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#15155: 24.3; wrap-prefix in adaptive-wrap-prefix-mode with variable-pitch has wrong face Date: Fri, 23 Aug 2013 17:29:37 +0300 Message-ID: <83fvu0iipa.fsf@gnu.org> References: <87ob8q4y67.fsf@mathematik.tu-chemnitz.de> <5215B7EC.10808@mathematik.tu-chemnitz.de> <838uztkc80.fsf@gnu.org> <52162DBA.2040905@mathematik.tu-chemnitz.de> <831u5lk909.fsf@gnu.org> <52163919.7080505@mathematik.tu-chemnitz.de> <83zjs9is0q.fsf@gnu.org> <20130822223246.07dbc5a6@mawo> <83txigj4ea.fsf@gnu.org> <20130823151758.4b4c3f8a@mawo> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1377268219 3360 80.91.229.3 (23 Aug 2013 14:30:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 23 Aug 2013 14:30:19 +0000 (UTC) Cc: 15155@debbugs.gnu.org To: Frank Fischer Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Aug 23 16:30:21 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 1VCsNW-0001Zb-QB for geb-bug-gnu-emacs@m.gmane.org; Fri, 23 Aug 2013 16:30:19 +0200 Original-Received: from localhost ([::1]:37264 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VCsNW-0002Je-Cx for geb-bug-gnu-emacs@m.gmane.org; Fri, 23 Aug 2013 10:30:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33512) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VCsNO-0002J9-Pi for bug-gnu-emacs@gnu.org; Fri, 23 Aug 2013 10:30:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VCsNJ-0000if-SB for bug-gnu-emacs@gnu.org; Fri, 23 Aug 2013 10:30:10 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:55935) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VCsNJ-0000iT-Pl for bug-gnu-emacs@gnu.org; Fri, 23 Aug 2013 10:30:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VCsNH-0004ya-1P for bug-gnu-emacs@gnu.org; Fri, 23 Aug 2013 10:30:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 23 Aug 2013 14:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15155 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 15155-submit@debbugs.gnu.org id=B15155.137726818019068 (code B ref 15155); Fri, 23 Aug 2013 14:30:02 +0000 Original-Received: (at 15155) by debbugs.gnu.org; 23 Aug 2013 14:29:40 +0000 Original-Received: from localhost ([127.0.0.1]:50251 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VCsMt-0004xR-7e for submit@debbugs.gnu.org; Fri, 23 Aug 2013 10:29:39 -0400 Original-Received: from mtaout21.012.net.il ([80.179.55.169]:35153) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VCsMo-0004xF-Uz for 15155@debbugs.gnu.org; Fri, 23 Aug 2013 10:29:36 -0400 Original-Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0MRZ00E00MO6AK00@a-mtaout21.012.net.il> for 15155@debbugs.gnu.org; Fri, 23 Aug 2013 17:29:33 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MRZ00EZDMX85280@a-mtaout21.012.net.il>; Fri, 23 Aug 2013 17:29:33 +0300 (IDT) In-reply-to: <20130823151758.4b4c3f8a@mawo> X-012-Sender: halo1@inter.net.il 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:77648 Archived-At: > Date: Fri, 23 Aug 2013 15:17:58 +0200 > From: Frank Fischer > Cc: monnier@iro.umontreal.ca, 15155@debbugs.gnu.org > > Am Fri, 23 Aug 2013 09:41:01 +0300 > schrieb Eli Zaretskii : > > > > Date: Thu, 22 Aug 2013 22:32:46 +0200 > > > From: Frank Fischer > > > Cc: monnier@iro.umontreal.ca, 15155@debbugs.gnu.org > > > > > > Am Thu, 22 Aug 2013 19:56:05 +0300 > > > schrieb Eli Zaretskii : > > > > > > > Can you build Emacs from the trunk? I would like to ask you to > > > > try a patch that might fix this in your use case. > > > > > > Sure, I'd be happy to help ;) > > > > Thank you. Please try the patch below. It should solve the problem > > with the font; you will still need to make sure on the Lisp level that > > the prefix has the right face, to get the color you want. > > That patch seems to work, thank you. Thanks, committed as trunk revision 113979. > I have only one (very) minor issue left: depending on the mode the > wrap-prefix may contain characters with different faces (e.g. in > emacs-lisp mode !!!;;; would be a correct prefix, the first three > characters with default face, the latter three with comment-face), hence > there is not really "the one" correct face to assign 'wrap-prefix with > `propertize`. That why I tried the variant > > (setq adaptive-fill-function > (lambda () > (and adaptive-fill-regexp > (looking-at adaptive-fill-regexp) > (match-string 0)))) > > hoping that (match-string 0) returns the whole prefix with the correct > fontification. However, there are situations where this does not work: > for example if one has a (very long) wrapped line without comment and > then inserts a semicolon (only one) at the beginning of that line to > comment it out, then the wrap-prefix does not get comment face (to be > precise, it has the correct font, thus your patch works, but not the > correct color). But if one inserts a second semicolon then the > wrap-prefix gets the correct color. I assume this happens because the > wrap-prefix is set before font-lock changed the face of inserted > semicolon. I think your analysis is correct. Perhaps invoking font-lock to fontify the appropriate portion of the text, before taking the prefix string, will solve that? > Perhaps this is a more an issue of adaptive-wrap-mode, I > don't know. I think it is indeed an issue with adaptive-wrap-mode.