GNU bug report logs -
#59224
29.0.50; Don't use defvar+make-sparse-keymap for example in docs
Previous Next
Reported by: Stefan Kangas <stefankangas <at> gmail.com>
Date: Sat, 12 Nov 2022 20:03:02 UTC
Severity: wishlist
Found in version 29.0.50
Fixed in version 29.2
Done: Stefan Kangas <stefankangas <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your message dated Sun, 10 Sep 2023 16:51:25 -0700
with message-id <CADwFkmnD9eW4Xibo_CanA7kw=FVTg2BOq4egmF=6vnpP=bem_w <at> mail.gmail.com>
and subject line Re: bug#59224: 29.0.50; Don't use defvar+make-sparse-keymap for example in docs
has caused the debbugs.gnu.org bug report #59224,
regarding 29.0.50; Don't use defvar+make-sparse-keymap for example in docs
to be marked as done.
(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)
--
59224: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=59224
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
Severity: wishlist
In (info "(elisp) Tips for Defining"), we have:
When defining and initializing a variable that holds a
complicated value (such as a keymap with bindings in it), it’s best
to put the entire computation of the value into the ‘defvar’, like
this:
(defvar my-mode-map
(let ((map (make-sparse-keymap)))
(keymap-set map "C-c C-a" 'my-command)
...
map)
DOCSTRING)
Could we use an example here that is not a keymap (which should be
defined using `defvar-keymap' these days)?
What would be a good example to use? `make-syntax-table'?
[Message part 3 (message/rfc822, inline)]
Version: 29.2
Stefan Kangas <stefankangas <at> gmail.com> writes:
> Severity: wishlist
>
> In (info "(elisp) Tips for Defining"), we have:
>
> When defining and initializing a variable that holds a
> complicated value (such as a keymap with bindings in it), it’s best
> to put the entire computation of the value into the ‘defvar’, like
> this:
>
> (defvar my-mode-map
> (let ((map (make-sparse-keymap)))
> (keymap-set map "C-c C-a" 'my-command)
> ...
> map)
> DOCSTRING)
>
> Could we use an example here that is not a keymap (which should be
> defined using `defvar-keymap' these days)?
>
> What would be a good example to use? `make-syntax-table'?
I've now changed this example to `make-syntax-table' on emacs-29.
If anyone can think of a better example, please speak up and we can
reopen the bug for further tweaking.
This bug report was last modified 1 year and 310 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.