[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/subr.el
From: |
Nick Roberts |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/subr.el |
Date: |
Sun, 01 May 2005 00:44:14 -0400 |
Index: emacs/lisp/subr.el
diff -c emacs/lisp/subr.el:1.442 emacs/lisp/subr.el:1.443
*** emacs/lisp/subr.el:1.442 Sun Apr 24 14:48:58 2005
--- emacs/lisp/subr.el Sun May 1 04:44:14 2005
***************
*** 349,362 ****
(defvar key-substitution-in-progress nil
"Used internally by substitute-key-definition.")
! (defun substitute-key-definition (olddef newdef keymap &optional oldmap
prefix)
! "Replace OLDDEF with NEWDEF for any keys in KEYMAP now defined as OLDDEF.
! In other words, OLDDEF is replaced with NEWDEF where ever it appears.
! Alternatively, if optional fourth argument OLDMAP is specified, we redefine
! in KEYMAP as NEWDEF those keys which are defined as OLDDEF in OLDMAP.
!
! For most uses, it is simpler and safer to use command remappping like this:
! \(define-key KEYMAP [remap OLDDEF] NEWDEF)"
;; Don't document PREFIX in the doc string because we don't want to
;; advertise it. It's meant for recursive calls only. Here's its
;; meaning
--- 349,358 ----
(defvar key-substitution-in-progress nil
"Used internally by substitute-key-definition.")
! (defun substitute-key-definitions (subst keymap &optional oldmap prefix)
! "Applies the SUBST remapping to key bindings in KEYMAP.
! SUBST will be a list of elements of the form (OLDDEF . NEWDEF).
! See `substitue-key-definition'."
;; Don't document PREFIX in the doc string because we don't want to
;; advertise it. It's meant for recursive calls only. Here's its
;; meaning
***************
*** 374,384 ****
(map-keymap
(lambda (char defn)
(aset prefix1 (length prefix) char)
! (substitute-key-definition-key defn olddef newdef prefix1 keymap))
scan)))
! (defun substitute-key-definition-key (defn olddef newdef prefix keymap)
! (let (inner-def skipped menu-item)
;; Find the actual command name within the binding.
(if (eq (car-safe defn) 'menu-item)
(setq menu-item defn defn (nth 2 defn))
--- 370,397 ----
(map-keymap
(lambda (char defn)
(aset prefix1 (length prefix) char)
! (substitute-key-definitions-key defn subst prefix1 keymap))
scan)))
! (defun substitute-key-definition (olddef newdef keymap &optional oldmap
prefix)
! "Replace OLDDEF with NEWDEF for any keys in KEYMAP now defined as OLDDEF.
! In other words, OLDDEF is replaced with NEWDEF where ever it appears.
! Alternatively, if optional fourth argument OLDMAP is specified, we redefine
! in KEYMAP as NEWDEF those keys which are defined as OLDDEF in OLDMAP.
!
! For most uses, it is simpler and safer to use command remappping like this:
! \(define-key KEYMAP [remap OLDDEF] NEWDEF)"
! ;; Don't document PREFIX in the doc string because we don't want to
! ;; advertise it. It's meant for recursive calls only. Here's its
! ;; meaning
!
! ;; If optional argument PREFIX is specified, it should be a key
! ;; prefix, a string. Redefined bindings will then be bound to the
! ;; original key, with PREFIX added at the front.
! (substitute-key-definitions (list (cons olddef newdef)) keymap oldmap
prefix))
!
! (defun substitute-key-definitions-key (defn subst prefix keymap)
! (let (inner-def skipped menu-item mapping)
;; Find the actual command name within the binding.
(if (eq (car-safe defn) 'menu-item)
(setq menu-item defn defn (nth 2 defn))
***************
*** 388,404 ****
;; Skip past cached key-equivalence data for menu items.
(if (consp (car-safe defn))
(setq defn (cdr defn))))
! (if (or (eq defn olddef)
;; Compare with equal if definition is a key sequence.
;; That is useful for operating on function-key-map.
(and (or (stringp defn) (vectorp defn))
! (equal defn olddef)))
(define-key keymap prefix
(if menu-item
(let ((copy (copy-sequence menu-item)))
! (setcar (nthcdr 2 copy) newdef)
copy)
! (nconc (nreverse skipped) newdef)))
;; Look past a symbol that names a keymap.
(setq inner-def
(and defn
--- 401,417 ----
;; Skip past cached key-equivalence data for menu items.
(if (consp (car-safe defn))
(setq defn (cdr defn))))
! (if (or (setq mapping (assq defn subst))
;; Compare with equal if definition is a key sequence.
;; That is useful for operating on function-key-map.
(and (or (stringp defn) (vectorp defn))
! (setq mapping (assoc defn subst))))
(define-key keymap prefix
(if menu-item
(let ((copy (copy-sequence menu-item)))
! (setcar (nthcdr 2 copy) (cdr mapping))
copy)
! (nconc (nreverse skipped) (cdr mapping))))
;; Look past a symbol that names a keymap.
(setq inner-def
(and defn
***************
*** 414,420 ****
;; Avoid recursively rescanning keymap being scanned.
(not (memq inner-def key-substitution-in-progress)))
;; If this one isn't being scanned already, scan it now.
! (substitute-key-definition olddef newdef keymap inner-def prefix)))))
(defun define-key-after (keymap key definition &optional after)
"Add binding in KEYMAP for KEY => DEFINITION, right after AFTER's binding.
--- 427,433 ----
;; Avoid recursively rescanning keymap being scanned.
(not (memq inner-def key-substitution-in-progress)))
;; If this one isn't being scanned already, scan it now.
! (substitute-key-definitions subst keymap inner-def prefix)))))
(defun define-key-after (keymap key definition &optional after)
"Add binding in KEYMAP for KEY => DEFINITION, right after AFTER's binding.
***************
*** 843,849 ****
;;; Should this be an obsolete name? If you decide it should, you get
;;; to go through all the sources and change them.
! (defalias 'string-to-int 'string-to-number)
;;;; Hook manipulation functions.
--- 856,862 ----
;;; Should this be an obsolete name? If you decide it should, you get
;;; to go through all the sources and change them.
! (define-obsolete-function-alias 'string-to-int 'string-to-number)
;;;; Hook manipulation functions.
- [Emacs-diffs] Changes to emacs/lisp/subr.el,
Nick Roberts <=
- [Emacs-diffs] Changes to emacs/lisp/subr.el, Richard M . Stallman, 2005/05/01
- [Emacs-diffs] Changes to emacs/lisp/subr.el, Nick Roberts, 2005/05/01
- [Emacs-diffs] Changes to emacs/lisp/subr.el, Nick Roberts, 2005/05/01
- [Emacs-diffs] Changes to emacs/lisp/subr.el, Luc Teirlinck, 2005/05/02
- [Emacs-diffs] Changes to emacs/lisp/subr.el, Richard M . Stallman, 2005/05/14
- [Emacs-diffs] Changes to emacs/lisp/subr.el, Kim F . Storm, 2005/05/16
- [Emacs-diffs] Changes to emacs/lisp/subr.el, Nick Roberts, 2005/05/16
- [Emacs-diffs] Changes to emacs/lisp/subr.el, Juanma Barranquero, 2005/05/17
- [Emacs-diffs] Changes to emacs/lisp/subr.el, Juanma Barranquero, 2005/05/18
- [Emacs-diffs] Changes to emacs/lisp/subr.el, Nick Roberts, 2005/05/18