screenshot icon indicating copy to clipboard operation
screenshot copied to clipboard

transient-setup: No key for screenshot--set-line-numbers-p

Open shaunsingh opened this issue 2 years ago • 10 comments

Getting the above error after highlighting a region and doing M-x screenshot

shaunsingh avatar Sep 28 '21 23:09 shaunsingh

+1 . And I found out that it was caused by this commit: https://github.com/tecosaur/screenshot/commit/fdd1692a4c9cb0e616f9a5d264344f2803bec6b1

sdvcrx avatar Oct 19 '21 13:10 sdvcrx

Interesting, I'm not sure what's going on with that...

tecosaur avatar Oct 19 '21 13:10 tecosaur

~~yeah, same issue on my Nixos machine. Rolling back to f8204e82dc0c1158c401735d36a143e6f6d24cf5 solves the issue.~~

ztlevi avatar Oct 31 '21 23:10 ztlevi

Rolling back doesn't seem to fix it for me. From what I can tell, the issue is that the bytecompiled file isn't loaded, so all functions that are generated at compile time (such as screenshot--set-line-numbers-p) aren't found. (I really don't see why the above fix should work)

  • I've installed it using doom by adding (package! screenshot :recipe (:host github :repo "tecosaur/screenshot")) to $DOOMDIR/packages.el
  • I'm using Emacs with nativecomp enabled (now that I say it out loud, this could be a cause)
  • A fix that worked for me: Forcing emacs to load the byte-compiled file by including
(load-file (locate-library "screenshot.elc"))

in my $DOOMDIR/config.el

ctsk avatar Nov 16 '21 18:11 ctsk

Same here. Doom user.

Workaround: navigate to "screenshot.el" and eval-buffer.

yangsheng6810 avatar Nov 28 '21 10:11 yangsheng6810

+1. I'm using snapshot version of emacs

(load-file (locate-library "screenshot.elc")) doesn't fix error, but (load-file (locate-library "screenshot.el")) does

codewylle avatar Dec 01 '21 04:12 codewylle

Hopefully this little bit from Spacemacs report issue function can help.


Description :octocat:

Screenshot.el is broken. :eyes:

Reproduction guide :beetle:

  • Start Emacs
  • Install screenshot.el using Quelpa.
  • M-x screenshot

Observed behaviour: :eyes: :broken_heart: The title of this issue.

Expected behaviour: :heart: :smile: Beautiful screenshot.

System Info :computer:

  • OS: darwin
  • Emacs: 27.2
  • Spacemacs: 0.300.0
  • Spacemacs branch: develop (rev. 500335a2c)
  • Graphic display: t
  • Distribution: spacemacs
  • Editing style: vim
  • Completion: helm
  • Layers:
((python :variables python-backend 'anaconda)
 markdown html helm auto-completion better-defaults emacs-lisp
 (ess :variables ess-r-fetch-ESSR-on-remotes 't ess-r-backend 'lsp)
 themes-megapack git org)
  • System configuration features: NOTIFY KQUEUE ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS MODULES THREADS JSON PDUMPER GMP

Backtrace :paw_prints:

Debugger entered--Lisp error: (error "No key for screenshot--set-line-numbers-p")
  apply(debug (error (error "No key for screenshot--set-line-numbers-p")))
  transient--exit-and-debug(error (error "No key for screenshot--set-line-numbers-p"))
  signal(error ("No key for screenshot--set-line-numbers-p"))
  error("No key for %s" screenshot--set-line-numbers-p)
  #f(compiled-function (obj) #<bytecode 0x1ff8d8837049>)(#<transient-suffix transient-suffix-1ff8d7391128>)
  apply(#f(compiled-function (obj) #<bytecode 0x1ff8d8837049>) #<transient-suffix transient-suffix-1ff8d7391128> nil)
  transient--init-suffix-key(#<transient-suffix transient-suffix-1ff8d7391128>)
  transient--init-suffix(nil (1 transient-suffix (:command screenshot--set-line-numbers-p)))
  transient--init-child(nil (1 transient-suffix (:command screenshot--set-line-numbers-p)))
  #f(compiled-function (c) #<bytecode 0x1ff8d73910f1>)((1 transient-suffix (:command screenshot--set-line-numbers-p)))
  mapcan(#f(compiled-functi

eval-buffer on screenshot.el does work as reported here.

bryce-carson avatar Dec 06 '21 09:12 bryce-carson

this help me fix bug thanks @yangsheng6810

donneyluckS avatar Jan 06 '22 02:01 donneyluckS

Setting :build (:not compile) in the straight.el recipe seems to help with that

SqrtMinusOne avatar Jan 06 '22 21:01 SqrtMinusOne

^ the above solves this for me if anyone is wondering ... the line I have for Doom Emacs is (package! screenshot :recipe (:host github :repo "tecosaur/screenshot" :branch "master" :build (:not compile)))

zackteo avatar Jun 16 '22 04:06 zackteo

I'm think this has just been fixed by e7a8941d9ff2274c7f784c4d89c2ed4a70a45b0a (at long last!).

tecosaur avatar Oct 17 '22 17:10 tecosaur