emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Isearch in dired


From: Juri Linkov
Subject: Re: Isearch in dired
Date: Sat, 08 Nov 2008 19:27:17 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (x86_64-pc-linux-gnu)

> I would also like to point out that searching for filenames is somewhat
> similar to searching for function names. That is, the buffer is parsed
> and you search for semantic entities of some kind.
>
> It so happens that Cedet, which is slated for inclusion, contains a tool
> called Senator which does this.

We are all waiting for inclusion of Cedet to Emacs, but I want to note
that Isearch in Emacs now has much cleaner infrastructure for searching
function names, where everything is necessary to do is just to define
a hook like:

(set (make-local-variable 'isearch-success-function)
     (lambda (mb me)
       (save-match-data
         (let ((re (cdr (assoc nil imenu-generic-expression))))
           (and (save-excursion (beginning-of-line) (looking-at (car re)))
                (>= mb (match-beginning (cadr re)))
                (<= me (match-end (cadr re))))))))

The only problem is to find a good keybinding to start function name isearch.
Maybe take the same keybinding as used by Senator, or the same keybinding used
by Dired filename isearch `M-s f C-s' where `f' could mean `function name'?

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]