all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: William Xu <william.xwl@gmail.com>, emacs-devel@gnu.org
Subject: Re: propose: dired-isearch.el --- isearch in Dired
Date: Thu, 09 Aug 2007 01:54:38 +0300	[thread overview]
Message-ID: <87lkclekep.fsf@jurta.org> (raw)
In-Reply-To: <jwvejidg9ix.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Wed\, 08 Aug 2007 14\:46\:09 -0400")

I think using isearch in Dired to match only at filenames is a very good idea.

> Actually all the search funs can be collapsed into one:
>
>    (defun dired-isearch-search-fun-function () 'dired-isearch-search)
>
>    (defun dired-isearch-search (&rest args)
>      (let ((fun (let ((isearch-search-fun-function nil))
>                   (isearch-search-fun)))
>            ret)
>        (while (and (setq ret (apply fun args))
>                    ;; Use `help-echo' instead of `dired-filename' so as to
>                    ;; also work in Tramp dired buffers.
>                    (not (get-text-property (1- point) 'help-echo)))
>          (forward-char 1))
>        ret))

With patches (uninstalled due to feature freeze) from the thread
http://lists.gnu.org/archive/html/emacs-devel/2005-03/msg00785.html
this implementation can be collapsed even more:

    (set (make-local-variable 'isearch-success-function)
         (lambda () (get-text-property (1- point) 'help-echo)))

or with a new function `dired-pos-in-filename-p':

    (set (make-local-variable 'isearch-success-function)
         'dired-pos-in-filename-p)

> But there are two problems left:
> 1 - find a UI for it: just providing N new commands doesn't seem good enough.
>     Maybe just something like:
>
>     (define-minor-mode dired-isearch-filenames-mode
>       "Only match filenames in isearch."
>       (if dired-isearch-filenames-mode
>           (set (make-local-variable 'isearch-search-fun-function)
>                'dired-isearch-search-fun-function)
>         (kill-local-variable 'isearch-search-fun-function)))
>
>     and then bind it to a key?

And to use the same key to activate other links-only searches like on
links in Info (filenames in dired buffers are links too).

> 2 - checking `help-echo' is bound to get us into trouble when we add
>     help-echo to other elements such as access right bits, etc...
>     We really should check `dired-filename'.  And if that doesn't work,
>     let's fix it so that it does.  And/or add a dired-pos-in-filename-p
>     predicate to abstract over it.

-- 
Juri Linkov
http://www.jurta.org/emacs/

  reply	other threads:[~2007-08-08 22:54 UTC|newest]

Thread overview: 50+ 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 [this message]
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
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

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lkclekep.fsf@jurta.org \
    --to=juri@jurta.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=william.xwl@gmail.com \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.