[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
'suppress-keymap' patch for easy-mmode
From: |
Tom Tromey |
Subject: |
'suppress-keymap' patch for easy-mmode |
Date: |
Tue, 08 Jan 2008 18:45:27 -0700 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.990 (gnu/linux) |
While looking at pcvs I found that easy-mmode-define-keymap doesn't
document its keywords. This updates the documentation, adds a
":suppress" keywords, and updates pcvs to use it.
Tom
lisp/ChangeLog:
2008-01-09 Tom Tromey <address@hidden>
* emacs-lisp/easy-mmode.el (easy-mmode-define-keymap): Document
keywords. Add :suppress.
* pcvs-defs.el (cvs-mode-map): Use :suppress.
Index: lisp/emacs-lisp/easy-mmode.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/emacs-lisp/easy-mmode.el,v
retrieving revision 1.90
diff -u -r1.90 easy-mmode.el
--- lisp/emacs-lisp/easy-mmode.el 8 Jan 2008 20:45:36 -0000 1.90
+++ lisp/emacs-lisp/easy-mmode.el 9 Jan 2008 02:11:45 -0000
@@ -409,8 +409,17 @@
KEY and BINDINGS are suitable for `define-key'.
Optional NAME is passed to `make-sparse-keymap'.
Optional map M can be used to modify an existing map.
-ARGS is a list of additional keyword arguments."
- (let (inherit dense)
+ARGS is a list of additional keyword arguments.
+
+Valid keywords and arguments are:
+
+ :name Name of the keymap; overrides NAME argument.
+ :dense Non-nil for a dense keymap.
+ :inherit Parent keymap.
+ :group Ignored.
+ :suppress Non-nil to call `suppress-keymap' on keymap,
+ 'nodigits to suppress digits as prefix arguments."
+ (let (inherit dense suppress)
(while args
(let ((key (pop args))
(val (pop args)))
@@ -418,11 +427,14 @@
(:name (setq name val))
(:dense (setq dense val))
(:inherit (setq inherit val))
+ (:suppress (setq suppress val))
(:group)
(t (message "Unknown argument %s in defmap" key)))))
(unless (keymapp m)
(setq bs (append m bs))
(setq m (if dense (make-keymap name) (make-sparse-keymap name))))
+ (when suppress
+ (suppress-keymap m (eq suppress 'nodigits)))
(dolist (b bs)
(let ((keys (car b))
(binding (cdr b)))
Index: lisp/pcvs-defs.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/pcvs-defs.el,v
retrieving revision 1.44
diff -u -r1.44 pcvs-defs.el
--- lisp/pcvs-defs.el 8 Jan 2008 20:45:04 -0000 1.44
+++ lisp/pcvs-defs.el 9 Jan 2008 02:11:45 -0000
@@ -320,11 +320,7 @@
(easy-mmode-defmap cvs-mode-map
;;(define-prefix-command 'cvs-mode-map-diff-prefix)
;;(define-prefix-command 'cvs-mode-map-control-c-prefix)
- '(;; simulate `suppress-keymap'
- (self-insert-command . undefined)
- (("0" "1" "2" "3" "4" "5" "6" "7" "8" "9") . digit-argument)
- ("-" . negative-argument)
- ;; various
+ '(;; various
;; (undo . cvs-mode-undo)
("?" . cvs-help)
("h" . cvs-help)
@@ -398,7 +394,8 @@
;;([tool-bar item2] . (menu-item "Update" cvs-update :image (image :file
"/usr/share/icons/mail1.xpm" :type xpm)))
)
"Keymap for `cvs-mode'."
- :dense t)
+ :dense t
+ :suppress t)
(fset 'cvs-mode-map cvs-mode-map)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- 'suppress-keymap' patch for easy-mmode,
Tom Tromey <=