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: Fri, 23 Aug 2013 17:17:59 +0200 Organization: Chemnitz University of Technology Message-ID: <20130823171759.575f8991@mawo> 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> <83fvu0iipa.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/0IQODPnqWgqrlBFyNfOG1vB" X-Trace: ger.gmane.org 1377271168 6465 80.91.229.3 (23 Aug 2013 15:19:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 23 Aug 2013 15:19:28 +0000 (UTC) Cc: 15155@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Aug 23 17:19:25 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 1VCt8w-0002x1-BB for geb-bug-gnu-emacs@m.gmane.org; Fri, 23 Aug 2013 17:19:18 +0200 Original-Received: from localhost ([::1]:37413 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VCt8v-0008DP-FR for geb-bug-gnu-emacs@m.gmane.org; Fri, 23 Aug 2013 11:19:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45896) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VCt8m-0008D3-Ef for bug-gnu-emacs@gnu.org; Fri, 23 Aug 2013 11:19:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VCt8h-0004I6-A5 for bug-gnu-emacs@gnu.org; Fri, 23 Aug 2013 11:19:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:55998) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VCt8h-0004Hz-5o for bug-gnu-emacs@gnu.org; Fri, 23 Aug 2013 11:19:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VCt8g-0006DQ-RI for bug-gnu-emacs@gnu.org; Fri, 23 Aug 2013 11:19: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: Fri, 23 Aug 2013 15:19: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.137727109423827 (code B ref 15155); Fri, 23 Aug 2013 15:19:02 +0000 Original-Received: (at 15155) by debbugs.gnu.org; 23 Aug 2013 15:18:14 +0000 Original-Received: from localhost ([127.0.0.1]:50310 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VCt7s-0006CE-Rz for submit@debbugs.gnu.org; Fri, 23 Aug 2013 11:18:13 -0400 Original-Received: from nick.hrz.tu-chemnitz.de ([134.109.228.11]:48279) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VCt7p-0006C4-Sp for 15155@debbugs.gnu.org; Fri, 23 Aug 2013 11:18:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tu-chemnitz.de; s=dkim2010; h=Content-Type:Mime-Version:References:In-Reply-To:Message-ID:Subject:Cc:To:From:Date; bh=3iw64M2dUeKwrRiHLbTuylpTWDD+tHsPNG0drjQ+iIs=; b=gyKwtthzI7pJm/+ujmM9RZsOjVt8s5FyLKPj5FDJs0x6PSd3fiO3WMzrr1CEzvAIObbexGv8EUS4Ac6WOXAX9KIcFKztTbKSk8sJRv6KQwJL+utQY3RBfpSP4jJgbkUuZ/zgPn3CzxaM7apGgU+8VKgdQ3DNB++vMWeTfLbCHTw=; Original-Received: from i59f6b570.versanet.de ([89.246.181.112] helo=mawo) by nick.hrz.tu-chemnitz.de with esmtpsa (SSLv3:DHE-RSA-AES128-SHA:128) (Exim 4.80.1) (envelope-from ) id 1VCt7n-0001Qc-Ny; Fri, 23 Aug 2013 17:18:08 +0200 In-Reply-To: <83fvu0iipa.fsf@gnu.org> X-Mailer: Claws Mail 3.9.1 (GTK+ 2.24.17; x86_64-pc-linux-gnu) X-purgate: clean X-purgate-type: clean X-purgate-ID: 154106::1377271087-000004FE-F381E110/0-0/0-0 X-Scan-AV: nick.hrz.tu-chemnitz.de; 2013-08-23 17:18:07; d89ecccc297c97b8ad94a8aeb2a6ce6c X-Scan-SA: nick.hrz.tu-chemnitz.de; 2013-08-23 17:18:08; a912dd7cd7743c81d31658988257d5ac 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:77649 Archived-At: --MP_/0IQODPnqWgqrlBFyNfOG1vB Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline Am Fri, 23 Aug 2013 17:29:37 +0300 schrieb Eli Zaretskii : > > That patch seems to work, thank you. > > Thanks, committed as trunk revision 113979. Cool! > 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. Yes, it seems to work. I used the attached patch for adaptive-wrap.el (although I do not know if this is the correct way to do because I'm not really familiar with font-lock), it just works for me. Thanks again Frank --MP_/0IQODPnqWgqrlBFyNfOG1vB Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=adaptive-wrap.patch --- adaptive-wrap-old.el 2013-08-23 17:02:00.150840918 +0200 +++ adaptive-wrap.el 2013-08-23 17:06:33.411490626 +0200 @@ -83,12 +83,20 @@ (defun adaptive-wrap-prefix-function (beg end) "Indent the region between BEG and END with adaptive filling." (goto-char beg) - (while (< (point) end) - (let ((lbp (line-beginning-position))) - (put-text-property (point) - (progn (search-forward "\n" end 'move) (point)) - 'wrap-prefix - (adaptive-wrap-fill-context-prefix lbp (point)))))) + (and font-lock-fontify-region-function + (funcall font-lock-fontify-region-function beg end)) + (let ((adaptive-fill-function + (or adaptive-fill-function + (and adaptive-fill-regexp + (lambda () + (and (looking-at adaptive-fill-regexp) + (match-string 0))))))) + (while (< (point) end) + (let ((lbp (line-beginning-position))) + (put-text-property (point) + (progn (search-forward "\n" end 'move) (point)) + 'wrap-prefix + (adaptive-wrap-fill-context-prefix lbp (point))))))) ;;;###autoload (define-minor-mode adaptive-wrap-prefix-mode --MP_/0IQODPnqWgqrlBFyNfOG1vB--