emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master e2ae1c5 08/14: Merge from origin/emacs-24


From: Paul Eggert
Subject: [Emacs-diffs] master e2ae1c5 08/14: Merge from origin/emacs-24
Date: Tue, 03 Mar 2015 22:56:44 +0000

branch: master
commit e2ae1c5a40e2802fcd9f5ee26b4906be97c8b878
Merge: d846236 4b0b27d
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>

    Merge from origin/emacs-24
    
    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      |    6 ++++
 doc/lispref/processes.texi |   16 ++++++----
 etc/NEWS                   |    7 ++++
 lisp/ChangeLog             |   25 +++++++++++++++
 lisp/comint.el             |    8 ++++-
 lisp/frame.el              |   26 ++++++++++++++--
 nt/ChangeLog               |   10 ++++++
 nt/cmdproxy.c              |   72 ++++++++++++++++++++++++++++++++++++++++----
 src/ChangeLog              |    7 ++++
 src/xfaces.c               |    2 +-
 10 files changed, 161 insertions(+), 18 deletions(-)

diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index f96cb26..50cc9cb 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,9 @@
+2015-03-03  Eli Zaretskii  <address@hidden>
+
+       * processes.texi (Synchronous Processes): Update documentation of
+       call-process-shell-command and process-file-shell-command.
+
+2015-03-03  Eli Zaretskii  <address@hidden>
 2015-03-03  Daniel Colascione  <address@hidden>
 
        * control.texi (Generators): Correct missing word.  Clarify which
diff --git a/doc/lispref/processes.texi b/doc/lispref/processes.texi
index 99411af..177cd68 100644
--- a/doc/lispref/processes.texi
+++ b/doc/lispref/processes.texi
@@ -503,17 +503,21 @@ address@hidden
 @c It actually uses shell-command-switch, but no need to mention that here.
 @end defun
 
address@hidden call-process-shell-command command &optional infile destination 
display &rest args
address@hidden 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
address@hidden
+The arguments are handled as in @code{call-process}.  An old calling
+convention allowed to pass any number of additional arguments after
address@hidden, which were concatenated to @var{command}; this is still
+supported, but strongly discouraged.
 @end defun
 
address@hidden process-file-shell-command command &optional infile destination 
display &rest args
address@hidden 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},
address@hidden can be executed also on remote hosts.
address@hidden can be executed also on remote hosts.  An old calling
+convention allowed to pass any number of additional arguments after
address@hidden, which were concatenated to @var{command}; this is still
+supported, but strongly discouraged.
 @end defun
 
 @defun shell-command-to-string command
diff --git a/etc/NEWS b/etc/NEWS
index ad8b6f2..a94c4ca 100644
--- 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
@@ -40,6 +44,9 @@ or by sticking with Emacs 24.4.
 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.
 
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index cd042da..69ccbfa 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,30 @@
 2015-03-03  Juri Linkov  <address@hidden>
 
+       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  <address@hidden>
+
+       * 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  <address@hidden>
+
+       * net/network-stream.el (network-stream-open-tls): Respect the
+       :end-of-capability setting.
+
+2015-03-03  Juri Linkov  <address@hidden>
+2015-03-03  Juri Linkov  <address@hidden>
+
        Revert the previous change of comint-line-beginning-position callers,
        and modify comint-line-beginning-position instead.
 
diff --git a/lisp/comint.el b/lisp/comint.el
index b14ab5b..722a42d 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -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
diff --git a/lisp/frame.el b/lisp/frame.el
index c81ee9b..94e581b 100644
--- a/lisp/frame.el
+++ b/lisp/frame.el
@@ -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.
diff --git a/nt/ChangeLog b/nt/ChangeLog
index 240f58c..cc77b18 100644
--- a/nt/ChangeLog
+++ b/nt/ChangeLog
@@ -1,3 +1,13 @@
+2015-03-03  Eli Zaretskii  <address@hidden>
+
+       * 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  <address@hidden>
 2015-02-27  Mark Laws  <address@hidden>
 
        Support daemon mode on MS-Windows (bug#19688)
diff --git a/nt/cmdproxy.c b/nt/cmdproxy.c
index faef2f8..3157a69 100644
--- a/nt/cmdproxy.c
+++ b/nt/cmdproxy.c
@@ -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
diff --git a/src/ChangeLog b/src/ChangeLog
index 5bfb180..2609ed7 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,12 @@
 2015-03-03  Eli Zaretskii  <address@hidden>
 
+       * 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  <address@hidden>
+2015-03-03  Eli Zaretskii  <address@hidden>
+
        * xdisp.c (move_it_in_display_line_to): Handle the case where the
        last character of a screen line is whitespace, and we are under
        word-wrap with overflow-newline-into-fringe turned on.
diff --git a/src/xfaces.c b/src/xfaces.c
index fcfdbc0..b269722 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]