diff options
| author | Michael Albinus | 2007-09-24 05:29:29 +0000 |
|---|---|---|
| committer | Michael Albinus | 2007-09-24 05:29:29 +0000 |
| commit | 6c4e47fa46d48c6eabb744a8520e9611db8dbc06 (patch) | |
| tree | 3e262f80c7d88191e4137141ae25ed63b7b4fa62 | |
| parent | 2de53ca6a26173baefa38d2c8e5028e1fd1c787f (diff) | |
| download | emacs-6c4e47fa46d48c6eabb744a8520e9611db8dbc06.tar.gz emacs-6c4e47fa46d48c6eabb744a8520e9611db8dbc06.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.
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/net/tramp.el | 53 |
2 files changed, 29 insertions, 31 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index abd5fd53352..ed38ee2635f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 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 | |||
| 1 | 2007-09-24 Adam Hupp <adam@hupp.org> | 8 | 2007-09-24 Adam Hupp <adam@hupp.org> |
| 2 | 9 | ||
| 3 | * progmodes/python.el (run-python): Import emacs module without | 10 | * progmodes/python.el (run-python): Import emacs module without |
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index a102a9f19c0..db6739a9e9f 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -4345,7 +4345,7 @@ ARGS are the arguments OPERATION has been called with." | |||
| 4345 | (defun tramp-find-foreign-file-name-handler (filename) | 4345 | (defun tramp-find-foreign-file-name-handler (filename) |
| 4346 | "Return foreign file name handler if exists." | 4346 | "Return foreign file name handler if exists." |
| 4347 | (when (and (stringp filename) (tramp-tramp-file-p filename) | 4347 | (when (and (stringp filename) (tramp-tramp-file-p filename) |
| 4348 | (or (not (tramp-completion-mode)) | 4348 | (or (not (tramp-completion-mode-p)) |
| 4349 | (not (string-match | 4349 | (not (string-match |
| 4350 | tramp-completion-file-name-regexp filename)))) | 4350 | tramp-completion-file-name-regexp filename)))) |
| 4351 | (let (elt | 4351 | (let (elt |
| @@ -4366,7 +4366,7 @@ ARGS are the arguments OPERATION has been called with." | |||
| 4366 | Falls back to normal file name handler if no tramp file name handler exists." | 4366 | Falls back to normal file name handler if no tramp file name handler exists." |
| 4367 | (save-match-data | 4367 | (save-match-data |
| 4368 | (let* ((filename (apply 'tramp-file-name-for-operation operation args)) | 4368 | (let* ((filename (apply 'tramp-file-name-for-operation operation args)) |
| 4369 | (completion (tramp-completion-mode)) | 4369 | (completion (tramp-completion-mode-p)) |
| 4370 | (foreign (tramp-find-foreign-file-name-handler filename))) | 4370 | (foreign (tramp-find-foreign-file-name-handler filename))) |
| 4371 | (with-parsed-tramp-file-name filename nil | 4371 | (with-parsed-tramp-file-name filename nil |
| 4372 | (cond | 4372 | (cond |
| @@ -4579,35 +4579,26 @@ Falls back to normal file name handler if no tramp file name handler exists." | |||
| 4579 | ;; tramp file name syntax. Maybe another variable should be introduced | 4579 | ;; tramp file name syntax. Maybe another variable should be introduced |
| 4580 | ;; overwriting this check in such cases. Or we change tramp file name | 4580 | ;; overwriting this check in such cases. Or we change tramp file name |
| 4581 | ;; syntax in order to avoid ambiguities, like in XEmacs ... | 4581 | ;; syntax in order to avoid ambiguities, like in XEmacs ... |
| 4582 | (defun tramp-completion-mode () | 4582 | (defun tramp-completion-mode-p () |
| 4583 | "Checks whether method / user name / host name completion is active." | 4583 | "Checks whether method / user name / host name completion is active." |
| 4584 | (or (equal last-input-event 'tab) | 4584 | (or |
| 4585 | ;; Emacs | 4585 | ;; Emacs |
| 4586 | (and (natnump last-input-event) | 4586 | (not (memq last-input-event '(return newline))) |
| 4587 | (or | 4587 | (and (natnump last-input-event) |
| 4588 | ;; ?\t has event-modifier 'control | 4588 | (not (char-equal last-input-event ?\n)) |
| 4589 | (char-equal last-input-event ?\t) | 4589 | (not (char-equal last-input-event ?\r))) |
| 4590 | (and (not (event-modifiers last-input-event)) | 4590 | ;; XEmacs |
| 4591 | (or (char-equal last-input-event ?\?) | 4591 | (and (featurep 'xemacs) |
| 4592 | (char-equal last-input-event ?\ ))))) | 4592 | ;; `last-input-event' might be nil. |
| 4593 | ;; XEmacs | 4593 | (not (null last-input-event)) |
| 4594 | (and (featurep 'xemacs) | 4594 | ;; `last-input-event' may have no character approximation. |
| 4595 | ;; `last-input-event' might be nil. | 4595 | (funcall (symbol-function 'event-to-character) last-input-event) |
| 4596 | (not (null last-input-event)) | 4596 | (not (char-equal |
| 4597 | ;; `last-input-event' may have no character approximation. | 4597 | (funcall (symbol-function 'event-to-character) |
| 4598 | (funcall (symbol-function 'event-to-character) last-input-event) | 4598 | last-input-event) ?\n)) |
| 4599 | (or | 4599 | (not (char-equal |
| 4600 | ;; ?\t has event-modifier 'control | 4600 | (funcall (symbol-function 'event-to-character) |
| 4601 | (char-equal | 4601 | last-input-event) ?\r))))) |
| 4602 | (funcall (symbol-function 'event-to-character) | ||
| 4603 | last-input-event) ?\t) | ||
| 4604 | (and (not (event-modifiers last-input-event)) | ||
| 4605 | (or (char-equal | ||
| 4606 | (funcall (symbol-function 'event-to-character) | ||
| 4607 | last-input-event) ?\?) | ||
| 4608 | (char-equal | ||
| 4609 | (funcall (symbol-function 'event-to-character) | ||
| 4610 | last-input-event) ?\ ))))))) | ||
| 4611 | 4602 | ||
| 4612 | ;; Method, host name and user name completion. | 4603 | ;; Method, host name and user name completion. |
| 4613 | ;; `tramp-completion-dissect-file-name' returns a list of | 4604 | ;; `tramp-completion-dissect-file-name' returns a list of |
| @@ -7575,7 +7566,7 @@ please ensure that the buffers are attached to your email.\n\n") | |||
| 7575 | ;; about Tramp, it does not do the right thing if the target file | 7566 | ;; about Tramp, it does not do the right thing if the target file |
| 7576 | ;; name is a Tramp name. | 7567 | ;; name is a Tramp name. |
| 7577 | ;; * Username and hostname completion. | 7568 | ;; * Username and hostname completion. |
| 7578 | ;; ** Try to avoid usage of `last-input-event' in `tramp-completion-mode'. | 7569 | ;; ** Try to avoid usage of `last-input-event' in `tramp-completion-mode-p'. |
| 7579 | ;; ** Unify `tramp-parse-{rhosts,shosts,sconfig,hosts,passwd,netrc}'. | 7570 | ;; ** Unify `tramp-parse-{rhosts,shosts,sconfig,hosts,passwd,netrc}'. |
| 7580 | ;; Code is nearly identical. | 7571 | ;; Code is nearly identical. |
| 7581 | ;; * Allow out-of-band methods as _last_ multi-hop. | 7572 | ;; * Allow out-of-band methods as _last_ multi-hop. |