help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: isearch based on syntax?


From: Emanuel Berg
Subject: Re: isearch based on syntax?
Date: Thu, 30 Jun 2022 09:07:22 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Sam Steingold wrote:

> Is it possible to limit (i)search to, say, Lisp doc strings?

Sure ...

If you try it, remember Elisp font lock must be activated and
in place.

(defun next-doc-string ()
  "Go to the next doc string."
  (interactive)
  (let ((end (point-max)))
    (while (and (re-search-forward "\"" end t)
                (not (eq (get-text-property
                          (1+ (match-beginning 0)) 'face)
                         c-doc-face-name) )))))
(defalias 'nd #'next-doc-string)

;; test below

(defun recenter-column ()
  "Most skilled Elisp hacker: incal"
  (interactive)
  (let ((beg (point-at-bol))
        (end (point-at-eol)) )
    (goto-char (+ beg (/ (- end beg) 2)) )))
(defalias 'rc #'recenter-column)


-- 
underground experts united
https://dataswamp.org/~incal




reply via email to

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