Re: Emacs/psgml problem

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

 



On Sun, 2004-08-15 at 12:20, Dave Pawson wrote:
> On Sun, 2004-08-15 at 16:55, Paul W. Frields wrote:
> > I'm hoping someone here has a quick solution. I'm working on a document
> > and my tags are giving me a problem under psgml. At a certain point in
> > my document, when I use a <filename> tag, slashes in the file name
> > content (not inside the tag marker) are being interpreted as ending tags
> > for the content outside "filename." So when I type:
> > 
> >   <filename>/etc/fstab</filename>
> > 
> > the first slash is being seen as </para>, and the second as </sect1>.
> Something is wrong Paul.
> The electric close should operate on </ not just on /
> Unless some clever person has added even more brevity?
> I.e. you shouldn't get tag closure until the </
> 
> This is code to do it
> 
> (defun sgml-slash-check () "For psgml-mode, if you type `/' after `<',
> insert the appropriate end tag, if there is an open element." 
> (interactive) 
> (if (= (char-before) 60) 
> ;; Slash after <, let's end the current open element if we can 
> (progn 
> (sgml-parse-to-here) 
> (cond 
> ((eq sgml-current-tree sgml-top-tree) 
> (insert "/")) 
> ((not (sgml-final-p sgml-current-state)) 
> (insert "/")) 
> (t (progn 
> (delete-backward-char 1) 
> (insert (sgml-end-tag-of sgml-current-tree)))))) 
> (insert "/")))
> 
> 
> (add-hook 'xml-mode-hook 
> (lambda () (define-key xml-mode-map "/" `sgml-slash-check))) 
> 
> 
> Its a tortuous path to chase through emacs site-lisp and all
> included .el files, but somewhere there should be similar code
> to do this. I think its a part of psgml, but the code above
> is for xsl-mode, so may be different.
> 
> psgml-edit.el is the file it's normally found it.
> 
> No idea of the 'standard' rh setup.

I've been using the same setup since I first started doing FDP stuff; I
added the code listed in the Doc Guide to my .emacs file, and haven't
changed it. rpm -V psgml looks fine.

I think after having battled it for a little while that it's related to
doing this:
  <xref linkend="target"/>
instead of:
  <xref linkend="target"></xref>

Exiting Emacs and restarting it seems to "fix" the problem. It only
happens using <filename> after <xref/> tags. I'm confused but I'm not
sure how to Bugzilla the problem since it could be the Big OE (Operator
Error).

-- 
Paul W. Frields, RHCE



[Index of Archives]     [Fedora Users]     [Fedora Desktop]     [Red Hat 9]     [Yosemite News]     [KDE Users]

  Powered by Linux