From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#23798: 25.0.90; Underscore for emphasis in Info? Date: Sat, 2 Jul 2016 13:59:54 -0700 (PDT) Message-ID: <89ca9fa3-c68b-4c9c-a826-406907c7248e@default> 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> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1467493298 26392 80.91.229.3 (2 Jul 2016 21:01:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 2 Jul 2016 21:01:38 +0000 (UTC) Cc: 23798@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jul 02 23:01:18 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 1bJS2P-0007d5-Ay for geb-bug-gnu-emacs@m.gmane.org; Sat, 02 Jul 2016 23:01:17 +0200 Original-Received: from localhost ([::1]:40084 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bJS2L-0007mm-7l for geb-bug-gnu-emacs@m.gmane.org; Sat, 02 Jul 2016 17:01:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45665) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bJS2D-0007ZM-UR for bug-gnu-emacs@gnu.org; Sat, 02 Jul 2016 17:01:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bJS2A-0002CN-PL for bug-gnu-emacs@gnu.org; Sat, 02 Jul 2016 17:01:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:50787) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bJS2A-0002CJ-M6 for bug-gnu-emacs@gnu.org; Sat, 02 Jul 2016 17:01:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bJS2A-0001gD-9S for bug-gnu-emacs@gnu.org; Sat, 02 Jul 2016 17:01:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 02 Jul 2016 21:01:02 +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.14674932136360 (code B ref 23798); Sat, 02 Jul 2016 21:01:02 +0000 Original-Received: (at 23798) by debbugs.gnu.org; 2 Jul 2016 21:00:13 +0000 Original-Received: from localhost ([127.0.0.1]:34891 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bJS1N-0001eV-Ms for submit@debbugs.gnu.org; Sat, 02 Jul 2016 17:00:13 -0400 Original-Received: from userp1040.oracle.com ([156.151.31.81]:34023) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bJS1M-0001eH-5j for 23798@debbugs.gnu.org; Sat, 02 Jul 2016 17:00:12 -0400 Original-Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u62L04W0030421 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 2 Jul 2016 21:00:05 GMT Original-Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0022.oracle.com (8.14.4/8.13.8) with ESMTP id u62L021u029665 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 2 Jul 2016 21:00:03 GMT Original-Received: from abhmp0004.oracle.com (abhmp0004.oracle.com [141.146.116.10]) by userv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u62L00Tg023170; Sat, 2 Jul 2016 21:00:01 GMT In-Reply-To: <1def2f0a-ed4f-4d6b-a735-ed4272189f68@default> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9 (901082) [OL 12.0.6744.5000 (x86)] X-Source-IP: userv0022.oracle.com [156.151.31.74] 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:120308 Archived-At: 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))))