unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* How to change line endings - where is it explained?
@ 2006-05-08 22:45 Lennart Borgman
  2006-05-09  3:45 ` Eli Zaretskii
  0 siblings, 1 reply; 18+ messages in thread
From: Lennart Borgman @ 2006-05-08 22:45 UTC (permalink / raw)


Is it explained in the manuals how to change line endings? I can not 
find it (neither for the lisp level or user level), but that is maybe 
just me.

I had to look up the function mode-line-change-eol to find out how.

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

* Re: How to change line endings - where is it explained?
  2006-05-08 22:45 How to change line endings - where is it explained? Lennart Borgman
@ 2006-05-09  3:45 ` Eli Zaretskii
  2006-05-09  5:48   ` Lennart Borgman
  2006-05-09  5:51   ` Lennart Borgman
  0 siblings, 2 replies; 18+ messages in thread
From: Eli Zaretskii @ 2006-05-09  3:45 UTC (permalink / raw)
  Cc: emacs-devel

> Date: Tue, 09 May 2006 00:45:52 +0200
> From: Lennart Borgman <lennart.borgman.073@student.lu.se>
> 
> Is it explained in the manuals how to change line endings? I can not 
> find it

Yes, it is described in the node "Text and Binray".

What did you try to look for it?  Perhaps we need to improve the
indexing.

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

* Re: How to change line endings - where is it explained?
  2006-05-09  3:45 ` Eli Zaretskii
@ 2006-05-09  5:48   ` Lennart Borgman
  2006-05-12 17:57     ` Eli Zaretskii
  2006-05-09  5:51   ` Lennart Borgman
  1 sibling, 1 reply; 18+ messages in thread
From: Lennart Borgman @ 2006-05-09  5:48 UTC (permalink / raw)
  Cc: emacs-devel

Eli Zaretskii wrote:
>> Date: Tue, 09 May 2006 00:45:52 +0200
>> From: Lennart Borgman <lennart.borgman.073@student.lu.se>
>>
>> Is it explained in the manuals how to change line endings? I can not 
>> find it
>>     
>
> Yes, it is described in the node "Text and Binray".
>
> What did you try to look for it?  Perhaps we need to improve the
> indexing.
>   
Thanks, yes I wonder why I missed that. A couple of small things perhaps:

- The name of the node is a bit "C style".
- I looked for "line endings".
- I looked for "line end conversion".
- I actually also searched for CRLF, but possibly only in the elisp 
manual since I wanted to do the conversion in code.
- I was thinking about coding systems, but somehow I missed that you 
could use just 'unix or 'dos for the coding system in some operations.
- I looked at the node "(emacs) Files" which says it tells everything 
about files.
- I looked at `buffer-file-coding-system' etc.

I think that I have some difficulties with English here. I however also 
think that the essence of the topic is a bit absent in the manuals. It 
is very an important topic if you are on w32 but not that important if 
all you care about is unix-style platforms.

Some suggestions:

- A link to  "(emacs) Coding Systems"  in "(emacs) Files".
- Something about line endings too in "(emacs) Files", possibly in 
connection with the link above.
- "(emacs) Coding Systems" should mention 'dos, 'unix and 'mac.
- "(elisp) Files" should mention line endings.
- `describe-coding-system' could somehow mention line endings.

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

* Re: How to change line endings - where is it explained?
  2006-05-09  3:45 ` Eli Zaretskii
  2006-05-09  5:48   ` Lennart Borgman
@ 2006-05-09  5:51   ` Lennart Borgman
  2006-05-09 19:35     ` Eli Zaretskii
  1 sibling, 1 reply; 18+ messages in thread
From: Lennart Borgman @ 2006-05-09  5:51 UTC (permalink / raw)
  Cc: emacs-devel

