From: Filipp Gunbin <fgunbin@fastmail.fm>
To: emacs-devel@gnu.org
Cc: juri@linkov.net
Subject: [patch, review request] better dired-isearch-filenames reset in dired-isearch-filenames-end
Date: Thu, 28 Nov 2019 17:13:08 +0300 [thread overview]
Message-ID: <m2imn4w0ln.fsf@fastmail.fm> (raw)
Current code calls custom-reevaluate-setting (bug#30187), and that
results in wrong value when dired-isearch-filenames was initialized not
with emacs customization facility, but with plain setq in .emacs. I
think a temporary local variable is a better way to save & restore the
global setting, WDYT? In my tests what worked well.
TIA.
Filipp
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index 4d7abd1ef6..fb1ad6266d 100644
--- a/lisp/dired-aux.el
+++ b/lisp/dired-aux.el
@@ -2876,7 +2876,7 @@ dired-isearch-filenames-end
(dired-isearch-filenames-mode -1)
(remove-hook 'isearch-mode-end-hook #'dired-isearch-filenames-end t)
(unless isearch-suspended
- (custom-reevaluate-setting 'dired-isearch-filenames)))
+ (kill-local-variable 'dired-isearch-filenames)))
(defun dired-isearch-filter-filenames (beg end)
"Test whether some part of the current search match is inside a file name.
@@ -2889,14 +2889,14 @@ dired-isearch-filter-filenames
(defun dired-isearch-filenames ()
"Search for a string using Isearch only in file names in the Dired buffer."
(interactive)
- (setq dired-isearch-filenames t)
+ (set (make-local-variable 'dired-isearch-filenames) t)
(isearch-forward nil t))
;;;###autoload
(defun dired-isearch-filenames-regexp ()
"Search for a regexp using Isearch only in file names in the Dired buffer."
(interactive)
- (setq dired-isearch-filenames t)
+ (set (make-local-variable 'dired-isearch-filenames) t)
(isearch-forward-regexp nil t))
\f
next reply other threads:[~2019-11-28 14:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-28 14:13 Filipp Gunbin [this message]
2019-11-28 16:07 ` [patch, review request] better dired-isearch-filenames reset in dired-isearch-filenames-end Stefan Monnier
2019-11-28 22:00 ` Filipp Gunbin
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m2imn4w0ln.fsf@fastmail.fm \
--to=fgunbin@fastmail.fm \
--cc=emacs-devel@gnu.org \
--cc=juri@linkov.net \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).