From 7b5290da89e927ba01ac51e1eaaffd828503285f Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 24 Aug 2015 17:59:12 -0700 Subject: Tramp diagnostics as per ‘text-quoting-style’ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * lisp/net/tramp-adb.el (tramp-adb-handle-file-truename) (tramp-adb-get-ls-command, tramp-adb-handle-make-directory) (tramp-adb-handle-delete-directory) (tramp-adb-handle-delete-file) (tramp-adb-handle-file-local-copy) (tramp-adb-handle-write-region, tramp-adb-handle-copy-file) (tramp-adb-send-command-and-check, tramp-adb-wait-for-output) (tramp-adb-maybe-open-connection): * lisp/net/tramp-cache.el: * lisp/net/tramp-compat.el (tramp-compat-temporary-file-directory) (tramp-compat-octal-to-decimal) (tramp-compat-coding-system-change-eol-conversion): * lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler) (tramp-gvfs-do-copy-or-rename-file) (tramp-gvfs-handle-delete-directory) (tramp-gvfs-handle-delete-file) (tramp-gvfs-handle-expand-file-name) (tramp-gvfs-handle-file-local-copy) (tramp-gvfs-handle-file-notify-add-watch) (tramp-gvfs-handle-make-directory) (tramp-gvfs-handle-write-region, tramp-gvfs-url-file-name): * lisp/net/tramp-gw.el (tramp-gw-gw-proc-sentinel) (tramp-gw-aux-proc-sentinel, tramp-gw-open-connection): * lisp/net/tramp-sh.el (tramp-sh-handle-file-truename) (tramp-sh-handle-set-visited-file-modtime) (tramp-sh-handle-set-file-modes) (tramp-sh-handle-file-name-all-completions) (tramp-sh-handle-add-name-to-file, tramp-do-copy-or-rename-file) (tramp-do-copy-or-rename-file-directly) (tramp-do-copy-or-rename-file-out-of-band) (tramp-sh-handle-make-directory) (tramp-sh-handle-delete-directory, tramp-sh-handle-delete-file) (tramp-sh-handle-insert-directory, tramp-process-sentinel) (tramp-sh-handle-start-file-process) (tramp-sh-handle-file-local-copy) (tramp-sh-handle-write-region, tramp-sh-handle-vc-registered) (tramp-sh-handle-file-notify-add-watch, tramp-maybe-send-script) (tramp-find-file-exists-command, tramp-open-shell) (tramp-find-shell) (tramp-open-connection-setup-interactive-shell) (tramp-find-inline-encoding, tramp-find-inline-compress) (tramp-compute-multi-hops, tramp-maybe-open-connection) (tramp-wait-for-output, tramp-send-command-and-check) (tramp-send-command-and-read, tramp-get-remote-path) (tramp-get-ls-command, tramp-get-ls-command-with-dired) (tramp-get-ls-command-with-quoting-style) (tramp-get-test-command, tramp-get-remote-ln) (tramp-get-remote-perl, tramp-get-remote-stat) (tramp-get-remote-readlink, tramp-get-remote-trash) (tramp-get-remote-touch, tramp-get-remote-gvfs-monitor-dir) (tramp-get-remote-inotifywait, tramp-get-remote-id) (tramp-get-remote-python): * lisp/net/tramp-smb.el (tramp-smb-errors) (tramp-smb-handle-add-name-to-file, tramp-smb-handle-copy-file) (tramp-smb-handle-delete-directory) (tramp-smb-handle-delete-file) (tramp-smb-handle-file-local-copy) (tramp-smb-handle-make-directory) (tramp-smb-handle-make-directory-internal) (tramp-smb-handle-make-symbolic-link) (tramp-smb-handle-rename-file, tramp-smb-handle-set-file-acl) (tramp-smb-handle-set-file-modes) (tramp-smb-handle-write-region, tramp-smb-get-file-entries): * lisp/net/tramp.el (tramp-debug-message, tramp-error) (tramp-process-actions): Generate diagnostics according to ‘text-quoting-style’, by using curved quotes in format strings and ‘format-message’ when appropriate. * lisp/net/tramp-compat.el (format-message): Define a replacement, if it’s an older version of Emacs that doesn’t have it already. --- lisp/net/tramp-adb.el | 45 +++++------ lisp/net/tramp-cache.el | 2 +- lisp/net/tramp-compat.el | 30 ++++++-- lisp/net/tramp-gvfs.el | 22 +++--- lisp/net/tramp-gw.el | 8 +- lisp/net/tramp-sh.el | 196 ++++++++++++++++++++++++----------------------- lisp/net/tramp-smb.el | 36 ++++----- lisp/net/tramp.el | 10 +-- 8 files changed, 185 insertions(+), 164 deletions(-) diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el index 746bd67508..9ef78a03fd 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el @@ -258,7 +258,7 @@ pass to the OPERATION." method user host (with-tramp-file-property v localname "file-truename" (let ((result nil)) ; result steps in reverse order - (tramp-message v 4 "Finding true name for `%s'" filename) + (tramp-message v 4 "Finding true name for ‘%s’" filename) (let* ((directory-sep-char ?/) (steps (tramp-compat-split-string localname "/")) (localnamedir (tramp-run-real-handler @@ -290,9 +290,9 @@ pass to the OPERATION." (list thisstep)) "/"))))) (cond ((string= "." thisstep) - (tramp-message v 5 "Ignoring step `.'")) + (tramp-message v 5 "Ignoring step ‘.’")) ((string= ".." thisstep) - (tramp-message v 5 "Processing step `..'") + (tramp-message v 5 "Processing step ‘..’") (pop result)) ((stringp symlink-target) ;; It's a symlink, follow it. @@ -307,7 +307,7 @@ pass to the OPERATION." (unless (tramp-equal-remote filename symlink-target) (tramp-error v 'file-error - "Symlink target `%s' on wrong host" symlink-target)) + "Symlink target ‘%s’ on wrong host" symlink-target)) (setq symlink-target localname)) (setq steps (append (tramp-compat-split-string @@ -330,7 +330,7 @@ pass to the OPERATION." (not (string= (substring result -1) "/")))) (setq result (concat result "/")))) - (tramp-message v 4 "True name of `%s' is `%s'" localname result) + (tramp-message v 4 "True name of ‘%s’ is ‘%s’" localname result) result)))) ;; Preserve trailing "/". @@ -433,7 +433,7 @@ pass to the OPERATION." (defun tramp-adb-get-ls-command (vec) (with-tramp-connection-property vec "ls" - (tramp-message vec 5 "Finding a suitable `ls' command") + (tramp-message vec 5 "Finding a suitable ‘ls’ command") (if (tramp-adb-send-command-and-check vec "ls --color=never -al /dev/null") ;; On CyanogenMod based system BusyBox is used and "ls" output ;; coloring is enabled by default. So we try to disable it @@ -514,7 +514,7 @@ Emacs dired can't find files." (make-directory par parents)))) (tramp-adb-barf-unless-okay v (format "mkdir %s" (tramp-shell-quote-argument localname)) - "Couldn't make directory %s" dir) + "Couldn’t make directory %s" dir) (tramp-flush-file-property v (file-name-directory localname)) (tramp-flush-directory-property v localname))) @@ -528,7 +528,7 @@ Emacs dired can't find files." v (format "%s %s" (if recursive "rm -r" "rmdir") (tramp-shell-quote-argument localname)) - "Couldn't delete %s" directory))) + "Couldn’t delete %s" directory))) (defun tramp-adb-handle-delete-file (filename &optional _trash) "Like `delete-file' for Tramp files." @@ -538,7 +538,7 @@ Emacs dired can't find files." (tramp-flush-file-property v localname) (tramp-adb-barf-unless-okay v (format "rm %s" (tramp-shell-quote-argument localname)) - "Couldn't delete %s" filename))) + "Couldn’t delete %s" filename))) (defun tramp-adb-handle-file-name-all-completions (filename directory) "Like `file-name-all-completions' for Tramp files." @@ -571,7 +571,7 @@ Emacs dired can't find files." (unless (file-exists-p (file-truename filename)) (tramp-error v 'file-error - "Cannot make local copy of non-existing file `%s'" filename)) + "Cannot make local copy of non-existing file ‘%s’" filename)) (let ((tmpfile (tramp-compat-make-temp-file filename))) (with-tramp-progress-reporter v 3 (format "Fetching %s to tmp file %s" filename tmpfile) @@ -580,7 +580,7 @@ Emacs dired can't find files." (not (file-exists-p tmpfile))) (ignore-errors (delete-file tmpfile)) (tramp-error - v 'file-error "Cannot make local copy of file `%s'" filename)) + v 'file-error "Cannot make local copy of file ‘%s’" filename)) (set-file-modes tmpfile (logior (or (file-modes filename) 0) @@ -635,10 +635,11 @@ But handle the case, if the \"test\" command is not available." 'write-region (list start end tmpfile append 'no-message lockname confirm)) (with-tramp-progress-reporter - v 3 (format "Moving tmp file `%s' to `%s'" tmpfile filename) + v 3 (format-message + "Moving tmp file ‘%s’ to ‘%s’" tmpfile filename) (unwind-protect (when (tramp-adb-execute-adb-command v "push" tmpfile localname) - (tramp-error v 'file-error "Cannot write: `%s'" filename)) + (tramp-error v 'file-error "Cannot write: ‘%s’" filename)) (delete-file tmpfile))) (when (or (eq visit t) (stringp visit)) @@ -647,7 +648,7 @@ But handle the case, if the \"test\" command is not available." (unless (equal curbuf (current-buffer)) (tramp-error v 'file-error - "Buffer has changed from `%s' to `%s'" curbuf (current-buffer)))))) + "Buffer has changed from ‘%s’ to ‘%s’" curbuf (current-buffer)))))) (defun tramp-adb-handle-set-file-modes (filename mode) "Like `set-file-modes' for Tramp files." @@ -712,7 +713,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." (tramp-flush-file-property v localname) (when (tramp-adb-execute-adb-command v "push" filename localname) (tramp-error - v 'file-error "Cannot copy `%s' `%s'" filename newname)))))) + v 'file-error "Cannot copy ‘%s’ ‘%s’" filename newname)))))) ;; KEEP-DATE handling. (when keep-date @@ -1113,7 +1114,7 @@ the exit status is not equal 0, and t otherwise." (goto-char (point-max)) (unless (re-search-backward "tramp_exit_status [0-9]+" nil t) (tramp-error - vec 'file-error "Couldn't find exit status of `%s'" command)) + vec 'file-error "Couldn’t find exit status of ‘%s’" command)) (skip-chars-forward "^ ") (prog1 (zerop (read (current-buffer))) @@ -1130,7 +1131,7 @@ FMT and ARGS are passed to `error'." "Wait for output from remote command." (unless (buffer-live-p (process-buffer proc)) (delete-process proc) - (tramp-error proc 'file-error "Process `%s' not available, try again" proc)) + (tramp-error proc 'file-error "Process ‘%s’ not available, try again" proc)) (with-current-buffer (process-buffer proc) (if (tramp-wait-for-regexp proc timeout tramp-adb-prompt) (let (buffer-read-only) @@ -1150,11 +1151,11 @@ FMT and ARGS are passed to `error'." (if timeout (tramp-error proc 'file-error - "[[Remote adb prompt `%s' not found in %d secs]]" + "[[Remote adb prompt ‘%s’ not found in %d secs]]" tramp-adb-prompt timeout) (tramp-error proc 'file-error - "[[Remote prompt `%s' not found]]" tramp-adb-prompt))))) + "[[Remote prompt ‘%s’ not found]]" tramp-adb-prompt))))) (defun tramp-adb-maybe-open-connection (vec) "Maybe open a connection VEC. @@ -1177,7 +1178,7 @@ connection if a previous connection has died for some reason." ;; use a connection property, because we have not checked yet ;; whether it is still the same device. (when (and user (not (tramp-get-file-property vec "" "su-command-p" t))) - (tramp-error vec 'file-error "Cannot switch to user `%s'" user)) + (tramp-error vec 'file-error "Cannot switch to user ‘%s’" user)) (unless (and p (processp p) (memq (process-status p) '(run open))) @@ -1223,7 +1224,7 @@ connection if a previous connection has died for some reason." (not (string-equal old-getprop new-getprop))) (tramp-message vec 3 - "Connection reset, because remote host changed from `%s' to `%s'" + "Connection reset, because remote host changed from ‘%s’ to ‘%s’" old-getprop new-getprop) (tramp-cleanup-connection vec t) (tramp-adb-maybe-open-connection vec))) @@ -1235,7 +1236,7 @@ connection if a previous connection has died for some reason." (delete-process p) (tramp-set-file-property vec "" "su-command-p" nil) (tramp-error - vec 'file-error "Cannot switch to user `%s'" user))) + vec 'file-error "Cannot switch to user ‘%s’" user))) ;; Set "remote-path" connection property. This is needed ;; for eshell. diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el index f13eee2056..c1d6a284a7 100644 --- a/lisp/net/tramp-cache.el +++ b/lisp/net/tramp-cache.el @@ -440,7 +440,7 @@ for all methods. Resulting data are derived from connection history." (clrhash tramp-cache-data)) (error ;; File is corrupted. - (message "Tramp persistency file '%s' is corrupted: %s" + (message "Tramp persistency file ‘%s’ is corrupted: %s" tramp-persistency-file-name (error-message-string err)) (clrhash tramp-cache-data)))) diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el index e68c81cfa7..48eda2fd17 100644 --- a/lisp/net/tramp-compat.el +++ b/lisp/net/tramp-compat.el @@ -236,8 +236,8 @@ this is the function `temp-directory'." ((let ((d (getenv "TMPDIR"))) (and d (file-directory-p d))) (file-name-as-directory (getenv "TMPDIR"))) ((file-exists-p "c:/temp") (file-name-as-directory "c:/temp")) - (t (message (concat "Neither `temporary-file-directory' nor " - "`temp-directory' is defined -- using /tmp.")) + (t (message (concat "Neither ‘temporary-file-directory’ nor " + "‘temp-directory’ is defined -- using /tmp.")) (file-name-as-directory "/tmp"))))) ;; `make-temp-file' exists in Emacs only. On XEmacs, we use our own @@ -294,7 +294,7 @@ Not actually used. Use `(format \"%o\" i)' instead?" (let ((x (or ostr ""))) ;; `save-match' is in `tramp-mode-string-to-int' which calls this. (unless (string-match "\\`[0-7]*\\'" x) - (error "Non-octal junk in string `%s'" x)) + (error "Non-octal junk in string ‘%s’" x)) (string-to-number ostr 8))) ;; ID-FORMAT does not exist in XEmacs. @@ -534,10 +534,10 @@ EOL-TYPE can be one of `dos', `unix', or `mac'." ((eq eol-type 'unix) 'lf) ((eq eol-type 'mac) 'cr) (t - (error "Unknown EOL-TYPE `%s', must be %s" - eol-type - "`dos', `unix', or `mac'"))))) - (t (error "Can't change EOL conversion -- is MULE missing?")))) + (error + "Unknown EOL-TYPE ‘%s’, must be ‘dos’, ‘unix’, or ‘mac’" + eol-type))))) + (t (error "Can’t change EOL conversion -- is MULE missing?")))) ;; `replace-regexp-in-string' does not exist in XEmacs. ;; Implementation is taken from Emacs 24. @@ -595,6 +595,22 @@ and replace a sub-expression, e.g. (unless (fboundp 'default-toplevel-value) (defalias 'default-toplevel-value 'symbol-value)) +;; ‘format-message’ is new in Emacs 25, and does not exist in XEmacs. +;; The substitute implementation always uses grave quoting style, for +;; compatibility with older Emacs. +(unless (fboundp 'format-message) + (defalias 'format-message + (lambda (format-string &rest args) + (let ((restyled-format-string + (let ((start (string-match "[‘’]" format-string))) + (if start + (tramp-compat-replace-regexp-in-string + "[‘’]" + (lambda (match) (if (string-equal match "‘") "`" "'")) + format-string t t nil start) + format-string)))) + (apply #'format restyled-format-string args))))) + (add-hook 'tramp-unload-hook (lambda () (unload-feature 'tramp-loaddefs 'force) diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index 4dfdcd76e6..d96fb3e3aa 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el @@ -494,7 +494,7 @@ Operations not mentioned here will be handled by the default Emacs primitives.") First arg specifies the OPERATION, second arg is a list of arguments to pass to the OPERATION." (unless tramp-gvfs-enabled - (tramp-user-error nil "Package `tramp-gvfs' not supported")) + (tramp-user-error nil "Package ‘tramp-gvfs’ not supported")) (let ((fn (assoc operation tramp-gvfs-file-name-handler-alist))) (if fn (save-match-data (apply (cdr fn) args)) @@ -600,7 +600,7 @@ This function is invoked by `tramp-gvfs-handle-copy-file' and of `copy' and `rename'. FILENAME and NEWNAME must be absolute file names." (unless (memq op '(copy rename)) - (error "Unknown operation `%s', must be `copy' or `rename'" op)) + (error "Unknown operation ‘%s’, must be ‘copy’ or ‘rename’" op)) (let ((t1 (tramp-tramp-file-p filename)) (t2 (tramp-tramp-file-p newname)) @@ -657,7 +657,7 @@ file names." (goto-char (point-min)) (tramp-error-with-buffer nil v 'file-error - "%s failed, see buffer `%s' for details." + "%s failed, see buffer ‘%s’ for details." msg-operation (buffer-name))) ;; Some WebDAV server, like the one from QNAP, do not @@ -724,7 +724,7 @@ file names." (with-current-buffer (tramp-get-connection-buffer v) (goto-char (point-min)) (tramp-error-with-buffer - nil v 'file-error "Couldn't delete %s" directory))))) + nil v 'file-error "Couldn’t delete %s" directory))))) (defun tramp-gvfs-handle-delete-file (filename &optional trash) "Like `delete-file' for Tramp files." @@ -739,7 +739,7 @@ file names." (with-current-buffer (tramp-get-connection-buffer v) (goto-char (point-min)) (tramp-error-with-buffer - nil v 'file-error "Couldn't delete %s" filename))))) + nil v 'file-error "Couldn’t delete %s" filename))))) (defun tramp-gvfs-handle-expand-file-name (name &optional dir) "Like `expand-file-name' for Tramp files." @@ -765,7 +765,7 @@ file names." (when (string-match "\\`\\(~[^/]*\\)\\(.*\\)\\'" localname) (tramp-error v 'file-error - "Cannot expand tilde in file `%s'" name)) + "Cannot expand tilde in file ‘%s’" name)) (unless (tramp-run-real-handler 'file-name-absolute-p (list localname)) (setq localname (concat "/" localname))) ;; We do not pass "/..". @@ -927,7 +927,7 @@ file names." (unless (file-exists-p filename) (tramp-error v 'file-error - "Cannot make local copy of non-existing file `%s'" filename)) + "Cannot make local copy of non-existing file ‘%s’" filename)) (copy-file filename tmpfile t t) tmpfile))) @@ -1013,7 +1013,7 @@ file names." (tramp-error v 'file-notify-error "gvfs-monitor-file failed to start") (tramp-message - v 6 "Run `%s', %S" (mapconcat 'identity (process-command p) " ") p) + v 6 "Run ‘%s’, %S" (mapconcat 'identity (process-command p) " ") p) (tramp-set-connection-property p "vector" v) (tramp-compat-set-process-query-on-exit-flag p nil) (set-process-filter p 'tramp-gvfs-file-gvfs-monitor-file-process-filter) @@ -1094,7 +1094,7 @@ file names." ;; Just do it. (unless (tramp-gvfs-send-command v "gvfs-mkdir" (tramp-gvfs-url-file-name dir)) - (tramp-error v 'file-error "Couldn't make directory %s" dir)))))) + (tramp-error v 'file-error "Couldn’t make directory %s" dir)))))) (defun tramp-gvfs-handle-rename-file (filename newname &optional ok-if-already-exists) @@ -1136,7 +1136,7 @@ file names." (error (delete-file tmpfile) (tramp-error - v 'file-error "Couldn't write region to `%s'" filename)))) + v 'file-error "Couldn’t write region to ‘%s’" filename)))) (tramp-flush-file-property v (file-name-directory localname)) (tramp-flush-file-property v localname) @@ -1175,7 +1175,7 @@ file names." (url-hexify-string (file-truename filename)) nil nil t)))) (when (tramp-tramp-file-p filename) (with-parsed-tramp-file-name filename nil - (tramp-message v 10 "remote file `%s' is URL `%s'" filename result))) + (tramp-message v 10 "remote file ‘%s’ is URL ‘%s’" filename result))) result)) (defun tramp-gvfs-object-path (filename) diff --git a/lisp/net/tramp-gw.el b/lisp/net/tramp-gw.el index 5e22f6a3b5..8f1909ae57 100644 --- a/lisp/net/tramp-gw.el +++ b/lisp/net/tramp-gw.el @@ -95,7 +95,7 @@ "Delete auxiliary process when we are deleted." (unless (memq (process-status proc) '(run open)) (tramp-message - tramp-gw-vector 4 "Deleting auxiliary process `%s'" tramp-gw-gw-proc) + tramp-gw-vector 4 "Deleting auxiliary process ‘%s’" tramp-gw-gw-proc) (let* ((tramp-verbose 0) (p (tramp-get-connection-property proc "process" nil))) (when (processp p) (delete-process p))))) @@ -106,7 +106,7 @@ ;; A new process has been spawned from `tramp-gw-aux-proc'. (tramp-message tramp-gw-vector 4 - "Opening auxiliary process `%s', speaking with process `%s'" + "Opening auxiliary process ‘%s’, speaking with process ‘%s’" proc tramp-gw-gw-proc) (tramp-compat-set-process-query-on-exit-flag proc nil) ;; We don't want debug messages, because the corresponding debug @@ -160,7 +160,7 @@ instead of the host name declared in TARGET-VEC." (set-process-sentinel tramp-gw-aux-proc 'tramp-gw-aux-proc-sentinel) (tramp-compat-set-process-query-on-exit-flag tramp-gw-aux-proc nil) (tramp-message - vec 4 "Opening auxiliary process `%s', listening on port %d" + vec 4 "Opening auxiliary process ‘%s’, listening on port %d" tramp-gw-aux-proc (process-contact tramp-gw-aux-proc :service)))) (let* ((gw-method @@ -206,7 +206,7 @@ instead of the host name declared in TARGET-VEC." (set-process-coding-system tramp-gw-gw-proc 'binary 'binary) (tramp-compat-set-process-query-on-exit-flag tramp-gw-gw-proc nil) (tramp-message - vec 4 "Opened %s process `%s'" + vec 4 "Opened %s process ‘%s’" (case gw-method ('tunnel "HTTP tunnel") ('socks "SOCKS")) tramp-gw-gw-proc) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 90b84b2795..b12c417f72 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -1046,7 +1046,7 @@ target of the symlink differ." method user host (with-tramp-file-property v localname "file-truename" (let ((result nil)) ; result steps in reverse order - (tramp-message v 4 "Finding true name for `%s'" filename) + (tramp-message v 4 "Finding true name for ‘%s’" filename) (cond ;; Use GNU readlink --canonicalize-missing where available. ((tramp-get-remote-readlink v) @@ -1104,9 +1104,9 @@ target of the symlink differ." (list thisstep)) "/"))))) (cond ((string= "." thisstep) - (tramp-message v 5 "Ignoring step `.'")) + (tramp-message v 5 "Ignoring step ‘.’")) ((string= ".." thisstep) - (tramp-message v 5 "Processing step `..'") + (tramp-message v 5 "Processing step ‘..’") (pop result)) ((stringp symlink-target) ;; It's a symlink, follow it. @@ -1122,7 +1122,7 @@ target of the symlink differ." (unless (tramp-equal-remote filename symlink-target) (tramp-error v 'file-error - "Symlink target `%s' on wrong host" + "Symlink target ‘%s’ on wrong host" symlink-target)) (setq symlink-target localname)) (setq steps @@ -1147,7 +1147,7 @@ target of the symlink differ." (not (string= (substring result -1) "/")))) (setq result (concat result "/")))))) - (tramp-message v 4 "True name of `%s' is `%s'" localname result) + (tramp-message v 4 "True name of ‘%s’ is ‘%s’" localname result) result)))) ;; Preserve trailing "/". @@ -1333,7 +1333,7 @@ target of the symlink differ." (defun tramp-sh-handle-set-visited-file-modtime (&optional time-list) "Like `set-visited-file-modtime' for Tramp files." (unless (buffer-file-name) - (error "Can't set-visited-file-modtime: buffer `%s' not visiting a file" + (error "Can’t set-visited-file-modtime: buffer ‘%s’ not visiting a file" (buffer-name))) (if time-list (tramp-run-real-handler 'set-visited-file-modtime (list time-list)) @@ -1427,7 +1427,7 @@ of." (format "chmod %s %s" (tramp-compat-decimal-to-octal mode) (tramp-shell-quote-argument localname)) - "Error while changing file's mode %s" filename))) + "Error while changing file’s mode %s" filename))) (defun tramp-sh-handle-set-file-times (filename &optional time) "Like `set-file-times' for Tramp files." @@ -1901,7 +1901,7 @@ be non-negative integers." (tramp-error v 'file-error "\ -tramp-sh-handle-file-name-all-completions: internal error accessing `%s': `%s'" +tramp-sh-handle-file-name-all-completions: internal error accessing ‘%s’: ‘%s’" (tramp-shell-quote-argument localname) (buffer-string)))) (while (zerop (forward-line -1)) @@ -1954,7 +1954,7 @@ tramp-sh-handle-file-name-all-completions: internal error accessing `%s': `%s'" (format "%s %s %s" ln (tramp-shell-quote-argument v1-localname) (tramp-shell-quote-argument v2-localname)) - "error with add-name-to-file, see buffer `%s' for details" + "error with add-name-to-file, see buffer ‘%s’ for details" (buffer-name)))))) (defun tramp-sh-handle-copy-file @@ -2059,7 +2059,7 @@ This function is invoked by `tramp-sh-handle-copy-file' and of `copy' and `rename'. FILENAME and NEWNAME must be absolute file names." (unless (memq op '(copy rename)) - (error "Unknown operation `%s', must be `copy' or `rename'" op)) + (error "Unknown operation ‘%s’, must be ‘copy’ or ‘rename’" op)) (let ((t1 (tramp-tramp-file-p filename)) (t2 (tramp-tramp-file-p newname)) (length (nth 7 (file-attributes (file-truename filename)))) @@ -2199,7 +2199,7 @@ the uid and gid from FILENAME." ((eq op 'rename) "mv -f") (t (tramp-error v 'file-error - "Unknown operation `%s', must be `copy' or `rename'" + "Unknown operation ‘%s’, must be ‘copy’ or ‘rename’" op)))) (localname1 (if t1 @@ -2231,7 +2231,7 @@ the uid and gid from FILENAME." cmd-result) (tramp-error-with-buffer nil v 'file-error - "Copying directly failed, see buffer `%s' for details." + "Copying directly failed, see buffer ‘%s’ for details." (buffer-name))))) ;; We are on the local host. @@ -2284,7 +2284,7 @@ the uid and gid from FILENAME." "%s %s %s" cmd (tramp-shell-quote-argument localname1) (tramp-shell-quote-argument tmpfile)) - "Copying directly failed, see buffer `%s' for details." + "Copying directly failed, see buffer ‘%s’ for details." (tramp-get-buffer v)) ;; We must change the ownership as remote user. ;; Since this does not work reliable, we also @@ -2322,7 +2322,7 @@ the uid and gid from FILENAME." "cp -f -p %s %s" (tramp-shell-quote-argument tmpfile) (tramp-shell-quote-argument localname2)) - "Copying directly failed, see buffer `%s' for details." + "Copying directly failed, see buffer ‘%s’ for details." (tramp-get-buffer v))) (t1 (tramp-run-real-handler @@ -2493,7 +2493,7 @@ The method used must be an out-of-band method." (with-timeout (60 (tramp-error v 'file-error - "Listener process not running on remote host: `%s'" + "Listener process not running on remote host: ‘%s’" remote-copy-program)) (tramp-send-command v (format "netstat -l | grep -q :%s" listener)) (while (not (tramp-send-command-and-check v nil)) @@ -2553,14 +2553,14 @@ The method used must be an out-of-band method." (re-search-backward "tramp_exit_status [0-9]+" nil t) (tramp-error orig-vec 'file-error - "Couldn't find exit status of `%s'" + "Couldn’t find exit status of ‘%s’" (mapconcat 'identity (process-command p) " "))) (skip-chars-forward "^ ") (unless (zerop (read (current-buffer))) (forward-line -1) (tramp-error orig-vec 'file-error - "Error copying: `%s'" + "Error copying: ‘%s’" (buffer-substring (point-min) (point-at-eol)))))) ;; Reset the transfer process properties. @@ -2599,7 +2599,7 @@ The method used must be an out-of-band method." v (format "%s %s" (if parents "mkdir -p" "mkdir") (tramp-shell-quote-argument localname)) - "Couldn't make directory %s" dir)))) + "Couldn’t make directory %s" dir)))) (defun tramp-sh-handle-delete-directory (directory &optional recursive) "Like `delete-directory' for Tramp files." @@ -2611,7 +2611,7 @@ The method used must be an out-of-band method." v (format "cd / && %s %s" (if recursive "rm -rf" "rmdir") (tramp-shell-quote-argument localname)) - "Couldn't delete %s" directory))) + "Couldn’t delete %s" directory))) (defun tramp-sh-handle-delete-file (filename &optional trash) "Like `delete-file' for Tramp files." @@ -2623,7 +2623,7 @@ The method used must be an out-of-band method." v (format "%s %s" (or (and trash (tramp-get-remote-trash v)) "rm -f") (tramp-shell-quote-argument localname)) - "Couldn't delete %s" filename))) + "Couldn’t delete %s" filename))) ;; Dired. @@ -2734,7 +2734,7 @@ This is like `dired-recursive-delete-directory' for Tramp files." (when wildcard (setq switches (concat switches " " wildcard))) (tramp-message - v 4 "Inserting directory `ls %s %s', wildcard %s, fulldir %s" + v 4 "Inserting directory ‘ls %s %s’, wildcard %s, fulldir %s" switches filename (if wildcard "yes" "no") (if full-directory-p "yes" "no")) ;; If `full-directory-p', we just say `ls -l FILENAME'. @@ -2753,7 +2753,7 @@ This is like `dired-recursive-delete-directory' for Tramp files." (format "cd %s" (tramp-shell-quote-argument (tramp-run-real-handler 'file-name-directory (list localname)))) - "Couldn't `cd %s'" + "Couldn’t ‘cd %s’" (tramp-shell-quote-argument (tramp-run-real-handler 'file-name-directory (list localname)))) (tramp-send-command @@ -2897,7 +2897,7 @@ the result will be a local, non-Tramp, file name." (unless (memq (process-status proc) '(run open)) (let ((vec (tramp-get-connection-property proc "vector" nil))) (when vec - (tramp-message vec 5 "Sentinel called: `%S' `%s'" proc event) + (tramp-message vec 5 "Sentinel called: ‘%S’ ‘%s’" proc event) (tramp-flush-connection-property proc) (tramp-flush-directory-property vec ""))))) @@ -3008,7 +3008,7 @@ the result will be a local, non-Tramp, file name." (tramp-get-connection-process v) 'remote-tty) (tramp-error v 'file-error - "pty association is not supported for `%s'" name)))) + "pty association is not supported for ‘%s’" name)))) (let ((p (tramp-get-connection-process v))) ;; Set query flag and process marker for this ;; process. We ignore errors, because the process @@ -3157,7 +3157,7 @@ the result will be a local, non-Tramp, file name." (unless (file-exists-p filename) (tramp-error v 'file-error - "Cannot make local copy of non-existing file `%s'" filename)) + "Cannot make local copy of non-existing file ‘%s’" filename)) (let* ((size (nth 7 (file-attributes (file-truename filename)))) (rem-enc (tramp-get-inline-coding v "remote-encoding" size)) @@ -3176,14 +3176,15 @@ the result will be a local, non-Tramp, file name." (save-excursion (with-tramp-progress-reporter v 3 - (format "Encoding remote file `%s' with `%s'" filename rem-enc) + (format-message "Encoding remote file ‘%s’ with ‘%s’" + filename rem-enc) (tramp-barf-unless-okay v (format rem-enc (tramp-shell-quote-argument localname)) "Encoding remote file failed")) (with-tramp-progress-reporter - v 3 (format "Decoding local file `%s' with `%s'" - tmpfile loc-dec) + v 3 (format-message "Decoding local file ‘%s’ with ‘%s’" + tmpfile loc-dec) (if (functionp loc-dec) ;; If local decoding is a function, we call it. ;; We must disable multibyte, because @@ -3219,7 +3220,7 @@ the result will be a local, non-Tramp, file name." ;; Oops, I don't know what to do. (t (tramp-error - v 'file-error "Wrong method specification for `%s'" method))) + v 'file-error "Wrong method specification for ‘%s’" method))) ;; Error handling. ((error quit) @@ -3390,8 +3391,9 @@ the result will be a local, non-Tramp, file name." (set-buffer-multibyte nil) ;; Use encoding function or command. (with-tramp-progress-reporter - v 3 (format "Encoding local file `%s' using `%s'" - tmpfile loc-enc) + v 3 (format-message + "Encoding local file ‘%s’ using ‘%s’" + tmpfile loc-enc) (if (functionp loc-enc) ;; The following `let' is a workaround for ;; the base64.el that comes with pgnus-0.84. @@ -3412,16 +3414,17 @@ the result will be a local, non-Tramp, file name." loc-enc tmpfile t)) (tramp-error v 'file-error - (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 ;; writes to remote file. Because this happens on ;; the remote host, we cannot use the function. (with-tramp-progress-reporter - v 3 (format "Decoding remote file `%s' using `%s'" - filename rem-dec) + v 3 (format-message + "Decoding remote file ‘%s’ using ‘%s’" + filename rem-dec) (goto-char (point-max)) (unless (bolp) (newline)) (tramp-send-command @@ -3434,7 +3437,7 @@ the result will be a local, non-Tramp, file name." tramp-end-of-heredoc)) (tramp-barf-unless-okay v nil - "Couldn't write region to `%s', decode using `%s' failed" + "Couldn’t write region to ‘%s’, decode using ‘%s’ failed" filename rem-dec) ;; When `file-precious-flag' is set, the region is ;; written to a temporary file. Check that the @@ -3457,8 +3460,8 @@ the result will be a local, non-Tramp, file name." (buffer-string)))) (tramp-error v 'file-error - (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. @@ -3468,7 +3471,7 @@ the result will be a local, non-Tramp, file name." (t (tramp-error v 'file-error - (concat "Method `%s' should specify both encoding and " + (concat "Method ‘%s’ should specify both encoding and " "decoding command or an scp program") method)))) @@ -3522,7 +3525,7 @@ the result will be a local, non-Tramp, file name." (tramp-compat-with-temp-message "" (with-parsed-tramp-file-name file nil (with-tramp-progress-reporter - v 3 (format "Checking `vc-registered' for %s" file) + v 3 (format-message "Checking ‘vc-registered’ for %s" file) ;; There could be new files, created by the vc backend. We ;; cannot reuse the old cache entries, therefore. In @@ -3682,9 +3685,9 @@ Fall back to normal file name handler if no Tramp handler exists." (if (not (processp p)) (tramp-error v 'file-notify-error - "`%s' failed to start on remote host" + "‘%s’ failed to start on remote host" (mapconcat 'identity sequence " ")) - (tramp-message v 6 "Run `%s', %S" (mapconcat 'identity sequence " ") p) + (tramp-message v 6 "Run ‘%s’, %S" (mapconcat 'identity sequence " ") p) (tramp-set-connection-property p "vector" v) (tramp-compat-set-process-query-on-exit-flag p nil) (set-process-filter p filter) @@ -3770,7 +3773,8 @@ Only send the definition if it has not already been done." (let ((scripts (tramp-get-connection-property (tramp-get-connection-process vec) "scripts" nil))) (unless (member name scripts) - (with-tramp-progress-reporter vec 5 (format "Sending script `%s'" name) + (with-tramp-progress-reporter + vec 5 (format-message "Sending script ‘%s’" name) ;; In bash, leading TABs like in `tramp-vc-registered-read-file-names' ;; could result in unwanted command expansion. Avoid this. (setq script (tramp-compat-replace-regexp-in-string @@ -3938,13 +3942,13 @@ file exists and nonzero exit status otherwise." (not (tramp-send-command-and-check vec (format "%s %s" result nonexistent)))))) (tramp-error - vec 'file-error "Couldn't find command to check if file exists")) + vec 'file-error "Couldn’t find command to check if file exists")) result)) (defun tramp-open-shell (vec shell) "Opens shell SHELL." (with-tramp-progress-reporter - vec 5 (format "Opening remote shell `%s'" shell) + vec 5 (format-message "Opening remote shell ‘%s’" shell) ;; Find arguments for this shell. (let ((alist tramp-sh-extra-args) item extra-args) @@ -4008,8 +4012,8 @@ file exists and nonzero exit status otherwise." (tramp-message vec 2 (concat - "Couldn't find a remote shell which groks tilde " - "expansion, using `%s'") + "Couldn’t find a remote shell which groks tilde " + "expansion, using ‘%s’") default-shell))) default-shell))) @@ -4017,7 +4021,7 @@ file exists and nonzero exit status otherwise." ;; Open a new shell if needed. (unless (string-equal shell default-shell) (tramp-message - vec 5 "Starting remote shell `%s' for tilde expansion" shell) + vec 5 "Starting remote shell ‘%s’ for tilde expansion" shell) (tramp-open-shell vec shell))))) ;; Utility functions. @@ -4093,7 +4097,7 @@ process to set up. VEC specifies the connection." (tramp-compat-funcall 'set-buffer-process-coding-system cs-decode cs-encode) (tramp-message - vec 5 "Setting coding system to `%s' and `%s'" cs-decode cs-encode)) + vec 5 "Setting coding system to ‘%s’ and ‘%s’" cs-decode cs-encode)) ;; Look for ^M and do something useful if found. (when (search-forward "\r" nil t) ;; We have found a ^M but cannot frob the process coding system @@ -4116,7 +4120,7 @@ process to set up. VEC specifies the connection." (when (and (stringp old-uname) (not (string-equal old-uname new-uname))) (tramp-message vec 3 - "Connection reset, because remote host changed from `%s' to `%s'" + "Connection reset, because remote host changed from ‘%s’ to ‘%s’" old-uname new-uname) ;; We want to keep the password. (tramp-cleanup-connection vec t t) @@ -4134,7 +4138,7 @@ process to set up. VEC specifies the connection." tramp-chunksize) (t (tramp-message - vec 5 "Checking remote host type for `send-process-string' bug") + vec 5 "Checking remote host type for ‘send-process-string’ bug") (if (string-match "^FreeBSD" (tramp-get-connection-property vec "uname" "")) 500 0)))) @@ -4300,17 +4304,17 @@ Goes through the list `tramp-local-coding-commands' and ;; corresponding command has to work locally. (if (not (stringp loc-enc)) (tramp-message - vec 5 "Checking local encoding function `%s'" loc-enc) + vec 5 "Checking local encoding function ‘%s’" loc-enc) (tramp-message - vec 5 "Checking local encoding command `%s' for sanity" loc-enc) + vec 5 "Checking local encoding command ‘%s’ for sanity" loc-enc) (unless (zerop (tramp-call-local-coding-command loc-enc nil nil)) (throw 'wont-work-local nil))) (if (not (stringp loc-dec)) (tramp-message - vec 5 "Checking local decoding function `%s'" loc-dec) + vec 5 "Checking local decoding function ‘%s’" loc-dec) (tramp-message - vec 5 "Checking local decoding command `%s' for sanity" loc-dec) + vec 5 "Checking local decoding command ‘%s’ for sanity" loc-dec) (unless (zerop (tramp-call-local-coding-command loc-dec nil nil)) (throw 'wont-work-local nil))) @@ -4325,7 +4329,7 @@ Goes through the list `tramp-local-coding-commands' and ;; Check the remote test command if exists. (when (stringp rem-test) (tramp-message - vec 5 "Checking remote test command `%s'" rem-test) + vec 5 "Checking remote test command ‘%s’" rem-test) (unless (tramp-send-command-and-check vec rem-test t) (throw 'wont-work-remote nil))) ;; Check if remote perl exists when necessary. @@ -4348,7 +4352,7 @@ Goes through the list `tramp-local-coding-commands' and (setq rem-enc name))) (tramp-message vec 5 - "Checking remote encoding command `%s' for sanity" rem-enc) + "Checking remote encoding command ‘%s’ for sanity" rem-enc) (unless (tramp-send-command-and-check vec (format "%s