unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Replace with CR
@ 2015-07-05 14:40 Andrea Venturoli
  2015-07-05 15:22 ` tomas
                   ` (2 more replies)
  0 siblings, 3 replies; 24+ messages in thread
From: Andrea Venturoli @ 2015-07-05 14:40 UTC (permalink / raw)
  To: help-gnu-emacs

Hello.

I'm using emacs on several FreeBSD boxes (text or X version).
For several years I've been able to replace any character with a 
newline, by doing (e.g. with ';'):
M-x replace-string(enter);(enter)^Q(enter)(enter)

The line
a;b;c
would become
a
b
c

Now the same procedure does not work anymore as the (enter) immediately 
after ^Q does not move to a newline, but enters ^M.

I.e. what I get is "a^Mb^Mc".


How can I restore the previous behavior, or, failing that, replace 
something with a newline?

I don't know when and why this stopped working.

  bye & Thanks
	av.


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

* Re: Replace with CR
  2015-07-05 14:40 Replace with CR Andrea Venturoli
@ 2015-07-05 15:22 ` tomas
  2015-07-05 15:24 ` Pascal J. Bourguignon
       [not found] ` <mailman.6367.1436109760.904.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 24+ messages in thread
From: tomas @ 2015-07-05 15:22 UTC (permalink / raw)
  To: Andrea Venturoli; +Cc: help-gnu-emacs

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sun, Jul 05, 2015 at 04:40:50PM +0200, Andrea Venturoli wrote:
> Hello.
> 
> I'm using emacs on several FreeBSD boxes (text or X version).
> For several years I've been able to replace any character with a
> newline, by doing (e.g. with ';'):
> M-x replace-string(enter);(enter)^Q(enter)(enter)

Try M-x replace-string<ENTER>;<ENTER>^Q^J<ENTER>

(i.e. replace your but-last <ENTER> with CTRL-J)

regards
- -- t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlWZS7EACgkQBcgs9XrR2kbQOQCeLLjXtetNsQxtMsfTQxYo9nGt
IKsAnR+HjjVRxQW9GR4i5Uy7t/hoQT1Z
=DYAy
-----END PGP SIGNATURE-----



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

* Re: Replace with CR
  2015-07-05 14:40 Replace with CR Andrea Venturoli
  2015-07-05 15:22 ` tomas
@ 2015-07-05 15:24 ` Pascal J. Bourguignon
  2015-07-05 15:47   ` Óscar Fuentes
                     ` (4 more replies)
       [not found] ` <mailman.6367.1436109760.904.help-gnu-emacs@gnu.org>
  2 siblings, 5 replies; 24+ messages in thread
From: Pascal J. Bourguignon @ 2015-07-05 15:24 UTC (permalink / raw)
  To: help-gnu-emacs

Andrea Venturoli <ml.diespammer@netfence.it> writes:

> Hello.
>
> I'm using emacs on several FreeBSD boxes (text or X version).
> For several years I've been able to replace any character with a
> newline, by doing (e.g. with ';'):
> M-x replace-string(enter);(enter)^Q(enter)(enter)

Only, there's no such "enter" thing.  So you are a cold liar.

> The line
> a;b;c
> would become
> a
> b
> c
>
> Now the same procedure does not work anymore as the (enter)
> immediately after ^Q does not move to a newline, but enters ^M.
>
> I.e. what I get is "a^Mb^Mc".

There's a key labelled "Return" that enters a CARRIAGE RETURN ASCII
control code whose value is 13.  This value can also be obtained with
Control  and the 13th letter, M, hence the representation as ^M.  If you
don't like CR, then don't use the RET key.


> How can I restore the previous behavior, or, failing that, replace
> something with a newline?

On unix, newline is represented by the ASCII code LINE FEED, value 10,
which can be entered using Control and the 10th letter, J.   
Then type: C-q C-j


> I don't know when and why this stopped working.

It stopped working when you lost those neurons when you banged your head
on the floor.  Leave backflips to professionnal acrobats, not for your
youtube channel.

