help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

lambda an (interactive) function but not a command


From: Emanuel Berg
Subject: lambda an (interactive) function but not a command
Date: Tue, 19 Mar 2019 01:27:06 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]