all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: emacs-devel@gnu.org
Subject: Encoding problem with Tramp
Date: Mon, 17 Mar 2008 16:29:32 -0400	[thread overview]
Message-ID: <jwv3aqp6qpj.fsf-monnier+inbox@gnu.org> (raw)

[-- 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

             reply	other threads:[~2008-03-17 20:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-17 20:29 Stefan Monnier [this message]
2008-03-17 23:06 ` Encoding problem with Tramp Michael Albinus

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=jwv3aqp6qpj.fsf-monnier+inbox@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    /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.