aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaroly Lorentey2004-08-09 11:05:10 +0000
committerKaroly Lorentey2004-08-09 11:05:10 +0000
commitcd83ec7be76b05014a49f8bb155a84ddd7c323ee (patch)
treed8847695cedbde0c1bad8737131e219bfac6ce8a
parent18ad87544445be2584163436bd3c5d6366afa122 (diff)
parent30e75a873acbcc4f4d59d0341fb49211d8c6d010 (diff)
downloademacs-cd83ec7be76b05014a49f8bb155a84ddd7c323ee.tar.gz
emacs-cd83ec7be76b05014a49f8bb155a84ddd7c323ee.zip
Merged in changes from CVS trunk.
Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-482 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-483 Build-in-place tweak * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-484 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-228
-rw-r--r--etc/NEWS5
-rw-r--r--lisp/ChangeLog34
-rw-r--r--lisp/emacs-lisp/re-builder.el15
-rw-r--r--lisp/ibuffer.el15
-rw-r--r--lisp/novice.el14
-rw-r--r--lisp/simple.el8
-rw-r--r--lisp/subr.el4
-rw-r--r--lisp/wid-edit.el2
-rw-r--r--lispref/ChangeLog45
-rw-r--r--lispref/commands.texi183
-rw-r--r--lispref/hooks.texi2
-rw-r--r--lispref/minibuf.texi1
-rw-r--r--lispref/objects.texi4
-rw-r--r--lispref/os.texi14
-rw-r--r--src/ChangeLog24
-rw-r--r--src/fileio.c8
-rw-r--r--src/keyboard.c13
-rw-r--r--src/keymap.c6
-rw-r--r--src/window.c2
19 files changed, 298 insertions, 101 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 0693e063992..2d8b10e81ec 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -2187,6 +2187,11 @@ configuration files.
2187 2187
2188* Lisp Changes in Emacs 21.4 2188* Lisp Changes in Emacs 21.4
2189 2189
2190+++
2191** Both the variable and the function `disabled-command-hook' have
2192been renamed to `disabled-command-function'. The variable
2193`disabled-command-hook' has been kept as an obsolete alias.
2194
2190** Function `compute-motion' now calculates the usable window 2195** Function `compute-motion' now calculates the usable window
2191width if the WIDTH argument is nil. If the TOPOS argument is nil, 2196width if the WIDTH argument is nil. If the TOPOS argument is nil,
2192the usable window height and width is used. 2197the usable window height and width is used.
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index e12449df8e4..31e414c2a4b 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,37 @@
12004-08-08 John Paul Wallington <jpw@gnu.org>
2
3 * ibuffer.el (define-ibuffer-column size): Use `string-to-number'
4 instead of `string-to-int'.
5 (define-ibuffer-column mode): Fix indentation.
6
72004-08-08 Lars Hansen <larsh@math.ku.dk>
8
9 * wid-edit.el (widget-sexp-validate): Allow whitespace after
10 expression.
11
122004-08-08 Luc Teirlinck <teirllm@auburn.edu>
13
14 * subr.el (global-unset-key, local-unset-key): Doc fixes.
15
16 * novice.el (disabled-command-function): New variable renamed from
17 `disabled-command-hook'.
18 (disabled-command-hook): Keep the _variable_ as alias for
19 `disabled-command-function' and make obsolete.
20 (disabled-command-function): Function renamed from
21 `disabled-command-hook'. Adapt code to name change of the variable.
22
232004-08-07 Satyaki Das <satyaki@theforce.stanford.edu> (tiny change)
24
25 * simple.el (completion-root-regexp): New defvar.
26 (completion-setup-function): Use it instead of a literal string.
27
282004-08-07 John Paul Wallington <jpw@gnu.org>
29
30 * emacs-lisp/re-builder.el (reb-re-syntax): Add `rx' syntax.
31 (reb-lisp-mode): Require `rx' feature when `re-reb-syntax' is `rx'.
32 (reb-lisp-syntax-p, reb-change-syntax): `rx' is a Lisp syntax.
33 (reb-cook-regexp): Call `rx-to-string' when `re-reb-syntax' is `rx'.
34
12004-08-04 Kenichi Handa <handa@m17n.org> 352004-08-04 Kenichi Handa <handa@m17n.org>
2 36
3 * international/encoded-kb.el (encoded-kbd-setup-keymap): Fix 37 * international/encoded-kb.el (encoded-kbd-setup-keymap): Fix
diff --git a/lisp/emacs-lisp/re-builder.el b/lisp/emacs-lisp/re-builder.el
index c6112c4a105..6eb1ffa2e54 100644
--- a/lisp/emacs-lisp/re-builder.el
+++ b/lisp/emacs-lisp/re-builder.el
@@ -135,6 +135,7 @@ Can either be `read', `string', `sregex' or `lisp-re'."
135 (const :tag "String syntax" string) 135 (const :tag "String syntax" string)
136 (const :tag "`sregex' syntax" sregex) 136 (const :tag "`sregex' syntax" sregex)
137 (const :tag "`lisp-re' syntax" lisp-re) 137 (const :tag "`lisp-re' syntax" lisp-re)
138 (const :tag "`rx' syntax" rx)
138 (value: string))) 139 (value: string)))
139 140
140(defcustom reb-auto-match-limit 200 141(defcustom reb-auto-match-limit 200
@@ -261,7 +262,9 @@ Except for Lisp syntax this is the same as `reb-regexp'.")
261 (cond ((eq reb-re-syntax 'lisp-re) ; Pull in packages 262 (cond ((eq reb-re-syntax 'lisp-re) ; Pull in packages
262 (require 'lisp-re)) ; as needed 263 (require 'lisp-re)) ; as needed
263 ((eq reb-re-syntax 'sregex) ; sregex is not autoloaded 264 ((eq reb-re-syntax 'sregex) ; sregex is not autoloaded
264 (require 'sregex))) ; right now.. 265 (require 'sregex)) ; right now..
266 ((eq reb-re-syntax 'rx) ; rx-to-string is autoloaded
267 (require 'rx))) ; require rx anyway
265 (reb-mode-common)) 268 (reb-mode-common))
266 269
267;; Use the same "\C-c" keymap as `reb-mode' and use font-locking from 270;; Use the same "\C-c" keymap as `reb-mode' and use font-locking from
@@ -320,7 +323,7 @@ Except for Lisp syntax this is the same as `reb-regexp'.")
320 323
321(defsubst reb-lisp-syntax-p () 324(defsubst reb-lisp-syntax-p ()
322 "Return non-nil if RE Builder uses a Lisp syntax." 325 "Return non-nil if RE Builder uses a Lisp syntax."
323 (memq reb-re-syntax '(lisp-re sregex))) 326 (memq reb-re-syntax '(lisp-re sregex rx)))
324 327
325(defmacro reb-target-binding (symbol) 328(defmacro reb-target-binding (symbol)
326 "Return binding for SYMBOL in the RE Builder target buffer." 329 "Return binding for SYMBOL in the RE Builder target buffer."
@@ -466,10 +469,10 @@ Optional argument SYNTAX must be specified if called non-interactively."
466 (list (intern 469 (list (intern
467 (completing-read "Select syntax: " 470 (completing-read "Select syntax: "
468 (mapcar (lambda (el) (cons (symbol-name el) 1)) 471 (mapcar (lambda (el) (cons (symbol-name el) 1))
469 '(read string lisp-re sregex)) 472 '(read string lisp-re sregex rx))
470 nil t (symbol-name reb-re-syntax))))) 473 nil t (symbol-name reb-re-syntax)))))
471 474
472 (if (memq syntax '(read string lisp-re sregex)) 475 (if (memq syntax '(read string lisp-re sregex rx))
473 (let ((buffer (get-buffer reb-buffer))) 476 (let ((buffer (get-buffer reb-buffer)))
474 (setq reb-re-syntax syntax) 477 (setq reb-re-syntax syntax)
475 (if buffer 478 (if buffer
@@ -604,6 +607,8 @@ optional fourth argument FORCE is non-nil."
604 (lre-compile-string (eval (car (read-from-string re))))) 607 (lre-compile-string (eval (car (read-from-string re)))))
605 ((eq reb-re-syntax 'sregex) 608 ((eq reb-re-syntax 'sregex)
606 (apply 'sregex (eval (car (read-from-string re))))) 609 (apply 'sregex (eval (car (read-from-string re)))))
610 ((eq reb-re-syntax 'rx)
611 (rx-to-string (eval (car (read-from-string re)))))
607 (t re))) 612 (t re)))
608 613
609(defun reb-update-regexp () 614(defun reb-update-regexp ()
@@ -670,7 +675,7 @@ If SUBEXP is non-nil mark only the corresponding sub-expressions."
670 (overlay-put overlay 'priority i))) 675 (overlay-put overlay 'priority i)))
671 (setq i (1+ i)))))) 676 (setq i (1+ i))))))
672 (let ((count (if subexp submatches matches))) 677 (let ((count (if subexp submatches matches)))
673 (message"%s %smatch%s%s" 678 (message "%s %smatch%s%s"
674 (if (= 0 count) "No" (int-to-string count)) 679 (if (= 0 count) "No" (int-to-string count))
675 (if subexp "subexpression " "") 680 (if subexp "subexpression " "")
676 (if (= 1 count) "" "es") 681 (if (= 1 count) "" "es")
diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el
index 140f2995292..f013f8e3c72 100644
--- a/lisp/ibuffer.el
+++ b/lisp/ibuffer.el
@@ -1644,16 +1644,17 @@ If point is on a group name, this function operates on that group."
1644 (dolist (string column-strings) 1644 (dolist (string column-strings)
1645 (setq total 1645 (setq total
1646 ;; like, ewww ... 1646 ;; like, ewww ...
1647 (+ (float (string-to-int string)) 1647 (+ (float (string-to-number string))
1648 total))) 1648 total)))
1649 (format "%.0f" total)))) 1649 (format "%.0f" total))))
1650 (format "%s" (buffer-size))) 1650 (format "%s" (buffer-size)))
1651 1651
1652(define-ibuffer-column mode (:inline t 1652(define-ibuffer-column mode
1653 :props 1653 (:inline t
1654 ('mouse-face 'highlight 1654 :props
1655 'keymap ibuffer-mode-name-map 1655 ('mouse-face 'highlight
1656 'help-echo "mouse-2: filter by this mode")) 1656 'keymap ibuffer-mode-name-map
1657 'help-echo "mouse-2: filter by this mode"))
1657 (format "%s" mode-name)) 1658 (format "%s" mode-name))
1658 1659
1659(define-ibuffer-column process 1660(define-ibuffer-column process
@@ -2198,7 +2199,7 @@ Try to restore the previous window configuration iff
2198`ibuffer-restore-window-config-on-quit' is non-nil." 2199`ibuffer-restore-window-config-on-quit' is non-nil."
2199 (interactive) 2200 (interactive)
2200 (if ibuffer-restore-window-config-on-quit 2201 (if ibuffer-restore-window-config-on-quit
2201 (progn 2202 (progn
2202 (bury-buffer) 2203 (bury-buffer)
2203 (unless (= (count-windows) 1) 2204 (unless (= (count-windows) 1)
2204 (set-window-configuration ibuffer-prev-window-config))) 2205 (set-window-configuration ibuffer-prev-window-config)))
diff --git a/lisp/novice.el b/lisp/novice.el
index 1cb89066481..ca9a06769d5 100644
--- a/lisp/novice.el
+++ b/lisp/novice.el
@@ -1,6 +1,7 @@
1;;; novice.el --- handling of disabled commands ("novice mode") for Emacs 1;;; novice.el --- handling of disabled commands ("novice mode") for Emacs
2 2
3;; Copyright (C) 1985, 1986, 1987, 1994, 2002 Free Software Foundation, Inc. 3;; Copyright (C) 1985, 1986, 1987, 1994, 2002, 2004
4;; Free Software Foundation, Inc.
4 5
5;; Maintainer: FSF 6;; Maintainer: FSF
6;; Keywords: internal, help 7;; Keywords: internal, help
@@ -36,12 +37,17 @@
36;; and the keys are returned by (this-command-keys). 37;; and the keys are returned by (this-command-keys).
37 38
38;;;###autoload 39;;;###autoload
39(defvar disabled-command-hook 'disabled-command-hook 40(defvar disabled-command-function 'disabled-command-function
40 "Function to call to handle disabled commands. 41 "Function to call to handle disabled commands.
41If nil, the feature is disabled, i.e., all commands work normally.") 42If nil, the feature is disabled, i.e., all commands work normally.")
42 43
44(defvaralias 'disabled-command-hook 'disabled-command-function)
45(make-obsolete-variable
46 'disabled-command-hook
47 "use the variable `disabled-command-function' instead." "21.4")
48
43;;;###autoload 49;;;###autoload
44(defun disabled-command-hook (&rest ignore) 50(defun disabled-command-function (&rest ignore)
45 (let (char) 51 (let (char)
46 (save-window-excursion 52 (save-window-excursion
47 (with-output-to-temp-buffer "*Help*" 53 (with-output-to-temp-buffer "*Help*"
@@ -91,7 +97,7 @@ SPC to try the command just this once, but leave it disabled.
91 (ding) 97 (ding)
92 (message "Please type y, n, ! or SPC (the space bar): ")))) 98 (message "Please type y, n, ! or SPC (the space bar): "))))
93 (if (= char ?!) 99 (if (= char ?!)
94 (setq disabled-command-hook nil)) 100 (setq disabled-command-function nil))
95 (if (= char ?y) 101 (if (= char ?y)
96 (if (and user-init-file 102 (if (and user-init-file
97 (not (string= "" user-init-file)) 103 (not (string= "" user-init-file))
diff --git a/lisp/simple.el b/lisp/simple.el
index 9a7b7f245d0..95f6ed864cf 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -4308,6 +4308,12 @@ make the common parts less visible than normal, so that the rest
4308of the differing parts is, by contrast, slightly highlighted." 4308of the differing parts is, by contrast, slightly highlighted."
4309 :group 'completion) 4309 :group 'completion)
4310 4310
4311;; This is for packages that need to bind it to a non-default regexp
4312;; in order to make the first-differing character highlight work
4313;; to their liking
4314(defvar completion-root-regexp "^/"
4315 "Regexp to use in `completion-setup-function' to find the root directory.")
4316
4311(defun completion-setup-function () 4317(defun completion-setup-function ()
4312 (let ((mainbuf (current-buffer)) 4318 (let ((mainbuf (current-buffer))
4313 (mbuf-contents (minibuffer-contents))) 4319 (mbuf-contents (minibuffer-contents)))
@@ -4336,7 +4342,7 @@ of the differing parts is, by contrast, slightly highlighted."
4336 (with-current-buffer mainbuf 4342 (with-current-buffer mainbuf
4337 (save-excursion 4343 (save-excursion
4338 (goto-char (point-max)) 4344 (goto-char (point-max))
4339 (skip-chars-backward "^/") 4345 (skip-chars-backward completion-root-regexp)
4340 (- (point) (minibuffer-prompt-end))))) 4346 (- (point) (minibuffer-prompt-end)))))
4341 ;; Otherwise, in minibuffer, the whole input is being completed. 4347 ;; Otherwise, in minibuffer, the whole input is being completed.
4342 (if (minibufferp mainbuf) 4348 (if (minibufferp mainbuf)
diff --git a/lisp/subr.el b/lisp/subr.el
index 2b329ef623f..2833dd10611 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -2316,13 +2316,13 @@ which in most cases is shared with all other buffers in the same major mode."
2316 2316
2317(defun global-unset-key (key) 2317(defun global-unset-key (key)
2318 "Remove global binding of KEY. 2318 "Remove global binding of KEY.
2319KEY is a string representing a sequence of keystrokes." 2319KEY is a string or vector representing a sequence of keystrokes."
2320 (interactive "kUnset key globally: ") 2320 (interactive "kUnset key globally: ")
2321 (global-set-key key nil)) 2321 (global-set-key key nil))
2322 2322
2323(defun local-unset-key (key) 2323(defun local-unset-key (key)
2324 "Remove local binding of KEY. 2324 "Remove local binding of KEY.
2325KEY is a string representing a sequence of keystrokes." 2325KEY is a string or vector representing a sequence of keystrokes."
2326 (interactive "kUnset key locally: ") 2326 (interactive "kUnset key locally: ")
2327 (if (current-local-map) 2327 (if (current-local-map)
2328 (local-set-key key nil)) 2328 (local-set-key key nil))
diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el
index 8029fb3d5a6..05ef4b95658 100644
--- a/lisp/wid-edit.el
+++ b/lisp/wid-edit.el
@@ -3153,6 +3153,8 @@ It will read a directory name from the minibuffer when invoked."
3153 (setq err "Empty sexp -- use `nil'?") 3153 (setq err "Empty sexp -- use `nil'?")
3154 (unless (widget-apply widget :match (read (current-buffer))) 3154 (unless (widget-apply widget :match (read (current-buffer)))
3155 (setq err (widget-get widget :type-error)))) 3155 (setq err (widget-get widget :type-error))))
3156 ;; Allow whitespace after expression.
3157 (skip-syntax-forward "\\s-")
3156 (if (and (not (eobp)) 3158 (if (and (not (eobp))
3157 (not err)) 3159 (not err))
3158 (setq err (format "Junk at end of expression: %s" 3160 (setq err (format "Junk at end of expression: %s"
diff --git a/lispref/ChangeLog b/lispref/ChangeLog
index 146f2173864..5f4f8901637 100644
--- a/lispref/ChangeLog
+++ b/lispref/ChangeLog
@@ -1,3 +1,48 @@
12004-08-08 Luc Teirlinck <teirllm@auburn.edu>
2
3 * objects.texi (Character Type): Reposition `@anchor' to prevent
4 double space inside sentence in Info.
5
6 * hooks.texi (Standard Hooks): `disabled-command-hook' has been
7 renamed to `disabled-command-function'.
8 * commands.texi (Key Sequence Input): Remove unnecessary anchor,
9 (Command Loop Info): Replace reference to it.
10 (Disabling Commands): `disabled-command-hook' has been renamed to
11 `disabled-command-function'.
12
132004-08-07 Luc Teirlinck <teirllm@auburn.edu>
14
15 * os.texi (Translating Input): Only non-prefix bindings in
16 `key-translation-map' override actual key bindings. Warn about
17 possible indirect effect of actual key bindings on non-prefix
18 bindings in `key-translation-map'.
19
202004-08-06 Luc Teirlinck <teirllm@auburn.edu>
21
22 * minibuf.texi (High-Level Completion): Add anchor for definition
23 of `read-variable'.
24
25 * commands.texi: Various changes in addition to:
26 (Using Interactive): Clarify description of `interactive-form'.
27 (Interactive Call): Mention default for KEYS argument to
28 `call-interactively'.
29 (Command Loop Info): Clarify description of `this-command-keys'.
30 Mention KEEP-RECORD argument to `clear-this-command-keys'.
31 Value of `last-event-frame' can be `macro'.
32 (Repeat Events): `double-click-fuzz' is also used to distinguish
33 clicks and drags.
34 (Classifying Events): Clarify descriptions of `event-modifiers'
35 `event-basic-type' and `event-convert-list'.
36 (Accessing Events): `posn-timestamp' takes POSITION argument.
37 (Quoted Character Input): Clarify description of
38 `read-quoted-char' and fix example.
39 (Quitting): Add `with-local-quit'.
40 (Disabling Commands): Correct and clarify descriptions of
41 `enable-command' and `disable-command'.
42 Mention what happens if `disabled-command-hook' is nil.
43 (Keyboard Macros): Mention LOOPFUNC arg to `execute-kbd-macro'.
44 Describe `executing-kbd-macro' instead of obsolete `executing-macro'.
45
12004-07-24 Luc Teirlinck <teirllm@auburn.edu> 462004-07-24 Luc Teirlinck <teirllm@auburn.edu>
2 47
3 * frames.texi: Various changes in addition to: 48 * frames.texi: Various changes in addition to:
diff --git a/lispref/commands.texi b/lispref/commands.texi
index 7a014080e89..796fc45f5f3 100644
--- a/lispref/commands.texi
+++ b/lispref/commands.texi
@@ -1,6 +1,6 @@
1@c -*-texinfo-*- 1@c -*-texinfo-*-
2@c This is part of the GNU Emacs Lisp Reference Manual. 2@c This is part of the GNU Emacs Lisp Reference Manual.
3@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999 3@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2004
4@c Free Software Foundation, Inc. 4@c Free Software Foundation, Inc.
5@c See the file elisp.texi for copying conditions. 5@c See the file elisp.texi for copying conditions.
6@setfilename ../info/commands 6@setfilename ../info/commands
@@ -119,7 +119,7 @@ controls the reading of arguments for an interactive call.
119 119
120 This section describes how to write the @code{interactive} form that 120 This section describes how to write the @code{interactive} form that
121makes a Lisp function an interactively-callable command, and how to 121makes a Lisp function an interactively-callable command, and how to
122examine a commands's @code{interactive} form. 122examine a command's @code{interactive} form.
123 123
124@defspec interactive arg-descriptor 124@defspec interactive arg-descriptor
125@cindex argument descriptors 125@cindex argument descriptors
@@ -235,12 +235,13 @@ string (starting with the first character that is not @samp{*} or
235 235
236@cindex examining the @code{interactive} form 236@cindex examining the @code{interactive} form
237@defun interactive-form function 237@defun interactive-form function
238This function returns the @code{interactive} form of @var{function}. If 238This function returns the @code{interactive} form of @var{function}.
239@var{function} is a command (@pxref{Interactive Call}), the value is a 239If @var{function} is an interactively callable function
240list of the form @code{(interactive @var{spec})}, where @var{spec} is 240(@pxref{Interactive Call}), the value is the command's
241the descriptor specification used by the command's @code{interactive} 241@code{interactive} form @code{(interactive @var{spec})}, which
242form to compute the function's arguments. If @var{function} is not a 242specifies how to compute its arguments. Otherwise, the value is
243command, @code{interactive-form} returns @code{nil}. 243@code{nil}. If @var{function} is a symbol, its function definition is
244used.
244@end defun 245@end defun
245 246
246@node Interactive Codes 247@node Interactive Codes
@@ -416,8 +417,9 @@ the string.) Other characters that normally terminate a symbol (e.g.,
416parentheses and brackets) do not do so here. Prompt. 417parentheses and brackets) do not do so here. Prompt.
417 418
418@item v 419@item v
419A variable declared to be a user option (i.e., satisfying the predicate 420A variable declared to be a user option (i.e., satisfying the
420@code{user-variable-p}). @xref{High-Level Completion}. Existing, 421predicate @code{user-variable-p}). This reads the variable using
422@code{read-variable}. @xref{Definition of read-variable}. Existing,
421Completion, Prompt. 423Completion, Prompt.
422 424
423@item x 425@item x
@@ -528,10 +530,12 @@ realistic example of using @code{commandp}.
528@defun call-interactively command &optional record-flag keys 530@defun call-interactively command &optional record-flag keys
529This function calls the interactively callable function @var{command}, 531This function calls the interactively callable function @var{command},
530reading arguments according to its interactive calling specifications. 532reading arguments according to its interactive calling specifications.
531An error is signaled if @var{command} is not a function or if it cannot 533It returns whatever @var{command} returns. An error is signaled if
532be called interactively (i.e., is not a command). Note that keyboard 534@var{command} is not a function or if it cannot be called
533macros (strings and vectors) are not accepted, even though they are 535interactively (i.e., is not a command). Note that keyboard macros
534considered commands, because they are not functions. 536(strings and vectors) are not accepted, even though they are
537considered commands, because they are not functions. If @var{command}
538is a symbol, then @code{call-interactively} uses its function definition.
535 539
536@cindex record command history 540@cindex record command history
537If @var{record-flag} is non-@code{nil}, then this command and its 541If @var{record-flag} is non-@code{nil}, then this command and its
@@ -541,6 +545,8 @@ an argument. @xref{Command History}.
541 545
542The argument @var{keys}, if given, specifies the sequence of events to 546The argument @var{keys}, if given, specifies the sequence of events to
543supply if the command inquires which events were used to invoke it. 547supply if the command inquires which events were used to invoke it.
548If @var{keys} is omitted or @code{nil}, the return value of
549@code{this-command-keys} is used. @xref{Definition of this-command-keys}.
544@end defun 550@end defun
545 551
546@defun command-execute command &optional record-flag keys special 552@defun command-execute command &optional record-flag keys special
@@ -551,7 +557,8 @@ callable function or a keyboard macro.
551 557
552A string or vector as @var{command} is executed with 558A string or vector as @var{command} is executed with
553@code{execute-kbd-macro}. A function is passed to 559@code{execute-kbd-macro}. A function is passed to
554@code{call-interactively}, along with the optional @var{record-flag}. 560@code{call-interactively}, along with the optional @var{record-flag}
561and @var{keys}.
555 562
556A symbol is handled by using its function definition in its place. A 563A symbol is handled by using its function definition in its place. A
557symbol with an @code{autoload} definition counts as a command if it was 564symbol with an @code{autoload} definition counts as a command if it was
@@ -559,9 +566,6 @@ declared to stand for an interactively callable function. Such a
559definition is handled by loading the specified library and then 566definition is handled by loading the specified library and then
560rechecking the definition of the symbol. 567rechecking the definition of the symbol.
561 568
562The argument @var{keys}, if given, specifies the sequence of events to
563supply if the command inquires which events were used to invoke it.
564
565The argument @var{special}, if given, means to ignore the prefix 569The argument @var{special}, if given, means to ignore the prefix
566argument and not clear it. This is used for executing special events 570argument and not clear it. This is used for executing special events
567(@pxref{Special Events}). 571(@pxref{Special Events}).
@@ -741,10 +745,14 @@ was specified to run but remapped into another command.
741@end defvar 745@end defvar
742 746
743@defun this-command-keys 747@defun this-command-keys
748@anchor{Definition of this-command-keys}
744This function returns a string or vector containing the key sequence 749This function returns a string or vector containing the key sequence
745that invoked the present command, plus any previous commands that 750that invoked the present command, plus any previous commands that
746generated the prefix argument for this command. The value is a string 751generated the prefix argument for this command. However, if the
747if all those events were characters. @xref{Input Events}. 752command has called @code{read-key-sequence}, it returns the last read
753key sequence. @xref{Key Sequence Input}. The value is a string if
754all events in the sequence were characters that fit in a string.
755@xref{Input Events}.
748 756
749@example 757@example
750@group 758@group
@@ -762,13 +770,13 @@ input events in a string (@pxref{Strings of Events}).
762@end defun 770@end defun
763 771
764@tindex clear-this-command-keys 772@tindex clear-this-command-keys
765@defun clear-this-command-keys 773@defun clear-this-command-keys &optional keep-record
766This function empties out the table of events for 774This function empties out the table of events for
767@code{this-command-keys} to return, and also empties the records that 775@code{this-command-keys} to return. Unless @var{keep-record} is
768the function @code{recent-keys} (@pxref{Recording Input}) will 776non-@code{nil}, it also empties the records that the function
769subsequently return. This is useful after reading a password, to 777@code{recent-keys} (@pxref{Recording Input}) will subsequently return.
770prevent the password from echoing inadvertently as part of the next 778This is useful after reading a password, to prevent the password from
771command in certain cases. 779echoing inadvertently as part of the next command in certain cases.
772@end defun 780@end defun
773 781
774@defvar last-nonmenu-event 782@defvar last-nonmenu-event
@@ -809,6 +817,8 @@ Usually this is the frame that was selected when the event was
809generated, but if that frame has redirected input focus to another 817generated, but if that frame has redirected input focus to another
810frame, the value is the frame to which the event was redirected. 818frame, the value is the frame to which the event was redirected.
811@xref{Input Focus}. 819@xref{Input Focus}.
820
821If the last event came from a keyboard macro, the value is @code{macro}.
812@end defvar 822@end defvar
813 823
814@node Adjusting Point 824@node Adjusting Point
@@ -1155,7 +1165,7 @@ the marginal areas, @var{position} has this form:
1155 1165
1156@example 1166@example
1157(@var{window} @var{pos-or-area} (@var{x} . @var{y}) @var{timestamp} 1167(@var{window} @var{pos-or-area} (@var{x} . @var{y}) @var{timestamp}
1158 @var{object} @var{text-pos} (@var{col} . @var{row}) 1168 @var{object} @var{text-pos} (@var{col} . @var{row})
1159 @var{image} (@var{dx} . @var{dy}) (@var{width} . @var{height})) 1169 @var{image} (@var{dx} . @var{dy}) (@var{width} . @var{height}))
1160@end example 1170@end example
1161 1171
@@ -1387,22 +1397,25 @@ the value is 3 or greater. If @var{event} is an ordinary mouse event
1387(not a repeat event), the value is 1. 1397(not a repeat event), the value is 1.
1388@end defun 1398@end defun
1389 1399
1390@defvar double-click-fuzz 1400@defopt double-click-fuzz
1391To generate repeat events, successive mouse button presses must be at 1401To generate repeat events, successive mouse button presses must be at
1392approximately the same screen position. The value of 1402approximately the same screen position. The value of
1393@code{double-click-fuzz} specifies the maximum number of pixels the 1403@code{double-click-fuzz} specifies the maximum number of pixels the
1394mouse may be moved between two successive clicks to make a 1404mouse may be moved (horizontally or vertically) between two successive
1395double-click. 1405clicks to make a double-click.
1396@end defvar
1397 1406
1398@defvar double-click-time 1407This variable is also the threshold for motion of the mouse to count
1408as a drag.
1409@end defopt
1410
1411@defopt double-click-time
1399To generate repeat events, the number of milliseconds between 1412To generate repeat events, the number of milliseconds between
1400successive button presses must be less than the value of 1413successive button presses must be less than the value of
1401@code{double-click-time}. Setting @code{double-click-time} to 1414@code{double-click-time}. Setting @code{double-click-time} to
1402@code{nil} disables multi-click detection entirely. Setting it to 1415@code{nil} disables multi-click detection entirely. Setting it to
1403@code{t} removes the time limit; Emacs then detects multi-clicks by 1416@code{t} removes the time limit; Emacs then detects multi-clicks by
1404position only. 1417position only.
1405@end defvar 1418@end defopt
1406 1419
1407@node Motion Events 1420@node Motion Events
1408@subsection Motion Events 1421@subsection Motion Events
@@ -1593,16 +1606,22 @@ This function returns a list of the modifiers that @var{event} has. The
1593modifiers are symbols; they include @code{shift}, @code{control}, 1606modifiers are symbols; they include @code{shift}, @code{control},
1594@code{meta}, @code{alt}, @code{hyper} and @code{super}. In addition, 1607@code{meta}, @code{alt}, @code{hyper} and @code{super}. In addition,
1595the modifiers list of a mouse event symbol always contains one of 1608the modifiers list of a mouse event symbol always contains one of
1596@code{click}, @code{drag}, and @code{down}. 1609@code{click}, @code{drag}, and @code{down}. For double or triple
1610events, it also contains @code{double} or @code{triple}.
1597 1611
1598The argument @var{event} may be an entire event object, or just an event 1612The argument @var{event} may be an entire event object, or just an
1599type. 1613event type. If @var{event} is a symbol that has never been used in an
1614event that has been read as input in the current Emacs session, then
1615@code{event-modifiers} can return @code{nil}, even when @var{event}
1616actually has modifiers.
1600 1617
1601Here are some examples: 1618Here are some examples:
1602 1619
1603@example 1620@example
1604(event-modifiers ?a) 1621(event-modifiers ?a)
1605 @result{} nil 1622 @result{} nil
1623(event-modifiers ?A)
1624 @result{} (shift)
1606(event-modifiers ?\C-a) 1625(event-modifiers ?\C-a)
1607 @result{} (control) 1626 @result{} (control)
1608(event-modifiers ?\C-%) 1627(event-modifiers ?\C-%)
@@ -1627,7 +1646,8 @@ but the event symbol name itself does not contain @samp{click}.
1627 1646
1628@defun event-basic-type event 1647@defun event-basic-type event
1629This function returns the key or mouse button that @var{event} 1648This function returns the key or mouse button that @var{event}
1630describes, with all modifiers removed. For example: 1649describes, with all modifiers removed. The @var{event} argument is as
1650in @code{event-modifiers}. For example:
1631 1651
1632@example 1652@example
1633(event-basic-type ?a) 1653(event-basic-type ?a)
@@ -1656,7 +1676,8 @@ event.
1656 1676
1657@defun event-convert-list list 1677@defun event-convert-list list
1658This function converts a list of modifier names and a basic event type 1678This function converts a list of modifier names and a basic event type
1659to an event type which specifies all of them. For example, 1679to an event type which specifies all of them. The basic event type
1680must be the last element of the list. For example,
1660 1681
1661@example 1682@example
1662(event-convert-list '(control ?a)) 1683(event-convert-list '(control ?a))
@@ -1788,7 +1809,7 @@ is a buffer position, return the size of the character at that position.
1788 1809
1789@cindex mouse event, timestamp 1810@cindex mouse event, timestamp
1790@cindex timestamp of a mouse event 1811@cindex timestamp of a mouse event
1791@defun posn-timestamp 1812@defun posn-timestamp position
1792Return the timestamp in @var{position}. This is the time at which the 1813Return the timestamp in @var{position}. This is the time at which the
1793event occurred, in milliseconds. 1814event occurred, in milliseconds.
1794@end defun 1815@end defun
@@ -2001,7 +2022,9 @@ for example, @code{describe-key} uses it to read the key to describe.
2001This function reads a key sequence and returns it as a string or 2022This function reads a key sequence and returns it as a string or
2002vector. It keeps reading events until it has accumulated a complete key 2023vector. It keeps reading events until it has accumulated a complete key
2003sequence; that is, enough to specify a non-prefix command using the 2024sequence; that is, enough to specify a non-prefix command using the
2004currently active keymaps. 2025currently active keymaps. (Remember that a key sequence that starts
2026with a mouse event is read using the keymaps of the buffer in the
2027window that the mouse was in, not the current buffer.)
2005 2028
2006If the events are all characters and all can fit in a string, then 2029If the events are all characters and all can fit in a string, then
2007@code{read-key-sequence} returns a string (@pxref{Strings of Events}). 2030@code{read-key-sequence} returns a string (@pxref{Strings of Events}).
@@ -2101,6 +2124,8 @@ from the terminal---not counting those generated by keyboard macros.
2101 The lowest level functions for command input are those that read a 2124 The lowest level functions for command input are those that read a
2102single event. 2125single event.
2103 2126
2127None of the three functions below suppresses quitting.
2128
2104@defun read-event &optional prompt inherit-input-method 2129@defun read-event &optional prompt inherit-input-method
2105This function reads and returns the next event of command input, waiting 2130This function reads and returns the next event of command input, waiting
2106if necessary until an event is available. Events can come directly from 2131if necessary until an event is available. Events can come directly from
@@ -2122,8 +2147,8 @@ If @code{cursor-in-echo-area} is non-@code{nil}, then @code{read-event}
2122moves the cursor temporarily to the echo area, to the end of any message 2147moves the cursor temporarily to the echo area, to the end of any message
2123displayed there. Otherwise @code{read-event} does not move the cursor. 2148displayed there. Otherwise @code{read-event} does not move the cursor.
2124 2149
2125If @code{read-event} gets an event that is defined as a help character, in 2150If @code{read-event} gets an event that is defined as a help character,
2126some cases @code{read-event} processes the event directly without 2151then in some cases @code{read-event} processes the event directly without
2127returning. @xref{Help Functions}. Certain other events, called 2152returning. @xref{Help Functions}. Certain other events, called
2128@dfn{special events}, are also processed directly within 2153@dfn{special events}, are also processed directly within
2129@code{read-event} (@pxref{Special Events}). 2154@code{read-event} (@pxref{Special Events}).
@@ -2235,7 +2260,10 @@ The command @code{quoted-insert} uses this function.
2235This function is like @code{read-char}, except that if the first 2260This function is like @code{read-char}, except that if the first
2236character read is an octal digit (0-7), it reads any number of octal 2261character read is an octal digit (0-7), it reads any number of octal
2237digits (but stopping if a non-octal digit is found), and returns the 2262digits (but stopping if a non-octal digit is found), and returns the
2238character represented by that numeric character code. 2263character represented by that numeric character code. If the
2264character that terminates the sequence of octal digits is @key{RET},
2265it is discarded. Any other terminating character is used as input
2266after this function returns.
2239 2267
2240Quitting is suppressed when the first character is read, so that the 2268Quitting is suppressed when the first character is read, so that the
2241user can enter a @kbd{C-g}. @xref{Quitting}. 2269user can enter a @kbd{C-g}. @xref{Quitting}.
@@ -2252,7 +2280,7 @@ is 127 in decimal).
2252 2280
2253@group 2281@group
2254---------- Echo Area ---------- 2282---------- Echo Area ----------
2255What character-@kbd{177} 2283What character @kbd{1 7 7}-
2256---------- Echo Area ---------- 2284---------- Echo Area ----------
2257 2285
2258 @result{} 127 2286 @result{} 127
@@ -2370,7 +2398,8 @@ during the sleep.
2370@cindex special events 2398@cindex special events
2371Special events are handled at a very low level---as soon as they are 2399Special events are handled at a very low level---as soon as they are
2372read. The @code{read-event} function processes these events itself, and 2400read. The @code{read-event} function processes these events itself, and
2373never returns them. 2401never returns them. Instead, it keeps waiting for the first event
2402that is not special and returns that one.
2374 2403
2375Events that are handled in this way do not echo, they are never grouped 2404Events that are handled in this way do not echo, they are never grouped
2376into key sequences, and they never appear in the value of 2405into key sequences, and they never appear in the value of
@@ -2544,6 +2573,28 @@ is set to a value other than @code{nil}. If @code{inhibit-quit} is
2544non-@code{nil}, then @code{quit-flag} has no special effect. 2573non-@code{nil}, then @code{quit-flag} has no special effect.
2545@end defvar 2574@end defvar
2546 2575
2576@defmac with-local-quit forms@dots{}
2577This macro executes @var{forms} in sequence, but allows quitting, at
2578least locally, within @var{body} even if @code{inhibit-quit} was
2579non-@code{nil} outside this construct. It returns the value of the
2580last form in @var{forms}.
2581
2582If @code{inhibit-quit} is @code{nil} on entry to @code{with-local-quit},
2583it only executes the @var{forms}, and setting @code{quit-flag} causes
2584a normal quit. However, if @code{inhibit-quit} is non-@code{nil} so
2585that ordinary quitting is delayed, a non-@code{nil} @code{quit-flag}
2586triggers a special kind of local quit. This ends the execution of
2587@var{forms} and exits the @code{with-local-quit} form with
2588@code{quit-flag} still non-@code{nil}, so that another (ordinary) quit
2589will happen as soon as that is allowed. If @code{quit-flag} is
2590already non-@code{nil} at the beginning of @var{forms}, the local quit
2591happens immediately and they don't execute at all.
2592
2593This macro is mainly useful in functions that can be called from
2594timers, @code{pre-command-hook}, @code{post-command-hook} and other
2595places where @code{inhibit-quit} is normally bound to @code{t}.
2596@end defmac
2597
2547@deffn Command keyboard-quit 2598@deffn Command keyboard-quit
2548This function signals the @code{quit} condition with @code{(signal 'quit 2599This function signals the @code{quit} condition with @code{(signal 'quit
2549nil)}. This is the same thing that quitting does. (See @code{signal} 2600nil)}. This is the same thing that quitting does. (See @code{signal}
@@ -2844,25 +2895,28 @@ Disabling a command has no effect on calling it as a function from Lisp
2844programs. 2895programs.
2845 2896
2846@deffn Command enable-command command 2897@deffn Command enable-command command
2847Allow @var{command} to be executed without special confirmation from now 2898Allow @var{command} (a symbol) to be executed without special
2848on, and (if the user confirms) alter the user's init file (@pxref{Init 2899confirmation from now on, and alter the user's init file (@pxref{Init
2849File}) so that this will apply to future sessions. 2900File}) so that this will apply to future sessions.
2850@end deffn 2901@end deffn
2851 2902
2852@deffn Command disable-command command 2903@deffn Command disable-command command
2853Require special confirmation to execute @var{command} from now on, and 2904Require special confirmation to execute @var{command} from now on, and
2854(if the user confirms) alter the user's init file so that this 2905alter the user's init file so that this will apply to future sessions.
2855will apply to future sessions.
2856@end deffn 2906@end deffn
2857 2907
2858@defvar disabled-command-hook 2908@defvar disabled-command-function
2859When the user invokes a disabled command interactively, this normal hook 2909The value of this variable should be a function. When the user
2860is run instead of the disabled command. The hook functions can use 2910invokes a disabled command interactively, this function is called
2861@code{this-command-keys} to determine what the user typed to run the 2911instead of the disabled command. It can use @code{this-command-keys}
2862command, and thus find the command itself. @xref{Hooks}. 2912to determine what the user typed to run the command, and thus find the
2913command itself.
2914
2915The value may also be @code{nil}. Then all commands work normally,
2916even disabled ones.
2863 2917
2864By default, @code{disabled-command-hook} contains a function that asks 2918By default, the value is a function that asks the user whether to
2865the user whether to proceed. 2919proceed.
2866@end defvar 2920@end defvar
2867 2921
2868@node Command History 2922@node Command History
@@ -2918,7 +2972,7 @@ representation of a keyboard macro is a string or vector containing the
2918events. Don't confuse keyboard macros with Lisp macros 2972events. Don't confuse keyboard macros with Lisp macros
2919(@pxref{Macros}). 2973(@pxref{Macros}).
2920 2974
2921@defun execute-kbd-macro kbdmacro &optional count 2975@defun execute-kbd-macro kbdmacro &optional count loopfunc
2922This function executes @var{kbdmacro} as a sequence of events. If 2976This function executes @var{kbdmacro} as a sequence of events. If
2923@var{kbdmacro} is a string or vector, then the events in it are executed 2977@var{kbdmacro} is a string or vector, then the events in it are executed
2924exactly as if they had been input by the user. The sequence is 2978exactly as if they had been input by the user. The sequence is
@@ -2935,10 +2989,14 @@ many times. If @var{count} is omitted or @code{nil}, @var{kbdmacro} is
2935executed once. If it is 0, @var{kbdmacro} is executed over and over until it 2989executed once. If it is 0, @var{kbdmacro} is executed over and over until it
2936encounters an error or a failing search. 2990encounters an error or a failing search.
2937 2991
2992If @var{loopfunc} is non-@code{nil}, it is a function that is called,
2993without arguments, prior to each iteration of the macro. If
2994@var{loopfunc} returns @code{nil}, then this stops execution of the macro.
2995
2938@xref{Reading One Event}, for an example of using @code{execute-kbd-macro}. 2996@xref{Reading One Event}, for an example of using @code{execute-kbd-macro}.
2939@end defun 2997@end defun
2940 2998
2941@defvar executing-macro 2999@defvar executing-kbd-macro
2942This variable contains the string or vector that defines the keyboard 3000This variable contains the string or vector that defines the keyboard
2943macro that is currently executing. It is @code{nil} if no macro is 3001macro that is currently executing. It is @code{nil} if no macro is
2944currently executing. A command can test this variable so as to behave 3002currently executing. A command can test this variable so as to behave
@@ -2947,10 +3005,11 @@ yourself.
2947@end defvar 3005@end defvar
2948 3006
2949@defvar defining-kbd-macro 3007@defvar defining-kbd-macro
2950This variable indicates whether a keyboard macro is being defined. A 3008This variable is non-@code{nil} if and only if a keyboard macro is
2951command can test this variable so as to behave differently while a macro 3009being defined. A command can test this variable so as to behave
2952is being defined. The commands @code{start-kbd-macro} and 3010differently while a macro is being defined. The commands
2953@code{end-kbd-macro} set this variable---do not set it yourself. 3011@code{start-kbd-macro} and @code{end-kbd-macro} set this variable---do
3012not set it yourself.
2954 3013
2955The variable is always local to the current terminal and cannot be 3014The variable is always local to the current terminal and cannot be
2956buffer-local. @xref{Multiple Displays}. 3015buffer-local. @xref{Multiple Displays}.
diff --git a/lispref/hooks.texi b/lispref/hooks.texi
index 5c424bd8de2..ad5d709e720 100644
--- a/lispref/hooks.texi
+++ b/lispref/hooks.texi
@@ -64,7 +64,7 @@ however, we have renamed all of those.)
64@item diary-display-hook 64@item diary-display-hook
65@item diary-hook 65@item diary-hook
66@item dired-mode-hook 66@item dired-mode-hook
67@item disabled-command-hook 67@item disabled-command-function
68@item echo-area-clear-hook 68@item echo-area-clear-hook
69@item edit-picture-hook 69@item edit-picture-hook
70@item electric-buffer-menu-mode-hook 70@item electric-buffer-menu-mode-hook
diff --git a/lispref/minibuf.texi b/lispref/minibuf.texi
index c0ee5c85881..7b762a654e6 100644
--- a/lispref/minibuf.texi
+++ b/lispref/minibuf.texi
@@ -1118,6 +1118,7 @@ complete in the set of extant Lisp symbols, and it uses the
1118@end defun 1118@end defun
1119 1119
1120@defun read-variable prompt &optional default 1120@defun read-variable prompt &optional default
1121@anchor{Definition of read-variable}
1121This function reads the name of a user variable and returns it as a 1122This function reads the name of a user variable and returns it as a
1122symbol. 1123symbol.
1123 1124
diff --git a/lispref/objects.texi b/lispref/objects.texi
index 7c8eff06295..e945f075e65 100644
--- a/lispref/objects.texi
+++ b/lispref/objects.texi
@@ -411,8 +411,8 @@ represents the shifted-control-o character.
411@cindex hyper characters 411@cindex hyper characters
412@cindex super characters 412@cindex super characters
413@cindex alt characters 413@cindex alt characters
414 The X Window System defines three other @anchor{modifier bits} 414 The X Window System defines three other
415modifier bits that can be set 415@anchor{modifier bits}modifier bits that can be set
416in a character: @dfn{hyper}, @dfn{super} and @dfn{alt}. The syntaxes 416in a character: @dfn{hyper}, @dfn{super} and @dfn{alt}. The syntaxes
417for these bits are @samp{\H-}, @samp{\s-} and @samp{\A-}. (Case is 417for these bits are @samp{\H-}, @samp{\s-} and @samp{\A-}. (Case is
418significant in these prefixes.) Thus, @samp{?\H-\M-\A-x} represents 418significant in these prefixes.) Thus, @samp{?\H-\M-\A-x} represents
diff --git a/lispref/os.texi b/lispref/os.texi
index 3e1b93339ad..42a0613bfec 100644
--- a/lispref/os.texi
+++ b/lispref/os.texi
@@ -1686,12 +1686,18 @@ finished; it receives the results of translation by
1686@code{function-key-map}. 1686@code{function-key-map}.
1687 1687
1688@item 1688@item
1689@code{key-translation-map} overrides actual key bindings. For example, 1689Non-prefix bindings in @code{key-translation-map} override actual key
1690if @kbd{C-x f} has a binding in @code{key-translation-map}, that 1690bindings. For example, if @kbd{C-x f} has a non-prefix binding in
1691translation takes effect even though @kbd{C-x f} also has a key binding 1691@code{key-translation-map}, that translation takes effect even though
1692in the global map. 1692@kbd{C-x f} also has a key binding in the global map.
1693@end itemize 1693@end itemize
1694 1694
1695Note however that actual key bindings can have an effect on
1696@code{key-translation-map}, even though they are overridden by it.
1697Indeed, actual key bindings override @code{function-key-map} and thus
1698may alter the key sequence that @code{key-translation-map} receives.
1699Clearly, it is better to avoid to avoid this type of situation.
1700
1695The intent of @code{key-translation-map} is for users to map one 1701The intent of @code{key-translation-map} is for users to map one
1696character set to another, including ordinary characters normally bound 1702character set to another, including ordinary characters normally bound
1697to @code{self-insert-command}. 1703to @code{self-insert-command}.
diff --git a/src/ChangeLog b/src/ChangeLog
index 2b0c47862d4..248d5daa92e 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,27 @@
12004-08-08 Luc Teirlinck <teirllm@auburn.edu>
2
3 * keyboard.c: Declare Qdisabled_command_function instead of
4 Qdisabled_command_hook.
5 (Fcommand_execute): Use Qdisabled_command_function instead of
6 Qdisabled_command_hook.
7 (syms_of_keyboard): Ditto.
8
92004-08-07 Luc Teirlinck <teirllm@auburn.edu>
10
11 * keymap.c (Flocal_key_binding, Fglobal_key_binding)
12 (syms_of_keymap) <key-translation-map>: Doc fixes.
13
142004-08-07 Stefan Monnier <monnier@iro.umontreal.ca>
15
16 * window.c (window_list_1): YAILOM.
17
18 * fileio.c (make_temp_name): Handle multibyte prefixes.
19
202004-08-06 Luc Teirlinck <teirllm@auburn.edu>
21
22 * keyboard.c (syms_of_keyboard) <overriding-terminal-local-map>:
23 Doc fix.
24
12004-08-03 Kenichi Handa <handa@m17n.org> 252004-08-03 Kenichi Handa <handa@m17n.org>
2 26
3 * coding.c (decode_coding_string): Adjust coding->consumed, and 27 * coding.c (decode_coding_string): Adjust coding->consumed, and
diff --git a/src/fileio.c b/src/fileio.c
index a05d7689c12..180f6f94130 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -888,7 +888,7 @@ make_temp_name (prefix, base64_p)
888 int base64_p; 888 int base64_p;
889{ 889{
890 Lisp_Object val; 890 Lisp_Object val;
891 int len; 891 int len, clen;
892 int pid; 892 int pid;
893 unsigned char *p, *data; 893 unsigned char *p, *data;
894 char pidbuf[20]; 894 char pidbuf[20];
@@ -923,8 +923,10 @@ make_temp_name (prefix, base64_p)
923#endif 923#endif
924 } 924 }
925 925
926 len = SCHARS (prefix); 926 len = SBYTES (prefix); clen = SCHARS (prefix);
927 val = make_uninit_string (len + 3 + pidlen); 927 val = make_uninit_multibyte_string (clen + 3 + pidlen, len + 3 + pidlen);
928 if (!STRING_MULTIBYTE (prefix))
929 STRING_SET_UNIBYTE (val);
928 data = SDATA (val); 930 data = SDATA (val);
929 bcopy(SDATA (prefix), data, len); 931 bcopy(SDATA (prefix), data, len);
930 p = data + len; 932 p = data + len;
diff --git a/src/keyboard.c b/src/keyboard.c
index c84e5d7bedc..d0b081e5cdd 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -127,8 +127,8 @@ KBOARD the_only_kboard;
127#endif 127#endif
128 128
129/* Non-nil disable property on a command means 129/* Non-nil disable property on a command means
130 do not execute it; call disabled-command-hook's value instead. */ 130 do not execute it; call disabled-command-function's value instead. */
131Lisp_Object Qdisabled, Qdisabled_command_hook; 131Lisp_Object Qdisabled, Qdisabled_command_function;
132 132
133#define NUM_RECENT_KEYS (100) 133#define NUM_RECENT_KEYS (100)
134int recent_keys_index; /* Index for storing next element into recent_keys */ 134int recent_keys_index; /* Index for storing next element into recent_keys */
@@ -9736,9 +9736,9 @@ a special event, so ignore the prefix argument and don't clear it. */)
9736 tem = Fget (cmd, Qdisabled); 9736 tem = Fget (cmd, Qdisabled);
9737 if (!NILP (tem) && !NILP (Vrun_hooks)) 9737 if (!NILP (tem) && !NILP (Vrun_hooks))
9738 { 9738 {
9739 tem = Fsymbol_value (Qdisabled_command_hook); 9739 tem = Fsymbol_value (Qdisabled_command_function);
9740 if (!NILP (tem)) 9740 if (!NILP (tem))
9741 return call1 (Vrun_hooks, Qdisabled_command_hook); 9741 return call1 (Vrun_hooks, Qdisabled_command_function);
9742 } 9742 }
9743 } 9743 }
9744 9744
@@ -10916,8 +10916,8 @@ syms_of_keyboard ()
10916 Qtimer_event_handler = intern ("timer-event-handler"); 10916 Qtimer_event_handler = intern ("timer-event-handler");
10917 staticpro (&Qtimer_event_handler); 10917 staticpro (&Qtimer_event_handler);
10918 10918
10919 Qdisabled_command_hook = intern ("disabled-command-hook"); 10919 Qdisabled_command_function = intern ("disabled-command-function");
10920 staticpro (&Qdisabled_command_hook); 10920 staticpro (&Qdisabled_command_function);
10921 10921
10922 Qself_insert_command = intern ("self-insert-command"); 10922 Qself_insert_command = intern ("self-insert-command");
10923 staticpro (&Qself_insert_command); 10923 staticpro (&Qself_insert_command);
@@ -11414,6 +11414,7 @@ The elements of the list are event types that may have menu bar bindings. */);
11414 doc: /* Per-terminal keymap that overrides all other local keymaps. 11414 doc: /* Per-terminal keymap that overrides all other local keymaps.
11415If this variable is non-nil, it is used as a keymap instead of the 11415If this variable is non-nil, it is used as a keymap instead of the
11416buffer's local map, and the minor mode keymaps and text property keymaps. 11416buffer's local map, and the minor mode keymaps and text property keymaps.
11417It also overrides `overriding-local-map'.
11417This variable is intended to let commands such as `universal-argument' 11418This variable is intended to let commands such as `universal-argument'
11418set up a different keymap for reading the next command. */); 11419set up a different keymap for reading the next command. */);
11419 11420
diff --git a/src/keymap.c b/src/keymap.c
index ee4f41de6b8..e93a3f89fe4 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -1603,7 +1603,7 @@ is non-nil, `key-binding' returns the unmapped command. */)
1603 1603
1604DEFUN ("local-key-binding", Flocal_key_binding, Slocal_key_binding, 1, 2, 0, 1604DEFUN ("local-key-binding", Flocal_key_binding, Slocal_key_binding, 1, 2, 0,
1605 doc: /* Return the binding for command KEYS in current local keymap only. 1605 doc: /* Return the binding for command KEYS in current local keymap only.
1606KEYS is a string, a sequence of keystrokes. 1606KEYS is a string or vector, a sequence of keystrokes.
1607The binding is probably a symbol with a function definition. 1607The binding is probably a symbol with a function definition.
1608 1608
1609If optional argument ACCEPT-DEFAULT is non-nil, recognize default 1609If optional argument ACCEPT-DEFAULT is non-nil, recognize default
@@ -1622,7 +1622,7 @@ bindings; see the description of `lookup-key' for more details about this. */)
1622 1622
1623DEFUN ("global-key-binding", Fglobal_key_binding, Sglobal_key_binding, 1, 2, 0, 1623DEFUN ("global-key-binding", Fglobal_key_binding, Sglobal_key_binding, 1, 2, 0,
1624 doc: /* Return the binding for command KEYS in current global keymap only. 1624 doc: /* Return the binding for command KEYS in current global keymap only.
1625KEYS is a string, a sequence of keystrokes. 1625KEYS is a string or vector, a sequence of keystrokes.
1626The binding is probably a symbol with a function definition. 1626The binding is probably a symbol with a function definition.
1627This function's return values are the same as those of `lookup-key' 1627This function's return values are the same as those of `lookup-key'
1628\(which see). 1628\(which see).
@@ -3752,7 +3752,7 @@ key, typing `ESC O P x' would return [f1 x]. */);
3752 DEFVAR_LISP ("key-translation-map", &Vkey_translation_map, 3752 DEFVAR_LISP ("key-translation-map", &Vkey_translation_map,
3753 doc: /* Keymap of key translations that can override keymaps. 3753 doc: /* Keymap of key translations that can override keymaps.
3754This keymap works like `function-key-map', but comes after that, 3754This keymap works like `function-key-map', but comes after that,
3755and applies even for keys that have ordinary bindings. */); 3755and its non-prefix bindings override ordinary bindings. */);
3756 Vkey_translation_map = Qnil; 3756 Vkey_translation_map = Qnil;
3757 3757
3758 staticpro (&Vmouse_events); 3758 staticpro (&Vmouse_events);
diff --git a/src/window.c b/src/window.c
index 4baf9d371bc..8a704bdc298 100644
--- a/src/window.c
+++ b/src/window.c
@@ -1830,7 +1830,7 @@ window_list_1 (window, minibuf, all_frames)
1830 rest = Fmemq (window, list); 1830 rest = Fmemq (window, list);
1831 if (!NILP (rest) && !EQ (rest, list)) 1831 if (!NILP (rest) && !EQ (rest, list))
1832 { 1832 {
1833 for (tail = list; XCDR (tail) != rest; tail = XCDR (tail)) 1833 for (tail = list; !EQ (XCDR (tail), rest); tail = XCDR (tail))
1834 ; 1834 ;
1835 XSETCDR (tail, Qnil); 1835 XSETCDR (tail, Qnil);
1836 list = nconc2 (rest, list); 1836 list = nconc2 (rest, list);