GNU bug report logs -
#23798
25.0.90; Underscore for emphasis in Info?
Previous Next
Reported by: Drew Adams <drew.adams <at> oracle.com>
Date: Sun, 19 Jun 2016 00:14:01 UTC
Severity: wishlist
Tags: fixed, patch
Found in version 25.0.90
Fixed in version 27.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> Date: Sat, 2 Jul 2016 13:59:54 -0700 (PDT)
> From: Drew Adams <drew.adams <at> oracle.com>
> Cc: 23798 <at> debbugs.gnu.org
>
> FWIW -
>
> In my own code I'm using this regexp now (by default - a user option):
>
> "_\\(\\(\\sw\\(\\s-\\|\\sw\\|\\s.\\)*\\)\\|\\(\\(\\s-\\|\\sw\\|\\s.\\)\\sw*\\)\\)_"
>
> It matches word, punctuation, and whitespace chars, plus hyphens,
> with at least one word character. Hyphen is included explicitly
> because it generally has symbol syntax in Info.
>
> This seems to work pretty will. But there are of course some
> places where it does not DTRT.
>
> In my own code I also remove hiding of the enclosing `_' chars
> when emphasis highlighting is turned off:
>
> (while (re-search-forward Info-emphasis-regexp nil t)
> (let ((fn (if Info-fontify-emphasis-flag
> #'add-text-properties
> #'remove-text-properties)))
> (funcall fn (match-beginning 0) (1+ (match-beginning 0))
> '(invisible t front-sticky nil rear-nonsticky t))
> (funcall fn (1- (match-end 0)) (match-end 0)
> '(invisible t front-sticky nil rear-nonsticky t))
> (funcall fn (match-beginning 1) (match-end 1)
> '(font-lock-face info-emphasis))))
I hope one of the Info gurus will chime in at some point.
Thanks.
This bug report was last modified 6 years and 21 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.