Re: Trimming email replies in gnus/message-mode

Jean Louis <[email protected]>
Newsgroups gmane.emacs.help
Organization GNU Support
Message-ID <[email protected]>
(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
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.