Commit bfeae2cf authored by Stefan Monnier's avatar Stefan Monnier
Browse files

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.
parent 8099e36b
...@@ -2738,17 +2738,6 @@ This function converts the string or vector @var{key} to a list of ...@@ -2738,17 +2738,6 @@ This function converts the string or vector @var{key} to a list of
individual events, which you can put in @code{unread-command-events}. individual events, which you can put in @code{unread-command-events}.
@end defun @end defun
@ignore
@defvar unread-command-char
This variable holds a character to be read as command input.
A value of -1 means ``empty''.
This variable is mostly obsolete now that you can use
@code{unread-command-events} instead; it exists only to support programs
written for Emacs versions 18 and earlier.
@end defvar
@end ignore
@defun input-pending-p @defun input-pending-p
@cindex waiting for command key input @cindex waiting for command key input
This function determines whether any command input is currently This function determines whether any command input is currently
......
...@@ -638,7 +638,7 @@ are deprecated and will be removed eventually. ...@@ -638,7 +638,7 @@ are deprecated and will be removed eventually.
*** `facemenu-unlisted-faces' *** `facemenu-unlisted-faces'
*** `rmail-decode-mime-charset' *** `rmail-decode-mime-charset'
*** `last-input-char' and `last-command-char' *** `last-input-char', `last-command-char', `unread-command-char'.
* Lisp changes in Emacs 24.3 * Lisp changes in Emacs 24.3
......
2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
* emacs-lisp/debug.el (debugger-outer-unread-command-char, debug)
(debugger-env-macro): Remove support for unread-command-char.
* subr.el (set-temporary-overlay-map): Minimize slightly the impact of
the temporary map re-appearing on emulation-mode-map-alists.
* emacs-lisp/edebug.el (def-edebug-form-spec): Remove, it's been broken
since 22.1.
* 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.
2012-09-12 Michael Albinus <michael.albinus@gmx.de> 2012-09-12 Michael Albinus <michael.albinus@gmx.de>
   
Sync with Tramp 2.2.6. Sync with Tramp 2.2.6.
...@@ -9,8 +25,8 @@ ...@@ -9,8 +25,8 @@
   
2012-09-12 Martin Rudalics <rudalics@gmx.at> 2012-09-12 Martin Rudalics <rudalics@gmx.at>
   
