unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* fill-paragraph-or-region
@ 2007-10-18 16:04 Stefan Monnier
  2007-10-19  0:34 ` fill-paragraph-or-region Juri Linkov
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Stefan Monnier @ 2007-10-18 16:04 UTC (permalink / raw)
  To: emacs-devel


I see that fill-paragraph-or-region was removed, and instead fill-paragraph
was changed to fill a region if transient-mark-mode is active.

What was the reason for this change?

It seems like a bad idea to me: fill-paragraph is already complex enough:
what's the benefit of conflating the two?


        Stefan

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

* Re: fill-paragraph-or-region
  2007-10-18 16:04 fill-paragraph-or-region Stefan Monnier
@ 2007-10-19  0:34 ` Juri Linkov
  2007-10-19 17:41   ` fill-paragraph-or-region Richard Stallman
  2007-10-19  5:40 ` fill-paragraph-or-region Richard Stallman
  2007-10-19 15:23 ` fill-paragraph-or-region David Reitter
  2 siblings, 1 reply; 6+ messages in thread
From: Juri Linkov @ 2007-10-19  0:34 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

> I see that fill-paragraph-or-region was removed, and instead fill-paragraph
> was changed to fill a region if transient-mark-mode is active.
>
> What was the reason for this change?
>
> It seems like a bad idea to me: fill-paragraph is already complex enough:
> what's the benefit of conflating the two?

As I understood, Richard wants the same solution to be applied to all
commands that modify their behavior when the region is active.

First, a new condition for checking the active region was added to
indent-for-tab-command.  A similar change was made later in ispell-word.
ispell-word is more complex than fill-paragraph, but still a new condition
fits nicely to the logic of this command.

It would be good to decide now what is the preferable way of doing this
and to apply the same solution consistently everywhere.

As I see, there are two possible solutions:

1. modifying the existing command by adding a condition for the
active region;

2. creating a new command with the old key binding:
fill-paragraph-or-region with M-q, ispell-word-or-region with M-$,
indent-for-tab-command-or-region with TAB.  This command decides what
a pair of existing functions to call depending on the active region.

I personally don't have an opinion which one is better.

-- 
Juri Linkov
http://www.jurta.org/emacs/

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

* Re: fill-paragraph-or-region
  2007-10-18 16:04 fill-paragraph-or-region Stefan Monnier
  2007-10-19  0:34 ` fill-paragraph-or-region Juri Linkov
@ 2007-10-19  5:40 ` Richard Stallman
  2007-10-19 13:57   ` fill-paragraph-or-region Stefan Monnier
  2007-10-19 15:23 ` fill-paragraph-or-region David Reitter
  2 siblings, 1 reply; 6+ messages in thread
From: Richard Stallman @ 2007-10-19  5:40 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

    It seems like a bad idea to me: fill-paragraph is already complex enough:
    what's the benefit of conflating the two?

The benefit is to keep `fill-paragraph' as the name of the command
that M-q runs.  That name is better even though it now has the feature
of doing something different for certain interactive calls.

The complexity added to `fill-paragraph' is a handful of lines.
Not significant.

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

* Re: fill-paragraph-or-region
  2007-10-19  5:40 ` fill-paragraph-or-region Richard Stallman
@ 2007-10-19 13:57   ` Stefan Monnier
  0 siblings, 0 replies; 6+ messages in thread
From: Stefan Monnier @ 2007-10-19 13:57 UTC (permalink / raw)
  To: rms; +Cc: emacs-devel

>     It seems like a bad idea to me: fill-paragraph is already complex enough:
>     what's the benefit of conflating the two?

> The benefit is to keep `fill-paragraph' as the name of the command
> that M-q runs.  That name is better even though it now has the feature
> of doing something different for certain interactive calls.

> The complexity added to `fill-paragraph' is a handful of lines.
> Not significant.

OK, actually the consistency with the other commands that obey the region (if
transient-mark-mode is set and the region is active) is a good argument.


        Stefan

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

* Re: fill-paragraph-or-region
  2007-10-18 16:04 fill-paragraph-or-region Stefan Monnier
  2007-10-19  0:34 ` fill-paragraph-or-region Juri Linkov
  2007-10-19  5:40 ` fill-paragraph-or-region Richard Stallman
@ 2007-10-19 15:23 ` David Reitter
  2 siblings, 0 replies; 6+ messages in thread
From: David Reitter @ 2007-10-19 15:23 UTC (permalink / raw)
  To: emacs- devel

On 18 Oct 2007, at 17:04, Stefan Monnier wrote:

> I see that fill-paragraph-or-region was removed, and instead fill- 
> paragraph
> was changed to fill a region if transient-mark-mode is active.

Whatever the internal implementation, this is a good idea from the  
user's perspective. We have had M-q bound to `fill-paragraph-or- 
region' for some time now in Aquamacs precisely because of the  
shortcoming that this change fixes, and I haven't heard any  
complaints from users.

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

* Re: fill-paragraph-or-region
  2007-10-19  0:34 ` fill-paragraph-or-region Juri Linkov
@ 2007-10-19 17:41   ` Richard Stallman
  0 siblings, 0 replies; 6+ messages in thread
From: Richard Stallman @ 2007-10-19 17:41 UTC (permalink / raw)
  To: Juri Linkov; +Cc: monnier, emacs-devel

    As I see, there are two possible solutions:

    1. modifying the existing command by adding a condition for the
    active region;

That is the method I've chosen.  I've decided not to change the
traditional command names, such as fill-paragraph, merely because they
now do something special when called interactively while the region is
active in transient mark mode.

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

end of thread, other threads:[~2007-10-19 17:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-18 16:04 fill-paragraph-or-region Stefan Monnier
2007-10-19  0:34 ` fill-paragraph-or-region Juri Linkov
2007-10-19 17:41   ` fill-paragraph-or-region Richard Stallman
2007-10-19  5:40 ` fill-paragraph-or-region Richard Stallman
2007-10-19 13:57   ` fill-paragraph-or-region Stefan Monnier
2007-10-19 15:23 ` fill-paragraph-or-region David Reitter

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).