2001-07-16 12:23:00 +00:00
|
|
|
|
;;; bookmark.el --- set bookmarks, maybe annotate them, jump to them later
|
1993-08-10 20:35:31 +00:00
|
|
|
|
|
2005-08-06 22:13:43 +00:00
|
|
|
|
;; Copyright (C) 1993, 1994, 1995, 1996, 1997, 2001, 2002, 2003,
|
|
|
|
|
;; 2004, 2005 Free Software Foundation, Inc.
|
1993-08-10 20:35:31 +00:00
|
|
|
|
|
1996-01-05 21:57:54 +00:00
|
|
|
|
;; Author: Karl Fogel <kfogel@red-bean.com>
|
|
|
|
|
;; Maintainer: Karl Fogel <kfogel@red-bean.com>
|
1993-08-10 20:35:31 +00:00
|
|
|
|
;; Created: July, 1993
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
;; Keywords: bookmarks, placeholders, annotations
|
1993-08-10 20:35:31 +00:00
|
|
|
|
|
|
|
|
|
;; This file is part of GNU Emacs.
|
|
|
|
|
|
|
|
|
|
;; GNU Emacs is free software; you can redistribute it and/or modify
|
|
|
|
|
;; it under the terms of the GNU General Public License as published by
|
|
|
|
|
;; the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
|
;; any later version.
|
|
|
|
|
|
|
|
|
|
;; GNU Emacs is distributed in the hope that it will be useful,
|
|
|
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
;; GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
;; You should have received a copy of the GNU General Public License
|
1996-01-14 07:34:30 +00:00
|
|
|
|
;; along with GNU Emacs; see the file COPYING. If not, write to the
|
2005-07-04 23:32:44 +00:00
|
|
|
|
;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
|
|
|
;; Boston, MA 02110-1301, USA.
|
1996-01-14 07:34:30 +00:00
|
|
|
|
|
|
|
|
|
;;; Commentary:
|
|
|
|
|
|
|
|
|
|
;; This package is for setting "bookmarks" in files. A bookmark
|
|
|
|
|
;; associates a string with a location in a certain file. Thus, you
|
|
|
|
|
;; can navigate your way to that location by providing the string.
|
|
|
|
|
;; See the "User Variables" section for customizations.
|
1993-08-10 20:35:31 +00:00
|
|
|
|
|
|
|
|
|
;; Thanks to David Bremner <bremner@cs.sfu.ca> for thinking of and
|
|
|
|
|
;; then implementing the bookmark-current-bookmark idea. He even
|
1993-10-25 23:56:15 +00:00
|
|
|
|
;; sent *patches*, bless his soul...
|
1993-08-10 20:35:31 +00:00
|
|
|
|
|
|
|
|
|
;; Thanks to Gregory M. Saunders <saunders@cis.ohio-state.edu> for
|
|
|
|
|
;; fixing and improving bookmark-time-to-save-p.
|
|
|
|
|
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
;; Thanks go to Andrew V. Klein <avk@cig.mot.com> for the code that
|
|
|
|
|
;; sorts the alist before presenting it to the user (in bookmark-bmenu-list
|
1993-10-25 23:56:15 +00:00
|
|
|
|
;; and the menu-bar).
|
|
|
|
|
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
;; And much thanks to David Hughes <djh@harston.cv.com> for many small
|
|
|
|
|
;; suggestions and the code to implement them (like
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
;; bookmark-bmenu-check-position, and some of the Lucid compatibility
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
;; stuff).
|
|
|
|
|
|
1996-01-05 21:57:54 +00:00
|
|
|
|
;; Kudos (whatever they are) go to Jim Blandy <jimb@red-bean.com>
|
1993-10-25 23:56:15 +00:00
|
|
|
|
;; for his eminently sensible suggestion to separate bookmark-jump
|
|
|
|
|
;; into bookmark-jump and bookmark-jump-noselect, which made many
|
|
|
|
|
;; other things cleaner as well.
|
|
|
|
|
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
;; Thanks to Roland McGrath for encouragement and help with defining
|
|
|
|
|
;; autoloads on the menu-bar.
|
|
|
|
|
|
1995-08-17 19:37:52 +00:00
|
|
|
|
;; Jonathan Stigelman <stig@hackvan.com> gave patches for default
|
1993-10-25 23:56:15 +00:00
|
|
|
|
;; values in bookmark-jump and bookmark-set. Everybody please keep
|
|
|
|
|
;; all the keystrokes they save thereby and send them to him at the
|
|
|
|
|
;; end of each year :-) (No, seriously, thanks Jonathan!)
|
|
|
|
|
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
;; Buckets of gratitude to John Grabowski <johng@media.mit.edu> for
|
|
|
|
|
;; thinking up the annotations feature and implementing it so well.
|
|
|
|
|
|
1993-08-10 20:35:31 +00:00
|
|
|
|
;; Based on info-bookmark.el, by Karl Fogel and Ken Olstad
|
|
|
|
|
;; <olstad@msc.edu>.
|
|
|
|
|
|
1995-06-18 22:46:02 +00:00
|
|
|
|
;; Thanks to Mikio Nakajima <PBC01764@niftyserve.or.jp> for many bugs
|
|
|
|
|
;; reported and fixed.
|
|
|
|
|
|
1995-12-30 19:52:40 +00:00
|
|
|
|
;; Thank you, Michael Kifer, for contributing the XEmacs support.
|
|
|
|
|
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
;; Enough with the credits already, get on to the good stuff:
|
1993-08-10 20:35:31 +00:00
|
|
|
|
|
2001-01-12 22:49:40 +00:00
|
|
|
|
;; FAVORITE CHINESE RESTAURANT:
|
1993-08-10 20:35:31 +00:00
|
|
|
|
;; Boy, that's a tough one. Probably Hong Min, or maybe Emperor's
|
|
|
|
|
;; Choice (both in Chicago's Chinatown). Well, both. How about you?
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
2001-07-16 12:23:00 +00:00
|
|
|
|
;;; Code:
|
1993-08-10 20:35:31 +00:00
|
|
|
|
|
1996-01-14 07:34:30 +00:00
|
|
|
|
(require 'pp)
|
|
|
|
|
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
;;; Misc comments:
|
1993-08-10 20:35:31 +00:00
|
|
|
|
;;
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
;; If variable bookmark-use-annotations is non-nil, an annotation is
|
2001-01-12 22:49:40 +00:00
|
|
|
|
;; queried for when setting a bookmark.
|
1993-08-13 00:59:51 +00:00
|
|
|
|
;;
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
;; The bookmark list is sorted lexically by default, but you can turn
|
|
|
|
|
;; this off by setting bookmark-sort-flag to nil. If it is nil, then
|
|
|
|
|
;; the list will be presented in the order it is recorded
|
|
|
|
|
;; (chronologically), which is actually fairly useful as well.
|
1993-08-10 20:35:31 +00:00
|
|
|
|
|
1995-06-18 22:46:02 +00:00
|
|
|
|
;;; User Variables
|
|
|
|
|
|
1997-04-12 03:18:33 +00:00
|
|
|
|
(defgroup bookmark nil
|
1997-04-12 03:22:41 +00:00
|
|
|
|
"Setting, annotation and jumping to bookmarks."
|
1997-04-12 03:18:33 +00:00
|
|
|
|
:group 'matching)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defcustom bookmark-use-annotations nil
|
1997-04-12 03:22:41 +00:00
|
|
|
|
"*If non-nil, saving a bookmark queries for an annotation in a buffer."
|
1997-04-12 03:18:33 +00:00
|
|
|
|
:type 'boolean
|
|
|
|
|
:group 'bookmark)
|
1995-06-18 22:46:02 +00:00
|
|
|
|
|
|
|
|
|
|
1997-04-12 03:18:33 +00:00
|
|
|
|
(defcustom bookmark-save-flag t
|
1995-06-18 22:46:02 +00:00
|
|
|
|
"*Controls when Emacs saves bookmarks to a file.
|
1997-04-12 03:22:41 +00:00
|
|
|
|
--> nil means never save bookmarks, except when `bookmark-save' is
|
1995-06-18 22:46:02 +00:00
|
|
|
|
explicitly called \(\\[bookmark-save]\).
|
|
|
|
|
--> t means save bookmarks when Emacs is killed.
|
1996-01-04 23:28:24 +00:00
|
|
|
|
--> Otherwise, it should be a number that is the frequency with which
|
1995-06-18 22:46:02 +00:00
|
|
|
|
the bookmark list is saved \(i.e.: the number of times which
|
|
|
|
|
Emacs' bookmark list may be modified before it is automatically
|
|
|
|
|
saved.\). If it is a number, Emacs will also automatically save
|
|
|
|
|
bookmarks when it is killed.
|
|
|
|
|
|
|
|
|
|
Therefore, the way to get it to save every time you make or delete a
|
|
|
|
|
bookmark is to set this variable to 1 \(or 0, which produces the same
|
|
|
|
|
behavior.\)
|
|
|
|
|
|
|
|
|
|
To specify the file in which to save them, modify the variable
|
1997-04-12 03:22:41 +00:00
|
|
|
|
`bookmark-default-file', which is `~/.emacs.bmk' by default."
|
1998-06-24 08:48:57 +00:00
|
|
|
|
:type '(choice (const nil) integer (other t))
|
1997-04-12 03:18:33 +00:00
|
|
|
|
:group 'bookmark)
|
1995-06-18 22:46:02 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defconst bookmark-old-default-file "~/.emacs-bkmrks"
|
1997-04-12 03:22:41 +00:00
|
|
|
|
"*The `.emacs.bmk' file used to be called this name.")
|
1995-06-18 22:46:02 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;; defvarred to avoid a compilation warning:
|
|
|
|
|
(defvar bookmark-file nil
|
|
|
|
|
"Old name for `bookmark-default-file'.")
|
|
|
|
|
|
1997-04-12 03:18:33 +00:00
|
|
|
|
(defcustom bookmark-default-file
|
1995-06-18 22:46:02 +00:00
|
|
|
|
(if bookmark-file
|
|
|
|
|
;; In case user set `bookmark-file' in her .emacs:
|
|
|
|
|
bookmark-file
|
1996-09-01 19:03:37 +00:00
|
|
|
|
(convert-standard-filename "~/.emacs.bmk"))
|
1997-04-12 03:18:33 +00:00
|
|
|
|
"*File in which to save bookmarks by default."
|
|
|
|
|
:type 'file
|
|
|
|
|
:group 'bookmark)
|
1995-06-18 22:46:02 +00:00
|
|
|
|
|
|
|
|
|
|
1997-04-12 03:18:33 +00:00
|
|
|
|
(defcustom bookmark-version-control 'nospecial
|
1995-06-18 22:46:02 +00:00
|
|
|
|
"*Whether or not to make numbered backups of the bookmark file.
|
|
|
|
|
It can have four values: t, nil, `never', and `nospecial'.
|
|
|
|
|
The first three have the same meaning that they do for the
|
|
|
|
|
variable `version-control', and the final value `nospecial' means just
|
1997-04-12 03:18:33 +00:00
|
|
|
|
use the value of `version-control'."
|
1998-06-24 08:48:57 +00:00
|
|
|
|
:type '(choice (const nil) (const never) (const nospecial)
|
|
|
|
|
(other t))
|
1997-04-12 03:18:33 +00:00
|
|
|
|
:group 'bookmark)
|
1995-06-18 22:46:02 +00:00
|
|
|
|
|
|
|
|
|
|
1997-04-12 03:18:33 +00:00
|
|
|
|
(defcustom bookmark-completion-ignore-case t
|
|
|
|
|
"*Non-nil means bookmark functions ignore case in completion."
|
|
|
|
|
:type 'boolean
|
|
|
|
|
:group 'bookmark)
|
1995-06-18 22:46:02 +00:00
|
|
|
|
|
|
|
|
|
|
1997-04-12 03:18:33 +00:00
|
|
|
|
(defcustom bookmark-sort-flag t
|
1997-04-12 03:22:41 +00:00
|
|
|
|
"*Non-nil means that bookmarks will be displayed sorted by bookmark name.
|
|
|
|
|
Otherwise they will be displayed in LIFO order (that is, most
|
1997-04-12 03:18:33 +00:00
|
|
|
|
recently set ones come first, oldest ones come last)."
|
|
|
|
|
:type 'boolean
|
|
|
|
|
:group 'bookmark)
|
1995-06-18 22:46:02 +00:00
|
|
|
|
|
|
|
|
|
|
1997-04-12 03:18:33 +00:00
|
|
|
|
(defcustom bookmark-automatically-show-annotations t
|
(bookmark-automatically-show-annotations, bookmark-read-annotation-text-func): Doc fixes.
(bookmark-save): Improve argument/docstring consistency.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-alist-from-buffer, bookmark-upgrade-file-format-from-0,
bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format,
bookmark-kill-line, bookmark-read-annotation-mode,
bookmark-insert-current-bookmark, bookmark-jump, bookmark-exit-hook):
Fix typos in docstrings.
(bookmark-exit-hooks): Define as obsolete alias.
(bookmark-exit-hook-internal): Run `bookmark-exit-hook',
not `bookmark-exit-hooks'. Fix docstring.
(bookmark-bmenu-select): "?\ " -> "?\s".
2005-07-26 13:56:01 +00:00
|
|
|
|
"*Non-nil means show annotations when jumping to a bookmark."
|
1997-04-12 03:18:33 +00:00
|
|
|
|
:type 'boolean
|
|
|
|
|
:group 'bookmark)
|
1995-06-18 22:46:02 +00:00
|
|
|
|
|
|
|
|
|
|
1997-04-12 03:18:33 +00:00
|
|
|
|
(defcustom bookmark-bmenu-file-column 30
|
1995-06-18 22:46:02 +00:00
|
|
|
|
"*Column at which to display filenames in a buffer listing bookmarks.
|
1997-04-12 03:18:33 +00:00
|
|
|
|
You can toggle whether files are shown with \\<bookmark-bmenu-mode-map>\\[bookmark-bmenu-toggle-filenames]."
|
|
|
|
|
:type 'integer
|
|
|
|
|
:group 'bookmark)
|
1995-06-18 22:46:02 +00:00
|
|
|
|
|
|
|
|
|
|
1997-04-12 03:18:33 +00:00
|
|
|
|
(defcustom bookmark-bmenu-toggle-filenames t
|
1995-06-18 22:46:02 +00:00
|
|
|
|
"*Non-nil means show filenames when listing bookmarks.
|
|
|
|
|
This may result in truncated bookmark names. To disable this, put the
|
1997-04-12 03:22:41 +00:00
|
|
|
|
following in your `.emacs' file:
|
1995-06-18 22:46:02 +00:00
|
|
|
|
|
1997-04-12 03:18:33 +00:00
|
|
|
|
\(setq bookmark-bmenu-toggle-filenames nil\)"
|
|
|
|
|
:type 'boolean
|
|
|
|
|
:group 'bookmark)
|
1995-06-18 22:46:02 +00:00
|
|
|
|
|
|
|
|
|
|
1997-04-12 03:18:33 +00:00
|
|
|
|
(defcustom bookmark-menu-length 70
|
|
|
|
|
"*Maximum length of a bookmark name displayed on a popup menu."
|
|
|
|
|
:type 'integer
|
2002-11-18 00:15:37 +00:00
|
|
|
|
:group 'bookmark)
|
1995-06-18 22:46:02 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; No user-serviceable parts beyond this point.
|
1993-08-10 20:35:31 +00:00
|
|
|
|
|
1995-12-30 19:52:40 +00:00
|
|
|
|
;; Is it XEmacs?
|
|
|
|
|
(defconst bookmark-xemacsp
|
|
|
|
|
(string-match "\\(Lucid\\|Xemacs\\)" emacs-version))
|
|
|
|
|
|
|
|
|
|
|
1993-08-10 20:35:31 +00:00
|
|
|
|
;; Added for lucid emacs compatibility, db
|
|
|
|
|
(or (fboundp 'defalias) (fset 'defalias 'fset))
|
|
|
|
|
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
;; suggested for lucid compatibility by david hughes:
|
1995-06-18 22:46:02 +00:00
|
|
|
|
(or (fboundp 'frame-height) (defalias 'frame-height 'screen-height))
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
|
1995-12-30 19:52:40 +00:00
|
|
|
|
;; This variable is probably obsolete now...
|
|
|
|
|
(or (boundp 'baud-rate)
|
2001-01-12 22:49:40 +00:00
|
|
|
|
;; some random value higher than 9600
|
1995-12-30 19:52:40 +00:00
|
|
|
|
(setq baud-rate 19200))
|
|
|
|
|
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Keymap stuff:
|
1993-08-10 20:35:31 +00:00
|
|
|
|
|
1997-07-10 06:43:19 +00:00
|
|
|
|
;; Set up these bindings dumping time *only*;
|
|
|
|
|
;; if the user alters them, don't override the user when loading bookmark.el.
|
|
|
|
|
|
|
|
|
|
;;;###autoload (define-key ctl-x-map "rb" 'bookmark-jump)
|
|
|
|
|
;;;###autoload (define-key ctl-x-map "rm" 'bookmark-set)
|
|
|
|
|
;;;###autoload (define-key ctl-x-map "rl" 'bookmark-bmenu-list)
|
1993-08-10 20:35:31 +00:00
|
|
|
|
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
;;;###autoload
|
1993-08-14 19:49:27 +00:00
|
|
|
|
(defvar bookmark-map nil
|
|
|
|
|
"Keymap containing bindings to bookmark functions.
|
|
|
|
|
It is not bound to any key by default: to bind it
|
|
|
|
|
so that you have a bookmark prefix, just use `global-set-key' and bind a
|
|
|
|
|
key of your choice to `bookmark-map'. All interactive bookmark
|
1993-08-10 20:35:31 +00:00
|
|
|
|
functions have a binding in this keymap.")
|
|
|
|
|
|
2003-08-02 22:06:12 +00:00
|
|
|
|
;;;###autoload (define-prefix-command 'bookmark-map)
|
1993-08-10 20:35:31 +00:00
|
|
|
|
|
|
|
|
|
;; Read the help on all of these functions for details...
|
2003-08-02 22:06:12 +00:00
|
|
|
|
;;;###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)
|
1993-08-10 20:35:31 +00:00
|
|
|
|
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
|
|
|
|
;;; The annotation maps.
|
|
|
|
|
(defvar bookmark-read-annotation-mode-map (copy-keymap text-mode-map)
|
|
|
|
|
"Keymap for composing an annotation for a bookmark.")
|
|
|
|
|
|
|
|
|
|
(define-key bookmark-read-annotation-mode-map "\C-c\C-c"
|
|
|
|
|
'bookmark-send-annotation)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Core variables and data structures:
|
1993-08-14 19:52:32 +00:00
|
|
|
|
(defvar bookmark-alist ()
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
"Association list of bookmarks and their records.
|
1993-08-14 19:52:32 +00:00
|
|
|
|
You probably don't want to change the value of this alist yourself;
|
1995-06-18 22:46:02 +00:00
|
|
|
|
instead, let the various bookmark functions do it for you.
|
|
|
|
|
|
|
|
|
|
The format of the alist is
|
|
|
|
|
|
|
|
|
|
\(BOOKMARK1 BOOKMARK2 ...\)
|
|
|
|
|
|
|
|
|
|
where each BOOKMARK is of the form
|
|
|
|
|
|
|
|
|
|
\(NAME
|
|
|
|
|
\(filename . FILE\)
|
|
|
|
|
\(front-context-string . FRONT-STR\)
|
|
|
|
|
\(rear-context-string . REAR-STR\)
|
|
|
|
|
\(position . POS\)
|
|
|
|
|
\(info-node . POS\)
|
|
|
|
|
\(annotation . ANNOTATION\)\)
|
|
|
|
|
|
|
|
|
|
So the cdr of each bookmark is an alist too.
|
|
|
|
|
`info-node' is optional, by the way.")
|
1993-08-14 19:52:32 +00:00
|
|
|
|
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
(defvar bookmarks-already-loaded nil)
|
|
|
|
|
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
1993-08-10 20:35:31 +00:00
|
|
|
|
;; more stuff added by db.
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
|
2001-01-12 22:49:40 +00:00
|
|
|
|
(defvar bookmark-current-bookmark nil
|
1993-08-14 19:49:27 +00:00
|
|
|
|
"Name of bookmark most recently used in the current file.
|
|
|
|
|
It is buffer local, used to make moving a bookmark forward
|
1993-08-14 11:04:06 +00:00
|
|
|
|
through a file easier.")
|
1993-08-10 20:35:31 +00:00
|
|
|
|
|
|
|
|
|
(make-variable-buffer-local 'bookmark-current-bookmark)
|
|
|
|
|
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
1993-08-10 20:35:31 +00:00
|
|
|
|
(defvar bookmark-alist-modification-count 0
|
1993-08-14 19:49:27 +00:00
|
|
|
|
"Number of modifications to bookmark list since it was last saved.")
|
1993-08-10 20:35:31 +00:00
|
|
|
|
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
|
|
|
|
(defvar bookmark-search-size 16
|
1993-08-14 19:49:27 +00:00
|
|
|
|
"Length of the context strings recorded on either side of a bookmark.")
|
1993-08-10 20:35:31 +00:00
|
|
|
|
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
1993-08-10 20:35:31 +00:00
|
|
|
|
(defvar bookmark-current-point 0)
|
|
|
|
|
(defvar bookmark-yank-point 0)
|
|
|
|
|
(defvar bookmark-current-buffer nil)
|
|
|
|
|
|
2005-07-03 16:08:19 +00:00
|
|
|
|
(defvar Info-current-node)
|
|
|
|
|
(defvar Info-suffix-list)
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
|
|
|
|
;; Helper functions.
|
|
|
|
|
|
|
|
|
|
;; Only functions on this page and the next one (file formats) need to
|
|
|
|
|
;; know anything about the format of bookmark-alist entries.
|
|
|
|
|
;; Everyone else should go through them.
|
|
|
|
|
|
|
|
|
|
(defun bookmark-name-from-full-record (full-record)
|
1995-06-18 22:46:02 +00:00
|
|
|
|
"Return name of FULL-RECORD \(an alist element instead of a string\)."
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(car full-record))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun bookmark-all-names ()
|
|
|
|
|
"Return a list of all current bookmark names."
|
|
|
|
|
(bookmark-maybe-load-default-file)
|
|
|
|
|
(mapcar
|
|
|
|
|
(lambda (full-record)
|
|
|
|
|
(bookmark-name-from-full-record full-record))
|
|
|
|
|
bookmark-alist))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun bookmark-get-bookmark (bookmark)
|
(bookmark-automatically-show-annotations, bookmark-read-annotation-text-func): Doc fixes.
(bookmark-save): Improve argument/docstring consistency.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-alist-from-buffer, bookmark-upgrade-file-format-from-0,
bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format,
bookmark-kill-line, bookmark-read-annotation-mode,
bookmark-insert-current-bookmark, bookmark-jump, bookmark-exit-hook):
Fix typos in docstrings.
(bookmark-exit-hooks): Define as obsolete alias.
(bookmark-exit-hook-internal): Run `bookmark-exit-hook',
not `bookmark-exit-hooks'. Fix docstring.
(bookmark-bmenu-select): "?\ " -> "?\s".
2005-07-26 13:56:01 +00:00
|
|
|
|
"Return the full entry for BOOKMARK in `bookmark-alist'.
|
2001-03-28 14:51:26 +00:00
|
|
|
|
If BOOKMARK is not a string, return nil."
|
|
|
|
|
(when (stringp bookmark)
|
2003-12-29 19:04:08 +00:00
|
|
|
|
(assoc-string bookmark bookmark-alist bookmark-completion-ignore-case)))
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun bookmark-get-bookmark-record (bookmark)
|
(bookmark-automatically-show-annotations, bookmark-read-annotation-text-func): Doc fixes.
(bookmark-save): Improve argument/docstring consistency.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-alist-from-buffer, bookmark-upgrade-file-format-from-0,
bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format,
bookmark-kill-line, bookmark-read-annotation-mode,
bookmark-insert-current-bookmark, bookmark-jump, bookmark-exit-hook):
Fix typos in docstrings.
(bookmark-exit-hooks): Define as obsolete alias.
(bookmark-exit-hook-internal): Run `bookmark-exit-hook',
not `bookmark-exit-hooks'. Fix docstring.
(bookmark-bmenu-select): "?\ " -> "?\s".
2005-07-26 13:56:01 +00:00
|
|
|
|
"Return the guts of the entry for BOOKMARK in `bookmark-alist'.
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
That is, all information but the name."
|
|
|
|
|
(car (cdr (bookmark-get-bookmark bookmark))))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun bookmark-set-name (bookmark newname)
|
|
|
|
|
"Set BOOKMARK's name to NEWNAME."
|
(bookmark-load): Use `bookmark-import-new-list' to
load the new list carefully, renaming bookmarks as necessary.
In docstring, mention new renaming behavior.
Optional arg OVERWRITE replaces inaccurately-named REVERT.
If file loaded was bookmark-default-file, then set
bookmarks-already-loaded to t.
(bookmark-import-new-list): New func.
(bookmark-maybe-rename): New func, helper to above.
(bookmark-set-name): Accept bookmark as either string (behaves
same as before) or list (treat it as a bookmark record).
(bookmark-set, bookmark-maybe-load-default-file)
(bookmark-jump-noselect, bookmark-rename)
(bookmark-show-annotation): Discard pointless `progn's.
(bookmark-bmenu-mark, bookmark-bmenu-unmark)
(bookmark-bmenu-backup-unmark, bookmark-bmenu-delete-backwards):
Renormalize position after all else is done.
(bookmark-edit-annotation-mode, bookmark-bmenu-list)
(bookmark-show-annotation, bookmark-show-all-annotations):
Use `x' instead of `(not (eq x nil))'.
(bookmark-yank-word): Inner save-excursion changed to progn.
(bookmark-send-annotation, bookmark-send-edited-annotation)
(bookmark-insert): Use buffer-string instead of buffer-substring.
(bookmark-make-cell): Make sure annotation and info-node strings
contain no text properties.
(bookmark-relocate): Remember to rebuild bmenu buffer after a
bookmark has been relocated.
(bookmark-bmenu-check-position): Return a meaningful value --
callers have apparently been assuming this anyway.
(bookmark-build-xemacs-menu): Unused function deleted.
(bookmark-version): Removed this variable; the Emacs version suffices.
1997-08-22 19:14:10 +00:00
|
|
|
|
(setcar
|
|
|
|
|
(if (stringp bookmark) (bookmark-get-bookmark bookmark) bookmark)
|
|
|
|
|
newname))
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun bookmark-get-annotation (bookmark)
|
|
|
|
|
"Return the annotation of BOOKMARK, or nil if none."
|
|
|
|
|
(cdr (assq 'annotation (bookmark-get-bookmark-record bookmark))))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun bookmark-set-annotation (bookmark ann)
|
1995-06-18 22:46:02 +00:00
|
|
|
|
"Set the annotation of BOOKMARK to ANN."
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(let ((cell (assq 'annotation (bookmark-get-bookmark-record bookmark))))
|
|
|
|
|
(if cell
|
|
|
|
|
(setcdr cell ann)
|
|
|
|
|
(nconc (bookmark-get-bookmark-record bookmark)
|
|
|
|
|
(list (cons 'annotation ann))))))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun bookmark-get-filename (bookmark)
|
|
|
|
|
"Return the full filename of BOOKMARK."
|
|
|
|
|
(cdr (assq 'filename (bookmark-get-bookmark-record bookmark))))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun bookmark-set-filename (bookmark filename)
|
|
|
|
|
"Set the full filename of BOOKMARK to FILENAME."
|
|
|
|
|
(let ((cell (assq 'filename (bookmark-get-bookmark-record bookmark))))
|
|
|
|
|
(if cell
|
|
|
|
|
(setcdr cell filename)
|
|
|
|
|
(nconc (bookmark-get-bookmark-record bookmark)
|
2004-06-13 01:59:21 +00:00
|
|
|
|
(list (cons 'filename filename))))
|
|
|
|
|
(setq bookmark-alist-modification-count
|
|
|
|
|
(1+ bookmark-alist-modification-count))
|
|
|
|
|
(if (bookmark-time-to-save-p)
|
|
|
|
|
(bookmark-save))))
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun bookmark-get-position (bookmark)
|
|
|
|
|
"Return the position \(i.e.: point\) of BOOKMARK."
|
|
|
|
|
(cdr (assq 'position (bookmark-get-bookmark-record bookmark))))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun bookmark-set-position (bookmark position)
|
|
|
|
|
"Set the position \(i.e.: point\) of BOOKMARK to POSITION."
|
|
|
|
|
(let ((cell (assq 'position (bookmark-get-bookmark-record bookmark))))
|
|
|
|
|
(if cell
|
|
|
|
|
(setcdr cell position)
|
|
|
|
|
(nconc (bookmark-get-bookmark-record bookmark)
|
|
|
|
|
(list (cons 'position position))))))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun bookmark-get-front-context-string (bookmark)
|
|
|
|
|
"Return the front-context-string of BOOKMARK."
|
|
|
|
|
(cdr (assq 'front-context-string (bookmark-get-bookmark-record bookmark))))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun bookmark-set-front-context-string (bookmark string)
|
|
|
|
|
"Set the front-context-string of BOOKMARK to STRING."
|
|
|
|
|
(let ((cell (assq 'front-context-string
|
|
|
|
|
(bookmark-get-bookmark-record bookmark))))
|
|
|
|
|
(if cell
|
|
|
|
|
(setcdr cell string)
|
|
|
|
|
(nconc (bookmark-get-bookmark-record bookmark)
|
|
|
|
|
(list (cons 'front-context-string string))))))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun bookmark-get-rear-context-string (bookmark)
|
|
|
|
|
"Return the rear-context-string of BOOKMARK."
|
|
|
|
|
(cdr (assq 'rear-context-string (bookmark-get-bookmark-record bookmark))))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun bookmark-set-rear-context-string (bookmark string)
|
|
|
|
|
"Set the rear-context-string of BOOKMARK to STRING."
|
|
|
|
|
(let ((cell (assq 'rear-context-string
|
|
|
|
|
(bookmark-get-bookmark-record bookmark))))
|
|
|
|
|
(if cell
|
|
|
|
|
(setcdr cell string)
|
|
|
|
|
(nconc (bookmark-get-bookmark-record bookmark)
|
|
|
|
|
(list (cons 'rear-context-string string))))))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun bookmark-get-info-node (bookmark)
|
1995-06-18 22:46:02 +00:00
|
|
|
|
"Get the info node associated with BOOKMARK."
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(cdr (assq 'info-node (bookmark-get-bookmark-record bookmark))))
|
2001-01-12 22:49:40 +00:00
|
|
|
|
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
|
|
|
|
(defun bookmark-set-info-node (bookmark node)
|
|
|
|
|
"Set the Info node of BOOKMARK to NODE."
|
|
|
|
|
(let ((cell (assq 'info-node
|
|
|
|
|
(bookmark-get-bookmark-record bookmark))))
|
|
|
|
|
(if cell
|
|
|
|
|
(setcdr cell node)
|
|
|
|
|
(nconc (bookmark-get-bookmark-record bookmark)
|
1996-05-08 02:22:12 +00:00
|
|
|
|
(list (cons 'info-node node)))))
|
|
|
|
|
|
|
|
|
|
(message "%S" (assq 'info-node (bookmark-get-bookmark-record bookmark)))
|
(bookmark-automatically-show-annotations, bookmark-read-annotation-text-func): Doc fixes.
(bookmark-save): Improve argument/docstring consistency.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-alist-from-buffer, bookmark-upgrade-file-format-from-0,
bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format,
bookmark-kill-line, bookmark-read-annotation-mode,
bookmark-insert-current-bookmark, bookmark-jump, bookmark-exit-hook):
Fix typos in docstrings.
(bookmark-exit-hooks): Define as obsolete alias.
(bookmark-exit-hook-internal): Run `bookmark-exit-hook',
not `bookmark-exit-hooks'. Fix docstring.
(bookmark-bmenu-select): "?\ " -> "?\s".
2005-07-26 13:56:01 +00:00
|
|
|
|
(sit-for 4))
|
2001-01-12 22:49:40 +00:00
|
|
|
|
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
1995-03-13 22:50:35 +00:00
|
|
|
|
(defvar bookmark-history nil
|
|
|
|
|
"The history list for bookmark functions.")
|
|
|
|
|
|
|
|
|
|
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(defun bookmark-completing-read (prompt &optional default)
|
|
|
|
|
"Prompting with PROMPT, read a bookmark name in completion.
|
|
|
|
|
PROMPT will get a \": \" stuck on the end no matter what, so you
|
|
|
|
|
probably don't want to include one yourself.
|
|
|
|
|
Optional second arg DEFAULT is a string to return if the user enters
|
|
|
|
|
the empty string."
|
|
|
|
|
(bookmark-maybe-load-default-file) ; paranoia
|
(bookmark-completing-read): Use a popup menu if activated from the mouse.
Return a string, instead of a list of one string.
(bookmark-edit-annotation): Remove unused vars.
(bookmark-jump, bookmark-relocate, bookmark-insert-location)
(bookmark-rename, bookmark-insert, bookmark-delete): Adjust calls
to bookmark-completing-read.
(bookmark-bmenu-show-filenames, bookmark-bmenu-hide-filenames)
(bookmark-bmenu-mark, bookmark-bmenu-select, bookmark-bmenu-unmark)
(bookmark-bmenu-delete, bookmark-bmenu-list): Use inhibit-read-only
and erase-buffer.
(bookmark-menu-delete, bookmark-menu-rename, bookmark-menu-locate)
(bookmark-menu-jump, bookmark-menu-insert)
(bookmark-popup-menu-and-apply-function)
(bookmark-menu-popup-paned-bookmark-menu): Remove.
(bookmark-menu-build-paned-menu): Remove by folding it into
bookmark-menu-popup-paned-menu.
(menu-bar-bookmark-map): Move the define-key statements here.
Use the "non-menu" commands since they now pop up a menu if needed.
(bookmark-exit-hook-internal): Simplify.
2003-08-11 17:30:47 +00:00
|
|
|
|
(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))))
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
|
|
|
|
|
1995-03-13 22:50:35 +00:00
|
|
|
|
(defmacro bookmark-maybe-historicize-string (string)
|
|
|
|
|
"Put STRING into the bookmark prompt history, if caller non-interactive.
|
|
|
|
|
We need this because sometimes bookmark functions are invoked from
|
|
|
|
|
menus, so `completing-read' never gets a chance to set `bookmark-history'."
|
2001-01-12 22:49:40 +00:00
|
|
|
|
`(or
|
|
|
|
|
(interactive-p)
|
|
|
|
|
(setq bookmark-history (cons ,string bookmark-history))))
|
1995-03-13 22:50:35 +00:00
|
|
|
|
|
|
|
|
|
|
1996-05-08 02:22:12 +00:00
|
|
|
|
(defun bookmark-make (name &optional annotation overwrite info-node)
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
"Make a bookmark named NAME.
|
|
|
|
|
Optional second arg ANNOTATION gives it an annotation.
|
|
|
|
|
Optional third arg OVERWRITE means replace any existing bookmarks with
|
1996-05-08 02:22:12 +00:00
|
|
|
|
this name.
|
|
|
|
|
Optional fourth arg INFO-NODE means this bookmark is at info node
|
|
|
|
|
INFO-NODE, so record this fact in the bookmark's entry."
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(bookmark-maybe-load-default-file)
|
1995-07-17 23:19:51 +00:00
|
|
|
|
(let ((stripped-name (copy-sequence name)))
|
1995-12-30 19:52:40 +00:00
|
|
|
|
(or bookmark-xemacsp
|
|
|
|
|
;; XEmacs's `set-text-properties' doesn't work on
|
|
|
|
|
;; free-standing strings, apparently.
|
|
|
|
|
(set-text-properties 0 (length stripped-name) nil stripped-name))
|
1995-07-17 23:19:51 +00:00
|
|
|
|
(if (and (bookmark-get-bookmark stripped-name) (not overwrite))
|
1996-01-04 23:28:24 +00:00
|
|
|
|
;; already existing bookmark under that name and
|
1995-07-17 23:19:51 +00:00
|
|
|
|
;; no prefix arg means just overwrite old bookmark
|
|
|
|
|
(setcdr (bookmark-get-bookmark stripped-name)
|
1996-05-08 02:22:12 +00:00
|
|
|
|
(list (bookmark-make-cell annotation info-node)))
|
2001-01-12 22:49:40 +00:00
|
|
|
|
|
1995-07-17 23:19:51 +00:00
|
|
|
|
;; otherwise just cons it onto the front (either the bookmark
|
|
|
|
|
;; doesn't exist already, or there is no prefix arg. In either
|
|
|
|
|
;; case, we want the new bookmark consed onto the alist...)
|
2001-01-12 22:49:40 +00:00
|
|
|
|
|
1995-07-17 23:19:51 +00:00
|
|
|
|
(setq bookmark-alist
|
|
|
|
|
(cons
|
2001-01-12 22:49:40 +00:00
|
|
|
|
(list stripped-name
|
1996-05-08 02:22:12 +00:00
|
|
|
|
(bookmark-make-cell annotation info-node))
|
1995-07-17 23:19:51 +00:00
|
|
|
|
bookmark-alist)))
|
2001-01-12 22:49:40 +00:00
|
|
|
|
|
1995-07-17 23:19:51 +00:00
|
|
|
|
;; Added by db
|
|
|
|
|
(setq bookmark-current-bookmark stripped-name)
|
|
|
|
|
(setq bookmark-alist-modification-count
|
|
|
|
|
(1+ bookmark-alist-modification-count))
|
|
|
|
|
(if (bookmark-time-to-save-p)
|
|
|
|
|
(bookmark-save))))
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
|
|
|
|
|
1996-05-08 02:22:12 +00:00
|
|
|
|
(defun bookmark-make-cell (annotation &optional info-node)
|
1995-06-18 22:46:02 +00:00
|
|
|
|
"Return the record part of a new bookmark, given ANNOTATION.
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
Must be at the correct position in the buffer in which the bookmark is
|
1996-05-08 02:22:12 +00:00
|
|
|
|
being set. This might change someday.
|
|
|
|
|
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
|
2001-11-27 15:52:52 +00:00
|
|
|
|
`((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)))))
|
1996-05-08 02:22:12 +00:00
|
|
|
|
|
|
|
|
|
;; Now fill in the optional parts:
|
(bookmark-load): Use `bookmark-import-new-list' to
load the new list carefully, renaming bookmarks as necessary.
In docstring, mention new renaming behavior.
Optional arg OVERWRITE replaces inaccurately-named REVERT.
If file loaded was bookmark-default-file, then set
bookmarks-already-loaded to t.
(bookmark-import-new-list): New func.
(bookmark-maybe-rename): New func, helper to above.
(bookmark-set-name): Accept bookmark as either string (behaves
same as before) or list (treat it as a bookmark record).
(bookmark-set, bookmark-maybe-load-default-file)
(bookmark-jump-noselect, bookmark-rename)
(bookmark-show-annotation): Discard pointless `progn's.
(bookmark-bmenu-mark, bookmark-bmenu-unmark)
(bookmark-bmenu-backup-unmark, bookmark-bmenu-delete-backwards):
Renormalize position after all else is done.
(bookmark-edit-annotation-mode, bookmark-bmenu-list)
(bookmark-show-annotation, bookmark-show-all-annotations):
Use `x' instead of `(not (eq x nil))'.
(bookmark-yank-word): Inner save-excursion changed to progn.
(bookmark-send-annotation, bookmark-send-edited-annotation)
(bookmark-insert): Use buffer-string instead of buffer-substring.
(bookmark-make-cell): Make sure annotation and info-node strings
contain no text properties.
(bookmark-relocate): Remember to rebuild bmenu buffer after a
bookmark has been relocated.
(bookmark-bmenu-check-position): Return a meaningful value --
callers have apparently been assuming this anyway.
(bookmark-build-xemacs-menu): Unused function deleted.
(bookmark-version): Removed this variable; the Emacs version suffices.
1997-08-22 19:14:10 +00:00
|
|
|
|
|
|
|
|
|
;; Take no chances with text properties
|
|
|
|
|
(set-text-properties 0 (length annotation) nil annotation)
|
|
|
|
|
(set-text-properties 0 (length info-node) nil info-node)
|
|
|
|
|
|
1996-05-08 02:22:12 +00:00
|
|
|
|
(if annotation
|
|
|
|
|
(nconc the-record (list (cons 'annotation annotation))))
|
|
|
|
|
(if info-node
|
|
|
|
|
(nconc the-record (list (cons 'info-node info-node))))
|
|
|
|
|
|
|
|
|
|
;; Finally, return the completed record.
|
|
|
|
|
the-record))
|
2001-01-12 22:49:40 +00:00
|
|
|
|
|
|
|
|
|
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
|
|
|
|
;;; File format stuff
|
|
|
|
|
|
|
|
|
|
;; The OLD format of the bookmark-alist was:
|
|
|
|
|
;;
|
|
|
|
|
;; ((bookmark-name (filename
|
|
|
|
|
;; string-in-front
|
|
|
|
|
;; string-behind
|
|
|
|
|
;; point))
|
|
|
|
|
;; ...)
|
|
|
|
|
;;
|
|
|
|
|
;; The NEW format of the bookmark-alist is:
|
|
|
|
|
;;
|
|
|
|
|
;; ((bookmark-name ((filename . FILENAME)
|
|
|
|
|
;; (front-context-string . string-in-front)
|
|
|
|
|
;; (rear-context-string . string-behind)
|
|
|
|
|
;; (position . POINT)
|
|
|
|
|
;; (annotation . annotation)
|
|
|
|
|
;; (whatever . VALUE)
|
|
|
|
|
;; ...
|
|
|
|
|
;; ))
|
|
|
|
|
;; ...)
|
|
|
|
|
;;
|
|
|
|
|
;;
|
|
|
|
|
;; I switched to using an internal as well as external alist because I
|
|
|
|
|
;; felt that would be a more flexible framework in which to add
|
|
|
|
|
;; features. It means that the order in which values appear doesn't
|
|
|
|
|
;; matter, and it means that arbitrary values can be added without
|
|
|
|
|
;; risk of interfering with existing ones.
|
|
|
|
|
;;
|
|
|
|
|
;; BOOKMARK-NAME is the string the user gives the bookmark and
|
2001-01-12 22:49:40 +00:00
|
|
|
|
;; accesses it by from then on.
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
;;
|
|
|
|
|
;; FILENAME is the location of the file in which the bookmark is set.
|
|
|
|
|
;;
|
|
|
|
|
;; STRING-IN-FRONT is a string of `bookmark-search-size' chars of
|
|
|
|
|
;; context in front of the point at which the bookmark is set.
|
|
|
|
|
;;
|
2001-01-12 22:49:40 +00:00
|
|
|
|
;; STRING-BEHIND is the same thing, but after the point.
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
;;
|
|
|
|
|
;; The context strings exist so that modifications to a file don't
|
2001-01-12 22:49:40 +00:00
|
|
|
|
;; necessarily cause a bookmark's position to be invalidated.
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
;; bookmark-jump will search for STRING-BEHIND and STRING-IN-FRONT in
|
|
|
|
|
;; case the file has changed since the bookmark was set. It will
|
|
|
|
|
;; attempt to place the user before the changes, if there were any.
|
1996-05-08 02:22:12 +00:00
|
|
|
|
;; ANNOTATION is the annotation for the bookmark; it may not exist
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
;; (for backward compatibility), be nil (no annotation), or be a
|
|
|
|
|
;; string.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defconst bookmark-file-format-version 1
|
|
|
|
|
"The current version of the format used by bookmark files.
|
|
|
|
|
You should never need to change this.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defconst bookmark-end-of-version-stamp-marker
|
|
|
|
|
"-*- End Of Bookmark File Format Version Stamp -*-\n"
|
|
|
|
|
"This string marks the end of the version stamp in a bookmark file.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun bookmark-alist-from-buffer ()
|
(bookmark-automatically-show-annotations, bookmark-read-annotation-text-func): Doc fixes.
(bookmark-save): Improve argument/docstring consistency.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-alist-from-buffer, bookmark-upgrade-file-format-from-0,
bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format,
bookmark-kill-line, bookmark-read-annotation-mode,
bookmark-insert-current-bookmark, bookmark-jump, bookmark-exit-hook):
Fix typos in docstrings.
(bookmark-exit-hooks): Define as obsolete alias.
(bookmark-exit-hook-internal): Run `bookmark-exit-hook',
not `bookmark-exit-hooks'. Fix docstring.
(bookmark-bmenu-select): "?\ " -> "?\s".
2005-07-26 13:56:01 +00:00
|
|
|
|
"Return a `bookmark-alist' (in any format) from the current buffer.
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
The buffer must of course contain bookmark format information.
|
|
|
|
|
Does not care from where in the buffer it is called, and does not
|
|
|
|
|
affect point."
|
|
|
|
|
(save-excursion
|
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
(if (search-forward bookmark-end-of-version-stamp-marker nil t)
|
|
|
|
|
(read (current-buffer))
|
|
|
|
|
;; Else we're dealing with format version 0
|
|
|
|
|
(if (search-forward "(" nil t)
|
|
|
|
|
(progn
|
|
|
|
|
(forward-char -1)
|
|
|
|
|
(read (current-buffer)))
|
|
|
|
|
;; Else no hope of getting information here.
|
1996-01-25 06:02:21 +00:00
|
|
|
|
(error "Not bookmark format")))))
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun bookmark-upgrade-version-0-alist (old-list)
|
1995-06-18 22:46:02 +00:00
|
|
|
|
"Upgrade a version 0 alist OLD-LIST to the current version."
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(mapcar
|
|
|
|
|
(lambda (bookmark)
|
|
|
|
|
(let* ((name (car bookmark))
|
|
|
|
|
(record (car (cdr bookmark)))
|
|
|
|
|
(filename (nth 0 record))
|
|
|
|
|
(front-str (nth 1 record))
|
|
|
|
|
(rear-str (nth 2 record))
|
|
|
|
|
(position (nth 3 record))
|
|
|
|
|
(ann (nth 4 record)))
|
|
|
|
|
(list
|
|
|
|
|
name
|
2001-11-27 15:52:52 +00:00
|
|
|
|
`((filename . ,filename)
|
|
|
|
|
(front-context-string . ,(or front-str ""))
|
|
|
|
|
(rear-context-string . ,(or rear-str ""))
|
|
|
|
|
(position . ,position)
|
|
|
|
|
(annotation . ,ann)))))
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
old-list))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun bookmark-upgrade-file-format-from-0 ()
|
|
|
|
|
"Upgrade a bookmark file of format 0 (the original format) to format 1.
|
(bookmark-automatically-show-annotations, bookmark-read-annotation-text-func): Doc fixes.
(bookmark-save): Improve argument/docstring consistency.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-alist-from-buffer, bookmark-upgrade-file-format-from-0,
bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format,
bookmark-kill-line, bookmark-read-annotation-mode,
bookmark-insert-current-bookmark, bookmark-jump, bookmark-exit-hook):
Fix typos in docstrings.
(bookmark-exit-hooks): Define as obsolete alias.
(bookmark-exit-hook-internal): Run `bookmark-exit-hook',
not `bookmark-exit-hooks'. Fix docstring.
(bookmark-bmenu-select): "?\ " -> "?\s".
2005-07-26 13:56:01 +00:00
|
|
|
|
This expects to be called from `point-min' in a bookmark file."
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(message "Upgrading bookmark format from 0 to %d..."
|
|
|
|
|
bookmark-file-format-version)
|
|
|
|
|
(let* ((old-list (bookmark-alist-from-buffer))
|
|
|
|
|
(new-list (bookmark-upgrade-version-0-alist old-list)))
|
|
|
|
|
(delete-region (point-min) (point-max))
|
|
|
|
|
(bookmark-insert-file-format-version-stamp)
|
|
|
|
|
(pp new-list (current-buffer))
|
|
|
|
|
(save-buffer))
|
|
|
|
|
(goto-char (point-min))
|
1996-01-05 21:57:54 +00:00
|
|
|
|
(message "Upgrading bookmark format from 0 to %d...done"
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
bookmark-file-format-version)
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun bookmark-grok-file-format-version ()
|
|
|
|
|
"Return an integer which is the file-format version of this bookmark file.
|
(bookmark-automatically-show-annotations, bookmark-read-annotation-text-func): Doc fixes.
(bookmark-save): Improve argument/docstring consistency.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-alist-from-buffer, bookmark-upgrade-file-format-from-0,
bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format,
bookmark-kill-line, bookmark-read-annotation-mode,
bookmark-insert-current-bookmark, bookmark-jump, bookmark-exit-hook):
Fix typos in docstrings.
(bookmark-exit-hooks): Define as obsolete alias.
(bookmark-exit-hook-internal): Run `bookmark-exit-hook',
not `bookmark-exit-hooks'. Fix docstring.
(bookmark-bmenu-select): "?\ " -> "?\s".
2005-07-26 13:56:01 +00:00
|
|
|
|
This expects to be called from `point-min' in a bookmark file."
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(if (looking-at "^;;;;")
|
|
|
|
|
(save-excursion
|
|
|
|
|
(save-match-data
|
|
|
|
|
(re-search-forward "[0-9]")
|
|
|
|
|
(forward-char -1)
|
|
|
|
|
(read (current-buffer))))
|
|
|
|
|
;; Else this is format version 0, the original one, which didn't
|
|
|
|
|
;; even have version stamps.
|
|
|
|
|
0))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun bookmark-maybe-upgrade-file-format ()
|
|
|
|
|
"Check the file-format version of this bookmark file.
|
|
|
|
|
If the version is not up-to-date, upgrade it automatically.
|
(bookmark-automatically-show-annotations, bookmark-read-annotation-text-func): Doc fixes.
(bookmark-save): Improve argument/docstring consistency.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-alist-from-buffer, bookmark-upgrade-file-format-from-0,
bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format,
bookmark-kill-line, bookmark-read-annotation-mode,
bookmark-insert-current-bookmark, bookmark-jump, bookmark-exit-hook):
Fix typos in docstrings.
(bookmark-exit-hooks): Define as obsolete alias.
(bookmark-exit-hook-internal): Run `bookmark-exit-hook',
not `bookmark-exit-hooks'. Fix docstring.
(bookmark-bmenu-select): "?\ " -> "?\s".
2005-07-26 13:56:01 +00:00
|
|
|
|
This expects to be called from `point-min' in a bookmark file."
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(let ((version (bookmark-grok-file-format-version)))
|
|
|
|
|
(cond
|
|
|
|
|
((= version bookmark-file-format-version)
|
|
|
|
|
) ; home free -- version is current
|
|
|
|
|
((= version 0)
|
|
|
|
|
(bookmark-upgrade-file-format-from-0))
|
|
|
|
|
(t
|
1996-01-25 06:02:21 +00:00
|
|
|
|
(error "Bookmark file format version strangeness")))))
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun bookmark-insert-file-format-version-stamp ()
|
1996-05-09 17:34:55 +00:00
|
|
|
|
"Insert text indicating current version of bookmark file format."
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(insert
|
|
|
|
|
(format ";;;; Emacs Bookmark Format Version %d ;;;;\n"
|
|
|
|
|
bookmark-file-format-version))
|
|
|
|
|
(insert ";;; This format is meant to be slightly human-readable;\n"
|
|
|
|
|
";;; nevertheless, you probably don't want to edit it.\n"
|
|
|
|
|
";;; "
|
|
|
|
|
bookmark-end-of-version-stamp-marker))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; end file-format stuff
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Core code:
|
|
|
|
|
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
;;;###autoload
|
1995-06-18 22:46:02 +00:00
|
|
|
|
(defun bookmark-set (&optional name parg)
|
|
|
|
|
"Set a bookmark named NAME inside a file.
|
|
|
|
|
If name is nil, then the user will be prompted.
|
1993-08-14 19:49:27 +00:00
|
|
|
|
With prefix arg, will not overwrite a bookmark that has the same name
|
|
|
|
|
as NAME if such a bookmark already exists, but instead will \"push\"
|
|
|
|
|
the new bookmark onto the bookmark alist. Thus the most recently set
|
|
|
|
|
bookmark with name NAME would be the one in effect at any given time,
|
|
|
|
|
but the others are still there, should you decide to delete the most
|
|
|
|
|
recent one.
|
1993-08-10 20:35:31 +00:00
|
|
|
|
|
|
|
|
|
To yank words from the text of the buffer and use them as part of the
|
1993-08-14 19:49:27 +00:00
|
|
|
|
bookmark name, type C-w while setting a bookmark. Successive C-w's
|
1993-08-10 20:35:31 +00:00
|
|
|
|
yank successive words.
|
|
|
|
|
|
1995-03-13 22:50:35 +00:00
|
|
|
|
Typing C-u inserts the name of the last bookmark used in the buffer
|
|
|
|
|
\(as an aid in using a single bookmark name to track your progress
|
|
|
|
|
through a large file\). If no bookmark was used, then C-u inserts the
|
|
|
|
|
name of the file being visited.
|
1993-08-10 20:35:31 +00:00
|
|
|
|
|
|
|
|
|
Use \\[bookmark-delete] to remove bookmarks \(you give it a name,
|
|
|
|
|
and it removes only the first instance of a bookmark with that name from
|
|
|
|
|
the list of bookmarks.\)"
|
1995-06-18 22:46:02 +00:00
|
|
|
|
(interactive (list nil current-prefix-arg))
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(or
|
|
|
|
|
(bookmark-buffer-file-name)
|
1996-01-25 06:02:21 +00:00
|
|
|
|
(error "Buffer not visiting a file or directory"))
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
|
|
|
|
(bookmark-maybe-load-default-file)
|
|
|
|
|
|
1993-08-10 20:35:31 +00:00
|
|
|
|
(setq bookmark-current-point (point))
|
|
|
|
|
(setq bookmark-yank-point (point))
|
|
|
|
|
(setq bookmark-current-buffer (current-buffer))
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
(let* ((default (or bookmark-current-bookmark
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(bookmark-buffer-name)))
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
(str
|
1995-06-18 22:46:02 +00:00
|
|
|
|
(or name
|
|
|
|
|
(read-from-minibuffer
|
|
|
|
|
(format "Set bookmark (%s): " default)
|
|
|
|
|
nil
|
|
|
|
|
(let ((now-map (copy-keymap minibuffer-local-map)))
|
(bookmark-load): Use `bookmark-import-new-list' to
load the new list carefully, renaming bookmarks as necessary.
In docstring, mention new renaming behavior.
Optional arg OVERWRITE replaces inaccurately-named REVERT.
If file loaded was bookmark-default-file, then set
bookmarks-already-loaded to t.
(bookmark-import-new-list): New func.
(bookmark-maybe-rename): New func, helper to above.
(bookmark-set-name): Accept bookmark as either string (behaves
same as before) or list (treat it as a bookmark record).
(bookmark-set, bookmark-maybe-load-default-file)
(bookmark-jump-noselect, bookmark-rename)
(bookmark-show-annotation): Discard pointless `progn's.
(bookmark-bmenu-mark, bookmark-bmenu-unmark)
(bookmark-bmenu-backup-unmark, bookmark-bmenu-delete-backwards):
Renormalize position after all else is done.
(bookmark-edit-annotation-mode, bookmark-bmenu-list)
(bookmark-show-annotation, bookmark-show-all-annotations):
Use `x' instead of `(not (eq x nil))'.
(bookmark-yank-word): Inner save-excursion changed to progn.
(bookmark-send-annotation, bookmark-send-edited-annotation)
(bookmark-insert): Use buffer-string instead of buffer-substring.
(bookmark-make-cell): Make sure annotation and info-node strings
contain no text properties.
(bookmark-relocate): Remember to rebuild bmenu buffer after a
bookmark has been relocated.
(bookmark-bmenu-check-position): Return a meaningful value --
callers have apparently been assuming this anyway.
(bookmark-build-xemacs-menu): Unused function deleted.
(bookmark-version): Removed this variable; the Emacs version suffices.
1997-08-22 19:14:10 +00:00
|
|
|
|
(define-key now-map "\C-w" 'bookmark-yank-word)
|
|
|
|
|
(define-key now-map "\C-u" 'bookmark-insert-current-bookmark)
|
1995-06-18 22:46:02 +00:00
|
|
|
|
now-map))))
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(annotation nil))
|
|
|
|
|
(and (string-equal str "") (setq str default))
|
2001-01-12 22:49:40 +00:00
|
|
|
|
;; Ask for an annotation buffer for this bookmark
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(if bookmark-use-annotations
|
|
|
|
|
(bookmark-read-annotation parg str)
|
(bookmark-load): Use `bookmark-import-new-list' to
load the new list carefully, renaming bookmarks as necessary.
In docstring, mention new renaming behavior.
Optional arg OVERWRITE replaces inaccurately-named REVERT.
If file loaded was bookmark-default-file, then set
bookmarks-already-loaded to t.
(bookmark-import-new-list): New func.
(bookmark-maybe-rename): New func, helper to above.
(bookmark-set-name): Accept bookmark as either string (behaves
same as before) or list (treat it as a bookmark record).
(bookmark-set, bookmark-maybe-load-default-file)
(bookmark-jump-noselect, bookmark-rename)
(bookmark-show-annotation): Discard pointless `progn's.
(bookmark-bmenu-mark, bookmark-bmenu-unmark)
(bookmark-bmenu-backup-unmark, bookmark-bmenu-delete-backwards):
Renormalize position after all else is done.
(bookmark-edit-annotation-mode, bookmark-bmenu-list)
(bookmark-show-annotation, bookmark-show-all-annotations):
Use `x' instead of `(not (eq x nil))'.
(bookmark-yank-word): Inner save-excursion changed to progn.
(bookmark-send-annotation, bookmark-send-edited-annotation)
(bookmark-insert): Use buffer-string instead of buffer-substring.
(bookmark-make-cell): Make sure annotation and info-node strings
contain no text properties.
(bookmark-relocate): Remember to rebuild bmenu buffer after a
bookmark has been relocated.
(bookmark-bmenu-check-position): Return a meaningful value --
callers have apparently been assuming this anyway.
(bookmark-build-xemacs-menu): Unused function deleted.
(bookmark-version): Removed this variable; the Emacs version suffices.
1997-08-22 19:14:10 +00:00
|
|
|
|
(bookmark-make str annotation parg (bookmark-info-current-node))
|
|
|
|
|
(setq bookmark-current-bookmark str)
|
|
|
|
|
(bookmark-bmenu-surreptitiously-rebuild-list)
|
|
|
|
|
(goto-char bookmark-current-point))))
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
|
|
|
|
|
1996-05-08 02:22:12 +00:00
|
|
|
|
(defun bookmark-info-current-node ()
|
|
|
|
|
"If in Info-mode, return current node name (a string), else nil."
|
|
|
|
|
(if (eq major-mode 'Info-mode)
|
|
|
|
|
Info-current-node))
|
|
|
|
|
|
|
|
|
|
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(defun bookmark-kill-line (&optional newline-too)
|
|
|
|
|
"Kill from point to end of line.
|
|
|
|
|
If optional arg NEWLINE-TOO is non-nil, delete the newline too.
|
(bookmark-automatically-show-annotations, bookmark-read-annotation-text-func): Doc fixes.
(bookmark-save): Improve argument/docstring consistency.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-alist-from-buffer, bookmark-upgrade-file-format-from-0,
bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format,
bookmark-kill-line, bookmark-read-annotation-mode,
bookmark-insert-current-bookmark, bookmark-jump, bookmark-exit-hook):
Fix typos in docstrings.
(bookmark-exit-hooks): Define as obsolete alias.
(bookmark-exit-hook-internal): Run `bookmark-exit-hook',
not `bookmark-exit-hooks'. Fix docstring.
(bookmark-bmenu-select): "?\ " -> "?\s".
2005-07-26 13:56:01 +00:00
|
|
|
|
Does not affect the kill ring."
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(let ((eol (save-excursion (end-of-line) (point))))
|
|
|
|
|
(delete-region (point) eol)
|
|
|
|
|
(if (and newline-too (looking-at "\n"))
|
|
|
|
|
(delete-char 1))))
|
|
|
|
|
|
|
|
|
|
|
1995-03-13 22:50:35 +00:00
|
|
|
|
;; Defvars to avoid compilation warnings:
|
|
|
|
|
(defvar bookmark-annotation-paragraph nil)
|
|
|
|
|
(defvar bookmark-annotation-name nil)
|
|
|
|
|
(defvar bookmark-annotation-buffer nil)
|
|
|
|
|
(defvar bookmark-annotation-file nil)
|
|
|
|
|
(defvar bookmark-annotation-point nil)
|
|
|
|
|
|
|
|
|
|
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(defun bookmark-send-annotation ()
|
1996-05-09 17:34:55 +00:00
|
|
|
|
"Use buffer contents as the annotation for a bookmark.
|
|
|
|
|
Exclude lines that begin with `#'.
|
|
|
|
|
Store the annotation text in the bookmark list with
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
the bookmark (and file, and point) specified in buffer local variables."
|
|
|
|
|
(interactive)
|
|
|
|
|
(if (not (eq major-mode 'bookmark-read-annotation-mode))
|
1996-01-25 06:02:21 +00:00
|
|
|
|
(error "Not in bookmark-read-annotation-mode"))
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
(while (< (point) (point-max))
|
|
|
|
|
(if (looking-at "^#")
|
|
|
|
|
(bookmark-kill-line t)
|
|
|
|
|
(forward-line 1)))
|
(bookmark-load): Use `bookmark-import-new-list' to
load the new list carefully, renaming bookmarks as necessary.
In docstring, mention new renaming behavior.
Optional arg OVERWRITE replaces inaccurately-named REVERT.
If file loaded was bookmark-default-file, then set
bookmarks-already-loaded to t.
(bookmark-import-new-list): New func.
(bookmark-maybe-rename): New func, helper to above.
(bookmark-set-name): Accept bookmark as either string (behaves
same as before) or list (treat it as a bookmark record).
(bookmark-set, bookmark-maybe-load-default-file)
(bookmark-jump-noselect, bookmark-rename)
(bookmark-show-annotation): Discard pointless `progn's.
(bookmark-bmenu-mark, bookmark-bmenu-unmark)
(bookmark-bmenu-backup-unmark, bookmark-bmenu-delete-backwards):
Renormalize position after all else is done.
(bookmark-edit-annotation-mode, bookmark-bmenu-list)
(bookmark-show-annotation, bookmark-show-all-annotations):
Use `x' instead of `(not (eq x nil))'.
(bookmark-yank-word): Inner save-excursion changed to progn.
(bookmark-send-annotation, bookmark-send-edited-annotation)
(bookmark-insert): Use buffer-string instead of buffer-substring.
(bookmark-make-cell): Make sure annotation and info-node strings
contain no text properties.
(bookmark-relocate): Remember to rebuild bmenu buffer after a
bookmark has been relocated.
(bookmark-bmenu-check-position): Return a meaningful value --
callers have apparently been assuming this anyway.
(bookmark-build-xemacs-menu): Unused function deleted.
(bookmark-version): Removed this variable; the Emacs version suffices.
1997-08-22 19:14:10 +00:00
|
|
|
|
(let ((annotation (buffer-string))
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(parg bookmark-annotation-paragraph)
|
|
|
|
|
(bookmark bookmark-annotation-name)
|
|
|
|
|
(pt bookmark-annotation-point)
|
|
|
|
|
(buf bookmark-annotation-buffer))
|
|
|
|
|
;; for bookmark-make-cell to work, we need to be
|
|
|
|
|
;; in the relevant buffer, at the relevant point.
|
|
|
|
|
;; Actually, bookmark-make-cell should probably be re-written,
|
|
|
|
|
;; to avoid this need. Should I handle the error if a buffer is
|
|
|
|
|
;; killed between "C-x r m" and a "C-c C-c" in the annotation buffer?
|
2001-01-12 22:49:40 +00:00
|
|
|
|
(save-excursion
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(pop-to-buffer buf)
|
|
|
|
|
(goto-char pt)
|
1996-05-08 02:22:12 +00:00
|
|
|
|
(bookmark-make bookmark annotation parg (bookmark-info-current-node))
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(setq bookmark-current-bookmark bookmark))
|
|
|
|
|
(bookmark-bmenu-surreptitiously-rebuild-list)
|
|
|
|
|
(goto-char bookmark-current-point))
|
|
|
|
|
(kill-buffer (current-buffer)))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun bookmark-default-annotation-text (bookmark)
|
|
|
|
|
(concat "# Type the annotation for bookmark '" bookmark "' here.\n"
|
|
|
|
|
"# All lines which start with a '#' will be deleted.\n"
|
|
|
|
|
"# Type C-c C-c when done.\n#\n"
|
|
|
|
|
"# Author: " (user-full-name) " <" (user-login-name) "@"
|
|
|
|
|
(system-name) ">\n"
|
|
|
|
|
"# Date: " (current-time-string) "\n"))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defvar bookmark-read-annotation-text-func 'bookmark-default-annotation-text
|
1996-05-09 17:34:55 +00:00
|
|
|
|
"Function to return default text to use for a bookmark annotation.
|
(bookmark-automatically-show-annotations, bookmark-read-annotation-text-func): Doc fixes.
(bookmark-save): Improve argument/docstring consistency.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-alist-from-buffer, bookmark-upgrade-file-format-from-0,
bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format,
bookmark-kill-line, bookmark-read-annotation-mode,
bookmark-insert-current-bookmark, bookmark-jump, bookmark-exit-hook):
Fix typos in docstrings.
(bookmark-exit-hooks): Define as obsolete alias.
(bookmark-exit-hook-internal): Run `bookmark-exit-hook',
not `bookmark-exit-hooks'. Fix docstring.
(bookmark-bmenu-select): "?\ " -> "?\s".
2005-07-26 13:56:01 +00:00
|
|
|
|
It takes one argument, the name of the bookmark, as a string.")
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
|
|
|
|
(defun bookmark-read-annotation-mode (buf point parg bookmark)
|
|
|
|
|
"Mode for composing annotations for a bookmark.
|
(bookmark-automatically-show-annotations, bookmark-read-annotation-text-func): Doc fixes.
(bookmark-save): Improve argument/docstring consistency.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-alist-from-buffer, bookmark-upgrade-file-format-from-0,
bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format,
bookmark-kill-line, bookmark-read-annotation-mode,
bookmark-insert-current-bookmark, bookmark-jump, bookmark-exit-hook):
Fix typos in docstrings.
(bookmark-exit-hooks): Define as obsolete alias.
(bookmark-exit-hook-internal): Run `bookmark-exit-hook',
not `bookmark-exit-hooks'. Fix docstring.
(bookmark-bmenu-select): "?\ " -> "?\s".
2005-07-26 13:56:01 +00:00
|
|
|
|
Wants BUF, POINT, PARG, and BOOKMARK.
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
When you have finished composing, type \\[bookmark-send-annotation] to send
|
|
|
|
|
the annotation.
|
|
|
|
|
|
|
|
|
|
\\{bookmark-read-annotation-mode-map}
|
|
|
|
|
"
|
|
|
|
|
(interactive)
|
|
|
|
|
(kill-all-local-variables)
|
|
|
|
|
(make-local-variable 'bookmark-annotation-paragraph)
|
|
|
|
|
(make-local-variable 'bookmark-annotation-name)
|
|
|
|
|
(make-local-variable 'bookmark-annotation-buffer)
|
|
|
|
|
(make-local-variable 'bookmark-annotation-file)
|
|
|
|
|
(make-local-variable 'bookmark-annotation-point)
|
|
|
|
|
(setq bookmark-annotation-paragraph parg)
|
|
|
|
|
(setq bookmark-annotation-name bookmark)
|
|
|
|
|
(setq bookmark-annotation-buffer buf)
|
|
|
|
|
(setq bookmark-annotation-file (buffer-file-name buf))
|
|
|
|
|
(setq bookmark-annotation-point point)
|
|
|
|
|
(use-local-map bookmark-read-annotation-mode-map)
|
|
|
|
|
(setq major-mode 'bookmark-read-annotation-mode)
|
|
|
|
|
(insert (funcall bookmark-read-annotation-text-func bookmark))
|
2005-05-26 12:28:39 +00:00
|
|
|
|
(run-mode-hooks 'text-mode-hook))
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun bookmark-read-annotation (parg bookmark)
|
1996-05-09 17:34:55 +00:00
|
|
|
|
"Pop up a buffer for entering a bookmark annotation.
|
|
|
|
|
Text surrounding the bookmark is PARG; the bookmark name is BOOKMARK."
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(let ((buf (current-buffer))
|
|
|
|
|
(point (point)))
|
|
|
|
|
(pop-to-buffer (generate-new-buffer-name "*Bookmark Annotation Compose*"))
|
|
|
|
|
(bookmark-read-annotation-mode buf point parg bookmark)))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defvar bookmark-edit-annotation-mode-map (copy-keymap text-mode-map)
|
|
|
|
|
"Keymap for editing an annotation of a bookmark.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(define-key bookmark-edit-annotation-mode-map "\C-c\C-c"
|
|
|
|
|
'bookmark-send-edited-annotation)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun bookmark-edit-annotation-mode (bookmark)
|
|
|
|
|
"Mode for editing the annotation of bookmark BOOKMARK.
|
|
|
|
|
When you have finished composing, type \\[bookmark-send-annotation].
|
|
|
|
|
|
|
|
|
|
\\{bookmark-edit-annotation-mode-map}
|
|
|
|
|
"
|
|
|
|
|
(interactive)
|
|
|
|
|
(kill-all-local-variables)
|
|
|
|
|
(make-local-variable 'bookmark-annotation-name)
|
|
|
|
|
(setq bookmark-annotation-name bookmark)
|
|
|
|
|
(use-local-map bookmark-edit-annotation-mode-map)
|
2004-04-15 23:13:16 +00:00
|
|
|
|
(setq major-mode 'bookmark-edit-annotation-mode
|
|
|
|
|
mode-name "Edit Bookmark Annotation")
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(insert (funcall bookmark-read-annotation-text-func bookmark))
|
|
|
|
|
(let ((annotation (bookmark-get-annotation bookmark)))
|
(bookmark-load): Use `bookmark-import-new-list' to
load the new list carefully, renaming bookmarks as necessary.
In docstring, mention new renaming behavior.
Optional arg OVERWRITE replaces inaccurately-named REVERT.
If file loaded was bookmark-default-file, then set
bookmarks-already-loaded to t.
(bookmark-import-new-list): New func.
(bookmark-maybe-rename): New func, helper to above.
(bookmark-set-name): Accept bookmark as either string (behaves
same as before) or list (treat it as a bookmark record).
(bookmark-set, bookmark-maybe-load-default-file)
(bookmark-jump-noselect, bookmark-rename)
(bookmark-show-annotation): Discard pointless `progn's.
(bookmark-bmenu-mark, bookmark-bmenu-unmark)
(bookmark-bmenu-backup-unmark, bookmark-bmenu-delete-backwards):
Renormalize position after all else is done.
(bookmark-edit-annotation-mode, bookmark-bmenu-list)
(bookmark-show-annotation, bookmark-show-all-annotations):
Use `x' instead of `(not (eq x nil))'.
(bookmark-yank-word): Inner save-excursion changed to progn.
(bookmark-send-annotation, bookmark-send-edited-annotation)
(bookmark-insert): Use buffer-string instead of buffer-substring.
(bookmark-make-cell): Make sure annotation and info-node strings
contain no text properties.
(bookmark-relocate): Remember to rebuild bmenu buffer after a
bookmark has been relocated.
(bookmark-bmenu-check-position): Return a meaningful value --
callers have apparently been assuming this anyway.
(bookmark-build-xemacs-menu): Unused function deleted.
(bookmark-version): Removed this variable; the Emacs version suffices.
1997-08-22 19:14:10 +00:00
|
|
|
|
(if (and annotation (not (string-equal annotation "")))
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(insert annotation)))
|
2005-05-26 12:28:39 +00:00
|
|
|
|
(run-mode-hooks 'text-mode-hook))
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun bookmark-send-edited-annotation ()
|
2004-04-15 23:13:16 +00:00
|
|
|
|
"Use buffer contents as annotation for a bookmark.
|
|
|
|
|
Lines beginning with `#' are ignored."
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(interactive)
|
|
|
|
|
(if (not (eq major-mode 'bookmark-edit-annotation-mode))
|
1996-01-25 06:02:21 +00:00
|
|
|
|
(error "Not in bookmark-edit-annotation-mode"))
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
(while (< (point) (point-max))
|
|
|
|
|
(if (looking-at "^#")
|
|
|
|
|
(bookmark-kill-line t)
|
|
|
|
|
(forward-line 1)))
|
(bookmark-load): Use `bookmark-import-new-list' to
load the new list carefully, renaming bookmarks as necessary.
In docstring, mention new renaming behavior.
Optional arg OVERWRITE replaces inaccurately-named REVERT.
If file loaded was bookmark-default-file, then set
bookmarks-already-loaded to t.
(bookmark-import-new-list): New func.
(bookmark-maybe-rename): New func, helper to above.
(bookmark-set-name): Accept bookmark as either string (behaves
same as before) or list (treat it as a bookmark record).
(bookmark-set, bookmark-maybe-load-default-file)
(bookmark-jump-noselect, bookmark-rename)
(bookmark-show-annotation): Discard pointless `progn's.
(bookmark-bmenu-mark, bookmark-bmenu-unmark)
(bookmark-bmenu-backup-unmark, bookmark-bmenu-delete-backwards):
Renormalize position after all else is done.
(bookmark-edit-annotation-mode, bookmark-bmenu-list)
(bookmark-show-annotation, bookmark-show-all-annotations):
Use `x' instead of `(not (eq x nil))'.
(bookmark-yank-word): Inner save-excursion changed to progn.
(bookmark-send-annotation, bookmark-send-edited-annotation)
(bookmark-insert): Use buffer-string instead of buffer-substring.
(bookmark-make-cell): Make sure annotation and info-node strings
contain no text properties.
(bookmark-relocate): Remember to rebuild bmenu buffer after a
bookmark has been relocated.
(bookmark-bmenu-check-position): Return a meaningful value --
callers have apparently been assuming this anyway.
(bookmark-build-xemacs-menu): Unused function deleted.
(bookmark-version): Removed this variable; the Emacs version suffices.
1997-08-22 19:14:10 +00:00
|
|
|
|
(let ((annotation (buffer-string))
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(bookmark bookmark-annotation-name))
|
|
|
|
|
(bookmark-set-annotation bookmark annotation)
|
|
|
|
|
(bookmark-bmenu-surreptitiously-rebuild-list)
|
|
|
|
|
(goto-char bookmark-current-point))
|
|
|
|
|
(kill-buffer (current-buffer)))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun bookmark-edit-annotation (bookmark)
|
|
|
|
|
"Pop up a buffer for editing bookmark BOOKMARK's annotation."
|
(bookmark-completing-read): Use a popup menu if activated from the mouse.
Return a string, instead of a list of one string.
(bookmark-edit-annotation): Remove unused vars.
(bookmark-jump, bookmark-relocate, bookmark-insert-location)
(bookmark-rename, bookmark-insert, bookmark-delete): Adjust calls
to bookmark-completing-read.
(bookmark-bmenu-show-filenames, bookmark-bmenu-hide-filenames)
(bookmark-bmenu-mark, bookmark-bmenu-select, bookmark-bmenu-unmark)
(bookmark-bmenu-delete, bookmark-bmenu-list): Use inhibit-read-only
and erase-buffer.
(bookmark-menu-delete, bookmark-menu-rename, bookmark-menu-locate)
(bookmark-menu-jump, bookmark-menu-insert)
(bookmark-popup-menu-and-apply-function)
(bookmark-menu-popup-paned-bookmark-menu): Remove.
(bookmark-menu-build-paned-menu): Remove by folding it into
bookmark-menu-popup-paned-menu.
(menu-bar-bookmark-map): Move the define-key statements here.
Use the "non-menu" commands since they now pop up a menu if needed.
(bookmark-exit-hook-internal): Simplify.
2003-08-11 17:30:47 +00:00
|
|
|
|
(pop-to-buffer (generate-new-buffer-name "*Bookmark Annotation Compose*"))
|
|
|
|
|
(bookmark-edit-annotation-mode bookmark))
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
1993-08-10 20:35:31 +00:00
|
|
|
|
|
|
|
|
|
(defun bookmark-insert-current-bookmark ()
|
(bookmark-automatically-show-annotations, bookmark-read-annotation-text-func): Doc fixes.
(bookmark-save): Improve argument/docstring consistency.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-alist-from-buffer, bookmark-upgrade-file-format-from-0,
bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format,
bookmark-kill-line, bookmark-read-annotation-mode,
bookmark-insert-current-bookmark, bookmark-jump, bookmark-exit-hook):
Fix typos in docstrings.
(bookmark-exit-hooks): Define as obsolete alias.
(bookmark-exit-hook-internal): Run `bookmark-exit-hook',
not `bookmark-exit-hooks'. Fix docstring.
(bookmark-bmenu-select): "?\ " -> "?\s".
2005-07-26 13:56:01 +00:00
|
|
|
|
"Insert this buffer's value of `bookmark-current-bookmark'.
|
1996-05-09 17:34:55 +00:00
|
|
|
|
Default to file name if it's nil."
|
1993-08-10 20:35:31 +00:00
|
|
|
|
(interactive)
|
|
|
|
|
(let ((str
|
|
|
|
|
(save-excursion
|
|
|
|
|
(set-buffer bookmark-current-buffer)
|
|
|
|
|
bookmark-current-bookmark)))
|
1995-03-11 20:17:37 +00:00
|
|
|
|
(if str (insert str) (bookmark-insert-buffer-name))))
|
1993-08-10 20:35:31 +00:00
|
|
|
|
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
1995-03-11 20:17:37 +00:00
|
|
|
|
(defun bookmark-insert-buffer-name ()
|
1996-05-09 17:34:55 +00:00
|
|
|
|
"Insert the current file name into the bookmark name being set.
|
|
|
|
|
The directory part of the file name is not used."
|
1993-08-10 20:35:31 +00:00
|
|
|
|
(interactive)
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(let ((str
|
|
|
|
|
(save-excursion
|
|
|
|
|
(set-buffer bookmark-current-buffer)
|
1995-03-11 20:17:37 +00:00
|
|
|
|
(bookmark-buffer-name))))
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(insert str)))
|
|
|
|
|
|
1993-08-10 20:35:31 +00:00
|
|
|
|
|
1995-03-11 20:17:37 +00:00
|
|
|
|
(defun bookmark-buffer-name ()
|
|
|
|
|
"Return the name of the current buffer's file, non-directory.
|
|
|
|
|
In Info, return the current node."
|
|
|
|
|
(cond
|
|
|
|
|
;; Are we in Info?
|
|
|
|
|
((string-equal mode-name "Info") Info-current-node)
|
|
|
|
|
;; Or are we a file?
|
|
|
|
|
(buffer-file-name (file-name-nondirectory buffer-file-name))
|
|
|
|
|
;; Or are we a directory?
|
|
|
|
|
((and (boundp 'dired-directory) dired-directory)
|
|
|
|
|
(let* ((dirname (if (stringp dired-directory)
|
|
|
|
|
dired-directory
|
|
|
|
|
(car dired-directory)))
|
|
|
|
|
(idx (1- (length dirname))))
|
|
|
|
|
;; Strip the trailing slash.
|
|
|
|
|
(if (= ?/ (aref dirname idx))
|
|
|
|
|
(file-name-nondirectory (substring dirname 0 idx))
|
|
|
|
|
;; Else return the current-buffer
|
|
|
|
|
(buffer-name (current-buffer)))))
|
|
|
|
|
;; If all else fails, use the buffer's name.
|
|
|
|
|
(t
|
|
|
|
|
(buffer-name (current-buffer)))))
|
|
|
|
|
|
|
|
|
|
|
1993-08-10 20:35:31 +00:00
|
|
|
|
(defun bookmark-yank-word ()
|
|
|
|
|
(interactive)
|
|
|
|
|
;; get the next word from the buffer and append it to the name of
|
|
|
|
|
;; the bookmark currently being set.
|
|
|
|
|
(let ((string (save-excursion
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
(set-buffer bookmark-current-buffer)
|
|
|
|
|
(goto-char bookmark-yank-point)
|
1995-07-17 23:19:51 +00:00
|
|
|
|
(buffer-substring-no-properties
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
(point)
|
(bookmark-load): Use `bookmark-import-new-list' to
load the new list carefully, renaming bookmarks as necessary.
In docstring, mention new renaming behavior.
Optional arg OVERWRITE replaces inaccurately-named REVERT.
If file loaded was bookmark-default-file, then set
bookmarks-already-loaded to t.
(bookmark-import-new-list): New func.
(bookmark-maybe-rename): New func, helper to above.
(bookmark-set-name): Accept bookmark as either string (behaves
same as before) or list (treat it as a bookmark record).
(bookmark-set, bookmark-maybe-load-default-file)
(bookmark-jump-noselect, bookmark-rename)
(bookmark-show-annotation): Discard pointless `progn's.
(bookmark-bmenu-mark, bookmark-bmenu-unmark)
(bookmark-bmenu-backup-unmark, bookmark-bmenu-delete-backwards):
Renormalize position after all else is done.
(bookmark-edit-annotation-mode, bookmark-bmenu-list)
(bookmark-show-annotation, bookmark-show-all-annotations):
Use `x' instead of `(not (eq x nil))'.
(bookmark-yank-word): Inner save-excursion changed to progn.
(bookmark-send-annotation, bookmark-send-edited-annotation)
(bookmark-insert): Use buffer-string instead of buffer-substring.
(bookmark-make-cell): Make sure annotation and info-node strings
contain no text properties.
(bookmark-relocate): Remember to rebuild bmenu buffer after a
bookmark has been relocated.
(bookmark-bmenu-check-position): Return a meaningful value --
callers have apparently been assuming this anyway.
(bookmark-build-xemacs-menu): Unused function deleted.
(bookmark-version): Removed this variable; the Emacs version suffices.
1997-08-22 19:14:10 +00:00
|
|
|
|
(progn
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
(forward-word 1)
|
|
|
|
|
(setq bookmark-yank-point (point)))))))
|
1993-08-10 20:35:31 +00:00
|
|
|
|
(insert string)))
|
|
|
|
|
|
|
|
|
|
|
2005-08-09 02:54:39 +00:00
|
|
|
|
(defvar Info-current-file)
|
|
|
|
|
|
1993-08-10 20:35:31 +00:00
|
|
|
|
(defun bookmark-buffer-file-name ()
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
"Return the current buffer's file in a way useful for bookmarks.
|
|
|
|
|
For example, if this is a Info buffer, return the Info file's name."
|
|
|
|
|
(if (eq major-mode 'Info-mode)
|
|
|
|
|
Info-current-file
|
|
|
|
|
(or
|
|
|
|
|
buffer-file-name
|
|
|
|
|
(if (and (boundp 'dired-directory) dired-directory)
|
|
|
|
|
(if (stringp dired-directory)
|
|
|
|
|
dired-directory
|
|
|
|
|
(car dired-directory))))))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun bookmark-maybe-load-default-file ()
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
(and (not bookmarks-already-loaded)
|
|
|
|
|
(null bookmark-alist)
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(prog2
|
|
|
|
|
(and
|
|
|
|
|
;; Possibly the old bookmark file, "~/.emacs-bkmrks", needs
|
|
|
|
|
;; to be renamed.
|
|
|
|
|
(file-exists-p (expand-file-name bookmark-old-default-file))
|
|
|
|
|
(not (file-exists-p (expand-file-name bookmark-default-file)))
|
|
|
|
|
(rename-file (expand-file-name bookmark-old-default-file)
|
|
|
|
|
(expand-file-name bookmark-default-file)))
|
|
|
|
|
;; return t so the `and' will continue...
|
|
|
|
|
t)
|
2001-01-12 22:49:40 +00:00
|
|
|
|
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(file-readable-p (expand-file-name bookmark-default-file))
|
(bookmark-load): Use `bookmark-import-new-list' to
load the new list carefully, renaming bookmarks as necessary.
In docstring, mention new renaming behavior.
Optional arg OVERWRITE replaces inaccurately-named REVERT.
If file loaded was bookmark-default-file, then set
bookmarks-already-loaded to t.
(bookmark-import-new-list): New func.
(bookmark-maybe-rename): New func, helper to above.
(bookmark-set-name): Accept bookmark as either string (behaves
same as before) or list (treat it as a bookmark record).
(bookmark-set, bookmark-maybe-load-default-file)
(bookmark-jump-noselect, bookmark-rename)
(bookmark-show-annotation): Discard pointless `progn's.
(bookmark-bmenu-mark, bookmark-bmenu-unmark)
(bookmark-bmenu-backup-unmark, bookmark-bmenu-delete-backwards):
Renormalize position after all else is done.
(bookmark-edit-annotation-mode, bookmark-bmenu-list)
(bookmark-show-annotation, bookmark-show-all-annotations):
Use `x' instead of `(not (eq x nil))'.
(bookmark-yank-word): Inner save-excursion changed to progn.
(bookmark-send-annotation, bookmark-send-edited-annotation)
(bookmark-insert): Use buffer-string instead of buffer-substring.
(bookmark-make-cell): Make sure annotation and info-node strings
contain no text properties.
(bookmark-relocate): Remember to rebuild bmenu buffer after a
bookmark has been relocated.
(bookmark-bmenu-check-position): Return a meaningful value --
callers have apparently been assuming this anyway.
(bookmark-build-xemacs-menu): Unused function deleted.
(bookmark-version): Removed this variable; the Emacs version suffices.
1997-08-22 19:14:10 +00:00
|
|
|
|
(bookmark-load bookmark-default-file t t)
|
|
|
|
|
(setq bookmarks-already-loaded t)))
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
(defun bookmark-maybe-sort-alist ()
|
|
|
|
|
;;Return the bookmark-alist for display. If the bookmark-sort-flag
|
|
|
|
|
;;is non-nil, then return a sorted copy of the alist.
|
|
|
|
|
(if bookmark-sort-flag
|
|
|
|
|
(setq bookmark-alist
|
|
|
|
|
(sort (copy-alist bookmark-alist)
|
|
|
|
|
(function
|
|
|
|
|
(lambda (x y) (string-lessp (car x) (car y))))))))
|
|
|
|
|
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
;;;###autoload
|
1995-06-18 22:46:02 +00:00
|
|
|
|
(defun bookmark-jump (bookmark)
|
2001-01-12 22:49:40 +00:00
|
|
|
|
"Jump to bookmark BOOKMARK (a point in some file).
|
1993-08-14 19:49:27 +00:00
|
|
|
|
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
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
this.
|
|
|
|
|
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
If the file pointed to by BOOKMARK no longer exists, you will be asked
|
(bookmark-automatically-show-annotations, bookmark-read-annotation-text-func): Doc fixes.
(bookmark-save): Improve argument/docstring consistency.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-alist-from-buffer, bookmark-upgrade-file-format-from-0,
bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format,
bookmark-kill-line, bookmark-read-annotation-mode,
bookmark-insert-current-bookmark, bookmark-jump, bookmark-exit-hook):
Fix typos in docstrings.
(bookmark-exit-hooks): Define as obsolete alias.
(bookmark-exit-hook-internal): Run `bookmark-exit-hook',
not `bookmark-exit-hooks'. Fix docstring.
(bookmark-bmenu-select): "?\ " -> "?\s".
2005-07-26 13:56:01 +00:00
|
|
|
|
if you wish to give the bookmark a new location, and `bookmark-jump'
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
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): Use a popup menu if activated from the mouse.
Return a string, instead of a list of one string.
(bookmark-edit-annotation): Remove unused vars.
(bookmark-jump, bookmark-relocate, bookmark-insert-location)
(bookmark-rename, bookmark-insert, bookmark-delete): Adjust calls
to bookmark-completing-read.
(bookmark-bmenu-show-filenames, bookmark-bmenu-hide-filenames)
(bookmark-bmenu-mark, bookmark-bmenu-select, bookmark-bmenu-unmark)
(bookmark-bmenu-delete, bookmark-bmenu-list): Use inhibit-read-only
and erase-buffer.
(bookmark-menu-delete, bookmark-menu-rename, bookmark-menu-locate)
(bookmark-menu-jump, bookmark-menu-insert)
(bookmark-popup-menu-and-apply-function)
(bookmark-menu-popup-paned-bookmark-menu): Remove.
(bookmark-menu-build-paned-menu): Remove by folding it into
bookmark-menu-popup-paned-menu.
(menu-bar-bookmark-map): Move the define-key statements here.
Use the "non-menu" commands since they now pop up a menu if needed.
(bookmark-exit-hook-internal): Simplify.
2003-08-11 17:30:47 +00:00
|
|
|
|
(list (bookmark-completing-read "Jump to bookmark"
|
|
|
|
|
bookmark-current-bookmark)))
|
2004-12-27 16:41:59 +00:00
|
|
|
|
(unless bookmark
|
|
|
|
|
(error "No bookmark specified"))
|
1995-06-18 22:46:02 +00:00
|
|
|
|
(bookmark-maybe-historicize-string bookmark)
|
|
|
|
|
(let ((cell (bookmark-jump-noselect bookmark)))
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
(and cell
|
|
|
|
|
(switch-to-buffer (car cell))
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(goto-char (cdr cell))
|
1995-03-20 14:46:38 +00:00
|
|
|
|
(if bookmark-automatically-show-annotations
|
|
|
|
|
;; if there is an annotation for this bookmark,
|
|
|
|
|
;; show it in a buffer.
|
1995-06-18 22:46:02 +00:00
|
|
|
|
(bookmark-show-annotation bookmark)))))
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
|
2000-03-06 12:46:50 +00:00
|
|
|
|
(defun bookmark-file-or-variation-thereof (file)
|
2002-06-12 21:44:33 +00:00
|
|
|
|
"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."
|
2002-06-08 03:33:09 +00:00
|
|
|
|
(if (file-exists-p file)
|
|
|
|
|
file
|
2002-06-12 21:44:33 +00:00
|
|
|
|
(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))))
|
|
|
|
|
|
2000-03-06 12:46:50 +00:00
|
|
|
|
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
(defun bookmark-jump-noselect (str)
|
|
|
|
|
;; a leetle helper for bookmark-jump :-)
|
|
|
|
|
;; returns (BUFFER . POINT)
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(bookmark-maybe-load-default-file)
|
|
|
|
|
(let* ((file (expand-file-name (bookmark-get-filename str)))
|
|
|
|
|
(forward-str (bookmark-get-front-context-string str))
|
|
|
|
|
(behind-str (bookmark-get-rear-context-string str))
|
|
|
|
|
(place (bookmark-get-position str))
|
|
|
|
|
(info-node (bookmark-get-info-node str))
|
|
|
|
|
(orig-file file)
|
|
|
|
|
)
|
2000-03-06 12:46:50 +00:00
|
|
|
|
(if (setq file (bookmark-file-or-variation-thereof file))
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(save-excursion
|
1998-05-26 18:27:47 +00:00
|
|
|
|
(save-window-excursion
|
|
|
|
|
(if info-node
|
|
|
|
|
;; Info nodes must be visited with care.
|
|
|
|
|
(progn
|
|
|
|
|
(require 'info)
|
2005-08-09 02:54:39 +00:00
|
|
|
|
(with-no-warnings
|
|
|
|
|
(Info-find-node file info-node)))
|
1998-05-26 18:27:47 +00:00
|
|
|
|
;; Else no Info. Can do an ordinary find-file:
|
|
|
|
|
(set-buffer (find-file-noselect file))
|
|
|
|
|
(goto-char place))
|
|
|
|
|
|
|
|
|
|
;; Go searching forward first. Then, if forward-str exists and
|
|
|
|
|
;; was found in the file, we can search backward for behind-str.
|
|
|
|
|
;; Rationale is that if text was inserted between the two in the
|
|
|
|
|
;; file, it's better to be put before it so you can read it,
|
|
|
|
|
;; rather than after and remain perhaps unaware of the changes.
|
|
|
|
|
(if forward-str
|
|
|
|
|
(if (search-forward forward-str (point-max) t)
|
|
|
|
|
(goto-char (match-beginning 0))))
|
|
|
|
|
(if behind-str
|
|
|
|
|
(if (search-backward behind-str (point-min) t)
|
|
|
|
|
(goto-char (match-end 0))))
|
|
|
|
|
;; added by db
|
|
|
|
|
(setq bookmark-current-bookmark str)
|
|
|
|
|
(cons (current-buffer) (point))))
|
|
|
|
|
|
(bookmark-load): Use `bookmark-import-new-list' to
load the new list carefully, renaming bookmarks as necessary.
In docstring, mention new renaming behavior.
Optional arg OVERWRITE replaces inaccurately-named REVERT.
If file loaded was bookmark-default-file, then set
bookmarks-already-loaded to t.
(bookmark-import-new-list): New func.
(bookmark-maybe-rename): New func, helper to above.
(bookmark-set-name): Accept bookmark as either string (behaves
same as before) or list (treat it as a bookmark record).
(bookmark-set, bookmark-maybe-load-default-file)
(bookmark-jump-noselect, bookmark-rename)
(bookmark-show-annotation): Discard pointless `progn's.
(bookmark-bmenu-mark, bookmark-bmenu-unmark)
(bookmark-bmenu-backup-unmark, bookmark-bmenu-delete-backwards):
Renormalize position after all else is done.
(bookmark-edit-annotation-mode, bookmark-bmenu-list)
(bookmark-show-annotation, bookmark-show-all-annotations):
Use `x' instead of `(not (eq x nil))'.
(bookmark-yank-word): Inner save-excursion changed to progn.
(bookmark-send-annotation, bookmark-send-edited-annotation)
(bookmark-insert): Use buffer-string instead of buffer-substring.
(bookmark-make-cell): Make sure annotation and info-node strings
contain no text properties.
(bookmark-relocate): Remember to rebuild bmenu buffer after a
bookmark has been relocated.
(bookmark-bmenu-check-position): Return a meaningful value --
callers have apparently been assuming this anyway.
(bookmark-build-xemacs-menu): Unused function deleted.
(bookmark-version): Removed this variable; the Emacs version suffices.
1997-08-22 19:14:10 +00:00
|
|
|
|
;; Else unable to find the marked file, so ask if user wants to
|
|
|
|
|
;; relocate the bookmark, else remind them to consider deletion.
|
|
|
|
|
(ding)
|
|
|
|
|
(if (y-or-n-p (concat (file-name-nondirectory orig-file)
|
|
|
|
|
" nonexistent. Relocate \""
|
|
|
|
|
str
|
|
|
|
|
"\"? "))
|
|
|
|
|
(progn
|
|
|
|
|
(bookmark-relocate str)
|
|
|
|
|
;; gasp! It's a recursive function call in Emacs Lisp!
|
|
|
|
|
(bookmark-jump-noselect str))
|
2001-01-12 22:49:40 +00:00
|
|
|
|
(message
|
(bookmark-load): Use `bookmark-import-new-list' to
load the new list carefully, renaming bookmarks as necessary.
In docstring, mention new renaming behavior.
Optional arg OVERWRITE replaces inaccurately-named REVERT.
If file loaded was bookmark-default-file, then set
bookmarks-already-loaded to t.
(bookmark-import-new-list): New func.
(bookmark-maybe-rename): New func, helper to above.
(bookmark-set-name): Accept bookmark as either string (behaves
same as before) or list (treat it as a bookmark record).
(bookmark-set, bookmark-maybe-load-default-file)
(bookmark-jump-noselect, bookmark-rename)
(bookmark-show-annotation): Discard pointless `progn's.
(bookmark-bmenu-mark, bookmark-bmenu-unmark)
(bookmark-bmenu-backup-unmark, bookmark-bmenu-delete-backwards):
Renormalize position after all else is done.
(bookmark-edit-annotation-mode, bookmark-bmenu-list)
(bookmark-show-annotation, bookmark-show-all-annotations):
Use `x' instead of `(not (eq x nil))'.
(bookmark-yank-word): Inner save-excursion changed to progn.
(bookmark-send-annotation, bookmark-send-edited-annotation)
(bookmark-insert): Use buffer-string instead of buffer-substring.
(bookmark-make-cell): Make sure annotation and info-node strings
contain no text properties.
(bookmark-relocate): Remember to rebuild bmenu buffer after a
bookmark has been relocated.
(bookmark-bmenu-check-position): Return a meaningful value --
callers have apparently been assuming this anyway.
(bookmark-build-xemacs-menu): Unused function deleted.
(bookmark-version): Removed this variable; the Emacs version suffices.
1997-08-22 19:14:10 +00:00
|
|
|
|
"Bookmark not relocated; consider removing it \(%s\)." str)
|
|
|
|
|
nil))))
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
|
|
|
|
|
;;;###autoload
|
1995-06-18 22:46:02 +00:00
|
|
|
|
(defun bookmark-relocate (bookmark)
|
1996-05-09 17:34:55 +00:00
|
|
|
|
"Relocate BOOKMARK to another file (reading file name with minibuffer).
|
|
|
|
|
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."
|
(bookmark-completing-read): Use a popup menu if activated from the mouse.
Return a string, instead of a list of one string.
(bookmark-edit-annotation): Remove unused vars.
(bookmark-jump, bookmark-relocate, bookmark-insert-location)
(bookmark-rename, bookmark-insert, bookmark-delete): Adjust calls
to bookmark-completing-read.
(bookmark-bmenu-show-filenames, bookmark-bmenu-hide-filenames)
(bookmark-bmenu-mark, bookmark-bmenu-select, bookmark-bmenu-unmark)
(bookmark-bmenu-delete, bookmark-bmenu-list): Use inhibit-read-only
and erase-buffer.
(bookmark-menu-delete, bookmark-menu-rename, bookmark-menu-locate)
(bookmark-menu-jump, bookmark-menu-insert)
(bookmark-popup-menu-and-apply-function)
(bookmark-menu-popup-paned-bookmark-menu): Remove.
(bookmark-menu-build-paned-menu): Remove by folding it into
bookmark-menu-popup-paned-menu.
(menu-bar-bookmark-map): Move the define-key statements here.
Use the "non-menu" commands since they now pop up a menu if needed.
(bookmark-exit-hook-internal): Simplify.
2003-08-11 17:30:47 +00:00
|
|
|
|
(interactive (list (bookmark-completing-read "Bookmark to relocate")))
|
1995-06-18 22:46:02 +00:00
|
|
|
|
(bookmark-maybe-historicize-string bookmark)
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(bookmark-maybe-load-default-file)
|
1995-06-18 22:46:02 +00:00
|
|
|
|
(let* ((bmrk-filename (bookmark-get-filename bookmark))
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
(newloc (expand-file-name
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(read-file-name
|
1995-06-18 22:46:02 +00:00
|
|
|
|
(format "Relocate %s to: " bookmark)
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(file-name-directory bmrk-filename)))))
|
(bookmark-load): Use `bookmark-import-new-list' to
load the new list carefully, renaming bookmarks as necessary.
In docstring, mention new renaming behavior.
Optional arg OVERWRITE replaces inaccurately-named REVERT.
If file loaded was bookmark-default-file, then set
bookmarks-already-loaded to t.
(bookmark-import-new-list): New func.
(bookmark-maybe-rename): New func, helper to above.
(bookmark-set-name): Accept bookmark as either string (behaves
same as before) or list (treat it as a bookmark record).
(bookmark-set, bookmark-maybe-load-default-file)
(bookmark-jump-noselect, bookmark-rename)
(bookmark-show-annotation): Discard pointless `progn's.
(bookmark-bmenu-mark, bookmark-bmenu-unmark)
(bookmark-bmenu-backup-unmark, bookmark-bmenu-delete-backwards):
Renormalize position after all else is done.
(bookmark-edit-annotation-mode, bookmark-bmenu-list)
(bookmark-show-annotation, bookmark-show-all-annotations):
Use `x' instead of `(not (eq x nil))'.
(bookmark-yank-word): Inner save-excursion changed to progn.
(bookmark-send-annotation, bookmark-send-edited-annotation)
(bookmark-insert): Use buffer-string instead of buffer-substring.
(bookmark-make-cell): Make sure annotation and info-node strings
contain no text properties.
(bookmark-relocate): Remember to rebuild bmenu buffer after a
bookmark has been relocated.
(bookmark-bmenu-check-position): Return a meaningful value --
callers have apparently been assuming this anyway.
(bookmark-build-xemacs-menu): Unused function deleted.
(bookmark-version): Removed this variable; the Emacs version suffices.
1997-08-22 19:14:10 +00:00
|
|
|
|
(bookmark-set-filename bookmark newloc)
|
|
|
|
|
(bookmark-bmenu-surreptitiously-rebuild-list)))
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
|
|
|
|
|
;;;###autoload
|
1995-06-18 22:46:02 +00:00
|
|
|
|
(defun bookmark-insert-location (bookmark &optional no-history)
|
1995-03-13 22:50:35 +00:00
|
|
|
|
"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'."
|
(bookmark-completing-read): Use a popup menu if activated from the mouse.
Return a string, instead of a list of one string.
(bookmark-edit-annotation): Remove unused vars.
(bookmark-jump, bookmark-relocate, bookmark-insert-location)
(bookmark-rename, bookmark-insert, bookmark-delete): Adjust calls
to bookmark-completing-read.
(bookmark-bmenu-show-filenames, bookmark-bmenu-hide-filenames)
(bookmark-bmenu-mark, bookmark-bmenu-select, bookmark-bmenu-unmark)
(bookmark-bmenu-delete, bookmark-bmenu-list): Use inhibit-read-only
and erase-buffer.
(bookmark-menu-delete, bookmark-menu-rename, bookmark-menu-locate)
(bookmark-menu-jump, bookmark-menu-insert)
(bookmark-popup-menu-and-apply-function)
(bookmark-menu-popup-paned-bookmark-menu): Remove.
(bookmark-menu-build-paned-menu): Remove by folding it into
bookmark-menu-popup-paned-menu.
(menu-bar-bookmark-map): Move the define-key statements here.
Use the "non-menu" commands since they now pop up a menu if needed.
(bookmark-exit-hook-internal): Simplify.
2003-08-11 17:30:47 +00:00
|
|
|
|
(interactive (list (bookmark-completing-read "Insert bookmark location")))
|
1995-06-18 22:46:02 +00:00
|
|
|
|
(or no-history (bookmark-maybe-historicize-string bookmark))
|
1997-03-30 21:38:43 +00:00
|
|
|
|
(let ((start (point)))
|
|
|
|
|
(prog1
|
|
|
|
|
(insert (bookmark-location bookmark)) ; *Return this line*
|
2000-06-06 22:41:24 +00:00
|
|
|
|
(if (and (display-color-p) (display-mouse-p))
|
2001-06-24 11:14:12 +00:00
|
|
|
|
(add-text-properties start
|
|
|
|
|
(save-excursion (re-search-backward
|
|
|
|
|
"[^ \t]")
|
|
|
|
|
(1+ (point)))
|
|
|
|
|
'(mouse-face highlight
|
|
|
|
|
help-echo "mouse-2: go to this bookmark"))))))
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
1996-05-08 19:16:51 +00:00
|
|
|
|
;;;###autoload
|
1996-05-08 02:22:12 +00:00
|
|
|
|
(defalias 'bookmark-locate 'bookmark-insert-location)
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
1995-06-18 22:46:02 +00:00
|
|
|
|
(defun bookmark-location (bookmark)
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
"Return the name of the file associated with BOOKMARK."
|
|
|
|
|
(bookmark-maybe-load-default-file)
|
1995-06-18 22:46:02 +00:00
|
|
|
|
(bookmark-get-filename bookmark))
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
|
|
|
|
|
;;;###autoload
|
1993-08-14 19:49:27 +00:00
|
|
|
|
(defun bookmark-rename (old &optional new)
|
1996-05-09 17:34:55 +00:00
|
|
|
|
"Change the name of OLD bookmark to NEW name.
|
|
|
|
|
If called from keyboard, prompt for OLD and NEW. If called from
|
|
|
|
|
menubar, select OLD from a menu and prompt for NEW.
|
1995-06-18 22:46:02 +00:00
|
|
|
|
|
1996-05-09 17:34:55 +00:00
|
|
|
|
If called from Lisp, prompt for NEW if only OLD was passed as an
|
1995-06-18 22:46:02 +00:00
|
|
|
|
argument. If called with two strings, then no prompting is done. You
|
|
|
|
|
must pass at least OLD when calling from Lisp.
|
1993-08-14 19:49:27 +00:00
|
|
|
|
|
|
|
|
|
While you are entering the new name, consecutive C-w's insert
|
1996-01-04 23:28:24 +00:00
|
|
|
|
consecutive words from the text of the buffer into the new bookmark
|
1995-03-13 22:50:35 +00:00
|
|
|
|
name."
|
(bookmark-completing-read): Use a popup menu if activated from the mouse.
Return a string, instead of a list of one string.
(bookmark-edit-annotation): Remove unused vars.
(bookmark-jump, bookmark-relocate, bookmark-insert-location)
(bookmark-rename, bookmark-insert, bookmark-delete): Adjust calls
to bookmark-completing-read.
(bookmark-bmenu-show-filenames, bookmark-bmenu-hide-filenames)
(bookmark-bmenu-mark, bookmark-bmenu-select, bookmark-bmenu-unmark)
(bookmark-bmenu-delete, bookmark-bmenu-list): Use inhibit-read-only
and erase-buffer.
(bookmark-menu-delete, bookmark-menu-rename, bookmark-menu-locate)
(bookmark-menu-jump, bookmark-menu-insert)
(bookmark-popup-menu-and-apply-function)
(bookmark-menu-popup-paned-bookmark-menu): Remove.
(bookmark-menu-build-paned-menu): Remove by folding it into
bookmark-menu-popup-paned-menu.
(menu-bar-bookmark-map): Move the define-key statements here.
Use the "non-menu" commands since they now pop up a menu if needed.
(bookmark-exit-hook-internal): Simplify.
2003-08-11 17:30:47 +00:00
|
|
|
|
(interactive (list (bookmark-completing-read "Old bookmark name")))
|
1995-03-13 22:50:35 +00:00
|
|
|
|
(bookmark-maybe-historicize-string old)
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(bookmark-maybe-load-default-file)
|
(bookmark-load): Use `bookmark-import-new-list' to
load the new list carefully, renaming bookmarks as necessary.
In docstring, mention new renaming behavior.
Optional arg OVERWRITE replaces inaccurately-named REVERT.
If file loaded was bookmark-default-file, then set
bookmarks-already-loaded to t.
(bookmark-import-new-list): New func.
(bookmark-maybe-rename): New func, helper to above.
(bookmark-set-name): Accept bookmark as either string (behaves
same as before) or list (treat it as a bookmark record).
(bookmark-set, bookmark-maybe-load-default-file)
(bookmark-jump-noselect, bookmark-rename)
(bookmark-show-annotation): Discard pointless `progn's.
(bookmark-bmenu-mark, bookmark-bmenu-unmark)
(bookmark-bmenu-backup-unmark, bookmark-bmenu-delete-backwards):
Renormalize position after all else is done.
(bookmark-edit-annotation-mode, bookmark-bmenu-list)
(bookmark-show-annotation, bookmark-show-all-annotations):
Use `x' instead of `(not (eq x nil))'.
(bookmark-yank-word): Inner save-excursion changed to progn.
(bookmark-send-annotation, bookmark-send-edited-annotation)
(bookmark-insert): Use buffer-string instead of buffer-substring.
(bookmark-make-cell): Make sure annotation and info-node strings
contain no text properties.
(bookmark-relocate): Remember to rebuild bmenu buffer after a
bookmark has been relocated.
(bookmark-bmenu-check-position): Return a meaningful value --
callers have apparently been assuming this anyway.
(bookmark-build-xemacs-menu): Unused function deleted.
(bookmark-version): Removed this variable; the Emacs version suffices.
1997-08-22 19:14:10 +00:00
|
|
|
|
|
|
|
|
|
(setq bookmark-current-point (point))
|
|
|
|
|
(setq bookmark-yank-point (point))
|
|
|
|
|
(setq bookmark-current-buffer (current-buffer))
|
|
|
|
|
(let ((newname
|
|
|
|
|
(or new ; use second arg, if non-nil
|
|
|
|
|
(read-from-minibuffer
|
|
|
|
|
"New name: "
|
|
|
|
|
nil
|
|
|
|
|
(let ((now-map (copy-keymap minibuffer-local-map)))
|
|
|
|
|
(define-key now-map "\C-w" 'bookmark-yank-word)
|
|
|
|
|
now-map)
|
|
|
|
|
nil
|
|
|
|
|
'bookmark-history))))
|
|
|
|
|
(bookmark-set-name old newname)
|
|
|
|
|
(setq bookmark-current-bookmark newname)
|
|
|
|
|
(bookmark-bmenu-surreptitiously-rebuild-list)
|
|
|
|
|
(setq bookmark-alist-modification-count
|
|
|
|
|
(1+ bookmark-alist-modification-count))
|
|
|
|
|
(if (bookmark-time-to-save-p)
|
|
|
|
|
(bookmark-save))))
|
1993-08-10 20:35:31 +00:00
|
|
|
|
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
;;;###autoload
|
1995-06-18 22:46:02 +00:00
|
|
|
|
(defun bookmark-insert (bookmark)
|
2001-01-12 22:49:40 +00:00
|
|
|
|
"Insert the text of the file pointed to by bookmark BOOKMARK.
|
1993-08-14 19:49:27 +00:00
|
|
|
|
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
|
1993-08-14 11:04:06 +00:00
|
|
|
|
this."
|
(bookmark-completing-read): Use a popup menu if activated from the mouse.
Return a string, instead of a list of one string.
(bookmark-edit-annotation): Remove unused vars.
(bookmark-jump, bookmark-relocate, bookmark-insert-location)
(bookmark-rename, bookmark-insert, bookmark-delete): Adjust calls
to bookmark-completing-read.
(bookmark-bmenu-show-filenames, bookmark-bmenu-hide-filenames)
(bookmark-bmenu-mark, bookmark-bmenu-select, bookmark-bmenu-unmark)
(bookmark-bmenu-delete, bookmark-bmenu-list): Use inhibit-read-only
and erase-buffer.
(bookmark-menu-delete, bookmark-menu-rename, bookmark-menu-locate)
(bookmark-menu-jump, bookmark-menu-insert)
(bookmark-popup-menu-and-apply-function)
(bookmark-menu-popup-paned-bookmark-menu): Remove.
(bookmark-menu-build-paned-menu): Remove by folding it into
bookmark-menu-popup-paned-menu.
(menu-bar-bookmark-map): Move the define-key statements here.
Use the "non-menu" commands since they now pop up a menu if needed.
(bookmark-exit-hook-internal): Simplify.
2003-08-11 17:30:47 +00:00
|
|
|
|
(interactive (list (bookmark-completing-read "Insert bookmark contents")))
|
1995-06-18 22:46:02 +00:00
|
|
|
|
(bookmark-maybe-historicize-string bookmark)
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(bookmark-maybe-load-default-file)
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
(let ((orig-point (point))
|
|
|
|
|
(str-to-insert
|
|
|
|
|
(save-excursion
|
1995-06-18 22:46:02 +00:00
|
|
|
|
(set-buffer (car (bookmark-jump-noselect bookmark)))
|
(bookmark-load): Use `bookmark-import-new-list' to
load the new list carefully, renaming bookmarks as necessary.
In docstring, mention new renaming behavior.
Optional arg OVERWRITE replaces inaccurately-named REVERT.
If file loaded was bookmark-default-file, then set
bookmarks-already-loaded to t.
(bookmark-import-new-list): New func.
(bookmark-maybe-rename): New func, helper to above.
(bookmark-set-name): Accept bookmark as either string (behaves
same as before) or list (treat it as a bookmark record).
(bookmark-set, bookmark-maybe-load-default-file)
(bookmark-jump-noselect, bookmark-rename)
(bookmark-show-annotation): Discard pointless `progn's.
(bookmark-bmenu-mark, bookmark-bmenu-unmark)
(bookmark-bmenu-backup-unmark, bookmark-bmenu-delete-backwards):
Renormalize position after all else is done.
(bookmark-edit-annotation-mode, bookmark-bmenu-list)
(bookmark-show-annotation, bookmark-show-all-annotations):
Use `x' instead of `(not (eq x nil))'.
(bookmark-yank-word): Inner save-excursion changed to progn.
(bookmark-send-annotation, bookmark-send-edited-annotation)
(bookmark-insert): Use buffer-string instead of buffer-substring.
(bookmark-make-cell): Make sure annotation and info-node strings
contain no text properties.
(bookmark-relocate): Remember to rebuild bmenu buffer after a
bookmark has been relocated.
(bookmark-bmenu-check-position): Return a meaningful value --
callers have apparently been assuming this anyway.
(bookmark-build-xemacs-menu): Unused function deleted.
(bookmark-version): Removed this variable; the Emacs version suffices.
1997-08-22 19:14:10 +00:00
|
|
|
|
(buffer-string))))
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
(insert str-to-insert)
|
|
|
|
|
(push-mark)
|
|
|
|
|
(goto-char orig-point)))
|
|
|
|
|
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
;;;###autoload
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(defun bookmark-delete (bookmark &optional batch)
|
2001-01-12 22:49:40 +00:00
|
|
|
|
"Delete BOOKMARK from the bookmark list.
|
1993-08-14 19:49:27 +00:00
|
|
|
|
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
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
one most recently used in this file, if any\).
|
|
|
|
|
Optional second arg BATCH means don't update the bookmark list buffer,
|
|
|
|
|
probably because we were called from there."
|
|
|
|
|
(interactive
|
(bookmark-completing-read): Use a popup menu if activated from the mouse.
Return a string, instead of a list of one string.
(bookmark-edit-annotation): Remove unused vars.
(bookmark-jump, bookmark-relocate, bookmark-insert-location)
(bookmark-rename, bookmark-insert, bookmark-delete): Adjust calls
to bookmark-completing-read.
(bookmark-bmenu-show-filenames, bookmark-bmenu-hide-filenames)
(bookmark-bmenu-mark, bookmark-bmenu-select, bookmark-bmenu-unmark)
(bookmark-bmenu-delete, bookmark-bmenu-list): Use inhibit-read-only
and erase-buffer.
(bookmark-menu-delete, bookmark-menu-rename, bookmark-menu-locate)
(bookmark-menu-jump, bookmark-menu-insert)
(bookmark-popup-menu-and-apply-function)
(bookmark-menu-popup-paned-bookmark-menu): Remove.
(bookmark-menu-build-paned-menu): Remove by folding it into
bookmark-menu-popup-paned-menu.
(menu-bar-bookmark-map): Move the define-key statements here.
Use the "non-menu" commands since they now pop up a menu if needed.
(bookmark-exit-hook-internal): Simplify.
2003-08-11 17:30:47 +00:00
|
|
|
|
(list (bookmark-completing-read "Delete bookmark"
|
|
|
|
|
bookmark-current-bookmark)))
|
1995-03-13 22:50:35 +00:00
|
|
|
|
(bookmark-maybe-historicize-string bookmark)
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(bookmark-maybe-load-default-file)
|
|
|
|
|
(let ((will-go (bookmark-get-bookmark bookmark)))
|
1993-08-13 00:59:51 +00:00
|
|
|
|
(setq bookmark-alist (delq will-go bookmark-alist))
|
|
|
|
|
;; Added by db, nil bookmark-current-bookmark if the last
|
1996-01-04 23:28:24 +00:00
|
|
|
|
;; occurrence has been deleted
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(or (bookmark-get-bookmark bookmark-current-bookmark)
|
1993-08-13 00:59:51 +00:00
|
|
|
|
(setq bookmark-current-bookmark nil)))
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
;; Don't rebuild the list
|
|
|
|
|
(if batch
|
|
|
|
|
nil
|
|
|
|
|
(bookmark-bmenu-surreptitiously-rebuild-list)
|
|
|
|
|
(setq bookmark-alist-modification-count
|
|
|
|
|
(1+ bookmark-alist-modification-count))
|
|
|
|
|
(if (bookmark-time-to-save-p)
|
|
|
|
|
(bookmark-save))))
|
|
|
|
|
|
1993-08-10 20:35:31 +00:00
|
|
|
|
|
|
|
|
|
(defun bookmark-time-to-save-p (&optional last-time)
|
|
|
|
|
;; By Gregory M. Saunders <saunders@cis.ohio-state.edu>
|
|
|
|
|
;; finds out whether it's time to save bookmarks to a file, by
|
|
|
|
|
;; examining the value of variable bookmark-save-flag, and maybe
|
|
|
|
|
;; bookmark-alist-modification-count. Returns t if they should be
|
|
|
|
|
;; saved, nil otherwise. if last-time is non-nil, then this is
|
|
|
|
|
;; being called when emacs is killed.
|
2001-01-12 22:49:40 +00:00
|
|
|
|
(cond (last-time
|
1993-08-10 20:35:31 +00:00
|
|
|
|
(and (> bookmark-alist-modification-count 0)
|
|
|
|
|
bookmark-save-flag))
|
|
|
|
|
((numberp bookmark-save-flag)
|
|
|
|
|
(>= bookmark-alist-modification-count bookmark-save-flag))
|
|
|
|
|
(t
|
|
|
|
|
nil)))
|
|
|
|
|
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
;;;###autoload
|
1993-08-10 20:35:31 +00:00
|
|
|
|
(defun bookmark-write ()
|
1996-05-09 17:34:55 +00:00
|
|
|
|
"Write bookmarks to a file (reading the file name with the minibuffer).
|
|
|
|
|
Don't use this in Lisp programs; use `bookmark-save' instead."
|
1993-08-10 20:35:31 +00:00
|
|
|
|
(interactive)
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(bookmark-maybe-load-default-file)
|
1993-08-10 20:35:31 +00:00
|
|
|
|
(bookmark-save t))
|
|
|
|
|
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
;;;###autoload
|
2001-01-12 22:49:40 +00:00
|
|
|
|
(defun bookmark-save (&optional parg file)
|
1993-08-14 19:49:27 +00:00
|
|
|
|
"Save currently defined bookmarks.
|
|
|
|
|
Saves by default in the file defined by the variable
|
1995-06-18 22:46:02 +00:00
|
|
|
|
`bookmark-default-file'. With a prefix arg, save it in file FILE
|
|
|
|
|
\(second argument\).
|
1993-08-10 20:35:31 +00:00
|
|
|
|
|
(bookmark-automatically-show-annotations, bookmark-read-annotation-text-func): Doc fixes.
(bookmark-save): Improve argument/docstring consistency.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-alist-from-buffer, bookmark-upgrade-file-format-from-0,
bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format,
bookmark-kill-line, bookmark-read-annotation-mode,
bookmark-insert-current-bookmark, bookmark-jump, bookmark-exit-hook):
Fix typos in docstrings.
(bookmark-exit-hooks): Define as obsolete alias.
(bookmark-exit-hook-internal): Run `bookmark-exit-hook',
not `bookmark-exit-hooks'. Fix docstring.
(bookmark-bmenu-select): "?\ " -> "?\s".
2005-07-26 13:56:01 +00:00
|
|
|
|
If you are calling this from Lisp, the two arguments are PARG and
|
|
|
|
|
FILE, and if you just want it to write to the default file, then
|
1993-08-10 20:35:31 +00:00
|
|
|
|
pass no arguments. Or pass in nil and FILE, and it will save in FILE
|
|
|
|
|
instead. If you pass in one argument, and it is non-nil, then the
|
|
|
|
|
user will be interactively queried for a file to save in.
|
|
|
|
|
|
1993-08-13 00:59:51 +00:00
|
|
|
|
When you want to load in the bookmarks from a file, use
|
1993-08-14 19:49:27 +00:00
|
|
|
|
\`bookmark-load\', \\[bookmark-load]. That function will prompt you
|
1993-08-13 00:59:51 +00:00
|
|
|
|
for a file, defaulting to the file defined by variable
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
`bookmark-default-file'."
|
1993-08-10 20:35:31 +00:00
|
|
|
|
(interactive "P")
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(bookmark-maybe-load-default-file)
|
1993-08-10 20:35:31 +00:00
|
|
|
|
(cond
|
|
|
|
|
((and (null parg) (null file))
|
|
|
|
|
;;whether interactive or not, write to default file
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(bookmark-write-file bookmark-default-file))
|
1993-08-10 20:35:31 +00:00
|
|
|
|
((and (null parg) file)
|
|
|
|
|
;;whether interactive or not, write to given file
|
|
|
|
|
(bookmark-write-file file))
|
|
|
|
|
((and parg (not file))
|
|
|
|
|
;;have been called interactively w/ prefix arg
|
|
|
|
|
(let ((file (read-file-name "File to save bookmarks in: ")))
|
|
|
|
|
(bookmark-write-file file)))
|
|
|
|
|
(t ; someone called us with prefix-arg *and* a file, so just write to file
|
|
|
|
|
(bookmark-write-file file)))
|
|
|
|
|
;; signal that we have synced the bookmark file by setting this to
|
|
|
|
|
;; 0. If there was an error at any point before, it will not get
|
|
|
|
|
;; set, which is what we want.
|
|
|
|
|
(setq bookmark-alist-modification-count 0))
|
|
|
|
|
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
|
|
|
|
|
1993-08-10 20:35:31 +00:00
|
|
|
|
(defun bookmark-write-file (file)
|
|
|
|
|
(save-excursion
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
(save-window-excursion
|
|
|
|
|
(if (>= baud-rate 9600)
|
1996-01-25 00:59:34 +00:00
|
|
|
|
(message "Saving bookmarks to file %s..." file))
|
1993-10-26 03:29:54 +00:00
|
|
|
|
(set-buffer (let ((enable-local-variables nil))
|
1993-10-25 23:56:15 +00:00
|
|
|
|
(find-file-noselect file)))
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
(goto-char (point-min))
|
2001-11-27 15:52:52 +00:00
|
|
|
|
(let ((print-length nil)
|
2001-09-04 13:17:56 +00:00
|
|
|
|
(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))))
|
2005-04-11 01:18:35 +00:00
|
|
|
|
(condition-case nil
|
|
|
|
|
(write-file file)
|
|
|
|
|
(file-error (message "Can't write %s" file)))
|
2001-09-04 13:17:56 +00:00
|
|
|
|
(kill-buffer (current-buffer))
|
|
|
|
|
(if (>= baud-rate 9600)
|
|
|
|
|
(message "Saving bookmarks to file %s...done" file)))))))
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
|
(bookmark-load): Use `bookmark-import-new-list' to
load the new list carefully, renaming bookmarks as necessary.
In docstring, mention new renaming behavior.
Optional arg OVERWRITE replaces inaccurately-named REVERT.
If file loaded was bookmark-default-file, then set
bookmarks-already-loaded to t.
(bookmark-import-new-list): New func.
(bookmark-maybe-rename): New func, helper to above.
(bookmark-set-name): Accept bookmark as either string (behaves
same as before) or list (treat it as a bookmark record).
(bookmark-set, bookmark-maybe-load-default-file)
(bookmark-jump-noselect, bookmark-rename)
(bookmark-show-annotation): Discard pointless `progn's.
(bookmark-bmenu-mark, bookmark-bmenu-unmark)
(bookmark-bmenu-backup-unmark, bookmark-bmenu-delete-backwards):
Renormalize position after all else is done.
(bookmark-edit-annotation-mode, bookmark-bmenu-list)
(bookmark-show-annotation, bookmark-show-all-annotations):
Use `x' instead of `(not (eq x nil))'.
(bookmark-yank-word): Inner save-excursion changed to progn.
(bookmark-send-annotation, bookmark-send-edited-annotation)
(bookmark-insert): Use buffer-string instead of buffer-substring.
(bookmark-make-cell): Make sure annotation and info-node strings
contain no text properties.
(bookmark-relocate): Remember to rebuild bmenu buffer after a
bookmark has been relocated.
(bookmark-bmenu-check-position): Return a meaningful value --
callers have apparently been assuming this anyway.
(bookmark-build-xemacs-menu): Unused function deleted.
(bookmark-version): Removed this variable; the Emacs version suffices.
1997-08-22 19:14:10 +00:00
|
|
|
|
(defun bookmark-import-new-list (new-list)
|
|
|
|
|
;; Walk over the new list, adding each individual bookmark
|
|
|
|
|
;; carefully. "Carefully" means checking against the existing
|
|
|
|
|
;; bookmark-alist and renaming the new bookmarks with <N> extensions
|
|
|
|
|
;; as necessary.
|
|
|
|
|
(let ((lst new-list)
|
|
|
|
|
(names (bookmark-all-names)))
|
|
|
|
|
(while lst
|
|
|
|
|
(let* ((full-record (car lst)))
|
|
|
|
|
(bookmark-maybe-rename full-record names)
|
|
|
|
|
(setq bookmark-alist (nconc bookmark-alist (list full-record)))
|
|
|
|
|
(setq names (cons (bookmark-name-from-full-record full-record) names))
|
|
|
|
|
(setq lst (cdr lst))))))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun bookmark-maybe-rename (full-record names)
|
|
|
|
|
;; just a helper for bookmark-import-new-list; it is only for
|
|
|
|
|
;; readability that this is not inlined.
|
|
|
|
|
;;
|
|
|
|
|
;; Once this has found a free name, it sets full-record to that
|
|
|
|
|
;; name.
|
|
|
|
|
(let ((found-name (bookmark-name-from-full-record full-record)))
|
|
|
|
|
(if (member found-name names)
|
|
|
|
|
;; We've got a conflict, so generate a new name
|
|
|
|
|
(let ((count 2)
|
|
|
|
|
(new-name found-name))
|
|
|
|
|
(while (member new-name names)
|
|
|
|
|
(setq new-name (concat found-name (format "<%d>" count)))
|
|
|
|
|
(setq count (1+ count)))
|
|
|
|
|
(bookmark-set-name full-record new-name)))))
|
|
|
|
|
|
|
|
|
|
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
;;;###autoload
|
(bookmark-load): Use `bookmark-import-new-list' to
load the new list carefully, renaming bookmarks as necessary.
In docstring, mention new renaming behavior.
Optional arg OVERWRITE replaces inaccurately-named REVERT.
If file loaded was bookmark-default-file, then set
bookmarks-already-loaded to t.
(bookmark-import-new-list): New func.
(bookmark-maybe-rename): New func, helper to above.
(bookmark-set-name): Accept bookmark as either string (behaves
same as before) or list (treat it as a bookmark record).
(bookmark-set, bookmark-maybe-load-default-file)
(bookmark-jump-noselect, bookmark-rename)
(bookmark-show-annotation): Discard pointless `progn's.
(bookmark-bmenu-mark, bookmark-bmenu-unmark)
(bookmark-bmenu-backup-unmark, bookmark-bmenu-delete-backwards):
Renormalize position after all else is done.
(bookmark-edit-annotation-mode, bookmark-bmenu-list)
(bookmark-show-annotation, bookmark-show-all-annotations):
Use `x' instead of `(not (eq x nil))'.
(bookmark-yank-word): Inner save-excursion changed to progn.
(bookmark-send-annotation, bookmark-send-edited-annotation)
(bookmark-insert): Use buffer-string instead of buffer-substring.
(bookmark-make-cell): Make sure annotation and info-node strings
contain no text properties.
(bookmark-relocate): Remember to rebuild bmenu buffer after a
bookmark has been relocated.
(bookmark-bmenu-check-position): Return a meaningful value --
callers have apparently been assuming this anyway.
(bookmark-build-xemacs-menu): Unused function deleted.
(bookmark-version): Removed this variable; the Emacs version suffices.
1997-08-22 19:14:10 +00:00
|
|
|
|
(defun bookmark-load (file &optional overwrite no-msg)
|
1993-08-14 19:49:27 +00:00
|
|
|
|
"Load bookmarks from FILE (which must be in bookmark format).
|
|
|
|
|
Appends loaded bookmarks to the front of the list of bookmarks. If
|
(bookmark-load): Use `bookmark-import-new-list' to
load the new list carefully, renaming bookmarks as necessary.
In docstring, mention new renaming behavior.
Optional arg OVERWRITE replaces inaccurately-named REVERT.
If file loaded was bookmark-default-file, then set
bookmarks-already-loaded to t.
(bookmark-import-new-list): New func.
(bookmark-maybe-rename): New func, helper to above.
(bookmark-set-name): Accept bookmark as either string (behaves
same as before) or list (treat it as a bookmark record).
(bookmark-set, bookmark-maybe-load-default-file)
(bookmark-jump-noselect, bookmark-rename)
(bookmark-show-annotation): Discard pointless `progn's.
(bookmark-bmenu-mark, bookmark-bmenu-unmark)
(bookmark-bmenu-backup-unmark, bookmark-bmenu-delete-backwards):
Renormalize position after all else is done.
(bookmark-edit-annotation-mode, bookmark-bmenu-list)
(bookmark-show-annotation, bookmark-show-all-annotations):
Use `x' instead of `(not (eq x nil))'.
(bookmark-yank-word): Inner save-excursion changed to progn.
(bookmark-send-annotation, bookmark-send-edited-annotation)
(bookmark-insert): Use buffer-string instead of buffer-substring.
(bookmark-make-cell): Make sure annotation and info-node strings
contain no text properties.
(bookmark-relocate): Remember to rebuild bmenu buffer after a
bookmark has been relocated.
(bookmark-bmenu-check-position): Return a meaningful value --
callers have apparently been assuming this anyway.
(bookmark-build-xemacs-menu): Unused function deleted.
(bookmark-version): Removed this variable; the Emacs version suffices.
1997-08-22 19:14:10 +00:00
|
|
|
|
optional second argument OVERWRITE is non-nil, existing bookmarks are
|
1993-08-14 19:49:27 +00:00
|
|
|
|
destroyed. Optional third arg NO-MSG means don't display any messages
|
|
|
|
|
while loading.
|
1993-08-10 20:35:31 +00:00
|
|
|
|
|
|
|
|
|
If you load a file that doesn't contain a proper bookmark alist, you
|
1993-08-14 19:49:27 +00:00
|
|
|
|
will corrupt Emacs's bookmark list. Generally, you should only load
|
1993-08-10 20:35:31 +00:00
|
|
|
|
in files that were created with the bookmark functions in the first
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
place. Your own personal bookmark file, `~/.emacs.bmk', is
|
1993-08-14 11:04:06 +00:00
|
|
|
|
maintained automatically by Emacs; you shouldn't need to load it
|
(bookmark-load): Use `bookmark-import-new-list' to
load the new list carefully, renaming bookmarks as necessary.
In docstring, mention new renaming behavior.
Optional arg OVERWRITE replaces inaccurately-named REVERT.
If file loaded was bookmark-default-file, then set
bookmarks-already-loaded to t.
(bookmark-import-new-list): New func.
(bookmark-maybe-rename): New func, helper to above.
(bookmark-set-name): Accept bookmark as either string (behaves
same as before) or list (treat it as a bookmark record).
(bookmark-set, bookmark-maybe-load-default-file)
(bookmark-jump-noselect, bookmark-rename)
(bookmark-show-annotation): Discard pointless `progn's.
(bookmark-bmenu-mark, bookmark-bmenu-unmark)
(bookmark-bmenu-backup-unmark, bookmark-bmenu-delete-backwards):
Renormalize position after all else is done.
(bookmark-edit-annotation-mode, bookmark-bmenu-list)
(bookmark-show-annotation, bookmark-show-all-annotations):
Use `x' instead of `(not (eq x nil))'.
(bookmark-yank-word): Inner save-excursion changed to progn.
(bookmark-send-annotation, bookmark-send-edited-annotation)
(bookmark-insert): Use buffer-string instead of buffer-substring.
(bookmark-make-cell): Make sure annotation and info-node strings
contain no text properties.
(bookmark-relocate): Remember to rebuild bmenu buffer after a
bookmark has been relocated.
(bookmark-bmenu-check-position): Return a meaningful value --
callers have apparently been assuming this anyway.
(bookmark-build-xemacs-menu): Unused function deleted.
(bookmark-version): Removed this variable; the Emacs version suffices.
1997-08-22 19:14:10 +00:00
|
|
|
|
explicitly.
|
|
|
|
|
|
|
|
|
|
If you load a file containing bookmarks with the same names as
|
|
|
|
|
bookmarks already present in your Emacs, the new bookmarks will get
|
|
|
|
|
unique numeric suffixes \"<2>\", \"<3>\", ... following the same
|
|
|
|
|
method buffers use to resolve name collisions."
|
1993-08-10 20:35:31 +00:00
|
|
|
|
(interactive
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(list (read-file-name
|
|
|
|
|
(format "Load bookmarks from: (%s) "
|
2001-01-12 22:49:40 +00:00
|
|
|
|
bookmark-default-file)
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
;;Default might not be used often,
|
|
|
|
|
;;but there's no better default, and
|
|
|
|
|
;;I guess it's better than none at all.
|
|
|
|
|
"~/" bookmark-default-file 'confirm)))
|
1993-08-10 20:35:31 +00:00
|
|
|
|
(setq file (expand-file-name file))
|
|
|
|
|
(if (file-readable-p file)
|
|
|
|
|
(save-excursion
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
(save-window-excursion
|
|
|
|
|
(if (and (null no-msg) (>= baud-rate 9600))
|
1996-01-25 00:59:34 +00:00
|
|
|
|
(message "Loading bookmarks from %s..." file))
|
1993-10-26 03:29:54 +00:00
|
|
|
|
(set-buffer (let ((enable-local-variables nil))
|
1993-10-25 23:56:15 +00:00
|
|
|
|
(find-file-noselect file)))
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
(goto-char (point-min))
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(bookmark-maybe-upgrade-file-format)
|
|
|
|
|
(let ((blist (bookmark-alist-from-buffer)))
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
(if (listp blist)
|
|
|
|
|
(progn
|
(bookmark-load): Use `bookmark-import-new-list' to
load the new list carefully, renaming bookmarks as necessary.
In docstring, mention new renaming behavior.
Optional arg OVERWRITE replaces inaccurately-named REVERT.
If file loaded was bookmark-default-file, then set
bookmarks-already-loaded to t.
(bookmark-import-new-list): New func.
(bookmark-maybe-rename): New func, helper to above.
(bookmark-set-name): Accept bookmark as either string (behaves
same as before) or list (treat it as a bookmark record).
(bookmark-set, bookmark-maybe-load-default-file)
(bookmark-jump-noselect, bookmark-rename)
(bookmark-show-annotation): Discard pointless `progn's.
(bookmark-bmenu-mark, bookmark-bmenu-unmark)
(bookmark-bmenu-backup-unmark, bookmark-bmenu-delete-backwards):
Renormalize position after all else is done.
(bookmark-edit-annotation-mode, bookmark-bmenu-list)
(bookmark-show-annotation, bookmark-show-all-annotations):
Use `x' instead of `(not (eq x nil))'.
(bookmark-yank-word): Inner save-excursion changed to progn.
(bookmark-send-annotation, bookmark-send-edited-annotation)
(bookmark-insert): Use buffer-string instead of buffer-substring.
(bookmark-make-cell): Make sure annotation and info-node strings
contain no text properties.
(bookmark-relocate): Remember to rebuild bmenu buffer after a
bookmark has been relocated.
(bookmark-bmenu-check-position): Return a meaningful value --
callers have apparently been assuming this anyway.
(bookmark-build-xemacs-menu): Unused function deleted.
(bookmark-version): Removed this variable; the Emacs version suffices.
1997-08-22 19:14:10 +00:00
|
|
|
|
(if overwrite
|
|
|
|
|
(progn
|
|
|
|
|
(setq bookmark-alist blist)
|
|
|
|
|
(setq bookmark-alist-modification-count 0))
|
|
|
|
|
;; else
|
|
|
|
|
(bookmark-import-new-list blist)
|
|
|
|
|
(setq bookmark-alist-modification-count
|
|
|
|
|
(1+ bookmark-alist-modification-count)))
|
|
|
|
|
(if (string-equal
|
|
|
|
|
(expand-file-name bookmark-default-file)
|
|
|
|
|
file)
|
|
|
|
|
(setq bookmarks-already-loaded t))
|
2001-01-12 22:49:40 +00:00
|
|
|
|
(bookmark-bmenu-surreptitiously-rebuild-list))
|
1996-01-25 06:02:21 +00:00
|
|
|
|
(error "Invalid bookmark list in %s" file)))
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
(kill-buffer (current-buffer)))
|
|
|
|
|
(if (and (null no-msg) (>= baud-rate 9600))
|
1996-01-25 00:59:34 +00:00
|
|
|
|
(message "Loading bookmarks from %s...done" file)))
|
1996-01-25 06:02:21 +00:00
|
|
|
|
(error "Cannot read bookmark file %s" file)))
|
1993-08-10 20:35:31 +00:00
|
|
|
|
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
|
|
|
|
;;; Code supporting the dired-like bookmark menu. Prefix is
|
|
|
|
|
;;; "bookmark-bmenu" for "buffer-menu":
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defvar bookmark-bmenu-bookmark-column nil)
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
|
|
|
|
|
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(defvar bookmark-bmenu-hidden-bookmarks ())
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defvar bookmark-bmenu-mode-map nil)
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
|
|
|
|
|
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(if bookmark-bmenu-mode-map
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
nil
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(setq bookmark-bmenu-mode-map (make-keymap))
|
|
|
|
|
(suppress-keymap bookmark-bmenu-mode-map t)
|
1998-03-08 00:20:23 +00:00
|
|
|
|
(define-key bookmark-bmenu-mode-map "q" 'quit-window)
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(define-key bookmark-bmenu-mode-map "v" 'bookmark-bmenu-select)
|
|
|
|
|
(define-key bookmark-bmenu-mode-map "w" 'bookmark-bmenu-locate)
|
|
|
|
|
(define-key bookmark-bmenu-mode-map "2" 'bookmark-bmenu-2-window)
|
|
|
|
|
(define-key bookmark-bmenu-mode-map "1" 'bookmark-bmenu-1-window)
|
|
|
|
|
(define-key bookmark-bmenu-mode-map "j" 'bookmark-bmenu-this-window)
|
1996-05-08 19:16:51 +00:00
|
|
|
|
(define-key bookmark-bmenu-mode-map "\C-c\C-c" 'bookmark-bmenu-this-window)
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(define-key bookmark-bmenu-mode-map "f" 'bookmark-bmenu-this-window)
|
1999-12-09 04:49:37 +00:00
|
|
|
|
(define-key bookmark-bmenu-mode-map "\C-m" 'bookmark-bmenu-this-window)
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(define-key bookmark-bmenu-mode-map "o" 'bookmark-bmenu-other-window)
|
1996-05-08 19:16:51 +00:00
|
|
|
|
(define-key bookmark-bmenu-mode-map "\C-o"
|
|
|
|
|
'bookmark-bmenu-switch-other-window)
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(define-key bookmark-bmenu-mode-map "s" 'bookmark-bmenu-save)
|
|
|
|
|
(define-key bookmark-bmenu-mode-map "k" 'bookmark-bmenu-delete)
|
|
|
|
|
(define-key bookmark-bmenu-mode-map "\C-d" 'bookmark-bmenu-delete-backwards)
|
|
|
|
|
(define-key bookmark-bmenu-mode-map "x" 'bookmark-bmenu-execute-deletions)
|
|
|
|
|
(define-key bookmark-bmenu-mode-map "d" 'bookmark-bmenu-delete)
|
|
|
|
|
(define-key bookmark-bmenu-mode-map " " 'next-line)
|
|
|
|
|
(define-key bookmark-bmenu-mode-map "n" 'next-line)
|
|
|
|
|
(define-key bookmark-bmenu-mode-map "p" 'previous-line)
|
|
|
|
|
(define-key bookmark-bmenu-mode-map "\177" 'bookmark-bmenu-backup-unmark)
|
|
|
|
|
(define-key bookmark-bmenu-mode-map "?" 'describe-mode)
|
|
|
|
|
(define-key bookmark-bmenu-mode-map "u" 'bookmark-bmenu-unmark)
|
|
|
|
|
(define-key bookmark-bmenu-mode-map "m" 'bookmark-bmenu-mark)
|
2001-01-12 22:49:40 +00:00
|
|
|
|
(define-key bookmark-bmenu-mode-map "l" 'bookmark-bmenu-load)
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(define-key bookmark-bmenu-mode-map "r" 'bookmark-bmenu-rename)
|
2004-06-13 01:59:21 +00:00
|
|
|
|
(define-key bookmark-bmenu-mode-map "R" 'bookmark-bmenu-relocate)
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(define-key bookmark-bmenu-mode-map "t" 'bookmark-bmenu-toggle-filenames)
|
|
|
|
|
(define-key bookmark-bmenu-mode-map "a" 'bookmark-bmenu-show-annotation)
|
|
|
|
|
(define-key bookmark-bmenu-mode-map "A" 'bookmark-bmenu-show-all-annotations)
|
1997-03-30 21:38:43 +00:00
|
|
|
|
(define-key bookmark-bmenu-mode-map "e" 'bookmark-bmenu-edit-annotation)
|
|
|
|
|
(define-key bookmark-bmenu-mode-map [mouse-2]
|
|
|
|
|
'bookmark-bmenu-other-window-with-mouse))
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
2001-01-12 22:49:40 +00:00
|
|
|
|
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
|
|
|
|
;; Bookmark Buffer Menu mode is suitable only for specially formatted
|
|
|
|
|
;; data.
|
|
|
|
|
(put 'bookmark-bmenu-mode 'mode-class 'special)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;; todo: need to display whether or not bookmark exists as a buffer in
|
2001-01-12 22:49:40 +00:00
|
|
|
|
;; flag column.
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
|
|
|
|
|
;; Format:
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
;; FLAGS BOOKMARK [ LOCATION ]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun bookmark-bmenu-surreptitiously-rebuild-list ()
|
|
|
|
|
"Rebuild the Bookmark List if it exists.
|
|
|
|
|
Don't affect the buffer ring order."
|
|
|
|
|
(if (get-buffer "*Bookmark List*")
|
|
|
|
|
(save-excursion
|
2001-01-12 22:49:40 +00:00
|
|
|
|
(save-window-excursion
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(bookmark-bmenu-list)))))
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;###autoload
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(defun bookmark-bmenu-list ()
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
"Display a list of existing bookmarks.
|
|
|
|
|
The list is displayed in a buffer named `*Bookmark List*'.
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
The leftmost column displays a D if the bookmark is flagged for
|
|
|
|
|
deletion, or > if it is flagged for displaying."
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
(interactive)
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(bookmark-maybe-load-default-file)
|
|
|
|
|
(if (interactive-p)
|
|
|
|
|
(switch-to-buffer (get-buffer-create "*Bookmark List*"))
|
|
|
|
|
(set-buffer (get-buffer-create "*Bookmark List*")))
|
(bookmark-completing-read): Use a popup menu if activated from the mouse.
Return a string, instead of a list of one string.
(bookmark-edit-annotation): Remove unused vars.
(bookmark-jump, bookmark-relocate, bookmark-insert-location)
(bookmark-rename, bookmark-insert, bookmark-delete): Adjust calls
to bookmark-completing-read.
(bookmark-bmenu-show-filenames, bookmark-bmenu-hide-filenames)
(bookmark-bmenu-mark, bookmark-bmenu-select, bookmark-bmenu-unmark)
(bookmark-bmenu-delete, bookmark-bmenu-list): Use inhibit-read-only
and erase-buffer.
(bookmark-menu-delete, bookmark-menu-rename, bookmark-menu-locate)
(bookmark-menu-jump, bookmark-menu-insert)
(bookmark-popup-menu-and-apply-function)
(bookmark-menu-popup-paned-bookmark-menu): Remove.
(bookmark-menu-build-paned-menu): Remove by folding it into
bookmark-menu-popup-paned-menu.
(menu-bar-bookmark-map): Move the define-key statements here.
Use the "non-menu" commands since they now pop up a menu if needed.
(bookmark-exit-hook-internal): Simplify.
2003-08-11 17:30:47 +00:00
|
|
|
|
(let ((inhibit-read-only t))
|
|
|
|
|
(erase-buffer)
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
(insert "% Bookmark\n- --------\n")
|
|
|
|
|
(bookmark-maybe-sort-alist)
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(mapcar
|
|
|
|
|
(lambda (full-record)
|
1996-01-04 23:28:24 +00:00
|
|
|
|
;; if a bookmark has an annotation, prepend a "*"
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
;; in the list of bookmarks.
|
|
|
|
|
(let ((annotation (bookmark-get-annotation
|
|
|
|
|
(bookmark-name-from-full-record full-record))))
|
(bookmark-load): Use `bookmark-import-new-list' to
load the new list carefully, renaming bookmarks as necessary.
In docstring, mention new renaming behavior.
Optional arg OVERWRITE replaces inaccurately-named REVERT.
If file loaded was bookmark-default-file, then set
bookmarks-already-loaded to t.
(bookmark-import-new-list): New func.
(bookmark-maybe-rename): New func, helper to above.
(bookmark-set-name): Accept bookmark as either string (behaves
same as before) or list (treat it as a bookmark record).
(bookmark-set, bookmark-maybe-load-default-file)
(bookmark-jump-noselect, bookmark-rename)
(bookmark-show-annotation): Discard pointless `progn's.
(bookmark-bmenu-mark, bookmark-bmenu-unmark)
(bookmark-bmenu-backup-unmark, bookmark-bmenu-delete-backwards):
Renormalize position after all else is done.
(bookmark-edit-annotation-mode, bookmark-bmenu-list)
(bookmark-show-annotation, bookmark-show-all-annotations):
Use `x' instead of `(not (eq x nil))'.
(bookmark-yank-word): Inner save-excursion changed to progn.
(bookmark-send-annotation, bookmark-send-edited-annotation)
(bookmark-insert): Use buffer-string instead of buffer-substring.
(bookmark-make-cell): Make sure annotation and info-node strings
contain no text properties.
(bookmark-relocate): Remember to rebuild bmenu buffer after a
bookmark has been relocated.
(bookmark-bmenu-check-position): Return a meaningful value --
callers have apparently been assuming this anyway.
(bookmark-build-xemacs-menu): Unused function deleted.
(bookmark-version): Removed this variable; the Emacs version suffices.
1997-08-22 19:14:10 +00:00
|
|
|
|
(if (and annotation (not (string-equal annotation "")))
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(insert " *")
|
|
|
|
|
(insert " "))
|
1997-03-30 21:38:43 +00:00
|
|
|
|
(let ((start (point)))
|
|
|
|
|
(insert (bookmark-name-from-full-record full-record))
|
2000-06-06 22:41:24 +00:00
|
|
|
|
(if (and (display-color-p) (display-mouse-p))
|
2001-06-24 11:14:12 +00:00
|
|
|
|
(add-text-properties start
|
|
|
|
|
(save-excursion (re-search-backward
|
|
|
|
|
"[^ \t]")
|
|
|
|
|
(1+ (point)))
|
|
|
|
|
'(mouse-face highlight
|
|
|
|
|
help-echo "mouse-2: go to this bookmark")))
|
1997-03-30 21:38:43 +00:00
|
|
|
|
(insert "\n")
|
|
|
|
|
)))
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
bookmark-alist))
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
(forward-line 2)
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(bookmark-bmenu-mode)
|
|
|
|
|
(if bookmark-bmenu-toggle-filenames
|
|
|
|
|
(bookmark-bmenu-toggle-filenames t)))
|
|
|
|
|
|
|
|
|
|
;;;###autoload
|
|
|
|
|
(defalias 'list-bookmarks 'bookmark-bmenu-list)
|
|
|
|
|
;;;###autoload
|
|
|
|
|
(defalias 'edit-bookmarks 'bookmark-bmenu-list)
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun bookmark-bmenu-mode ()
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
"Major mode for editing a list of bookmarks.
|
|
|
|
|
Each line describes one of the bookmarks in Emacs.
|
|
|
|
|
Letters do not insert themselves; instead, they are commands.
|
1996-01-04 23:28:24 +00:00
|
|
|
|
Bookmark names preceded by a \"*\" have annotations.
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
\\<bookmark-bmenu-mode-map>
|
|
|
|
|
\\[bookmark-bmenu-mark] -- mark bookmark to be displayed.
|
|
|
|
|
\\[bookmark-bmenu-select] -- select bookmark of line point is on.
|
|
|
|
|
Also show bookmarks marked using m in other windows.
|
|
|
|
|
\\[bookmark-bmenu-toggle-filenames] -- toggle displaying of filenames (they may obscure long bookmark names).
|
|
|
|
|
\\[bookmark-bmenu-locate] -- display (in minibuffer) location of this bookmark.
|
|
|
|
|
\\[bookmark-bmenu-1-window] -- select this bookmark in full-frame window.
|
|
|
|
|
\\[bookmark-bmenu-2-window] -- select this bookmark in one window,
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
together with bookmark selected before this one in another window.
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
\\[bookmark-bmenu-this-window] -- select this bookmark in place of the bookmark menu buffer.
|
|
|
|
|
\\[bookmark-bmenu-other-window] -- select this bookmark in another window,
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
so the bookmark menu bookmark remains visible in its window.
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
\\[bookmark-bmenu-switch-other-window] -- switch the other window to this bookmark.
|
2001-01-12 22:49:40 +00:00
|
|
|
|
\\[bookmark-bmenu-rename] -- rename this bookmark \(prompts for new name\).
|
2004-06-13 01:59:21 +00:00
|
|
|
|
\\[bookmark-bmenu-relocate] -- relocate this bookmark's file \(prompts for new file\).
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
\\[bookmark-bmenu-delete] -- mark this bookmark to be deleted, and move down.
|
2001-01-12 22:49:40 +00:00
|
|
|
|
\\[bookmark-bmenu-delete-backwards] -- mark this bookmark to be deleted, and move up.
|
1996-01-05 21:57:54 +00:00
|
|
|
|
\\[bookmark-bmenu-execute-deletions] -- delete bookmarks marked with `\\[bookmark-bmenu-delete]'.
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
\\[bookmark-bmenu-save] -- save the current bookmark list in the default file.
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
With a prefix arg, prompts for a file to save in.
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
\\[bookmark-bmenu-load] -- load in a file of bookmarks (prompts for file.)
|
|
|
|
|
\\[bookmark-bmenu-unmark] -- remove all kinds of marks from current line.
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
With prefix argument, also move up one line.
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
\\[bookmark-bmenu-backup-unmark] -- back up a line and remove marks.
|
|
|
|
|
\\[bookmark-bmenu-show-annotation] -- show the annotation, if it exists, for the current bookmark
|
|
|
|
|
in another buffer.
|
|
|
|
|
\\[bookmark-bmenu-show-all-annotations] -- show the annotations of all bookmarks in another buffer.
|
|
|
|
|
\\[bookmark-bmenu-edit-annotation] -- edit the annotation for the current bookmark."
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
(kill-all-local-variables)
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(use-local-map bookmark-bmenu-mode-map)
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
(setq truncate-lines t)
|
|
|
|
|
(setq buffer-read-only t)
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(setq major-mode 'bookmark-bmenu-mode)
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
(setq mode-name "Bookmark Menu")
|
2005-05-26 12:28:39 +00:00
|
|
|
|
(run-mode-hooks 'bookmark-bmenu-mode-hook))
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
1995-06-18 22:46:02 +00:00
|
|
|
|
(defun bookmark-bmenu-toggle-filenames (&optional show)
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
"Toggle whether filenames are shown in the bookmark list.
|
|
|
|
|
Optional argument SHOW means show them unconditionally."
|
|
|
|
|
(interactive)
|
|
|
|
|
(cond
|
1995-06-18 22:46:02 +00:00
|
|
|
|
(show
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(setq bookmark-bmenu-toggle-filenames nil)
|
|
|
|
|
(bookmark-bmenu-show-filenames)
|
|
|
|
|
(setq bookmark-bmenu-toggle-filenames t))
|
|
|
|
|
(bookmark-bmenu-toggle-filenames
|
|
|
|
|
(bookmark-bmenu-hide-filenames)
|
|
|
|
|
(setq bookmark-bmenu-toggle-filenames nil))
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
(t
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(bookmark-bmenu-show-filenames)
|
|
|
|
|
(setq bookmark-bmenu-toggle-filenames t))))
|
|
|
|
|
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(defun bookmark-bmenu-show-filenames (&optional force)
|
|
|
|
|
(if (and (not force) bookmark-bmenu-toggle-filenames)
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
nil ;already shown, so do nothing
|
|
|
|
|
(save-excursion
|
|
|
|
|
(save-window-excursion
|
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
(forward-line 2)
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(setq bookmark-bmenu-hidden-bookmarks ())
|
(bookmark-completing-read): Use a popup menu if activated from the mouse.
Return a string, instead of a list of one string.
(bookmark-edit-annotation): Remove unused vars.
(bookmark-jump, bookmark-relocate, bookmark-insert-location)
(bookmark-rename, bookmark-insert, bookmark-delete): Adjust calls
to bookmark-completing-read.
(bookmark-bmenu-show-filenames, bookmark-bmenu-hide-filenames)
(bookmark-bmenu-mark, bookmark-bmenu-select, bookmark-bmenu-unmark)
(bookmark-bmenu-delete, bookmark-bmenu-list): Use inhibit-read-only
and erase-buffer.
(bookmark-menu-delete, bookmark-menu-rename, bookmark-menu-locate)
(bookmark-menu-jump, bookmark-menu-insert)
(bookmark-popup-menu-and-apply-function)
(bookmark-menu-popup-paned-bookmark-menu): Remove.
(bookmark-menu-build-paned-menu): Remove by folding it into
bookmark-menu-popup-paned-menu.
(menu-bar-bookmark-map): Move the define-key statements here.
Use the "non-menu" commands since they now pop up a menu if needed.
(bookmark-exit-hook-internal): Simplify.
2003-08-11 17:30:47 +00:00
|
|
|
|
(let ((inhibit-read-only t))
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
(while (< (point) (point-max))
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(let ((bmrk (bookmark-bmenu-bookmark)))
|
|
|
|
|
(setq bookmark-bmenu-hidden-bookmarks
|
|
|
|
|
(cons bmrk bookmark-bmenu-hidden-bookmarks))
|
1997-03-30 21:38:43 +00:00
|
|
|
|
(let ((start (save-excursion (end-of-line) (point))))
|
|
|
|
|
(move-to-column bookmark-bmenu-file-column t)
|
|
|
|
|
;; Strip off `mouse-face' from the white spaces region.
|
2000-06-06 22:41:24 +00:00
|
|
|
|
(if (and (display-color-p) (display-mouse-p))
|
1997-03-30 21:38:43 +00:00
|
|
|
|
(remove-text-properties start (point)
|
2001-06-24 11:14:12 +00:00
|
|
|
|
'(mouse-face nil help-echo nil))))
|
1997-03-30 21:38:43 +00:00
|
|
|
|
(delete-region (point) (progn (end-of-line) (point)))
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
(insert " ")
|
1995-03-13 22:50:35 +00:00
|
|
|
|
;; Pass the NO-HISTORY arg:
|
|
|
|
|
(bookmark-insert-location bmrk t)
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
(forward-line 1))))))))
|
|
|
|
|
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
|
|
|
|
(defun bookmark-bmenu-hide-filenames (&optional force)
|
|
|
|
|
(if (and (not force) bookmark-bmenu-toggle-filenames)
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
;; nothing to hide if above is nil
|
|
|
|
|
(save-excursion
|
|
|
|
|
(save-window-excursion
|
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
(forward-line 2)
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(setq bookmark-bmenu-hidden-bookmarks
|
|
|
|
|
(nreverse bookmark-bmenu-hidden-bookmarks))
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
(save-excursion
|
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
(search-forward "Bookmark")
|
|
|
|
|
(backward-word 1)
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(setq bookmark-bmenu-bookmark-column (current-column)))
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
(save-excursion
|
(bookmark-completing-read): Use a popup menu if activated from the mouse.
Return a string, instead of a list of one string.
(bookmark-edit-annotation): Remove unused vars.
(bookmark-jump, bookmark-relocate, bookmark-insert-location)
(bookmark-rename, bookmark-insert, bookmark-delete): Adjust calls
to bookmark-completing-read.
(bookmark-bmenu-show-filenames, bookmark-bmenu-hide-filenames)
(bookmark-bmenu-mark, bookmark-bmenu-select, bookmark-bmenu-unmark)
(bookmark-bmenu-delete, bookmark-bmenu-list): Use inhibit-read-only
and erase-buffer.
(bookmark-menu-delete, bookmark-menu-rename, bookmark-menu-locate)
(bookmark-menu-jump, bookmark-menu-insert)
(bookmark-popup-menu-and-apply-function)
(bookmark-menu-popup-paned-bookmark-menu): Remove.
(bookmark-menu-build-paned-menu): Remove by folding it into
bookmark-menu-popup-paned-menu.
(menu-bar-bookmark-map): Move the define-key statements here.
Use the "non-menu" commands since they now pop up a menu if needed.
(bookmark-exit-hook-internal): Simplify.
2003-08-11 17:30:47 +00:00
|
|
|
|
(let ((inhibit-read-only t))
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(while bookmark-bmenu-hidden-bookmarks
|
|
|
|
|
(move-to-column bookmark-bmenu-bookmark-column t)
|
|
|
|
|
(bookmark-kill-line)
|
1997-03-30 21:38:43 +00:00
|
|
|
|
(let ((start (point)))
|
|
|
|
|
(insert (car bookmark-bmenu-hidden-bookmarks))
|
2000-06-06 22:41:24 +00:00
|
|
|
|
(if (and (display-color-p) (display-mouse-p))
|
2001-06-24 11:14:12 +00:00
|
|
|
|
(add-text-properties start
|
|
|
|
|
(save-excursion (re-search-backward
|
|
|
|
|
"[^ \t]")
|
|
|
|
|
(1+ (point)))
|
|
|
|
|
'(mouse-face highlight
|
|
|
|
|
help-echo
|
|
|
|
|
"mouse-2: go to this bookmark"))))
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(setq bookmark-bmenu-hidden-bookmarks
|
|
|
|
|
(cdr bookmark-bmenu-hidden-bookmarks))
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
(forward-line 1))))))))
|
|
|
|
|
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
|
|
|
|
(defun bookmark-bmenu-check-position ()
|
(bookmark-load): Use `bookmark-import-new-list' to
load the new list carefully, renaming bookmarks as necessary.
In docstring, mention new renaming behavior.
Optional arg OVERWRITE replaces inaccurately-named REVERT.
If file loaded was bookmark-default-file, then set
bookmarks-already-loaded to t.
(bookmark-import-new-list): New func.
(bookmark-maybe-rename): New func, helper to above.
(bookmark-set-name): Accept bookmark as either string (behaves
same as before) or list (treat it as a bookmark record).
(bookmark-set, bookmark-maybe-load-default-file)
(bookmark-jump-noselect, bookmark-rename)
(bookmark-show-annotation): Discard pointless `progn's.
(bookmark-bmenu-mark, bookmark-bmenu-unmark)
(bookmark-bmenu-backup-unmark, bookmark-bmenu-delete-backwards):
Renormalize position after all else is done.
(bookmark-edit-annotation-mode, bookmark-bmenu-list)
(bookmark-show-annotation, bookmark-show-all-annotations):
Use `x' instead of `(not (eq x nil))'.
(bookmark-yank-word): Inner save-excursion changed to progn.
(bookmark-send-annotation, bookmark-send-edited-annotation)
(bookmark-insert): Use buffer-string instead of buffer-substring.
(bookmark-make-cell): Make sure annotation and info-node strings
contain no text properties.
(bookmark-relocate): Remember to rebuild bmenu buffer after a
bookmark has been relocated.
(bookmark-bmenu-check-position): Return a meaningful value --
callers have apparently been assuming this anyway.
(bookmark-build-xemacs-menu): Unused function deleted.
(bookmark-version): Removed this variable; the Emacs version suffices.
1997-08-22 19:14:10 +00:00
|
|
|
|
;; Returns non-nil if on a line with a bookmark.
|
|
|
|
|
;; (The actual value returned is bookmark-alist).
|
|
|
|
|
;; Else reposition and try again, else return nil.
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
(cond ((< (count-lines (point-min) (point)) 2)
|
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
(forward-line 2)
|
(bookmark-load): Use `bookmark-import-new-list' to
load the new list carefully, renaming bookmarks as necessary.
In docstring, mention new renaming behavior.
Optional arg OVERWRITE replaces inaccurately-named REVERT.
If file loaded was bookmark-default-file, then set
bookmarks-already-loaded to t.
(bookmark-import-new-list): New func.
(bookmark-maybe-rename): New func, helper to above.
(bookmark-set-name): Accept bookmark as either string (behaves
same as before) or list (treat it as a bookmark record).
(bookmark-set, bookmark-maybe-load-default-file)
(bookmark-jump-noselect, bookmark-rename)
(bookmark-show-annotation): Discard pointless `progn's.
(bookmark-bmenu-mark, bookmark-bmenu-unmark)
(bookmark-bmenu-backup-unmark, bookmark-bmenu-delete-backwards):
Renormalize position after all else is done.
(bookmark-edit-annotation-mode, bookmark-bmenu-list)
(bookmark-show-annotation, bookmark-show-all-annotations):
Use `x' instead of `(not (eq x nil))'.
(bookmark-yank-word): Inner save-excursion changed to progn.
(bookmark-send-annotation, bookmark-send-edited-annotation)
(bookmark-insert): Use buffer-string instead of buffer-substring.
(bookmark-make-cell): Make sure annotation and info-node strings
contain no text properties.
(bookmark-relocate): Remember to rebuild bmenu buffer after a
bookmark has been relocated.
(bookmark-bmenu-check-position): Return a meaningful value --
callers have apparently been assuming this anyway.
(bookmark-build-xemacs-menu): Unused function deleted.
(bookmark-version): Removed this variable; the Emacs version suffices.
1997-08-22 19:14:10 +00:00
|
|
|
|
bookmark-alist)
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
((and (bolp) (eobp))
|
|
|
|
|
(beginning-of-line 0)
|
(bookmark-load): Use `bookmark-import-new-list' to
load the new list carefully, renaming bookmarks as necessary.
In docstring, mention new renaming behavior.
Optional arg OVERWRITE replaces inaccurately-named REVERT.
If file loaded was bookmark-default-file, then set
bookmarks-already-loaded to t.
(bookmark-import-new-list): New func.
(bookmark-maybe-rename): New func, helper to above.
(bookmark-set-name): Accept bookmark as either string (behaves
same as before) or list (treat it as a bookmark record).
(bookmark-set, bookmark-maybe-load-default-file)
(bookmark-jump-noselect, bookmark-rename)
(bookmark-show-annotation): Discard pointless `progn's.
(bookmark-bmenu-mark, bookmark-bmenu-unmark)
(bookmark-bmenu-backup-unmark, bookmark-bmenu-delete-backwards):
Renormalize position after all else is done.
(bookmark-edit-annotation-mode, bookmark-bmenu-list)
(bookmark-show-annotation, bookmark-show-all-annotations):
Use `x' instead of `(not (eq x nil))'.
(bookmark-yank-word): Inner save-excursion changed to progn.
(bookmark-send-annotation, bookmark-send-edited-annotation)
(bookmark-insert): Use buffer-string instead of buffer-substring.
(bookmark-make-cell): Make sure annotation and info-node strings
contain no text properties.
(bookmark-relocate): Remember to rebuild bmenu buffer after a
bookmark has been relocated.
(bookmark-bmenu-check-position): Return a meaningful value --
callers have apparently been assuming this anyway.
(bookmark-build-xemacs-menu): Unused function deleted.
(bookmark-version): Removed this variable; the Emacs version suffices.
1997-08-22 19:14:10 +00:00
|
|
|
|
bookmark-alist)
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
(t
|
(bookmark-load): Use `bookmark-import-new-list' to
load the new list carefully, renaming bookmarks as necessary.
In docstring, mention new renaming behavior.
Optional arg OVERWRITE replaces inaccurately-named REVERT.
If file loaded was bookmark-default-file, then set
bookmarks-already-loaded to t.
(bookmark-import-new-list): New func.
(bookmark-maybe-rename): New func, helper to above.
(bookmark-set-name): Accept bookmark as either string (behaves
same as before) or list (treat it as a bookmark record).
(bookmark-set, bookmark-maybe-load-default-file)
(bookmark-jump-noselect, bookmark-rename)
(bookmark-show-annotation): Discard pointless `progn's.
(bookmark-bmenu-mark, bookmark-bmenu-unmark)
(bookmark-bmenu-backup-unmark, bookmark-bmenu-delete-backwards):
Renormalize position after all else is done.
(bookmark-edit-annotation-mode, bookmark-bmenu-list)
(bookmark-show-annotation, bookmark-show-all-annotations):
Use `x' instead of `(not (eq x nil))'.
(bookmark-yank-word): Inner save-excursion changed to progn.
(bookmark-send-annotation, bookmark-send-edited-annotation)
(bookmark-insert): Use buffer-string instead of buffer-substring.
(bookmark-make-cell): Make sure annotation and info-node strings
contain no text properties.
(bookmark-relocate): Remember to rebuild bmenu buffer after a
bookmark has been relocated.
(bookmark-bmenu-check-position): Return a meaningful value --
callers have apparently been assuming this anyway.
(bookmark-build-xemacs-menu): Unused function deleted.
(bookmark-version): Removed this variable; the Emacs version suffices.
1997-08-22 19:14:10 +00:00
|
|
|
|
bookmark-alist)))
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
|
|
|
|
(defun bookmark-bmenu-bookmark ()
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
;; return a string which is bookmark of this line.
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(if (bookmark-bmenu-check-position)
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
(save-excursion
|
|
|
|
|
(save-window-excursion
|
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
(search-forward "Bookmark")
|
|
|
|
|
(backward-word 1)
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(setq bookmark-bmenu-bookmark-column (current-column)))))
|
|
|
|
|
(if bookmark-bmenu-toggle-filenames
|
|
|
|
|
(bookmark-bmenu-hide-filenames))
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
(save-excursion
|
|
|
|
|
(save-window-excursion
|
|
|
|
|
(beginning-of-line)
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(forward-char bookmark-bmenu-bookmark-column)
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
(prog1
|
2001-01-12 22:49:40 +00:00
|
|
|
|
(buffer-substring-no-properties (point)
|
|
|
|
|
(progn
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
(end-of-line)
|
|
|
|
|
(point)))
|
|
|
|
|
;; well, this is certainly crystal-clear:
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(if bookmark-bmenu-toggle-filenames
|
|
|
|
|
(bookmark-bmenu-toggle-filenames t))))))
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
|
|
|
|
(defun bookmark-show-annotation (bookmark)
|
|
|
|
|
"Display the annotation for bookmark named BOOKMARK in a buffer,
|
|
|
|
|
if an annotation exists."
|
|
|
|
|
(let ((annotation (bookmark-get-annotation bookmark)))
|
(bookmark-load): Use `bookmark-import-new-list' to
load the new list carefully, renaming bookmarks as necessary.
In docstring, mention new renaming behavior.
Optional arg OVERWRITE replaces inaccurately-named REVERT.
If file loaded was bookmark-default-file, then set
bookmarks-already-loaded to t.
(bookmark-import-new-list): New func.
(bookmark-maybe-rename): New func, helper to above.
(bookmark-set-name): Accept bookmark as either string (behaves
same as before) or list (treat it as a bookmark record).
(bookmark-set, bookmark-maybe-load-default-file)
(bookmark-jump-noselect, bookmark-rename)
(bookmark-show-annotation): Discard pointless `progn's.
(bookmark-bmenu-mark, bookmark-bmenu-unmark)
(bookmark-bmenu-backup-unmark, bookmark-bmenu-delete-backwards):
Renormalize position after all else is done.
(bookmark-edit-annotation-mode, bookmark-bmenu-list)
(bookmark-show-annotation, bookmark-show-all-annotations):
Use `x' instead of `(not (eq x nil))'.
(bookmark-yank-word): Inner save-excursion changed to progn.
(bookmark-send-annotation, bookmark-send-edited-annotation)
(bookmark-insert): Use buffer-string instead of buffer-substring.
(bookmark-make-cell): Make sure annotation and info-node strings
contain no text properties.
(bookmark-relocate): Remember to rebuild bmenu buffer after a
bookmark has been relocated.
(bookmark-bmenu-check-position): Return a meaningful value --
callers have apparently been assuming this anyway.
(bookmark-build-xemacs-menu): Unused function deleted.
(bookmark-version): Removed this variable; the Emacs version suffices.
1997-08-22 19:14:10 +00:00
|
|
|
|
(if (and annotation (not (string-equal annotation "")))
|
|
|
|
|
(save-excursion
|
|
|
|
|
(let ((old-buf (current-buffer)))
|
|
|
|
|
(pop-to-buffer (get-buffer-create "*Bookmark Annotation*") t)
|
|
|
|
|
(delete-region (point-min) (point-max))
|
|
|
|
|
;; (insert (concat "Annotation for bookmark '" bookmark "':\n\n"))
|
|
|
|
|
(insert annotation)
|
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
(pop-to-buffer old-buf))))))
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun bookmark-show-all-annotations ()
|
|
|
|
|
"Display the annotations for all bookmarks in a buffer."
|
|
|
|
|
(let ((old-buf (current-buffer)))
|
|
|
|
|
(pop-to-buffer (get-buffer-create "*Bookmark Annotation*") t)
|
|
|
|
|
(delete-region (point-min) (point-max))
|
|
|
|
|
(mapcar
|
|
|
|
|
(lambda (full-record)
|
|
|
|
|
(let* ((name (bookmark-name-from-full-record full-record))
|
|
|
|
|
(ann (bookmark-get-annotation name)))
|
|
|
|
|
(insert (concat name ":\n"))
|
(bookmark-load): Use `bookmark-import-new-list' to
load the new list carefully, renaming bookmarks as necessary.
In docstring, mention new renaming behavior.
Optional arg OVERWRITE replaces inaccurately-named REVERT.
If file loaded was bookmark-default-file, then set
bookmarks-already-loaded to t.
(bookmark-import-new-list): New func.
(bookmark-maybe-rename): New func, helper to above.
(bookmark-set-name): Accept bookmark as either string (behaves
same as before) or list (treat it as a bookmark record).
(bookmark-set, bookmark-maybe-load-default-file)
(bookmark-jump-noselect, bookmark-rename)
(bookmark-show-annotation): Discard pointless `progn's.
(bookmark-bmenu-mark, bookmark-bmenu-unmark)
(bookmark-bmenu-backup-unmark, bookmark-bmenu-delete-backwards):
Renormalize position after all else is done.
(bookmark-edit-annotation-mode, bookmark-bmenu-list)
(bookmark-show-annotation, bookmark-show-all-annotations):
Use `x' instead of `(not (eq x nil))'.
(bookmark-yank-word): Inner save-excursion changed to progn.
(bookmark-send-annotation, bookmark-send-edited-annotation)
(bookmark-insert): Use buffer-string instead of buffer-substring.
(bookmark-make-cell): Make sure annotation and info-node strings
contain no text properties.
(bookmark-relocate): Remember to rebuild bmenu buffer after a
bookmark has been relocated.
(bookmark-bmenu-check-position): Return a meaningful value --
callers have apparently been assuming this anyway.
(bookmark-build-xemacs-menu): Unused function deleted.
(bookmark-version): Removed this variable; the Emacs version suffices.
1997-08-22 19:14:10 +00:00
|
|
|
|
(if (and ann (not (string-equal ann "")))
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
;; insert the annotation, indented by 4 spaces.
|
|
|
|
|
(progn
|
|
|
|
|
(save-excursion (insert ann))
|
|
|
|
|
(while (< (point) (point-max))
|
|
|
|
|
(beginning-of-line) ; paranoia
|
|
|
|
|
(insert " ")
|
|
|
|
|
(forward-line)
|
|
|
|
|
(end-of-line))))))
|
|
|
|
|
bookmark-alist)
|
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
(pop-to-buffer old-buf)))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun bookmark-bmenu-mark ()
|
1996-05-09 17:34:55 +00:00
|
|
|
|
"Mark bookmark on this line to be displayed by \\<bookmark-bmenu-mode-map>\\[bookmark-bmenu-select]."
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
(interactive)
|
|
|
|
|
(beginning-of-line)
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(if (bookmark-bmenu-check-position)
|
(bookmark-completing-read): Use a popup menu if activated from the mouse.
Return a string, instead of a list of one string.
(bookmark-edit-annotation): Remove unused vars.
(bookmark-jump, bookmark-relocate, bookmark-insert-location)
(bookmark-rename, bookmark-insert, bookmark-delete): Adjust calls
to bookmark-completing-read.
(bookmark-bmenu-show-filenames, bookmark-bmenu-hide-filenames)
(bookmark-bmenu-mark, bookmark-bmenu-select, bookmark-bmenu-unmark)
(bookmark-bmenu-delete, bookmark-bmenu-list): Use inhibit-read-only
and erase-buffer.
(bookmark-menu-delete, bookmark-menu-rename, bookmark-menu-locate)
(bookmark-menu-jump, bookmark-menu-insert)
(bookmark-popup-menu-and-apply-function)
(bookmark-menu-popup-paned-bookmark-menu): Remove.
(bookmark-menu-build-paned-menu): Remove by folding it into
bookmark-menu-popup-paned-menu.
(menu-bar-bookmark-map): Move the define-key statements here.
Use the "non-menu" commands since they now pop up a menu if needed.
(bookmark-exit-hook-internal): Simplify.
2003-08-11 17:30:47 +00:00
|
|
|
|
(let ((inhibit-read-only t))
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
(delete-char 1)
|
|
|
|
|
(insert ?>)
|
(bookmark-load): Use `bookmark-import-new-list' to
load the new list carefully, renaming bookmarks as necessary.
In docstring, mention new renaming behavior.
Optional arg OVERWRITE replaces inaccurately-named REVERT.
If file loaded was bookmark-default-file, then set
bookmarks-already-loaded to t.
(bookmark-import-new-list): New func.
(bookmark-maybe-rename): New func, helper to above.
(bookmark-set-name): Accept bookmark as either string (behaves
same as before) or list (treat it as a bookmark record).
(bookmark-set, bookmark-maybe-load-default-file)
(bookmark-jump-noselect, bookmark-rename)
(bookmark-show-annotation): Discard pointless `progn's.
(bookmark-bmenu-mark, bookmark-bmenu-unmark)
(bookmark-bmenu-backup-unmark, bookmark-bmenu-delete-backwards):
Renormalize position after all else is done.
(bookmark-edit-annotation-mode, bookmark-bmenu-list)
(bookmark-show-annotation, bookmark-show-all-annotations):
Use `x' instead of `(not (eq x nil))'.
(bookmark-yank-word): Inner save-excursion changed to progn.
(bookmark-send-annotation, bookmark-send-edited-annotation)
(bookmark-insert): Use buffer-string instead of buffer-substring.
(bookmark-make-cell): Make sure annotation and info-node strings
contain no text properties.
(bookmark-relocate): Remember to rebuild bmenu buffer after a
bookmark has been relocated.
(bookmark-bmenu-check-position): Return a meaningful value --
callers have apparently been assuming this anyway.
(bookmark-build-xemacs-menu): Unused function deleted.
(bookmark-version): Removed this variable; the Emacs version suffices.
1997-08-22 19:14:10 +00:00
|
|
|
|
(forward-line 1)
|
|
|
|
|
(bookmark-bmenu-check-position))))
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
|
|
|
|
(defun bookmark-bmenu-select ()
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
"Select this line's bookmark; also display bookmarks marked with `>'.
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
You can mark bookmarks with the \\<bookmark-bmenu-mode-map>\\[bookmark-bmenu-mark] command."
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
(interactive)
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(if (bookmark-bmenu-check-position)
|
|
|
|
|
(let ((bmrk (bookmark-bmenu-bookmark))
|
2001-01-12 22:49:40 +00:00
|
|
|
|
(menu (current-buffer))
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
(others ())
|
|
|
|
|
tem)
|
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
(while (re-search-forward "^>" nil t)
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(setq tem (bookmark-bmenu-bookmark))
|
(bookmark-completing-read): Use a popup menu if activated from the mouse.
Return a string, instead of a list of one string.
(bookmark-edit-annotation): Remove unused vars.
(bookmark-jump, bookmark-relocate, bookmark-insert-location)
(bookmark-rename, bookmark-insert, bookmark-delete): Adjust calls
to bookmark-completing-read.
(bookmark-bmenu-show-filenames, bookmark-bmenu-hide-filenames)
(bookmark-bmenu-mark, bookmark-bmenu-select, bookmark-bmenu-unmark)
(bookmark-bmenu-delete, bookmark-bmenu-list): Use inhibit-read-only
and erase-buffer.
(bookmark-menu-delete, bookmark-menu-rename, bookmark-menu-locate)
(bookmark-menu-jump, bookmark-menu-insert)
(bookmark-popup-menu-and-apply-function)
(bookmark-menu-popup-paned-bookmark-menu): Remove.
(bookmark-menu-build-paned-menu): Remove by folding it into
bookmark-menu-popup-paned-menu.
(menu-bar-bookmark-map): Move the define-key statements here.
Use the "non-menu" commands since they now pop up a menu if needed.
(bookmark-exit-hook-internal): Simplify.
2003-08-11 17:30:47 +00:00
|
|
|
|
(let ((inhibit-read-only t))
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
(delete-char -1)
|
(bookmark-automatically-show-annotations, bookmark-read-annotation-text-func): Doc fixes.
(bookmark-save): Improve argument/docstring consistency.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-alist-from-buffer, bookmark-upgrade-file-format-from-0,
bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format,
bookmark-kill-line, bookmark-read-annotation-mode,
bookmark-insert-current-bookmark, bookmark-jump, bookmark-exit-hook):
Fix typos in docstrings.
(bookmark-exit-hooks): Define as obsolete alias.
(bookmark-exit-hook-internal): Run `bookmark-exit-hook',
not `bookmark-exit-hooks'. Fix docstring.
(bookmark-bmenu-select): "?\ " -> "?\s".
2005-07-26 13:56:01 +00:00
|
|
|
|
(insert ?\s))
|
2001-01-12 22:49:40 +00:00
|
|
|
|
(or (string-equal tem bmrk)
|
|
|
|
|
(member tem others)
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
(setq others (cons tem others))))
|
|
|
|
|
(setq others (nreverse others)
|
|
|
|
|
tem (/ (1- (frame-height)) (1+ (length others))))
|
|
|
|
|
(delete-other-windows)
|
|
|
|
|
(bookmark-jump bmrk)
|
|
|
|
|
(bury-buffer menu)
|
1995-06-18 22:46:02 +00:00
|
|
|
|
(if others
|
|
|
|
|
(while others
|
|
|
|
|
(split-window nil tem)
|
|
|
|
|
(other-window 1)
|
|
|
|
|
(bookmark-jump (car others))
|
|
|
|
|
(setq others (cdr others)))
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
(other-window 1)))))
|
|
|
|
|
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
|
|
|
|
(defun bookmark-bmenu-save (parg)
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
"Save the current list into a bookmark file.
|
|
|
|
|
With a prefix arg, prompts for a file to save them in."
|
|
|
|
|
(interactive "P")
|
|
|
|
|
(save-excursion
|
|
|
|
|
(save-window-excursion
|
|
|
|
|
(bookmark-save parg))))
|
|
|
|
|
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
|
|
|
|
(defun bookmark-bmenu-load ()
|
|
|
|
|
"Load the bookmark file and rebuild the bookmark menu-buffer."
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
(interactive)
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(if (bookmark-bmenu-check-position)
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
(save-excursion
|
|
|
|
|
(save-window-excursion
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
;; This will call `bookmark-bmenu-list'
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
(call-interactively 'bookmark-load)))))
|
|
|
|
|
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
|
|
|
|
(defun bookmark-bmenu-1-window ()
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
"Select this line's bookmark, alone, in full frame."
|
|
|
|
|
(interactive)
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(if (bookmark-bmenu-check-position)
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
(progn
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(bookmark-jump (bookmark-bmenu-bookmark))
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
(bury-buffer (other-buffer))
|
|
|
|
|
(delete-other-windows))))
|
|
|
|
|
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
|
|
|
|
(defun bookmark-bmenu-2-window ()
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
"Select this line's bookmark, with previous buffer in second window."
|
|
|
|
|
(interactive)
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(if (bookmark-bmenu-check-position)
|
|
|
|
|
(let ((bmrk (bookmark-bmenu-bookmark))
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
(menu (current-buffer))
|
|
|
|
|
(pop-up-windows t))
|
|
|
|
|
(delete-other-windows)
|
|
|
|
|
(switch-to-buffer (other-buffer))
|
1995-03-15 14:47:09 +00:00
|
|
|
|
(let* ((pair (bookmark-jump-noselect bmrk))
|
|
|
|
|
(buff (car pair))
|
|
|
|
|
(pos (cdr pair)))
|
|
|
|
|
(pop-to-buffer buff)
|
|
|
|
|
(goto-char pos))
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
(bury-buffer menu))))
|
|
|
|
|
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
|
|
|
|
(defun bookmark-bmenu-this-window ()
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
"Select this line's bookmark in this window."
|
|
|
|
|
(interactive)
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(if (bookmark-bmenu-check-position)
|
|
|
|
|
(bookmark-jump (bookmark-bmenu-bookmark))))
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
|
|
|
|
(defun bookmark-bmenu-other-window ()
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
"Select this line's bookmark in other window, leaving bookmark menu visible."
|
|
|
|
|
(interactive)
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(let ((bookmark (bookmark-bmenu-bookmark)))
|
|
|
|
|
(if (bookmark-bmenu-check-position)
|
1995-03-15 14:47:09 +00:00
|
|
|
|
(let* ((pair (bookmark-jump-noselect bookmark))
|
|
|
|
|
(buff (car pair))
|
|
|
|
|
(pos (cdr pair)))
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(switch-to-buffer-other-window buff)
|
1995-03-15 14:47:09 +00:00
|
|
|
|
(goto-char pos)
|
|
|
|
|
(set-window-point (get-buffer-window buff) pos)
|
|
|
|
|
(bookmark-show-annotation bookmark)))))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun bookmark-bmenu-switch-other-window ()
|
|
|
|
|
"Make the other window select this line's bookmark.
|
|
|
|
|
The current window remains selected."
|
|
|
|
|
(interactive)
|
1998-05-26 18:27:47 +00:00
|
|
|
|
(let ((bookmark (bookmark-bmenu-bookmark))
|
|
|
|
|
(pop-up-windows t)
|
2001-01-12 22:49:40 +00:00
|
|
|
|
same-window-buffer-names
|
1998-05-26 18:27:47 +00:00
|
|
|
|
same-window-regexps)
|
1995-03-15 14:47:09 +00:00
|
|
|
|
(if (bookmark-bmenu-check-position)
|
|
|
|
|
(let* ((pair (bookmark-jump-noselect bookmark))
|
|
|
|
|
(buff (car pair))
|
|
|
|
|
(pos (cdr pair)))
|
|
|
|
|
(display-buffer buff)
|
|
|
|
|
(let ((o-buffer (current-buffer)))
|
|
|
|
|
;; save-excursion won't do
|
|
|
|
|
(set-buffer buff)
|
|
|
|
|
(goto-char pos)
|
|
|
|
|
(set-window-point (get-buffer-window buff) pos)
|
|
|
|
|
(set-buffer o-buffer))
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(bookmark-show-annotation bookmark)))))
|
|
|
|
|
|
1997-03-30 21:38:43 +00:00
|
|
|
|
(defun bookmark-bmenu-other-window-with-mouse (event)
|
|
|
|
|
"Select bookmark at the mouse pointer in other window, leaving bookmark menu visible."
|
|
|
|
|
(interactive "e")
|
|
|
|
|
(save-excursion
|
|
|
|
|
(set-buffer (window-buffer (posn-window (event-end event))))
|
|
|
|
|
(save-excursion
|
|
|
|
|
(goto-char (posn-point (event-end event)))
|
|
|
|
|
(bookmark-bmenu-other-window))))
|
|
|
|
|
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
|
|
|
|
(defun bookmark-bmenu-show-annotation ()
|
|
|
|
|
"Show the annotation for the current bookmark in another window."
|
|
|
|
|
(interactive)
|
|
|
|
|
(let ((bookmark (bookmark-bmenu-bookmark)))
|
|
|
|
|
(if (bookmark-bmenu-check-position)
|
|
|
|
|
(bookmark-show-annotation bookmark))))
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
|
|
|
|
(defun bookmark-bmenu-show-all-annotations ()
|
|
|
|
|
"Show the annotation for all bookmarks in another window."
|
|
|
|
|
(interactive)
|
|
|
|
|
(bookmark-show-all-annotations))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun bookmark-bmenu-edit-annotation ()
|
|
|
|
|
"Edit the annotation for the current bookmark in another window."
|
|
|
|
|
(interactive)
|
|
|
|
|
(let ((bookmark (bookmark-bmenu-bookmark)))
|
|
|
|
|
(if (bookmark-bmenu-check-position)
|
|
|
|
|
(bookmark-edit-annotation bookmark))))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun bookmark-bmenu-unmark (&optional backup)
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
"Cancel all requested operations on bookmark on this line and move down.
|
1995-06-18 22:46:02 +00:00
|
|
|
|
Optional BACKUP means move up."
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
(interactive "P")
|
|
|
|
|
(beginning-of-line)
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(if (bookmark-bmenu-check-position)
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
(progn
|
(bookmark-completing-read): Use a popup menu if activated from the mouse.
Return a string, instead of a list of one string.
(bookmark-edit-annotation): Remove unused vars.
(bookmark-jump, bookmark-relocate, bookmark-insert-location)
(bookmark-rename, bookmark-insert, bookmark-delete): Adjust calls
to bookmark-completing-read.
(bookmark-bmenu-show-filenames, bookmark-bmenu-hide-filenames)
(bookmark-bmenu-mark, bookmark-bmenu-select, bookmark-bmenu-unmark)
(bookmark-bmenu-delete, bookmark-bmenu-list): Use inhibit-read-only
and erase-buffer.
(bookmark-menu-delete, bookmark-menu-rename, bookmark-menu-locate)
(bookmark-menu-jump, bookmark-menu-insert)
(bookmark-popup-menu-and-apply-function)
(bookmark-menu-popup-paned-bookmark-menu): Remove.
(bookmark-menu-build-paned-menu): Remove by folding it into
bookmark-menu-popup-paned-menu.
(menu-bar-bookmark-map): Move the define-key statements here.
Use the "non-menu" commands since they now pop up a menu if needed.
(bookmark-exit-hook-internal): Simplify.
2003-08-11 17:30:47 +00:00
|
|
|
|
(let ((inhibit-read-only t))
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
(delete-char 1)
|
|
|
|
|
;; any flags to reset according to circumstances? How about a
|
|
|
|
|
;; flag indicating whether this bookmark is being visited?
|
|
|
|
|
;; well, we don't have this now, so maybe later.
|
|
|
|
|
(insert " "))
|
(bookmark-load): Use `bookmark-import-new-list' to
load the new list carefully, renaming bookmarks as necessary.
In docstring, mention new renaming behavior.
Optional arg OVERWRITE replaces inaccurately-named REVERT.
If file loaded was bookmark-default-file, then set
bookmarks-already-loaded to t.
(bookmark-import-new-list): New func.
(bookmark-maybe-rename): New func, helper to above.
(bookmark-set-name): Accept bookmark as either string (behaves
same as before) or list (treat it as a bookmark record).
(bookmark-set, bookmark-maybe-load-default-file)
(bookmark-jump-noselect, bookmark-rename)
(bookmark-show-annotation): Discard pointless `progn's.
(bookmark-bmenu-mark, bookmark-bmenu-unmark)
(bookmark-bmenu-backup-unmark, bookmark-bmenu-delete-backwards):
Renormalize position after all else is done.
(bookmark-edit-annotation-mode, bookmark-bmenu-list)
(bookmark-show-annotation, bookmark-show-all-annotations):
Use `x' instead of `(not (eq x nil))'.
(bookmark-yank-word): Inner save-excursion changed to progn.
(bookmark-send-annotation, bookmark-send-edited-annotation)
(bookmark-insert): Use buffer-string instead of buffer-substring.
(bookmark-make-cell): Make sure annotation and info-node strings
contain no text properties.
(bookmark-relocate): Remember to rebuild bmenu buffer after a
bookmark has been relocated.
(bookmark-bmenu-check-position): Return a meaningful value --
callers have apparently been assuming this anyway.
(bookmark-build-xemacs-menu): Unused function deleted.
(bookmark-version): Removed this variable; the Emacs version suffices.
1997-08-22 19:14:10 +00:00
|
|
|
|
(forward-line (if backup -1 1))
|
|
|
|
|
(bookmark-bmenu-check-position))))
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
|
|
|
|
(defun bookmark-bmenu-backup-unmark ()
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
"Move up and cancel all requested operations on bookmark on line above."
|
|
|
|
|
(interactive)
|
|
|
|
|
(forward-line -1)
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(if (bookmark-bmenu-check-position)
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
(progn
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(bookmark-bmenu-unmark)
|
(bookmark-load): Use `bookmark-import-new-list' to
load the new list carefully, renaming bookmarks as necessary.
In docstring, mention new renaming behavior.
Optional arg OVERWRITE replaces inaccurately-named REVERT.
If file loaded was bookmark-default-file, then set
bookmarks-already-loaded to t.
(bookmark-import-new-list): New func.
(bookmark-maybe-rename): New func, helper to above.
(bookmark-set-name): Accept bookmark as either string (behaves
same as before) or list (treat it as a bookmark record).
(bookmark-set, bookmark-maybe-load-default-file)
(bookmark-jump-noselect, bookmark-rename)
(bookmark-show-annotation): Discard pointless `progn's.
(bookmark-bmenu-mark, bookmark-bmenu-unmark)
(bookmark-bmenu-backup-unmark, bookmark-bmenu-delete-backwards):
Renormalize position after all else is done.
(bookmark-edit-annotation-mode, bookmark-bmenu-list)
(bookmark-show-annotation, bookmark-show-all-annotations):
Use `x' instead of `(not (eq x nil))'.
(bookmark-yank-word): Inner save-excursion changed to progn.
(bookmark-send-annotation, bookmark-send-edited-annotation)
(bookmark-insert): Use buffer-string instead of buffer-substring.
(bookmark-make-cell): Make sure annotation and info-node strings
contain no text properties.
(bookmark-relocate): Remember to rebuild bmenu buffer after a
bookmark has been relocated.
(bookmark-bmenu-check-position): Return a meaningful value --
callers have apparently been assuming this anyway.
(bookmark-build-xemacs-menu): Unused function deleted.
(bookmark-version): Removed this variable; the Emacs version suffices.
1997-08-22 19:14:10 +00:00
|
|
|
|
(forward-line -1)
|
|
|
|
|
(bookmark-bmenu-check-position))))
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
|
|
|
|
(defun bookmark-bmenu-delete ()
|
1996-05-09 17:34:55 +00:00
|
|
|
|
"Mark bookmark on this line to be deleted.
|
|
|
|
|
To carry out the deletions that you've marked, use \\<bookmark-bmenu-mode-map>\\[bookmark-bmenu-execute-deletions]."
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
(interactive)
|
|
|
|
|
(beginning-of-line)
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(if (bookmark-bmenu-check-position)
|
(bookmark-completing-read): Use a popup menu if activated from the mouse.
Return a string, instead of a list of one string.
(bookmark-edit-annotation): Remove unused vars.
(bookmark-jump, bookmark-relocate, bookmark-insert-location)
(bookmark-rename, bookmark-insert, bookmark-delete): Adjust calls
to bookmark-completing-read.
(bookmark-bmenu-show-filenames, bookmark-bmenu-hide-filenames)
(bookmark-bmenu-mark, bookmark-bmenu-select, bookmark-bmenu-unmark)
(bookmark-bmenu-delete, bookmark-bmenu-list): Use inhibit-read-only
and erase-buffer.
(bookmark-menu-delete, bookmark-menu-rename, bookmark-menu-locate)
(bookmark-menu-jump, bookmark-menu-insert)
(bookmark-popup-menu-and-apply-function)
(bookmark-menu-popup-paned-bookmark-menu): Remove.
(bookmark-menu-build-paned-menu): Remove by folding it into
bookmark-menu-popup-paned-menu.
(menu-bar-bookmark-map): Move the define-key statements here.
Use the "non-menu" commands since they now pop up a menu if needed.
(bookmark-exit-hook-internal): Simplify.
2003-08-11 17:30:47 +00:00
|
|
|
|
(let ((inhibit-read-only t))
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
(delete-char 1)
|
|
|
|
|
(insert ?D)
|
(bookmark-load): Use `bookmark-import-new-list' to
load the new list carefully, renaming bookmarks as necessary.
In docstring, mention new renaming behavior.
Optional arg OVERWRITE replaces inaccurately-named REVERT.
If file loaded was bookmark-default-file, then set
bookmarks-already-loaded to t.
(bookmark-import-new-list): New func.
(bookmark-maybe-rename): New func, helper to above.
(bookmark-set-name): Accept bookmark as either string (behaves
same as before) or list (treat it as a bookmark record).
(bookmark-set, bookmark-maybe-load-default-file)
(bookmark-jump-noselect, bookmark-rename)
(bookmark-show-annotation): Discard pointless `progn's.
(bookmark-bmenu-mark, bookmark-bmenu-unmark)
(bookmark-bmenu-backup-unmark, bookmark-bmenu-delete-backwards):
Renormalize position after all else is done.
(bookmark-edit-annotation-mode, bookmark-bmenu-list)
(bookmark-show-annotation, bookmark-show-all-annotations):
Use `x' instead of `(not (eq x nil))'.
(bookmark-yank-word): Inner save-excursion changed to progn.
(bookmark-send-annotation, bookmark-send-edited-annotation)
(bookmark-insert): Use buffer-string instead of buffer-substring.
(bookmark-make-cell): Make sure annotation and info-node strings
contain no text properties.
(bookmark-relocate): Remember to rebuild bmenu buffer after a
bookmark has been relocated.
(bookmark-bmenu-check-position): Return a meaningful value --
callers have apparently been assuming this anyway.
(bookmark-build-xemacs-menu): Unused function deleted.
(bookmark-version): Removed this variable; the Emacs version suffices.
1997-08-22 19:14:10 +00:00
|
|
|
|
(forward-line 1)
|
|
|
|
|
(bookmark-bmenu-check-position))))
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
|
|
|
|
(defun bookmark-bmenu-delete-backwards ()
|
1996-05-09 17:34:55 +00:00
|
|
|
|
"Mark bookmark on this line to be deleted, then move up one line.
|
|
|
|
|
To carry out the deletions that you've marked, use \\<bookmark-bmenu-mode-map>\\[bookmark-bmenu-execute-deletions]."
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
(interactive)
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(bookmark-bmenu-delete)
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
(forward-line -2)
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(if (bookmark-bmenu-check-position)
|
(bookmark-load): Use `bookmark-import-new-list' to
load the new list carefully, renaming bookmarks as necessary.
In docstring, mention new renaming behavior.
Optional arg OVERWRITE replaces inaccurately-named REVERT.
If file loaded was bookmark-default-file, then set
bookmarks-already-loaded to t.
(bookmark-import-new-list): New func.
(bookmark-maybe-rename): New func, helper to above.
(bookmark-set-name): Accept bookmark as either string (behaves
same as before) or list (treat it as a bookmark record).
(bookmark-set, bookmark-maybe-load-default-file)
(bookmark-jump-noselect, bookmark-rename)
(bookmark-show-annotation): Discard pointless `progn's.
(bookmark-bmenu-mark, bookmark-bmenu-unmark)
(bookmark-bmenu-backup-unmark, bookmark-bmenu-delete-backwards):
Renormalize position after all else is done.
(bookmark-edit-annotation-mode, bookmark-bmenu-list)
(bookmark-show-annotation, bookmark-show-all-annotations):
Use `x' instead of `(not (eq x nil))'.
(bookmark-yank-word): Inner save-excursion changed to progn.
(bookmark-send-annotation, bookmark-send-edited-annotation)
(bookmark-insert): Use buffer-string instead of buffer-substring.
(bookmark-make-cell): Make sure annotation and info-node strings
contain no text properties.
(bookmark-relocate): Remember to rebuild bmenu buffer after a
bookmark has been relocated.
(bookmark-bmenu-check-position): Return a meaningful value --
callers have apparently been assuming this anyway.
(bookmark-build-xemacs-menu): Unused function deleted.
(bookmark-version): Removed this variable; the Emacs version suffices.
1997-08-22 19:14:10 +00:00
|
|
|
|
(forward-line 1))
|
|
|
|
|
(bookmark-bmenu-check-position))
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
|
|
|
|
(defun bookmark-bmenu-execute-deletions ()
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
"Delete bookmarks marked with \\<Buffer-menu-mode-map>\\[Buffer-menu-delete] commands."
|
|
|
|
|
(interactive)
|
1996-01-05 21:57:54 +00:00
|
|
|
|
(message "Deleting bookmarks...")
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(let ((hide-em bookmark-bmenu-toggle-filenames)
|
|
|
|
|
(o-point (point))
|
|
|
|
|
(o-str (save-excursion
|
|
|
|
|
(beginning-of-line)
|
|
|
|
|
(if (looking-at "^D")
|
|
|
|
|
nil
|
|
|
|
|
(buffer-substring
|
|
|
|
|
(point)
|
|
|
|
|
(progn (end-of-line) (point))))))
|
|
|
|
|
(o-col (current-column)))
|
|
|
|
|
(if hide-em (bookmark-bmenu-hide-filenames))
|
|
|
|
|
(setq bookmark-bmenu-toggle-filenames nil)
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
(forward-line 1)
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(while (re-search-forward "^D" (point-max) t)
|
|
|
|
|
(bookmark-delete (bookmark-bmenu-bookmark) t)) ; pass BATCH arg
|
|
|
|
|
(bookmark-bmenu-list)
|
|
|
|
|
(setq bookmark-bmenu-toggle-filenames hide-em)
|
|
|
|
|
(if bookmark-bmenu-toggle-filenames
|
|
|
|
|
(bookmark-bmenu-toggle-filenames t))
|
|
|
|
|
(if o-str
|
|
|
|
|
(progn
|
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
(search-forward o-str)
|
|
|
|
|
(beginning-of-line)
|
|
|
|
|
(forward-char o-col))
|
|
|
|
|
(goto-char o-point))
|
|
|
|
|
(beginning-of-line)
|
|
|
|
|
(setq bookmark-alist-modification-count
|
|
|
|
|
(1+ bookmark-alist-modification-count))
|
|
|
|
|
(if (bookmark-time-to-save-p)
|
1996-01-05 21:57:54 +00:00
|
|
|
|
(bookmark-save))
|
|
|
|
|
(message "Deleting bookmarks...done")
|
|
|
|
|
))
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun bookmark-bmenu-rename ()
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
"Rename bookmark on current line. Prompts for a new name."
|
|
|
|
|
(interactive)
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(if (bookmark-bmenu-check-position)
|
|
|
|
|
(let ((bmrk (bookmark-bmenu-bookmark))
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
(thispoint (point)))
|
|
|
|
|
(bookmark-rename bmrk)
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(bookmark-bmenu-list)
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
(goto-char thispoint))))
|
|
|
|
|
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
|
|
|
|
(defun bookmark-bmenu-locate ()
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
"Display location of this bookmark. Displays in the minibuffer."
|
|
|
|
|
(interactive)
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(if (bookmark-bmenu-check-position)
|
|
|
|
|
(let ((bmrk (bookmark-bmenu-bookmark)))
|
|
|
|
|
(message (bookmark-location bmrk)))))
|
|
|
|
|
|
2004-06-13 01:59:21 +00:00
|
|
|
|
(defun bookmark-bmenu-relocate ()
|
|
|
|
|
"Change the file path of the bookmark on the current line,
|
|
|
|
|
prompting with completion for the new path."
|
|
|
|
|
(interactive)
|
|
|
|
|
(if (bookmark-bmenu-check-position)
|
|
|
|
|
(let ((bmrk (bookmark-bmenu-bookmark))
|
|
|
|
|
(thispoint (point)))
|
|
|
|
|
(bookmark-relocate bmrk)
|
|
|
|
|
(goto-char thispoint))))
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
|
|
|
|
;;; Menu bar stuff. Prefix is "bookmark-menu".
|
1993-08-13 00:59:51 +00:00
|
|
|
|
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(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.
|
(bookmark-completing-read): Use a popup menu if activated from the mouse.
Return a string, instead of a list of one string.
(bookmark-edit-annotation): Remove unused vars.
(bookmark-jump, bookmark-relocate, bookmark-insert-location)
(bookmark-rename, bookmark-insert, bookmark-delete): Adjust calls
to bookmark-completing-read.
(bookmark-bmenu-show-filenames, bookmark-bmenu-hide-filenames)
(bookmark-bmenu-mark, bookmark-bmenu-select, bookmark-bmenu-unmark)
(bookmark-bmenu-delete, bookmark-bmenu-list): Use inhibit-read-only
and erase-buffer.
(bookmark-menu-delete, bookmark-menu-rename, bookmark-menu-locate)
(bookmark-menu-jump, bookmark-menu-insert)
(bookmark-popup-menu-and-apply-function)
(bookmark-menu-popup-paned-bookmark-menu): Remove.
(bookmark-menu-build-paned-menu): Remove by folding it into
bookmark-menu-popup-paned-menu.
(menu-bar-bookmark-map): Move the define-key statements here.
Use the "non-menu" commands since they now pop up a menu if needed.
(bookmark-exit-hook-internal): Simplify.
2003-08-11 17:30:47 +00:00
|
|
|
|
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)))
|
(bookmark-automatically-show-annotations, bookmark-read-annotation-text-func): Doc fixes.
(bookmark-save): Improve argument/docstring consistency.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-alist-from-buffer, bookmark-upgrade-file-format-from-0,
bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format,
bookmark-kill-line, bookmark-read-annotation-mode,
bookmark-insert-current-bookmark, bookmark-jump, bookmark-exit-hook):
Fix typos in docstrings.
(bookmark-exit-hooks): Define as obsolete alias.
(bookmark-exit-hook-internal): Run `bookmark-exit-hook',
not `bookmark-exit-hooks'. Fix docstring.
(bookmark-bmenu-select): "?\ " -> "?\s".
2005-07-26 13:56:01 +00:00
|
|
|
|
|
(bookmark-completing-read): Use a popup menu if activated from the mouse.
Return a string, instead of a list of one string.
(bookmark-edit-annotation): Remove unused vars.
(bookmark-jump, bookmark-relocate, bookmark-insert-location)
(bookmark-rename, bookmark-insert, bookmark-delete): Adjust calls
to bookmark-completing-read.
(bookmark-bmenu-show-filenames, bookmark-bmenu-hide-filenames)
(bookmark-bmenu-mark, bookmark-bmenu-select, bookmark-bmenu-unmark)
(bookmark-bmenu-delete, bookmark-bmenu-list): Use inhibit-read-only
and erase-buffer.
(bookmark-menu-delete, bookmark-menu-rename, bookmark-menu-locate)
(bookmark-menu-jump, bookmark-menu-insert)
(bookmark-popup-menu-and-apply-function)
(bookmark-menu-popup-paned-bookmark-menu): Remove.
(bookmark-menu-build-paned-menu): Remove by folding it into
bookmark-menu-popup-paned-menu.
(menu-bar-bookmark-map): Move the define-key statements here.
Use the "non-menu" commands since they now pop up a menu if needed.
(bookmark-exit-hook-internal): Simplify.
2003-08-11 17:30:47 +00:00
|
|
|
|
;; Popup the menu and return the string.
|
|
|
|
|
(x-popup-menu event (cons (concat "-*- " name " -*-")
|
|
|
|
|
(nreverse pane-list)))))
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
1993-08-10 20:35:31 +00:00
|
|
|
|
|
(bookmark-write): Add numbered backups for bookmark file.
(bookmark-version-control): New variable.
(bookmark-jump): bookmark-jump now gives a
default value if no bookmark is entered manually.
(bookmark-set): Default to bookmark-current-bookmark or
buffer-name the way bookmark-jump does.
(ctl-x-map): Check if C-x r is a prefix before using it as one.
Include string "Bookmarks" in defining
[menu-bar bookmark] in global-map in the menu-bar code.
(menu-bar-bookmark-map): Supply t as 4th arg of autoload.
(bookmark-jump-noselect): New subroutine taken from
bookmark-jump. Support compressed files.
(bookmark-jump): Call bookmark-jump-noselect.
Offer to relocate if necessary, but change default dir to that of
the old bookmark in read-file-name.
(bookmark-set, bookmark-rename, bookmark-delete,
bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames,
Bookmark-menu-hide-filenames, Bookmark-menu-bookmark,
Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion
bugs by wrapping things in save-window-excursion as well.
(bookmark-make-menu-bar-alist): Added sorting.
(bookmark-map): Added new keybindings.
(bookmark-try-default-file): Set bookmarks-already-loaded to t after the load.
(list-bookmarks): Added bookmark menu stuff.
(Bookmark-menu-*): New functions.
1993-10-13 05:59:54 +00:00
|
|
|
|
;; Thanks to Roland McGrath for fixing menubar.el so that the
|
|
|
|
|
;; following works, and for explaining what to do to make it work.
|
1993-08-10 20:35:31 +00:00
|
|
|
|
|
1995-04-06 08:44:21 +00:00
|
|
|
|
;; We MUST autoload EACH form used to set up this variable's value, so
|
|
|
|
|
;; that the whole job is done in loaddefs.el.
|
1993-08-10 20:35:31 +00:00
|
|
|
|
|
1996-05-09 17:34:55 +00:00
|
|
|
|
;; Emacs menubar stuff.
|
1995-12-30 19:52:40 +00:00
|
|
|
|
|
1995-04-06 08:44:21 +00:00
|
|
|
|
;;;###autoload
|
(bookmark-completing-read): Use a popup menu if activated from the mouse.
Return a string, instead of a list of one string.
(bookmark-edit-annotation): Remove unused vars.
(bookmark-jump, bookmark-relocate, bookmark-insert-location)
(bookmark-rename, bookmark-insert, bookmark-delete): Adjust calls
to bookmark-completing-read.
(bookmark-bmenu-show-filenames, bookmark-bmenu-hide-filenames)
(bookmark-bmenu-mark, bookmark-bmenu-select, bookmark-bmenu-unmark)
(bookmark-bmenu-delete, bookmark-bmenu-list): Use inhibit-read-only
and erase-buffer.
(bookmark-menu-delete, bookmark-menu-rename, bookmark-menu-locate)
(bookmark-menu-jump, bookmark-menu-insert)
(bookmark-popup-menu-and-apply-function)
(bookmark-menu-popup-paned-bookmark-menu): Remove.
(bookmark-menu-build-paned-menu): Remove by folding it into
bookmark-menu-popup-paned-menu.
(menu-bar-bookmark-map): Move the define-key statements here.
Use the "non-menu" commands since they now pop up a menu if needed.
(bookmark-exit-hook-internal): Simplify.
2003-08-11 17:30:47 +00:00
|
|
|
|
(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))
|
2005-03-28 01:19:46 +00:00
|
|
|
|
(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))
|
(bookmark-completing-read): Use a popup menu if activated from the mouse.
Return a string, instead of a list of one string.
(bookmark-edit-annotation): Remove unused vars.
(bookmark-jump, bookmark-relocate, bookmark-insert-location)
(bookmark-rename, bookmark-insert, bookmark-delete): Adjust calls
to bookmark-completing-read.
(bookmark-bmenu-show-filenames, bookmark-bmenu-hide-filenames)
(bookmark-bmenu-mark, bookmark-bmenu-select, bookmark-bmenu-unmark)
(bookmark-bmenu-delete, bookmark-bmenu-list): Use inhibit-read-only
and erase-buffer.
(bookmark-menu-delete, bookmark-menu-rename, bookmark-menu-locate)
(bookmark-menu-jump, bookmark-menu-insert)
(bookmark-popup-menu-and-apply-function)
(bookmark-menu-popup-paned-bookmark-menu): Remove.
(bookmark-menu-build-paned-menu): Remove by folding it into
bookmark-menu-popup-paned-menu.
(menu-bar-bookmark-map): Move the define-key statements here.
Use the "non-menu" commands since they now pop up a menu if needed.
(bookmark-exit-hook-internal): Simplify.
2003-08-11 17:30:47 +00:00
|
|
|
|
map))
|
1995-12-30 19:52:40 +00:00
|
|
|
|
|
1995-04-06 08:44:21 +00:00
|
|
|
|
;;;###autoload
|
(bookmark-completing-read): Use a popup menu if activated from the mouse.
Return a string, instead of a list of one string.
(bookmark-edit-annotation): Remove unused vars.
(bookmark-jump, bookmark-relocate, bookmark-insert-location)
(bookmark-rename, bookmark-insert, bookmark-delete): Adjust calls
to bookmark-completing-read.
(bookmark-bmenu-show-filenames, bookmark-bmenu-hide-filenames)
(bookmark-bmenu-mark, bookmark-bmenu-select, bookmark-bmenu-unmark)
(bookmark-bmenu-delete, bookmark-bmenu-list): Use inhibit-read-only
and erase-buffer.
(bookmark-menu-delete, bookmark-menu-rename, bookmark-menu-locate)
(bookmark-menu-jump, bookmark-menu-insert)
(bookmark-popup-menu-and-apply-function)
(bookmark-menu-popup-paned-bookmark-menu): Remove.
(bookmark-menu-build-paned-menu): Remove by folding it into
bookmark-menu-popup-paned-menu.
(menu-bar-bookmark-map): Move the define-key statements here.
Use the "non-menu" commands since they now pop up a menu if needed.
(bookmark-exit-hook-internal): Simplify.
2003-08-11 17:30:47 +00:00
|
|
|
|
(defalias 'menu-bar-bookmark-map menu-bar-bookmark-map)
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
1995-12-30 19:52:40 +00:00
|
|
|
|
;; make bookmarks appear toward the right side of the menu.
|
|
|
|
|
(if (boundp 'menu-bar-final-items)
|
2001-01-12 22:49:40 +00:00
|
|
|
|
(if menu-bar-final-items
|
1995-12-30 19:52:40 +00:00
|
|
|
|
(setq menu-bar-final-items
|
|
|
|
|
(cons 'bookmark menu-bar-final-items)))
|
|
|
|
|
(setq menu-bar-final-items '(bookmark)))
|
|
|
|
|
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
;;;; end bookmark menu stuff ;;;;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Load Hook
|
|
|
|
|
(defvar bookmark-load-hook nil
|
(bookmark-completing-read): Use a popup menu if activated from the mouse.
Return a string, instead of a list of one string.
(bookmark-edit-annotation): Remove unused vars.
(bookmark-jump, bookmark-relocate, bookmark-insert-location)
(bookmark-rename, bookmark-insert, bookmark-delete): Adjust calls
to bookmark-completing-read.
(bookmark-bmenu-show-filenames, bookmark-bmenu-hide-filenames)
(bookmark-bmenu-mark, bookmark-bmenu-select, bookmark-bmenu-unmark)
(bookmark-bmenu-delete, bookmark-bmenu-list): Use inhibit-read-only
and erase-buffer.
(bookmark-menu-delete, bookmark-menu-rename, bookmark-menu-locate)
(bookmark-menu-jump, bookmark-menu-insert)
(bookmark-popup-menu-and-apply-function)
(bookmark-menu-popup-paned-bookmark-menu): Remove.
(bookmark-menu-build-paned-menu): Remove by folding it into
bookmark-menu-popup-paned-menu.
(menu-bar-bookmark-map): Move the define-key statements here.
Use the "non-menu" commands since they now pop up a menu if needed.
(bookmark-exit-hook-internal): Simplify.
2003-08-11 17:30:47 +00:00
|
|
|
|
"Hook run at the end of loading bookmark.")
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
|
2000-12-13 22:56:38 +00:00
|
|
|
|
;;; Exit Hook, called from kill-emacs-hook
|
|
|
|
|
(defvar bookmark-exit-hook nil
|
(bookmark-automatically-show-annotations, bookmark-read-annotation-text-func): Doc fixes.
(bookmark-save): Improve argument/docstring consistency.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-alist-from-buffer, bookmark-upgrade-file-format-from-0,
bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format,
bookmark-kill-line, bookmark-read-annotation-mode,
bookmark-insert-current-bookmark, bookmark-jump, bookmark-exit-hook):
Fix typos in docstrings.
(bookmark-exit-hooks): Define as obsolete alias.
(bookmark-exit-hook-internal): Run `bookmark-exit-hook',
not `bookmark-exit-hooks'. Fix docstring.
(bookmark-bmenu-select): "?\ " -> "?\s".
2005-07-26 13:56:01 +00:00
|
|
|
|
"Hook run when Emacs exits.")
|
|
|
|
|
|
|
|
|
|
(define-obsolete-variable-alias 'bookmark-exit-hooks 'bookmark-exit-hook "22.1")
|
2001-01-12 22:49:40 +00:00
|
|
|
|
|
2000-12-13 22:56:38 +00:00
|
|
|
|
(defun bookmark-exit-hook-internal ()
|
|
|
|
|
"Save bookmark state, if necessary, at Emacs exit time.
|
(bookmark-automatically-show-annotations, bookmark-read-annotation-text-func): Doc fixes.
(bookmark-save): Improve argument/docstring consistency.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-alist-from-buffer, bookmark-upgrade-file-format-from-0,
bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format,
bookmark-kill-line, bookmark-read-annotation-mode,
bookmark-insert-current-bookmark, bookmark-jump, bookmark-exit-hook):
Fix typos in docstrings.
(bookmark-exit-hooks): Define as obsolete alias.
(bookmark-exit-hook-internal): Run `bookmark-exit-hook',
not `bookmark-exit-hooks'. Fix docstring.
(bookmark-bmenu-select): "?\ " -> "?\s".
2005-07-26 13:56:01 +00:00
|
|
|
|
This also runs `bookmark-exit-hook'."
|
|
|
|
|
(run-hooks 'bookmark-exit-hook)
|
(bookmark-completing-read): Use a popup menu if activated from the mouse.
Return a string, instead of a list of one string.
(bookmark-edit-annotation): Remove unused vars.
(bookmark-jump, bookmark-relocate, bookmark-insert-location)
(bookmark-rename, bookmark-insert, bookmark-delete): Adjust calls
to bookmark-completing-read.
(bookmark-bmenu-show-filenames, bookmark-bmenu-hide-filenames)
(bookmark-bmenu-mark, bookmark-bmenu-select, bookmark-bmenu-unmark)
(bookmark-bmenu-delete, bookmark-bmenu-list): Use inhibit-read-only
and erase-buffer.
(bookmark-menu-delete, bookmark-menu-rename, bookmark-menu-locate)
(bookmark-menu-jump, bookmark-menu-insert)
(bookmark-popup-menu-and-apply-function)
(bookmark-menu-popup-paned-bookmark-menu): Remove.
(bookmark-menu-build-paned-menu): Remove by folding it into
bookmark-menu-popup-paned-menu.
(menu-bar-bookmark-map): Move the define-key statements here.
Use the "non-menu" commands since they now pop up a menu if needed.
(bookmark-exit-hook-internal): Simplify.
2003-08-11 17:30:47 +00:00
|
|
|
|
(and bookmark-alist
|
|
|
|
|
(bookmark-time-to-save-p t)
|
|
|
|
|
(bookmark-save)))
|
2000-12-13 22:56:38 +00:00
|
|
|
|
|
|
|
|
|
(add-hook 'kill-emacs-hook 'bookmark-exit-hook-internal)
|
|
|
|
|
|
|
|
|
|
|
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
1995-03-11 02:05:20 +00:00
|
|
|
|
(run-hooks 'bookmark-load-hook)
|
1993-08-10 20:35:31 +00:00
|
|
|
|
|
|
|
|
|
(provide 'bookmark)
|
2001-01-12 22:49:40 +00:00
|
|
|
|
|
2003-09-01 15:45:59 +00:00
|
|
|
|
;;; arch-tag: 139f519a-dd0c-4b8d-8b5d-f9fcf53ca8f6
|
1993-08-13 00:59:51 +00:00
|
|
|
|
;;; bookmark.el ends here
|