unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* adaptive-wrap
       [not found] <874jlc7ifu.fsf.ref@yahoo.com>
@ 2023-08-06  7:12 ` Po Lu
  2023-08-06  7:20   ` adaptive-wrap Eli Zaretskii
                     ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Po Lu @ 2023-08-06  7:12 UTC (permalink / raw)
  To: emacs-devel

adaptive-wrap makes the wrapping of comments within buffers
aesthetically pleasing, but doesn't offer any true functional advantage
other than that.

I think we should seek to distribute it and many other analogous small
packages with Emacs itself, since these minor niceties will never
provide a sufficient advantage for users to purposefully install them
from ELPA.



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

* Re: adaptive-wrap
  2023-08-06  7:12 ` adaptive-wrap Po Lu
@ 2023-08-06  7:20   ` Eli Zaretskii
  2023-08-06  7:24     ` adaptive-wrap Po Lu
  2023-08-07 16:01   ` adaptive-wrap Spencer Baugh
  2023-08-09 17:34   ` Pixel Fill + Justify Madhu
  2 siblings, 1 reply; 12+ messages in thread
From: Eli Zaretskii @ 2023-08-06  7:20 UTC (permalink / raw)
  To: Po Lu; +Cc: emacs-devel

> From: Po Lu <luangruo@yahoo.com>
> Date: Sun, 06 Aug 2023 15:12:37 +0800
> 
> adaptive-wrap makes the wrapping of comments within buffers
> aesthetically pleasing, but doesn't offer any true functional advantage
> other than that.

What does it offer beyond the built-in major modes, like CC Mode, for
example?



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

* Re: adaptive-wrap
  2023-08-06  7:20   ` adaptive-wrap Eli Zaretskii
@ 2023-08-06  7:24     ` Po Lu
  0 siblings, 0 replies; 12+ messages in thread
From: Po Lu @ 2023-08-06  7:24 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

> What does it offer beyond the built-in major modes, like CC Mode, for
> example?

adaptive-wrap only changes the contents of the display through jit-lock.
It does not modify the contents of the buffer.



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

* Re: adaptive-wrap
  2023-08-06  7:12 ` adaptive-wrap Po Lu
  2023-08-06  7:20   ` adaptive-wrap Eli Zaretskii
@ 2023-08-07 16:01   ` Spencer Baugh
  2023-08-07 16:49     ` adaptive-wrap Eli Zaretskii
                       ` (2 more replies)
  2023-08-09 17:34   ` Pixel Fill + Justify Madhu
  2 siblings, 3 replies; 12+ messages in thread
From: Spencer Baugh @ 2023-08-07 16:01 UTC (permalink / raw)
  To: emacs-devel

Po Lu <luangruo@yahoo.com> writes:
> adaptive-wrap makes the wrapping of comments within buffers
> aesthetically pleasing, but doesn't offer any true functional advantage
> other than that.
>
> I think we should seek to distribute it and many other analogous small
> packages with Emacs itself, since these minor niceties will never
> provide a sufficient advantage for users to purposefully install them
> from ELPA.

I am learning about this package for the first time and I find it quite
minor, but nice.  I agree, it should be in core Emacs, it's such a minor
improvement that it's hard to justify taking the effort to install it.

It seems especially useful for small displays (such as on Android).

I wonder if adaptive-wrap should be on by default?  Or maybe many modes
should set a wrap-prefix overlay themselves?

-----
Tangent:

This would be nice in combination with some kind of dynamic
line-wrapping which simulates joining lines.  Then comments would
appear as if they've been filled to the screen width, no matter what
the actual fill-column and screen width is.  Which would be nice on
small displays.

By dynamic word-wrapping I mean something which would display:

foo foo foo foo foo foo foo
foo foo foo foo foo foo foo

as

foo foo foo foo foo
foo foo foo foo foo
foo foo foo foo

on a 20-character width display.  Instead of the default display
behavior:

foo foo foo foo foo
foo foo
foo foo foo foo foo
foo foo





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

* Re: adaptive-wrap
  2023-08-07 16:01   ` adaptive-wrap Spencer Baugh
@ 2023-08-07 16:49     ` Eli Zaretskii
  2023-08-07 20:40       ` adaptive-wrap Spencer Baugh
  2023-08-07 16:50     ` adaptive-wrap Ihor Radchenko
  2023-08-10  5:37     ` adaptive-wrap Po Lu
  2 siblings, 1 reply; 12+ messages in thread
From: Eli Zaretskii @ 2023-08-07 16:49 UTC (permalink / raw)
  To: Spencer Baugh; +Cc: emacs-devel

