GNU bug report logs - #77544
(WIP) [PATCH] Prettify page separators.

Previous Next

Package: emacs;

Reported by: Elijah Gabe Pérez <eg642616 <at> gmail.com>

Date: Sat, 5 Apr 2025 05:02:02 UTC

Severity: normal

Tags: patch

Full log


Message #62 received at 77544 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Elijah Gabe Pérez <eg642616 <at> gmail.com>
Cc: gerd.moellmann <at> gmail.com, 77544 <at> debbugs.gnu.org, visuweshm <at> gmail.com
Subject: Re: bug#77544: (WIP) [PATCH] Prettify page separators.
Date: Sat, 09 Aug 2025 12:35:01 +0300
> From: Elijah Gabe Pérez <eg642616 <at> gmail.com>
> Cc: Visuwesh <visuweshm <at> gmail.com>,  gerd.moellmann <at> gmail.com,
>   77544 <at> debbugs.gnu.org
> 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.




This bug report was last modified today.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.