all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alex Branham <alex.branham@gmail.com>
To: Stefan Monnier <monnier@IRO.UMontreal.CA>
Cc: 30452@debbugs.gnu.org
Subject: bug#30452: [PATCH] Use 'make-sparse-keymap' rather than 'copy-keymap'
Date: Mon, 21 Jan 2019 09:53:29 -0600	[thread overview]
Message-ID: <877eeyc8hy.fsf@gmail.com> (raw)
In-Reply-To: <jwvsgxobr4t.fsf-monnier+emacsbugs@gnu.org>


On Sat 19 Jan 2019 at 09:33, Stefan Monnier <monnier@IRO.UMontreal.CA> wrote:

>>>  (defvar tabulated-list-mode-map
>>> -  (let ((map (copy-keymap special-mode-map)))
>>> +  (let ((map (make-sparse-keymap)))
>>>      (set-keymap-parent map button-buffer-map)
>
> Nowadays we can inherit from both with something like
>
>     (set-keymap-parent map (make-composed-keymap
>                             button-buffer-map
>                             special-mode-map))

Thanks, that's better! Here's the updated patch.

Alex

From 6c21fb2434fa9f0499ebff5beabdbfda7b03f534 Mon Sep 17 00:00:00 2001
From: Alex Branham <alex.branham@gmail.com>
Date: Mon, 21 Jan 2019 09:50:11 -0600
Subject: [PATCH] Make tabulated-list-mode-map inherit from special-mode-map

* lisp/emacs-lisp/tabulated-list.el (tabulated-list-mode-map): Use
  'make-composed-keymap'.

Bug #30452
---
 lisp/emacs-lisp/tabulated-list.el | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lisp/emacs-lisp/tabulated-list.el b/lisp/emacs-lisp/tabulated-list.el
index 6fdca2cd08..12d0151d67 100644
--- a/lisp/emacs-lisp/tabulated-list.el
+++ b/lisp/emacs-lisp/tabulated-list.el
@@ -151,8 +151,10 @@ If ADVANCE is non-nil, move forward by one line afterwards."
       (forward-line)))
 
 (defvar tabulated-list-mode-map
-  (let ((map (copy-keymap special-mode-map)))
-    (set-keymap-parent map button-buffer-map)
+  (let ((map (make-sparse-keymap)))
+    (set-keymap-parent map (make-composed-keymap
+                            button-buffer-map
+                            special-mode-map))
     (define-key map "n" 'next-line)
     (define-key map "p" 'previous-line)
     (define-key map "S" 'tabulated-list-sort)
-- 
2.19.2







  reply	other threads:[~2019-01-21 15:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-14  3:52 bug#30452: 25.3; tabulated-list-mode-map should inherit from special-mode-map Stephen Jung
2019-01-15 17:57 ` bug#30452: [PATCH] Use 'make-sparse-keymap' rather than 'copy-keymap' Alex Branham
2019-01-19  8:05   ` Eli Zaretskii
2019-01-19 15:33     ` Stefan Monnier
2019-01-21 15:53       ` Alex Branham [this message]
2019-01-25  8:50         ` Eli Zaretskii

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877eeyc8hy.fsf@gmail.com \
    --to=alex.branham@gmail.com \
    --cc=30452@debbugs.gnu.org \
    --cc=monnier@IRO.UMontreal.CA \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.