[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#74999: [PATCH v3] Recommend `keymap-set' instead of `define-key' in
From: |
Hong Xu |
Subject: |
bug#74999: [PATCH v3] Recommend `keymap-set' instead of `define-key' in emacs lisp intro |
Date: |
Thu, 26 Dec 2024 13:58:33 -0800 |
User-agent: |
mu4e 1.12.8; emacs 29.4 |
Thanks for reviewing. Please see my followup patch.
On 2024-12-26 Thu 00:20 GMT-08, Eli Zaretskii <eliz@gnu.org> wrote:
>> From: Hong Xu <hong@topbug.net>
>> Date: Sat, 21 Dec 2024 00:03:54 -0800
>>
>> * Since `define-key' is considered legacy and we encourage `keymap-set'
>> now.
>> ---
>> doc/lispintro/emacs-lisp-intro.texi | 25 ++++++++++++++++++-------
>> 1 file changed, 18 insertions(+), 7 deletions(-)
>
> Thanks. I tried to install this, but the git-commit hook rejected the
> commit because Subject line is too long:
>
> Line longer than 78 characters in commit message
> Commit aborted; please see the file CONTRIBUTE
>
> Please format the patch using "git format-patch", and please commit
> the patch locally before you do so (assuming you have the hooks in
> your local clone), to make sure these problems are corrected before
> you send the patch here.
I could apply these patches without line length complaints, and the
hooks were in effect. An inspection into the patch file also shows no
line is longer than 78 characters. Git is supposed to abandon the
"[Patch vN]" prefix when applying the patch.
> More generally, global-set-key, discussed earlier in this section, is
> also obsolete, and we nowadays prefer keymap-global-set instead. So,
> if we want to modernize this part of the Emacs Lisp Intro manual, I
> think we should replace all the key-binding examples and the
> surrounding text in the manual to use the new keymap-* functions. It
> makes little sense to replace only define-key and leave the rest as
> they were.
>
> Would you like to submit a patch that takes care of these issues in a
> more thorough manner?
Addressed.
>
>> +While you are encouraged to use @code{keymap-set}, you likely would
>> +encounter @code{define-key} in various places. Historically, keymaps
>> +are bound using a lower-level function, @code{define-key}, which
>> +is now considered legacy.
>
> These two sentences should be in reverse order: first tell that
> historically we used define-key, then say that the reader is
> encouraged to use keymap-set.
>
Addressed.
- bug#74999: [PATCH v2] Recommend `keymap-set' instead of `define-key' in emacs lisp intro, (continued)
- bug#74999: [PATCH v3] Recommend `keymap-set' instead of `define-key' in emacs lisp intro, Eli Zaretskii, 2024/12/26
- bug#74999: [PATCH v4] Use `keymap*-set' over `global-set-key'/`define-key' in elisp intro, Hong Xu, 2024/12/26
- bug#74999: [PATCH v4] Use `keymap*-set' over `global-set-key'/`define-key' in elisp intro, Hong Xu, 2024/12/26
- bug#74999: [PATCH v4] Use `keymap*-set' over `global-set-key'/`define-key' in elisp intro, Eli Zaretskii, 2024/12/27
- bug#74999: [PATCH v4] Use `keymap*-set' over `global-set-key'/`define-key' in elisp intro, Eli Zaretskii, 2024/12/28
- bug#74999: [PATCH v4] Use `keymap*-set' over `global-set-key'/`define-key' in elisp intro, Hong Xu, 2024/12/28
- bug#74999: [PATCH v3] Recommend `keymap-set' instead of `define-key' in emacs lisp intro,
Hong Xu <=
- bug#74999: [PATCH v3] Recommend `keymap-set' instead of `define-key' in emacs lisp intro, Eli Zaretskii, 2024/12/27
- bug#74999: [PATCH v2] Recommend `keymap-set' instead of `define-key' in emacs lisp intro, Hong Xu, 2024/12/21
bug#74983: [PATCH] Use `keymap-set' instead of `define-key' in emacs lisp intro, Drew Adams, 2024/12/20
bug#74983: [PATCH] Use `keymap-set' instead of `define-key' in emacs lisp intro, Hong Xu, 2024/12/20