]> git.eshelyaron.com Git - emacs.git/commitdiff
Adjust some search failure errors in info.el
authorNoam Postavsky <npostavs@gmail.com>
Tue, 28 Mar 2017 14:10:34 +0000 (10:10 -0400)
committerNoam Postavsky <npostavs@gmail.com>
Wed, 29 Mar 2017 01:25:17 +0000 (21:25 -0400)
* lisp/info.el (Info-select-node): The search for beginning of node is
an internal detail, and is not normally expected to fail, so it should
not be a user error.
(Info-complete-menu-item): Failing to find a menu indicates the user
searched for a menu when there isn't one, so change to `use-error'.

lisp/info.el

index a06c868fb3d3821e711f92e1c1c3e1edb11ce127..a6bab290a72c512551f345c50f788d47cd55a461 100644 (file)
@@ -1672,7 +1672,7 @@ escaped (\\\",\\\\)."
          (forward-line 2)
        (if (looking-at "\^_")
            (forward-line 1)
-         (user-error "Search failed: `\n\^_'")))
+         (signal 'search-failed (list "\n\^_"))))
       ;; Get nodename spelled as it is in the node.
       (re-search-forward "Node:[ \t]*")
       (setq Info-current-node
@@ -2699,7 +2699,8 @@ Because of ambiguities, this should be concatenated with something like
             (orignode Info-current-node)
             nextnode)
         (goto-char (point-min))
-        (search-forward "\n* Menu:")
+        (unless (search-forward "\n* Menu:" nil t)
+          (user-error "No menu in this node"))
         (cond
          ((eq (car-safe action) 'boundaries) nil)
          ((eq action 'lambda)