X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/d52969e8afaa19ed1acc01f4ff0bb651bf7869a7..7031be6d49cb78d4cc4a2604b899144824abfeca:/lisp/bookmark.el diff --git a/lisp/bookmark.el b/lisp/bookmark.el index 60bed24ce1..d3db54c81d 100644 --- a/lisp/bookmark.el +++ b/lisp/bookmark.el @@ -1,7 +1,6 @@ ;;; bookmark.el --- set bookmarks, maybe annotate them, jump to them later -;; Copyright (C) 1993, 1994, 1995, 1996, 1997, 2001, 2002, 2003, -;; 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. +;; Copyright (C) 1993-1997, 2001-2011 Free Software Foundation, Inc. ;; Author: Karl Fogel ;; Maintainer: Karl Fogel @@ -1059,7 +1058,7 @@ compatibility only." (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, -or signals a `file-error'. +or signals a `file-error'. 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, @@ -1476,8 +1475,7 @@ method buffers use to resolve name collisions." (defvar bookmark-bmenu-mode-map (let ((map (make-keymap))) - (suppress-keymap map t) - (define-key map "q" 'quit-window) + (set-keymap-parent map special-mode-map) (define-key map "v" 'bookmark-bmenu-select) (define-key map "w" 'bookmark-bmenu-locate) (define-key map "2" 'bookmark-bmenu-2-window) @@ -1497,7 +1495,6 @@ method buffers use to resolve name collisions." (define-key map "n" 'next-line) (define-key map "p" 'previous-line) (define-key map "\177" 'bookmark-bmenu-backup-unmark) - (define-key map "?" 'describe-mode) (define-key map "u" 'bookmark-bmenu-unmark) (define-key map "m" 'bookmark-bmenu-mark) (define-key map "l" 'bookmark-bmenu-load) @@ -1587,7 +1584,7 @@ deletion, or > if it is flagged for displaying." -(defun bookmark-bmenu-mode () +(define-derived-mode bookmark-bmenu-mode special-mode "Bookmark Menu" "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. @@ -1620,13 +1617,8 @@ Bookmark names preceded by a \"*\" have annotations. in another buffer. \\[bookmark-bmenu-show-all-annotations] -- show the annotations of all bookmarks in another buffer. \\[bookmark-bmenu-edit-annotation] -- edit the annotation for the current bookmark." - (kill-all-local-variables) - (use-local-map bookmark-bmenu-mode-map) (setq truncate-lines t) - (setq buffer-read-only t) - (setq major-mode 'bookmark-bmenu-mode) - (setq mode-name "Bookmark Menu") - (run-mode-hooks 'bookmark-bmenu-mode-hook)) + (setq buffer-read-only t)) (defun bookmark-bmenu-toggle-filenames (&optional show) @@ -2189,7 +2181,8 @@ This also runs `bookmark-exit-hook'." (bookmark-time-to-save-p t) (bookmark-save))) -(add-hook 'kill-emacs-hook 'bookmark-exit-hook-internal) +(unless noninteractive + (add-hook 'kill-emacs-hook 'bookmark-exit-hook-internal)) (defun bookmark-unload-function () "Unload the Bookmark library."