]> code.delx.au - gnu-emacs/commitdiff
(info): Don't add parens if FILE already has them.
authorKarl Heuer <kwzh@gnu.org>
Fri, 4 Sep 1998 19:50:26 +0000 (19:50 +0000)
committerKarl Heuer <kwzh@gnu.org>
Fri, 4 Sep 1998 19:50:26 +0000 (19:50 +0000)
lisp/info.el

index c96844a88fc69735f1478482614eba5b7561203e..6149c570b148dc137ac21e246ae97efe2ef743d8 100644 (file)
@@ -299,8 +299,15 @@ in all the directories in that path."
   (interactive (if current-prefix-arg
                   (list (read-file-name "Info file name: " nil nil t))))
   (if file
-      (progn (pop-to-buffer "*info*")
-            (Info-goto-node (concat "(" file ")")))
+      (progn
+       (pop-to-buffer "*info*")
+       ;; If argument already contains parentheses, don't add another set
+       ;; since the argument will then be parsed improperly.  This also
+       ;; has the added benefit of allowing node names to be included
+       ;; following the parenthesized filename.
+       (if (and (stringp file) (string-match "(.*)" file))
+           (Info-goto-node file)
+         (Info-goto-node (concat "(" file ")"))))
     (if (get-buffer "*info*")
        (pop-to-buffer "*info*")
       (Info-directory))))