emacs-devel
[Top][All Lists]
Advanced

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

proposition about bookmark-buffer-file-name in bookmark.el


From: Toru TSUNEYOSHI
Subject: proposition about bookmark-buffer-file-name in bookmark.el
Date: Wed, 19 Nov 2008 13:27:44 +0900

Hello.

I have a proposition.
(I use GNU Emacs 22.3.1 (i386-msvc-nt5.0.2195).)

Now, `bookmark-buffer-file-name' in bookmark.el do
`abbreviate-file-name' buffer-file-name only.
So, I wish this function do `abbreviate-file-name' dired-directory (and
Info-current-file) on next version of Emacs.

`bookmark-buffer-file-name' in bookmark.el on Emacs 22.3.1:
========================================================================
(defun bookmark-buffer-file-name ()
  "Return the current buffer's file in a way useful for bookmarks.
For example, if this is a Info buffer, return the Info file's name."
  (cond
   ((eq major-mode 'Info-mode)
    Info-current-file)
   (buffer-file-name
    ;; Abbreviate the path, both so it's shorter and so it's more
    ;; portable.  E.g., the user's home dir might be a different
    ;; path on different machines, but "~/" will still reach it.
    (abbreviate-file-name buffer-file-name))
   ((and (boundp 'dired-directory) dired-directory)
    (if (stringp dired-directory)
        dired-directory
      (car dired-directory)))))
========================================================================





reply via email to

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