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

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

Problem w/ CRLF


From: Feghhi, Jalil
Subject: Problem w/ CRLF
Date: Mon, 15 Mar 2004 10:14:38 -0800

I have downloaded emacs 21.3 from the gnu ftp site 
(ftp://ftp.gnu.org/pub/pub/gnu/emacs/) and have problems when opening and 
saving files using emacs. Basically, what happens is as soon as I open and save 
a text file, the linefeed changes to the unix style and my files get corrupted. 
I even created a new file with emacs, which got saved fine. However, as soon as 
I opened it again and saved it, it got corrupted.

The following emails have more info on this issue. If you need more info or if 
there is a workaround, please let me know.

-Jalil


 <<RE: Windows text files saved as Unix files>>  <<Re: Windows text files saved 
as Unix files>>  <<RE: Windows text files saved as Unix files>>  <<RE: Windows 
text files saved as Unix files>>  <<RE: Windows text files saved as Unix 
files>>  <<RE: Windows text files saved as Unix files>>  <<RE: Windows text 
files saved as Unix files>>  <<Windows text files saved as Unix files>> 
--- Begin Message --- Subject: RE: Windows text files saved as Unix files Date: Fri, 12 Mar 2004 06:35:13 -0800
iso-latin-1-dos

-Jalil
-----Original Message-----
From: Eli Zaretskii [mailto:address@hidden
Sent: Friday, March 12, 2004 5:51 AM
To: Jalil Feghhi
Subject: Re: Windows text files saved as Unix files


> From: "Feghhi, Jalil" <address@hidden>
> Date: Thu, 11 Mar 2004 07:23:27 -0800
> 
> GNU Emacs 21.3.1 (i386-mingw-nt5.0.2195) of 2003-11-10 on NYAUMO

Very strange...

What does Emacs say if you type this:

     M-: (default-value 'buffeer-file-coding-system) RET"

--- End Message ---
--- Begin Message --- Subject: Re: Windows text files saved as Unix files Date: Fri, 12 Mar 2004 05:51:11 -0800
> From: "Feghhi, Jalil" <address@hidden>
> Date: Thu, 11 Mar 2004 07:23:27 -0800
> 
> GNU Emacs 21.3.1 (i386-mingw-nt5.0.2195) of 2003-11-10 on NYAUMO

Very strange...

What does Emacs say if you type this:

     M-: (default-value 'buffeer-file-coding-system) RET"

--- End Message ---
--- Begin Message --- Subject: RE: Windows text files saved as Unix files Date: Thu, 11 Mar 2004 07:23:27 -0800
Sorry. It says:

GNU Emacs 21.3.1 (i386-mingw-nt5.0.2195) of 2003-11-10 on NYAUMO

-Jalil

-----Original Message-----
From: Eli Zaretskii [mailto:address@hidden
Sent: Wednesday, March 10, 2004 10:17 PM
To: Feghhi, Jalil
Subject: Re: Windows text files saved as Unix files


> From: "Feghhi, Jalil" <address@hidden>
> Date: Wed, 10 Mar 2004 10:46:30 -0800
> 
> I have 21.3.1. I downloaded it from ftp.gnu.org and ungziped an untared it in 
> my cygwin window.

Thanks, but please tell me what does Emacs say when you type "M-x
emacs-version RET".  It's important for me to know that.

--- End Message ---
--- Begin Message --- Subject: RE: Windows text files saved as Unix files Date: Wed, 10 Mar 2004 10:46:30 -0800
I have 21.3.1. I downloaded it from ftp.gnu.org and ungziped an untared it in 
my cygwin window.

By the way, I removed that line from my .emacs. I still have the same problem 
even when I open .emacs!!

-Jalil

-----Original Message-----
From: Eli Zaretskii [mailto:address@hidden
Sent: Wednesday, March 10, 2004 10:21 AM
To: Jalil Feghhi
Subject: Re: Windows text files saved as Unix files


> From: "Feghhi, Jalil" <address@hidden>
> Date: Wed, 10 Mar 2004 06:47:27 -0800
> 
> Thanks for your response. I am opening old files. All I know is that when I 
> open these files with Notepad, they look fine and when I edit them w/ emacs 
> and then open them again with Notepad they don't look good b/c of new line 
> problems. 

Very strange.  What version of Emacs is that?  What does Emacs print
when you type "M-x emacs-version RET"?

> ;; added by me to take care of this problem but didn't help.
> (add-untranslated-filesystem "C:")

That is exactly what you do NOT want to have in your .emacs.  This
tells Emacs to create all files on the C: drive with Unix end-of-line
format.  So you want to remove this line.

--- End Message ---
--- Begin Message --- Subject: RE: Windows text files saved as Unix files Date: Wed, 10 Mar 2004 06:54:02 -0800
Eli,

I just had another email from somebody which asked me to:

use C-x RET f (runs the command set-buffer-file-coding-system) and
type "dos" RET at the command prompt. then save the file and that's
it.

This worked. When I did the 'C-x RET f', the coding system showed as nil. I 
thought
this might help with troubleshoot.

-Jalil
-----Original Message-----
From: Feghhi, Jalil 
Sent: Wednesday, March 10, 2004 6:47 AM
To: 'Eli Zaretskii'
Subject: RE: Windows text files saved as Unix files


Eli,

Thanks for your response. I am opening old files. All I know is that when I 
open these files with Notepad, they look fine and when I edit them w/ emacs and 
then open them again with Notepad they don't look good b/c of new line 
problems. 

I tested creating new files and they looked fine in Notepad. I ran emacs with 
-q and still had the same problems. Please let me know how I can troubleshoot. 
I appreciate your help.

Here is my .emacs:

(custom-set-variables
  ;; custom-set-variables was added by Custom -- don't edit or cut/paste it!
  ;; Your init file should contain only one such instance.
 '(case-fold-search t)
 '(current-language-environment "Latin-1")
 '(default-input-method "latin-1-prefix"))
(custom-set-faces
  ;; custom-set-faces was added by Custom -- don't edit or cut/paste it!
  ;; Your init file should contain only one such instance.
 )
;; added by me to take care of this problem but didn't help.
(add-untranslated-filesystem "C:")


-Jalil

-----Original Message-----
From: Eli Zaretskii [mailto:address@hidden
Sent: Tuesday, March 09, 2004 9:54 PM
To: Feghhi, Jalil
Cc: address@hidden
Subject: Re: Windows text files saved as Unix files


> From: "Feghhi, Jalil" <address@hidden>
> Date: Thu, 4 Mar 2004 11:57:10 -0800
> 
> I just installed the Windows versions of emacs and when I edit text files on 
> my Windows they are saved with unix-stype linefeeds. When I open these files, 
> I see Unix at the left hand side of the buffer too.
> 
> I searched for some time and found several articles on this but nothing that 
> could help me. How can I fix this problem? Also, why the default installation 
> for Windows is like this?

Are these new files you create with Emacs, or are these existing
files you edit?

If the latter, Emacs preserves their original end-of-line format; if
they originally had Unix-style linefeeds, Emacs will save the edited
file with the same end-of-line format.

If these are new files created by Emacs, it's probably something in
your customization, as by default Emacs on Windows creates files with
Windows-style CR-LF pairs at the end of each line.  Try invoking Emacs
with "emacs -q" and see if that helps; if it does, look inside your
.emacs (or _emacs) init file for some customization that causes this.
Things to watch for are setting of the defaults for files'
coding-system and use of untranslated-filesystem feature.

--- End Message ---
--- Begin Message --- Subject: RE: Windows text files saved as Unix files Date: Wed, 10 Mar 2004 06:52:23 -0800
Martin,

Thanks for your help. This works. But, how can have emacs do this 
automatically? I checked and I am fine when creating new files but when I open 
old files, this problem happen. 

-Jalil

-----Original Message-----
From: address@hidden [mailto:address@hidden
Sent: Tuesday, March 09, 2004 11:37 PM
Cc: address@hidden
Subject: Re: Windows text files saved as Unix files


The following message is a courtesy copy of an article
that has been posted to gnu.emacs.help as well.


"FJ" == Feghhi, Jalil <address@hidden> writes:
 FJ> Date: Thu, 4 Mar 2004 11:57:10 -0800
 FJ> To: "'address@hidden'" <address@hidden>
 FJ> 
 FJ> I just installed the Windows versions of emacs and when I edit text
 FJ> files on my Windows they are saved with unix-stype linefeeds. When I
 FJ> open these files, I see Unix at the left hand side of the buffer too.
 FJ> 
 FJ> I searched for some time and found several articles on this but
 FJ> nothing that could help me. How can I fix this problem?

hi,

use C-x RET f (runs the command set-buffer-file-coding-system) and
type "dos" RET at the command prompt. then save the file and that's
it.

martin

 FJ> Also, why the default installation for Windows is like this?
 FJ> 
 FJ> Thanks for the help.
 FJ> 
 FJ> -Jalil ps. Please reply to my email address as I am not part of the
 FJ> mailing list yet.
 FJ> 
 FJ> 
 FJ> 
-- 
martin dot fischer at boschrexroth dot de

--- End Message ---
--- Begin Message --- Subject: RE: Windows text files saved as Unix files Date: Wed, 10 Mar 2004 06:47:27 -0800
Eli,

Thanks for your response. I am opening old files. All I know is that when I 
open these files with Notepad, they look fine and when I edit them w/ emacs and 
then open them again with Notepad they don't look good b/c of new line 
problems. 

I tested creating new files and they looked fine in Notepad. I ran emacs with 
-q and still had the same problems. Please let me know how I can troubleshoot. 
I appreciate your help.

Here is my .emacs:

(custom-set-variables
  ;; custom-set-variables was added by Custom -- don't edit or cut/paste it!
  ;; Your init file should contain only one such instance.
 '(case-fold-search t)
 '(current-language-environment "Latin-1")
 '(default-input-method "latin-1-prefix"))
(custom-set-faces
  ;; custom-set-faces was added by Custom -- don't edit or cut/paste it!
  ;; Your init file should contain only one such instance.
 )
;; added by me to take care of this problem but didn't help.
(add-untranslated-filesystem "C:")


-Jalil

-----Original Message-----
From: Eli Zaretskii [mailto:address@hidden
Sent: Tuesday, March 09, 2004 9:54 PM
To: Feghhi, Jalil
Cc: address@hidden
Subject: Re: Windows text files saved as Unix files


> From: "Feghhi, Jalil" <address@hidden>
> Date: Thu, 4 Mar 2004 11:57:10 -0800
> 
> I just installed the Windows versions of emacs and when I edit text files on 
> my Windows they are saved with unix-stype linefeeds. When I open these files, 
> I see Unix at the left hand side of the buffer too.
> 
> I searched for some time and found several articles on this but nothing that 
> could help me. How can I fix this problem? Also, why the default installation 
> for Windows is like this?

Are these new files you create with Emacs, or are these existing
files you edit?

If the latter, Emacs preserves their original end-of-line format; if
they originally had Unix-style linefeeds, Emacs will save the edited
file with the same end-of-line format.

If these are new files created by Emacs, it's probably something in
your customization, as by default Emacs on Windows creates files with
Windows-style CR-LF pairs at the end of each line.  Try invoking Emacs
with "emacs -q" and see if that helps; if it does, look inside your
.emacs (or _emacs) init file for some customization that causes this.
Things to watch for are setting of the defaults for files'
coding-system and use of untranslated-filesystem feature.

--- End Message ---
--- Begin Message --- Subject: Windows text files saved as Unix files Date: Thu, 4 Mar 2004 11:57:10 -0800
I just installed the Windows versions of emacs and when I edit text files on my 
Windows they are saved with unix-stype linefeeds. When I open these files, I 
see Unix at the left hand side of the buffer too.

I searched for some time and found several articles on this but nothing that 
could help me. How can I fix this problem? Also, why the default installation 
for Windows is like this?

Thanks for the help.

-Jalil
ps. Please reply to my email address as I am not part of the mailing list yet.

--- End Message ---

reply via email to

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