From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Emacs unconditionally loads tramp.el Date: Tue, 25 Apr 2006 14:44:00 -0400 Message-ID: References: <87r73n5o5x.fsf@pacem.orebokech.com> <87iroz5g0z.fsf@pacem.orebokech.com> <87u08iyd2r.fsf@gmx.de> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1145990697 11328 80.91.229.2 (25 Apr 2006 18:44:57 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 25 Apr 2006 18:44:57 +0000 (UTC) Cc: romain@orebokech.com, rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Apr 25 20:44:52 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FYSWV-000638-4Q for ged-emacs-devel@m.gmane.org; Tue, 25 Apr 2006 20:44:31 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FYSWU-0002qR-Kn for ged-emacs-devel@m.gmane.org; Tue, 25 Apr 2006 14:44:30 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FYSWF-0002nn-HX for emacs-devel@gnu.org; Tue, 25 Apr 2006 14:44:15 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FYSWB-0002gg-O5 for emacs-devel@gnu.org; Tue, 25 Apr 2006 14:44:15 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FYSWB-0002gL-11 for emacs-devel@gnu.org; Tue, 25 Apr 2006 14:44:11 -0400 Original-Received: from [132.204.24.67] (helo=mercure.iro.umontreal.ca) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FYSYd-0001NJ-Tt; Tue, 25 Apr 2006 14:46:44 -0400 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id E19152CF46F; Tue, 25 Apr 2006 14:44:06 -0400 (EDT) Original-Received: from asado.iro.umontreal.ca (asado.iro.umontreal.ca [132.204.24.84]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id 4DD89445C; Tue, 25 Apr 2006 14:44:00 -0400 (EDT) Original-Received: by asado.iro.umontreal.ca (Postfix, from userid 20848) id 31AEC71500; Tue, 25 Apr 2006 14:44:00 -0400 (EDT) Original-To: Michael Albinus In-Reply-To: (Michael Albinus's message of "Tue, 25 Apr 2006 20:10:51 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-2.82, requis 5, autolearn=not spam, ALL_TRUSTED -2.82) X-DIRO-MailScanner-From: monnier@iro.umontreal.ca X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:53402 Archived-At: >> So how about if move the Tramp completion function to files.el >> in the same way? > That would solve this problem. `tramp-completion-file-name-handler=B4 is > sufficiently stable (last change on 2002-10-11). Shall I apply this patch? BTW if you'd rather keep all the code in tramp.el rather than spread a bit of it in files.el, you can use the ;;;###autoload trick. That is, place in tramp.el either ;;;###autoload (defun tramp-completion-file-name-handler (operation &rest a= rgs) ;;;###autoload "Invoke tramp file name completion handler. ;;;###autoload Falls back to normal file name handler if no tramp file name= handler exists." ;;;###autoload ;; (setq tramp-debug-buffer t) ;;;###autoload ;; (tramp-message 1 "%s %s" operation args) ;;;###autoload ;; (tramp-message 1 "%s %s\n%s" ;;;###autoload ;; operation args (with-output-to-string (backtrace))) ;;;###autoload (let ((fn (assoc operation tramp-completion-file-name-hand= ler-alist))) ;;;###autoload (if fn ;;;###autoload (save-match-data (apply (cdr fn) args)) ;;;###autoload (tramp-completion-run-real-handler operation args)))) or ;;;###autoload (progn (defun tramp-completion-file-name-handler (operation &rest args) "Invoke tramp file name completion handler. Falls back to normal file name handler if no tramp file name handler exists= ." ;; (setq tramp-debug-buffer t) ;; (tramp-message 1 "%s %s" operation args) ;; (tramp-message 1 "%s %s\n%s" ;; operation args (with-output-to-string (backtrace))) (let ((fn (assoc operation tramp-completion-file-name-handler-alist))) (if fn (save-match-data (apply (cdr fn) args)) (tramp-completion-run-real-handler operation args))))) so that the complete function gets copied to loaddefs.el (not just a short `autoload statement). We use this in vc-*.el so that the code that determines whether a file is under CVS or not can be in vc-cvs.el and preloaded even though vc-cvs.el is not itself preloaded. Stefan