[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: |
Emanuel Berg |
Subject: |
Re: Any way to remove ^L or ^M from some buffer outputs? |
Date: |
Sun, 04 Oct 2020 21:49:36 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) |
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?, Emanuel Berg, 2020/10/05
- 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