From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Patrick Mahan Newsgroups: gmane.emacs.help Subject: Re: Any way to remove ^L or ^M from some buffer outputs? Date: Sun, 4 Oct 2020 13:32:50 -0700 Message-ID: References: <87pn5xrctr.fsf@ebih.ebihd> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36540"; mail-complaints-to="usenet@ciao.gmane.io" To: Emanuel Berg , help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Oct 04 22:33:45 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 1kPAhV-0009Ot-55 for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 04 Oct 2020 22:33:45 +0200 Original-Received: from localhost ([::1]:50106 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPAhU-00005q-6w for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 04 Oct 2020 16:33:44 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36784) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPAgs-00005I-1K for help-gnu-emacs@gnu.org; Sun, 04 Oct 2020 16:33:06 -0400 Original-Received: from mail-lf1-x136.google.com ([2a00:1450:4864:20::136]:38844) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kPAgp-0007WS-Mq for help-gnu-emacs@gnu.org; Sun, 04 Oct 2020 16:33:05 -0400 Original-Received: by mail-lf1-x136.google.com with SMTP id y11so8440709lfl.5 for ; Sun, 04 Oct 2020 13:33:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=qS/HTA+CWxM4fNTbnVqqAJYM6pUIUi/NcwEEZUKM/kg=; b=WdH7sv3w+uQU2Z44OFYNEhHwR4L/tQvyKJ3zngTkX/yIJWQMG8cJ4zVlSaHBFXhXhj YTUUYofRVVHxyPwC5qB3eSf+1Bn/MY4KPL1qHx/4/KLszYsIZRiWRUcF3sVLgJVwLajq J8MAfajImuz51SaBCdV5TKfj6tnW9vZP0zWdUICGzmCmodT4n1Uwh217dmVdm4O0YWu4 fjVd8wIilBeWpUqUPWd1xqpLPNZ6Glvg04bTDjp7HlCciFA7EaM1N8jpwyvSSrXAK2wS y7/6CYeQex189zzNoIb0sIYJ0qdJ8w0rYwrTprrrmDI6Vi2r07wfAvWykM1w69dzvqtd IkIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=qS/HTA+CWxM4fNTbnVqqAJYM6pUIUi/NcwEEZUKM/kg=; b=JvtaZ25LH/iqvoCr0H9OzURe38uekxBe+9Xg9RNcA2jKozmb4QjCP1o02I5eC0aBSk 7VYvgLiu/NcszKASm+Z+Mc1FcawAd0oiz9oOu6pEuGqvOBE5SbQz4jaaWVm092jCr6mi l+c6eVPwLsCBU5W19jhbAnFy3TevLflB4JX7n7o49HSB4zYmY5ankEKPH5khxJVcC268 9Z18K99qeXs70YHkZJNhIHCuw8FQl2R/e5L0/wIOCC78fMp1WV6GIgdD/jwCD2Vfb01u EUYuiKit08xLrh+CfPXRssxo+YcmCbp5utwIH4t/46S3uICwpdz3sIuBFAzXp5QZ3+hJ 92wQ== X-Gm-Message-State: AOAM530L8RThOH5TJEnsmkl48dWzsJpRAx8V+bM+SyRxp2ZIHGdUOyrd /f65JC9KOXhnQy0JnCxpGf8TulnsgRZ0iUKI9io= X-Google-Smtp-Source: ABdhPJznj22lI73OhpUH46rZdobewIMGYFqTUpf5SlNZxbBLtAYxmzU4Thg4IBVrQE8aFsB7OEszJ09Xb7ooa4qzkm0= X-Received: by 2002:a19:dd5:: with SMTP id 204mr4077380lfn.579.1601843581735; Sun, 04 Oct 2020 13:33:01 -0700 (PDT) In-Reply-To: <87pn5xrctr.fsf@ebih.ebihd> Received-SPF: pass client-ip=2a00:1450:4864:20::136; envelope-from=plmahan@gmail.com; helo=mail-lf1-x136.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Content-Filtered-By: Mailman/MimeDel 2.1.23 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:124303 Archived-At: Yes, I have never byte-compiled it as I have only used it interactively to clean-up text files coming from a DOS world to linux/unix/macos. It is defined in my .emacs init file. On Sun, Oct 4, 2020 at 12:50 PM Emanuel Berg via Users list for the GNU Emacs text editor wrote: > Patrick Mahan wrote: > > > (defun cut-ctrlM () > > "Cut all visible ^M." > > (interactive) > > (beginning-of-buffer) > > (while (search-forward "\r" nil t) > > (replace-match "" nil t)) > > (not-modified) > > (beginning-of-buffer)) > > Well, yeah, if we want to replace (not hide), only, > as always, the byte compiler is your friend! > > In cut-ctrlM: > [...]Warning: =E2=80=98beginning-of-buffer=E2=80=99 is for interactive = use only; use > =E2=80=98(goto-char (point-min))=E2=80=99 instead. > [...]Warning: =E2=80=98not-modified=E2=80=99 is for interactive use onl= y; use > =E2=80=98set-buffer-modified-p=E2=80=99 instead. > [...]Warning: =E2=80=98beginning-of-buffer=E2=80=99 is for interactive = use only; use > =E2=80=98(goto-char (point-min))=E2=80=99 instead. > > And... maybe wrap it in `save-excursion' as well? > > -- > underground experts united > http://user.it.uu.se/~embe8573 > https://dataswamp.org/~incal > > >