Loading ...
Sorry, an error occurred while loading the content.

Inserting customized markup

Expand Messages
  • Jesse Sheidlower
    Second question: I d like to be able to insert my own markup groups into a document with nXML. PSGML has this with the sgml-custom-markup variable. What s the
    Message 1 of 5 , Aug 30, 2004
    • 0 Attachment
      Second question: I'd like to be able to insert my own markup groups
      into a document with nXML. PSGML has this with the sgml-custom-markup
      variable. What's the right way of doing this with nXML? I'm talking
      about something like inserting

      <Bibliography>
      <date>2004</date>
      <author></author>
      <title></title>
      </Bibliography>

      into a document, with the point placed between the author tags.

      In the long run it would be nice to associate such markups with a
      menu-bar menu, or a mouse click, but for now I'd be happy to just
      have it as a key binding. Is there a recommended sequence for such
      bindings, or ones that people just tend to use?

      Thanks again.

      Jesse Sheidlower
    • James Clark
      ... Is there anything XML-specific about this? Could you just use define-skeleton? ... The main problem I see is the same problem as with colorization: how to
      Message 2 of 5 , Aug 30, 2004
      • 0 Attachment
        On Mon, 2004-08-30 at 21:07, Jesse Sheidlower wrote:
        > Second question: I'd like to be able to insert my own markup groups
        > into a document with nXML. PSGML has this with the sgml-custom-markup
        > variable. What's the right way of doing this with nXML? I'm talking
        > about something like inserting
        >
        > <Bibliography>
        > <date>2004</date>
        > <author></author>
        > <title></title>
        > </Bibliography>
        >
        > into a document, with the point placed between the author tags.

        Is there anything XML-specific about this? Could you just use
        define-skeleton?

        > In the long run it would be nice to associate such markups with a
        > menu-bar menu, or a mouse click, but for now I'd be happy to just
        > have it as a key binding.

        The main problem I see is the same problem as with colorization: how to
        allow the specification of these key-bindings to be document-type
        dependent.

        James
        --
        To send me mail, replace auth-only by public in the from address.
      • Bruce D'Arcus
        ... There s a template.el package that s quite nice, and Mike Smith came up with menu code for it. I use both in conjunction with nxml. Bruce
        Message 3 of 5 , Aug 31, 2004
        • 0 Attachment
          On Aug 31, 2004, at 12:38 AM, James Clark wrote:

          > On Mon, 2004-08-30 at 21:07, Jesse Sheidlower wrote:
          >> Second question: I'd like to be able to insert my own markup groups
          >> into a document with nXML. PSGML has this with the sgml-custom-markup
          >> variable. What's the right way of doing this with nXML? I'm talking
          >> about something like inserting
          >>
          >> <Bibliography>
          >> <date>2004</date>
          >> <author></author>
          >> <title></title>
          >> </Bibliography>
          >>
          >> into a document, with the point placed between the author tags.
          >
          > Is there anything XML-specific about this? Could you just use
          > define-skeleton?

          There's a template.el package that's quite nice, and Mike Smith came up
          with menu code for it. I use both in conjunction with nxml.

          Bruce
        • Jesse Sheidlower
          ... I could, and I ll also take a look at the Template package that Bruce pointed me to. But the XML-specific thing would of course be that you d only be
          Message 4 of 5 , Aug 31, 2004
          • 0 Attachment
            On Tue, Aug 31, 2004 at 11:38:00AM +0700, James Clark wrote:
            > On Mon, 2004-08-30 at 21:07, Jesse Sheidlower wrote:
            > > Second question: I'd like to be able to insert my own markup groups
            > > into a document with nXML. PSGML has this with the sgml-custom-markup
            > > variable. What's the right way of doing this with nXML? I'm talking
            > > about something like inserting
            > >
            > > <Bibliography>
            > > <date>2004</date>
            > > <author></author>
            > > <title></title>
            > > </Bibliography>
            > >
            > > into a document, with the point placed between the author tags.
            >
            > Is there anything XML-specific about this? Could you just use
            > define-skeleton?

            I could, and I'll also take a look at the Template package
            that Bruce pointed me to. But the XML-specific thing would of
            course be that you'd only be allowed to insert a skeleton in a
            legal place according to the schema, so if you could insert a
            skeleton by mouse-3'ing to a menu, or by using completion on
            the skelton's name, you'd only see the valid skeletons, etc.

            > > In the long run it would be nice to associate such markups with a
            > > menu-bar menu, or a mouse click, but for now I'd be happy to just
            > > have it as a key binding.
            >
            > The main problem I see is the same problem as with colorization: how to
            > allow the specification of these key-bindings to be document-type
            > dependent.

            I do not know. In the past, I've kludged it by defining a derived
            mode with the document-type-specific things in it, so I can call
            it with "nxml-docbook-mode" or "nxml-tei-mode" or whatever.

            Thanks for your comments on colorization; I'll play around with
            it. It's more important to be able to get the tags in a specific
            face, rather than the contents of some tags in a specific face,
            which you thought would be a problem.

            Best,

            Jesse Sheidlower
          • Bruce D'Arcus
            ... Yeah, I could see this. I should say I typically use the template package for creating new documents, rather than inserting content in existing document.
            Message 5 of 5 , Aug 31, 2004
            • 0 Attachment
              On Aug 31, 2004, at 9:44 AM, Jesse Sheidlower wrote:

              > I could, and I'll also take a look at the Template package
              > that Bruce pointed me to. But the XML-specific thing would of
              > course be that you'd only be allowed to insert a skeleton in a
              > legal place according to the schema

              Yeah, I could see this.

              I should say I typically use the template package for creating new
              documents, rather than inserting content in existing document. So, say
              I start a new article in DocBook. I have a menu item I select, the
              skeleton is created, and I am prompted to enter the title and such.

              I do the same for bib records. Select, say, "book", and I get prompted
              for the necessary metadata. It's quite useful, actually. Of course, I
              have to be careful to ensure the templates are valid!

              Bruce
            Your message has been successfully submitted and would be delivered to recipients shortly.