From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#14645: Keep highlighting face foreground Date: Wed, 19 Jun 2013 02:31:43 +0300 Organization: JURTA Message-ID: <87mwqn9g6g.fsf@mail.jurta.org> References: <87ehc0mjhy.fsf@mail.jurta.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1371601028 6928 80.91.229.3 (19 Jun 2013 00:17:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 19 Jun 2013 00:17:08 +0000 (UTC) To: 14645@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jun 19 02:17:08 2013 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 1Up65E-0002NN-0g for geb-bug-gnu-emacs@m.gmane.org; Wed, 19 Jun 2013 02:17:08 +0200 Original-Received: from localhost ([::1]:34366 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Up65D-0000yn-JZ for geb-bug-gnu-emacs@m.gmane.org; Tue, 18 Jun 2013 20:17:07 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49287) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Up659-0000yg-TS for bug-gnu-emacs@gnu.org; Tue, 18 Jun 2013 20:17:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Up658-0006CC-T6 for bug-gnu-emacs@gnu.org; Tue, 18 Jun 2013 20:17:03 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:59818) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Up658-0006C4-PJ for bug-gnu-emacs@gnu.org; Tue, 18 Jun 2013 20:17:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Up657-0001bM-PU for bug-gnu-emacs@gnu.org; Tue, 18 Jun 2013 20:17:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 19 Jun 2013 00:17:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14645 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 14645-submit@debbugs.gnu.org id=B14645.13716009696001 (code B ref 14645); Wed, 19 Jun 2013 00:17:01 +0000 Original-Received: (at 14645) by debbugs.gnu.org; 19 Jun 2013 00:16:09 +0000 Original-Received: from localhost ([127.0.0.1]:54132 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Up64G-0001Yg-Oz for submit@debbugs.gnu.org; Tue, 18 Jun 2013 20:16:09 -0400 Original-Received: from ps18281.dreamhost.com ([69.163.218.105]:53270 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Up64C-0001YE-B8 for 14645@debbugs.gnu.org; Tue, 18 Jun 2013 20:16:05 -0400 Original-Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id CBF9D258B9E915 for <14645@debbugs.gnu.org>; Tue, 18 Jun 2013 17:16:02 -0700 (PDT) In-Reply-To: <87ehc0mjhy.fsf@mail.jurta.org> (Juri Linkov's message of "Tue, 18 Jun 2013 01:55:12 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:75319 Archived-At: Another place where `add-face-text-property' could help is for the recently added face `info-index-match'. Currently it looks very ugly when the `info-index-match' face is added in the middle of a link that breaks its continuity. A test case is: `C-h r I match RET'. This is because `Info-index' adds the `info-index-match' face to the strings of the found index entries. Later `Info-virtual-index-find-node' inserts strings to the Info buffer. And finally `Info-fontify-node' puts the `font-lock-face' property with `info-xref' on links. The `face info-index-match' takes precedence over `font-lock-face info-xref'. This patch uses `add-face-text-property' to merge the `info-index-match' face with the `info-xref' face. I think it's not a problem that it will use the text property `face' instead of `font-lock-face' since more strategically advantageous direction of the development for the Info reader would be to move from font-lock-mode to more browser-like design like in eww. However, the problem is that usually a highlighting feature puts a highlighting face on the already fontified string, but this code reverses the order and first it highlights matches and later puts more regular text properties on it (so this reversal requires the non-nil APPEND arg of `add-face-text-property'). Unfortunately, I have no better idea. === modified file 'lisp/info.el' --- lisp/info.el 2013-05-27 22:42:11 +0000 +++ lisp/info.el 2013-06-18 22:57:07 +0000 @@ -4874,9 +4894,8 @@ (defun Info-fontify-node () "mouse-2: go to this node") 'mouse-face 'highlight))) (when (or not-fontified-p fontify-visited-p) - (put-text-property + (add-face-text-property (match-beginning 1) (match-end 1) - 'font-lock-face ;; Display visited menu items in a different face (if (and Info-fontify-visited-nodes (save-match-data @@ -4905,7 +4924,7 @@ (defun Info-fontify-node () (caar hl)))) (setq res (car hl) hl nil) (setq hl (cdr hl)))) - res))) 'info-xref-visited 'info-xref))) + res))) 'info-xref-visited 'info-xref) 'append)) (when (and not-fontified-p (memq Info-hide-note-references '(t hide)) (not (Info-index-node)))