169 |
|
|
170 |
|
|
171 |
(defcustom bookmark-automatically-show-annotations t |
(defcustom bookmark-automatically-show-annotations t |
172 |
"*nil means don't show annotations when jumping to a bookmark." |
"*Non-nil means show annotations when jumping to a bookmark." |
173 |
:type 'boolean |
:type 'boolean |
174 |
:group 'bookmark) |
:group 'bookmark) |
175 |
|
|
333 |
|
|
334 |
|
|
335 |
(defun bookmark-get-bookmark (bookmark) |
(defun bookmark-get-bookmark (bookmark) |
336 |
"Return the full entry for BOOKMARK in bookmark-alist. |
"Return the full entry for BOOKMARK in `bookmark-alist'. |
337 |
If BOOKMARK is not a string, return nil." |
If BOOKMARK is not a string, return nil." |
338 |
(when (stringp bookmark) |
(when (stringp bookmark) |
339 |
(assoc-string bookmark bookmark-alist bookmark-completion-ignore-case))) |
(assoc-string bookmark bookmark-alist bookmark-completion-ignore-case))) |
340 |
|
|
341 |
|
|
342 |
(defun bookmark-get-bookmark-record (bookmark) |
(defun bookmark-get-bookmark-record (bookmark) |
343 |
"Return the guts of the entry for BOOKMARK in bookmark-alist. |
"Return the guts of the entry for BOOKMARK in `bookmark-alist'. |
344 |
That is, all information but the name." |
That is, all information but the name." |
345 |
(car (cdr (bookmark-get-bookmark bookmark)))) |
(car (cdr (bookmark-get-bookmark bookmark)))) |
346 |
|
|
443 |
(list (cons 'info-node node))))) |
(list (cons 'info-node node))))) |
444 |
|
|
445 |
(message "%S" (assq 'info-node (bookmark-get-bookmark-record bookmark))) |
(message "%S" (assq 'info-node (bookmark-get-bookmark-record bookmark))) |
446 |
(sit-for 4) |
(sit-for 4)) |
|
) |
|
447 |
|
|
448 |
|
|
449 |
(defvar bookmark-history nil |
(defvar bookmark-history nil |
618 |
|
|
619 |
|
|
620 |
(defun bookmark-alist-from-buffer () |
(defun bookmark-alist-from-buffer () |
621 |
"Return a bookmark-alist (in any format) from the current buffer. |
"Return a `bookmark-alist' (in any format) from the current buffer. |
622 |
The buffer must of course contain bookmark format information. |
The buffer must of course contain bookmark format information. |
623 |
Does not care from where in the buffer it is called, and does not |
Does not care from where in the buffer it is called, and does not |
624 |
affect point." |
affect point." |
658 |
|
|
659 |
(defun bookmark-upgrade-file-format-from-0 () |
(defun bookmark-upgrade-file-format-from-0 () |
660 |
"Upgrade a bookmark file of format 0 (the original format) to format 1. |
"Upgrade a bookmark file of format 0 (the original format) to format 1. |
661 |
This expects to be called from point-min in a bookmark file." |
This expects to be called from `point-min' in a bookmark file." |
662 |
(message "Upgrading bookmark format from 0 to %d..." |
(message "Upgrading bookmark format from 0 to %d..." |
663 |
bookmark-file-format-version) |
bookmark-file-format-version) |
664 |
(let* ((old-list (bookmark-alist-from-buffer)) |
(let* ((old-list (bookmark-alist-from-buffer)) |
675 |
|
|
676 |
(defun bookmark-grok-file-format-version () |
(defun bookmark-grok-file-format-version () |
677 |
"Return an integer which is the file-format version of this bookmark file. |
"Return an integer which is the file-format version of this bookmark file. |
678 |
This expects to be called from point-min in a bookmark file." |
This expects to be called from `point-min' in a bookmark file." |
679 |
(if (looking-at "^;;;;") |
(if (looking-at "^;;;;") |
680 |
(save-excursion |
(save-excursion |
681 |
(save-match-data |
(save-match-data |
690 |
(defun bookmark-maybe-upgrade-file-format () |
(defun bookmark-maybe-upgrade-file-format () |
691 |
"Check the file-format version of this bookmark file. |
"Check the file-format version of this bookmark file. |
692 |
If the version is not up-to-date, upgrade it automatically. |
If the version is not up-to-date, upgrade it automatically. |
693 |
This expects to be called from point-min in a bookmark file." |
This expects to be called from `point-min' in a bookmark file." |
694 |
(let ((version (bookmark-grok-file-format-version))) |
(let ((version (bookmark-grok-file-format-version))) |
695 |
(cond |
(cond |
696 |
((= version bookmark-file-format-version) |
((= version bookmark-file-format-version) |
782 |
(defun bookmark-kill-line (&optional newline-too) |
(defun bookmark-kill-line (&optional newline-too) |
783 |
"Kill from point to end of line. |
"Kill from point to end of line. |
784 |
If optional arg NEWLINE-TOO is non-nil, delete the newline too. |
If optional arg NEWLINE-TOO is non-nil, delete the newline too. |
785 |
Does not affect the kill-ring." |
Does not affect the kill ring." |
786 |
(let ((eol (save-excursion (end-of-line) (point)))) |
(let ((eol (save-excursion (end-of-line) (point)))) |
787 |
(delete-region (point) eol) |
(delete-region (point) eol) |
788 |
(if (and newline-too (looking-at "\n")) |
(if (and newline-too (looking-at "\n")) |
841 |
|
|
842 |
(defvar bookmark-read-annotation-text-func 'bookmark-default-annotation-text |
(defvar bookmark-read-annotation-text-func 'bookmark-default-annotation-text |
843 |
"Function to return default text to use for a bookmark annotation. |
"Function to return default text to use for a bookmark annotation. |
844 |
It takes the name of the bookmark, as a string, as an arg.") |
It takes one argument, the name of the bookmark, as a string.") |
845 |
|
|
846 |
(defun bookmark-read-annotation-mode (buf point parg bookmark) |
(defun bookmark-read-annotation-mode (buf point parg bookmark) |
847 |
"Mode for composing annotations for a bookmark. |
"Mode for composing annotations for a bookmark. |
848 |
Wants BUF POINT PARG and BOOKMARK. |
Wants BUF, POINT, PARG, and BOOKMARK. |
849 |
When you have finished composing, type \\[bookmark-send-annotation] to send |
When you have finished composing, type \\[bookmark-send-annotation] to send |
850 |
the annotation. |
the annotation. |
851 |
|
|
932 |
|
|
933 |
|
|
934 |
(defun bookmark-insert-current-bookmark () |
(defun bookmark-insert-current-bookmark () |
935 |
"Insert this buffer's value of bookmark-current-bookmark. |
"Insert this buffer's value of `bookmark-current-bookmark'. |
936 |
Default to file name if it's nil." |
Default to file name if it's nil." |
937 |
(interactive) |
(interactive) |
938 |
(let ((str |
(let ((str |
1043 |
this. |
this. |
1044 |
|
|
1045 |
If the file pointed to by BOOKMARK no longer exists, you will be asked |
If the file pointed to by BOOKMARK no longer exists, you will be asked |
1046 |
if you wish to give the bookmark a new location, and bookmark-jump |
if you wish to give the bookmark a new location, and `bookmark-jump' |
1047 |
will then jump to the new location, as well as recording it in place |
will then jump to the new location, as well as recording it in place |
1048 |
of the old one in the permanent bookmark record." |
of the old one in the permanent bookmark record." |
1049 |
(interactive |
(interactive |
1303 |
`bookmark-default-file'. With a prefix arg, save it in file FILE |
`bookmark-default-file'. With a prefix arg, save it in file FILE |
1304 |
\(second argument\). |
\(second argument\). |
1305 |
|
|
1306 |
If you are calling this from Lisp, the two arguments are PREFIX-ARG |
If you are calling this from Lisp, the two arguments are PARG and |
1307 |
and FILE, and if you just want it to write to the default file, then |
FILE, and if you just want it to write to the default file, then |
1308 |
pass no arguments. Or pass in nil and FILE, and it will save in FILE |
pass no arguments. Or pass in nil and FILE, and it will save in FILE |
1309 |
instead. If you pass in one argument, and it is non-nil, then the |
instead. If you pass in one argument, and it is non-nil, then the |
1310 |
user will be interactively queried for a file to save in. |
user will be interactively queried for a file to save in. |
1803 |
(setq tem (bookmark-bmenu-bookmark)) |
(setq tem (bookmark-bmenu-bookmark)) |
1804 |
(let ((inhibit-read-only t)) |
(let ((inhibit-read-only t)) |
1805 |
(delete-char -1) |
(delete-char -1) |
1806 |
(insert ?\ )) |
(insert ?\s)) |
1807 |
(or (string-equal tem bmrk) |
(or (string-equal tem bmrk) |
1808 |
(member tem others) |
(member tem others) |
1809 |
(setq others (cons tem others)))) |
(setq others (cons tem others)))) |
2092 |
(format "-*- %s (%d) -*-" name iter) |
(format "-*- %s (%d) -*-" name iter) |
2093 |
(nreverse lst)) |
(nreverse lst)) |
2094 |
pane-list))) |
pane-list))) |
2095 |
|
|
2096 |
;; Popup the menu and return the string. |
;; Popup the menu and return the string. |
2097 |
(x-popup-menu event (cons (concat "-*- " name " -*-") |
(x-popup-menu event (cons (concat "-*- " name " -*-") |
2098 |
(nreverse pane-list))))) |
(nreverse pane-list))))) |
2140 |
|
|
2141 |
;;; Exit Hook, called from kill-emacs-hook |
;;; Exit Hook, called from kill-emacs-hook |
2142 |
(defvar bookmark-exit-hook nil |
(defvar bookmark-exit-hook nil |
2143 |
"Hook run when emacs exits.") |
"Hook run when Emacs exits.") |
2144 |
|
|
2145 |
|
(define-obsolete-variable-alias 'bookmark-exit-hooks 'bookmark-exit-hook "22.1") |
2146 |
|
|
2147 |
(defun bookmark-exit-hook-internal () |
(defun bookmark-exit-hook-internal () |
2148 |
"Save bookmark state, if necessary, at Emacs exit time. |
"Save bookmark state, if necessary, at Emacs exit time. |
2149 |
This also runs `bookmark-exit-hooks'." |
This also runs `bookmark-exit-hook'." |
2150 |
(run-hooks 'bookmark-exit-hooks) |
(run-hooks 'bookmark-exit-hook) |
2151 |
(and bookmark-alist |
(and bookmark-alist |
2152 |
(bookmark-time-to-save-p t) |
(bookmark-time-to-save-p t) |
2153 |
(bookmark-save))) |
(bookmark-save))) |