emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: In info: Wrong type argument: stringp, nil


From: Juri Linkov
Subject: Re: In info: Wrong type argument: stringp, nil
Date: Thu, 05 Jan 2006 08:44:04 +0200
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux)

> When doing C-h for the first time, the "dir" node is shown.  The menu item
> and tool bar item back in history is enabled.  Selecting Back in history in
> the menu, pressing the tool bar putton, or just using the key l gives:
> byte-code: Wrong type argument: stringp, nil
>
> The menu item looks like this:
>    ["Back in history" Info-history-back :active Info-history
>     :help "Go back in history to the last node you were at"]
>
> but when entering "dir" for the first time, the value of Info-history is
> not nil, but ((nil nil 1)).  The first nil is supposed to be a file name
> and it is when info tries to use it as such the error message above shows
> up.  How Info-history becomes ((nil nil 1)) instead of just nil I don't know.

This is due to the following changes in info.el from 2005-11-25 that
removed some tests for Info-current-file.  I don't see a need for these
changes.  Unless there is a reason to keep these changes we could
revert them.  Below is not a patch, but a partial diff that shows
changes in CVS:

@@ -691,12 +690,13 @@
   ;; Go into Info buffer.
   (or (eq major-mode 'Info-mode) (pop-to-buffer "*info*"))
   ;; Record the node we are leaving.
-  (if (and Info-current-file (not no-going-back))
+  (if (not no-going-back)
       (setq Info-history
             (cons (list Info-current-file Info-current-node (point))
                   Info-history)))
@@ -726,8 +729,7 @@
        (pline        (count-lines (point-min) (line-beginning-position)))
        (wline        (count-lines (point-min) (window-start)))
        (old-history  Info-history)
-       (new-history (and Info-current-file
-                         (list Info-current-file Info-current-node (point)))))
+       (new-history  (list Info-current-file Info-current-node (point))))
     (kill-buffer (current-buffer))
     (Info-find-node filename nodename)
     (setq Info-history old-history)
@@ -1400,12 +1402,10 @@
        (nconc (propertized-buffer-identification "%b")
               (list
                (concat " ("
-                       (file-name-nondirectory
-                        (if (stringp Info-current-file)
-                            Info-current-file
-                          (or buffer-file-name "")))
-                       ") "
-                       (or Info-current-node ""))))))
+                       (if Info-current-file
+                           (file-name-nondirectory Info-current-file)
+                         " ")
+                       ") " (or Info-current-node ""))))))
 
 ;; Go to an Info node specified with a filename-and-nodename string
 ;; of the sort that is found in pointers in nodes.
@@ -1884,7 +1884,7 @@
     (let ((old-node Info-current-node)
          (old-file Info-current-file)
          (node (Info-extract-pointer "up")) p)
-      (and (or same-file (not (stringp Info-current-file)))
+      (and same-file
           (string-match "^(" node)
           (error "Up node is in another Info file"))
       (Info-goto-node node)
@@ -3266,12 +3266,8 @@
   (interactive "P")
   (unless Info-current-node
     (error "No current Info node"))
-  (let ((node (concat "(" (file-name-nondirectory
-                           (or (and (stringp Info-current-file)
-                                    Info-current-file)
-                               buffer-file-name
-                               ""))
-                      ")" Info-current-node)))
+  (let ((node (concat "(" (file-name-nondirectory Info-current-file) ")"
+                     Info-current-node)))
     (if (zerop (prefix-numeric-value arg))
         (setq node (concat "(info \"" node "\")")))
     (kill-new node)

-- 
Juri Linkov
http://www.jurta.org/emacs/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]