From: Stefan Monnier <monnier@iro.umontreal.ca>
To: "Rüdiger Sonderfeld" <ruediger@c-plusplus.de>
Cc: Leo Liu <sdl.web@gmail.com>, emacs-devel@gnu.org
Subject: Re: [PATCH 2/3] octave.el: Add `octave-apropos' function.
Date: Fri, 27 Sep 2013 20:31:19 -0400 [thread overview]
Message-ID: <jwvy56hvlgq.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <2808254.TOFES3Zzvm@descartes> ("Rüdiger Sonderfeld"'s message of "Fri, 27 Sep 2013 15:11:28 +0200")
> It searches help strings ("lookfor") of octave functions.
Looks good overall. See comments below.
> + (let ((lines inferior-octave-output-list)
> + (inhibit-read-only t))
> + (when (string-match "error: \\(.*\\)$" (car lines))
> + (error "%s" (match-string 1 (car lines))))
> + (with-help-window octave-help-buffer
> + (princ (mapconcat 'identity lines "\n"))
> + (with-current-buffer octave-help-buffer
> + ;; Bound to t so that `help-buffer' returns current buffer for
> + ;; `help-setup-xref'.
> + (let ((help-xref-following t))
> + (help-setup-xref (list 'octave-apropos str all)
> + (called-interactively-p 'interactive)))
> + (goto-char (point-min))
> + (while (re-search-forward "^\\([^[:blank:]]+\\) " nil 'noerror)
> + (make-text-button (match-beginning 1) (match-end 1)
> + :type 'octave-help-function))
> + (octave-help-mode)))))
Please move the inhibit-read-only binding closer to the actual
buffer modifications. Especially, binding it in one buffer to then
use it in another is a very bad idea.
Stefan
next prev parent reply other threads:[~2013-09-28 0:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-27 13:11 [PATCH 2/3] octave.el: Add `octave-apropos' function Rüdiger Sonderfeld
2013-09-28 0:31 ` Stefan Monnier [this message]
2013-09-28 2:32 ` Leo Liu
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=jwvy56hvlgq.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=emacs-devel@gnu.org \
--cc=ruediger@c-plusplus.de \
--cc=sdl.web@gmail.com \
/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.