emacs-diffs
[Top][All Lists]
Advanced

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

master 7ee3296: More Tramp code cleanup


From: Michael Albinus
Subject: master 7ee3296: More Tramp code cleanup
Date: Sun, 12 Jul 2020 09:03:03 -0400 (EDT)

branch: master
commit 7ee32966a951b2e07daf219da0f6f1eabf638a8a
Author: Michael Albinus <michael.albinus@gmx.de>
Commit: Michael Albinus <michael.albinus@gmx.de>

    More Tramp code cleanup
    
    * lisp/net/tramp.el (tramp-process-actions):
    * lisp/net/tramp-adb.el (tramp-adb-handle-file-system-info)
    (tramp-adb-handle-set-file-times)
    (tramp-adb-maybe-open-connection):
    * lisp/net/tramp-cmds.el (tramp-rename-files, tramp-rename-these-files)
    (tramp-reporter-dump-variable):
    * lisp/net/tramp-sh.el (tramp-do-file-attributes-with-stat)
    (tramp-sh-handle-file-selinux-context)
    (tramp-do-directory-files-and-attributes-with-stat)
    (tramp-sh-handle-file-name-all-completions)
    (tramp-sh-handle-write-region)
    (tramp-sh-handle-file-notify-add-watch)
    (tramp-sh-gvfs-monitor-dir-process-filter)
    (tramp-sh-inotifywait-process-filter)
    (tramp-sh-handle-file-system-info, tramp-find-executable)
    (tramp-open-shell, tramp-find-shell):
    * lisp/net/tramp-smb.el (tramp-smb-do-file-attributes-with-stat)
    (tramp-smb-handle-file-system-info):
    * lisp/net/tramp-sudoedit.el (tramp-sudoedit-handle-file-selinux-context)
    (tramp-sudoedit-handle-file-system-info): Remove superfluous
    `eval-when-compile', `concat' creates the string during byte
    compilation.  Reported by Mattias EngdegÄrd <mattiase@acm.org>.
    
    * lisp/net/tramp-adb.el (tramp-adb-prompt): Simplify.
    (tramp-adb-send-command):
    * lisp/net/tramp-gvfs.el (tramp-gvfs-dbus-string-to-byte-array):
    Use `string-match-p'.
    
    * lisp/net/tramp-sh.el (tramp-sunos-unames): New defconst.
    (tramp-find-executable, tramp-find-shell, tramp-get-remote-stat): Use it.
---
 lisp/net/tramp-adb.el      |  32 +++++-----
 lisp/net/tramp-cmds.el     |  19 +++---
 lisp/net/tramp-ftp.el      |   3 +-
 lisp/net/tramp-gvfs.el     |  11 ++--
 lisp/net/tramp-sh.el       | 147 ++++++++++++++++++++-------------------------
 lisp/net/tramp-smb.el      |  50 +++++++--------
 lisp/net/tramp-sudoedit.el |  12 ++--
 lisp/net/tramp.el          |   7 +--
 8 files changed, 123 insertions(+), 158 deletions(-)

diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el
index 7a45a90..25e4097 100644
--- a/lisp/net/tramp-adb.el
+++ b/lisp/net/tramp-adb.el
@@ -55,11 +55,10 @@ It is used for TCP/IP devices."
   "When this method name is used, forward all calls to Android Debug Bridge.")
 
 ;;;###tramp-autoload
-(defcustom tramp-adb-prompt
-  "^[[:digit:]]*|?[[:alnum:]\e;[]*@?[[:alnum:]]*[^#\\$]*[#\\$][[:space:]]"
+(defcustom tramp-adb-prompt "^[^#\\$]*[#\\$][[:space:]]"
   "Regexp used as prompt in almquist shell."
   :type 'regexp
-  :version "24.4"
+  :version "28.1"
   :group 'tramp)
 
 (eval-and-compile
@@ -229,11 +228,10 @@ ARGUMENTS to pass to the OPERATION."
        (goto-char (point-min))
        (forward-line)
        (when (looking-at
-              (eval-when-compile
-                (concat "[[:space:]]*[^[:space:]]+"
-                        "[[:space:]]+\\([[:digit:]]+\\)"
-                        "[[:space:]]+\\([[:digit:]]+\\)"
-                        "[[:space:]]+\\([[:digit:]]+\\)")))
+              (concat "[[:space:]]*[^[:space:]]+"
+                      "[[:space:]]+\\([[:digit:]]+\\)"
+                      "[[:space:]]+\\([[:digit:]]+\\)"
+                      "[[:space:]]+\\([[:digit:]]+\\)"))
          ;; The values are given as 1k numbers, so we must change
          ;; them to number of bytes.
          (list (* 1024 (string-to-number (match-string 1)))
@@ -604,10 +602,9 @@ But handle the case, if the \"test\" command is not 
available."
       ;; (introduced in POSIX.1-2008) fails.
       (tramp-adb-send-command-and-check
        v (format
-         (eval-when-compile
-           (concat "touch -d %s %s %s 2>/dev/null || "
-                   "touch -d %s %s %s 2>/dev/null || "
-                   "touch -t %s %s %s"))
+         (concat "touch -d %s %s %s 2>/dev/null || "
+                 "touch -d %s %s %s 2>/dev/null || "
+                 "touch -t %s %s %s")
          (format-time-string "%Y-%m-%dT%H:%M:%S.%NZ" time t)
          nofollow quoted-name
          (format-time-string "%Y-%m-%dT%H:%M:%S" time t)
@@ -1085,7 +1082,7 @@ This happens for Android >= 4.0."
 
 (defun tramp-adb-send-command (vec command &optional neveropen nooutput)
   "Send the COMMAND to connection VEC."
-  (if (string-match "[[:multibyte:]]" command)
+  (if (string-match-p "[[:multibyte:]]" command)
       ;; Multibyte codepoints with four bytes are not supported at
       ;; least by toybox.
       (tramp-adb-execute-adb-command vec "shell" command)
@@ -1233,11 +1230,10 @@ connection if a previous connection has died for some 
reason."
            (tramp-message vec 5 "Checking system information")
            (tramp-adb-send-command
             vec
-            (eval-when-compile
-              (concat
-               "echo \\\"`getprop ro.product.model` "
-               "`getprop ro.product.version` "
-               "`getprop ro.build.version.release`\\\"")))
+            (concat
+             "echo \\\"`getprop ro.product.model` "
+             "`getprop ro.product.version` "
+             "`getprop ro.build.version.release`\\\""))
            (let ((old-getprop
                   (tramp-get-connection-property vec "getprop" nil))
                  (new-getprop
diff --git a/lisp/net/tramp-cmds.el b/lisp/net/tramp-cmds.el
index 0ca560a..52cc186 100644
--- a/lisp/net/tramp-cmds.el
+++ b/lisp/net/tramp-cmds.el
@@ -359,9 +359,8 @@ The remote connection identified by SOURCE is flushed by
     (or (setq target (tramp-default-rename-file source))
        (tramp-user-error
         nil
-        (eval-when-compile
-          (concat "There is no target specified.  "
-                  "Check `tramp-default-rename-alist' for a proper entry.")))))
+        (concat "There is no target specified.  "
+                "Check `tramp-default-rename-alist' for a proper entry."))))
   (when (tramp-equal-remote source target)
     (tramp-user-error nil "Source and target must have different remote."))
 
