unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Making vertical-border char defcustom?
@ 2020-01-19 14:13 Paul W. Rankin
  2020-01-19 15:35 ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: Paul W. Rankin @ 2020-01-19 14:13 UTC (permalink / raw)
  To: emacs-devel

Would anyone be open to adding a defcustom for the vertical-border
slot in standard-display-table?

In the past I've been using the following...

   (defun prettify-vertical-border (&optional dummy)
     (ignore dummy)
     (set-display-table-slot
      (or buffer-display-table standard-display-table)
        'vertical-border ?│))

   (when (not window-system)
     (add-hook 'window-configuration-change-hook
               'prettify-vertical-border)
     (add-hook 'change-major-mode-hook
               'prettify-vertical-border))

However the problem with this approach is that some major/minor-modes
set their own overriding display-table... I think help-mode or
special-mode...

This would make Emacs look a lot prettier on UTF-8 consoles, as
currently the 0x7C (vertical bar) default does not create a solid
vertical line with most fonts.

Thoughts?


-- 
Paul W. Rankin
https://www.paulwrankin.com



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Making vertical-border char defcustom?
  2020-01-19 14:13 Making vertical-border char defcustom? Paul W. Rankin
@ 2020-01-19 15:35 ` Eli Zaretskii
  2020-01-19 23:49   ` Paul W. Rankin
  0 siblings, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2020-01-19 15:35 UTC (permalink / raw)
  To: Paul W. Rankin; +Cc: emacs-devel

> From: Paul W. Rankin <hello@paulwrankin.com>
> Date: Mon, 20 Jan 2020 00:13:27 +1000
> 
>    (defun prettify-vertical-border (&optional dummy)
>      (ignore dummy)
>      (set-display-table-slot
>       (or buffer-display-table standard-display-table)
>         'vertical-border ?│))
> 
>    (when (not window-system)
>      (add-hook 'window-configuration-change-hook
>                'prettify-vertical-border)
>      (add-hook 'change-major-mode-hook
>                'prettify-vertical-border))
> 
> However the problem with this approach is that some major/minor-modes
> set their own overriding display-table... I think help-mode or
> special-mode...

I don't understand the difficulty.  AFAIU, all you need is augment
your prettify-vertical-border with a call to window-display-table, and
then no overriding could get in your way.  Or am I missing something?



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Making vertical-border char defcustom?
  2020-01-19 15:35 ` Eli Zaretskii
@ 2020-01-19 23:49   ` Paul W. Rankin
  2020-01-20 18:08     ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: Paul W. Rankin @ 2020-01-19 23:49 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

On 20 Jan 2020, at 1:35 am, Eli Zaretskii <eliz@gnu.org> wrote:
> 
>> From: Paul W. Rankin <hello@paulwrankin.com>
>> Date: Mon, 20 Jan 2020 00:13:27 +1000
>> 
>>   (defun prettify-vertical-border (&optional dummy)
>>     (ignore dummy)
>>     (set-display-table-slot
>>      (or buffer-display-table standard-display-table)
>>        'vertical-border ?│))
>> 
>>   (when (not window-system)
>>     (add-hook 'window-configuration-change-hook
>>               'prettify-vertical-border)
>>     (add-hook 'change-major-mode-hook
>>               'prettify-vertical-border))
>> 
>> However the problem with this approach is that some major/minor-modes
>> set their own overriding display-table... I think help-mode or
>> special-mode...
> 
> I don't understand the difficulty.  AFAIU, all you need is augment
> your prettify-vertical-border with a call to window-display-table, and
> then no overriding could get in your way.  Or am I missing something?

Ah sorry, the issue seems to be with some interference from a global minor mode page-break-lines-mode... Your suggestion helped me find that. Thanks.

Would the net benefit from making the vertical-border char defcustom still make it worthwhile? It seems similar to the recently added display-fill-column-indicator-character, a vertical line that sits next to the vertical border and is customisable.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Making vertical-border char defcustom?
  2020-01-19 23:49   ` Paul W. Rankin
@ 2020-01-20 18:08     ` Eli Zaretskii
  2020-01-21  6:25       ` Paul W. Rankin
  0 siblings, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2020-01-20 18:08 UTC (permalink / raw)
  To: Paul W. Rankin; +Cc: emacs-devel

> From: "Paul W. Rankin" <hello@paulwrankin.com>
> Date: Mon, 20 Jan 2020 09:49:30 +1000
> Cc: emacs-devel@gnu.org
> 
> > I don't understand the difficulty.  AFAIU, all you need is augment
> > your prettify-vertical-border with a call to window-display-table, and
> > then no overriding could get in your way.  Or am I missing something?
> 
> Ah sorry, the issue seems to be with some interference from a global minor mode page-break-lines-mode... Your suggestion helped me find that. Thanks.

You are welcome.

> Would the net benefit from making the vertical-border char defcustom still make it worthwhile? It seems similar to the recently added display-fill-column-indicator-character, a vertical line that sits next to the vertical border and is customisable.

We don't offer customization of the display tables via defcustom, most
probably because it is "tricky" (as you yourself discovered).  I
hesitate to offer just this one slot of the display table, and the
fact that it only affects TTY frames and requires UTF-8 capable
terminal on top of that doesn't provide additional motivation...

display-fill-column-indicator-character is an entirely different
matter, it's a minor mode which lets users specify an indicator glyph.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Making vertical-border char defcustom?
  2020-01-20 18:08     ` Eli Zaretskii
@ 2020-01-21  6:25       ` Paul W. Rankin
  2020-01-21 15:30         ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: Paul W. Rankin @ 2020-01-21  6:25 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

On 21 Jan 2020, at 4:08 am, Eli Zaretskii <eliz@gnu.org> wrote:
> We don't offer customization of the display tables via defcustom, most
> probably because it is "tricky" (as you yourself discovered).  I
> hesitate to offer just this one slot of the display table, and the
> fact that it only affects TTY frames and requires UTF-8 capable
> terminal on top of that doesn't provide additional motivation...

Do you mean tricky from an implementation or user perspective? From my user perspective, I'm hoping it can be made less tricky.

> display-fill-column-indicator-character is an entirely different
> matter, it's a minor mode which lets users specify an indicator glyph.

This I mean more from a user perspective, as in, "Oh I see I can customise this vertical line but I can't customise this vertical line next to it..."


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Making vertical-border char defcustom?
  2020-01-21  6:25       ` Paul W. Rankin
@ 2020-01-21 15:30         ` Eli Zaretskii
  0 siblings, 0 replies; 6+ messages in thread
From: Eli Zaretskii @ 2020-01-21 15:30 UTC (permalink / raw)
  To: Paul W. Rankin; +Cc: emacs-devel

> From: "Paul W. Rankin" <hello@paulwrankin.com>
> Date: Tue, 21 Jan 2020 16:25:52 +1000
> Cc: emacs-devel@gnu.org
> 
> On 21 Jan 2020, at 4:08 am, Eli Zaretskii <eliz@gnu.org> wrote:
> > We don't offer customization of the display tables via defcustom, most
> > probably because it is "tricky" (as you yourself discovered).  I
> > hesitate to offer just this one slot of the display table, and the
> > fact that it only affects TTY frames and requires UTF-8 capable
> > terminal on top of that doesn't provide additional motivation...
> 
> Do you mean tricky from an implementation or user perspective?

The former.  This is a low-level facility that Emacs itself uses on a
very low level.  Naïvely customizing it will have global session-wide
effect, something many users won't want, and then they will want to
have user-level access to buffer- and window-local display tables,
something that is not trivial to get right.

> > display-fill-column-indicator-character is an entirely different
> > matter, it's a minor mode which lets users specify an indicator glyph.
> 
> This I mean more from a user perspective, as in, "Oh I see I can customise this vertical line but I can't customise this vertical line next to it..."

The other one was never meant to be customized, not really.



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-01-21 15:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-19 14:13 Making vertical-border char defcustom? Paul W. Rankin
2020-01-19 15:35 ` Eli Zaretskii
2020-01-19 23:49   ` Paul W. Rankin
2020-01-20 18:08     ` Eli Zaretskii
2020-01-21  6:25       ` Paul W. Rankin
2020-01-21 15:30         ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).