From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ihor Radchenko Newsgroups: gmane.emacs.bugs Subject: bug#62847: 29.0.90; Propertized space in Org Agenda's mode-name Date: Sat, 15 Apr 2023 12:08:17 +0000 Message-ID: <87cz45e4b2.fsf@localhost> References: <87edollc2k.fsf@localhost> <83v8hxcw6k.fsf@gnu.org> <875y9xlayt.fsf@localhost> <83sfd1cuka.fsf@gnu.org> <873551l97f.fsf@localhost> <83o7npct3x.fsf@gnu.org> <87mt39e5fg.fsf@localhost> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38771"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , 62847@debbugs.gnu.org To: Gustavo Barros Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Apr 15 14:06:26 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pnefh-0009sH-S8 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 15 Apr 2023 14:06:26 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pnefQ-0003DH-7M; Sat, 15 Apr 2023 08:06:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pnefO-0003Cp-Qe for bug-gnu-emacs@gnu.org; Sat, 15 Apr 2023 08:06:06 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pnefK-0004bS-DP for bug-gnu-emacs@gnu.org; Sat, 15 Apr 2023 08:06:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pnefJ-00061G-Sk for bug-gnu-emacs@gnu.org; Sat, 15 Apr 2023 08:06:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ihor Radchenko Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 15 Apr 2023 12:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62847 X-GNU-PR-Package: emacs Original-Received: via spool by 62847-submit@debbugs.gnu.org id=B62847.168156034823115 (code B ref 62847); Sat, 15 Apr 2023 12:06:01 +0000 Original-Received: (at 62847) by debbugs.gnu.org; 15 Apr 2023 12:05:48 +0000 Original-Received: from localhost ([127.0.0.1]:48445 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pnef6-00060k-BL for submit@debbugs.gnu.org; Sat, 15 Apr 2023 08:05:48 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]:59673) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pnef4-00060X-Cg for 62847@debbugs.gnu.org; Sat, 15 Apr 2023 08:05:47 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 66D5024020B for <62847@debbugs.gnu.org>; Sat, 15 Apr 2023 14:05:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1681560340; bh=uWmmwzHLyLEmcw8VaDCndpd13plxgs0Cz/i060irkUM=; h=From:To:Cc:Subject:Date:From; b=qebK8QbOxRvsytmOLo6A6HeRixyqzELL0OHwOFQX/DPXSQt1iQjk4K6J+7SrIGSMw V9Lgol1VuWL17xwsadPAuoKUUhrOF68YNx0Hc3TNerEdJ6bfc+S4k8NW3tH4wZII0J Dheyn0kGGq9QOkyoD/8H+zbtD55lZL5Xy4/KoL20qI0LY8IO8/Gz8v6pLrnZeg6IzC YKDDhSC9QtD7t1/BvDKg4DD7HPFGMPD4xzXyCQoY+ErmyWiKwRFMbkGv8wKq3MYhlk g/R1YUatn7SiGpjMh0G5SXZJu+FOTZO+VSE0YWiD8CrL8y0S4XJzwMjzBny7l6JtK5 o5esURvi8LskQ== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4PzBpq5R27z6tvb; Sat, 15 Apr 2023 14:05:39 +0200 (CEST) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:260041 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Gustavo Barros writes: > On Sat, 15 Apr 2023 at 08:41, Ihor Radchenko wrote: > >> Gustavo, what happens if you put (load "org-agenda.el") in your init.el? > > Problem gone, the space is not propertized. So, it really looks like compilation problem. I am now looking into Elisp manual 2.9 Mutability =20=20=20=20 When similar constants occur as parts of a program, the Lisp interpreter might save time or space by reusing existing constants or their components. For example, =E2=80=98(eq "abc" "abc")=E2=80=99 retu= rns =E2=80=98t=E2=80=99 if the interpreter creates only one instance of the string literal =E2=80=98"a= bc"=E2=80=99, and returns =E2=80=98nil=E2=80=99 if it creates two instances. Lisp progra= ms should be written so that they work regardless of whether this optimization is in use. So, it should be a good idea to avoid setting text properties in string constants in general. See the attached patch. Though I have no clue if this is enough to fix the bug... --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-lisp-org-agenda.el-Try-not-to-modify-string-constant.patch >From 6e74e7746936a5584fce9c8539dd1ad96b37bb7e Mon Sep 17 00:00:00 2001 Message-Id: <6e74e7746936a5584fce9c8539dd1ad96b37bb7e.1681560403.git.yantar92@posteo.net> From: Ihor Radchenko Date: Sat, 15 Apr 2023 14:04:19 +0200 Subject: [PATCH] * lisp/org-agenda.el: Try not to modify string constants by side effect (org-agenda-propertize-selected-todo-keywords): (org-agenda-format-item): (org-agenda-highlight-todo): Make sure that we use a fresh string constant copy when adding properties. This avoids race modifications when compiler use shared object for several string constants in org-agenda. See Emacs bug#62847. Reported-by: Gustavo Barros Link: https://orgmode.org/list/CAM9ALR95F_ZHV2_WsqAz0-35-S2rwxbHqsA5VGftvq51Yz3ZAQ@mail.gmail.com --- lisp/org-agenda.el | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index 2ec2f4c00..8e6b84362 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -4923,7 +4923,9 @@ (defun org-agenda-propertize-selected-todo-keywords (keywords) "Use `org-todo-keyword-faces' for the selected todo KEYWORDS." (concat (if (or (equal keywords "ALL") (not keywords)) - (propertize "ALL" 'face 'org-agenda-structure-filter) + (propertize + (copy-sequence "ALL") ; Avoid modifying `eq' string constants. + 'face 'org-agenda-structure-filter) (mapconcat (lambda (kw) (propertize kw 'face (list (org-get-todo-face kw) 'org-agenda-structure))) @@ -7251,7 +7253,9 @@ (defvar level) (defvar tag) (defvar time)) ""))) (category-icon (org-agenda-get-category-icon category)) (category-icon (if category-icon - (propertize " " 'display category-icon) + (propertize + (copy-sequence " ") ; Avoid modifying `eq' " ". + 'display category-icon) "")) (effort (and (not (string= txt "")) (get-text-property 1 'effort txt))) @@ -7724,8 +7728,10 @@ (defun org-agenda-highlight-todo (x) (unless (string= org-agenda-todo-keyword-format "") ;; Remove `display' property as the icon could leak ;; on the white space. - (org-add-props " " (org-plist-delete (text-properties-at 0 x) - 'display))) + (org-add-props + (copy-sequence " ") ; Avoid modifying `eq' " ". + (org-plist-delete (text-properties-at 0 x) + 'display))) (substring x (match-end 3))))))) x))) -- 2.40.0 --=-=-= Content-Type: text/plain -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at --=-=-=--