Gnus development mailing list
 help / color / mirror / Atom feed
From: Lars Magne Ingebrigtsen <larsi@ifi.uio.no>
Subject: Mode lines and stuff
Date: 27 May 1997 16:34:08 +0200	[thread overview]
Message-ID: <m2d8qdq90f.fsf@proletcult.slip.ifi.uio.no> (raw)

I thought I could be a bit naughty and use the minor mode specs to say
whether Gnus is online or not.  So I did this in `gnus-agent-mode',
which is a minor mode installed in all Gnus buffers:

(defvar gnus-agent-mode-status '(gnus-agent-mode " Online"))

(defun gnus-agent-mode ()
  ...
  (unless (assq 'gnus-agent-mode minor-mode-alist)
      (push gnus-agent-mode-status minor-mode-alist))
  ...)

And then to toggle on and off, I use this command:

(defun gnus-agent-toggle-online (online)
  "Toggle whether Gnus is online or not."
  (interactive (list (not gnus-online)))
  (if (setq gnus-online (not gnus-online))
      (setcar (cdr gnus-agent-mode-status) " Online")
    (setcar (cdr gnus-agent-mode-status) " Offline"))
  (set-buffer-modified-p t))

This works.  However, it works badly.  Each time I run this command, a
new " Online" (or " Offline") is added to the mode line, so it grows
rather big.  Not only that, whenever this command is used, *all* the
old " Online"s (or " Offline"s) flip over.

This is all rather strange.  Anyone here familiar with how the mode
bar works?

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@ifi.uio.no * Lars Magne Ingebrigtsen


             reply	other threads:[~1997-05-27 14:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-05-27 14:34 Lars Magne Ingebrigtsen [this message]
     [not found] ` <wkvi44eq2y.fsf@peorth.gweep.net>
1997-05-30 20:16   ` Lars Magne Ingebrigtsen

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=m2d8qdq90f.fsf@proletcult.slip.ifi.uio.no \
    --to=larsi@ifi.uio.no \
    /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).