diff options
| author | Michael Albinus | 2015-05-30 11:54:32 +0200 |
|---|---|---|
| committer | Michael Albinus | 2015-05-30 11:54:32 +0200 |
| commit | fdf31e5d6e79047fd0c0a30a5fb64dbc033f3169 (patch) | |
| tree | 1caf14bdd47c9f5bcd42f4084b54862b023744a2 | |
| parent | b65be6c5defd517cdfcb9aeee91904def06f5782 (diff) | |
| download | emacs-fdf31e5d6e79047fd0c0a30a5fb64dbc033f3169.tar.gz emacs-fdf31e5d6e79047fd0c0a30a5fb64dbc033f3169.zip | |
Improve Tramp traces.
* lisp/net/trampver.el (tramp-repository-get-version): New defun.
* lisp/net/tramp.el (tramp-debug-message): Use it.
| -rw-r--r-- | lisp/net/tramp.el | 7 | ||||
| -rw-r--r-- | lisp/net/trampver.el | 12 |
2 files changed, 18 insertions, 1 deletions
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 7bfd225c374..40bba145454 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -1433,7 +1433,12 @@ ARGUMENTS to actually emit the message (if applicable)." | |||
| 1433 | (format | 1433 | (format |
| 1434 | ";; %sEmacs: %s Tramp: %s -*- mode: outline; -*-" | 1434 | ";; %sEmacs: %s Tramp: %s -*- mode: outline; -*-" |
| 1435 | (if (featurep 'sxemacs) "SX" (if (featurep 'xemacs) "X" "GNU ")) | 1435 | (if (featurep 'sxemacs) "SX" (if (featurep 'xemacs) "X" "GNU ")) |
| 1436 | emacs-version tramp-version))) | 1436 | emacs-version tramp-version)) |
| 1437 | (when (>= tramp-verbose 10) | ||
| 1438 | (insert | ||
| 1439 | (format | ||
| 1440 | "\n;; Location: %s Git: %s" | ||
| 1441 | (locate-library "tramp") (tramp-repository-get-version))))) | ||
| 1437 | (unless (bolp) | 1442 | (unless (bolp) |
| 1438 | (insert "\n")) | 1443 | (insert "\n")) |
| 1439 | ;; Timestamp. | 1444 | ;; Timestamp. |
diff --git a/lisp/net/trampver.el b/lisp/net/trampver.el index 226ec9f194a..c5e57053513 100644 --- a/lisp/net/trampver.el +++ b/lisp/net/trampver.el | |||
| @@ -38,6 +38,18 @@ | |||
| 38 | (defconst tramp-bug-report-address "tramp-devel@gnu.org" | 38 | (defconst tramp-bug-report-address "tramp-devel@gnu.org" |
| 39 | "Email address to send bug reports to.") | 39 | "Email address to send bug reports to.") |
| 40 | 40 | ||
| 41 | (defun tramp-repository-get-version () | ||
| 42 | "Try to return as a string the repository revision of the Tramp sources." | ||
| 43 | (let ((dir (funcall 'locate-dominating-file (locate-library "tramp") ".git"))) | ||
| 44 | (when dir | ||
| 45 | (with-temp-buffer | ||
| 46 | (let ((default-directory (file-name-as-directory dir))) | ||
| 47 | (and (zerop | ||
| 48 | (ignore-errors | ||
| 49 | (call-process "git" nil '(t nil) nil "rev-parse" "HEAD"))) | ||
| 50 | (not (zerop (buffer-size))) | ||
| 51 | (replace-regexp-in-string "\n" "" (buffer-string)))))))) | ||
| 52 | |||
| 41 | ;; Check for (X)Emacs version. | 53 | ;; Check for (X)Emacs version. |
| 42 | (let ((x (if (or (>= emacs-major-version 22) | 54 | (let ((x (if (or (>= emacs-major-version 22) |
| 43 | (and (featurep 'xemacs) | 55 | (and (featurep 'xemacs) |