diff options
| author | Michael Albinus | 2007-09-24 05:42:34 +0000 |
|---|---|---|
| committer | Michael Albinus | 2007-09-24 05:42:34 +0000 |
| commit | 7a3cdcc52a67c1e383863f337f90e31ae58cebba (patch) | |
| tree | 3f75ddc0a614c80c75ff0d3a70fe0c38bbf46144 | |
| parent | 9a3d2737673f27a74e60aab0b2570430aa2fe4c6 (diff) | |
| download | emacs-7a3cdcc52a67c1e383863f337f90e31ae58cebba.tar.gz emacs-7a3cdcc52a67c1e383863f337f90e31ae58cebba.zip | |
* net/tramp.el (tramp-completion-mode-p): Rename from
`tramp-completion-mode'. Revert logic, check `return', `newline'
and such alike. Packages like Icicles tend to use other completion
characters but `tab' and `space' only.
(top): Require cl.el, when `copy-tree' is not available otherwise.
* net/tramp-vc.el (tramp-vc-user-login-name): Get argument by
`ad-get-arg'. Use `vc-find-version' instead of `process-file' to check
whether we have a new enough vc that doesn't need the defadvice.
| -rw-r--r-- | lisp/ChangeLog | 17 | ||||
| -rw-r--r-- | lisp/net/tramp-vc.el | 7 | ||||
| -rw-r--r-- | lisp/net/tramp.el | 64 |
3 files changed, 52 insertions, 36 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 28d9f4eb9ec..5ad04a42e9b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,20 @@ | |||
| 1 | 2007-09-24 Michael Albinus <michael.albinus@gmx.de> | ||
| 2 | |||
| 3 | * net/tramp.el (tramp-completion-mode-p): Rename from | ||
| 4 | `tramp-completion-mode'. Revert logic, check `return', `newline' | ||
| 5 | and such alike. Packages like Icicles tend to use other completion | ||
| 6 | characters but `tab' and `space' only. | ||
| 7 | (top): Require cl.el, when `copy-tree' is not available otherwise. | ||
| 8 | |||
| 9 | * net/tramp-vc.el (tramp-vc-user-login-name): Get argument by | ||
| 10 | `ad-get-arg'. | ||
| 11 | |||
| 12 | 2007-09-24 Ville Skyttä <scop@xemacs.org> (tiny change) | ||
| 13 | |||
| 14 | * net/tramp-vc.el (tramp-vc-user-login-name): Use | ||
| 15 | `vc-find-version' instead of `process-file' to check whether we | ||
| 16 | have a new enough vc that doesn't need the defadvice. | ||
| 17 | |||
| 1 | 2007-09-23 Dan Nicolaescu <dann@ics.uci.edu> | 18 | 2007-09-23 Dan Nicolaescu <dann@ics.uci.edu> |
| 2 | 19 | ||
| 3 | * files.el (file-name-sans-versions): Use [:alnum:] and also allow | 20 | * files.el (file-name-sans-versions): Use [:alnum:] and also allow |
diff --git a/lisp/net/tramp-vc.el b/lisp/net/tramp-vc.el index 1aea7b04b4a..eb411cb307f 100644 --- a/lisp/net/tramp-vc.el +++ b/lisp/net/tramp-vc.el | |||
| @@ -437,7 +437,10 @@ filename we are thinking about..." | |||
| 437 | ;; The following defadvice is no longer necessary after changes in VC | 437 | ;; The following defadvice is no longer necessary after changes in VC |
| 438 | ;; on 2006-01-25, Andre. | 438 | ;; on 2006-01-25, Andre. |
| 439 | 439 | ||
| 440 | (unless (fboundp 'process-file) | 440 | ;; That means either GNU Emacs >= 22 or the "new vc" package from XEmacs |
| 441 | ;; packages collection; as of 2007-09-06, test for availability of | ||
| 442 | ;; `vc-find-version' works for both of those cases. | ||
| 443 | (unless (fboundp 'vc-find-version) | ||
| 441 | (defadvice vc-user-login-name | 444 | (defadvice vc-user-login-name |
| 442 | (around tramp-vc-user-login-name activate) | 445 | (around tramp-vc-user-login-name activate) |
| 443 | "Support for files on remote machines accessed by TRAMP." | 446 | "Support for files on remote machines accessed by TRAMP." |
| @@ -453,7 +456,7 @@ filename we are thinking about..." | |||
| 453 | (tramp-tramp-file-p file) ; tramp file | 456 | (tramp-tramp-file-p file) ; tramp file |
| 454 | (setq ad-return-value | 457 | (setq ad-return-value |
| 455 | (save-match-data | 458 | (save-match-data |
| 456 | (tramp-handle-vc-user-login-name uid)))) ; get the owner name | 459 | (tramp-handle-vc-user-login-name (ad-get-arg 0))))) ; get the owner name |
| 457 | ad-do-it))) ; else call the original | 460 | ad-do-it))) ; else call the original |
| 458 | 461 | ||
| 459 | (add-hook 'tramp-unload-hook | 462 | (add-hook 'tramp-unload-hook |
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 33026451722..7d2e5161ac9 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -94,6 +94,11 @@ | |||
| 94 | (require 'shell) | 94 | (require 'shell) |
| 95 | (require 'advice) | 95 | (require 'advice) |
| 96 | 96 | ||
| 97 | ;; `copy-tree' is part of subr.el since Emacs 22. | ||
| 98 | (eval-when-compile | ||
| 99 | (unless (functionp 'copy-tree) | ||
| 100 | (require 'cl))) | ||
| 101 | |||
| 97 | (autoload 'tramp-uuencode-region "tramp-uu" | 102 | (autoload 'tramp-uuencode-region "tramp-uu" |
| 98 | "Implementation of `uuencode' in Lisp.") | 103 | "Implementation of `uuencode' in Lisp.") |
| 99 | (add-hook 'tramp-unload-hook | 104 | (add-hook 'tramp-unload-hook |
| @@ -4239,10 +4244,10 @@ pass to the OPERATION." | |||
| 4239 | (inhibit-file-name-operation operation)) | 4244 | (inhibit-file-name-operation operation)) |
| 4240 | (apply operation args)))) | 4245 | (apply operation args)))) |
| 4241 | 4246 | ||
| 4242 | ;; This function is used from `tramp-completion-file-name-handler' functions | 4247 | ;; This function is used from `tramp-completion-file-name-handler' |
| 4243 | ;; only, if `tramp-completion-mode' is true. But this cannot be checked here | 4248 | ;; functions only, if `tramp-completion-mode-p' is true. But this |
| 4244 | ;; because the check is based on a full filename, not available for all | 4249 | ;; cannot be checked here because the check is based on a full |
| 4245 | ;; basic I/O operations. | 4250 | ;; filename, not available for all basic I/O operations. |
| 4246 | ;;;###autoload | 4251 | ;;;###autoload |
| 4247 | (progn (defun tramp-completion-run-real-handler (operation args) | 4252 | (progn (defun tramp-completion-run-real-handler (operation args) |
| 4248 | "Invoke `tramp-file-name-handler' for OPERATION. | 4253 | "Invoke `tramp-file-name-handler' for OPERATION. |
| @@ -4357,7 +4362,7 @@ Falls back to normal file name handler if no tramp file name handler exists." | |||
| 4357 | ;; (edebug-trace "%s" (with-output-to-string (backtrace))) | 4362 | ;; (edebug-trace "%s" (with-output-to-string (backtrace))) |
| 4358 | (save-match-data | 4363 | (save-match-data |
| 4359 | (let* ((filename (apply 'tramp-file-name-for-operation operation args)) | 4364 | (let* ((filename (apply 'tramp-file-name-for-operation operation args)) |
| 4360 | (completion (tramp-completion-mode filename)) | 4365 | (completion (tramp-completion-mode-p filename)) |
| 4361 | (foreign (tramp-find-foreign-file-name-handler filename))) | 4366 | (foreign (tramp-find-foreign-file-name-handler filename))) |
| 4362 | (with-parsed-tramp-file-name filename nil | 4367 | (with-parsed-tramp-file-name filename nil |
| 4363 | (cond | 4368 | (cond |
| @@ -4563,7 +4568,7 @@ Falls back to normal file name handler if no tramp file name handler exists." | |||
| 4563 | ;; file name syntax in order to avoid ambiguities, like in XEmacs ... | 4568 | ;; file name syntax in order to avoid ambiguities, like in XEmacs ... |
| 4564 | ;; In case of non unified file names it can be always true (and wouldn't be | 4569 | ;; In case of non unified file names it can be always true (and wouldn't be |
| 4565 | ;; necessary, because there are different regexp). | 4570 | ;; necessary, because there are different regexp). |
| 4566 | (defun tramp-completion-mode (file) | 4571 | (defun tramp-completion-mode-p (file) |
| 4567 | "Checks whether method / user name / host name completion is active." | 4572 | "Checks whether method / user name / host name completion is active." |
| 4568 | (cond | 4573 | (cond |
| 4569 | (tramp-completion-mode t) | 4574 | (tramp-completion-mode t) |
| @@ -4573,33 +4578,24 @@ Falls back to normal file name handler if no tramp file name handler exists." | |||
| 4573 | "\\(" tramp-method-regexp "\\)" tramp-postfix-single-method-regexp "$") | 4578 | "\\(" tramp-method-regexp "\\)" tramp-postfix-single-method-regexp "$") |
| 4574 | file) | 4579 | file) |
| 4575 | (member (match-string 1 file) (mapcar 'car tramp-methods))) | 4580 | (member (match-string 1 file) (mapcar 'car tramp-methods))) |
| 4576 | ((or (equal last-input-event 'tab) | 4581 | ((or |
| 4577 | ;; Emacs | 4582 | ;; Emacs |
| 4578 | (and (natnump last-input-event) | 4583 | (not (memq last-input-event '(return newline))) |
| 4579 | (or | 4584 | (and (natnump last-input-event) |
| 4580 | ;; ?\t has event-modifier 'control | 4585 | (not (char-equal last-input-event ?\n)) |
| 4581 | (char-equal last-input-event ?\t) | 4586 | (not (char-equal last-input-event ?\r))) |
| 4582 | (and (not (event-modifiers last-input-event)) | 4587 | ;; XEmacs |
| 4583 | (or (char-equal last-input-event ?\?) | 4588 | (and (featurep 'xemacs) |
| 4584 | (char-equal last-input-event ?\ ))))) | 4589 | ;; `last-input-event' might be nil. |
| 4585 | ;; XEmacs | 4590 | (not (null last-input-event)) |
| 4586 | (and (featurep 'xemacs) | 4591 | ;; `last-input-event' may have no character approximation. |
| 4587 | ;; `last-input-event' might be nil. | 4592 | (funcall (symbol-function 'event-to-character) last-input-event) |
| 4588 | (not (null last-input-event)) | 4593 | (not (char-equal |
| 4589 | ;; `last-input-event' may have no character approximation. | 4594 | (funcall (symbol-function 'event-to-character) |
| 4590 | (funcall (symbol-function 'event-to-character) last-input-event) | 4595 | last-input-event) ?\n)) |
| 4591 | (or | 4596 | (not (char-equal |
| 4592 | ;; ?\t has event-modifier 'control | 4597 | (funcall (symbol-function 'event-to-character) |
| 4593 | (char-equal | 4598 | last-input-event) ?\r)))) |
| 4594 | (funcall (symbol-function 'event-to-character) | ||
| 4595 | last-input-event) ?\t) | ||
| 4596 | (and (not (event-modifiers last-input-event)) | ||
| 4597 | (or (char-equal | ||
| 4598 | (funcall (symbol-function 'event-to-character) | ||
| 4599 | last-input-event) ?\?) | ||
| 4600 | (char-equal | ||
| 4601 | (funcall (symbol-function 'event-to-character) | ||
| 4602 | last-input-event) ?\ )))))) | ||
| 4603 | t))) | 4599 | t))) |
| 4604 | 4600 | ||
| 4605 | ;; Method, host name and user name completion. | 4601 | ;; Method, host name and user name completion. |
| @@ -7898,7 +7894,7 @@ Therefore, the contents of files might be included in the debug buffer(s).") | |||
| 7898 | ;; ** If `partial-completion-mode' isn't loaded, "/foo:bla" tries to | 7894 | ;; ** If `partial-completion-mode' isn't loaded, "/foo:bla" tries to |
| 7899 | ;; connect to host "blabla" already if that host is unique. No idea | 7895 | ;; connect to host "blabla" already if that host is unique. No idea |
| 7900 | ;; how to suppress. Maybe not an essential problem. | 7896 | ;; how to suppress. Maybe not an essential problem. |
| 7901 | ;; ** Try to avoid usage of `last-input-event' in `tramp-completion-mode'. | 7897 | ;; ** Try to avoid usage of `last-input-event' in `tramp-completion-mode-p'. |
| 7902 | ;; ** Extend `tramp-get-completion-su' for NIS and shadow passwords. | 7898 | ;; ** Extend `tramp-get-completion-su' for NIS and shadow passwords. |
| 7903 | ;; ** Unify `tramp-parse-{rhosts,shosts,sconfig,hosts,passwd,netrc}'. | 7899 | ;; ** Unify `tramp-parse-{rhosts,shosts,sconfig,hosts,passwd,netrc}'. |
| 7904 | ;; Code is nearly identical. | 7900 | ;; Code is nearly identical. |