From: Shynur Xie <one.last.kiss@outlook.com>
To: "help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>
Subject: Documentation of ‘define-alternatives’
Date: Mon, 14 Aug 2023 12:34:42 +0000 [thread overview]
Message-ID: <PH0PR11MB747098E8A0E76646D8B740EAD717A@PH0PR11MB7470.namprd11.prod.outlook.com> (raw)
Hi friends, I’m reading (elisp) 22.2.5 Select among Command
Alternatives. It’s a little difficult for me understand it:
> contain an alist with alternative implementations
What does it mean by ‘implementation’? An expression?
> If customizations is non-nil, it should consist of ... and values
> to add to the declaration of command-alternatives.
How to include the ‘values’?
I tried:
- evaluate:
(define-alternatives your/generic-cmd-1)
(setq your/generic-cmd-1-alternatives '((1 . (ignore))))
;; Or the reverse order.
then type ‘M-x your/generic-cmd-1 <return> <tab>’.
Got ‘no match’
- evaluate:
(define-alternatives your/generic-cmd-2
'(1 . (ignore))
'(2 . (ignore)))
Got error.
IMHO, section 22.2.5 needs an example or more readable or clear
description for ‘define-alternatives’.
next reply other threads:[~2023-08-14 12:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-14 12:34 Shynur Xie [this message]
2023-08-14 18:00 ` Documentation of ‘define-alternatives’ Eli Zaretskii
-- strict thread matches above, loose matches on Subject: below --
2023-08-15 10:16 Shynur Xie
2023-08-15 12:53 ` Eli Zaretskii
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=PH0PR11MB747098E8A0E76646D8B740EAD717A@PH0PR11MB7470.namprd11.prod.outlook.com \
--to=one.last.kiss@outlook.com \
--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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.