From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.devel Subject: Re: "tramp-completion-file-name-handler: Recursive load" with the trunk code Date: Wed, 19 Mar 2008 15:58:18 +0100 Message-ID: References: <98e737510803182045n6dddd2ffxe237dfd8e58b56aa@mail.gmail.com> <98e737510803190324l21c8cbeeud7040b3076bc620e@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1205938667 30921 80.91.229.12 (19 Mar 2008 14:57:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 19 Mar 2008 14:57:47 +0000 (UTC) Cc: Juanma Barranquero , an0 , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 19 15:58:16 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from mail-forward.uio.no ([129.240.10.42]) by lo.gmane.org with esmtp (Exim 4.50) id 1Jbzk3-0000HG-5r for ged-emacs-devel@m.gmane.org; Wed, 19 Mar 2008 15:58:11 +0100 Original-Received: from mail-mx9.uio.no ([129.240.10.39]) by pat.uio.no with esmtp (Exim 4.67) (envelope-from ) id 1JbzjT-0003tg-Rw for ged-emacs-devel@m.gmane.org; Wed, 19 Mar 2008 15:57:35 +0100 Original-Received: from lists.gnu.org ([199.232.76.165]) by mail-mx9.uio.no with esmtps (TLSv1:AES256-SHA:256) (Exim 4.67) (envelope-from ) id 1JbzjK-0000Sg-RD for ged-emacs-devel@m.gmane.org; Wed, 19 Mar 2008 15:57:35 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JbzjH-0001uQ-Ke for ged-emacs-devel@m.gmane.org; Wed, 19 Mar 2008 10:57:23 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JbzjD-0001u6-LO for emacs-devel@gnu.org; Wed, 19 Mar 2008 10:57:19 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JbzjC-0001th-NI for emacs-devel@gnu.org; Wed, 19 Mar 2008 10:57:18 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JbzjC-0001te-Kl for emacs-devel@gnu.org; Wed, 19 Mar 2008 10:57:18 -0400 Original-Received: from mailrelay1.alcatel.de ([194.113.59.95]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JbzjC-0006lm-8l for emacs-devel@gnu.org; Wed, 19 Mar 2008 10:57:18 -0400 Original-Received: from slbhab.alcatel.de (slbhab.bln.sel.alcatel.de [149.204.63.218]) by mailrelay1.alcatel.de (8.13.8/8.13.8/ICT) with ESMTP id m2JEvC8E023689; Wed, 19 Mar 2008 15:57:12 +0100 User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (hpux) X-Scanned-By: MIMEDefang 2.57 on 149.204.45.72 X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 2) 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 X-UiO-SPF-Received: Received-SPF: pass (mail-mx9.uio.no: domain of gnu.org designates 199.232.76.165 as permitted sender) client-ip=199.232.76.165; envelope-from=emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org; helo=lists.gnu.org; X-UiO-Spam-info: not spam, SpamAssassin (score=-1.0, required=5.0, autolearn=disabled, RCVD_IN_DNSWL_LOW=-1) X-UiO-Scanned: 3A8CA524D17531A6BDDCE88770D6D996F7DE3C00 X-UiO-SR-test: 8A28AD169D90B89F89DAFA71468D21C9DCC5B80C X-UiO-SPAM-Test: remote_host: 199.232.76.165 spam_score: -9 maxlevel 200 minaction 2 bait 0 mail/h: 18 total 43735 max/h 424 blacklist 0 greylist 0 ratelimit 0 Xref: news.gmane.org gmane.emacs.devel:92980 Archived-At: --=-=-= Stefan Monnier writes: > It's a simple problem: > > load > calls file-truename > calls tramp-completion-file-name-handler > uses tramp-let-maybe > which is autoloaded from tramp.el > which cases tramp.elc to be loaded, so calls load > calls file-truename > ... > > I *strongly* suggest to live with the obsolete warnings rather than use > such hideous hacks as tramp-let-maybe. tramp-let-maybe is needed only in case of XEmacs on W32... The appended patch shall cure it for now. There will be a new error in compiling tramp-fish.el; this can be ignored. Tonight I'll commit a patch handling this as well. > Stefan Sorry for the inconvenience to everybody. Best regards, Michael. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment *** /tmp/tramp.el.~1~ Wed Mar 19 15:52:46 2008 --- /tmp/tramp.el Wed Mar 19 15:52:46 2008 *************** *** 1957,1974 **** (put 'with-connection-property 'edebug-form-spec t) (font-lock-add-keywords 'emacs-lisp-mode '("\\")) - ;;;###autoload - (defmacro tramp-let-maybe (variable value &rest body) - "Let-bind VARIABLE to VALUE in BODY, but only if VARIABLE is not obsolete. - BODY is executed whether or not the variable is obsolete. - The intent is to protect against `obsolete variable' warnings." - `(if (get ',variable 'byte-obsolete-variable) - (progn ,@body) - (let ((,variable ,value)) - ,@body))) - (put 'tramp-let-maybe 'lisp-indent-function 2) - (put 'tramp-let-maybe 'edebug-form-spec t) - (defsubst tramp-make-tramp-temp-file (vec) "Create a temporary file on the remote host identified by VEC. Return the local name of the temporary file." --- 1957,1962 ---- *************** *** 2201,2209 **** "Like `file-truename' for Tramp files." (with-parsed-tramp-file-name (expand-file-name filename) nil (with-file-property v localname "file-truename" ! (let* ((steps (tramp-split-string localname "/")) ! (localnamedir (tramp-let-maybe directory-sep-char ?/ ;for XEmacs ! (file-name-as-directory localname))) (is-dir (string= localname localnamedir)) (thisstep nil) (numchase 0) --- 2189,2197 ---- "Like `file-truename' for Tramp files." (with-parsed-tramp-file-name (expand-file-name filename) nil (with-file-property v localname "file-truename" ! (let* ((directory-sep-char ?/) ;for XEmacs ! (steps (tramp-split-string localname "/")) ! (localnamedir (file-name-as-directory localname)) (is-dir (string= localname localnamedir)) (thisstep nil) (numchase 0) *************** *** 3557,3569 **** ;; would otherwise use backslash. `default-directory' is ;; bound, because on Windows there would be problems with UNC ;; shares or Cygwin mounts. ! (tramp-let-maybe directory-sep-char ?/ ! (let ((default-directory (tramp-compat-temporary-file-directory))) ! (tramp-make-tramp-file-name ! method user host ! (tramp-drop-volume-letter ! (tramp-run-real-handler 'expand-file-name ! (list localname))))))))) (defun tramp-handle-substitute-in-file-name (filename) "Like `substitute-in-file-name' for Tramp files. --- 3545,3557 ---- ;; would otherwise use backslash. `default-directory' is ;; bound, because on Windows there would be problems with UNC ;; shares or Cygwin mounts. ! (let ((directory-sep-char ?/) ! (default-directory (tramp-compat-temporary-file-directory))) ! (tramp-make-tramp-file-name ! method user host ! (tramp-drop-volume-letter ! (tramp-run-real-handler 'expand-file-name ! (list localname)))))))) (defun tramp-handle-substitute-in-file-name (filename) "Like `substitute-in-file-name' for Tramp files. *************** *** 4497,4507 **** Falls back to normal file name handler if no Tramp file name handler exists." ;; We bind `directory-sep-char' here for XEmacs on Windows, which ;; would otherwise use backslash. ! (tramp-let-maybe directory-sep-char ?/ ! (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)))))) ;;;###autoload (defsubst tramp-register-file-name-handler () --- 4485,4495 ---- Falls back to normal file name handler if no Tramp file name handler exists." ;; We bind `directory-sep-char' here for XEmacs on Windows, which ;; would otherwise use backslash. ! (let ((directory-sep-char ?/) ! (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))))) ;;;###autoload (defsubst tramp-register-file-name-handler () --=-=-=--