-;;; 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
+;; Copyright (C) 1993, 1994, 1995, 1996, 1997, 2001, 2003 Free Software Foundation
;; Author: Karl Fogel <kfogel@red-bean.com>
;; Maintainer: Karl Fogel <kfogel@red-bean.com>
;; 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)
(defcustom bookmark-automatically-show-annotations t
- "*Nil means don't show annotations when jumping to a bookmark."
+ "*nil means don't show annotations when jumping to a bookmark."
:type 'boolean
:group 'bookmark)
(defcustom bookmark-menu-length 70
"*Maximum length of a bookmark name displayed on a popup menu."
:type 'integer
- :group 'boolean)
+ :group 'bookmark)
;;; No user-serviceable parts beyond this point.
key of your choice to `bookmark-map'. All interactive bookmark
functions have a binding in this keymap.")
-;;;###autoload
-(define-prefix-command 'bookmark-map)
+;;;###autoload (define-prefix-command 'bookmark-map)
;; Read the help on all of these functions for details...
-;;;###autoload
-(define-key bookmark-map "x" 'bookmark-set)
-;;;###autoload
-(define-key bookmark-map "m" 'bookmark-set) ; "m" for "mark"
-;;;###autoload
-(define-key bookmark-map "j" 'bookmark-jump)
-;;;###autoload
-(define-key bookmark-map "g" 'bookmark-jump) ; "g" for "go"
-;;;###autoload
-(define-key bookmark-map "i" 'bookmark-insert)
-;;;###autoload
-(define-key bookmark-map "e" 'edit-bookmarks)
-;;;###autoload
-(define-key bookmark-map "f" 'bookmark-insert-location) ; "f" for "find"
-;;;###autoload
-(define-key bookmark-map "r" 'bookmark-rename)
-;;;###autoload
-(define-key bookmark-map "d" 'bookmark-delete)
-;;;###autoload
-(define-key bookmark-map "l" 'bookmark-load)
-;;;###autoload
-(define-key bookmark-map "w" 'bookmark-write)
-;;;###autoload
-(define-key bookmark-map "s" 'bookmark-save)
+;;;###autoload (define-key bookmark-map "x" 'bookmark-set)
+;;;###autoload (define-key bookmark-map "m" 'bookmark-set) ; "m" for "mark"
+;;;###autoload (define-key bookmark-map "j" 'bookmark-jump)
+;;;###autoload (define-key bookmark-map "g" 'bookmark-jump) ; "g" for "go"
+;;;###autoload (define-key bookmark-map "i" 'bookmark-insert)
+;;;###autoload (define-key bookmark-map "e" 'edit-bookmarks)
+;;;###autoload (define-key bookmark-map "f" 'bookmark-insert-location) ; "f" for "find"
+;;;###autoload (define-key bookmark-map "r" 'bookmark-rename)
+;;;###autoload (define-key bookmark-map "d" 'bookmark-delete)
+;;;###autoload (define-key bookmark-map "l" 'bookmark-load)
+;;;###autoload (define-key bookmark-map "w" 'bookmark-write)
+;;;###autoload (define-key bookmark-map "s" 'bookmark-save)
;;; The annotation maps.
"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))))
+ (assoc-string bookmark bookmark-alist bookmark-completion-ignore-case)))
(defun bookmark-get-bookmark-record (bookmark)
Optional second arg DEFAULT is a string to return if the user enters
the empty string."
(bookmark-maybe-load-default-file) ; paranoia
- (let* ((completion-ignore-case bookmark-completion-ignore-case)
- (default default)
- (prompt (if default
- (concat prompt (format " (%s): " default))
- (concat prompt ": ")))
- (str
- (completing-read prompt
- bookmark-alist
- nil
- 0
- nil
- 'bookmark-history)))
- (if (string-equal "" str)
- (list default)
- (list str))))
+ (if (listp last-nonmenu-event)
+ (bookmark-menu-popup-paned-menu t prompt (bookmark-all-names))
+ (let* ((completion-ignore-case bookmark-completion-ignore-case)
+ (default default)
+ (prompt (if default
+ (concat prompt (format " (%s): " default))
+ (concat prompt ": ")))
+ (str
+ (completing-read prompt
+ bookmark-alist
+ nil
+ 0
+ nil
+ 'bookmark-history)))
+ (if (string-equal "" str) default str))))
(defmacro bookmark-maybe-historicize-string (string)
Optional second arg INFO-NODE means this bookmark is at info node
INFO-NODE, so record this fact in the bookmark's entry."
(let ((the-record
- (` ((filename . (, (bookmark-buffer-file-name)))
- (front-context-string
- . (, (if (>= (- (point-max) (point)) bookmark-search-size)
- (buffer-substring-no-properties
- (point)
- (+ (point) bookmark-search-size))
- nil)))
- (rear-context-string
- . (, (if (>= (- (point) (point-min)) bookmark-search-size)
- (buffer-substring-no-properties
- (point)
- (- (point) bookmark-search-size))
- nil)))
- (position . (, (point)))
- ))))
+ `((filename . ,(bookmark-buffer-file-name))
+ (front-context-string
+ . ,(if (>= (- (point-max) (point)) bookmark-search-size)
+ (buffer-substring-no-properties
+ (point)
+ (+ (point) bookmark-search-size))
+ nil))
+ (rear-context-string
+ . ,(if (>= (- (point) (point-min)) bookmark-search-size)
+ (buffer-substring-no-properties
+ (point)
+ (- (point) bookmark-search-size))
+ nil))
+ (position . ,(point)))))
;; Now fill in the optional parts:
(ann (nth 4 record)))
(list
name
- (` ((filename . (, filename))
- (front-context-string . (, (or front-str "")))
- (rear-context-string . (, (or rear-str "")))
- (position . (, position))
- (annotation . (, ann)))))))
+ `((filename . ,filename)
+ (front-context-string . ,(or front-str ""))
+ (rear-context-string . ,(or rear-str ""))
+ (position . ,position)
+ (annotation . ,ann)))))
old-list))
(make-local-variable 'bookmark-annotation-name)
(setq bookmark-annotation-name bookmark)
(use-local-map bookmark-edit-annotation-mode-map)
- (setq major-mode 'bookmark-edit-annotation-mode)
+ (setq major-mode 'bookmark-edit-annotation-mode
+ mode-name "Edit Bookmark Annotation")
(insert (funcall bookmark-read-annotation-text-func bookmark))
(let ((annotation (bookmark-get-annotation bookmark)))
(if (and annotation (not (string-equal annotation "")))
(defun bookmark-send-edited-annotation ()
- "Use buffer contents (minus beginning with `#' as annotation for a bookmark."
+ "Use buffer contents as annotation for a bookmark.
+Lines beginning with `#' are ignored."
(interactive)
(if (not (eq major-mode 'bookmark-edit-annotation-mode))
(error "Not in bookmark-edit-annotation-mode"))
(defun bookmark-edit-annotation (bookmark)
"Pop up a buffer for editing bookmark BOOKMARK's annotation."
- (let ((buf (current-buffer))
- (point (point)))
- (pop-to-buffer (generate-new-buffer-name "*Bookmark Annotation Compose*"))
- (bookmark-edit-annotation-mode bookmark)))
+ (pop-to-buffer (generate-new-buffer-name "*Bookmark Annotation Compose*"))
+ (bookmark-edit-annotation-mode bookmark))
(defun bookmark-insert-current-bookmark ()
will then jump to the new location, as well as recording it in place
of the old one in the permanent bookmark record."
(interactive
- (bookmark-completing-read "Jump to bookmark" bookmark-current-bookmark))
+ (list (bookmark-completing-read "Jump to bookmark"
+ bookmark-current-bookmark)))
(bookmark-maybe-historicize-string bookmark)
(let ((cell (bookmark-jump-noselect bookmark)))
(and cell
(defun bookmark-file-or-variation-thereof (file)
- "Return FILE (a string) if it exists in any reasonable variation, else nil.
-Reasonable variations are FILE.gz, FILE.Z, FILE.info, FILE.info.gz, etc."
- (cond
- ((file-exists-p file) file)
- ((file-exists-p (concat file ".Z")) (concat file ".Z"))
- ((file-exists-p (concat file ".gz")) (concat file ".gz"))
- ((file-exists-p (concat file ".z")) (concat file ".z"))
- ((file-exists-p (concat file ".info")) (concat file ".info"))
- ((file-exists-p (concat file ".info.gz")) (concat file ".info.gz"))
- ((file-exists-p (concat file ".info.Z")) (concat file ".info.Z"))
- ((file-exists-p (concat file ".info.z")) (concat file ".info.z"))
- ((vc-backend file) file) ; maybe VC has it?
- (t nil)))
+ "Return FILE (a string) if it exists, or return a reasonable
+variation of FILE if that exists. Reasonable variations are checked
+by appending suffixes defined in `Info-suffix-list'. If cannot find FILE
+nor a reasonable variation thereof, then still return FILE if it can
+be retrieved from a VC backend, else return nil."
+ (if (file-exists-p file)
+ file
+ (or
+ (progn (require 'info) ; ensure Info-suffix-list is bound
+ (catch 'found
+ (mapc (lambda (elt)
+ (let ((suffixed-file (concat file (car elt))))
+ (if (file-exists-p suffixed-file)
+ (throw 'found suffixed-file))))
+ Info-suffix-list)
+ nil))
+ ;; Last possibility: try VC
+ (if (vc-backend file) file))))
(defun bookmark-jump-noselect (str)
This makes an already existing bookmark point to that file, instead of
the one it used to point at. Useful when a file has been renamed
after a bookmark was set in it."
- (interactive (bookmark-completing-read "Bookmark to relocate"))
+ (interactive (list (bookmark-completing-read "Bookmark to relocate")))
(bookmark-maybe-historicize-string bookmark)
(bookmark-maybe-load-default-file)
(let* ((bmrk-filename (bookmark-get-filename bookmark))
"Insert the name of the file associated with BOOKMARK.
Optional second arg NO-HISTORY means don't record this in the
minibuffer history list `bookmark-history'."
- (interactive (bookmark-completing-read "Insert bookmark location"))
+ (interactive (list (bookmark-completing-read "Insert bookmark location")))
(or no-history (bookmark-maybe-historicize-string bookmark))
(let ((start (point)))
(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)
While you are entering the new name, consecutive C-w's insert
consecutive words from the text of the buffer into the new bookmark
name."
- (interactive (bookmark-completing-read "Old bookmark name"))
+ (interactive (list (bookmark-completing-read "Old bookmark name")))
(bookmark-maybe-historicize-string old)
(bookmark-maybe-load-default-file)
`bookmark-alist' is nil. If that happens, you need to load in some
bookmarks. See help on function `bookmark-load' for more about
this."
- (interactive (bookmark-completing-read "Insert bookmark contents"))
+ (interactive (list (bookmark-completing-read "Insert bookmark contents")))
(bookmark-maybe-historicize-string bookmark)
(bookmark-maybe-load-default-file)
(let ((orig-point (point))
Optional second arg BATCH means don't update the bookmark list buffer,
probably because we were called from there."
(interactive
- (bookmark-completing-read "Delete bookmark" bookmark-current-bookmark))
+ (list (bookmark-completing-read "Delete bookmark"
+ bookmark-current-bookmark)))
(bookmark-maybe-historicize-string bookmark)
(bookmark-maybe-load-default-file)
(let ((will-go (bookmark-get-bookmark bookmark)))
(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)
(if (interactive-p)
(switch-to-buffer (get-buffer-create "*Bookmark List*"))
(set-buffer (get-buffer-create "*Bookmark List*")))
- (let ((buffer-read-only nil))
- (delete-region (point-max) (point-min))
- (goto-char (point-min)) ;sure are playing it safe...
+ (let ((inhibit-read-only t))
+ (erase-buffer)
(insert "% Bookmark\n- --------\n")
(bookmark-maybe-sort-alist)
(mapcar
(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))
(goto-char (point-min))
(forward-line 2)
(setq bookmark-bmenu-hidden-bookmarks ())
- (let ((buffer-read-only nil))
+ (let ((inhibit-read-only t))
(while (< (point) (point-max))
(let ((bmrk (bookmark-bmenu-bookmark)))
(setq bookmark-bmenu-hidden-bookmarks
;; 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:
(backward-word 1)
(setq bookmark-bmenu-bookmark-column (current-column)))
(save-excursion
- (let ((buffer-read-only nil))
+ (let ((inhibit-read-only t))
(while bookmark-bmenu-hidden-bookmarks
(move-to-column bookmark-bmenu-bookmark-column t)
(bookmark-kill-line)
(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))))))))
(interactive)
(beginning-of-line)
(if (bookmark-bmenu-check-position)
- (let ((buffer-read-only nil))
+ (let ((inhibit-read-only t))
(delete-char 1)
(insert ?>)
(forward-line 1)
(goto-char (point-min))
(while (re-search-forward "^>" nil t)
(setq tem (bookmark-bmenu-bookmark))
- (let ((buffer-read-only nil))
+ (let ((inhibit-read-only t))
(delete-char -1)
(insert ?\ ))
(or (string-equal tem bmrk)
(beginning-of-line)
(if (bookmark-bmenu-check-position)
(progn
- (let ((buffer-read-only nil))
+ (let ((inhibit-read-only t))
(delete-char 1)
;; any flags to reset according to circumstances? How about a
;; flag indicating whether this bookmark is being visited?
(interactive)
(beginning-of-line)
(if (bookmark-bmenu-check-position)
- (let ((buffer-read-only nil))
+ (let ((inhibit-read-only t))
(delete-char 1)
(insert ?D)
(forward-line 1)
\f
;;; Menu bar stuff. Prefix is "bookmark-menu".
-(defun bookmark-menu-build-paned-menu (name entries)
- "Build a multi-paned menu named NAME from the strings in ENTRIES.
-That is, ENTRIES is a list of strings which appear as the choices
-in the menu. The number of panes depends on the number of entries.
-The visible entries are truncated to `bookmark-menu-length', but the
-strings returned are not."
- (let* ((f-height (/ (frame-height) 2))
- (pane-list
- (let (temp-pane-list
- (iter 0))
- (while entries
- (let (lst
- (count 0))
- (while (and (< count f-height) entries)
- (let ((str (car entries)))
- (setq lst (cons
- (cons
- (if (> (length str) bookmark-menu-length)
- (substring str 0 bookmark-menu-length)
- str)
- str)
- lst))
- (setq entries (cdr entries))
- (setq count (1+ count))))
- (setq iter (1+ iter))
- (setq
- temp-pane-list
- (cons
- (cons
- (format "-*- %s (%d) -*-" name iter)
- (nreverse lst))
- temp-pane-list))))
- (nreverse temp-pane-list))))
-
- ;; Return the menu:
- (cons (concat "-*- " name " -*-") pane-list)))
-
-
(defun bookmark-menu-popup-paned-menu (event name entries)
"Pop up multi-paned menu at EVENT, return string chosen from ENTRIES.
That is, ENTRIES is a list of strings which appear as the choices
in the menu.
-The number of panes depends on the number of entries."
- (interactive "e")
- (x-popup-menu event (bookmark-menu-build-paned-menu name entries)))
-
-
-(defun bookmark-menu-popup-paned-bookmark-menu (event name)
- "Pop up menu of bookmarks, return chosen bookmark.
-Pop up at EVENT, menu's name is NAME.
-The number of panes depends on the number of bookmarks."
- (bookmark-menu-popup-paned-menu event name (bookmark-all-names)))
-
-
-(defun bookmark-popup-menu-and-apply-function (func-sym menu-label event)
- ;; help function for making menus that need to apply a bookmark
- ;; function to a string.
- (let* ((choice (bookmark-menu-popup-paned-bookmark-menu
- event menu-label)))
- (if choice (apply func-sym (list choice)))))
-
-
-;;;###autoload
-(defun bookmark-menu-insert (event)
- "Insert the text of the file pointed to by bookmark BOOKMARK.
-You may have a problem using this function if the value of variable
-`bookmark-alist' is nil. If that happens, you need to load in some
-bookmarks. See help on function `bookmark-load' for more about
-this.
-
-Warning: this function only takes an EVENT as argument. Use the
-corresponding bookmark function from Lisp \(the one without the
-\"-menu-\" in its name\)."
- (interactive "e")
- (bookmark-popup-menu-and-apply-function
- 'bookmark-insert "Insert Bookmark Contents" event))
-
-
-;;;###autoload
-(defun bookmark-menu-jump (event)
- "Jump to bookmark BOOKMARK (a point in some file).
-You may have a problem using this function if the value of variable
-`bookmark-alist' is nil. If that happens, you need to load in some
-bookmarks. See help on function `bookmark-load' for more about
-this.
-
-Warning: this function only takes an EVENT as argument. Use the
-corresponding bookmark function from Lisp \(the one without the
-\"-menu-\" in its name\)."
- (interactive "e")
- (bookmark-popup-menu-and-apply-function
- 'bookmark-jump "Jump to Bookmark" event))
-
-
-;;;###autoload
-(defun bookmark-menu-locate (event)
- "Insert the name of the file associated with BOOKMARK.
-\(This is not the same as the contents of that file\).
-
-Warning: this function only takes an EVENT as argument. Use the
-corresponding bookmark function from Lisp \(the one without the
-\"-menu-\" in its name\)."
- (interactive "e")
- (bookmark-popup-menu-and-apply-function
- 'bookmark-insert-location "Insert Bookmark Location" event))
-
-
-;;;###autoload
-(defun bookmark-menu-rename (event)
- "Change the name of OLD-BOOKMARK to NEWNAME.
-If called from keyboard, prompts for OLD-BOOKMARK and NEWNAME.
-If called from menubar, OLD-BOOKMARK is selected from a menu, and
-prompts for NEWNAME.
-If called from Lisp, prompts for NEWNAME if only OLD-BOOKMARK was
-passed as an argument. If called with two strings, then no prompting
-is done. You must pass at least OLD-BOOKMARK when calling from Lisp.
-
-While you are entering the new name, consecutive C-w's insert
-consecutive words from the text of the buffer into the new bookmark
-name.
-
-Warning: this function only takes an EVENT as argument. Use the
-corresponding bookmark function from Lisp \(the one without the
-\"-menu-\" in its name\)."
- (interactive "e")
- (bookmark-popup-menu-and-apply-function
- 'bookmark-rename "Rename Bookmark" event))
-
-
-;;;###autoload
-(defun bookmark-menu-delete (event)
- "Delete the bookmark named NAME from the bookmark list.
-Removes only the first instance of a bookmark with that name. If
-there are one or more other bookmarks with the same name, they will
-not be deleted. Defaults to the \"current\" bookmark \(that is, the
-one most recently used in this file, if any\).
-
-Warning: this function only takes an EVENT as argument. Use the
-corresponding bookmark function from Lisp \(the one without the
-\"-menu-\" in its name\)."
- (interactive "e")
- (bookmark-popup-menu-and-apply-function
- 'bookmark-delete "Delete Bookmark" event))
+The number of panes depends on the number of entries.
+The visible entries are truncated to `bookmark-menu-length', but the
+strings returned are not."
+ (let ((f-height (/ (frame-height) 2))
+ (pane-list nil)
+ (iter 0))
+ (while entries
+ (let (lst
+ (count 0))
+ (while (and (< count f-height) entries)
+ (let ((str (car entries)))
+ (push (cons
+ (if (> (length str) bookmark-menu-length)
+ (substring str 0 bookmark-menu-length)
+ str)
+ str)
+ lst)
+ (setq entries (cdr entries))
+ (setq count (1+ count))))
+ (setq iter (1+ iter))
+ (push (cons
+ (format "-*- %s (%d) -*-" name iter)
+ (nreverse lst))
+ pane-list)))
+
+ ;; Popup the menu and return the string.
+ (x-popup-menu event (cons (concat "-*- " name " -*-")
+ (nreverse pane-list)))))
;; Thanks to Roland McGrath for fixing menubar.el so that the
;; Emacs menubar stuff.
;;;###autoload
-(defvar menu-bar-bookmark-map (make-sparse-keymap "Bookmark functions"))
+(defvar menu-bar-bookmark-map
+ (let ((map (make-sparse-keymap "Bookmark functions")))
+ (define-key map [load] '("Load a Bookmark File..." . bookmark-load))
+ (define-key map [write] '("Save Bookmarks As..." . bookmark-write))
+ (define-key map [save] '("Save Bookmarks" . bookmark-save))
+ (define-key map [edit] '("Edit Bookmark List" . bookmark-bmenu-list))
+ (define-key map [delete] '("Delete Bookmark" . bookmark-delete))
+ (define-key map [rename] '("Rename Bookmark" . bookmark-rename))
+ (define-key map [locate] '("Insert Location" . bookmark-locate))
+ (define-key map [insert] '("Insert Contents" . bookmark-insert))
+ (define-key map [set] '("Set Bookmark" . bookmark-set))
+ (define-key map [jump] '("Jump to Bookmark" . bookmark-jump))
+ map))
;;;###autoload
-(defalias 'menu-bar-bookmark-map (symbol-value 'menu-bar-bookmark-map))
+(defalias 'menu-bar-bookmark-map menu-bar-bookmark-map)
;; make bookmarks appear toward the right side of the menu.
(if (boundp 'menu-bar-final-items)
(cons 'bookmark menu-bar-final-items)))
(setq menu-bar-final-items '(bookmark)))
-;;;###autoload
-(define-key menu-bar-bookmark-map [load]
- '("Load a Bookmark File..." . bookmark-load))
-
-;;;###autoload
-(define-key menu-bar-bookmark-map [write]
- '("Save Bookmarks As..." . bookmark-write))
-
-;;;###autoload
-(define-key menu-bar-bookmark-map [save]
- '("Save Bookmarks" . bookmark-save))
-
-;;;###autoload
-(define-key menu-bar-bookmark-map [edit]
- '("Edit Bookmark List" . bookmark-bmenu-list))
-
-;;;###autoload
-(define-key menu-bar-bookmark-map [delete]
- '("Delete Bookmark" . bookmark-menu-delete))
-
-;;;###autoload
-(define-key menu-bar-bookmark-map [rename]
- '("Rename Bookmark" . bookmark-menu-rename))
-
-;;;###autoload
-(define-key menu-bar-bookmark-map [locate]
- '("Insert Location" . bookmark-menu-locate))
-
-;;;###autoload
-(define-key menu-bar-bookmark-map [insert]
- '("Insert Contents" . bookmark-menu-insert))
-
-;;;###autoload
-(define-key menu-bar-bookmark-map [set]
- '("Set Bookmark" . bookmark-set))
-
-;;;###autoload
-(define-key menu-bar-bookmark-map [jump]
- '("Jump to Bookmark" . bookmark-menu-jump))
-
;;;; end bookmark menu stuff ;;;;
\f
;;; Load Hook
(defvar bookmark-load-hook nil
- "Hook to run at the end of loading bookmark.")
+ "Hook run at the end of loading bookmark.")
;;; Exit Hook, called from kill-emacs-hook
(defvar bookmark-exit-hook nil
- "Hook to run when emacs exits")
+ "Hook run when emacs exits.")
(defun bookmark-exit-hook-internal ()
"Save bookmark state, if necessary, at Emacs exit time.
This also runs `bookmark-exit-hooks'."
- (and
- (progn (run-hooks 'bookmark-exit-hooks) t)
- bookmark-alist
- (bookmark-time-to-save-p t)
- (bookmark-save)))
+ (run-hooks 'bookmark-exit-hooks)
+ (and bookmark-alist
+ (bookmark-time-to-save-p t)
+ (bookmark-save)))
(add-hook 'kill-emacs-hook 'bookmark-exit-hook-internal)
(provide 'bookmark)
+;;; arch-tag: 139f519a-dd0c-4b8d-8b5d-f9fcf53ca8f6
;;; bookmark.el ends here