all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Support double colons in Info index entries
@ 2019-01-09 21:14 Gavin Smith
  2019-01-11  0:04 ` bug#34023: " Juri Linkov
  2019-01-11  0:53 ` Glenn Morris
  0 siblings, 2 replies; 11+ messages in thread
From: Gavin Smith @ 2019-01-09 21:14 UTC (permalink / raw)
  To: bug-gnu-emacs; +Cc: bug-texinfo

Emacs version checked: 26.1.

In the Info format colons are special, and for this reason, there is 
limited support for colons in index entries.  The Emacs Info mode 
supports single colons in index entries as long as they are not followed 
by a space.

There is this comment at the start of info.el:

;; Note that nowadays we expect Info files to be made using makeinfo.
;; In particular we make these assumptions:
;;  - a menu item MAY contain colons but not colon-space ": "
;;  - a menu item ending with ": " (but not ":: ") is an index entry
;;  - a node name MAY NOT contain a colon
;; This distinction is to support indexing of computer programming
;; language terms that may contain ":" but not ": ".

It doesn't state it, but when I tested it double colons don't work even 
if they are not followed by a space.

There is a fairly simple solution to this problem that I haven't seen 
suggested in all the messages posted on this topic in the mailing list 
archives. In index nodes only (which have a special marker included, 
^@^H[index^@^H]), use a colon to terminate the text of the index entry, 
but instead of looking for the first colon in the line, look for the 
last.  So this entry:

* a::b:  a colon b.  (line 129)

would refer to line 129 of the node "a colon b".  This is possible 
because node names cannot contain colons.  This restriction is not too 
important, whereas the inability to index items containing colons is 
quite important.  This is what is implemented in the standalone info 
browser (since change on 2017-04-08).

This change shouldn't be made for all nodes, because the comment after 
the closing '.' could contain a colon:

* label: node.  comment: with a colon.

This shouldn't be interpreted as refering to a node "with a colon".

However, the "(line ...)" comment can't contain a colon.

I'm not familiar with Emacs Lisp enough to propose a patch to implement 
this change myself.

The standalone info program also implemented a quoting mechanism 
(surrounding the text with a pair of 0x7F bytes) to allow nearly all 
characters to be included in node names and index entries.  This has 
never been implemented in Emacs Info and has never been used by default 
in texi2any's output.  I think my suggestion above would be sufficient 
and would work with existing Info files and versions of 
texi2any/makeinfo without anything breaking.  The quoting mechanism could 
potentially be removed from texi2any and info as nobody has ever used it 
and it makes things more complicated for no reason.



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

end of thread, other threads:[~2019-01-16 19:17 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-09 21:14 Support double colons in Info index entries Gavin Smith
2019-01-11  0:04 ` bug#34023: " Juri Linkov
2019-01-11  0:28   ` Drew Adams
2019-01-11 19:46   ` Gavin Smith
     [not found]   ` <20190111194631.GA14925@darkstar>
2019-01-11 19:49     ` Gavin Smith
2019-01-13  0:55     ` Juri Linkov
2019-01-11  0:53 ` Glenn Morris
2019-01-11 20:13   ` Gavin Smith
2019-01-11 20:14     ` Gavin Smith
2019-01-11 20:32     ` Glenn Morris
     [not found]     ` <hek1jbkk9o.fsf@fencepost.gnu.org>
2019-01-16 19:17       ` Gavin Smith

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.