diff options
| author | Michael Albinus | 2013-09-02 15:41:08 +0200 |
|---|---|---|
| committer | Michael Albinus | 2013-09-02 15:41:08 +0200 |
| commit | 95beaef369763423111bca752a7a3c5c3d853fb0 (patch) | |
| tree | 35d863b9479d45f66b02f4b2ac25c3718d28e08b | |
| parent | 8b09823660104a1698c2c8ab902042d2d39b0ebf (diff) | |
| download | emacs-95beaef369763423111bca752a7a3c5c3d853fb0.tar.gz emacs-95beaef369763423111bca752a7a3c5c3d853fb0.zip | |
* net/tramp-compat.el (tramp-compat-user-error): Move it ...
* net/tramp.el (tramp-user-error): ... here.
(tramp-find-method, tramp-check-proper-host)
(tramp-dissect-file-name, tramp-debug-message)
(tramp-handle-shell-command):
* net/tramp-adb.el (tramp-adb-handle-shell-command):
* net/tramp-gvfs.el (tramp-gvfs-file-name-handler): Adapt callees.
* net/tramp-cache.el (tramp-cache-print): Don't print text properties.
| -rw-r--r-- | lisp/ChangeLog | 12 | ||||
| -rw-r--r-- | lisp/net/tramp-adb.el | 2 | ||||
| -rw-r--r-- | lisp/net/tramp-cache.el | 5 | ||||
| -rw-r--r-- | lisp/net/tramp-compat.el | 6 | ||||
| -rw-r--r-- | lisp/net/tramp-gvfs.el | 2 | ||||
| -rw-r--r-- | lisp/net/tramp.el | 21 |
6 files changed, 33 insertions, 15 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c9cdc559a17..201d29fa558 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,15 @@ | |||
| 1 | 2013-09-02 Michael Albinus <michael.albinus@gmx.de> | ||
| 2 | |||
| 3 | * net/tramp-compat.el (tramp-compat-user-error): Move it ... | ||
| 4 | * net/tramp.el (tramp-user-error): ... here. | ||
| 5 | (tramp-find-method, tramp-check-proper-host) | ||
| 6 | (tramp-dissect-file-name, tramp-debug-message) | ||
| 7 | (tramp-handle-shell-command): | ||
| 8 | * net/tramp-adb.el (tramp-adb-handle-shell-command): | ||
| 9 | * net/tramp-gvfs.el (tramp-gvfs-file-name-handler): Adapt callees. | ||
| 10 | |||
| 11 | * net/tramp-cache.el (tramp-cache-print): Don't print text properties. | ||
| 12 | |||
| 1 | 2013-09-02 Martin Rudalics <rudalics@gmx.at> | 13 | 2013-09-02 Martin Rudalics <rudalics@gmx.at> |
| 2 | 14 | ||
| 3 | * avoid.el (mouse-avoidance-point-position) | 15 | * avoid.el (mouse-avoidance-point-position) |
diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el index ff6d0d10671..a5f59227ef7 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el | |||
| @@ -874,7 +874,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." | |||
| 874 | (when p | 874 | (when p |
| 875 | (if (yes-or-no-p "A command is running. Kill it? ") | 875 | (if (yes-or-no-p "A command is running. Kill it? ") |
| 876 | (ignore-errors (kill-process p)) | 876 | (ignore-errors (kill-process p)) |
| 877 | (tramp-compat-user-error "Shell command in progress"))) | 877 | (tramp-user-error p "Shell command in progress"))) |
| 878 | 878 | ||
| 879 | (if current-buffer-p | 879 | (if current-buffer-p |
| 880 | (progn | 880 | (progn |
diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el index 118be597433..b89c5124721 100644 --- a/lisp/net/tramp-cache.el +++ b/lisp/net/tramp-cache.el | |||
| @@ -285,6 +285,11 @@ KEY identifies the connection, it is either a process or a vector." | |||
| 285 | (let (result) | 285 | (let (result) |
| 286 | (maphash | 286 | (maphash |
| 287 | (lambda (key value) | 287 | (lambda (key value) |
| 288 | ;; Remove text properties from KEY. | ||
| 289 | (when (vectorp key) | ||
| 290 | (dotimes (i (length key)) | ||
| 291 | (when (stringp (aref key i)) | ||
| 292 | (aset key i (substring-no-properties (aref key i)))))) | ||
| 288 | (let ((tmp (format | 293 | (let ((tmp (format |
| 289 | "(%s %s)" | 294 | "(%s %s)" |
| 290 | (if (processp key) | 295 | (if (processp key) |
diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el index f0905245dea..3081c45cc7d 100644 --- a/lisp/net/tramp-compat.el +++ b/lisp/net/tramp-compat.el | |||
| @@ -518,12 +518,6 @@ EOL-TYPE can be one of `dos', `unix', or `mac'." | |||
| 518 | "`dos', `unix', or `mac'"))))) | 518 | "`dos', `unix', or `mac'"))))) |
| 519 | (t (error "Can't change EOL conversion -- is MULE missing?")))) | 519 | (t (error "Can't change EOL conversion -- is MULE missing?")))) |
| 520 | 520 | ||
| 521 | ;; `user-error' has been added to Emacs 24.3. | ||
| 522 | (defun tramp-compat-user-error (format &rest args) | ||
| 523 | "Signal a pilot error." | ||
| 524 | ; (tramp-backtrace) | ||
| 525 | (apply (if (fboundp 'user-error) 'user-error 'error) format args)) | ||
| 526 | |||
| 527 | (add-hook 'tramp-unload-hook | 521 | (add-hook 'tramp-unload-hook |
| 528 | (lambda () | 522 | (lambda () |
| 529 | (unload-feature 'tramp-compat 'force))) | 523 | (unload-feature 'tramp-compat 'force))) |
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index e26ffb26e84..9ae352eccc1 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el | |||
| @@ -490,7 +490,7 @@ Operations not mentioned here will be handled by the default Emacs primitives.") | |||
| 490 | First arg specifies the OPERATION, second arg is a list of arguments to | 490 | First arg specifies the OPERATION, second arg is a list of arguments to |
| 491 | pass to the OPERATION." | 491 | pass to the OPERATION." |
| 492 | (unless tramp-gvfs-enabled | 492 | (unless tramp-gvfs-enabled |
| 493 | (tramp-compat-user-error "Package `tramp-gvfs' not supported")) | 493 | (tramp-user-error nil "Package `tramp-gvfs' not supported")) |
| 494 | (let ((fn (assoc operation tramp-gvfs-file-name-handler-alist))) | 494 | (let ((fn (assoc operation tramp-gvfs-file-name-handler-alist))) |
| 495 | (if fn | 495 | (if fn |
| 496 | (save-match-data (apply (cdr fn) args)) | 496 | (save-match-data (apply (cdr fn) args)) |
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 43aa0031cb1..ff0200c1161 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -1120,6 +1120,12 @@ calling HANDLER.") | |||
| 1120 | 1120 | ||
| 1121 | ;;; Internal functions which must come first: | 1121 | ;;; Internal functions which must come first: |
| 1122 | 1122 | ||
| 1123 | (defsubst tramp-user-error (vec-or-proc format &rest args) | ||
| 1124 | "Signal a pilot error." | ||
| 1125 | (apply | ||
| 1126 | 'tramp-error vec-or-proc | ||
| 1127 | (if (fboundp 'user-error) 'user-error 'error) format args)) | ||
| 1128 | |||
| 1123 | ;; Conversion functions between external representation and | 1129 | ;; Conversion functions between external representation and |
| 1124 | ;; internal data structure. Convenience functions for internal | 1130 | ;; internal data structure. Convenience functions for internal |
| 1125 | ;; data structure. | 1131 | ;; data structure. |
| @@ -1232,9 +1238,9 @@ their replacement." | |||
| 1232 | (if noninteractive | 1238 | (if noninteractive |
| 1233 | (warn "Method %s is obsolete, using %s" | 1239 | (warn "Method %s is obsolete, using %s" |
| 1234 | result (substring result 0 -1)) | 1240 | result (substring result 0 -1)) |
| 1235 | (unless (y-or-n-p (format "Method %s is obsolete, use %s? " | 1241 | (unless (y-or-n-p (format "Method \"%s\" is obsolete, use \"%s\"? " |
| 1236 | result (substring result 0 -1))) | 1242 | result (substring result 0 -1))) |
| 1237 | (tramp-compat-user-error "Method \"%s\" not supported" result))) | 1243 | (tramp-user-error nil "Method \"%s\" not supported" result))) |
| 1238 | (add-to-list 'tramp-warned-obsolete-methods result)) | 1244 | (add-to-list 'tramp-warned-obsolete-methods result)) |
| 1239 | ;; This works with the current set of `tramp-obsolete-methods'. | 1245 | ;; This works with the current set of `tramp-obsolete-methods'. |
| 1240 | ;; Must be improved, if their are more sophisticated replacements. | 1246 | ;; Must be improved, if their are more sophisticated replacements. |
| @@ -1289,8 +1295,8 @@ This is HOST, if non-nil. Otherwise, it is `tramp-default-host'." | |||
| 1289 | (or (null method) (get-text-property 0 'tramp-default method)) | 1295 | (or (null method) (get-text-property 0 'tramp-default method)) |
| 1290 | (or (null user) (get-text-property 0 'tramp-default user)) | 1296 | (or (null user) (get-text-property 0 'tramp-default user)) |
| 1291 | (member host (mapcar 'car tramp-methods))) | 1297 | (member host (mapcar 'car tramp-methods))) |
| 1292 | (tramp-compat-user-error | 1298 | (tramp-cleanup-connection vec) |
| 1293 | "Host name must not match method `%s'" host)))) | 1299 | (tramp-user-error vec "Host name must not match method \"%s\"" host)))) |
| 1294 | 1300 | ||
| 1295 | (defun tramp-dissect-file-name (name &optional nodefault) | 1301 | (defun tramp-dissect-file-name (name &optional nodefault) |
| 1296 | "Return a `tramp-file-name' structure. | 1302 | "Return a `tramp-file-name' structure. |
| @@ -1300,7 +1306,7 @@ non-nil, the file name parts are not expanded to their default | |||
| 1300 | values." | 1306 | values." |
| 1301 | (save-match-data | 1307 | (save-match-data |
| 1302 | (let ((match (string-match (nth 0 tramp-file-name-structure) name))) | 1308 | (let ((match (string-match (nth 0 tramp-file-name-structure) name))) |
| 1303 | (unless match (tramp-compat-user-error "Not a Tramp file name: %s" name)) | 1309 | (unless match (tramp-user-error nil "Not a Tramp file name: \"%s\"" name)) |
| 1304 | (let ((method (match-string (nth 1 tramp-file-name-structure) name)) | 1310 | (let ((method (match-string (nth 1 tramp-file-name-structure) name)) |
| 1305 | (user (match-string (nth 2 tramp-file-name-structure) name)) | 1311 | (user (match-string (nth 2 tramp-file-name-structure) name)) |
| 1306 | (host (match-string (nth 3 tramp-file-name-structure) name)) | 1312 | (host (match-string (nth 3 tramp-file-name-structure) name)) |
| @@ -1485,7 +1491,8 @@ ARGUMENTS to actually emit the message (if applicable)." | |||
| 1485 | "tramp-debug-message" | 1491 | "tramp-debug-message" |
| 1486 | "tramp-error" | 1492 | "tramp-error" |
| 1487 | "tramp-error-with-buffer" | 1493 | "tramp-error-with-buffer" |
| 1488 | "tramp-message") | 1494 | "tramp-message" |
| 1495 | "tramp-user-error") | ||
| 1489 | t) | 1496 | t) |
| 1490 | "$") | 1497 | "$") |
| 1491 | fn))) | 1498 | fn))) |
| @@ -3236,7 +3243,7 @@ User is always nil." | |||
| 3236 | (when p | 3243 | (when p |
| 3237 | (if (yes-or-no-p "A command is running. Kill it? ") | 3244 | (if (yes-or-no-p "A command is running. Kill it? ") |
| 3238 | (ignore-errors (kill-process p)) | 3245 | (ignore-errors (kill-process p)) |
| 3239 | (tramp-compat-user-error "Shell command in progress"))) | 3246 | (tramp-user-error p "Shell command in progress"))) |
| 3240 | 3247 | ||
| 3241 | (if current-buffer-p | 3248 | (if current-buffer-p |
| 3242 | (progn | 3249 | (progn |