aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2012-09-12 15:16:36 -0400
committerStefan Monnier2012-09-12 15:16:36 -0400
commitbfeae2cf098dcf5bdb4af14d896e790cbe91d60f (patch)
treedb59532750052577bf07f28ee4304dee4a6e9ff5
parent8099e36b7edde645bfc1a13bfa142ae7645e6bd6 (diff)
downloademacs-bfeae2cf098dcf5bdb4af14d896e790cbe91d60f.tar.gz
emacs-bfeae2cf098dcf5bdb4af14d896e790cbe91d60f.zip
Remove unread-command-char.
* src/keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p) (Fdiscard_input, quit_throw_to_read_char, init_keyboard) (syms_of_keyboard): Remove support for unread-command-char. * lisp/emacs-lisp/debug.el (debugger-outer-unread-command-char, debug) (debugger-env-macro): Remove support for unread-command-char. * lisp/ehelp.el (with-electric-help): Accept functions in electric-help-form-to-execute. (electric-help-execute-extended, electric-help-ctrl-x-prefix): Use it. And replace unread-command-char -> unread-command-events. * lisp/subr.el (set-temporary-overlay-map): Minimize slightly the impact of the temporary map re-appearing on emulation-mode-map-alists. * lisp/emacs-lisp/edebug.el (def-edebug-form-spec): Remove, it's been broken since 22.1.
-rw-r--r--doc/lispref/commands.texi11
-rw-r--r--etc/NEWS2
-rw-r--r--lisp/ChangeLog20
-rw-r--r--lisp/ehelp.el13
-rw-r--r--lisp/emacs-lisp/debug.el21
-rw-r--r--lisp/emacs-lisp/edebug.el5
-rw-r--r--lisp/progmodes/ebrowse.el2
-rw-r--r--lisp/subr.el6
-rw-r--r--src/ChangeLog6
-rw-r--r--src/data.c2
-rw-r--r--src/keyboard.c25
11 files changed, 43 insertions, 70 deletions
diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi
index 7e24de94fbe..dc0fa4c639d 100644
--- a/doc/lispref/commands.texi
+++ b/doc/lispref/commands.texi
@@ -2738,17 +2738,6 @@ This function converts the string or vector @var{key} to a list of
2738individual events, which you can put in @code{unread-command-events}. 2738individual events, which you can put in @code{unread-command-events}.
2739@end defun 2739@end defun
2740 2740
2741@ignore
2742@defvar unread-command-char
2743This variable holds a character to be read as command input.
2744A value of -1 means ``empty''.
2745
2746This variable is mostly obsolete now that you can use
2747@code{unread-command-events} instead; it exists only to support programs
2748written for Emacs versions 18 and earlier.
2749@end defvar
2750@end ignore
2751
2752@defun input-pending-p 2741@defun input-pending-p
2753@cindex waiting for command key input 2742@cindex waiting for command key input
2754This function determines whether any command input is currently 2743This function determines whether any command input is currently
diff --git a/etc/NEWS b/etc/NEWS
index e095ca795e4..a7388c4e9fa 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -638,7 +638,7 @@ are deprecated and will be removed eventually.
638 638
639*** `facemenu-unlisted-faces' 639*** `facemenu-unlisted-faces'
640*** `rmail-decode-mime-charset' 640*** `rmail-decode-mime-charset'
641*** `last-input-char' and `last-command-char' 641*** `last-input-char', `last-command-char', `unread-command-char'.
642 642
643 643
644* Lisp changes in Emacs 24.3 644* Lisp changes in Emacs 24.3
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 56311198831..549b70a1de1 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,19 @@
12012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * emacs-lisp/debug.el (debugger-outer-unread-command-char, debug)
4 (debugger-env-macro): Remove support for unread-command-char.
5
6 * subr.el (set-temporary-overlay-map): Minimize slightly the impact of
7 the temporary map re-appearing on emulation-mode-map-alists.
8
9 * emacs-lisp/edebug.el (def-edebug-form-spec): Remove, it's been broken
10 since 22.1.
11
12 * ehelp.el (with-electric-help): Accept functions in
13 electric-help-form-to-execute.
14 (electric-help-execute-extended, electric-help-ctrl-x-prefix): Use it.
15 And replace unread-command-char -> unread-command-events.
16
12012-09-12 Michael Albinus <michael.albinus@gmx.de> 172012-09-12 Michael Albinus <michael.albinus@gmx.de>
2 18
3 Sync with Tramp 2.2.6. 19 Sync with Tramp 2.2.6.
@@ -9,8 +25,8 @@
9 25
102012-09-12 Martin Rudalics <rudalics@gmx.at> 262012-09-12 Martin Rudalics <rudalics@gmx.at>
11 27
12 * emacs-lisp/debug.el (debugger-previous-window-height): New 28 * emacs-lisp/debug.el (debugger-previous-window-height):
13 variable. 29 New variable.
14 (debug): When debugger-jumping-flag is non-nil try to restore 30 (debug): When debugger-jumping-flag is non-nil try to restore
15 height of debugger window. (Bug#8789) 31 height of debugger window. (Bug#8789)
16 32
diff --git a/lisp/ehelp.el b/lisp/ehelp.el
index abb897f73f6..281148d9cf6 100644
--- a/lisp/ehelp.el
+++ b/lisp/ehelp.el
@@ -193,7 +193,9 @@ BUFFER is put back into its original major mode."
193 (replace-buffer-in-windows buffer) 193 (replace-buffer-in-windows buffer)
194 ;; must do this outside of save-window-excursion 194 ;; must do this outside of save-window-excursion
195 (bury-buffer buffer)) 195 (bury-buffer buffer))
196 (eval electric-help-form-to-execute)))) 196 (if (functionp electric-help-form-to-execute)
197 (funcall electric-help-form-to-execute)
198 (eval electric-help-form-to-execute)))))
197 199
198(defun electric-help-command-loop () 200(defun electric-help-command-loop ()
199 (catch 'exit 201 (catch 'exit
@@ -349,14 +351,19 @@ will select it.)"
349;; continues with execute-extended-command. 351;; continues with execute-extended-command.
350(defun electric-help-execute-extended (_prefixarg) 352(defun electric-help-execute-extended (_prefixarg)
351 (interactive "p") 353 (interactive "p")
352 (setq electric-help-form-to-execute '(execute-extended-command nil)) 354 (setq electric-help-form-to-execute
355 (lambda () (execute-extended-command nil)))
353 (electric-help-retain)) 356 (electric-help-retain))
354 357
355;; This is to be buond to C-x in ehelp mode. Retains ehelp buffer and then 358;; This is to be buond to C-x in ehelp mode. Retains ehelp buffer and then
356;; continues with ctrl-x prefix. 359;; continues with ctrl-x prefix.
357(defun electric-help-ctrl-x-prefix (_prefixarg) 360(defun electric-help-ctrl-x-prefix (_prefixarg)
358 (interactive "p") 361 (interactive "p")
359 (setq electric-help-form-to-execute '(progn (message nil) (setq unread-command-char ?\C-x))) 362 (setq electric-help-form-to-execute
363 (lambda ()
364 (message nil)
365 (setq unread-command-events
366 (append unread-command-events '(?\C-x)))))
360 (electric-help-retain)) 367 (electric-help-retain))
361 368
362 369
diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el
index 8b89e65c5d9..774b4d3d600 100644
--- a/lisp/emacs-lisp/debug.el
+++ b/lisp/emacs-lisp/debug.el
@@ -110,10 +110,6 @@ This is to optimize `debugger-make-xrefs'.")
110(defvar debugger-outer-track-mouse) 110(defvar debugger-outer-track-mouse)
111(defvar debugger-outer-last-command) 111(defvar debugger-outer-last-command)
112(defvar debugger-outer-this-command) 112(defvar debugger-outer-this-command)
113;; unread-command-char is obsolete,
114;; but we still save and restore it
115;; in case some user program still tries to set it.
116(defvar debugger-outer-unread-command-char)
117(defvar debugger-outer-unread-command-events) 113(defvar debugger-outer-unread-command-events)
118(defvar debugger-outer-unread-post-input-method-events) 114(defvar debugger-outer-unread-post-input-method-events)
119(defvar debugger-outer-last-input-event) 115(defvar debugger-outer-last-input-event)
@@ -185,8 +181,6 @@ first will be printed into the backtrace buffer."
185 (debugger-outer-track-mouse track-mouse) 181 (debugger-outer-track-mouse track-mouse)
186 (debugger-outer-last-command last-command) 182 (debugger-outer-last-command last-command)
187 (debugger-outer-this-command this-command) 183 (debugger-outer-this-command this-command)
188 (debugger-outer-unread-command-char
189 (with-no-warnings unread-command-char))
190 (debugger-outer-unread-command-events unread-command-events) 184 (debugger-outer-unread-command-events unread-command-events)
191 (debugger-outer-unread-post-input-method-events 185 (debugger-outer-unread-post-input-method-events
192 unread-post-input-method-events) 186 unread-post-input-method-events)
@@ -221,8 +215,6 @@ first will be printed into the backtrace buffer."
221 (cursor-in-echo-area nil)) 215 (cursor-in-echo-area nil))
222 (unwind-protect 216 (unwind-protect
223 (save-excursion 217 (save-excursion
224 (with-no-warnings
225 (setq unread-command-char -1))
226 (when (eq (car debugger-args) 'debug) 218 (when (eq (car debugger-args) 'debug)
227 ;; Skip the frames for backtrace-debug, byte-code, 219 ;; Skip the frames for backtrace-debug, byte-code,
228 ;; and implement-debug-on-entry. 220 ;; and implement-debug-on-entry.
@@ -302,8 +294,6 @@ first will be printed into the backtrace buffer."
302 (setq track-mouse debugger-outer-track-mouse) 294 (setq track-mouse debugger-outer-track-mouse)
303 (setq last-command debugger-outer-last-command) 295 (setq last-command debugger-outer-last-command)
304 (setq this-command debugger-outer-this-command) 296 (setq this-command debugger-outer-this-command)
305 (with-no-warnings
306 (setq unread-command-char debugger-outer-unread-command-char))
307 (setq unread-command-events debugger-outer-unread-command-events) 297 (setq unread-command-events debugger-outer-unread-command-events)
308 (setq unread-post-input-method-events 298 (setq unread-post-input-method-events
309 debugger-outer-unread-post-input-method-events) 299 debugger-outer-unread-post-input-method-events)
@@ -605,16 +595,7 @@ Applies to the frame whose line point is on in the backtrace."
605 (cursor-in-echo-area debugger-outer-cursor-in-echo-area)) 595 (cursor-in-echo-area debugger-outer-cursor-in-echo-area))
606 (set-match-data debugger-outer-match-data) 596 (set-match-data debugger-outer-match-data)
607 (prog1 597 (prog1
608 (let ((save-ucc (with-no-warnings unread-command-char))) 598 (progn ,@body)
609 (unwind-protect
610 (progn
611 (with-no-warnings
612 (setq unread-command-char debugger-outer-unread-command-char))
613 (prog1 (progn ,@body)
614 (with-no-warnings
615 (setq debugger-outer-unread-command-char unread-command-char))))
616 (with-no-warnings
617 (setq unread-command-char save-ucc))))
618 (setq debugger-outer-match-data (match-data)) 599 (setq debugger-outer-match-data (match-data))
619 (setq debugger-outer-load-read-function load-read-function) 600 (setq debugger-outer-load-read-function load-read-function)
620 (setq debugger-outer-overriding-terminal-local-map 601 (setq debugger-outer-overriding-terminal-local-map
diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el
index 17f6f79cd66..f147fba167d 100644
--- a/lisp/emacs-lisp/edebug.el
+++ b/lisp/emacs-lisp/edebug.el
@@ -235,11 +235,6 @@ If the result is non-nil, then break. Errors are ignored."
235 235
236;;; Form spec utilities. 236;;; Form spec utilities.
237 237
238(defmacro def-edebug-form-spec (symbol spec-form)
239 "For compatibility with old version."
240 (def-edebug-spec symbol (eval spec-form)))
241(make-obsolete 'def-edebug-form-spec 'def-edebug-spec "22.1")
242
243(defun get-edebug-spec (symbol) 238(defun get-edebug-spec (symbol)
244 ;; Get the spec of symbol resolving all indirection. 239 ;; Get the spec of symbol resolving all indirection.
245 (let ((edebug-form-spec nil) 240 (let ((edebug-form-spec nil)
diff --git a/lisp/progmodes/ebrowse.el b/lisp/progmodes/ebrowse.el
index 1d29011762e..8ac54d6524e 100644
--- a/lisp/progmodes/ebrowse.el
+++ b/lisp/progmodes/ebrowse.el
@@ -4210,7 +4210,7 @@ NUMBER-OF-STATIC-VARIABLES:"
4210;; this will select the buffer from which the buffer menu was 4210;; this will select the buffer from which the buffer menu was
4211;; invoked. But this buffer is not displayed in the buffer list if 4211;; invoked. But this buffer is not displayed in the buffer list if
4212;; it isn't a tree buffer. I therefore let the buffer menu command 4212;; it isn't a tree buffer. I therefore let the buffer menu command
4213;; loop read the command `p' via `unread-command-char'. This command 4213;; loop read the command `p' via `unread-command-events'. This command
4214;; has no effect since we are on the first line of the buffer. 4214;; has no effect since we are on the first line of the buffer.
4215 4215
4216(defvar electric-buffer-menu-mode-hook nil) 4216(defvar electric-buffer-menu-mode-hook nil)
diff --git a/lisp/subr.el b/lisp/subr.el
index 23b62b25c9c..aa1b10ce17d 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -1250,11 +1250,6 @@ is converted into a string by expressing it in decimal."
1250 'mode-line-inverse-video 1250 'mode-line-inverse-video
1251 "use the appropriate faces instead." 1251 "use the appropriate faces instead."
1252 "21.1") 1252 "21.1")
1253(make-obsolete-variable
1254 'unread-command-char
1255 "use `unread-command-events' instead. That variable is a list of events
1256to reread, so it now uses nil to mean `no event', instead of -1."
1257 "before 19.15")
1258 1253
1259;; Lisp manual only updated in 22.1. 1254;; Lisp manual only updated in 22.1.
1260(define-obsolete-variable-alias 'executing-macro 'executing-kbd-macro 1255(define-obsolete-variable-alias 'executing-macro 'executing-kbd-macro
@@ -3928,6 +3923,7 @@ When KEEP-PRED is nil, the temporary keymap is used only once."
3928 (lookup-key ',map 3923 (lookup-key ',map
3929 (this-command-keys-vector)))) 3924 (this-command-keys-vector))))
3930 (t `(funcall ',keep-pred))) 3925 (t `(funcall ',keep-pred)))
3926 (set ',overlaysym nil) ;Just in case.
3931 (remove-hook 'pre-command-hook ',clearfunsym) 3927 (remove-hook 'pre-command-hook ',clearfunsym)
3932 (setq emulation-mode-map-alists 3928 (setq emulation-mode-map-alists
3933 (delq ',alist emulation-mode-map-alists)))))) 3929 (delq ',alist emulation-mode-map-alists))))))
diff --git a/src/ChangeLog b/src/ChangeLog
index bfb6e5a87b3..8b47c52c23f 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
12012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
4 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
5 (syms_of_keyboard): Remove support for unread-command-char.
6
12012-09-12 Eli Zaretskii <eliz@gnu.org> 72012-09-12 Eli Zaretskii <eliz@gnu.org>
2 8
3 * w32proc.c (sys_kill): If PID is our process ID and the signal is 9 * w32proc.c (sys_kill): If PID is our process ID and the signal is
diff --git a/src/data.c b/src/data.c
index d894ac71a65..5d7f036b70d 100644
--- a/src/data.c
+++ b/src/data.c
@@ -1164,7 +1164,7 @@ set_internal (Lisp_Object symbol, Lisp_Object newval, Lisp_Object where,
1164 the default binding is loaded, the loaded binding may be the 1164 the default binding is loaded, the loaded binding may be the
1165 wrong one. */ 1165 wrong one. */
1166 if (!EQ (blv->where, where) 1166 if (!EQ (blv->where, where)
1167 /* Also unload a global binding (if the var is local_if_set). */ 1167 /* Also unload a global binding (if the var is local_if_set). */
1168 || (EQ (blv->valcell, blv->defcell))) 1168 || (EQ (blv->valcell, blv->defcell)))
1169 { 1169 {
1170 /* The currently loaded binding is not necessarily valid. 1170 /* The currently loaded binding is not necessarily valid.
diff --git a/src/keyboard.c b/src/keyboard.c
index 8091258578c..7be3e9e118e 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -2366,15 +2366,6 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps,
2366 goto reread_first; 2366 goto reread_first;
2367 } 2367 }
2368 2368
2369 if (unread_command_char != -1)
2370 {
2371 XSETINT (c, unread_command_char);
2372 unread_command_char = -1;
2373
2374 reread = 1;
2375 goto reread_first;
2376 }
2377
2378 if (CONSP (Vunread_command_events)) 2369 if (CONSP (Vunread_command_events))
2379 { 2370 {
2380 int was_disabled = 0; 2371 int was_disabled = 0;
@@ -2559,7 +2550,6 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps,
2559 && !NILP (prev_event) && ! EVENT_HAS_PARAMETERS (prev_event) 2550 && !NILP (prev_event) && ! EVENT_HAS_PARAMETERS (prev_event)
2560 /* Don't bring up a menu if we already have another event. */ 2551 /* Don't bring up a menu if we already have another event. */
2561 && NILP (Vunread_command_events) 2552 && NILP (Vunread_command_events)
2562 && unread_command_char < 0
2563 && !detect_input_pending_run_timers (0)) 2553 && !detect_input_pending_run_timers (0))
2564 { 2554 {
2565 c = read_char_minibuf_menu_prompt (commandflag, nmaps, maps); 2555 c = read_char_minibuf_menu_prompt (commandflag, nmaps, maps);
@@ -2695,8 +2685,7 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps,
2695 && !EQ (XCAR (prev_event), Qmenu_bar) 2685 && !EQ (XCAR (prev_event), Qmenu_bar)
2696 && !EQ (XCAR (prev_event), Qtool_bar) 2686 && !EQ (XCAR (prev_event), Qtool_bar)
2697 /* Don't bring up a menu if we already have another event. */ 2687 /* Don't bring up a menu if we already have another event. */
2698 && NILP (Vunread_command_events) 2688 && NILP (Vunread_command_events))
2699 && unread_command_char < 0)
2700 { 2689 {
2701 c = read_char_x_menu_prompt (nmaps, maps, prev_event, used_mouse_menu); 2690 c = read_char_x_menu_prompt (nmaps, maps, prev_event, used_mouse_menu);
2702 2691
@@ -10453,7 +10442,7 @@ clear_input_pending (void)
10453int 10442int
10454requeued_events_pending_p (void) 10443requeued_events_pending_p (void)
10455{ 10444{
10456 return (!NILP (Vunread_command_events) || unread_command_char != -1); 10445 return (!NILP (Vunread_command_events));
10457} 10446}
10458 10447
10459 10448
@@ -10463,7 +10452,7 @@ Actually, the value is nil only if we can be sure that no input is available;
10463if there is a doubt, the value is t. */) 10452if there is a doubt, the value is t. */)
10464 (void) 10453 (void)
10465{ 10454{
10466 if (!NILP (Vunread_command_events) || unread_command_char != -1 10455 if (!NILP (Vunread_command_events)
10467 || !NILP (Vunread_post_input_method_events) 10456 || !NILP (Vunread_post_input_method_events)
10468 || !NILP (Vunread_input_method_events)) 10457 || !NILP (Vunread_input_method_events))
10469 return (Qt); 10458 return (Qt);
@@ -10651,7 +10640,6 @@ Also end any kbd macro being defined. */)
10651 update_mode_lines++; 10640 update_mode_lines++;
10652 10641
10653 Vunread_command_events = Qnil; 10642 Vunread_command_events = Qnil;
10654 unread_command_char = -1;
10655 10643
10656 discard_tty_input (); 10644 discard_tty_input ();
10657 10645
@@ -10991,7 +10979,6 @@ quit_throw_to_read_char (int from_signal)
10991 input_pending = 0; 10979 input_pending = 0;
10992 10980
10993 Vunread_command_events = Qnil; 10981 Vunread_command_events = Qnil;
10994 unread_command_char = -1;
10995 10982
10996#if 0 /* Currently, sit_for is called from read_char without turning 10983#if 0 /* Currently, sit_for is called from read_char without turning
10997 off polling. And that can call set_waiting_for_input. 10984 off polling. And that can call set_waiting_for_input.
@@ -11378,12 +11365,11 @@ delete_kboard (KBOARD *kb)
11378void 11365void
11379init_keyboard (void) 11366init_keyboard (void)
11380{ 11367{
11381 /* This is correct before outermost invocation of the editor loop */ 11368 /* This is correct before outermost invocation of the editor loop. */
11382 command_loop_level = -1; 11369 command_loop_level = -1;
11383 immediate_quit = 0; 11370 immediate_quit = 0;
11384 quit_char = Ctl ('g'); 11371 quit_char = Ctl ('g');
11385 Vunread_command_events = Qnil; 11372 Vunread_command_events = Qnil;
11386 unread_command_char = -1;
11387 timer_idleness_start_time = invalid_emacs_time (); 11373 timer_idleness_start_time = invalid_emacs_time ();
11388 total_keys = 0; 11374 total_keys = 0;
11389 recent_keys_index = 0; 11375 recent_keys_index = 0;
@@ -11716,9 +11702,6 @@ as they will already have been added once as they were read for the first time.
11716An element of the form (t . EVENT) forces EVENT to be added to that list. */); 11702An element of the form (t . EVENT) forces EVENT to be added to that list. */);
11717 Vunread_command_events = Qnil; 11703 Vunread_command_events = Qnil;
11718 11704
11719 DEFVAR_INT ("unread-command-char", unread_command_char,
11720 doc: /* If not -1, an object to be read as next command input event. */);
11721
11722 DEFVAR_LISP ("unread-post-input-method-events", Vunread_post_input_method_events, 11705 DEFVAR_LISP ("unread-post-input-method-events", Vunread_post_input_method_events,
11723 doc: /* List of events to be processed as input by input methods. 11706 doc: /* List of events to be processed as input by input methods.
11724These events are processed before `unread-command-events' 11707These events are processed before `unread-command-events'