2019-06-18 05:59:11 +00:00
|
|
|
|
;;; bookmark.el --- set bookmarks, maybe annotate them, jump to them later -*- lexical-binding: t -*-
|
1993-08-10 20:35:31 +00:00
|
|
|
|
|
2024-01-02 01:47:10 +00:00
|
|
|
|
;; Copyright (C) 1993-1997, 2001-2024 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>
|
1993-08-10 20:35:31 +00:00
|
|
|
|
;; Created: July, 1993
|
2019-06-30 23:21:47 +00:00
|
|
|
|
;; Keywords: convenience
|
1993-08-10 20:35:31 +00:00
|
|
|
|
|
|
|
|
|
;; This file is part of GNU Emacs.
|
|
|
|
|
|
2008-05-06 08:06:51 +00:00
|
|
|
|
;; GNU Emacs is free software: you can redistribute it and/or modify
|
1993-08-10 20:35:31 +00:00
|
|
|
|
;; it under the terms of the GNU General Public License as published by
|
2008-05-06 08:06:51 +00:00
|
|
|
|
;; the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
;; (at your option) any later version.
|
1993-08-10 20:35:31 +00:00
|
|
|
|
|
|
|
|
|
;; 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
|
2017-09-13 22:52:52 +00:00
|
|
|
|
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
|
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.
|
2020-12-14 13:52:46 +00:00
|
|
|
|
;;
|
2021-09-03 09:13:53 +00:00
|
|
|
|
;; Type `M-x customize-group RET bookmark RET' for user options.
|
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
|
|
|
|
|
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)
|
2020-10-17 15:56:44 +00:00
|
|
|
|
(require 'tabulated-list)
|
2019-07-02 01:06:37 +00:00
|
|
|
|
(require 'text-property-search)
|
2022-08-16 13:40:49 +00:00
|
|
|
|
(require 'fringe) ; for builds --without-x
|
Reduce use of (require 'cl).
* admin/bzrmerge.el: Use cl-lib.
* leim/quail/hangul.el: Don't require CL.
* leim/quail/ipa.el: Use cl-lib.
* vc/smerge-mode.el, vc/pcvs.el, vc/pcvs-util.el, vc/pcvs-info.el:
* vc/diff-mode.el, vc/cvs-status.el, uniquify.el, scroll-bar.el:
* register.el, progmodes/sh-script.el, net/gnutls.el, net/dbus.el:
* msb.el, mpc.el, minibuffer.el, international/ucs-normalize.el:
* international/quail.el, info-xref.el, imenu.el, image-mode.el:
* font-lock.el, filesets.el, edmacro.el, doc-view.el, bookmark.el:
* battery.el, avoid.el, abbrev.el: Use cl-lib.
* vc/pcvs-parse.el, vc/pcvs-defs.el, vc/log-view.el, vc/log-edit.el:
* vc/diff.el, simple.el, pcomplete.el, lpr.el, comint.el, loadhist.el:
* jit-lock.el, international/iso-ascii.el, info.el, frame.el, bs.el:
* emulation/crisp.el, electric.el, dired.el, cus-dep.el, composite.el:
* calculator.el, autorevert.el, apropos.el: Don't require CL.
* emacs-bytecomp.el (byte-recompile-directory, display-call-tree)
(byte-compile-unfold-bcf, byte-compile-check-variable):
* emacs-byte-opt.el (byte-compile-trueconstp)
(byte-compile-nilconstp):
* emacs-autoload.el (make-autoload): Use pcase.
* face-remap.el (text-scale-adjust): Simplify pcase patterns.
2012-07-10 11:51:54 +00:00
|
|
|
|
(eval-when-compile (require 'cl-lib))
|
1996-01-14 07:34:30 +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
|
|
|
|
;;; Misc comments:
|
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
|
|
|
|
;; 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
|
2019-06-28 11:40:37 +00:00
|
|
|
|
"If non-nil, setting a bookmark queries for an annotation in a buffer."
|
2019-06-30 23:21:47 +00:00
|
|
|
|
:type 'boolean)
|
1995-06-18 22:46:02 +00:00
|
|
|
|
|
|
|
|
|
|
1997-04-12 03:18:33 +00:00
|
|
|
|
(defcustom bookmark-save-flag t
|
2008-03-09 21:01:54 +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
|
2010-01-02 01:05:44 +00:00
|
|
|
|
explicitly called (\\[bookmark-save]).
|
1995-06-18 22:46:02 +00:00
|
|
|
|
--> 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
|
2010-01-02 01:05:44 +00:00
|
|
|
|
the bookmark list is saved (i.e.: the number of times which
|
2012-02-28 08:17:21 +00:00
|
|
|
|
Emacs's bookmark list may be modified before it is automatically
|
2010-01-02 01:05:44 +00:00
|
|
|
|
saved.). If it is a number, Emacs will also automatically save
|
1995-06-18 22:46:02 +00:00
|
|
|
|
bookmarks when it is killed.
|
|
|
|
|
|
|
|
|
|
Therefore, the way to get it to save every time you make or delete a
|
2010-01-02 01:05:44 +00:00
|
|
|
|
bookmark is to set this variable to 1 (or 0, which produces the same
|
|
|
|
|
behavior.)
|
1995-06-18 22:46:02 +00:00
|
|
|
|
|
|
|
|
|
To specify the file in which to save them, modify the variable
|
2016-04-25 08:28:17 +00:00
|
|
|
|
`bookmark-default-file'."
|
2019-06-30 23:21:47 +00:00
|
|
|
|
:type '(choice (const nil) integer (other t)))
|
1995-06-18 22:46:02 +00:00
|
|
|
|
|
|
|
|
|
|
2019-06-09 23:47:16 +00:00
|
|
|
|
(define-obsolete-variable-alias 'bookmark-old-default-file
|
|
|
|
|
'bookmark-default-file "27.1")
|
2019-06-09 23:26:55 +00:00
|
|
|
|
(define-obsolete-variable-alias 'bookmark-file 'bookmark-default-file "27.1")
|
1997-04-12 03:18:33 +00:00
|
|
|
|
(defcustom bookmark-default-file
|
2019-06-09 23:26:55 +00:00
|
|
|
|
(locate-user-emacs-file "bookmarks" ".emacs.bmk")
|
2008-03-09 21:01:54 +00:00
|
|
|
|
"File in which to save bookmarks by default."
|
2019-06-18 05:59:11 +00:00
|
|
|
|
;; The current default file is defined via the internal variable
|
|
|
|
|
;; `bookmark-bookmarks-timestamp'. This does not affect the value
|
|
|
|
|
;; of `bookmark-default-file'.
|
2019-06-30 23:21:47 +00:00
|
|
|
|
:type 'file)
|
1995-06-18 22:46:02 +00:00
|
|
|
|
|
2019-06-18 05:59:11 +00:00
|
|
|
|
(defcustom bookmark-watch-bookmark-file t
|
2023-07-22 12:45:40 +00:00
|
|
|
|
"If non-nil reload the default bookmark file if it was changed.
|
2019-06-18 05:59:11 +00:00
|
|
|
|
If this file has changed on disk since it was last loaded, query the user
|
|
|
|
|
whether to load it again. If the value is `silent' reload without querying.
|
|
|
|
|
This file defaults to `bookmark-default-file'. But during an Emacs session,
|
|
|
|
|
`bookmark-load' and `bookmark-save' can redefine the current default file."
|
|
|
|
|
:version "27.1"
|
2023-07-22 12:45:40 +00:00
|
|
|
|
:type '(choice (const :tag "Suggest to reload bookmark file if changed" t)
|
|
|
|
|
(const :tag "Silently reload bookmark file if changed" silent)
|
|
|
|
|
(const :tag "Ignore changes of bookmark file" nil))
|
2019-06-18 05:59:11 +00:00
|
|
|
|
:group 'bookmark)
|
1995-06-18 22:46:02 +00:00
|
|
|
|
|
1997-04-12 03:18:33 +00:00
|
|
|
|
(defcustom bookmark-version-control 'nospecial
|
2008-03-09 21:01:54 +00:00
|
|
|
|
"Whether or not to make numbered backups of the bookmark file.
|
2012-10-01 03:32:06 +00:00
|
|
|
|
It can have four values: t, nil, `never', or `nospecial'.
|
1995-06-18 22:46:02 +00:00
|
|
|
|
The first three have the same meaning that they do for the
|
2012-10-01 03:32:06 +00:00
|
|
|
|
variable `version-control'; the value `nospecial' (the default) means
|
|
|
|
|
just use the value of `version-control'."
|
|
|
|
|
:type '(choice (const :tag "If existing" nil)
|
|
|
|
|
(const :tag "Never" never)
|
2012-10-01 04:15:48 +00:00
|
|
|
|
(const :tag "Use value of option `version-control'" nospecial)
|
2019-06-30 23:21:47 +00:00
|
|
|
|
(other :tag "Always" t)))
|
1995-06-18 22:46:02 +00:00
|
|
|
|
|
|
|
|
|
|
1997-04-12 03:18:33 +00:00
|
|
|
|
(defcustom bookmark-completion-ignore-case t
|
2008-03-09 21:01:54 +00:00
|
|
|
|
"Non-nil means bookmark functions ignore case in completion."
|
2019-06-30 23:21:47 +00:00
|
|
|
|
:type 'boolean)
|
1995-06-18 22:46:02 +00:00
|
|
|
|
|
|
|
|
|
|
1997-04-12 03:18:33 +00:00
|
|
|
|
(defcustom bookmark-sort-flag t
|
2022-05-31 18:35:39 +00:00
|
|
|
|
"This controls the bookmark display sorting.
|
|
|
|
|
nil means they will be displayed in LIFO order (that is, most
|
|
|
|
|
recently created ones come first, oldest ones come last).
|
|
|
|
|
|
|
|
|
|
`last-modified' means that bookmarks will be displayed sorted
|
2022-06-08 11:51:41 +00:00
|
|
|
|
from most recently modified to least recently modified.
|
2022-05-31 18:35:39 +00:00
|
|
|
|
|
|
|
|
|
Other values means that bookmarks will be displayed sorted by
|
|
|
|
|
bookmark name."
|
|
|
|
|
:type '(choice (const :tag "By name" t)
|
|
|
|
|
(const :tag "By modified time" last-modified)
|
|
|
|
|
(const :tag "By creation time" nil)))
|
1995-06-18 22:46:02 +00:00
|
|
|
|
|
|
|
|
|
|
2021-05-05 21:40:52 +00:00
|
|
|
|
(defcustom bookmark-menu-confirm-deletion nil
|
|
|
|
|
"Non-nil means confirm before deleting bookmarks in a bookmark menu buffer.
|
|
|
|
|
Nil means don't prompt for confirmation."
|
|
|
|
|
:version "28.1"
|
|
|
|
|
:type 'boolean)
|
|
|
|
|
|
1997-04-12 03:18:33 +00:00
|
|
|
|
(defcustom bookmark-automatically-show-annotations t
|
2008-03-09 21:01:54 +00:00
|
|
|
|
"Non-nil means show annotations when jumping to a bookmark."
|
2019-06-30 23:21:47 +00:00
|
|
|
|
:type 'boolean)
|
1995-06-18 22:46:02 +00:00
|
|
|
|
|
2019-07-02 01:06:37 +00:00
|
|
|
|
(defconst bookmark-bmenu-buffer "*Bookmark List*"
|
|
|
|
|
"Name of buffer used for Bookmark List.")
|
|
|
|
|
|
2020-10-17 15:56:44 +00:00
|
|
|
|
(defvar bookmark-bmenu-use-header-line t
|
2013-12-28 02:16:05 +00:00
|
|
|
|
"Non-nil means to use an immovable header line.
|
2020-10-17 15:56:44 +00:00
|
|
|
|
This is as opposed to inline text at the top of the buffer.")
|
|
|
|
|
(make-obsolete-variable 'bookmark-bmenu-use-header-line "no longer used." "28.1")
|
1995-06-18 22:46:02 +00:00
|
|
|
|
|
2013-03-07 22:33:22 +00:00
|
|
|
|
(defconst bookmark-bmenu-inline-header-height 2
|
2019-05-26 10:48:26 +00:00
|
|
|
|
"Number of lines used for the *Bookmark List* header.
|
|
|
|
|
\(This is only significant when `bookmark-bmenu-use-header-line'
|
|
|
|
|
is nil.)")
|
2020-10-17 15:56:44 +00:00
|
|
|
|
(make-obsolete-variable 'bookmark-bmenu-inline-header-height "no longer used." "28.1")
|
2010-01-02 04:36:17 +00:00
|
|
|
|
|
2010-01-02 19:14:13 +00:00
|
|
|
|
(defconst bookmark-bmenu-marks-width 2
|
2019-05-26 10:48:26 +00:00
|
|
|
|
"Number of columns (chars) used for the *Bookmark List* marks column.
|
|
|
|
|
This includes the annotations column.")
|
2010-01-02 04:36:17 +00:00
|
|
|
|
|
1997-04-12 03:18:33 +00:00
|
|
|
|
(defcustom bookmark-bmenu-file-column 30
|
2008-03-09 21:01:54 +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]."
|
Make some defcustom types more restrictive
* lisp/abbrev.el (abbrev-suggest-hint-threshold):
* lisp/bookmark.el (bookmark-bmenu-file-column)
(bookmark-menu-length):
* lisp/buff-menu.el (Buffer-menu-size-width)
(Buffer-menu-mode-width):
* lisp/calendar/calendar.el (calendar-week-start-day)
(calendar-intermonth-spacing, calendar-column-width)
(calendar-day-digit-width):
* lisp/calc/calc.el (calc-undo-length):
* lisp/calendar/timeclock.el (timeclock-workday):
* lisp/comint.el (comint-buffer-maximum-size)
(comint-input-ring-size):
* lisp/doc-view.el (doc-view-resolution, doc-view-image-width):
* lisp/emacs-lisp/bytecomp.el (byte-compile-docstring-max-column):
* lisp/emacs-lisp/comp.el (native-comp-debug)
(native-comp-verbose, native-comp-async-jobs-number):
* lisp/emacs-lisp/package.el (package-name-column-width)
(package-version-column-width, package-status-column-width)
(package-archive-column-width):
* lisp/eshell/esh-mode.el (eshell-buffer-maximum-lines):
* lisp/frame.el (blink-cursor-blinks):
* lisp/info.el (Info-breadcrumbs-depth):
* lisp/jit-lock.el (jit-lock-chunk-size):
* lisp/kmacro.el (kmacro-ring-max):
* lisp/menu-bar.el (yank-menu-length, yank-menu-max-items):
* lisp/midnight.el (clean-buffer-list-delay-general)
(clean-buffer-list-delay-special):
* lisp/net/dictionary.el (dictionary-port)
(dictionary-proxy-port):
* lisp/net/ldap.el (ldap-default-port):
* lisp/net/pop3.el (pop3-port, pop3-stream-length):
* lisp/net/rcirc.el (rcirc-default-port):
* lisp/net/sieve-manage.el (sieve-manage-default-port):
* lisp/play/spook.el (spook-phrase-default-count):
* lisp/play/tetris.el (tetris-buffer-width)
(tetris-buffer-height, tetris-width, tetris-height)
(tetris-top-left-x, tetris-top-left-y):
* lisp/profiler.el (profiler-sampling-interval):
* lisp/progmodes/sql.el (sql-port):
* lisp/recentf.el (recentf-max-menu-items):
* lisp/strokes.el (strokes-grid-resolution):
* lisp/tab-bar.el (tab-bar-tab-name-truncated-max):
* lisp/term/xterm.el (xterm-max-cut-length):
* lisp/time.el (display-time-interval, world-clock-timer-second):
* lisp/url/url-cache.el (url-cache-expire-time):
* lisp/url/url-cookie.el (url-cookie-save-interval):
* lisp/url/url-history.el (url-history-save-interval):
* lisp/url/url-queue.el (url-queue-parallel-processes)
(url-queue-timeout):
* lisp/url/url-vars.el (url-max-password-attempts)
(url-max-redirections):
* lisp/vc/emerge.el (emerge-min-visible-lines):
* lisp/vc/vc.el (vc-log-show-limit):
* lisp/window.el (window-min-height, window-min-width):
* lisp/winner.el (winner-ring-size): Use :type natnum.
* lisp/savehist.el (savehist-file-modes): Fix setting to nil value and
use :type natnum.
2022-07-05 14:26:45 +00:00
|
|
|
|
:type 'natnum)
|
1995-06-18 22:46:02 +00:00
|
|
|
|
|
|
|
|
|
|
1997-04-12 03:18:33 +00:00
|
|
|
|
(defcustom bookmark-bmenu-toggle-filenames t
|
2008-03-09 21:01:54 +00:00
|
|
|
|
"Non-nil means show filenames when listing bookmarks.
|
2012-09-17 05:41:04 +00:00
|
|
|
|
A non-nil value may result in truncated bookmark names."
|
2019-06-30 23:21:47 +00:00
|
|
|
|
:type 'boolean)
|
1995-06-18 22:46:02 +00:00
|
|
|
|
|
2013-03-07 22:35:47 +00:00
|
|
|
|
(defface bookmark-menu-bookmark
|
|
|
|
|
'((t (:weight bold)))
|
2019-06-30 23:21:47 +00:00
|
|
|
|
"Face used to highlight bookmark names in bookmark menu buffers.")
|
1995-06-18 22:46:02 +00:00
|
|
|
|
|
1997-04-12 03:18:33 +00:00
|
|
|
|
(defcustom bookmark-menu-length 70
|
2008-03-09 21:01:54 +00:00
|
|
|
|
"Maximum length of a bookmark name displayed on a popup menu."
|
Make some defcustom types more restrictive
* lisp/abbrev.el (abbrev-suggest-hint-threshold):
* lisp/bookmark.el (bookmark-bmenu-file-column)
(bookmark-menu-length):
* lisp/buff-menu.el (Buffer-menu-size-width)
(Buffer-menu-mode-width):
* lisp/calendar/calendar.el (calendar-week-start-day)
(calendar-intermonth-spacing, calendar-column-width)
(calendar-day-digit-width):
* lisp/calc/calc.el (calc-undo-length):
* lisp/calendar/timeclock.el (timeclock-workday):
* lisp/comint.el (comint-buffer-maximum-size)
(comint-input-ring-size):
* lisp/doc-view.el (doc-view-resolution, doc-view-image-width):
* lisp/emacs-lisp/bytecomp.el (byte-compile-docstring-max-column):
* lisp/emacs-lisp/comp.el (native-comp-debug)
(native-comp-verbose, native-comp-async-jobs-number):
* lisp/emacs-lisp/package.el (package-name-column-width)
(package-version-column-width, package-status-column-width)
(package-archive-column-width):
* lisp/eshell/esh-mode.el (eshell-buffer-maximum-lines):
* lisp/frame.el (blink-cursor-blinks):
* lisp/info.el (Info-breadcrumbs-depth):
* lisp/jit-lock.el (jit-lock-chunk-size):
* lisp/kmacro.el (kmacro-ring-max):
* lisp/menu-bar.el (yank-menu-length, yank-menu-max-items):
* lisp/midnight.el (clean-buffer-list-delay-general)
(clean-buffer-list-delay-special):
* lisp/net/dictionary.el (dictionary-port)
(dictionary-proxy-port):
* lisp/net/ldap.el (ldap-default-port):
* lisp/net/pop3.el (pop3-port, pop3-stream-length):
* lisp/net/rcirc.el (rcirc-default-port):
* lisp/net/sieve-manage.el (sieve-manage-default-port):
* lisp/play/spook.el (spook-phrase-default-count):
* lisp/play/tetris.el (tetris-buffer-width)
(tetris-buffer-height, tetris-width, tetris-height)
(tetris-top-left-x, tetris-top-left-y):
* lisp/profiler.el (profiler-sampling-interval):
* lisp/progmodes/sql.el (sql-port):
* lisp/recentf.el (recentf-max-menu-items):
* lisp/strokes.el (strokes-grid-resolution):
* lisp/tab-bar.el (tab-bar-tab-name-truncated-max):
* lisp/term/xterm.el (xterm-max-cut-length):
* lisp/time.el (display-time-interval, world-clock-timer-second):
* lisp/url/url-cache.el (url-cache-expire-time):
* lisp/url/url-cookie.el (url-cookie-save-interval):
* lisp/url/url-history.el (url-history-save-interval):
* lisp/url/url-queue.el (url-queue-parallel-processes)
(url-queue-timeout):
* lisp/url/url-vars.el (url-max-password-attempts)
(url-max-redirections):
* lisp/vc/emerge.el (emerge-min-visible-lines):
* lisp/vc/vc.el (vc-log-show-limit):
* lisp/window.el (window-min-height, window-min-width):
* lisp/winner.el (winner-ring-size): Use :type natnum.
* lisp/savehist.el (savehist-file-modes): Fix setting to nil value and
use :type natnum.
2022-07-05 14:26:45 +00:00
|
|
|
|
:type 'natnum)
|
1995-06-18 22:46:02 +00:00
|
|
|
|
|
2009-11-21 04:43:10 +00:00
|
|
|
|
;; FIXME: Is it really worth a customization option?
|
2009-11-20 15:47:26 +00:00
|
|
|
|
(defcustom bookmark-search-delay 0.2
|
2009-11-21 04:43:10 +00:00
|
|
|
|
"Time before `bookmark-bmenu-search' updates the display."
|
2013-05-09 01:40:20 +00:00
|
|
|
|
:type 'number)
|
2009-11-20 15:47:26 +00:00
|
|
|
|
|
2022-08-02 18:40:43 +00:00
|
|
|
|
(define-fringe-bitmap 'bookmark-mark
|
|
|
|
|
[#b01111110
|
|
|
|
|
#b01111110
|
|
|
|
|
#b01111110
|
|
|
|
|
#b01111110
|
|
|
|
|
#b01111110
|
|
|
|
|
#b01111110
|
|
|
|
|
#b01100110
|
|
|
|
|
#b01000010])
|
|
|
|
|
|
|
|
|
|
(define-obsolete-variable-alias 'bookmark-set-fringe-mark
|
|
|
|
|
'bookmark-fringe-mark "29.1")
|
|
|
|
|
|
|
|
|
|
(defcustom bookmark-fringe-mark 'bookmark-mark
|
|
|
|
|
"The fringe bitmap to mark bookmarked lines with.
|
|
|
|
|
If nil, don't display a mark on the fringe."
|
|
|
|
|
:type '(choice (const nil) fringe-bitmap)
|
|
|
|
|
:set #'fringe-custom-set-bitmap
|
|
|
|
|
:version "29.1")
|
2021-05-04 08:58:52 +00:00
|
|
|
|
|
|
|
|
|
(defface bookmark-face
|
|
|
|
|
'((((class grayscale)
|
|
|
|
|
(background light))
|
2021-09-13 11:35:53 +00:00
|
|
|
|
:foreground "DimGray")
|
2021-05-04 08:58:52 +00:00
|
|
|
|
(((class grayscale)
|
|
|
|
|
(background dark))
|
2021-09-13 11:35:53 +00:00
|
|
|
|
:foreground "LightGray")
|
2021-05-04 08:58:52 +00:00
|
|
|
|
(((class color)
|
|
|
|
|
(background light))
|
2022-08-02 18:40:43 +00:00
|
|
|
|
:foreground "DarkOrange1" :distant-foreground "DarkOrange3")
|
2021-05-04 08:58:52 +00:00
|
|
|
|
(((class color)
|
|
|
|
|
(background dark))
|
2022-08-02 18:40:43 +00:00
|
|
|
|
:foreground "DarkOrange1" :distant-foreground "Orange1"))
|
2021-05-04 08:58:52 +00:00
|
|
|
|
"Face used to highlight current line."
|
2021-05-04 09:36:56 +00:00
|
|
|
|
:version "28.1")
|
2005-10-19 09:45:43 +00:00
|
|
|
|
|
1995-06-18 22:46:02 +00:00
|
|
|
|
;;; No user-serviceable parts beyond this point.
|
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
|
|
|
|
|
|
|
|
|
;;; 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.
|
|
|
|
|
|
2022-07-04 14:18:54 +00:00
|
|
|
|
;;;###autoload (keymap-set ctl-x-r-map "b" #'bookmark-jump)
|
|
|
|
|
;;;###autoload (keymap-set ctl-x-r-map "m" #'bookmark-set)
|
|
|
|
|
;;;###autoload (keymap-set ctl-x-r-map "M" #'bookmark-set-no-overwrite)
|
|
|
|
|
;;;###autoload (keymap-set ctl-x-r-map "l" #'bookmark-bmenu-list)
|
2007-07-15 01:34:15 +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
|
2021-11-17 04:49:05 +00:00
|
|
|
|
(defvar-keymap bookmark-map
|
|
|
|
|
:doc "Keymap containing bindings to bookmark functions.
|
1993-08-14 19:49:27 +00:00
|
|
|
|
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
|
2019-05-26 10:48:26 +00:00
|
|
|
|
key of your choice to variable `bookmark-map'. All interactive bookmark
|
2021-11-17 04:49:05 +00:00
|
|
|
|
functions have a binding in this keymap."
|
|
|
|
|
"x" #'bookmark-set
|
|
|
|
|
"m" #'bookmark-set ;"m"ark
|
|
|
|
|
"M" #'bookmark-set-no-overwrite ;"M"aybe mark
|
|
|
|
|
"j" #'bookmark-jump
|
|
|
|
|
"g" #'bookmark-jump ;"g"o
|
|
|
|
|
"o" #'bookmark-jump-other-window
|
|
|
|
|
"5" #'bookmark-jump-other-frame
|
|
|
|
|
"i" #'bookmark-insert
|
|
|
|
|
"e" #'edit-bookmarks
|
|
|
|
|
"f" #'bookmark-insert-location ;"f"ind
|
|
|
|
|
"r" #'bookmark-rename
|
|
|
|
|
"d" #'bookmark-delete
|
|
|
|
|
"D" #'bookmark-delete-all
|
|
|
|
|
"l" #'bookmark-load
|
|
|
|
|
"w" #'bookmark-write
|
|
|
|
|
"s" #'bookmark-save)
|
1993-08-10 20:35:31 +00:00
|
|
|
|
|
2008-03-07 05:00:18 +00:00
|
|
|
|
;;;###autoload (fset 'bookmark-map 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Core variables and data structures:
|
1993-08-14 19:52:32 +00:00
|
|
|
|
(defvar bookmark-alist ()
|
2017-12-09 09:18:06 +00:00
|
|
|
|
"Association list of bookmark names and their parameters.
|
2009-10-25 02:07:45 +00:00
|
|
|
|
Bookmark functions update the value automatically.
|
|
|
|
|
You probably do NOT want to change the value yourself.
|
1995-06-18 22:46:02 +00:00
|
|
|
|
|
2022-03-18 02:18:26 +00:00
|
|
|
|
The value is an alist whose elements are of the form
|
1995-06-18 22:46:02 +00:00
|
|
|
|
|
2009-10-25 02:07:45 +00:00
|
|
|
|
(BOOKMARK-NAME . PARAM-ALIST)
|
1995-06-18 22:46:02 +00:00
|
|
|
|
|
2022-03-18 02:18:26 +00:00
|
|
|
|
or the deprecated form (BOOKMARK-NAME PARAM-ALIST). The alist is
|
|
|
|
|
ordered from most recently created bookmark at the front to least
|
|
|
|
|
recently created bookmark at the end.
|
1995-06-18 22:46:02 +00:00
|
|
|
|
|
2019-06-18 05:59:11 +00:00
|
|
|
|
BOOKMARK-NAME is the name you gave to the bookmark when creating it.
|
|
|
|
|
|
|
|
|
|
PARAM-ALIST is an alist of bookmark information. The order of the
|
|
|
|
|
entries in PARAM-ALIST is not important. The default entries are
|
|
|
|
|
described below. An entry with a key but null value means the entry
|
|
|
|
|
is not used.
|
|
|
|
|
|
|
|
|
|
(filename . FILENAME)
|
|
|
|
|
(buf . BUFFER-OR-NAME)
|
|
|
|
|
(position . POS)
|
|
|
|
|
(front-context-string . STR-AFTER-POS)
|
|
|
|
|
(rear-context-string . STR-BEFORE-POS)
|
|
|
|
|
(handler . HANDLER)
|
|
|
|
|
(annotation . ANNOTATION)
|
|
|
|
|
|
|
|
|
|
FILENAME names the bookmarked file.
|
|
|
|
|
BUFFER-OR-NAME is a buffer or the name of a buffer that is used
|
|
|
|
|
if FILENAME is not defined or it refers to a non-existent file.
|
|
|
|
|
POS is the bookmarked buffer position.
|
|
|
|
|
STR-AFTER-POS is buffer text that immediately follows POS.
|
|
|
|
|
STR-BEFORE-POS is buffer text that immediately precedes POS.
|
|
|
|
|
ANNOTATION is a string that describes the bookmark.
|
|
|
|
|
See options `bookmark-use-annotations' and
|
|
|
|
|
`bookmark-automatically-show-annotations'.
|
2021-09-14 06:43:18 +00:00
|
|
|
|
HANDLER is a function that provides the `bookmark-jump' behavior for a
|
2019-06-18 05:59:11 +00:00
|
|
|
|
specific kind of bookmark instead of the default `bookmark-default-handler'.
|
|
|
|
|
This is the case for Info bookmarks, for instance. HANDLER must accept
|
|
|
|
|
a bookmark as its single argument.
|
|
|
|
|
|
|
|
|
|
A function `bookmark-make-record-function' may define additional entries
|
|
|
|
|
in PARAM-LIST that can be used by HANDLER.")
|
|
|
|
|
|
2019-06-18 10:21:27 +00:00
|
|
|
|
(define-obsolete-variable-alias 'bookmarks-already-loaded
|
|
|
|
|
'bookmark-bookmarks-timestamp "27.1")
|
2019-06-18 05:59:11 +00:00
|
|
|
|
(defvar bookmark-bookmarks-timestamp nil
|
|
|
|
|
"Timestamp of current default bookmark file.
|
|
|
|
|
The value is actually (FILE . MODTIME), where FILE is a bookmark file that
|
|
|
|
|
defaults to `bookmark-default-file' and MODTIME is its modification time.")
|
(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
|
|
|
|
|
2017-01-07 12:33:41 +00:00
|
|
|
|
(defvar bookmark-file-coding-system nil
|
|
|
|
|
"The coding-system of the last loaded or saved 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
|
|
|
|
|
Prefer defvar-local in remaining libraries
* lisp/align.el (align-mode-rules-list)
(align-mode-exclude-rules-list):
* lisp/bookmark.el (bookmark-current-bookmark)
(bookmark-annotation-name)
(bookmark--annotation-from-bookmark-list):
* lisp/calc/calc-embed.el (calc-embedded-all-active)
(calc-embedded-some-active):
* lisp/comint.el (comint-password-function):
* lisp/completion.el (completion-syntax-table):
* lisp/dframe.el (dframe-track-mouse-function)
(dframe-help-echo-function, dframe-mouse-click-function)
(dframe-mouse-position-function, dframe-timer)
(dframe-attached-frame, dframe-controlled):
* lisp/ehelp.el (electric-help-orig-major-mode):
* lisp/eshell/esh-util.el (eshell-path-env):
* lisp/expand.el (expand-pos, expand-index, expand-point):
* lisp/face-remap.el (text-scale-mode-remapping)
(text-scale-mode-lighter, text-scale-mode-amount)
(text-scale-remap-header-line, buffer-face-mode-remapping):
* lisp/ffap.el (ffap-menu-alist):
* lisp/files-x.el (connection-local-variables-alist):
* lisp/foldout.el (foldout-fold-list, foldout-mode-line-string):
* lisp/follow.el (follow-start-end-invalid):
* lisp/forms.el (forms--mode-setup):
* lisp/gnus/message.el (message-cross-post-old-target)
(message-options):
* lisp/help-mode.el (help-xref-stack, help-xref-forward-stack)
(help-xref-stack-item, help-xref-stack-forward-item):
* lisp/hexl.el (hexl-mode--old-var-vals, hexl-ascii-overlay):
* lisp/hilit-chg.el (hilit-chg-string):
* lisp/ido.el (ido-eoinput):
* lisp/imenu.el (imenu-generic-expression)
(imenu-create-index-function, imenu-default-goto-function)
(imenu-prev-index-position-function)
(imenu-extract-index-name-function, imenu-name-lookup-function)
(imenu-syntax-alist, imenu-case-fold-search):
* lisp/jka-compr.el (jka-compr-really-do-compress):
* lisp/language/ethio-util.el (ethio-prefer-ascii-space):
* lisp/leim/quail/hangul.el (hangul-input-method-help-text):
* lisp/leim/quail/japanese.el (quail-japanese-package-saved):
* lisp/linum.el (linum-overlays, linum-available):
* lisp/man.el (Man-original-frame, Man-arguments, Man--sections)
(Man--refpages, Man-page-list, Man-current-page)
(Man-page-mode-string):
* lisp/pcomplete.el (pcomplete-current-completions)
(pcomplete-last-completion-length)
(pcomplete-last-completion-stub, pcomplete-last-completion-raw)
(pcomplete-last-window-config, pcomplete-window-restore-timer):
* lisp/reveal.el (reveal-open-spots, reveal-last-tick):
* lisp/ruler-mode.el (ruler-mode):
* lisp/scroll-lock.el (scroll-lock-preserve-screen-pos-save):
* lisp/server.el (server-buffer-clients, server-existing-buffer):
* lisp/tab-line.el (tab-line-exclude):
* lisp/tar-mode.el (tar-data-buffer, tar-data-swapped):
* lisp/thumbs.el (thumbs-current-tmp-filename)
(thumbs-current-image-filename, thumbs-extra-images)
(thumbs-image-num, thumbs-buffer, thumbs-marked-list):
* lisp/tutorial.el (tutorial--point-before-chkeys)
(tutorial--point-after-chkeys, tutorial--lang):
* lisp/url/url-vars.el (url-current-object)
(url-current-mime-headers, url-current-lastloc):
* lisp/view.el (view-mode, view-old-buffer-read-only)
(view-old-Helper-return-blurb, view-page-size)
(view-half-page-size, view-last-regexp, view-return-to-alist)
(view-exit-action, view-overlay):
* lisp/wid-edit.el (widget-global-map, widget-field-new)
(widget-field-list, widget-field-last, widget-field-was):
* lisp/woman.el (woman-imenu-done): Prefer defvar-local.
2021-02-02 08:55:40 +00:00
|
|
|
|
(defvar-local 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
|
|
|
|
|
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
|
|
|
|
|
2009-10-10 21:48:22 +00:00
|
|
|
|
(defvar bookmark-current-buffer nil
|
|
|
|
|
"The buffer in which a bookmark is currently being set or renamed.
|
|
|
|
|
Functions that insert strings into the minibuffer use this to know
|
2012-08-08 08:48:57 +00:00
|
|
|
|
the source buffer for that information; see `bookmark-yank-word'
|
|
|
|
|
for example.")
|
2009-10-10 21:48:22 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defvar bookmark-yank-point 0
|
|
|
|
|
"The next point from which to pull source text for `bookmark-yank-word'.
|
2010-01-02 01:05:44 +00:00
|
|
|
|
This point is in `bookmark-current-buffer'.")
|
2009-10-10 21:48:22 +00:00
|
|
|
|
|
1993-08-10 20:35:31 +00:00
|
|
|
|
|
2009-11-20 15:47:26 +00:00
|
|
|
|
(defvar bookmark-quit-flag nil
|
2019-05-26 10:48:26 +00:00
|
|
|
|
"Non-nil means `bookmark-bmenu-search' quits immediately.")
|
2019-07-01 17:56:00 +00:00
|
|
|
|
(make-obsolete-variable 'bookmark-quit-flag "no longer used" "27.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
|
|
|
|
|
2010-01-02 18:52:32 +00:00
|
|
|
|
;; Helper functions and macros.
|
|
|
|
|
|
|
|
|
|
(defmacro with-buffer-modified-unmodified (&rest body)
|
|
|
|
|
"Run BODY while preserving the buffer's `buffer-modified-p' state."
|
|
|
|
|
(let ((was-modified (make-symbol "was-modified")))
|
|
|
|
|
`(let ((,was-modified (buffer-modified-p)))
|
|
|
|
|
(unwind-protect
|
|
|
|
|
(progn ,@body)
|
|
|
|
|
(set-buffer-modified-p ,was-modified)))))
|
|
|
|
|
|
|
|
|
|
;; Only functions below, in this page and the next one (file formats),
|
|
|
|
|
;; need to know anything about the format of bookmark-alist entries.
|
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
|
|
|
|
;; Everyone else should go through them.
|
|
|
|
|
|
2010-12-12 16:53:24 +00:00
|
|
|
|
(defun bookmark-name-from-full-record (bookmark-record)
|
2019-05-26 10:48:26 +00:00
|
|
|
|
"Return the name of BOOKMARK-RECORD.
|
|
|
|
|
BOOKMARK-RECORD is, e.g., one element from `bookmark-alist'."
|
Adjust parameter names and doc strings to resolve confusion over
whether "bookmark" meant a bookmark name or a bookmark record.
Along the way, shorten one function's name for similar reasons.
(Issue #7548)
* lisp/bookmark.el
(bookmark-name-from-record):
New name for `bookmark-name-from-full-record'. All callers changed.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-default-annotation-text, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation,
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,
bookmark-get-handler, bookmark-edit-annotation, bookmark--jump-via,
bookmark-handle-bookmark, bookmark-location, bookmark-show-annotation):
Rename `bookmark' parameter to `bookmark-name-or-record', to
clearly show its role, and shorten or adjust doc strings accordingly.
(bookmark-set-name):
Same, and pass the parameter directly to `bookmark-get-bookmark'
instead of redundantly doing the callee's work.
(bookmark-default-annotation-text, bookmark-send-edited-annotation,
bookmark-relocate, bookmark-insert-location, bookmark-insert,
bookmark-delete):
Rename `bookmark' parameter to `bookmark-name', and in some cases
shorten doc string accordingly.
(bookmark-rename):
Change `old' and `new' parameters to `old-name'
and `new-name', and adjust an internal variable to avoid confusion.
(bookmark-jump, bookmark-jump-noselect):
Clarify `bookmark' parameter in doc string.
2010-12-08 08:09:27 +00:00
|
|
|
|
(car bookmark-record))
|
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
|
|
|
|
|
2022-02-15 22:39:02 +00:00
|
|
|
|
(defun bookmark-type-from-full-record (bookmark-record)
|
2022-11-17 02:34:28 +00:00
|
|
|
|
"Return the type of BOOKMARK-RECORD.
|
|
|
|
|
BOOKMARK-RECORD is, e.g., one element from `bookmark-alist'. Its
|
2022-02-15 22:39:02 +00:00
|
|
|
|
type is read from the symbol property named
|
|
|
|
|
`bookmark-handler-type' read on the record handler function."
|
|
|
|
|
(let ((handler (bookmark-get-handler bookmark-record)))
|
|
|
|
|
(when (autoloadp (symbol-function handler))
|
|
|
|
|
(autoload-do-load (symbol-function handler)))
|
|
|
|
|
(if (symbolp handler)
|
|
|
|
|
(get handler 'bookmark-handler-type)
|
|
|
|
|
"")))
|
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-all-names ()
|
|
|
|
|
"Return a list of all current bookmark names."
|
|
|
|
|
(bookmark-maybe-load-default-file)
|
2010-12-12 16:53:24 +00:00
|
|
|
|
(mapcar 'bookmark-name-from-full-record 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
|
|
|
|
|
|
|
|
|
|
Adjust parameter names and doc strings to resolve confusion over
whether "bookmark" meant a bookmark name or a bookmark record.
Along the way, shorten one function's name for similar reasons.
(Issue #7548)
* lisp/bookmark.el
(bookmark-name-from-record):
New name for `bookmark-name-from-full-record'. All callers changed.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-default-annotation-text, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation,
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,
bookmark-get-handler, bookmark-edit-annotation, bookmark--jump-via,
bookmark-handle-bookmark, bookmark-location, bookmark-show-annotation):
Rename `bookmark' parameter to `bookmark-name-or-record', to
clearly show its role, and shorten or adjust doc strings accordingly.
(bookmark-set-name):
Same, and pass the parameter directly to `bookmark-get-bookmark'
instead of redundantly doing the callee's work.
(bookmark-default-annotation-text, bookmark-send-edited-annotation,
bookmark-relocate, bookmark-insert-location, bookmark-insert,
bookmark-delete):
Rename `bookmark' parameter to `bookmark-name', and in some cases
shorten doc string accordingly.
(bookmark-rename):
Change `old' and `new' parameters to `old-name'
and `new-name', and adjust an internal variable to avoid confusion.
(bookmark-jump, bookmark-jump-noselect):
Clarify `bookmark' parameter in doc string.
2010-12-08 08:09:27 +00:00
|
|
|
|
(defun bookmark-get-bookmark (bookmark-name-or-record &optional noerror)
|
|
|
|
|
"Return the bookmark record corresponding to BOOKMARK-NAME-OR-RECORD.
|
|
|
|
|
If BOOKMARK-NAME-OR-RECORD is a string, look for the corresponding
|
|
|
|
|
bookmark record in `bookmark-alist'; return it if found, otherwise
|
2019-05-26 10:04:56 +00:00
|
|
|
|
error. If optional argument NOERROR is non-nil, return nil
|
|
|
|
|
instead of signaling an error. Else if BOOKMARK-NAME-OR-RECORD
|
|
|
|
|
is already a bookmark record, just return it."
|
2008-06-25 16:51:33 +00:00
|
|
|
|
(cond
|
Adjust parameter names and doc strings to resolve confusion over
whether "bookmark" meant a bookmark name or a bookmark record.
Along the way, shorten one function's name for similar reasons.
(Issue #7548)
* lisp/bookmark.el
(bookmark-name-from-record):
New name for `bookmark-name-from-full-record'. All callers changed.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-default-annotation-text, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation,
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,
bookmark-get-handler, bookmark-edit-annotation, bookmark--jump-via,
bookmark-handle-bookmark, bookmark-location, bookmark-show-annotation):
Rename `bookmark' parameter to `bookmark-name-or-record', to
clearly show its role, and shorten or adjust doc strings accordingly.
(bookmark-set-name):
Same, and pass the parameter directly to `bookmark-get-bookmark'
instead of redundantly doing the callee's work.
(bookmark-default-annotation-text, bookmark-send-edited-annotation,
bookmark-relocate, bookmark-insert-location, bookmark-insert,
bookmark-delete):
Rename `bookmark' parameter to `bookmark-name', and in some cases
shorten doc string accordingly.
(bookmark-rename):
Change `old' and `new' parameters to `old-name'
and `new-name', and adjust an internal variable to avoid confusion.
(bookmark-jump, bookmark-jump-noselect):
Clarify `bookmark' parameter in doc string.
2010-12-08 08:09:27 +00:00
|
|
|
|
((consp bookmark-name-or-record) bookmark-name-or-record)
|
|
|
|
|
((stringp bookmark-name-or-record)
|
|
|
|
|
(or (assoc-string bookmark-name-or-record bookmark-alist
|
|
|
|
|
bookmark-completion-ignore-case)
|
|
|
|
|
(unless noerror (error "Invalid bookmark %s"
|
|
|
|
|
bookmark-name-or-record))))))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun bookmark-get-bookmark-record (bookmark-name-or-record)
|
2019-05-26 10:48:26 +00:00
|
|
|
|
"Return the record portion of BOOKMARK-NAME-OR-RECORD in `bookmark-alist'.
|
|
|
|
|
In other words, return all information but the name."
|
Adjust parameter names and doc strings to resolve confusion over
whether "bookmark" meant a bookmark name or a bookmark record.
Along the way, shorten one function's name for similar reasons.
(Issue #7548)
* lisp/bookmark.el
(bookmark-name-from-record):
New name for `bookmark-name-from-full-record'. All callers changed.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-default-annotation-text, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation,
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,
bookmark-get-handler, bookmark-edit-annotation, bookmark--jump-via,
bookmark-handle-bookmark, bookmark-location, bookmark-show-annotation):
Rename `bookmark' parameter to `bookmark-name-or-record', to
clearly show its role, and shorten or adjust doc strings accordingly.
(bookmark-set-name):
Same, and pass the parameter directly to `bookmark-get-bookmark'
instead of redundantly doing the callee's work.
(bookmark-default-annotation-text, bookmark-send-edited-annotation,
bookmark-relocate, bookmark-insert-location, bookmark-insert,
bookmark-delete):
Rename `bookmark' parameter to `bookmark-name', and in some cases
shorten doc string accordingly.
(bookmark-rename):
Change `old' and `new' parameters to `old-name'
and `new-name', and adjust an internal variable to avoid confusion.
(bookmark-jump, bookmark-jump-noselect):
Clarify `bookmark' parameter in doc string.
2010-12-08 08:09:27 +00:00
|
|
|
|
(let ((alist (cdr (bookmark-get-bookmark bookmark-name-or-record))))
|
2008-06-25 16:51:33 +00:00
|
|
|
|
;; The bookmark objects can either look like (NAME ALIST) or
|
|
|
|
|
;; (NAME . ALIST), so we have to distinguish the two here.
|
|
|
|
|
(if (and (null (cdr alist)) (consp (caar alist)))
|
|
|
|
|
(car alist) 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
|
|
|
|
|
|
|
|
|
|
Adjust parameter names and doc strings to resolve confusion over
whether "bookmark" meant a bookmark name or a bookmark record.
Along the way, shorten one function's name for similar reasons.
(Issue #7548)
* lisp/bookmark.el
(bookmark-name-from-record):
New name for `bookmark-name-from-full-record'. All callers changed.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-default-annotation-text, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation,
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,
bookmark-get-handler, bookmark-edit-annotation, bookmark--jump-via,
bookmark-handle-bookmark, bookmark-location, bookmark-show-annotation):
Rename `bookmark' parameter to `bookmark-name-or-record', to
clearly show its role, and shorten or adjust doc strings accordingly.
(bookmark-set-name):
Same, and pass the parameter directly to `bookmark-get-bookmark'
instead of redundantly doing the callee's work.
(bookmark-default-annotation-text, bookmark-send-edited-annotation,
bookmark-relocate, bookmark-insert-location, bookmark-insert,
bookmark-delete):
Rename `bookmark' parameter to `bookmark-name', and in some cases
shorten doc string accordingly.
(bookmark-rename):
Change `old' and `new' parameters to `old-name'
and `new-name', and adjust an internal variable to avoid confusion.
(bookmark-jump, bookmark-jump-noselect):
Clarify `bookmark' parameter in doc string.
2010-12-08 08:09:27 +00:00
|
|
|
|
(defun bookmark-set-name (bookmark-name-or-record newname)
|
|
|
|
|
"Set BOOKMARK-NAME-OR-RECORD's name to NEWNAME."
|
|
|
|
|
(setcar (bookmark-get-bookmark bookmark-name-or-record) 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
|
|
|
|
|
Adjust parameter names and doc strings to resolve confusion over
whether "bookmark" meant a bookmark name or a bookmark record.
Along the way, shorten one function's name for similar reasons.
(Issue #7548)
* lisp/bookmark.el
(bookmark-name-from-record):
New name for `bookmark-name-from-full-record'. All callers changed.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-default-annotation-text, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation,
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,
bookmark-get-handler, bookmark-edit-annotation, bookmark--jump-via,
bookmark-handle-bookmark, bookmark-location, bookmark-show-annotation):
Rename `bookmark' parameter to `bookmark-name-or-record', to
clearly show its role, and shorten or adjust doc strings accordingly.
(bookmark-set-name):
Same, and pass the parameter directly to `bookmark-get-bookmark'
instead of redundantly doing the callee's work.
(bookmark-default-annotation-text, bookmark-send-edited-annotation,
bookmark-relocate, bookmark-insert-location, bookmark-insert,
bookmark-delete):
Rename `bookmark' parameter to `bookmark-name', and in some cases
shorten doc string accordingly.
(bookmark-rename):
Change `old' and `new' parameters to `old-name'
and `new-name', and adjust an internal variable to avoid confusion.
(bookmark-jump, bookmark-jump-noselect):
Clarify `bookmark' parameter in doc string.
2010-12-08 08:09:27 +00:00
|
|
|
|
(defun bookmark-prop-get (bookmark-name-or-record prop)
|
|
|
|
|
"Return the property PROP of BOOKMARK-NAME-OR-RECORD, or nil if none."
|
|
|
|
|
(cdr (assq prop (bookmark-get-bookmark-record bookmark-name-or-record))))
|
2008-03-08 22:07:23 +00:00
|
|
|
|
|
Adjust parameter names and doc strings to resolve confusion over
whether "bookmark" meant a bookmark name or a bookmark record.
Along the way, shorten one function's name for similar reasons.
(Issue #7548)
* lisp/bookmark.el
(bookmark-name-from-record):
New name for `bookmark-name-from-full-record'. All callers changed.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-default-annotation-text, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation,
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,
bookmark-get-handler, bookmark-edit-annotation, bookmark--jump-via,
bookmark-handle-bookmark, bookmark-location, bookmark-show-annotation):
Rename `bookmark' parameter to `bookmark-name-or-record', to
clearly show its role, and shorten or adjust doc strings accordingly.
(bookmark-set-name):
Same, and pass the parameter directly to `bookmark-get-bookmark'
instead of redundantly doing the callee's work.
(bookmark-default-annotation-text, bookmark-send-edited-annotation,
bookmark-relocate, bookmark-insert-location, bookmark-insert,
bookmark-delete):
Rename `bookmark' parameter to `bookmark-name', and in some cases
shorten doc string accordingly.
(bookmark-rename):
Change `old' and `new' parameters to `old-name'
and `new-name', and adjust an internal variable to avoid confusion.
(bookmark-jump, bookmark-jump-noselect):
Clarify `bookmark' parameter in doc string.
2010-12-08 08:09:27 +00:00
|
|
|
|
(defun bookmark-prop-set (bookmark-name-or-record prop val)
|
|
|
|
|
"Set the property PROP of BOOKMARK-NAME-OR-RECORD to VAL."
|
|
|
|
|
(let ((cell (assq
|
|
|
|
|
prop (bookmark-get-bookmark-record bookmark-name-or-record))))
|
2008-03-08 22:07:23 +00:00
|
|
|
|
(if cell
|
|
|
|
|
(setcdr cell val)
|
Adjust parameter names and doc strings to resolve confusion over
whether "bookmark" meant a bookmark name or a bookmark record.
Along the way, shorten one function's name for similar reasons.
(Issue #7548)
* lisp/bookmark.el
(bookmark-name-from-record):
New name for `bookmark-name-from-full-record'. All callers changed.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-default-annotation-text, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation,
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,
bookmark-get-handler, bookmark-edit-annotation, bookmark--jump-via,
bookmark-handle-bookmark, bookmark-location, bookmark-show-annotation):
Rename `bookmark' parameter to `bookmark-name-or-record', to
clearly show its role, and shorten or adjust doc strings accordingly.
(bookmark-set-name):
Same, and pass the parameter directly to `bookmark-get-bookmark'
instead of redundantly doing the callee's work.
(bookmark-default-annotation-text, bookmark-send-edited-annotation,
bookmark-relocate, bookmark-insert-location, bookmark-insert,
bookmark-delete):
Rename `bookmark' parameter to `bookmark-name', and in some cases
shorten doc string accordingly.
(bookmark-rename):
Change `old' and `new' parameters to `old-name'
and `new-name', and adjust an internal variable to avoid confusion.
(bookmark-jump, bookmark-jump-noselect):
Clarify `bookmark' parameter in doc string.
2010-12-08 08:09:27 +00:00
|
|
|
|
(nconc (bookmark-get-bookmark-record bookmark-name-or-record)
|
2008-03-08 22:07:23 +00:00
|
|
|
|
(list (cons prop val))))))
|
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
|
|
|
|
|
Adjust parameter names and doc strings to resolve confusion over
whether "bookmark" meant a bookmark name or a bookmark record.
Along the way, shorten one function's name for similar reasons.
(Issue #7548)
* lisp/bookmark.el
(bookmark-name-from-record):
New name for `bookmark-name-from-full-record'. All callers changed.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-default-annotation-text, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation,
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,
bookmark-get-handler, bookmark-edit-annotation, bookmark--jump-via,
bookmark-handle-bookmark, bookmark-location, bookmark-show-annotation):
Rename `bookmark' parameter to `bookmark-name-or-record', to
clearly show its role, and shorten or adjust doc strings accordingly.
(bookmark-set-name):
Same, and pass the parameter directly to `bookmark-get-bookmark'
instead of redundantly doing the callee's work.
(bookmark-default-annotation-text, bookmark-send-edited-annotation,
bookmark-relocate, bookmark-insert-location, bookmark-insert,
bookmark-delete):
Rename `bookmark' parameter to `bookmark-name', and in some cases
shorten doc string accordingly.
(bookmark-rename):
Change `old' and `new' parameters to `old-name'
and `new-name', and adjust an internal variable to avoid confusion.
(bookmark-jump, bookmark-jump-noselect):
Clarify `bookmark' parameter in doc string.
2010-12-08 08:09:27 +00:00
|
|
|
|
(defun bookmark-get-annotation (bookmark-name-or-record)
|
|
|
|
|
"Return the annotation of BOOKMARK-NAME-OR-RECORD, or nil if none."
|
|
|
|
|
(bookmark-prop-get bookmark-name-or-record '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
|
|
|
|
|
Adjust parameter names and doc strings to resolve confusion over
whether "bookmark" meant a bookmark name or a bookmark record.
Along the way, shorten one function's name for similar reasons.
(Issue #7548)
* lisp/bookmark.el
(bookmark-name-from-record):
New name for `bookmark-name-from-full-record'. All callers changed.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-default-annotation-text, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation,
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,
bookmark-get-handler, bookmark-edit-annotation, bookmark--jump-via,
bookmark-handle-bookmark, bookmark-location, bookmark-show-annotation):
Rename `bookmark' parameter to `bookmark-name-or-record', to
clearly show its role, and shorten or adjust doc strings accordingly.
(bookmark-set-name):
Same, and pass the parameter directly to `bookmark-get-bookmark'
instead of redundantly doing the callee's work.
(bookmark-default-annotation-text, bookmark-send-edited-annotation,
bookmark-relocate, bookmark-insert-location, bookmark-insert,
bookmark-delete):
Rename `bookmark' parameter to `bookmark-name', and in some cases
shorten doc string accordingly.
(bookmark-rename):
Change `old' and `new' parameters to `old-name'
and `new-name', and adjust an internal variable to avoid confusion.
(bookmark-jump, bookmark-jump-noselect):
Clarify `bookmark' parameter in doc string.
2010-12-08 08:09:27 +00:00
|
|
|
|
(defun bookmark-set-annotation (bookmark-name-or-record ann)
|
|
|
|
|
"Set the annotation of BOOKMARK-NAME-OR-RECORD to ANN."
|
|
|
|
|
(bookmark-prop-set bookmark-name-or-record '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
|
|
|
|
|
|
|
|
|
|
Adjust parameter names and doc strings to resolve confusion over
whether "bookmark" meant a bookmark name or a bookmark record.
Along the way, shorten one function's name for similar reasons.
(Issue #7548)
* lisp/bookmark.el
(bookmark-name-from-record):
New name for `bookmark-name-from-full-record'. All callers changed.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-default-annotation-text, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation,
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,
bookmark-get-handler, bookmark-edit-annotation, bookmark--jump-via,
bookmark-handle-bookmark, bookmark-location, bookmark-show-annotation):
Rename `bookmark' parameter to `bookmark-name-or-record', to
clearly show its role, and shorten or adjust doc strings accordingly.
(bookmark-set-name):
Same, and pass the parameter directly to `bookmark-get-bookmark'
instead of redundantly doing the callee's work.
(bookmark-default-annotation-text, bookmark-send-edited-annotation,
bookmark-relocate, bookmark-insert-location, bookmark-insert,
bookmark-delete):
Rename `bookmark' parameter to `bookmark-name', and in some cases
shorten doc string accordingly.
(bookmark-rename):
Change `old' and `new' parameters to `old-name'
and `new-name', and adjust an internal variable to avoid confusion.
(bookmark-jump, bookmark-jump-noselect):
Clarify `bookmark' parameter in doc string.
2010-12-08 08:09:27 +00:00
|
|
|
|
(defun bookmark-get-filename (bookmark-name-or-record)
|
|
|
|
|
"Return the full filename of BOOKMARK-NAME-OR-RECORD, or nil if none."
|
|
|
|
|
(bookmark-prop-get bookmark-name-or-record 'filename))
|
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
|
|
|
|
|
|
|
|
|
|
Adjust parameter names and doc strings to resolve confusion over
whether "bookmark" meant a bookmark name or a bookmark record.
Along the way, shorten one function's name for similar reasons.
(Issue #7548)
* lisp/bookmark.el
(bookmark-name-from-record):
New name for `bookmark-name-from-full-record'. All callers changed.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-default-annotation-text, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation,
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,
bookmark-get-handler, bookmark-edit-annotation, bookmark--jump-via,
bookmark-handle-bookmark, bookmark-location, bookmark-show-annotation):
Rename `bookmark' parameter to `bookmark-name-or-record', to
clearly show its role, and shorten or adjust doc strings accordingly.
(bookmark-set-name):
Same, and pass the parameter directly to `bookmark-get-bookmark'
instead of redundantly doing the callee's work.
(bookmark-default-annotation-text, bookmark-send-edited-annotation,
bookmark-relocate, bookmark-insert-location, bookmark-insert,
bookmark-delete):
Rename `bookmark' parameter to `bookmark-name', and in some cases
shorten doc string accordingly.
(bookmark-rename):
Change `old' and `new' parameters to `old-name'
and `new-name', and adjust an internal variable to avoid confusion.
(bookmark-jump, bookmark-jump-noselect):
Clarify `bookmark' parameter in doc string.
2010-12-08 08:09:27 +00:00
|
|
|
|
(defun bookmark-set-filename (bookmark-name-or-record filename)
|
|
|
|
|
"Set the full filename of BOOKMARK-NAME-OR-RECORD to FILENAME."
|
|
|
|
|
(bookmark-prop-set bookmark-name-or-record 'filename filename))
|
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
|
|
|
|
|
|
|
|
|
|
Adjust parameter names and doc strings to resolve confusion over
whether "bookmark" meant a bookmark name or a bookmark record.
Along the way, shorten one function's name for similar reasons.
(Issue #7548)
* lisp/bookmark.el
(bookmark-name-from-record):
New name for `bookmark-name-from-full-record'. All callers changed.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-default-annotation-text, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation,
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,
bookmark-get-handler, bookmark-edit-annotation, bookmark--jump-via,
bookmark-handle-bookmark, bookmark-location, bookmark-show-annotation):
Rename `bookmark' parameter to `bookmark-name-or-record', to
clearly show its role, and shorten or adjust doc strings accordingly.
(bookmark-set-name):
Same, and pass the parameter directly to `bookmark-get-bookmark'
instead of redundantly doing the callee's work.
(bookmark-default-annotation-text, bookmark-send-edited-annotation,
bookmark-relocate, bookmark-insert-location, bookmark-insert,
bookmark-delete):
Rename `bookmark' parameter to `bookmark-name', and in some cases
shorten doc string accordingly.
(bookmark-rename):
Change `old' and `new' parameters to `old-name'
and `new-name', and adjust an internal variable to avoid confusion.
(bookmark-jump, bookmark-jump-noselect):
Clarify `bookmark' parameter in doc string.
2010-12-08 08:09:27 +00:00
|
|
|
|
(defun bookmark-get-position (bookmark-name-or-record)
|
|
|
|
|
"Return the position (i.e.: point) of BOOKMARK-NAME-OR-RECORD, or nil if none."
|
|
|
|
|
(bookmark-prop-get bookmark-name-or-record 'position))
|
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
|
|
|
|
|
|
|
|
|
|
Adjust parameter names and doc strings to resolve confusion over
whether "bookmark" meant a bookmark name or a bookmark record.
Along the way, shorten one function's name for similar reasons.
(Issue #7548)
* lisp/bookmark.el
(bookmark-name-from-record):
New name for `bookmark-name-from-full-record'. All callers changed.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-default-annotation-text, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation,
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,
bookmark-get-handler, bookmark-edit-annotation, bookmark--jump-via,
bookmark-handle-bookmark, bookmark-location, bookmark-show-annotation):
Rename `bookmark' parameter to `bookmark-name-or-record', to
clearly show its role, and shorten or adjust doc strings accordingly.
(bookmark-set-name):
Same, and pass the parameter directly to `bookmark-get-bookmark'
instead of redundantly doing the callee's work.
(bookmark-default-annotation-text, bookmark-send-edited-annotation,
bookmark-relocate, bookmark-insert-location, bookmark-insert,
bookmark-delete):
Rename `bookmark' parameter to `bookmark-name', and in some cases
shorten doc string accordingly.
(bookmark-rename):
Change `old' and `new' parameters to `old-name'
and `new-name', and adjust an internal variable to avoid confusion.
(bookmark-jump, bookmark-jump-noselect):
Clarify `bookmark' parameter in doc string.
2010-12-08 08:09:27 +00:00
|
|
|
|
(defun bookmark-set-position (bookmark-name-or-record position)
|
|
|
|
|
"Set the position (i.e.: point) of BOOKMARK-NAME-OR-RECORD to POSITION."
|
|
|
|
|
(bookmark-prop-set bookmark-name-or-record 'position position))
|
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
|
|
|
|
|
|
|
|
|
|
Adjust parameter names and doc strings to resolve confusion over
whether "bookmark" meant a bookmark name or a bookmark record.
Along the way, shorten one function's name for similar reasons.
(Issue #7548)
* lisp/bookmark.el
(bookmark-name-from-record):
New name for `bookmark-name-from-full-record'. All callers changed.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-default-annotation-text, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation,
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,
bookmark-get-handler, bookmark-edit-annotation, bookmark--jump-via,
bookmark-handle-bookmark, bookmark-location, bookmark-show-annotation):
Rename `bookmark' parameter to `bookmark-name-or-record', to
clearly show its role, and shorten or adjust doc strings accordingly.
(bookmark-set-name):
Same, and pass the parameter directly to `bookmark-get-bookmark'
instead of redundantly doing the callee's work.
(bookmark-default-annotation-text, bookmark-send-edited-annotation,
bookmark-relocate, bookmark-insert-location, bookmark-insert,
bookmark-delete):
Rename `bookmark' parameter to `bookmark-name', and in some cases
shorten doc string accordingly.
(bookmark-rename):
Change `old' and `new' parameters to `old-name'
and `new-name', and adjust an internal variable to avoid confusion.
(bookmark-jump, bookmark-jump-noselect):
Clarify `bookmark' parameter in doc string.
2010-12-08 08:09:27 +00:00
|
|
|
|
(defun bookmark-get-front-context-string (bookmark-name-or-record)
|
|
|
|
|
"Return the front-context-string of BOOKMARK-NAME-OR-RECORD, or nil if none."
|
|
|
|
|
(bookmark-prop-get bookmark-name-or-record 'front-context-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
|
|
|
|
|
|
|
|
|
|
Adjust parameter names and doc strings to resolve confusion over
whether "bookmark" meant a bookmark name or a bookmark record.
Along the way, shorten one function's name for similar reasons.
(Issue #7548)
* lisp/bookmark.el
(bookmark-name-from-record):
New name for `bookmark-name-from-full-record'. All callers changed.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-default-annotation-text, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation,
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,
bookmark-get-handler, bookmark-edit-annotation, bookmark--jump-via,
bookmark-handle-bookmark, bookmark-location, bookmark-show-annotation):
Rename `bookmark' parameter to `bookmark-name-or-record', to
clearly show its role, and shorten or adjust doc strings accordingly.
(bookmark-set-name):
Same, and pass the parameter directly to `bookmark-get-bookmark'
instead of redundantly doing the callee's work.
(bookmark-default-annotation-text, bookmark-send-edited-annotation,
bookmark-relocate, bookmark-insert-location, bookmark-insert,
bookmark-delete):
Rename `bookmark' parameter to `bookmark-name', and in some cases
shorten doc string accordingly.
(bookmark-rename):
Change `old' and `new' parameters to `old-name'
and `new-name', and adjust an internal variable to avoid confusion.
(bookmark-jump, bookmark-jump-noselect):
Clarify `bookmark' parameter in doc string.
2010-12-08 08:09:27 +00:00
|
|
|
|
(defun bookmark-set-front-context-string (bookmark-name-or-record string)
|
|
|
|
|
"Set the front-context-string of BOOKMARK-NAME-OR-RECORD to STRING."
|
|
|
|
|
(bookmark-prop-set bookmark-name-or-record 'front-context-string 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
|
|
|
|
|
|
|
|
|
|
Adjust parameter names and doc strings to resolve confusion over
whether "bookmark" meant a bookmark name or a bookmark record.
Along the way, shorten one function's name for similar reasons.
(Issue #7548)
* lisp/bookmark.el
(bookmark-name-from-record):
New name for `bookmark-name-from-full-record'. All callers changed.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-default-annotation-text, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation,
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,
bookmark-get-handler, bookmark-edit-annotation, bookmark--jump-via,
bookmark-handle-bookmark, bookmark-location, bookmark-show-annotation):
Rename `bookmark' parameter to `bookmark-name-or-record', to
clearly show its role, and shorten or adjust doc strings accordingly.
(bookmark-set-name):
Same, and pass the parameter directly to `bookmark-get-bookmark'
instead of redundantly doing the callee's work.
(bookmark-default-annotation-text, bookmark-send-edited-annotation,
bookmark-relocate, bookmark-insert-location, bookmark-insert,
bookmark-delete):
Rename `bookmark' parameter to `bookmark-name', and in some cases
shorten doc string accordingly.
(bookmark-rename):
Change `old' and `new' parameters to `old-name'
and `new-name', and adjust an internal variable to avoid confusion.
(bookmark-jump, bookmark-jump-noselect):
Clarify `bookmark' parameter in doc string.
2010-12-08 08:09:27 +00:00
|
|
|
|
(defun bookmark-get-rear-context-string (bookmark-name-or-record)
|
|
|
|
|
"Return the rear-context-string of BOOKMARK-NAME-OR-RECORD, or nil if none."
|
|
|
|
|
(bookmark-prop-get bookmark-name-or-record 'rear-context-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
|
|
|
|
|
|
|
|
|
|
Adjust parameter names and doc strings to resolve confusion over
whether "bookmark" meant a bookmark name or a bookmark record.
Along the way, shorten one function's name for similar reasons.
(Issue #7548)
* lisp/bookmark.el
(bookmark-name-from-record):
New name for `bookmark-name-from-full-record'. All callers changed.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-default-annotation-text, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation,
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,
bookmark-get-handler, bookmark-edit-annotation, bookmark--jump-via,
bookmark-handle-bookmark, bookmark-location, bookmark-show-annotation):
Rename `bookmark' parameter to `bookmark-name-or-record', to
clearly show its role, and shorten or adjust doc strings accordingly.
(bookmark-set-name):
Same, and pass the parameter directly to `bookmark-get-bookmark'
instead of redundantly doing the callee's work.
(bookmark-default-annotation-text, bookmark-send-edited-annotation,
bookmark-relocate, bookmark-insert-location, bookmark-insert,
bookmark-delete):
Rename `bookmark' parameter to `bookmark-name', and in some cases
shorten doc string accordingly.
(bookmark-rename):
Change `old' and `new' parameters to `old-name'
and `new-name', and adjust an internal variable to avoid confusion.
(bookmark-jump, bookmark-jump-noselect):
Clarify `bookmark' parameter in doc string.
2010-12-08 08:09:27 +00:00
|
|
|
|
(defun bookmark-set-rear-context-string (bookmark-name-or-record string)
|
|
|
|
|
"Set the rear-context-string of BOOKMARK-NAME-OR-RECORD to STRING."
|
|
|
|
|
(bookmark-prop-set bookmark-name-or-record 'rear-context-string 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
|
|
|
|
|
|
|
|
|
|
Adjust parameter names and doc strings to resolve confusion over
whether "bookmark" meant a bookmark name or a bookmark record.
Along the way, shorten one function's name for similar reasons.
(Issue #7548)
* lisp/bookmark.el
(bookmark-name-from-record):
New name for `bookmark-name-from-full-record'. All callers changed.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-default-annotation-text, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation,
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,
bookmark-get-handler, bookmark-edit-annotation, bookmark--jump-via,
bookmark-handle-bookmark, bookmark-location, bookmark-show-annotation):
Rename `bookmark' parameter to `bookmark-name-or-record', to
clearly show its role, and shorten or adjust doc strings accordingly.
(bookmark-set-name):
Same, and pass the parameter directly to `bookmark-get-bookmark'
instead of redundantly doing the callee's work.
(bookmark-default-annotation-text, bookmark-send-edited-annotation,
bookmark-relocate, bookmark-insert-location, bookmark-insert,
bookmark-delete):
Rename `bookmark' parameter to `bookmark-name', and in some cases
shorten doc string accordingly.
(bookmark-rename):
Change `old' and `new' parameters to `old-name'
and `new-name', and adjust an internal variable to avoid confusion.
(bookmark-jump, bookmark-jump-noselect):
Clarify `bookmark' parameter in doc string.
2010-12-08 08:09:27 +00:00
|
|
|
|
(defun bookmark-get-handler (bookmark-name-or-record)
|
|
|
|
|
"Return the handler function for BOOKMARK-NAME-OR-RECORD, or nil if none."
|
|
|
|
|
(bookmark-prop-get bookmark-name-or-record 'handler))
|
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
|
|
|
|
|
2022-06-08 11:51:41 +00:00
|
|
|
|
|
2022-05-31 18:35:39 +00:00
|
|
|
|
(defun bookmark-get-last-modified (bookmark-name-or-record)
|
|
|
|
|
"Return the last-modified for BOOKMARK-NAME-OR-RECORD, or nil if none."
|
|
|
|
|
(bookmark-prop-get bookmark-name-or-record 'last-modified))
|
|
|
|
|
|
2022-06-08 11:51:41 +00:00
|
|
|
|
|
|
|
|
|
(defun bookmark-update-last-modified (bookmark-name-or-record)
|
|
|
|
|
"Update the last-modified date of BOOKMARK-NAME-OR-RECORD to the current time."
|
|
|
|
|
(bookmark-prop-set bookmark-name-or-record 'last-modified (current-time)))
|
|
|
|
|
|
|
|
|
|
|
1995-03-13 22:50:35 +00:00
|
|
|
|
(defvar bookmark-history nil
|
|
|
|
|
"The history list for bookmark functions.")
|
|
|
|
|
|
2021-09-13 11:35:53 +00:00
|
|
|
|
(defun bookmark--set-fringe-mark ()
|
2021-05-04 08:58:52 +00:00
|
|
|
|
"Apply a colorized overlay to the bookmarked location.
|
2022-08-02 18:40:43 +00:00
|
|
|
|
See user option `bookmark-fringe-mark'."
|
2022-08-21 16:00:53 +00:00
|
|
|
|
(let ((bm (make-overlay (pos-bol) (1+ (pos-bol)))))
|
2021-05-04 08:58:52 +00:00
|
|
|
|
(overlay-put bm 'category 'bookmark)
|
2021-09-15 07:58:41 +00:00
|
|
|
|
(overlay-put bm 'evaporate t)
|
2021-09-13 11:35:53 +00:00
|
|
|
|
(overlay-put bm 'before-string
|
|
|
|
|
(propertize
|
|
|
|
|
"x" 'display
|
|
|
|
|
`(left-fringe bookmark-fringe-mark bookmark-face)))))
|
2021-05-04 08:58:52 +00:00
|
|
|
|
|
2021-09-13 11:35:53 +00:00
|
|
|
|
(defun bookmark--remove-fringe-mark (bm)
|
2021-05-04 08:58:52 +00:00
|
|
|
|
"Remove a bookmark's colorized overlay.
|
|
|
|
|
BM is a bookmark as returned from function `bookmark-get-bookmark'.
|
2022-08-02 18:40:43 +00:00
|
|
|
|
See user option `bookmark-fringe-mark'."
|
2021-07-05 13:09:45 +00:00
|
|
|
|
(let ((filename (cdr (assq 'filename bm)))
|
|
|
|
|
(pos (cdr (assq 'position bm)))
|
2023-11-10 10:15:30 +00:00
|
|
|
|
;; Don't expand file names for non-existing remote connections.
|
|
|
|
|
(non-essential t)
|
2021-05-04 09:36:56 +00:00
|
|
|
|
overlays found temp)
|
2021-07-05 13:09:45 +00:00
|
|
|
|
(when (and pos filename)
|
|
|
|
|
(setq filename (expand-file-name filename))
|
|
|
|
|
(dolist (buf (buffer-list))
|
|
|
|
|
(with-current-buffer buf
|
|
|
|
|
(when (equal filename buffer-file-name)
|
2021-11-15 18:20:30 +00:00
|
|
|
|
(setq overlays
|
|
|
|
|
(save-excursion
|
|
|
|
|
(goto-char pos)
|
2022-08-21 16:00:53 +00:00
|
|
|
|
(overlays-in (pos-bol) (1+ (pos-bol)))))
|
2021-07-05 13:09:45 +00:00
|
|
|
|
(while (and (not found) (setq temp (pop overlays)))
|
|
|
|
|
(when (eq 'bookmark (overlay-get temp 'category))
|
|
|
|
|
(delete-overlay (setq found temp))))))))))
|
1995-03-13 22:50:35 +00:00
|
|
|
|
|
2022-05-31 18:35:39 +00:00
|
|
|
|
(defun bookmark-maybe-sort-alist ()
|
|
|
|
|
"Return `bookmark-alist' for display.
|
|
|
|
|
If `bookmark-sort-flag' is T, then return a sorted by name copy of the alist.
|
|
|
|
|
If `bookmark-sort-flag' is LAST-MODIFIED, then return a sorted by last modified
|
|
|
|
|
copy of the alist. Otherwise, just return `bookmark-alist', which by default
|
|
|
|
|
is ordered from most recently created to least recently created bookmark."
|
|
|
|
|
(let ((copy (copy-alist bookmark-alist)))
|
|
|
|
|
(cond ((eq bookmark-sort-flag t)
|
|
|
|
|
(sort copy (lambda (x y) (string-lessp (car x) (car y)))))
|
|
|
|
|
((eq bookmark-sort-flag 'last-modified)
|
|
|
|
|
(sort copy (lambda (x y)
|
2022-06-01 15:32:28 +00:00
|
|
|
|
(let ((tx (bookmark-get-last-modified x))
|
|
|
|
|
(ty (bookmark-get-last-modified y)))
|
|
|
|
|
(cond ((null tx) nil)
|
|
|
|
|
((null ty) t)
|
|
|
|
|
(t (time-less-p ty tx)))))))
|
2022-05-31 18:35:39 +00:00
|
|
|
|
(t copy))))
|
|
|
|
|
|
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.
|
2013-04-19 05:11:16 +00:00
|
|
|
|
Optional arg DEFAULT is a string to return if the user input is empty.
|
|
|
|
|
If DEFAULT is nil then return empty string for empty input."
|
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) ; 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)
|
2009-11-08 23:01:45 +00:00
|
|
|
|
(bookmark-menu-popup-paned-menu t prompt
|
2022-05-31 18:35:39 +00:00
|
|
|
|
(mapcar 'bookmark-name-from-full-record
|
|
|
|
|
(bookmark-maybe-sort-alist)))
|
(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* ((completion-ignore-case bookmark-completion-ignore-case)
|
2021-10-05 01:34:08 +00:00
|
|
|
|
(default (unless (equal "" default) default)))
|
|
|
|
|
(completing-read (format-prompt prompt default)
|
2013-04-19 05:11:16 +00:00
|
|
|
|
(lambda (string pred action)
|
|
|
|
|
(if (eq action 'metadata)
|
|
|
|
|
'(metadata (category . bookmark))
|
|
|
|
|
(complete-with-action
|
|
|
|
|
action bookmark-alist string pred)))
|
|
|
|
|
nil 0 nil 'bookmark-history default))))
|
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.
|
2021-12-04 04:56:32 +00:00
|
|
|
|
We need this because sometimes bookmark functions are invoked
|
|
|
|
|
from other commands that pass in the bookmark name, so
|
|
|
|
|
`completing-read' never gets a chance to set `bookmark-history'."
|
2001-01-12 22:49:40 +00:00
|
|
|
|
`(or
|
2009-10-02 03:48:36 +00:00
|
|
|
|
(called-interactively-p 'interactive)
|
2001-01-12 22:49:40 +00:00
|
|
|
|
(setq bookmark-history (cons ,string bookmark-history))))
|
1995-03-13 22:50:35 +00:00
|
|
|
|
|
2008-06-25 16:51:33 +00:00
|
|
|
|
(defvar bookmark-make-record-function 'bookmark-make-record-default
|
2008-03-07 05:44:37 +00:00
|
|
|
|
"A function that should be called to create a bookmark record.
|
|
|
|
|
Modes may set this variable buffer-locally to enable bookmarking of
|
|
|
|
|
locations that should be treated specially, such as Info nodes,
|
|
|
|
|
news posts, images, pdf documents, etc.
|
2007-12-26 08:53:06 +00:00
|
|
|
|
|
2008-03-09 03:05:34 +00:00
|
|
|
|
The function will be called with no arguments.
|
2008-06-25 16:51:33 +00:00
|
|
|
|
It should signal a user error if it is unable to construct a record for
|
|
|
|
|
the current location.
|
2008-03-09 21:35:01 +00:00
|
|
|
|
|
|
|
|
|
The returned record should be a cons cell of the form (NAME . ALIST)
|
|
|
|
|
where ALIST is as described in `bookmark-alist' and may typically contain
|
2009-10-04 23:48:33 +00:00
|
|
|
|
a special cons (handler . HANDLER-FUNC) which specifies the handler function
|
|
|
|
|
that should be used instead of `bookmark-default-handler' to open this
|
|
|
|
|
bookmark. See the documentation for `bookmark-alist' for more.
|
2008-03-09 21:35:01 +00:00
|
|
|
|
|
|
|
|
|
NAME is a suggested name for the constructed bookmark. It can be nil
|
2008-06-25 16:51:33 +00:00
|
|
|
|
in which case a default heuristic will be used. The function can also
|
|
|
|
|
equivalently just return ALIST without NAME.")
|
2008-03-09 21:35:01 +00:00
|
|
|
|
|
2022-09-22 11:14:46 +00:00
|
|
|
|
(defcustom bookmark-inhibit-context-functions nil
|
|
|
|
|
"List of functions to call before making a bookmark record.
|
|
|
|
|
The functions take `buffer-file-name' as argument. If any of
|
|
|
|
|
these functions returns non-nil, the bookmark does not record
|
|
|
|
|
context strings from the current buffer."
|
|
|
|
|
:type 'hook
|
|
|
|
|
:version "29.1")
|
|
|
|
|
|
2008-03-09 21:35:01 +00:00
|
|
|
|
(defun bookmark-make-record ()
|
|
|
|
|
"Return a new bookmark record (NAME . ALIST) for the current location."
|
2022-09-19 07:42:28 +00:00
|
|
|
|
(let* ((bookmark-search-size
|
|
|
|
|
;; If we're in a buffer that's visiting an encrypted file,
|
|
|
|
|
;; don't include any context in the bookmark file, because
|
|
|
|
|
;; that would leak (possibly secret) data.
|
|
|
|
|
(if (and buffer-file-name
|
2022-09-23 14:07:07 +00:00
|
|
|
|
(run-hook-with-args-until-success
|
|
|
|
|
'bookmark-inhibit-context-functions buffer-file-name))
|
2022-09-19 07:42:28 +00:00
|
|
|
|
0
|
|
|
|
|
bookmark-search-size))
|
|
|
|
|
(record (funcall bookmark-make-record-function)))
|
2013-07-23 00:58:28 +00:00
|
|
|
|
;; Set up default name if the function does not provide one.
|
|
|
|
|
(unless (stringp (car record))
|
|
|
|
|
(if (car record) (push nil record))
|
|
|
|
|
(setcar record (or bookmark-current-bookmark (bookmark-buffer-name))))
|
2012-08-08 08:48:57 +00:00
|
|
|
|
;; Set up defaults.
|
|
|
|
|
(bookmark-prop-set
|
|
|
|
|
record 'defaults
|
|
|
|
|
(delq nil (delete-dups (append (bookmark-prop-get record 'defaults)
|
|
|
|
|
(list bookmark-current-bookmark
|
2013-07-23 00:58:28 +00:00
|
|
|
|
(car record)
|
|
|
|
|
(bookmark-buffer-name))))))
|
|
|
|
|
record))
|
2008-03-09 21:35:01 +00:00
|
|
|
|
|
|
|
|
|
(defun bookmark-store (name alist no-overwrite)
|
|
|
|
|
"Store the bookmark NAME with data ALIST.
|
|
|
|
|
If NO-OVERWRITE is non-nil and another bookmark of the same name already
|
|
|
|
|
exists in `bookmark-alist', record the new bookmark without throwing away the
|
|
|
|
|
old one."
|
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)))
|
2019-06-13 14:02:39 +00:00
|
|
|
|
(set-text-properties 0 (length stripped-name) nil stripped-name)
|
2008-11-21 19:29:16 +00:00
|
|
|
|
(if (and (not no-overwrite)
|
|
|
|
|
(bookmark-get-bookmark stripped-name 'noerror))
|
2021-07-25 07:37:36 +00:00
|
|
|
|
;; Already existing bookmark under that name and
|
|
|
|
|
;; no prefix arg means just overwrite old bookmark.
|
|
|
|
|
(let ((bm (bookmark-get-bookmark stripped-name)))
|
|
|
|
|
;; First clean up if previously location was fontified.
|
2022-08-02 18:40:43 +00:00
|
|
|
|
(when bookmark-fringe-mark
|
2021-09-13 11:35:53 +00:00
|
|
|
|
(bookmark--remove-fringe-mark bm))
|
2021-07-25 07:37:36 +00:00
|
|
|
|
;; Modify using the new (NAME . ALIST) format.
|
|
|
|
|
(setcdr bm alist))
|
2001-01-12 22:49:40 +00:00
|
|
|
|
|
2022-03-18 02:18:26 +00:00
|
|
|
|
;; Otherwise just put it onto the front of the list. Either the
|
|
|
|
|
;; bookmark doesn't exist already, or there is no prefix arg.
|
|
|
|
|
;; In either case, we want the new bookmark on the front of the
|
|
|
|
|
;; list, since the list is kept in reverse order of creation.
|
2008-06-25 16:51:33 +00:00
|
|
|
|
(push (cons stripped-name alist) 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)
|
2008-03-09 21:35:01 +00:00
|
|
|
|
(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
|
|
|
|
|
2008-03-09 21:35:01 +00:00
|
|
|
|
(setq bookmark-current-bookmark stripped-name)
|
|
|
|
|
(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
|
|
|
|
|
2010-07-14 15:57:54 +00:00
|
|
|
|
(defun bookmark-make-record-default (&optional no-file no-context posn)
|
2008-03-09 03:05:34 +00:00
|
|
|
|
"Return the record describing the location of a new bookmark.
|
2010-07-14 15:57:54 +00:00
|
|
|
|
Point should be at the buffer in which the bookmark is being set,
|
|
|
|
|
and normally should be at the position where the bookmark is desired,
|
|
|
|
|
but see the optional arguments for other possibilities.
|
|
|
|
|
|
|
|
|
|
If NO-FILE is non-nil, then only return the subset of the
|
|
|
|
|
record that pertains to the location within the buffer, leaving off
|
|
|
|
|
the part that records the filename.
|
|
|
|
|
|
|
|
|
|
If NO-CONTEXT is non-nil, do not include the front- and rear-context
|
|
|
|
|
strings in the record -- the position is enough.
|
|
|
|
|
|
|
|
|
|
If POSN is non-nil, record POSN as the point instead of `(point)'."
|
|
|
|
|
`(,@(unless no-file `((filename . ,(bookmark-buffer-file-name))))
|
|
|
|
|
,@(unless no-context `((front-context-string
|
|
|
|
|
. ,(if (>= (- (point-max) (point))
|
|
|
|
|
bookmark-search-size)
|
|
|
|
|
(buffer-substring-no-properties
|
|
|
|
|
(point)
|
|
|
|
|
(+ (point) bookmark-search-size))
|
|
|
|
|
nil))))
|
|
|
|
|
,@(unless no-context `((rear-context-string
|
|
|
|
|
. ,(if (>= (- (point) (point-min))
|
|
|
|
|
bookmark-search-size)
|
|
|
|
|
(buffer-substring-no-properties
|
|
|
|
|
(point)
|
|
|
|
|
(- (point) bookmark-search-size))
|
|
|
|
|
nil))))
|
2022-05-31 18:35:39 +00:00
|
|
|
|
(position . ,(or posn (point)))
|
|
|
|
|
(last-modified . ,(current-time))))
|
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
|
|
|
|
|
|
2009-10-25 02:07:45 +00:00
|
|
|
|
;; *IMPORTANT NOTICE* If you are thinking about modifying (redefining)
|
|
|
|
|
;; the bookmark file format -- please don't. The current format
|
|
|
|
|
;; should be extensible enough. If you feel the need to change it,
|
|
|
|
|
;; please discuss it with other Emacs developers first.
|
|
|
|
|
;;
|
|
|
|
|
;; The format of `bookmark-alist' has changed twice in its lifetime.
|
|
|
|
|
;; This comment describes the three formats, FIRST, SECOND, and
|
|
|
|
|
;; CURRENT.
|
|
|
|
|
;;
|
|
|
|
|
;; The FIRST format was used prior to Emacs 20:
|
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
|
|
|
|
;;
|
2009-10-25 02:07:45 +00:00
|
|
|
|
;; ((BOOKMARK-NAME (FILENAME
|
2008-04-05 18:01:52 +00:00
|
|
|
|
;; STRING-IN-FRONT
|
|
|
|
|
;; STRING-BEHIND
|
|
|
|
|
;; 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
|
|
|
|
;; ...)
|
|
|
|
|
;;
|
2009-10-25 02:07:45 +00:00
|
|
|
|
;; The SECOND format was introduced in Emacs 20:
|
|
|
|
|
;;
|
|
|
|
|
;; ((BOOKMARK-NAME ((filename . FILENAME)
|
|
|
|
|
;; (position . POS)
|
|
|
|
|
;; (front-context-string . STR-AFTER-POS)
|
|
|
|
|
;; (rear-context-string . STR-BEFORE-POS)
|
|
|
|
|
;; (annotation . ANNOTATION)
|
|
|
|
|
;; (whatever . VALUE)
|
|
|
|
|
;; ...
|
|
|
|
|
;; ))
|
|
|
|
|
;; ...)
|
|
|
|
|
;;
|
|
|
|
|
;; The CURRENT format was introduced in Emacs 22:
|
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
|
|
|
|
;;
|
2008-04-05 18:01:52 +00:00
|
|
|
|
;; ((BOOKMARK-NAME (filename . FILENAME)
|
2009-10-25 02:07:45 +00:00
|
|
|
|
;; (position . POS)
|
|
|
|
|
;; (front-context-string . STR-AFTER-POS)
|
|
|
|
|
;; (rear-context-string . STR-BEFORE-POS)
|
2008-04-05 18:01:52 +00:00
|
|
|
|
;; (annotation . ANNOTATION)
|
|
|
|
|
;; (whatever . VALUE)
|
|
|
|
|
;; ...
|
2009-10-25 02:07:45 +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
|
|
|
|
;; ...)
|
|
|
|
|
;;
|
2009-10-25 02:07:45 +00:00
|
|
|
|
;; Both FIRST and SECOND have the same level of nesting: the cadr of a
|
|
|
|
|
;; bookmark record is a list of entry information. FIRST and SECOND
|
|
|
|
|
;; differ in the form of the record information: FIRST uses a list of
|
|
|
|
|
;; atoms, and SECOND uses an alist. In the FIRST format, the order of
|
|
|
|
|
;; the list elements matters. In the SECOND format, the order of the
|
|
|
|
|
;; alist elements is unimportant. The SECOND format facilitates the
|
|
|
|
|
;; addition of new kinds of elements, to support new kinds of
|
|
|
|
|
;; bookmarks or code evolution.
|
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
|
|
|
|
;;
|
2009-10-25 02:07:45 +00:00
|
|
|
|
;; The CURRENT format removes a level of nesting wrt FIRST and SECOND,
|
|
|
|
|
;; saving one cons cell per bookmark: the cadr of a bookmark record is
|
|
|
|
|
;; no longer a cons. Why that change was made remains a mystery --
|
|
|
|
|
;; just be aware of it. (Be aware too that this explanatory comment
|
|
|
|
|
;; was incorrect in Emacs 22 and Emacs 23.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
|
|
|
|
;;
|
2009-10-25 02:07:45 +00:00
|
|
|
|
;; To deal with the change from FIRST format to SECOND, conversion
|
2019-07-01 14:16:06 +00:00
|
|
|
|
;; code was added, which is no longer used and has been declared
|
|
|
|
|
;; obsolete. See `bookmark-maybe-upgrade-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
|
|
|
|
;;
|
2009-10-25 02:07:45 +00:00
|
|
|
|
;; No conversion from SECOND to CURRENT is done. Instead, the code
|
|
|
|
|
;; handles both formats OK. It must continue to do so.
|
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
|
|
|
|
;;
|
2009-10-25 02:07:45 +00:00
|
|
|
|
;; See the doc string of `bookmark-alist' for information about the
|
|
|
|
|
;; elements that define a bookmark (e.g. `filename').
|
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(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 ()
|
2019-07-01 14:16:06 +00:00
|
|
|
|
"Return a `bookmark-alist' 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))
|
2019-07-01 14:16:06 +00:00
|
|
|
|
(if buffer-file-name
|
|
|
|
|
(error "File not in bookmark format: %s" buffer-file-name)
|
|
|
|
|
(error "Buffer not in bookmark format: %s" (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
|
|
|
|
|
|
|
|
|
(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."
|
2019-07-01 14:16:06 +00:00
|
|
|
|
(declare (obsolete nil "27.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
|
|
|
|
(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."
|
2019-07-01 14:16:06 +00:00
|
|
|
|
(declare (obsolete nil "27.1"))
|
2019-07-01 17:10:36 +00:00
|
|
|
|
(let* ((reporter (make-progress-reporter
|
|
|
|
|
(format "Upgrading bookmark format from 0 to %d..."
|
2019-07-01 14:16:06 +00:00
|
|
|
|
bookmark-file-format-version)))
|
2019-07-01 17:10:36 +00:00
|
|
|
|
(old-list (bookmark-alist-from-buffer))
|
2019-07-01 14:16:06 +00:00
|
|
|
|
(new-list (with-suppressed-warnings
|
|
|
|
|
((obsolete bookmark-upgrade-version-0-alist))
|
|
|
|
|
(bookmark-upgrade-version-0-alist old-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
|
|
|
|
(delete-region (point-min) (point-max))
|
2017-01-07 12:33:41 +00:00
|
|
|
|
(bookmark-insert-file-format-version-stamp buffer-file-coding-system)
|
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
|
|
|
|
(pp new-list (current-buffer))
|
2019-07-01 17:10:36 +00:00
|
|
|
|
(save-buffer)
|
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
(progress-reporter-done reporter)))
|
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-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."
|
2019-07-01 14:16:06 +00:00
|
|
|
|
(declare (obsolete nil "27.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 (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."
|
2019-07-01 14:16:06 +00:00
|
|
|
|
(declare (obsolete nil "27.1"))
|
|
|
|
|
(let ((version
|
|
|
|
|
(with-suppressed-warnings
|
|
|
|
|
((obsolete bookmark-grok-file-format-version))
|
|
|
|
|
(bookmark-grok-file-format-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
|
|
|
|
(cond
|
|
|
|
|
((= version bookmark-file-format-version)
|
|
|
|
|
) ; home free -- version is current
|
|
|
|
|
((= version 0)
|
2019-07-01 14:16:06 +00:00
|
|
|
|
(with-suppressed-warnings
|
|
|
|
|
((obsolete bookmark-upgrade-file-format-from-0))
|
|
|
|
|
(bookmark-upgrade-file-format-from-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
|
|
|
|
(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
|
|
|
|
|
|
|
|
|
|
2017-01-07 12:33:41 +00:00
|
|
|
|
(defun bookmark-insert-file-format-version-stamp (coding)
|
|
|
|
|
"Insert text indicating current version of bookmark file format.
|
|
|
|
|
CODING is the symbol of the coding-system in which the file is encoded."
|
|
|
|
|
(if (memq (coding-system-base coding) '(undecided prefer-utf-8))
|
|
|
|
|
(setq coding 'utf-8-emacs))
|
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
|
2020-04-18 01:46:04 +00:00
|
|
|
|
(format
|
|
|
|
|
";;;; Emacs Bookmark Format Version %d\
|
2020-05-01 13:44:56 +00:00
|
|
|
|
;;;; -*- coding: %S; mode: lisp-data -*-\n"
|
2020-04-18 01:46:04 +00:00
|
|
|
|
bookmark-file-format-version (coding-system-base coding)))
|
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 ";;; 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:
|
|
|
|
|
|
2019-06-09 23:38:31 +00:00
|
|
|
|
(define-obsolete-function-alias 'bookmark-maybe-message 'message "27.1")
|
|
|
|
|
|
2021-11-17 04:49:05 +00:00
|
|
|
|
(defvar-keymap bookmark-minibuffer-read-name-map
|
|
|
|
|
:parent minibuffer-local-map
|
2021-11-17 06:04:22 +00:00
|
|
|
|
"C-w" #'bookmark-yank-word)
|
2008-03-09 21:01:54 +00:00
|
|
|
|
|
2015-11-08 19:16:43 +00:00
|
|
|
|
(defun bookmark-set-internal (prompt name overwrite-or-push)
|
2019-07-02 05:09:13 +00:00
|
|
|
|
"Set a bookmark using specified NAME or prompting with PROMPT.
|
|
|
|
|
The bookmark is set at the current location.
|
|
|
|
|
|
|
|
|
|
If NAME is non-nil, use it as the name of the new bookmark. In
|
|
|
|
|
this case, the value of PROMPT is ignored.
|
|
|
|
|
|
|
|
|
|
Otherwise, prompt the user for the bookmark name. Begin the
|
|
|
|
|
interactive prompt with PROMPT, followed by a space, a generated
|
|
|
|
|
default name in parentheses, a colon and a space.
|
|
|
|
|
|
|
|
|
|
OVERWRITE-OR-PUSH controls what happens if there is already a
|
|
|
|
|
bookmark with the same name: nil means signal an error;
|
|
|
|
|
`overwrite' means replace any existing bookmark; `push' means
|
|
|
|
|
push the new bookmark onto the bookmark alist. The `push'
|
|
|
|
|
behavior means that among bookmarks with the same name, this most
|
|
|
|
|
recently set one becomes the one in effect, but the others are
|
|
|
|
|
still there, in order, if the topmost one is ever deleted."
|
2010-07-14 16:41:40 +00:00
|
|
|
|
(unwind-protect
|
|
|
|
|
(let* ((record (bookmark-make-record))
|
2012-08-08 08:48:57 +00:00
|
|
|
|
;; `defaults' is a transient element of the
|
|
|
|
|
;; extensible format described above in the section
|
|
|
|
|
;; `File format stuff'. Bookmark record functions
|
|
|
|
|
;; can use it to specify a list of default values
|
|
|
|
|
;; accessible via M-n while reading a bookmark name.
|
|
|
|
|
(defaults (bookmark-prop-get record 'defaults))
|
|
|
|
|
(default (if (consp defaults) (car defaults) defaults)))
|
|
|
|
|
|
|
|
|
|
(if defaults
|
|
|
|
|
;; Don't store default values in the record.
|
|
|
|
|
(setq record (assq-delete-all 'defaults record))
|
|
|
|
|
;; When no defaults in the record, use its first element.
|
|
|
|
|
(setq defaults (car record) default defaults))
|
2010-07-14 16:41:40 +00:00
|
|
|
|
|
|
|
|
|
(bookmark-maybe-load-default-file)
|
|
|
|
|
;; Don't set `bookmark-yank-point' and `bookmark-current-buffer'
|
|
|
|
|
;; if they have been already set in another buffer. (e.g gnus-art).
|
|
|
|
|
(unless (and bookmark-yank-point
|
|
|
|
|
bookmark-current-buffer)
|
|
|
|
|
(setq bookmark-yank-point (point))
|
|
|
|
|
(setq bookmark-current-buffer (current-buffer)))
|
|
|
|
|
|
|
|
|
|
(let ((str
|
|
|
|
|
(or name
|
|
|
|
|
(read-from-minibuffer
|
Use `format-prompt' when prompting with default values
* lisp/woman.el (woman-file-name):
* lisp/wid-edit.el (widget-file-prompt-value)
(widget-coding-system-prompt-value):
* lisp/w32-fns.el (w32-set-system-coding-system):
* lisp/vc/vc.el (vc-print-root-log):
* lisp/vc/vc-annotate.el (vc-annotate):
* lisp/vc/emerge.el (emerge-read-file-name):
* lisp/vc/ediff.el (ediff-directories)
(ediff-directory-revisions, ediff-directories3)
(ediff-merge-directories, )
(ediff-merge-directories-with-ancestor)
(ediff-merge-directory-revisions)
(ediff-merge-directory-revisions-with-ancestor)
(ediff-merge-revisions, ediff-merge-revisions-with-ancestor)
(ediff-revision):
* lisp/vc/ediff-util.el (ediff-toggle-regexp-match):
* lisp/vc/ediff-mult.el (ediff-filegroup-action):
* lisp/vc/add-log.el (prompt-for-change-log-name):
* lisp/textmodes/table.el (table-insert-row-column)
(table-span-cell, table-split-cell-horizontally)
(table-split-cell, table-justify, table-generate-source)
(table-insert-sequence, table-capture)
(table--read-from-minibuffer, table--query-justification):
* lisp/textmodes/sgml-mode.el (sgml-tag, sgml-tag-help):
* lisp/textmodes/reftex-ref.el (reftex-goto-label):
* lisp/textmodes/refer.el (refer-get-bib-files):
* lisp/textmodes/css-mode.el (css-lookup-symbol):
* lisp/term.el (serial-read-name, serial-read-speed):
* lisp/speedbar.el (speedbar-change-initial-expansion-list):
* lisp/simple.el (previous-matching-history-element)
(set-variable):
* lisp/ses.el (ses-read-cell, ses-set-column-width):
* lisp/replace.el (query-replace-read-from)
(occur-read-primary-args):
* lisp/rect.el (string-rectangle, string-insert-rectangle):
* lisp/progmodes/tcl.el (tcl-help-on-word):
* lisp/progmodes/sh-script.el (sh-set-shell):
* lisp/progmodes/python.el (python-eldoc-at-point):
* lisp/progmodes/octave.el (octave-completing-read)
(octave-update-function-file-comment, octave-insert-defun):
* lisp/progmodes/inf-lisp.el (lisp-symprompt):
* lisp/progmodes/cperl-mode.el (cperl-info-on-command)
(cperl-perldoc):
* lisp/progmodes/compile.el (compilation-find-file):
* lisp/net/rcirc.el (rcirc-prompt-for-encryption):
* lisp/net/eww.el (eww):
* lisp/net/browse-url.el (browse-url-with-browser-kind):
* lisp/man.el (man):
* lisp/mail/sendmail.el (sendmail-query-user-about-smtp):
* lisp/mail/mailalias.el (build-mail-aliases):
* lisp/mail/mailabbrev.el (merge-mail-abbrevs)
(rebuild-mail-abbrevs):
* lisp/locate.el (locate-prompt-for-search-string):
* lisp/isearch.el (isearch-occur):
* lisp/international/ogonek.el (ogonek-read-encoding)
(ogonek-read-prefix):
* lisp/international/mule.el (read-buffer-file-coding-system)
(set-terminal-coding-system, set-keyboard-coding-system)
(set-next-selection-coding-system, recode-region):
* lisp/international/mule-cmds.el ()
(universal-coding-system-argument, search-unencodable-char)
(select-safe-coding-system-interactively):
* lisp/info.el (Info-search, Info-search-backward, Info-menu):
* lisp/info-look.el (info-lookup-interactive-arguments):
* lisp/imenu.el (imenu--completion-buffer):
* lisp/ibuf-ext.el (mode, used-mode, ibuffer-mark-by-mode):
* lisp/hi-lock.el (hi-lock-unface-buffer)
(hi-lock-read-face-name):
* lisp/help.el (view-emacs-news, where-is):
* lisp/help-fns.el (describe-variable, describe-symbol)
(describe-keymap):
* lisp/gnus/mm-decode.el (mm-save-part):
* lisp/gnus/gnus-sum.el (gnus-summary-browse-url):
* lisp/gnus/gnus-group.el (gnus-group--read-bug-ids)
(gnus-group-set-current-level):
* lisp/frame.el (make-frame-on-monitor)
(close-display-connection, select-frame-by-name):
* lisp/format.el (format-encode-buffer, format-encode-region):
* lisp/files.el (recode-file-name):
* lisp/files-x.el (read-file-local-variable)
(read-file-local-variable-value, )
(read-file-local-variable-mode):
* lisp/ffap.el (ffap-menu-ask):
* lisp/faces.el (face-read-string):
* lisp/facemenu.el (facemenu-set-charset):
* lisp/erc/erc-dcc.el (erc-dcc-do-GET-command):
* lisp/emulation/edt-mapper.el (edt-mapper):
* lisp/emacs-lisp/trace.el (trace--read-args)
(trace-function-foreground, trace-function-background):
* lisp/emacs-lisp/smie.el (smie-config-set-indent):
* lisp/emacs-lisp/re-builder.el (reb-change-syntax):
* lisp/emacs-lisp/package.el (describe-package):
* lisp/emacs-lisp/find-func.el (read-library-name)
(find-function-read):
* lisp/emacs-lisp/ert.el (ert-read-test-name)
(ert-run-tests-interactively):
* lisp/emacs-lisp/disass.el (disassemble):
* lisp/emacs-lisp/debug.el (debug-on-entry)
(debug-on-variable-change):
* lisp/emacs-lisp/advice.el (ad-read-advised-function)
(ad-read-advice-class, ad-read-advice-name, ad-read-regexp):
* lisp/dired-x.el (dired--mark-suffix-interactive-spec):
* lisp/dired-aux.el (dired-diff):
* lisp/cus-edit.el (custom-variable-prompt, customize-mode)
(customize-changed-options):
* lisp/completion.el (interactive-completion-string-reader):
* lisp/calendar/timeclock.el (timeclock-ask-for-project):
* lisp/calc/calcalg3.el (calc-get-fit-variables):
* lisp/calc/calc-store.el (calc-edit-variable):
* lisp/calc/calc-bin.el (calc-word-size):
* lisp/bookmark.el (bookmark-set-internal):
* lisp/abbrev.el (read-abbrev-file): Use `format-prompt' for
prompting (bug#12443).
2020-09-06 14:56:44 +00:00
|
|
|
|
(format-prompt prompt default)
|
2010-07-14 16:41:40 +00:00
|
|
|
|
nil
|
|
|
|
|
bookmark-minibuffer-read-name-map
|
2012-08-08 08:48:57 +00:00
|
|
|
|
nil nil defaults))))
|
2010-07-14 16:41:40 +00:00
|
|
|
|
(and (string-equal str "") (setq str default))
|
2015-11-08 19:16:43 +00:00
|
|
|
|
|
|
|
|
|
(cond
|
|
|
|
|
((eq overwrite-or-push nil)
|
|
|
|
|
(if (bookmark-get-bookmark str t)
|
2019-05-26 10:48:26 +00:00
|
|
|
|
(error "A bookmark named \"%s\" already exists" str)
|
2015-11-08 19:16:43 +00:00
|
|
|
|
(bookmark-store str (cdr record) nil)))
|
|
|
|
|
((eq overwrite-or-push 'overwrite)
|
|
|
|
|
(bookmark-store str (cdr record) nil))
|
|
|
|
|
((eq overwrite-or-push 'push)
|
|
|
|
|
(bookmark-store str (cdr record) t))
|
|
|
|
|
(t
|
|
|
|
|
(error "Unrecognized value for `overwrite-or-push': %S"
|
|
|
|
|
overwrite-or-push)))
|
2010-07-14 16:41:40 +00:00
|
|
|
|
|
|
|
|
|
;; Ask for an annotation buffer for this bookmark
|
|
|
|
|
(when bookmark-use-annotations
|
2021-05-04 08:58:52 +00:00
|
|
|
|
(bookmark-edit-annotation str))
|
2022-08-02 18:40:43 +00:00
|
|
|
|
(when bookmark-fringe-mark
|
2021-09-13 11:35:53 +00:00
|
|
|
|
(bookmark--set-fringe-mark))))
|
2010-07-14 16:41:40 +00:00
|
|
|
|
(setq bookmark-yank-point nil)
|
|
|
|
|
(setq bookmark-current-buffer 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
|
|
|
|
|
2015-11-10 04:14:49 +00:00
|
|
|
|
;;;###autoload
|
2015-11-08 19:16:43 +00:00
|
|
|
|
(defun bookmark-set (&optional name no-overwrite)
|
|
|
|
|
"Set a bookmark named NAME at the current location.
|
|
|
|
|
If NAME is nil, then prompt the user.
|
|
|
|
|
|
|
|
|
|
With a prefix arg (non-nil NO-OVERWRITE), do not overwrite any
|
|
|
|
|
existing bookmark that has the same name as NAME, but instead push the
|
|
|
|
|
new bookmark onto the bookmark alist. The most recently set bookmark
|
|
|
|
|
with name NAME is thus the one in effect at any given time, but the
|
|
|
|
|
others are still there, should the user decide to delete the most
|
|
|
|
|
recent one.
|
|
|
|
|
|
|
|
|
|
To yank words from the text of the buffer and use them as part of the
|
2021-09-22 18:26:40 +00:00
|
|
|
|
bookmark name, type \\<bookmark-minibuffer-read-name-map>\
|
|
|
|
|
\\[bookmark-yank-word] while setting a bookmark. Successive \
|
|
|
|
|
\\[bookmark-yank-word]'s
|
2015-11-08 19:16:43 +00:00
|
|
|
|
yank successive words.
|
|
|
|
|
|
Docfix: use command substitution for 'universal-argument'
* lisp/autoarg.el (autoarg-mode):
* lisp/bookmark.el (bookmark-set, bookmark-set-no-overwrite)
(bookmark-save):
* lisp/calendar/todo-mode.el (todo-insert-item)
(todo-filter-top-priorities)
(todo-filter-top-priorities-multifile):
* lisp/dired-x.el (dired-mark-extension, dired-mark-suffix):
* lisp/eshell/eshell.el (eshell):
* lisp/gnus/gnus-group.el (gnus-group-find-new-groups):
* lisp/gnus/gnus-start.el (gnus-find-new-newsgroups):
* lisp/gnus/gnus-sum.el (gnus-summary-show-article):
* lisp/gnus/gnus.el (gnus-secondary-servers):
* lisp/org/org-timer.el (org-timer-set-timer):
* lisp/org/ox.el (org-export-dispatch-last-position):
* lisp/printing.el (pr-ps-directory-preview)
(pr-ps-directory-using-ghostscript, pr-ps-directory-print)
(pr-ps-directory-ps-print, pr-ps-buffer-preview)
(pr-ps-buffer-using-ghostscript, pr-ps-buffer-print)
(pr-ps-buffer-ps-print, pr-despool-preview)
(pr-despool-using-ghostscript, pr-despool-print)
(pr-despool-ps-print, pr-ps-file-up-ps-print, pr-ps-fast-fire)
(pr-txt-fast-fire):
* lisp/progmodes/idlwave.el (idlwave-complete):
* lisp/progmodes/sh-script.el (sh-set-shell):
* lisp/replace.el (occur):
* lisp/ses.el (ses--advice-yank):
* lisp/simple.el (set-mark-command-repeat-pop):
* lisp/sort.el (delete-duplicate-lines):
* lisp/strokes.el (strokes-help):
* lisp/textmodes/artist.el (artist-mode):
* lisp/textmodes/reftex-cite.el (reftex-citation):
* lisp/textmodes/reftex-dcr.el (reftex-view-crossref):
* lisp/textmodes/reftex-index.el (reftex-index-selection-or-word)
(reftex-display-index):
* lisp/textmodes/reftex-ref.el (reftex-reference):
* lisp/textmodes/reftex-toc.el (reftex-toc):
* lisp/textmodes/reftex-vars.el (reftex-cite-prompt-optional-args)
(reftex-enable-partial-scans):
* lisp/textmodes/texnfo-upd.el (texinfo-master-menu):
* lisp/windmove.el (windmove-display-in-direction)
(windmove-delete-left, windmove-delete-up)
(windmove-delete-right, windmove-delete-down):
* lisp/window.el (recenter-window-group, recenter-other-window): Use
command substitution for 'universal-argument' instead of raw "C-u".
2021-09-16 18:05:48 +00:00
|
|
|
|
Typing \\[universal-argument] inserts (at the bookmark name prompt) the name of the last
|
2015-11-08 19:16:43 +00:00
|
|
|
|
bookmark used in the document where the new bookmark is being set;
|
|
|
|
|
this helps you use a single bookmark name to track progress through a
|
|
|
|
|
large document. If there is no prior bookmark for this document, then
|
Docfix: use command substitution for 'universal-argument'
* lisp/autoarg.el (autoarg-mode):
* lisp/bookmark.el (bookmark-set, bookmark-set-no-overwrite)
(bookmark-save):
* lisp/calendar/todo-mode.el (todo-insert-item)
(todo-filter-top-priorities)
(todo-filter-top-priorities-multifile):
* lisp/dired-x.el (dired-mark-extension, dired-mark-suffix):
* lisp/eshell/eshell.el (eshell):
* lisp/gnus/gnus-group.el (gnus-group-find-new-groups):
* lisp/gnus/gnus-start.el (gnus-find-new-newsgroups):
* lisp/gnus/gnus-sum.el (gnus-summary-show-article):
* lisp/gnus/gnus.el (gnus-secondary-servers):
* lisp/org/org-timer.el (org-timer-set-timer):
* lisp/org/ox.el (org-export-dispatch-last-position):
* lisp/printing.el (pr-ps-directory-preview)
(pr-ps-directory-using-ghostscript, pr-ps-directory-print)
(pr-ps-directory-ps-print, pr-ps-buffer-preview)
(pr-ps-buffer-using-ghostscript, pr-ps-buffer-print)
(pr-ps-buffer-ps-print, pr-despool-preview)
(pr-despool-using-ghostscript, pr-despool-print)
(pr-despool-ps-print, pr-ps-file-up-ps-print, pr-ps-fast-fire)
(pr-txt-fast-fire):
* lisp/progmodes/idlwave.el (idlwave-complete):
* lisp/progmodes/sh-script.el (sh-set-shell):
* lisp/replace.el (occur):
* lisp/ses.el (ses--advice-yank):
* lisp/simple.el (set-mark-command-repeat-pop):
* lisp/sort.el (delete-duplicate-lines):
* lisp/strokes.el (strokes-help):
* lisp/textmodes/artist.el (artist-mode):
* lisp/textmodes/reftex-cite.el (reftex-citation):
* lisp/textmodes/reftex-dcr.el (reftex-view-crossref):
* lisp/textmodes/reftex-index.el (reftex-index-selection-or-word)
(reftex-display-index):
* lisp/textmodes/reftex-ref.el (reftex-reference):
* lisp/textmodes/reftex-toc.el (reftex-toc):
* lisp/textmodes/reftex-vars.el (reftex-cite-prompt-optional-args)
(reftex-enable-partial-scans):
* lisp/textmodes/texnfo-upd.el (texinfo-master-menu):
* lisp/windmove.el (windmove-display-in-direction)
(windmove-delete-left, windmove-delete-up)
(windmove-delete-right, windmove-delete-down):
* lisp/window.el (recenter-window-group, recenter-other-window): Use
command substitution for 'universal-argument' instead of raw "C-u".
2021-09-16 18:05:48 +00:00
|
|
|
|
\\[universal-argument] inserts an appropriate name based on the buffer or file.
|
2015-11-08 19:16:43 +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.)"
|
|
|
|
|
(interactive (list nil current-prefix-arg))
|
|
|
|
|
(let ((prompt
|
2022-08-12 15:24:38 +00:00
|
|
|
|
(if no-overwrite "Add bookmark named" "Set bookmark named")))
|
2015-11-08 19:16:43 +00:00
|
|
|
|
(bookmark-set-internal prompt name (if no-overwrite 'push 'overwrite))))
|
|
|
|
|
|
2015-11-10 04:14:49 +00:00
|
|
|
|
;;;###autoload
|
2015-11-08 19:16:43 +00:00
|
|
|
|
(defun bookmark-set-no-overwrite (&optional name push-bookmark)
|
|
|
|
|
"Set a bookmark named NAME at the current location.
|
|
|
|
|
If NAME is nil, then prompt the user.
|
|
|
|
|
|
|
|
|
|
If a bookmark named NAME already exists and prefix argument
|
|
|
|
|
PUSH-BOOKMARK is non-nil, then push the new bookmark onto the
|
|
|
|
|
bookmark alist. Pushing it means that among bookmarks named
|
|
|
|
|
NAME, this one becomes the one in effect, but the others are
|
|
|
|
|
still there, in order, and become effective again if the user
|
|
|
|
|
ever deletes the most recent one.
|
|
|
|
|
|
|
|
|
|
Otherwise, if a bookmark named NAME already exists but PUSH-BOOKMARK
|
|
|
|
|
is nil, raise an error.
|
|
|
|
|
|
|
|
|
|
To yank words from the text of the buffer and use them as part of the
|
2021-09-22 18:26:40 +00:00
|
|
|
|
bookmark name, type \\<bookmark-minibuffer-read-name-map>\
|
|
|
|
|
\\[bookmark-yank-word] while setting a bookmark. Successive \
|
|
|
|
|
\\[bookmark-yank-word]'s
|
2015-11-08 19:16:43 +00:00
|
|
|
|
yank successive words.
|
|
|
|
|
|
Docfix: use command substitution for 'universal-argument'
* lisp/autoarg.el (autoarg-mode):
* lisp/bookmark.el (bookmark-set, bookmark-set-no-overwrite)
(bookmark-save):
* lisp/calendar/todo-mode.el (todo-insert-item)
(todo-filter-top-priorities)
(todo-filter-top-priorities-multifile):
* lisp/dired-x.el (dired-mark-extension, dired-mark-suffix):
* lisp/eshell/eshell.el (eshell):
* lisp/gnus/gnus-group.el (gnus-group-find-new-groups):
* lisp/gnus/gnus-start.el (gnus-find-new-newsgroups):
* lisp/gnus/gnus-sum.el (gnus-summary-show-article):
* lisp/gnus/gnus.el (gnus-secondary-servers):
* lisp/org/org-timer.el (org-timer-set-timer):
* lisp/org/ox.el (org-export-dispatch-last-position):
* lisp/printing.el (pr-ps-directory-preview)
(pr-ps-directory-using-ghostscript, pr-ps-directory-print)
(pr-ps-directory-ps-print, pr-ps-buffer-preview)
(pr-ps-buffer-using-ghostscript, pr-ps-buffer-print)
(pr-ps-buffer-ps-print, pr-despool-preview)
(pr-despool-using-ghostscript, pr-despool-print)
(pr-despool-ps-print, pr-ps-file-up-ps-print, pr-ps-fast-fire)
(pr-txt-fast-fire):
* lisp/progmodes/idlwave.el (idlwave-complete):
* lisp/progmodes/sh-script.el (sh-set-shell):
* lisp/replace.el (occur):
* lisp/ses.el (ses--advice-yank):
* lisp/simple.el (set-mark-command-repeat-pop):
* lisp/sort.el (delete-duplicate-lines):
* lisp/strokes.el (strokes-help):
* lisp/textmodes/artist.el (artist-mode):
* lisp/textmodes/reftex-cite.el (reftex-citation):
* lisp/textmodes/reftex-dcr.el (reftex-view-crossref):
* lisp/textmodes/reftex-index.el (reftex-index-selection-or-word)
(reftex-display-index):
* lisp/textmodes/reftex-ref.el (reftex-reference):
* lisp/textmodes/reftex-toc.el (reftex-toc):
* lisp/textmodes/reftex-vars.el (reftex-cite-prompt-optional-args)
(reftex-enable-partial-scans):
* lisp/textmodes/texnfo-upd.el (texinfo-master-menu):
* lisp/windmove.el (windmove-display-in-direction)
(windmove-delete-left, windmove-delete-up)
(windmove-delete-right, windmove-delete-down):
* lisp/window.el (recenter-window-group, recenter-other-window): Use
command substitution for 'universal-argument' instead of raw "C-u".
2021-09-16 18:05:48 +00:00
|
|
|
|
Typing \\[universal-argument] inserts (at the bookmark name prompt) the name of the last
|
2015-11-08 19:16:43 +00:00
|
|
|
|
bookmark used in the document where the new bookmark is being set;
|
|
|
|
|
this helps you use a single bookmark name to track progress through a
|
|
|
|
|
large document. If there is no prior bookmark for this document, then
|
Docfix: use command substitution for 'universal-argument'
* lisp/autoarg.el (autoarg-mode):
* lisp/bookmark.el (bookmark-set, bookmark-set-no-overwrite)
(bookmark-save):
* lisp/calendar/todo-mode.el (todo-insert-item)
(todo-filter-top-priorities)
(todo-filter-top-priorities-multifile):
* lisp/dired-x.el (dired-mark-extension, dired-mark-suffix):
* lisp/eshell/eshell.el (eshell):
* lisp/gnus/gnus-group.el (gnus-group-find-new-groups):
* lisp/gnus/gnus-start.el (gnus-find-new-newsgroups):
* lisp/gnus/gnus-sum.el (gnus-summary-show-article):
* lisp/gnus/gnus.el (gnus-secondary-servers):
* lisp/org/org-timer.el (org-timer-set-timer):
* lisp/org/ox.el (org-export-dispatch-last-position):
* lisp/printing.el (pr-ps-directory-preview)
(pr-ps-directory-using-ghostscript, pr-ps-directory-print)
(pr-ps-directory-ps-print, pr-ps-buffer-preview)
(pr-ps-buffer-using-ghostscript, pr-ps-buffer-print)
(pr-ps-buffer-ps-print, pr-despool-preview)
(pr-despool-using-ghostscript, pr-despool-print)
(pr-despool-ps-print, pr-ps-file-up-ps-print, pr-ps-fast-fire)
(pr-txt-fast-fire):
* lisp/progmodes/idlwave.el (idlwave-complete):
* lisp/progmodes/sh-script.el (sh-set-shell):
* lisp/replace.el (occur):
* lisp/ses.el (ses--advice-yank):
* lisp/simple.el (set-mark-command-repeat-pop):
* lisp/sort.el (delete-duplicate-lines):
* lisp/strokes.el (strokes-help):
* lisp/textmodes/artist.el (artist-mode):
* lisp/textmodes/reftex-cite.el (reftex-citation):
* lisp/textmodes/reftex-dcr.el (reftex-view-crossref):
* lisp/textmodes/reftex-index.el (reftex-index-selection-or-word)
(reftex-display-index):
* lisp/textmodes/reftex-ref.el (reftex-reference):
* lisp/textmodes/reftex-toc.el (reftex-toc):
* lisp/textmodes/reftex-vars.el (reftex-cite-prompt-optional-args)
(reftex-enable-partial-scans):
* lisp/textmodes/texnfo-upd.el (texinfo-master-menu):
* lisp/windmove.el (windmove-display-in-direction)
(windmove-delete-left, windmove-delete-up)
(windmove-delete-right, windmove-delete-down):
* lisp/window.el (recenter-window-group, recenter-other-window): Use
command substitution for 'universal-argument' instead of raw "C-u".
2021-09-16 18:05:48 +00:00
|
|
|
|
\\[universal-argument] inserts an appropriate name based on the buffer or file.
|
2015-11-08 19:16:43 +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.)"
|
|
|
|
|
(interactive (list nil current-prefix-arg))
|
|
|
|
|
(bookmark-set-internal "Set bookmark" name (if push-bookmark 'push 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-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."
|
2022-08-21 16:00:53 +00:00
|
|
|
|
(let ((eol (pos-eol)))
|
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
|
|
|
|
(delete-region (point) eol)
|
2017-02-12 14:46:03 +00:00
|
|
|
|
(when (and newline-too (= (following-char) ?\n))
|
|
|
|
|
(delete-char 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
|
|
|
|
|
Prefer defvar-local in remaining libraries
* lisp/align.el (align-mode-rules-list)
(align-mode-exclude-rules-list):
* lisp/bookmark.el (bookmark-current-bookmark)
(bookmark-annotation-name)
(bookmark--annotation-from-bookmark-list):
* lisp/calc/calc-embed.el (calc-embedded-all-active)
(calc-embedded-some-active):
* lisp/comint.el (comint-password-function):
* lisp/completion.el (completion-syntax-table):
* lisp/dframe.el (dframe-track-mouse-function)
(dframe-help-echo-function, dframe-mouse-click-function)
(dframe-mouse-position-function, dframe-timer)
(dframe-attached-frame, dframe-controlled):
* lisp/ehelp.el (electric-help-orig-major-mode):
* lisp/eshell/esh-util.el (eshell-path-env):
* lisp/expand.el (expand-pos, expand-index, expand-point):
* lisp/face-remap.el (text-scale-mode-remapping)
(text-scale-mode-lighter, text-scale-mode-amount)
(text-scale-remap-header-line, buffer-face-mode-remapping):
* lisp/ffap.el (ffap-menu-alist):
* lisp/files-x.el (connection-local-variables-alist):
* lisp/foldout.el (foldout-fold-list, foldout-mode-line-string):
* lisp/follow.el (follow-start-end-invalid):
* lisp/forms.el (forms--mode-setup):
* lisp/gnus/message.el (message-cross-post-old-target)
(message-options):
* lisp/help-mode.el (help-xref-stack, help-xref-forward-stack)
(help-xref-stack-item, help-xref-stack-forward-item):
* lisp/hexl.el (hexl-mode--old-var-vals, hexl-ascii-overlay):
* lisp/hilit-chg.el (hilit-chg-string):
* lisp/ido.el (ido-eoinput):
* lisp/imenu.el (imenu-generic-expression)
(imenu-create-index-function, imenu-default-goto-function)
(imenu-prev-index-position-function)
(imenu-extract-index-name-function, imenu-name-lookup-function)
(imenu-syntax-alist, imenu-case-fold-search):
* lisp/jka-compr.el (jka-compr-really-do-compress):
* lisp/language/ethio-util.el (ethio-prefer-ascii-space):
* lisp/leim/quail/hangul.el (hangul-input-method-help-text):
* lisp/leim/quail/japanese.el (quail-japanese-package-saved):
* lisp/linum.el (linum-overlays, linum-available):
* lisp/man.el (Man-original-frame, Man-arguments, Man--sections)
(Man--refpages, Man-page-list, Man-current-page)
(Man-page-mode-string):
* lisp/pcomplete.el (pcomplete-current-completions)
(pcomplete-last-completion-length)
(pcomplete-last-completion-stub, pcomplete-last-completion-raw)
(pcomplete-last-window-config, pcomplete-window-restore-timer):
* lisp/reveal.el (reveal-open-spots, reveal-last-tick):
* lisp/ruler-mode.el (ruler-mode):
* lisp/scroll-lock.el (scroll-lock-preserve-screen-pos-save):
* lisp/server.el (server-buffer-clients, server-existing-buffer):
* lisp/tab-line.el (tab-line-exclude):
* lisp/tar-mode.el (tar-data-buffer, tar-data-swapped):
* lisp/thumbs.el (thumbs-current-tmp-filename)
(thumbs-current-image-filename, thumbs-extra-images)
(thumbs-image-num, thumbs-buffer, thumbs-marked-list):
* lisp/tutorial.el (tutorial--point-before-chkeys)
(tutorial--point-after-chkeys, tutorial--lang):
* lisp/url/url-vars.el (url-current-object)
(url-current-mime-headers, url-current-lastloc):
* lisp/view.el (view-mode, view-old-buffer-read-only)
(view-old-Helper-return-blurb, view-page-size)
(view-half-page-size, view-last-regexp, view-return-to-alist)
(view-exit-action, view-overlay):
* lisp/wid-edit.el (widget-global-map, widget-field-new)
(widget-field-list, widget-field-last, widget-field-was):
* lisp/woman.el (woman-imenu-done): Prefer defvar-local.
2021-02-02 08:55:40 +00:00
|
|
|
|
(defvar-local bookmark-annotation-name nil
|
2019-07-02 01:06:37 +00:00
|
|
|
|
"Name of bookmark under edit 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
|
|
|
|
|
Prefer defvar-local in remaining libraries
* lisp/align.el (align-mode-rules-list)
(align-mode-exclude-rules-list):
* lisp/bookmark.el (bookmark-current-bookmark)
(bookmark-annotation-name)
(bookmark--annotation-from-bookmark-list):
* lisp/calc/calc-embed.el (calc-embedded-all-active)
(calc-embedded-some-active):
* lisp/comint.el (comint-password-function):
* lisp/completion.el (completion-syntax-table):
* lisp/dframe.el (dframe-track-mouse-function)
(dframe-help-echo-function, dframe-mouse-click-function)
(dframe-mouse-position-function, dframe-timer)
(dframe-attached-frame, dframe-controlled):
* lisp/ehelp.el (electric-help-orig-major-mode):
* lisp/eshell/esh-util.el (eshell-path-env):
* lisp/expand.el (expand-pos, expand-index, expand-point):
* lisp/face-remap.el (text-scale-mode-remapping)
(text-scale-mode-lighter, text-scale-mode-amount)
(text-scale-remap-header-line, buffer-face-mode-remapping):
* lisp/ffap.el (ffap-menu-alist):
* lisp/files-x.el (connection-local-variables-alist):
* lisp/foldout.el (foldout-fold-list, foldout-mode-line-string):
* lisp/follow.el (follow-start-end-invalid):
* lisp/forms.el (forms--mode-setup):
* lisp/gnus/message.el (message-cross-post-old-target)
(message-options):
* lisp/help-mode.el (help-xref-stack, help-xref-forward-stack)
(help-xref-stack-item, help-xref-stack-forward-item):
* lisp/hexl.el (hexl-mode--old-var-vals, hexl-ascii-overlay):
* lisp/hilit-chg.el (hilit-chg-string):
* lisp/ido.el (ido-eoinput):
* lisp/imenu.el (imenu-generic-expression)
(imenu-create-index-function, imenu-default-goto-function)
(imenu-prev-index-position-function)
(imenu-extract-index-name-function, imenu-name-lookup-function)
(imenu-syntax-alist, imenu-case-fold-search):
* lisp/jka-compr.el (jka-compr-really-do-compress):
* lisp/language/ethio-util.el (ethio-prefer-ascii-space):
* lisp/leim/quail/hangul.el (hangul-input-method-help-text):
* lisp/leim/quail/japanese.el (quail-japanese-package-saved):
* lisp/linum.el (linum-overlays, linum-available):
* lisp/man.el (Man-original-frame, Man-arguments, Man--sections)
(Man--refpages, Man-page-list, Man-current-page)
(Man-page-mode-string):
* lisp/pcomplete.el (pcomplete-current-completions)
(pcomplete-last-completion-length)
(pcomplete-last-completion-stub, pcomplete-last-completion-raw)
(pcomplete-last-window-config, pcomplete-window-restore-timer):
* lisp/reveal.el (reveal-open-spots, reveal-last-tick):
* lisp/ruler-mode.el (ruler-mode):
* lisp/scroll-lock.el (scroll-lock-preserve-screen-pos-save):
* lisp/server.el (server-buffer-clients, server-existing-buffer):
* lisp/tab-line.el (tab-line-exclude):
* lisp/tar-mode.el (tar-data-buffer, tar-data-swapped):
* lisp/thumbs.el (thumbs-current-tmp-filename)
(thumbs-current-image-filename, thumbs-extra-images)
(thumbs-image-num, thumbs-buffer, thumbs-marked-list):
* lisp/tutorial.el (tutorial--point-before-chkeys)
(tutorial--point-after-chkeys, tutorial--lang):
* lisp/url/url-vars.el (url-current-object)
(url-current-mime-headers, url-current-lastloc):
* lisp/view.el (view-mode, view-old-buffer-read-only)
(view-old-Helper-return-blurb, view-page-size)
(view-half-page-size, view-last-regexp, view-return-to-alist)
(view-exit-action, view-overlay):
* lisp/wid-edit.el (widget-global-map, widget-field-new)
(widget-field-list, widget-field-last, widget-field-was):
* lisp/woman.el (woman-imenu-done): Prefer defvar-local.
2021-02-02 08:55:40 +00:00
|
|
|
|
(defvar-local bookmark--annotation-from-bookmark-list nil
|
2019-07-02 01:06:37 +00:00
|
|
|
|
"If non-nil, `bookmark-edit-annotation-mode' should return to 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
|
|
|
|
|
Adjust parameter names and doc strings to resolve confusion over
whether "bookmark" meant a bookmark name or a bookmark record.
Along the way, shorten one function's name for similar reasons.
(Issue #7548)
* lisp/bookmark.el
(bookmark-name-from-record):
New name for `bookmark-name-from-full-record'. All callers changed.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-default-annotation-text, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation,
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,
bookmark-get-handler, bookmark-edit-annotation, bookmark--jump-via,
bookmark-handle-bookmark, bookmark-location, bookmark-show-annotation):
Rename `bookmark' parameter to `bookmark-name-or-record', to
clearly show its role, and shorten or adjust doc strings accordingly.
(bookmark-set-name):
Same, and pass the parameter directly to `bookmark-get-bookmark'
instead of redundantly doing the callee's work.
(bookmark-default-annotation-text, bookmark-send-edited-annotation,
bookmark-relocate, bookmark-insert-location, bookmark-insert,
bookmark-delete):
Rename `bookmark' parameter to `bookmark-name', and in some cases
shorten doc string accordingly.
(bookmark-rename):
Change `old' and `new' parameters to `old-name'
and `new-name', and adjust an internal variable to avoid confusion.
(bookmark-jump, bookmark-jump-noselect):
Clarify `bookmark' parameter in doc string.
2010-12-08 08:09:27 +00:00
|
|
|
|
(defun bookmark-default-annotation-text (bookmark-name)
|
|
|
|
|
"Return default annotation text for BOOKMARK-NAME.
|
* bookmark.el
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-set-name, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation, 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,
bookmark-location, bookmark-jump, bookmark-jump-other-window,
bookmark-handle-bookmark, bookmark-relocate, bookmark-insert-location,
bookmark-rename, bookmark-insert, bookmark-delete, bookmark-time-to-save-p,
bookmark-edit-annotation-mode, bookmark-edit-annotation): Improve doc
strings to say whether bookmark can be a string or a record or both,
and make other consistency and clarity fixes.
(bookmark-get-handler, bookmark--jump-via, bookmark-write-file,
bookmark-default-annotation-text, bookmark-yank-word,
bookmark-maybe-load-default-file, bookmark-maybe-sort-alist,
bookmark-import-new-list, bookmark-maybe-rename,
bookmark-bmenu-show-filenames, bookmark-bmenu-hide-filenames,
bookmark-bmenu-bookmark): Give these doc strings.
(bookmark-bmenu-check-position): Give this a doc string, but also
add a FIXME comment about how the function may be pointless.
(bookmark-default-handler): Rework doc string and change a parameter
name, to clarify that this takes a bookmark record not a bookmark name.
(bookmark-set): Change a parameter name to indicate its meaning,
and improve the doc string a bit.
(Bug#4188)
2009-10-05 01:35:34 +00:00
|
|
|
|
The default annotation text is simply some text explaining how to use
|
|
|
|
|
annotations."
|
Prefer directed to neutral quotes
Prefer directed to neutral quotes in docstings and diagnostics.
In docstrings, escape apostrophes that would otherwise be translated
to curved quotes using the newer, simpler rules.
* admin/unidata/unidata-gen.el (unidata-gen-table):
* lisp/align.el (align-region):
* lisp/allout.el (allout-mode, allout-solicit-alternate-bullet):
* lisp/bookmark.el (bookmark-default-annotation-text):
* lisp/calc/calc-aent.el (math-read-if, math-read-factor):
* lisp/calc/calc-lang.el (math-read-giac-subscr)
(math-read-math-subscr):
* lisp/calc/calc-misc.el (report-calc-bug):
* lisp/calc/calc-prog.el (calc-fix-token-name)
(calc-read-parse-table-part):
* lisp/cedet/ede/pmake.el (ede-proj-makefile-insert-dist-rules):
* lisp/cedet/semantic/complete.el (semantic-displayor-show-request):
* lisp/dabbrev.el (dabbrev-expand):
* lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine):
* lisp/emacs-lisp/elint.el (elint-get-top-forms):
* lisp/emacs-lisp/lisp-mnt.el (lm-verify):
* lisp/emulation/viper-cmd.el (viper-toggle-search-style):
* lisp/erc/erc-button.el (erc-nick-popup):
* lisp/erc/erc.el (erc-cmd-LOAD, erc-handle-login):
* lisp/eshell/em-dirs.el (eshell/cd):
* lisp/eshell/em-glob.el (eshell-glob-regexp):
* lisp/eshell/em-pred.el (eshell-parse-modifiers):
* lisp/eshell/esh-arg.el (eshell-parse-arguments):
* lisp/eshell/esh-opt.el (eshell-show-usage):
* lisp/files-x.el (modify-file-local-variable):
* lisp/filesets.el (filesets-add-buffer, filesets-remove-buffer)
(filesets-update-pre010505):
* lisp/find-cmd.el (find-generic, find-to-string):
* lisp/gnus/auth-source.el (auth-source-netrc-parse-entries):
* lisp/gnus/gnus-agent.el (gnus-agent-check-overview-buffer)
(gnus-agent-fetch-headers):
* lisp/gnus/gnus-int.el (gnus-start-news-server):
* lisp/gnus/gnus-registry.el:
(gnus-registry--split-fancy-with-parent-internal):
* lisp/gnus/gnus-score.el (gnus-summary-increase-score):
* lisp/gnus/gnus-start.el (gnus-convert-old-newsrc):
* lisp/gnus/gnus-topic.el (gnus-topic-rename):
* lisp/gnus/legacy-gnus-agent.el (gnus-agent-unlist-expire-days):
* lisp/gnus/nnmairix.el (nnmairix-widget-create-query):
* lisp/gnus/spam.el (spam-check-blackholes):
* lisp/mail/feedmail.el (feedmail-run-the-queue):
* lisp/mpc.el (mpc-playlist-rename):
* lisp/net/ange-ftp.el (ange-ftp-shell-command):
* lisp/net/mairix.el (mairix-widget-create-query):
* lisp/net/tramp-cache.el:
* lisp/obsolete/otodo-mode.el (todo-more-important-p):
* lisp/obsolete/pgg-gpg.el (pgg-gpg-process-region):
* lisp/obsolete/pgg-pgp.el (pgg-pgp-process-region):
* lisp/obsolete/pgg-pgp5.el (pgg-pgp5-process-region):
* lisp/org/ob-core.el (org-babel-goto-named-src-block)
(org-babel-goto-named-result):
* lisp/org/ob-fortran.el (org-babel-fortran-ensure-main-wrap):
* lisp/org/ob-ref.el (org-babel-ref-resolve):
* lisp/org/org-agenda.el (org-agenda-prepare):
* lisp/org/org-bibtex.el (org-bibtex-fields):
* lisp/org/org-clock.el (org-clock-notify-once-if-expired)
(org-clock-resolve):
* lisp/org/org-feed.el (org-feed-parse-atom-entry):
* lisp/org/org-habit.el (org-habit-parse-todo):
* lisp/org/org-mouse.el (org-mouse-popup-global-menu)
(org-mouse-context-menu):
* lisp/org/org-table.el (org-table-edit-formulas):
* lisp/org/ox.el (org-export-async-start):
* lisp/play/dunnet.el (dun-score, dun-help, dun-endgame-question)
(dun-rooms, dun-endgame-questions):
* lisp/progmodes/ada-mode.el (ada-goto-matching-start):
* lisp/progmodes/ada-xref.el (ada-find-executable):
* lisp/progmodes/antlr-mode.el (antlr-options-alists):
* lisp/progmodes/flymake.el (flymake-parse-err-lines)
(flymake-start-syntax-check-process):
* lisp/progmodes/python.el (python-define-auxiliary-skeleton):
* lisp/progmodes/sql.el (sql-comint):
* lisp/progmodes/verilog-mode.el (verilog-load-file-at-point):
* lisp/server.el (server-get-auth-key):
* lisp/subr.el (version-to-list):
* lisp/textmodes/reftex-ref.el (reftex-label):
* lisp/textmodes/reftex-toc.el (reftex-toc-rename-label):
* lisp/vc/ediff-diff.el (ediff-same-contents):
* lisp/vc/vc-cvs.el (vc-cvs-mode-line-string):
* test/automated/tramp-tests.el (tramp-test33-asynchronous-requests):
Use directed rather than neutral quotes in diagnostics.
2015-08-25 06:39:33 +00:00
|
|
|
|
(concat (format-message
|
Go back to grave quoting in source-code docstrings etc.
This reverts almost all my recent changes to use curved quotes
in docstrings and/or strings used for error diagnostics.
There are a few exceptions, e.g., Bahá’í proper names.
* admin/unidata/unidata-gen.el (unidata-gen-table):
* lisp/abbrev.el (expand-region-abbrevs):
* lisp/align.el (align-region):
* lisp/allout.el (allout-mode, allout-solicit-alternate-bullet)
(outlineify-sticky):
* lisp/apropos.el (apropos-library):
* lisp/bookmark.el (bookmark-default-annotation-text):
* lisp/button.el (button-category-symbol, button-put)
(make-text-button):
* lisp/calc/calc-aent.el (math-read-if, math-read-factor):
* lisp/calc/calc-embed.el (calc-do-embedded):
* lisp/calc/calc-ext.el (calc-user-function-list):
* lisp/calc/calc-graph.el (calc-graph-show-dumb):
* lisp/calc/calc-help.el (calc-describe-key)
(calc-describe-thing, calc-full-help):
* lisp/calc/calc-lang.el (calc-c-language)
(math-parse-fortran-vector-end, math-parse-tex-sum)
(math-parse-eqn-matrix, math-parse-eqn-prime)
(calc-yacas-language, calc-maxima-language, calc-giac-language)
(math-read-giac-subscr, math-read-math-subscr)
(math-read-big-rec, math-read-big-balance):
* lisp/calc/calc-misc.el (calc-help, report-calc-bug):
* lisp/calc/calc-mode.el (calc-auto-why, calc-save-modes)
(calc-auto-recompute):
* lisp/calc/calc-prog.el (calc-fix-token-name)
(calc-read-parse-table-part, calc-user-define-invocation)
(math-do-arg-check):
* lisp/calc/calc-store.el (calc-edit-variable):
* lisp/calc/calc-units.el (math-build-units-table-buffer):
* lisp/calc/calc-vec.el (math-read-brackets):
* lisp/calc/calc-yank.el (calc-edit-mode):
* lisp/calc/calc.el (calc, calc-do, calc-user-invocation):
* lisp/calendar/appt.el (appt-display-message):
* lisp/calendar/diary-lib.el (diary-check-diary-file)
(diary-mail-entries, diary-from-outlook):
* lisp/calendar/icalendar.el (icalendar-export-region)
(icalendar--convert-float-to-ical)
(icalendar--convert-date-to-ical)
(icalendar--convert-ical-to-diary)
(icalendar--convert-recurring-to-diary)
(icalendar--add-diary-entry):
* lisp/calendar/time-date.el (format-seconds):
* lisp/calendar/timeclock.el (timeclock-mode-line-display)
(timeclock-make-hours-explicit, timeclock-log-data):
* lisp/calendar/todo-mode.el (todo-prefix, todo-delete-category)
(todo-item-mark, todo-check-format)
(todo-insert-item--next-param, todo-edit-item--next-key)
(todo-mode):
* lisp/cedet/ede/pmake.el (ede-proj-makefile-insert-dist-rules):
* lisp/cedet/mode-local.el (describe-mode-local-overload)
(mode-local-print-binding, mode-local-describe-bindings-2):
* lisp/cedet/semantic/complete.el (semantic-displayor-show-request):
* lisp/cedet/srecode/srt-mode.el (srecode-macro-help):
* lisp/cus-start.el (standard):
* lisp/cus-theme.el (describe-theme-1):
* lisp/custom.el (custom-add-dependencies, custom-check-theme)
(custom--sort-vars-1, load-theme):
* lisp/descr-text.el (describe-text-properties-1, describe-char):
* lisp/dired-x.el (dired-do-run-mail):
* lisp/dired.el (dired-log):
* lisp/emacs-lisp/advice.el (ad-read-advised-function)
(ad-read-advice-class, ad-read-advice-name, ad-enable-advice)
(ad-disable-advice, ad-remove-advice, ad-set-argument)
(ad-set-arguments, ad--defalias-fset, ad-activate)
(ad-deactivate):
* lisp/emacs-lisp/byte-opt.el (byte-compile-inline-expand)
(byte-compile-unfold-lambda, byte-optimize-form-code-walker)
(byte-optimize-while, byte-optimize-apply):
* lisp/emacs-lisp/byte-run.el (defun, defsubst):
* lisp/emacs-lisp/bytecomp.el (byte-compile-lapcode)
(byte-compile-log-file, byte-compile-format-warn)
(byte-compile-nogroup-warn, byte-compile-arglist-warn)
(byte-compile-cl-warn)
(byte-compile-warn-about-unresolved-functions)
(byte-compile-file, byte-compile--declare-var)
(byte-compile-file-form-defmumble, byte-compile-form)
(byte-compile-normal-call, byte-compile-check-variable)
(byte-compile-variable-ref, byte-compile-variable-set)
(byte-compile-subr-wrong-args, byte-compile-setq-default)
(byte-compile-negation-optimizer)
(byte-compile-condition-case--old)
(byte-compile-condition-case--new, byte-compile-save-excursion)
(byte-compile-defvar, byte-compile-autoload)
(byte-compile-lambda-form)
(byte-compile-make-variable-buffer-local, display-call-tree)
(batch-byte-compile):
* lisp/emacs-lisp/cconv.el (cconv-convert, cconv--analyze-use):
* lisp/emacs-lisp/chart.el (chart-space-usage):
* lisp/emacs-lisp/check-declare.el (check-declare-scan)
(check-declare-warn, check-declare-file)
(check-declare-directory):
* lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine)
(checkdoc-message-text-engine):
* lisp/emacs-lisp/cl-extra.el (cl-parse-integer)
(cl--describe-class):
* lisp/emacs-lisp/cl-generic.el (cl-defgeneric)
(cl--generic-describe, cl-generic-generalizers):
* lisp/emacs-lisp/cl-macs.el (cl--parse-loop-clause, cl-tagbody)
(cl-symbol-macrolet):
* lisp/emacs-lisp/cl.el (cl-unload-function, flet):
* lisp/emacs-lisp/copyright.el (copyright)
(copyright-update-directory):
* lisp/emacs-lisp/edebug.el (edebug-read-list):
* lisp/emacs-lisp/eieio-base.el (eieio-persistent-read):
* lisp/emacs-lisp/eieio-core.el (eieio--slot-override)
(eieio-oref):
* lisp/emacs-lisp/eieio-opt.el (eieio-help-constructor):
* lisp/emacs-lisp/eieio-speedbar.el:
(eieio-speedbar-child-make-tag-lines)
(eieio-speedbar-child-description):
* lisp/emacs-lisp/eieio.el (defclass, change-class):
* lisp/emacs-lisp/elint.el (elint-file, elint-get-top-forms)
(elint-init-form, elint-check-defalias-form)
(elint-check-let-form):
* lisp/emacs-lisp/ert.el (ert-get-test, ert-results-mode-menu)
(ert-results-pop-to-backtrace-for-test-at-point)
(ert-results-pop-to-messages-for-test-at-point)
(ert-results-pop-to-should-forms-for-test-at-point)
(ert-describe-test):
* lisp/emacs-lisp/find-func.el (find-function-search-for-symbol)
(find-function-library):
* lisp/emacs-lisp/generator.el (iter-yield):
* lisp/emacs-lisp/gv.el (gv-define-simple-setter):
* lisp/emacs-lisp/lisp-mnt.el (lm-verify):
* lisp/emacs-lisp/macroexp.el (macroexp--obsolete-warning):
* lisp/emacs-lisp/map-ynp.el (map-y-or-n-p):
* lisp/emacs-lisp/nadvice.el (advice--make-docstring)
(advice--make, define-advice):
* lisp/emacs-lisp/package-x.el (package-upload-file):
* lisp/emacs-lisp/package.el (package-version-join)
(package-disabled-p, package-activate-1, package-activate)
(package--download-one-archive)
(package--download-and-read-archives)
(package-compute-transaction, package-install-from-archive)
(package-install, package-install-selected-packages)
(package-delete, package-autoremove, describe-package-1)
(package-install-button-action, package-delete-button-action)
(package-menu-hide-package, package-menu--list-to-prompt)
(package-menu--perform-transaction)
(package-menu--find-and-notify-upgrades):
* lisp/emacs-lisp/pcase.el (pcase-exhaustive, pcase--u1):
* lisp/emacs-lisp/re-builder.el (reb-enter-subexp-mode):
* lisp/emacs-lisp/ring.el (ring-previous, ring-next):
* lisp/emacs-lisp/rx.el (rx-check, rx-anything)
(rx-check-any-string, rx-check-any, rx-check-not, rx-=)
(rx-repeat, rx-check-backref, rx-syntax, rx-check-category)
(rx-form):
* lisp/emacs-lisp/smie.el (smie-config-save):
* lisp/emacs-lisp/subr-x.el (internal--check-binding):
* lisp/emacs-lisp/tabulated-list.el (tabulated-list-put-tag):
* lisp/emacs-lisp/testcover.el (testcover-1value):
* lisp/emacs-lisp/timer.el (timer-event-handler):
* lisp/emulation/viper-cmd.el (viper-toggle-parse-sexp-ignore-comments)
(viper-toggle-search-style, viper-kill-buffer)
(viper-brac-function):
* lisp/emulation/viper-macs.el (viper-record-kbd-macro):
* lisp/env.el (setenv):
* lisp/erc/erc-button.el (erc-nick-popup):
* lisp/erc/erc.el (erc-cmd-LOAD, erc-handle-login, english):
* lisp/eshell/em-dirs.el (eshell/cd):
* lisp/eshell/em-glob.el (eshell-glob-regexp)
(eshell-glob-entries):
* lisp/eshell/em-pred.el (eshell-parse-modifiers):
* lisp/eshell/esh-opt.el (eshell-show-usage):
* lisp/facemenu.el (facemenu-add-new-face)
(facemenu-add-new-color):
* lisp/faces.el (read-face-name, read-face-font, describe-face)
(x-resolve-font-name):
* lisp/files-x.el (modify-file-local-variable):
* lisp/files.el (locate-user-emacs-file, find-alternate-file)
(set-auto-mode, hack-one-local-variable--obsolete)
(dir-locals-set-directory-class, write-file, basic-save-buffer)
(delete-directory, copy-directory, recover-session)
(recover-session-finish, insert-directory)
(file-modes-char-to-who, file-modes-symbolic-to-number)
(move-file-to-trash):
* lisp/filesets.el (filesets-add-buffer, filesets-remove-buffer):
* lisp/find-cmd.el (find-generic, find-to-string):
* lisp/finder.el (finder-commentary):
* lisp/font-lock.el (font-lock-fontify-buffer):
* lisp/format.el (format-write-file, format-find-file)
(format-insert-file):
* lisp/frame.el (get-device-terminal, select-frame-by-name):
* lisp/fringe.el (fringe--check-style):
* lisp/gnus/nnmairix.el (nnmairix-widget-create-query):
* lisp/help-fns.el (help-fns--key-bindings)
(help-fns--compiler-macro, help-fns--parent-mode)
(help-fns--obsolete, help-fns--interactive-only)
(describe-function-1, describe-variable):
* lisp/help.el (describe-mode)
(describe-minor-mode-from-indicator):
* lisp/image.el (image-type):
* lisp/international/ccl.el (ccl-dump):
* lisp/international/fontset.el (x-must-resolve-font-name):
* lisp/international/mule-cmds.el (prefer-coding-system)
(select-safe-coding-system-interactively)
(select-safe-coding-system, activate-input-method)
(toggle-input-method, describe-current-input-method)
(describe-language-environment):
* lisp/international/mule-conf.el (code-offset):
* lisp/international/mule-diag.el (describe-character-set)
(list-input-methods-1):
* lisp/mail/feedmail.el (feedmail-run-the-queue):
* lisp/mouse.el (minor-mode-menu-from-indicator):
* lisp/mpc.el (mpc-playlist-rename):
* lisp/msb.el (msb--choose-menu):
* lisp/net/ange-ftp.el (ange-ftp-shell-command):
* lisp/net/imap.el (imap-interactive-login):
* lisp/net/mairix.el (mairix-widget-create-query):
* lisp/net/newst-backend.el (newsticker--sentinel-work):
* lisp/net/newst-treeview.el (newsticker--treeview-load):
* lisp/net/rlogin.el (rlogin):
* lisp/obsolete/iswitchb.el (iswitchb-possible-new-buffer):
* lisp/obsolete/otodo-mode.el (todo-more-important-p):
* lisp/obsolete/pgg-gpg.el (pgg-gpg-process-region):
* lisp/obsolete/pgg-pgp.el (pgg-pgp-process-region):
* lisp/obsolete/pgg-pgp5.el (pgg-pgp5-process-region):
* lisp/org/ob-core.el (org-babel-goto-named-src-block)
(org-babel-goto-named-result):
* lisp/org/ob-fortran.el (org-babel-fortran-ensure-main-wrap):
* lisp/org/ob-ref.el (org-babel-ref-resolve):
* lisp/org/org-agenda.el (org-agenda-prepare):
* lisp/org/org-clock.el (org-clock-notify-once-if-expired)
(org-clock-resolve):
* lisp/org/org-ctags.el (org-ctags-ask-rebuild-tags-file-then-find-tag):
* lisp/org/org-feed.el (org-feed-parse-atom-entry):
* lisp/org/org-habit.el (org-habit-parse-todo):
* lisp/org/org-mouse.el (org-mouse-popup-global-menu)
(org-mouse-context-menu):
* lisp/org/org-table.el (org-table-edit-formulas):
* lisp/org/ox.el (org-export-async-start):
* lisp/proced.el (proced-log):
* lisp/progmodes/ada-mode.el (ada-get-indent-case)
(ada-check-matching-start, ada-goto-matching-start):
* lisp/progmodes/ada-prj.el (ada-prj-display-page):
* lisp/progmodes/ada-xref.el (ada-find-executable):
* lisp/progmodes/ebrowse.el (ebrowse-tags-apropos):
* lisp/progmodes/etags.el (etags-tags-apropos-additional):
* lisp/progmodes/flymake.el (flymake-parse-err-lines)
(flymake-start-syntax-check-process):
* lisp/progmodes/python.el (python-shell-get-process-or-error)
(python-define-auxiliary-skeleton):
* lisp/progmodes/sql.el (sql-comint):
* lisp/progmodes/verilog-mode.el (verilog-load-file-at-point):
* lisp/progmodes/vhdl-mode.el (vhdl-widget-directory-validate):
* lisp/recentf.el (recentf-open-files):
* lisp/replace.el (query-replace-read-from)
(occur-after-change-function, occur-1):
* lisp/scroll-bar.el (scroll-bar-columns):
* lisp/server.el (server-get-auth-key):
* lisp/simple.el (execute-extended-command)
(undo-outer-limit-truncate, list-processes--refresh)
(compose-mail, set-variable, choose-completion-string)
(define-alternatives):
* lisp/startup.el (site-run-file, tty-handle-args, command-line)
(command-line-1):
* lisp/subr.el (noreturn, define-error, add-to-list)
(read-char-choice, version-to-list):
* lisp/term/common-win.el (x-handle-xrm-switch)
(x-handle-name-switch, x-handle-args):
* lisp/term/x-win.el (x-handle-parent-id, x-handle-smid):
* lisp/textmodes/reftex-ref.el (reftex-label):
* lisp/textmodes/reftex-toc.el (reftex-toc-rename-label):
* lisp/textmodes/two-column.el (2C-split):
* lisp/tutorial.el (tutorial--describe-nonstandard-key)
(tutorial--find-changed-keys):
* lisp/type-break.el (type-break-noninteractive-query):
* lisp/wdired.el (wdired-do-renames, wdired-do-symlink-changes)
(wdired-do-perm-changes):
* lisp/whitespace.el (whitespace-report-region):
Prefer grave quoting in source-code strings used to generate help
and diagnostics.
* lisp/faces.el (face-documentation):
No need to convert quotes, since the result is a docstring.
* lisp/info.el (Info-virtual-index-find-node)
(Info-virtual-index, info-apropos):
Simplify by generating only curved quotes, since info files are
typically that ways nowadays anyway.
* lisp/international/mule-diag.el (list-input-methods):
Don’t assume text quoting style is curved.
* lisp/org/org-bibtex.el (org-bibtex-fields):
Revert my recent changes, going back to the old quoting style.
2015-09-07 15:41:44 +00:00
|
|
|
|
"# Type the annotation for bookmark `%s' here.\n"
|
Prefer directed to neutral quotes
Prefer directed to neutral quotes in docstings and diagnostics.
In docstrings, escape apostrophes that would otherwise be translated
to curved quotes using the newer, simpler rules.
* admin/unidata/unidata-gen.el (unidata-gen-table):
* lisp/align.el (align-region):
* lisp/allout.el (allout-mode, allout-solicit-alternate-bullet):
* lisp/bookmark.el (bookmark-default-annotation-text):
* lisp/calc/calc-aent.el (math-read-if, math-read-factor):
* lisp/calc/calc-lang.el (math-read-giac-subscr)
(math-read-math-subscr):
* lisp/calc/calc-misc.el (report-calc-bug):
* lisp/calc/calc-prog.el (calc-fix-token-name)
(calc-read-parse-table-part):
* lisp/cedet/ede/pmake.el (ede-proj-makefile-insert-dist-rules):
* lisp/cedet/semantic/complete.el (semantic-displayor-show-request):
* lisp/dabbrev.el (dabbrev-expand):
* lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine):
* lisp/emacs-lisp/elint.el (elint-get-top-forms):
* lisp/emacs-lisp/lisp-mnt.el (lm-verify):
* lisp/emulation/viper-cmd.el (viper-toggle-search-style):
* lisp/erc/erc-button.el (erc-nick-popup):
* lisp/erc/erc.el (erc-cmd-LOAD, erc-handle-login):
* lisp/eshell/em-dirs.el (eshell/cd):
* lisp/eshell/em-glob.el (eshell-glob-regexp):
* lisp/eshell/em-pred.el (eshell-parse-modifiers):
* lisp/eshell/esh-arg.el (eshell-parse-arguments):
* lisp/eshell/esh-opt.el (eshell-show-usage):
* lisp/files-x.el (modify-file-local-variable):
* lisp/filesets.el (filesets-add-buffer, filesets-remove-buffer)
(filesets-update-pre010505):
* lisp/find-cmd.el (find-generic, find-to-string):
* lisp/gnus/auth-source.el (auth-source-netrc-parse-entries):
* lisp/gnus/gnus-agent.el (gnus-agent-check-overview-buffer)
(gnus-agent-fetch-headers):
* lisp/gnus/gnus-int.el (gnus-start-news-server):
* lisp/gnus/gnus-registry.el:
(gnus-registry--split-fancy-with-parent-internal):
* lisp/gnus/gnus-score.el (gnus-summary-increase-score):
* lisp/gnus/gnus-start.el (gnus-convert-old-newsrc):
* lisp/gnus/gnus-topic.el (gnus-topic-rename):
* lisp/gnus/legacy-gnus-agent.el (gnus-agent-unlist-expire-days):
* lisp/gnus/nnmairix.el (nnmairix-widget-create-query):
* lisp/gnus/spam.el (spam-check-blackholes):
* lisp/mail/feedmail.el (feedmail-run-the-queue):
* lisp/mpc.el (mpc-playlist-rename):
* lisp/net/ange-ftp.el (ange-ftp-shell-command):
* lisp/net/mairix.el (mairix-widget-create-query):
* lisp/net/tramp-cache.el:
* lisp/obsolete/otodo-mode.el (todo-more-important-p):
* lisp/obsolete/pgg-gpg.el (pgg-gpg-process-region):
* lisp/obsolete/pgg-pgp.el (pgg-pgp-process-region):
* lisp/obsolete/pgg-pgp5.el (pgg-pgp5-process-region):
* lisp/org/ob-core.el (org-babel-goto-named-src-block)
(org-babel-goto-named-result):
* lisp/org/ob-fortran.el (org-babel-fortran-ensure-main-wrap):
* lisp/org/ob-ref.el (org-babel-ref-resolve):
* lisp/org/org-agenda.el (org-agenda-prepare):
* lisp/org/org-bibtex.el (org-bibtex-fields):
* lisp/org/org-clock.el (org-clock-notify-once-if-expired)
(org-clock-resolve):
* lisp/org/org-feed.el (org-feed-parse-atom-entry):
* lisp/org/org-habit.el (org-habit-parse-todo):
* lisp/org/org-mouse.el (org-mouse-popup-global-menu)
(org-mouse-context-menu):
* lisp/org/org-table.el (org-table-edit-formulas):
* lisp/org/ox.el (org-export-async-start):
* lisp/play/dunnet.el (dun-score, dun-help, dun-endgame-question)
(dun-rooms, dun-endgame-questions):
* lisp/progmodes/ada-mode.el (ada-goto-matching-start):
* lisp/progmodes/ada-xref.el (ada-find-executable):
* lisp/progmodes/antlr-mode.el (antlr-options-alists):
* lisp/progmodes/flymake.el (flymake-parse-err-lines)
(flymake-start-syntax-check-process):
* lisp/progmodes/python.el (python-define-auxiliary-skeleton):
* lisp/progmodes/sql.el (sql-comint):
* lisp/progmodes/verilog-mode.el (verilog-load-file-at-point):
* lisp/server.el (server-get-auth-key):
* lisp/subr.el (version-to-list):
* lisp/textmodes/reftex-ref.el (reftex-label):
* lisp/textmodes/reftex-toc.el (reftex-toc-rename-label):
* lisp/vc/ediff-diff.el (ediff-same-contents):
* lisp/vc/vc-cvs.el (vc-cvs-mode-line-string):
* test/automated/tramp-tests.el (tramp-test33-asynchronous-requests):
Use directed rather than neutral quotes in diagnostics.
2015-08-25 06:39:33 +00:00
|
|
|
|
bookmark-name)
|
|
|
|
|
(format-message
|
Go back to grave quoting in source-code docstrings etc.
This reverts almost all my recent changes to use curved quotes
in docstrings and/or strings used for error diagnostics.
There are a few exceptions, e.g., Bahá’í proper names.
* admin/unidata/unidata-gen.el (unidata-gen-table):
* lisp/abbrev.el (expand-region-abbrevs):
* lisp/align.el (align-region):
* lisp/allout.el (allout-mode, allout-solicit-alternate-bullet)
(outlineify-sticky):
* lisp/apropos.el (apropos-library):
* lisp/bookmark.el (bookmark-default-annotation-text):
* lisp/button.el (button-category-symbol, button-put)
(make-text-button):
* lisp/calc/calc-aent.el (math-read-if, math-read-factor):
* lisp/calc/calc-embed.el (calc-do-embedded):
* lisp/calc/calc-ext.el (calc-user-function-list):
* lisp/calc/calc-graph.el (calc-graph-show-dumb):
* lisp/calc/calc-help.el (calc-describe-key)
(calc-describe-thing, calc-full-help):
* lisp/calc/calc-lang.el (calc-c-language)
(math-parse-fortran-vector-end, math-parse-tex-sum)
(math-parse-eqn-matrix, math-parse-eqn-prime)
(calc-yacas-language, calc-maxima-language, calc-giac-language)
(math-read-giac-subscr, math-read-math-subscr)
(math-read-big-rec, math-read-big-balance):
* lisp/calc/calc-misc.el (calc-help, report-calc-bug):
* lisp/calc/calc-mode.el (calc-auto-why, calc-save-modes)
(calc-auto-recompute):
* lisp/calc/calc-prog.el (calc-fix-token-name)
(calc-read-parse-table-part, calc-user-define-invocation)
(math-do-arg-check):
* lisp/calc/calc-store.el (calc-edit-variable):
* lisp/calc/calc-units.el (math-build-units-table-buffer):
* lisp/calc/calc-vec.el (math-read-brackets):
* lisp/calc/calc-yank.el (calc-edit-mode):
* lisp/calc/calc.el (calc, calc-do, calc-user-invocation):
* lisp/calendar/appt.el (appt-display-message):
* lisp/calendar/diary-lib.el (diary-check-diary-file)
(diary-mail-entries, diary-from-outlook):
* lisp/calendar/icalendar.el (icalendar-export-region)
(icalendar--convert-float-to-ical)
(icalendar--convert-date-to-ical)
(icalendar--convert-ical-to-diary)
(icalendar--convert-recurring-to-diary)
(icalendar--add-diary-entry):
* lisp/calendar/time-date.el (format-seconds):
* lisp/calendar/timeclock.el (timeclock-mode-line-display)
(timeclock-make-hours-explicit, timeclock-log-data):
* lisp/calendar/todo-mode.el (todo-prefix, todo-delete-category)
(todo-item-mark, todo-check-format)
(todo-insert-item--next-param, todo-edit-item--next-key)
(todo-mode):
* lisp/cedet/ede/pmake.el (ede-proj-makefile-insert-dist-rules):
* lisp/cedet/mode-local.el (describe-mode-local-overload)
(mode-local-print-binding, mode-local-describe-bindings-2):
* lisp/cedet/semantic/complete.el (semantic-displayor-show-request):
* lisp/cedet/srecode/srt-mode.el (srecode-macro-help):
* lisp/cus-start.el (standard):
* lisp/cus-theme.el (describe-theme-1):
* lisp/custom.el (custom-add-dependencies, custom-check-theme)
(custom--sort-vars-1, load-theme):
* lisp/descr-text.el (describe-text-properties-1, describe-char):
* lisp/dired-x.el (dired-do-run-mail):
* lisp/dired.el (dired-log):
* lisp/emacs-lisp/advice.el (ad-read-advised-function)
(ad-read-advice-class, ad-read-advice-name, ad-enable-advice)
(ad-disable-advice, ad-remove-advice, ad-set-argument)
(ad-set-arguments, ad--defalias-fset, ad-activate)
(ad-deactivate):
* lisp/emacs-lisp/byte-opt.el (byte-compile-inline-expand)
(byte-compile-unfold-lambda, byte-optimize-form-code-walker)
(byte-optimize-while, byte-optimize-apply):
* lisp/emacs-lisp/byte-run.el (defun, defsubst):
* lisp/emacs-lisp/bytecomp.el (byte-compile-lapcode)
(byte-compile-log-file, byte-compile-format-warn)
(byte-compile-nogroup-warn, byte-compile-arglist-warn)
(byte-compile-cl-warn)
(byte-compile-warn-about-unresolved-functions)
(byte-compile-file, byte-compile--declare-var)
(byte-compile-file-form-defmumble, byte-compile-form)
(byte-compile-normal-call, byte-compile-check-variable)
(byte-compile-variable-ref, byte-compile-variable-set)
(byte-compile-subr-wrong-args, byte-compile-setq-default)
(byte-compile-negation-optimizer)
(byte-compile-condition-case--old)
(byte-compile-condition-case--new, byte-compile-save-excursion)
(byte-compile-defvar, byte-compile-autoload)
(byte-compile-lambda-form)
(byte-compile-make-variable-buffer-local, display-call-tree)
(batch-byte-compile):
* lisp/emacs-lisp/cconv.el (cconv-convert, cconv--analyze-use):
* lisp/emacs-lisp/chart.el (chart-space-usage):
* lisp/emacs-lisp/check-declare.el (check-declare-scan)
(check-declare-warn, check-declare-file)
(check-declare-directory):
* lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine)
(checkdoc-message-text-engine):
* lisp/emacs-lisp/cl-extra.el (cl-parse-integer)
(cl--describe-class):
* lisp/emacs-lisp/cl-generic.el (cl-defgeneric)
(cl--generic-describe, cl-generic-generalizers):
* lisp/emacs-lisp/cl-macs.el (cl--parse-loop-clause, cl-tagbody)
(cl-symbol-macrolet):
* lisp/emacs-lisp/cl.el (cl-unload-function, flet):
* lisp/emacs-lisp/copyright.el (copyright)
(copyright-update-directory):
* lisp/emacs-lisp/edebug.el (edebug-read-list):
* lisp/emacs-lisp/eieio-base.el (eieio-persistent-read):
* lisp/emacs-lisp/eieio-core.el (eieio--slot-override)
(eieio-oref):
* lisp/emacs-lisp/eieio-opt.el (eieio-help-constructor):
* lisp/emacs-lisp/eieio-speedbar.el:
(eieio-speedbar-child-make-tag-lines)
(eieio-speedbar-child-description):
* lisp/emacs-lisp/eieio.el (defclass, change-class):
* lisp/emacs-lisp/elint.el (elint-file, elint-get-top-forms)
(elint-init-form, elint-check-defalias-form)
(elint-check-let-form):
* lisp/emacs-lisp/ert.el (ert-get-test, ert-results-mode-menu)
(ert-results-pop-to-backtrace-for-test-at-point)
(ert-results-pop-to-messages-for-test-at-point)
(ert-results-pop-to-should-forms-for-test-at-point)
(ert-describe-test):
* lisp/emacs-lisp/find-func.el (find-function-search-for-symbol)
(find-function-library):
* lisp/emacs-lisp/generator.el (iter-yield):
* lisp/emacs-lisp/gv.el (gv-define-simple-setter):
* lisp/emacs-lisp/lisp-mnt.el (lm-verify):
* lisp/emacs-lisp/macroexp.el (macroexp--obsolete-warning):
* lisp/emacs-lisp/map-ynp.el (map-y-or-n-p):
* lisp/emacs-lisp/nadvice.el (advice--make-docstring)
(advice--make, define-advice):
* lisp/emacs-lisp/package-x.el (package-upload-file):
* lisp/emacs-lisp/package.el (package-version-join)
(package-disabled-p, package-activate-1, package-activate)
(package--download-one-archive)
(package--download-and-read-archives)
(package-compute-transaction, package-install-from-archive)
(package-install, package-install-selected-packages)
(package-delete, package-autoremove, describe-package-1)
(package-install-button-action, package-delete-button-action)
(package-menu-hide-package, package-menu--list-to-prompt)
(package-menu--perform-transaction)
(package-menu--find-and-notify-upgrades):
* lisp/emacs-lisp/pcase.el (pcase-exhaustive, pcase--u1):
* lisp/emacs-lisp/re-builder.el (reb-enter-subexp-mode):
* lisp/emacs-lisp/ring.el (ring-previous, ring-next):
* lisp/emacs-lisp/rx.el (rx-check, rx-anything)
(rx-check-any-string, rx-check-any, rx-check-not, rx-=)
(rx-repeat, rx-check-backref, rx-syntax, rx-check-category)
(rx-form):
* lisp/emacs-lisp/smie.el (smie-config-save):
* lisp/emacs-lisp/subr-x.el (internal--check-binding):
* lisp/emacs-lisp/tabulated-list.el (tabulated-list-put-tag):
* lisp/emacs-lisp/testcover.el (testcover-1value):
* lisp/emacs-lisp/timer.el (timer-event-handler):
* lisp/emulation/viper-cmd.el (viper-toggle-parse-sexp-ignore-comments)
(viper-toggle-search-style, viper-kill-buffer)
(viper-brac-function):
* lisp/emulation/viper-macs.el (viper-record-kbd-macro):
* lisp/env.el (setenv):
* lisp/erc/erc-button.el (erc-nick-popup):
* lisp/erc/erc.el (erc-cmd-LOAD, erc-handle-login, english):
* lisp/eshell/em-dirs.el (eshell/cd):
* lisp/eshell/em-glob.el (eshell-glob-regexp)
(eshell-glob-entries):
* lisp/eshell/em-pred.el (eshell-parse-modifiers):
* lisp/eshell/esh-opt.el (eshell-show-usage):
* lisp/facemenu.el (facemenu-add-new-face)
(facemenu-add-new-color):
* lisp/faces.el (read-face-name, read-face-font, describe-face)
(x-resolve-font-name):
* lisp/files-x.el (modify-file-local-variable):
* lisp/files.el (locate-user-emacs-file, find-alternate-file)
(set-auto-mode, hack-one-local-variable--obsolete)
(dir-locals-set-directory-class, write-file, basic-save-buffer)
(delete-directory, copy-directory, recover-session)
(recover-session-finish, insert-directory)
(file-modes-char-to-who, file-modes-symbolic-to-number)
(move-file-to-trash):
* lisp/filesets.el (filesets-add-buffer, filesets-remove-buffer):
* lisp/find-cmd.el (find-generic, find-to-string):
* lisp/finder.el (finder-commentary):
* lisp/font-lock.el (font-lock-fontify-buffer):
* lisp/format.el (format-write-file, format-find-file)
(format-insert-file):
* lisp/frame.el (get-device-terminal, select-frame-by-name):
* lisp/fringe.el (fringe--check-style):
* lisp/gnus/nnmairix.el (nnmairix-widget-create-query):
* lisp/help-fns.el (help-fns--key-bindings)
(help-fns--compiler-macro, help-fns--parent-mode)
(help-fns--obsolete, help-fns--interactive-only)
(describe-function-1, describe-variable):
* lisp/help.el (describe-mode)
(describe-minor-mode-from-indicator):
* lisp/image.el (image-type):
* lisp/international/ccl.el (ccl-dump):
* lisp/international/fontset.el (x-must-resolve-font-name):
* lisp/international/mule-cmds.el (prefer-coding-system)
(select-safe-coding-system-interactively)
(select-safe-coding-system, activate-input-method)
(toggle-input-method, describe-current-input-method)
(describe-language-environment):
* lisp/international/mule-conf.el (code-offset):
* lisp/international/mule-diag.el (describe-character-set)
(list-input-methods-1):
* lisp/mail/feedmail.el (feedmail-run-the-queue):
* lisp/mouse.el (minor-mode-menu-from-indicator):
* lisp/mpc.el (mpc-playlist-rename):
* lisp/msb.el (msb--choose-menu):
* lisp/net/ange-ftp.el (ange-ftp-shell-command):
* lisp/net/imap.el (imap-interactive-login):
* lisp/net/mairix.el (mairix-widget-create-query):
* lisp/net/newst-backend.el (newsticker--sentinel-work):
* lisp/net/newst-treeview.el (newsticker--treeview-load):
* lisp/net/rlogin.el (rlogin):
* lisp/obsolete/iswitchb.el (iswitchb-possible-new-buffer):
* lisp/obsolete/otodo-mode.el (todo-more-important-p):
* lisp/obsolete/pgg-gpg.el (pgg-gpg-process-region):
* lisp/obsolete/pgg-pgp.el (pgg-pgp-process-region):
* lisp/obsolete/pgg-pgp5.el (pgg-pgp5-process-region):
* lisp/org/ob-core.el (org-babel-goto-named-src-block)
(org-babel-goto-named-result):
* lisp/org/ob-fortran.el (org-babel-fortran-ensure-main-wrap):
* lisp/org/ob-ref.el (org-babel-ref-resolve):
* lisp/org/org-agenda.el (org-agenda-prepare):
* lisp/org/org-clock.el (org-clock-notify-once-if-expired)
(org-clock-resolve):
* lisp/org/org-ctags.el (org-ctags-ask-rebuild-tags-file-then-find-tag):
* lisp/org/org-feed.el (org-feed-parse-atom-entry):
* lisp/org/org-habit.el (org-habit-parse-todo):
* lisp/org/org-mouse.el (org-mouse-popup-global-menu)
(org-mouse-context-menu):
* lisp/org/org-table.el (org-table-edit-formulas):
* lisp/org/ox.el (org-export-async-start):
* lisp/proced.el (proced-log):
* lisp/progmodes/ada-mode.el (ada-get-indent-case)
(ada-check-matching-start, ada-goto-matching-start):
* lisp/progmodes/ada-prj.el (ada-prj-display-page):
* lisp/progmodes/ada-xref.el (ada-find-executable):
* lisp/progmodes/ebrowse.el (ebrowse-tags-apropos):
* lisp/progmodes/etags.el (etags-tags-apropos-additional):
* lisp/progmodes/flymake.el (flymake-parse-err-lines)
(flymake-start-syntax-check-process):
* lisp/progmodes/python.el (python-shell-get-process-or-error)
(python-define-auxiliary-skeleton):
* lisp/progmodes/sql.el (sql-comint):
* lisp/progmodes/verilog-mode.el (verilog-load-file-at-point):
* lisp/progmodes/vhdl-mode.el (vhdl-widget-directory-validate):
* lisp/recentf.el (recentf-open-files):
* lisp/replace.el (query-replace-read-from)
(occur-after-change-function, occur-1):
* lisp/scroll-bar.el (scroll-bar-columns):
* lisp/server.el (server-get-auth-key):
* lisp/simple.el (execute-extended-command)
(undo-outer-limit-truncate, list-processes--refresh)
(compose-mail, set-variable, choose-completion-string)
(define-alternatives):
* lisp/startup.el (site-run-file, tty-handle-args, command-line)
(command-line-1):
* lisp/subr.el (noreturn, define-error, add-to-list)
(read-char-choice, version-to-list):
* lisp/term/common-win.el (x-handle-xrm-switch)
(x-handle-name-switch, x-handle-args):
* lisp/term/x-win.el (x-handle-parent-id, x-handle-smid):
* lisp/textmodes/reftex-ref.el (reftex-label):
* lisp/textmodes/reftex-toc.el (reftex-toc-rename-label):
* lisp/textmodes/two-column.el (2C-split):
* lisp/tutorial.el (tutorial--describe-nonstandard-key)
(tutorial--find-changed-keys):
* lisp/type-break.el (type-break-noninteractive-query):
* lisp/wdired.el (wdired-do-renames, wdired-do-symlink-changes)
(wdired-do-perm-changes):
* lisp/whitespace.el (whitespace-report-region):
Prefer grave quoting in source-code strings used to generate help
and diagnostics.
* lisp/faces.el (face-documentation):
No need to convert quotes, since the result is a docstring.
* lisp/info.el (Info-virtual-index-find-node)
(Info-virtual-index, info-apropos):
Simplify by generating only curved quotes, since info files are
typically that ways nowadays anyway.
* lisp/international/mule-diag.el (list-input-methods):
Don’t assume text quoting style is curved.
* lisp/org/org-bibtex.el (org-bibtex-fields):
Revert my recent changes, going back to the old quoting style.
2015-09-07 15:41:44 +00:00
|
|
|
|
"# All lines which start with a `#' will be deleted.\n")
|
2022-06-17 10:49:57 +00:00
|
|
|
|
(substitute-command-keys
|
2022-06-17 11:34:36 +00:00
|
|
|
|
(concat
|
2022-06-17 14:06:10 +00:00
|
|
|
|
"# Type \\[bookmark-edit-annotation-confirm] when done. Type "
|
2022-06-17 11:34:36 +00:00
|
|
|
|
"\\[bookmark-edit-annotation-cancel] to cancel.\n#\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
|
|
|
|
"# Author: " (user-full-name) " <" (user-login-name) "@"
|
|
|
|
|
(system-name) ">\n"
|
2022-06-17 11:34:36 +00:00
|
|
|
|
"# Date: " (current-time-string) "\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
|
|
|
|
|
|
|
|
|
|
2008-03-09 21:16:26 +00:00
|
|
|
|
(defvar bookmark-edit-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
|
|
|
|
|
2021-11-17 04:49:05 +00:00
|
|
|
|
(defvar-keymap bookmark-edit-annotation-mode-map
|
|
|
|
|
:doc "Keymap for editing an annotation of a bookmark."
|
|
|
|
|
:parent text-mode-map
|
2022-06-17 14:06:10 +00:00
|
|
|
|
"C-c C-c" #'bookmark-edit-annotation-confirm
|
2022-06-17 11:34:36 +00:00
|
|
|
|
"C-c C-k" #'bookmark-edit-annotation-cancel)
|
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
|
|
|
|
|
2013-09-11 03:31:56 +00:00
|
|
|
|
(defun bookmark-insert-annotation (bookmark-name-or-record)
|
2019-05-26 10:48:26 +00:00
|
|
|
|
"Insert annotation for BOOKMARK-NAME-OR-RECORD at point."
|
2019-06-30 23:21:47 +00:00
|
|
|
|
(when (not (bookmark-get-bookmark bookmark-name-or-record t))
|
|
|
|
|
(error "Invalid bookmark: %s" bookmark-name-or-record))
|
Adjust parameter names and doc strings to resolve confusion over
whether "bookmark" meant a bookmark name or a bookmark record.
Along the way, shorten one function's name for similar reasons.
(Issue #7548)
* lisp/bookmark.el
(bookmark-name-from-record):
New name for `bookmark-name-from-full-record'. All callers changed.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-default-annotation-text, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation,
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,
bookmark-get-handler, bookmark-edit-annotation, bookmark--jump-via,
bookmark-handle-bookmark, bookmark-location, bookmark-show-annotation):
Rename `bookmark' parameter to `bookmark-name-or-record', to
clearly show its role, and shorten or adjust doc strings accordingly.
(bookmark-set-name):
Same, and pass the parameter directly to `bookmark-get-bookmark'
instead of redundantly doing the callee's work.
(bookmark-default-annotation-text, bookmark-send-edited-annotation,
bookmark-relocate, bookmark-insert-location, bookmark-insert,
bookmark-delete):
Rename `bookmark' parameter to `bookmark-name', and in some cases
shorten doc string accordingly.
(bookmark-rename):
Change `old' and `new' parameters to `old-name'
and `new-name', and adjust an internal variable to avoid confusion.
(bookmark-jump, bookmark-jump-noselect):
Clarify `bookmark' parameter in doc string.
2010-12-08 08:09:27 +00:00
|
|
|
|
(insert (funcall bookmark-edit-annotation-text-func bookmark-name-or-record))
|
|
|
|
|
(let ((annotation (bookmark-get-annotation bookmark-name-or-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 "")))
|
2013-09-11 03:31:56 +00:00
|
|
|
|
(insert annotation))))
|
|
|
|
|
|
|
|
|
|
(define-derived-mode bookmark-edit-annotation-mode
|
|
|
|
|
text-mode "Edit Bookmark Annotation"
|
|
|
|
|
"Mode for editing the annotation of bookmarks.
|
2022-06-17 11:34:36 +00:00
|
|
|
|
\\<bookmark-edit-annotation-mode-map>\
|
2022-06-17 14:06:10 +00:00
|
|
|
|
When you have finished composing, type \\[bookmark-edit-annotation-confirm] \
|
2022-06-17 11:34:36 +00:00
|
|
|
|
or \\[bookmark-edit-annotation-cancel] to cancel.
|
2013-09-11 03:31:56 +00:00
|
|
|
|
|
|
|
|
|
\\{bookmark-edit-annotation-mode-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
|
|
|
|
|
2022-06-17 11:34:36 +00:00
|
|
|
|
(defmacro bookmark-edit-annotation--maybe-display-list (&rest body)
|
|
|
|
|
"Display bookmark list after editing if appropriate."
|
|
|
|
|
`(let ((from-bookmark-list bookmark--annotation-from-bookmark-list)
|
|
|
|
|
(old-buffer (current-buffer)))
|
|
|
|
|
,@body
|
|
|
|
|
(quit-window)
|
|
|
|
|
(bookmark-bmenu-surreptitiously-rebuild-list)
|
|
|
|
|
(when from-bookmark-list
|
|
|
|
|
(pop-to-buffer (get-buffer bookmark-bmenu-buffer))
|
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
(bookmark-bmenu-bookmark))
|
|
|
|
|
(kill-buffer old-buffer)))
|
|
|
|
|
|
|
|
|
|
(defun bookmark-edit-annotation-cancel ()
|
|
|
|
|
"Cancel the current annotation edit."
|
|
|
|
|
(interactive nil bookmark-edit-annotation-mode)
|
|
|
|
|
(bookmark-edit-annotation--maybe-display-list
|
|
|
|
|
(message "Canceled by user")))
|
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
|
|
|
|
|
2022-06-17 14:06:10 +00:00
|
|
|
|
(defun bookmark-edit-annotation-confirm ()
|
2004-04-15 23:13:16 +00:00
|
|
|
|
"Use buffer contents as annotation for a bookmark.
|
|
|
|
|
Lines beginning with `#' are ignored."
|
2021-02-14 20:37:23 +00:00
|
|
|
|
(interactive nil bookmark-edit-annotation-mode)
|
2013-09-11 03:31:56 +00:00
|
|
|
|
(if (not (derived-mode-p '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))
|
2017-02-12 23:21:06 +00:00
|
|
|
|
(if (= (following-char) ?#)
|
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-kill-line t)
|
|
|
|
|
(forward-line 1)))
|
2008-03-09 21:01:54 +00:00
|
|
|
|
;; Take no chances with text properties.
|
2022-06-17 11:34:36 +00:00
|
|
|
|
(bookmark-edit-annotation--maybe-display-list
|
|
|
|
|
(let ((annotation (buffer-substring-no-properties (point-min) (point-max)))
|
|
|
|
|
(bookmark-name bookmark-annotation-name))
|
|
|
|
|
(bookmark-set-annotation bookmark-name annotation)
|
|
|
|
|
(bookmark-update-last-modified bookmark-name)
|
|
|
|
|
(setq bookmark-alist-modification-count
|
|
|
|
|
(1+ bookmark-alist-modification-count))
|
|
|
|
|
(message "Annotation updated for \"%s\"" bookmark-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
|
|
|
|
|
|
|
|
|
|
2019-07-02 01:06:37 +00:00
|
|
|
|
(defun bookmark-edit-annotation (bookmark-name-or-record &optional from-bookmark-list)
|
|
|
|
|
"Pop up a buffer for editing bookmark BOOKMARK-NAME-OR-RECORD's annotation.
|
|
|
|
|
If optional argument FROM-BOOKMARK-LIST is non-nil, return to the
|
|
|
|
|
bookmark list when editing is done."
|
(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*"))
|
2013-09-11 03:31:56 +00:00
|
|
|
|
(bookmark-edit-annotation-mode)
|
2022-06-17 10:49:57 +00:00
|
|
|
|
(bookmark-insert-annotation bookmark-name-or-record)
|
2019-07-02 01:06:37 +00:00
|
|
|
|
(setq bookmark--annotation-from-bookmark-list from-bookmark-list)
|
|
|
|
|
(setq bookmark-annotation-name bookmark-name-or-record))
|
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
|
|
|
|
|
1995-03-11 20:17:37 +00:00
|
|
|
|
(defun bookmark-buffer-name ()
|
2009-10-25 02:07:45 +00:00
|
|
|
|
"Return the name of the current buffer in a form usable as a bookmark name.
|
|
|
|
|
If the buffer is associated with a file or directory, use that name."
|
1995-03-11 20:17:37 +00:00
|
|
|
|
(cond
|
|
|
|
|
;; 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 ()
|
2009-10-10 21:54:13 +00:00
|
|
|
|
"Get the next word from buffer `bookmark-current-buffer' and append
|
|
|
|
|
it to the name of the bookmark currently being set, advancing
|
2010-01-02 01:05:44 +00:00
|
|
|
|
`bookmark-yank-point' by one word."
|
1993-08-10 20:35:31 +00:00
|
|
|
|
(interactive)
|
2008-06-25 16:51:33 +00:00
|
|
|
|
(let ((string (with-current-buffer bookmark-current-buffer
|
|
|
|
|
(goto-char bookmark-yank-point)
|
|
|
|
|
(buffer-substring-no-properties
|
|
|
|
|
(point)
|
|
|
|
|
(progn
|
|
|
|
|
(forward-word 1)
|
|
|
|
|
(setq bookmark-yank-point (point)))))))
|
1993-08-10 20:35:31 +00:00
|
|
|
|
(insert string)))
|
|
|
|
|
|
|
|
|
|
(defun bookmark-buffer-file-name ()
|
2008-03-13 01:57:05 +00:00
|
|
|
|
"Return the current buffer's file in a way useful for bookmarks."
|
2008-11-21 19:07:21 +00:00
|
|
|
|
;; Abbreviate the path, both so it's shorter and so it's more
|
|
|
|
|
;; portable. E.g., the user's home dir might be a different
|
|
|
|
|
;; path on different machines, but "~/" will still reach it.
|
2008-12-03 05:48:14 +00:00
|
|
|
|
(abbreviate-file-name
|
2008-11-21 19:07:21 +00:00
|
|
|
|
(cond
|
|
|
|
|
(buffer-file-name buffer-file-name)
|
|
|
|
|
((and (boundp 'dired-directory) dired-directory)
|
|
|
|
|
(if (stringp dired-directory)
|
|
|
|
|
dired-directory
|
|
|
|
|
(car dired-directory)))
|
|
|
|
|
(t (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
|
|
|
|
|
2021-02-14 23:43:15 +00:00
|
|
|
|
(defvar bookmark--watch-already-asked-mtime nil
|
|
|
|
|
"Mtime for which we already queried about reloading.")
|
|
|
|
|
|
|
|
|
|
(defun bookmark--watch-file-already-queried-p (new-mtime)
|
|
|
|
|
;; Don't ask repeatedly if user already said "no" to reloading a
|
|
|
|
|
;; file with this mtime:
|
2022-08-01 07:38:34 +00:00
|
|
|
|
(prog1 (time-equal-p new-mtime bookmark--watch-already-asked-mtime)
|
2021-02-14 23:43:15 +00:00
|
|
|
|
(setq bookmark--watch-already-asked-mtime new-mtime)))
|
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-maybe-load-default-file ()
|
* bookmark.el
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-set-name, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation, 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,
bookmark-location, bookmark-jump, bookmark-jump-other-window,
bookmark-handle-bookmark, bookmark-relocate, bookmark-insert-location,
bookmark-rename, bookmark-insert, bookmark-delete, bookmark-time-to-save-p,
bookmark-edit-annotation-mode, bookmark-edit-annotation): Improve doc
strings to say whether bookmark can be a string or a record or both,
and make other consistency and clarity fixes.
(bookmark-get-handler, bookmark--jump-via, bookmark-write-file,
bookmark-default-annotation-text, bookmark-yank-word,
bookmark-maybe-load-default-file, bookmark-maybe-sort-alist,
bookmark-import-new-list, bookmark-maybe-rename,
bookmark-bmenu-show-filenames, bookmark-bmenu-hide-filenames,
bookmark-bmenu-bookmark): Give these doc strings.
(bookmark-bmenu-check-position): Give this a doc string, but also
add a FIXME comment about how the function may be pointless.
(bookmark-default-handler): Rework doc string and change a parameter
name, to clarify that this takes a bookmark record not a bookmark name.
(bookmark-set): Change a parameter name to indicate its meaning,
and improve the doc string a bit.
(Bug#4188)
2009-10-05 01:35:34 +00:00
|
|
|
|
"If bookmarks have not been loaded from the default place, load them."
|
2019-06-18 05:59:11 +00:00
|
|
|
|
(cond ((and (not bookmark-bookmarks-timestamp)
|
|
|
|
|
(null bookmark-alist)
|
|
|
|
|
(file-readable-p bookmark-default-file)
|
|
|
|
|
(bookmark-load bookmark-default-file t t)))
|
|
|
|
|
((and bookmark-watch-bookmark-file
|
2021-02-14 23:43:15 +00:00
|
|
|
|
(let ((new-mtime (nth 5 (file-attributes
|
|
|
|
|
(car bookmark-bookmarks-timestamp))))
|
|
|
|
|
(old-mtime (cdr bookmark-bookmarks-timestamp)))
|
2022-08-01 07:38:34 +00:00
|
|
|
|
(and (not (time-equal-p new-mtime old-mtime))
|
2021-02-14 23:43:15 +00:00
|
|
|
|
(not (bookmark--watch-file-already-queried-p new-mtime))
|
|
|
|
|
(or (eq 'silent bookmark-watch-bookmark-file)
|
|
|
|
|
(yes-or-no-p
|
|
|
|
|
(format "Bookmarks %s changed on disk. Reload? "
|
|
|
|
|
(car bookmark-bookmarks-timestamp)))))))
|
2019-06-18 05:59:11 +00:00
|
|
|
|
(bookmark-load (car bookmark-bookmarks-timestamp) t 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
|
|
|
|
|
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
|
|
|
|
|
2005-08-24 10:18:29 +00:00
|
|
|
|
(defvar bookmark-after-jump-hook nil
|
|
|
|
|
"Hook run after `bookmark-jump' jumps to a bookmark.
|
|
|
|
|
Useful for example to unhide text in `outline-mode'.")
|
|
|
|
|
|
Adjust parameter names and doc strings to resolve confusion over
whether "bookmark" meant a bookmark name or a bookmark record.
Along the way, shorten one function's name for similar reasons.
(Issue #7548)
* lisp/bookmark.el
(bookmark-name-from-record):
New name for `bookmark-name-from-full-record'. All callers changed.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-default-annotation-text, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation,
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,
bookmark-get-handler, bookmark-edit-annotation, bookmark--jump-via,
bookmark-handle-bookmark, bookmark-location, bookmark-show-annotation):
Rename `bookmark' parameter to `bookmark-name-or-record', to
clearly show its role, and shorten or adjust doc strings accordingly.
(bookmark-set-name):
Same, and pass the parameter directly to `bookmark-get-bookmark'
instead of redundantly doing the callee's work.
(bookmark-default-annotation-text, bookmark-send-edited-annotation,
bookmark-relocate, bookmark-insert-location, bookmark-insert,
bookmark-delete):
Rename `bookmark' parameter to `bookmark-name', and in some cases
shorten doc string accordingly.
(bookmark-rename):
Change `old' and `new' parameters to `old-name'
and `new-name', and adjust an internal variable to avoid confusion.
(bookmark-jump, bookmark-jump-noselect):
Clarify `bookmark' parameter in doc string.
2010-12-08 08:09:27 +00:00
|
|
|
|
(defun bookmark--jump-via (bookmark-name-or-record display-function)
|
2019-05-26 10:48:26 +00:00
|
|
|
|
"Handle BOOKMARK-NAME-OR-RECORD, then call DISPLAY-FUNCTION.
|
|
|
|
|
DISPLAY-FUNCTION is called with the current buffer as argument.
|
* bookmark.el
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-set-name, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation, 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,
bookmark-location, bookmark-jump, bookmark-jump-other-window,
bookmark-handle-bookmark, bookmark-relocate, bookmark-insert-location,
bookmark-rename, bookmark-insert, bookmark-delete, bookmark-time-to-save-p,
bookmark-edit-annotation-mode, bookmark-edit-annotation): Improve doc
strings to say whether bookmark can be a string or a record or both,
and make other consistency and clarity fixes.
(bookmark-get-handler, bookmark--jump-via, bookmark-write-file,
bookmark-default-annotation-text, bookmark-yank-word,
bookmark-maybe-load-default-file, bookmark-maybe-sort-alist,
bookmark-import-new-list, bookmark-maybe-rename,
bookmark-bmenu-show-filenames, bookmark-bmenu-hide-filenames,
bookmark-bmenu-bookmark): Give these doc strings.
(bookmark-bmenu-check-position): Give this a doc string, but also
add a FIXME comment about how the function may be pointless.
(bookmark-default-handler): Rework doc string and change a parameter
name, to clarify that this takes a bookmark record not a bookmark name.
(bookmark-set): Change a parameter name to indicate its meaning,
and improve the doc string a bit.
(Bug#4188)
2009-10-05 01:35:34 +00:00
|
|
|
|
|
|
|
|
|
After calling DISPLAY-FUNCTION, set window point to the point specified
|
Adjust parameter names and doc strings to resolve confusion over
whether "bookmark" meant a bookmark name or a bookmark record.
Along the way, shorten one function's name for similar reasons.
(Issue #7548)
* lisp/bookmark.el
(bookmark-name-from-record):
New name for `bookmark-name-from-full-record'. All callers changed.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-default-annotation-text, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation,
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,
bookmark-get-handler, bookmark-edit-annotation, bookmark--jump-via,
bookmark-handle-bookmark, bookmark-location, bookmark-show-annotation):
Rename `bookmark' parameter to `bookmark-name-or-record', to
clearly show its role, and shorten or adjust doc strings accordingly.
(bookmark-set-name):
Same, and pass the parameter directly to `bookmark-get-bookmark'
instead of redundantly doing the callee's work.
(bookmark-default-annotation-text, bookmark-send-edited-annotation,
bookmark-relocate, bookmark-insert-location, bookmark-insert,
bookmark-delete):
Rename `bookmark' parameter to `bookmark-name', and in some cases
shorten doc string accordingly.
(bookmark-rename):
Change `old' and `new' parameters to `old-name'
and `new-name', and adjust an internal variable to avoid confusion.
(bookmark-jump, bookmark-jump-noselect):
Clarify `bookmark' parameter in doc string.
2010-12-08 08:09:27 +00:00
|
|
|
|
by BOOKMARK-NAME-OR-RECORD, if necessary, run `bookmark-after-jump-hook',
|
|
|
|
|
and then show any annotations for this bookmark."
|
|
|
|
|
(bookmark-handle-bookmark bookmark-name-or-record)
|
2008-06-25 16:51:33 +00:00
|
|
|
|
(save-current-buffer
|
|
|
|
|
(funcall display-function (current-buffer)))
|
|
|
|
|
(let ((win (get-buffer-window (current-buffer) 0)))
|
|
|
|
|
(if win (set-window-point win (point))))
|
|
|
|
|
;; FIXME: we used to only run bookmark-after-jump-hook in
|
|
|
|
|
;; `bookmark-jump' itself, but in none of the other commands.
|
2022-08-02 18:40:43 +00:00
|
|
|
|
(when bookmark-fringe-mark
|
2022-08-21 16:00:53 +00:00
|
|
|
|
(let ((overlays (overlays-in (pos-bol) (1+ (pos-bol))))
|
2021-05-04 08:58:52 +00:00
|
|
|
|
temp found)
|
|
|
|
|
(while (and (not found) (setq temp (pop overlays)))
|
|
|
|
|
(when (eq 'bookmark (overlay-get temp 'category))
|
|
|
|
|
(setq found t)))
|
|
|
|
|
(unless found
|
2021-09-13 11:35:53 +00:00
|
|
|
|
(bookmark--set-fringe-mark))))
|
2008-06-25 16:51:33 +00:00
|
|
|
|
(run-hooks 'bookmark-after-jump-hook)
|
|
|
|
|
(if bookmark-automatically-show-annotations
|
|
|
|
|
;; if there is an annotation for this bookmark,
|
|
|
|
|
;; show it in a buffer.
|
Adjust parameter names and doc strings to resolve confusion over
whether "bookmark" meant a bookmark name or a bookmark record.
Along the way, shorten one function's name for similar reasons.
(Issue #7548)
* lisp/bookmark.el
(bookmark-name-from-record):
New name for `bookmark-name-from-full-record'. All callers changed.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-default-annotation-text, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation,
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,
bookmark-get-handler, bookmark-edit-annotation, bookmark--jump-via,
bookmark-handle-bookmark, bookmark-location, bookmark-show-annotation):
Rename `bookmark' parameter to `bookmark-name-or-record', to
clearly show its role, and shorten or adjust doc strings accordingly.
(bookmark-set-name):
Same, and pass the parameter directly to `bookmark-get-bookmark'
instead of redundantly doing the callee's work.
(bookmark-default-annotation-text, bookmark-send-edited-annotation,
bookmark-relocate, bookmark-insert-location, bookmark-insert,
bookmark-delete):
Rename `bookmark' parameter to `bookmark-name', and in some cases
shorten doc string accordingly.
(bookmark-rename):
Change `old' and `new' parameters to `old-name'
and `new-name', and adjust an internal variable to avoid confusion.
(bookmark-jump, bookmark-jump-noselect):
Clarify `bookmark' parameter in doc string.
2010-12-08 08:09:27 +00:00
|
|
|
|
(bookmark-show-annotation bookmark-name-or-record)))
|
2008-11-21 10:32:39 +00:00
|
|
|
|
|
2008-06-25 16:51:33 +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
|
2009-10-09 05:54:57 +00:00
|
|
|
|
(defun bookmark-jump (bookmark &optional display-func)
|
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
|
* bookmark.el
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-set-name, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation, 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,
bookmark-location, bookmark-jump, bookmark-jump-other-window,
bookmark-handle-bookmark, bookmark-relocate, bookmark-insert-location,
bookmark-rename, bookmark-insert, bookmark-delete, bookmark-time-to-save-p,
bookmark-edit-annotation-mode, bookmark-edit-annotation): Improve doc
strings to say whether bookmark can be a string or a record or both,
and make other consistency and clarity fixes.
(bookmark-get-handler, bookmark--jump-via, bookmark-write-file,
bookmark-default-annotation-text, bookmark-yank-word,
bookmark-maybe-load-default-file, bookmark-maybe-sort-alist,
bookmark-import-new-list, bookmark-maybe-rename,
bookmark-bmenu-show-filenames, bookmark-bmenu-hide-filenames,
bookmark-bmenu-bookmark): Give these doc strings.
(bookmark-bmenu-check-position): Give this a doc string, but also
add a FIXME comment about how the function may be pointless.
(bookmark-default-handler): Rework doc string and change a parameter
name, to clarify that this takes a bookmark record not a bookmark name.
(bookmark-set): Change a parameter name to indicate its meaning,
and improve the doc string a bit.
(Bug#4188)
2009-10-05 01:35:34 +00:00
|
|
|
|
of the old one in the permanent bookmark record.
|
|
|
|
|
|
Adjust parameter names and doc strings to resolve confusion over
whether "bookmark" meant a bookmark name or a bookmark record.
Along the way, shorten one function's name for similar reasons.
(Issue #7548)
* lisp/bookmark.el
(bookmark-name-from-record):
New name for `bookmark-name-from-full-record'. All callers changed.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-default-annotation-text, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation,
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,
bookmark-get-handler, bookmark-edit-annotation, bookmark--jump-via,
bookmark-handle-bookmark, bookmark-location, bookmark-show-annotation):
Rename `bookmark' parameter to `bookmark-name-or-record', to
clearly show its role, and shorten or adjust doc strings accordingly.
(bookmark-set-name):
Same, and pass the parameter directly to `bookmark-get-bookmark'
instead of redundantly doing the callee's work.
(bookmark-default-annotation-text, bookmark-send-edited-annotation,
bookmark-relocate, bookmark-insert-location, bookmark-insert,
bookmark-delete):
Rename `bookmark' parameter to `bookmark-name', and in some cases
shorten doc string accordingly.
(bookmark-rename):
Change `old' and `new' parameters to `old-name'
and `new-name', and adjust an internal variable to avoid confusion.
(bookmark-jump, bookmark-jump-noselect):
Clarify `bookmark' parameter in doc string.
2010-12-08 08:09:27 +00:00
|
|
|
|
BOOKMARK is usually a bookmark name (a string). It can also be a
|
|
|
|
|
bookmark record, but this is usually only done by programmatic callers.
|
2009-10-09 05:54:57 +00:00
|
|
|
|
|
|
|
|
|
If DISPLAY-FUNC is non-nil, it is a function to invoke to display the
|
2018-07-24 01:49:00 +00:00
|
|
|
|
bookmark. It defaults to `pop-to-buffer-same-window'. A typical value for
|
2009-10-25 02:07:45 +00:00
|
|
|
|
DISPLAY-FUNC would be `switch-to-buffer-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
|
|
|
|
(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)
|
2018-07-24 22:45:43 +00:00
|
|
|
|
;; Don't use `switch-to-buffer' because it would let the
|
|
|
|
|
;; window-point override the bookmark's point when
|
|
|
|
|
;; `switch-to-buffer-preserve-window-point' is non-nil.
|
2018-07-24 01:49:00 +00:00
|
|
|
|
(bookmark--jump-via bookmark (or display-func 'pop-to-buffer-same-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-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
|
|
|
|
|
2007-07-13 18:20:55 +00:00
|
|
|
|
;;;###autoload
|
|
|
|
|
(defun bookmark-jump-other-window (bookmark)
|
* bookmark.el
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-set-name, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation, 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,
bookmark-location, bookmark-jump, bookmark-jump-other-window,
bookmark-handle-bookmark, bookmark-relocate, bookmark-insert-location,
bookmark-rename, bookmark-insert, bookmark-delete, bookmark-time-to-save-p,
bookmark-edit-annotation-mode, bookmark-edit-annotation): Improve doc
strings to say whether bookmark can be a string or a record or both,
and make other consistency and clarity fixes.
(bookmark-get-handler, bookmark--jump-via, bookmark-write-file,
bookmark-default-annotation-text, bookmark-yank-word,
bookmark-maybe-load-default-file, bookmark-maybe-sort-alist,
bookmark-import-new-list, bookmark-maybe-rename,
bookmark-bmenu-show-filenames, bookmark-bmenu-hide-filenames,
bookmark-bmenu-bookmark): Give these doc strings.
(bookmark-bmenu-check-position): Give this a doc string, but also
add a FIXME comment about how the function may be pointless.
(bookmark-default-handler): Rework doc string and change a parameter
name, to clarify that this takes a bookmark record not a bookmark name.
(bookmark-set): Change a parameter name to indicate its meaning,
and improve the doc string a bit.
(Bug#4188)
2009-10-05 01:35:34 +00:00
|
|
|
|
"Jump to BOOKMARK in another window. See `bookmark-jump' for more."
|
2007-07-13 18:20:55 +00:00
|
|
|
|
(interactive
|
2009-10-09 05:54:57 +00:00
|
|
|
|
(list (bookmark-completing-read "Jump to bookmark (in another window)"
|
|
|
|
|
bookmark-current-bookmark)))
|
|
|
|
|
(bookmark-jump bookmark 'switch-to-buffer-other-window))
|
2007-07-13 18:20:55 +00:00
|
|
|
|
|
2018-10-13 20:06:41 +00:00
|
|
|
|
;;;###autoload
|
|
|
|
|
(defun bookmark-jump-other-frame (bookmark)
|
|
|
|
|
"Jump to BOOKMARK in another frame. See `bookmark-jump' for more."
|
|
|
|
|
(interactive
|
|
|
|
|
(list (bookmark-completing-read "Jump to bookmark (in another frame)"
|
|
|
|
|
bookmark-current-bookmark)))
|
|
|
|
|
(let ((pop-up-frames t))
|
|
|
|
|
(bookmark-jump-other-window bookmark)))
|
2007-07-13 18:20:55 +00:00
|
|
|
|
|
Adjust parameter names and doc strings to resolve confusion over
whether "bookmark" meant a bookmark name or a bookmark record.
Along the way, shorten one function's name for similar reasons.
(Issue #7548)
* lisp/bookmark.el
(bookmark-name-from-record):
New name for `bookmark-name-from-full-record'. All callers changed.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-default-annotation-text, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation,
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,
bookmark-get-handler, bookmark-edit-annotation, bookmark--jump-via,
bookmark-handle-bookmark, bookmark-location, bookmark-show-annotation):
Rename `bookmark' parameter to `bookmark-name-or-record', to
clearly show its role, and shorten or adjust doc strings accordingly.
(bookmark-set-name):
Same, and pass the parameter directly to `bookmark-get-bookmark'
instead of redundantly doing the callee's work.
(bookmark-default-annotation-text, bookmark-send-edited-annotation,
bookmark-relocate, bookmark-insert-location, bookmark-insert,
bookmark-delete):
Rename `bookmark' parameter to `bookmark-name', and in some cases
shorten doc string accordingly.
(bookmark-rename):
Change `old' and `new' parameters to `old-name'
and `new-name', and adjust an internal variable to avoid confusion.
(bookmark-jump, bookmark-jump-noselect):
Clarify `bookmark' parameter in doc string.
2010-12-08 08:09:27 +00:00
|
|
|
|
(defun bookmark-handle-bookmark (bookmark-name-or-record)
|
|
|
|
|
"Call BOOKMARK-NAME-OR-RECORD's handler or `bookmark-default-handler'
|
|
|
|
|
if it has none. This changes current buffer and point and returns nil,
|
2011-02-01 21:22:21 +00:00
|
|
|
|
or signals a `file-error'.
|
* bookmark.el
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-set-name, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation, 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,
bookmark-location, bookmark-jump, bookmark-jump-other-window,
bookmark-handle-bookmark, bookmark-relocate, bookmark-insert-location,
bookmark-rename, bookmark-insert, bookmark-delete, bookmark-time-to-save-p,
bookmark-edit-annotation-mode, bookmark-edit-annotation): Improve doc
strings to say whether bookmark can be a string or a record or both,
and make other consistency and clarity fixes.
(bookmark-get-handler, bookmark--jump-via, bookmark-write-file,
bookmark-default-annotation-text, bookmark-yank-word,
bookmark-maybe-load-default-file, bookmark-maybe-sort-alist,
bookmark-import-new-list, bookmark-maybe-rename,
bookmark-bmenu-show-filenames, bookmark-bmenu-hide-filenames,
bookmark-bmenu-bookmark): Give these doc strings.
(bookmark-bmenu-check-position): Give this a doc string, but also
add a FIXME comment about how the function may be pointless.
(bookmark-default-handler): Rework doc string and change a parameter
name, to clarify that this takes a bookmark record not a bookmark name.
(bookmark-set): Change a parameter name to indicate its meaning,
and improve the doc string a bit.
(Bug#4188)
2009-10-05 01:35:34 +00:00
|
|
|
|
|
Adjust parameter names and doc strings to resolve confusion over
whether "bookmark" meant a bookmark name or a bookmark record.
Along the way, shorten one function's name for similar reasons.
(Issue #7548)
* lisp/bookmark.el
(bookmark-name-from-record):
New name for `bookmark-name-from-full-record'. All callers changed.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-default-annotation-text, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation,
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,
bookmark-get-handler, bookmark-edit-annotation, bookmark--jump-via,
bookmark-handle-bookmark, bookmark-location, bookmark-show-annotation):
Rename `bookmark' parameter to `bookmark-name-or-record', to
clearly show its role, and shorten or adjust doc strings accordingly.
(bookmark-set-name):
Same, and pass the parameter directly to `bookmark-get-bookmark'
instead of redundantly doing the callee's work.
(bookmark-default-annotation-text, bookmark-send-edited-annotation,
bookmark-relocate, bookmark-insert-location, bookmark-insert,
bookmark-delete):
Rename `bookmark' parameter to `bookmark-name', and in some cases
shorten doc string accordingly.
(bookmark-rename):
Change `old' and `new' parameters to `old-name'
and `new-name', and adjust an internal variable to avoid confusion.
(bookmark-jump, bookmark-jump-noselect):
Clarify `bookmark' parameter in doc string.
2010-12-08 08:09:27 +00:00
|
|
|
|
If BOOKMARK-NAME-OR-RECORD has no file, this is a no-op. If
|
|
|
|
|
BOOKMARK-NAME-OR-RECORD has a file, but that file no longer exists,
|
|
|
|
|
then offer interactively to relocate BOOKMARK-NAME-OR-RECORD."
|
2008-06-25 16:51:33 +00:00
|
|
|
|
(condition-case err
|
Adjust parameter names and doc strings to resolve confusion over
whether "bookmark" meant a bookmark name or a bookmark record.
Along the way, shorten one function's name for similar reasons.
(Issue #7548)
* lisp/bookmark.el
(bookmark-name-from-record):
New name for `bookmark-name-from-full-record'. All callers changed.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-default-annotation-text, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation,
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,
bookmark-get-handler, bookmark-edit-annotation, bookmark--jump-via,
bookmark-handle-bookmark, bookmark-location, bookmark-show-annotation):
Rename `bookmark' parameter to `bookmark-name-or-record', to
clearly show its role, and shorten or adjust doc strings accordingly.
(bookmark-set-name):
Same, and pass the parameter directly to `bookmark-get-bookmark'
instead of redundantly doing the callee's work.
(bookmark-default-annotation-text, bookmark-send-edited-annotation,
bookmark-relocate, bookmark-insert-location, bookmark-insert,
bookmark-delete):
Rename `bookmark' parameter to `bookmark-name', and in some cases
shorten doc string accordingly.
(bookmark-rename):
Change `old' and `new' parameters to `old-name'
and `new-name', and adjust an internal variable to avoid confusion.
(bookmark-jump, bookmark-jump-noselect):
Clarify `bookmark' parameter in doc string.
2010-12-08 08:09:27 +00:00
|
|
|
|
(funcall (or (bookmark-get-handler bookmark-name-or-record)
|
2008-06-25 16:51:33 +00:00
|
|
|
|
'bookmark-default-handler)
|
Adjust parameter names and doc strings to resolve confusion over
whether "bookmark" meant a bookmark name or a bookmark record.
Along the way, shorten one function's name for similar reasons.
(Issue #7548)
* lisp/bookmark.el
(bookmark-name-from-record):
New name for `bookmark-name-from-full-record'. All callers changed.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-default-annotation-text, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation,
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,
bookmark-get-handler, bookmark-edit-annotation, bookmark--jump-via,
bookmark-handle-bookmark, bookmark-location, bookmark-show-annotation):
Rename `bookmark' parameter to `bookmark-name-or-record', to
clearly show its role, and shorten or adjust doc strings accordingly.
(bookmark-set-name):
Same, and pass the parameter directly to `bookmark-get-bookmark'
instead of redundantly doing the callee's work.
(bookmark-default-annotation-text, bookmark-send-edited-annotation,
bookmark-relocate, bookmark-insert-location, bookmark-insert,
bookmark-delete):
Rename `bookmark' parameter to `bookmark-name', and in some cases
shorten doc string accordingly.
(bookmark-rename):
Change `old' and `new' parameters to `old-name'
and `new-name', and adjust an internal variable to avoid confusion.
(bookmark-jump, bookmark-jump-noselect):
Clarify `bookmark' parameter in doc string.
2010-12-08 08:09:27 +00:00
|
|
|
|
(bookmark-get-bookmark bookmark-name-or-record))
|
2010-02-10 20:02:54 +00:00
|
|
|
|
(bookmark-error-no-filename ;file-error
|
2008-06-25 16:51:33 +00:00
|
|
|
|
;; We were unable to find the marked file, so ask if user wants to
|
|
|
|
|
;; relocate the bookmark, else remind them to consider deletion.
|
Adjust parameter names and doc strings to resolve confusion over
whether "bookmark" meant a bookmark name or a bookmark record.
Along the way, shorten one function's name for similar reasons.
(Issue #7548)
* lisp/bookmark.el
(bookmark-name-from-record):
New name for `bookmark-name-from-full-record'. All callers changed.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-default-annotation-text, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation,
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,
bookmark-get-handler, bookmark-edit-annotation, bookmark--jump-via,
bookmark-handle-bookmark, bookmark-location, bookmark-show-annotation):
Rename `bookmark' parameter to `bookmark-name-or-record', to
clearly show its role, and shorten or adjust doc strings accordingly.
(bookmark-set-name):
Same, and pass the parameter directly to `bookmark-get-bookmark'
instead of redundantly doing the callee's work.
(bookmark-default-annotation-text, bookmark-send-edited-annotation,
bookmark-relocate, bookmark-insert-location, bookmark-insert,
bookmark-delete):
Rename `bookmark' parameter to `bookmark-name', and in some cases
shorten doc string accordingly.
(bookmark-rename):
Change `old' and `new' parameters to `old-name'
and `new-name', and adjust an internal variable to avoid confusion.
(bookmark-jump, bookmark-jump-noselect):
Clarify `bookmark' parameter in doc string.
2010-12-08 08:09:27 +00:00
|
|
|
|
(when (stringp bookmark-name-or-record)
|
|
|
|
|
;; `bookmark-name-or-record' can be either a bookmark name
|
|
|
|
|
;; (from `bookmark-alist') or a bookmark object. If it's an
|
|
|
|
|
;; object, we assume it's a bookmark used internally by some
|
|
|
|
|
;; other package.
|
|
|
|
|
(let ((file (bookmark-get-filename bookmark-name-or-record)))
|
2008-06-25 16:51:33 +00:00
|
|
|
|
(when file ;Don't know how to relocate if there's no `file'.
|
2009-10-05 04:19:04 +00:00
|
|
|
|
;; If file is not a dir, directory-file-name just returns file.
|
|
|
|
|
(let ((display-name (directory-file-name file)))
|
|
|
|
|
(ding)
|
|
|
|
|
;; Dialog boxes can accept a file target, but usually don't
|
|
|
|
|
;; know how to accept a directory target (at least, this
|
|
|
|
|
;; is true in Gnome on GNU/Linux, and Bug#4230 says it's
|
|
|
|
|
;; true on Windows as well). So we suppress file dialogs
|
|
|
|
|
;; when relocating.
|
|
|
|
|
(let ((use-dialog-box nil)
|
|
|
|
|
(use-file-dialog nil))
|
|
|
|
|
(if (y-or-n-p (concat display-name " nonexistent. Relocate \""
|
Adjust parameter names and doc strings to resolve confusion over
whether "bookmark" meant a bookmark name or a bookmark record.
Along the way, shorten one function's name for similar reasons.
(Issue #7548)
* lisp/bookmark.el
(bookmark-name-from-record):
New name for `bookmark-name-from-full-record'. All callers changed.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-default-annotation-text, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation,
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,
bookmark-get-handler, bookmark-edit-annotation, bookmark--jump-via,
bookmark-handle-bookmark, bookmark-location, bookmark-show-annotation):
Rename `bookmark' parameter to `bookmark-name-or-record', to
clearly show its role, and shorten or adjust doc strings accordingly.
(bookmark-set-name):
Same, and pass the parameter directly to `bookmark-get-bookmark'
instead of redundantly doing the callee's work.
(bookmark-default-annotation-text, bookmark-send-edited-annotation,
bookmark-relocate, bookmark-insert-location, bookmark-insert,
bookmark-delete):
Rename `bookmark' parameter to `bookmark-name', and in some cases
shorten doc string accordingly.
(bookmark-rename):
Change `old' and `new' parameters to `old-name'
and `new-name', and adjust an internal variable to avoid confusion.
(bookmark-jump, bookmark-jump-noselect):
Clarify `bookmark' parameter in doc string.
2010-12-08 08:09:27 +00:00
|
|
|
|
bookmark-name-or-record "\"? "))
|
2009-10-05 04:19:04 +00:00
|
|
|
|
(progn
|
Adjust parameter names and doc strings to resolve confusion over
whether "bookmark" meant a bookmark name or a bookmark record.
Along the way, shorten one function's name for similar reasons.
(Issue #7548)
* lisp/bookmark.el
(bookmark-name-from-record):
New name for `bookmark-name-from-full-record'. All callers changed.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-default-annotation-text, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation,
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,
bookmark-get-handler, bookmark-edit-annotation, bookmark--jump-via,
bookmark-handle-bookmark, bookmark-location, bookmark-show-annotation):
Rename `bookmark' parameter to `bookmark-name-or-record', to
clearly show its role, and shorten or adjust doc strings accordingly.
(bookmark-set-name):
Same, and pass the parameter directly to `bookmark-get-bookmark'
instead of redundantly doing the callee's work.
(bookmark-default-annotation-text, bookmark-send-edited-annotation,
bookmark-relocate, bookmark-insert-location, bookmark-insert,
bookmark-delete):
Rename `bookmark' parameter to `bookmark-name', and in some cases
shorten doc string accordingly.
(bookmark-rename):
Change `old' and `new' parameters to `old-name'
and `new-name', and adjust an internal variable to avoid confusion.
(bookmark-jump, bookmark-jump-noselect):
Clarify `bookmark' parameter in doc string.
2010-12-08 08:09:27 +00:00
|
|
|
|
(bookmark-relocate bookmark-name-or-record)
|
2009-10-05 04:19:04 +00:00
|
|
|
|
;; Try again.
|
Adjust parameter names and doc strings to resolve confusion over
whether "bookmark" meant a bookmark name or a bookmark record.
Along the way, shorten one function's name for similar reasons.
(Issue #7548)
* lisp/bookmark.el
(bookmark-name-from-record):
New name for `bookmark-name-from-full-record'. All callers changed.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-default-annotation-text, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation,
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,
bookmark-get-handler, bookmark-edit-annotation, bookmark--jump-via,
bookmark-handle-bookmark, bookmark-location, bookmark-show-annotation):
Rename `bookmark' parameter to `bookmark-name-or-record', to
clearly show its role, and shorten or adjust doc strings accordingly.
(bookmark-set-name):
Same, and pass the parameter directly to `bookmark-get-bookmark'
instead of redundantly doing the callee's work.
(bookmark-default-annotation-text, bookmark-send-edited-annotation,
bookmark-relocate, bookmark-insert-location, bookmark-insert,
bookmark-delete):
Rename `bookmark' parameter to `bookmark-name', and in some cases
shorten doc string accordingly.
(bookmark-rename):
Change `old' and `new' parameters to `old-name'
and `new-name', and adjust an internal variable to avoid confusion.
(bookmark-jump, bookmark-jump-noselect):
Clarify `bookmark' parameter in doc string.
2010-12-08 08:09:27 +00:00
|
|
|
|
(funcall (or (bookmark-get-handler bookmark-name-or-record)
|
2009-10-05 04:19:04 +00:00
|
|
|
|
'bookmark-default-handler)
|
Adjust parameter names and doc strings to resolve confusion over
whether "bookmark" meant a bookmark name or a bookmark record.
Along the way, shorten one function's name for similar reasons.
(Issue #7548)
* lisp/bookmark.el
(bookmark-name-from-record):
New name for `bookmark-name-from-full-record'. All callers changed.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-default-annotation-text, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation,
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,
bookmark-get-handler, bookmark-edit-annotation, bookmark--jump-via,
bookmark-handle-bookmark, bookmark-location, bookmark-show-annotation):
Rename `bookmark' parameter to `bookmark-name-or-record', to
clearly show its role, and shorten or adjust doc strings accordingly.
(bookmark-set-name):
Same, and pass the parameter directly to `bookmark-get-bookmark'
instead of redundantly doing the callee's work.
(bookmark-default-annotation-text, bookmark-send-edited-annotation,
bookmark-relocate, bookmark-insert-location, bookmark-insert,
bookmark-delete):
Rename `bookmark' parameter to `bookmark-name', and in some cases
shorten doc string accordingly.
(bookmark-rename):
Change `old' and `new' parameters to `old-name'
and `new-name', and adjust an internal variable to avoid confusion.
(bookmark-jump, bookmark-jump-noselect):
Clarify `bookmark' parameter in doc string.
2010-12-08 08:09:27 +00:00
|
|
|
|
(bookmark-get-bookmark bookmark-name-or-record)))
|
2009-10-05 04:19:04 +00:00
|
|
|
|
(message
|
2010-01-02 01:05:44 +00:00
|
|
|
|
"Bookmark not relocated; consider removing it (%s)."
|
Adjust parameter names and doc strings to resolve confusion over
whether "bookmark" meant a bookmark name or a bookmark record.
Along the way, shorten one function's name for similar reasons.
(Issue #7548)
* lisp/bookmark.el
(bookmark-name-from-record):
New name for `bookmark-name-from-full-record'. All callers changed.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-default-annotation-text, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation,
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,
bookmark-get-handler, bookmark-edit-annotation, bookmark--jump-via,
bookmark-handle-bookmark, bookmark-location, bookmark-show-annotation):
Rename `bookmark' parameter to `bookmark-name-or-record', to
clearly show its role, and shorten or adjust doc strings accordingly.
(bookmark-set-name):
Same, and pass the parameter directly to `bookmark-get-bookmark'
instead of redundantly doing the callee's work.
(bookmark-default-annotation-text, bookmark-send-edited-annotation,
bookmark-relocate, bookmark-insert-location, bookmark-insert,
bookmark-delete):
Rename `bookmark' parameter to `bookmark-name', and in some cases
shorten doc string accordingly.
(bookmark-rename):
Change `old' and `new' parameters to `old-name'
and `new-name', and adjust an internal variable to avoid confusion.
(bookmark-jump, bookmark-jump-noselect):
Clarify `bookmark' parameter in doc string.
2010-12-08 08:09:27 +00:00
|
|
|
|
bookmark-name-or-record)
|
2009-10-05 04:19:04 +00:00
|
|
|
|
(signal (car err) (cdr err))))))))))
|
2008-06-25 16:51:33 +00:00
|
|
|
|
;; Added by db.
|
Adjust parameter names and doc strings to resolve confusion over
whether "bookmark" meant a bookmark name or a bookmark record.
Along the way, shorten one function's name for similar reasons.
(Issue #7548)
* lisp/bookmark.el
(bookmark-name-from-record):
New name for `bookmark-name-from-full-record'. All callers changed.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-default-annotation-text, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation,
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,
bookmark-get-handler, bookmark-edit-annotation, bookmark--jump-via,
bookmark-handle-bookmark, bookmark-location, bookmark-show-annotation):
Rename `bookmark' parameter to `bookmark-name-or-record', to
clearly show its role, and shorten or adjust doc strings accordingly.
(bookmark-set-name):
Same, and pass the parameter directly to `bookmark-get-bookmark'
instead of redundantly doing the callee's work.
(bookmark-default-annotation-text, bookmark-send-edited-annotation,
bookmark-relocate, bookmark-insert-location, bookmark-insert,
bookmark-delete):
Rename `bookmark' parameter to `bookmark-name', and in some cases
shorten doc string accordingly.
(bookmark-rename):
Change `old' and `new' parameters to `old-name'
and `new-name', and adjust an internal variable to avoid confusion.
(bookmark-jump, bookmark-jump-noselect):
Clarify `bookmark' parameter in doc string.
2010-12-08 08:09:27 +00:00
|
|
|
|
(when (stringp bookmark-name-or-record)
|
|
|
|
|
(setq bookmark-current-bookmark bookmark-name-or-record))
|
2008-06-25 16:51:33 +00:00
|
|
|
|
nil)
|
|
|
|
|
|
2019-06-12 16:42:46 +00:00
|
|
|
|
(define-error 'bookmark-errors
|
|
|
|
|
"Bookmark error")
|
* lisp/subr.el (define-error): New function.
* doc/lispref/control.texi (Signaling Errors): Refer to define-error.
(Error Symbols): Add `define-error'.
* doc/lispref/errors.texi (Standard Errors): Don't refer to `error-conditions'.
* lisp/progmodes/ada-xref.el (ada-error-file-not-found): Rename from
error-file-not-found and define with define-error.
* lisp/emacs-lisp/cl-lib.el (cl-assertion-failed): Move here from subr.el
and define with define-error.
* lisp/userlock.el (file-locked, file-supersession):
* lisp/simple.el (mark-inactive):
* lisp/progmodes/js.el (js-moz-bad-rpc, js-js-error):
* lisp/progmodes/ada-mode.el (ada-mode-errors):
* lisp/play/life.el (life-extinct):
* lisp/nxml/xsd-regexp.el (xsdre-invalid-regexp, xsdre-parse-error):
* lisp/nxml/xmltok.el (xmltok-markup-declaration-parse-error):
* lisp/nxml/rng-util.el (rng-error):
* lisp/nxml/rng-uri.el (rng-uri-error):
* lisp/nxml/rng-match.el (rng-compile-error):
* lisp/nxml/rng-cmpct.el (rng-c-incorrect-schema):
* lisp/nxml/nxml-util.el (nxml-error, nxml-file-parse-error):
* lisp/nxml/nxml-rap.el (nxml-scan-error):
* lisp/nxml/nxml-outln.el (nxml-outline-error):
* lisp/net/soap-client.el (soap-error):
* lisp/net/gnutls.el (gnutls-error):
* lisp/net/ange-ftp.el (ftp-error):
* lisp/mpc.el (mpc-proc-error):
* lisp/json.el (json-error, json-readtable-error, json-unknown-keyword)
(json-number-format, json-string-escape, json-string-format)
(json-key-format, json-object-format):
* lisp/jka-compr.el (compression-error):
* lisp/international/quail.el (quail-error):
* lisp/international/kkc.el (kkc-error):
* lisp/emacs-lisp/ert.el (ert-test-failed):
* lisp/calc/calc.el (calc-error, inexact-result, math-overflow)
(math-underflow):
* lisp/bookmark.el (bookmark-error-no-filename):
* lisp/epg.el (epg-error): Define with define-error.
2013-08-09 21:22:44 +00:00
|
|
|
|
(define-error 'bookmark-error-no-filename
|
|
|
|
|
"Bookmark has no associated file (or directory)" 'bookmark-errors)
|
2009-10-05 04:19:04 +00:00
|
|
|
|
|
* bookmark.el
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-set-name, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation, 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,
bookmark-location, bookmark-jump, bookmark-jump-other-window,
bookmark-handle-bookmark, bookmark-relocate, bookmark-insert-location,
bookmark-rename, bookmark-insert, bookmark-delete, bookmark-time-to-save-p,
bookmark-edit-annotation-mode, bookmark-edit-annotation): Improve doc
strings to say whether bookmark can be a string or a record or both,
and make other consistency and clarity fixes.
(bookmark-get-handler, bookmark--jump-via, bookmark-write-file,
bookmark-default-annotation-text, bookmark-yank-word,
bookmark-maybe-load-default-file, bookmark-maybe-sort-alist,
bookmark-import-new-list, bookmark-maybe-rename,
bookmark-bmenu-show-filenames, bookmark-bmenu-hide-filenames,
bookmark-bmenu-bookmark): Give these doc strings.
(bookmark-bmenu-check-position): Give this a doc string, but also
add a FIXME comment about how the function may be pointless.
(bookmark-default-handler): Rework doc string and change a parameter
name, to clarify that this takes a bookmark record not a bookmark name.
(bookmark-set): Change a parameter name to indicate its meaning,
and improve the doc string a bit.
(Bug#4188)
2009-10-05 01:35:34 +00:00
|
|
|
|
(defun bookmark-default-handler (bmk-record)
|
2008-06-25 16:51:33 +00:00
|
|
|
|
"Default handler to jump to a particular bookmark location.
|
* bookmark.el
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-set-name, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation, 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,
bookmark-location, bookmark-jump, bookmark-jump-other-window,
bookmark-handle-bookmark, bookmark-relocate, bookmark-insert-location,
bookmark-rename, bookmark-insert, bookmark-delete, bookmark-time-to-save-p,
bookmark-edit-annotation-mode, bookmark-edit-annotation): Improve doc
strings to say whether bookmark can be a string or a record or both,
and make other consistency and clarity fixes.
(bookmark-get-handler, bookmark--jump-via, bookmark-write-file,
bookmark-default-annotation-text, bookmark-yank-word,
bookmark-maybe-load-default-file, bookmark-maybe-sort-alist,
bookmark-import-new-list, bookmark-maybe-rename,
bookmark-bmenu-show-filenames, bookmark-bmenu-hide-filenames,
bookmark-bmenu-bookmark): Give these doc strings.
(bookmark-bmenu-check-position): Give this a doc string, but also
add a FIXME comment about how the function may be pointless.
(bookmark-default-handler): Rework doc string and change a parameter
name, to clarify that this takes a bookmark record not a bookmark name.
(bookmark-set): Change a parameter name to indicate its meaning,
and improve the doc string a bit.
(Bug#4188)
2009-10-05 01:35:34 +00:00
|
|
|
|
BMK-RECORD is a bookmark record, not a bookmark name (i.e., not a string).
|
2022-02-03 21:16:14 +00:00
|
|
|
|
Changes current buffer and point and returns nil, or signals a `file-error'.
|
|
|
|
|
|
|
|
|
|
If BMK-RECORD has a property called `buffer', it should be a live
|
|
|
|
|
buffer object, and this buffer will be selected."
|
2009-10-05 04:19:04 +00:00
|
|
|
|
(let ((file (bookmark-get-filename bmk-record))
|
2010-02-10 20:02:54 +00:00
|
|
|
|
(buf (bookmark-prop-get bmk-record 'buffer))
|
2009-10-05 04:19:04 +00:00
|
|
|
|
(forward-str (bookmark-get-front-context-string bmk-record))
|
|
|
|
|
(behind-str (bookmark-get-rear-context-string bmk-record))
|
|
|
|
|
(place (bookmark-get-position bmk-record)))
|
2010-02-10 20:02:54 +00:00
|
|
|
|
(set-buffer
|
|
|
|
|
(cond
|
|
|
|
|
((and file (file-readable-p file) (not (buffer-live-p buf)))
|
|
|
|
|
(find-file-noselect file))
|
2019-06-18 05:59:11 +00:00
|
|
|
|
;; No file found. See if buffer BUF has been created.
|
2010-02-10 20:02:54 +00:00
|
|
|
|
((and buf (get-buffer buf)))
|
|
|
|
|
(t ;; If not, raise error.
|
|
|
|
|
(signal 'bookmark-error-no-filename (list 'stringp file)))))
|
|
|
|
|
(if place (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.
|
|
|
|
|
(when (and forward-str (search-forward forward-str (point-max) t))
|
|
|
|
|
(goto-char (match-beginning 0)))
|
|
|
|
|
(when (and behind-str (search-backward behind-str (point-min) t))
|
|
|
|
|
(goto-char (match-end 0)))
|
2008-06-25 16:51:33 +00:00
|
|
|
|
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
|
|
|
|
|
|
|
|
|
;;;###autoload
|
Adjust parameter names and doc strings to resolve confusion over
whether "bookmark" meant a bookmark name or a bookmark record.
Along the way, shorten one function's name for similar reasons.
(Issue #7548)
* lisp/bookmark.el
(bookmark-name-from-record):
New name for `bookmark-name-from-full-record'. All callers changed.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-default-annotation-text, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation,
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,
bookmark-get-handler, bookmark-edit-annotation, bookmark--jump-via,
bookmark-handle-bookmark, bookmark-location, bookmark-show-annotation):
Rename `bookmark' parameter to `bookmark-name-or-record', to
clearly show its role, and shorten or adjust doc strings accordingly.
(bookmark-set-name):
Same, and pass the parameter directly to `bookmark-get-bookmark'
instead of redundantly doing the callee's work.
(bookmark-default-annotation-text, bookmark-send-edited-annotation,
bookmark-relocate, bookmark-insert-location, bookmark-insert,
bookmark-delete):
Rename `bookmark' parameter to `bookmark-name', and in some cases
shorten doc string accordingly.
(bookmark-rename):
Change `old' and `new' parameters to `old-name'
and `new-name', and adjust an internal variable to avoid confusion.
(bookmark-jump, bookmark-jump-noselect):
Clarify `bookmark' parameter in doc string.
2010-12-08 08:09:27 +00:00
|
|
|
|
(defun bookmark-relocate (bookmark-name)
|
|
|
|
|
"Relocate BOOKMARK-NAME to another file, reading file name with minibuffer.
|
* bookmark.el
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-set-name, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation, 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,
bookmark-location, bookmark-jump, bookmark-jump-other-window,
bookmark-handle-bookmark, bookmark-relocate, bookmark-insert-location,
bookmark-rename, bookmark-insert, bookmark-delete, bookmark-time-to-save-p,
bookmark-edit-annotation-mode, bookmark-edit-annotation): Improve doc
strings to say whether bookmark can be a string or a record or both,
and make other consistency and clarity fixes.
(bookmark-get-handler, bookmark--jump-via, bookmark-write-file,
bookmark-default-annotation-text, bookmark-yank-word,
bookmark-maybe-load-default-file, bookmark-maybe-sort-alist,
bookmark-import-new-list, bookmark-maybe-rename,
bookmark-bmenu-show-filenames, bookmark-bmenu-hide-filenames,
bookmark-bmenu-bookmark): Give these doc strings.
(bookmark-bmenu-check-position): Give this a doc string, but also
add a FIXME comment about how the function may be pointless.
(bookmark-default-handler): Rework doc string and change a parameter
name, to clarify that this takes a bookmark record not a bookmark name.
(bookmark-set): Change a parameter name to indicate its meaning,
and improve the doc string a bit.
(Bug#4188)
2009-10-05 01:35:34 +00:00
|
|
|
|
|
1996-05-09 17:34:55 +00:00
|
|
|
|
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")))
|
Adjust parameter names and doc strings to resolve confusion over
whether "bookmark" meant a bookmark name or a bookmark record.
Along the way, shorten one function's name for similar reasons.
(Issue #7548)
* lisp/bookmark.el
(bookmark-name-from-record):
New name for `bookmark-name-from-full-record'. All callers changed.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-default-annotation-text, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation,
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,
bookmark-get-handler, bookmark-edit-annotation, bookmark--jump-via,
bookmark-handle-bookmark, bookmark-location, bookmark-show-annotation):
Rename `bookmark' parameter to `bookmark-name-or-record', to
clearly show its role, and shorten or adjust doc strings accordingly.
(bookmark-set-name):
Same, and pass the parameter directly to `bookmark-get-bookmark'
instead of redundantly doing the callee's work.
(bookmark-default-annotation-text, bookmark-send-edited-annotation,
bookmark-relocate, bookmark-insert-location, bookmark-insert,
bookmark-delete):
Rename `bookmark' parameter to `bookmark-name', and in some cases
shorten doc string accordingly.
(bookmark-rename):
Change `old' and `new' parameters to `old-name'
and `new-name', and adjust an internal variable to avoid confusion.
(bookmark-jump, bookmark-jump-noselect):
Clarify `bookmark' parameter in doc string.
2010-12-08 08:09:27 +00:00
|
|
|
|
(bookmark-maybe-historicize-string bookmark-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
|
|
|
|
(bookmark-maybe-load-default-file)
|
2022-11-17 00:59:17 +00:00
|
|
|
|
(let ((bmrk-filename (bookmark-get-filename bookmark-name)))
|
|
|
|
|
;; FIXME: Make `bookmark-relocate' support bookmark Types
|
|
|
|
|
;; besides files and directories.
|
|
|
|
|
(unless bmrk-filename
|
|
|
|
|
(user-error "Cannot relocate bookmark of type \"%s\""
|
|
|
|
|
(bookmark-type-from-full-record
|
|
|
|
|
(bookmark-get-bookmark bookmark-name))))
|
|
|
|
|
(let ((newloc (abbreviate-file-name
|
|
|
|
|
(expand-file-name
|
|
|
|
|
(read-file-name
|
|
|
|
|
(format "Relocate %s to: " bookmark-name)
|
|
|
|
|
(file-name-directory bmrk-filename))))))
|
|
|
|
|
(bookmark-set-filename bookmark-name newloc)
|
|
|
|
|
(bookmark-update-last-modified bookmark-name)
|
|
|
|
|
(setq bookmark-alist-modification-count
|
|
|
|
|
(1+ bookmark-alist-modification-count))
|
|
|
|
|
(when (bookmark-time-to-save-p)
|
2008-06-25 16:51:33 +00:00
|
|
|
|
(bookmark-save))
|
2022-11-17 00:59:17 +00:00
|
|
|
|
(bookmark-bmenu-surreptitiously-rebuild-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
|
Adjust parameter names and doc strings to resolve confusion over
whether "bookmark" meant a bookmark name or a bookmark record.
Along the way, shorten one function's name for similar reasons.
(Issue #7548)
* lisp/bookmark.el
(bookmark-name-from-record):
New name for `bookmark-name-from-full-record'. All callers changed.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-default-annotation-text, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation,
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,
bookmark-get-handler, bookmark-edit-annotation, bookmark--jump-via,
bookmark-handle-bookmark, bookmark-location, bookmark-show-annotation):
Rename `bookmark' parameter to `bookmark-name-or-record', to
clearly show its role, and shorten or adjust doc strings accordingly.
(bookmark-set-name):
Same, and pass the parameter directly to `bookmark-get-bookmark'
instead of redundantly doing the callee's work.
(bookmark-default-annotation-text, bookmark-send-edited-annotation,
bookmark-relocate, bookmark-insert-location, bookmark-insert,
bookmark-delete):
Rename `bookmark' parameter to `bookmark-name', and in some cases
shorten doc string accordingly.
(bookmark-rename):
Change `old' and `new' parameters to `old-name'
and `new-name', and adjust an internal variable to avoid confusion.
(bookmark-jump, bookmark-jump-noselect):
Clarify `bookmark' parameter in doc string.
2010-12-08 08:09:27 +00:00
|
|
|
|
(defun bookmark-insert-location (bookmark-name &optional no-history)
|
|
|
|
|
"Insert the name of the file associated with BOOKMARK-NAME.
|
* bookmark.el
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-set-name, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation, 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,
bookmark-location, bookmark-jump, bookmark-jump-other-window,
bookmark-handle-bookmark, bookmark-relocate, bookmark-insert-location,
bookmark-rename, bookmark-insert, bookmark-delete, bookmark-time-to-save-p,
bookmark-edit-annotation-mode, bookmark-edit-annotation): Improve doc
strings to say whether bookmark can be a string or a record or both,
and make other consistency and clarity fixes.
(bookmark-get-handler, bookmark--jump-via, bookmark-write-file,
bookmark-default-annotation-text, bookmark-yank-word,
bookmark-maybe-load-default-file, bookmark-maybe-sort-alist,
bookmark-import-new-list, bookmark-maybe-rename,
bookmark-bmenu-show-filenames, bookmark-bmenu-hide-filenames,
bookmark-bmenu-bookmark): Give these doc strings.
(bookmark-bmenu-check-position): Give this a doc string, but also
add a FIXME comment about how the function may be pointless.
(bookmark-default-handler): Rework doc string and change a parameter
name, to clarify that this takes a bookmark record not a bookmark name.
(bookmark-set): Change a parameter name to indicate its meaning,
and improve the doc string a bit.
(Bug#4188)
2009-10-05 01:35:34 +00:00
|
|
|
|
|
1995-03-13 22:50:35 +00:00
|
|
|
|
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")))
|
Adjust parameter names and doc strings to resolve confusion over
whether "bookmark" meant a bookmark name or a bookmark record.
Along the way, shorten one function's name for similar reasons.
(Issue #7548)
* lisp/bookmark.el
(bookmark-name-from-record):
New name for `bookmark-name-from-full-record'. All callers changed.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-default-annotation-text, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation,
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,
bookmark-get-handler, bookmark-edit-annotation, bookmark--jump-via,
bookmark-handle-bookmark, bookmark-location, bookmark-show-annotation):
Rename `bookmark' parameter to `bookmark-name-or-record', to
clearly show its role, and shorten or adjust doc strings accordingly.
(bookmark-set-name):
Same, and pass the parameter directly to `bookmark-get-bookmark'
instead of redundantly doing the callee's work.
(bookmark-default-annotation-text, bookmark-send-edited-annotation,
bookmark-relocate, bookmark-insert-location, bookmark-insert,
bookmark-delete):
Rename `bookmark' parameter to `bookmark-name', and in some cases
shorten doc string accordingly.
(bookmark-rename):
Change `old' and `new' parameters to `old-name'
and `new-name', and adjust an internal variable to avoid confusion.
(bookmark-jump, bookmark-jump-noselect):
Clarify `bookmark' parameter in doc string.
2010-12-08 08:09:27 +00:00
|
|
|
|
(or no-history (bookmark-maybe-historicize-string bookmark-name))
|
2013-03-07 22:35:47 +00:00
|
|
|
|
(insert (bookmark-location bookmark-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
|
|
|
|
|
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
|
|
|
|
|
Adjust parameter names and doc strings to resolve confusion over
whether "bookmark" meant a bookmark name or a bookmark record.
Along the way, shorten one function's name for similar reasons.
(Issue #7548)
* lisp/bookmark.el
(bookmark-name-from-record):
New name for `bookmark-name-from-full-record'. All callers changed.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-default-annotation-text, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation,
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,
bookmark-get-handler, bookmark-edit-annotation, bookmark--jump-via,
bookmark-handle-bookmark, bookmark-location, bookmark-show-annotation):
Rename `bookmark' parameter to `bookmark-name-or-record', to
clearly show its role, and shorten or adjust doc strings accordingly.
(bookmark-set-name):
Same, and pass the parameter directly to `bookmark-get-bookmark'
instead of redundantly doing the callee's work.
(bookmark-default-annotation-text, bookmark-send-edited-annotation,
bookmark-relocate, bookmark-insert-location, bookmark-insert,
bookmark-delete):
Rename `bookmark' parameter to `bookmark-name', and in some cases
shorten doc string accordingly.
(bookmark-rename):
Change `old' and `new' parameters to `old-name'
and `new-name', and adjust an internal variable to avoid confusion.
(bookmark-jump, bookmark-jump-noselect):
Clarify `bookmark' parameter in doc string.
2010-12-08 08:09:27 +00:00
|
|
|
|
(defun bookmark-location (bookmark-name-or-record)
|
|
|
|
|
"Return a description of the location of BOOKMARK-NAME-OR-RECORD."
|
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)
|
2010-04-14 15:07:53 +00:00
|
|
|
|
;; We could call the `handler' and ask for it to construct a description
|
|
|
|
|
;; dynamically: it would open up several new possibilities, but it
|
|
|
|
|
;; would have the major disadvantage of forcing to load each and
|
|
|
|
|
;; every handler when the user calls bookmark-menu.
|
Adjust parameter names and doc strings to resolve confusion over
whether "bookmark" meant a bookmark name or a bookmark record.
Along the way, shorten one function's name for similar reasons.
(Issue #7548)
* lisp/bookmark.el
(bookmark-name-from-record):
New name for `bookmark-name-from-full-record'. All callers changed.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-default-annotation-text, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation,
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,
bookmark-get-handler, bookmark-edit-annotation, bookmark--jump-via,
bookmark-handle-bookmark, bookmark-location, bookmark-show-annotation):
Rename `bookmark' parameter to `bookmark-name-or-record', to
clearly show its role, and shorten or adjust doc strings accordingly.
(bookmark-set-name):
Same, and pass the parameter directly to `bookmark-get-bookmark'
instead of redundantly doing the callee's work.
(bookmark-default-annotation-text, bookmark-send-edited-annotation,
bookmark-relocate, bookmark-insert-location, bookmark-insert,
bookmark-delete):
Rename `bookmark' parameter to `bookmark-name', and in some cases
shorten doc string accordingly.
(bookmark-rename):
Change `old' and `new' parameters to `old-name'
and `new-name', and adjust an internal variable to avoid confusion.
(bookmark-jump, bookmark-jump-noselect):
Clarify `bookmark' parameter in doc string.
2010-12-08 08:09:27 +00:00
|
|
|
|
(or (bookmark-prop-get bookmark-name-or-record 'location)
|
|
|
|
|
(bookmark-get-filename bookmark-name-or-record)
|
2010-04-14 15:07:53 +00:00
|
|
|
|
"-- Unknown 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
|
|
|
|
|
(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
|
Adjust parameter names and doc strings to resolve confusion over
whether "bookmark" meant a bookmark name or a bookmark record.
Along the way, shorten one function's name for similar reasons.
(Issue #7548)
* lisp/bookmark.el
(bookmark-name-from-record):
New name for `bookmark-name-from-full-record'. All callers changed.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-default-annotation-text, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation,
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,
bookmark-get-handler, bookmark-edit-annotation, bookmark--jump-via,
bookmark-handle-bookmark, bookmark-location, bookmark-show-annotation):
Rename `bookmark' parameter to `bookmark-name-or-record', to
clearly show its role, and shorten or adjust doc strings accordingly.
(bookmark-set-name):
Same, and pass the parameter directly to `bookmark-get-bookmark'
instead of redundantly doing the callee's work.
(bookmark-default-annotation-text, bookmark-send-edited-annotation,
bookmark-relocate, bookmark-insert-location, bookmark-insert,
bookmark-delete):
Rename `bookmark' parameter to `bookmark-name', and in some cases
shorten doc string accordingly.
(bookmark-rename):
Change `old' and `new' parameters to `old-name'
and `new-name', and adjust an internal variable to avoid confusion.
(bookmark-jump, bookmark-jump-noselect):
Clarify `bookmark' parameter in doc string.
2010-12-08 08:09:27 +00:00
|
|
|
|
(defun bookmark-rename (old-name &optional new-name)
|
|
|
|
|
"Change the name of OLD-NAME bookmark to NEW-NAME name.
|
|
|
|
|
If called from keyboard, prompt for OLD-NAME and NEW-NAME.
|
|
|
|
|
If called from menubar, select OLD-NAME from a menu and prompt for NEW-NAME.
|
* bookmark.el
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-set-name, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation, 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,
bookmark-location, bookmark-jump, bookmark-jump-other-window,
bookmark-handle-bookmark, bookmark-relocate, bookmark-insert-location,
bookmark-rename, bookmark-insert, bookmark-delete, bookmark-time-to-save-p,
bookmark-edit-annotation-mode, bookmark-edit-annotation): Improve doc
strings to say whether bookmark can be a string or a record or both,
and make other consistency and clarity fixes.
(bookmark-get-handler, bookmark--jump-via, bookmark-write-file,
bookmark-default-annotation-text, bookmark-yank-word,
bookmark-maybe-load-default-file, bookmark-maybe-sort-alist,
bookmark-import-new-list, bookmark-maybe-rename,
bookmark-bmenu-show-filenames, bookmark-bmenu-hide-filenames,
bookmark-bmenu-bookmark): Give these doc strings.
(bookmark-bmenu-check-position): Give this a doc string, but also
add a FIXME comment about how the function may be pointless.
(bookmark-default-handler): Rework doc string and change a parameter
name, to clarify that this takes a bookmark record not a bookmark name.
(bookmark-set): Change a parameter name to indicate its meaning,
and improve the doc string a bit.
(Bug#4188)
2009-10-05 01:35:34 +00:00
|
|
|
|
|
Adjust parameter names and doc strings to resolve confusion over
whether "bookmark" meant a bookmark name or a bookmark record.
Along the way, shorten one function's name for similar reasons.
(Issue #7548)
* lisp/bookmark.el
(bookmark-name-from-record):
New name for `bookmark-name-from-full-record'. All callers changed.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-default-annotation-text, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation,
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,
bookmark-get-handler, bookmark-edit-annotation, bookmark--jump-via,
bookmark-handle-bookmark, bookmark-location, bookmark-show-annotation):
Rename `bookmark' parameter to `bookmark-name-or-record', to
clearly show its role, and shorten or adjust doc strings accordingly.
(bookmark-set-name):
Same, and pass the parameter directly to `bookmark-get-bookmark'
instead of redundantly doing the callee's work.
(bookmark-default-annotation-text, bookmark-send-edited-annotation,
bookmark-relocate, bookmark-insert-location, bookmark-insert,
bookmark-delete):
Rename `bookmark' parameter to `bookmark-name', and in some cases
shorten doc string accordingly.
(bookmark-rename):
Change `old' and `new' parameters to `old-name'
and `new-name', and adjust an internal variable to avoid confusion.
(bookmark-jump, bookmark-jump-noselect):
Clarify `bookmark' parameter in doc string.
2010-12-08 08:09:27 +00:00
|
|
|
|
If called from Lisp, prompt for NEW-NAME if only OLD-NAME was passed
|
|
|
|
|
as an argument. If called with two strings, then no prompting is done.
|
|
|
|
|
You must pass at least OLD-NAME when calling from Lisp.
|
1993-08-14 19:49:27 +00:00
|
|
|
|
|
2021-09-22 18:26:40 +00:00
|
|
|
|
While you are entering the new name, consecutive \
|
|
|
|
|
\\<bookmark-minibuffer-read-name-map>\\[bookmark-yank-word]'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")))
|
Adjust parameter names and doc strings to resolve confusion over
whether "bookmark" meant a bookmark name or a bookmark record.
Along the way, shorten one function's name for similar reasons.
(Issue #7548)
* lisp/bookmark.el
(bookmark-name-from-record):
New name for `bookmark-name-from-full-record'. All callers changed.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-default-annotation-text, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation,
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,
bookmark-get-handler, bookmark-edit-annotation, bookmark--jump-via,
bookmark-handle-bookmark, bookmark-location, bookmark-show-annotation):
Rename `bookmark' parameter to `bookmark-name-or-record', to
clearly show its role, and shorten or adjust doc strings accordingly.
(bookmark-set-name):
Same, and pass the parameter directly to `bookmark-get-bookmark'
instead of redundantly doing the callee's work.
(bookmark-default-annotation-text, bookmark-send-edited-annotation,
bookmark-relocate, bookmark-insert-location, bookmark-insert,
bookmark-delete):
Rename `bookmark' parameter to `bookmark-name', and in some cases
shorten doc string accordingly.
(bookmark-rename):
Change `old' and `new' parameters to `old-name'
and `new-name', and adjust an internal variable to avoid confusion.
(bookmark-jump, bookmark-jump-noselect):
Clarify `bookmark' parameter in doc string.
2010-12-08 08:09:27 +00:00
|
|
|
|
(bookmark-maybe-historicize-string old-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
|
|
|
|
(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-yank-point (point))
|
|
|
|
|
(setq bookmark-current-buffer (current-buffer))
|
Adjust parameter names and doc strings to resolve confusion over
whether "bookmark" meant a bookmark name or a bookmark record.
Along the way, shorten one function's name for similar reasons.
(Issue #7548)
* lisp/bookmark.el
(bookmark-name-from-record):
New name for `bookmark-name-from-full-record'. All callers changed.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-default-annotation-text, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation,
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,
bookmark-get-handler, bookmark-edit-annotation, bookmark--jump-via,
bookmark-handle-bookmark, bookmark-location, bookmark-show-annotation):
Rename `bookmark' parameter to `bookmark-name-or-record', to
clearly show its role, and shorten or adjust doc strings accordingly.
(bookmark-set-name):
Same, and pass the parameter directly to `bookmark-get-bookmark'
instead of redundantly doing the callee's work.
(bookmark-default-annotation-text, bookmark-send-edited-annotation,
bookmark-relocate, bookmark-insert-location, bookmark-insert,
bookmark-delete):
Rename `bookmark' parameter to `bookmark-name', and in some cases
shorten doc string accordingly.
(bookmark-rename):
Change `old' and `new' parameters to `old-name'
and `new-name', and adjust an internal variable to avoid confusion.
(bookmark-jump, bookmark-jump-noselect):
Clarify `bookmark' parameter in doc string.
2010-12-08 08:09:27 +00:00
|
|
|
|
(let ((final-new-name
|
|
|
|
|
(or new-name ; use second arg, if non-nil
|
(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
|
|
|
|
(read-from-minibuffer
|
2022-09-25 10:49:23 +00:00
|
|
|
|
(format-prompt "Rename \"%s\" to" nil old-name)
|
(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
|
|
|
|
nil
|
2022-07-04 14:18:54 +00:00
|
|
|
|
(define-keymap
|
|
|
|
|
:parent minibuffer-local-map
|
|
|
|
|
"C-w" #'bookmark-yank-word)
|
(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
|
|
|
|
nil
|
|
|
|
|
'bookmark-history))))
|
Adjust parameter names and doc strings to resolve confusion over
whether "bookmark" meant a bookmark name or a bookmark record.
Along the way, shorten one function's name for similar reasons.
(Issue #7548)
* lisp/bookmark.el
(bookmark-name-from-record):
New name for `bookmark-name-from-full-record'. All callers changed.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-default-annotation-text, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation,
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,
bookmark-get-handler, bookmark-edit-annotation, bookmark--jump-via,
bookmark-handle-bookmark, bookmark-location, bookmark-show-annotation):
Rename `bookmark' parameter to `bookmark-name-or-record', to
clearly show its role, and shorten or adjust doc strings accordingly.
(bookmark-set-name):
Same, and pass the parameter directly to `bookmark-get-bookmark'
instead of redundantly doing the callee's work.
(bookmark-default-annotation-text, bookmark-send-edited-annotation,
bookmark-relocate, bookmark-insert-location, bookmark-insert,
bookmark-delete):
Rename `bookmark' parameter to `bookmark-name', and in some cases
shorten doc string accordingly.
(bookmark-rename):
Change `old' and `new' parameters to `old-name'
and `new-name', and adjust an internal variable to avoid confusion.
(bookmark-jump, bookmark-jump-noselect):
Clarify `bookmark' parameter in doc string.
2010-12-08 08:09:27 +00:00
|
|
|
|
(bookmark-set-name old-name final-new-name)
|
2022-06-08 11:51:41 +00:00
|
|
|
|
(bookmark-update-last-modified final-new-name)
|
Adjust parameter names and doc strings to resolve confusion over
whether "bookmark" meant a bookmark name or a bookmark record.
Along the way, shorten one function's name for similar reasons.
(Issue #7548)
* lisp/bookmark.el
(bookmark-name-from-record):
New name for `bookmark-name-from-full-record'. All callers changed.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-default-annotation-text, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation,
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,
bookmark-get-handler, bookmark-edit-annotation, bookmark--jump-via,
bookmark-handle-bookmark, bookmark-location, bookmark-show-annotation):
Rename `bookmark' parameter to `bookmark-name-or-record', to
clearly show its role, and shorten or adjust doc strings accordingly.
(bookmark-set-name):
Same, and pass the parameter directly to `bookmark-get-bookmark'
instead of redundantly doing the callee's work.
(bookmark-default-annotation-text, bookmark-send-edited-annotation,
bookmark-relocate, bookmark-insert-location, bookmark-insert,
bookmark-delete):
Rename `bookmark' parameter to `bookmark-name', and in some cases
shorten doc string accordingly.
(bookmark-rename):
Change `old' and `new' parameters to `old-name'
and `new-name', and adjust an internal variable to avoid confusion.
(bookmark-jump, bookmark-jump-noselect):
Clarify `bookmark' parameter in doc string.
2010-12-08 08:09:27 +00:00
|
|
|
|
(setq bookmark-current-bookmark final-new-name)
|
(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-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
|
Adjust parameter names and doc strings to resolve confusion over
whether "bookmark" meant a bookmark name or a bookmark record.
Along the way, shorten one function's name for similar reasons.
(Issue #7548)
* lisp/bookmark.el
(bookmark-name-from-record):
New name for `bookmark-name-from-full-record'. All callers changed.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-default-annotation-text, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation,
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,
bookmark-get-handler, bookmark-edit-annotation, bookmark--jump-via,
bookmark-handle-bookmark, bookmark-location, bookmark-show-annotation):
Rename `bookmark' parameter to `bookmark-name-or-record', to
clearly show its role, and shorten or adjust doc strings accordingly.
(bookmark-set-name):
Same, and pass the parameter directly to `bookmark-get-bookmark'
instead of redundantly doing the callee's work.
(bookmark-default-annotation-text, bookmark-send-edited-annotation,
bookmark-relocate, bookmark-insert-location, bookmark-insert,
bookmark-delete):
Rename `bookmark' parameter to `bookmark-name', and in some cases
shorten doc string accordingly.
(bookmark-rename):
Change `old' and `new' parameters to `old-name'
and `new-name', and adjust an internal variable to avoid confusion.
(bookmark-jump, bookmark-jump-noselect):
Clarify `bookmark' parameter in doc string.
2010-12-08 08:09:27 +00:00
|
|
|
|
(defun bookmark-insert (bookmark-name)
|
|
|
|
|
"Insert the text of the file pointed to by bookmark BOOKMARK-NAME.
|
|
|
|
|
BOOKMARK-NAME is a bookmark name (a string), not a bookmark record.
|
* bookmark.el
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-set-name, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation, 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,
bookmark-location, bookmark-jump, bookmark-jump-other-window,
bookmark-handle-bookmark, bookmark-relocate, bookmark-insert-location,
bookmark-rename, bookmark-insert, bookmark-delete, bookmark-time-to-save-p,
bookmark-edit-annotation-mode, bookmark-edit-annotation): Improve doc
strings to say whether bookmark can be a string or a record or both,
and make other consistency and clarity fixes.
(bookmark-get-handler, bookmark--jump-via, bookmark-write-file,
bookmark-default-annotation-text, bookmark-yank-word,
bookmark-maybe-load-default-file, bookmark-maybe-sort-alist,
bookmark-import-new-list, bookmark-maybe-rename,
bookmark-bmenu-show-filenames, bookmark-bmenu-hide-filenames,
bookmark-bmenu-bookmark): Give these doc strings.
(bookmark-bmenu-check-position): Give this a doc string, but also
add a FIXME comment about how the function may be pointless.
(bookmark-default-handler): Rework doc string and change a parameter
name, to clarify that this takes a bookmark record not a bookmark name.
(bookmark-set): Change a parameter name to indicate its meaning,
and improve the doc string a bit.
(Bug#4188)
2009-10-05 01:35:34 +00:00
|
|
|
|
|
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")))
|
Adjust parameter names and doc strings to resolve confusion over
whether "bookmark" meant a bookmark name or a bookmark record.
Along the way, shorten one function's name for similar reasons.
(Issue #7548)
* lisp/bookmark.el
(bookmark-name-from-record):
New name for `bookmark-name-from-full-record'. All callers changed.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-default-annotation-text, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation,
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,
bookmark-get-handler, bookmark-edit-annotation, bookmark--jump-via,
bookmark-handle-bookmark, bookmark-location, bookmark-show-annotation):
Rename `bookmark' parameter to `bookmark-name-or-record', to
clearly show its role, and shorten or adjust doc strings accordingly.
(bookmark-set-name):
Same, and pass the parameter directly to `bookmark-get-bookmark'
instead of redundantly doing the callee's work.
(bookmark-default-annotation-text, bookmark-send-edited-annotation,
bookmark-relocate, bookmark-insert-location, bookmark-insert,
bookmark-delete):
Rename `bookmark' parameter to `bookmark-name', and in some cases
shorten doc string accordingly.
(bookmark-rename):
Change `old' and `new' parameters to `old-name'
and `new-name', and adjust an internal variable to avoid confusion.
(bookmark-jump, bookmark-jump-noselect):
Clarify `bookmark' parameter in doc string.
2010-12-08 08:09:27 +00:00
|
|
|
|
(bookmark-maybe-historicize-string bookmark-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
|
|
|
|
(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))
|
2007-12-26 08:53:06 +00:00
|
|
|
|
(str-to-insert
|
2008-06-25 16:51:33 +00:00
|
|
|
|
(save-current-buffer
|
Adjust parameter names and doc strings to resolve confusion over
whether "bookmark" meant a bookmark name or a bookmark record.
Along the way, shorten one function's name for similar reasons.
(Issue #7548)
* lisp/bookmark.el
(bookmark-name-from-record):
New name for `bookmark-name-from-full-record'. All callers changed.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-default-annotation-text, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation,
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,
bookmark-get-handler, bookmark-edit-annotation, bookmark--jump-via,
bookmark-handle-bookmark, bookmark-location, bookmark-show-annotation):
Rename `bookmark' parameter to `bookmark-name-or-record', to
clearly show its role, and shorten or adjust doc strings accordingly.
(bookmark-set-name):
Same, and pass the parameter directly to `bookmark-get-bookmark'
instead of redundantly doing the callee's work.
(bookmark-default-annotation-text, bookmark-send-edited-annotation,
bookmark-relocate, bookmark-insert-location, bookmark-insert,
bookmark-delete):
Rename `bookmark' parameter to `bookmark-name', and in some cases
shorten doc string accordingly.
(bookmark-rename):
Change `old' and `new' parameters to `old-name'
and `new-name', and adjust an internal variable to avoid confusion.
(bookmark-jump, bookmark-jump-noselect):
Clarify `bookmark' parameter in doc string.
2010-12-08 08:09:27 +00:00
|
|
|
|
(bookmark-handle-bookmark bookmark-name)
|
2007-12-26 08:53:06 +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
|
Adjust parameter names and doc strings to resolve confusion over
whether "bookmark" meant a bookmark name or a bookmark record.
Along the way, shorten one function's name for similar reasons.
(Issue #7548)
* lisp/bookmark.el
(bookmark-name-from-record):
New name for `bookmark-name-from-full-record'. All callers changed.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-default-annotation-text, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation,
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,
bookmark-get-handler, bookmark-edit-annotation, bookmark--jump-via,
bookmark-handle-bookmark, bookmark-location, bookmark-show-annotation):
Rename `bookmark' parameter to `bookmark-name-or-record', to
clearly show its role, and shorten or adjust doc strings accordingly.
(bookmark-set-name):
Same, and pass the parameter directly to `bookmark-get-bookmark'
instead of redundantly doing the callee's work.
(bookmark-default-annotation-text, bookmark-send-edited-annotation,
bookmark-relocate, bookmark-insert-location, bookmark-insert,
bookmark-delete):
Rename `bookmark' parameter to `bookmark-name', and in some cases
shorten doc string accordingly.
(bookmark-rename):
Change `old' and `new' parameters to `old-name'
and `new-name', and adjust an internal variable to avoid confusion.
(bookmark-jump, bookmark-jump-noselect):
Clarify `bookmark' parameter in doc string.
2010-12-08 08:09:27 +00:00
|
|
|
|
(defun bookmark-delete (bookmark-name &optional batch)
|
|
|
|
|
"Delete BOOKMARK-NAME from the bookmark list.
|
* bookmark.el
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-set-name, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation, 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,
bookmark-location, bookmark-jump, bookmark-jump-other-window,
bookmark-handle-bookmark, bookmark-relocate, bookmark-insert-location,
bookmark-rename, bookmark-insert, bookmark-delete, bookmark-time-to-save-p,
bookmark-edit-annotation-mode, bookmark-edit-annotation): Improve doc
strings to say whether bookmark can be a string or a record or both,
and make other consistency and clarity fixes.
(bookmark-get-handler, bookmark--jump-via, bookmark-write-file,
bookmark-default-annotation-text, bookmark-yank-word,
bookmark-maybe-load-default-file, bookmark-maybe-sort-alist,
bookmark-import-new-list, bookmark-maybe-rename,
bookmark-bmenu-show-filenames, bookmark-bmenu-hide-filenames,
bookmark-bmenu-bookmark): Give these doc strings.
(bookmark-bmenu-check-position): Give this a doc string, but also
add a FIXME comment about how the function may be pointless.
(bookmark-default-handler): Rework doc string and change a parameter
name, to clarify that this takes a bookmark record not a bookmark name.
(bookmark-set): Change a parameter name to indicate its meaning,
and improve the doc string a bit.
(Bug#4188)
2009-10-05 01:35:34 +00:00
|
|
|
|
|
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
|
2010-01-02 01:05:44 +00:00
|
|
|
|
not be deleted. Defaults to the \"current\" bookmark (that is, the
|
|
|
|
|
one most recently used in this file, if any).
|
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
|
|
|
|
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)))
|
Adjust parameter names and doc strings to resolve confusion over
whether "bookmark" meant a bookmark name or a bookmark record.
Along the way, shorten one function's name for similar reasons.
(Issue #7548)
* lisp/bookmark.el
(bookmark-name-from-record):
New name for `bookmark-name-from-full-record'. All callers changed.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-default-annotation-text, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation,
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,
bookmark-get-handler, bookmark-edit-annotation, bookmark--jump-via,
bookmark-handle-bookmark, bookmark-location, bookmark-show-annotation):
Rename `bookmark' parameter to `bookmark-name-or-record', to
clearly show its role, and shorten or adjust doc strings accordingly.
(bookmark-set-name):
Same, and pass the parameter directly to `bookmark-get-bookmark'
instead of redundantly doing the callee's work.
(bookmark-default-annotation-text, bookmark-send-edited-annotation,
bookmark-relocate, bookmark-insert-location, bookmark-insert,
bookmark-delete):
Rename `bookmark' parameter to `bookmark-name', and in some cases
shorten doc string accordingly.
(bookmark-rename):
Change `old' and `new' parameters to `old-name'
and `new-name', and adjust an internal variable to avoid confusion.
(bookmark-jump, bookmark-jump-noselect):
Clarify `bookmark' parameter in doc string.
2010-12-08 08:09:27 +00:00
|
|
|
|
(bookmark-maybe-historicize-string bookmark-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
|
|
|
|
(bookmark-maybe-load-default-file)
|
Adjust parameter names and doc strings to resolve confusion over
whether "bookmark" meant a bookmark name or a bookmark record.
Along the way, shorten one function's name for similar reasons.
(Issue #7548)
* lisp/bookmark.el
(bookmark-name-from-record):
New name for `bookmark-name-from-full-record'. All callers changed.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-default-annotation-text, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation,
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,
bookmark-get-handler, bookmark-edit-annotation, bookmark--jump-via,
bookmark-handle-bookmark, bookmark-location, bookmark-show-annotation):
Rename `bookmark' parameter to `bookmark-name-or-record', to
clearly show its role, and shorten or adjust doc strings accordingly.
(bookmark-set-name):
Same, and pass the parameter directly to `bookmark-get-bookmark'
instead of redundantly doing the callee's work.
(bookmark-default-annotation-text, bookmark-send-edited-annotation,
bookmark-relocate, bookmark-insert-location, bookmark-insert,
bookmark-delete):
Rename `bookmark' parameter to `bookmark-name', and in some cases
shorten doc string accordingly.
(bookmark-rename):
Change `old' and `new' parameters to `old-name'
and `new-name', and adjust an internal variable to avoid confusion.
(bookmark-jump, bookmark-jump-noselect):
Clarify `bookmark' parameter in doc string.
2010-12-08 08:09:27 +00:00
|
|
|
|
(let ((will-go (bookmark-get-bookmark bookmark-name 'noerror)))
|
2021-09-13 11:35:53 +00:00
|
|
|
|
(bookmark--remove-fringe-mark will-go)
|
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
|
2008-11-21 19:29:16 +00:00
|
|
|
|
(or (bookmark-get-bookmark bookmark-current-bookmark 'noerror)
|
1993-08-13 00:59:51 +00:00
|
|
|
|
(setq bookmark-current-bookmark nil)))
|
2009-10-09 06:44:40 +00:00
|
|
|
|
(unless batch
|
|
|
|
|
(bookmark-bmenu-surreptitiously-rebuild-list))
|
|
|
|
|
(setq bookmark-alist-modification-count
|
|
|
|
|
(1+ bookmark-alist-modification-count))
|
|
|
|
|
(when (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
|
|
|
|
|
1993-08-10 20:35:31 +00:00
|
|
|
|
|
2020-07-23 21:14:32 +00:00
|
|
|
|
;;;###autoload
|
|
|
|
|
(defun bookmark-delete-all (&optional no-confirm)
|
|
|
|
|
"Permanently delete all bookmarks.
|
|
|
|
|
If optional argument NO-CONFIRM is non-nil, don't ask for
|
|
|
|
|
confirmation."
|
|
|
|
|
(interactive "P")
|
2021-05-05 21:40:52 +00:00
|
|
|
|
;; We don't use `bookmark-menu-confirm-deletion' here because that
|
|
|
|
|
;; variable is specifically to control confirmation prompting in a
|
|
|
|
|
;; bookmark menu buffer, where the user has the marked-for-deletion
|
|
|
|
|
;; bookmarks arrayed in front of them and might have accidentally
|
|
|
|
|
;; hit the key that executes the deletions. The UI situation here
|
|
|
|
|
;; is quite different, by contrast: the user got to this point by a
|
|
|
|
|
;; sequence of keystrokes unlikely to be typed by chance.
|
2020-07-23 21:14:32 +00:00
|
|
|
|
(when (or no-confirm
|
|
|
|
|
(yes-or-no-p "Permanently delete all bookmarks? "))
|
|
|
|
|
(bookmark-maybe-load-default-file)
|
|
|
|
|
(setq bookmark-alist-modification-count
|
|
|
|
|
(+ bookmark-alist-modification-count (length bookmark-alist)))
|
|
|
|
|
(setq bookmark-alist nil)
|
|
|
|
|
(bookmark-bmenu-surreptitiously-rebuild-list)
|
|
|
|
|
(when (bookmark-time-to-save-p)
|
|
|
|
|
(bookmark-save))))
|
|
|
|
|
|
|
|
|
|
|
* bookmark.el
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-set-name, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation, 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,
bookmark-location, bookmark-jump, bookmark-jump-other-window,
bookmark-handle-bookmark, bookmark-relocate, bookmark-insert-location,
bookmark-rename, bookmark-insert, bookmark-delete, bookmark-time-to-save-p,
bookmark-edit-annotation-mode, bookmark-edit-annotation): Improve doc
strings to say whether bookmark can be a string or a record or both,
and make other consistency and clarity fixes.
(bookmark-get-handler, bookmark--jump-via, bookmark-write-file,
bookmark-default-annotation-text, bookmark-yank-word,
bookmark-maybe-load-default-file, bookmark-maybe-sort-alist,
bookmark-import-new-list, bookmark-maybe-rename,
bookmark-bmenu-show-filenames, bookmark-bmenu-hide-filenames,
bookmark-bmenu-bookmark): Give these doc strings.
(bookmark-bmenu-check-position): Give this a doc string, but also
add a FIXME comment about how the function may be pointless.
(bookmark-default-handler): Rework doc string and change a parameter
name, to clarify that this takes a bookmark record not a bookmark name.
(bookmark-set): Change a parameter name to indicate its meaning,
and improve the doc string a bit.
(Bug#4188)
2009-10-05 01:35:34 +00:00
|
|
|
|
(defun bookmark-time-to-save-p (&optional final-time)
|
|
|
|
|
"Return t if it is time to save bookmarks to disk, nil otherwise.
|
|
|
|
|
Optional argument FINAL-TIME means this is being called when Emacs
|
|
|
|
|
is being killed, so save even if `bookmark-save-flag' is a number and
|
|
|
|
|
is greater than `bookmark-alist-modification-count'."
|
|
|
|
|
;; By Gregory M. Saunders <saunders{_AT_}cis.ohio-state.edu>
|
|
|
|
|
(cond (final-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 ()
|
Include interactive-only information in describe-function output
* lisp/help-fns.el (help-fns--interactive-only): New function.
(help-fns-describe-function-functions): Add the above function.
* lisp/simple.el (beginning-of-buffer, end-of-buffer, insert-buffer)
(next-line, previous-line): Remove hand-written interactive-only
information from doc strings, it is auto-generated now.
* lisp/bookmark.el (bookmark-write):
* lisp/epa-mail.el (epa-mail-decrypt, epa-mail-verify, epa-mail-sign)
(epa-mail-import-keys): Mark interactive-only,
and remove hand-written interactive-only information from doc strings.
* lisp/epa.el (epa-decrypt-armor-in-region, epa-verify-region)
(epa-verify-cleartext-in-region, epa-sign-region, epa-encrypt-region):
* lisp/files.el (not-modified):
* lisp/simple.el (mark-whole-buffer): Mark interactive-only.
* doc/lispref/commands.texi (Defining Commands):
Mention that interactive-only also affects describe-function.
* etc/NEWS: Mention this.
2014-03-22 22:36:29 +00:00
|
|
|
|
"Write bookmarks to a file (reading the file name with the minibuffer)."
|
|
|
|
|
(declare (interactive-only bookmark-save))
|
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
|
2019-06-18 05:59:11 +00:00
|
|
|
|
(defun bookmark-save (&optional parg file make-default)
|
|
|
|
|
"Save currently defined bookmarks in FILE.
|
|
|
|
|
FILE defaults to `bookmark-default-file'.
|
|
|
|
|
With prefix PARG, query user for a file to save in.
|
Docfix: use command substitution for 'universal-argument'
* lisp/autoarg.el (autoarg-mode):
* lisp/bookmark.el (bookmark-set, bookmark-set-no-overwrite)
(bookmark-save):
* lisp/calendar/todo-mode.el (todo-insert-item)
(todo-filter-top-priorities)
(todo-filter-top-priorities-multifile):
* lisp/dired-x.el (dired-mark-extension, dired-mark-suffix):
* lisp/eshell/eshell.el (eshell):
* lisp/gnus/gnus-group.el (gnus-group-find-new-groups):
* lisp/gnus/gnus-start.el (gnus-find-new-newsgroups):
* lisp/gnus/gnus-sum.el (gnus-summary-show-article):
* lisp/gnus/gnus.el (gnus-secondary-servers):
* lisp/org/org-timer.el (org-timer-set-timer):
* lisp/org/ox.el (org-export-dispatch-last-position):
* lisp/printing.el (pr-ps-directory-preview)
(pr-ps-directory-using-ghostscript, pr-ps-directory-print)
(pr-ps-directory-ps-print, pr-ps-buffer-preview)
(pr-ps-buffer-using-ghostscript, pr-ps-buffer-print)
(pr-ps-buffer-ps-print, pr-despool-preview)
(pr-despool-using-ghostscript, pr-despool-print)
(pr-despool-ps-print, pr-ps-file-up-ps-print, pr-ps-fast-fire)
(pr-txt-fast-fire):
* lisp/progmodes/idlwave.el (idlwave-complete):
* lisp/progmodes/sh-script.el (sh-set-shell):
* lisp/replace.el (occur):
* lisp/ses.el (ses--advice-yank):
* lisp/simple.el (set-mark-command-repeat-pop):
* lisp/sort.el (delete-duplicate-lines):
* lisp/strokes.el (strokes-help):
* lisp/textmodes/artist.el (artist-mode):
* lisp/textmodes/reftex-cite.el (reftex-citation):
* lisp/textmodes/reftex-dcr.el (reftex-view-crossref):
* lisp/textmodes/reftex-index.el (reftex-index-selection-or-word)
(reftex-display-index):
* lisp/textmodes/reftex-ref.el (reftex-reference):
* lisp/textmodes/reftex-toc.el (reftex-toc):
* lisp/textmodes/reftex-vars.el (reftex-cite-prompt-optional-args)
(reftex-enable-partial-scans):
* lisp/textmodes/texnfo-upd.el (texinfo-master-menu):
* lisp/windmove.el (windmove-display-in-direction)
(windmove-delete-left, windmove-delete-up)
(windmove-delete-right, windmove-delete-down):
* lisp/window.el (recenter-window-group, recenter-other-window): Use
command substitution for 'universal-argument' instead of raw "C-u".
2021-09-16 18:05:48 +00:00
|
|
|
|
If MAKE-DEFAULT is non-nil (interactively with prefix \\[universal-argument] \\[universal-argument])
|
2019-06-18 05:59:11 +00:00
|
|
|
|
the file we save in becomes the new default in the current Emacs
|
|
|
|
|
session (without affecting the value of `bookmark-default-file'.).
|
1993-08-10 20:35:31 +00:00
|
|
|
|
|
1993-08-13 00:59:51 +00:00
|
|
|
|
When you want to load in the bookmarks from a file, use
|
2010-01-02 01:05:44 +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'."
|
2019-06-18 05:59:11 +00:00
|
|
|
|
(interactive
|
|
|
|
|
(list current-prefix-arg nil (equal '(16) 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
|
|
|
|
(bookmark-maybe-load-default-file)
|
2019-06-18 05:59:11 +00:00
|
|
|
|
(unless file
|
|
|
|
|
(setq file
|
|
|
|
|
(let ((default (or (car bookmark-bookmarks-timestamp)
|
|
|
|
|
bookmark-default-file)))
|
|
|
|
|
(if parg
|
|
|
|
|
;; This should be part of the `interactive' spec.
|
2020-09-13 12:58:24 +00:00
|
|
|
|
(read-file-name (format "File to save bookmarks in: (%s) "
|
|
|
|
|
default)
|
2019-06-18 05:59:11 +00:00
|
|
|
|
(file-name-directory default) default)
|
|
|
|
|
default))))
|
|
|
|
|
(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)
|
|
|
|
|
(if make-default
|
|
|
|
|
(let ((default (expand-file-name file)))
|
|
|
|
|
(setq bookmark-bookmarks-timestamp
|
|
|
|
|
(cons default (nth 5 (file-attributes default)))))
|
|
|
|
|
(let ((default (car bookmark-bookmarks-timestamp)))
|
|
|
|
|
(if (string= default (expand-file-name file))
|
|
|
|
|
(setq bookmark-bookmarks-timestamp
|
|
|
|
|
(cons default (nth 5 (file-attributes default))))))))
|
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)
|
* bookmark.el
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-set-name, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation, 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,
bookmark-location, bookmark-jump, bookmark-jump-other-window,
bookmark-handle-bookmark, bookmark-relocate, bookmark-insert-location,
bookmark-rename, bookmark-insert, bookmark-delete, bookmark-time-to-save-p,
bookmark-edit-annotation-mode, bookmark-edit-annotation): Improve doc
strings to say whether bookmark can be a string or a record or both,
and make other consistency and clarity fixes.
(bookmark-get-handler, bookmark--jump-via, bookmark-write-file,
bookmark-default-annotation-text, bookmark-yank-word,
bookmark-maybe-load-default-file, bookmark-maybe-sort-alist,
bookmark-import-new-list, bookmark-maybe-rename,
bookmark-bmenu-show-filenames, bookmark-bmenu-hide-filenames,
bookmark-bmenu-bookmark): Give these doc strings.
(bookmark-bmenu-check-position): Give this a doc string, but also
add a FIXME comment about how the function may be pointless.
(bookmark-default-handler): Rework doc string and change a parameter
name, to clarify that this takes a bookmark record not a bookmark name.
(bookmark-set): Change a parameter name to indicate its meaning,
and improve the doc string a bit.
(Bug#4188)
2009-10-05 01:35:34 +00:00
|
|
|
|
"Write `bookmark-alist' to FILE."
|
2019-06-09 23:38:31 +00:00
|
|
|
|
(let ((reporter (make-progress-reporter
|
|
|
|
|
(format "Saving bookmarks to file %s..." file))))
|
|
|
|
|
(with-current-buffer (get-buffer-create " *Bookmarks*")
|
2017-01-10 15:47:10 +00:00
|
|
|
|
(goto-char (point-min))
|
2019-06-09 23:38:31 +00:00
|
|
|
|
(delete-region (point-min) (point-max))
|
|
|
|
|
(let ((coding-system-for-write
|
|
|
|
|
(or coding-system-for-write
|
|
|
|
|
bookmark-file-coding-system 'utf-8-emacs))
|
|
|
|
|
(print-length nil)
|
|
|
|
|
(print-level nil)
|
|
|
|
|
;; See bug #12503 for why we bind `print-circle'. Users
|
|
|
|
|
;; can define their own bookmark types, which can result in
|
|
|
|
|
;; arbitrary Lisp objects being stored in bookmark records,
|
|
|
|
|
;; and some users create objects containing circularities.
|
|
|
|
|
(print-circle t))
|
|
|
|
|
(insert "(")
|
|
|
|
|
;; Rather than a single call to `pp' we make one per bookmark.
|
|
|
|
|
;; Apparently `pp' has a poor algorithmic complexity, so this
|
|
|
|
|
;; scales a lot better. bug#4485.
|
|
|
|
|
(dolist (i bookmark-alist) (pp i (current-buffer)))
|
2019-06-30 23:21:47 +00:00
|
|
|
|
(insert ")\n")
|
2019-06-09 23:38:31 +00:00
|
|
|
|
;; Make sure the specified encoding can safely encode the
|
|
|
|
|
;; bookmarks. If it cannot, suggest utf-8-emacs as default.
|
|
|
|
|
(with-coding-priority '(utf-8-emacs)
|
|
|
|
|
(setq coding-system-for-write
|
|
|
|
|
(select-safe-coding-system (point-min) (point-max)
|
|
|
|
|
(list t coding-system-for-write))))
|
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
(bookmark-insert-file-format-version-stamp coding-system-for-write)
|
|
|
|
|
(let ((version-control
|
|
|
|
|
(cond
|
|
|
|
|
((null bookmark-version-control) nil)
|
|
|
|
|
((eq 'never bookmark-version-control) 'never)
|
|
|
|
|
((eq 'nospecial bookmark-version-control) version-control)
|
|
|
|
|
(t t))))
|
|
|
|
|
(condition-case nil
|
2020-11-29 00:17:46 +00:00
|
|
|
|
;; There was a stretch of time (about 15 years) when we
|
|
|
|
|
;; used `write-region' below instead of `write-file',
|
|
|
|
|
;; before going back to `write-file' again. So if you're
|
|
|
|
|
;; considering changing it to `write-region', please see
|
|
|
|
|
;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=12507.
|
|
|
|
|
;; That bug tells the story of how we first started using
|
|
|
|
|
;; `write-region' in 2005...
|
|
|
|
|
;;
|
|
|
|
|
;; commit a506054af7cd86a63fda996056c09310966f32ef
|
|
|
|
|
;; Author: Karl Fogel <kfogel@red-bean.com>
|
|
|
|
|
;; AuthorDate: Sat Nov 12 20:30:22 2005 +0000
|
|
|
|
|
;;
|
|
|
|
|
;; (bookmark-write-file): Don't visit the
|
|
|
|
|
;; destination file, just write the data to it
|
|
|
|
|
;; using write-region. This is similar to
|
|
|
|
|
;; 2005-05-29T08:36:26Z!rms@gnu.org of saveplace.el,
|
|
|
|
|
;; but with an additional change to avoid visiting
|
|
|
|
|
;; the file in the first place.
|
|
|
|
|
;;
|
|
|
|
|
;; ...and of how further inquiry led us to investigate (in
|
|
|
|
|
;; 2012 and then again in 2020) and eventually decide that
|
|
|
|
|
;; matching the saveplace.el change doesn't make sense for
|
|
|
|
|
;; bookmark.el. Therefore we reverted to `write-file',
|
|
|
|
|
;; which means numbered backups may now be created,
|
|
|
|
|
;; depending on `bookmark-version-control' as per above.
|
|
|
|
|
(write-file file)
|
2019-06-09 23:38:31 +00:00
|
|
|
|
(file-error (message "Can't write %s" file)))
|
|
|
|
|
(setq bookmark-file-coding-system coding-system-for-write)
|
|
|
|
|
(kill-buffer (current-buffer))
|
|
|
|
|
(progress-reporter-done reporter))))))
|
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)
|
2009-10-25 02:07:45 +00:00
|
|
|
|
"Add NEW-LIST of bookmarks to `bookmark-alist'.
|
|
|
|
|
Rename new bookmarks as needed using suffix \"<N>\" (N=1,2,3...), when
|
|
|
|
|
they conflict with existing bookmark names."
|
2009-10-28 03:09:11 +00:00
|
|
|
|
(let ((names (bookmark-all-names)))
|
|
|
|
|
(dolist (full-record new-list)
|
|
|
|
|
(bookmark-maybe-rename full-record names)
|
|
|
|
|
(setq bookmark-alist (nconc bookmark-alist (list full-record)))
|
2010-12-12 16:53:24 +00:00
|
|
|
|
(push (bookmark-name-from-full-record full-record) names))))
|
(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-maybe-rename (full-record names)
|
2009-10-25 02:07:45 +00:00
|
|
|
|
"Rename bookmark FULL-RECORD if its current name is already used.
|
|
|
|
|
This is a helper for `bookmark-import-new-list'."
|
2010-12-12 16:53:24 +00:00
|
|
|
|
(let ((found-name (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 (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
|
2019-06-18 05:59:11 +00:00
|
|
|
|
(defun bookmark-load (file &optional overwrite no-msg default)
|
1993-08-14 19:49:27 +00:00
|
|
|
|
"Load bookmarks from FILE (which must be in bookmark format).
|
2019-06-18 05:59:11 +00:00
|
|
|
|
Appends loaded bookmarks to the front of the list of bookmarks.
|
|
|
|
|
If argument OVERWRITE is non-nil, existing bookmarks are destroyed.
|
|
|
|
|
Optional third arg NO-MSG means don't display any messages while loading.
|
|
|
|
|
If DEFAULT is non-nil make FILE the new bookmark file to watch.
|
|
|
|
|
Interactively, a prefix arg makes OVERWRITE and DEFAULT non-nil.
|
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
|
2016-04-25 08:28:17 +00:00
|
|
|
|
place. Your own personal bookmark file, specified by the variable
|
|
|
|
|
`bookmark-default-file', is maintained automatically by Emacs; you
|
|
|
|
|
shouldn't need to load it explicitly.
|
(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 you load a file containing bookmarks with the same names as
|
|
|
|
|
bookmarks already present in your Emacs, the new bookmarks will get
|
2014-06-08 07:41:27 +00:00
|
|
|
|
unique numeric suffixes \"<2>\", \"<3>\", etc."
|
1993-08-10 20:35:31 +00:00
|
|
|
|
(interactive
|
2019-06-18 05:59:11 +00:00
|
|
|
|
(let ((default (abbreviate-file-name
|
|
|
|
|
(or (car bookmark-bookmarks-timestamp)
|
|
|
|
|
(expand-file-name bookmark-default-file))))
|
|
|
|
|
(prefix current-prefix-arg))
|
2020-09-13 12:58:24 +00:00
|
|
|
|
(list (read-file-name (format "Load bookmarks from: (%s) " default)
|
2019-06-18 05:59:11 +00:00
|
|
|
|
(file-name-directory default) default 'confirm)
|
|
|
|
|
prefix nil prefix)))
|
|
|
|
|
(let* ((file (expand-file-name file))
|
|
|
|
|
(afile (abbreviate-file-name file)))
|
|
|
|
|
(unless (file-readable-p file)
|
|
|
|
|
(user-error "Cannot read bookmark file %s" afile))
|
2019-06-09 23:38:31 +00:00
|
|
|
|
(let ((reporter
|
2019-06-18 05:59:11 +00:00
|
|
|
|
(unless no-msg
|
2019-06-09 23:38:31 +00:00
|
|
|
|
(make-progress-reporter
|
|
|
|
|
(format "Loading bookmarks from %s..." file)))))
|
2019-06-18 05:59:11 +00:00
|
|
|
|
(with-current-buffer (let (enable-local-variables)
|
2019-06-09 23:38:31 +00:00
|
|
|
|
(find-file-noselect file))
|
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
(let ((blist (bookmark-alist-from-buffer)))
|
2019-06-18 05:59:11 +00:00
|
|
|
|
(unless (listp blist)
|
|
|
|
|
(error "Invalid bookmark list in %s" file))
|
|
|
|
|
;; RW: Upon loading the bookmarks, we could add to each bookmark
|
|
|
|
|
;; in `bookmark-alist' an extra key `bookmark-file', so that
|
|
|
|
|
;; upon reloading the bookmarks with OVERWRITE non-nil,
|
|
|
|
|
;; we overwrite only those bookmarks for which the key `bookmark-file'
|
|
|
|
|
;; matches FILE. `bookmark-save' can ignore this key.
|
|
|
|
|
;; Would this be a useful option?
|
|
|
|
|
(if overwrite
|
|
|
|
|
(setq bookmark-alist blist
|
|
|
|
|
bookmark-alist-modification-count 0)
|
|
|
|
|
(bookmark-import-new-list blist)
|
|
|
|
|
(setq bookmark-alist-modification-count
|
|
|
|
|
(1+ bookmark-alist-modification-count)))
|
|
|
|
|
(if (or default
|
|
|
|
|
(string= file (or (car bookmark-bookmarks-timestamp)
|
|
|
|
|
(expand-file-name bookmark-default-file))))
|
|
|
|
|
(setq bookmark-bookmarks-timestamp
|
|
|
|
|
(cons file (nth 5 (file-attributes file)))))
|
|
|
|
|
(bookmark-bmenu-surreptitiously-rebuild-list)
|
|
|
|
|
(setq bookmark-file-coding-system buffer-file-coding-system))
|
2019-06-09 23:38:31 +00:00
|
|
|
|
(kill-buffer (current-buffer)))
|
2019-06-18 05:59:11 +00:00
|
|
|
|
(unless no-msg
|
2019-06-09 23:38:31 +00:00
|
|
|
|
(progress-reporter-done reporter)))))
|
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
|
|
|
|
|
2019-07-02 01:06:37 +00:00
|
|
|
|
;;; Code supporting the dired-like bookmark list.
|
2008-06-25 16:51:33 +00:00
|
|
|
|
;; Prefix is "bookmark-bmenu" for "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
|
|
|
|
|
|
|
|
|
(defvar bookmark-bmenu-hidden-bookmarks ())
|
|
|
|
|
|
2021-11-17 04:49:05 +00:00
|
|
|
|
(defvar-keymap bookmark-bmenu-mode-map
|
|
|
|
|
:doc "Keymap for `bookmark-bmenu-mode'."
|
|
|
|
|
:parent tabulated-list-mode-map
|
|
|
|
|
"v" #'bookmark-bmenu-select
|
|
|
|
|
"w" #'bookmark-bmenu-locate
|
|
|
|
|
"5" #'bookmark-bmenu-other-frame
|
|
|
|
|
"2" #'bookmark-bmenu-2-window
|
|
|
|
|
"1" #'bookmark-bmenu-1-window
|
|
|
|
|
"j" #'bookmark-bmenu-this-window
|
2021-11-17 06:04:22 +00:00
|
|
|
|
"C-c C-c" #'bookmark-bmenu-this-window
|
2021-11-17 04:49:05 +00:00
|
|
|
|
"f" #'bookmark-bmenu-this-window
|
2021-11-17 06:04:22 +00:00
|
|
|
|
"C-m" #'bookmark-bmenu-this-window
|
2021-11-17 04:49:05 +00:00
|
|
|
|
"o" #'bookmark-bmenu-other-window
|
2021-11-17 06:04:22 +00:00
|
|
|
|
"C-o" #'bookmark-bmenu-switch-other-window
|
2021-11-17 04:49:05 +00:00
|
|
|
|
"s" #'bookmark-bmenu-save
|
2021-11-17 06:04:22 +00:00
|
|
|
|
"C-x C-s" #'bookmark-bmenu-save
|
2021-11-17 04:49:05 +00:00
|
|
|
|
"k" #'bookmark-bmenu-delete
|
2021-11-17 06:04:22 +00:00
|
|
|
|
"C-d" #'bookmark-bmenu-delete-backwards
|
2021-11-17 04:49:05 +00:00
|
|
|
|
"x" #'bookmark-bmenu-execute-deletions
|
|
|
|
|
"d" #'bookmark-bmenu-delete
|
|
|
|
|
"D" #'bookmark-bmenu-delete-all
|
2022-04-02 14:01:43 +00:00
|
|
|
|
"S-SPC" #'previous-line
|
2021-11-17 06:04:22 +00:00
|
|
|
|
"SPC" #'next-line
|
|
|
|
|
"DEL" #'bookmark-bmenu-backup-unmark
|
2021-11-17 04:49:05 +00:00
|
|
|
|
"u" #'bookmark-bmenu-unmark
|
|
|
|
|
"U" #'bookmark-bmenu-unmark-all
|
|
|
|
|
"m" #'bookmark-bmenu-mark
|
|
|
|
|
"M" #'bookmark-bmenu-mark-all
|
|
|
|
|
"l" #'bookmark-bmenu-load
|
|
|
|
|
"r" #'bookmark-bmenu-rename
|
|
|
|
|
"R" #'bookmark-bmenu-relocate
|
|
|
|
|
"t" #'bookmark-bmenu-toggle-filenames
|
|
|
|
|
"a" #'bookmark-bmenu-show-annotation
|
|
|
|
|
"A" #'bookmark-bmenu-show-all-annotations
|
|
|
|
|
"e" #'bookmark-bmenu-edit-annotation
|
|
|
|
|
"/" #'bookmark-bmenu-search
|
2021-11-17 06:04:22 +00:00
|
|
|
|
"<mouse-2>" #'bookmark-bmenu-other-window-with-mouse)
|
Move keymap initialization into declaration.
* lisp/textmodes/enriched.el (enriched-mode-map):
* lisp/textmodes/bib-mode.el (bib-mode-map):
* lisp/term/lk201.el (lk201-function-map):
* lisp/tar-mode.el (tar-mode-map):
* lisp/replace.el (occur-mode-map):
* lisp/progmodes/idlwave.el (idlwave-rinfo-mouse-map, idlwave-rinfo-map):
* lisp/progmodes/idlw-help.el (idlwave-help-mode-map):
* lisp/progmodes/gdb-mi.el (gdb-memory-format-menu, gdb-memory-unit-menu):
* lisp/play/solitaire.el (solitaire-mode-map):
* lisp/play/snake.el (snake-mode-map, snake-null-map):
* lisp/play/pong.el (pong-mode-map):
* lisp/play/handwrite.el (menu-bar-handwrite-map):
* lisp/play/gametree.el (gametree-mode-map):
* lisp/net/rcirc.el (rcirc-mode-map, rcirc-browse-url-map
(rcirc-multiline-minor-mode-map, rcirc-track-minor-mode-map):
* lisp/net/newst-plainview.el (newsticker-menu, newsticker-mode-map)
(newsticker--url-keymap):
* lisp/net/net-utils.el (nslookup-mode-map, ftp-mode-map):
* lisp/menu-bar.el (menu-bar-file-menu, menu-bar-i-search-menu)
(menu-bar-search-menu, menu-bar-replace-menu, menu-bar-goto-menu)
(menu-bar-edit-menu, menu-bar-custom-menu)
(menu-bar-showhide-fringe-ind-menu, menu-bar-showhide-fringe-menu)
(menu-bar-showhide-scroll-bar-menu, menu-bar-showhide-menu)
(menu-bar-line-wrapping-menu, menu-bar-options-menu)
(menu-bar-games-menu, menu-bar-encryption-decryption-menu)
(menu-bar-tools-menu, menu-bar-describe-menu)
(menu-bar-search-documentation-menu, menu-bar-manuals-menu)
(menu-bar-help-menu):
* lisp/mail/rmailsum.el (rmail-summary-mode-map):
* lisp/kmacro.el (kmacro-step-edit-map):
* lisp/ibuffer.el (ibuffer-mode-groups-popup, ibuffer-mode-map)
(ibuffer-mode-operate-map):
* lisp/hi-lock.el (hi-lock-menu, hi-lock-map):
* lisp/emulation/vip.el (vip-mode-map):
* lisp/emacs-lisp/re-builder.el (reb-lisp-mode-map):
* lisp/bookmark.el (bookmark-bmenu-mode-map):
* lisp/help-mode.el (help-mode-map):
* lisp/erc/erc-list.el (erc-list-menu-mode-map):
* lisp/org/org-remember.el (org-remember-mode-map):
* lisp/org/org-src.el (org-src-mode-map): Move initialization into declaration.
2011-02-10 16:56:00 +00:00
|
|
|
|
|
2021-09-22 18:26:40 +00:00
|
|
|
|
(easy-menu-define bookmark-menu bookmark-bmenu-mode-map
|
|
|
|
|
"Menu for `bookmark-bmenu'."
|
2019-06-18 05:59:11 +00:00
|
|
|
|
'("Bookmark"
|
|
|
|
|
["Select Bookmark in This Window" bookmark-bmenu-this-window t]
|
|
|
|
|
["Select Bookmark in Full-Frame Window" bookmark-bmenu-1-window t]
|
|
|
|
|
["Select Bookmark in Other Window" bookmark-bmenu-other-window t]
|
|
|
|
|
["Select Bookmark in Other Frame" bookmark-bmenu-other-frame t]
|
|
|
|
|
["Select Marked Bookmarks" bookmark-bmenu-select t]
|
|
|
|
|
"---"
|
|
|
|
|
["Mark Bookmark" bookmark-bmenu-mark t]
|
2020-07-23 21:14:32 +00:00
|
|
|
|
["Mark all Bookmarks" bookmark-bmenu-mark-all t]
|
2019-06-18 05:59:11 +00:00
|
|
|
|
["Unmark Bookmark" bookmark-bmenu-unmark t]
|
|
|
|
|
["Unmark Backwards" bookmark-bmenu-backup-unmark t]
|
2020-07-23 21:14:32 +00:00
|
|
|
|
["Unmark all Bookmarks" bookmark-bmenu-unmark-all t]
|
2019-06-18 05:59:11 +00:00
|
|
|
|
["Toggle Display of Filenames" bookmark-bmenu-toggle-filenames t]
|
|
|
|
|
["Display Location of Bookmark" bookmark-bmenu-locate t]
|
|
|
|
|
"---"
|
|
|
|
|
("Edit Bookmarks"
|
|
|
|
|
["Rename Bookmark" bookmark-bmenu-rename t]
|
|
|
|
|
["Relocate Bookmark's File" bookmark-bmenu-relocate t]
|
|
|
|
|
["Mark Bookmark for Deletion" bookmark-bmenu-delete t]
|
2020-07-23 21:14:32 +00:00
|
|
|
|
["Mark all Bookmarks for Deletion" bookmark-bmenu-delete-all t]
|
2019-06-18 05:59:11 +00:00
|
|
|
|
["Delete Marked Bookmarks" bookmark-bmenu-execute-deletions t])
|
|
|
|
|
("Annotations"
|
|
|
|
|
["Show Annotation for Current Bookmark" bookmark-bmenu-show-annotation t]
|
|
|
|
|
["Show Annotations for All Bookmarks" bookmark-bmenu-show-all-annotations t]
|
|
|
|
|
["Edit Annotation for Current Bookmark." bookmark-bmenu-edit-annotation t])
|
|
|
|
|
"---"
|
|
|
|
|
["Save Bookmarks" bookmark-bmenu-save t]
|
|
|
|
|
["Load Bookmarks" bookmark-bmenu-load 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 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."
|
2019-07-02 01:06:37 +00:00
|
|
|
|
(if (get-buffer bookmark-bmenu-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
|
|
|
|
(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
|
|
|
|
|
2020-10-17 15:56:44 +00:00
|
|
|
|
(defun bookmark-bmenu--revert ()
|
|
|
|
|
"Re-populate `tabulated-list-entries'."
|
|
|
|
|
(let (entries)
|
|
|
|
|
(dolist (full-record (bookmark-maybe-sort-alist))
|
|
|
|
|
(let* ((name (bookmark-name-from-full-record full-record))
|
2022-02-15 22:39:02 +00:00
|
|
|
|
(type (bookmark-type-from-full-record full-record))
|
2020-10-17 15:56:44 +00:00
|
|
|
|
(annotation (bookmark-get-annotation full-record))
|
|
|
|
|
(location (bookmark-location full-record)))
|
|
|
|
|
(push (list
|
|
|
|
|
full-record
|
|
|
|
|
`[,(if (and annotation (not (string-equal annotation "")))
|
|
|
|
|
"*" "")
|
|
|
|
|
,(if (display-mouse-p)
|
|
|
|
|
(propertize name
|
|
|
|
|
'font-lock-face 'bookmark-menu-bookmark
|
|
|
|
|
'mouse-face 'highlight
|
|
|
|
|
'follow-link t
|
|
|
|
|
'help-echo "mouse-2: go to this bookmark in other window")
|
|
|
|
|
name)
|
2022-02-15 22:39:02 +00:00
|
|
|
|
,(or type "")
|
2020-10-17 15:56:44 +00:00
|
|
|
|
,@(if bookmark-bmenu-toggle-filenames
|
|
|
|
|
(list location))])
|
|
|
|
|
entries)))
|
2022-04-24 19:07:21 +00:00
|
|
|
|
;; The value of `bookmark-sort-flag' might have changed since the
|
|
|
|
|
;; last time the buffer contents were generated, so re-check it.
|
2022-05-31 18:35:39 +00:00
|
|
|
|
(cond ((eq bookmark-sort-flag t)
|
|
|
|
|
(setq tabulated-list-sort-key '("Bookmark Name" . nil)
|
|
|
|
|
tabulated-list-entries entries))
|
|
|
|
|
((or (null bookmark-sort-flag)
|
|
|
|
|
(eq bookmark-sort-flag 'last-modified))
|
|
|
|
|
(setq tabulated-list-sort-key nil)
|
|
|
|
|
;; And since we're not sorting by bookmark name, show bookmarks
|
|
|
|
|
;; according to order of creation, with the most recently
|
|
|
|
|
;; created bookmarks at the top and the least recently created
|
|
|
|
|
;; at the bottom.
|
|
|
|
|
;;
|
|
|
|
|
;; Note that clicking the column sort toggle for the bookmark
|
|
|
|
|
;; name column will invoke the `tabulated-list-mode' sort, which
|
|
|
|
|
;; uses `bookmark-bmenu--name-predicate' to sort lexically by
|
|
|
|
|
;; bookmark name instead of by (reverse) creation order.
|
|
|
|
|
;; Clicking the toggle again will reverse the lexical sort, but
|
|
|
|
|
;; the sort will still be lexical not creation-order. However,
|
|
|
|
|
;; if the user reverts the buffer, then the above check of
|
|
|
|
|
;; `bookmark-sort-flag' will happen again and the buffer will
|
|
|
|
|
;; go back to a creation-order sort. This is all expected
|
|
|
|
|
;; behavior, as documented in `bookmark-bmenu-mode'.
|
|
|
|
|
(setq tabulated-list-entries (reverse entries))))
|
2022-04-25 17:30:02 +00:00
|
|
|
|
;; Generate the header only after `tabulated-list-sort-key' is
|
|
|
|
|
;; settled, because if that's non-nil then the sort-direction
|
|
|
|
|
;; indicator will be shown in the named column, but if it's
|
|
|
|
|
;; nil then the indicator will not be shown.
|
|
|
|
|
(tabulated-list-init-header))
|
2020-10-17 15:56:44 +00:00
|
|
|
|
(tabulated-list-print 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
|
|
|
|
|
2020-08-08 11:45:23 +00:00
|
|
|
|
;;;###autoload
|
|
|
|
|
(defun bookmark-bmenu-get-buffer ()
|
|
|
|
|
"Return the Bookmark List, building it if it doesn't exists.
|
|
|
|
|
Don't affect the buffer ring order."
|
|
|
|
|
(or (get-buffer bookmark-bmenu-buffer)
|
|
|
|
|
(save-excursion
|
|
|
|
|
(save-window-excursion
|
|
|
|
|
(bookmark-bmenu-list)
|
|
|
|
|
(get-buffer bookmark-bmenu-buffer)))))
|
|
|
|
|
|
|
|
|
|
(custom-add-choice 'tab-bar-new-tab-choice
|
|
|
|
|
'(const :tag "Bookmark List" bookmark-bmenu-get-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
|
|
|
|
;;;###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)
|
2019-07-02 01:06:37 +00:00
|
|
|
|
(let ((buf (get-buffer-create bookmark-bmenu-buffer)))
|
2009-10-25 18:09:57 +00:00
|
|
|
|
(if (called-interactively-p 'interactive)
|
2011-09-02 16:38:40 +00:00
|
|
|
|
(switch-to-buffer buf)
|
2009-10-25 18:09:57 +00:00
|
|
|
|
(set-buffer buf)))
|
2020-10-17 15:56:44 +00:00
|
|
|
|
(bookmark-bmenu-mode)
|
|
|
|
|
(bookmark-bmenu--revert))
|
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
|
|
|
|
|
|
|
|
|
;;;###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
|
|
|
|
|
2020-10-17 15:56:44 +00:00
|
|
|
|
(define-obsolete-function-alias 'bookmark-bmenu-set-header
|
|
|
|
|
#'tabulated-list-init-header "28.1")
|
|
|
|
|
|
|
|
|
|
(define-derived-mode bookmark-bmenu-mode tabulated-list-mode "Bookmark Menu"
|
(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.
|
2022-04-24 19:07:21 +00:00
|
|
|
|
|
|
|
|
|
If `bookmark-sort-flag' is non-nil, then sort the list by
|
|
|
|
|
bookmark name (case-insensitively, in collation order); the
|
|
|
|
|
direction of that sort can be reversed by using the column sort
|
|
|
|
|
toggle for the bookmark name column.
|
|
|
|
|
|
|
|
|
|
If `bookmark-sort-flag' is nil, then sort the list by bookmark
|
|
|
|
|
creation order, with most recently created bookmarks on top.
|
|
|
|
|
However, the column sort toggle will still activate (and
|
|
|
|
|
thereafter toggle the direction of) lexical sorting by bookmark name.
|
|
|
|
|
At any time you may use \\[revert-buffer] to go back to sorting by creation order.
|
|
|
|
|
|
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.
|
2020-07-23 21:14:32 +00:00
|
|
|
|
\\[bookmark-bmenu-mark-all] -- mark all listed bookmarks to be displayed.
|
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-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.
|
2018-10-13 20:06:41 +00:00
|
|
|
|
\\[bookmark-bmenu-other-frame] -- select this bookmark in another frame.
|
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.
|
2010-01-02 01:05:44 +00:00
|
|
|
|
\\[bookmark-bmenu-rename] -- rename this bookmark (prompts for new name).
|
|
|
|
|
\\[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.
|
2020-07-23 21:14:32 +00:00
|
|
|
|
\\[bookmark-bmenu-delete-all] -- mark all listed bookmarks as to be deleted.
|
|
|
|
|
\\[bookmark-bmenu-execute-deletions] -- delete bookmarks marked with `\\[bookmark-bmenu-delete]' or `\\[bookmark-bmenu-delete-all]'.
|
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.
|
2020-07-23 21:14:32 +00:00
|
|
|
|
\\[bookmark-bmenu-unmark-all] -- remove all kinds of marks from all listed 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
|
|
|
|
\\[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.
|
2020-07-18 07:53:20 +00:00
|
|
|
|
\\[bookmark-bmenu-edit-annotation] -- edit the annotation for the current bookmark.
|
2022-04-24 19:07:21 +00:00
|
|
|
|
\\[bookmark-bmenu-search] -- incrementally search for bookmarks.
|
|
|
|
|
\\[revert-buffer] -- refresh the buffer, and thus refresh the sort order (useful
|
|
|
|
|
if `bookmark-sort-flag' is 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
|
|
|
|
(setq truncate-lines t)
|
2020-10-17 15:56:44 +00:00
|
|
|
|
(setq buffer-read-only t)
|
|
|
|
|
;; FIXME: The header could also display the current default bookmark file
|
|
|
|
|
;; according to `bookmark-bookmarks-timestamp'.
|
|
|
|
|
(setq tabulated-list-format
|
|
|
|
|
`[("" 1) ;; Space to add "*" for bookmark with annotation
|
2022-04-24 19:07:21 +00:00
|
|
|
|
("Bookmark Name"
|
|
|
|
|
,bookmark-bmenu-file-column bookmark-bmenu--name-predicate)
|
2022-02-17 11:57:15 +00:00
|
|
|
|
("Type" 8 bookmark-bmenu--type-predicate)
|
2020-10-17 15:56:44 +00:00
|
|
|
|
,@(if bookmark-bmenu-toggle-filenames
|
|
|
|
|
'(("File" 0 bookmark-bmenu--file-predicate)))])
|
|
|
|
|
(setq tabulated-list-padding bookmark-bmenu-marks-width)
|
2022-05-31 18:35:39 +00:00
|
|
|
|
(when (and bookmark-sort-flag
|
|
|
|
|
(not (eq bookmark-sort-flag 'last-modified)))
|
2022-04-24 19:07:21 +00:00
|
|
|
|
(setq tabulated-list-sort-key '("Bookmark Name" . nil)))
|
2020-10-17 15:56:44 +00:00
|
|
|
|
(add-hook 'tabulated-list-revert-hook #'bookmark-bmenu--revert nil t)'
|
|
|
|
|
(setq revert-buffer-function 'bookmark-bmenu--revert)
|
|
|
|
|
(tabulated-list-init-header))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun bookmark-bmenu--name-predicate (a b)
|
|
|
|
|
"Predicate to sort \"*Bookmark List*\" buffer by the name column.
|
|
|
|
|
This is used for `tabulated-list-format' in `bookmark-bmenu-mode'."
|
2022-04-24 19:07:21 +00:00
|
|
|
|
(string-collate-lessp (caar a) (caar b) nil t))
|
2020-10-17 15:56:44 +00:00
|
|
|
|
|
2022-02-15 22:39:02 +00:00
|
|
|
|
(defun bookmark-bmenu--type-predicate (a b)
|
|
|
|
|
"Predicate to sort \"*Bookmark List*\" buffer by the type column.
|
|
|
|
|
This is used for `tabulated-list-format' in `bookmark-bmenu-mode'."
|
2022-04-24 19:07:21 +00:00
|
|
|
|
(string-collate-lessp (elt (cadr a) 2) (elt (cadr b) 2) nil t))
|
2020-10-17 15:56:44 +00:00
|
|
|
|
|
|
|
|
|
(defun bookmark-bmenu--file-predicate (a b)
|
|
|
|
|
"Predicate to sort \"*Bookmark List*\" buffer by the file column.
|
|
|
|
|
This is used for `tabulated-list-format' in `bookmark-bmenu-mode'."
|
2022-04-24 19:07:21 +00:00
|
|
|
|
(string-collate-lessp (bookmark-location (car a))
|
|
|
|
|
(bookmark-location (car b))
|
|
|
|
|
nil t))
|
2011-02-01 21:22:21 +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."
|
2021-02-14 20:37:23 +00:00
|
|
|
|
(interactive nil 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
|
|
|
|
(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 t))
|
|
|
|
|
(bookmark-bmenu-toggle-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
|
2013-03-07 22:33:22 +00:00
|
|
|
|
(setq bookmark-bmenu-toggle-filenames t)))
|
2020-10-17 15:56:44 +00:00
|
|
|
|
(bookmark-bmenu-surreptitiously-rebuild-list))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun bookmark-bmenu-show-filenames (&optional _)
|
|
|
|
|
"In an interactive bookmark list, show filenames along with bookmarks."
|
|
|
|
|
(setq bookmark-bmenu-toggle-filenames t)
|
|
|
|
|
(bookmark-bmenu-surreptitiously-rebuild-list))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun bookmark-bmenu-hide-filenames (&optional _)
|
|
|
|
|
"In an interactive bookmark list, hide the filenames of the bookmarks."
|
|
|
|
|
(setq bookmark-bmenu-toggle-filenames nil)
|
|
|
|
|
(bookmark-bmenu-surreptitiously-rebuild-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
|
|
|
|
|
2010-01-02 04:36:17 +00:00
|
|
|
|
(defun bookmark-bmenu-ensure-position ()
|
2009-10-25 02:07:45 +00:00
|
|
|
|
"If point is not on a bookmark line, move it to one.
|
2020-10-17 15:56:44 +00:00
|
|
|
|
If after the last full line, move to the last full line. The
|
|
|
|
|
return value is undefined."
|
|
|
|
|
(cond ((and (bolp) (eobp))
|
2010-01-02 04:36:17 +00:00
|
|
|
|
(beginning-of-line 0))))
|
(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.el
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-set-name, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation, 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,
bookmark-location, bookmark-jump, bookmark-jump-other-window,
bookmark-handle-bookmark, bookmark-relocate, bookmark-insert-location,
bookmark-rename, bookmark-insert, bookmark-delete, bookmark-time-to-save-p,
bookmark-edit-annotation-mode, bookmark-edit-annotation): Improve doc
strings to say whether bookmark can be a string or a record or both,
and make other consistency and clarity fixes.
(bookmark-get-handler, bookmark--jump-via, bookmark-write-file,
bookmark-default-annotation-text, bookmark-yank-word,
bookmark-maybe-load-default-file, bookmark-maybe-sort-alist,
bookmark-import-new-list, bookmark-maybe-rename,
bookmark-bmenu-show-filenames, bookmark-bmenu-hide-filenames,
bookmark-bmenu-bookmark): Give these doc strings.
(bookmark-bmenu-check-position): Give this a doc string, but also
add a FIXME comment about how the function may be pointless.
(bookmark-default-handler): Rework doc string and change a parameter
name, to clarify that this takes a bookmark record not a bookmark name.
(bookmark-set): Change a parameter name to indicate its meaning,
and improve the doc string a bit.
(Bug#4188)
2009-10-05 01:35:34 +00:00
|
|
|
|
"Return the bookmark for this line in an interactive bookmark list buffer."
|
2010-01-02 04:36:17 +00:00
|
|
|
|
(bookmark-bmenu-ensure-position)
|
2020-10-17 15:56:44 +00:00
|
|
|
|
(let* ((id (tabulated-list-get-id))
|
|
|
|
|
(entry (and id (assoc id tabulated-list-entries))))
|
|
|
|
|
(if entry
|
|
|
|
|
(caar entry)
|
|
|
|
|
"")))
|
(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
|
|
|
|
|
Adjust parameter names and doc strings to resolve confusion over
whether "bookmark" meant a bookmark name or a bookmark record.
Along the way, shorten one function's name for similar reasons.
(Issue #7548)
* lisp/bookmark.el
(bookmark-name-from-record):
New name for `bookmark-name-from-full-record'. All callers changed.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-default-annotation-text, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation,
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,
bookmark-get-handler, bookmark-edit-annotation, bookmark--jump-via,
bookmark-handle-bookmark, bookmark-location, bookmark-show-annotation):
Rename `bookmark' parameter to `bookmark-name-or-record', to
clearly show its role, and shorten or adjust doc strings accordingly.
(bookmark-set-name):
Same, and pass the parameter directly to `bookmark-get-bookmark'
instead of redundantly doing the callee's work.
(bookmark-default-annotation-text, bookmark-send-edited-annotation,
bookmark-relocate, bookmark-insert-location, bookmark-insert,
bookmark-delete):
Rename `bookmark' parameter to `bookmark-name', and in some cases
shorten doc string accordingly.
(bookmark-rename):
Change `old' and `new' parameters to `old-name'
and `new-name', and adjust an internal variable to avoid confusion.
(bookmark-jump, bookmark-jump-noselect):
Clarify `bookmark' parameter in doc string.
2010-12-08 08:09:27 +00:00
|
|
|
|
(defun bookmark-show-annotation (bookmark-name-or-record)
|
2019-05-26 10:48:26 +00:00
|
|
|
|
"Display the annotation for BOOKMARK-NAME-OR-RECORD in a buffer.
|
|
|
|
|
If the annotation does not exist, do nothing."
|
Adjust parameter names and doc strings to resolve confusion over
whether "bookmark" meant a bookmark name or a bookmark record.
Along the way, shorten one function's name for similar reasons.
(Issue #7548)
* lisp/bookmark.el
(bookmark-name-from-record):
New name for `bookmark-name-from-full-record'. All callers changed.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-default-annotation-text, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation,
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,
bookmark-get-handler, bookmark-edit-annotation, bookmark--jump-via,
bookmark-handle-bookmark, bookmark-location, bookmark-show-annotation):
Rename `bookmark' parameter to `bookmark-name-or-record', to
clearly show its role, and shorten or adjust doc strings accordingly.
(bookmark-set-name):
Same, and pass the parameter directly to `bookmark-get-bookmark'
instead of redundantly doing the callee's work.
(bookmark-default-annotation-text, bookmark-send-edited-annotation,
bookmark-relocate, bookmark-insert-location, bookmark-insert,
bookmark-delete):
Rename `bookmark' parameter to `bookmark-name', and in some cases
shorten doc string accordingly.
(bookmark-rename):
Change `old' and `new' parameters to `old-name'
and `new-name', and adjust an internal variable to avoid confusion.
(bookmark-jump, bookmark-jump-noselect):
Clarify `bookmark' parameter in doc string.
2010-12-08 08:09:27 +00:00
|
|
|
|
(let ((annotation (bookmark-get-annotation bookmark-name-or-record)))
|
2010-07-13 22:17:51 +00:00
|
|
|
|
(when (and annotation (not (string-equal annotation "")))
|
|
|
|
|
(save-excursion
|
|
|
|
|
(let ((old-buf (current-buffer)))
|
|
|
|
|
(pop-to-buffer (get-buffer-create "*Bookmark Annotation*") t)
|
2019-06-18 05:59:11 +00:00
|
|
|
|
(let (buffer-read-only)
|
|
|
|
|
(erase-buffer)
|
|
|
|
|
(insert annotation)
|
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
(set-buffer-modified-p nil))
|
|
|
|
|
(setq buffer-read-only t)
|
2010-07-13 22:17:51 +00:00
|
|
|
|
(switch-to-buffer-other-window 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."
|
2009-10-28 03:09:11 +00:00
|
|
|
|
(save-selected-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
|
|
|
|
(pop-to-buffer (get-buffer-create "*Bookmark Annotation*") t)
|
2019-06-18 05:59:11 +00:00
|
|
|
|
(let (buffer-read-only)
|
|
|
|
|
(erase-buffer)
|
|
|
|
|
(dolist (full-record (bookmark-maybe-sort-alist))
|
|
|
|
|
(let* ((name (bookmark-name-from-full-record full-record))
|
|
|
|
|
(ann (bookmark-get-annotation full-record)))
|
|
|
|
|
(insert (concat name ":\n"))
|
|
|
|
|
(if (and ann (not (string-equal ann "")))
|
|
|
|
|
;; insert the annotation, indented by 4 spaces.
|
|
|
|
|
(progn
|
|
|
|
|
(save-excursion (insert ann) (unless (bolp)
|
|
|
|
|
(insert "\n")))
|
|
|
|
|
(while (< (point) (point-max))
|
|
|
|
|
(beginning-of-line) ; paranoia
|
|
|
|
|
(insert " ")
|
|
|
|
|
(forward-line)
|
|
|
|
|
(end-of-line))))))
|
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
(set-buffer-modified-p nil))
|
|
|
|
|
(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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(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]."
|
2021-02-14 20:37:23 +00:00
|
|
|
|
(interactive nil bookmark-bmenu-mode)
|
2010-01-02 04:36:17 +00:00
|
|
|
|
(bookmark-bmenu-ensure-position)
|
2020-10-17 15:56:44 +00:00
|
|
|
|
(tabulated-list-put-tag ">" 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
|
|
|
|
|
2020-07-23 21:14:32 +00:00
|
|
|
|
(defun bookmark-bmenu-mark-all ()
|
|
|
|
|
"Mark all listed bookmarks to be displayed by \\<bookmark-bmenu-mode-map>\\[bookmark-bmenu-select]."
|
2021-02-14 20:37:23 +00:00
|
|
|
|
(interactive nil bookmark-bmenu-mode)
|
2020-07-23 21:14:32 +00:00
|
|
|
|
(save-excursion
|
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
(bookmark-bmenu-ensure-position)
|
2020-10-17 15:56:44 +00:00
|
|
|
|
(while (not (eobp))
|
|
|
|
|
(tabulated-list-put-tag ">" t))))
|
2020-07-23 21:14: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
|
|
|
|
(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 `>'.
|
2020-07-23 21:14:32 +00:00
|
|
|
|
You can mark bookmarks with the \\<bookmark-bmenu-mode-map>\\[bookmark-bmenu-mark] or \\<bookmark-bmenu-mode-map>\\[bookmark-bmenu-mark-all] commands."
|
2021-02-14 20:37:23 +00:00
|
|
|
|
(interactive nil bookmark-bmenu-mode)
|
2010-01-02 04:36:17 +00:00
|
|
|
|
(let ((bmrk (bookmark-bmenu-bookmark))
|
|
|
|
|
(menu (current-buffer))
|
|
|
|
|
(others ())
|
|
|
|
|
tem)
|
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
(while (re-search-forward "^>" nil t)
|
|
|
|
|
(setq tem (bookmark-bmenu-bookmark))
|
|
|
|
|
(let ((inhibit-read-only t))
|
|
|
|
|
(delete-char -1)
|
|
|
|
|
(insert ?\s))
|
|
|
|
|
(or (string-equal tem bmrk)
|
|
|
|
|
(member tem others)
|
|
|
|
|
(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)
|
|
|
|
|
(if others
|
|
|
|
|
(while others
|
|
|
|
|
(split-window nil tem)
|
|
|
|
|
(other-window 1)
|
|
|
|
|
(bookmark-jump (car others))
|
|
|
|
|
(setq others (cdr others)))
|
|
|
|
|
(other-window 1))))
|
(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
|
|
|
|
|
2010-01-02 07:08:02 +00:00
|
|
|
|
(defun bookmark-bmenu-any-marks ()
|
|
|
|
|
"Return non-nil if any bookmarks are marked in the marks column."
|
|
|
|
|
(save-excursion
|
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
(bookmark-bmenu-ensure-position)
|
|
|
|
|
(catch 'found-mark
|
|
|
|
|
(while (not (eobp))
|
|
|
|
|
(beginning-of-line)
|
|
|
|
|
(if (looking-at "^\\S-")
|
|
|
|
|
(throw 'found-mark t)
|
|
|
|
|
(forward-line 1)))
|
|
|
|
|
nil)))
|
|
|
|
|
|
|
|
|
|
|
2019-06-18 05:59:11 +00:00
|
|
|
|
(defun bookmark-bmenu-save ()
|
(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.
|
2021-09-22 18:26:40 +00:00
|
|
|
|
With a prefix arg, prompt for a file to save them in.
|
2021-05-26 19:28:11 +00:00
|
|
|
|
|
|
|
|
|
See also the related behaviors of `bookmark-load' and
|
|
|
|
|
`bookmark-bmenu-load'."
|
2021-02-14 20:37:23 +00:00
|
|
|
|
(interactive nil 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
|
|
|
|
(save-excursion
|
|
|
|
|
(save-window-excursion
|
2019-06-18 05:59:11 +00:00
|
|
|
|
(call-interactively 'bookmark-save)
|
2010-01-02 18:57:02 +00:00
|
|
|
|
(set-buffer-modified-p 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
|
|
|
|
|
|
|
|
|
(defun bookmark-bmenu-load ()
|
2021-05-26 19:28:11 +00:00
|
|
|
|
"Load bookmarks from a file and rebuild the bookmark menu-buffer.
|
|
|
|
|
Prompt for a file, with the default choice being the value of
|
|
|
|
|
`bookmark-default-file'.
|
|
|
|
|
|
|
|
|
|
With a prefix argument, replace the current ambient bookmarks
|
|
|
|
|
(i.e., the ones in `bookmark-alist') with the ones from the selected
|
|
|
|
|
file and make that file be the new value of `bookmark-default-file'.
|
|
|
|
|
In other words, a prefix argument means \"switch over to the bookmark
|
|
|
|
|
universe defined in the loaded file\". Without a prefix argument,
|
|
|
|
|
just add the loaded bookmarks into the current ambient set.
|
|
|
|
|
|
|
|
|
|
See the documentation for `bookmark-load' for more details; see also
|
|
|
|
|
the related behaviors of `bookmark-save' and `bookmark-bmenu-save'."
|
2021-02-14 20:37:23 +00:00
|
|
|
|
(interactive nil bookmark-bmenu-mode)
|
2010-01-02 04:36:17 +00:00
|
|
|
|
(bookmark-bmenu-ensure-position)
|
|
|
|
|
(save-excursion
|
|
|
|
|
(save-window-excursion
|
|
|
|
|
;; This will call `bookmark-bmenu-list'
|
|
|
|
|
(call-interactively 'bookmark-load))))
|
(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-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."
|
2021-02-14 20:37:23 +00:00
|
|
|
|
(interactive nil bookmark-bmenu-mode)
|
2010-01-02 04:36:17 +00:00
|
|
|
|
(bookmark-jump (bookmark-bmenu-bookmark))
|
|
|
|
|
(bury-buffer (other-buffer))
|
|
|
|
|
(delete-other-windows))
|
(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-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."
|
2021-02-14 20:37:23 +00:00
|
|
|
|
(interactive nil bookmark-bmenu-mode)
|
2010-01-02 04:36:17 +00:00
|
|
|
|
(let ((bmrk (bookmark-bmenu-bookmark))
|
|
|
|
|
(menu (current-buffer))
|
|
|
|
|
(pop-up-windows t))
|
|
|
|
|
(delete-other-windows)
|
2011-07-14 01:40:30 +00:00
|
|
|
|
(switch-to-buffer (other-buffer) nil t)
|
2010-07-04 19:57:02 +00:00
|
|
|
|
(bookmark--jump-via bmrk 'pop-to-buffer)
|
2010-01-02 04:36:17 +00:00
|
|
|
|
(bury-buffer menu)))
|
(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-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."
|
2021-02-14 20:37:23 +00:00
|
|
|
|
(interactive nil bookmark-bmenu-mode)
|
2010-01-02 04:36:17 +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
|
|
|
|
|
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."
|
2021-02-14 20:37:23 +00:00
|
|
|
|
(interactive nil bookmark-bmenu-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
|
|
|
|
(let ((bookmark (bookmark-bmenu-bookmark)))
|
2010-07-04 19:57:02 +00:00
|
|
|
|
(bookmark--jump-via bookmark 'switch-to-buffer-other-window)))
|
1995-03-15 14:47:09 +00:00
|
|
|
|
|
|
|
|
|
|
2018-10-13 20:06:41 +00:00
|
|
|
|
(defun bookmark-bmenu-other-frame ()
|
|
|
|
|
"Select this line's bookmark in other frame."
|
2021-02-14 20:37:23 +00:00
|
|
|
|
(interactive nil bookmark-bmenu-mode)
|
2018-10-13 20:06:41 +00:00
|
|
|
|
(let ((bookmark (bookmark-bmenu-bookmark))
|
|
|
|
|
(pop-up-frames t))
|
|
|
|
|
(bookmark-jump-other-window bookmark)))
|
|
|
|
|
|
1995-03-15 14:47:09 +00:00
|
|
|
|
(defun bookmark-bmenu-switch-other-window ()
|
|
|
|
|
"Make the other window select this line's bookmark.
|
|
|
|
|
The current window remains selected."
|
2021-02-14 20:37:23 +00:00
|
|
|
|
(interactive nil bookmark-bmenu-mode)
|
1998-05-26 18:27:47 +00:00
|
|
|
|
(let ((bookmark (bookmark-bmenu-bookmark))
|
2012-11-04 03:25:18 +00:00
|
|
|
|
(fun (lambda (b) (display-buffer b t))))
|
|
|
|
|
(bookmark--jump-via bookmark fun)))
|
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
|
|
|
|
|
1997-03-30 21:38:43 +00:00
|
|
|
|
(defun bookmark-bmenu-other-window-with-mouse (event)
|
2019-05-26 10:48:26 +00:00
|
|
|
|
"Jump to bookmark at mouse EVENT position in other window.
|
|
|
|
|
Move point in menu buffer to the position of EVENT and leave
|
|
|
|
|
bookmark menu visible."
|
2021-02-14 20:37:23 +00:00
|
|
|
|
(interactive "e" bookmark-bmenu-mode)
|
2008-06-25 16:51:33 +00:00
|
|
|
|
(with-current-buffer (window-buffer (posn-window (event-end event)))
|
1997-03-30 21:38:43 +00:00
|
|
|
|
(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."
|
2021-02-14 20:37:23 +00:00
|
|
|
|
(interactive nil bookmark-bmenu-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
|
|
|
|
(let ((bookmark (bookmark-bmenu-bookmark)))
|
2010-01-02 04:36:17 +00:00
|
|
|
|
(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."
|
2021-02-14 20:37:23 +00:00
|
|
|
|
(interactive nil bookmark-bmenu-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
|
|
|
|
(bookmark-show-all-annotations))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun bookmark-bmenu-edit-annotation ()
|
|
|
|
|
"Edit the annotation for the current bookmark in another window."
|
2021-02-14 20:37:23 +00:00
|
|
|
|
(interactive nil bookmark-bmenu-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
|
|
|
|
(let ((bookmark (bookmark-bmenu-bookmark)))
|
2019-07-02 01:06:37 +00:00
|
|
|
|
(bookmark-edit-annotation bookmark 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(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."
|
2021-02-14 20:37:23 +00:00
|
|
|
|
(interactive "P" bookmark-bmenu-mode)
|
2020-10-17 15:56:44 +00:00
|
|
|
|
;; 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.
|
2010-01-02 04:36:17 +00:00
|
|
|
|
(bookmark-bmenu-ensure-position)
|
2020-10-17 15:56:44 +00:00
|
|
|
|
(tabulated-list-put-tag " ")
|
|
|
|
|
(forward-line (if backup -1 1)))
|
(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."
|
2021-02-14 20:37:23 +00:00
|
|
|
|
(interactive nil 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
|
|
|
|
(forward-line -1)
|
2010-01-02 04:36:17 +00:00
|
|
|
|
(bookmark-bmenu-ensure-position)
|
|
|
|
|
(bookmark-bmenu-unmark)
|
|
|
|
|
(forward-line -1)
|
|
|
|
|
(bookmark-bmenu-ensure-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
|
|
|
|
|
2020-07-23 21:14:32 +00:00
|
|
|
|
(defun bookmark-bmenu-unmark-all ()
|
|
|
|
|
"Cancel all requested operations on all listed bookmarks."
|
2021-02-14 20:37:23 +00:00
|
|
|
|
(interactive nil bookmark-bmenu-mode)
|
2020-07-23 21:14:32 +00:00
|
|
|
|
(save-excursion
|
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
(bookmark-bmenu-ensure-position)
|
2020-10-17 15:56:44 +00:00
|
|
|
|
(while (not (eobp))
|
|
|
|
|
(tabulated-list-put-tag " " t))))
|
2020-07-23 21:14: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
|
|
|
|
(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]."
|
2021-02-14 20:37:23 +00:00
|
|
|
|
(interactive nil bookmark-bmenu-mode)
|
2010-01-02 04:36:17 +00:00
|
|
|
|
(bookmark-bmenu-ensure-position)
|
2020-10-17 15:56:44 +00:00
|
|
|
|
(tabulated-list-put-tag "D" 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-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]."
|
2021-02-14 20:37:23 +00:00
|
|
|
|
(interactive nil bookmark-bmenu-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
|
|
|
|
(bookmark-bmenu-delete)
|
2020-10-17 15:56:44 +00:00
|
|
|
|
(forward-line -2))
|
(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
|
|
|
|
|
2020-07-23 21:14:32 +00:00
|
|
|
|
(defun bookmark-bmenu-delete-all ()
|
|
|
|
|
"Mark all listed bookmarks as to be deleted.
|
|
|
|
|
To remove all deletion marks, use \\<bookmark-bmenu-mode-map>\\[bookmark-bmenu-unmark-all].
|
|
|
|
|
To carry out the deletions that you've marked, use \\<bookmark-bmenu-mode-map>\\[bookmark-bmenu-execute-deletions]."
|
2021-02-14 20:37:23 +00:00
|
|
|
|
(interactive nil bookmark-bmenu-mode)
|
2020-07-23 21:14:32 +00:00
|
|
|
|
(save-excursion
|
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
(bookmark-bmenu-ensure-position)
|
2020-10-17 15:56:44 +00:00
|
|
|
|
(while (not (eobp))
|
|
|
|
|
(tabulated-list-put-tag "D" t))))
|
2020-07-23 21:14: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
|
|
|
|
(defun bookmark-bmenu-execute-deletions ()
|
2021-05-05 21:40:52 +00:00
|
|
|
|
"Delete bookmarks flagged `D'.
|
|
|
|
|
If `bookmark-menu-confirm-deletion' is non-nil, prompt for
|
|
|
|
|
confirmation first."
|
2021-02-14 20:37:23 +00:00
|
|
|
|
(interactive nil bookmark-bmenu-mode)
|
2021-05-05 21:40:52 +00:00
|
|
|
|
(if (and bookmark-menu-confirm-deletion
|
|
|
|
|
(not (yes-or-no-p "Delete selected bookmarks? ")))
|
|
|
|
|
(message "Bookmarks not deleted.")
|
|
|
|
|
(let ((reporter (make-progress-reporter "Deleting bookmarks..."))
|
|
|
|
|
(o-point (point))
|
|
|
|
|
(o-str (save-excursion
|
|
|
|
|
(beginning-of-line)
|
|
|
|
|
(unless (= (following-char) ?D)
|
|
|
|
|
(buffer-substring
|
|
|
|
|
(point)
|
|
|
|
|
(progn (end-of-line) (point))))))
|
|
|
|
|
(o-col (current-column)))
|
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
(while (re-search-forward "^D" (point-max) t)
|
|
|
|
|
(bookmark-delete (bookmark-bmenu-bookmark) t)) ; pass BATCH arg
|
|
|
|
|
(bookmark-bmenu-list)
|
|
|
|
|
(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)
|
|
|
|
|
(progress-reporter-done reporter))))
|
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."
|
2021-02-14 20:37:23 +00:00
|
|
|
|
(interactive nil bookmark-bmenu-mode)
|
2010-01-02 04:36:17 +00:00
|
|
|
|
(let ((bmrk (bookmark-bmenu-bookmark))
|
|
|
|
|
(thispoint (point)))
|
|
|
|
|
(bookmark-rename 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
|
|
|
|
|
|
|
|
|
(defun bookmark-bmenu-locate ()
|
2023-07-01 09:46:37 +00:00
|
|
|
|
"Display the location of the bookmark for this line."
|
2021-02-14 20:37:23 +00:00
|
|
|
|
(interactive nil bookmark-bmenu-mode)
|
2010-01-02 18:13:28 +00:00
|
|
|
|
(let ((bmrk (bookmark-bmenu-bookmark)))
|
|
|
|
|
(message "%s" (bookmark-location 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
|
|
|
|
|
2004-06-13 01:59:21 +00:00
|
|
|
|
(defun bookmark-bmenu-relocate ()
|
2019-05-26 10:48:26 +00:00
|
|
|
|
"Change the absolute file name of the bookmark on the current line.
|
|
|
|
|
Prompt with completion for the new path."
|
2021-02-14 20:37:23 +00:00
|
|
|
|
(interactive nil bookmark-bmenu-mode)
|
2010-01-02 04:36:17 +00:00
|
|
|
|
(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
|
|
|
|
|
2009-11-20 15:47:26 +00:00
|
|
|
|
;;; Bookmark-bmenu search
|
|
|
|
|
|
|
|
|
|
(defun bookmark-bmenu-filter-alist-by-regexp (regexp)
|
|
|
|
|
"Filter `bookmark-alist' with bookmarks matching REGEXP and rebuild list."
|
2009-11-21 04:43:10 +00:00
|
|
|
|
(let ((bookmark-alist
|
Reduce use of (require 'cl).
* admin/bzrmerge.el: Use cl-lib.
* leim/quail/hangul.el: Don't require CL.
* leim/quail/ipa.el: Use cl-lib.
* vc/smerge-mode.el, vc/pcvs.el, vc/pcvs-util.el, vc/pcvs-info.el:
* vc/diff-mode.el, vc/cvs-status.el, uniquify.el, scroll-bar.el:
* register.el, progmodes/sh-script.el, net/gnutls.el, net/dbus.el:
* msb.el, mpc.el, minibuffer.el, international/ucs-normalize.el:
* international/quail.el, info-xref.el, imenu.el, image-mode.el:
* font-lock.el, filesets.el, edmacro.el, doc-view.el, bookmark.el:
* battery.el, avoid.el, abbrev.el: Use cl-lib.
* vc/pcvs-parse.el, vc/pcvs-defs.el, vc/log-view.el, vc/log-edit.el:
* vc/diff.el, simple.el, pcomplete.el, lpr.el, comint.el, loadhist.el:
* jit-lock.el, international/iso-ascii.el, info.el, frame.el, bs.el:
* emulation/crisp.el, electric.el, dired.el, cus-dep.el, composite.el:
* calculator.el, autorevert.el, apropos.el: Don't require CL.
* emacs-bytecomp.el (byte-recompile-directory, display-call-tree)
(byte-compile-unfold-bcf, byte-compile-check-variable):
* emacs-byte-opt.el (byte-compile-trueconstp)
(byte-compile-nilconstp):
* emacs-autoload.el (make-autoload): Use pcase.
* face-remap.el (text-scale-adjust): Simplify pcase patterns.
2012-07-10 11:51:54 +00:00
|
|
|
|
(cl-loop for i in bookmark-alist
|
|
|
|
|
when (string-match regexp (car i)) collect i into new
|
|
|
|
|
finally return new)))
|
2009-11-20 15:47:26 +00:00
|
|
|
|
(bookmark-bmenu-list)))
|
|
|
|
|
|
2009-11-21 04:43:10 +00:00
|
|
|
|
|
2009-11-20 15:47:26 +00:00
|
|
|
|
;;;###autoload
|
|
|
|
|
(defun bookmark-bmenu-search ()
|
2009-11-21 04:43:10 +00:00
|
|
|
|
"Incremental search of bookmarks, hiding the non-matches as we go."
|
2021-02-14 20:37:23 +00:00
|
|
|
|
(interactive nil bookmark-bmenu-mode)
|
2009-11-21 04:43:10 +00:00
|
|
|
|
(let ((bmk (bookmark-bmenu-bookmark))
|
2012-10-02 02:47:12 +00:00
|
|
|
|
(timer nil))
|
2009-11-21 04:43:10 +00:00
|
|
|
|
(unwind-protect
|
2012-10-02 02:47:12 +00:00
|
|
|
|
(minibuffer-with-setup-hook
|
|
|
|
|
(lambda ()
|
|
|
|
|
(setq timer (run-with-idle-timer
|
|
|
|
|
bookmark-search-delay 'repeat
|
Remove redundant #' before lambda
* admin/unidata/unidata-gen.el (unidata-gen-table)
(unidata-gen-table-symbol, unidata-gen-table-integer)
(unidata-gen-table-numeric, unidata-gen-table-word-list)
(unidata-describe-decomposition):
* lisp/apropos.el (apropos-user-option):
* lisp/bookmark.el (bookmark-bmenu-search):
* lisp/composite.el (unicode-category-table):
* lisp/elec-pair.el (electric-pair--balance-info):
* lisp/electric.el (electric-quote-chars):
* lisp/emulation/cua-base.el (cua-rectangle-mark-key):
* lisp/epa-hook.el (epa-file-encrypt-to):
* lisp/faces.el (face-font-selection-order)
(face-font-family-alternatives, face-font-registry-alternatives)
(face-valid-attribute-values, tty-run-terminal-initialization):
* lisp/files.el (recover-file, file-expand-wildcards):
* lisp/frame.el (frames-on-display-list):
* lisp/help-at-pt.el (help-at-pt-display-when-idle):
* lisp/help-fns.el (help-fns--face-attributes):
* lisp/ido.el (ido-mode, ido-unc-hosts):
* lisp/isearch.el (isearch-highlight-regexp)
(isearch-highlight-lines-matching-regexp):
* lisp/language/indian.el (script-regexp-alist):
* lisp/language/lao.el:
* lisp/leim/quail/ipa.el (ipa-x-sampa-prepend-to-keymap-entry):
* lisp/mh-e/mh-folder.el (mh-process-commands):
* lisp/mh-e/mh-mime.el (mh-display-with-external-viewer):
* lisp/ps-mule.el (ps-mule-end-job):
* lisp/ps-print.el (ps-color-scale, ps-background-pages)
(ps-background-text, ps-background-image, ps-background)
(ps-begin-job, ps-print-translation-table):
* lisp/recentf.el (recentf-sort-ascending)
(recentf-sort-descending, recentf-sort-basenames-ascending)
(recentf-sort-basenames-descending)
(recentf-sort-directories-ascending)
(recentf-sort-directories-descending):
* lisp/replace.el (occur-engine-add-prefix):
* lisp/select.el (xselect--encode-string):
* lisp/server.el (server-use-tcp):
* lisp/ses.el (ses-sort-column):
* lisp/sort.el (sort-columns):
* lisp/term/ns-win.el (window-system-initialization):
* lisp/tree-widget.el (tree-widget-image-formats):
* lisp/whitespace.el (whitespace-report-region): Remove redundant #'
before lambda.
2021-10-21 21:35:07 +00:00
|
|
|
|
(lambda (buf)
|
|
|
|
|
(with-current-buffer buf
|
|
|
|
|
(bookmark-bmenu-filter-alist-by-regexp
|
|
|
|
|
(minibuffer-contents))))
|
2012-10-02 02:47:12 +00:00
|
|
|
|
(current-buffer))))
|
|
|
|
|
(read-string "Pattern: ")
|
|
|
|
|
(when timer (cancel-timer timer) (setq timer nil)))
|
2016-12-22 18:13:46 +00:00
|
|
|
|
(when timer ;; Signaled an error or a `quit'.
|
2012-10-02 02:47:12 +00:00
|
|
|
|
(cancel-timer timer)
|
|
|
|
|
(bookmark-bmenu-list)
|
|
|
|
|
(bookmark-bmenu-goto-bookmark bmk)))))
|
2010-01-02 01:05:44 +00:00
|
|
|
|
|
2009-11-20 15:47:26 +00:00
|
|
|
|
(defun bookmark-bmenu-goto-bookmark (name)
|
|
|
|
|
"Move point to bookmark with name NAME."
|
|
|
|
|
(goto-char (point-min))
|
2015-04-09 15:07:15 +00:00
|
|
|
|
(while (not (or (equal name (bookmark-bmenu-bookmark))
|
|
|
|
|
(eobp)))
|
2009-11-20 15:47:26 +00:00
|
|
|
|
(forward-line 1))
|
|
|
|
|
(forward-line 0))
|
2010-01-02 01:05:44 +00:00
|
|
|
|
|
2009-11-20 15:47:26 +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")))
|
2012-06-27 21:15:13 +00:00
|
|
|
|
(bindings--define-key map [load]
|
|
|
|
|
'(menu-item "Load a Bookmark File..." bookmark-load
|
|
|
|
|
:help "Load bookmarks from a bookmark file)"))
|
|
|
|
|
(bindings--define-key map [write]
|
|
|
|
|
'(menu-item "Save Bookmarks As..." bookmark-write
|
|
|
|
|
:help "Write bookmarks to a file (reading the file name with the minibuffer)"))
|
|
|
|
|
(bindings--define-key map [save]
|
|
|
|
|
'(menu-item "Save Bookmarks" bookmark-save
|
|
|
|
|
:help "Save currently defined bookmarks"))
|
|
|
|
|
(bindings--define-key map [edit]
|
|
|
|
|
'(menu-item "Edit Bookmark List" bookmark-bmenu-list
|
|
|
|
|
:help "Display a list of existing bookmarks"))
|
|
|
|
|
(bindings--define-key map [delete]
|
|
|
|
|
'(menu-item "Delete Bookmark..." bookmark-delete
|
|
|
|
|
:help "Delete a bookmark from the bookmark list"))
|
2020-07-23 21:14:32 +00:00
|
|
|
|
(bindings--define-key map [delete-all]
|
|
|
|
|
'(menu-item "Delete all Bookmarks..." bookmark-delete-all
|
|
|
|
|
:help "Delete all bookmarks from the bookmark list"))
|
2012-06-27 21:15:13 +00:00
|
|
|
|
(bindings--define-key map [rename]
|
|
|
|
|
'(menu-item "Rename Bookmark..." bookmark-rename
|
|
|
|
|
:help "Change the name of a bookmark"))
|
|
|
|
|
(bindings--define-key map [locate]
|
|
|
|
|
'(menu-item "Insert Location..." bookmark-locate
|
|
|
|
|
:help "Insert the name of the file associated with a bookmark"))
|
|
|
|
|
(bindings--define-key map [insert]
|
|
|
|
|
'(menu-item "Insert Contents..." bookmark-insert
|
|
|
|
|
:help "Insert the text of the file pointed to by a bookmark"))
|
|
|
|
|
(bindings--define-key map [set]
|
|
|
|
|
'(menu-item "Set Bookmark..." bookmark-set
|
|
|
|
|
:help "Set a bookmark named inside a file."))
|
|
|
|
|
(bindings--define-key map [jump]
|
|
|
|
|
'(menu-item "Jump to Bookmark..." bookmark-jump
|
|
|
|
|
:help "Jump to a bookmark (a point in some file)"))
|
(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
|
2009-10-28 03:09:11 +00:00
|
|
|
|
(push 'bookmark menu-bar-final-items))
|
1995-12-30 19:52:40 +00:00
|
|
|
|
(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 ;;;;
|
|
|
|
|
|
|
|
|
|
|
2008-06-25 16:51:33 +00:00
|
|
|
|
;; Load 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
|
|
|
|
(defvar bookmark-load-hook nil
|
2010-07-14 19:09:28 +00:00
|
|
|
|
"Hook run at the end of loading library `bookmark.el'.")
|
2020-01-17 07:06:04 +00:00
|
|
|
|
(make-obsolete-variable 'bookmark-load-hook
|
|
|
|
|
"use `with-eval-after-load' instead." "28.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
|
|
|
|
|
2008-06-25 16:51:33 +00:00
|
|
|
|
;; Exit Hook, called from kill-emacs-hook
|
2000-12-13 22:56:38 +00:00
|
|
|
|
(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.")
|
|
|
|
|
|
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)
|
2013-04-04 01:59:09 +00:00
|
|
|
|
(and (bookmark-time-to-save-p t)
|
(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
|
|
|
|
(bookmark-save)))
|
2000-12-13 22:56:38 +00:00
|
|
|
|
|
2011-03-06 00:30:16 +00:00
|
|
|
|
(unless noninteractive
|
|
|
|
|
(add-hook 'kill-emacs-hook 'bookmark-exit-hook-internal))
|
2000-12-13 22:56:38 +00:00
|
|
|
|
|
2008-10-06 11:49:59 +00:00
|
|
|
|
(defun bookmark-unload-function ()
|
|
|
|
|
"Unload the Bookmark library."
|
|
|
|
|
(when bookmark-save-flag (bookmark-save))
|
|
|
|
|
;; continue standard unloading
|
|
|
|
|
nil)
|
|
|
|
|
|
2000-12-13 22:56:38 +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
|
|
|
|
(run-hooks 'bookmark-load-hook)
|
1993-08-10 20:35:31 +00:00
|
|
|
|
|
2022-06-17 14:06:10 +00:00
|
|
|
|
|
|
|
|
|
;;; Obsolete:
|
|
|
|
|
|
|
|
|
|
(define-obsolete-function-alias 'bookmark-send-edited-annotation
|
|
|
|
|
#'bookmark-edit-annotation-confirm "29.1")
|
|
|
|
|
|
1993-08-10 20:35:31 +00:00
|
|
|
|
(provide 'bookmark)
|
2001-01-12 22:49:40 +00:00
|
|
|
|
|
1993-08-13 00:59:51 +00:00
|
|
|
|
;;; bookmark.el ends here
|