GNU bug report logs - #59224
29.0.50; Don't use defvar+make-sparse-keymap for example in docs

Previous Next

Package: emacs;

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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 59224 in the body.
You can then email your comments to 59224 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to larsi <at> gnus.org, bug-gnu-emacs <at> gnu.org:
bug#59224; Package emacs. (Sat, 12 Nov 2022 20:03:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefan Kangas <stefankangas <at> gmail.com>:
New bug report received and forwarded. Copy sent to larsi <at> gnus.org, bug-gnu-emacs <at> gnu.org. (Sat, 12 Nov 2022 20:03:02 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefankangas <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.0.50; Don't use defvar+make-sparse-keymap for example in docs
Date: Sat, 12 Nov 2022 12:02:31 -0800
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'?




Reply sent to Stefan Kangas <stefankangas <at> gmail.com>:
You have taken responsibility. (Sun, 10 Sep 2023 23:52:01 GMT) Full text and rfc822 format available.

Notification sent to Stefan Kangas <stefankangas <at> gmail.com>:
bug acknowledged by developer. (Sun, 10 Sep 2023 23:52:02 GMT) Full text and rfc822 format available.

Message #10 received at 59224-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: 59224-done <at> debbugs.gnu.org
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>
Subject: Re: bug#59224: 29.0.50; Don't use defvar+make-sparse-keymap for
 example in docs
Date: Sun, 10 Sep 2023 16:51:25 -0700
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.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 09 Oct 2023 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 193 days ago.

Previous Next


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