From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Nick Dokos Newsgroups: gmane.emacs.help Subject: Re: Any way to remove ^L or ^M from some buffer outputs? Date: Mon, 05 Oct 2020 15:16:22 -0400 Message-ID: <87tuv8wkjd.fsf@alphaville.usersys.redhat.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36678"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) To: help-gnu-emacs@gnu.org Cancel-Lock: sha1:j/J+nKucFbfovZ25vX5tAteUur0= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Oct 05 21:18:04 2020 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kPVzn-0009SE-An for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 05 Oct 2020 21:18:03 +0200 Original-Received: from localhost ([::1]:53708 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPVzm-0006jd-BN for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 05 Oct 2020 15:18:02 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49522) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPVyO-0006iQ-Cq for help-gnu-emacs@gnu.org; Mon, 05 Oct 2020 15:16:36 -0400 Original-Received: from static.214.254.202.116.clients.your-server.de ([116.202.254.214]:49800 helo=ciao.gmane.io) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPVyM-0002kI-Rq for help-gnu-emacs@gnu.org; Mon, 05 Oct 2020 15:16:36 -0400 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1kPVyH-0007kY-0d for help-gnu-emacs@gnu.org; Mon, 05 Oct 2020 21:16:29 +0200 X-Injected-Via-Gmane: http://gmane.org/ Received-SPF: pass client-ip=116.202.254.214; envelope-from=geh-help-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/05 14:44:07 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FREEMAIL_FORGED_FROMDOMAIN=0.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, NML_ADSP_CUSTOM_MED=0.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:124328 Archived-At: Jean Louis 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