Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lambda expression as suffix command results in "Warning: (lambda nil \...) quoted with ' rather than with #'" #256

Closed
gusbrs opened this issue Sep 7, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@gusbrs
Copy link

gusbrs commented Sep 7, 2023

The use of a lambda expression as suffix command for transient results in Warning: (lambda nil \...) quoted with ' rather than with #'.

Regarding instructions, I've installed the package to the latest version available in gnu-elpa-dev, namely 0.4.3.0.20230903.183543 (before doing so, I was using the built-in version in Emacs 29.1), and restarted Emacs.

To reproduce, start emacs -Q, setup:

(add-to-list 'load-path "~/.emacs.d/elpa/transient-0.4.3.0.20230903.183543")
(add-to-list 'load-path "~/.emacs.d/elpa/compat-29.1.4.2")
(require 'transient)
(setq debug-on-message "quoted with")

Then eval (taken from https://github.com/positron-solutions/transient-showcase#running-examples-in-org-mode, but that's just an example):

(transient-define-prefix tsc-hello ()
  "Prefix that is minimal and uses an anonymous command suffix."
  [("s" "call suffix"
    (lambda ()
      (interactive)
      (message "Called a suffix")))])

The warning in the messages buffer is:

Warning: (lambda nil \...) quoted with ' rather than with #'

And the resulting backtrace:

Debugger entered--Lisp error: "Warning: (lambda nil \\...) quoted with ' rather th..."
  macroexp-warn-and-return("(lambda nil \\...) quoted with ' rather than with #..." '(lambda nil (interactive) (message "Called a suffix")) nil nil (lambda nil (interactive) (message "Called a suffix")))
  macroexp--expand-all((defalias 'transient:tsc-hello:call\ suffix '(lambda nil (interactive) (message "Called a suffix"))))
  macroexp--all-forms((prog1 'transient:tsc-hello:call\ suffix (put 'transient:tsc-hello:call\ suffix 'interactive-only t) (put 'transient:tsc-hello:call\ suffix 'command-modes (list 'not-a-mode)) (defalias 'transient:tsc-hello:call\ suffix '(lambda nil (interactive) (message "Called a suffix")))) 1)
  macroexp--expand-all((prog1 'transient:tsc-hello:call\ suffix (put 'transient:tsc-hello:call\ suffix 'interactive-only t) (put 'transient:tsc-hello:call\ suffix 'command-modes (list 'not-a-mode)) (defalias 'transient:tsc-hello:call\ suffix '(lambda nil (interactive) (message "Called a suffix")))))
  macroexp--all-forms((list :key "s" :description "call suffix" :command (prog1 'transient:tsc-hello:call\ suffix (put 'transient:tsc-hello:call\ suffix 'interactive-only t) (put 'transient:tsc-hello:call\ suffix 'command-modes (list 'not-a-mode)) (defalias 'transient:tsc-hello:call\ suffix '(lambda nil (interactive) (message "Called a suffix"))))) 1)
  macroexp--expand-all((list :key "s" :description "call suffix" :command (prog1 'transient:tsc-hello:call\ suffix (put 'transient:tsc-hello:call\ suffix 'interactive-only t) (put 'transient:tsc-hello:call\ suffix 'command-modes (list 'not-a-mode)) (defalias 'transient:tsc-hello:call\ suffix '(lambda nil (interactive) (message "Called a suffix"))))))
  macroexp--all-forms((list 1 'transient-suffix (list :key "s" :description "call suffix" :command (prog1 'transient:tsc-hello:call\ suffix (put 'transient:tsc-hello:call\ suffix 'interactive-only t) (put 'transient:tsc-hello:call\ suffix 'command-modes (list 'not-a-mode)) (defalias 'transient:tsc-hello:call\ suffix '(lambda nil (interactive) (message "Called a suffix")))))) 1)
  macroexp--expand-all((list 1 'transient-suffix (list :key "s" :description "call suffix" :command (prog1 'transient:tsc-hello:call\ suffix (put 'transient:tsc-hello:call\ suffix 'interactive-only t) (put 'transient:tsc-hello:call\ suffix 'command-modes (list 'not-a-mode)) (defalias 'transient:tsc-hello:call\ suffix '(lambda nil (interactive) (message "Called a suffix")))))))
  macroexp--all-forms((list (list 1 'transient-suffix (list :key "s" :description "call suffix" :command (prog1 'transient:tsc-hello:call\ suffix (put 'transient:tsc-hello:call\ suffix 'interactive-only t) (put 'transient:tsc-hello:call\ suffix 'command-modes (list 'not-a-mode)) (defalias 'transient:tsc-hello:call\ suffix '(lambda nil ... ...)))))) 1)
  macroexp--expand-all((list (list 1 'transient-suffix (list :key "s" :description "call suffix" :command (prog1 'transient:tsc-hello:call\ suffix (put 'transient:tsc-hello:call\ suffix 'interactive-only t) (put 'transient:tsc-hello:call\ suffix 'command-modes (list 'not-a-mode)) (defalias 'transient:tsc-hello:call\ suffix '(lambda nil ... ...)))))))
  macroexp--all-forms((vector 1 'transient-column nil (list (list 1 'transient-suffix (list :key "s" :description "call suffix" :command (prog1 'transient:tsc-hello:call\ suffix (put 'transient:tsc-hello:call\ suffix 'interactive-only t) (put 'transient:tsc-hello:call\ suffix 'command-modes (list ...)) (defalias 'transient:tsc-hello:call\ suffix '...)))))) 1)
  macroexp--expand-all((vector 1 'transient-column nil (list (list 1 'transient-suffix (list :key "s" :description "call suffix" :command (prog1 'transient:tsc-hello:call\ suffix (put 'transient:tsc-hello:call\ suffix 'interactive-only t) (put 'transient:tsc-hello:call\ suffix 'command-modes (list ...)) (defalias 'transient:tsc-hello:call\ suffix '...)))))))
  macroexp--all-forms((list (vector 1 'transient-column nil (list (list 1 'transient-suffix (list :key "s" :description "call suffix" :command (prog1 'transient:tsc-hello:call\ suffix (put ... ... t) (put ... ... ...) (defalias ... ...))))))) 1)
  macroexp--expand-all((list (vector 1 'transient-column nil (list (list 1 'transient-suffix (list :key "s" :description "call suffix" :command (prog1 'transient:tsc-hello:call\ suffix (put ... ... t) (put ... ... ...) (defalias ... ...))))))))
  macroexp--all-forms((put 'tsc-hello 'transient--layout (list (vector 1 'transient-column nil (list (list 1 'transient-suffix (list :key "s" :description "call suffix" :command (prog1 ... ... ... ...))))))) 1)
  macroexp--expand-all((put 'tsc-hello 'transient--layout (list (vector 1 'transient-column nil (list (list 1 'transient-suffix (list :key "s" :description "call suffix" :command (prog1 ... ... ... ...))))))))
  macroexp--all-forms((progn (defalias 'tsc-hello (lambda nil (interactive) (transient-setup 'tsc-hello))) (put 'tsc-hello 'interactive-only t) (put 'tsc-hello 'function-documentation "Prefix that is minimal and uses an anonymous comma...") (put 'tsc-hello 'transient--prefix (transient-prefix :command 'tsc-hello)) (put 'tsc-hello 'transient--layout (list (vector 1 'transient-column nil (list (list 1 'transient-suffix (list :key "s" :description "call suffix" :command ...))))))) 1)
  macroexp--expand-all((progn (defalias 'tsc-hello (lambda nil (interactive) (transient-setup 'tsc-hello))) (put 'tsc-hello 'interactive-only t) (put 'tsc-hello 'function-documentation "Prefix that is minimal and uses an anonymous comma...") (put 'tsc-hello 'transient--prefix (transient-prefix :command 'tsc-hello)) (put 'tsc-hello 'transient--layout (list (vector 1 'transient-column nil (list (list 1 'transient-suffix (list :key "s" :description "call suffix" :command ...))))))))
  macroexp--all-forms((progn (progn (defalias 'tsc-hello (lambda nil (interactive) (transient-setup 'tsc-hello))) (put 'tsc-hello 'interactive-only t) (put 'tsc-hello 'function-documentation "Prefix that is minimal and uses an anonymous comma...") (put 'tsc-hello 'transient--prefix (transient-prefix :command 'tsc-hello)) (put 'tsc-hello 'transient--layout (list (vector 1 'transient-column nil (list (list 1 ... ...))))))) 1)
  macroexp--expand-all((progn (progn (defalias 'tsc-hello (lambda nil (interactive) (transient-setup 'tsc-hello))) (put 'tsc-hello 'interactive-only t) (put 'tsc-hello 'function-documentation "Prefix that is minimal and uses an anonymous comma...") (put 'tsc-hello 'transient--prefix (transient-prefix :command 'tsc-hello)) (put 'tsc-hello 'transient--layout (list (vector 1 'transient-column nil (list (list 1 ... ...))))))))
  macroexpand-all((progn (progn (defalias 'tsc-hello (lambda nil (interactive) (transient-setup 'tsc-hello))) (put 'tsc-hello 'interactive-only t) (put 'tsc-hello 'function-documentation "Prefix that is minimal and uses an anonymous comma...") (put 'tsc-hello 'transient--prefix (transient-prefix :command 'tsc-hello)) (put 'tsc-hello 'transient--layout (list (vector 1 'transient-column nil (list (list 1 ... ...))))))))
  elisp--eval-last-sexp(nil)
  eval-last-sexp(nil)
  funcall-interactively(eval-last-sexp nil)
  command-execute(eval-last-sexp)
@tarsius tarsius closed this as completed in dd970cd Sep 7, 2023
@tarsius
Copy link
Member

tarsius commented Sep 7, 2023

Thanks for the report!

@gusbrs
Copy link
Author

gusbrs commented Sep 7, 2023

Wow, that was lightning fast! Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants