From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Heime via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#59828: Fundamental Mode buffers fail to keep text properties Date: Mon, 05 Dec 2022 20:27:09 +0000 Message-ID: References: <83lenl9al6.fsf@gnu.org> <83edtd99p2.fsf@gnu.org> <83cz8x97uk.fsf@gnu.org> <-vvz_2yrqjb2Eck0fqcM6KaTnwqc4Q2n5nn6vsVuZxHe1gRjV8gnJvyGQAPGuE2fXiAkJ_JpUp_Q6j9qdX2WegKM2vslVdpjt342CTznuc0=@protonmail.com> <2557E415-E1C9-4BDA-ACFB-8242FF363B63@gmail.com> Reply-To: Heime 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="36202"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Yuan Fu , Eli Zaretskii , 59828-done@debbugs.gnu.org To: Heime Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 05 21:28:25 2022 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 1p2I4d-0009BH-H3 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 05 Dec 2022 21:28:23 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p2I4L-0006S3-Cc; Mon, 05 Dec 2022 15:28:05 -0500 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 1p2I4I-0006Ri-KV for bug-gnu-emacs@gnu.org; Mon, 05 Dec 2022 15:28:02 -0500 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 1p2I4I-0002Tb-CR for bug-gnu-emacs@gnu.org; Mon, 05 Dec 2022 15:28:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p2I4I-0001Df-6n for bug-gnu-emacs@gnu.org; Mon, 05 Dec 2022 15:28:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Heime Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 05 Dec 2022 20:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59828 X-GNU-PR-Package: emacs Original-Received: via spool by 59828-done@debbugs.gnu.org id=D59828.16702720524676 (code D ref 59828); Mon, 05 Dec 2022 20:28:02 +0000 Original-Received: (at 59828-done) by debbugs.gnu.org; 5 Dec 2022 20:27:32 +0000 Original-Received: from localhost ([127.0.0.1]:38212 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p2I3n-0001DM-TO for submit@debbugs.gnu.org; Mon, 05 Dec 2022 15:27:32 -0500 Original-Received: from mail-40137.protonmail.ch ([185.70.40.137]:47049) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p2I3k-0001DE-Jo for 59828-done@debbugs.gnu.org; Mon, 05 Dec 2022 15:27:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1670272042; x=1670531242; bh=BWogZ2JxDBq1zdYooLjgXt1vkBcvXoEBboXw9+Q14ts=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=Jdi+PsOcSl2XhYU2DO57O+owIX5fPakot6bg2OXxS73s073BsVPwOVA0Th3kxquh3 up3MGZPwlttSboeun5ijzXBTZdQpsmvOUXyx7kYQrU15UNkYzFUViWOfZ2q2HxfEfO hAGUvZVU2UBjkynbaCr1ROvQ4dv2yYyYpkLvuTxfk3TETcsGKMJTL1scBnZtqnJ1vo z1TDkdL7vekB+hwQ2RgdG7fK4zWQCmefvZQ/Q5F+AhESk3oA9UXQhBztJaz3ru5IdO LC04c8xULXzgsIvMxcR3NUVmznadLm8b8kEuKJzT/MKjp6xF/pmczm49BTP8qlaZWT gugko8D4cjArw== In-Reply-To: Feedback-ID: 57735886:user:proton 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:250071 Archived-At: ------- Original Message ------- On Monday, December 5th, 2022 at 8:13 PM, Heime via "Bug reports for GNU Em= acs, the Swiss army knife of text editors" wrote: > ------- Original Message ------- > On Monday, December 5th, 2022 at 8:07 PM, Yuan Fu casouri@gmail.com wrote= : >=20 >=20 >=20 > > > On Dec 5, 2022, at 11:23 AM, Heime heimeborgia@protonmail.com wrote: > > >=20 > > > ------- Original Message ------- > > > On Monday, December 5th, 2022 at 3:40 PM, Eli Zaretskii eliz@gnu.org = wrote: > > >=20 > > > > > Date: Mon, 05 Dec 2022 15:06:09 +0000 > > > > > From: Heime heimeborgia@protonmail.com > > > > > Cc: casouri@gmail.com, 59828@debbugs.gnu.org > > > > >=20 > > > > > > > > Conclusion: you need to turn on font-lock in that buffer. > > > > > > >=20 > > > > > > > When I use (text-mode) or (org-mode), I do not get the proble= m. > > > > > > >=20 > > > > > > > (with-current-buffer (get-buffer-create bufrn) > > > > > > > (text-mode) > > > > > > > (insert (propertize "G" > > > > > > > 'font-lock-face '(:background "green" > > > > > > > :foreground "black")))) > > > > > >=20 > > > > > > Because those turn on font-lock by default. > > > > >=20 > > > > > What do you think about having fundamental-mode also turn font-lo= ck on ? > > > >=20 > > > > What it does now is the result of what we think. That's why it is c= alled > > > > Fundamental. > > > >=20 > > > > Anyway, there's no bug here, so I'm closing this. > > >=20 > > > Is fundamental mode not usually used when working on new buffers? > >=20 > > Just to clarify: > >=20 > > 1. If font-lock-mode is off, you should use (propertize =E2=80=A6 = =E2=80=98face =E2=80=A6) > > 2. If font-lock-mode is on, you should use (propertize =E2=80=A6 = =E2=80=98font-lock-face =E2=80=A6) If I have a function that does the inserts, should I include the two differ= ent conditions,=20 whether "font-lock-mode" in "off" or "on" ? Test whether font-lock-mode is off, then use (propertize =E2=80=A6 = =E2=80=98face =E2=80=A6) Test whether font-lock-mode is on, then use (propertize =E2=80=A6 =E2=80= =98font-lock-face =E2=80=A6) =20 > Very clear explanation. >=20 > > If you create a buffer interactively, font-lock-mode is on (at least in= the latest version of Emacs, not sure which version of Emacs are you on). = But if you create a buffer programmatically (as you did in the code snippet= ), font-lock-mode is off. >=20 >=20 > Even if you make a buffer interactively in fundamental-mode, would font-l= ock-mode be on ? >