-;;; bookmark.el --- set bookmarks, maybe annotate them, jump to them later.
+;;; bookmark.el --- set bookmarks, maybe annotate them, jump to them later
;; Copyright (C) 1993, 1994, 1995, 1996, 1997, 2001 Free Software Foundation
;; Boy, that's a tough one. Probably Hong Min, or maybe Emperor's
;; Choice (both in Chicago's Chinatown). Well, both. How about you?
\f
-;;;; Code:
+;;; Code:
(require 'pp)
(defun bookmark-get-bookmark (bookmark)
- "Return the full entry for BOOKMARK in bookmark-alist."
- (apply (if bookmark-completion-ignore-case
- #'assoc-ignore-case
- #'assoc)
- (list bookmark bookmark-alist)))
+ "Return the full entry for BOOKMARK in bookmark-alist.
+If BOOKMARK is not a string, return nil."
+ (when (stringp bookmark)
+ (apply (if bookmark-completion-ignore-case
+ #'assoc-ignore-case
+ #'assoc)
+ (list bookmark bookmark-alist))))
(defun bookmark-get-bookmark-record (bookmark)
(prog1
(insert (bookmark-location bookmark)) ; *Return this line*
(if (and (display-color-p) (display-mouse-p))
- (put-text-property start
- (save-excursion (re-search-backward
- "[^ \t]")
- (1+ (point)))
- 'mouse-face 'highlight)))))
+ (add-text-properties start
+ (save-excursion (re-search-backward
+ "[^ \t]")
+ (1+ (point)))
+ '(mouse-face highlight
+ help-echo "mouse-2: go to this bookmark"))))))
;;;###autoload
(defalias 'bookmark-locate 'bookmark-insert-location)
(set-buffer (let ((enable-local-variables nil))
(find-file-noselect file)))
(goto-char (point-min))
- (delete-region (point-min) (point-max))
- (bookmark-insert-file-format-version-stamp)
- (pp bookmark-alist (current-buffer))
- (let ((version-control
- (cond
- ((null bookmark-version-control) nil)
- ((eq 'never bookmark-version-control) 'never)
- ((eq 'nospecial bookmark-version-control) version-control)
- (t
- t))))
- (write-file file)
- (kill-buffer (current-buffer))
- (if (>= baud-rate 9600)
- (message "Saving bookmarks to file %s...done" file))
- ))))
+ (let ((print-length nil)
+ (print-level nil))
+ (delete-region (point-min) (point-max))
+ (bookmark-insert-file-format-version-stamp)
+ (pp bookmark-alist (current-buffer))
+ (let ((version-control
+ (cond
+ ((null bookmark-version-control) nil)
+ ((eq 'never bookmark-version-control) 'never)
+ ((eq 'nospecial bookmark-version-control) version-control)
+ (t
+ t))))
+ (write-file file)
+ (kill-buffer (current-buffer))
+ (if (>= baud-rate 9600)
+ (message "Saving bookmarks to file %s...done" file)))))))
(defun bookmark-import-new-list (new-list)
(let ((start (point)))
(insert (bookmark-name-from-full-record full-record))
(if (and (display-color-p) (display-mouse-p))
- (put-text-property start
- (save-excursion (re-search-backward
- "[^ \t]")
- (1+ (point)))
- 'mouse-face 'highlight))
+ (add-text-properties start
+ (save-excursion (re-search-backward
+ "[^ \t]")
+ (1+ (point)))
+ '(mouse-face highlight
+ help-echo "mouse-2: go to this bookmark")))
(insert "\n")
)))
bookmark-alist))
;; Strip off `mouse-face' from the white spaces region.
(if (and (display-color-p) (display-mouse-p))
(remove-text-properties start (point)
- '(mouse-face))))
+ '(mouse-face nil help-echo nil))))
(delete-region (point) (progn (end-of-line) (point)))
(insert " ")
;; Pass the NO-HISTORY arg:
(let ((start (point)))
(insert (car bookmark-bmenu-hidden-bookmarks))
(if (and (display-color-p) (display-mouse-p))
- (put-text-property start
- (save-excursion (re-search-backward
- "[^ \t]")
- (1+ (point)))
- 'mouse-face 'highlight)))
+ (add-text-properties start
+ (save-excursion (re-search-backward
+ "[^ \t]")
+ (1+ (point)))
+ '(mouse-face highlight
+ help-echo
+ "mouse-2: go to this bookmark"))))
(setq bookmark-bmenu-hidden-bookmarks
(cdr bookmark-bmenu-hidden-bookmarks))
(forward-line 1))))))))