From 95268e987c484b98aac3de54cf91d65db16f4c22 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Thu, 3 Jul 2014 11:27:02 +0200 Subject: [PATCH] * net/tramp-adb.el (tramp-adb-sh-fix-ls-output): Use `bolp'. * net/tramp-sh.el (tramp-sh-handle-set-visited-file-modtime) (tramp-sh-handle-verify-visited-file-modtime): Use `point-at-eol'. * net/tramp.el (tramp-call-process): Handle error strings. * net/trampver.el: Update release number. --- lisp/ChangeLog | 11 +++++++++++ lisp/net/tramp-adb.el | 4 +--- lisp/net/tramp-sh.el | 6 ++---- lisp/net/tramp.el | 10 ++++++---- lisp/net/trampver.el | 6 +++--- 5 files changed, 23 insertions(+), 14 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3c71395f8b9..450eac3f48d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,14 @@ +2014-07-03 Michael Albinus + + * net/tramp.el (tramp-call-process): Handle error strings. + + * net/tramp-adb.el (tramp-adb-sh-fix-ls-output): Use `bolp'. + + * net/tramp-sh.el (tramp-sh-handle-set-visited-file-modtime) + (tramp-sh-handle-verify-visited-file-modtime): Use `point-at-eol'. + + * net/trampver.el: Update release number. + 2014-07-03 Juri Linkov * desktop.el (desktop-save): Rename arg `auto-save' to diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el index 4f6d5807ba5..16017eebba3 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el @@ -458,9 +458,7 @@ Emacs dired can't find files." (insert " " (mapconcat 'identity sorted-lines "\n "))) ;; Add final newline. (goto-char (point-max)) - (unless (= (point) (line-beginning-position)) - (insert "\n")))) - + (unless (bolp) (insert "\n")))) (defun tramp-adb-ls-output-time-less-p (a b) "Sort \"ls\" output by time, descending." diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index d906cc67674..315bc08d0ef 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -1265,8 +1265,7 @@ target of the symlink differ." (format "%s -ild %s" (tramp-get-ls-command v) (tramp-shell-quote-argument localname))) - (setq attr (buffer-substring (point) - (progn (end-of-line) (point))))) + (setq attr (buffer-substring (point) (point-at-eol)))) (tramp-set-file-property v localname "visited-file-modtime-ild" attr)) (when (boundp 'last-coding-system-used) @@ -1317,8 +1316,7 @@ of." (tramp-get-ls-command v) (tramp-shell-quote-argument localname))) (with-current-buffer (tramp-get-buffer v) - (setq attr (buffer-substring - (point) (progn (end-of-line) (point))))) + (setq attr (buffer-substring (point) (point-at-eol)))) (equal attr (tramp-get-file-property diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 6be737eb3f0..921c70135df 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -4127,10 +4127,9 @@ ALIST is of the form ((FROM . TO) ...)." (defun tramp-call-process (vec program &optional infile destination display &rest args) "Calls `call-process' on the local host. -This is needed because for some Emacs flavors Tramp has -defadvised `call-process' to behave like `process-file'. The -Lisp error raised when PROGRAM is nil is trapped also, returning 1. -Furthermore, traces are written with verbosity of 6." +It always returns a return code. The Lisp error raised when +PROGRAM is nil is trapped also, returning 1. Furthermore, traces +are written with verbosity of 6." (let ((v (or vec (vector tramp-current-method tramp-current-user tramp-current-host nil nil))) @@ -4144,6 +4143,9 @@ Furthermore, traces are written with verbosity of 6." (setq result (apply 'call-process program infile (or destination t) display args)) + ;; `result' could also be an error string. + (when (stringp result) + (signal 'file-error (list result))) (with-current-buffer (if (bufferp destination) destination (current-buffer)) (tramp-message v 6 "%d\n%s" result (buffer-string)))) diff --git a/lisp/net/trampver.el b/lisp/net/trampver.el index 9c0beb114bc..065c3f33ebe 100644 --- a/lisp/net/trampver.el +++ b/lisp/net/trampver.el @@ -24,14 +24,14 @@ ;;; Code: -;; In the Tramp CVS repository, the version number and the bug report +;; In the Tramp GIT repository, the version number and the bug report ;; address are auto-frobbed from configure.ac, so you should edit that ;; file and run "autoconf && ./configure" to change them. (X)Emacs ;; version check is defined in macro AC_EMACS_INFO of aclocal.m4; ;; should be changed only there. ;;;###tramp-autoload -(defconst tramp-version "2.2.10" +(defconst tramp-version "2.2.11-pre" "This version of Tramp.") ;;;###tramp-autoload @@ -44,7 +44,7 @@ (= emacs-major-version 21) (>= emacs-minor-version 4))) "ok" - (format "Tramp 2.2.10 is not fit for %s" + (format "Tramp 2.2.11-pre is not fit for %s" (when (string-match "^.*$" (emacs-version)) (match-string 0 (emacs-version))))))) (unless (string-match "\\`ok\\'" x) (error "%s" x))) -- 2.39.2