GNU bug report logs - #71605
30.0.50; [PATCH] Support variable-width text in 'visual-wrap-prefix-mode'

Previous Next

Package: emacs;

Reported by: Jim Porter <jporterbugs <at> gmail.com>

Date: Mon, 17 Jun 2024 02:57:02 UTC

Severity: normal

Tags: patch

Found in version 30.0.50

Done: Jim Porter <jporterbugs <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Jim Porter <jporterbugs <at> gmail.com>
Cc: 71605 <at> debbugs.gnu.org
Subject: bug#71605: 30.0.50; [PATCH] Support variable-width text in 'visual-wrap-prefix-mode'
Date: Tue, 18 Jun 2024 14:37:40 +0300
> Date: Mon, 17 Jun 2024 11:44:47 -0700
> Cc: 71605 <at> debbugs.gnu.org
> From: Jim Porter <jporterbugs <at> gmail.com>
> 
> Replying to your individual points below, but in the other subthread, I 
> had the idea that maybe a better way to do this would be for the wrap 
> prefix to always be the first-line prefix but to make it transparent 
> when desired. So for the "* some text" example, the wrap-prefix would be 
> "* " but fontified(?) such that you can't see it.

I don't think I understand how would this do the job.  Surely, the
indentation space should be visible?

> A face transparency attribute might do the trick, and be useful for 
> other things too: 

It isn't universally supported, AFAIK.

> Or maybe :align-to could take a string value, which would mean "use the 
> pixel-width of this string as the value".

How is that different from using a column (as opposed to pixel) value
for :align-to?

> >> If I set that correctly, then the pixel-size should adjust as the
> >> text scales. It wouldn't handle the case where the actual font
> >> changes though.
> > 
> > Why not?
> 
> I was planning to set :relative-width to <first_line_prefix_width> / 
> <width_of_one_space>. If the font changes, the result of that 
> calculation can change.

The idea is to set it to the multiple of the character's width, which
will then scale with the font.

> > If you can pass a window, you can use window-text-pixel-size instead.
> 
> I think 'window-text-pixel-size' would compute the size of the text 
> already in the buffer

Yes, and we have with-current-buffer...




This bug report was last modified 347 days ago.

Previous Next


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