From 6904b34bf4f4383484de65974df78a403867a1b8 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 1 Nov 2003 17:02:32 +0000 Subject: [PATCH] (overriding-map-is-bound, saved-overriding-map): New variables. (ensure-overriding-map-is-bound, restore-overriding-map): New functions. (universal-argument, universal-argument-more, negative-argument) (digit-argument, universal-argument-other-key): Minor changes. --- lisp/ChangeLog | 24 ++++++++++++++++++++++++ lisp/simple.el | 32 ++++++++++++++++++++++++++------ 2 files changed, 50 insertions(+), 6 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 051b572931e..64a5b3f7a08 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,27 @@ +2003-11-01 Alan Mackenzie + + Changes to allow scrolling whilst in isearch mode: + * isearch.el (isearch-unread-key-sequence): New function, + extracted from isearch-other-meta-char. + (top level): (put 'foo 'isearch-scroll) on all Emacs's + "scrollable" standard functions. + (isearch-allow-scroll): New customizable variable. + (isearch-string-out-of-window, isearch-back-into-window) + (isearch-reread-key-sequence-naturally) + (isearch-lookup-scroll-key): New functions. + (isearch-other-meta-char): Doc string and functionality enhanced. + Now accepts a prefix argument. + (isearch-lazy-highlight-window-end): New variable. + (isearch-lazy-highlight-new-loop): Pay attention to the window's + end (thru isearch-lazy-highlight-window-end), not only its start. + + * simple.el (overriding-map-is-bound, saved-overriding-map): New + variables. + (ensure-overriding-map-is-bound, restore-overriding-map): New + functions. + (universal-argument, universal-argument-more, negative-argument) + (digit-argument, universal-argument-other-key): Minor changes. + 2003-11-01 Alexander Pohoyda (tiny change) * mail/rmailsum.el (rmail-summary-goto-msg): Don't call itself diff --git a/lisp/simple.el b/lisp/simple.el index 3d636de721a..7584b72da0a 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -1657,6 +1657,26 @@ specifies the value of ERROR-BUFFER." `universal-argument-other-key' uses this to discard those events from (this-command-keys), and reread only the final command.") +(defvar overriding-map-is-bound nil + "Non-nil when `overriding-terminal-local-map' is `universal-argument-map'.") + +(defvar saved-overriding-map nil + "The saved value of `overriding-terminal-local-map'. +That variable gets restored to this value on exiting \"universal +argument mode\".") + +(defun ensure-overriding-map-is-bound () + "Check `overriding-terminal-local-map' is `universal-argument-map'." + (unless overriding-map-is-bound + (setq saved-overriding-map overriding-terminal-local-map) + (setq overriding-terminal-local-map universal-argument-map) + (setq overriding-map-is-bound t))) + +(defun restore-overriding-map () + "Restore `overriding-terminal-local-map' to its saved value." + (setq overriding-terminal-local-map saved-overriding-map) + (setq overriding-map-is-bound nil)) + (defun universal-argument () "Begin a numeric argument for the following command. Digits or minus sign following \\[universal-argument] make up the numeric argument. @@ -1670,7 +1690,7 @@ These commands include \\[set-mark-command] and \\[start-kbd-macro]." (interactive) (setq prefix-arg (list 4)) (setq universal-argument-num-events (length (this-command-keys))) - (setq overriding-terminal-local-map universal-argument-map)) + (ensure-overriding-map-is-bound)) ;; A subsequent C-u means to multiply the factor by 4 if we've typed ;; nothing but C-u's; otherwise it means to terminate the prefix arg. @@ -1681,7 +1701,7 @@ These commands include \\[set-mark-command] and \\[start-kbd-macro]." (if (eq arg '-) (setq prefix-arg (list -4)) (setq prefix-arg arg) - (setq overriding-terminal-local-map nil))) + (restore-overriding-map))) (setq universal-argument-num-events (length (this-command-keys)))) (defun negative-argument (arg) @@ -1695,7 +1715,7 @@ These commands include \\[set-mark-command] and \\[start-kbd-macro]." (t (setq prefix-arg '-))) (setq universal-argument-num-events (length (this-command-keys))) - (setq overriding-terminal-local-map universal-argument-map)) + (ensure-overriding-map-is-bound)) (defun digit-argument (arg) "Part of the numeric argument for the next command. @@ -1714,7 +1734,7 @@ These commands include \\[set-mark-command] and \\[start-kbd-macro]." (t (setq prefix-arg digit)))) (setq universal-argument-num-events (length (this-command-keys))) - (setq overriding-terminal-local-map universal-argument-map)) + (ensure-overriding-map-is-bound)) ;; For backward compatibility, minus with no modifiers is an ordinary ;; command if digits have already been entered. @@ -1735,7 +1755,7 @@ These commands include \\[set-mark-command] and \\[start-kbd-macro]." (append (nthcdr universal-argument-num-events keylist) unread-command-events))) (reset-this-command-lengths) - (setq overriding-terminal-local-map nil)) + (restore-overriding-map)) ;;;; Window system cut and paste hooks. @@ -3348,7 +3368,7 @@ Just \\[universal-argument] as argument means to use the current column." (setq arg (current-column))) (if (not (integerp arg)) ;; Disallow missing argument; it's probably a typo for C-x C-f. - (error "set-fill-column requires an explicit argument") + (error "Set-fill-column requires an explicit argument") (message "Fill column set to %d (was %d)" arg fill-column) (setq fill-column arg))) -- 2.39.2