-- 
__Pascal Bourguignon__                 http://www.informatimago.com/
“The factory of the future will have only two employees, a man and a
dog. The man will be there to feed the dog. The dog will be there to
keep the man from touching the equipment.” -- Carl Bass CEO Autodesk


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

* Re: Replace with CR
       [not found] ` <mailman.6367.1436109760.904.help-gnu-emacs@gnu.org>
@ 2015-07-05 15:36   ` Pascal J. Bourguignon
  2015-07-05 16:30     ` Stefan Monnier
  0 siblings, 1 reply; 24+ messages in thread
From: Pascal J. Bourguignon @ 2015-07-05 15:36 UTC (permalink / raw)
  To: help-gnu-emacs

<tomas@tuxteam.de> writes:

> On Sun, Jul 05, 2015 at 04:40:50PM +0200, Andrea Venturoli wrote:
>> Hello.
>> 
>> I'm using emacs on several FreeBSD boxes (text or X version).
>> For several years I've been able to replace any character with a
>> newline, by doing (e.g. with ';'):
>> M-x replace-string(enter);(enter)^Q(enter)(enter)
>
> Try M-x replace-string<ENTER>;<ENTER>^Q^J<ENTER>
>
> (i.e. replace your but-last <ENTER> with CTRL-J)

Again, there's no such thing as ENTER.  The key is RETURN.
You would type:

    M-x replace-string RET ; RET C-q C-j RET

(kbd "ENTER") --> "ENTER"
(kbd "RET") --> ""

-- 
__Pascal Bourguignon__                 http://www.informatimago.com/
“The factory of the future will have only two employees, a man and a
dog. The man will be there to feed the dog. The dog will be there to
keep the man from touching the equipment.” -- Carl Bass CEO Autodesk


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

* Re: Replace with CR
  2015-07-05 15:24 ` Pascal J. Bourguignon
@ 2015-07-05 15:47   ` Óscar Fuentes
  2015-07-06  8:41     ` Gian Uberto Lauri
       [not found]     ` <mailman.6422.1436172122.904.help-gnu-emacs@gnu.org>
  2015-07-05 15:55   ` tomas
                     ` (3 subsequent siblings)
  4 siblings, 2 replies; 24+ messages in thread
From: Óscar Fuentes @ 2015-07-05 15:47 UTC (permalink / raw)
  To: help-gnu-emacs

"Pascal J. Bourguignon" <pjb@informatimago.com> writes:

> Andrea Venturoli <ml.diespammer@netfence.it> writes:
>> M-x replace-string(enter);(enter)^Q(enter)(enter)
>
> Only, there's no such "enter" thing.  So you are a cold liar.

In Spain the RETURN key is usually named ENTER. I guess the same could
be possibly on Italy, where the OP seems to be.

Not that it is an excuse when posting on a English-speaking mailing
list, but it doesn't warrant your overly offensive tone either.

[snip]




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

* Re: Replace with CR
  2015-07-05 15:24 ` Pascal J. Bourguignon
  2015-07-05 15:47   ` Óscar Fuentes
@ 2015-07-05 15:55   ` tomas
  2015-07-05 17:03   ` Ian Zimmerman
                     ` (2 subsequent siblings)
  4 siblings, 0 replies; 24+ messages in thread
From: tomas @ 2015-07-05 15:55 UTC (permalink / raw)
  To: Pascal J. Bourguignon; +Cc: help-gnu-emacs

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sun, Jul 05, 2015 at 05:24:30PM +0200, Pascal J. Bourguignon wrote:

[...]

> It stopped working when [...]

Now, now. Pascal, I don't know you like this..

regards
- -- tomás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlWZU4QACgkQBcgs9XrR2kYfJwCfaCR86D17+9lb+5iGFFfcTAv/
l/YAn2MXNUzU4We6kFNJnkAwBNK14qEl
=5osI
-----END PGP SIGNATURE-----



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

