aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Roberts2005-05-01 13:30:19 +0000
committerNick Roberts2005-05-01 13:30:19 +0000
commit73f67715537c87784df735cac84e6fcfc541c45f (patch)
treee6707afea19ee219a917117737db5d1d2f4cc99e
parent35bfeac0e510da8239e5878098e8a036d10231b5 (diff)
downloademacs-73f67715537c87784df735cac84e6fcfc541c45f.tar.gz
emacs-73f67715537c87784df735cac84e6fcfc541c45f.zip
(dot, dot-marker, dot-min, dot-max, buffer-flush-undo)
(compiled-function-p, focus-frame, unfocus-frame): Remove aliases and obsolete declarations. Back out inadvertant changes from previous commit.
-rw-r--r--lisp/subr.el62
1 files changed, 16 insertions, 46 deletions
diff --git a/lisp/subr.el b/lisp/subr.el
index b8d2ca6c054..6418825aa44 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -349,10 +349,14 @@ but optional second arg NODIGITS non-nil treats them like other chars."
349(defvar key-substitution-in-progress nil 349(defvar key-substitution-in-progress nil
350 "Used internally by substitute-key-definition.") 350 "Used internally by substitute-key-definition.")
351 351
352(defun substitute-key-definitions (subst keymap &optional oldmap prefix) 352(defun substitute-key-definition (olddef newdef keymap &optional oldmap prefix)
353 "Applies the SUBST remapping to key bindings in KEYMAP. 353 "Replace OLDDEF with NEWDEF for any keys in KEYMAP now defined as OLDDEF.
354SUBST will be a list of elements of the form (OLDDEF . NEWDEF). 354In other words, OLDDEF is replaced with NEWDEF where ever it appears.
355See `substitue-key-definition'." 355Alternatively, if optional fourth argument OLDMAP is specified, we redefine
356in KEYMAP as NEWDEF those keys which are defined as OLDDEF in OLDMAP.
357
358For most uses, it is simpler and safer to use command remappping like this:
359 \(define-key KEYMAP [remap OLDDEF] NEWDEF)"
356 ;; Don't document PREFIX in the doc string because we don't want to 360 ;; Don't document PREFIX in the doc string because we don't want to
357 ;; advertise it. It's meant for recursive calls only. Here's its 361 ;; advertise it. It's meant for recursive calls only. Here's its
358 ;; meaning 362 ;; meaning
@@ -370,28 +374,11 @@ See `substitue-key-definition'."
370 (map-keymap 374 (map-keymap
371 (lambda (char defn) 375 (lambda (char defn)
372 (aset prefix1 (length prefix) char) 376 (aset prefix1 (length prefix) char)
373 (substitute-key-definitions-key defn subst prefix1 keymap)) 377 (substitute-key-definition-key defn olddef newdef prefix1 keymap))
374 scan))) 378 scan)))
375 379
376(defun substitute-key-definition (olddef newdef keymap &optional oldmap prefix) 380(defun substitute-key-definition-key (defn olddef newdef prefix keymap)
377 "Replace OLDDEF with NEWDEF for any keys in KEYMAP now defined as OLDDEF. 381 (let (inner-def skipped menu-item)
378In other words, OLDDEF is replaced with NEWDEF where ever it appears.
379Alternatively, if optional fourth argument OLDMAP is specified, we redefine
380in KEYMAP as NEWDEF those keys which are defined as OLDDEF in OLDMAP.
381
382For most uses, it is simpler and safer to use command remappping like this:
383 \(define-key KEYMAP [remap OLDDEF] NEWDEF)"
384 ;; Don't document PREFIX in the doc string because we don't want to
385 ;; advertise it. It's meant for recursive calls only. Here's its
386 ;; meaning
387
388 ;; If optional argument PREFIX is specified, it should be a key
389 ;; prefix, a string. Redefined bindings will then be bound to the
390 ;; original key, with PREFIX added at the front.
391 (substitute-key-definitions (list (cons olddef newdef)) keymap oldmap prefix))
392
393(defun substitute-key-definitions-key (defn subst prefix keymap)
394 (let (inner-def skipped menu-item mapping)
395 ;; Find the actual command name within the binding. 382 ;; Find the actual command name within the binding.
396 (if (eq (car-safe defn) 'menu-item) 383 (if (eq (car-safe defn) 'menu-item)
397 (setq menu-item defn defn (nth 2 defn)) 384 (setq menu-item defn defn (nth 2 defn))
@@ -401,17 +388,17 @@ For most uses, it is simpler and safer to use command remappping like this:
401 ;; Skip past cached key-equivalence data for menu items. 388 ;; Skip past cached key-equivalence data for menu items.
402 (if (consp (car-safe defn)) 389 (if (consp (car-safe defn))
403 (setq defn (cdr defn)))) 390 (setq defn (cdr defn))))
404 (if (or (setq mapping (assq defn subst)) 391 (if (or (eq defn olddef)
405 ;; Compare with equal if definition is a key sequence. 392 ;; Compare with equal if definition is a key sequence.
406 ;; That is useful for operating on function-key-map. 393 ;; That is useful for operating on function-key-map.
407 (and (or (stringp defn) (vectorp defn)) 394 (and (or (stringp defn) (vectorp defn))
408 (setq mapping (assoc defn subst)))) 395 (equal defn olddef)))
409 (define-key keymap prefix 396 (define-key keymap prefix
410 (if menu-item 397 (if menu-item
411 (let ((copy (copy-sequence menu-item))) 398 (let ((copy (copy-sequence menu-item)))
412 (setcar (nthcdr 2 copy) (cdr mapping)) 399 (setcar (nthcdr 2 copy) newdef)
413 copy) 400 copy)
414 (nconc (nreverse skipped) (cdr mapping)))) 401 (nconc (nreverse skipped) newdef)))
415 ;; Look past a symbol that names a keymap. 402 ;; Look past a symbol that names a keymap.
416 (setq inner-def 403 (setq inner-def
417 (and defn 404 (and defn
@@ -427,7 +414,7 @@ For most uses, it is simpler and safer to use command remappping like this:
427 ;; Avoid recursively rescanning keymap being scanned. 414 ;; Avoid recursively rescanning keymap being scanned.
428 (not (memq inner-def key-substitution-in-progress))) 415 (not (memq inner-def key-substitution-in-progress)))
429 ;; If this one isn't being scanned already, scan it now. 416 ;; If this one isn't being scanned already, scan it now.
430 (substitute-key-definitions subst keymap inner-def prefix))))) 417 (substitute-key-definition olddef newdef keymap inner-def prefix)))))
431 418
432(defun define-key-after (keymap key definition &optional after) 419(defun define-key-after (keymap key definition &optional after)
433 "Add binding in KEYMAP for KEY => DEFINITION, right after AFTER's binding. 420 "Add binding in KEYMAP for KEY => DEFINITION, right after AFTER's binding.
@@ -766,35 +753,21 @@ and `event-end' functions."
766 753
767;;;; Obsolescent names for functions. 754;;;; Obsolescent names for functions.
768 755
769(defalias 'dot 'point)
770(defalias 'dot-marker 'point-marker)
771(defalias 'dot-min 'point-min)
772(defalias 'dot-max 'point-max)
773(defalias 'window-dot 'window-point) 756(defalias 'window-dot 'window-point)
774(defalias 'set-window-dot 'set-window-point) 757(defalias 'set-window-dot 'set-window-point)
775(defalias 'read-input 'read-string) 758(defalias 'read-input 'read-string)
776(defalias 'send-string 'process-send-string) 759(defalias 'send-string 'process-send-string)
777(defalias 'send-region 'process-send-region) 760(defalias 'send-region 'process-send-region)
778(defalias 'show-buffer 'set-window-buffer) 761(defalias 'show-buffer 'set-window-buffer)
779(defalias 'buffer-flush-undo 'buffer-disable-undo)
780(defalias 'eval-current-buffer 'eval-buffer) 762(defalias 'eval-current-buffer 'eval-buffer)
781(defalias 'compiled-function-p 'byte-code-function-p)
782(defalias 'define-function 'defalias) 763(defalias 'define-function 'defalias)
783 764
784(defalias 'sref 'aref) 765(defalias 'sref 'aref)
785(make-obsolete 'sref 'aref "20.4") 766(make-obsolete 'sref 'aref "20.4")
786(make-obsolete 'char-bytes "now always returns 1." "20.4") 767(make-obsolete 'char-bytes "now always returns 1." "20.4")
787(make-obsolete 'chars-in-region "use (abs (- BEG END))." "20.3") 768(make-obsolete 'chars-in-region "use (abs (- BEG END))." "20.3")
788(make-obsolete 'dot 'point "before 19.15")
789(make-obsolete 'dot-max 'point-max "before 19.15")
790(make-obsolete 'dot-min 'point-min "before 19.15")
791(make-obsolete 'dot-marker 'point-marker "before 19.15")
792(make-obsolete 'buffer-flush-undo 'buffer-disable-undo "before 19.15")
793(make-obsolete 'baud-rate "use the `baud-rate' variable instead." "before 19.15") 769(make-obsolete 'baud-rate "use the `baud-rate' variable instead." "before 19.15")
794(make-obsolete 'compiled-function-p 'byte-code-function-p "before 19.15")
795(make-obsolete 'define-function 'defalias "20.1") 770(make-obsolete 'define-function 'defalias "20.1")
796(make-obsolete 'focus-frame "it does nothing." "19.32")
797(make-obsolete 'unfocus-frame "it does nothing." "19.32")
798 771
799(defun insert-string (&rest args) 772(defun insert-string (&rest args)
800 "Mocklisp-compatibility insert function. 773 "Mocklisp-compatibility insert function.
@@ -811,9 +784,6 @@ is converted into a string by expressing it in decimal."
811 "Return the value of the `baud-rate' variable." 784 "Return the value of the `baud-rate' variable."
812 baud-rate) 785 baud-rate)
813 786
814(defalias 'focus-frame 'ignore "")
815(defalias 'unfocus-frame 'ignore "")
816
817 787
818;;;; Obsolescence declarations for variables, and aliases. 788;;;; Obsolescence declarations for variables, and aliases.
819 789