GNU bug report logs - #44328
27.1; [PATCH] Add expand-abbrev-maybe condition key binding

Previous Next

Package: emacs;

Reported by: Zhu Zihao <all_but_last <at> 163.com>

Date: Fri, 30 Oct 2020 14:49:02 UTC

Severity: normal

Tags: patch, wontfix

Found in version 27.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 44328 <at> debbugs.gnu.org (full text, mbox):

From: "Zhu Zihao" <all_but_last <at> 163.com>
To: "Lars Ingebrigtsen" <larsi <at> gnus.org>
Cc: 44328 <at> debbugs.gnu.org
Subject: Re:Re: bug#44328: 27.1; [PATCH] Add expand-abbrev-maybe condition
 key binding
Date: Mon, 2 Nov 2020 13:41:37 +0800 (CST)
[Message part 1 (text/plain, inline)]
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 <at> gnus.org> wrote:
>Zhu Zihao <all_but_last <at> 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
[Message part 2 (text/html, inline)]

This bug report was last modified 4 years and 12 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.