* Re: Replace with CR
  2015-07-05 15:36   ` Pascal J. Bourguignon
@ 2015-07-05 16:30     ` Stefan Monnier
  2015-07-05 16:39       ` Paul Smith
                         ` (2 more replies)
  0 siblings, 3 replies; 24+ messages in thread
From: Stefan Monnier @ 2015-07-05 16:30 UTC (permalink / raw)
  To: help-gnu-emacs

> Again, there's no such thing as ENTER.  The key is RETURN.

FWIW, my keyboard (US thinkpad) has no "RETURN", but it does have a key
labelled "Enter".


        Stefan


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

* Re: Replace with CR
  2015-07-05 16:30     ` Stefan Monnier
@ 2015-07-05 16:39       ` Paul Smith
  2015-07-06  8:49       ` Gian Uberto Lauri
       [not found]       ` <mailman.6423.1436172566.904.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 24+ messages in thread
From: Paul Smith @ 2015-07-05 16:39 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: help-gnu-emacs

On Sun, 2015-07-05 at 12:30 -0400, Stefan Monnier wrote:
> > Again, there's no such thing as ENTER.  The key is RETURN.
> 
> FWIW, my keyboard (US thinkpad) has no "RETURN", but it does have a
> key labelled "Enter".

Just about every US keyboard I've seen in the last 15 years has used the
label "Enter".




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

* Re: Replace with CR
  2015-07-05 15:24 ` Pascal J. Bourguignon
  2015-07-05 15:47   ` Óscar Fuentes
  2015-07-05 15:55   ` tomas
@ 2015-07-05 17:03   ` Ian Zimmerman
       [not found]   ` <mailman.6379.1436115793.904.help-gnu-emacs@gnu.org>
       [not found]   ` <mailman.6368.1436111238.904.help-gnu-emacs@gnu.org>
  4 siblings, 0 replies; 24+ messages in thread
From: Ian Zimmerman @ 2015-07-05 17:03 UTC (permalink / raw)
  To: help-gnu-emacs

On 2015-07-05 17:24 +0200, Pascal J. Bourguignon wrote:

> Only, there's no such "enter" thing.

There is (2 of them in fact) on my brand "new" IBM 101-key clicky
keyboard :-)

-- 
Please *no* private copies of mailing list or newsgroup messages.
Rule 420: All persons more than eight miles high to leave the court.




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

* Re: Replace with CR
       [not found]   ` <mailman.6379.1436115793.904.help-gnu-emacs@gnu.org>
@ 2015-07-05 17:34     ` Pascal J. Bourguignon
  2015-07-05 19:25       ` Barry Margolin
  0 siblings, 1 reply; 24+ messages in thread
From: Pascal J. Bourguignon @ 2015-07-05 17:34 UTC (permalink / raw)
  To: help-gnu-emacs

Ian Zimmerman <itz@buug.org> writes:

> On 2015-07-05 17:24 +0200, Pascal J. Bourguignon wrote:
>
>> Only, there's no such "enter" thing.
>
> There is (2 of them in fact) on my brand "new" IBM 101-key clicky
> keyboard :-)

Indeed.  The world is becoming dumber.


On real keyboard, the keys were labelled: CAR RET (for Carriage Return),
and LINE FEED:

http://www.galleyrack.com/images/artifice/telegraphy/tty-biblio/att/twx-form-E-2059-standard-typewriter-keyboard-with-teletypewriter-keyboard-superimposed-0600rgb-crop-icon-4983x3504.png

-- 
__Pascal Bourguignon__                 http://www.informatimago.com/
“The factory of the future will have only two employees, a man and a
dog. The man will be there to feed the dog. The dog will be there to
keep the man from touching the equipment.” -- Carl Bass CEO Autodesk


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

* Re: Replace with CR
  2015-07-05 17:34     ` Pascal J. Bourguignon
