From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#62847: 29.0.90; Propertized space in Org Agenda's mode-name Date: Sat, 15 Apr 2023 09:21:35 -0400 Message-ID: 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> <87cz45e4b2.fsf@localhost> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23695"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , 62847@debbugs.gnu.org, Gustavo Barros To: Ihor Radchenko Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Apr 15 15:22:12 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 1pnfr1-0005w4-T8 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 15 Apr 2023 15:22:12 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pnfqv-0003Bz-8M; Sat, 15 Apr 2023 09:22:05 -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 1pnfqs-0003Ba-Oy for bug-gnu-emacs@gnu.org; Sat, 15 Apr 2023 09:22:02 -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 1pnfqs-00059x-Gc for bug-gnu-emacs@gnu.org; Sat, 15 Apr 2023 09:22:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pnfqs-0008M1-Br for bug-gnu-emacs@gnu.org; Sat, 15 Apr 2023 09:22:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 15 Apr 2023 13:22:02 +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.168156490732086 (code B ref 62847); Sat, 15 Apr 2023 13:22:02 +0000 Original-Received: (at 62847) by debbugs.gnu.org; 15 Apr 2023 13:21:47 +0000 Original-Received: from localhost ([127.0.0.1]:48535 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pnfqd-0008LQ-8p for submit@debbugs.gnu.org; Sat, 15 Apr 2023 09:21:47 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:25420) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pnfqa-0008LC-IN for 62847@debbugs.gnu.org; Sat, 15 Apr 2023 09:21:44 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id CF64A440A4A; Sat, 15 Apr 2023 09:21:38 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 79A2F44019B; Sat, 15 Apr 2023 09:21:37 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1681564897; bh=Jw+7wrliulDnxjIukpaIElwgT0LZv4l1iqSgQ3styAo=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=BS50/RQa4//7ztLyQ+948R/21CEMbNvan28R8R+L14h+1YdQTSgY1/EL2f/urfEae ojHhFFwLhSy+Xyn1IVIxH7wSPUMEFVJwORi8zzBfZVVAj0Yo8MCmJL8slk/hYJRWXp svupUBTGIHlduTUGB3w7RP/1fUiT3PI2rxf+jASXbr8z+EetCgIZ9+VhREFDzcSBaG nemz2TUioVQAxquTpFnfK7eP/1EJ6gdVP6YoZ9X6oIOClkE5217iplGFNCKeBCZRgK eyF3AmonVH6ge4WxKs6M2GZL6J1aPJBt/xCArvS127ayYqbKMFqEzVsocKOACgMP6i jlR9weeo2/c+A== Original-Received: from pastel (unknown [45.72.217.176]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 5162812030C; Sat, 15 Apr 2023 09:21:37 -0400 (EDT) In-Reply-To: <87cz45e4b2.fsf@localhost> (Ihor Radchenko's message of "Sat, 15 Apr 2023 12:08:17 +0000") 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:260052 Archived-At: > So, it really looks like compilation problem. > > I am now looking into Elisp manual > > 2.9 Mutability >=20=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 re= turns =E2=80=98t=E2=80=99 if the > interpreter creates only one instance of the string literal =E2=80=98= "abc"=E2=80=99, and > returns =E2=80=98nil=E2=80=99 if it creates two instances. Lisp prog= rams 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. Indeed, since it modifies the object, it's "undefined behavior" territory. > - (propertize "ALL" 'face 'org-agenda-structure-filter) > + (propertize > + (copy-sequence "ALL") ; Avoid modifying `eq' string constants. > + 'face 'org-agenda-structure-filter) `propertize` does not modify its string argument (it returns a new string instead), so the `copy-sequence` here is a pure waste. > - (propertize " " 'display category-icon) > + (propertize > + (copy-sequence " ") ; Avoid modifying `= eq' " ". > + 'display category-icon) Same here. > - (org-add-props " " (org-plist-delete (text-properti= es-at 0 x) > - 'display))) > + (org-add-props > + (copy-sequence " ") ; Avoid modifying `eq' " ". > + (org-plist-delete (text-properties-at 0 x) > + 'display))) This hunk fixes a real bug, OTOH. Maybe you should use `(apply #'propertize` instead or `org-add-props`? Stefan