From: Juri Linkov <juri@jurta.org>
To: Stefan Monnier <monnier@IRO.UMontreal.CA>
Cc: emacs-devel@gnu.org
Subject: Re: isearch in Dired
Date: Wed, 30 Jul 2008 17:29:42 +0300 [thread overview]
Message-ID: <877ib3cund.fsf@jurta.org> (raw)
In-Reply-To: <jwvhca8y3qi.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Tue, 29 Jul 2008 13:56:14 -0400")
>> I see that it is better to implement this in isearch.el to toggle the effect
>> of the variable `isearch-success-function' but for a general solution we need
>> a general function name for the letter "f". It seems a good name is "field"
>
> I think the key to use should be chosen by the client package
> (e.g. dired in this case), so that the key can be a menmonic for its
> functionality (rather than for its implementation technique).
Ok, this is implemented by the patch below:
Index: lisp/dired-aux.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/dired-aux.el,v
retrieving revision 1.176
diff -c -r1.176 dired-aux.el
*** lisp/dired-aux.el 30 Jul 2008 14:18:04 -0000 1.176
--- lisp/dired-aux.el 30 Jul 2008 14:27:08 -0000
***************
*** 2310,2320 ****
--- 2321,2346 ----
(defvar dired-isearch-orig-success-function nil)
+ (defun dired-isearch-filenames-toggle ()
+ "Toggle file names searching on or off.
+ When on, Isearch checks the success of the current matching point
+ using the function `dired-isearch-success-function' that matches only
+ at file names. When off, it uses the default function
+ `isearch-success-function-default'."
+ (interactive)
+ (setq isearch-success-function
+ (if (eq isearch-success-function 'dired-isearch-success-function)
+ 'isearch-success-function-default
+ 'dired-isearch-success-function))
+ (setq isearch-success t isearch-adjusted t)
+ (isearch-update))
+
;;;###autoload
(defun dired-isearch-filenames-setup ()
"Set up isearch to search in Dired file names.
Intended to be added to `isearch-mode-hook'."
(when dired-isearch-filenames
+ (define-key isearch-mode-map "\M-sf" 'dired-isearch-filenames-toggle)
(setq dired-isearch-orig-success-function
(default-value 'isearch-success-function))
(setq-default isearch-success-function 'dired-isearch-success-function)
***************
*** 2322,2327 ****
--- 2348,2354 ----
(defun dired-isearch-filenames-end ()
"Clean up the Dired file name search after terminating isearch."
+ (define-key isearch-mode-map "\M-sf" nil)
(setq-default isearch-success-function dired-isearch-orig-success-function)
(remove-hook 'isearch-mode-end-hook 'dired-isearch-filenames-end t))
--
Juri Linkov
http://www.jurta.org/emacs/
next prev parent reply other threads:[~2008-07-30 14:29 UTC|newest]
Thread overview: 79+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-08 3:05 propose: dired-isearch.el --- isearch in Dired William Xu
2007-08-08 3:47 ` Levin
2007-08-08 5:29 ` William Xu
2007-08-08 8:12 ` Herbert Euler
2007-08-08 8:16 ` Miles Bader
2007-08-08 9:35 ` William Xu
2007-08-08 13:01 ` Stefan Monnier
2007-08-09 2:45 ` Miles Bader
2007-08-08 18:46 ` Stefan Monnier
2007-08-08 22:54 ` Juri Linkov
2008-07-23 20:34 ` Juri Linkov
2008-07-24 6:41 ` Mathias Dahl
2008-07-25 0:32 ` Juri Linkov
2008-07-24 13:53 ` Stefan Monnier
2008-07-24 15:52 ` Drew Adams
2008-07-24 17:20 ` Stefan Monnier
2008-07-24 17:31 ` dired-details status [was: isearch in Dired] Drew Adams
2008-07-25 0:33 ` isearch in Dired Juri Linkov
2008-07-25 0:40 ` Lennart Borgman (gmail)
2008-07-29 15:44 ` word search (Re: isearch in Dired) Juri Linkov
2008-07-29 17:22 ` Chong Yidong
2008-07-30 16:50 ` Juri Linkov
2008-07-31 12:35 ` Juri Linkov
2008-07-31 14:10 ` Stefan Monnier
2008-07-31 15:16 ` Juri Linkov
2008-07-31 16:30 ` Stefan Monnier
2008-07-31 15:24 ` Stefan Monnier
2008-07-29 15:45 ` isearch in Dired Juri Linkov
2008-07-29 17:56 ` Stefan Monnier
2008-07-30 14:29 ` Juri Linkov [this message]
2007-08-09 2:46 ` propose: dired-isearch.el --- " William Xu
2007-08-09 0:06 ` Richard Stallman
2007-08-09 1:53 ` William Xu
2007-08-09 23:11 ` Richard Stallman
2007-08-10 1:42 ` William Xu
2007-08-10 8:37 ` Mathias Dahl
2007-08-10 9:22 ` David Kastrup
2007-08-10 15:56 ` Drew Adams
2007-08-11 10:52 ` William Xu
2007-08-11 15:15 ` Drew Adams
2007-08-11 16:58 ` Robert J. Chassell
2007-08-12 1:02 ` Drew Adams
2007-08-12 20:46 ` Juri Linkov
2007-08-12 21:43 ` Drew Adams
2007-08-12 23:23 ` Juri Linkov
2007-08-13 9:14 ` Mathias Megyei
2007-08-13 9:24 ` Andreas Schwab
2007-08-13 13:09 ` Mathias Dahl
2007-08-09 16:07 ` Drew Adams
2007-08-09 2:37 ` Herbert Euler
-- strict thread matches above, loose matches on Subject: below --
2008-11-08 9:56 Isearch in dired Richard M. Stallman
2008-11-08 10:59 ` Juri Linkov
2008-11-08 11:33 ` Lennart Borgman
2008-11-08 12:23 ` Alan Mackenzie
2008-11-08 15:22 ` Lennart Borgman
2008-11-08 17:07 ` Juri Linkov
2008-11-09 0:26 ` Richard M. Stallman
2008-11-09 21:57 ` Juri Linkov
2008-11-08 12:19 ` Alan Mackenzie
2008-11-08 17:08 ` Juri Linkov
2008-11-08 14:10 ` Chong Yidong
2008-11-08 16:05 ` joakim
2008-11-08 17:27 ` Juri Linkov
2008-11-08 17:17 ` Juri Linkov
2008-11-09 0:26 ` Richard M. Stallman
2008-11-09 14:22 ` Chong Yidong
2008-11-09 15:08 ` Stefan Monnier
2008-11-09 17:59 ` Juri Linkov
2008-11-11 22:55 ` Chong Yidong
2008-11-12 2:59 ` Stefan Monnier
2008-11-12 11:59 ` René Kyllingstad
2008-11-12 15:13 ` Drew Adams
2008-11-12 15:53 ` Richard M. Stallman
2008-11-12 7:55 ` Juri Linkov
2008-11-12 15:08 ` Chong Yidong
2008-11-13 16:57 ` Juri Linkov
2008-11-16 22:22 ` Juri Linkov
2008-11-10 3:11 ` Richard M. Stallman
2008-11-11 21:35 ` Juri Linkov
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=877ib3cund.fsf@jurta.org \
--to=juri@jurta.org \
--cc=emacs-devel@gnu.org \
--cc=monnier@IRO.UMontreal.CA \
/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).