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 [EMACS_22_BASE]


From: Michael Albinus
Subject: [Emacs-diffs] Changes to emacs/lisp/net/tramp.el,v [EMACS_22_BASE]
Date: Sat, 06 Oct 2007 15:25:52 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Branch:         EMACS_22_BASE
Changes by:     Michael Albinus <albinus>       07/10/06 15:25:51

Index: net/tramp.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/net/tramp.el,v
retrieving revision 1.124.2.6
retrieving revision 1.124.2.7
diff -u -b -r1.124.2.6 -r1.124.2.7
--- net/tramp.el        24 Sep 2007 05:42:34 -0000      1.124.2.6
+++ net/tramp.el        6 Oct 2007 15:25:50 -0000       1.124.2.7
@@ -4554,7 +4554,12 @@
 ;;; File name handler functions for completion mode
 
 (defvar tramp-completion-mode nil
-  "If non-nil, we are in file name completion mode.")
+  "If non-nil, external packages signal that they are in file name completion.
+
+This is necessary, because Tramp uses a heuristic depending on last
+input event.  This fails when external packages use other characters
+but <TAB>, <SPACE> or ?\\? for file name completion.  This variable
+should never be set globally, the intention is to let-bind it.")
 
 ;; Necessary because `tramp-file-name-regexp-unified' and
 ;; `tramp-completion-file-name-regexp-unified' aren't different.
@@ -4579,23 +4584,33 @@
      file)
     (member (match-string 1 file) (mapcar 'car tramp-methods)))
    ((or
-     ;; Emacs
-     (not (memq last-input-event '(return newline)))
+     ;; Emacs.
+     (equal last-input-event 'tab)
      (and (natnump last-input-event)
-         (not (char-equal last-input-event ?\n))
-         (not (char-equal last-input-event ?\r)))
-     ;; XEmacs
+         (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 ?\ )))))
+     ;; 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)
-         (not (char-equal
+         (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
                (funcall (symbol-function 'event-to-character)
-                        last-input-event) ?\n))
-         (not (char-equal
+                             last-input-event) ?\?)
+                   (char-equal
                (funcall (symbol-function 'event-to-character)
-                        last-input-event) ?\r))))
+                             last-input-event) ?\ ))))))
     t)))
 
 ;; Method, host name and user name completion.




reply via email to

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