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

Cannot get emacs nxml code completion to work

Expand Messages
  • ozi_jdavid
    Hi All, I have just installed GNU emacs-22.3 with nxml-mode-20041004 in Windows 2000 but cannot seem to get the code / tag completion to work. It verifies the
    Message 1 of 7 , Oct 24, 2008
      Hi All,

      I have just installed GNU emacs-22.3 with nxml-mode-20041004 in
      Windows 2000 but cannot seem to get the code / tag completion to work.
      It verifies the XML code with no problem and tag pairing is OK. The
      tag compeletion used to work before I reformatted my machine. Have I
      missed something? Thanks.

      David Boudville
    • Niels Giesen
      ... Hi, Does M-x nxml-complete work? If yes, customize `nxml-bind-meta-tab-to-complete-flag to t: M-x customize-variable RET nxml-b TAB RET. Hit toggle
      Message 2 of 7 , Oct 24, 2008
        "ozi_jdavid" <jdavid@...> writes:

        > Hi All,
        >
        > I have just installed GNU emacs-22.3 with nxml-mode-20041004 in
        > Windows 2000 but cannot seem to get the code / tag completion to work.
        > It verifies the XML code with no problem and tag pairing is OK. The
        > tag compeletion used to work before I reformatted my machine. Have I
        > missed something? Thanks.
        >
        Hi,

        Does M-x nxml-complete work?

        If yes, customize `nxml-bind-meta-tab-to-complete-flag' to t:

        M-x customize-variable RET nxml-b TAB RET. Hit toggle button. And one
        of save for current session or safe for future sessions.

        Then typing M-TAB (or probably: M-C-i as `true' M-TAB is most of the
        time intercepted by a window manager for window cycling).

        Cheers,

        Niels.

        PS:

        (setq nxml-bind-meta-tab-to-complete-flag t)

        In your .emacs works too of course, with less clutter.
      • Lennart Borgman
        ... No, it is not guaranteed to work.
        Message 3 of 7 , Oct 24, 2008
          On Fri, Oct 24, 2008 at 10:52 AM, Niels Giesen <niels.giesen@...> wrote:
          > If yes, customize `nxml-bind-meta-tab-to-complete-flag' to t:
          >
          > M-x customize-variable RET nxml-b TAB RET. Hit toggle button. And one
          > of save for current session or safe for future sessions.
          >
          > Then typing M-TAB (or probably: M-C-i as `true' M-TAB is most of the
          > time intercepted by a window manager for window cycling).
          >
          > Cheers,
          >
          > Niels.
          >
          > PS:
          >
          > (setq nxml-bind-meta-tab-to-complete-flag t)
          >
          > In your .emacs works too of course, with less clutter.

          No, it is not guaranteed to work.
        • Niels Giesen
          ... Grmbl, you are right... why not? Of interest to the OP, this lead me into actually reading the documentation for `nxml-bind-meta-tab-to-complete-flag ,
          Message 4 of 7 , Oct 24, 2008
            "Lennart Borgman" <lennart.borgman@...> writes:

            > On Fri, Oct 24, 2008 at 10:52 AM, Niels Giesen <niels.giesen@...> wrote:
            >> If yes, customize `nxml-bind-meta-tab-to-complete-flag' to t:
            >>
            >> M-x customize-variable RET nxml-b TAB RET. Hit toggle button. And one
            >> of save for current session or safe for future sessions.
            >>
            >> Then typing M-TAB (or probably: M-C-i as `true' M-TAB is most of the
            >> time intercepted by a window manager for window cycling).
            >>
            >> Cheers,
            >>
            >> Niels.
            >>
            >> PS:
            >>
            >> (setq nxml-bind-meta-tab-to-complete-flag t)
            >>
            >> In your .emacs works too of course, with less clutter.
            >
            > No, it is not guaranteed to work.
            >

            Grmbl, you are right... why not?

            Of interest to the OP, this lead me into actually reading the
            documentation for `nxml-bind-meta-tab-to-complete-flag', where it says:

            *Non-nil means bind M-TAB in `nxml-mode-map' to `nxml-complete'.
            C-return will be bound to `nxml-complete' in any case.
            M-TAB gets swallowed by many window systems/managers, and
            `documentation' will show M-TAB rather than C-return as the
            binding `rng-complete' when both are bound. So it's better
            to bind M-TAB only when it will work.

            So C-Return should work any time, out of the box. Didn't know that.
          • ozi_jdavid
            ... wrote: ... Unfortunately it doesn t. If I type in :
            Message 5 of 7 , Oct 26, 2008
              --- In emacs-nxml-mode@yahoogroups.com, Niels Giesen
              <niels.giesen@...> wrote:

              ... snip

              >
              > Hi,
              >
              > Does M-x nxml-complete work?
              >

              Unfortunately it doesn't. If I type in :
              <tab'C-Enter'
              I get :
              No completion for 'tab'
              I should get something like :
              <table
              Looks as if it cannot find the tag list. Thanks.

              David
            • Niels Giesen
              ... The completion does not use a simple taglist, it is more intelligent than that: if a table tag would be invalid in the context, nxml-complete will not
              Message 6 of 7 , Oct 27, 2008
                On Mon, Oct 27, 2008 at 1:46 AM, ozi_jdavid <jdavid@...> wrote:
                >> Does M-x nxml-complete work?
                >>
                >
                > Unfortunately it doesn't. If I type in :
                > <tab'C-Enter'
                > I get :
                > No completion for 'tab'
                > I should get something like :
                > <table
                > Looks as if it cannot find the tag list. Thanks.

                The completion does not use a simple taglist, it is more intelligent
                than that: if a table tag would be invalid in the context,
                nxml-complete will not complete it. You did not give us enough context
                to judge whether the tag in question would be valid. Please provide a
                minimal but complete example where it should complete (in accordance
                with the DTD) but it does not.
              • ozi_jdavid
                ... Thanks to everyone for their help. I have mananged to solve the problem. This issue arises from the fact that I am using Docbook v5.0 and the supplied
                Message 7 of 7 , Oct 28, 2008
                  --- In emacs-nxml-mode@yahoogroups.com, "Niels Giesen"
                  <niels.giesen@...> wrote:
                  >
                  > The completion does not use a simple taglist, it is more intelligent
                  > than that: if a table tag would be invalid in the context,
                  > nxml-complete will not complete it. You did not give us enough context
                  > to judge whether the tag in question would be valid. Please provide a
                  > minimal but complete example where it should complete (in accordance
                  > with the DTD) but it does not.
                  >

                  Thanks to everyone for their help. I have mananged to solve the
                  problem. This issue arises from the fact that I am using Docbook v5.0
                  and the supplied nxml-mode refers to Docbook 4.5 DTD. Referring to the
                  'Docbook V5.0 Transition Guide', I edited my
                  'site-lisp/nxml/schemas.xml' file to associate the Docbook V5.0
                  elements with the appropriate schema. It now works whenever my
                  document refers to "http://docbook.org/ns/docbook".

                  I must have done the association when I initially installed both emacs
                  and nxml-mode but not since I re-formatted the hard drive. Thanks once
                  again to all who helped.

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