emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/net/tramp.el,v


From: Michael Albinus
Subject: [Emacs-diffs] Changes to emacs/lisp/net/tramp.el,v
Date: Mon, 24 Sep 2007 05:29:30 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Michael Albinus <albinus>       07/09/24 05:29:29

Index: net/tramp.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/net/tramp.el,v
retrieving revision 1.137
retrieving revision 1.138
diff -u -b -r1.137 -r1.138
--- net/tramp.el        21 Sep 2007 05:24:06 -0000      1.137
+++ net/tramp.el        24 Sep 2007 05:29:29 -0000      1.138
@@ -4345,7 +4345,7 @@
 (defun tramp-find-foreign-file-name-handler (filename)
   "Return foreign file name handler if exists."
   (when (and (stringp filename) (tramp-tramp-file-p filename)
-            (or (not (tramp-completion-mode))
+            (or (not (tramp-completion-mode-p))
                 (not (string-match
                       tramp-completion-file-name-regexp filename))))
     (let (elt
@@ -4366,7 +4366,7 @@
 Falls back to normal file name handler if no tramp file name handler exists."
   (save-match-data
     (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)))
       (with-parsed-tramp-file-name filename nil
        (cond
@@ -4579,35 +4579,26 @@
 ;; tramp file name syntax. Maybe another variable should be introduced
 ;; overwriting this check in such cases. Or we change tramp file name
 ;; 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."
-  (or (equal last-input-event 'tab)
+  (or
       ;; Emacs
+   (not (memq last-input-event '(return newline)))
       (and (natnump last-input-event)
-          (or
-           ;; ?\t has event-modifier 'control
-           (char-equal last-input-event ?\t)
-           (and (not (event-modifiers last-input-event))
-                (or (char-equal last-input-event ?\?)
-                    (char-equal last-input-event ?\ )))))
+       (not (char-equal last-input-event ?\n))
+       (not (char-equal last-input-event ?\r)))
       ;; XEmacs
       (and (featurep 'xemacs)
           ;; `last-input-event' might be nil.
           (not (null last-input-event))
           ;; `last-input-event' may have no character approximation.
           (funcall (symbol-function 'event-to-character) last-input-event)
-          (or
-           ;; ?\t has event-modifier 'control
-           (char-equal
-            (funcall (symbol-function 'event-to-character)
-                     last-input-event) ?\t)
-           (and (not (event-modifiers last-input-event))
-                (or (char-equal
+       (not (char-equal
                      (funcall (symbol-function 'event-to-character)
-                              last-input-event) ?\?)
-                    (char-equal
+                      last-input-event) ?\n))
+       (not (char-equal
                      (funcall (symbol-function 'event-to-character)
-                              last-input-event) ?\ )))))))
+                      last-input-event) ?\r)))))
 
 ;; Method, host name and user name completion.
 ;; `tramp-completion-dissect-file-name' returns a list of
@@ -7575,7 +7566,7 @@
 ;;   about Tramp, it does not do the right thing if the target file
 ;;   name is a Tramp name.
 ;; * 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}'.
 ;;    Code is nearly identical.
 ;; * Allow out-of-band methods as _last_ multi-hop.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]