unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* M-=
@ 2012-07-24  7:57 Ulrich Mueller
  2012-07-24  9:37 ` M-= Tassilo Horn
  2012-07-27  4:05 ` M-= Chong Yidong
  0 siblings, 2 replies; 14+ messages in thread
From: Ulrich Mueller @ 2012-07-24  7:57 UTC (permalink / raw)
  To: emacs-devel

I've noticed that M-= is no longer operating on the region but on the
whole buffer (i.e. it is bound to count-words instead of
count-words-region).

The old behaviour was established for decades and I found it much more
useful. Can we please have it back?

Ulrich



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

* Re: M-=
@ 2012-07-24  9:03 Dmitry Gutov
  2012-07-24  9:24 ` M-= Ulrich Mueller
  0 siblings, 1 reply; 14+ messages in thread
From: Dmitry Gutov @ 2012-07-24  9:03 UTC (permalink / raw)
  To: ulm; +Cc: emacs-devel

Ulrich Mueller <ulm@gentoo.org> writes:

 > I've noticed that M-= is no longer operating on the region but on the
 > whole buffer (i.e. it is bound to count-words instead of
 > count-words-region).

Are you sure `count-words' doesn't do what you want? If the region is
active, it uses the region, otherwise, the whole buffer.

--Dmitry



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

* Re: M-=
  2012-07-24  9:03 M-= Dmitry Gutov
@ 2012-07-24  9:24 ` Ulrich Mueller
  0 siblings, 0 replies; 14+ messages in thread
From: Ulrich Mueller @ 2012-07-24  9:24 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: emacs-devel

>>>>> On Tue, 24 Jul 2012, Dmitry Gutov wrote:

>> I've noticed that M-= is no longer operating on the region but on
>> the whole buffer (i.e. it is bound to count-words instead of
>> count-words-region).

> Are you sure `count-words' doesn't do what you want? If the region
> is active, it uses the region, otherwise, the whole buffer.

M-= used to operate on the region, regardless if the region is active
or not. Now it can only be used in that way if transient-mark-mode is
(permanently or temporarily) enabled.

Ulrich



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

* Re: M-=
  2012-07-24  7:57 M-= Ulrich Mueller
@ 2012-07-24  9:37 ` Tassilo Horn
  2012-07-24 10:13   ` M-= Ulrich Mueller
  2012-07-27  4:05 ` M-= Chong Yidong
  1 sibling, 1 reply; 14+ messages in thread
From: Tassilo Horn @ 2012-07-24  9:37 UTC (permalink / raw)
  To: Ulrich Mueller; +Cc: emacs-devel

Ulrich Mueller <ulm@gentoo.org> writes:

> I've noticed that M-= is no longer operating on the region but on the
> whole buffer (i.e. it is bound to count-words instead of
> count-words-region).
>
> The old behaviour was established for decades and I found it much more
> useful. Can we please have it back?

It still acts on active regions.  Do you have transient-mark-mode
disabled explicitly?

Bye,
Tassilo



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

* Re: M-=
  2012-07-24  9:37 ` M-= Tassilo Horn
@ 2012-07-24 10:13   ` Ulrich Mueller
  2012-07-24 10:28     ` M-= Tassilo Horn
  0 siblings, 1 reply; 14+ messages in thread
From: Ulrich Mueller @ 2012-07-24 10:13 UTC (permalink / raw)
  To: Tassilo Horn; +Cc: emacs-devel

>>>>> On Tue, 24 Jul 2012, Tassilo Horn wrote:

>> I've noticed that M-= is no longer operating on the region but on
>> the whole buffer (i.e. it is bound to count-words instead of
>> count-words-region).
>> 
>> The old behaviour was established for decades and I found it much
>> more useful. Can we please have it back?

> It still acts on active regions.  Do you have transient-mark-mode
> disabled explicitly?

I do. Is this no longer a supported configuration?

Ulrich



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

* Re: M-=
  2012-07-24 10:13   ` M-= Ulrich Mueller
@ 2012-07-24 10:28     ` Tassilo Horn
  0 siblings, 0 replies; 14+ messages in thread
From: Tassilo Horn @ 2012-07-24 10:28 UTC (permalink / raw)
  To: Ulrich Mueller; +Cc: emacs-devel

