1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-24 06:20:43 -08:00

* 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.
This commit is contained in:
Michael Albinus 2007-09-24 05:29:29 +00:00
parent 2de53ca6a2
commit 6c4e47fa46
2 changed files with 29 additions and 31 deletions

View file

@ -1,3 +1,10 @@
2007-09-24 Michael Albinus <michael.albinus@gmx.de>
* 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.
2007-09-24 Adam Hupp <adam@hupp.org> 2007-09-24 Adam Hupp <adam@hupp.org>
* progmodes/python.el (run-python): Import emacs module without * progmodes/python.el (run-python): Import emacs module without

View file

@ -4345,7 +4345,7 @@ ARGS are the arguments OPERATION has been called with."
(defun tramp-find-foreign-file-name-handler (filename) (defun tramp-find-foreign-file-name-handler (filename)
"Return foreign file name handler if exists." "Return foreign file name handler if exists."
(when (and (stringp filename) (tramp-tramp-file-p filename) (when (and (stringp filename) (tramp-tramp-file-p filename)
(or (not (tramp-completion-mode)) (or (not (tramp-completion-mode-p))
(not (string-match (not (string-match
tramp-completion-file-name-regexp filename)))) tramp-completion-file-name-regexp filename))))
(let (elt (let (elt
@ -4366,7 +4366,7 @@ ARGS are the arguments OPERATION has been called with."
Falls back to normal file name handler if no tramp file name handler exists." Falls back to normal file name handler if no tramp file name handler exists."
(save-match-data (save-match-data
(let* ((filename (apply 'tramp-file-name-for-operation operation args)) (let* ((filename (apply 'tramp-file-name-for-operation operation args))
(completion (tramp-completion-mode)) (completion (tramp-completion-mode-p))
(foreign (tramp-find-foreign-file-name-handler filename))) (foreign (tramp-find-foreign-file-name-handler filename)))
(with-parsed-tramp-file-name filename nil (with-parsed-tramp-file-name filename nil
(cond (cond
@ -4579,35 +4579,26 @@ Falls back to normal file name handler if no tramp file name handler exists."
;; tramp file name syntax. Maybe another variable should be introduced ;; tramp file name syntax. Maybe another variable should be introduced
;; overwriting this check in such cases. Or we change tramp file name ;; overwriting this check in such cases. Or we change tramp file name
;; syntax in order to avoid ambiguities, like in XEmacs ... ;; syntax in order to avoid ambiguities, like in XEmacs ...
(defun tramp-completion-mode () (defun tramp-completion-mode-p ()
"Checks whether method / user name / host name completion is active." "Checks whether method / user name / host name completion is active."
(or (equal last-input-event 'tab) (or
;; Emacs ;; Emacs
(and (natnump last-input-event) (not (memq last-input-event '(return newline)))
(or (and (natnump last-input-event)
;; ?\t has event-modifier 'control (not (char-equal last-input-event ?\n))
(char-equal last-input-event ?\t) (not (char-equal last-input-event ?\r)))
(and (not (event-modifiers last-input-event)) ;; XEmacs
(or (char-equal last-input-event ?\?) (and (featurep 'xemacs)
(char-equal last-input-event ?\ ))))) ;; `last-input-event' might be nil.
;; XEmacs (not (null last-input-event))
(and (featurep 'xemacs) ;; `last-input-event' may have no character approximation.
;; `last-input-event' might be nil. (funcall (symbol-function 'event-to-character) last-input-event)
(not (null last-input-event)) (not (char-equal
;; `last-input-event' may have no character approximation. (funcall (symbol-function 'event-to-character)
(funcall (symbol-function 'event-to-character) last-input-event) last-input-event) ?\n))
(or (not (char-equal
;; ?\t has event-modifier 'control (funcall (symbol-function 'event-to-character)
(char-equal last-input-event) ?\r)))))
(funcall (symbol-function 'event-to-character)
last-input-event) ?\t)
(and (not (event-modifiers last-input-event))
(or (char-equal
(funcall (symbol-function 'event-to-character)
last-input-event) ?\?)
(char-equal
(funcall (symbol-function 'event-to-character)
last-input-event) ?\ )))))))
;; Method, host name and user name completion. ;; Method, host name and user name completion.
;; `tramp-completion-dissect-file-name' returns a list of ;; `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")
;; about Tramp, it does not do the right thing if the target file ;; about Tramp, it does not do the right thing if the target file
;; name is a Tramp name. ;; name is a Tramp name.
;; * Username and hostname completion. ;; * Username and hostname completion.
;; ** Try to avoid usage of `last-input-event' in `tramp-completion-mode'. ;; ** Try to avoid usage of `last-input-event' in `tramp-completion-mode-p'.
;; ** Unify `tramp-parse-{rhosts,shosts,sconfig,hosts,passwd,netrc}'. ;; ** Unify `tramp-parse-{rhosts,shosts,sconfig,hosts,passwd,netrc}'.
;; Code is nearly identical. ;; Code is nearly identical.
;; * Allow out-of-band methods as _last_ multi-hop. ;; * Allow out-of-band methods as _last_ multi-hop.