all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Paul W. Rankin" via "Emacs development discussions." <emacs-devel@gnu.org>
To: Gregory Heytings <gregory@heytings.org>,
	Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: 'M-o' ('facemap-keymap') has now been removed until March 10th 2021
Date: Wed, 24 Mar 2021 19:09:33 +1000	[thread overview]
Message-ID: <A4AC0A08-5570-4C2B-8171-AE059C68B68E@bydasein.com> (raw)
In-Reply-To: <8786a8e8faf45a989904@heytings.org>


> On 24 Mar 2021, at 6:01 pm, Gregory Heytings <gregory@heytings.org> wrote:
> 
>>>> No bugs here. Both of these work as expected. I think the issue is you're confused about font-lock-mode and text properties. These are not the same thing. Font-lock-mode is just one way to add text properties to text, so may other functions. Deactivating font-lock-mode does not remove all text properties, only on text with the `(fontified . t)' property. This is why you're seeing what you're seeing.
>>> 
>>> Please explain this to Stefan M, who considers this to be bugs, who would like to deprecate the font-lock-fontify-{buffer,block} commands, and who guided me to write the font-lock-update command.
>> 
>> For sure. If you can, please link me to the lists.gnu.org message?
>> 
> 
> I'm curious how you will explain to the author of font-lock-fontify-buffer that his command has no bugs, when he thinks it has and would like to obsolete it.  The first message is at https://lists.gnu.org/archive/html/emacs-devel/2021-03/msg00581.html .

Thanks for the link. I've looped in Stefan so he can tell me I'm wrong, but...

I think the issue you describe, where yanked text includes previous text properties without font-lock-mode active is expected behaviour. You can control this behaviour with the variable `yank-excluded-properties'. (Eli I'm surprised you didn't use this?)

I think Stefan was commenting on how this behaviour might be unexpected, then separately, also commenting on the messiness of the code in `font-lock-fontify-buffer'. But the messiness of that code does not imply that the way text properties work is a bug.

I'm pretty sure the idea is to have a cleaner version of `font-lock-fontify-buffer' i.e. a duplicate, which is almost what you have.

> By the way, what actual problems do you see in font-lock-update?  Do you see cases where it produces unexpected results?

Just the toggling part. The command is called `font-lock-update' but when font-lock-mode is active and the command is called with ARG, it turns font-lock-mode off. From the docstring I'm not sure if that was your intention? Given this is a default key binding on the Holy ctl-x-map (technically the ctl-x-x-map), it should probably do what it says on the tin.

Here's the same but what I'd consider a cleaner approach:

(defun font-lock-update ()
  "Refontify the accessible portion of the buffer.
Unconditionally activate `font-lock-mode'."
  (interactive)
  (unless font-lock-mode (font-lock-mode 1))
  (save-excursion
    (font-lock-fontify-region (point-min) (point-max))))

Technically this is still a bit misleading because of teh aforementioned `font-lock-dont-widen' variable, but we can't have everything.




  reply	other threads:[~2021-03-24  9:09 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-23 21:38 'M-o' ('facemap-keymap') has now been removed until March 10th 2021 Paul W. Rankin via Emacs development discussions.
2021-03-23 22:07 ` Gregory Heytings
2021-03-23 23:08   ` Paul W. Rankin via Emacs development discussions.
2021-03-23 23:13     ` Gregory Heytings
2021-03-24  5:40       ` Paul W. Rankin via Emacs development discussions.
2021-03-24  8:01         ` Gregory Heytings
2021-03-24  9:09           ` Paul W. Rankin via Emacs development discussions. [this message]
2021-03-24  9:20             ` Gregory Heytings
2021-03-24  9:33               ` Paul W. Rankin via Emacs development discussions.
2021-03-24  9:44                 ` Gregory Heytings
2021-03-24 12:00                   ` Paul W. Rankin via Emacs development discussions.
2021-03-24 12:12                     ` Gregory Heytings
2021-03-24 12:35                       ` Paul W. Rankin via Emacs development discussions.
2021-03-24 13:01                         ` Gregory Heytings
2021-03-24 13:09                 ` Stefan Monnier
2021-03-24 13:30                   ` Paul W. Rankin via Emacs development discussions.
2021-03-24 15:14                     ` Stefan Monnier
2021-03-24 15:38                       ` Paul W. Rankin via Emacs development discussions.
2021-03-24 15:40                         ` Stefan Monnier
2021-03-24 15:53                           ` Paul W. Rankin via Emacs development discussions.
2021-03-24 21:47                             ` Stefan Monnier
2021-03-24 17:09             ` Eli Zaretskii
2021-03-24 21:58               ` Stefan Monnier
2021-03-25  6:15                 ` Eli Zaretskii
2021-03-25 14:03                   ` Stefan Monnier
2021-03-24 13:07   ` Stefan Monnier
2021-03-24 13:41     ` Paul W. Rankin via Emacs development discussions.
2021-03-24 13:53       ` Gregory Heytings
  -- strict thread matches above, loose matches on Subject: below --
2021-02-10 18:40 Lars Ingebrigtsen
2021-02-10 19:14 ` Alan Mackenzie
2021-02-10 19:19   ` Lars Ingebrigtsen
2021-02-10 19:38     ` Lars Ingebrigtsen
2021-02-10 19:47       ` Alan Mackenzie
2021-02-11 13:34 ` Richard Stallman
2021-03-11 16:27 ` Lars Ingebrigtsen
2021-03-11 16:53   ` Eli Zaretskii
2021-03-11 17:02     ` Gregory Heytings
2021-03-11 17:29       ` Eli Zaretskii
2021-03-12 12:09       ` Filipp Gunbin
2021-03-12 12:46         ` Gregory Heytings
2021-03-11 17:37   ` Stefan Kangas
2021-03-11 18:25   ` Alfred M. Szmidt
2021-03-17 16:32   ` Sean Whitton
2021-03-18  3:43     ` Lars Ingebrigtsen
2021-03-18  4:35       ` Sean Whitton
2021-03-18  4:40         ` Lars Ingebrigtsen
2021-03-18  4:16   ` Lars Ingebrigtsen
2021-03-18  9:00     ` Eli Zaretskii
2021-03-18 10:27       ` Eli Zaretskii
2021-03-19  7:46         ` Lars Ingebrigtsen
2021-03-19  8:06           ` Eli Zaretskii
2021-03-19  9:35             ` Gregory Heytings
2021-03-19 12:01               ` Eli Zaretskii
2021-03-20  7:58             ` Lars Ingebrigtsen
2021-03-20  8:39               ` Andreas Schwab
2021-03-20  8:45                 ` Lars Ingebrigtsen
2021-03-20  8:58                   ` Gregory Heytings
2021-03-20  9:10               ` Eli Zaretskii
2021-03-18 13:28       ` Jean Louis
2021-03-18 14:45         ` Eli Zaretskii
2021-03-18  9:45     ` Alfred M. Szmidt
2021-03-18 13:25     ` Jean Louis
2021-03-18 23:03     ` Sean Whitton
2021-03-19 13:14     ` Gregory Heytings
2021-03-20  7:54       ` Lars Ingebrigtsen

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=A4AC0A08-5570-4C2B-8171-AE059C68B68E@bydasein.com \
    --to=emacs-devel@gnu.org \
    --cc=gregory@heytings.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=pwr@bydasein.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.