From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [PATCH 2/3] octave.el: Add `octave-apropos' function. Date: Fri, 27 Sep 2013 20:31:19 -0400 Message-ID: References: <2808254.TOFES3Zzvm@descartes> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1380328298 14235 80.91.229.3 (28 Sep 2013 00:31:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 28 Sep 2013 00:31:38 +0000 (UTC) Cc: Leo Liu , emacs-devel@gnu.org To: =?windows-1252?Q?R=FCdiger?= Sonderfeld Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Sep 28 02:31:40 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VPiRg-00046a-45 for ged-emacs-devel@m.gmane.org; Sat, 28 Sep 2013 02:31:40 +0200 Original-Received: from localhost ([::1]:39066 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VPiRf-00006e-GQ for ged-emacs-devel@m.gmane.org; Fri, 27 Sep 2013 20:31:39 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40396) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VPiRU-00006Z-Oc for emacs-devel@gnu.org; Fri, 27 Sep 2013 20:31:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VPiRN-00059d-Fk for emacs-devel@gnu.org; Fri, 27 Sep 2013 20:31:28 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:9527) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VPiRM-00058m-TX for emacs-devel@gnu.org; Fri, 27 Sep 2013 20:31:21 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EABK/CFG4rw/I/2dsb2JhbAA7Cb8OF3OCHgEBBAFWIwULCzQSFBgNJIgeBsEtjRaDdAOkeoFegxM X-IPAS-Result: Av4EABK/CFG4rw/I/2dsb2JhbAA7Cb8OF3OCHgEBBAFWIwULCzQSFBgNJIgeBsEtjRaDdAOkeoFegxM X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="29277190" Original-Received: from 184-175-15-200.dsl.teksavvy.com (HELO pastel.home) ([184.175.15.200]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 27 Sep 2013 20:28:16 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 9B61F631A0; Fri, 27 Sep 2013 20:31:19 -0400 (EDT) In-Reply-To: <2808254.TOFES3Zzvm@descartes> (=?windows-1252?Q?=22R=FCdiger?= Sonderfeld"'s message of "Fri, 27 Sep 2013 15:11:28 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.182 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:163692 Archived-At: > 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