From unknown Sun Aug 10 00:25:54 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#15701 <15701@debbugs.gnu.org> To: bug#15701 <15701@debbugs.gnu.org> Subject: Status: [PATCH] octave-mode: Handle empty lookfor result. Reply-To: bug#15701 <15701@debbugs.gnu.org> Date: Sun, 10 Aug 2025 07:25:54 +0000 retitle 15701 [PATCH] octave-mode: Handle empty lookfor result. reassign 15701 emacs submitter 15701 R=C3=BCdiger Sonderfeld severity 15701 normal tag 15701 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 24 13:16:25 2013 Received: (at submit) by debbugs.gnu.org; 24 Oct 2013 17:16:25 +0000 Received: from localhost ([127.0.0.1]:41488 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VZOWH-0004LY-9R for submit@debbugs.gnu.org; Thu, 24 Oct 2013 13:16:25 -0400 Received: from eggs.gnu.org ([208.118.235.92]:38304) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VZOFv-0003tv-I3 for submit@debbugs.gnu.org; Thu, 24 Oct 2013 12:59:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VZOFj-00054K-Cq for submit@debbugs.gnu.org; Thu, 24 Oct 2013 12:59:26 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:47319) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VZOFj-00054G-AL for submit@debbugs.gnu.org; Thu, 24 Oct 2013 12:59:19 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39974) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VZOFd-0008Qm-A2 for bug-gnu-emacs@gnu.org; Thu, 24 Oct 2013 12:59:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VZOFW-0004yH-31 for bug-gnu-emacs@gnu.org; Thu, 24 Oct 2013 12:59:13 -0400 Received: from ptmx.org ([178.63.28.110]:33670) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VZOFV-0004xu-TK for bug-gnu-emacs@gnu.org; Thu, 24 Oct 2013 12:59:06 -0400 Received: from localhost (localhost [127.0.0.1]) by ptmx.org (Postfix) with ESMTP id 1B7C02B13F; Thu, 24 Oct 2013 18:59:04 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at ptmx.org Received: from ptmx.org ([127.0.0.1]) by localhost (ptmx.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mVFC2xqUtfxO; Thu, 24 Oct 2013 18:59:02 +0200 (CEST) Received: from descartes.localnet (chello080108246092.7.14.vie.surfer.at [80.108.246.92]) by ptmx.org (Postfix) with ESMTPSA id D10432130F; Thu, 24 Oct 2013 18:59:01 +0200 (CEST) From: =?ISO-8859-1?Q?R=FCdiger?= Sonderfeld To: bug-gnu-emacs@gnu.org Subject: [PATCH] octave-mode: Handle empty lookfor result. Date: Thu, 24 Oct 2013 18:58:53 +0200 Message-ID: <1836189.W366bmrAnb@descartes> User-Agent: KMail/4.11.2 (Linux/3.11.0-12-generic; KDE/4.11.2; x86_64; ; ) MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Thu, 24 Oct 2013 13:16:23 -0400 Cc: Leo Liu X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) * lisp/progmodes/octave.el (octave-lookfor): Handle empty lookfor result. Ask user to retry using '-all' flag. Signed-off-by: R=C3=BCdiger Sonderfeld --- lisp/progmodes/octave.el | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/lisp/progmodes/octave.el b/lisp/progmodes/octave.el index 899bf15..1803ea6 100644 --- a/lisp/progmodes/octave.el +++ b/lisp/progmodes/octave.el @@ -1724,20 +1724,32 @@ (defun octave-lookfor (str &optional all) (if all "'-all', " "") str))) (let ((lines inferior-octave-output-list)) - (when (string-match "error: \\(.*\\)$" (car lines)) + (when (and (stringp (car lines)) + (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 + (if lines + (insert (mapconcat 'identity lines "\n")) + (insert (format "Nothing found for \"%s\".\n" str))) ;; Bound to t so that `help-buffer' returns current buffer for= ;; `help-setup-xref'. (let ((help-xref-following t)) (help-setup-xref (list 'octave-lookfor 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)) + (when lines + (while (re-search-forward "^\\([^[:blank:]]+\\) " nil 'noerr= or) + (make-text-button (match-beginning 1) (match-end 1) + :type 'octave-help-function))) + (unless all + (goto-char (point-max)) + (insert "\nRetry with ") + (insert-text-button "'-all'" + 'follow-link t + 'action #'(lambda (b) + (octave-lookfor str '-all)))= + (insert ".\n")) (octave-help-mode))))) =20 (defcustom octave-source-directories nil --=20 1.8.4 From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 24 20:51:24 2013 Received: (at 15701-done) by debbugs.gnu.org; 25 Oct 2013 00:51:24 +0000 Received: from localhost ([127.0.0.1]:42173 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VZVca-0000D3-8b for submit@debbugs.gnu.org; Thu, 24 Oct 2013 20:51:24 -0400 Received: from mail-pd0-f179.google.com ([209.85.192.179]:45202) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VZVcX-0000Cp-Hd for 15701-done@debbugs.gnu.org; Thu, 24 Oct 2013 20:51:21 -0400 Received: by mail-pd0-f179.google.com with SMTP id y10so3235017pdj.10 for <15701-done@debbugs.gnu.org>; Thu, 24 Oct 2013 17:51:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:face:date:in-reply-to:message-id :user-agent:mime-version:content-type:content-transfer-encoding; bh=FswQFIq8Jz5+krELrsXaPDMObkR1cftHJ669B4c+oJg=; b=tosUGti/XTnPwzONOk5fS/F08CWHu7EwvoRnheqbW4EG0dZPtpMhybJ0DKWSUDFY8x iSmgrWBccvvmgSPA9bgIO8oq29+clInBWZcuQh6LSTYC9DBWpxK0A/zXblubfxdnpXv8 KXku/CXC91KRpeYk0FyYeX1osS7aTSGEgfmGxRbFgukQcIIdw8IWySDibbqLUfcFLGL8 wAnMZa7LBX38uKcdHp0U6QvQwJiEBe9NH4pXxiJNvdDVaK/JIE/ud8x4gP4Wt+ScOwWW 3qusPt75ai3YgWqaObjBqWGLklxIaSOnPcXlRnnUmvzxfDnRn4MgJ+aaicm3sVoPVEJm BKEA== X-Received: by 10.66.65.195 with SMTP id z3mr6366361pas.47.1382662275538; Thu, 24 Oct 2013 17:51:15 -0700 (PDT) Received: from localhost ([221.222.146.138]) by mx.google.com with ESMTPSA id y9sm8680379pas.10.2013.10.24.17.51.13 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 Oct 2013 17:51:14 -0700 (PDT) From: Leo Liu To: =?iso-8859-1?Q?R=FCdiger?= Sonderfeld Subject: Re: bug#15701: [PATCH] octave-mode: Handle empty lookfor result. References: <1836189.W366bmrAnb@descartes> Face: iVBORw0KGgoAAAANSUhEUgAAACgAAAAoAgMAAADxkFD+AAAADFBMVEUvT09qWs3/pQD///+J kUVcAAAAAWJLR0QAiAUdSAAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9cBBwMLOd3veKQA AACuSURBVBjTldE9CgIxEAXgB+lEyFUC2wo5ikdZ8DSypxhMY7H9VuIVwlqkGRgnm59VsHGafIQ3 CZlAtmKIRaHETgYa12lqvEsPYKf8wXHsPGfqPaUM0g9aJPKFXkmNQmSDqwzz4Fpgpz+6WAPY2z5o uPJJpu0uypcl4nyCibMLQ8lCiVjayLoQvw5LsVKQuHPRR958HZbOcVsKeepcLxpByjycGvnKmY+c MBvrtyjfe0vmuLvdq/kAAAAASUVORK5CYII= Date: Fri, 25 Oct 2013 08:51:08 +0800 In-Reply-To: <1836189.W366bmrAnb@descartes> (=?iso-8859-1?Q?=22R=FCdiger?= Sonderfeld"'s message of "Thu, 24 Oct 2013 18:58:53 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (OS X 10.9) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 15701-done Cc: 15701-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) On 2013-10-25 00:58 +0800, R=FCdiger Sonderfeld wrote: > * lisp/progmodes/octave.el (octave-lookfor): Handle empty lookfor > result. Ask user to retry using '-all' flag. Committed with thanks. Leo From unknown Sun Aug 10 00:25:54 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 22 Nov 2013 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator