[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Type Ahead Find
From: |
Juri Linkov |
Subject: |
Re: Type Ahead Find |
Date: |
Sun, 20 Mar 2005 22:22:35 +0200 |
User-agent: |
Gnus/5.110002 (No Gnus v0.2) Emacs/22.0.50 (gnu/linux) |
Juri Linkov <address@hidden> writes:
> (set (make-local-variable 'isearch-success-function)
> ;; isearch only in function names
> (lambda ()
> (save-match-data
> (let* ((re (cdr (assoc nil imenu-generic-expression))))
> (and (save-excursion (beginning-of-line) (looking-at (car re)))
> (>= (point) (match-beginning (cadr re)))
> (<= (point) (match-end (cadr re))))))))
I noticed that `(point)' is not a reliable indicator to find
a matching point. It seems better to give two arguments
(match-beginning 0) and (match-end 0) to `isearch-success-function'.
So a correct example would be:
(set (make-local-variable 'isearch-success-function)
;; isearch only in function names
(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))))))))
--
Juri Linkov
http://www.jurta.org/emacs/
- Re: Type Ahead Find, (continued)
- Re: Type Ahead Find, Stefan Monnier, 2005/03/18
- Re: Type Ahead Find, Juri Linkov, 2005/03/19
- Re: Type Ahead Find, Miles Bader, 2005/03/19
- Re: Type Ahead Find, David Kastrup, 2005/03/19
- Re: Type Ahead Find, Miles Bader, 2005/03/19
- Re: Type Ahead Find, Juri Linkov, 2005/03/20
- Re: Type Ahead Find, David Kastrup, 2005/03/20
- Re: Type Ahead Find, Miles Bader, 2005/03/20
- Re: Type Ahead Find, Juri Linkov, 2005/03/21
- Re: Type Ahead Find, Juri Linkov, 2005/03/20
- Re: Type Ahead Find,
Juri Linkov <=
Re: Type Ahead Find, Richard Stallman, 2005/03/19