info-gnus-english
[Top][All Lists]
Advanced

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

Some useful key bindings


From: Cecil Westerhof
Subject: Some useful key bindings
Date: Wed, 23 Dec 2009 13:06:29 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (gnu/linux)

Most of the time I am not interested in all the groups. So I wrote a few
functions and key bindings to easily switch between different situation.
I hope it is useful to somebody. Of course the list with topics have to
be changed to fit your situation. It does not work completely correct,
but good enough to share.
The key bindings are 'v t ?', with:
  a: show all topics
  c: show compact topics
  i: show important topics (compact and a few extra)
  n: show no topics

The code:
    (defun gnus-topic-hide-all ()
      (interactive)
      (gnus-topic-show-all)
      (gnus-topic-hide-list (gnus-topic-list)))

    (defun gnus-topic-hide-list (this-list)
      (interactive)
      (dolist (this-topic this-list)
            (when (gnus-topic-goto-topic this-topic)
              (gnus-topic-hide-topic))))

    (defun gnus-topic-show-all ()
      (interactive)
      (gnus-topic-show-list (gnus-topic-list)))

    (defun gnus-topic-show-compact ()
      (interactive)
      (gnus-topic-hide-all)
      (gnus-topic-show-list (list "Bedrijf" "Emacs" "NLLGG" "Privé")))

    (defun gnus-topic-show-important ()
      (interactive)
      (gnus-topic-show-compact)
      (gnus-topic-show-list (list "Algemeen" "InfoB" "Language" "Linux"
                                  "Tex" "Web" "InfoP" "Misc")))

    (defun gnus-topic-show-list (this-list)
      (dolist (this-topic this-list)
        (gnus-topic-jump-to-topic this-topic)
        (gnus-topic-show-topic)))

and the key bindings:
    (define-key gnus-group-mode-map (kbd "v t a")
      'gnus-topic-show-all)

    (define-key gnus-group-mode-map (kbd "v t c")
      'gnus-topic-show-compact)

    (define-key gnus-group-mode-map (kbd "v t i")
      'gnus-topic-show-important)

    (define-key gnus-group-mode-map (kbd "v t n")
      'gnus-topic-hide-all)

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof


reply via email to

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