[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs doc/lispref/ChangeLog doc/lispref/process...
From: |
Stefan Monnier |
Subject: |
[Emacs-diffs] emacs doc/lispref/ChangeLog doc/lispref/process... |
Date: |
Wed, 19 Aug 2009 03:03:10 +0000 |
CVSROOT: /sources/emacs
Module name: emacs
Changes by: Stefan Monnier <monnier> 09/08/19 03:03:10
Modified files:
doc/lispref : ChangeLog processes.texi
etc : NEWS
lisp : ChangeLog subr.el
Log message:
* subr.el (listify-key-sequence-1): Use normal syntax since those
integers are nowadays always represented by the same (positive) number
on all platforms.
(read-key-empty-map): New const.
(read-key-delay): New var.
(read-key): New function.
(force-mode-line-update): Use with-current-buffer.
(locate-user-emacs-file): Don't forget to abbreviate the file name.
(start-process-shell-command, start-file-process-shell-command):
Discourage the use of command-args.
* processes.texi (Asynchronous Processes): Adjust arglist of
start-process-shell-command and start-file-process-shell-command.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/doc/lispref/ChangeLog?cvsroot=emacs&r1=1.317&r2=1.318
http://cvs.savannah.gnu.org/viewcvs/emacs/doc/lispref/processes.texi?cvsroot=emacs&r1=1.23&r2=1.24
http://cvs.savannah.gnu.org/viewcvs/emacs/etc/NEWS?cvsroot=emacs&r1=1.2062&r2=1.2063
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/ChangeLog?cvsroot=emacs&r1=1.15966&r2=1.15967
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/subr.el?cvsroot=emacs&r1=1.643&r2=1.644
Patches:
Index: doc/lispref/ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/doc/lispref/ChangeLog,v
retrieving revision 1.317
retrieving revision 1.318
diff -u -b -r1.317 -r1.318
--- doc/lispref/ChangeLog 15 Aug 2009 22:02:59 -0000 1.317
+++ doc/lispref/ChangeLog 19 Aug 2009 03:03:05 -0000 1.318
@@ -1,3 +1,8 @@
+2009-08-19 Stefan Monnier <address@hidden>
+
+ * processes.texi (Asynchronous Processes): Adjust arglist of
+ start-process-shell-command and start-file-process-shell-command.
+
2009-08-15 Chong Yidong <address@hidden>
* advice.texi (Argument Access in Advice): Note that argument
Index: doc/lispref/processes.texi
===================================================================
RCS file: /sources/emacs/emacs/doc/lispref/processes.texi,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -b -r1.23 -r1.24
--- doc/lispref/processes.texi 18 Jul 2009 04:42:25 -0000 1.23
+++ doc/lispref/processes.texi 19 Aug 2009 03:03:05 -0000 1.24
@@ -581,11 +581,10 @@
does nothing and returns @code{nil}.
@end defun
address@hidden start-process-shell-command name buffer-or-name command &rest
command-args
address@hidden start-process-shell-command name buffer-or-name command
This function is like @code{start-process} except that it uses a shell
to execute the specified command. The argument @var{command} is a shell
-command name, and @var{command-args} are the arguments for the shell
-command. The variable @code{shell-file-name} specifies which shell to
+command name. The variable @code{shell-file-name} specifies which shell to
use.
The point of running a program through the shell, rather than directly
@@ -597,7 +596,7 @@
Arguments}.
@end defun
address@hidden start-file-process-shell-command name buffer-or-name command
&rest command-args
address@hidden start-file-process-shell-command name buffer-or-name command
This function is like @code{start-process-shell-command}, but uses
@code{start-file-process} internally. By this, @var{command} can be
executed also on remote hosts, depending on @code{default-directory}.
Index: etc/NEWS
===================================================================
RCS file: /sources/emacs/emacs/etc/NEWS,v
retrieving revision 1.2062
retrieving revision 1.2063
diff -u -b -r1.2062 -r1.2063
--- etc/NEWS 17 Aug 2009 23:50:26 -0000 1.2062
+++ etc/NEWS 19 Aug 2009 03:03:06 -0000 1.2063
@@ -177,6 +177,10 @@
* Lisp changes in Emacs 23.2
+** read-key is a function halfway between read-event and read-key-sequence.
+It reads a single key, but obeys input and escape sequence decoding.
+** start-process-shell-command start-file-process-shell-command only
+take a single `command' argument any more.
** Hash tables have a new printed representation that is readable.
The feature `hashtable-print-readable' identifies this new
functionality.
Index: lisp/ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.15966
retrieving revision 1.15967
diff -u -b -r1.15966 -r1.15967
--- lisp/ChangeLog 19 Aug 2009 02:53:53 -0000 1.15966
+++ lisp/ChangeLog 19 Aug 2009 03:03:07 -0000 1.15967
@@ -1,3 +1,16 @@
+2009-08-19 Stefan Monnier <address@hidden>
+
+ * subr.el (listify-key-sequence-1): Use normal syntax since those
+ integers are nowadays always represented by the same (positive) number
+ on all platforms.
+ (read-key-empty-map): New const.
+ (read-key-delay): New var.
+ (read-key): New function.
+ (force-mode-line-update): Use with-current-buffer.
+ (locate-user-emacs-file): Don't forget to abbreviate the file name.
+ (start-process-shell-command, start-file-process-shell-command):
+ Discourage the use of command-args.
+
2009-08-19 Glenn Morris <address@hidden>
* emacs-lisp/authors.el (authors-fixed-entries): Remove cvtmail.
Index: lisp/subr.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/subr.el,v
retrieving revision 1.643
retrieving revision 1.644
diff -u -b -r1.643 -r1.644
--- lisp/subr.el 9 Aug 2009 02:57:48 -0000 1.643
+++ lisp/subr.el 19 Aug 2009 03:03:09 -0000 1.644
@@ -225,7 +225,9 @@
"Signal an error, making error message by passing all args to `format'.
In Emacs, the convention is that error messages start with a capital
letter but *do not* end with a period. Please follow this convention
-for the sake of consistency."
+for the sake of consistency.
+
+\(fn STRING &rest ARGS)"
(while t
(signal 'error (list (apply 'format args)))))
@@ -753,10 +755,7 @@
;;;; Event manipulation functions.
-;; The call to `read' is to ensure that the value is computed at load time
-;; and not compiled into the .elc file. The value is negative on most
-;; machines, but not on all!
-(defconst listify-key-sequence-1 (logior 128 (read "?\\M-\\^@")))
+(defconst listify-key-sequence-1 (logior 128 ?\M-\C-@))
(defun listify-key-sequence (key)
"Convert a key sequence to a list of events."
@@ -1759,6 +1758,48 @@
:type '(choice (const 8) (const 10) (const 16))
:group 'editing-basics)
+(defconst read-key-empty-map (make-sparse-keymap))
+
+(defvar read-key-delay 0.1)
+
+(defun read-key (&optional prompt)
+ "Read a key from the keyboard.
+Contrary to `read-event' this will not return a raw event but instead will
+obey the input decoding and translations usually done by `read-key-sequence'.
+So escape sequences and keyboard encoding are taken into account.
+When there's an ambiguity because the key looks like the prefix of
+some sort of escape sequence, the ambiguity is resolved via `read-key-delay'."
+ (let ((overriding-terminal-local-map read-key-empty-map)
+ (overriding-local-map nil)
+ (old-global-map (current-global-map))
+ (timer (run-with-idle-timer
+ ;; Wait long enough that Emacs has the time to receive and
+ ;; process all the raw events associated with the single-key.
+ ;; But don't wait too long, or the user may find the delay
+ ;; annoying (or keep hitting more keys which may then get
+ ;; lost or misinterpreted).
+ ;; This is only relevant for keys which Emacs perceives as
+ ;; "prefixes", such as C-x (because of the C-x 8 map in
+ ;; key-translate-table and the C-x @ map in function-key-map)
+ ;; or ESC (because of terminal escape sequences in
+ ;; input-decode-map).
+ read-key-delay t
+ (lambda ()
+ (let ((keys (this-command-keys-vector)))
+ (unless (zerop (length keys))
+ ;; `keys' is non-empty, so the user has hit at least
+ ;; one key; there's no point waiting any longer, even
+ ;; though read-key-sequence thinks we should wait
+ ;; for more input to decide how to interpret the
+ ;; current input.
+ (throw 'read-key keys)))))))
+ (unwind-protect
+ (progn
+ (use-global-map read-key-empty-map)
+ (aref (catch 'read-key (read-key-sequence prompt nil t)) 0))
+ (cancel-timer timer)
+ (use-global-map old-global-map))))
+
(defun read-quoted-char (&optional prompt)
"Like `read-char', but do not allow quitting.
Also, if the first character read is an octal digit,
@@ -2095,7 +2136,7 @@
With optional non-nil ALL, force redisplay of all mode lines and
header lines. This function also forces recomputation of the
menu bar menus and the frame title."
- (if all (save-excursion (set-buffer (other-buffer))))
+ (if all (with-current-buffer (other-buffer)))
(set-buffer-modified-p (buffer-modified-p)))
(defun momentary-string-display (string pos &optional exit-char message)
@@ -2240,7 +2281,8 @@
purify-flag
(file-accessible-directory-p (directory-file-name
user-emacs-directory))
(make-directory user-emacs-directory))
- (expand-file-name new-name user-emacs-directory)))))
+ (abbreviate-file-name
+ (expand-file-name new-name user-emacs-directory))))))
;;;; Misc. useful functions.
@@ -2491,13 +2533,13 @@
an output stream or filter function to handle the output.
BUFFER may be also nil, meaning that this process is not associated
with any buffer
-COMMAND is the name of a shell command.
-Remaining arguments are the arguments for the command; they are all
-spliced together with blanks separating between each two of them, before
-passing the command to the shell.
-Wildcards and redirection are handled as usual in the shell.
+COMMAND is the shell command to run.
-\(fn NAME BUFFER COMMAND &rest COMMAND-ARGS)"
+An old calling convention accepted any number of arguments after COMMAND,
+which were just concatenated to COMMAND. This is still supported but strongly
+discouraged.
+
+\(fn NAME BUFFER COMMAND)"
;; We used to use `exec' to replace the shell with the command,
;; but that failed to handle (...) and semicolon, etc.
(start-process name buffer shell-file-name shell-command-switch
@@ -2505,7 +2547,9 @@
(defun start-file-process-shell-command (name buffer &rest args)
"Start a program in a subprocess. Return the process object for it.
-Similar to `start-process-shell-command', but calls `start-file-process'."
+Similar to `start-process-shell-command', but calls `start-file-process'.
+
+\(fn NAME BUFFER COMMAND)"
(start-file-process
name buffer
(if (file-remote-p default-directory) "/bin/sh" shell-file-name)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] emacs doc/lispref/ChangeLog doc/lispref/process...,
Stefan Monnier <=