all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
To: Glenn Morris <rgm@gnu.org>
Cc: 16405@debbugs.gnu.org
Subject: bug#16405: info on non-existent node shows raw info buffer
Date: Fri, 10 Jan 2014 10:04:11 +0200	[thread overview]
Message-ID: <87bnzkgt50.fsf@mail.jurta.org> (raw)
In-Reply-To: <t1txdctp0x.fsf@fencepost.gnu.org> (Glenn Morris's message of "Thu, 09 Jan 2014 23:54:38 -0500")

> (info "(emacs)Node That Does Not Exist")
>
> This dumps you in a raw, unformatted info buffer, which is not very
> friendly. I think it should format the info buffer as normal, go to the
> start, and only then return
>
> user-error: No such node or anchor: Node That Does Not Exist

AFAICS, this problem happens only when there is no *info* buffer
initially.  Otherwise, it recovers to the previously visited Info node.
So if there is no history then it could visit the Top node.

BTW, I see a similar problem with

  (info "(File That Does Not Exist)Node That Does Not Exist")

It displays an empty Info buffer.  I guess it would make sense to visit
the Dir node in this case. This patch should fix both problems:

=== modified file 'lisp/info.el'
--- lisp/info.el	2014-01-01 07:43:34 +0000
+++ lisp/info.el	2014-01-10 08:02:57 +0000
@@ -917,6 +917,8 @@ (defun Info-find-file (filename &optiona
 	  (setq filename found)
 	(if noerror
 	    (setq filename nil)
+	  (unless Info-history
+	    (Info-directory))
 	  (error "Info file %s does not exist" filename)))
       filename))))
 
@@ -1238,11 +1240,13 @@ (defun Info-find-node-2 (filename nodena
 		   (setq Info-point-loc nil))))))
     ;; If we did not finish finding the specified node,
     ;; go back to the previous one.
-    (or Info-current-node no-going-back (null Info-history)
-        (let ((hist (car Info-history)))
-          (setq Info-history (cdr Info-history))
-          (Info-find-node (nth 0 hist) (nth 1 hist) t)
-          (goto-char (nth 2 hist))))))
+    (unless (or Info-current-node no-going-back)
+      (if Info-history
+	  (let ((hist (car Info-history)))
+	    (setq Info-history (cdr Info-history))
+	    (Info-find-node (nth 0 hist) (nth 1 hist) t)
+	    (goto-char (nth 2 hist)))
+	(Info-find-node (or filename Info-current-file) "Top" t)))))
 
 ;; Cache the contents of the (virtual) dir file, once we have merged
 ;; it for the first time, so we can save time subsequently.






  reply	other threads:[~2014-01-10  8:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-10  4:54 bug#16405: info on non-existent node shows raw info buffer Glenn Morris
2014-01-10  8:04 ` Juri Linkov [this message]
2014-01-10  8:24   ` Eli Zaretskii
2014-01-13  8:05     ` Juri Linkov
2014-01-13 16:11       ` Eli Zaretskii

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

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

  git send-email \
    --in-reply-to=87bnzkgt50.fsf@mail.jurta.org \
    --to=juri@jurta.org \
    --cc=16405@debbugs.gnu.org \
    --cc=rgm@gnu.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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.