unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
Subject: Info bug with @xref{Sample .emacs File, , , ccmode, the CC Mode Manual}.
Date: Sun, 11 Dec 2005 18:37:49 +0000 (GMT)	[thread overview]
Message-ID: <Pine.LNX.3.96.1051211165626.238B-100000@acm.acm> (raw)

Hi, Emacs!

Whilst amending programs.texi (to incorporate changes from CC Mode 5.31),
I hit a problem with Info.  I've inserted the cross reference:

    @xref{Sample .emacs File,,, ccmode, the CC Mode Manual}.

, and makeinfo'd it.  When I load the info file, this xref fails with the
error message "No such node or anchor: Sample".  [BTW: on the same
file.info, Emacs 21.3 says much the same: "No such anchor in tag table or
node in tag table or file: Sample".]

Putting point on this xref typing <CR>, and edebuggering through info.el,
this happens:

(i) <CR> is bound to `Info-follow-nearest-node', and this gets called.
(ii) This calls (Info-try-follow-nearest-node nil).

(iii) Info-t-f-n-n extracts the node name (but WITHOUT "ccmode"), and
does:  (Info-follow-reference "Sample .emacs File" nil).

Up to now, this is well and good.  But my poor little brain can't cope
with what now follows:

(v) Info-follow-reference makes a regexp out of "Sample .emacs File"
prefixed by "*note":  "\\*note[ \t\n]+Sample[ \t\n]+\\.emacs[ \t\n]+File".

(vi) Info-f-r now searches forwards and backwards in the original info
buffer for this regexp, and finds it (again).  It then calls
(Info-extract-menu-node-name t)  [The "t" here is the parameter
@code{multi-line}.]

(vii) Info-extract-menu-node-name now tries to extract the node name
(again).  It builds a exquisite regexp, and uses it to "look-at" the
buffer at point to extract the node name (again) as (match-string 2).

HERE IS THE BUG:  In building the regexp, it inserts a "[^.]" component
here:

    (concat Info-menu-entry-name-re ":\\(:\\|"
            (Info-following-node-name-re
             (cond
              (index-node "^,\t\n")
              (multi-line "^.,\t")     <=================== info.el L2195
;;;
;;;                         ^
;;;                         |
;;;                      OUTCH!!
;;;
              (t          "^.,\t\n")))
            "\\)"
            (if index-node
                "\\.\\(?:[ \t\n]+(line +\\([0-9]+\\))\\)?"
              ""))

Thus the regexp search truncates "Sample .emacs File" after "Sample".

These functions and their parameters aren't commented, so it's difficult
to understand exactly what they're supposed to do.  In particular, I've
no idea why multi-line (whatever that might mean) excludes "." from
permissible node names.  Can somebody help me here, please?

And surely, moving point to the @xref, partially extracting the node name
(i.e. without the (optional) filename "ccmode"), building a regexp from
this, searching for this regexp to find where we were anyway, then
extracting the target node name (again) from where this regexp matches is
silly.

-- 
Alan Mackenzie (Munich, Germany)

             reply	other threads:[~2005-12-11 18:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-11 18:37 Alan Mackenzie [this message]
2005-12-11 19:58 ` Info bug with @xref{Sample .emacs File, , , ccmode, the CC Mode Manual} Eli Zaretskii
2005-12-11 21:28   ` Alan Mackenzie
2005-12-12  0:58     ` Robert J. Chassell
2005-12-12  9:32       ` Alan Mackenzie
2005-12-12 20:59         ` Eli Zaretskii
2005-12-12  5:23     ` Richard M. Stallman
2005-12-12  5:39     ` Eli Zaretskii
2005-12-12 23:44       ` Karl Berry

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.3.96.1051211165626.238B-100000@acm.acm \
    --to=acm@muc.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).