Gnus development mailing list
 help / color / mirror / Atom feed
From: Lloyd Zusman <ljz@asfast.com>
Subject: A solution that's better than my ugly hack?
Date: Mon, 13 Jan 2003 13:47:17 -0500	[thread overview]
Message-ID: <8665ssevka.fsf_-_@asfast.com> (raw)
In-Reply-To: <8665t4bwp2.fsf@asfast.com> (Lloyd Zusman's message of "Sat, 04 Jan 2003 13:23:53 -0500")

A week or two ago I posted this ugly hack here (quoted below) to provide
a feature that I've wanted: if I enter a group with no unread articles,
I only see the last N already-read articles (where N is configurable),
instead of the entire set of already-read's; but if I enter a group with
at least one unread article, I only see the unreads (and in both cases,
I'd also see the ticked and dormant articles).

Has anyone been able to figure out a cleaner way of getting this same
functionality, instead of this horrible, defadvice-based hack?

Thanks in advance.


>  (defvar ljz-group-default-display-count 256
>    "*Default count of articles to display when entering a group, if there
>  are no unread, dormant, or ticked articles, and if there is no prefix
>  argument.")
>
>  ;; Yes, I know that all of the variables defined in the `let*' clause
>  ;; are not really necessary, but I put them there so I could more easily
>  ;; put meaningful debug statements into the code during development.
>  (defadvice gnus-group-read-group (around gnus-group-read-group freeze)
>    (interactive "P")
>    (let* ((the-group (or group (gnus-group-group-name)))
>           (the-unread-count (gnus-group-unread the-group))
>           (the-marks (gnus-info-marks (gnus-get-info the-group)))
>           (the-dormant (cdr (assq 'dormant the-marks)))
>           (the-ticked (cdr (assq 'tick the-marks)))
>           (the-count
> 	      (+ the-unread-count (length the-dormant) (length the-ticked)))
>           (the-parameter (if all all (if (> the-count 0)
> 					 nil
> 				       ljz-group-default-display-count))))
>      (ad-set-arg 0 the-parameter)
>      ad-do-it))
>

-- 
 Lloyd Zusman
 ljz@asfast.com



  reply	other threads:[~2003-01-13 18:47 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-01 22:23 Concerning marks and the back end Lloyd Zusman
2003-01-02 16:57 ` Kai Großjohann
2003-01-02 18:23   ` Lloyd Zusman
2003-01-02 18:46     ` Lars Magne Ingebrigtsen
2003-01-03  2:23       ` Lloyd Zusman
2003-01-03  2:45         ` Simon Josefsson
2003-01-03  2:56           ` Lloyd Zusman
2003-01-03  3:01             ` Lloyd Zusman
2003-01-03  4:11               ` Simon Josefsson
2003-01-03  4:59                 ` Lloyd Zusman
2003-01-03 14:57                   ` Simon Josefsson
2003-01-04 18:23                   ` Lloyd Zusman
2003-01-13 18:47                     ` Lloyd Zusman [this message]
2003-01-13 18:53                       ` A solution that's better than my ugly hack? Lars Magne Ingebrigtsen
2003-01-13 19:00                         ` Lloyd Zusman
2003-01-13 19:18                           ` Lars Magne Ingebrigtsen
2003-01-13 19:26                             ` Lloyd Zusman
2003-01-13 19:30                               ` Lars Magne Ingebrigtsen
2003-01-13 19:33                                 ` Lloyd Zusman
2003-01-13 21:04                                 ` Lloyd Zusman
2003-01-13 19:32                               ` Lloyd Zusman
2003-01-03 17:54         ` Concerning marks and the back end Kai Großjohann
2003-01-03 18:20           ` Lloyd Zusman
2003-01-03 17:53     ` Kai Großjohann
2003-01-03 18:15       ` Lloyd Zusman
2003-01-03 19:18         ` Kai Großjohann
2003-01-03 19:34           ` Lloyd Zusman
2003-01-03 19:43             ` Lloyd Zusman
2003-01-03 21:03               ` Kai Großjohann
2003-01-03 21:24                 ` Lloyd Zusman
2003-01-04 14:52                   ` Kai Großjohann
2003-01-04 16:19                     ` Lloyd Zusman
2003-01-03 20:17             ` Lars Magne Ingebrigtsen
2003-01-03 20:41               ` Lloyd Zusman
2003-01-03 20:45                 ` Lars Magne Ingebrigtsen
2003-01-03 20:52                   ` Lloyd Zusman
2003-01-03 21:05                     ` Kai Großjohann
2003-01-03 21:05                 ` Kai Großjohann
2003-01-04  4:50                   ` Lloyd Zusman
2003-01-03 20:53             ` Paul Jarc
2003-01-03 20:58               ` Lloyd Zusman
2003-01-03 21:02             ` Kai Großjohann
2003-01-02 19:14 ` Simon Josefsson
2003-01-03  2:25   ` Lloyd Zusman

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=8665ssevka.fsf_-_@asfast.com \
    --to=ljz@asfast.com \
    /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).