[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[h-e-w] Re: way for jumping between next/previous highlighted positions
From: |
Mathias Dahl |
Subject: |
[h-e-w] Re: way for jumping between next/previous highlighted positions |
Date: |
Tue, 11 Jul 2006 15:21:31 +0200 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (windows-nt) |
"lalit mohan tripathi" <address@hidden> writes:
> i am very new to emacs. I use hi-lock-mode to highlight some words
> in a big buffer, How can i directly jump to next/previous
> highlighted position other than scrolling buffer?
> thanks in advance.
> genvia
What about something like this:
(defun hi-lock-goto-next-highlight ()
"Go to char where next hilight is.
Search for the next property change where the `hi-lock-overlay'
property is set."
(interactive)
(let (found next overlays)
(while (and (not (eobp))
(not found))
(setq next (next-overlay-change (point)))
(when (not (eq next (point-max)))
(setq overlays (overlays-at next))
(if (and overlays (not found))
(if (not (overlay-get (car overlays) 'hi-lock-overlay))
(setq overlays (cdr overlays))
(goto-char next)
(setq found t))
(forward-char 1))))))
I seldom use hi-lock so I was surprised to find that no such command
already existed. Or does it?
/Mathias