GNU bug report logs - #25190
Initialization of `dired-mode-map' in by the `dired-x' feature is not safe

Previous Next

Package: emacs;

Reported by: Alexander Shukaev <emacs <at> Alexander.Shukaev.name>

Date: Tue, 13 Dec 2016 00:53:02 UTC

Severity: minor

Tags: fixed

Fixed in version 27.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Alexander Shukaev <emacs <at> Alexander.Shukaev.name>
Cc: 25190 <at> debbugs.gnu.org
Subject: bug#25190: Initialization of `dired-mode-map' in by the `dired-x' feature is not safe
Date: Wed, 09 Oct 2019 09:41:02 +0200
Alexander Shukaev <emacs <at> Alexander.Shukaev.name> writes:

> consider the two
>
> ;;; KEY BINDINGS.
>
> (define-key dired-mode-map "\C-x\M-o" 'dired-omit-mode)
> (define-key dired-mode-map "*O" 'dired-mark-omitted)

[...]

> sections.  Both can easily fail.  For instance,
>
> (define-key dired-mode-map "%Y" 'dired-do-relsymlink-regexp)
>
> assumes that the "%" prefix command has been defined in
> `dired-mode-map' which is not at all true for any customization.  The 
> `easy-menu-add-item' calls suffers from similar issue.  It should be
> possible to conditionally disable these code sections or even remove 
> them altogether as they are maldesigned.

I've now added some checks to Emacs 27 to ensure that dired-x doesn't
try to define keys in sub-keymaps that doesn't exist.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




This bug report was last modified 5 years and 288 days ago.

Previous Next


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