> From: Spencer Baugh <sbaugh@janestreet.com>
> Date: Mon, 07 Aug 2023 12:01:51 -0400
> 
> This would be nice in combination with some kind of dynamic
> line-wrapping which simulates joining lines.  Then comments would
> appear as if they've been filled to the screen width, no matter what
> the actual fill-column and screen width is.  Which would be nice on
> small displays.
> 
> By dynamic word-wrapping I mean something which would display:
> 
> foo foo foo foo foo foo foo
> foo foo foo foo foo foo foo
> 
> as
> 
> foo foo foo foo foo
> foo foo foo foo foo
> foo foo foo foo
> 
> on a 20-character width display.  Instead of the default display
> behavior:
> 
> foo foo foo foo foo
> foo foo
> foo foo foo foo foo
> foo foo

Dynamic wrapping is incompatible with hard newlines.  Don't use
newlines except between paragraphs, and word-wrap we have in Emacs
will do what you want.



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

* Re: adaptive-wrap
  2023-08-07 16:01   ` adaptive-wrap Spencer Baugh
  2023-08-07 16:49     ` adaptive-wrap Eli Zaretskii
@ 2023-08-07 16:50     ` Ihor Radchenko
  2023-08-07 20:42       ` adaptive-wrap Spencer Baugh
  2023-08-10  5:37     ` adaptive-wrap Po Lu
  2 siblings, 1 reply; 12+ messages in thread
From: Ihor Radchenko @ 2023-08-07 16:50 UTC (permalink / raw)
  To: Spencer Baugh; +Cc: emacs-devel

Spencer Baugh <sbaugh@janestreet.com> writes:

> Tangent:
>
> This would be nice in combination with some kind of dynamic
> line-wrapping which simulates joining lines.  Then comments would
> appear as if they've been filled to the screen width, no matter what
> the actual fill-column and screen width is.  Which would be nice on
> small displays.

https://codeberg.org/joostkremers/visual-fill-column

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>



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

* Re: adaptive-wrap
  2023-08-07 16:49     ` adaptive-wrap Eli Zaretskii
@ 2023-08-07 20:40       ` Spencer Baugh
  2023-08-08 10:59         ` adaptive-wrap Eli Zaretskii
  0 siblings, 1 reply; 12+ messages in thread
From: Spencer Baugh @ 2023-08-07 20:40 UTC (permalink / raw)
  To: emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Spencer Baugh <sbaugh@janestreet.com>
>> Date: Mon, 07 Aug 2023 12:01:51 -0400
>> 
>> This would be nice in combination with some kind of dynamic
>> line-wrapping which simulates joining lines.  Then comments would
>> appear as if they've been filled to the screen width, no matter what
>> the actual fill-column and screen width is.  Which would be nice on
>> small displays.
>> 
>> By dynamic word-wrapping I mean something which would display:
>> 
>> foo foo foo foo foo foo foo
>> foo foo foo foo foo foo foo
>> 
>> as
>> 
>> foo foo foo foo foo
>> foo foo foo foo foo
>> foo foo foo foo
>> 
>> on a 20-character width display.  Instead of the default display
>> behavior:
>> 
>> foo foo foo foo foo
>> foo foo
>> foo foo foo foo foo
>> foo foo
>
> Dynamic wrapping is incompatible with hard newlines.  Don't use
> newlines except between paragraphs, and word-wrap we have in Emacs
> will do what you want.

But of course that is not the style used for comments in the Emacs
codebase (and most others); most programmers hard-wrap their text with
hard newlines to comply with line length limits.






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

* Re: adaptive-wrap
  2023-08-07 16:50     ` adaptive-wrap Ihor Radchenko
@ 2023-08-07 20:42       ` Spencer Baugh
  0 siblings, 0 replies; 12+ messages in thread
From: Spencer Baugh @ 2023-08-07 20:42 UTC (permalink / raw)
  To: emacs-devel

Ihor Radchenko <yantar92@posteo.net> writes:
> Spencer Baugh <sbaugh@janestreet.com> writes:
>
>> Tangent:
>>
>> This would be nice in combination with some kind of dynamic
>> line-wrapping which simulates joining lines.  Then comments would
>> appear as if they've been filled to the screen width, no matter what
>> the actual fill-column and screen width is.  Which would be nice on
>> small displays.
>
> https://codeberg.org/joostkremers/visual-fill-column

That does not do what I described on my example.




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

* Re: adaptive-wrap
  2023-08-07 20:40       ` adaptive-wrap Spencer Baugh
@ 2023-08-08 10:59         ` Eli Zaretskii
  0 siblings, 0 replies; 12+ messages in thread
From: Eli Zaretskii @ 2023-08-08 10:59 UTC (permalink / raw)
  To: Spencer Baugh; +Cc: emacs-devel

> From: Spencer Baugh <sbaugh@janestreet.com>
> Date: Mon, 07 Aug 2023 16:40:27 -0400
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > Dynamic wrapping is incompatible with hard newlines.  Don't use
> > newlines except between paragraphs, and word-wrap we have in Emacs
> > will do what you want.
> 
> But of course that is not the style used for comments in the Emacs
> codebase (and most others); most programmers hard-wrap their text with
> hard newlines to comply with line length limits.

