tramp-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: xemacs tramp - naive fix


From: Michael Albinus
Subject: Re: xemacs tramp - naive fix
Date: Sun, 10 Jun 2007 22:43:36 +0200
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1.50 (gnu/linux)

Peter Gordon <address@hidden> writes:

> Hi Michael,

Hi Peter,

> I just had a look at the code in tramp.el, and added the lines
> ;; pmg
>         (set-buffer-modified-p nil)
>
> It seems to me that set-buffer-modified-p should be set after
> insert-file-contents.

Good shot. It is indeed a problem there. But `set-buffer-modified-p'
shouldn't be set unconditionally. The parameter VISIT controls the
behaviour.

For unknown (to me) reasons the logic is reverted. VISIT is handled
before `insert-file-contents' on the local copy is called.

The following patch shall fix it (based on Tramp 2.0.56, which might
differ in the line numbers).

*** /home/albinus/src/tramp-stable/lisp/tramp.el.~2.359.2.105.~ 2007-05-27 
18:06:57.000000000 +0200
--- /home/albinus/src/tramp-stable/lisp/tramp.el        2007-06-10 
22:30:36.000000000 +0200
***************
*** 3899,3912 ****
                      'file-local-copy)))
               (file-local-copy filename)))
            coding-system-used result)
-       (when visit
-         (setq buffer-file-name filename)
-         (set-visited-file-modtime)
-         (set-buffer-modified-p nil))
        (tramp-message-for-buffer
         multi-method method user host
         9 "Inserting local temp file `%s'..." local-copy)
        (setq result (insert-file-contents local-copy nil beg end replace))
        ;; Now `last-coding-system-used' has right value.  Remember it.
        (when (boundp 'last-coding-system-used)
          (setq coding-system-used (symbol-value 'last-coding-system-used)))
--- 3899,3912 ----
                      'file-local-copy)))
               (file-local-copy filename)))
            coding-system-used result)
        (tramp-message-for-buffer
         multi-method method user host
         9 "Inserting local temp file `%s'..." local-copy)
        (setq result (insert-file-contents local-copy nil beg end replace))
+       (when visit
+         (setq buffer-file-name filename)
+         (set-visited-file-modtime)
+         (set-buffer-modified-p nil))
        ;; Now `last-coding-system-used' has right value.  Remember it.
        (when (boundp 'last-coding-system-used)
          (setq coding-system-used (symbol-value 'last-coding-system-used)))

> Regards,
>
> Peter

Thanks, and best regards, Michael.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]