Ulrich Mueller <ulm@gentoo.org> writes:

>>> I've noticed that M-= is no longer operating on the region but on
>>> the whole buffer (i.e. it is bound to count-words instead of
>>> count-words-region).
>>> 
>>> The old behaviour was established for decades and I found it much
>>> more useful. Can we please have it back?
>
>> It still acts on active regions.  Do you have transient-mark-mode
>> disabled explicitly?
>
> I do. Is this no longer a supported configuration?

I wouldn't go that far, but there are some commands that act differently
depending on the "activeness" of a region.  Other examples are `undo'
and `ispell' which undo/spell-check selectively in active regions
defaulting to the complete buffer if there's none.

Bye,
Tassilo



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

* Re: M-=
  2012-07-24  7:57 M-= Ulrich Mueller
  2012-07-24  9:37 ` M-= Tassilo Horn
@ 2012-07-27  4:05 ` Chong Yidong
  2012-07-27 10:59   ` M-= Ulrich Mueller
  2012-07-27 17:30   ` M-= James Cloos
  1 sibling, 2 replies; 14+ messages in thread
From: Chong Yidong @ 2012-07-27  4:05 UTC (permalink / raw)
  To: Ulrich Mueller; +Cc: emacs-devel

Ulrich Mueller <ulm@gentoo.org> writes:

> I've noticed that M-= is no longer operating on the region but on the
> whole buffer (i.e. it is bound to count-words instead of
> count-words-region).
>
> The old behaviour was established for decades and I found it much more
> useful. Can we please have it back?

I made the change because it seemed like a fairly straightforward
improvement, but if the old behavior is generally preferred or the
change is found to be too disruptive, we can certainly revert it.

The rule of thumb is that when transient mark mode is enabled, commands
that are bound to convenient keys ought to act on the region if it is
active, and some other convenient unit of text otherwise.  Examples of
this behavior are M-; and M-$.  There are exceptions: C-w and M-w always
act on the region, because yanking the whole buffer is a relatively rare
operation, and has annoying results if you accidentally trigger it.

Counting words seems like it should fall in the former category
(together with M-; and M-$) rather than the latter (with C-w and M-w).
But maybe you can explain otherwise?

Another possibility is to keep M-= for count-words-region and assign
another convenient key to count-words.  The obvious candidate is C-=,
but unfortunately it is not typable on text terminals.



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

* Re: M-=
  2012-07-27  4:05 ` M-= Chong Yidong
@ 2012-07-27 10:59   ` Ulrich Mueller
  2012-07-27 14:57     ` M-= Tassilo Horn
  2012-07-29  3:33     ` M-= Chong Yidong
  2012-07-27 17:30   ` M-= James Cloos
  1 sibling, 2 replies; 14+ messages in thread
From: Ulrich Mueller @ 2012-07-27 10:59 UTC (permalink / raw)
  To: Chong Yidong; +Cc: emacs-devel

>>>>> On Fri, 27 Jul 2012, Chong Yidong wrote:

> Ulrich Mueller <ulm@gentoo.org> writes:
>> I've noticed that M-= is no longer operating on the region but on the
>> whole buffer (i.e. it is bound to count-words instead of
>> count-words-region).
>> 
>> The old behaviour was established for decades and I found it much more
>> useful. Can we please have it back?

> I made the change because it seemed like a fairly straightforward
> improvement, but if the old behavior is generally preferred or the
> change is found to be too disruptive, we can certainly revert it.

> The rule of thumb is that when transient mark mode is enabled, commands
> that are bound to convenient keys ought to act on the region if it is
> active, and some other convenient unit of text otherwise.  Examples of
> this behavior are M-; and M-$.  There are exceptions: C-w and M-w always
> act on the region, because yanking the whole buffer is a relatively rare
> operation, and has annoying results if you accidentally trigger it.

C-x C-u is another example that unconditionally acts on the region.
(Please don't change this!)

> Counting words seems like it should fall in the former category
> (together with M-; and M-$) rather than the latter (with C-w and M-w).
> But maybe you can explain otherwise?

I certainly use M-= on the region much more often than on the whole
buffer. With transient-mark-mode switched off, I now find it rather
painful. Especially combinations like M-h M-= (i.e., mark-paragraph
followed by count-words-region) no longer work.

Also M-= was bound to count-lines-region (or later count-words-region)
since Emacs 18 at least. OTOH, during all that time there wasn't any
key that did this operation for the whole buffer. From that I conclude
that it wasn't missed, otherwise a key binding would have been added.

> Another possibility is to keep M-= for count-words-region and assign
> another convenient key to count-words.  The obvious candidate is C-=,
> but unfortunately it is not typable on text terminals.

I wouldn't mind that. But how about M-+ ?

Ulrich



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

* Re: M-=
  2012-07-27 10:59   ` M-= Ulrich Mueller
