unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Emanuel Berg <moasenwood@zoho.eu>
To: help-gnu-emacs@gnu.org
Subject: lambda an (interactive) function but not a command
Date: Tue, 19 Mar 2019 01:27:06 +0100	[thread overview]
Message-ID: <86k1gvemjp.fsf@zoho.eu> (raw)

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	other threads:[~2019-03-19  0:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-19  0:27 Emanuel Berg [this message]
2019-03-19  1:17 ` lambda an (interactive) function but not a command 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86k1gvemjp.fsf@zoho.eu \
    --to=moasenwood@zoho.eu \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).