Then you should look for support measures, e.g., use display tables to
show newlines as space characters, and yet somehow(?) avoid doing that
for "real" newlines, where you do want to leave newlines alone.  Once
you accomplish that, the word-wrap will do the rest, I think.



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

* Pixel Fill + Justify
  2023-08-06  7:12 ` adaptive-wrap Po Lu
  2023-08-06  7:20   ` adaptive-wrap Eli Zaretskii
  2023-08-07 16:01   ` adaptive-wrap Spencer Baugh
@ 2023-08-09 17:34   ` Madhu
  2023-08-10  7:12     ` Eli Zaretskii
  2 siblings, 1 reply; 12+ messages in thread
From: Madhu @ 2023-08-09 17:34 UTC (permalink / raw)
  To: emacs-devel


This reminds me to ask: are there any consumers of pixel-fill-region?
I'd like to be able to read buffers in variable-pitch-mode with `full'
justification, the signature doesn't have a 'justify' optional argument
but is that a limitation or just a small matter of programming?



* Po Lu <874jlc7ifu.fsf@yahoo.com> :
Wrote on Sun, 06 Aug 2023 15:12:37 +0800:

> adaptive-wrap makes the wrapping of comments within buffers
> aesthetically pleasing, but doesn't offer any true functional advantage
> other than that.

> I think we should seek to distribute it and many other analogous small
> packages with Emacs itself, since these minor niceties will never
> provide a sufficient advantage for users to purposefully install them
> from ELPA.




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

* Re: adaptive-wrap
  2023-08-07 16:01   ` adaptive-wrap Spencer Baugh
  2023-08-07 16:49     ` adaptive-wrap Eli Zaretskii
  2023-08-07 16:50     ` adaptive-wrap Ihor Radchenko
@ 2023-08-10  5:37     ` Po Lu
  2 siblings, 0 replies; 12+ messages in thread
From: Po Lu @ 2023-08-10  5:37 UTC (permalink / raw)
  To: Spencer Baugh; +Cc: emacs-devel, Stephen Berman

Spencer Baugh <sbaugh@janestreet.com> writes:

> Po Lu <luangruo@yahoo.com> writes:
>> adaptive-wrap makes the wrapping of comments within buffers
>> aesthetically pleasing, but doesn't offer any true functional advantage
>> other than that.
>>
>> I think we should seek to distribute it and many other analogous small
>> packages with Emacs itself, since these minor niceties will never
>> provide a sufficient advantage for users to purposefully install them
>> from ELPA.
>
> I am learning about this package for the first time and I find it quite
> minor, but nice.  I agree, it should be in core Emacs, it's such a minor
> improvement that it's hard to justify taking the effort to install it.
>
> It seems especially useful for small displays (such as on Android).

Stefan, what do you say to this?  Since the package in ELPA, migrating
it into Emacs should not pose any legal difficulties, so the only
prerequisites are suitable entries in NEWS and the documentation,
correct?



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

* Re: Pixel Fill + Justify
  2023-08-09 17:34   ` Pixel Fill + Justify Madhu
@ 2023-08-10  7:12     ` Eli Zaretskii
  0 siblings, 0 replies; 12+ messages in thread
From: Eli Zaretskii @ 2023-08-10  7:12 UTC (permalink / raw)
  To: Madhu; +Cc: emacs-devel

> From: Madhu <enometh@meer.net>
> Date: Wed, 09 Aug 2023 23:04:32 +0530
> 
> 
> This reminds me to ask: are there any consumers of pixel-fill-region?

A few, you can find them by grepping the Emacs sources.  For example,
shr.el uses it for filling HTML display.

> I'd like to be able to read buffers in variable-pitch-mode with `full'
> justification, the signature doesn't have a 'justify' optional argument
> but is that a limitation or just a small matter of programming?

It's a matter of programming: the code needs to insert spaces with
:width 'display' spec on them to produce pixel-resolution
justification.

Patches welcome.



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

end of thread, other threads:[~2023-08-10  7:12 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <874jlc7ifu.fsf.ref@yahoo.com>
2023-08-06  7:12 ` adaptive-wrap Po Lu
2023-08-06  7:20   ` adaptive-wrap Eli Zaretskii
2023-08-06  7:24     ` adaptive-wrap Po Lu
2023-08-07 16:01   ` adaptive-wrap Spencer Baugh
2023-08-07 16:49     ` adaptive-wrap Eli Zaretskii
2023-08-07 20:40       ` adaptive-wrap Spencer Baugh
2023-08-08 10:59         ` adaptive-wrap Eli Zaretskii
2023-08-07 16:50     ` adaptive-wrap Ihor Radchenko
2023-08-07 20:42       ` adaptive-wrap Spencer Baugh
2023-08-10  5:37     ` adaptive-wrap Po Lu
2023-08-09 17:34   ` Pixel Fill + Justify Madhu
2023-08-10  7:12     ` 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).