emacs-bug-tracker
[Top][All Lists]
Advanced

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

[Emacs-bug-tracker] bug#8780: closed (24.0.50; Coding system and eol sty


From: GNU bug Tracking System
Subject: [Emacs-bug-tracker] bug#8780: closed (24.0.50; Coding system and eol style auto-detection after opening remote files)
Date: Thu, 09 Jun 2011 09:50:04 +0000

Your message dated Thu, 09 Jun 2011 12:48:56 +0300
with message-id <address@hidden>
and subject line Re: bug#8780: 24.0.50; Coding system and eol style 
auto-detection after opening remote files
has caused the GNU bug report #8780,
regarding 24.0.50; Coding system and eol style auto-detection after opening 
remote files
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
8780: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8780
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: 24.0.50; Coding system and eol style auto-detection after opening remote files Date: Wed, 1 Jun 2011 10:26:22 +0200
1. Start Emacs (emacs -Q).

2. Save the *scratch* buffer file to the local machine, in format
`iso-latin-1-dos'.

3. Put an exact copy of the above file into another machine accesible via ftp.

4. Open the local file (created in #2), and check the modeline flags
(coding system and eol style) and the buffer contents. --> Both look
right.

5. Open the remote file (C-x C-f /address@hidden:/path-to-file), and check
the modeline flags and buffer contents. --> Both look right too.

6. Kill both buffers and repeat step #4 and/or #5. --> Now the
behavior is different (and likely wrong): (a) the modeline flags say
nothing about the coding system, (b) the eol style supposedly is
(Unix) now, and thus the buffer shows ^M characters at the end of each
and every line.



In GNU Emacs 24.0.50.1 (i386-mingw-nt5.1.2600)
 of 2011-05-31 on 3249CTO
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (4.5) --no-opt --cflags
-Ic:/build/include'


-- 
Dani Moncayo



--- End Message ---
--- Begin Message --- Subject: Re: bug#8780: 24.0.50; Coding system and eol style auto-detection after opening remote files Date: Thu, 09 Jun 2011 12:48:56 +0300
> Date: Wed, 8 Jun 2011 23:38:52 +0200
> From: Dani Moncayo <address@hidden>
> Cc: address@hidden
> 
>  1. C-x C-f /address@hidden:/sites/ctan.org/README.uploads

The "ftp@" part was the crucial detail that was missing from the
original report.  The bug was in ange-ftp.  It was a very old bug, but
it was exposed by fixing bug #7383 on the trunk: since now every file
is transferred in binary mode, that bug now affects many more files
than it did before.

I fixed it on the emacs-23 branch (revision 100596 there).  The
required one-line change is reproduced below, if you cannot wait for
it to be merged to the trunk.

I'm closing this bug report.

> Well, my knowledge of Tramp is quite limited.  I guess I'm using "ftp"
> method, because it is the value of the variable
> `tramp-default-method'.

"ftp" is the default only if you don't have PuTTY installed and on
PATH.

Here's the change to fix the bug:

=== modified file 'lisp/ChangeLog'
--- lisp/ChangeLog      2011-06-05 00:32:23 +0000
+++ lisp/ChangeLog      2011-06-09 09:40:51 +0000
@@ -1,3 +1,10 @@
+2011-06-09  Eli Zaretskii  <address@hidden>
+
+       * net/ange-ftp.el (ange-ftp-insert-file-contents): Let-bind
+       buffer-file-type before setting its value, to avoid disastrous
+       global effects on decoding files for DOS/Windows systems.
+       (Bug#8780)
+
 2011-06-05  Juanma Barranquero  <address@hidden>
 
        * progmodes/python.el (python-after-info-look): Add autoload cookie.

=== modified file 'lisp/net/ange-ftp.el'
--- lisp/net/ange-ftp.el        2011-01-02 23:50:46 +0000
+++ lisp/net/ange-ftp.el        2011-06-09 09:40:51 +0000
@@ -3290,6 +3290,7 @@ system TYPE.")
                     (binary (or (ange-ftp-binary-file filename)
                                 (memq (ange-ftp-host-type host user)
                                       '(unix dumb-unix))))
+                    (buffer-file-type buffer-file-type)
                     (abbr (ange-ftp-abbreviate-filename filename))
                     (coding-system-used last-coding-system-used)
                     size)



--- End Message ---

reply via email to

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