Re: Re: auto-indenting

Peter Flynn <[email protected]> Wed, 07 Jul 2004 20:53:59 +0100
Newsgroups gmane.emacs.psgml.user
Organization Silmaril Consultants
Message-ID <[email protected]>
On Wed, 2004-07-07 at 16:50, David Abrahams wrote:
[me]
> > <?PSGML nofill programlisting screen ?> 
> >  
> > to the top of your document (I put it after the DocType Declaration 
> > and before the root element start-tag). 
> 
> Doesn't work for me.  Perhaps this is related to the other parsing
> problems I'm having?

What other parsing problems are you having?

> I'm getting frustrated.  How does anyone manage to get this stuff to
> work?

The nofill PI only works in recent versions. I though it was built in
but a quick look at my site-lisp directory shows a separate file,
psgml-nofill.el so as it's very short, here it is. Is this not part of
regular psgml yet?

///Peter
-- 
(require 'psgml-parse)
(require 'psgml-edit)

;; psgml-parse.el

(defun sgml-parse-set-appflag (flagsym)
  (loop for name = (sgml-parse-name)
        while name
        for et = (sgml-lookup-eltype name)
        for flag-value = t
        do
        (when (looking-at "@")
          (forward-char 1)
          (let ((attr (sgml-check-name)))
            (sgml-check-delim "VI")
            (let ((val (sgml-parse-literal)))
              (setq flag-value (cons attr val)))))
        (setf (sgml-eltype-appdata et flagsym) flag-value)
        (message "Defining element %s as %s %S" name flagsym flag-value)
        (sgml-skip-cs)))

;; psgml-edit.el

(defun sgml-element-fillable (element)
  (and (sgml-element-mixed element)
       (let ((nofill (sgml-element-appdata element 'nofill)))
         (if (or (eq nofill t) (not (consp nofill)))
             t
           (let ((attr (car nofill))
                 (val  (cdr nofill)))
             (let ((attval (sgml-element-attval element attr)))
               (not (equal val attval))))))))




-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com