[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: |
Mon, 05 Oct 2020 05:57:35 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) |
> (defun delete-c-m (&optional beg end)
> (interactive (if (use-region-p)
> (list (region-beginning) (region-end))
> (list (point-min) (point-max)) ))
> (save-excursion
> (goto-char beg)
> (while (search-forward "\r" end t)
> (replace-match "" nil t) )
> (set-buffer-modified-p nil) ; can be used or omitted...
> ))
BTW `search-forward' has a formally incorrect
docstring in
GNU Emacs 26.1 (build 2, x86_64-pc-linux-gnu) of
2019-09-23, modified by Debian
that way "bounds" won't get font locked with
`help-argument-name' (it should be BOUNDs, or
reformulated: "An optional second argument bounds the
search" - ... and optimally the word appears as the
argument is and nothing else, right? but regardless
of whatever, please just upcase it so one can see it
instantly, and I'm happy :))
--
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?, Patrick Mahan, 2020/10/04
Re: Any way to remove ^L or ^M from some buffer outputs?, Nick Dokos, 2020/10/05