[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/3] octave.el: Add `octave-apropos' function.
From: |
Stefan Monnier |
Subject: |
Re: [PATCH 2/3] octave.el: Add `octave-apropos' function. |
Date: |
Fri, 27 Sep 2013 20:31:19 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
> 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