@ 2012-07-27 14:57     ` Tassilo Horn
  2012-07-27 16:24       ` M-= Ulrich Mueller
  2012-07-29  3:33     ` M-= Chong Yidong
  1 sibling, 1 reply; 14+ messages in thread
From: Tassilo Horn @ 2012-07-27 14:57 UTC (permalink / raw)
  To: Ulrich Mueller; +Cc: Chong Yidong, emacs-devel

Ulrich Mueller <ulm@gentoo.org> writes:

> I certainly use M-= on the region much more often than on the whole
> buffer. With transient-mark-mode switched off, I now find it rather
> painful. Especially combinations like M-h M-= (i.e., mark-paragraph
> followed by count-words-region) no longer work.

You could do C-SPC C-SPC M-h M-= to enable ttm just for that command.

In general, I really like that some commands act differently (very
conveniently IMHO) in transient-mark-mode.  So I'd rather prefer not to
change good keys to less capable commands.

Just my 2 cents,
Tassilo



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

* Re: M-=
  2012-07-27 14:57     ` M-= Tassilo Horn
@ 2012-07-27 16:24       ` Ulrich Mueller
  2012-07-27 17:32         ` M-= Tassilo Horn
  0 siblings, 1 reply; 14+ messages in thread
From: Ulrich Mueller @ 2012-07-27 16:24 UTC (permalink / raw)
  To: Tassilo Horn; +Cc: Chong Yidong, emacs-devel

>>>>> On Fri, 27 Jul 2012, Tassilo Horn wrote:

>> I certainly use M-= on the region much more often than on the whole
>> buffer. With transient-mark-mode switched off, I now find it rather
>> painful. Especially combinations like M-h M-= (i.e., mark-paragraph
>> followed by count-words-region) no longer work.

> You could do C-SPC C-SPC M-h M-= to enable ttm just for that command.

That doesn't work: M-h marks the whole paragraph, whereas C-SPC C-SPC
M-h only marks from point to end of paragraph.

Ulrich



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

* Re: M-=
  2012-07-27  4:05 ` M-= Chong Yidong
  2012-07-27 10:59   ` M-= Ulrich Mueller
@ 2012-07-27 17:30   ` James Cloos
  2012-07-27 19:02     ` M-= Andreas Röhler
  1 sibling, 1 reply; 14+ messages in thread
From: James Cloos @ 2012-07-27 17:30 UTC (permalink / raw)
  To: Chong Yidong; +Cc: Ulrich Mueller, emacs-devel

>>>>> "CY" == Chong Yidong <cyd@gnu.org> writes:

CY> Counting words seems like it should fall in the former category
CY> (together with M-; and M-$) rather than the latter (with C-w and M-w).
CY> But maybe you can explain otherwise?

Can we compromize?  A new function which acts like the old M-= when
transient-mark-mode is nil and like the new if t-m-m is t or lambda?

Perhaps by way of a generalized function which embodies that test, in
case there are other key commands which similarly could be improved.

-JimC
-- 
James Cloos <cloos@jhcloos.com>         OpenPGP: 1024D/ED7DAEA6



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

* Re: M-=
  2012-07-27 16:24       ` M-= Ulrich Mueller
@ 2012-07-27 17:32         ` Tassilo Horn
  0 siblings, 0 replies; 14+ messages in thread
From: Tassilo Horn @ 2012-07-27 17:32 UTC (permalink / raw)
  To: Ulrich Mueller; +Cc: Chong Yidong, emacs-devel

Ulrich Mueller <ulm@gentoo.org> writes:

