From: phillip.lord@russet.org.uk (Phillip Lord)
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: Thinking about changed buffers
Date: Tue, 29 Mar 2016 23:26:19 +0100 [thread overview]
Message-ID: <87k2kkq5tg.fsf@russet.org.uk> (raw)
In-Reply-To: <jwvwpolbe3o.fsf-monnier+gmane.emacs.devel@gnu.org> (Stefan Monnier's message of "Tue, 29 Mar 2016 09:39:54 -0400")
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> The only solution I can see for fill-paragraph is to copy the paragraph to
>> a temp buffer, fill that, check whether it has changed, then if it has,
>> signal before-change, copy the changed paragraph back, signal after
>> change. If it has not changed, then fill-paragraph becomes a no-op.
>
> BTW, another solution for fill-paragraph is to reimplement it from
> scratch such that it doesn't "unfill+refill". I.e. it could instead
> loop go to each LF in the paragraph, such if that LF is found to be "at
> the right spot", it moves on, if it's "too soon", then it removes it,
> and if it's "too far" then it adds another somewhere earlier.
>
> This would naturally lead to the result that the buffer would stay
> unmodified if there was no change.
Yes, that would seem a clean solution, as it would avoid changing a
buffer which might not need to be changed. It would also mean that a
fill-paragraph which doesn't change anything would leave no undo events.
Phil
next prev parent reply other threads:[~2016-03-29 22:26 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-28 17:31 Thinking about changed buffers Lars Magne Ingebrigtsen
2016-03-28 17:56 ` Andreas Schwab
2016-03-28 18:00 ` Lars Magne Ingebrigtsen
2016-03-28 18:10 ` Andreas Schwab
2016-03-28 18:19 ` Lars Magne Ingebrigtsen
2016-03-28 18:30 ` Eli Zaretskii
2016-03-28 18:53 ` Lars Magne Ingebrigtsen
2016-03-28 18:57 ` Eli Zaretskii
2016-03-28 19:06 ` Lars Magne Ingebrigtsen
2016-03-28 19:15 ` Eli Zaretskii
2016-03-28 19:23 ` Lars Magne Ingebrigtsen
2016-03-28 19:38 ` Eli Zaretskii
2016-03-28 19:46 ` Lars Magne Ingebrigtsen
2016-03-28 20:21 ` Lars Magne Ingebrigtsen
2016-03-29 2:29 ` Eli Zaretskii
2016-03-28 18:54 ` Andreas Schwab
2016-03-28 18:22 ` Eli Zaretskii
2016-03-28 18:40 ` Lars Magne Ingebrigtsen
2016-03-28 18:49 ` Stephan Mueller
2016-03-28 19:13 ` Stefan Monnier
2016-03-28 19:20 ` Lars Magne Ingebrigtsen
2016-03-28 20:13 ` Clément Pit--Claudel
2016-03-28 20:32 ` Óscar Fuentes
2016-03-28 20:33 ` Stephan Mueller
2016-03-28 20:17 ` Marcin Borkowski
2016-03-28 18:51 ` Lars Magne Ingebrigtsen
2016-03-28 19:22 ` Stefan Monnier
2016-03-28 19:27 ` Lars Magne Ingebrigtsen
2016-03-28 19:32 ` Dmitry Gutov
2016-03-28 20:16 ` Clément Pit--Claudel
2016-03-28 20:22 ` Lars Magne Ingebrigtsen
2016-03-28 21:43 ` Stefan Monnier
2016-03-29 8:53 ` Florian Weimer
2016-03-29 13:14 ` Phillip Lord
2016-03-29 13:39 ` Stefan Monnier
2016-03-29 15:30 ` Lars Magne Ingebrigtsen
2016-04-03 23:05 ` John Wiegley
2016-04-03 23:29 ` Clément Pit--Claudel
2016-04-03 23:30 ` John Wiegley
2016-04-03 23:44 ` Óscar Fuentes
2016-04-04 0:20 ` Clément Pit--Claudel
2016-04-04 0:29 ` Óscar Fuentes
2016-04-04 5:21 ` Lars Magne Ingebrigtsen
2016-04-04 5:26 ` John Wiegley
2016-03-29 22:26 ` Phillip Lord [this message]
2016-04-03 23:05 ` John Wiegley
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87k2kkq5tg.fsf@russet.org.uk \
--to=phillip.lord@russet.org.uk \
--cc=emacs-devel@gnu.org \
--cc=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.