unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Zhu Zihao" <all_but_last@163.com>
To: "Lars Ingebrigtsen" <larsi@gnus.org>
Cc: 44328@debbugs.gnu.org
Subject: bug#44328: Re: bug#44328: 27.1; [PATCH] Add expand-abbrev-maybe condition key binding
Date: Mon, 2 Nov 2020 13:41:37 +0800 (CST)	[thread overview]
Message-ID: <33826ad9.44e2.1758779a4c1.Coremail.all_but_last@163.com> (raw)
In-Reply-To: <87v9ep9msu.fsf@gnus.org>

[-- Attachment #1: Type: text/plain, Size: 1371 bytes --]

Actually, it's a menu-item definition, described in https://www.gnu.org/software/emacs/manual/html_node/elisp/Extended-Menu-Items.html



It can be bound to a keymap and use it like key bindings, it also support some dynamic features which normal keybinding can't do, according to manual.


















At 2020-11-01 22:25:21, "Lars Ingebrigtsen" <larsi@gnus.org> wrote:
>Zhu Zihao <all_but_last@163.com> writes:
>
>> +@vindex expand-abbrev-maybe
>> +  If you don't want to check expand for every @code{self-insert-command}
>> +like Abbrev mode. There's a variable describing a conditional key definition
>> +You can bind it to some key like @kbd{TAB}. It' ll expand abbrev if
>> +there's some abbrev at point, and act like usual @kbd{TAB} if there's not.
>
>[...]
>
>> +(defconst expand-abbrev-maybe
>> +  '(menu-item "" expand-abbrev
>> +    :filter (lambda (cmd) (and (abbrev--before-point) cmd)))
>> +  "A conditional key definition for `expand-abbrev'.
>> +When this was bound, it will expand abbrev at point if there're any possible
>> +abbrev.")
>
>I'm afraid I don't understand the meaning of this constant, or what this
>is trying to achieve.  You talk about adding a new key binding, which
>should presumably refer to a new command (i.e. function)?
>
>-- 
>(domestic pets only, the antidote for overdose, milk.)
>   bloggy blog: http://lars.ingebrigtsen.no

[-- Attachment #2: Type: text/html, Size: 1919 bytes --]

  reply	other threads:[~2020-11-02  5:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-30 14:32 bug#44328: 27.1; [PATCH] Add expand-abbrev-maybe condition key binding Zhu Zihao
2020-11-01 14:25 ` Lars Ingebrigtsen
2020-11-02  5:41   ` Zhu Zihao [this message]
2020-11-02 15:30     ` Lars Ingebrigtsen
2020-11-03  4:40       ` Zhu Zihao
2021-05-13 11:25         ` Lars Ingebrigtsen

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=33826ad9.44e2.1758779a4c1.Coremail.all_but_last@163.com \
    --to=all_but_last@163.com \
    --cc=44328@debbugs.gnu.org \
    --cc=larsi@gnus.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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).