"lalit mohan tripathi" <[EMAIL PROTECTED]> 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



Reply via email to