Eli Zaretskii wrote:
>> Date: Tue, 09 May 2006 00:45:52 +0200
>> From: Lennart Borgman <lennart.borgman.073@student.lu.se>
>>
>> Is it explained in the manuals how to change line endings? I can not 
>> find it
>>     
>
> Yes, it is described in the node "Text and Binray".
>
> What did you try to look for it?  Perhaps we need to improve the
> indexing.
>   
Forgot to say that the elisp manual also should say something about how 
to find out the line endings currently used.

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

* Re: How to change line endings - where is it explained?
  2006-05-09  5:51   ` Lennart Borgman
@ 2006-05-09 19:35     ` Eli Zaretskii
  2006-05-09 19:41       ` Lennart Borgman
  0 siblings, 1 reply; 18+ messages in thread
From: Eli Zaretskii @ 2006-05-09 19:35 UTC (permalink / raw)
  Cc: emacs-devel

> Date: Tue, 09 May 2006 07:51:19 +0200
> From: Lennart Borgman <lennart.borgman.073@student.lu.se>
> CC:  emacs-devel@gnu.org
> 
> Forgot to say that the elisp manual also should say something about how 
> to find out the line endings currently used.

I'm not sure I understand what you mean by that.  In particular, what
is the exact meaning of ``currently used''.

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

* Re: How to change line endings - where is it explained?
  2006-05-09 19:35     ` Eli Zaretskii
@ 2006-05-09 19:41       ` Lennart Borgman
  2006-05-09 22:04         ` Luc Teirlinck
  2006-05-10  3:36         ` Eli Zaretskii
  0 siblings, 2 replies; 18+ messages in thread
From: Lennart Borgman @ 2006-05-09 19:41 UTC (permalink / raw)
  Cc: emacs-devel

Eli Zaretskii wrote:
>> Date: Tue, 09 May 2006 07:51:19 +0200
>> From: Lennart Borgman <lennart.borgman.073@student.lu.se>
>> CC:  emacs-devel@gnu.org
>>
>> Forgot to say that the elisp manual also should say something about how 
>> to find out the line endings currently used.
>>     
>
> I'm not sure I understand what you mean by that.  In particular, what
> is the exact meaning of ``currently used''.
>   
I was thinking about the line endings that will be used when writing the 
buffer (with just C-x C-s for example). But I might misunderstand 
something here?

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

* Re: How to change line endings - where is it explained?
  2006-05-09 19:41       ` Lennart Borgman
@ 2006-05-09 22:04         ` Luc Teirlinck
  2006-05-10  3:36         ` Eli Zaretskii
  1 sibling, 0 replies; 18+ messages in thread
From: Luc Teirlinck @ 2006-05-09 22:04 UTC (permalink / raw)
  Cc: eliz, emacs-devel

Lennart Borgman wrote:

   I was thinking about the line endings that will be used when writing the 
   buffer (with just C-x C-s for example). But I might misunderstand 
   something here?

I have not been following this thread, so I may be the one
misunderstanding something, but what about `(elisp)MS-DOS File' or
other sections of `(elisp)Coding Systems'?

Sincerely,

Luc.

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

* Re: How to change line endings - where is it explained?
  2006-05-09 19:41       ` Lennart Borgman
  2006-05-09 22:04         ` Luc Teirlinck
@ 2006-05-10  3:36         ` Eli Zaretskii
  2006-05-10  5:49           ` Lennart Borgman
  1 sibling, 1 reply; 18+ messages in thread
From: Eli Zaretskii @ 2006-05-10  3:36 UTC (permalink / raw)
  Cc: emacs-devel

> Date: Tue, 09 May 2006 21:41:20 +0200
> From: Lennart Borgman <lennart.borgman.073@student.lu.se>
> Cc: emacs-devel@gnu.org
> 
> I was thinking about the line endings that will be used when writing the 
> buffer (with just C-x C-s for example).

You mean the current buffer's coding-system
(a.k.a. buffer-file-coding-system).

In that case, is coding-system-eol-type what you'd like to be added to
the Lisp manual?

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

