Commit e2ae1c5a authored by Paul Eggert's avatar Paul Eggert
Browse files

Merge from origin/emacs-24

4b0b27d0 Fix invocation of commands whose file name includes extension
87fc99fe Better support for the case of typing RET on the prompt in comint.
a7b1c2f8 Don't lose frame's background color when setting foreground
20c817d3 Fix handling of frame color parameters in TTY sessions
eca7da10 Complete the remaining documentation updates for 24.5

Conflicts:
	doc/lispref/ChangeLog
	etc/NEWS
	lisp/ChangeLog
	nt/ChangeLog
	src/ChangeLog
parents d8462361 4b0b27d0
2015-03-03 Eli Zaretskii <eliz@gnu.org>
* processes.texi (Synchronous Processes): Update documentation of
call-process-shell-command and process-file-shell-command.
2015-03-03 Eli Zaretskii <eliz@gnu.org>
2015-03-03 Daniel Colascione <dancol@dancol.org>
* control.texi (Generators): Correct missing word. Clarify which
......
......@@ -503,17 +503,21 @@ inputinput@point{}
@c It actually uses shell-command-switch, but no need to mention that here.
@end defun
@defun call-process-shell-command command &optional infile destination display &rest args
@defun call-process-shell-command command &optional infile destination display
This function executes the shell command @var{command} synchronously.
The final arguments @var{args} are additional arguments to add at the
end of @var{command}. The other arguments are handled as in
@code{call-process}.
The arguments are handled as in @code{call-process}. An old calling
convention allowed to pass any number of additional arguments after
@var{display}, which were concatenated to @var{command}; this is still
supported, but strongly discouraged.
@end defun
@defun process-file-shell-command command &optional infile destination display &rest args
@defun process-file-shell-command command &optional infile destination display
This function is like @code{call-process-shell-command}, but uses
@code{process-file} internally. Depending on @code{default-directory},
@var{command} can be executed also on remote hosts.
@var{command} can be executed also on remote hosts. An old calling
convention allowed to pass any number of additional arguments after
@var{display}, which were concatenated to @var{command}; this is still
supported, but strongly discouraged.
@end defun
@defun shell-command-to-string command
......
......@@ -29,6 +29,10 @@ otherwise leave it unmarked.
** Building Emacs now requires GNU make, version 3.81 or later.
+++
** `call-process-shell-command' and `process-file-shell-command'
don't take "&rest args" any more.
** By default, Emacs no longer works on IRIX. We expect that Emacs
users are not affected by this, as SGI stopped supporting IRIX in
December 2013. If you are affected, please send a bug report. You
......@@ -39,6 +43,9 @@ or by sticking with Emacs 24.4.
** 'configure' now prefers gnustep-config when configuring GNUstep.
If gnustep-config is not available, the old heuristics are used.
---
*** cc-compat.el
---
** The configure option `--with-pkg-config-prog' has been removed.
Use './configure PKG_CONFIG=/full/name/of/pkg-config' if you need to.
......
2015-03-03 Juri Linkov <juri@linkov.net>
Better support for the case of typing RET on the prompt in comint.
* comint.el (comint-get-old-input-default): Go to the field end
when comint-use-prompt-regexp is nil.
(comint-line-beginning-position): Check if point is already
on the prompt before searching for the prompt when
comint-use-prompt-regexp is non-nil. (Bug#19710)
2015-03-03 Eli Zaretskii <eliz@gnu.org>
* frame.el (frame-notice-user-settings): Refresh the value of
frame parameters after calling tty-handle-reverse-video. Call
face-set-after-frame-default with the actual parameters, to avoid
resetting colors back to unspecified.
(set-background-color, set-foreground-color): Pass the foreground
and background colors to face-set-after-frame-default. (Bug#19802)
2015-03-03 Wolfgang Jenkner <wjenkner@inode.at>
* net/network-stream.el (network-stream-open-tls): Respect the
:end-of-capability setting.
2015-03-03 Juri Linkov <juri@linkov.net>
2015-03-03 Juri Linkov <juri@linkov.net>
 
Revert the previous change of comint-line-beginning-position callers,
......
......@@ -2222,7 +2222,10 @@ the current line with any initial string matching the regexp
(null (get-char-property (setq bof (field-beginning)) 'field)))
(field-string-no-properties bof)
(comint-bol)
(buffer-substring-no-properties (point) (line-end-position)))))
(buffer-substring-no-properties (point)
(if comint-use-prompt-regexp
(line-end-position)
(field-end))))))
(defun comint-copy-old-input ()
"Insert after prompt old input at point as new input to be edited.
......@@ -2270,8 +2273,9 @@ a buffer local variable."
(if comint-use-prompt-regexp
;; Use comint-prompt-regexp
(save-excursion
(re-search-backward comint-prompt-regexp nil t)
(beginning-of-line)
(unless (looking-at comint-prompt-regexp)
(re-search-backward comint-prompt-regexp nil t))
(comint-skip-prompt)
(point))
;; Use input fields. Note that, unlike the behavior of
......
......@@ -259,6 +259,10 @@ there (in decreasing order of priority)."
(let ((newparms (frame-parameters))
(frame (selected-frame)))
(tty-handle-reverse-video frame newparms)
;; tty-handle-reverse-video might change the frame's
;; color parameters, and we need to use the updated
;; value below.
(setq newparms (frame-parameters))
;; If we changed the background color, we need to update
;; the background-mode parameter, and maybe some faces,
;; too.
......@@ -266,7 +270,7 @@ there (in decreasing order of priority)."
(unless (or (assq 'background-mode initial-frame-alist)
(assq 'background-mode default-frame-alist))
(frame-set-background-mode frame))
(face-set-after-frame-default frame))))))
(face-set-after-frame-default frame newparms))))))
;; If the initial frame is still around, apply initial-frame-alist
;; and default-frame-alist to it.
......@@ -1201,7 +1205,15 @@ To get the frame's current background color, use `frame-parameters'."
(modify-frame-parameters (selected-frame)
(list (cons 'background-color color-name)))
(or window-system
(face-set-after-frame-default (selected-frame))))
(face-set-after-frame-default (selected-frame)
(list
(cons 'background-color color-name)
;; Pass the foreground-color as
;; well, if defined, to avoid
;; losing it when faces are reset
;; to their defaults.
(assq 'foreground-color
(frame-parameters))))))
(defun set-foreground-color (color-name)
"Set the foreground color of the selected frame to COLOR-NAME.
......@@ -1211,7 +1223,15 @@ To get the frame's current foreground color, use `frame-parameters'."
(modify-frame-parameters (selected-frame)
(list (cons 'foreground-color color-name)))
(or window-system
(face-set-after-frame-default (selected-frame))))
(face-set-after-frame-default (selected-frame)
(list
(cons 'foreground-color color-name)
;; Pass the background-color as
;; well, if defined, to avoid
;; losing it when faces are reset
;; to their defaults.
(assq 'background-color
(frame-parameters))))))
(defun set-cursor-color (color-name)
"Set the text cursor color of the selected frame to COLOR-NAME.
......
2015-03-03 Eli Zaretskii <eliz@gnu.org>
* cmdproxy.c (get_next_token): Don't make backslashes disappear
without a trace when they are not followed by a quote.
(search_dir): Support searching programs whose file name already
has an arbitrary extension. (Bug#19817)
(main): When passing a command line to the shell, use cmd.exe
rules for quoting command-line tail.
2015-03-03 Oscar Fuentes <ofv@wanadoo.es>
2015-02-27 Mark Laws <mdl@60hz.org>
Support daemon mode on MS-Windows (bug#19688)
......
......@@ -135,7 +135,10 @@ skip_nonspace (const char *str)
return str;
}
int escape_char = '\\';
/* This value is never changed by the code. We keep the code that
supports also the value of '"', but let's allow the compiler to
optimize it out, until someone actually uses that. */
const int escape_char = '\\';
/* Get next token from input, advancing pointer. */
int
......@@ -196,11 +199,31 @@ get_next_token (char * buf, const char ** pSrc)
/* End of string, but no ending quote found. We might want to
flag this as an error, but for now will consider the end as
the end of the token. */
if (escape_char == '\\')
{
/* Output literal backslashes. Note that if the
token ends with an unpaired backslash, we eat it
up here. But since this case invokes undefined
behavior anyway, it's okay. */
while (escape_char_run > 1)
{
*o++ = escape_char;
escape_char_run -= 2;
}
}
*o = '\0';
break;
}
else
{
if (escape_char == '\\')
{
/* Output literal backslashes. Note that we don't
treat a backslash as an escape character here,
since it doesn't preceed a quote. */
for ( ; escape_char_run > 0; escape_char_run--)
*o++ = escape_char;
}
*o++ = *p++;
}
}
......@@ -251,13 +274,44 @@ search_dir (const char *dir, const char *exec, int bufsize, char *buffer)
int n_exts = sizeof (exts) / sizeof (char *);
char *dummy;
int i, rc;
const char *pext = strrchr (exec, '\\');
/* Does EXEC already include an extension? */
if (!pext)
pext = exec;
pext = strchr (pext, '.');
/* Search the directory for the program. */
for (i = 0; i < n_exts; i++)
if (pext)
{
rc = SearchPath (dir, exec, exts[i], bufsize, buffer, &dummy);
/* SearchPath will not append an extension if the file already
has an extension, so we must append it ourselves. */
char exec_ext[MAX_PATH], *p;
p = strcpy (exec_ext, exec) + strlen (exec);
/* Search first without any extension; if found, we are done. */
rc = SearchPath (dir, exec_ext, NULL, bufsize, buffer, &dummy);
if (rc > 0)
return rc;
/* Try the known extensions. */
for (i = 0; i < n_exts; i++)
{
strcpy (p, exts[i]);
rc = SearchPath (dir, exec_ext, NULL, bufsize, buffer, &dummy);
if (rc > 0)
return rc;
}
}
else
{
for (i = 0; i < n_exts; i++)
{
rc = SearchPath (dir, exec, exts[i], bufsize, buffer, &dummy);
if (rc > 0)
return rc;
}
}
return 0;
......@@ -798,7 +852,7 @@ main (int argc, char ** argv)
quotes, since they are illegal in path names). */
remlen = maxlen =
strlen (progname) + extra_arg_space + strlen (cmdline) + 16;
strlen (progname) + extra_arg_space + strlen (cmdline) + 16 + 2;
buf = p = alloca (maxlen + 1);
/* Quote progname in case it contains spaces. */
......@@ -813,10 +867,16 @@ main (int argc, char ** argv)
remlen = maxlen - (p - buf);
}
/* Now that we know we will be invoking the shell, quote the
command line after the "/c" switch as the shell expects:
a single pair of quotes enclosing the entire command
tail, no matter whether quotes are used in the command
line, and how many of them are there. See the output of
"cmd /?" for how cmd.exe treats quotes. */
if (run_command_dot_com)
_snprintf (p, remlen, " /e:%d /c %s", envsize, cmdline);
_snprintf (p, remlen, " /e:%d /c \"%s\"", envsize, cmdline);
else
_snprintf (p, remlen, " /c %s", cmdline);
_snprintf (p, remlen, " /c \"%s\"", cmdline);
cmdline = buf;
}
else
......
2015-03-03 Eli Zaretskii <eliz@gnu.org>
* xfaces.c (map_tty_color): Use assoc_no_quit instead of
assq_no_quit to fetch color definition by its string name.
(Bug#19802)
2015-03-03 Eli Zaretskii <eliz@gnu.org>
2015-03-03 Eli Zaretskii <eliz@gnu.org>
 
* xdisp.c (move_it_in_display_line_to): Handle the case where the
......
......@@ -5700,7 +5700,7 @@ map_tty_color (struct frame *f, struct face *face,
if (STRINGP (color)
&& SCHARS (color)
&& CONSP (Vtty_defined_color_alist)
&& (def = assq_no_quit (color, call1 (Qtty_color_alist, frame)),
&& (def = assoc_no_quit (color, call1 (Qtty_color_alist, frame)),
CONSP (def)))
{
/* Associations in tty-defined-color-alist are of the form
......
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