Emacs/psgml problem

Mark Johnson mjohnson at redhat.com
Sun Aug 15 19:11:20 UTC 2004


Karsten Wade wrote:
> On Sun, 2004-08-15 at 10:28, Paul W. Frields wrote:
> 
>>On Sun, 2004-08-15 at 13:23, Karsten Wade wrote:
>>
>>>On Sun, 2004-08-15 at 09:54, Paul W. Frields wrote:
>>>
>>>>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).
>>>
>>>I was first going to ask if you had a stuck Ctrl key on your keyboard.
>>>:)
>>
>>Out of genuine curiosity, would this have caused a problem like what I
>>observed?
> 
> 
> Not sure.  An nXML keybinding is C-/ to close the previous open tag,
> iirc.  That was why my first thought was, stuck keyboard?  But yeah, in
> PSGML, it's different as Dave pointed out.
> 
> 
>>>Another thing you might try (being a self-professed newbie who seems to
>>>be doing quite well anyway) is Mark's PSGMLX package:
>>>http://dulug.duke.edu/~mark/psgmlx .  It will validate against the XML
>>>DTD properly, afaict.  Just don't find any bugs in it, Mark doesn't have
>>>any time to fix them. :)
>>
>>It's on my to-do list! Am I correct that you just indicated (in another
>>thread, sorry) that I can use all the same keybindings as in PSGML? If I
>>don't have to unlearn what I've only recently learned for psgml, I'm
>>more likely to try psgmlx.
> 
> 
> Yeah, it was on my list for too long, and it turned out to be stupidly
> easy to setup. :D
> 
> Right, it's exactly like PSGML keybindings.  I think Mark adds some
> stuff, but nothing is taken away, iirc. 

Yeah, I did add a couple of keyboard macros:.e.g.

- C-x C-p inserts <para></para> and places the cursor in the middle.

- Another one allows you to <para> tag a marked region (start & end
   points matter) by hitting M-p (aka <Alt>-p).

- another one allows you to tag the marked region with <emphasis>
   tags with "C-x e"

None of the above should affect the default psgml keybindings, 
they're simply add-ons.

At any rate, they can be turned off by commenting them out in the 
following files in the psgmlx directory:

[psgmlx-dir]/conf/psgml/macros-sgml.el

[psgmlx-dir]/conf/psgml/macros-docbook.el


FWIW, I got the material, or at least the ideas, from Bob DuCharme's 
"PSGML Tricks" page:

http://www.snee.com/bob/sgmlfree/emcspsgm.html

which has somewhat more advanced material than his *very* useful 
"Emacs/PSGML Quick Reference" page:

  http://www.snee.com/bob/sgmlfree/psgmqref.html

Knowing some simple things like

   C-c C-q (sgml-fill-element)

   M-C-\  (indent-region)

   C-c [ENTER]   (sgml-split element)

   C-c C-o  (move to next trouble spot)

   C-c C-v   (validate)


Can really enhance your productivity.

I highly recommend learning the stuff in the "Moving Your Cursor 
Around: PSGML Keystrokes" section. Really speeds things up.

HTH,
Mark

> Still, like I alluded to, it's
> an extension of PSGML, so it may have different (i.e., buggy) behavior. 
> Definitely worth a try, though.
> 
> Examples of stuff added - when you are in a mode that is editing a
> script (Perl, bash, etc.) and you put your cursor is over any bracket {}
> [] (), the opening and closing brackets are highlighted.  Right-click in
> SGML files pulls up an insert element menu that only lets you insert
> legal tags -- fast way of checking for what is valid, which may be part
> of troubleshooting.
> 
> - Karsten
> 


-- 
----------------------------------------------------------
Mark Johnson                     <mjohnson at redhat.com>
Red Hat Documentation Group      <http://www.redhat.com>
Tel: 919.754.4151                Fax: 919.754.3708
GPG fp: DBEA FA3C C46A 70B5 F120  568B 89D5 4F61 C07D E242





More information about the fedora-docs-list mailing list