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

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

bug#13016: 24.3.50; Inconsistency in the way of presenting the filename


From: Juri Linkov
Subject: bug#13016: 24.3.50; Inconsistency in the way of presenting the filename in info buffers.
Date: Sat, 08 Dec 2012 01:54:20 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu)

> The original problem is fixed, but I still see one: After opening an
> info manual via `C-u C-h i ...', if I try to define a bookmark via
> `C-x r m', the default value in the minibuffer prompt does have the
> ".info" extension (like others default values brought by `M-n').
>
> The ".info" extension should be removed there too.

Searching the source file info.el for more occurrences of

  (file-name-nondirectory Info-current-file)

also finds the same problem in other places
like when typing `w' (Info-copy-current-node-name),
and in `Info-breadcrumbs' and `Info-fontify-node'.

If using `file-name-sans-extension' is the right way
to fix them, then all they could be fixed with:

=== modified file 'lisp/info.el'
--- lisp/info.el        2012-12-07 23:15:16 +0000
+++ lisp/info.el        2012-12-07 23:53:00 +0000
@@ -4064,7 +4064,9 @@ (defun Info-copy-current-node-name (&opt
   (unless Info-current-node
     (user-error "No current Info node"))
   (let ((node (if (stringp Info-current-file)
-                 (concat "(" (file-name-nondirectory Info-current-file) ") "
+                 (concat "(" (file-name-sans-extension
+                              (file-name-nondirectory Info-current-file))
+                         ") "
                          Info-current-node))))
     (if (zerop (prefix-numeric-value arg))
         (setq node (concat "(info \"" node "\")")))
@@ -4451,7 +4453,8 @@ (defun Info-breadcrumbs ()
               (if (not (equal node "Top")) node
                 (format "(%s)Top"
                         (if (stringp Info-current-file)
-                            (file-name-nondirectory Info-current-file)
+                            (file-name-sans-extension
+                             (file-name-nondirectory Info-current-file))
                           ;; Some legacy code can still use a symbol.
                           Info-current-file)))))
          (setq line (concat
@@ -4563,7 +4566,8 @@ (defun Info-fontify-node ()
              (if (re-search-forward
                   (format "File: %s\\([^,\n\t]+\\),"
                           (if (stringp Info-current-file)
-                              (file-name-nondirectory Info-current-file)
+                              (file-name-sans-extension
+                               (file-name-nondirectory Info-current-file))
                             Info-current-file))
                   header-end t)
                  (put-text-property (match-beginning 1) (match-end 1)
@@ -5101,7 +5105,8 @@ (defun Info-bookmark-make-record ()
   "This implements the `bookmark-make-record-function' type (which see)
 for Info nodes."
   (let* ((file (and (stringp Info-current-file)
-                   (file-name-nondirectory Info-current-file)))
+                   (file-name-sans-extension
+                    (file-name-nondirectory Info-current-file))))
         (bookmark-name (if file
                            (concat "(" file ") " Info-current-node)
                          Info-current-node))





reply via email to

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