From unknown Sat Sep 06 09:45:49 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#4260: 23.1.50; tramp is loading unnecessarily Reply-To: Peter Dyballa , 4260@debbugs.gnu.org Resent-From: Peter Dyballa Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Tue, 25 Aug 2009 22:25:06 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: report 4260 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by submit@emacsbugs.donarmstrong.com id=B.125123884416059 (code B ref -1); Tue, 25 Aug 2009 22:25:06 +0000 Received: (at submit) by emacsbugs.donarmstrong.com; 25 Aug 2009 22:20:44 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-2.2 required=4.0 tests=AWL,FOURLA autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7PMKgpp016056 for ; Tue, 25 Aug 2009 15:20:44 -0700 Received: from mail.gnu.org ([199.232.76.166]:56765 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1Mg4Ne-0004TL-5x for emacs-pretest-bug@gnu.org; Tue, 25 Aug 2009 18:20:42 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Mg4Nb-00046v-6T for emacs-pretest-bug@gnu.org; Tue, 25 Aug 2009 18:20:41 -0400 Received: from mout4.freenet.de ([195.4.92.94]:45023) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Mg4Na-00046V-Md for emacs-pretest-bug@gnu.org; Tue, 25 Aug 2009 18:20:38 -0400 Received: from [195.4.92.27] (helo=17.mx.freenet.de) by mout4.freenet.de with esmtpa (ID peter_dyballa@freenet.de) (port 25) (Exim 4.69 #92) id 1Mg4NX-0006T5-3F for emacs-pretest-bug@gnu.org; Wed, 26 Aug 2009 00:20:35 +0200 Received: from p5b23f087.dip.t-dialin.net ([91.35.240.135]:56862 helo=[192.168.1.2]) by 17.mx.freenet.de with esmtpsa (ID peter_dyballa@freenet.de) (TLSv1:AES128-SHA:128) (port 587) (Exim 4.69 #94) id 1Mg4NW-0006jv-QP for emacs-pretest-bug@gnu.org; Wed, 26 Aug 2009 00:20:35 +0200 Mime-Version: 1.0 (Apple Message framework v753.1) Content-Transfer-Encoding: quoted-printable Message-Id: Content-Type: text/plain; charset=WINDOWS-1252; delsp=yes; format=flowed To: emacs-pretest-bug@gnu.org From: Peter Dyballa Date: Wed, 26 Aug 2009 00:20:31 +0200 X-Mailer: Apple Mail (2.753.1) X-purgate-ID: 149285::1251238835-00005F40-9C6AD277/0-0/0-0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Hello! When I type C-x d /Vol TAB to visit a local directory and expand its =20 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 =20 sequence) in / and move the text cursor onto the Volumes entry and =20 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 =20 neither loaded. Why is TRAMP loaded at all in some situation when I try to access a =20 local file system? In GNU Emacs 23.1.50.1 (powerpc-apple-darwin8.11.0, X toolkit, Xaw3d =20 scroll bars) of 2009-08-25 on Latsche.local Windowing system distributor `The XFree86 Project, Inc', version =20 11.0.40400000 configured using `configure '--without-sound' '--without-pop' '--=20 without-dbus' '--with-x-toolkit=3Dathena' '--enable-locallisppath=3D/=20 Library/Application Support/Emacs/calendar23:/Library/Application =20 Support/Emacs' 'CPPFLAGS=3D-no-cpp-precomp -I/sw/include -I/sw/lib/=20 pango-ft219/include/pango-1.0 -idirafter -I/usr/X11R6/include' =20 'CFLAGS=3D-ggdb3 -gfull -mtraceback=3Dfull -Wno-pointer-sign -H -pipe -=20= fPIC -mcpu=3D7450 -mtune=3D7450 -fast -mpim-altivec -ftree-vectorize -=20= foptimize-register-move -freorder-blocks -fthread-jumps -fpeephole -=20 fno-crossjumping' 'LDFLAGS=3D-dead_strip -multiply_defined suppress -L/=20= sw/lib' 'C_SWITCH_X_SITE=3D-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: C-x 2 C-x b C-x o C-x d / f f > s < s C-x d / V o C-g 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=FC=DFen Pete The problem with the French is that they don't have a word for =AB =20 entrepreneur =BB. =96 Georges W. Bush From unknown Sat Sep 06 09:45:49 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#4260: 23.1.50; tramp is loading unnecessarily Reply-To: Michael Albinus , 4260@debbugs.gnu.org Resent-From: Michael Albinus Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Wed, 26 Aug 2009 08:00:08 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: followup 4260 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 4260-submit@emacsbugs.donarmstrong.com id=B4260.125127336821038 (code B ref 4260); Wed, 26 Aug 2009 08:00:08 +0000 Received: (at 4260) by emacsbugs.donarmstrong.com; 26 Aug 2009 07:56:08 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.1 required=4.0 tests=AWL,HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from mailrelay2.alcatel.de (mailrelay2.alcatel.de [194.113.59.96]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7Q7u5SR021033 for <4260@emacsbugs.donarmstrong.com>; Wed, 26 Aug 2009 00:56:07 -0700 Received: from destgsu0048.stgl.sel.alcatel.de (destgsu0048.de.alcatel-lucent.com [149.204.242.4]) by mailrelay2.alcatel.de (8.13.8/8.13.8/ICT) with ESMTP id n7Q7txYv002426; Wed, 26 Aug 2009 09:55:59 +0200 Received: from slbhn1.alcatel.de (slbhn1.de.alcatel-lucent.com [149.204.90.35]) by destgsu0048.stgl.sel.alcatel.de (8.12.3/8.12.3) with ESMTP id n7Q7twY4013832; Wed, 26 Aug 2009 09:55:58 +0200 (MEST) From: Michael Albinus To: Peter Dyballa Cc: 4260@debbugs.gnu.org References: Date: Wed, 26 Aug 2009 09:55:57 +0200 In-Reply-To: (Peter Dyballa's message of "Wed, 26 Aug 2009 00:20:31 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Alcanet-virus-scanned: n7Q7twY4013832 at destgsu0048.stgl.sel.alcatel.de X-Scanned-By: MIMEDefang 2.57 on 149.204.45.73 Peter Dyballa 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 . 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=C3=BC=C3=9Fen > > Pete Best regards, Michael. From unknown Sat Sep 06 09:45:49 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#4260: 23.1.50; tramp is loading unnecessarily Reply-To: Stefan Monnier , 4260@debbugs.gnu.org Resent-From: Stefan Monnier Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Thu, 27 Aug 2009 05:10:07 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: followup 4260 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 4260-submit@emacsbugs.donarmstrong.com id=B4260.125134934824262 (code B ref 4260); Thu, 27 Aug 2009 05:10:07 +0000 Received: (at 4260) by emacsbugs.donarmstrong.com; 27 Aug 2009 05:02:28 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-2.7 required=4.0 tests=AWL,HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from ironport2-out.teksavvy.com (ironport2-out.teksavvy.com [206.248.154.182]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7R52Q9d024255 for <4260@emacsbugs.donarmstrong.com>; Wed, 26 Aug 2009 22:02:27 -0700 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: As8EADGwlUpFpYuS/2dsb2JhbACBU9ZKhBoFh2M X-IronPort-AV: E=Sophos;i="4.44,283,1249272000"; d="scan'208";a="44279904" Received: from 69-165-139-146.dsl.teksavvy.com (HELO ceviche.home) ([69.165.139.146]) by ironport2-out.teksavvy.com with ESMTP; 27 Aug 2009 01:01:25 -0400 Received: by ceviche.home (Postfix, from userid 20848) id 078F1B40F3; Thu, 27 Aug 2009 01:02:19 -0400 (EDT) From: Stefan Monnier To: Michael Albinus Cc: 4260@debbugs.gnu.org, Peter Dyballa Message-ID: References: Date: Thu, 27 Aug 2009 01:02:19 -0400 In-Reply-To: (Michael Albinus's message of "Wed, 26 Aug 2009 09:55:57 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii > 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 From unknown Sat Sep 06 09:45:49 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#4260: 23.1.50; tramp is loading unnecessarily Reply-To: Michael Albinus , 4260@debbugs.gnu.org Resent-From: Michael Albinus Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Thu, 27 Aug 2009 06:45:06 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: followup 4260 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 4260-submit@emacsbugs.donarmstrong.com id=B4260.12513551396897 (code B ref 4260); Thu, 27 Aug 2009 06:45:06 +0000 Received: (at 4260) by emacsbugs.donarmstrong.com; 27 Aug 2009 06:38:59 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.1 required=4.0 tests=AWL,HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from mailrelay2.alcatel.de (mailrelay2.alcatel.de [194.113.59.96]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7R6cv32006891 for <4260@emacsbugs.donarmstrong.com>; Wed, 26 Aug 2009 23:38:58 -0700 Received: from destgsu0048.stgl.sel.alcatel.de (destgsu0048.de.alcatel-lucent.com [149.204.242.4]) by mailrelay2.alcatel.de (8.13.8/8.13.8/ICT) with ESMTP id n7R6cps2011366; Thu, 27 Aug 2009 08:38:51 +0200 Received: from slbhn1.alcatel.de (slbhn1.de.alcatel-lucent.com [149.204.90.35]) by destgsu0048.stgl.sel.alcatel.de (8.12.3/8.12.3) with ESMTP id n7R6clY4020485; Thu, 27 Aug 2009 08:38:50 +0200 (MEST) From: Michael Albinus To: Stefan Monnier Cc: "4260\@debbugs.gnu.org" <4260@debbugs.gnu.org>, Peter Dyballa References: Date: Thu, 27 Aug 2009 08:38:45 +0200 In-Reply-To: (Stefan Monnier's message of "Thu, 27 Aug 2009 07:02:19 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Alcanet-virus-scanned: n7R6clY4020485 at destgsu0048.stgl.sel.alcatel.de X-Scanned-By: MIMEDefang 2.57 on 149.204.45.73 Stefan Monnier 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. From unknown Sat Sep 06 09:45:49 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#4260: 23.1.50; tramp is loading unnecessarily Reply-To: Stefan Monnier , 4260@debbugs.gnu.org Resent-From: Stefan Monnier Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Thu, 27 Aug 2009 18:00:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: followup 4260 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 4260-submit@emacsbugs.donarmstrong.com id=B4260.125139567831237 (code B ref 4260); Thu, 27 Aug 2009 18:00:04 +0000 Received: (at 4260) by emacsbugs.donarmstrong.com; 27 Aug 2009 17:54:38 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.6 required=4.0 tests=AWL,FOURLA,HAS_BUG_NUMBER, IMPRONONCABLE_1,MURPHY_DRUGS_REL8,MURPHY_WRONG_WORD2 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from pruche.dit.umontreal.ca (pruche.dit.umontreal.ca [132.204.246.22]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7RHsYQU031232 for <4260@emacsbugs.donarmstrong.com>; Thu, 27 Aug 2009 10:54:36 -0700 Received: from faina.iro.umontreal.ca (faina.iro.umontreal.ca [132.204.26.177]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id n7RHsXLb032189; Thu, 27 Aug 2009 13:54:33 -0400 Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id 4EA6B3A06F; Thu, 27 Aug 2009 13:54:33 -0400 (EDT) From: Stefan Monnier To: Michael Albinus Cc: "4260\@debbugs.gnu.org" <4260@debbugs.gnu.org>, Peter Dyballa Message-ID: References: Date: Thu, 27 Aug 2009 13:54:33 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit X-NAI-Spam-Level: X-NAI-Spam-Score: 0.1 X-NAI-Spam-Rules: 2 Rules triggered PHISH_ACC_002=0.1, RV3350=0 >>> 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 From unknown Sat Sep 06 09:45:49 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#4260: 23.1.50; tramp is loading unnecessarily Reply-To: Michael Albinus , 4260@debbugs.gnu.org Resent-From: Michael Albinus Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Fri, 28 Aug 2009 12:20:06 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: followup 4260 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 4260-submit@emacsbugs.donarmstrong.com id=B4260.125146175015616 (code B ref 4260); Fri, 28 Aug 2009 12:20:06 +0000 Received: (at 4260) by emacsbugs.donarmstrong.com; 28 Aug 2009 12:15:50 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.1 required=4.0 tests=AWL,HAS_BUG_NUMBER, MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from mailrelay2.alcatel.de (mailrelay2.alcatel.de [194.113.59.96]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7SCFmCg015610 for <4260@emacsbugs.donarmstrong.com>; Fri, 28 Aug 2009 05:15:50 -0700 Received: from destgsu0048.stgl.sel.alcatel.de (destgsu0048.de.alcatel-lucent.com [149.204.242.4]) by mailrelay2.alcatel.de (8.13.8/8.13.8/ICT) with ESMTP id n7SCFgWw007104; Fri, 28 Aug 2009 14:15:42 +0200 Received: from slbhn1.alcatel.de (slbhn1.de.alcatel-lucent.com [149.204.90.35]) by destgsu0048.stgl.sel.alcatel.de (8.12.3/8.12.3) with ESMTP id n7SCFfY4008337; Fri, 28 Aug 2009 14:15:41 +0200 (MEST) From: Michael Albinus To: Stefan Monnier Cc: "4260-done\@debbugs.gnu.org" <4260@debbugs.gnu.org>, Peter Dyballa References: Date: Fri, 28 Aug 2009 14:15:40 +0200 In-Reply-To: (Stefan Monnier's message of "Thu, 27 Aug 2009 19:54:33 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Alcanet-virus-scanned: n7SCFfY4008337 at destgsu0048.stgl.sel.alcatel.de X-Scanned-By: MIMEDefang 2.57 on 149.204.45.73 Stefan Monnier 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. From cyd@stupidchicken.com Fri Sep 11 19:04:13 2009 Received: (at control) by emacsbugs.donarmstrong.com; 12 Sep 2009 02:04:13 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-0.4 required=4.0 tests=AWL autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from pantheon-po32.its.yale.edu (pantheon-po32.its.yale.edu [130.132.50.88]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n8C24BxT015769 for ; Fri, 11 Sep 2009 19:04:13 -0700 Received: from furry (dhcp128036014244.central.yale.edu [128.36.14.244]) (authenticated bits=0) by pantheon-po32.its.yale.edu (8.12.11.20060308/8.12.11) with ESMTP id n8C24611006205 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Fri, 11 Sep 2009 22:04:06 -0400 Received: by furry (Postfix, from userid 1000) id DCCC3C070; Fri, 11 Sep 2009 22:04:06 -0400 (EDT) From: Chong Yidong To: control@debbugs.gnu.org Subject: close 4260 Date: Fri, 11 Sep 2009 22:04:06 -0400 Message-ID: <87vdjodill.fsf@stupidchicken.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-YaleITSMailFilter: Version 1.2c (attachment(s) not renamed) close 4260 thanks