unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Info bug with @xref{Sample .emacs File, , , ccmode, the CC Mode Manual}.
@ 2005-12-11 18:37 Alan Mackenzie
  2005-12-11 19:58 ` Eli Zaretskii
  0 siblings, 1 reply; 9+ messages in thread
From: Alan Mackenzie @ 2005-12-11 18:37 UTC (permalink / 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)

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2005-12-12 23:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-11 18:37 Info bug with @xref{Sample .emacs File, , , ccmode, the CC Mode Manual} Alan Mackenzie
2005-12-11 19:58 ` 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

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).