@ 2015-07-05 19:25       ` Barry Margolin
  2015-07-05 20:01         ` Óscar Fuentes
  2015-07-05 20:47         ` Pascal J. Bourguignon
  0 siblings, 2 replies; 24+ messages in thread
From: Barry Margolin @ 2015-07-05 19:25 UTC (permalink / raw)
  To: help-gnu-emacs

In article <87si92tsof.fsf@kuiper.lan.informatimago.com>,
 "Pascal J. Bourguignon" <pjb@informatimago.com> wrote:

> Ian Zimmerman <itz@buug.org> writes:
> 
> > On 2015-07-05 17:24 +0200, Pascal J. Bourguignon wrote:
> >
> >> Only, there's no such "enter" thing.
> >
> > There is (2 of them in fact) on my brand "new" IBM 101-key clicky
> > keyboard :-)
> 
> Indeed.  The world is becoming dumber.
> 
> 
> On real keyboard, the keys were labelled: CAR RET (for Carriage Return),
> and LINE FEED:

Where is the carriage on your computer? :)

-- 
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***


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

* Re: Replace with CR
  2015-07-05 19:25       ` Barry Margolin
@ 2015-07-05 20:01         ` Óscar Fuentes
  2015-07-05 20:47         ` Pascal J. Bourguignon
  1 sibling, 0 replies; 24+ messages in thread
From: Óscar Fuentes @ 2015-07-05 20:01 UTC (permalink / raw)
  To: help-gnu-emacs

Barry Margolin <barmar@alum.mit.edu> writes:

>> On real keyboard, the keys were labelled: CAR RET (for Carriage Return),
>> and LINE FEED:
>
> Where is the carriage on your computer? :)

You can see mine here:

http://www.micomunidad.com/uploads/no_me_agarra_el_guaifai_8322555078.jpg

If your computer has no carriage maybe is because you bought one of
those fancy, dumbed-down Macs.




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

* Re: Replace with CR
  2015-07-05 19:25       ` Barry Margolin
  2015-07-05 20:01         ` Óscar Fuentes
@ 2015-07-05 20:47         ` Pascal J. Bourguignon
  2015-07-05 22:59           ` Richard Wordingham
  2015-07-06 13:51           ` Barry Fishman
  1 sibling, 2 replies; 24+ messages in thread
From: Pascal J. Bourguignon @ 2015-07-05 20:47 UTC (permalink / raw)
  To: help-gnu-emacs

Barry Margolin <barmar@alum.mit.edu> writes:

> In article <87si92tsof.fsf@kuiper.lan.informatimago.com>,
>  "Pascal J. Bourguignon" <pjb@informatimago.com> wrote:
>
>> Ian Zimmerman <itz@buug.org> writes:
>> 
>> > On 2015-07-05 17:24 +0200, Pascal J. Bourguignon wrote:
>> >
>> >> Only, there's no such "enter" thing.
>> >
>> > There is (2 of them in fact) on my brand "new" IBM 101-key clicky
>> > keyboard :-)
>> 
>> Indeed.  The world is becoming dumber.
>> 
>> 
>> On real keyboard, the keys were labelled: CAR RET (for Carriage Return),
>> and LINE FEED:
>
> Where is the carriage on your computer? :)

Agreed, but this is entirely another can of worm. why are we using the
ASCIi control codes for carriage return, or line feed, to separate
lines? Shouldn't we use instead ASCII control code RS (Record Separator,
0x1e) or ISO-8859 (ECMA-048) control code NEL (Next Line, 0x85)?  or the
new unicode LS (Line Separator, 0x2028), or is it PS (Paragraph
Separator, 0x2029)?

At least in GUI, when you input some text in a text field, this problem
doesn't occur: you click on the "OK" button :-)


http://unicode.org/standard/reports/tr13/tr13-5.html
https://xkcd.com/927/
-- 
__Pascal Bourguignon__                 http://www.informatimago.com/
“The factory of the future will have only two employees, a man and a
dog. The man will be there to feed the dog. The dog will be there to
keep the man from touching the equipment.” -- Carl Bass CEO Autodesk


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

* Re: Replace with CR
  2015-07-05 20:47         ` Pascal J. Bourguignon