* Re: How to change line endings - where is it explained?
  2006-05-10  3:36         ` Eli Zaretskii
@ 2006-05-10  5:49           ` Lennart Borgman
  2006-05-11  3:44             ` Richard Stallman
  0 siblings, 1 reply; 18+ messages in thread
From: Lennart Borgman @ 2006-05-10  5:49 UTC (permalink / raw)
  Cc: emacs-devel

Eli Zaretskii wrote:
>> Date: Tue, 09 May 2006 21:41:20 +0200
>> From: Lennart Borgman <lennart.borgman.073@student.lu.se>
>> Cc: emacs-devel@gnu.org
>>
>> I was thinking about the line endings that will be used when writing the 
>> buffer (with just C-x C-s for example).
>>     
>
> You mean the current buffer's coding-system
> (a.k.a. buffer-file-coding-system).
>
> In that case, is coding-system-eol-type what you'd like to be added to
> the Lisp manual?
>   
Yes.

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

* Re: How to change line endings - where is it explained?
  2006-05-10  5:49           ` Lennart Borgman
@ 2006-05-11  3:44             ` Richard Stallman
  2006-05-11 18:29               ` Eli Zaretskii
  2006-05-12 14:34               ` Eli Zaretskii
  0 siblings, 2 replies; 18+ messages in thread
From: Richard Stallman @ 2006-05-11  3:44 UTC (permalink / raw)
  Cc: eliz, emacs-devel

    > In that case, is coding-system-eol-type what you'd like to be added to
    > the Lisp manual?

Eli, could you add that?

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

* Re: How to change line endings - where is it explained?
  2006-05-11  3:44             ` Richard Stallman
@ 2006-05-11 18:29               ` Eli Zaretskii
  2006-05-12 14:34               ` Eli Zaretskii
  1 sibling, 0 replies; 18+ messages in thread
From: Eli Zaretskii @ 2006-05-11 18:29 UTC (permalink / raw)
  Cc: lennart.borgman.073, emacs-devel

> From: Richard Stallman <rms@gnu.org>
> CC: eliz@gnu.org, emacs-devel@gnu.org
> Date: Wed, 10 May 2006 23:44:57 -0400
> 
>     > In that case, is coding-system-eol-type what you'd like to be added to
>     > the Lisp manual?
> 
> Eli, could you add that?

Okay.

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

* Re: How to change line endings - where is it explained?
  2006-05-11  3:44             ` Richard Stallman
  2006-05-11 18:29               ` Eli Zaretskii
@ 2006-05-12 14:34               ` Eli Zaretskii
  1 sibling, 0 replies; 18+ messages in thread
From: Eli Zaretskii @ 2006-05-12 14:34 UTC (permalink / raw)
  Cc: lennart.borgman.073, emacs-devel

> From: Richard Stallman <rms@gnu.org>
> CC: eliz@gnu.org, emacs-devel@gnu.org
> Date: Wed, 10 May 2006 23:44:57 -0400
> 
>     > In that case, is coding-system-eol-type what you'd like to be added to
>     > the Lisp manual?
> 
> Eli, could you add that?

Done.

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

* Re: How to change line endings - where is it explained?
  2006-05-09  5:48   ` Lennart Borgman
@ 2006-05-12 17:57     ` Eli Zaretskii
  2006-05-14 20:17       ` Lennart Borgman
  0 siblings, 1 reply; 18+ messages in thread
From: Eli Zaretskii @ 2006-05-12 17:57 UTC (permalink / raw)
  Cc: emacs-devel

