πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.text.sgml
Article #736

Re: customized font-locking for DocBook in psgml?

#736
From: Lennart Staflin
Date: Sat, 21 Apr 2001 08:18
34 lines
2598 bytes
Laurens Kils-HοΏ½tten wrote:

> I would like to add some extra font-locking features to psgml in order to
> make editing instances of docbook more intuitive. For instance display text
> enclosed in <title></title> bold and in an outstanding color, hyperlinks in
> blue etc.
>
> Has anyone worked on such a customization? Could you post/mail it or give
> me a link to resources?

I have made some experimental modifications for this. If you have the latest
version of PSGML (1.2.2) you can have a look in the file psgml-debug.el that
is included in the distribution. In psgml-debug I put some debugging code and
also some experimental code (candidates for additions to PSGML).

The interesting code is at the end of psgml-debug, starting with:

;;;; Adding appdata to element types
;;; Candidate for PI PSGML processing

Then you need to add some PIs to you DTD:

<?PSGML ELEMENT title face=bold >

Where bold must be a defined emacs face.

A note about the PI-syntax. After "PSGML ELEMENT" there should be a element
name (gi) followed by something almost like an attribute specification list.
An important difference is if the attribute value is not a literal, as in the
example above, it is parsed as a Lisp expression. In the example 'bold' is
parsed as a Lisp symbol and the space after the name is important because
Emacs Lisp allows '>' to be part of symbol names.

//Lennart
Technical Details
Message-ID: <3AE14270.B4BB562A@lysator.liu.se>
Path: arc1-ca.pugleaf.net!newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!148.122.208.68!news2.oke.nextra.no!nextra.com!news3.oke.nextra.no.POSTED!not-for-mail
References: <slrn9dp993.mr.laurens@Powerbook.koob.rewop>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: fa82c,196658a7405de0fa
X-Google-Attributes: gidfa82c,public
X-Google-Thread: 103b8b,196658a7405de0fa
X-Google-Attributes: gid103b8b,public
X-Google-ArrivalTime: 2001-04-21 01:37:36 PST
Path: arc1-ca.pugleaf.net!newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!148.122.208.68!news2.oke.nextra.no!nextra.com!news3.oke.nextra.no.POSTED!not-for-mail
Message-ID: <3AE14270.B4BB562A@lysator.liu.se>
From: Lennart Staflin <lenst@lysator.liu.se>
X-Mailer: Mozilla 4.73C-CCK-MCD {C-UDP; EBM-APPLE} (Macintosh; U; PPC)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: comp.text.sgml,gnu.emacs.help
Subject: Re: customized font-locking for DocBook in psgml?
References: <slrn9dp993.mr.laurens@Powerbook.koob.rewop>
Content-Type: text/plain; charset=iso-8859-1; x-mac-type="54455854"; x-mac-creator="4D4F5353"
Content-Transfer-Encoding: 8bit
Lines: 37
Date: Sat, 21 Apr 2001 10:18:56 +0200
NNTP-Posting-Host: 130.67.6.141
X-Complaints-To: news-abuse@nextra.no
X-Trace: news3.oke.nextra.no 987842246 130.67.6.141 (Sat, 21 Apr 2001 10:37:26 MEST)
NNTP-Posting-Date: Sat, 21 Apr 2001 10:37:26 MEST
Organization: Nextra Public Access