@ 2015-07-05 22:59           ` Richard Wordingham
  2015-07-06 13:51           ` Barry Fishman
  1 sibling, 0 replies; 24+ messages in thread
From: Richard Wordingham @ 2015-07-05 22:59 UTC (permalink / raw)
  To: help-gnu-emacs

On Sun, 05 Jul 2015 22:47:42 +0200
"Pascal J. Bourguignon" <pjb@informatimago.com> wrote:

> Agreed, but this is entirely another can of worm. why are we using the
> ASCIi control codes for carriage return, or line feed, to separate
> lines? Shouldn't we use instead ASCII control code RS (Record
> Separator, 0x1e) or ISO-8859 (ECMA-048) control code NEL (Next Line,
> 0x85)?  or the new unicode LS (Line Separator, 0x2028), or is it PS
> (Paragraph Separator, 0x2029)?

Because we want the edited text to work.  There is no guarantee that
the above codes will work.  RS is particularly unlikely to work.
Incidentally, NEL is not ISO-8859; try ISO-6426.

> At least in GUI, when you input some text in a text field, this
> problem doesn't occur: you click on the "OK" button :-)

Try doing the substitution converting semicolons to line breaks in
MS Word - it may be doable, but it isn't pleasant.

Richard.



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

* Re: Replace with CR
  2015-07-05 15:47   ` Óscar Fuentes
@ 2015-07-06  8:41     ` Gian Uberto Lauri
       [not found]     ` <mailman.6422.1436172122.904.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 24+ messages in thread
From: Gian Uberto Lauri @ 2015-07-06  8:41 UTC (permalink / raw)
  To: Óscar Fuentes; +Cc: help-gnu-emacs

Óscar Fuentes writes:
 > "Pascal J. Bourguignon" <pjb@informatimago.com> writes:
 > 
 > > Andrea Venturoli <ml.diespammer@netfence.it> writes:
 > >> M-x replace-string(enter);(enter)^Q(enter)(enter)
 > >
 > > Only, there's no such "enter" thing.  So you are a cold liar.
 > 
 > In Spain the RETURN key is usually named ENTER. I guess the same could
 > be possibly on Italy, where the OP seems to be.

In Italy the key is labeled most often "invio", sometimes "immiss"
(from "immissione" - nauseating). I have Enter on my custom US layout.

http://www.userfriendly.org/cartoons/archives/01mar/uf002860.gif
http://www.userfriendly.org/cartoons/archives/01mar/uf002862.gif

-- 
 /\           ___                                    Ubuntu: ancient
/___/\_|_|\_|__|___Gian Uberto Lauri_____               African word
  //--\| | \|  |   Integralista GNUslamico            meaning "I can
\/                 coltivatore diretto di software       not install
     già sistemista a tempo (altrui) perso...                Debian"

Warning: gnome-config-daemon considered more dangerous than GOTO



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

* Re: Replace with CR
  2015-07-05 16:30     ` Stefan Monnier
  2015-07-05 16:39       ` Paul Smith
@ 2015-07-06  8:49       ` Gian Uberto Lauri
       [not found]       ` <mailman.6423.1436172566.904.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 24+ messages in thread
From: Gian Uberto Lauri @ 2015-07-06  8:49 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: help-gnu-emacs

Stefan Monnier writes:
 > > Again, there's no such thing as ENTER.  The key is RETURN.
 > 
 > FWIW, my keyboard (US thinkpad) has no "RETURN", but it does have a key
 > labelled "Enter".

I have "Return" on my old VIC20, but I doubt Emacs will be ever ported
there...

"Return" was a tty-derivative labeling and was once common, even when
it sent a LF o CR/LF[1] pair. Enter is much common now and closer to
semantic the keys has today for most computer users. Enough common to
build jokes on, see the two strips I posted.

[1] for those who still do not know it: the pair is CR/LF and not
LF/CR because on old TTY the carriage return was a longer operation
that could be controlled without keeping the tty controller busy: you
could start the head carriage, and while the it was going home move
the paper drum one line.

-- 
 /\           ___                                    Ubuntu: ancient
/___/\_|_|\_|__|___Gian Uberto Lauri_____               African word
  //--\| | \|  |   Integralista GNUslamico            meaning "I can
\/                 coltivatore diretto di software       not install
     già sistemista a tempo (altrui) perso...                Debian"

Warning: gnome-config-daemon considered more dangerous than GOTO



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

* Re: Replace with CR
       [not found]   ` <mailman.6368.1436111238.904.help-gnu-emacs@gnu.org>
