/[emacs]/emacs/lisp/bookmark.el
ViewVC logotype

Diff of /emacs/lisp/bookmark.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.75 by lute, Mon Jul 4 23:08:52 2005 UTC revision 1.76 by lektu, Tue Jul 26 13:53:45 2005 UTC
# Line 169  recently set ones come first, oldest one Line 169  recently set ones come first, oldest one
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    
# Line 333  through a file easier.") Line 333  through a file easier.")
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    
# Line 443  That is, all information but the name." Line 443  That is, all information but the name."
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
# Line 619  You should never need to change this.") Line 618  You should never need to change this.")
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."
# Line 659  affect point." Line 658  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))
# Line 676  This expects to be called from point-min Line 675  This expects to be called from point-min
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
# Line 691  This expects to be called from point-min Line 690  This expects to be called from point-min
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)
# Line 783  the list of bookmarks.\)" Line 782  the list of bookmarks.\)"
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"))
# Line 842  the bookmark (and file, and point) speci Line 841  the bookmark (and file, and point) speci
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    
# Line 933  Lines beginning with `#' are ignored." Line 932  Lines beginning with `#' are ignored."
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
# Line 1044  bookmarks.  See help on function `bookma Line 1043  bookmarks.  See help on function `bookma
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
# Line 1304  Saves by default in the file defined by Line 1303  Saves by default in the file defined by
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.
# Line 1804  You can mark bookmarks with the \\<bookm Line 1803  You can mark bookmarks with the \\<bookm
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))))
# Line 2093  strings returned are not." Line 2092  strings returned are not."
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)))))
# Line 2141  strings returned are not." Line 2140  strings returned are not."
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)))

Legend:
Removed from v.1.75  
changed lines
  Added in v.1.76

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26