From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: npostavs@users.sourceforge.net Newsgroups: gmane.emacs.bugs Subject: bug#6106: 24.0.50; info.el adds 'search-failed to debug-ignored-errors Date: Sat, 01 Apr 2017 17:08:42 -0400 Message-ID: <87fuhr25ut.fsf@users.sourceforge.net> References: <87fw8bt721.fsf@mail.jurta.org> <87vaqz2umz.fsf@users.sourceforge.net> <87k2741bvk.fsf@users.sourceforge.net> <83vaqo43n7.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1491080898 5733 195.159.176.226 (1 Apr 2017 21:08:18 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 1 Apr 2017 21:08:18 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) Cc: mvoteiza@udel.edu, 6106@debbugs.gnu.org, eller.helmut@gmail.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Apr 01 23:08:12 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cuQFj-0000Ok-ML for geb-bug-gnu-emacs@m.gmane.org; Sat, 01 Apr 2017 23:08:07 +0200 Original-Received: from localhost ([::1]:52822 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cuQFp-0008CK-Op for geb-bug-gnu-emacs@m.gmane.org; Sat, 01 Apr 2017 17:08:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51478) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cuQFi-0008C4-PF for bug-gnu-emacs@gnu.org; Sat, 01 Apr 2017 17:08:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cuQFf-0005MA-Ho for bug-gnu-emacs@gnu.org; Sat, 01 Apr 2017 17:08:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:57793) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cuQFf-0005M2-Do for bug-gnu-emacs@gnu.org; Sat, 01 Apr 2017 17:08:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cuQFd-0001hN-M0 for bug-gnu-emacs@gnu.org; Sat, 01 Apr 2017 17:08:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 01 Apr 2017 21:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6106 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed patch Original-Received: via spool by 6106-submit@debbugs.gnu.org id=B6106.14910808476489 (code B ref 6106); Sat, 01 Apr 2017 21:08:01 +0000 Original-Received: (at 6106) by debbugs.gnu.org; 1 Apr 2017 21:07:27 +0000 Original-Received: from localhost ([127.0.0.1]:55992 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cuQF4-0001gb-OF for submit@debbugs.gnu.org; Sat, 01 Apr 2017 17:07:27 -0400 Original-Received: from mail-io0-f175.google.com ([209.85.223.175]:34424) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cuQF3-0001gO-CC for 6106@debbugs.gnu.org; Sat, 01 Apr 2017 17:07:25 -0400 Original-Received: by mail-io0-f175.google.com with SMTP id b140so57291671iof.1 for <6106@debbugs.gnu.org>; Sat, 01 Apr 2017 14:07:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=prL4jDUPOpDMZ1mPCaQXBjE1pGI00NMcOf9//fywfEM=; b=rGyBcM66OzMJMOnHT9va+mpl5jDdLLijU/4157ByVMRVUGVYbFLGTTURqwbn2thuiJ 8craai5GNzRqlI83feLsqUG1m3ZSBa+FgdTre87Rb9BaIxcH7k7t6FW/8DSdss6S0EVu ey0PcUDytoQVviUtvW5cocDOHpHzcR/J/OUMG3NMVK20RYcPP6fY309SCWfK1nw6WaFy 1gbxWjj7z1fCaJP+G3bBJ/mTyuKcHB9J3yfBODAQ2jLohlEQmps9Bnu5JMPtUyS3GnGQ x5fpd2GllwuZ9c6nQ2JlmhBcHEL8NQCSlsMjEaHimQp7zaJkD1cI8ano/0sceKKTAeqc cqpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=prL4jDUPOpDMZ1mPCaQXBjE1pGI00NMcOf9//fywfEM=; b=dUqGqb3/2Ub49Qhgjppsca6narEfobeDKtixC40/Q4Phrg/i9RnffuHHRtiyMFPP5L Kcn1UZnkFeo1cwqbv2Q+Ldcs1449qAdl+zhARdOss7ZDE/IUeUXKN158Svuav1uRZupd AyaZb4acnrD+XI4GwNIoAu1/say76aRNtpG1AHsjnYaCsKzZZe3f9X34AUsVEkjD9kA7 a44HuvXRn52/mg4b2KiQ3vHi9XTxQOo1yyzo6Y/WxD11Pbf3mNbKOkzLOXCuKpKhK3eG 9/HkNIuLJtL7qBpTV7FIazE2nZ5wtgd/P5wPYTCHMSI72GNfrHGkiXw5PMkI7sYZGmSX Gvkg== X-Gm-Message-State: AFeK/H1WrqruLJwAHBMn38o1Lhx/ROcEdxfWGzlQTvM2Mz7XAFQkC15iC6jhs3L0GeXgXw== X-Received: by 10.107.163.83 with SMTP id m80mr10551038ioe.74.1491080839814; Sat, 01 Apr 2017 14:07:19 -0700 (PDT) Original-Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id f196sm5583597itc.2.2017.04.01.14.07.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 01 Apr 2017 14:07:18 -0700 (PDT) In-Reply-To: <83vaqo43n7.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 01 Apr 2017 17:13:32 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:131181 Archived-At: --=-=-= Content-Type: text/plain Eli Zaretskii writes: > > Thanks. I think the symbol you are introducing and its plist should > be documented in the ELisp manual and mentioned in NEWS. I added it to `(elisp) Standard Errors' after `user-error'. Or should it go next to `search-failed'? It says the list is "grouped by concept" though it seems to be alphabetical. Mark Oteiza writes: > On 01/04/17 at 09:43am, npostavs@users.sourceforge.net wrote: >> npostavs@users.sourceforge.net writes: >> >> > (Info-select-node, Info-search): Replace (signal 'search-failed ...) >> > with (user-error "Search failed: "...). >> >> Turns out this breaks isearch over multiple nodes, as noted by Mark >> Oteiza in [1]. I believe this is fixed by the patch below. >> >> [1]: http://lists.gnu.org/archive/html/emacs-devel/2017-03/msg00869.html > > Thanks for addressing. I get the following with your patch: > > peculiar error: "cats", "(end of node)" Sorry, I messed up. I did an initial implementation using `define-error' in lisp, and I didn't retest after moving that part to C. Here's a corrected patch. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=v2-0001-Throw-a-search-failed-derived-error-in-Info-searc.patch Content-Description: patch >From bc0b21552dd782190662fe1fcbf7cd8197a7822e Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sat, 1 Apr 2017 09:34:04 -0400 Subject: [PATCH v2] Throw a `search-failed' derived error in Info search The original fix for Bug#6106 switched from signalling `search-failed' to `user-error'. However, this breaks incremental searching over multiple nodes because the isearch code doesn't expect a `user-error'. * src/search.c (syms_of_search): New error, `user-search-failed', with `user-error' and `search-failed' as parents. * doc/lispref/errors.texi (Standard Errors): Document it. * etc/NEWS: Announce it. * lisp/info.el (Info-search): Use it instead of `user-error' so that isearch will handle failed searches correctly. --- doc/lispref/errors.texi | 6 ++++++ etc/NEWS | 4 ++++ lisp/info.el | 12 ++++++------ src/search.c | 10 ++++++++++ 4 files changed, 26 insertions(+), 6 deletions(-) diff --git a/doc/lispref/errors.texi b/doc/lispref/errors.texi index 2ec1a108ea..1f67819c34 100644 --- a/doc/lispref/errors.texi +++ b/doc/lispref/errors.texi @@ -186,6 +186,12 @@ Standard Errors @item user-error The message is the empty string. @xref{Signaling Errors}. +@item user-search-failed +This is like @samp{search-failed}, but doesn't trigger the debugger, +like @samp{user-error}. @xref{Signaling Errors}, and @xref{Searching +and Matching}. This is used for searching in Info files, @xref{Search +Text,,,info,Info}. + @item void-function The message is @samp{Symbol's function definition is void}. @xref{Function Cells}. diff --git a/etc/NEWS b/etc/NEWS index c09cc390bb..f4627ac3a6 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1067,6 +1067,10 @@ its window gets deleted by 'delete-other-windows'. *** New command 'window-swap-states' swaps the states of two live windows. ++++ +*** New error type 'user-search-failed' like 'search-failed' but +avoids debugger like 'user-error'. + * Changes in Emacs 26.1 on Non-Free Operating Systems diff --git a/lisp/info.el b/lisp/info.el index a06c868fb3..28534f13e6 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -1998,20 +1998,20 @@ Info-search Info-isearch-initial-node bound (and found (> found opoint-min) (< found opoint-max))) - (user-error "Search failed: `%s' (end of node)" regexp)) + (signal 'user-search-failed (list regexp "(end of node)"))) ;; If no subfiles, give error now. (unless (or found Info-current-subfile) (if isearch-mode - (user-error "Search failed: `%s' (end of manual)" regexp) + (signal 'user-search-failed (list regexp "end of manual")) (let ((search-spaces-regexp Info-search-whitespace-regexp)) (unless (if backward (re-search-backward regexp nil t) (re-search-forward regexp nil t)) - (user-error "Search failed: `%s'" regexp))))) + (signal 'user-seach-failed (list regexp)))))) (if (and bound (not found)) - (user-error "Search failed: `%s'" regexp)) + (signal 'user-search-failed (list regexp))) (unless (or found bound) (unwind-protect @@ -2055,8 +2055,8 @@ Info-search (setq list nil))) (if found (message "") - (user-error "Search failed: `%s'%s" - regexp (if isearch-mode " (end of manual)" "")))) + (signal 'user-search-failed + `(,regexp ,@(if isearch-mode '("end of manual")))))) (if (not found) (progn (Info-read-subfile osubfile) (goto-char opoint) diff --git a/src/search.c b/src/search.c index 33cb02aa7a..c0deb57213 100644 --- a/src/search.c +++ b/src/search.c @@ -3389,6 +3389,10 @@ syms_of_search (void) /* Error condition used for failing searches. */ DEFSYM (Qsearch_failed, "search-failed"); + /* Error condition used for failing searches started by user, i.e., + where failure should not invoke the debugger. */ + DEFSYM (Quser_search_failed, "user-search-failed"); + /* Error condition signaled when regexp compile_pattern fails. */ DEFSYM (Qinvalid_regexp, "invalid-regexp"); @@ -3397,6 +3401,12 @@ syms_of_search (void) Fput (Qsearch_failed, Qerror_message, build_pure_c_string ("Search failed")); + Fput (Quser_search_failed, Qerror_conditions, + listn (CONSTYPE_PURE, 4, + Quser_search_failed, Quser_error, Qsearch_failed, Qerror)); + Fput (Quser_search_failed, Qerror_message, + build_pure_c_string ("Search failed")); + Fput (Qinvalid_regexp, Qerror_conditions, listn (CONSTYPE_PURE, 2, Qinvalid_regexp, Qerror)); Fput (Qinvalid_regexp, Qerror_message, -- 2.11.1 --=-=-=--