all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Encoding problem with Tramp
@ 2008-03-17 20:29 Stefan Monnier
  2008-03-17 23:06 ` Michael Albinus
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Monnier @ 2008-03-17 20:29 UTC (permalink / raw)
  To: emacs-devel

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

[ For Kai Großjohann and Michael Albinus, thanks to stupid mailers. ]


        Stefan



[-- Attachment #2: Type: message/rfc822, Size: 4928 bytes --]

[-- Attachment #2.1.1: Type: text/plain, Size: 382 bytes --]

The following message to <kai.grossjohann@gmx.net> was undeliverable.
The reason for the problem:
5.1.0 - Unknown address error 550-"5.7.1 {mx069} The recipient does not accept mails from 'iro.umontreal.ca' over foreign mailservers.\n5.7.1 According to the domain's SPF record your host '206.248.154.182' is not a designated sender.\n5.7.1 ( http://portal.gmx.net/serverrules )"

[-- Attachment #2.1.2: Type: message/delivery-status, Size: 502 bytes --]

[-- Attachment #2.1.3: Type: message/rfc822, Size: 2501 bytes --]

From: Stefan Monnier <monnier@iro.umontreal.ca>
To: "Kai Gro\x1fFFFFFFjohann" <kai.grossjohann@gmx.net>, "Michael Albinus" <michael.albinus@gmx.de>
Subject: Encoding problem with Tramp
Date: Mon, 17 Mar 2008 16:15:32 -0400
Message-ID: <jwveja96ryq.fsf-monnier+emacs@gnu.org>


I recently noticed that my home page has emacs-mule encoding, even tho
it specifies latin-1.  It turns out that it's because I was editing it
via Tramp and that Tramp has a bug in this regard.
Using good ol' print statements, it turns out that
last-coding-system-used is modified in tramp-handle-write-region *after*
tramp-handle-write-region was careful to save&set it.

More specifically the code does:

	  ;; Make `last-coding-system-used' have the right value.
	  (when coding-system-used
	    (set 'last-coding-system-used coding-system-used))))

      ;; Set file modification time.
      (when (or (eq visit t) (stringp visit))
	(set-visited-file-modtime
	 ;; We must pass modtime explicitely, because filename can
	 ;; be different from (buffer-file-name), f.e. if
	 ;; `file-precious-flag' is set.
	 (nth 5 (file-attributes filename))))

so while the first 3 lines DTRT, the subsequent 7 lines (probably just
the call to file-attributes) set the last-coding-system-used back to
raw-text-unix.

I suggest to fix Tramp's file-attributes by wrapping a let around it
that preserves the value of last-coding-system-used.

If I fix it, then I get the same problem with the subsequent call to
tramp-set-file-uid-gid.

Maybe another way to fix those problem is to move the above 3 lines that
reset last-coding-system-used to the end of tramp-handle-write-region.

Although, the let-binding around tramp-handle-file-attributes seem to be
good in general, since file-attributes is normally not expected to
modify last-coding-system-used.


        Stefan

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Encoding problem with Tramp
  2008-03-17 20:29 Encoding problem with Tramp Stefan Monnier
@ 2008-03-17 23:06 ` Michael Albinus
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Albinus @ 2008-03-17 23:06 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Kai Grossjohann, emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> I suggest to fix Tramp's file-attributes by wrapping a let around it
> that preserves the value of last-coding-system-used.
>
> If I fix it, then I get the same problem with the subsequent call to
> tramp-set-file-uid-gid.

I've wrapped all trailing statements in tramp-handle-write-region with a
let-bind of last-coding-system-used. This shall do the job.

>         Stefan

Best regards, Michael.




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-03-17 23:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-17 20:29 Encoding problem with Tramp Stefan Monnier
2008-03-17 23:06 ` Michael Albinus

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.