@ 2015-07-06  9:49     ` Andrea Venturoli
  2015-07-06 14:37       ` Barry Margolin
  0 siblings, 1 reply; 24+ messages in thread
From: Andrea Venturoli @ 2015-07-06  9:49 UTC (permalink / raw)
  To: help-gnu-emacs

On 07/05/15 17:47, Óscar Fuentes wrote:
> "Pascal J. Bourguignon" <pjb@informatimago.com> writes:
>
>> Andrea Venturoli <ml.diespammer@netfence.it> writes:
>>> M-x replace-string(enter);(enter)^Q(enter)(enter)
>>
>> Only, there's no such "enter" thing.  So you are a cold liar.
>
> In Spain the RETURN key is usually named ENTER. I guess the same could
> be possibly on Italy, where the OP seems to be.

Hello.
Thanks for the answer.

Actually in Italy it's "Invio", which means "sending", but I don't think 
anyone would have understood that (probably I would have spoiled 
Pascal's day too :).

Anyway, it works with ^J, so I'm fine.
Thanks to Tomas for this suggestion.
                                                               |
Still I wonder why the "Enter"/"Invio"/"Immis"/"Return"/"CR"/"<---+"/:-) 
key stopped working, but I can easily live with that.

  bye
	av.


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

* Re: Replace with CR
       [not found]     ` <mailman.6422.1436172122.904.help-gnu-emacs@gnu.org>
@ 2015-07-06 10:18       ` Pascal J. Bourguignon
  0 siblings, 0 replies; 24+ messages in thread
From: Pascal J. Bourguignon @ 2015-07-06 10:18 UTC (permalink / raw)
  To: help-gnu-emacs

"Gian Uberto Lauri" <saint@eng.it> writes:

> Óscar Fuentes writes:
>  > "Pascal J. Bourguignon" <pjb@informatimago.com> writes:
>  > 
>  > > Andrea Venturoli <ml.diespammer@netfence.it> writes:
>  > >> M-x replace-string(enter);(enter)^Q(enter)(enter)
>  > >
>  > > Only, there's no such "enter" thing.  So you are a cold liar.
>  > 
>  > In Spain the RETURN key is usually named ENTER. I guess the same could
>  > be possibly on Italy, where the OP seems to be.
>
> In Italy the key is labeled most often "invio", sometimes "immiss"
> (from "immissione" - nauseating). I have Enter on my custom US layout.

Right, let's have a different control code for each possible label on
that key, and let's have the applications deal with all those control
codes…

-- 
__Pascal Bourguignon__                 http://www.informatimago.com/
“The factory of the future will have only two employees, a man and a
dog. The man will be there to feed the dog. The dog will be there to
keep the man from touching the equipment.” -- Carl Bass CEO Autodesk


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

* Re: Replace with CR
       [not found]       ` <mailman.6423.1436172566.904.help-gnu-emacs@gnu.org>
@ 2015-07-06 10:34         ` Pascal J. Bourguignon
  0 siblings, 0 replies; 24+ messages in thread
From: Pascal J. Bourguignon @ 2015-07-06 10:34 UTC (permalink / raw)
  To: help-gnu-emacs

"Gian Uberto Lauri" <saint@eng.it> writes:

