From: Emanuel Berg <incal@dataswamp.org>
To: help-gnu-emacs@gnu.org
Subject: Re: Problem with search-forward in *Help* buffers
Date: Sat, 26 Nov 2022 06:03:59 +0100 [thread overview]
Message-ID: <87sfi69uio.fsf@dataswamp.org> (raw)
In-Reply-To: CADs++6gDQkpjBB-Vi2wn_oJjvDOKKzaSDu12+OXYp4qGCaK4PA@mail.gmail.com
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
prev parent reply other threads:[~2022-11-26 5:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-26 4:08 Problem with search-forward in *Help* buffers Eduardo Ochs
2022-11-26 5:03 ` Emanuel Berg [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87sfi69uio.fsf@dataswamp.org \
--to=incal@dataswamp.org \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.