help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

interactive to do `use-region-p'


From: Emanuel Berg
Subject: interactive to do `use-region-p'
Date: Sun, 06 Nov 2022 14:45:30 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

This is a common situation (the first three lines of the code
below) and possible area of integration, because there is
already a lowercase "r" you can send to `interactive', however
that doesn't do `use-region-p', maybe we could have an
uppercase "R" that sent (nil nil) unless use-region-p, and
otherwise behaved like "r", i.e. sent the region to beg
and end?

(defun gnus-summary-respool-all (&optional beg end)
  (interactive (when (use-region-p)
                 (list (region-beginning) (region-end)) ))
  (or beg (setq beg (point-min)))
  (or end (setq end (point-max)))
  (let ((lines  (count-lines beg end))
        (method (gnus-find-method-for-group "nnml:mail.misc")) )
    (goto-char beg)
    (gnus-summary-respool-article lines method) ))

https://dataswamp.org/~incal/emacs-init/gnus/summary.el

-- 
underground experts united
https://dataswamp.org/~incal




reply via email to

[Prev in Thread] Current Thread [Next in Thread]