Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
From: Walt Buehring <wjb100@iono.com>
To: info-gnus-english@gnu.org
Subject: new func: gnus-group-list-more-groups
Date: Tue, 29 Jan 2008 18:30:18 GMT	[thread overview]
Message-ID: <u4pcw4h8u.fsf@iono.com> (raw)

Been making more use of group levels lately and thought it would be
awfully nice if "L" (normally gnus-group-list-all-groups) would
instead progressively increase the listing level in steps.  That is,
determine the currently listed level and bump it to display more.

Below is a poor implementation of the idea (with level bumps hardcoded
in a case stmt).  As a side benefit it also raises the activation
level once gnus-activate-level is exceeded - which is nice.(?)

-W


(defun gnus-group-list-more-groups (&optional arg)
  "Progressively list additional groups at increasing levels.
With arg, only list groups with level ARG or lower."
  (interactive "P")
  (if arg
      (gnus-group-list-groups arg t)
    ;; determine the max level group currently displayed
    (let ((maxlevel 0)
	  glevel newlevel)
      (save-excursion
	(goto-char (point-min))
	(while (not (eobp))
	  (setq glevel (or (get-text-property (point) 'gnus-level) 0)
		maxlevel (max glevel maxlevel))
	  (forward-line 1)))
      ;; choose next level in progression
      (setq newlevel (case maxlevel
		       (2 3)
		       (3 5)
		       (5 6)
		       (t 9)))
      ;; activate at new level if appropriate
      (when (> newlevel gnus-activate-level)
	(let ((gnus-activate-level newlevel)
	      (gnus-activate-foreign-newsgroups newlevel))
		(gnus-group-get-new-news newlevel)))
      (gnus-group-list-groups newlevel t))))

             reply	other threads:[~2008-01-29 18:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-29 18:30 Walt Buehring [this message]
2008-02-14 19:49 ` Reiner Steib

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=u4pcw4h8u.fsf@iono.com \
    --to=wjb100@iono.com \
    --cc=info-gnus-english@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).