From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 0DFQMFQ3kGBSgwAAgWs5BA (envelope-from ) for ; Mon, 03 May 2021 19:48:04 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id YOTzK1Q3kGArRwAAB5/wlQ (envelope-from ) for ; Mon, 03 May 2021 17:48:04 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 1C27E20666 for ; Mon, 3 May 2021 19:48:04 +0200 (CEST) Received: from localhost ([::1]:41198 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ldcfq-0002er-Hm for larch@yhetil.org; Mon, 03 May 2021 13:48:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49620) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldcBf-00055M-2w for emacs-orgmode@gnu.org; Mon, 03 May 2021 13:16:53 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:58242) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ldcBd-0005i1-0M; Mon, 03 May 2021 13:16:49 -0400 Received: from [2a01:e34:ec2b:7150:ed76:623:99f1:997] (port=55558 helo=guerry) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.82) (envelope-from ) id 1ldcBc-00053c-4D; Mon, 03 May 2021 13:16:48 -0400 Received: by guerry (Postfix, from userid 1000) id 60B0A1A60E28; Mon, 3 May 2021 19:16:44 +0200 (CEST) From: Bastien To: Ihor Radchenko Subject: Re: prettify-symbols-mode in org agenda? In-Reply-To: <87h7jl1eds.fsf@localhost> (Ihor Radchenko's message of "Sun, 02 May 2021 20:58:23 +0800") Organization: GNU References: <87o8kf81yq.fsf@localhost> <87im474fgy.fsf@gnu.org> <87v98263bg.fsf@localhost> <87mtteo6zq.fsf@localhost> <87h7jl1eds.fsf@localhost> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Date: Mon, 03 May 2021 19:16:44 +0200 Message-ID: <87k0ofn3er.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: William Xu , emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1620064084; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=CG3hqVjEEWX5/YNCp59DWL+3EB9aNexaByvAtVb71iY=; b=CJ1SY/O5O5IETxd8Fi4qYZEl7qiuFlWZbeZO8jvCY4Q38LD5OZWrJAGq2+7o8bZoz2LzVn C2k42m7Kcbm/KNfrSxkqtqnWWQPRTXTXu4Im0jpj3poGgT9y3QSuT1ExjBQEOf8OBeeecW TgUWPrDUBWHclC7REboz8ZQ00nHiEoY5myyZxm9cuHlLwyTmWYrKk/InGlBntvNSgvLGiR C7Uc1FBDtK7QXce/IRiupLxGPqjgLVvCKeccsbFN6KUG0rfNEly2cQ/3l0CE3eLgAHlu53 pYtzGDXXdnhnSXni/mUMcTQi+lDNq6IH09qrIEO0seMA/yCcntcroVQr5RNJag== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1620064084; a=rsa-sha256; cv=none; b=e3vQA3XRZarfY4JrryHIeWW+jd9EY4G5S0hHOmhSQ/+Abd5F+6hOwKuPyaHm4oc+8PDvrv GZY5Pdyfcw0HXPFaDWkBuvM7X7NZSi+fqQC2MkAhuIDALR3m0Yx9p4gkwIJkwJEnZU0WYZ +7906bCa+MCfKDJfwIs7cNtVYn9olBa1Kz2UUIo+lQs9MR+dxT33+tGegYTYkHXmJ+QMjq w+Dv8lMTCsyscdHJO+4lnnp61Tj3t3b9+JgmyeRNRQa5iTCDgSSN9iE7eKx5v+/aQ5fvDD 2JUJFXzjUfQ8MoyGAQcQx0X4ojpjmvMq7rziSTnWq94xxWf4ZDDzeKysIP2QvA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -1.96 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 1C27E20666 X-Spam-Score: -1.96 X-Migadu-Scanner: scn0.migadu.com X-TUID: OQsqVahwWY1b Hi Ihor, Ihor Radchenko writes: > William Xu writes: > >> Now I try to test it extensively. Even with all your changes, I find >> when I use org-agenda-todo to change the todo-state inside the agenda >> buffer, the new state isn't always prettified. >> >> Do you see the same behaviour? > > Oops. Yes, I do see the same behaviour. I only did light testing on > master and I had some unrelated changes nullifying the problem you > observe on my testing branch. Thank you very much for the patch. Could it slow down agenda generation for some configurations? > See the updated patch. > > From 06a2d8ab328721835866bf97f0344cce15cd1dee Mon Sep 17 00:00:00 2001 > Message-Id: <06a2d8ab328721835866bf97f0344cce15cd1dee.1619960107.git.yantar92@gmail.com> > From: Ihor Radchenko > Date: Sat, 1 May 2021 20:09:10 +0800 > Subject: [PATCH] Make sure that fontification is preserved in agenda > > Preserve fontification and composition of headlines and tags in > agenda. If the headlines/tags are not yet fontified when building > agenda, make sure that they are fontified in the original Org mode > buffers first. > > In addition, tags alignment is now done pixelwise to avoid alignment > issues with variable-pitch symbols that may appear in fontified Org > mode buffers. The alignment is utilising :align-to specification, > which means that the alignment will be automatically updated as the > agenda buffer is resized. Please move the comments after the change log themselves. > * lisp/org-macs.el (org-string-width): Refactor old code and add > optional argument to return pixel width. The old code used manual > parsing of text proerpties to find which parts of string are visible. > The new code defers this work to Emacs display engine via > `window-text-pixel-size'. The visibility settings of current buffer > are taken into account. > > (org-buffer-substring-fontified): New function getting fontified > substring from current buffer. > > * lisp/org-agenda.el (org-agenda-get-todos, org-agenda-get-progress, > org-agenda-get-deadlines, org-agenda-get-scheduled): Use > org-buffer-substring-fontified to get fontified heading. > > (org-agenda-fix-displayed-tags): Fontify tags. > > (org-agenda-highlight-todo): Preserve composition property used, > i.e. by `prettify-symbols-mode'. The composition is usually set to be > removed on text change, so we do the changes inside > `with-silent-modifications'. > > (org-agenda-align-tags): Use pixel width and (space . :align-to) > 'display property to align tags in agenda. > > * lisp/org.el (org-get-heading): Make sure that heading is fontified. > --- > lisp/org-agenda.el | 63 ++++++++++++++++---------- > lisp/org-macs.el | 108 ++++++++++++++++++--------------------------- > lisp/org.el | 2 + > 3 files changed, 85 insertions(+), 88 deletions(-) > > diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el > index bd9d466a6..5add0e092 100644 > --- a/lisp/org-agenda.el > +++ b/lisp/org-agenda.el > @@ -5562,7 +5562,7 @@ (defun org-agenda-get-todos () > ts-date-pair (org-agenda-entry-get-agenda-timestamp (point)) > ts-date (car ts-date-pair) > ts-date-type (cdr ts-date-pair) > - txt (org-trim (buffer-substring (match-beginning 2) (match-end 0))) > + txt (org-trim (org-buffer-substring-fontified (match-beginning 2) (match-end 0))) Here and for the rest of the patch: please try to keep lines below 80 characters. I'm aware this is not always feasible, especially given long functions with many nested s-exps, but let's try to come as close as possible to 80. Thanks! -- Bastien