GNU bug report logs -
#4260
23.1.50; tramp is loading unnecessarily
Previous Next
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 4260 in the body.
You can then email your comments to 4260 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#4260
; Package
emacs
.
(Tue, 25 Aug 2009 22:25:07 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Peter Dyballa <Peter_Dyballa <at> Freenet.DE>
:
New bug report received and forwarded. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Tue, 25 Aug 2009 22:25:07 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):
Hello!
When I type C-x d /Vol TAB to visit a local directory and expand its
name TRAMP is loaded without reason.
When I launch GNU Emacs as
src/emacs-23.1.50.1 -Q lisp/emacs-lisp &
TRAMP is not loaded. It is also not loaded when I type
C-x d M-DEL inter TAB RET
When I type
C-x d / RET
TRAMP is not loaded. When I now type
C-x d Vol TAB
TRAMP is loaded. When I am (in new session and in the same test
sequence) in / and move the text cursor onto the Volumes entry and
press f TRAMP is not loaded.
When I launch GNU Emacs as
src/emacs-23.1.50.1 -Q /Volumes &
TRAMP is not loaded. When I f(ollow) into a sub-directory TRAMP is
neither loaded.
Why is TRAMP loaded at all in some situation when I try to access a
local file system?
In GNU Emacs 23.1.50.1 (powerpc-apple-darwin8.11.0, X toolkit, Xaw3d
scroll bars)
of 2009-08-25 on Latsche.local
Windowing system distributor `The XFree86 Project, Inc', version
11.0.40400000
configured using `configure '--without-sound' '--without-pop' '--
without-dbus' '--with-x-toolkit=athena' '--enable-locallisppath=/
Library/Application Support/Emacs/calendar23:/Library/Application
Support/Emacs' 'CPPFLAGS=-no-cpp-precomp -I/sw/include -I/sw/lib/
pango-ft219/include/pango-1.0 -idirafter -I/usr/X11R6/include'
'CFLAGS=-ggdb3 -gfull -mtraceback=full -Wno-pointer-sign -H -pipe -
fPIC -mcpu=7450 -mtune=7450 -fast -mpim-altivec -ftree-vectorize -
foptimize-register-move -freorder-blocks -fthread-jumps -fpeephole -
fno-crossjumping' 'LDFLAGS=-dead_strip -multiply_defined suppress -L/
sw/lib' 'C_SWITCH_X_SITE=-idirafter -I/usr/X11R6/include''
Important settings:
value of $LC_ALL: nil
value of $LC_COLLATE: nil
value of $LC_CTYPE: de_DE.UTF-8
value of $LC_MESSAGES: nil
value of $LC_MONETARY: nil
value of $LC_NUMERIC: nil
value of $LC_TIME: nil
value of $LANG: de_DE.UTF-8
value of $XMODIFIERS: nil
locale-coding-system: utf-8-unix
default-enable-multibyte-characters: t
Major mode: Dired by name
Minor modes in effect:
shell-dirtrack-mode: t
tooltip-mode: t
mouse-wheel-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
blink-cursor-mode: t
global-auto-composition-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
line-number-mode: t
transient-mark-mode: t
Recent input:
<down-mouse-1> <mouse-1> C-x 2 C-x b <return> C-x o
C-x d / <return> <next> <up> <up> <up> <up> f <down>
f <escape> > s <prior> <home> <escape> < s C-x d /
V o <tab> C-g <help-echo> <help-echo> <help-echo> <help-echo>
<help-echo> <help-echo> <menu-bar> <help-menu> <send-emacs-bug-report>
Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Mark set [2 times]
Loading tramp...done
Quit
--
Mit friedvollen Grüßen
Pete
The problem with the French is that they don't have a word for «
entrepreneur ».
– Georges W. Bush
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#4260
; Package
emacs
.
(Wed, 26 Aug 2009 08:00:08 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Michael Albinus <michael.albinus <at> gmx.de>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Wed, 26 Aug 2009 08:00:08 GMT)
Full text and
rfc822 format available.
Message #10 received at 4260 <at> emacsbugs.donarmstrong.com (full text, mbox):
Peter Dyballa <Peter_Dyballa <at> Freenet.DE> writes:
> Hello!
Hi,
> Why is TRAMP loaded at all in some situation when I try to access a
> local file system?
Short answer:
Because partial completion is enabled by default in Emacs 23. It wasn't
in Emacs 22.
As workaround, you could place in your .emacs
(setq completion-styles (delete 'partial-completion completion-styles))
Long answer:
See discussion in <http://thread.gmane.org/gmane.emacs.bugs/29783>. I'll
still thinking about, how to disable Tramp loading when you just have
typed "/s TAB" or alike. The proposal of David sounds interesting (load
Tramp only when "/s: TAB" is pressed), but it raises new problems.
The current completion algorithm for methods, host names and user names
in Tramp completes only on the right-hand-side of a
delimiter. Completing "/s:" to "/ssh:" requires a new algorithm, I'm
working on.
> Mit friedvollen Grüßen
>
> Pete
Best regards, Michael.
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#4260
; Package
emacs
.
(Thu, 27 Aug 2009 05:10:07 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Stefan Monnier <monnier <at> iro.umontreal.ca>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Thu, 27 Aug 2009 05:10:07 GMT)
Full text and
rfc822 format available.
Message #15 received at 4260 <at> emacsbugs.donarmstrong.com (full text, mbox):
> Because partial completion is enabled by default in Emacs 23. It wasn't
> in Emacs 22.
As I said, I think the current behavior is wrong and should be fixed.
"check if partial-completion is enabled" was a heuristic which worked in
Emacs-23. It's not The Right Thing. So we shouldn't take it as holy
word and stick to it. Instead we should revisit it.
The thing that does matter is that "emacs -Q" should not autoload Tramp when
you just do C-x C-f /s TAB
Stefan
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#4260
; Package
emacs
.
(Thu, 27 Aug 2009 06:45:06 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Michael Albinus <michael.albinus <at> gmx.de>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Thu, 27 Aug 2009 06:45:06 GMT)
Full text and
rfc822 format available.
Message #20 received at 4260 <at> emacsbugs.donarmstrong.com (full text, mbox):
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
>> Because partial completion is enabled by default in Emacs 23. It wasn't
>> in Emacs 22.
>
> As I said, I think the current behavior is wrong and should be fixed.
> "check if partial-completion is enabled" was a heuristic which worked in
> Emacs-23. It's not The Right Thing. So we shouldn't take it as holy
> word and stick to it. Instead we should revisit it.
> The thing that does matter is that "emacs -Q" should not autoload Tramp when
> you just do C-x C-f /s TAB
That's what I'm working on. Tramp shall not be loaded before you type
"C-x C-f /s: TAB" or "C-x C-f /s@ TAB".
Alternatively, we could introduce another value `remote-completion' (or
something like this) to be added to `completion-styles'. Then a user
must place in her .emacs
(add-to-list 'completion-styles 'remote-completion)
Which solution do you prefer?
> Stefan
Best regards, Michael.
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#4260
; Package
emacs
.
(Thu, 27 Aug 2009 18:00:04 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Stefan Monnier <monnier <at> IRO.UMontreal.CA>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Thu, 27 Aug 2009 18:00:04 GMT)
Full text and
rfc822 format available.
Message #25 received at 4260 <at> emacsbugs.donarmstrong.com (full text, mbox):
>>> Because partial completion is enabled by default in Emacs 23. It wasn't
>>> in Emacs 22.
>>
>> As I said, I think the current behavior is wrong and should be fixed.
>> "check if partial-completion is enabled" was a heuristic which worked in
>> Emacs-23. It's not The Right Thing. So we shouldn't take it as holy
>> word and stick to it. Instead we should revisit it.
>> The thing that does matter is that "emacs -Q" should not autoload Tramp when
>> you just do C-x C-f /s TAB
> That's what I'm working on. Tramp shall not be loaded before you type
> "C-x C-f /s: TAB" or "C-x C-f /s@ TAB".
> Alternatively, we could introduce another value `remote-completion' (or
> something like this) to be added to `completion-styles'. Then a user
> must place in her .emacs
> (add-to-list 'completion-styles 'remote-completion)
> Which solution do you prefer?
completion-styles has nothing to do with it, so it would be wrong to
abuse it this way: completion-styles is about how to use
completion-tables to provide the completion UI, whereas the problem at
hand is about whether (and when) the file name completion-table should
provide completion of Tramp method/host/user names.
As mentioned, one way to go about it is to only provide this completion
when Tramp is loaded (e.g. with the sample patch below). Or maybe we can be
more clever.
Stefan
Using submit branch file:///home/monnier/src/emacs/bzr/trunk/
=== modified file 'lisp/net/tramp.el'
--- lisp/net/tramp.el 2009-08-18 01:11:33 +0000
+++ lisp/net/tramp.el 2009-08-18 15:47:13 +0000
@@ -987,7 +987,9 @@
:type 'regexp)
(defcustom tramp-shell-prompt-pattern
- "^[^#$%>\n]*[#$%>] *\\(\e\\[[0-9;]*[a-zA-Z] *\\)*"
+ ;; Allow a prompt to start right after a ^M since it indeed would be
+ ;; displayed at the beginning of the line (and Zsh uses it).
+ "\\(?:^\\|
\\)[^#$%>\n]*[#$%>] *\\(\e\\[[0-9;]*[a-zA-Z] *\\)*"
"Regexp to match prompts from remote shell.
Normally, Tramp expects you to configure `shell-prompt-pattern'
correctly, but sometimes it happens that you are connecting to a
@@ -1369,29 +1371,29 @@
;;;###autoload
(defconst tramp-root-regexp
(if (memq system-type '(cygwin windows-nt))
- "^\\([a-zA-Z]:\\)?/"
- "^/")
+ "\\`\\([a-zA-Z]:\\)?/"
+ "\\`/")
"Beginning of an incomplete Tramp file name.
-Usually, it is just \"^/\". On W32 systems, there might be a
+Usually, it is just \"\\\\`/\". On W32 systems, there might be a
volume letter, which will be removed by `tramp-drop-volume-letter'.")
;;;###autoload
(defconst tramp-completion-file-name-regexp-unified
- (concat tramp-root-regexp "[^/]*$")
+ (concat tramp-root-regexp "[^/]*\\'")
"Value for `tramp-completion-file-name-regexp' for unified remoting.
GNU Emacs uses a unified filename syntax for Tramp and Ange-FTP.
See `tramp-file-name-structure' for more explanations.")
;;;###autoload
(defconst tramp-completion-file-name-regexp-separate
- (concat tramp-root-regexp "\\([[][^]]*\\)?$")
+ (concat tramp-root-regexp "\\([[][^]]*\\)?\\'")
"Value for `tramp-completion-file-name-regexp' for separate remoting.
XEmacs uses a separate filename syntax for Tramp and EFS.
See `tramp-file-name-structure' for more explanations.")
;;;###autoload
(defconst tramp-completion-file-name-regexp-url
- (concat tramp-root-regexp "[^/:]+\\(:\\(/\\(/[^/]*\\)?\\)?\\)?$")
+ (concat tramp-root-regexp "[^/:]+\\(:\\(/\\(/[^/]*\\)?\\)?\\)?\\'")
"Value for `tramp-completion-file-name-regexp' for URL-like remoting.
See `tramp-file-name-structure' for more explanations.")
@@ -2454,6 +2456,8 @@
(defun tramp-handle-file-attributes (filename &optional id-format)
"Like `file-attributes' for Tramp files."
(unless id-format (setq id-format 'integer))
+ ;; Don't modify last-coding-system-used by accident.
+ (let ((last-coding-system-used last-coding-system-used))
(with-parsed-tramp-file-name (expand-file-name filename) nil
(with-file-property v localname (format "file-attributes-%s" id-format)
(when (file-exists-p filename)
@@ -2466,7 +2470,7 @@
(if (tramp-get-remote-perl v)
(tramp-handle-file-attributes-with-perl v localname id-format)
(tramp-handle-file-attributes-with-ls
- v localname id-format)))))))))
+ v localname id-format))))))))))
(defun tramp-handle-file-attributes-with-ls (vec localname &optional id-format)
"Implement `file-attributes' for Tramp files using the ls(1) command."
@@ -2719,6 +2723,8 @@
;; another implementation, see `dired-do-chown'. OTOH, it is mostly
;; working with su(do)? when it is needed, so it shall succeed in
;; the majority of cases.
+ ;; Don't modify last-coding-system-used by accident.
+ (let ((last-coding-system-used last-coding-system-used))
(if (file-remote-p filename)
(with-parsed-tramp-file-name filename nil
(if (and (zerop (user-uid)) (tramp-local-host-p v))
@@ -2739,7 +2745,7 @@
(gid (or (and (integerp gid) gid) (tramp-get-local-gid 'integer))))
(tramp-local-call-process
"chown" nil nil nil
- (format "%d:%d" uid gid) (tramp-shell-quote-argument filename)))))
+ (format "%d:%d" uid gid) (tramp-shell-quote-argument filename))))))
;; Simple functions using the `test' command.
@@ -4889,59 +4895,41 @@
;; would otherwise use backslash.
(let ((directory-sep-char ?/)
(fn (assoc operation tramp-completion-file-name-handler-alist)))
+ (if (and
;; When `tramp-mode' is not enabled, we don't do anything.
- (if (and fn tramp-mode)
+ fn tramp-mode
+ ;; For other syntaxes than `sep', the regexp matches many common
+ ;; situations where the user doesn't actually want to use Tramp.
+ ;; So to avoid autoloading Tramp after typing just "/s", we
+ ;; disable this part of the completion, unless the user implicitly
+ ;; indicated his interest in using a fancier completion system.
+ (or (eq tramp-syntax 'sep)
+ (featurep 'tramp) ;If it's loaded, we may as well use it.
+ (and (boundp 'partial-completion-mode) partial-completion-mode)
+ ;; FIXME: These may have been loaded even if the user never
+ ;; intended to use them.
+ (featurep 'ido)
+ (featurep 'icicles)))
(save-match-data (apply (cdr fn) args))
(tramp-completion-run-real-handler operation args)))))
;;;###autoload
-(defsubst tramp-register-file-name-handler ()
- "Add Tramp file name handler to `file-name-handler-alist'."
- ;; Remove autoloaded handler from file name handler alist. Useful,
+(defsubst tramp-register-file-name-handlers ()
+ "Add Tramp file name handlers to `file-name-handler-alist'."
+ ;; Remove autoloaded handlers from file name handler alist. Useful,
;; if `tramp-syntax' has been changed.
(let ((a1 (rassq 'tramp-file-name-handler file-name-handler-alist)))
- (setq file-name-handler-alist (delete a1 file-name-handler-alist)))
- ;; Add the handler.
- (add-to-list 'file-name-handler-alist
- (cons tramp-file-name-regexp 'tramp-file-name-handler))
- ;; If jka-compr is already loaded, move it to the front of
- ;; `file-name-handler-alist'.
- (let ((jka (rassoc 'jka-compr-handler file-name-handler-alist)))
- (when jka
- (setq file-name-handler-alist
- (cons jka (delete jka file-name-handler-alist))))))
-
-;; `tramp-file-name-handler' must be registered before evaluation of
-;; site-start and init files, because there might exist remote files
-;; already, f.e. files kept via recentf-mode.
-;;;###autoload(tramp-register-file-name-handler)
-(tramp-register-file-name-handler)
-
-;;;###autoload
-(defsubst tramp-register-completion-file-name-handler ()
- "Add Tramp completion file name handler to `file-name-handler-alist'."
- ;; Remove autoloaded handler from file name handler alist. Useful,
- ;; if `tramp-syntax' has been changed.
+ (setq file-name-handler-alist (delq a1 file-name-handler-alist)))
(let ((a1 (rassq
'tramp-completion-file-name-handler file-name-handler-alist)))
- (setq file-name-handler-alist (delete a1 file-name-handler-alist)))
- ;; In XEmacs, there is another Tramp syntax, so we can enable this
- ;; unconditionally. In GNU Emacs <= 22, method/user/host name
- ;; completion shall be bound to `partial-completion-mode'. Starting
- ;; with GNU Emacs 23, this is replaced by `completion-styles',
- ;; containing symbol `partial-completion'. `ido-mode' and
- ;; `icy-mode' are other packages which extend file name completion.
- (when (or (and (boundp 'partial-completion-mode)
- (symbol-value 'partial-completion-mode))
- (and (boundp 'completion-styles)
- (member 'partial-completion (symbol-value 'completion-styles)))
- (featurep 'xemacs)
- (featurep 'ido)
- (featurep 'icicles))
+ (setq file-name-handler-alist (delq a1 file-name-handler-alist)))
+ ;; Add the handlers.
+ (add-to-list 'file-name-handler-alist
+ (cons tramp-file-name-regexp 'tramp-file-name-handler))
(add-to-list 'file-name-handler-alist
(cons tramp-completion-file-name-regexp
'tramp-completion-file-name-handler))
- (put 'tramp-completion-file-name-handler 'safe-magic t))
+ (put 'tramp-completion-file-name-handler 'safe-magic t)
;; If jka-compr is already loaded, move it to the front of
;; `file-name-handler-alist'.
(let ((jka (rassoc 'jka-compr-handler file-name-handler-alist)))
@@ -4949,13 +4937,11 @@
(setq file-name-handler-alist
(cons jka (delete jka file-name-handler-alist))))))
-;; During autoload, it shall be checked whether
-;; `partial-completion-mode' is active. Therefore, registering of
-;; `tramp-completion-file-name-handler' will be delayed.
-;;;###autoload(add-hook
-;;;###autoload 'after-init-hook
-;;;###autoload 'tramp-register-completion-file-name-handler)
-(tramp-register-completion-file-name-handler)
+;; `tramp-file-name-handler' must be registered before evaluation of
+;; site-start and init files, because there might exist remote files
+;; already, f.e. files kept via recentf-mode.
+;;;###autoload(tramp-register-file-name-handlers)
+(tramp-register-file-name-handlers)
;;;###autoload
(defun tramp-unload-file-name-handlers ()
@@ -6952,7 +6938,7 @@
(unless (stringp (nth 8 attr))
(setcar (nthcdr 8 attr) (tramp-file-mode-from-int (nth 8 attr)))
(when (stringp (car attr))
- (aset (nth 8 attr) 0 ?l)))
+ (setf (nth 8 attr) (concat "l" (substring (nth 8 attr) 1)))))
;; Convert directory indication bit.
(when (string-match "^d" (nth 8 attr))
(setcar attr t))
@@ -7559,7 +7545,7 @@
(file-name-handler-alist
(list
(cons "/"
- '(lambda (operation &rest args)
+ (lambda (operation &rest args)
"Returns OPERATION if it is the one to be checked."
(if (equal check-file-name-operation operation)
operation
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#4260
; Package
emacs
.
(Fri, 28 Aug 2009 12:20:07 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Michael Albinus <michael.albinus <at> gmx.de>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Fri, 28 Aug 2009 12:20:08 GMT)
Full text and
rfc822 format available.
Message #30 received at 4260 <at> emacsbugs.donarmstrong.com (full text, mbox):
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
> As mentioned, one way to go about it is to only provide this completion
> when Tramp is loaded (e.g. with the sample patch below). Or maybe we can be
> more clever.
OK, let's go this way. It is not *so* important, that completion is
autoloaded. I've committed your patch.
> Stefan
Thanks, and best regards, Michael.
bug closed, send any further explanations to Peter Dyballa <Peter_Dyballa <at> Freenet.DE>
Request was from
Chong Yidong <cyd <at> stupidchicken.com>
to
control <at> emacsbugs.donarmstrong.com
.
(Sat, 12 Sep 2009 02:10:07 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> emacsbugs.donarmstrong.com
.
(Sat, 10 Oct 2009 14:24:12 GMT)
Full text and
rfc822 format available.
This bug report was last modified 15 years and 334 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.