diff options
Diffstat (limited to 'lisp/net')
-rw-r--r-- | lisp/net/tramp-adb.el | 2 | ||||
-rw-r--r-- | lisp/net/tramp-cmds.el | 8 | ||||
-rw-r--r-- | lisp/net/tramp-compat.el | 5 | ||||
-rw-r--r-- | lisp/net/tramp-gvfs.el | 9 | ||||
-rw-r--r-- | lisp/net/tramp-sh.el | 6 | ||||
-rw-r--r-- | lisp/net/tramp-smb.el | 6 | ||||
-rw-r--r-- | lisp/net/tramp.el | 28 |
7 files changed, 37 insertions, 27 deletions
diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el index 2825532c525..8bbdca795e8 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el @@ -652,6 +652,8 @@ But handle the case, if the \"test\" command is not available." (when (or (eq visit t) (stringp visit)) (set-visited-file-modtime)) + (tramp-handle-write-region-message v start end filename append visit) + (unless (equal curbuf (current-buffer)) (tramp-error v 'file-error diff --git a/lisp/net/tramp-cmds.el b/lisp/net/tramp-cmds.el index 99fc0cc7098..a11908af63e 100644 --- a/lisp/net/tramp-cmds.el +++ b/lisp/net/tramp-cmds.el @@ -247,10 +247,9 @@ buffer in your bug report. ;; Pretty print the cache. (set varsym (read (format "(%s)" (tramp-cache-print val)))) ;; There are non-7bit characters to be masked. - (when (and (boundp 'mm-7bit-chars) - (stringp val) + (when (and (stringp val) (string-match - (concat "[^" (symbol-value 'mm-7bit-chars) "]") val)) + (concat "[^" (bound-and-true-p mm-7bit-chars) "]") val)) (with-current-buffer reporter-eval-buffer (set varsym @@ -327,8 +326,7 @@ buffer in your bug report. ;; Append buffers only when we are in message mode. (when (and (eq major-mode 'message-mode) - (boundp 'mml-mode) - (symbol-value 'mml-mode)) + (bound-and-true-p mml-mode)) (let ((tramp-buf-regexp "\\*\\(debug \\)?tramp/") (buffer-list (tramp-list-tramp-buffers)) diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el index 732922b60ec..322e9c36895 100644 --- a/lisp/net/tramp-compat.el +++ b/lisp/net/tramp-compat.el @@ -197,10 +197,7 @@ Add the extension of F, if existing." (tramp-compat-funcall 'delete-file filename trash) ;; This Emacs version does not support the TRASH flag. (wrong-number-of-arguments - (let ((delete-by-moving-to-trash - (and (boundp 'delete-by-moving-to-trash) - (symbol-value 'delete-by-moving-to-trash) - trash))) + (let ((delete-by-moving-to-trash (and delete-by-moving-to-trash trash))) (delete-file filename))))) ;; RECURSIVE has been introduced with Emacs 23.2. TRASH has been diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index aba6f414a45..55fddf3dbd8 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el @@ -619,7 +619,8 @@ is no information where to trace the message.") (tramp-message tramp-gvfs-dbus-event-vector 10 "%S" event) (tramp-error tramp-gvfs-dbus-event-vector 'file-error "%s" (cadr err)))) -;; `dbus-event-error-hooks' has been renamed to `dbus-event-error-functions'. +;; `dbus-event-error-hooks' has been renamed to +;; `dbus-event-error-functions' in Emacs 24.3. (add-hook (if (boundp 'dbus-event-error-functions) 'dbus-event-error-functions 'dbus-event-error-hooks) @@ -1223,11 +1224,7 @@ file-notify events." (file-attributes filename)))) ;; The end. - (when (or (eq visit t) (null visit) (stringp visit)) - (tramp-message v 0 "Wrote `%s' (%d characters)" filename - (cond ((null start) (buffer-size)) - ((stringp start) (length start)) - (t (- end start))))) + (tramp-handle-write-region-message v start end filename append visit) (run-hooks 'tramp-handle-write-region-hook))) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 971cdaedf82..adadf9650e6 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -3412,11 +3412,7 @@ the result will be a local, non-Tramp, file name." ;; Set the ownership. (when need-chown (tramp-set-file-uid-gid filename uid gid)) - (when (or (eq visit t) (null visit) (stringp visit)) - (tramp-message v 0 "Wrote `%s' (%d characters)" filename - (cond ((null start) (buffer-size)) - ((stringp start) (length start)) - (t (- end start))))) + (tramp-handle-write-region-message v start end filename append visit) (run-hooks 'tramp-handle-write-region-hook))))) (defvar tramp-vc-registered-file-names nil diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index 5a3e2566d71..4b288e199af 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el @@ -1521,7 +1521,8 @@ errors for shares like \"C$/\", which are common in Microsoft Windows." v 'file-error "Buffer has changed from `%s' to `%s'" curbuf (current-buffer))) (when (eq visit t) - (set-visited-file-modtime))))) + (set-visited-file-modtime)) + (tramp-handle-write-region-message v start end filename append visit)))) ;; Internal file name functions. @@ -1945,8 +1946,7 @@ If ARGUMENT is non-nil, use it as argument for (error (with-current-buffer (tramp-get-connection-buffer vec) (goto-char (point-min)) - (if (and (boundp 'auth-sources) - (symbol-value 'auth-sources) + (if (and (bound-and-true-p auth-sources) (search-forward-regexp tramp-smb-wrong-passwd-regexp nil t)) ;; Disable `auth-source' and `password-cache'. diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 33e5900f3c2..4a1900c6f8a 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -533,9 +533,8 @@ This regexp must match both `tramp-initial-end-of-output' and (defcustom tramp-password-prompt-regexp (format "^.*\\(%s\\).*:\^@? *" ;; `password-word-equivalents' has been introduced with Emacs 24.4. - (if (boundp 'password-word-equivalents) - (regexp-opt (symbol-value 'password-word-equivalents)) - "password\\|passphrase")) + (regexp-opt (or (bound-and-true-p password-word-equivalents) + '("password" "passphrase")))) "Regexp matching password-like prompts. The regexp should match at end of buffer. @@ -2305,7 +2304,7 @@ Add operations defined in `HANDLER-alist' to `tramp-file-name-handler'." "Check, whether method / user name / host name completion is active." (or ;; Signal from outside. `non-essential' has been introduced in Emacs 24. - (and (boundp 'non-essential) (symbol-value 'non-essential)) + (bound-and-true-p non-essential) ;; This variable has been obsoleted in Emacs 26. tramp-completion-mode)) @@ -2754,6 +2753,27 @@ User is always nil." (defvar tramp-handle-write-region-hook nil "Normal hook to be run at the end of `tramp-*-handle-write-region'.") +(defsubst tramp-handle-write-region-message + (vec start end filename &optional append visit) + "Message to be written for `tramp-*-handle-write-region'" + ;; We shall also don't write when autosaving. How to check? + (when (and (null noninteractive) + (or (eq visit t) (null visit) (stringp visit))) + (let ((nchars (cond ((null start) (buffer-size)) + ((stringp start) (length start)) + (t (- end start))))) + (tramp-message + vec 0 "%s `%s'%s" + (cond + ((numberp append) "Updated") + (append "Added to") + (t "Wrote")) + filename + (cond + ((null (bound-and-true-p write-region-verbose)) "") + ((= nchars 1) " (1 character)") + (t (format " (%d characters)" nchars))))))) + (defun tramp-handle-directory-file-name (directory) "Like `directory-file-name' for Tramp files." ;; If localname component of filename is "/", leave it unchanged. |