aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl Fogel2007-01-15 20:04:26 +0000
committerKarl Fogel2007-01-15 20:04:26 +0000
commitacf3709f0182ffc4ad5dc79be96552628a7dfdda (patch)
tree59d488577d5fbde8c8976d5f34863ba4690c0b69
parenta35c8b708a96ef2bf7cd4b5583db0356bd5caac2 (diff)
downloademacs-acf3709f0182ffc4ad5dc79be96552628a7dfdda.tar.gz
emacs-acf3709f0182ffc4ad5dc79be96552628a7dfdda.zip
* bookmark.el (bookmark-buffer-file-name): Abbreviate the bookmark path.
Rewrite function in `cond' style for readability. Suggested by: Stephen Eglen <S.J.Eglen{_AT_}damtp.cam.ac.uk> (The path shortening, that is, not the rearrarangement.)
-rw-r--r--lisp/ChangeLog8
-rw-r--r--lisp/bookmark.el20
2 files changed, 20 insertions, 8 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 7b08f1fb0f7..3f599e637e1 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,11 @@
12007-01-15 Karl Fogel <kfogel@red-bean.com>
2
3 * bookmark.el (bookmark-buffer-file-name): Abbreviate the bookmark
4 path. Rewrite function in `cond' style for readability.
5
6 Suggested by: Stephen Eglen <S.J.Eglen{_AT_}damtp.cam.ac.uk>
7 (The path shortening, that is, not the rearrarangement.)
8
12007-01-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> 92007-01-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2 10
3 * term/mac-win.el (mac-ae-quit-application): New function. 11 * term/mac-win.el (mac-ae-quit-application): New function.
diff --git a/lisp/bookmark.el b/lisp/bookmark.el
index 104a9c6512f..805703a2464 100644
--- a/lisp/bookmark.el
+++ b/lisp/bookmark.el
@@ -1007,14 +1007,18 @@ In Info, return the current node."
1007(defun bookmark-buffer-file-name () 1007(defun bookmark-buffer-file-name ()
1008 "Return the current buffer's file in a way useful for bookmarks. 1008 "Return the current buffer's file in a way useful for bookmarks.
1009For example, if this is a Info buffer, return the Info file's name." 1009For example, if this is a Info buffer, return the Info file's name."
1010 (if (eq major-mode 'Info-mode) 1010 (cond
1011 Info-current-file 1011 ((eq major-mode 'Info-mode)
1012 (or 1012 Info-current-file)
1013 buffer-file-name 1013 (buffer-file-name
1014 (if (and (boundp 'dired-directory) dired-directory) 1014 ;; Abbreviate the path, both so it's shorter and so it's more
1015 (if (stringp dired-directory) 1015 ;; portable. E.g., the user's home dir might be a different
1016 dired-directory 1016 ;; path on different machines, but "~/" will still reach it.
1017 (car dired-directory)))))) 1017 (abbreviate-file-name buffer-file-name))
1018 ((and (boundp 'dired-directory) dired-directory)
1019 (if (stringp dired-directory)
1020 dired-directory
1021 (car dired-directory)))))
1018 1022
1019 1023
1020(defun bookmark-maybe-load-default-file () 1024(defun bookmark-maybe-load-default-file ()