unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* info.el dots in node names
@ 2003-06-04 23:42 Kevin Ryde
  2003-06-05 21:46 ` Richard Stallman
  0 siblings, 1 reply; 8+ messages in thread
From: Kevin Ryde @ 2003-06-04 23:42 UTC (permalink / raw)
  Cc: Karl Berry

[-- Attachment #1: Type: text/plain, Size: 724 bytes --]

[This started on the autoconf-patches list about dots in node names in
the autoconf manual, eg. "config.status".]

        * info.el (Info-following-node-name): Accept "." followed by allowed
        non-whitespace non-")" chars, so filenames like foo.h can be in node
        names.

The standalone info reader uses a similar rule (skip_node_characters
in info/search.c), though currently it includes the "." in "node.,",
which I'm not sure it should, in case someone puts a comma after an
@pxref (foo.texi below).

foo.texi below is a little sample I was testing with.  Notice with
this change that the cross references in the "something.txt" node
work, as does the index entry.  The top-level menu entry already
worked.


[-- Attachment #2: info.el.node-name-dots.diff --]
[-- Type: text/plain, Size: 2090 bytes --]

*** info.el.~1.350.~	Thu Jun  5 02:58:08 2003
--- info.el	Thu Jun  5 08:33:52 2003
*************** (defun Info-extract-pointer (name &optio
*** 1403,1415 ****
  (defun Info-following-node-name (&optional allowedchars)
    "Return the node name in the buffer following point.
  ALLOWEDCHARS, if non-nil, goes within [...] to make a regexp
! saying which chars may appear in the node name."
    (skip-chars-forward " \t")
    (buffer-substring-no-properties
     (point)
     (progn
       (while (looking-at (concat "[" (or allowedchars "^,\t\n") "]"))
         (skip-chars-forward (concat (or allowedchars "^,\t\n") "("))
         (if (looking-at "(")
  	   (skip-chars-forward "^)")))
       (skip-chars-backward " ")
--- 1403,1433 ----
  (defun Info-following-node-name (&optional allowedchars)
    "Return the node name in the buffer following point.
  ALLOWEDCHARS, if non-nil, goes within [...] to make a regexp
! saying which chars may appear in the node name.
! 
! If \".\" is not among the allowed chars, it will still be accepted if it (or
! a sequence of dots) is followed by a non-whitespace, non-\")\", allowed
! char.  A cross reference normally ends at a \".\", but this rule lets
! filenames like foo.h appear in the node name.  Note that it still correctly
! stops at the \".\" for things like the following which can arise from
! @pxref.
! 
!     *note something: node name., etc
!     (go to *note something: node name.) etc
! "
! 
!   ;; For reference, the standalone info reader applies a similar rule for
!   ;; ".", see texinfo info/search.c skip_node_characters().
!   
    (skip-chars-forward " \t")
    (buffer-substring-no-properties
     (point)
     (progn
       (while (looking-at (concat "[" (or allowedchars "^,\t\n") "]"))
         (skip-chars-forward (concat (or allowedchars "^,\t\n") "("))
+        (if (and (looking-at "\\.+[^) \t\n]")
+                 (looking-at (concat "\\.+[" (or allowedchars "^,\t\n") "]")))
+            (goto-char (match-end 0)))
         (if (looking-at "(")
  	   (skip-chars-forward "^)")))
       (skip-chars-backward " ")

[-- Attachment #3: foo.texi --]
[-- Type: application/x-texinfo, Size: 458 bytes --]

[-- Attachment #4: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel

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

end of thread, other threads:[~2003-06-08  1:07 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-06-04 23:42 info.el dots in node names Kevin Ryde
2003-06-05 21:46 ` Richard Stallman
2003-06-06 12:22   ` Andreas Schwab
2003-06-08  1:07     ` Richard Stallman
2003-06-06 22:16   ` Kevin Ryde
2003-06-06 23:41     ` Kevin Ryde
2003-06-06 23:58       ` Kevin Ryde
     [not found]         ` <200306070029.h570TdJL008307@rum.cs.yale.edu>
2003-06-07  0:50           ` Kevin Ryde

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