all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* 'suppress-keymap' patch for easy-mmode
@ 2008-01-09  1:45 Tom Tromey
  0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2008-01-09  1:45 UTC (permalink / raw)
  To: emacs-devel

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  <tromey@redhat.com>

	* 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)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-01-09  1:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-09  1:45 'suppress-keymap' patch for easy-mmode Tom Tromey

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.