emacs-devel
[Top][All Lists]
Advanced

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

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


From: Alan Mackenzie
Subject: Info bug with @xref{Sample .emacs File, , , ccmode, the CC Mode Manual}.
Date: Sun, 11 Dec 2005 18:37:49 +0000 (GMT)

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 via email to

[Prev in Thread] Current Thread [Next in Thread]