help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Any way to remove ^L or ^M from some buffer outputs?


From: Nick Dokos
Subject: Re: Any way to remove ^L or ^M from some buffer outputs?
Date: Mon, 05 Oct 2020 15:16:22 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Jean Louis <bugs@gnu.support> writes:

> 
> Compiling file /home/data1/protected/Programming/emacs-lisp/rcd-cf.el at Sun 
> Oct  4 17:48:33 2020
>
> In cf-sms-exists:
> rcd-cf.el:437:18: Warning: reference to free variable ā€˜nā€™ Disable showing
>     Disable logging
>
> I am not sure if you can see ^L above, let us say I am compiling or
> having some shell output, then I see often ^L, this may be line feed,
> I do not know, but it looks green here on my side and is often not
> interpreted correctly, line after line, but just as special character
> after which other output lines are shown.

#+BEGIN_ANCIENT_HISTORY

It is a "form-feed" - in the olden days, the line printer program would output
one of these at the end of a job (although programs could do that as well) in
order to line up the output of the next program with the perforations in the
continuous-feed paper.

Terminals sometimes used it to clear the screen. And it is still used e.g. when
you define file-local variables in emacs:

#+begin_quote
   If some unrelated text might look to Emacs as a local variables list,
you can countermand that by inserting a form-feed character (a page
delimiter, *note Pages::) after that text.  Emacs only looks for
file-local variables in the last page of a file, after the last page
delimiter.
#+end_quote

>
> In this case I see Emacs compiling buffer. It seems not necessary to
> be in the buffer like that.
>
> Then in shell buffers, I see something like this below:
>
> Output file: 
> /home/data1/protected/Media/Videos/Recordings/2020/10/2020-10-04/2020-10-04-17:51:02.ogv
> ^M[0%] ^M[1%] ^M[2%] ^M[3%] ^M[4%] ^M[5%] ^M[6%] ^M[7%] ^M[8%] ^M[9%]
> ^M[10%] ^M[10%] ^M[11%] ^M[12%] ^M[13%] ^M[14%] ^M[15%] ^M[16%]
> ^M[17%] ^M[18%] ^M[19%] ^M[20%] ^M[20%] ^M[21%] ^M[22%] ^M[23%]
> ^M[24%] ^M[25%] ^M[26%] ^M[27%] ^M[28%] ^M[29%] ^M[30%]
>
> Is that alright to be so? Maybe there is way to remove those by
> setting something?
>
>
This is the output of a program that implements a poor man's version
of a progress meter: ^M is a carriage return (CR) which moves the
typewriter head to the beginning of the current line (it is then
usually - but not in this case - followed by a line feed in order to
allow you to type on the next line - I believe Windows text files
still have a CR/LF combination marking the end of each line in the
file).

By prepending a CR on each output, the next output overwrites the
previous value, showing you the progress of the task.

But it only works on typewrites, teletypes, terminals and terminal
emulators that implement these operations exactly. A shell in emacs
does not do that and prefers to output everything more-or-less verbatim.

#END_ANCIENT_HISTORY

We now return you to the 21st century...

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




reply via email to

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