all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Heime via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: casouri@gmail.com, 59828@debbugs.gnu.org
Subject: bug#59828: Fundamental Mode buffers fail to keep text properties
Date: Mon, 05 Dec 2022 14:54:47 +0000	[thread overview]
Message-ID: <ILSK8lFpKN_13dxh8Pb87ovt27VdO4QFocdJV214ItECMDLGZHdcVv305Lk5mh-gK4sYIBalLel8lJdAj8YgcLsu7auDk4uCJ6CmeOfwS34=@protonmail.com> (raw)
In-Reply-To: <83lenl9al6.fsf@gnu.org>

------- Original Message -------
On Monday, December 5th, 2022 at 2:41 PM, Eli Zaretskii <eliz@gnu.org> wrote:


> > Date: Mon, 05 Dec 2022 13:49:28 +0000
> > From: Heime heimeborgia@protonmail.com
> > Cc: casouri@gmail.com, 59828@debbugs.gnu.org
> > 
> > > > > > Have noticed that when I insert text with colour properties in a buffer
> > > > > > using fundamental-mode, the text properties (e.g. colours) get lost.
> > > > > 
> > > > > I assume you used the ‘face property, right? If you replace ‘face with 'font-lock-face, does it work?
> > > > > 
> > > > > Yuan
> > > > 
> > > > I used 'font-lock-face and did not work.
> > > 
> > > Please show the code you used. It works here.
> > 
> > (with-current-buffer (get-buffer-create bufrn)
> > (insert (propertize "G"
> > 'font-lock-face '(:background "green"
> > :foreground "black"))))
> 
> 
> From the ELisp manual:
> 
> ‘font-lock-face’
> This property specifies a value for the ‘face’ property that Font
> Lock mode should apply to the underlying text. It is one of the
> fontification methods used by Font Lock mode, and is useful for
> special modes that implement their own highlighting. *Note
> Precalculated Fontification::. When Font Lock mode is disabled,
> ‘font-lock-face’ has no effect.
> 
> Note the last sentence.
> 
> Conclusion: you need to turn on font-lock in that buffer.
> 

When I use (text-mode) or (org-mode), I do not get the problem.

(with-current-buffer (get-buffer-create bufrn)
 (text-mode)
 (insert (propertize "G"
 'font-lock-face '(:background "green"
 :foreground "black"))))





  reply	other threads:[~2022-12-05 14:54 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-05  6:30 bug#59828: Fundamental Mode buffers fail to keep text properties Heime via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-05  6:32 ` Yuan Fu
2022-12-05  8:30   ` Heime via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-05 12:46     ` Eli Zaretskii
2022-12-05 13:49       ` Heime via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-05 14:41         ` Eli Zaretskii
2022-12-05 14:54           ` Heime via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2022-12-05 15:00             ` Eli Zaretskii
2022-12-05 15:06               ` Heime via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-05 15:40                 ` Eli Zaretskii
2022-12-05 19:23                   ` Heime via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-05 20:04                     ` Eli Zaretskii
2022-12-05 20:07                     ` Yuan Fu
2022-12-05 20:13                       ` Heime via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-05 20:25                         ` Yuan Fu
2022-12-05 20:27                         ` Heime via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-06  5:41                           ` Yuan Fu
2022-12-07  0:53                             ` Heime via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-08 13:00                               ` Heime via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='ILSK8lFpKN_13dxh8Pb87ovt27VdO4QFocdJV214ItECMDLGZHdcVv305Lk5mh-gK4sYIBalLel8lJdAj8YgcLsu7auDk4uCJ6CmeOfwS34=@protonmail.com' \
    --to=bug-gnu-emacs@gnu.org \
    --cc=59828@debbugs.gnu.org \
    --cc=casouri@gmail.com \
    --cc=eliz@gnu.org \
    --cc=heimeborgia@protonmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.