From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:c151::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id QK5cBXNTOWAQDwAA0tVLHw (envelope-from ) for ; Fri, 26 Feb 2021 20:00:51 +0000 Received: from aspmx2.migadu.com ([2001:41d0:2:c151::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id yJwSAXNTOWCEDgAAbx9fmQ (envelope-from ) for ; Fri, 26 Feb 2021 20:00:51 +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 aspmx2.migadu.com (Postfix) with ESMTPS id 31B6A8C18 for ; Fri, 26 Feb 2021 21:00:50 +0100 (CET) Received: from localhost ([::1]:47174 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lFjI9-0002HO-7g for larch@yhetil.org; Fri, 26 Feb 2021 15:00:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44646) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lFjG8-0002FK-Vl for emacs-orgmode@gnu.org; Fri, 26 Feb 2021 14:58:49 -0500 Received: from mout02.posteo.de ([185.67.36.66]:58339) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lFjG6-0006tj-SJ for emacs-orgmode@gnu.org; Fri, 26 Feb 2021 14:58:44 -0500 Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 2AE772400FC for ; Fri, 26 Feb 2021 20:58:38 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.eu; s=2017; t=1614369519; bh=rheOYco2x+uHAsg6C/nLmU09n58UoNs1LUF22JSRSRg=; h=Subject:From:To:Cc:Date:From; b=mf0SkUjVc5+k6VCEF5oK/08sWuK5PMTyQfisq2Zd8ImGxfXtsnBMeYmwy5j9PP9N8 yiIe0uudvQZksZLb5Q6KRohRZAObfr/qkkH1pdLMlRWJYB8P75GITDQ3TK+qk+pjGP GBvABd4gJ8m5b2+Cw5dEOcCSwLs9Zk3CdE17cbKRWz29ACYnoFkVhDQqXevAOCPVk1 s5mq6zl2/M7oh/qReeoxs5MZap6J/a9ECb1tk+4UaxzsV/LoQEY/1eEKCQCCA+bM24 4LzxXOSdbWznx7BvNd4UaZEVD+bQLwYZhaDlSBtC4nhSVx5FO5+uw/IfMcKb+UD1qD Uccn2UknTH/fg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4DnL7f1B1fz9rxS; Fri, 26 Feb 2021 20:58:38 +0100 (CET) Subject: [PATCH] ~org-font-lock-add-priority-faces~: ensure priority cookies are in a headline From: =?UTF-8?Q?S=c3=a9bastien_Miquel?= To: emacs-orgmode@gnu.org References: <8f36ba0c-5b96-2af4-8d19-1dbf6c9d142e@posteo.eu> <87ft25zzyy.fsf@localhost> <36c35724-0d94-0033-ffc0-1074d8da38a4@posteo.eu> <87v9b1tfvr.fsf@localhost> <87sg64ti6s.fsf@ucl.ac.uk> <87im6vfejz.fsf@gmail.com> <87a6s77x7q.fsf@ucl.ac.uk> <87h7meke8h.fsf@gmail.com> Message-ID: Date: Fri, 26 Feb 2021 20:58:35 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/mixed; boundary="------------EE9198C5730AFCE8A135AB54" Content-Language: fr Received-SPF: pass client-ip=185.67.36.66; envelope-from=sebastien.miquel@posteo.eu; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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: , Reply-To: sebastien.miquel@posteo.eu Cc: Ihor Radchenko 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=1614369650; h=from:from:sender:sender:reply-to: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:dkim-signature; bh=K895oO6ZSpPFBW/TLLq98LaNmZP9niD0UKYI2ArgR+A=; b=t8fgpnP2urJ4gOnFN2IS3EqwmML5j3H5ZknCuQuts+VLuekXZmxT8qKIKXCyt1XMnkUJKJ sebkwHxLpoQU9G2XhBNldLuODkU4+XMQs0TyeIr4AJCsBvjfomYyglKal36DpefV51ZqCQ RoTTkuraxMENd0YBW2mUp1RAYvS8HTPJZZceFWzEh0Q/BaoZ58jkgIuyKjFTqeqd61G9mT Fc0GY3LbbSU1n1i/9CrGbxRPOrLeGK9UxCbFoAmGy+f8CcOPZAwzzVIwTEHi5Jo42rCFoi lpCMdWMCGmGKivMF1WTIdwGoNHbk7VAh7aFBlEaz0u/LupubSq7cYW1LJ28H8g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1614369650; a=rsa-sha256; cv=none; b=dyAy136T015V3SQf7EBFvyAVj+2QiD6+vZ3kHp/MgfizhTPIRc6MUOcR6NafAvUxxlyJc8 3lEi5sA2eMo6f1xWKYu9MArhMA/piCG2Nkf8o5tKLusjFWGjALM3EkL39sQ+MpzHGFURuv /3JGaomRqhoG36zVPS3k8JNR+hCWpulxjvJLoKE4U1dvmqw4hBQRKq+U8tnDnFmT178OYt KCNiyWGHj1TeDWOzeHbJTR8z/ZULoh0TUTBce7RgJlAhylLzVt1lkyLq5OrLhT4BOVs4cu MjFZda357Lpivv3KvFKhSZVyssCLBv4xltOdrDr/WTBaVysvvHpoUlmZpD/DMg== ARC-Authentication-Results: i=1; aspmx2.migadu.com; dkim=pass header.d=posteo.eu header.s=2017 header.b=mf0SkUjV; dmarc=pass (policy=none) header.from=posteo.eu; spf=pass (aspmx2.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: -3.07 Authentication-Results: aspmx2.migadu.com; dkim=pass header.d=posteo.eu header.s=2017 header.b=mf0SkUjV; dmarc=pass (policy=none) header.from=posteo.eu; spf=pass (aspmx2.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: 31B6A8C18 X-Spam-Score: -3.07 X-Migadu-Scanner: scn1.migadu.com X-TUID: Y4LwN+mw9w2g This is a multi-part message in MIME format. --------------EE9198C5730AFCE8A135AB54 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Priority cookies are always in a headline. The attached patch speeds up fontification of a 1k lines buffer by 0.1 second. Note that the variable org-priority-regexp can't be modified since it is used in the agenda and in org-get-priority. Regards, -- Sébastien Miquel --------------EE9198C5730AFCE8A135AB54 Content-Type: text/x-patch; charset=UTF-8; name="0001-org.el-org-font-lock-add-priority-faces-Speed-up-reg.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-org.el-org-font-lock-add-priority-faces-Speed-up-reg.pa"; filename*1="tch" >From a348a3834b79608a20bfd4e28815ae3995c7eb5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Miquel?= Date: Fri, 26 Feb 2021 18:02:32 +0100 Subject: [PATCH] org.el (org-font-lock-add-priority-faces): Speed up regexp * org.el (org-font-lock-add-priority-faces): Speed up regexp. Only fontify priority cookies in headlines. TINYCHANGE --- lisp/org.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/org.el b/lisp/org.el index 00596564f..8c976213d 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -5855,7 +5855,7 @@ If TAG is a number, get the corresponding match group." (defun org-font-lock-add-priority-faces (limit) "Add the special priority faces." - (while (re-search-forward org-priority-regexp limit t) + (while (re-search-forward (concat "^\\*+" org-priority-regexp) limit t) (let ((beg (match-beginning 1)) (end (1+ (match-end 2)))) (add-face-text-property -- 2.30.1 --------------EE9198C5730AFCE8A135AB54--