Mercurial > emacs
comparison lisp/bookmark.el @ 11218:fc73b8f750f1
(menu-bar-bookmark-map): Autoload each form
used to set up this variable's value, so that the whole job
is done in loaddefs.el.
(bookmark-menu-locate, bookmark-menu-jump, bookmark-menu-insert)
(bookmark-menu-delete, bookmark-menu-rename): Add autoloads.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Thu, 06 Apr 1995 08:44:21 +0000 |
parents | ebee80744a06 |
children | f7638ab47de7 |
comparison
equal
deleted
inserted
replaced
11217:f634aecca4a4 | 11218:fc73b8f750f1 |
---|---|
1959 (let* ((choice (bookmark-menu-popup-paned-bookmark-menu | 1959 (let* ((choice (bookmark-menu-popup-paned-bookmark-menu |
1960 event menu-label))) | 1960 event menu-label))) |
1961 (if choice (apply func-sym (list choice))))) | 1961 (if choice (apply func-sym (list choice))))) |
1962 | 1962 |
1963 | 1963 |
1964 ;;;###autoload | |
1964 (defun bookmark-menu-insert (event) | 1965 (defun bookmark-menu-insert (event) |
1965 "Insert the text of the file pointed to by bookmark BOOKMARK. | 1966 "Insert the text of the file pointed to by bookmark BOOKMARK. |
1966 You may have a problem using this function if the value of variable | 1967 You may have a problem using this function if the value of variable |
1967 `bookmark-alist' is nil. If that happens, you need to load in some | 1968 `bookmark-alist' is nil. If that happens, you need to load in some |
1968 bookmarks. See help on function `bookmark-load' for more about | 1969 bookmarks. See help on function `bookmark-load' for more about |
1970 (interactive "e") | 1971 (interactive "e") |
1971 (bookmark-popup-menu-and-apply-function | 1972 (bookmark-popup-menu-and-apply-function |
1972 'bookmark-insert "Insert Bookmark Contents" event)) | 1973 'bookmark-insert "Insert Bookmark Contents" event)) |
1973 | 1974 |
1974 | 1975 |
1976 ;;;###autoload | |
1975 (defun bookmark-menu-jump (event) | 1977 (defun bookmark-menu-jump (event) |
1976 "Jump to bookmark BOOKMARK (a point in some file). | 1978 "Jump to bookmark BOOKMARK (a point in some file). |
1977 You may have a problem using this function if the value of variable | 1979 You may have a problem using this function if the value of variable |
1978 `bookmark-alist' is nil. If that happens, you need to load in some | 1980 `bookmark-alist' is nil. If that happens, you need to load in some |
1979 bookmarks. See help on function `bookmark-load' for more about | 1981 bookmarks. See help on function `bookmark-load' for more about |
1981 (interactive "e") | 1983 (interactive "e") |
1982 (bookmark-popup-menu-and-apply-function | 1984 (bookmark-popup-menu-and-apply-function |
1983 'bookmark-jump "Jump to Bookmark" event)) | 1985 'bookmark-jump "Jump to Bookmark" event)) |
1984 | 1986 |
1985 | 1987 |
1988 ;;;###autoload | |
1986 (defun bookmark-menu-locate (event) | 1989 (defun bookmark-menu-locate (event) |
1987 "Insert the name of the file associated with BOOKMARK. | 1990 "Insert the name of the file associated with BOOKMARK. |
1988 \(This is not the same as the contents of that file\)." | 1991 \(This is not the same as the contents of that file\)." |
1989 (interactive "e") | 1992 (interactive "e") |
1990 (bookmark-popup-menu-and-apply-function | 1993 (bookmark-popup-menu-and-apply-function |
1991 'bookmark-insert-location "Insert Bookmark Location" event)) | 1994 'bookmark-insert-location "Insert Bookmark Location" event)) |
1992 | 1995 |
1993 | 1996 |
1997 ;;;###autoload | |
1994 (defun bookmark-menu-rename (event) | 1998 (defun bookmark-menu-rename (event) |
1995 "Change the name of OLD-BOOKMARK to NEWNAME. | 1999 "Change the name of OLD-BOOKMARK to NEWNAME. |
1996 If called from keyboard, prompts for OLD-BOOKMARK and NEWNAME. | 2000 If called from keyboard, prompts for OLD-BOOKMARK and NEWNAME. |
1997 If called from menubar, OLD-BOOKMARK is selected from a menu, and | 2001 If called from menubar, OLD-BOOKMARK is selected from a menu, and |
1998 prompts for NEWNAME. | 2002 prompts for NEWNAME. |
2006 (interactive "e") | 2010 (interactive "e") |
2007 (bookmark-popup-menu-and-apply-function | 2011 (bookmark-popup-menu-and-apply-function |
2008 'bookmark-rename "Rename Bookmark" event)) | 2012 'bookmark-rename "Rename Bookmark" event)) |
2009 | 2013 |
2010 | 2014 |
2015 ;;;###autoload | |
2011 (defun bookmark-menu-delete (event) | 2016 (defun bookmark-menu-delete (event) |
2012 "Delete the bookmark named NAME from the bookmark list. | 2017 "Delete the bookmark named NAME from the bookmark list. |
2013 Removes only the first instance of a bookmark with that name. If | 2018 Removes only the first instance of a bookmark with that name. If |
2014 there are one or more other bookmarks with the same name, they will | 2019 there are one or more other bookmarks with the same name, they will |
2015 not be deleted. Defaults to the \"current\" bookmark \(that is, the | 2020 not be deleted. Defaults to the \"current\" bookmark \(that is, the |
2020 | 2025 |
2021 | 2026 |
2022 ;; Thanks to Roland McGrath for fixing menubar.el so that the | 2027 ;; Thanks to Roland McGrath for fixing menubar.el so that the |
2023 ;; following works, and for explaining what to do to make it work. | 2028 ;; following works, and for explaining what to do to make it work. |
2024 | 2029 |
2025 (defvar menu-bar-bookmark-map (make-sparse-keymap "Bookmark functions.")) | 2030 ;; We MUST autoload EACH form used to set up this variable's value, so |
2026 | 2031 ;; that the whole job is done in loaddefs.el. |
2027 | 2032 |
2028 ;; make bookmarks appear toward the right side of the menu. | 2033 ;;;###autoload |
2029 (if (boundp 'menu-bar-final-items) | 2034 (defvar menu-bar-bookmark-map (make-sparse-keymap "Bookmark functions")) |
2030 (if menu-bar-final-items | 2035 |
2031 (setq menu-bar-final-items | 2036 ;;;###autoload |
2032 (cons 'bookmark menu-bar-final-items))) | 2037 (fset 'menu-bar-bookmark-map (symbol-value 'menu-bar-bookmark-map)) |
2033 (setq menu-bar-final-items '(bookmark))) | 2038 |
2034 | 2039 ;;;###autoload |
2035 (define-key menu-bar-bookmark-map [load] | 2040 (define-key menu-bar-bookmark-map [load] |
2036 '("Load a bookmark file" . bookmark-load)) | 2041 '("Load a bookmark file" . bookmark-load)) |
2037 | 2042 |
2043 ;;;###autoload | |
2038 (define-key menu-bar-bookmark-map [write] | 2044 (define-key menu-bar-bookmark-map [write] |
2039 '("Write \(to another file\)" . bookmark-write)) | 2045 '("Write \(to another file\)" . bookmark-write)) |
2040 | 2046 |
2047 ;;;###autoload | |
2041 (define-key menu-bar-bookmark-map [save] | 2048 (define-key menu-bar-bookmark-map [save] |
2042 '("Save \(in default file\)" . bookmark-save)) | 2049 '("Save \(in default file\)" . bookmark-save)) |
2043 | 2050 |
2051 ;;;###autoload | |
2044 (define-key menu-bar-bookmark-map [edit] | 2052 (define-key menu-bar-bookmark-map [edit] |
2045 '("Edit Bookmark List" . bookmark-bmenu-list)) | 2053 '("Edit Bookmark List" . bookmark-bmenu-list)) |
2046 | 2054 |
2055 ;;;###autoload | |
2047 (define-key menu-bar-bookmark-map [delete] | 2056 (define-key menu-bar-bookmark-map [delete] |
2048 '("Delete bookmark" . bookmark-menu-delete)) | 2057 '("Delete bookmark" . bookmark-menu-delete)) |
2049 | 2058 |
2059 ;;;###autoload | |
2050 (define-key menu-bar-bookmark-map [rename] | 2060 (define-key menu-bar-bookmark-map [rename] |
2051 '("Rename bookmark" . bookmark-menu-rename)) | 2061 '("Rename bookmark" . bookmark-menu-rename)) |
2052 | 2062 |
2063 ;;;###autoload | |
2053 (define-key menu-bar-bookmark-map [locate] | 2064 (define-key menu-bar-bookmark-map [locate] |
2054 '("Insert location" . bookmark-menu-locate)) | 2065 '("Insert location" . bookmark-menu-locate)) |
2055 | 2066 |
2067 ;;;###autoload | |
2056 (define-key menu-bar-bookmark-map [insert] | 2068 (define-key menu-bar-bookmark-map [insert] |
2057 '("Insert contents" . bookmark-menu-insert)) | 2069 '("Insert contents" . bookmark-menu-insert)) |
2058 | 2070 |
2071 ;;;###autoload | |
2059 (define-key menu-bar-bookmark-map [set] | 2072 (define-key menu-bar-bookmark-map [set] |
2060 '("Set bookmark" . bookmark-set)) | 2073 '("Set bookmark" . bookmark-set)) |
2061 | 2074 |
2075 ;;;###autoload | |
2062 (define-key menu-bar-bookmark-map [jump] | 2076 (define-key menu-bar-bookmark-map [jump] |
2063 '("Jump to bookmark" . bookmark-menu-jump)) | 2077 '("Jump to bookmark" . bookmark-menu-jump)) |
2064 | |
2065 ;;;###autoload (autoload 'menu-bar-bookmark-map "bookmark" nil t 'keymap) | |
2066 | |
2067 (fset 'menu-bar-bookmark-map (symbol-value 'menu-bar-bookmark-map)) | |
2068 | 2078 |
2069 ;;;; end bookmark menu stuff ;;;; | 2079 ;;;; end bookmark menu stuff ;;;; |
2070 | 2080 |
2071 | 2081 |
2072 ;;; Load Hook | 2082 ;;; Load Hook |