From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Frank Fischer Newsgroups: gmane.emacs.bugs Subject: bug#15155: 24.3; wrap-prefix in adaptive-wrap-prefix-mode with variable-pitch has wrong face Date: Thu, 22 Aug 2013 09:04:12 +0200 Organization: Chemnitz University of Technology Message-ID: <5215B7EC.10808@mathematik.tu-chemnitz.de> References: <87ob8q4y67.fsf@mathematik.tu-chemnitz.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1377155120 15372 80.91.229.3 (22 Aug 2013 07:05:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 22 Aug 2013 07:05:20 +0000 (UTC) Cc: 15155@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Aug 22 09:05:23 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 1VCOxO-0007ud-Sz for geb-bug-gnu-emacs@m.gmane.org; Thu, 22 Aug 2013 09:05:23 +0200 Original-Received: from localhost ([::1]:58018 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VCOxO-00086Q-G7 for geb-bug-gnu-emacs@m.gmane.org; Thu, 22 Aug 2013 03:05:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52002) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VCOxE-00083j-KT for bug-gnu-emacs@gnu.org; Thu, 22 Aug 2013 03:05:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VCOx5-0005Ok-Mf for bug-gnu-emacs@gnu.org; Thu, 22 Aug 2013 03:05:12 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:52373) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VCOx5-0005NJ-Am for bug-gnu-emacs@gnu.org; Thu, 22 Aug 2013 03:05:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VCOx4-0005IQ-HV for bug-gnu-emacs@gnu.org; Thu, 22 Aug 2013 03:05:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Frank Fischer Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 22 Aug 2013 07:05: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.137715506420307 (code B ref 15155); Thu, 22 Aug 2013 07:05:02 +0000 Original-Received: (at 15155) by debbugs.gnu.org; 22 Aug 2013 07:04:24 +0000 Original-Received: from localhost ([127.0.0.1]:46689 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VCOwR-0005HS-HG for submit@debbugs.gnu.org; Thu, 22 Aug 2013 03:04:24 -0400 Original-Received: from nick.hrz.tu-chemnitz.de ([134.109.228.11]:40787) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VCOwN-0005HD-OV for 15155@debbugs.gnu.org; Thu, 22 Aug 2013 03:04:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tu-chemnitz.de; s=dkim2010; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:References:Subject:CC:To:MIME-Version:From:Date:Message-ID; bh=r0j4GQINBr8ELT0OjjOZ85Vk+JWJoOO4qN85/YpHC5M=; b=SUYIa5zodkW9t0KM4t3zHEQrBBen32YCyD5JHsoL5VTIy9Uy2dclfP+PU+x+R3mI6Ybn7hbnnKrPDL+NxDtoSicuD41rIKqa5kPujhNb8xcjaAoOH1XbmcjPH0mNOa3AQOCaf/uwCxZqjsVNFb3KzIiG7gsuohHA9dlVLvneiuw=; Original-Received: from mordred.mathematik.tu-chemnitz.de ([134.109.40.151]) by nick.hrz.tu-chemnitz.de with esmtpsa (TLSv1:DHE-RSA-CAMELLIA256-SHA:256) (Exim 4.80.1) (envelope-from ) id 1VCOwG-0003XF-Cr; Thu, 22 Aug 2013 09:04:18 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 In-Reply-To: X-Enigmail-Version: 1.5.2 X-purgate: clean X-purgate-type: clean X-purgate-ID: 154106::1377155052-000004FE-EA407CE5/0-0/0-0 X-Scan-AV: nick.hrz.tu-chemnitz.de; 2013-08-22 09:04:12; 1e2e8b49525236b2b34880c12b1ac96d X-Scan-SA: nick.hrz.tu-chemnitz.de; 2013-08-22 09:04:18; 287185797384c7f2dc00f180326352a4 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:77597 Archived-At: Am 08/22/2013 03:33 AM, schrieb Stefan Monnier: > I have the vague impression of having already seen such a bug-report, > except the other way around (where the user complained that the > wrap-prefix was displayed in the font that happened to be active where > the line got truncated), so we "fixed" it for Emacs-24. Ah, I see (just add some additional !!! before the first line in *scratch* and see that the exclamation marks in the wrapped lines have comment face (but they should be black) in Emacs 23). Taking your hint, I have tried the following `adaptive-fill-function` (setq adaptive-fill-function (lambda () (and adaptive-fill-prefix (looking-at adaptive-fill-prefix) (match-string 0)))) This is exactly what `fill-adaptive-match-prefix' does except the latter uses `match-string-no-properties`. This seems to work fine for the color of the prefix but not for its font (when using variable-pitch-mode). So a second try was (setq adaptive-fill-function (lambda () (and adaptive-fill-prefix (looking-at adaptive-fill-prefix) (propertize (match-string-no-properties 0) 'face 'default)))) Now the wrap-prefix has the correct font but the wrong color (but this variant seems to work reasonably well for LaTeX and variable-pitch). I think, the wrap-prefix should at least have the default face (which may be modified by variable-pitch-mode) in any case. I'm not sure about the other properties like color, but may adaptive-wrap-mode should (optionally?) use something like the adaptive-fill-function above to assign the wrap-prefix the same face as the original prefix (in contrast to the one that happened to be active where the line got truncated). Though, I have no idea what to about the color vs. font problem (how to get both?). Many thanks for your comments, they already helped me a lot :) Frank