[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problem with search-forward in *Help* buffers
From: |
Emanuel Berg |
Subject: |
Re: Problem with search-forward in *Help* buffers |
Date: |
Sat, 26 Nov 2022 06:03:59 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Eduardo Ochs wrote:
> ;; This is a simplified version of:
> ;; (find-efunction 'ee-goto-position)
> ;; http://angg.twu.net/eev-current/eev-blinks.el.html#ee-goto-position
> (defun ee-goto-position-mini (&optional str &rest strs)
> (when str
> (goto-char (point-min))
> (search-forward str)
> (dolist (s strs)
> (search-forward s))))
You can simplify even further with just (&rest strs) since
that is optional in its own way with nil/the empty list ...
> ;; This is a simplified version of:
> ;; (find-efunction 'find-dbsw-call)
> ;; http://angg.twu.net/eev-current/eev-blinks.el.html#find-dbsw
> (defun find-dbsw-call-mini (sexp &rest pos-spec-list)
> (let ((display-buffer-overriding-action '(display-buffer-same-window)))
> (eval sexp))
> (apply 'ee-goto-position-mini pos-spec-list))
Why `apply'?
> and searches for the first occurrence of the string "Parent"
> in it. But in the other ones the search doesn't work - after
> the (find-dbsw-call-mini ...) is run the point is elsewhere.
> What is happening here? And do you have any suggestions of
> how to fix that?
You must do something like
(progn
(describe-function #'next-line)
(with-current-buffer (help-buffer)
(search-forward "line-move-visual") ))
--
underground experts united
https://dataswamp.org/~incal