Subject: bug#30452: [PATCH] Use 'make-sparse-keymap' rather than 'copy-keymap'

From: Eli Zaretskii <[email-masked]>
Date: Sat, 19 Jan 2019 10:05:17 +0200

> From: Alex Branham <[email-masked]>
> Date: Tue, 15 Jan 2019 11:57:52 -0600
> 
> Here's a tiny patch that changes the call from copy-keymap to make-sparse-keymap.
> 
> Thanks,
> Alex
> 
> >From c7f6db630f720fd26f0f1cc45631326bdcec136c Mon Sep 17 00:00:00 2001
> From: Alex Branham <[email-masked]>
> Date: Tue, 15 Jan 2019 11:50:55 -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-sparse-keymap' rather than copying 'special-mode-map'.
> 
> Bug #30452

Maybe I'm missing something, but I thought the original bug report
said it should inherit from special-mode's keymap?  Your patch doesn't
seem to be doing that, or did I miss something?

More generally, I wonder why we don't say in the ELisp manual that a
derived mode should do this with its keymap.  Should we?

Thanks.

>  lisp/emacs-lisp/tabulated-list.el | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lisp/emacs-lisp/tabulated-list.el b/lisp/emacs-lisp/tabulated-list.el
> index 6fdca2cd08..8c99728fd4 100644
> --- a/lisp/emacs-lisp/tabulated-list.el
> +++ b/lisp/emacs-lisp/tabulated-list.el
> @@ -151,7 +151,7 @@ tabulated-list-put-tag
>        (forward-line)))
>  
>  (defvar tabulated-list-mode-map
> -  (let ((map (copy-keymap special-mode-map)))
> +  (let ((map (make-sparse-keymap)))
>      (set-keymap-parent map button-buffer-map)
>      (define-key map "n" 'next-line)
>      (define-key map "p" 'previous-line)
> -- 
> 2.19.2