Mercurial > emacs
comparison lisp/bookmark.el @ 4891:6c76e6edff0e
upped version to 2.5
Got rid of ###autoload to put a bookmark menu on the menu-bar. Now it
will appear on the File menu, fourth item down. menu-bar.el will be
modified to do this.
(bookmark-load, bookmark-write-file): made enable-local-eval be nil
when loading a bookmark file, since bookmark context strings can
contain eval forms from the files in which the bookmarks are set, and
we don't want them evalled when .emacs-bkmrks is found!
upped version to 2.4.1 after doing this.
author | Karl Fogel <kfogel@red-bean.com> |
---|---|
date | Mon, 25 Oct 1993 23:56:15 +0000 |
parents | 511c83aee4ae |
children | c4bab885aa8d |
comparison
equal
deleted
inserted
replaced
4890:dab300dfe449 | 4891:6c76e6edff0e |
---|---|
3 ;; Copyright (C) 1993 Free Software Foundation | 3 ;; Copyright (C) 1993 Free Software Foundation |
4 | 4 |
5 ;; Author: Karl Fogel <kfogel@cs.oberlin.edu> | 5 ;; Author: Karl Fogel <kfogel@cs.oberlin.edu> |
6 ;; Maintainer: Karl Fogel <kfogel@cs.oberlin.edu> | 6 ;; Maintainer: Karl Fogel <kfogel@cs.oberlin.edu> |
7 ;; Created: July, 1993 | 7 ;; Created: July, 1993 |
8 ;; Version: 2.4 | 8 ;; Version: 2.5 |
9 ;; Keywords: bookmarks, placeholders | 9 ;; Keywords: bookmarks, placeholders |
10 | 10 |
11 ;; This file is part of GNU Emacs. | 11 ;; This file is part of GNU Emacs. |
12 | 12 |
13 ;; GNU Emacs is free software; you can redistribute it and/or modify | 13 ;; GNU Emacs is free software; you can redistribute it and/or modify |
24 ;; along with GNU Emacs; see the file COPYING. If not, write to | 24 ;; along with GNU Emacs; see the file COPYING. If not, write to |
25 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | 25 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. |
26 | 26 |
27 ;; Thanks to David Bremner <bremner@cs.sfu.ca> for thinking of and | 27 ;; Thanks to David Bremner <bremner@cs.sfu.ca> for thinking of and |
28 ;; then implementing the bookmark-current-bookmark idea. He even | 28 ;; then implementing the bookmark-current-bookmark idea. He even |
29 ;; sent *patches*, bless his soul... | 29 ;; sent *patches*, bless his soul... |
30 | 30 |
31 ;; Thanks to Gregory M. Saunders <saunders@cis.ohio-state.edu> for | 31 ;; Thanks to Gregory M. Saunders <saunders@cis.ohio-state.edu> for |
32 ;; fixing and improving bookmark-time-to-save-p. | 32 ;; fixing and improving bookmark-time-to-save-p. |
33 | |
34 ;; Thanks go to Andrew V. Klein <avk@rtsg.mot.com> for the code that | |
35 ;; sorts the alist before presenting it to the user (in list-bookmarks | |
36 ;; and the menu-bar). | |
33 | 37 |
34 ;; And much thanks to David Hughes <djh@harston.cv.com> for many small | 38 ;; And much thanks to David Hughes <djh@harston.cv.com> for many small |
35 ;; suggestions and the code to implement them (like | 39 ;; suggestions and the code to implement them (like |
36 ;; Bookmark-menu-check-position, and some of the Lucid compatibility | 40 ;; Bookmark-menu-check-position, and some of the Lucid compatibility |
37 ;; stuff). | 41 ;; stuff). |
38 | 42 |
43 ;; Kudos (whatever they are) go to Jim Blandy <jimb@cs.oberlin.edu> | |
44 ;; for his eminently sensible suggestion to separate bookmark-jump | |
45 ;; into bookmark-jump and bookmark-jump-noselect, which made many | |
46 ;; other things cleaner as well. | |
47 | |
39 ;; Thanks to Roland McGrath for encouragement and help with defining | 48 ;; Thanks to Roland McGrath for encouragement and help with defining |
40 ;; autoloads on the menu-bar. | 49 ;; autoloads on the menu-bar. |
50 | |
51 ;; Jonathan Stigelman <stig@key.amdahl.com> gave patches for default | |
52 ;; values in bookmark-jump and bookmark-set. Everybody please keep | |
53 ;; all the keystrokes they save thereby and send them to him at the | |
54 ;; end of each year :-) (No, seriously, thanks Jonathan!) | |
41 | 55 |
42 ;; Based on info-bookmark.el, by Karl Fogel and Ken Olstad | 56 ;; Based on info-bookmark.el, by Karl Fogel and Ken Olstad |
43 ;; <olstad@msc.edu>. | 57 ;; <olstad@msc.edu>. |
44 | 58 |
45 ;; LCD Archive Entry: | 59 ;; LCD Archive Entry: |
46 ;; bookmark|Karl Fogel|kfogel@cs.oberlin.edu| | 60 ;; bookmark|Karl Fogel|kfogel@cs.oberlin.edu| |
47 ;; Setting bookmarks in files or directories, jumping to them later.| | 61 ;; Setting bookmarks in files or directories, jumping to them later.| |
48 ;; 16-July-93|Version: 2.4|~/misc/bookmark.el.Z| | 62 ;; 16-July-93|Version: 2.5|~/misc/bookmark.el.Z| |
49 | 63 |
50 ;; Enough with the credits already, get on to the good stuff: | 64 ;; Enough with the credits already, get on to the good stuff: |
51 | 65 |
52 ;; FAVORITE CHINESE RESTAURANT: | 66 ;; FAVORITE CHINESE RESTAURANT: |
53 ;; Boy, that's a tough one. Probably Hong Min, or maybe Emperor's | 67 ;; Boy, that's a tough one. Probably Hong Min, or maybe Emperor's |
664 (defun bookmark-write-file (file) | 678 (defun bookmark-write-file (file) |
665 (save-excursion | 679 (save-excursion |
666 (save-window-excursion | 680 (save-window-excursion |
667 (if (>= baud-rate 9600) | 681 (if (>= baud-rate 9600) |
668 (message (format "Saving bookmarks to file %s." file))) | 682 (message (format "Saving bookmarks to file %s." file))) |
669 (set-buffer (find-file-noselect file)) | 683 (set-buffer (let ((enable-local-eval nil)) |
684 (find-file-noselect file))) | |
670 (goto-char (point-min)) | 685 (goto-char (point-min)) |
671 (delete-region (point-min) (point-max)) | 686 (delete-region (point-min) (point-max)) |
672 (print bookmark-alist (current-buffer)) | 687 (print bookmark-alist (current-buffer)) |
673 (let ((version-control | 688 (let ((version-control |
674 (cond | 689 (cond |
707 (if (file-readable-p file) | 722 (if (file-readable-p file) |
708 (save-excursion | 723 (save-excursion |
709 (save-window-excursion | 724 (save-window-excursion |
710 (if (and (null no-msg) (>= baud-rate 9600)) | 725 (if (and (null no-msg) (>= baud-rate 9600)) |
711 (message (format "Loading bookmarks from %s..." file))) | 726 (message (format "Loading bookmarks from %s..." file))) |
712 (set-buffer (find-file-noselect file)) | 727 (set-buffer (let ((enable-local-eval nil)) |
728 (find-file-noselect file))) | |
713 (goto-char (point-min)) | 729 (goto-char (point-min)) |
714 (let ((blist (car (read-from-string | 730 (let ((blist (car (read-from-string |
715 (buffer-substring (point-min) (point-max)))))) | 731 (buffer-substring (point-min) (point-max)))))) |
716 (if (listp blist) | 732 (if (listp blist) |
717 (progn | 733 (progn |
1235 event)) | 1251 event)) |
1236 | 1252 |
1237 ;; Thanks to Roland McGrath for fixing menubar.el so that the | 1253 ;; Thanks to Roland McGrath for fixing menubar.el so that the |
1238 ;; following works, and for explaining what to do to make it work. | 1254 ;; following works, and for explaining what to do to make it work. |
1239 | 1255 |
1240 ;;;###autoload | |
1241 (define-key global-map [menu-bar bookmark] | |
1242 '("Bookmarks" . menu-bar-bookmark-map)) | |
1243 | |
1244 (defvar menu-bar-bookmark-map (make-sparse-keymap "Bookmark functions.")) | 1256 (defvar menu-bar-bookmark-map (make-sparse-keymap "Bookmark functions.")) |
1245 | 1257 |
1246 ;; make bookmarks appear toward the right side of the menu. | 1258 ;; make bookmarks appear toward the right side of the menu. |
1247 (if (boundp 'menu-bar-final-items) | 1259 (if (boundp 'menu-bar-final-items) |
1248 (if menu-bar-final-items | 1260 (if menu-bar-final-items |
1287 ;;;; end bookmark menu-bar stuff ;;;; | 1299 ;;;; end bookmark menu-bar stuff ;;;; |
1288 | 1300 |
1289 (provide 'bookmark) | 1301 (provide 'bookmark) |
1290 | 1302 |
1291 ;;; bookmark.el ends here | 1303 ;;; bookmark.el ends here |
1292 |