>>> I certainly use M-= on the region much more often than on the whole
>>> buffer. With transient-mark-mode switched off, I now find it rather
>>> painful. Especially combinations like M-h M-= (i.e., mark-paragraph
>>> followed by count-words-region) no longer work.
>
>> You could do C-SPC C-SPC M-h M-= to enable ttm just for that command.
>
> That doesn't work: M-h marks the whole paragraph, whereas C-SPC C-SPC
> M-h only marks from point to end of paragraph.

Indeed, I tested that while point was at the beginning of a paragraph,
so that didn't make a difference.  But this works:

  M-h C-u C-x C-x M-=

Ok, probably not /that/ convenient, but how often do you check the
wordcount of a paragraph?

Bye,
Tassilo



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

* Re: M-=
  2012-07-27 17:30   ` M-= James Cloos
@ 2012-07-27 19:02     ` Andreas Röhler
  0 siblings, 0 replies; 14+ messages in thread
From: Andreas Röhler @ 2012-07-27 19:02 UTC (permalink / raw)
  To: emacs-devel

Am 27.07.2012 19:30, schrieb James Cloos:
>>>>>> "CY" == Chong Yidong <cyd@gnu.org> writes:
>
> CY> Counting words seems like it should fall in the former category
> CY> (together with M-; and M-$) rather than the latter (with C-w and M-w).
> CY> But maybe you can explain otherwise?
>
> Can we compromize?  A new function which acts like the old M-= when
> transient-mark-mode is nil and like the new if t-m-m is t or lambda?
>
> Perhaps by way of a generalized function which embodies that test, in
> case there are other key commands which similarly could be improved.
>
> -JimC
>

what about making that customizable - active-region-requires-t-m-m

Cheers,

Andreas




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

* Re: M-=
  2012-07-27 10:59   ` M-= Ulrich Mueller
  2012-07-27 14:57     ` M-= Tassilo Horn
@ 2012-07-29  3:33     ` Chong Yidong
  1 sibling, 0 replies; 14+ messages in thread
From: Chong Yidong @ 2012-07-29  3:33 UTC (permalink / raw)
  To: Ulrich Mueller; +Cc: emacs-devel

Ulrich Mueller <ulm@gentoo.org> writes:

> C-x C-u is another example that unconditionally acts on the region.
> (Please don't change this!)

Yes, upcase-region obviously falls in the category of commands which
would give annoying results if accidentally triggered on the whole
buffer.  Counting words, on the other hand, doesn't.

> Also M-= was bound to count-lines-region (or later count-words-region)
> since Emacs 18 at least. OTOH, during all that time there wasn't any
> key that did this operation for the whole buffer. From that I conclude
> that it wasn't missed, otherwise a key binding would have been added.

If I'm not mistaken, counting words in the buffer was one of the more
commonly-requested commands on gnu.emacs.help.

But your argument that the change might be disruptive, because of how
long M-= has been around, is a fair one.

>> Another possibility is to keep M-= for count-words-region and assign
>> another convenient key to count-words.  The obvious candidate is C-=,
>> but unfortunately it is not typable on text terminals.
>
> I wouldn't mind that. But how about M-+ ?

How about making C-u M-= (count-words-region with a prefix argument)
call count-words on the whole buffer?

This is a bit messy; as I said, it breaks consistency with the way other
commands handle active regions.  But I guess it is better to not switch
things around on users, if there are indeed people who frequently use
M-=.



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

end of thread, other threads:[~2012-07-29  3:33 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-24  7:57 M-= Ulrich Mueller
2012-07-24  9:37 ` M-= Tassilo Horn
2012-07-24 10:13   ` M-= Ulrich Mueller
2012-07-24 10:28     ` M-= Tassilo Horn
2012-07-27  4:05 ` M-= Chong Yidong
2012-07-27 10:59   ` M-= Ulrich Mueller
2012-07-27 14:57     ` M-= Tassilo Horn
2012-07-27 16:24       ` M-= Ulrich Mueller
2012-07-27 17:32         ` M-= Tassilo Horn
2012-07-29  3:33     ` M-= Chong Yidong
2012-07-27 17:30   ` M-= James Cloos
2012-07-27 19:02     ` M-= Andreas Röhler
  -- strict thread matches above, loose matches on Subject: below --
2012-07-24  9:03 M-= Dmitry Gutov
2012-07-24  9:24 ` M-= Ulrich Mueller

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