[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: |
Patrick Mahan |
Subject: |
Re: Any way to remove ^L or ^M from some buffer outputs? |
Date: |
Sun, 4 Oct 2020 13:32:50 -0700 |
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 <help-gnu-emacs@gnu.org> 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: ‘beginning-of-buffer’ is for interactive use only; use
> ‘(goto-char (point-min))’ instead.
> [...]Warning: ‘not-modified’ is for interactive use only; use
> ‘set-buffer-modified-p’ instead.
> [...]Warning: ‘beginning-of-buffer’ is for interactive use only; use
> ‘(goto-char (point-min))’ instead.
>
> And... maybe wrap it in `save-excursion' as well?
>
> --
> underground experts united
> http://user.it.uu.se/~embe8573
> https://dataswamp.org/~incal
>
>
>
- RE: Any way to remove ^L or ^M from some buffer outputs?, (continued)
- RE: Any way to remove ^L or ^M from some buffer outputs?, Drew Adams, 2020/10/05
- Re: Any way to remove ^L or ^M from some buffer outputs?, Jean Louis, 2020/10/05
- Re: Any way to remove ^L or ^M from some buffer outputs?, Eli Zaretskii, 2020/10/05
- Re: Any way to remove ^L or ^M from some buffer outputs?, Eli Zaretskii, 2020/10/05
- Re: Any way to remove ^L or ^M from some buffer outputs?, Yuri Khan, 2020/10/05
- Re: Any way to remove ^L or ^M from some buffer outputs?, Stefan Monnier, 2020/10/05
- Re: Any way to remove ^L or ^M from some buffer outputs?, Jean Louis, 2020/10/09
- Re: Any way to remove ^L or ^M from some buffer outputs?, Eli Zaretskii, 2020/10/10
Re: Any way to remove ^L or ^M from some buffer outputs?, Patrick Mahan, 2020/10/04
Re: Any way to remove ^L or ^M from some buffer outputs?, Nick Dokos, 2020/10/05