From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 4AOGGOZYjWDuZAAAgWs5BA (envelope-from ) for ; Sat, 01 May 2021 15:34:30 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id qEBJFOZYjWBTfgAA1q6Kng (envelope-from ) for ; Sat, 01 May 2021 13:34:30 +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 A86BA12492 for ; Sat, 1 May 2021 15:34:29 +0200 (CEST) Received: from localhost ([::1]:50814 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lcplM-0005eK-Dv for larch@yhetil.org; Sat, 01 May 2021 09:34:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34232) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lcpku-0005eE-Ok for emacs-orgmode@gnu.org; Sat, 01 May 2021 09:34:00 -0400 Received: from ciao.gmane.io ([116.202.254.214]:55190) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lcpkt-00009k-1P for emacs-orgmode@gnu.org; Sat, 01 May 2021 09:34:00 -0400 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1lcpkq-0004sm-H9 for emacs-orgmode@gnu.org; Sat, 01 May 2021 15:33:56 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: emacs-orgmode@gnu.org From: William Xu Subject: Re: prettify-symbols-mode in org agenda? Date: Sat, 01 May 2021 15:33:52 +0200 Organization: the Church of Emacs Message-ID: References: <87o8kf81yq.fsf@localhost> <87im474fgy.fsf@gnu.org> <87v98263bg.fsf@localhost> Mime-Version: 1.0 Content-Type: text/plain User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (darwin) Cancel-Lock: sha1:M/qM95kCU30DwM4/I9qcdihbii8= Received-SPF: pass client-ip=116.202.254.214; envelope-from=geo-emacs-orgmode@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, NML_ADSP_CUSTOM_MED=0.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action 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: , 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=1619876069; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=k+0t0zxbCPzownfD40yERXjHPNfKFrJsNWcfsHLr8Mc=; b=dwpTUXB4hm1SgAwTuQcxhIJFwuWArvr+9dU6kRChZQCyJcmU3pmT1fv48CrhnvRwi57XhH /7xPh+a0VoK+ytnXFxNGG7hGVJTKfCOjnL+h5EfSo5otHk4L4vDO9uc3n0BEx9JudoeqaU OsyOOghSqns+dDlhra42RtdgpuwznGugMKPGRcUkpam+9YNQEouvXMeGsFJoeB3IB6wu7K 2zB3Vf1snALziV2ZlRfUx1NowrFUcQ5FD+4rLTCUxEDPfV293/N6bImNqx8tRQir4ielwE IIxrSHNx/YHjkw++bk0pu6P6WO55vsJjyN9mA61yiGGUNu+17UQDWQjAkBeDJA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1619876069; a=rsa-sha256; cv=none; b=Nk/ihbQeIQAGKmmiUjU3Cb7KliDvuhrLPKGyMSe+jaFsIYmJM6ATktWTD2zE+locyZaXcR 7p09Z4HQjgWe9piG8o5pLqSynz+v9vCazurVoPAWAfubig8L68MAqfeWtVl7MLX0hZPz1j nb1C5V2o7g2fauL4dsOoaiXCpOYLnAXkEtlJviz9FHf0ImdXyM01ik1pVD+HPGBbwzUbZd jb1vPD8LvjhtEO/e5ki4SGYW2NEJOE2nKdy2oBwjH/FT//MGgsKlsPZPbm1akFdvv3CRtP +1ashbcaVQvRzl7+pJ4c6JZwAk87IUcFXgfPLwaj4NJftY7BrTRpUdiOV5+KGg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=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: -0.86 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=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-Queue-Id: A86BA12492 X-Spam-Score: -0.86 X-Migadu-Scanner: scn0.migadu.com X-TUID: bMreN7HJhfkP Ihor Radchenko writes: > Bastien writes: > >> Thanks for bringing this idea up. >> >> If allowing prettify-symbols-mode in Org agenda mode does not slow >> down the agenda display and does not create spacing problems, then >> yes, why not. > > Here is the patch. It will be great if other people test it first, as I > rewrote it from advised functions in my personal config. Works for me. Thanks! > (org-agenda-highlight-todo): Preserve composition property used, > i.e. by `prettify-symbols-mode'. It looks like this change is not really needed, my emacs is built from git master. Maybe the 'composition property is now preserved automatically in the buffer? -William > @@ -7110,7 +7119,8 @@ (defun org-agenda-limit-interactively (remove) > (defun org-agenda-highlight-todo (x) > (let ((org-done-keywords org-done-keywords-for-agenda) > (case-fold-search nil) > - re) > + re > + composition-property) > (if (eq x 'line) > (save-excursion > (beginning-of-line 1) > @@ -7119,10 +7129,12 @@ (defun org-agenda-highlight-todo (x) > (when (looking-at (concat "[ \t]*\\.*\\(" re "\\) +")) > (add-text-properties (match-beginning 0) (match-end 1) > (list 'face (org-get-todo-face 1))) > - (let ((s (buffer-substring (match-beginning 1) (match-end 1)))) > + (setq composition-property (plist-get (text-properties-at (match-beginning 1)) 'composition)) > + (let ((s (org-buffer-substring-fontified (match-beginning 1) (match-end 1)))) > (delete-region (match-beginning 1) (1- (match-end 0))) > (goto-char (match-beginning 1)) > - (insert (format org-agenda-todo-keyword-format s))))) > + (insert (format org-agenda-todo-keyword-format s)) > + (add-text-properties (match-beginning 1) (match-end 1) (list 'composition composition-property))))) > (let ((pl (text-property-any 0 (length x) 'org-heading t x))) > (setq re (get-text-property 0 'org-todo-regexp x)) > (when (and re