unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: npostavs@users.sourceforge.net
To: Juri Linkov <juri@jurta.org>
Cc: 6106@debbugs.gnu.org, Helmut Eller <eller.helmut@gmail.com>
Subject: bug#6106: 24.0.50; info.el adds 'search-failed to debug-ignored-errors
Date: Thu, 23 Mar 2017 23:58:28 -0400	[thread overview]
Message-ID: <87vaqz2umz.fsf@users.sourceforge.net> (raw)
In-Reply-To: <87fw8bt721.fsf@mail.jurta.org> (Juri Linkov's message of "Sun, 29 Jul 2012 09:32:22 +0300")

[-- Attachment #1: Type: text/plain, Size: 470 bytes --]

tags 6106 patch
quit

Juri Linkov <juri@jurta.org> writes:

> `search-failed' is added to `debug-ignored-errors' in info.el
> to not enter the debugger when a normal search stops with no results.
>
> But this error is raised by `xsignal1 (Qsearch_failed, string)'
> in `re-search-forward' (called from `Info-search'),
> so I see no way to replace it with a call to the new function
> `user-error' (or the same function with any other name).

Use the NOERROR parameter?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch --]
[-- Type: text/x-diff, Size: 2805 bytes --]

From f0b7b943368e9856dda49c3bdb862c1940266189 Mon Sep 17 00:00:00 2001
From: Noam Postavsky <npostavs@gmail.com>
Date: Thu, 23 Mar 2017 23:54:58 -0400
Subject: [PATCH v1] Don't add `search-failed' to ignored errors in info.el
 (Bug#6106)

* lisp/info.el: Stop adding `search-failed' to `debug-ignored-errors'.
(Info-select-node, Info-search): Replace (signal 'search-failed ...)
with (user-error "Search failed: "...).
---
 lisp/info.el | 23 ++++++++++-------------
 1 file changed, 10 insertions(+), 13 deletions(-)

diff --git a/lisp/info.el b/lisp/info.el
index 8dc85f48a4..a06c868fb3 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -1672,7 +1672,7 @@ Info-select-node
 	  (forward-line 2)
 	(if (looking-at "\^_")
 	    (forward-line 1)
-	  (signal 'search-failed (list "\n\^_"))))
+	  (user-error "Search failed: `\n\^_'")))
       ;; Get nodename spelled as it is in the node.
       (re-search-forward "Node:[ \t]*")
       (setq Info-current-node
@@ -1998,19 +1998,20 @@ Info-search
                   Info-isearch-initial-node
                   bound
                   (and found (> found opoint-min) (< found opoint-max)))
-	(signal 'search-failed (list regexp "end of node")))
+	(user-error "Search failed: `%s' (end of node)" regexp))
 
       ;; If no subfiles, give error now.
       (unless (or found Info-current-subfile)
         (if isearch-mode
-            (signal 'search-failed (list regexp "end of manual"))
+            (user-error "Search failed: `%s' (end of manual)" regexp)
           (let ((search-spaces-regexp Info-search-whitespace-regexp))
-            (if backward
-                (re-search-backward regexp)
-              (re-search-forward regexp)))))
+            (unless (if backward
+                        (re-search-backward regexp nil t)
+                      (re-search-forward regexp nil t))
+              (user-error "Search failed: `%s'" regexp)))))
 
       (if (and bound (not found))
-	  (signal 'search-failed (list regexp)))
+          (user-error "Search failed: `%s'" regexp))
 
       (unless (or found bound)
 	(unwind-protect
@@ -2054,9 +2055,8 @@ Info-search
 		    (setq list nil)))
 	      (if found
 		  (message "")
-		(signal 'search-failed (if isearch-mode
-					   (list regexp "end of manual")
-					 (list regexp)))))
+                (user-error "Search failed: `%s'%s"
+                            regexp (if isearch-mode " (end of manual)" ""))))
 	  (if (not found)
 	      (progn (Info-read-subfile osubfile)
 		     (goto-char opoint)
@@ -5237,9 +5237,6 @@ Info-speedbar-buttons
       (erase-buffer))
   (Info-speedbar-hierarchy-buttons nil 0))
 
-;; FIXME: Really?  Why here?
-(add-to-list 'debug-ignored-errors 'search-failed)
-
 ;;;;  Desktop support
 
 (defun Info-desktop-buffer-misc-data (_desktop-dirname)
-- 
2.11.1


  reply	other threads:[~2017-03-24  3:58 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-05  9:56 bug#6106: 24.0.50; info.el adds 'search-failed to debug-ignored-errors Helmut Eller
2010-05-05 18:18 ` Juri Linkov
2010-05-06  5:57   ` Helmut Eller
2010-05-06 13:07   ` Stefan Monnier
2010-05-06 20:49     ` Juri Linkov
2012-07-29  6:32 ` Juri Linkov
2017-03-24  3:58   ` npostavs [this message]
2017-03-26 22:35     ` Juri Linkov
2017-03-28  0:24       ` npostavs
2017-04-01 13:43     ` npostavs
2017-04-01 14:13       ` Eli Zaretskii
2017-04-01 21:08         ` npostavs
2017-04-02  2:33           ` Eli Zaretskii
2017-04-02 14:49           ` Mark Oteiza
2017-04-03 23:51             ` npostavs
2017-04-01 14:23       ` Mark Oteiza

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87vaqz2umz.fsf@users.sourceforge.net \
    --to=npostavs@users.sourceforge.net \
    --cc=6106@debbugs.gnu.org \
    --cc=eller.helmut@gmail.com \
    --cc=juri@jurta.org \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).