Gnus development mailing list
 help / color / mirror / Atom feed
From: "Joe Casadonte" <jcasadonte@northbound-train.com>
Subject: Font-lock for Server mode
Date: 17 Aug 2001 17:27:32 -0400	[thread overview]
Message-ID: <u4rr62x8b.fsf@terrapin.northbound-train.com> (raw)

I find myself in the server buffer a couple of times a day, for one
reason or another, and I thought a little syntax coloring based on
status would be nice.  So here it is; include it if you'd like.

I'd send in a patch if I knew how (though honestly I only poked around
for it; I'm sure there's a command somewhere that I'm missing), but
the code can go anywhere, really.  Except for the one line that needs
to go (somewhere) in `gnus-server-mode':

    (defun gnus-server-mode ()
        ...
        (setq buffer-read-only t)
=>      (set (make-local-variable 'font-lock-defaults) '(gnus-server-font-lock-keywords t))
        (gnus-run-hooks 'gnus-server-mode-hook))

and the rest:

(defface gnus-server-opened-face
  '((((class color) (background light)) (:foreground "Green3" :bold t))
    (((class color) (background dark)) (:foreground "Green1" :bold t))
    (t (:bold t)))
  "Face used for displaying OPENED servers"
  :group 'gnus-server-faces)

(defface gnus-server-closed-face
  '((((class color) (background light)) (:foreground "Steel Blue" :italic t))
    (((class color) (background dark)) (:foreground "Light Steel Blue" :italic t))
    (t (:italic t)))
  "Face used for displaying CLOSED servers"
  :group 'gnus-server-faces)

(defface gnus-server-denied-face
  '((((class color) (background light)) (:foreground "Red" :bold t))
    (((class color) (background dark)) (:foreground "Pink" :bold t))
    (t (:inverse-video t :bold t)))
  "Face used for displaying DENIED servers"
  :group 'gnus-server-faces)

(defvar gnus-server-opened-face	'gnus-server-opened-face
  "Face name to use on OPENED servers.")

(defvar gnus-server-closed-face	'gnus-server-closed-face
  "Face name to use on CLOSED servers.")

(defvar gnus-server-denied-face	'gnus-server-denied-face
  "Face name to use on DENIED servers.")

(defvar gnus-server-font-lock-keywords
  (list
   '("(\\(opened\\))" 1 gnus-server-opened-face)
   '("(\\(closed\\))" 1 gnus-server-closed-face)
   '("(\\(denied\\))" 1 gnus-server-denied-face)
   ))

--
Regards,

joe
Joe Casadonte
jcasadonte@northbound-train.com

------------------------------------------------------------------------------
         Llama Fresh Farms => http://www.northbound-train.com
   Gay Media Resource List => http://www.northbound-train.com/gaymedia.html
            Perl for Win32 => http://www.northbound-train.com/perlwin32.html
               Emacs Stuff => http://www.northbound-train.com/emacs.html
          Music CD Trading => http://www.northbound-train.com/cdr.html
------------------------------------------------------------------------------
                       Live Free, that's the message!
------------------------------------------------------------------------------



             reply	other threads:[~2001-08-17 21:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-17 21:27 Joe Casadonte [this message]
2001-08-19 10:47 ` Simon Josefsson
2001-08-19 15:50   ` Mind The Paperwork (was: Font-lock for Server mode) Lars Magne Ingebrigtsen
2001-08-19 17:18     ` Simon Josefsson

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=u4rr62x8b.fsf@terrapin.northbound-train.com \
    --to=jcasadonte@northbound-train.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).