* emacs-lisp/debug.el (debugger-previous-window-height): New * emacs-lisp/debug.el (debugger-previous-window-height):
variable. New variable.
(debug): When debugger-jumping-flag is non-nil try to restore (debug): When debugger-jumping-flag is non-nil try to restore
height of debugger window. (Bug#8789) height of debugger window. (Bug#8789)
   
......
...@@ -193,7 +193,9 @@ BUFFER is put back into its original major mode." ...@@ -193,7 +193,9 @@ BUFFER is put back into its original major mode."
(replace-buffer-in-windows buffer) (replace-buffer-in-windows buffer)
;; must do this outside of save-window-excursion ;; must do this outside of save-window-excursion
(bury-buffer buffer)) (bury-buffer buffer))
(eval electric-help-form-to-execute)))) (if (functionp electric-help-form-to-execute)
(funcall electric-help-form-to-execute)
(eval electric-help-form-to-execute)))))
(defun electric-help-command-loop () (defun electric-help-command-loop ()
(catch 'exit (catch 'exit
...@@ -349,14 +351,19 @@ will select it.)" ...@@ -349,14 +351,19 @@ will select it.)"
;; continues with execute-extended-command. ;; continues with execute-extended-command.
(defun electric-help-execute-extended (_prefixarg) (defun electric-help-execute-extended (_prefixarg)
(interactive "p") (interactive "p")
(setq electric-help-form-to-execute '(execute-extended-command nil)) (setq electric-help-form-to-execute
(lambda () (execute-extended-command nil)))
(electric-help-retain)) (electric-help-retain))
;; This is to be buond to C-x in ehelp mode. Retains ehelp buffer and then ;; This is to be buond to C-x in ehelp mode. Retains ehelp buffer and then
;; continues with ctrl-x prefix. ;; continues with ctrl-x prefix.
(defun electric-help-ctrl-x-prefix (_prefixarg) (defun electric-help-ctrl-x-prefix (_prefixarg)
(interactive "p") (interactive "p")
(setq electric-help-form-to-execute '(progn (message nil) (setq unread-command-char ?\C-x))) (setq electric-help-form-to-execute
(lambda ()
(message nil)
(setq unread-command-events
(append unread-command-events '(?\C-x)))))
(electric-help-retain)) (electric-help-retain))
......
...@@ -110,10 +110,6 @@ This is to optimize `debugger-make-xrefs'.") ...@@ -110,10 +110,6 @@ This is to optimize `debugger-make-xrefs'.")
(defvar debugger-outer-track-mouse) (defvar debugger-outer-track-mouse)
(defvar debugger-outer-last-command) (defvar debugger-outer-last-command)
(defvar debugger-outer-this-command) (defvar debugger-outer-this-command)
;; unread-command-char is obsolete,
;; but we still save and restore it
;; in case some user program still tries to set it.
(defvar debugger-outer-unread-command-char)
(defvar debugger-outer-unread-command-events) (defvar debugger-outer-unread-command-events)
(defvar debugger-outer-unread-post-input-method-events) (defvar debugger-outer-unread-post-input-method-events)
(defvar debugger-outer-last-input-event) (defvar debugger-outer-last-input-event)
...@@ -185,8 +181,6 @@ first will be printed into the backtrace buffer." ...@@ -185,8 +181,6 @@ first will be printed into the backtrace buffer."
(debugger-outer-track-mouse track-mouse) (debugger-outer-track-mouse track-mouse)
(debugger-outer-last-command last-command) (debugger-outer-last-command last-command)
(debugger-outer-this-command this-command) (debugger-outer-this-command this-command)
(debugger-outer-unread-command-char
(with-no-warnings unread-command-char))
(debugger-outer-unread-command-events unread-command-events) (debugger-outer-unread-command-events unread-command-events)
(debugger-outer-unread-post-input-method-events (debugger-outer-unread-post-input-method-events
unread-post-input-method-events) unread-post-input-method-events)
...@@ -221,8 +215,6 @@ first will be printed into the backtrace buffer." ...@@ -221,8 +215,6 @@ first will be printed into the backtrace buffer."
(cursor-in-echo-area nil)) (cursor-in-echo-area nil))
(unwind-protect (unwind-protect
(save-excursion (save-excursion
(with-no-warnings
(setq unread-command-char -1))
(when (eq (car debugger-args) 'debug) (when (eq (car debugger-args) 'debug)
;; Skip the frames for backtrace-debug, byte-code, ;; Skip the frames for backtrace-debug, byte-code,
;; and implement-debug-on-entry. ;; and implement-debug-on-entry.
...@@ -302,8 +294,6 @@ first will be printed into the backtrace buffer." ...@@ -302,8 +294,6 @@ first will be printed into the backtrace buffer."
(setq track-mouse debugger-outer-track-mouse) (setq track-mouse debugger-outer-track-mouse)
(setq last-command debugger-outer-last-command) (setq last-command debugger-outer-last-command)
(setq this-command debugger-outer-this-command) (setq this-command debugger-outer-this-command)
(with-no-warnings
(setq unread-command-char debugger-outer-unread-command-char))
(setq unread-command-events debugger-outer-unread-command-events) (setq unread-command-events debugger-outer-unread-command-events)
(setq unread-post-input-method-events (setq unread-post-input-method-events
debugger-outer-unread-post-input-method-events) debugger-outer-unread-post-input-method-events)
...@@ -605,16 +595,7 @@ Applies to the frame whose line point is on in the backtrace." ...@@ -605,16 +595,7 @@ Applies to the frame whose line point is on in the backtrace."
(cursor-in-echo-area debugger-outer-cursor-in-echo-area)) (cursor-in-echo-area debugger-outer-cursor-in-echo-area))
(set-match-data debugger-outer-match-data) (set-match-data debugger-outer-match-data)
(prog1 (prog1
(let ((save-ucc (with-no-warnings unread-command-char))) (progn ,@body)
(unwind-protect
(progn
(with-no-warnings
(setq unread-command-char debugger-outer-unread-command-char))
(prog1 (progn ,@body)
(with-no-warnings
(setq debugger-outer-unread-command-char unread-command-char))))
(with-no-warnings
(setq unread-command-char save-ucc))))
(setq debugger-outer-match-data (match-data)) (setq debugger-outer-match-data (match-data))
(setq debugger-outer-load-read-function load-read-function) (setq debugger-outer-load-read-function load-read-function)
(setq debugger-outer-overriding-terminal-local-map (setq debugger-outer-overriding-terminal-local-map
......
...@@ -235,11 +235,6 @@ If the result is non-nil, then break. Errors are ignored." ...@@ -235,11 +235,6 @@ If the result is non-nil, then break. Errors are ignored."
;;; Form spec utilities. ;;; Form spec utilities.
(defmacro def-edebug-form-spec (symbol spec-form)
"For compatibility with old version."
(def-edebug-spec symbol (eval spec-form)))
(make-obsolete 'def-edebug-form-spec 'def-edebug-spec "22.1")
(defun get-edebug-spec (symbol) (defun get-edebug-spec (symbol)
;; Get the spec of symbol resolving all indirection. ;; Get the spec of symbol resolving all indirection.
(let ((edebug-form-spec nil) (let ((edebug-form-spec nil)
......
...@@ -4210,7 +4210,7 @@ NUMBER-OF-STATIC-VARIABLES:" ...@@ -4210,7 +4210,7 @@ NUMBER-OF-STATIC-VARIABLES:"
;; this will select the buffer from which the buffer menu was ;; this will select the buffer from which the buffer menu was
;; invoked. But this buffer is not displayed in the buffer list if ;; invoked. But this buffer is not displayed in the buffer list if
;; it isn't a tree buffer. I therefore let the buffer menu command ;; it isn't a tree buffer. I therefore let the buffer menu command
;; loop read the command `p' via `unread-command-char'. This command ;; loop read the command `p' via `unread-command-events'. This command
;; has no effect since we are on the first line of the buffer. ;; has no effect since we are on the first line of the buffer.
(defvar electric-buffer-menu-mode-hook nil) (defvar electric-buffer-menu-mode-hook nil)
......
...@@ -1250,11 +1250,6 @@ is converted into a string by expressing it in decimal." ...@@ -1250,11 +1250,6 @@ is converted into a string by expressing it in decimal."
'mode-line-inverse-video 'mode-line-inverse-video
"use the appropriate faces instead." "use the appropriate faces instead."
"21.1") "21.1")
(make-obsolete-variable
'unread-command-char
"use `unread-command-events' instead. That variable is a list of events
to reread, so it now uses nil to mean `no event', instead of -1."
"before 19.15")
;; Lisp manual only updated in 22.1. ;; Lisp manual only updated in 22.1.
(define-obsolete-variable-alias 'executing-macro 'executing-kbd-macro (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,6 +3923,7 @@ When KEEP-PRED is nil, the temporary keymap is used only once."
(lookup-key ',map (lookup-key ',map
(this-command-keys-vector)))) (this-command-keys-vector))))
(t `(funcall ',keep-pred))) (t `(funcall ',keep-pred)))
(set ',overlaysym nil) ;Just in case.
(remove-hook 'pre-command-hook ',clearfunsym) (remove-hook 'pre-command-hook ',clearfunsym)
(setq emulation-mode-map-alists (setq emulation-mode-map-alists
(delq ',alist emulation-mode-map-alists)))))) (delq ',alist emulation-mode-map-alists))))))
......
2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
* 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.
2012-09-12 Eli Zaretskii <eliz@gnu.org> 2012-09-12 Eli Zaretskii <eliz@gnu.org>
   
* w32proc.c (sys_kill): If PID is our process ID and the signal is * w32proc.c (sys_kill): If PID is our process ID and the signal is
......
...@@ -1164,7 +1164,7 @@ set_internal (Lisp_Object symbol, Lisp_Object newval, Lisp_Object where, ...@@ -1164,7 +1164,7 @@ set_internal (Lisp_Object symbol, Lisp_Object newval, Lisp_Object where,
the default binding is loaded, the loaded binding may be the the default binding is loaded, the loaded binding may be the
wrong one. */ wrong one. */
if (!EQ (blv->where, where) if (!EQ (blv->where, where)
/* Also unload a global binding (if the var is local_if_set). */ /* Also unload a global binding (if the var is local_if_set). */
|| (EQ (blv->valcell, blv->defcell))) || (EQ (blv->valcell, blv->defcell)))
{ {
/* The currently loaded binding is not necessarily valid. /* The currently loaded binding is not necessarily valid.
......
...@@ -2366,15 +2366,6 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps, ...@@ -2366,15 +2366,6 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps,
goto reread_first; goto reread_first;
} }
if (unread_command_char != -1)
{
XSETINT (c, unread_command_char);
unread_command_char = -1;
reread = 1;
goto reread_first;
}
if (CONSP (Vunread_command_events)) if (CONSP (Vunread_command_events))
{ {
int was_disabled = 0; int was_disabled = 0;
...@@ -2559,7 +2550,6 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps, ...@@ -2559,7 +2550,6 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps,
&& !NILP (prev_event) && ! EVENT_HAS_PARAMETERS (prev_event) && !NILP (prev_event) && ! EVENT_HAS_PARAMETERS (prev_event)
/* Don't bring up a menu if we already have another event. */ /* Don't bring up a menu if we already have another event. */
&& NILP (Vunread_command_events) && NILP (Vunread_command_events)
&& unread_command_char < 0
&& !detect_input_pending_run_timers (0)) && !detect_input_pending_run_timers (0))
{ {
c = read_char_minibuf_menu_prompt (commandflag, nmaps, maps); c = read_char_minibuf_menu_prompt (commandflag, nmaps, maps);
...@@ -2695,8 +2685,7 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps, ...@@ -2695,8 +2685,7 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps,
&& !EQ (XCAR (prev_event), Qmenu_bar) && !EQ (XCAR (prev_event), Qmenu_bar)
&& !EQ (XCAR (prev_event), Qtool_bar) && !EQ (XCAR (prev_event), Qtool_bar)
/* Don't bring up a menu if we already have another event. */ /* Don't bring up a menu if we already have another event. */
&& NILP (Vunread_command_events) && NILP (Vunread_command_events))
&& unread_command_char < 0)
{ {
c = read_char_x_menu_prompt (nmaps, maps, prev_event, used_mouse_menu); c = read_char_x_menu_prompt (nmaps, maps, prev_event, used_mouse_menu);
...@@ -10453,7 +10442,7 @@ clear_input_pending (void) ...@@ -10453,7 +10442,7 @@ clear_input_pending (void)
int int
requeued_events_pending_p (void) requeued_events_pending_p (void)
{ {
return (!NILP (Vunread_command_events) || unread_command_char != -1); return (!NILP (Vunread_command_events));
} }
...@@ -10463,7 +10452,7 @@ Actually, the value is nil only if we can be sure that no input is available; ...@@ -10463,7 +10452,7 @@ Actually, the value is nil only if we can be sure that no input is available;
if there is a doubt, the value is t. */) if there is a doubt, the value is t. */)
(void) (void)
{ {
if (!NILP (Vunread_command_events) || unread_command_char != -1 if (!NILP (Vunread_command_events)
|| !NILP (Vunread_post_input_method_events) || !NILP (Vunread_post_input_method_events)
|| !NILP (Vunread_input_method_events)) || !NILP (Vunread_input_method_events))
return (Qt); return (Qt);
...@@ -10651,7 +10640,6 @@ Also end any kbd macro being defined. */) ...@@ -10651,7 +10640,6 @@ Also end any kbd macro being defined. */)
update_mode_lines++; update_mode_lines++;
Vunread_command_events = Qnil; Vunread_command_events = Qnil;
unread_command_char = -1;
discard_tty_input (); discard_tty_input ();
...@@ -10991,7 +10979,6 @@ quit_throw_to_read_char (int from_signal) ...@@ -10991,7 +10979,6 @@ quit_throw_to_read_char (int from_signal)
input_pending = 0; input_pending = 0;
Vunread_command_events = Qnil; Vunread_command_events = Qnil;
unread_command_char = -1;
#if 0 /* Currently, sit_for is called from read_char without turning #if 0 /* Currently, sit_for is called from read_char without turning
off polling. And that can call set_waiting_for_input. off polling. And that can call set_waiting_for_input.
...@@ -11378,12 +11365,11 @@ delete_kboard (KBOARD *kb) ...@@ -11378,12 +11365,11 @@ delete_kboard (KBOARD *kb)
void void
init_keyboard (void) init_keyboard (void)
{ {
/* This is correct before outermost invocation of the editor loop */ /* This is correct before outermost invocation of the editor loop. */
command_loop_level = -1; command_loop_level = -1;
immediate_quit = 0; immediate_quit = 0;
quit_char = Ctl ('g'); quit_char = Ctl ('g');
Vunread_command_events = Qnil; Vunread_command_events = Qnil;
unread_command_char = -1;
timer_idleness_start_time = invalid_emacs_time (); timer_idleness_start_time = invalid_emacs_time ();
total_keys = 0; total_keys = 0;
recent_keys_index = 0; recent_keys_index = 0;
...@@ -11716,9 +11702,6 @@ as they will already have been added once as they were read for the first time. ...@@ -11716,9 +11702,6 @@ as they will already have been added once as they were read for the first time.
An element of the form (t . EVENT) forces EVENT to be added to that list. */); An element of the form (t . EVENT) forces EVENT to be added to that list. */);
Vunread_command_events = Qnil; Vunread_command_events = Qnil;
DEFVAR_INT ("unread-command-char", unread_command_char,
doc: /* If not -1, an object to be read as next command input event. */);
DEFVAR_LISP ("unread-post-input-method-events", Vunread_post_input_method_events, DEFVAR_LISP ("unread-post-input-method-events", Vunread_post_input_method_events,
doc: /* List of events to be processed as input by input methods. doc: /* List of events to be processed as input by input methods.
These events are processed before `unread-command-events' These events are processed before `unread-command-events'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment