[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: propose: dired-isearch.el --- isearch in Dired
From: |
Stefan Monnier |
Subject: |
Re: propose: dired-isearch.el --- isearch in Dired |
Date: |
Wed, 08 Aug 2007 14:46:09 -0400 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux) |
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))
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?
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.
-- Stefan
PS: The above pieces of code are all guaranteed 100% untested.
- propose: dired-isearch.el --- isearch in Dired, William Xu, 2007/08/07
- Re: propose: dired-isearch.el --- isearch in Dired, Levin, 2007/08/07
- Re: propose: dired-isearch.el --- isearch in Dired, Miles Bader, 2007/08/08
- Re: propose: dired-isearch.el --- isearch in Dired,
Stefan Monnier <=
- Re: propose: dired-isearch.el --- isearch in Dired, Richard Stallman, 2007/08/08
- Re: propose: dired-isearch.el --- isearch in Dired, William Xu, 2007/08/08
- Re: propose: dired-isearch.el --- isearch in Dired, Richard Stallman, 2007/08/09
- Re: propose: dired-isearch.el --- isearch in Dired, William Xu, 2007/08/09
- Re: propose: dired-isearch.el --- isearch in Dired, Mathias Dahl, 2007/08/10
- Re: propose: dired-isearch.el --- isearch in Dired, David Kastrup, 2007/08/10
- RE: propose: dired-isearch.el --- isearch in Dired, Drew Adams, 2007/08/10
- Re: propose: dired-isearch.el --- isearch in Dired, William Xu, 2007/08/11