From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#23798: 25.0.90; Underscore for emphasis in Info? Date: Sun, 03 Jul 2016 06:34:22 +0300 Message-ID: <831t3bs8ch.fsf@gnu.org> References: <<<>>> <<<<8337o9aogg.fsf@gnu.org>>>> <<<3129ea6b-50bf-48e6-b3d0-b180828dfc5c@default>>> <<<83wpll8bbi.fsf@gnu.org>>> <<7648aec5-f939-4da3-8d4c-9ea03799c0db@default>> <<83mvmh87dl.fsf@gnu.org>> <1def2f0a-ed4f-4d6b-a735-ed4272189f68@default> <89ca9fa3-c68b-4c9c-a826-406907c7248e@default> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1467516924 20955 80.91.229.3 (3 Jul 2016 03:35:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 3 Jul 2016 03:35:24 +0000 (UTC) Cc: 23798@debbugs.gnu.org To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jul 03 05:35:13 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bJYBc-0003va-C0 for geb-bug-gnu-emacs@m.gmane.org; Sun, 03 Jul 2016 05:35:12 +0200 Original-Received: from localhost ([::1]:41063 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bJYBb-0002mE-Cv for geb-bug-gnu-emacs@m.gmane.org; Sat, 02 Jul 2016 23:35:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58567) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bJYBW-0002kd-A5 for bug-gnu-emacs@gnu.org; Sat, 02 Jul 2016 23:35:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bJYBS-000838-5h for bug-gnu-emacs@gnu.org; Sat, 02 Jul 2016 23:35:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:50935) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bJYBS-000834-2h for bug-gnu-emacs@gnu.org; Sat, 02 Jul 2016 23:35:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bJYBR-00070J-VW for bug-gnu-emacs@gnu.org; Sat, 02 Jul 2016 23:35:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 03 Jul 2016 03:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23798 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 23798-submit@debbugs.gnu.org id=B23798.146751688326896 (code B ref 23798); Sun, 03 Jul 2016 03:35:01 +0000 Original-Received: (at 23798) by debbugs.gnu.org; 3 Jul 2016 03:34:43 +0000 Original-Received: from localhost ([127.0.0.1]:35039 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bJYB9-0006zk-Ia for submit@debbugs.gnu.org; Sat, 02 Jul 2016 23:34:43 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:39312) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bJYB8-0006zV-1r for 23798@debbugs.gnu.org; Sat, 02 Jul 2016 23:34:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bJYB2-00081a-14 for 23798@debbugs.gnu.org; Sat, 02 Jul 2016 23:34:37 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:58837) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bJYB1-00081S-U1; Sat, 02 Jul 2016 23:34:35 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3932 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bJYB0-0007ss-54; Sat, 02 Jul 2016 23:34:34 -0400 In-reply-to: <89ca9fa3-c68b-4c9c-a826-406907c7248e@default> (message from Drew Adams on Sat, 2 Jul 2016 13:59:54 -0700 (PDT)) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:120316 Archived-At: > Date: Sat, 2 Jul 2016 13:59:54 -0700 (PDT) > From: Drew Adams > Cc: 23798@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.