]> code.delx.au - gnu-emacs/commitdiff
Merge from origin/emacs-24
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 3 Mar 2015 22:37:43 +0000 (14:37 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 3 Mar 2015 22:37:43 +0000 (14:37 -0800)
4b0b27d Fix invocation of commands whose file name includes extension
87fc99f Better support for the case of typing RET on the prompt in comint.
a7b1c2f Don't lose frame's background color when setting foreground
20c817d Fix handling of frame color parameters in TTY sessions
eca7da1 Complete the remaining documentation updates for 24.5

Conflicts:
doc/lispref/ChangeLog
etc/NEWS
lisp/ChangeLog
nt/ChangeLog
src/ChangeLog

doc/lispref/ChangeLog
doc/lispref/processes.texi
etc/NEWS
lisp/ChangeLog
lisp/comint.el
lisp/frame.el
nt/ChangeLog
nt/cmdproxy.c
src/ChangeLog
src/xfaces.c

index f96cb26a5e167bf85b7b1eceb971e2256cc68127..50cc9cb43b31687d3bac257722a31bcd073ce257 100644 (file)
@@ -1,3 +1,9 @@
+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
index 99411af3d4600f0e529260c643ad13f853a4cfea..177cd684f5c57e014bf955c57dba3cdbf30e3b0d 100644 (file)
@@ -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
index ad8b6f27812cb31d65e224b679ba592852a99dc9..a94c4caac64872bd6719d4dccc2b0edf8c7e3aa2 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -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.
index cd042da8e926651b3543d21f0bcb3d812275e9df..69ccbfaa507a9ec7bdd8cd9ab6f68775752a0a60 100644 (file)
@@ -1,3 +1,28 @@
+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,
index b14ab5bdf9f0cce2ac3cdda0dd8ddcea3af1026c..722a42d6af2bbbaf23b69212af359dc21aa56526 100644 (file)
@@ -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
index c81ee9bfa615773adccd2b727fae422cdd15f10c..94e581b1e24072c0528a521d8eba59d13d20671d 100644 (file)
@@ -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.
index 240f58c850b07f008dd007a3ea77ad6cd8a29a9a..cc77b18adbada4e60fdeb0b4deaf5d6f28bee38b 100644 (file)
@@ -1,3 +1,13 @@
+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)
index faef2f83496b6dc6cff9f95a39a4d1bbd653e78a..3157a69c1b62800e0597003d7771da97ca8faaf2 100644 (file)
@@ -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
index 5bfb18091398d920e25b3735d15ab38431603b3d..2609ed7dd01cea7ee601ed00df25ea74dda24a7f 100644 (file)
@@ -1,3 +1,10 @@
+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
index fcfdbc0ee4ff8ee6dbc1fc8f53ef8782d17f1cb6..b2697220bce70f5553b559a9f5c8371b546d2568 100644 (file)
@@ -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