> Date: Tue, 09 May 2006 07:48:43 +0200
> From: Lennart Borgman <lennart.borgman.073@student.lu.se>
> CC:  emacs-devel@gnu.org
> 
> > Yes, it is described in the node "Text and Binray".
> >
> > What did you try to look for it?  Perhaps we need to improve the
> > indexing.
> >   
> Thanks, yes I wonder why I missed that. A couple of small things perhaps:
> 
> - The name of the node is a bit "C style".
> - I looked for "line endings".
> - I looked for "line end conversion".
> - I actually also searched for CRLF, but possibly only in the elisp 
> manual since I wanted to do the conversion in code.
> - I was thinking about coding systems, but somehow I missed that you 
> could use just 'unix or 'dos for the coding system in some operations.
> - I looked at the node "(emacs) Files" which says it tells everything 
> about files.
> - I looked at `buffer-file-coding-system' etc.

I added some index entries that should make this search easier.

> Some suggestions:
> 
> - A link to  "(emacs) Coding Systems"  in "(emacs) Files".

There is already such a link: see the node "Visiting".

> - Something about line endings too in "(emacs) Files", possibly in 
> connection with the link above.

Ditto: "Visiting" already talks about EOLs.

> - "(emacs) Coding Systems" should mention 'dos, 'unix and 'mac.

It already does, please take a closer look.

> - "(elisp) Files" should mention line endings.

I added the references to code and EOL conversions to the appropriate
sections of files.texi.

> - `describe-coding-system' could somehow mention line endings.

Done.

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

* Re: How to change line endings - where is it explained?
  2006-05-12 17:57     ` Eli Zaretskii
@ 2006-05-14 20:17       ` Lennart Borgman
  2006-05-14 20:29         ` Eli Zaretskii
  0 siblings, 1 reply; 18+ messages in thread
From: Lennart Borgman @ 2006-05-14 20:17 UTC (permalink / raw)
  Cc: emacs-devel

Eli Zaretskii wrote:
>> Date: Tue, 09 May 2006 07:48:43 +0200
>> From: Lennart Borgman <lennart.borgman.073@student.lu.se>
>> CC:  emacs-devel@gnu.org
>>
>>     
>>> Yes, it is described in the node "Text and Binray".
>>>
>>> What did you try to look for it?  Perhaps we need to improve the
>>> indexing.
>>>   
>>>       
>> Thanks, yes I wonder why I missed that. A couple of small things perhaps:
>>
>> - The name of the node is a bit "C style".
>> - I looked for "line endings".
>> - I looked for "line end conversion".
>> - I actually also searched for CRLF, but possibly only in the elisp 
>> manual since I wanted to do the conversion in code.
>> - I was thinking about coding systems, but somehow I missed that you 
>> could use just 'unix or 'dos for the coding system in some operations.
>> - I looked at the node "(emacs) Files" which says it tells everything 
>> about files.
>> - I looked at `buffer-file-coding-system' etc.
>>     
>
> I added some index entries that should make this search easier.
>   
Thanks for the index entries and for adding CRLF in a relevant place in 
the elisp manual.

>   
>> - Something about line endings too in "(emacs) Files", possibly in 
>> connection with the link above.
>>     
>
> Ditto: "Visiting" already talks about EOLs.
>   
Oh, I found it! But I did not see it before. The reason is that I am 
nearly always searching, not reading. In "(emacs) Visiting" the term for 
line endings is "convention it uses to separate lines". Could perhaps 
"(line endings)" be added right after this? :

      convention it uses to separate lines (line endings) -- newline 
