Subject: Re: bug#77544: (WIP) [PATCH] Prettify page separators.

From: Eli Zaretskii <[email-masked]>
Date: Sat, 09 Aug 2025 12:35:01 +0300

> From: Elijah Gabe Pérez <[email-masked]>
> Cc: Visuwesh <[email-masked]>,  [email-masked],
>   [email-masked]
> Date: Fri, 08 Aug 2025 23:09:03 -0600
> 
> Sorry for the delay, i tried to make the strike-through face property
> support the same line styles as the underline, but i couldn't figure out
> how, as it seems that strike-through is designed to support only 1
> style.
> 
> My solution was to make a kind of hack to display the underline as
> strike-through, and it worked.

Why is it a problem to show a normal underline?

> Optionally, I've added a new minor mode to enable this outside
> whitespace-mode (an example of use in this would be in the NEWS file or
> in *Compile-Log* buffers).

I'm not sure it is justified to have a separate mode for this.

> +---
> +*** 'whitespace-mode' now can prettify page delimiters characters (^L).
> +If 'page-delimiters' is set in 'whitespace-style', or the new minor mode
> +'whitespace-page-delimiters-mode' is on, the page delimiters characters
                                                     ^^^^^^^^^^
"delimiter", singular.

> +(^L) are displayed as a pretty horizontal line that spans the entire
> +width of the window.  The new 'whitespace-page-delimiter' face, can be
                                                                 ^
That comma should be deleted.

> +used for customize the appearence
        ^^^^^^^^^^^^^
Either "to customize" or "for customizing".

I think we should also mention that font-lock must be ON for this to
work.  E.g., does it work in Fundamental mode?

> +;;;###autoload
> +(define-minor-mode whitespace-page-delimiters-mode
> +  "Display page delimiters characters as horizontal lines."
> +  :group 'whitespace
> +  (cond
> +   ((and whitespace-mode (not (memq 'page-delimiters whitespace-style)))
> +    (setq-local whitespace-style
> +                (cons 'page-delimiters whitespace-style))
> +    (whitespace-mode +1))
> +   (whitespace-page-delimiters-mode
> +    (font-lock-add-keywords nil whitespace--page-delimiters-keyword)
> +    (unless (memq 'display font-lock-extra-managed-props)
> +      (setq-local font-lock-extra-managed-props
> +                  (cons 'display font-lock-extra-managed-props)))
> +    (font-lock-flush))
> +   (t
> +    (font-lock-remove-keywords nil whitespace--page-delimiters-keyword)
> +    (font-lock-flush))))

Is it wise to support this minor mode outside of whitespace-mode?  Why
shouldn't this work only if whitespace-mode is ON?  It complicates the
implementation, and adds 'display' properties to font-lock-keywords,
but I don't quite see the justification.