aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/ChangeLog33
-rw-r--r--lisp/apropos.el9
-rw-r--r--lisp/arc-mode.el5
-rw-r--r--lisp/bookmark.el85
-rw-r--r--lisp/calendar/diary-lib.el7
-rw-r--r--lisp/dired.el6
-rw-r--r--lisp/emacs-lisp/ert.el12
-rw-r--r--lisp/emacs-lisp/package.el13
-rw-r--r--lisp/erc/erc-list.el28
-rw-r--r--lisp/image-mode.el4
-rw-r--r--lisp/net/xesam.el13
-rw-r--r--lisp/play/solitaire.el81
-rw-r--r--lisp/progmodes/compile.el8
-rw-r--r--lisp/replace.el117
-rw-r--r--lisp/simple.el3
-rw-r--r--lisp/tar-mode.el160
-rw-r--r--lisp/vc/diff-mode.el6
-rw-r--r--lisp/vc/log-view.el5
18 files changed, 276 insertions, 319 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 5b2011b108..d4f9358f2e 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,38 @@
2011-02-01 Sam Steingold <[email protected]>
+ * simple.el (special-mode-map): Bind "h" to `describe-mode';
+ bind "z" to `kill-this-buffer'.
+ (completion-list-mode-map): Bind "z" to `kill-this-buffer'.
+ * apropos.el (apropos-mode-map): Inherit from `special-mode-map'.
+ (apropos-mode): Inherit from `special-mode'.
+ * arc-mode.el (archive-mode-map): Inherit from `special-mode-map'.
+ * bookmark.el (bookmark-bmenu-mode): Define using
+ `define-derived-mode' inheriting from `special-mode'.
+ * dired.el (dired-mode-map): Inherit from `special-mode-map'.
+ * image-mode.el (image-mode-map): Ditto.
+ * replace.el (occur-mode): Define using
+ `define-derived-mode' inheriting from `special-mode'.
+ * tar-mode.el (tar-mode): Inherit from `special-mode'.
+ * calendar/diary-lib.el (diary-fancy-display-mode):
+ Inherit from `special-mode-map'.
+ * emacs-lisp/ert.el (ert-simple-view-mode, ert-results-mode):
+ Inherit from `special-mode'.
+ * emacs-lisp/package.el (package-menu-mode-map): Copy from
+ `special-mode-map'.
+ (package-menu-mode): Define using `define-derived-mode'
+ inheriting from `special-mode'.
+ * erc/erc-list.el (erc-list-menu-mode): Inherit from `special-mode'.
+ * net/xesam.el (xesam-mode): Inherit from `special-mode'.
+ (xesam-mode-map): Define separately.
+ * play/solitaire.el (solitaire-mode): Inherit from `special-mode'.
+ * progmodes/compile.el (compilation-minor-mode-map)
+ (compilation-mode-map): Inherit from `special-mode-map'.
+ * vc/diff-mode.el (diff-mode-shared-map):
+ Inherit from `special-mode-map'.
+ * vc/log-view.el (log-view-mode-map): Add a comment.
+
+2011-02-01 Sam Steingold <[email protected]>
+
* subr.el (purecopy-cons, purecopy-car): Add shortcuts.
* faces.el (face-x-resources): Use `purecopy-cons'.
* files.el (auto-mode-alist, interpreter-mode-alist): Use
diff --git a/lisp/apropos.el b/lisp/apropos.el
index 459d12804f..ac7d3d4085 100644
--- a/lisp/apropos.el
+++ b/lisp/apropos.el
@@ -121,15 +121,12 @@ If value is `verbose', the computed score is shown for each match."
(const :tag "show scores" verbose)))
(defvar apropos-mode-map
- (let ((map (make-sparse-keymap)))
- (set-keymap-parent map button-buffer-map)
+ (let ((map (copy-keymap button-buffer-map)))
+ (set-keymap-parent map special-mode-map)
;; Use `apropos-follow' instead of just using the button
;; definition of RET, so that users can use it anywhere in an
;; apropos item, not just on top of a button.
(define-key map "\C-m" 'apropos-follow)
- (define-key map " " 'scroll-up)
- (define-key map "\177" 'scroll-down)
- (define-key map "q" 'quit-window)
map)
"Keymap used in Apropos mode.")
@@ -410,7 +407,7 @@ This requires that at least 2 keywords (unless only one was given)."
"Return t if DOC is really matched by the current keywords."
(apropos-true-hit doc apropos-all-words))
-(define-derived-mode apropos-mode fundamental-mode "Apropos"
+(define-derived-mode apropos-mode special-mode "Apropos"
"Major mode for following hyperlinks in output of apropos commands.
\\{apropos-mode-map}")
diff --git a/lisp/arc-mode.el b/lisp/arc-mode.el
index 131b0dcd95..df96a1920e 100644
--- a/lisp/arc-mode.el
+++ b/lisp/arc-mode.el
@@ -339,7 +339,7 @@ be added."
(defvar archive-local-name nil "Name of local copy of remote archive.")
(defvar archive-mode-map
(let ((map (make-keymap)))
- (suppress-keymap map)
+ (set-keymap-parent map 'special-mode-map)
(define-key map " " 'archive-next-line)
(define-key map "a" 'archive-alternate-display)
;;(define-key map "c" 'archive-copy)
@@ -348,15 +348,12 @@ be added."
(define-key map "e" 'archive-extract)
(define-key map "f" 'archive-extract)
(define-key map "\C-m" 'archive-extract)
- (define-key map "g" 'revert-buffer)
- (define-key map "h" 'describe-mode)
(define-key map "m" 'archive-mark)
(define-key map "n" 'archive-next-line)
(define-key map "\C-n" 'archive-next-line)
(define-key map [down] 'archive-next-line)
(define-key map "o" 'archive-extract-other-window)
(define-key map "p" 'archive-previous-line)
- (define-key map "q" 'quit-window)
(define-key map "\C-p" 'archive-previous-line)
(define-key map [up] 'archive-previous-line)
(define-key map "r" 'archive-rename-entry)
diff --git a/lisp/bookmark.el b/lisp/bookmark.el
index 4c0dd64a2c..503264f4b3 100644
--- a/lisp/bookmark.el
+++ b/lisp/bookmark.el
@@ -1058,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,
@@ -1473,45 +1473,6 @@ method buffers use to resolve name collisions."
(defvar bookmark-bmenu-hidden-bookmarks ())
-(defvar bookmark-bmenu-mode-map
- (let ((map (make-keymap)))
- (suppress-keymap map t)
- (define-key map "q" 'quit-window)
- (define-key map "v" 'bookmark-bmenu-select)
- (define-key map "w" 'bookmark-bmenu-locate)
- (define-key map "2" 'bookmark-bmenu-2-window)
- (define-key map "1" 'bookmark-bmenu-1-window)
- (define-key map "j" 'bookmark-bmenu-this-window)
- (define-key map "\C-c\C-c" 'bookmark-bmenu-this-window)
- (define-key map "f" 'bookmark-bmenu-this-window)
- (define-key map "\C-m" 'bookmark-bmenu-this-window)
- (define-key map "o" 'bookmark-bmenu-other-window)
- (define-key map "\C-o" 'bookmark-bmenu-switch-other-window)
- (define-key map "s" 'bookmark-bmenu-save)
- (define-key map "k" 'bookmark-bmenu-delete)
- (define-key map "\C-d" 'bookmark-bmenu-delete-backwards)
- (define-key map "x" 'bookmark-bmenu-execute-deletions)
- (define-key map "d" 'bookmark-bmenu-delete)
- (define-key map " " 'next-line)
- (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)
- (define-key map "r" 'bookmark-bmenu-rename)
- (define-key map "R" 'bookmark-bmenu-relocate)
- (define-key map "t" 'bookmark-bmenu-toggle-filenames)
- (define-key map "a" 'bookmark-bmenu-show-annotation)
- (define-key map "A" 'bookmark-bmenu-show-all-annotations)
- (define-key map "e" 'bookmark-bmenu-edit-annotation)
- ;; The original binding of M-g hides the M-g prefix map.
- ;; If someone has a better idea than M-g s, I'm open to suggestions.
- (define-key map [?\M-g ?s] 'bookmark-bmenu-search)
- (define-key map [mouse-2] 'bookmark-bmenu-other-window-with-mouse)
- map))
-
;; Bookmark Buffer Menu mode is suitable only for specially formatted
;; data.
(put 'bookmark-bmenu-mode 'mode-class 'special)
@@ -1586,7 +1547,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.
@@ -1619,14 +1580,42 @@ 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))
+
+(define-key bookmark-bmenu-mode-map "q" 'quit-window)
+(define-key bookmark-bmenu-mode-map "v" 'bookmark-bmenu-select)
+(define-key bookmark-bmenu-mode-map "w" 'bookmark-bmenu-locate)
+(define-key bookmark-bmenu-mode-map "2" 'bookmark-bmenu-2-window)
+(define-key bookmark-bmenu-mode-map "1" 'bookmark-bmenu-1-window)
+(define-key bookmark-bmenu-mode-map "j" 'bookmark-bmenu-this-window)
+(define-key bookmark-bmenu-mode-map "\C-c\C-c" 'bookmark-bmenu-this-window)
+(define-key bookmark-bmenu-mode-map "f" 'bookmark-bmenu-this-window)
+(define-key bookmark-bmenu-mode-map "\C-m" 'bookmark-bmenu-this-window)
+(define-key bookmark-bmenu-mode-map "o" 'bookmark-bmenu-other-window)
+(define-key bookmark-bmenu-mode-map "\C-o" 'bookmark-bmenu-switch-other-window)
+(define-key bookmark-bmenu-mode-map "s" 'bookmark-bmenu-save)
+(define-key bookmark-bmenu-mode-map "k" 'bookmark-bmenu-delete)
+(define-key bookmark-bmenu-mode-map "\C-d" 'bookmark-bmenu-delete-backwards)
+(define-key bookmark-bmenu-mode-map "x" 'bookmark-bmenu-execute-deletions)
+(define-key bookmark-bmenu-mode-map "d" 'bookmark-bmenu-delete)
+(define-key bookmark-bmenu-mode-map " " 'next-line)
+(define-key bookmark-bmenu-mode-map "n" 'next-line)
+(define-key bookmark-bmenu-mode-map "p" 'previous-line)
+(define-key bookmark-bmenu-mode-map "\177" 'bookmark-bmenu-backup-unmark)
+(define-key bookmark-bmenu-mode-map "?" 'describe-mode)
+(define-key bookmark-bmenu-mode-map "u" 'bookmark-bmenu-unmark)
+(define-key bookmark-bmenu-mode-map "m" 'bookmark-bmenu-mark)
+(define-key bookmark-bmenu-mode-map "l" 'bookmark-bmenu-load)
+(define-key bookmark-bmenu-mode-map "r" 'bookmark-bmenu-rename)
+(define-key bookmark-bmenu-mode-map "R" 'bookmark-bmenu-relocate)
+(define-key bookmark-bmenu-mode-map "t" 'bookmark-bmenu-toggle-filenames)
+(define-key bookmark-bmenu-mode-map "a" 'bookmark-bmenu-show-annotation)
+(define-key bookmark-bmenu-mode-map "A" 'bookmark-bmenu-show-all-annotations)
+(define-key bookmark-bmenu-mode-map "e" 'bookmark-bmenu-edit-annotation)
+;; The original binding of M-g hides the M-g prefix map.
+;; If someone has a better idea than M-g s, I'm open to suggestions.
+(define-key bookmark-bmenu-mode-map [?\M-g ?s] 'bookmark-bmenu-search)(define-key bookmark-bmenu-mode-map [mouse-2] 'bookmark-bmenu-other-window-with-mouse)
(defun bookmark-bmenu-toggle-filenames (&optional show)
"Toggle whether filenames are shown in the bookmark list.
diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el
index 0bbdeccee6..c70808206a 100644
--- a/lisp/calendar/diary-lib.el
+++ b/lisp/calendar/diary-lib.el
@@ -2409,12 +2409,10 @@ Fontify the region between BEG and END, quietly unless VERBOSE is non-nil."
(setq end (line-beginning-position 2)))
(font-lock-default-fontify-region beg end verbose))
-(defvar diary-fancy-overriding-map (let ((map (make-sparse-keymap)))
- (define-key map "q" 'quit-window)
- map)
+(defvar diary-fancy-overriding-map (make-sparse-keymap)
"Keymap overriding minor-mode maps in `diary-fancy-display-mode'.")
-(define-derived-mode diary-fancy-display-mode fundamental-mode
+(define-derived-mode diary-fancy-display-mode special-mode
"Diary"
"Major mode used while displaying diary entries using Fancy Display."
(set (make-local-variable 'font-lock-defaults)
@@ -2422,7 +2420,6 @@ Fontify the region between BEG and END, quietly unless VERBOSE is non-nil."
t nil nil nil
(font-lock-fontify-region-function
. diary-fancy-font-lock-fontify-region-function)))
- (local-set-key "q" 'quit-window)
(set (make-local-variable 'minor-mode-overriding-map-alist)
(list (cons t diary-fancy-overriding-map)))
(view-mode 1))
diff --git a/lisp/dired.el b/lisp/dired.el
index 02d855a0d3..3cc490f12c 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -1294,7 +1294,7 @@ Do so according to the former subdir alist OLD-SUBDIR-ALIST."
;; This looks ugly when substitute-command-keys uses C-d instead d:
;; (define-key dired-mode-map "\C-d" 'dired-flag-file-deletion)
(let ((map (make-keymap)))
- (suppress-keymap map)
+ (set-keymap-parent map special-mode-map)
(define-key map [mouse-2] 'dired-mouse-find-file-other-window)
(define-key map [follow-link] 'mouse-face)
;; Commands to mark or flag certain categories of files
@@ -1373,7 +1373,6 @@ Do so according to the former subdir alist OLD-SUBDIR-ALIST."
(define-key map "\C-m" 'dired-find-file)
(put 'dired-find-file :advertised-binding "\C-m")
(define-key map "g" 'revert-buffer)
- (define-key map "h" 'describe-mode)
(define-key map "i" 'dired-maybe-insert-subdir)
(define-key map "j" 'dired-goto-file)
(define-key map "k" 'dired-do-kill-lines)
@@ -1383,7 +1382,6 @@ Do so according to the former subdir alist OLD-SUBDIR-ALIST."
(define-key map "o" 'dired-find-file-other-window)
(define-key map "\C-o" 'dired-display-file)
(define-key map "p" 'dired-previous-line)
- (define-key map "q" 'quit-window)
(define-key map "s" 'dired-sort-toggle-or-edit)
(define-key map "t" 'dired-toggle-marks)
(define-key map "u" 'dired-unmark)
@@ -2027,7 +2025,7 @@ Otherwise, an error occurs in these cases."
;; with quotation marks in their names.
(while (string-match "\\(?:[^\\]\\|\\`\\)\\(\"\\)" file)
(setq file (replace-match "\\\"" nil t file 1)))
-
+
(when (eq system-type 'windows-nt)
(save-match-data
(let ((start 0))
diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el
index 7ee8146323..fad8f82233 100644
--- a/lisp/emacs-lisp/ert.el
+++ b/lisp/emacs-lisp/ert.el
@@ -1997,19 +1997,12 @@ and how to display message."
;;; Simple view mode for auxiliary information like stack traces or
;;; messages. Mainly binds "q" for quit.
-(define-derived-mode ert-simple-view-mode fundamental-mode "ERT-View"
+(define-derived-mode ert-simple-view-mode special-mode "ERT-View"
"Major mode for viewing auxiliary information in ERT.")
-(loop for (key binding) in
- '(("q" quit-window)
- )
- do
- (define-key ert-simple-view-mode-map key binding))
-
-
;;; Commands and button actions for the results buffer.
-(define-derived-mode ert-results-mode fundamental-mode "ERT-Results"
+(define-derived-mode ert-results-mode special-mode "ERT-Results"
"Major mode for viewing results of ERT test runs.")
(loop for (key binding) in
@@ -2017,7 +2010,6 @@ and how to display message."
("\t" forward-button)
([backtab] backward-button)
("j" ert-results-jump-between-summary-and-result)
- ("q" quit-window)
("L" ert-results-toggle-printer-limits-for-test-at-point)
("n" ert-results-next-test)
("p" ert-results-previous-test)
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 59964ff6b9..c581e586b9 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -1213,18 +1213,16 @@ If optional arg NO-ACTIVATE is non-nil, don't activate packages."
;;;; Package menu mode.
(defvar package-menu-mode-map
- (let ((map (make-keymap))
+ (let ((map (copy-keymap special-mode-map))
(menu-map (make-sparse-keymap "Package")))
(set-keymap-parent map button-buffer-map)
(define-key map "\C-m" 'package-menu-describe-package)
- (define-key map "q" 'quit-window)
(define-key map "n" 'next-line)
(define-key map "p" 'previous-line)
(define-key map "u" 'package-menu-mark-unmark)
(define-key map "\177" 'package-menu-backup-unmark)
(define-key map "d" 'package-menu-mark-delete)
(define-key map "i" 'package-menu-mark-install)
- (define-key map "g" 'revert-buffer)
(define-key map "r" 'package-menu-refresh)
(define-key map "~" 'package-menu-mark-obsolete-for-deletion)
(define-key map "x" 'package-menu-execute)
@@ -1290,15 +1288,11 @@ If optional arg NO-ACTIVATE is non-nil, don't activate packages."
(put 'package-menu-mode 'mode-class 'special)
-(defun package-menu-mode ()
+(define-derived-mode package-menu-mode special-mode "Package Menu"
"Major mode for browsing a list of packages.
Letters do not insert themselves; instead, they are commands.
\\<package-menu-mode-map>
\\{package-menu-mode-map}"
- (kill-all-local-variables)
- (use-local-map package-menu-mode-map)
- (setq major-mode 'package-menu-mode)
- (setq mode-name "Package Menu")
(setq truncate-lines t)
(setq buffer-read-only t)
(set (make-local-variable 'revert-buffer-function) 'package-menu-revert)
@@ -1326,8 +1320,7 @@ Letters do not insert themselves; instead, they are commands.
(20 . "Version")
(32 . "Status")
(43 . "Description"))
- ""))
- (run-mode-hooks 'package-menu-mode-hook))
+ "")))
(defun package-menu-refresh ()
"Download the Emacs Lisp package archive.
diff --git a/lisp/erc/erc-list.el b/lisp/erc/erc-list.el
index 955b654f92..ae579dba3b 100644
--- a/lisp/erc/erc-list.el
+++ b/lisp/erc/erc-list.el
@@ -117,26 +117,12 @@
(sort-fields col (point-min) (point-max))
(sort-numeric-fields col (point-min) (point-max))))))
-(defvar erc-list-menu-mode-map
- (let ((map (make-keymap)))
- (suppress-keymap map)
- (define-key map "k" 'erc-list-kill)
- (define-key map "j" 'erc-list-join)
- (define-key map "g" 'erc-list-revert)
- (define-key map "n" 'next-line)
- (define-key map "p" 'previous-line)
- (define-key map "q" 'quit-window)
- map)
- "Local keymap for `erc-list-mode' buffers.")
-
-(defvar erc-list-menu-sort-button-map nil
- "Local keymap for ERC list menu mode sorting buttons.")
-
-(unless erc-list-menu-sort-button-map
+(defvar erc-list-menu-sort-button-map
(let ((map (make-sparse-keymap)))
(define-key map [header-line mouse-1] 'erc-list-menu-sort-by-column)
(define-key map [follow-link] 'mouse-face)
- (setq erc-list-menu-sort-button-map map)))
+ map)
+ "Local keymap for ERC list menu mode sorting buttons.")
;; Helper function that makes a buttonized column header.
(defun erc-list-button (title column)
@@ -146,7 +132,7 @@
'mouse-face 'highlight
'keymap erc-list-menu-sort-button-map))
-(define-derived-mode erc-list-menu-mode nil "ERC-List"
+(define-derived-mode erc-list-menu-mode special-mode "ERC-List"
"Major mode for editing a list of irc channels."
(setq header-line-format
(concat
@@ -160,6 +146,12 @@
(put 'erc-list-menu-mode 'mode-class 'special)
+(define-key erc-list-menu-mode-map "k" 'erc-list-kill)
+(define-key erc-list-menu-mode-map "j" 'erc-list-join)
+(define-key erc-list-menu-mode-map "g" 'erc-list-revert)
+(define-key erc-list-menu-mode-map "n" 'next-line)
+(define-key erc-list-menu-mode-map "p" 'previous-line)
+
;; Handle a "322" response. This response tells us about a single
;; channel.
(defun erc-list-handle-322 (proc parsed)
diff --git a/lisp/image-mode.el b/lisp/image-mode.el
index 74fd96e8ad..190ca08722 100644
--- a/lisp/image-mode.el
+++ b/lisp/image-mode.el
@@ -305,8 +305,7 @@ This variable is used to display the current image type in the mode line.")
(defvar image-mode-map
(let ((map (make-sparse-keymap)))
- (suppress-keymap map)
- (define-key map "q" 'quit-window)
+ (set-keymap-parent map special-mode-map)
(define-key map "\C-c\C-c" 'image-toggle-display)
(define-key map (kbd "SPC") 'image-scroll-up)
(define-key map (kbd "DEL") 'image-scroll-down)
@@ -385,7 +384,6 @@ to toggle between display as an image and display as text."
(funcall
(if (called-interactively-p 'any) 'error 'message)
"Cannot display image: %s" (cdr err)))))
-
;;;###autoload
(define-minor-mode image-minor-mode
"Toggle Image minor mode.
diff --git a/lisp/net/xesam.el b/lisp/net/xesam.el
index 16500c61b7..21a2274940 100644
--- a/lisp/net/xesam.el
+++ b/lisp/net/xesam.el
@@ -446,7 +446,12 @@ If there is no registered search engine at all, the function returns `nil'."
;;; Search buffers.
-(define-derived-mode xesam-mode nil "Xesam"
+(defvar xesam-mode-map
+ (let ((map (copy-keymap special-mode-map)))
+ (set-keymap-parent xesam-mode-map widget-keymap)
+ map))
+
+(define-derived-mode xesam-mode special-mode "Xesam"
"Major mode for presenting search results of a Xesam search.
In this mode, widgets represent the search results.
@@ -455,12 +460,6 @@ Turning on Xesam mode runs the normal hook `xesam-mode-hook'. It
can be used to set `xesam-notify-function', which must a search
engine specific, widget :notify function to visualize xesam:url."
(set (make-local-variable 'xesam-notify-function) nil)
-
- ;; Keymap.
- (setq xesam-mode-map (copy-keymap special-mode-map))
- (set-keymap-parent xesam-mode-map widget-keymap)
- (define-key xesam-mode-map "z" 'kill-this-buffer)
-
;; Maybe we implement something useful, later on.
(set (make-local-variable 'revert-buffer-function) 'ignore)
;; `xesam-engine', `xesam-search', `xesam-type', `xesam-query', and
diff --git a/lisp/play/solitaire.el b/lisp/play/solitaire.el
index d58a81b5ae..a9cb6c32e7 100644
--- a/lisp/play/solitaire.el
+++ b/lisp/play/solitaire.el
@@ -41,54 +41,10 @@
:type 'hook
:group 'solitaire)
-(defvar solitaire-mode-map
- (let ((map (make-sparse-keymap)))
- (suppress-keymap map t)
-
- (define-key map "\C-f" 'solitaire-right)
- (define-key map "\C-b" 'solitaire-left)
- (define-key map "\C-p" 'solitaire-up)
- (define-key map "\C-n" 'solitaire-down)
- (define-key map "\r" 'solitaire-move)
- (define-key map [remap undo] 'solitaire-undo)
- (define-key map " " 'solitaire-do-check)
- (define-key map "q" 'quit-window)
-
- (define-key map [right] 'solitaire-right)
- (define-key map [left] 'solitaire-left)
- (define-key map [up] 'solitaire-up)
- (define-key map [down] 'solitaire-down)
-
- (define-key map [S-right] 'solitaire-move-right)
- (define-key map [S-left] 'solitaire-move-left)
- (define-key map [S-up] 'solitaire-move-up)
- (define-key map [S-down] 'solitaire-move-down)
-
- (define-key map [kp-6] 'solitaire-right)
- (define-key map [kp-4] 'solitaire-left)
- (define-key map [kp-8] 'solitaire-up)
- (define-key map [kp-2] 'solitaire-down)
- (define-key map [kp-5] 'solitaire-center-point)
-
- (define-key map [S-kp-6] 'solitaire-move-right)
- (define-key map [S-kp-4] 'solitaire-move-left)
- (define-key map [S-kp-8] 'solitaire-move-up)
- (define-key map [S-kp-2] 'solitaire-move-down)
-
- (define-key map [kp-enter] 'solitaire-move)
- (define-key map [kp-0] 'solitaire-undo)
-
- ;; spoil it with s ;)
- (define-key map [?s] 'solitaire-solve)
-
- ;; (define-key map [kp-0] 'solitaire-hint) - Not yet provided ;)
- map)
- "Keymap for playing Solitaire.")
-
;; Solitaire mode is suitable only for specially formatted data.
(put 'solitaire-mode 'mode-class 'special)
-(define-derived-mode solitaire-mode nil "Solitaire"
+(define-derived-mode solitaire-mode special-mode "Solitaire"
"Major mode for playing Solitaire.
To learn how to play Solitaire, see the documentation for function
`solitaire'.
@@ -98,6 +54,41 @@ The usual mnemonic keys move the cursor around the board; in addition,
(setq truncate-lines t)
(setq show-trailing-whitespace nil))
+(define-key solitaire-mode-map "\C-f" 'solitaire-right)
+(define-key solitaire-mode-map "\C-b" 'solitaire-left)
+(define-key solitaire-mode-map "\C-p" 'solitaire-up)
+(define-key solitaire-mode-map "\C-n" 'solitaire-down)
+(define-key solitaire-mode-map "\r" 'solitaire-move)
+(define-key solitaire-mode-map [remap undo] 'solitaire-undo)
+(define-key solitaire-mode-map " " 'solitaire-do-check)
+
+(define-key solitaire-mode-map [right] 'solitaire-right)
+(define-key solitaire-mode-map [left] 'solitaire-left)
+(define-key solitaire-mode-map [up] 'solitaire-up)
+(define-key solitaire-mode-map [down] 'solitaire-down)
+
+(define-key solitaire-mode-map [S-right] 'solitaire-move-right)
+(define-key solitaire-mode-map [S-left] 'solitaire-move-left)
+(define-key solitaire-mode-map [S-up] 'solitaire-move-up)
+(define-key solitaire-mode-map [S-down] 'solitaire-move-down)
+
+(define-key solitaire-mode-map [kp-6] 'solitaire-right)
+(define-key solitaire-mode-map [kp-4] 'solitaire-left)
+(define-key solitaire-mode-map [kp-8] 'solitaire-up)
+(define-key solitaire-mode-map [kp-2] 'solitaire-down)
+(define-key solitaire-mode-map [kp-5] 'solitaire-center-point)
+
+(define-key solitaire-mode-map [S-kp-6] 'solitaire-move-right)
+(define-key solitaire-mode-map [S-kp-4] 'solitaire-move-left)
+(define-key solitaire-mode-map [S-kp-8] 'solitaire-move-up)
+(define-key solitaire-mode-map [S-kp-2] 'solitaire-move-down)
+
+(define-key solitaire-mode-map [kp-enter] 'solitaire-move)
+(define-key solitaire-mode-map [kp-0] 'solitaire-undo)
+
+;; spoil it with s ;)
+(define-key solitaire-mode-map [?s] 'solitaire-solve)
+;; (define-key map [kp-0] 'solitaire-hint) - Not yet provided ;)
(defvar solitaire-stones 0
"Counter for the stones that are still there.")
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index df8e044d20..e243043d66 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -862,7 +862,7 @@ POS and RES.")
(< (cdr compilation--previous-directory-cache) pos)))
;; No need to call previous-single-property-change.
(cdr compilation--previous-directory-cache)
-
+
(let* ((cache (and compilation--previous-directory-cache
(<= (car compilation--previous-directory-cache) pos)
(car compilation--previous-directory-cache)))
@@ -1711,6 +1711,7 @@ Returns the compilation buffer created."
(defvar compilation-minor-mode-map
(let ((map (make-sparse-keymap)))
+ (set-keymap-parent map special-mode-map)
(define-key map [mouse-2] 'compile-goto-error)
(define-key map [follow-link] 'mouse-face)
(define-key map "\C-c\C-c" 'compile-goto-error)
@@ -1721,7 +1722,6 @@ Returns the compilation buffer created."
(define-key map "\M-{" 'compilation-previous-file)
(define-key map "\M-}" 'compilation-next-file)
(define-key map "g" 'recompile) ; revert
- (define-key map "q" 'quit-window)
;; Set up the menu-bar
(define-key map [menu-bar compilation]
(cons "Errors" compilation-menu-map))
@@ -1755,6 +1755,7 @@ Returns the compilation buffer created."
;; Don't inherit from compilation-minor-mode-map,
;; because that introduces a menu bar item we don't want.
;; That confuses C-down-mouse-3.
+ (set-keymap-parent map special-mode-map)
(define-key map [mouse-2] 'compile-goto-error)
(define-key map [follow-link] 'mouse-face)
(define-key map "\C-c\C-c" 'compile-goto-error)
@@ -1767,10 +1768,7 @@ Returns the compilation buffer created."
(define-key map "\t" 'compilation-next-error)
(define-key map [backtab] 'compilation-previous-error)
(define-key map "g" 'recompile) ; revert
- (define-key map "q" 'quit-window)
- (define-key map " " 'scroll-up)
- (define-key map "\^?" 'scroll-down)
(define-key map "\C-c\C-f" 'next-error-follow-minor-mode)
;; Set up the menu-bar
diff --git a/lisp/replace.el b/lisp/replace.el
index d89a511a09..924622b692 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -757,63 +757,6 @@ a previously found match."
count)))
-(defvar occur-mode-map
- (let ((map (make-sparse-keymap)))
- ;; We use this alternative name, so we can use \\[occur-mode-mouse-goto].
- (define-key map [mouse-2] 'occur-mode-mouse-goto)
- (define-key map "\C-c\C-c" 'occur-mode-goto-occurrence)
- (define-key map "\C-m" 'occur-mode-goto-occurrence)
- (define-key map "o" 'occur-mode-goto-occurrence-other-window)
- (define-key map "\C-o" 'occur-mode-display-occurrence)
- (define-key map "\M-n" 'occur-next)
- (define-key map "\M-p" 'occur-prev)
- (define-key map "r" 'occur-rename-buffer)
- (define-key map "c" 'clone-buffer)
- (define-key map "g" 'revert-buffer)
- (define-key map "q" 'quit-window)
- (define-key map "z" 'kill-this-buffer)
- (define-key map "\C-c\C-f" 'next-error-follow-minor-mode)
- (define-key map [menu-bar] (make-sparse-keymap))
- (define-key map [menu-bar occur]
- `(cons ,(purecopy "Occur") map))
- (define-key map [next-error-follow-minor-mode]
- (menu-bar-make-mm-toggle next-error-follow-minor-mode
- "Auto Occurrence Display"
- "Display another occurrence when moving the cursor"))
- (define-key map [separator-1] menu-bar-separator)
- (define-key map [kill-this-buffer]
- `(menu-item ,(purecopy "Kill occur buffer") kill-this-buffer
- :help ,(purecopy "Kill the current *Occur* buffer")))
- (define-key map [quit-window]
- `(menu-item ,(purecopy "Quit occur window") quit-window
- :help ,(purecopy "Quit the current *Occur* buffer. Bury it, and maybe delete the selected frame")))
- (define-key map [revert-buffer]
- `(menu-item ,(purecopy "Revert occur buffer") revert-buffer
- :help ,(purecopy "Replace the text in the *Occur* buffer with the results of rerunning occur")))
- (define-key map [clone-buffer]
- `(menu-item ,(purecopy "Clone occur buffer") clone-buffer
- :help ,(purecopy "Create and return a twin copy of the current *Occur* buffer")))
- (define-key map [occur-rename-buffer]
- `(menu-item ,(purecopy "Rename occur buffer") occur-rename-buffer
- :help ,(purecopy "Rename the current *Occur* buffer to *Occur: original-buffer-name*.")))
- (define-key map [separator-2] menu-bar-separator)
- (define-key map [occur-mode-goto-occurrence-other-window]
- `(menu-item ,(purecopy "Go To Occurrence Other Window") occur-mode-goto-occurrence-other-window
- :help ,(purecopy "Go to the occurrence the current line describes, in another window")))
- (define-key map [occur-mode-goto-occurrence]
- `(menu-item ,(purecopy "Go To Occurrence") occur-mode-goto-occurrence
- :help ,(purecopy "Go to the occurrence the current line describes")))
- (define-key map [occur-mode-display-occurrence]
- `(menu-item ,(purecopy "Display Occurrence") occur-mode-display-occurrence
- :help ,(purecopy "Display in another window the occurrence the current line describes")))
- (define-key map [occur-next]
- `(menu-item ,(purecopy "Move to next match") occur-next
- :help ,(purecopy "Move to the Nth (default 1) next match in an Occur mode buffer")))
- (define-key map [occur-prev]
- `(menu-item ,(purecopy "Move to previous match") occur-prev
- :help ,(purecopy "Move to the Nth (default 1) previous match in an Occur mode buffer")))
- map)
- "Keymap for `occur-mode'.")
(defvar occur-revert-arguments nil
"Arguments to pass to `occur-1' to revert an Occur mode buffer.
@@ -837,24 +780,66 @@ for this is to reveal context in an outline-mode when the occurrence is hidden."
:group 'matching)
(put 'occur-mode 'mode-class 'special)
-(defun occur-mode ()
+(define-derived-mode occur-mode special-mode "Occur"
"Major mode for output from \\[occur].
\\<occur-mode-map>Move point to one of the items in this buffer, then use
\\[occur-mode-goto-occurrence] to go to the occurrence that the item refers to.
Alternatively, click \\[occur-mode-mouse-goto] on an item to go to it.
\\{occur-mode-map}"
- (interactive)
- (kill-all-local-variables)
- (use-local-map occur-mode-map)
- (setq major-mode 'occur-mode)
- (setq mode-name "Occur")
(set (make-local-variable 'revert-buffer-function) 'occur-revert-function)
(make-local-variable 'occur-revert-arguments)
(add-hook 'change-major-mode-hook 'font-lock-defontify nil t)
- (setq next-error-function 'occur-next-error)
- (run-mode-hooks 'occur-mode-hook))
-
+ (setq next-error-function 'occur-next-error))
+
+(define-key occur-mode-map [mouse-2] 'occur-mode-mouse-goto)
+(define-key occur-mode-map "\C-c\C-c" 'occur-mode-goto-occurrence)
+(define-key occur-mode-map "\C-m" 'occur-mode-goto-occurrence)
+(define-key occur-mode-map "o" 'occur-mode-goto-occurrence-other-window)
+(define-key occur-mode-map "\C-o" 'occur-mode-display-occurrence)
+(define-key occur-mode-map "\M-n" 'occur-next)
+(define-key occur-mode-map "\M-p" 'occur-prev)
+(define-key occur-mode-map "r" 'occur-rename-buffer)
+(define-key occur-mode-map "c" 'clone-buffer)
+(define-key occur-mode-map "\C-c\C-f" 'next-error-follow-minor-mode)
+(define-key occur-mode-map [menu-bar] (make-sparse-keymap))
+(define-key occur-mode-map [menu-bar occur] `(cons ,(purecopy "Occur") map))
+(define-key occur-mode-map [next-error-follow-minor-mode]
+ (menu-bar-make-mm-toggle next-error-follow-minor-mode
+ "Auto Occurrence Display"
+ "Display another occurrence when moving the cursor"))
+(define-key occur-mode-map [separator-1] menu-bar-separator)
+(define-key occur-mode-map [kill-this-buffer]
+ `(menu-item ,(purecopy "Kill occur buffer") kill-this-buffer
+ :help ,(purecopy "Kill the current *Occur* buffer")))
+(define-key occur-mode-map [quit-window]
+ `(menu-item ,(purecopy "Quit occur window") quit-window
+ :help ,(purecopy "Quit the current *Occur* buffer. Bury it, and maybe delete the selected frame")))
+(define-key occur-mode-map [revert-buffer]
+ `(menu-item ,(purecopy "Revert occur buffer") revert-buffer
+ :help ,(purecopy "Replace the text in the *Occur* buffer with the results of rerunning occur")))
+(define-key occur-mode-map [clone-buffer]
+ `(menu-item ,(purecopy "Clone occur buffer") clone-buffer
+ :help ,(purecopy "Create and return a twin copy of the current *Occur* buffer")))
+(define-key occur-mode-map [occur-rename-buffer]
+ `(menu-item ,(purecopy "Rename occur buffer") occur-rename-buffer
+ :help ,(purecopy "Rename the current *Occur* buffer to *Occur: original-buffer-name*.")))
+(define-key occur-mode-map [separator-2] menu-bar-separator)
+(define-key occur-mode-map [occur-mode-goto-occurrence-other-window]
+ `(menu-item ,(purecopy "Go To Occurrence Other Window") occur-mode-goto-occurrence-other-window
+ :help ,(purecopy "Go to the occurrence the current line describes, in another window")))
+(define-key occur-mode-map [occur-mode-goto-occurrence]
+ `(menu-item ,(purecopy "Go To Occurrence") occur-mode-goto-occurrence
+ :help ,(purecopy "Go to the occurrence the current line describes")))
+(define-key occur-mode-map [occur-mode-display-occurrence]
+ `(menu-item ,(purecopy "Display Occurrence") occur-mode-display-occurrence
+ :help ,(purecopy "Display in another window the occurrence the current line describes")))
+(define-key occur-mode-map [occur-next]
+ `(menu-item ,(purecopy "Move to next match") occur-next
+ :help ,(purecopy "Move to the Nth (default 1) next match in an Occur mode buffer")))
+(define-key occur-mode-map [occur-prev]
+ `(menu-item ,(purecopy "Move to previous match") occur-prev
+ :help ,(purecopy "Move to the Nth (default 1) previous match in an Occur mode buffer")))
(defun occur-revert-function (ignore1 ignore2)
"Handle `revert-buffer' for Occur mode buffers."
(apply 'occur-1 (append occur-revert-arguments (list (buffer-name)))))
diff --git a/lisp/simple.el b/lisp/simple.el
index 51c33e5c5f..537c9a8083 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -411,9 +411,11 @@ Other major modes are defined by comparison with this one."
(define-key map " " 'scroll-up)
(define-key map "\C-?" 'scroll-down)
(define-key map "?" 'describe-mode)
+ (define-key map "h" 'describe-mode)
(define-key map ">" 'end-of-buffer)
(define-key map "<" 'beginning-of-buffer)
(define-key map "g" 'revert-buffer)
+ (define-key map "z" 'kill-this-buffer)
map))
(put 'special-mode 'mode-class 'special)
@@ -5890,6 +5892,7 @@ With a prefix argument, set VARIABLE to VALUE buffer-locally."
(define-key map [left] 'previous-completion)
(define-key map [right] 'next-completion)
(define-key map "q" 'quit-window)
+ (define-key map "z" 'kill-this-buffer)
map)
"Local map for completion list buffers.")
diff --git a/lisp/tar-mode.el b/lisp/tar-mode.el
index fdac245c53..10ea1ac23c 100644
--- a/lisp/tar-mode.el
+++ b/lisp/tar-mode.el
@@ -220,7 +220,7 @@ Preserve the modified states of the buffers and set `buffer-swapped-with'."
(defun tar-roundup-512 (s)
"Round S up to the next multiple of 512."
(ash (ash (+ s 511) -9) 9))
-
+
(defun tar-header-block-tokenize (pos coding)
"Return a `tar-header' structure.
This is a list of name, mode, uid, gid, size,
@@ -283,7 +283,7 @@ write-date, checksum, link-type, and link-name."
(let* ((size (tar-parse-octal-integer
string tar-size-offset tar-time-offset))
;; -1 so as to strip the terminating 0 byte.
- (name (decode-coding-string
+ (name (decode-coding-string
(buffer-substring pos (+ pos size -1)) coding))
(descriptor (tar-header-block-tokenize
(+ pos (tar-roundup-512 size))
@@ -298,7 +298,7 @@ write-date, checksum, link-type, and link-name."
(setf (tar-header-header-start descriptor)
(copy-marker (- pos 512) t))
descriptor)
-
+
(make-tar-header
(copy-marker pos nil)
name
@@ -501,7 +501,7 @@ MODE should be an integer which is a file mode value."
;;(tar-header-block-check-checksum
;; hblock (tar-header-block-checksum hblock)
;; (tar-header-name descriptor))
-
+
(push descriptor result)
(setq pos (tar-header-data-end descriptor))
(progress-reporter-update progress-reporter pos)))
@@ -520,86 +520,7 @@ MODE should be an integer which is a file mode value."
(goto-char (point-min))
(restore-buffer-modified-p modified)))
-(defvar tar-mode-map
- (let ((map (make-keymap)))
- (suppress-keymap map)
- (define-key map " " 'tar-next-line)
- (define-key map "C" 'tar-copy)
- (define-key map "d" 'tar-flag-deleted)
- (define-key map "\^D" 'tar-flag-deleted)
- (define-key map "e" 'tar-extract)
- (define-key map "f" 'tar-extract)
- (define-key map "\C-m" 'tar-extract)
- (define-key map [mouse-2] 'tar-mouse-extract)
- (define-key map "g" 'revert-buffer)
- (define-key map "h" 'describe-mode)
- (define-key map "n" 'tar-next-line)
- (define-key map "\^N" 'tar-next-line)
- (define-key map [down] 'tar-next-line)
- (define-key map "o" 'tar-extract-other-window)
- (define-key map "p" 'tar-previous-line)
- (define-key map "q" 'quit-window)
- (define-key map "\^P" 'tar-previous-line)
- (define-key map [up] 'tar-previous-line)
- (define-key map "R" 'tar-rename-entry)
- (define-key map "u" 'tar-unflag)
- (define-key map "v" 'tar-view)
- (define-key map "x" 'tar-expunge)
- (define-key map "\177" 'tar-unflag-backwards)
- (define-key map "E" 'tar-extract-other-window)
- (define-key map "M" 'tar-chmod-entry)
- (define-key map "G" 'tar-chgrp-entry)
- (define-key map "O" 'tar-chown-entry)
- ;; Let mouse-1 follow the link.
- (define-key map [follow-link] 'mouse-face)
-
- ;; Make menu bar items.
-
- ;; Get rid of the Edit menu bar item to save space.
- (define-key map [menu-bar edit] 'undefined)
-
- (define-key map [menu-bar immediate]
- (cons "Immediate" (make-sparse-keymap "Immediate")))
-
- (define-key map [menu-bar immediate view]
- '("View This File" . tar-view))
- (define-key map [menu-bar immediate display]
- '("Display in Other Window" . tar-display-other-window))
- (define-key map [menu-bar immediate find-file-other-window]
- '("Find in Other Window" . tar-extract-other-window))
- (define-key map [menu-bar immediate find-file]
- '("Find This File" . tar-extract))
-
- (define-key map [menu-bar mark]
- (cons "Mark" (make-sparse-keymap "Mark")))
-
- (define-key map [menu-bar mark unmark-all]
- '("Unmark All" . tar-clear-modification-flags))
- (define-key map [menu-bar mark deletion]
- '("Flag" . tar-flag-deleted))
- (define-key map [menu-bar mark unmark]
- '("Unflag" . tar-unflag))
-
- (define-key map [menu-bar operate]
- (cons "Operate" (make-sparse-keymap "Operate")))
-
- (define-key map [menu-bar operate chown]
- '("Change Owner..." . tar-chown-entry))
- (define-key map [menu-bar operate chgrp]
- '("Change Group..." . tar-chgrp-entry))
- (define-key map [menu-bar operate chmod]
- '("Change Mode..." . tar-chmod-entry))
- (define-key map [menu-bar operate rename]
- '("Rename to..." . tar-rename-entry))
- (define-key map [menu-bar operate copy]
- '("Copy to..." . tar-copy))
- (define-key map [menu-bar operate expunge]
- '("Expunge Marked Files" . tar-expunge))
-
- map)
- "Local keymap for Tar mode listings.")
-
;; tar mode is suitable only for specially formatted data.
(put 'tar-mode 'mode-class 'special)
(put 'tar-subfile-mode 'mode-class 'special)
@@ -614,7 +535,7 @@ MODE should be an integer which is a file mode value."
(if (buffer-live-p tar-data-buffer) (kill-buffer tar-data-buffer)))
;;;###autoload
-(define-derived-mode tar-mode nil "Tar"
+(define-derived-mode tar-mode special-mode "Tar"
"Major mode for viewing a tar file as a dired-like listing of its contents.
You can move around using the usual cursor motion commands.
Letters no longer insert themselves.
@@ -669,6 +590,77 @@ See also: variables `tar-update-datestamp' and `tar-anal-blocksize'.
(fundamental-mode)
(signal (car err) (cdr err)))))
+(define-key tar-mode-map " " 'tar-next-line)
+(define-key tar-mode-map "C" 'tar-copy)
+(define-key tar-mode-map "d" 'tar-flag-deleted)
+(define-key tar-mode-map "\^D" 'tar-flag-deleted)
+(define-key tar-mode-map "e" 'tar-extract)
+(define-key tar-mode-map "f" 'tar-extract)
+(define-key tar-mode-map "\C-m" 'tar-extract)
+(define-key tar-mode-map [mouse-2] 'tar-mouse-extract)
+(define-key tar-mode-map "g" 'revert-buffer)
+(define-key tar-mode-map "h" 'describe-mode)
+(define-key tar-mode-map "n" 'tar-next-line)
+(define-key tar-mode-map "\^N" 'tar-next-line)
+(define-key tar-mode-map [down] 'tar-next-line)
+(define-key tar-mode-map "o" 'tar-extract-other-window)
+(define-key tar-mode-map "p" 'tar-previous-line)
+(define-key tar-mode-map "\^P" 'tar-previous-line)
+(define-key tar-mode-map [up] 'tar-previous-line)
+(define-key tar-mode-map "R" 'tar-rename-entry)
+(define-key tar-mode-map "u" 'tar-unflag)
+(define-key tar-mode-map "v" 'tar-view)
+(define-key tar-mode-map "x" 'tar-expunge)
+(define-key tar-mode-map "\177" 'tar-unflag-backwards)
+(define-key tar-mode-map "E" 'tar-extract-other-window)
+(define-key tar-mode-map "M" 'tar-chmod-entry)
+(define-key tar-mode-map "G" 'tar-chgrp-entry)
+(define-key tar-mode-map "O" 'tar-chown-entry)
+;; Let mouse-1 follow the link.
+(define-key tar-mode-map [follow-link] 'mouse-face)
+
+;; Make menu bar items.
+
+;; Get rid of the Edit menu bar item to save space.
+(define-key tar-mode-map [menu-bar edit] 'undefined)
+
+(define-key tar-mode-map [menu-bar immediate]
+ (cons "Immediate" (make-sparse-keymap "Immediate")))
+
+(define-key tar-mode-map [menu-bar immediate view]
+ '("View This File" . tar-view))
+(define-key tar-mode-map [menu-bar immediate display]
+ '("Display in Other Window" . tar-display-other-window))
+(define-key tar-mode-map [menu-bar immediate find-file-other-window]
+ '("Find in Other Window" . tar-extract-other-window))
+(define-key tar-mode-map [menu-bar immediate find-file]
+ '("Find This File" . tar-extract))
+
+(define-key tar-mode-map [menu-bar mark]
+ (cons "Mark" (make-sparse-keymap "Mark")))
+
+(define-key tar-mode-map [menu-bar mark unmark-all]
+ '("Unmark All" . tar-clear-modification-flags))
+(define-key tar-mode-map [menu-bar mark deletion]
+ '("Flag" . tar-flag-deleted))
+(define-key tar-mode-map [menu-bar mark unmark]
+ '("Unflag" . tar-unflag))
+
+(define-key tar-mode-map [menu-bar operate]
+ (cons "Operate" (make-sparse-keymap "Operate")))
+
+(define-key tar-mode-map [menu-bar operate chown]
+ '("Change Owner..." . tar-chown-entry))
+(define-key tar-mode-map [menu-bar operate chgrp]
+ '("Change Group..." . tar-chgrp-entry))
+(define-key tar-mode-map [menu-bar operate chmod]
+ '("Change Mode..." . tar-chmod-entry))
+(define-key tar-mode-map [menu-bar operate rename]
+ '("Rename to..." . tar-rename-entry))
+(define-key tar-mode-map [menu-bar operate copy]
+ '("Copy to..." . tar-copy))
+(define-key tar-mode-map [menu-bar operate expunge]
+ '("Expunge Marked Files" . tar-expunge))
(define-minor-mode tar-subfile-mode
"Minor mode for editing an element of a tar-file.
diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el
index a1c9f9d02d..13d10f02b4 100644
--- a/lisp/vc/diff-mode.el
+++ b/lisp/vc/diff-mode.el
@@ -140,9 +140,9 @@ when editing big diffs)."
;; Standard M-r is useful, so don't change M-r or M-R.
;;("r" . diff-restrict-view)
;;("R" . diff-reverse-direction)
- ("g" . revert-buffer)
- ("q" . quit-window))
- "Basic keymap for `diff-mode', bound to various prefix keys.")
+ )
+ "Basic keymap for `diff-mode', bound to various prefix keys."
+ :inherit special-mode-map)
(easy-mmode-defmap diff-mode-map
`(("\e" . ,diff-mode-shared-map)
diff --git a/lisp/vc/log-view.el b/lisp/vc/log-view.el
index 3b008c69d4..11ffc9a5e3 100644
--- a/lisp/vc/log-view.el
+++ b/lisp/vc/log-view.el
@@ -125,9 +125,12 @@
(require 'wid-edit)
(easy-mmode-defmap log-view-mode-map
- '(("z" . kill-this-buffer)
+ '(
+ ;; FIXME: (copy-keymap special-mode-map) instead
+ ("z" . kill-this-buffer)
("q" . quit-window)
("g" . revert-buffer)
+
("m" . log-view-toggle-mark-entry)
("e" . log-view-modify-change-comment)
("d" . log-view-diff)