(used on ...

>   
>> - "(emacs) Coding Systems" should mention 'dos, 'unix and 'mac.
>>     
>
> It already does, please take a closer look.
>   
I just checked out a fresh copy from CVS and I am afraid I still can not 
find anything about the use of just 'dos, 'unix and 'mac like in

    M-x set-buffer-file-coding-system RET unix RET

As I understand it this changes just the line endings to unix style 
(LF). Would it not be good to mention this feature?

>   
>> - "(elisp) Files" should mention line endings.
>>     
>
> I added the references to code and EOL conversions to the appropriate
> sections of files.texi.
>   
Thanks.

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

* Re: How to change line endings - where is it explained?
  2006-05-14 20:17       ` Lennart Borgman
@ 2006-05-14 20:29         ` Eli Zaretskii
  2006-05-14 21:00           ` Lennart Borgman
  0 siblings, 1 reply; 18+ messages in thread
From: Eli Zaretskii @ 2006-05-14 20:29 UTC (permalink / raw)
  Cc: emacs-devel

> Date: Sun, 14 May 2006 22:17:44 +0200
> From: Lennart Borgman <lennart.borgman.073@student.lu.se>
> CC:  emacs-devel@gnu.org
> 
> >> - Something about line endings too in "(emacs) Files", possibly in 
> >> connection with the link above.
> >
> > Ditto: "Visiting" already talks about EOLs.
> >   
> Oh, I found it! But I did not see it before. The reason is that I am 
> nearly always searching, not reading.

That is almost certainly not the right way to use the manual.
Searching is a vehicle of getting to the right node, but once you are
already there, you should read it in its entirety.

> In "(emacs) Visiting" the term for 
> line endings is "convention it uses to separate lines". Could perhaps 
> "(line endings)" be added right after this? :

I actually dislike the term "line endings"; "end-of-line format" is a
better term, IMO.

> >> - "(emacs) Coding Systems" should mention 'dos, 'unix and 'mac.
> >
> > It already does, please take a closer look.
> >   
> I just checked out a fresh copy from CVS and I am afraid I still can not 
> find anything about the use of just 'dos, 'unix and 'mac

??? How can that be?  Are we talking about the same thing here?
Here's the fragment I had in mind:

       Each of the listed coding systems has three variants which specify
    exactly what to do for end-of-line conversion:

    `...-unix'
	 Don't do any end-of-line conversion; assume the file uses newline
	 to separate lines.  (This is the convention normally used on Unix
	 and GNU systems.)

    `...-dos'
	 Assume the file uses carriage-return linefeed to separate lines,
	 and do the appropriate conversion.  (This is the convention
	 normally used on Microsoft systems.(2))

    `...-mac'
	 Assume the file uses carriage-return to separate lines, and do the
	 appropriate conversion.  (This is the convention normally used on
	 the Macintosh system.)

       These variant coding systems are omitted from the
    `list-coding-systems' display for brevity, since they are entirely
    predictable.  For example, the coding system `iso-latin-1' has variants
    `iso-latin-1-unix', `iso-latin-1-dos' and `iso-latin-1-mac'.

> like in
> 
>     M-x set-buffer-file-coding-system RET unix RET
> 
> As I understand it this changes just the line endings to unix style 
> (LF). Would it not be good to mention this feature?

Ah, you mean this paragraph (from "Text Coding"):

       You can also use this command to specify the end-of-line conversion
    (*note end-of-line conversion: Coding Systems.) for encoding the
    current buffer.  For example, `C-x <RET> f dos <RET>' will cause Emacs
    to save the current buffer's text with DOS-style CRLF line endings.

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

* Re: How to change line endings - where is it explained?
  2006-05-14 20:29         ` Eli Zaretskii
@ 2006-05-14 21:00           ` Lennart Borgman
  2006-05-15  3:14             ` Eli Zaretskii
  0 siblings, 1 reply; 18+ messages in thread
From: Lennart Borgman @ 2006-05-14 21:00 UTC (permalink / raw)
  Cc: emacs-devel

Eli Zaretskii wrote:
>> Oh, I found it! But I did not see it before. The reason is that I am 
>> nearly always searching, not reading.
>>     
>
> That is almost certainly not the right way to use the manual.
> Searching is a vehicle of getting to the right node, but once you are
> already there, you should read it in its entirety.
>   
Maybe it is a little bit a matter of cognitive style? It is really hard 
to organize a big text like Emacs manual and I tend to think that maybe 
I am not in the right node and then I continue searching. Sometimes this 
is the best approach I believe and sometimes not. This time it was 
certainly not the best strategy I was using, you are right in that.

It might well be that most people doing some programming tend to have a 
cognitive style that is more consistent with the reading style you suggest.

> I actually dislike the term "line endings"; "end-of-line format" is a
> better term, IMO.
>   
If you dislike that term I suppose that there are more native English 
speaking people that does that. But there is one drawback with the term 
"end-of-line format" and that is that there is a function with that 
name. It makes searching a little bit harder, perhaps. However I would 
be glad if one term was use consistently in the manual. That makes my 
way of reading the manual (=searching) quite a bit more easy.

> ??? How can that be?  Are we talking about the same thing here?
> Here's the fragment I had in mind:
>
>        Each of the listed coding systems has three variants which specify
>     exactly what to do for end-of-line conversion:
>
>     `...-unix'
> 	 Don't do any end-of-line conversion; assume the file uses newline
> 	 to separate lines.  (This is the convention normally used on Unix
> 	 and GNU systems.)
>   
...
>> like in
>>
>>     M-x set-buffer-file-coding-system RET unix RET
>>
>> As I understand it this changes just the line endings to unix style 
>> (LF). Would it not be good to mention this feature?
>>     
>
> Ah, you mean this paragraph (from "Text Coding"):
>
>        You can also use this command to specify the end-of-line conversion
>     (*note end-of-line conversion: Coding Systems.) for encoding the
>     current buffer.  For example, `C-x <RET> f dos <RET>' will cause Emacs
>     to save the current buffer's text with DOS-style CRLF line endings.
>   
Yes, that is more in line with what I was searching for. And looked for 
in the node "(emacs) Coding Systems".

To summarize: What I would have found most useful would have been one 
consistent term for "line endings"/"end-of-line 
conversions"/"end-of-line type" since this makes searching easier.

Thanks for taking time with this. It cleared my thoughts a bit.

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

* Re: How to change line endings - where is it explained?
  2006-05-14 21:00           ` Lennart Borgman
@ 2006-05-15  3:14             ` Eli Zaretskii
  2006-05-15 20:37               ` Richard Stallman
  0 siblings, 1 reply; 18+ messages in thread
From: Eli Zaretskii @ 2006-05-15  3:14 UTC (permalink / raw)
  Cc: emacs-devel

> Date: Sun, 14 May 2006 23:00:53 +0200
> From: Lennart Borgman <lennart.borgman.073@student.lu.se>
> Cc: emacs-devel@gnu.org
> 
> Maybe it is a little bit a matter of cognitive style? It is really hard 
> to organize a big text like Emacs manual

Nodes are not large.  If you see relevant text in the node, I suggest
you read it carefully.

> and I tend to think that maybe I am not in the right node and then I
> continue searching.

Well, you now see the drawback of that.

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

* Re: How to change line endings - where is it explained?
  2006-05-15  3:14             ` Eli Zaretskii
@ 2006-05-15 20:37               ` Richard Stallman
  0 siblings, 0 replies; 18+ messages in thread
From: Richard Stallman @ 2006-05-15 20:37 UTC (permalink / raw)
  Cc: lennart.borgman.073, emacs-devel

    Nodes are not large.  If you see relevant text in the node, I suggest
    you read it carefully.

Some nodes are too large--it is useful to notice them and split them.

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

end of thread, other threads:[~2006-05-15 20:37 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-08 22:45 How to change line endings - where is it explained? Lennart Borgman
2006-05-09  3:45 ` Eli Zaretskii
2006-05-09  5:48   ` Lennart Borgman
2006-05-12 17:57     ` Eli Zaretskii
2006-05-14 20:17       ` Lennart Borgman
2006-05-14 20:29         ` Eli Zaretskii
2006-05-14 21:00           ` Lennart Borgman
2006-05-15  3:14             ` Eli Zaretskii
2006-05-15 20:37               ` Richard Stallman
2006-05-09  5:51   ` Lennart Borgman
2006-05-09 19:35     ` Eli Zaretskii
2006-05-09 19:41       ` Lennart Borgman
2006-05-09 22:04         ` Luc Teirlinck
2006-05-10  3:36         ` Eli Zaretskii
2006-05-10  5:49           ` Lennart Borgman
2006-05-11  3:44             ` Richard Stallman
2006-05-11 18:29               ` Eli Zaretskii
2006-05-12 14:34               ` 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).