unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* interactive to do `use-region-p'
@ 2022-11-06 13:45 Emanuel Berg
  2022-11-06 15:41 ` [External] : " Drew Adams
  0 siblings, 1 reply; 8+ messages in thread
From: Emanuel Berg @ 2022-11-06 13:45 UTC (permalink / raw)
  To: help-gnu-emacs

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




^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-11-07 17:25 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-06 13:45 interactive to do `use-region-p' Emanuel Berg
2022-11-06 15:41 ` [External] : " Drew Adams
2022-11-06 18:53   ` Emanuel Berg
2022-11-07  1:41   ` Stefan Monnier via Users list for the GNU Emacs text editor
2022-11-07  2:29     ` Drew Adams
2022-11-07 12:28       ` Emanuel Berg
2022-11-07 15:51         ` Drew Adams
2022-11-07 17:25           ` Emanuel Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).