]> code.delx.au - gnu-emacs/blobdiff - lisp/bookmark.el
*** empty log message ***
[gnu-emacs] / lisp / bookmark.el
index da8a4e2b809208efded06b12c280b497b92e75a6..86fa6e489f082a2404d1badc56ef8590ebb1af0c 100644 (file)
@@ -198,6 +198,13 @@ following in your `.emacs' file:
   :group 'bookmark)
 
 
+(defface bookmark-menu-heading
+  '((t (:inherit font-lock-type-face)))
+  "Face used to highlight the heading in bookmark menu buffers."
+  :group 'bookmark
+  :version "22.1")
+
+
 ;;; No user-serviceable parts beyond this point.
 
 ;; Is it XEmacs?
@@ -211,12 +218,6 @@ following in your `.emacs' file:
 ;; suggested for lucid compatibility by david hughes:
 (or (fboundp 'frame-height)  (defalias 'frame-height 'screen-height))
 
-;; This variable is probably obsolete now...
-(or (boundp 'baud-rate)
-    ;; some random value higher than 9600
-    (setq baud-rate 19200))
-
-
 \f
 ;;; Keymap stuff:
 
@@ -1037,6 +1038,10 @@ For example, if this is a Info buffer, return the Info file's name."
                    (lambda (x y) (string-lessp (car x) (car y))))))))
 
 
+(defvar bookmark-after-jump-hook nil
+  "Hook run after `bookmark-jump' jumps to a bookmark.
+Useful for example to unhide text in `outline-mode'.")
+
 ;;;###autoload
 (defun bookmark-jump (bookmark)
   "Jump to bookmark BOOKMARK (a point in some file).
@@ -1059,6 +1064,7 @@ of the old one in the permanent bookmark record."
     (and cell
          (switch-to-buffer (car cell))
          (goto-char (cdr cell))
+        (progn (run-hooks 'bookmark-after-jump-hook) t)
         (if bookmark-automatically-show-annotations
              ;; if there is an annotation for this bookmark,
              ;; show it in a buffer.
@@ -1170,12 +1176,14 @@ minibuffer history list `bookmark-history'."
     (prog1
        (insert (bookmark-location bookmark)) ; *Return this line*
       (if (and (display-color-p) (display-mouse-p))
-         (add-text-properties start
-                              (save-excursion (re-search-backward
-                                               "[^ \t]")
+         (add-text-properties
+          start
+          (save-excursion (re-search-backward
+                           "[^ \t]")
                                               (1+ (point)))
-                              '(mouse-face highlight
-                                help-echo "mouse-2: go to this bookmark"))))))
+          '(mouse-face highlight
+            follow-link t
+            help-echo "mouse-2: go to this bookmark in other window"))))))
 
 ;;;###autoload
 (defalias 'bookmark-locate 'bookmark-insert-location)
@@ -1548,6 +1556,8 @@ deletion, or > if it is flagged for displaying."
   (let ((inhibit-read-only t))
     (erase-buffer)
     (insert "% Bookmark\n- --------\n")
+    (add-text-properties (point-min) (point)
+                        '(font-lock-face bookmark-menu-heading))
     (bookmark-maybe-sort-alist)
     (mapcar
      (lambda (full-record)
@@ -1561,12 +1571,14 @@ deletion, or > if it is flagged for displaying."
         (let ((start (point)))
           (insert (bookmark-name-from-full-record full-record))
           (if (and (display-color-p) (display-mouse-p))
-              (add-text-properties start
-                                   (save-excursion (re-search-backward
-                                                    "[^ \t]")
-                                                   (1+ (point)))
-                                   '(mouse-face highlight
-                                     help-echo "mouse-2: go to this bookmark")))
+              (add-text-properties
+               start
+               (save-excursion (re-search-backward
+                                "[^ \t]")
+                               (1+ (point)))
+               '(mouse-face highlight
+                 follow-link t
+                 help-echo "mouse-2: go to this bookmark in other window")))
           (insert "\n")
           )))
      bookmark-alist))
@@ -1690,13 +1702,15 @@ Optional argument SHOW means show them unconditionally."
                (let ((start (point)))
                  (insert (car bookmark-bmenu-hidden-bookmarks))
                  (if (and (display-color-p) (display-mouse-p))
-                     (add-text-properties start
-                                          (save-excursion (re-search-backward
-                                                           "[^ \t]")
-                                                          (1+ (point)))
-                                          '(mouse-face highlight
-                                            help-echo
-                                            "mouse-2: go to this bookmark"))))
+                     (add-text-properties
+                      start
+                      (save-excursion (re-search-backward
+                                       "[^ \t]")
+                                      (1+ (point)))
+                      '(mouse-face highlight
+                        follow-link t
+                        help-echo
+                        "mouse-2: go to this bookmark in other window"))))
                 (setq bookmark-bmenu-hidden-bookmarks
                       (cdr bookmark-bmenu-hidden-bookmarks))
                 (forward-line 1))))))))
@@ -2053,7 +2067,7 @@ To carry out the deletions that you've marked, use \\<bookmark-bmenu-mode-map>\\
   (interactive)
   (if (bookmark-bmenu-check-position)
       (let ((bmrk (bookmark-bmenu-bookmark)))
-        (message (bookmark-location bmrk)))))
+        (message "%s" (bookmark-location bmrk)))))
 
 (defun bookmark-bmenu-relocate ()
   "Change the file path of the bookmark on the current line,