[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 00:56:05 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) |
Patrick Mahan wrote:
> 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.
Well, you can byte-compile your .emacs as well. It is
just another Elisp file...
Anyway, here (last) is a refined version, if you
don't mind...
I wonder tho... why does (insert-char 13) insert ^M
but M-x insert-char 13 RET inserts ^S?
(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 user or omitted...
))
;; (insert-char 13)
--
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?, 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