unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#8780: 24.0.50; Coding system and eol style auto-detection after opening remote files
@ 2011-06-01  8:26 Dani Moncayo
  2011-06-01 13:26 ` Dani Moncayo
  0 siblings, 1 reply; 6+ messages in thread
From: Dani Moncayo @ 2011-06-01  8:26 UTC (permalink / raw)
  To: 8780

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 /user@host:/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





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

* bug#8780: 24.0.50; Coding system and eol style auto-detection after opening remote files
  2011-06-01  8:26 bug#8780: 24.0.50; Coding system and eol style auto-detection after opening remote files Dani Moncayo
@ 2011-06-01 13:26 ` Dani Moncayo
  2011-06-08 17:53   ` Dani Moncayo
  0 siblings, 1 reply; 6+ messages in thread
From: Dani Moncayo @ 2011-06-01 13:26 UTC (permalink / raw)
  To: 8780

Simpler recipe:

0. Start Emacs: emacs -Q.
1. Visit any remote file (in any format): C-x C-f /user@host:/path-to-file.
2. From now on, any attempt to visit some iso-latin-1-dos file give
the abnormal results described in the OP.

-- 
Dani Moncayo





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

* bug#8780: 24.0.50; Coding system and eol style auto-detection after opening remote files
  2011-06-01 13:26 ` Dani Moncayo
@ 2011-06-08 17:53   ` Dani Moncayo
  2011-06-08 20:56     ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: Dani Moncayo @ 2011-06-08 17:53 UTC (permalink / raw)
  To: 8780

Ping!

I'm experiencing this problem everyday at work.  Everyone who works
with remote files should be experiencing it too (and I think that is a
frequent practice among programmers).

I get abnormal results regardless of the coding system of the file.
So, here is an updated, description of the problem:

0. Start Emacs: emacs -Q.
1. Visit any _remote_ file: C-x C-f /user@host:/path-to-file.
2. Now, any attempt to visit any file (remote or local) gives abnormal
results(*).

(*):
a. The coding system flag is missing from the modeline.
b. If the file has DOS format, the eol-style flag is wrong (it
indicates UNIX style), and the buffer shows the ^M characters at the
end of each and every line.

-- 
Dani Moncayo





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

* bug#8780: 24.0.50; Coding system and eol style auto-detection after opening remote files
  2011-06-08 17:53   ` Dani Moncayo
@ 2011-06-08 20:56     ` Eli Zaretskii
  2011-06-08 21:38       ` Dani Moncayo
  0 siblings, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2011-06-08 20:56 UTC (permalink / raw)
  To: Dani Moncayo; +Cc: 8780

> Date: Wed, 8 Jun 2011 19:53:10 +0200
> From: Dani Moncayo <dmoncayo@gmail.com>
> 
> 0. Start Emacs: emacs -Q.
> 1. Visit any _remote_ file: C-x C-f /user@host:/path-to-file.
> 2. Now, any attempt to visit any file (remote or local) gives abnormal
> results(*).
> 
> (*):
> a. The coding system flag is missing from the modeline.
> b. If the file has DOS format, the eol-style flag is wrong (it
> indicates UNIX style), and the buffer shows the ^M characters at the
> end of each and every line.

I cannot reproduce this with yesterday's build of Emacs 24 on w32.  I
tried fetching a remote file from a GNU/Linux machine -- it was
displayed correctly and with the correct EOL mnemonic.  I then tried
visiting several local files, and they all also displayed correctly.
This is both using the default pscp method of accessing remote files
and with the plink method.

Are you using one of these Tramp methods?  If not, which method do you
use?





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

* bug#8780: 24.0.50; Coding system and eol style auto-detection after opening remote files
  2011-06-08 20:56     ` Eli Zaretskii
@ 2011-06-08 21:38       ` Dani Moncayo
  2011-06-09  9:48         ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: Dani Moncayo @ 2011-06-08 21:38 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 8780

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

Hi Eli,

> I cannot reproduce this with yesterday's build of Emacs 24 on w32.  I
> tried fetching a remote file from a GNU/Linux machine -- it was
> displayed correctly and with the correct EOL mnemonic.  I then tried
> visiting several local files, and they all also displayed correctly.

I've just reproduced it at home, also with yesterday's build of Emacs
trunk on w32.  FWIW, here I have Windows 7 Ultimate 64-bit.  I've just
done this:
 1. C-x C-f /ftp@ftp.gui.uva.es:/sites/ctan.org/README.uploads
 2. C-x C-f some-local-iso-latin-1-dos-file

I'm attaching a screenshot of the Emacs frame after #2, which shows
the two anomalies mentioned earlier.

At work I'm using a Windows XP box, where I also have the same problem.


> This is both using the default pscp method of accessing remote files
> and with the plink method.
>
> Are you using one of these Tramp methods?  If not, which method do you
> use?

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'.  Anyway, I've not tweaked anything in Emacs
nor Windows, FWIW.

If you need more data, just ask for it.

Thanks.

-- 
Dani Moncayo

[-- Attachment #2: img1.png --]
[-- Type: image/png, Size: 46915 bytes --]

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

* bug#8780: 24.0.50; Coding system and eol style auto-detection after opening remote files
  2011-06-08 21:38       ` Dani Moncayo
@ 2011-06-09  9:48         ` Eli Zaretskii
  0 siblings, 0 replies; 6+ messages in thread
From: Eli Zaretskii @ 2011-06-09  9:48 UTC (permalink / raw)
  To: Dani Moncayo; +Cc: 8780-done

> Date: Wed, 8 Jun 2011 23:38:52 +0200
> From: Dani Moncayo <dmoncayo@gmail.com>
> Cc: 8780@debbugs.gnu.org
> 
>  1. C-x C-f /ftp@ftp.gui.uva.es:/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  <eliz@gnu.org>
+
+	* 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  <lekktu@gmail.com>
 
 	* 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)






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

end of thread, other threads:[~2011-06-09  9:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-01  8:26 bug#8780: 24.0.50; Coding system and eol style auto-detection after opening remote files Dani Moncayo
2011-06-01 13:26 ` Dani Moncayo
2011-06-08 17:53   ` Dani Moncayo
2011-06-08 20:56     ` Eli Zaretskii
2011-06-08 21:38       ` Dani Moncayo
2011-06-09  9:48         ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).