Function: bookmark-buffer-file-name

bookmark-buffer-file-name is a byte-compiled function defined in bookmark.el.gz.

Signature

(bookmark-buffer-file-name)

Documentation

Return the current buffer's file in a way useful for bookmarks.

Source Code

;; Defined in /usr/src/emacs/lisp/bookmark.el.gz
(defun bookmark-buffer-file-name ()
  "Return the current buffer's file in a way useful for bookmarks."
  ;; 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
   (cond
    (buffer-file-name buffer-file-name)
    ((and (boundp 'dired-directory) dired-directory)
     (if (stringp dired-directory)
         dired-directory
       (car dired-directory)))
    (t (error "Buffer not visiting a file or directory")))))