From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#60815: 28.2; Hard-coded M-sff key binding in dired-aux.el Date: Sat, 14 Jan 2023 20:19:57 +0200 Organization: LINKOV.NET Message-ID: <868ri5yo4y.fsf@mail.linkov.net> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17972"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) Cc: 60815@debbugs.gnu.org To: Evgeni Pandurski Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jan 14 19:22:15 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pGlAU-0004Um-IU for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 14 Jan 2023 19:22:14 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pGlAJ-0005Ff-VF; Sat, 14 Jan 2023 13:22:03 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pGlAI-0005FS-3u for bug-gnu-emacs@gnu.org; Sat, 14 Jan 2023 13:22:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pGlAH-0001KL-SE for bug-gnu-emacs@gnu.org; Sat, 14 Jan 2023 13:22:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pGlAH-0005Gx-Jx for bug-gnu-emacs@gnu.org; Sat, 14 Jan 2023 13:22:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 14 Jan 2023 18:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60815 X-GNU-PR-Package: emacs Original-Received: via spool by 60815-submit@debbugs.gnu.org id=B60815.167372047920215 (code B ref 60815); Sat, 14 Jan 2023 18:22:01 +0000 Original-Received: (at 60815) by debbugs.gnu.org; 14 Jan 2023 18:21:19 +0000 Original-Received: from localhost ([127.0.0.1]:55524 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pGl9a-0005Fy-W7 for submit@debbugs.gnu.org; Sat, 14 Jan 2023 13:21:19 -0500 Original-Received: from relay8-d.mail.gandi.net ([217.70.183.201]:58685) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pGl9X-0005Fe-EC for 60815@debbugs.gnu.org; Sat, 14 Jan 2023 13:21:16 -0500 Original-Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 5D8EE1BF208; Sat, 14 Jan 2023 18:21:07 +0000 (UTC) In-Reply-To: (Evgeni Pandurski's message of "Sat, 14 Jan 2023 18:44:06 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:253380 Archived-At: > I have set "(dired-isearch-filenames t)", and have rebound "M-s" to > something that is not a keymap (other-window). The problem appears > when I try to "isearch" in a Dired buffer. Then the following code: > > (defun dired-isearch-filenames-end () > "Clean up the Dired file name search after terminating isearch." > (define-key isearch-mode-map "\M-sff" nil) > (dired-isearch-filenames-mode -1) > (remove-hook 'isearch-mode-end-hook #'dired-isearch-filenames-end t) > (unless isearch-suspended > (kill-local-variable 'dired-isearch-filenames))) > > runs and fails, because it can not bind to "M-sff". It works when I > change "M-sff" to something that starts with a keymap-binding. This is > also a problem in Emacs 27. Maybe it should be configurable: ``` diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index c390017e190..27ab35c04d2 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -3530,6 +3530,9 @@ dired-isearch-filenames-mode (setq isearch-success t isearch-adjusted t) (isearch-update))) +(defvar dired-isearch-filenames-toggle-key "\M-sff" + "Key to toggle `dired-isearch-filenames-setup' in `isearch-mode'.") + ;;;###autoload (defun dired-isearch-filenames-setup () "Set up isearch to search in Dired file names. @@ -3537,13 +3540,16 @@ dired-isearch-filenames-setup (when (or (eq dired-isearch-filenames t) (and (eq dired-isearch-filenames 'dwim) (get-text-property (point) 'dired-filename))) - (define-key isearch-mode-map "\M-sff" 'dired-isearch-filenames-mode) + (when dired-isearch-filenames-toggle-key + (define-key isearch-mode-map dired-isearch-filenames-toggle-key + 'dired-isearch-filenames-mode)) (dired-isearch-filenames-mode 1) (add-hook 'isearch-mode-end-hook #'dired-isearch-filenames-end nil t))) (defun dired-isearch-filenames-end () "Clean up the Dired file name search after terminating isearch." - (define-key isearch-mode-map "\M-sff" nil) + (when dired-isearch-filenames-toggle-key + (define-key isearch-mode-map dired-isearch-filenames-toggle-key nil)) (dired-isearch-filenames-mode -1) (remove-hook 'isearch-mode-end-hook #'dired-isearch-filenames-end t) (unless isearch-suspended ```