> Stefan Monnier writes:
>  > > Again, there's no such thing as ENTER.  The key is RETURN.
>  > 
>  > FWIW, my keyboard (US thinkpad) has no "RETURN", but it does have a key
>  > labelled "Enter".
>
> I have "Return" on my old VIC20, but I doubt Emacs will be ever ported
> there...
>
> "Return" was a tty-derivative labeling and was once common, even when
> it sent a LF o CR/LF[1] pair. 

NO. THE "RETURN" KEY NEVER EVER SENT A LINE-FEED CODE! Not even in CR-LF
pair.  It only sent a CARRIAGE RETURN code.

It is the system that echoed this carriage return along with a line feed
(or just a line feed when local echo was activated).  And in the case of
unix, it is the keyboard driver that translates the CARRIAGE RETURN code
it reads into a LINE FEED in the buffer (and even, only according to the
tty configuration).  In linux, check n_tty_receive_char and
do_output_char in drivers/tty/n_tty.c



> Enter is much common now and closer to
> semantic the keys has today for most computer users. Enough common to
> build jokes on, see the two strips I posted.
>
> [1] for those who still do not know it: the pair is CR/LF and not
> LF/CR because on old TTY the carriage return was a longer operation
> that could be controlled without keeping the tty controller busy: you
> could start the head carriage, and while the it was going home move
> the paper drum one line.

-- 
__Pascal Bourguignon__                 http://www.informatimago.com/
“The factory of the future will have only two employees, a man and a
dog. The man will be there to feed the dog. The dog will be there to
keep the man from touching the equipment.” -- Carl Bass CEO Autodesk


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

* Re: Replace with CR
  2015-07-05 20:47         ` Pascal J. Bourguignon
  2015-07-05 22:59           ` Richard Wordingham
@ 2015-07-06 13:51           ` Barry Fishman
  2015-07-06 16:04             ` Stefan Monnier
  1 sibling, 1 reply; 24+ messages in thread
From: Barry Fishman @ 2015-07-06 13:51 UTC (permalink / raw)
  To: help-gnu-emacs


>        Shouldn't we use instead ASCII control code RS (Record Separator,
> 0x1e) or ISO-8859 (ECMA-048) control code NEL (Next Line, 0x85)?  or the
> new unicode LS (Line Separator, 0x2028), or is it PS (Paragraph
> Separator, 0x2029)?

Please don't mention this on the Emacs development mailing list, or
someone will propose making LS and PS Emacs's default behavior.
--
Barry Fishman


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

* Re: Replace with CR
  2015-07-06  9:49     ` Andrea Venturoli
@ 2015-07-06 14:37       ` Barry Margolin
  2015-07-06 15:33         ` Andrea Venturoli
  2015-07-07  0:29         ` Robert Thorpe
  0 siblings, 2 replies; 24+ messages in thread
From: Barry Margolin @ 2015-07-06 14:37 UTC (permalink / raw)
  To: help-gnu-emacs

In article <mndiuo$p56$1@speranza.aioe.org>,
 Andrea Venturoli <ml.diespammer@netfence.it> wrote:

> Still I wonder why the "Enter"/"Invio"/"Immis"/"Return"/"CR"/"<---+"/:-) 
> key stopped working, but I can easily live with that.

I can't imagine why it ever worked. I've been using Emacs for decades, 
and it has always been necessary to use C-q C-j to put a literal newline 
in the replacement string. C-q RET would always put a CR there.

Maybe you had an extension installed that modified the behavior of C-q 
RET?

-- 
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***


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

* Re: Replace with CR
  2015-07-06 14:37       ` Barry Margolin
@ 2015-07-06 15:33         ` Andrea Venturoli
  2015-07-07  0:29         ` Robert Thorpe
  1 sibling, 0 replies; 24+ messages in thread
From: Andrea Venturoli @ 2015-07-06 15:33 UTC (permalink / raw)
  To: help-gnu-emacs

On 07/06/15 16:37, Barry Margolin wrote:

> Maybe you had an extension installed that modified the behavior of C-q
> RET?

No.
I'm sure the upgrade of some package changed this.
Anyway, let's drop this, I'm fine.

  bye & Thanks
	av.


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

* Re: Replace with CR
  2015-07-06 13:51           ` Barry Fishman
