From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alexander Shukaev Newsgroups: gmane.emacs.bugs Subject: bug#25190: Initialization of `dired-mode-map' in by the `dired-x' feature is not safe Date: Tue, 13 Dec 2016 01:52:31 +0100 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1481590400 4936 195.159.176.226 (13 Dec 2016 00:53:20 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 13 Dec 2016 00:53:20 +0000 (UTC) To: 25190@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Dec 13 01:53:14 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cGbLC-0008Rd-Vn for geb-bug-gnu-emacs@m.gmane.org; Tue, 13 Dec 2016 01:53:11 +0100 Original-Received: from localhost ([::1]:34608 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cGbLG-0004RO-Rd for geb-bug-gnu-emacs@m.gmane.org; Mon, 12 Dec 2016 19:53:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40559) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cGbL7-0004R8-Px for bug-gnu-emacs@gnu.org; Mon, 12 Dec 2016 19:53:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cGbL4-0002PX-Jp for bug-gnu-emacs@gnu.org; Mon, 12 Dec 2016 19:53:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:52633) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cGbL4-0002PT-Fs for bug-gnu-emacs@gnu.org; Mon, 12 Dec 2016 19:53:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cGbL4-00005U-7a for bug-gnu-emacs@gnu.org; Mon, 12 Dec 2016 19:53:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alexander Shukaev Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 13 Dec 2016 00:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 25190 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.1481590368303 (code B ref -1); Tue, 13 Dec 2016 00:53:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 13 Dec 2016 00:52:48 +0000 Original-Received: from localhost ([127.0.0.1]:39799 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cGbKp-0008WU-Vb for submit@debbugs.gnu.org; Mon, 12 Dec 2016 19:52:48 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:49564) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cGbKo-0008WH-K3 for submit@debbugs.gnu.org; Mon, 12 Dec 2016 19:52:46 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cGbKi-0002O1-Kd for submit@debbugs.gnu.org; Mon, 12 Dec 2016 19:52:41 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:50979) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cGbKi-0002Nx-Hd for submit@debbugs.gnu.org; Mon, 12 Dec 2016 19:52:40 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40535) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cGbKh-0004Q0-C2 for bug-gnu-emacs@gnu.org; Mon, 12 Dec 2016 19:52:40 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cGbKe-0002NX-8L for bug-gnu-emacs@gnu.org; Mon, 12 Dec 2016 19:52:39 -0500 Original-Received: from relay6-d.mail.gandi.net ([2001:4b98:c:538::198]:55352) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cGbKd-0002NH-Uj for bug-gnu-emacs@gnu.org; Mon, 12 Dec 2016 19:52:36 -0500 Original-Received: from mfilter10-d.gandi.net (mfilter10-d.gandi.net [217.70.178.139]) by relay6-d.mail.gandi.net (Postfix) with ESMTP id A22C4FB883 for ; Tue, 13 Dec 2016 01:52:33 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mfilter10-d.gandi.net Original-Received: from relay6-d.mail.gandi.net ([IPv6:::ffff:217.70.183.198]) by mfilter10-d.gandi.net (mfilter10-d.gandi.net [::ffff:10.0.15.180]) (amavisd-new, port 10024) with ESMTP id Rp07QhxYiEAP for ; Tue, 13 Dec 2016 01:52:32 +0100 (CET) X-Originating-IP: 88.68.181.111 Original-Received: from [192.168.3.110] (dslb-088-068-181-111.088.068.pools.vodafone-ip.de [88.68.181.111]) (Authenticated sender: forum@alexander.shukaev.name) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 35442FB87D for ; Tue, 13 Dec 2016 01:52:32 +0100 (CET) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:126945 Archived-At: Hi, 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) (define-key dired-mode-map "\M-(" 'dired-mark-sexp) (define-key dired-mode-map "*(" 'dired-mark-sexp) (define-key dired-mode-map "*." 'dired-mark-extension) (define-key dired-mode-map "\M-!" 'dired-smart-shell-command) (define-key dired-mode-map "\M-G" 'dired-goto-subdir) (define-key dired-mode-map "F" 'dired-do-find-marked-files) (define-key dired-mode-map "Y" 'dired-do-relsymlink) (define-key dired-mode-map "%Y" 'dired-do-relsymlink-regexp) (define-key dired-mode-map "V" 'dired-do-run-mail) ;;; MENU BINDINGS (require 'easymenu) (let ((menu (lookup-key dired-mode-map [menu-bar]))) (easy-menu-add-item menu '("Operate") ["Find Files" dired-do-find-marked-files :help "Find current or marked files"] "Shell Command...") (easy-menu-add-item menu '("Operate") ["Relative Symlink to..." dired-do-relsymlink :visible (fboundp 'make-symbolic-link) :help "Make relative symbolic links for current or \ marked files"] "Hardlink to...") (easy-menu-add-item menu '("Mark") ["Flag Extension..." dired-flag-extension :help "Flag files with a certain extension for deletion"] "Mark Executables") (easy-menu-add-item menu '("Mark") ["Mark Extension..." dired-mark-extension :help "Mark files with a certain extension"] "Unmark All") (easy-menu-add-item menu '("Mark") ["Mark Omitted" dired-mark-omitted :help "Mark files matching `dired-omit-files' \ and `dired-omit-extensions'"] "Unmark All") (easy-menu-add-item menu '("Regexp") ["Relative Symlink..." dired-do-relsymlink-regexp :visible (fboundp 'make-symbolic-link) :help "Make relative symbolic links for files \ matching regexp"] "Hardlink...") (easy-menu-add-item menu '("Immediate") ["Omit Mode" dired-omit-mode :style toggle :selected dired-omit-mode :help "Enable or disable omitting \"uninteresting\" \ files"] "Refresh")) 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. Looking forward to fix. P.S. Just a side question: why `dired-x' is not yet merged into `dired'? IMO, makes no sense to maintain separate extension packages of the main package when they are already built-in anyway. Regards, Alexander