comparison lisp/subr.el @ 47042:74f8b41068e0

(suppress-keymap): Use command remapping instead of substitute-key-definition to undefine self-inserting keys.
author Kim F. Storm <storm@cua.dk>
date Mon, 26 Aug 2002 12:38:59 +0000
parents 324b87cc6fdf
children 6e9df2174ee2
comparison
equal deleted inserted replaced
47041:308c03d953c8 47042:74f8b41068e0
277 277
278 (defun suppress-keymap (map &optional nodigits) 278 (defun suppress-keymap (map &optional nodigits)
279 "Make MAP override all normally self-inserting keys to be undefined. 279 "Make MAP override all normally self-inserting keys to be undefined.
280 Normally, as an exception, digits and minus-sign are set to make prefix args, 280 Normally, as an exception, digits and minus-sign are set to make prefix args,
281 but optional second arg NODIGITS non-nil treats them like other chars." 281 but optional second arg NODIGITS non-nil treats them like other chars."
282 (substitute-key-definition 'self-insert-command 'undefined map global-map) 282 (define-key map [remap self-insert-command] 'undefined)
283 (or nodigits 283 (or nodigits
284 (let (loop) 284 (let (loop)
285 (define-key map "-" 'negative-argument) 285 (define-key map "-" 'negative-argument)
286 ;; Make plain numbers do numeric args. 286 ;; Make plain numbers do numeric args.
287 (setq loop ?0) 287 (setq loop ?0)