From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#16405: info on non-existent node shows raw info buffer Date: Fri, 10 Jan 2014 10:04:11 +0200 Organization: JURTA Message-ID: <87bnzkgt50.fsf@mail.jurta.org> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1389341234 28325 80.91.229.3 (10 Jan 2014 08:07:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 10 Jan 2014 08:07:14 +0000 (UTC) Cc: 16405@debbugs.gnu.org To: Glenn Morris Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jan 10 09:07:19 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1W1X7e-0008LD-Sf for geb-bug-gnu-emacs@m.gmane.org; Fri, 10 Jan 2014 09:07:19 +0100 Original-Received: from localhost ([::1]:55747 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W1X7e-00066w-BJ for geb-bug-gnu-emacs@m.gmane.org; Fri, 10 Jan 2014 03:07:18 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60214) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W1X7U-0005va-Th for bug-gnu-emacs@gnu.org; Fri, 10 Jan 2014 03:07:14 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W1X7O-0002mu-RZ for bug-gnu-emacs@gnu.org; Fri, 10 Jan 2014 03:07:08 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:58903) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W1X7O-0002mq-Nn for bug-gnu-emacs@gnu.org; Fri, 10 Jan 2014 03:07:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1W1X7O-0005WG-CI for bug-gnu-emacs@gnu.org; Fri, 10 Jan 2014 03:07:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 10 Jan 2014 08:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16405 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 16405-submit@debbugs.gnu.org id=B16405.138934119221161 (code B ref 16405); Fri, 10 Jan 2014 08:07:02 +0000 Original-Received: (at 16405) by debbugs.gnu.org; 10 Jan 2014 08:06:32 +0000 Original-Received: from localhost ([127.0.0.1]:44689 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W1X6u-0005VD-5A for submit@debbugs.gnu.org; Fri, 10 Jan 2014 03:06:32 -0500 Original-Received: from [69.163.184.122] (port=53394 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W1X6r-0005V1-Ej for 16405@debbugs.gnu.org; Fri, 10 Jan 2014 03:06:30 -0500 Original-Received: from localhost.jurta.org (ps18281.dreamhostps.com [69.163.184.122]) by ps18281.dreamhostps.com (Postfix) with ESMTP id B5867301948192; Fri, 10 Jan 2014 00:06:27 -0800 (PST) In-Reply-To: (Glenn Morris's message of "Thu, 09 Jan 2014 23:54:38 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:83220 Archived-At: > (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.