aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorStefan Monnier2011-06-01 12:52:35 -0300
committerStefan Monnier2011-06-01 12:52:35 -0300
commitfb5b2591a6b112ee3747d24dceb1797ef770c6e0 (patch)
treeae544969a2807746cf00054a74b5a097e4eb6389 /lisp
parentfd6fa53f884d35c7fa412b492eaac4500cca2cd6 (diff)
downloademacs-fb5b2591a6b112ee3747d24dceb1797ef770c6e0.tar.gz
emacs-fb5b2591a6b112ee3747d24dceb1797ef770c6e0.zip
* lisp/simple.el (goto-line): Use read-number.
(overriding-map-is-bound): Remove. (saved-overriding-map): Change default. (save&set-overriding-map): Rename from ensure-overriding-map-is-bound; Take the map as argument. (universal-argument, negative-argument, digit-argument): Use it. (restore-overriding-map): Adjust. (do-auto-fill): Use fill-forward-paragraph. (keyboard-quit): Don't signal an error when debug-on-quit is non-nil.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog10
-rw-r--r--lisp/simple.el41
2 files changed, 28 insertions, 23 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 2ec54b36d1d..ac5a6db7508 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,15 @@
12011-06-01 Stefan Monnier <monnier@iro.umontreal.ca> 12011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
2 2
3 * simple.el (goto-line): Use read-number.
4 (overriding-map-is-bound): Remove.
5 (saved-overriding-map): Change default.
6 (save&set-overriding-map): Rename from ensure-overriding-map-is-bound;
7 Take the map as argument.
8 (universal-argument, negative-argument, digit-argument): Use it.
9 (restore-overriding-map): Adjust.
10 (do-auto-fill): Use fill-forward-paragraph.
11 (keyboard-quit): Don't signal an error when debug-on-quit is non-nil.
12
3 * minibuffer.el (minibuffer-inactive-mode-map): New var. 13 * minibuffer.el (minibuffer-inactive-mode-map): New var.
4 (minibuffer-inactive-mode): New major mode. 14 (minibuffer-inactive-mode): New major mode.
5 * mouse.el (mouse-drag-region): Remove the "mouse-1 pops up 15 * mouse.el (mouse-drag-region): Remove the "mouse-1 pops up
diff --git a/lisp/simple.el b/lisp/simple.el
index 18ae1367d74..df32ce8fd08 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -967,13 +967,11 @@ rather than line counts."
967 (concat " in " (buffer-name buffer)) 967 (concat " in " (buffer-name buffer))
968 ""))) 968 "")))
969 ;; Read the argument, offering that number (if any) as default. 969 ;; Read the argument, offering that number (if any) as default.
970 (list (read-from-minibuffer (format (if default "Goto line%s (%s): " 970 (list (read-number (format (if default "Goto line%s (%s): "
971 "Goto line%s: ") 971 "Goto line%s: ")
972 buffer-prompt 972 buffer-prompt
973 default) 973 default)
974 nil nil t 974 default)
975 'minibuffer-history
976 default)
977 buffer)))) 975 buffer))))
978 ;; Switch to the desired buffer, one way or another. 976 ;; Switch to the desired buffer, one way or another.
979 (if buffer 977 (if buffer
@@ -2815,25 +2813,21 @@ The return value is always nil."
2815`universal-argument-other-key' uses this to discard those events 2813`universal-argument-other-key' uses this to discard those events
2816from (this-command-keys), and reread only the final command.") 2814from (this-command-keys), and reread only the final command.")
2817 2815
2818(defvar overriding-map-is-bound nil 2816(defvar saved-overriding-map t
2819 "Non-nil when `overriding-terminal-local-map' is `universal-argument-map'.")
2820
2821(defvar saved-overriding-map nil
2822 "The saved value of `overriding-terminal-local-map'. 2817 "The saved value of `overriding-terminal-local-map'.
2823That variable gets restored to this value on exiting \"universal 2818That variable gets restored to this value on exiting \"universal
2824argument mode\".") 2819argument mode\".")
2825 2820
2826(defun ensure-overriding-map-is-bound () 2821(defun save&set-overriding-map (map)
2827 "Check `overriding-terminal-local-map' is `universal-argument-map'." 2822 "Set `overriding-terminal-local-map' to MAP."
2828 (unless overriding-map-is-bound 2823 (when (eq saved-overriding-map t)
2829 (setq saved-overriding-map overriding-terminal-local-map) 2824 (setq saved-overriding-map overriding-terminal-local-map)
2830 (setq overriding-terminal-local-map universal-argument-map) 2825 (setq overriding-terminal-local-map map)))
2831 (setq overriding-map-is-bound t)))
2832 2826
2833(defun restore-overriding-map () 2827(defun restore-overriding-map ()
2834 "Restore `overriding-terminal-local-map' to its saved value." 2828 "Restore `overriding-terminal-local-map' to its saved value."
2835 (setq overriding-terminal-local-map saved-overriding-map) 2829 (setq overriding-terminal-local-map saved-overriding-map)
2836 (setq overriding-map-is-bound nil)) 2830 (setq saved-overriding-map t))
2837 2831
2838(defun universal-argument () 2832(defun universal-argument ()
2839 "Begin a numeric argument for the following command. 2833 "Begin a numeric argument for the following command.
@@ -2848,7 +2842,7 @@ These commands include \\[set-mark-command] and \\[start-kbd-macro]."
2848 (interactive) 2842 (interactive)
2849 (setq prefix-arg (list 4)) 2843 (setq prefix-arg (list 4))
2850 (setq universal-argument-num-events (length (this-command-keys))) 2844 (setq universal-argument-num-events (length (this-command-keys)))
2851 (ensure-overriding-map-is-bound)) 2845 (save&set-overriding-map universal-argument-map))
2852 2846
2853;; A subsequent C-u means to multiply the factor by 4 if we've typed 2847;; A subsequent C-u means to multiply the factor by 4 if we've typed
2854;; nothing but C-u's; otherwise it means to terminate the prefix arg. 2848;; nothing but C-u's; otherwise it means to terminate the prefix arg.
@@ -2873,7 +2867,7 @@ These commands include \\[set-mark-command] and \\[start-kbd-macro]."
2873 (t 2867 (t
2874 (setq prefix-arg '-))) 2868 (setq prefix-arg '-)))
2875 (setq universal-argument-num-events (length (this-command-keys))) 2869 (setq universal-argument-num-events (length (this-command-keys)))
2876 (ensure-overriding-map-is-bound)) 2870 (save&set-overriding-map universal-argument-map))
2877 2871
2878(defun digit-argument (arg) 2872(defun digit-argument (arg)
2879 "Part of the numeric argument for the next command. 2873 "Part of the numeric argument for the next command.
@@ -2892,7 +2886,7 @@ These commands include \\[set-mark-command] and \\[start-kbd-macro]."
2892 (t 2886 (t
2893 (setq prefix-arg digit)))) 2887 (setq prefix-arg digit))))
2894 (setq universal-argument-num-events (length (this-command-keys))) 2888 (setq universal-argument-num-events (length (this-command-keys)))
2895 (ensure-overriding-map-is-bound)) 2889 (save&set-overriding-map universal-argument-map))
2896 2890
2897;; For backward compatibility, minus with no modifiers is an ordinary 2891;; For backward compatibility, minus with no modifiers is an ordinary
2898;; command if digits have already been entered. 2892;; command if digits have already been entered.
@@ -5177,8 +5171,8 @@ Returns t if it really did any work."
5177 (or (null fill-prefix) (string= fill-prefix ""))) 5171 (or (null fill-prefix) (string= fill-prefix "")))
5178 (let ((prefix 5172 (let ((prefix
5179 (fill-context-prefix 5173 (fill-context-prefix
5180 (save-excursion (backward-paragraph 1) (point)) 5174 (save-excursion (fill-forward-paragraph -1) (point))
5181 (save-excursion (forward-paragraph 1) (point))))) 5175 (save-excursion (fill-forward-paragraph 1) (point)))))
5182 (and prefix (not (equal prefix "")) 5176 (and prefix (not (equal prefix ""))
5183 ;; Use auto-indentation rather than a guessed empty prefix. 5177 ;; Use auto-indentation rather than a guessed empty prefix.
5184 (not (and fill-indent-according-to-mode 5178 (not (and fill-indent-according-to-mode
@@ -5660,7 +5654,8 @@ At top-level, as an editor command, this simply beeps."
5660 (if (fboundp 'kmacro-keyboard-quit) 5654 (if (fboundp 'kmacro-keyboard-quit)
5661 (kmacro-keyboard-quit)) 5655 (kmacro-keyboard-quit))
5662 (setq defining-kbd-macro nil) 5656 (setq defining-kbd-macro nil)
5663 (signal 'quit nil)) 5657 (let ((debug-on-quit nil))
5658 (signal 'quit nil)))
5664 5659
5665(defvar buffer-quit-function nil 5660(defvar buffer-quit-function nil
5666 "Function to call to \"quit\" the current buffer, or nil if none. 5661 "Function to call to \"quit\" the current buffer, or nil if none.