all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Juanma Barranquero <lekktu@gmail.com>, an0 <an00na@gmail.com>,
	emacs-devel@gnu.org
Subject: Re: "tramp-completion-file-name-handler: Recursive load" with the trunk code
Date: Wed, 19 Mar 2008 15:58:18 +0100	[thread overview]
Message-ID: <nqmyou222d.fsf@alcatel-lucent.de> (raw)
In-Reply-To: jwvk5jyzucv.fsf-monnier+emacs@gnu.org

[-- Attachment #1: Type: text/plain, Size: 737 bytes --]

Stefan Monnier <monnier@iro.umontreal.ca> 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.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 4061 bytes --]

*** /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 '("\\<with-connection-property\\>"))
  
- ;;;###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 ()

  reply	other threads:[~2008-03-19 14:58 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-19  3:45 "tramp-completion-file-name-handler: Recursive load" with the trunk code an0
2008-03-19  9:23 ` Juanma Barranquero
2008-03-19 10:24   ` an0
2008-03-19 10:26     ` Juanma Barranquero
2008-03-19 12:13     ` Michael Albinus
2008-03-19 14:02       ` Stefan Monnier
2008-03-19 14:58         ` Michael Albinus [this message]
2008-03-19 16:40           ` Stefan Monnier
2008-03-19 16:54             ` Michael Albinus
2008-03-19 17:39               ` Stefan Monnier
2008-03-19 20:25                 ` Stephen J. Turnbull
2008-03-19 20:51                   ` Michael Albinus
2008-03-19 21:44       ` Richard Stallman
2008-03-19 22:32         ` Thomas Lord
2008-03-20  7:32           ` Michael Albinus
2008-03-19 21:14 ` Michael Albinus
2008-03-20  2:45   ` an0

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=nqmyou222d.fsf@alcatel-lucent.de \
    --to=michael.albinus@gmx.de \
    --cc=an00na@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=lekktu@gmail.com \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.