@@ -448,9 +447,8 @@ For details, see `tramp-rename-files'."
         (tramp-user-error
          nil
          (substitute-command-keys
-          (eval-when-compile
-            (concat "Current buffer is not remote.  "
-                    "Consider `\\[tramp-rename-files]' instead."))))
+          (concat "Current buffer is not remote.  "
+                  "Consider `\\[tramp-rename-files]' instead.")))
        (setq target
             (when (null current-prefix-arg)
               ;; The source remote connection shall not trigger any action.
@@ -567,11 +565,10 @@ buffer in your bug report.
       ;; Remove string quotation.
       (forward-line -1)
       (when (looking-at
-            (eval-when-compile
-              (concat "\\(^.*\\)" "\""                       ;; \1 "
-                      "\\((base64-decode-string \\)" "\\\\"  ;; \2 \
-                      "\\(\".*\\)" "\\\\"                    ;; \3 \
-                      "\\(\")\\)" "\"$")))                   ;; \4 "
+            (concat "\\(^.*\\)" "\""                       ;; \1 "
+                    "\\((base64-decode-string \\)" "\\\\"  ;; \2 \
+                    "\\(\".*\\)" "\\\\"                    ;; \3 \
+                    "\\(\")\\)" "\"$"))                    ;; \4 "
        (replace-match "\\1\\2\\3\\4")
        (beginning-of-line)
        (insert " ;; Variable encoded due to non-printable characters.\n"))
diff --git a/lisp/net/tramp-ftp.el b/lisp/net/tramp-ftp.el
index 33d49aa..996a924 100644
--- a/lisp/net/tramp-ftp.el
+++ b/lisp/net/tramp-ftp.el
@@ -31,8 +31,7 @@
 (require 'tramp)
 
 ;; Pacify byte-compiler.
-(eval-when-compile
-  (require 'custom))
+(eval-when-compile (require 'custom))
 (defvar ange-ftp-ftp-name-arg)
 (defvar ange-ftp-ftp-name-res)
 (defvar ange-ftp-name-format)
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el
index 4193faa..6467d8f 100644
--- a/lisp/net/tramp-gvfs.el
+++ b/lisp/net/tramp-gvfs.el
@@ -108,8 +108,7 @@
 (require 'url-util)
 
 ;; Pacify byte-compiler.
-(eval-when-compile
-  (require 'custom))
+(eval-when-compile (require 'custom))
 
 (declare-function zeroconf-init "zeroconf")
 (declare-function zeroconf-list-service-types "zeroconf")
@@ -866,7 +865,7 @@ pass to the OPERATION."
 (defun tramp-gvfs-dbus-string-to-byte-array (string)
   "Like `dbus-string-to-byte-array' but add trailing \\0 if needed."
   (dbus-string-to-byte-array
-   (if (string-match "^(aya{sv})" tramp-gvfs-mountlocation-signature)
+   (if (string-match-p "^(aya{sv})" tramp-gvfs-mountlocation-signature)
        (concat string (string 0)) string)))
 
 (defun tramp-gvfs-dbus-byte-array-to-string (byte-array)
@@ -1288,8 +1287,7 @@ If FILE-SYSTEM is non-nil, return file system attributes."
            (if (eq id-format 'integer)
                (string-to-number
                 (or (cdr (assoc "unix::uid" attributes))
-                    (eval-when-compile
-                      (format "%s" tramp-unknown-id-integer))))
+                    (eval-when-compile (format "%s" 
tramp-unknown-id-integer))))
              (or (cdr (assoc "owner::user" attributes))
                  (cdr (assoc "unix::uid" attributes))
                  tramp-unknown-id-string)))
@@ -1297,8 +1295,7 @@ If FILE-SYSTEM is non-nil, return file system attributes."
            (if (eq id-format 'integer)
                (string-to-number
                 (or (cdr (assoc "unix::gid" attributes))
-                    (eval-when-compile
-                      (format "%s" tramp-unknown-id-integer))))
+                    (eval-when-compile (format "%s" 
tramp-unknown-id-integer))))
              (or (cdr (assoc "owner::group" attributes))
                  (cdr (assoc "unix::gid" attributes))
                  tramp-unknown-id-string)))
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 370244f..0e55d60 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -1329,13 +1329,12 @@ component is used as the target of the symlink."
   (tramp-send-command-and-read
    vec
    (format
-    (eval-when-compile
-      (concat
-       ;; Apostrophes in the stat output are masked as
-       ;; `tramp-stat-marker', in order to make a proper shell escape
-       ;; of them in file names.
-       "(%s -c '((%s%%N%s) %%h %s %s %%X %%Y %%Z %%s %s%%A%s t %%i -1)' %s |"
-       " sed -e 's/\"/\\\\\"/g' -e 's/%s/\"/g')"))
+    (concat
+     ;; Apostrophes in the stat output are masked as
+     ;; `tramp-stat-marker', in order to make a proper shell escape of
+     ;; them in file names.
+     "(%s -c '((%s%%N%s) %%h %s %s %%X %%Y %%Z %%s %s%%A%s t %%i -1)' %s |"
+     " sed -e 's/\"/\\\\\"/g' -e 's/%s/\"/g')")
     (tramp-get-remote-stat vec)
     tramp-stat-marker tramp-stat-marker
     (if (eq id-format 'integer)
@@ -1514,9 +1513,8 @@ ID-FORMAT valid values are `string' and `integer'."
   (with-parsed-tramp-file-name filename nil
     (with-tramp-file-property v localname "file-selinux-context"
       (let ((context '(nil nil nil nil))
-           (regexp (eval-when-compile
-                     (concat "\\([[:alnum:]_]+\\):" "\\([[:alnum:]_]+\\):"
-                             "\\([[:alnum:]_]+\\):" "\\([[:alnum]_]+\\)"))))
+           (regexp (concat "\\([[:alnum:]_]+\\):" "\\([[:alnum:]_]+\\):"
+                           "\\([[:alnum:]_]+\\):" "\\([[:alnum:]_]+\\)")))
        (when (and (tramp-remote-selinux-p v)
                   (tramp-send-command-and-check
                    v (format
@@ -1766,21 +1764,19 @@ ID-FORMAT valid values are `string' and `integer'."
   (tramp-send-command-and-read
    vec
    (format
-    (eval-when-compile
-      (concat
-       ;; We must care about file names with spaces, or starting with
-       ;; "-"; this would confuse xargs.  "ls -aQ" might be a
-       ;; solution, but it does not work on all remote systems.
-       ;; Therefore, we use \000 as file separator.
-       ;; `tramp-sh--quoting-style-options' do not work for file names
-       ;; with spaces piped to "xargs".
-       ;; Apostrophes in the stat output are masked as
-       ;; `tramp-stat-marker', in order to make a proper shell escape
-       ;; of them in file names.
-       "cd %s && echo \"(\"; (%s %s -a | tr '\\n\\r' '\\000\\000' | "
-       "xargs -0 %s -c "
-       "'(%s%%n%s (%s%%N%s) %%h %s %s %%X %%Y %%Z %%s %s%%A%s t %%i -1)' "
-       "-- 2>/dev/null | sed -e 's/\"/\\\\\"/g' -e 's/%s/\"/g'); echo \")\""))
+    (concat
+     ;; We must care about file names with spaces, or starting with
+     ;; "-"; this would confuse xargs.  "ls -aQ" might be a solution,
+     ;; but it does not work on all remote systems.  Therefore, we use
+     ;; \000 as file separator.  `tramp-sh--quoting-style-options' do
+     ;; not work for file names with spaces piped to "xargs".
+     ;; Apostrophes in the stat output are masked as
+     ;; `tramp-stat-marker', in order to make a proper shell escape of
+     ;; them in file names.
+     "cd %s && echo \"(\"; (%s %s -a | tr '\\n\\r' '\\000\\000' | "
+     "xargs -0 %s -c "
+     "'(%s%%n%s (%s%%N%s) %%h %s %s %%X %%Y %%Z %%s %s%%A%s t %%i -1)' "
+     "-- 2>/dev/null | sed -e 's/\"/\\\\\"/g' -e 's/%s/\"/g'); echo \")\"")
     (tramp-shell-quote-argument localname)
     (tramp-get-ls-command vec)
     ;; On systems which have no quoting style, file names with special
@@ -1821,13 +1817,12 @@ ID-FORMAT valid values are `string' and `integer'."
                  (format "tramp_perl_file_name_all_completions %s"
                          (tramp-shell-quote-argument localname)))
 
-             (format (eval-when-compile
-                       (concat
-                        "(cd %s 2>&1 && %s -a 2>/dev/null"
-                        " | while IFS= read f; do"
-                        " if %s -d \"$f\" 2>/dev/null;"
-                        " then \\echo \"$f/\"; else \\echo \"$f\"; fi; done"
-                        " && \\echo ok) || \\echo fail"))
+             (format (concat
+                      "(cd %s 2>&1 && %s -a 2>/dev/null"
+                      " | while IFS= read f; do"
+                      " if %s -d \"$f\" 2>/dev/null;"
+                      " then \\echo \"$f/\"; else \\echo \"$f\"; fi; done"
+                      " && \\echo ok) || \\echo fail")
                      (tramp-shell-quote-argument localname)
                      (tramp-get-ls-command v)
                      (tramp-get-test-command v))))
@@ -3387,9 +3382,8 @@ STDERR can also be a file name."
                                        loc-enc tmpfile t))
                          (tramp-error
                           v 'file-error
-                          (eval-when-compile
-                            (concat "Cannot write to `%s', "
-                                    "local encoding command `%s' failed"))
+                          (concat "Cannot write to `%s', "
+                                  "local encoding command `%s' failed")
                           filename loc-enc))))
 
                    ;; Send buffer into remote decoding command which
@@ -3434,9 +3428,8 @@ STDERR can also be a file name."
                             (buffer-string))))
                         (tramp-error
                          v 'file-error
-                         (eval-when-compile
-                           (concat "Couldn't write region to `%s',"
-                                   " decode using `%s' failed"))
+                         (concat "Couldn't write region to `%s',"
+                                 " decode using `%s' failed")
                          filename rem-dec)))))
 
                ;; Save exit.
@@ -3446,9 +3439,8 @@ STDERR can also be a file name."
             (t
              (tramp-error
               v 'file-error
-              (eval-when-compile
-                (concat "Method `%s' should specify both encoding and "
-                        "decoding command or an scp program"))
+              (concat "Method `%s' should specify both encoding and "
+                      "decoding command or an scp program")
               method))))
 
          ;; Make `last-coding-system-used' have the right value.
@@ -3648,13 +3640,11 @@ Fall back to normal file name handler if no Tramp 
handler exists."
              events
              (cond
               ((and (memq 'change flags) (memq 'attribute-change flags))
-               (eval-when-compile
-                 (concat "create,modify,move,moved_from,moved_to,move_self,"
-                         "delete,delete_self,attrib,ignored")))
+               (concat "create,modify,move,moved_from,moved_to,move_self,"
+                       "delete,delete_self,attrib,ignored"))
               ((memq 'change flags)
-               (eval-when-compile
-                 (concat "create,modify,move,moved_from,moved_to,move_self,"
-                         "delete,delete_self,ignored")))
+               (concat "create,modify,move,moved_from,moved_to,move_self,"
+                       "delete,delete_self,ignored"))
               ((memq 'attribute-change flags) "attrib,ignored"))
              sequence `(,command "-mq" "-e" ,events ,localname)
              ;; Make events a list of symbols.
@@ -3796,12 +3786,11 @@ Fall back to normal file name handler if no Tramp 
handler exists."
                  "ATTRIB CHANGED" "ATTRIBUTE_CHANGED" string))
 
     (while (string-match
-           (eval-when-compile
-             (concat "^[\n\r]*"
-                     "Directory Monitor Event:[\n\r]+"
-                     "Child = \\([^\n\r]+\\)[\n\r]+"
-                     "\\(Other = \\([^\n\r]+\\)[\n\r]+\\)?"
-                     "Event = \\([^[:blank:]]+\\)[\n\r]+"))
+           (concat "^[\n\r]*"
+                   "Directory Monitor Event:[\n\r]+"
+                   "Child = \\([^\n\r]+\\)[\n\r]+"
+                   "\\(Other = \\([^\n\r]+\\)[\n\r]+\\)?"
+                   "Event = \\([^[:blank:]]+\\)[\n\r]+")
            string)
       (let* ((file (match-string 1 string))
             (file1 (match-string 3 string))
@@ -3837,10 +3826,9 @@ Fall back to normal file name handler if no Tramp 
handler exists."
     (dolist (line (split-string string "[\n\r]+" 'omit))
       ;; Check, whether there is a problem.
       (unless (string-match
-              (eval-when-compile
-                (concat "^[^[:blank:]]+"
-                        "[[:blank:]]+\\([^[:blank:]]+\\)"
-                        "\\([[:blank:]]+\\([^\n\r]+\\)\\)?"))
+              (concat "^[^[:blank:]]+"
+                      "[[:blank:]]+\\([^[:blank:]]+\\)"
+                      "\\([[:blank:]]+\\([^\n\r]+\\)\\)?")
               line)
        (tramp-error proc 'file-notify-error "%s" line))
 
@@ -3876,11 +3864,10 @@ Fall back to normal file name handler if no Tramp 
handler exists."
          (goto-char (point-min))
          (forward-line)
          (when (looking-at
-                (eval-when-compile
-                  (concat "\\(?:^/[^[:space:]]*[[:space:]]\\)?"
-                          "[[:space:]]*\\([[:digit:]]+\\)"
-                          "[[:space:]]+\\([[:digit:]]+\\)"
-                          "[[:space:]]+\\([[:digit:]]+\\)")))
+                (concat "\\(?:^/[^[:space:]]*[[:space:]]\\)?"
+                        "[[:space:]]*\\([[:digit:]]+\\)"
+                        "[[:space:]]+\\([[:digit:]]+\\)"
+                        "[[:space:]]+\\([[:digit:]]+\\)"))
            (mapcar
             (lambda (d)
               (* d (tramp-get-connection-property v "df-blocksize" 0)))
@@ -3949,6 +3936,9 @@ hosts, or files, disagree."
               (tramp-shell-quote-argument v1-localname)
               (tramp-shell-quote-argument v2-localname))))))
 
+(defconst tramp-sunos-unames (regexp-opt '("SunOS 5.10" "SunOS 5.11"))
+  "Regexp to determine remote SunOS.")
+
 (defun tramp-find-executable
   (vec progname dirlist &optional ignore-tilde ignore-path)
   "Search for PROGNAME in $PATH and all directories mentioned in DIRLIST.
@@ -3970,7 +3960,7 @@ This function expects to be in the right *tramp* buffer."
       ;; therefore.
       (unless (or ignore-path
                  (string-match-p
-                  (eval-when-compile (regexp-opt '("SunOS 5.10" "SunOS 5.11")))
+                  tramp-sunos-unames
                   (tramp-get-connection-property vec "uname" "")))
        (tramp-send-command vec (format "which \\%s | wc -w" progname))
        (goto-char (point-min))
@@ -3988,12 +3978,11 @@ This function expects to be in the right *tramp* 
buffer."
            (setq dirlist (nreverse newdl))))
        (tramp-send-command
         vec
-        (format (eval-when-compile
-                  (concat "while read d; "
-                          "do if test -x $d/%s && test -f $d/%s; "
-                          "then echo tramp_executable $d/%s; "
-                          "break; fi; done <<'%s'\n"
-                          "%s\n%s"))
+        (format (concat "while read d; "
+                        "do if test -x $d/%s && test -f $d/%s; "
+                        "then echo tramp_executable $d/%s; "
+                        "break; fi; done <<'%s'\n"
+                        "%s\n%s")
                 progname progname progname
                 tramp-end-of-heredoc
                 (string-join dirlist "\n")
@@ -4146,10 +4135,9 @@ file exists and nonzero exit status otherwise."
       ;; initial probes to ensure the remote shell is usable.)
       (tramp-send-command
        vec (format
-           (eval-when-compile
-             (concat
-              "exec env TERM='%s' INSIDE_EMACS='%s,tramp:%s' "
-              "ENV=%s %s PROMPT_COMMAND='' PS1=%s PS2='' PS3='' %s %s"))
+           (concat
+            "exec env TERM='%s' INSIDE_EMACS='%s,tramp:%s' "
+            "ENV=%s %s PROMPT_COMMAND='' PS1=%s PS2='' PS3='' %s %s")
             tramp-terminal-type
             (or (getenv "INSIDE_EMACS") emacs-version) tramp-version
             (or (getenv-internal "ENV" tramp-remote-process-environment) "")
@@ -4199,8 +4187,7 @@ file exists and nonzero exit status otherwise."
                        ;; and Solaris is buggy.  We've got reports
                        ;; for "SunOS 5.10" and "SunOS 5.11" so far.
                        (string-match-p
-                        (eval-when-compile
-                          (regexp-opt '("SunOS 5.10" "SunOS 5.11")))
+                        tramp-sunos-unames
                         (tramp-get-connection-property vec "uname" "")))
 
                    (or (tramp-find-executable
@@ -4212,10 +4199,9 @@ file exists and nonzero exit status otherwise."
                            default-shell
                          (tramp-message
                           vec 2
-                          (eval-when-compile
-                            (concat
-                             "Couldn't find a remote shell which groks tilde "
-                             "expansion, using `%s'"))
+                          (concat
+                           "Couldn't find a remote shell which groks tilde "
+                           "expansion, using `%s'")
                           default-shell)))
 
                  default-shell)))
@@ -5627,8 +5613,7 @@ Nonexistent directories are removed from spec."
     ;; stat on Solaris is buggy.  We've got reports for "SunOS 5.10"
     ;; and "SunOS 5.11" so far.
     (unless (string-match-p
-            (eval-when-compile (regexp-opt '("SunOS 5.10" "SunOS 5.11")))
-            (tramp-get-connection-property vec "uname" ""))
+            tramp-sunos-unames (tramp-get-connection-property vec "uname" ""))
       (tramp-message vec 5 "Finding a suitable `stat' command")
       (let ((result (tramp-find-executable
                     vec "stat" (tramp-get-remote-path vec)))
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el
index b120516..1b6af2a 100644
--- a/lisp/net/tramp-smb.el
+++ b/lisp/net/tramp-smb.el
@@ -875,10 +875,9 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are 
completely ignored."
          (while (not (eobp))
            (cond
             ((looking-at
-              (eval-when-compile
-                (concat
-                 "Size:\\s-+\\([[:digit:]]+\\)\\s-+"
-                 "Blocks:\\s-+[[:digit:]]+\\s-+\\(\\w+\\)")))
+              (concat
+               "Size:\\s-+\\([[:digit:]]+\\)\\s-+"
+               "Blocks:\\s-+[[:digit:]]+\\s-+\\(\\w+\\)"))
              (setq size (string-to-number (match-string 1))
                    id (if (string-equal "directory" (match-string 2)) t
                         (if (string-equal "symbolic" (match-string 2)) ""))))
@@ -887,22 +886,20 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are 
completely ignored."
              (setq inode (string-to-number (match-string 1))
                    link (string-to-number (match-string 2))))
             ((looking-at
-              (eval-when-compile
-                (concat
-                 "Access:\\s-+([[:digit:]]+/\\(\\S-+\\))\\s-+"
-                 "Uid:\\s-+\\([[:digit:]]+\\)\\s-+"
-                 "Gid:\\s-+\\([[:digit:]]+\\)")))
+              (concat
+               "Access:\\s-+([[:digit:]]+/\\(\\S-+\\))\\s-+"
+               "Uid:\\s-+\\([[:digit:]]+\\)\\s-+"
+               "Gid:\\s-+\\([[:digit:]]+\\)"))
              (setq mode (match-string 1)
                    uid (if (equal id-format 'string) (match-string 2)
                          (string-to-number (match-string 2)))
                    gid (if (equal id-format 'string) (match-string 3)
                          (string-to-number (match-string 3)))))
             ((looking-at
-              (eval-when-compile
-                (concat
-                 "Access:\\s-+"
-                 
"\\([[:digit:]]+\\)-\\([[:digit:]]+\\)-\\([[:digit:]]+\\)\\s-+"
-                 "\\([[:digit:]]+\\):\\([[:digit:]]+\\):\\([[:digit:]]+\\)")))
+              (concat
+               "Access:\\s-+"
+               "\\([[:digit:]]+\\)-\\([[:digit:]]+\\)-\\([[:digit:]]+\\)\\s-+"
+               "\\([[:digit:]]+\\):\\([[:digit:]]+\\):\\([[:digit:]]+\\)"))
              (setq atime
                    (encode-time
                     (string-to-number (match-string 6)) ;; sec
@@ -912,11 +909,10 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are 
completely ignored."
                     (string-to-number (match-string 2)) ;; month
                     (string-to-number (match-string 1))))) ;; year
             ((looking-at
-              (eval-when-compile
-                (concat
-                 "Modify:\\s-+"
-                 
"\\([[:digit:]]+\\)-\\([[:digit:]]+\\)-\\([[:digit:]]+\\)\\s-+"
-                 "\\([[:digit:]]+\\):\\([[:digit:]]+\\):\\([[:digit:]]+\\)")))
+              (concat
+               "Modify:\\s-+"
+               "\\([[:digit:]]+\\)-\\([[:digit:]]+\\)-\\([[:digit:]]+\\)\\s-+"
+               "\\([[:digit:]]+\\):\\([[:digit:]]+\\):\\([[:digit:]]+\\)"))
              (setq mtime
                    (encode-time
                     (string-to-number (match-string 6)) ;; sec
@@ -926,11 +922,10 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are 
completely ignored."
                     (string-to-number (match-string 2)) ;; month
                     (string-to-number (match-string 1))))) ;; year
             ((looking-at
-              (eval-when-compile
-                (concat
-                 "Change:\\s-+"
-                 
"\\([[:digit:]]+\\)-\\([[:digit:]]+\\)-\\([[:digit:]]+\\)\\s-+"
-                 "\\([[:digit:]]+\\):\\([[:digit:]]+\\):\\([[:digit:]]+\\)")))
+              (concat
+               "Change:\\s-+"
+               "\\([[:digit:]]+\\)-\\([[:digit:]]+\\)-\\([[:digit:]]+\\)\\s-+"
+               "\\([[:digit:]]+\\):\\([[:digit:]]+\\):\\([[:digit:]]+\\)"))
              (setq ctime
                    (encode-time
                     (string-to-number (match-string 6)) ;; sec
@@ -1006,10 +1001,9 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are 
completely ignored."
            (goto-char (point-min))
            (forward-line)
            (when (looking-at
-                  (eval-when-compile
-                    (concat "[[:space:]]*\\([[:digit:]]+\\)"
-                            " blocks of size \\([[:digit:]]+\\)"
-                            "\\. \\([[:digit:]]+\\) blocks available")))
+                  (concat "[[:space:]]*\\([[:digit:]]+\\)"
+                          " blocks of size \\([[:digit:]]+\\)"
+                          "\\. \\([[:digit:]]+\\) blocks available"))
              (setq blocksize (string-to-number (match-string 2))
                    total (* blocksize (string-to-number (match-string 1)))
                    avail (* blocksize (string-to-number (match-string 3)))))
diff --git a/lisp/net/tramp-sudoedit.el b/lisp/net/tramp-sudoedit.el
index 29d419e..98727dc 100644
--- a/lisp/net/tramp-sudoedit.el
+++ b/lisp/net/tramp-sudoedit.el
@@ -488,9 +488,8 @@ the result will be a local, non-Tramp, file name."
   (with-parsed-tramp-file-name filename nil
     (with-tramp-file-property v localname "file-selinux-context"
       (let ((context '(nil nil nil nil))
-           (regexp (eval-when-compile
-                     (concat "\\([[:alnum:]_]+\\):" "\\([[:alnum:]_]+\\):"
-                             "\\([[:alnum:]_]+\\):" "\\([[:alnum:]_]+\\)"))))
+           (regexp (concat "\\([[:alnum:]_]+\\):" "\\([[:alnum:]_]+\\):"
+                           "\\([[:alnum:]_]+\\):" "\\([[:alnum:]_]+\\)")))
        (when (and (tramp-sudoedit-remote-selinux-p v)
                   (tramp-sudoedit-send-command
                    v "ls" "-d" "-Z"
@@ -515,10 +514,9 @@ the result will be a local, non-Tramp, file name."
          (goto-char (point-min))
          (forward-line)
          (when (looking-at
-                (eval-when-compile
-                  (concat "[[:space:]]*\\([[:digit:]]+\\)"
-                          "[[:space:]]+\\([[:digit:]]+\\)"
-                          "[[:space:]]+\\([[:digit:]]+\\)")))
+                (concat "[[:space:]]*\\([[:digit:]]+\\)"
+                        "[[:space:]]+\\([[:digit:]]+\\)"
+                        "[[:space:]]+\\([[:digit:]]+\\)"))
            (list (string-to-number (match-string 1))
                  ;; The second value is the used size.  We need the
                  ;; free size.
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 1e7f2b5..cd35e3f 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -4225,10 +4225,9 @@ performed successfully.  Any other value means an error."
              (tramp-get-connection-buffer vec)))
            ((eq exit 'process-died)
              (substitute-command-keys
-             (eval-when-compile
-               (concat
-                "Tramp failed to connect.  If this happens repeatedly, try\n"
-                "    `\\[tramp-cleanup-this-connection]'"))))
+             (concat
+              "Tramp failed to connect.  If this happens repeatedly, try\n"
+              "    `\\[tramp-cleanup-this-connection]'")))
            ((eq exit 'timeout)
             (format-message
              "Timeout reached, see buffer `%s' for details"



reply via email to

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