Peter Gordon <[EMAIL PROTECTED]> 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.



_______________________________________________
Tramp-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/tramp-devel

Reply via email to