emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: master 2399541: Remove font-lock toggle from font-lock-update


From: Alan Mackenzie
Subject: Re: master 2399541: Remove font-lock toggle from font-lock-update
Date: Thu, 25 Mar 2021 11:00:56 +0000

Hello, Gregory.

There's an unnecessary vagueness in your proposed doc string for
font-lock-dwim.

On Thu, Mar 25, 2021 at 10:14:06 +0000, Gregory Heytings wrote:

[ .... ]

> -(defun font-lock-update (&optional arg)
> +(defun font-lock-dwim (&optional arg)
>    "Updates the syntax highlighting in this buffer.
> -Refontify the accessible portion of this buffer, or enable Font Lock mode
> -in this buffer if it is currently disabled.  With prefix ARG, toggle Font
> -Lock mode."
> +Enable Font Lock mode if it is disabled.  Otherwise, refontify the region
> +if it is active, or a large part of the accessible portion of the buffer.
> +With prefix ARG, toggle Font Lock mode." <===========================
>    (interactive "P")
>    (save-excursion
>      (if (and (not arg) font-lock-mode)
> -        (font-lock-fontify-region (point-min) (point-max))
> +        (if (use-region-p)
> +            (font-lock-fontify-region (region-beginning) (region-end))
> +          (font-lock-flush (point-min) (point-max))
> +          (font-lock-fontify-region (max (point-min) (- (point) 50000))
> +                                    (min (point-max) (+ (point) 50000))))
>        (font-lock-unfontify-region (point-min) (point-max))
>        (font-lock-mode 'toggle))))

I think the sentence should read:

    With prefix ARG, INSTEAD toggle Font Lock mode.

..  The other meaning would be captured by:

    With prefix ARG, ALSO toggle Font Lock mode.

..  Please consider amending the doc string accordingly.

-- 
Alan Mackenzie (Nuremberg, Germany).



reply via email to

[Prev in Thread] Current Thread [Next in Thread]