Re: Trimming email replies in gnus/message-mode

Martin Kjær Jørgensen via Users list for the GNU Emacs text editor <[email protected]>
Newsgroups gmane.emacs.help
Message-ID <[email protected]>
On 04/22/26 20:31 PM, Jean Louis wrote:
> (defun trim-one-reply-level ()
>   "Remove one '>' from start of each line in region."
>   (interactive)
>   (when (use-region-p)
>     (save-excursion
>       (let ((start-line (line-number-at-pos (region-beginning)))
>             (end-line (line-number-at-pos (region-end))))
>         (goto-char (region-beginning))
>         (dotimes (i (1+ (- end-line start-line)))
>           (beginning-of-line)
>           (when (looking-at "^>+")
>             (delete-char 1)
>             (when (looking-at " ")
>               (delete-char 1)))
>           (forward-line 1))))))
>
> From:
>
>> One
>> > One more
>> > > more
>
> to
>
> One
>> One more
>> > more
>
> From
>
>> > One
>> > > One more
>> > > > more
>
> to
>
>> One
>> > One more
>> > > more
>

Yes, kinda like that, except I wish to delete the trimmed lines, and not just
remove '> ' effectively move the text further and further back.

-- 
/Martin
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.