@ 2015-07-06 16:04             ` Stefan Monnier
  0 siblings, 0 replies; 24+ messages in thread
From: Stefan Monnier @ 2015-07-06 16:04 UTC (permalink / raw)
  To: help-gnu-emacs

> ... will propose making LS and PS Emacs's default behavior.

Hmm, indeed it sounds like a great idea, which will finally get us rid
of the ambiguity with LF.
We could just start using it and add a warning any time we see an LF in
a file, with some way to let Emacs auto-convert the file, so users would
quickly and almost transparently upgrade to the new system.
Patches welcome,


        Stefan "not"


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

* Re: Replace with CR
  2015-07-06 14:37       ` Barry Margolin
  2015-07-06 15:33         ` Andrea Venturoli
@ 2015-07-07  0:29         ` Robert Thorpe
  1 sibling, 0 replies; 24+ messages in thread
From: Robert Thorpe @ 2015-07-07  0:29 UTC (permalink / raw)
  To: Barry Margolin; +Cc: help-gnu-emacs

Barry Margolin <barmar@alum.mit.edu> writes:

> In article <mndiuo$p56$1@speranza.aioe.org>,
>  Andrea Venturoli <ml.diespammer@netfence.it> wrote:
>
>> Still I wonder why the "Enter"/"Invio"/"Immis"/"Return"/"CR"/"<---+"/:-) 
>> key stopped working, but I can easily live with that.
>
> I can't imagine why it ever worked. I've been using Emacs for decades, 
> and it has always been necessary to use C-q C-j to put a literal newline 
> in the replacement string. C-q RET would always put a CR there.

It could have been because the files being edited had Mac line-endings.
In that case once the file was saved and recalled the line-endings would
change as expected.

Anyway, the OP has solved his problem, so it doesn't matter.

BR,
Robert Thorpe



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

end of thread, other threads:[~2015-07-07  0:29 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-05 14:40 Replace with CR Andrea Venturoli
2015-07-05 15:22 ` tomas
2015-07-05 15:24 ` Pascal J. Bourguignon
2015-07-05 15:47   ` Óscar Fuentes
2015-07-06  8:41     ` Gian Uberto Lauri
     [not found]     ` <mailman.6422.1436172122.904.help-gnu-emacs@gnu.org>
2015-07-06 10:18       ` Pascal J. Bourguignon
2015-07-05 15:55   ` tomas
2015-07-05 17:03   ` Ian Zimmerman
     [not found]   ` <mailman.6379.1436115793.904.help-gnu-emacs@gnu.org>
2015-07-05 17:34     ` Pascal J. Bourguignon
2015-07-05 19:25       ` Barry Margolin
2015-07-05 20:01         ` Óscar Fuentes
2015-07-05 20:47         ` Pascal J. Bourguignon
2015-07-05 22:59           ` Richard Wordingham
2015-07-06 13:51           ` Barry Fishman
2015-07-06 16:04             ` Stefan Monnier
     [not found]   ` <mailman.6368.1436111238.904.help-gnu-emacs@gnu.org>
2015-07-06  9:49     ` Andrea Venturoli
2015-07-06 14:37       ` Barry Margolin
2015-07-06 15:33         ` Andrea Venturoli
2015-07-07  0:29         ` Robert Thorpe
     [not found] ` <mailman.6367.1436109760.904.help-gnu-emacs@gnu.org>
2015-07-05 15:36   ` Pascal J. Bourguignon
2015-07-05 16:30     ` Stefan Monnier
2015-07-05 16:39       ` Paul Smith
2015-07-06  8:49       ` Gian Uberto Lauri
     [not found]       ` <mailman.6423.1436172566.904.help-gnu-emacs@gnu.org>
2015-07-06 10:34         ` Pascal J. Bourguignon

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).