unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* lambda an (interactive) function but not a command
@ 2019-03-19  0:27 Emanuel Berg
  2019-03-19  1:17 ` Michael Heerdegen
  0 siblings, 1 reply; 8+ messages in thread
From: Emanuel Berg @ 2019-03-19  0:27 UTC (permalink / raw)
  To: help-gnu-emacs

In my config file for the Gnus summary
buffer [1] I have this [2]. What I wonder is,
for the "F" key to invoke the
`gnus-summary-followup-inline' function, for
such a simple one-liner, why can't one use
a lambda for that, i.e.

    (lambda (interactive) (gnus-summary-mail-forward 4))

?

Only then I get the error

    (wrong-type-argument commandp ...

Is it because the whole thing is based on
names, and a lambda by definition doesn't have
a name, and so it can just be an
anonymous *function*, not an "anonymous
command" if you will?

TIA


[1] line 72 @ http://user.it.uu.se/~embe8573/emacs-init/gnus/summary.el

[2]

(defun gnus-summary-followup-inline ()
  (interactive)
  (gnus-summary-mail-forward 4) )

;;; KEYS

(let ((the-map gnus-summary-mode-map))
    (disable-super-global-keys the-map)
    (set-vertical-keys         the-map)
    ;; group
    (define-key the-map  "o"  #'gnus-summary-insert-old-articles)
    (define-key the-map  "w"  #'gnus-summary-exit-and-update-group)
    ;; reply
    (define-key the-map  "r"  #'gnus-summary-followup-with-original)
    (define-key the-map  "R"  #'gnus-summary-reply-with-original)
    ;; message
    (define-key the-map  "d"  #'gnus-summary-delete-article)
    (define-key the-map  "D"  #'gnus-summary-mark-as-dormant)
    (define-key the-map  "D"  #'gnus-summary-mark-as-dormant)
    (define-key the-map  "f"  #'gnus-article-fill-cited-article)
    (define-key the-map  "F"  #'gnus-summary-followup-inline)
    (define-key the-map  "U"  #'gnus-summary-uncool-subject)
    (define-key the-map  "z"  #'gnus-score-edit-current-scores)
    (define-key the-map "\r"  #'gnus-summary-show-article)
    ;; mark
    (define-key the-map  "l"  #'gnus-summary-put-mark-as-unread-next)
    (define-key the-map  "s"  #'gnus-summary-mark-as-read-forward)
    )

-- 
underground experts united
http://user.it.uu.se/~embe8573




^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-03-19 14:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-19  0:27 lambda an (interactive) function but not a command Emanuel Berg
2019-03-19  1:17 ` Michael Heerdegen
2019-03-19  1:29   ` Emanuel Berg
2019-03-19  1:38     ` Amin Bandali
2019-03-19  1:39     ` Michael Heerdegen
2019-03-19  2:03       ` Emanuel Berg
2019-03-19  2:49         ` quoting lambdas (was: Re: lambda an (interactive) function but not a command) Emanuel Berg
2019-03-19 14:15           ` quoting lambdas Michael Heerdegen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).