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

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

Re: Make Gnus highlighting Lisp snippets ?


From: Marcus Frings
Subject: Re: Make Gnus highlighting Lisp snippets ?
Date: Tue, 29 Jun 2004 17:39:34 -0000
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux)

* Hans-Peter Binder <hpb@appledomain.de> wrote:
> * Xavier Maillard <zedek@gnu-rox.org> writes:

>> Is there a possibility (I am pretty sure there is one) to make
>> Gnus (No Gnus) highlighting code snippets for certain groups ?

> Maybe this one can help you.

> ;; fontlocking Lisp in News,
> ;; i.e. all groups with 'gnu' and 'emacs'

>     (defvar egoge-emacs-lisp-ngs-regexp
>       (regexp-opt
>        '(
>        "gnu" "emacs"
>        )))

>     (add-to-list 'mm-uu-type-alist
>                '(emacs-lisp "^(" ")\\s-*\\(\n\n\\|\n?\\'\\)"
>                             mm-uu-emacs-sources-extract nil
>                             egoge-mm-uu-emacs-lisp-test))

>     (defun egoge-mm-uu-emacs-lisp-test ()
>       (and gnus-newsgroup-name
>          (string-match egoge-emacs-lisp-ngs-regexp
>                        gnus-newsgroup-name)))

>     (mm-uu-configure)

I use a slightly modified version:

;; Highlight Lisp code in article buffer
;; Oliver Scholz in <m366152i3i.fsf@ID-87814.user.dfncis.de>
;; Alternative code: <86brpj6fq0.fsf@pille.fhaun.de>
;:*=========================================================
(defvar egoge-emacs-lisp-ngs-regexp
  (regexp-opt '("de.comm.software.gnus" "de.comp.editoren"
                "gmane.emacs.gnus.general" "gnu.emacs.help"
                "gnu.emacs.gnus"  "gnu.emacs.sources")))

(defun egoge-mm-uu-emacs-lisp-test ()
  (setq file-name (match-string 1))
  (and gnus-newsgroup-name
       (string-match egoge-emacs-lisp-ngs-regexp gnus-newsgroup-name)))

(add-to-list 'mm-uu-type-alist
             '(emacs-lisp
               "^("
               ")\\s-*\\(\n\n\\|\n?\\'\\)"
               mm-uu-emacs-sources-extract
               nil
               egoge-mm-uu-emacs-lisp-test))

(mm-uu-configure)

Regards,
Marcus
-- 
Spook words for the NSA: President, Military Intelligence, PGP, Defense, SASR,
CDC, DOE, FMS, HPCC, NTIS, SEL, USCODE, CISE, SIRC, CIM, ISN, DJC, SGC, CDA,
M-14, Infowar, Attack, EloAufkl, Chemical, Activist, CRYPT, Lacrosse, Control,
Communications, VX, Assassin, Sniper, Ingram, Industrial, Plutonium, Nuclear


reply via email to

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