unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* ispell-region with M-$ in transient-mark-mode
@ 2005-01-18 10:48 Juri Linkov
  2005-01-18 11:42 ` David Kastrup
  2005-01-18 19:40 ` Eli Zaretskii
  0 siblings, 2 replies; 31+ messages in thread
From: Juri Linkov @ 2005-01-18 10:48 UTC (permalink / raw)
  Cc: k.stevens, ispell-el-bugs

When a region is active in Transient Mark mode, typing M-$
unexpectedly checks only one word, and quits.  What is more natural
to do in such case is to call `ispell-region' on a selected region.

This change also makes it more convenient to check a region with
a single key `M-$' than with typing `M-x ispell-region'.

Index: lisp/textmodes/ispell.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/textmodes/ispell.el,v
retrieving revision 1.152
diff -u -r1.152 ispell.el
--- lisp/textmodes/ispell.el	13 Jan 2005 04:33:05 -0000	1.152
+++ lisp/textmodes/ispell.el	18 Jan 2005 10:27:17 -0000
@@ -1454,6 +1464,9 @@
   (interactive (list ispell-following-word ispell-quietly current-prefix-arg))
   (if continue
       (ispell-continue)
+    (if (and (boundp 'transient-mark-mode) transient-mark-mode
+	     (boundp 'mark-active) mark-active)
+	(ispell-region (region-beginning) (region-end))
     (ispell-accept-buffer-local-defs)	; use the correct dictionary
     (let ((cursor-location (point))	; retain cursor location
 	  (word (ispell-get-word following))
@@ -1538,7 +1551,7 @@
 	;; NB: Cancels ispell-quit incorrectly if called from ispell-region
 	(if ispell-quit (setq ispell-quit nil replace 'quit))))
       (goto-char cursor-location)	; return to original location
-      replace)))
+      replace))))

Another idea is to call ispell-word on each word with the `w' syntax
in the region, but this may have problems as was pointed out in
the recent discussion.

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

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

* Re: ispell-region with M-$ in transient-mark-mode
  2005-01-18 10:48 ispell-region with M-$ in transient-mark-mode Juri Linkov
@ 2005-01-18 11:42 ` David Kastrup
  2005-01-19  0:28   ` Juri Linkov
  2005-01-18 19:40 ` Eli Zaretskii
  1 sibling, 1 reply; 31+ messages in thread
From: David Kastrup @ 2005-01-18 11:42 UTC (permalink / raw)
  Cc: k.stevens, ispell-el-bugs, emacs-devel

Juri Linkov <juri@jurta.org> writes:

> +    (if (and (boundp 'transient-mark-mode) transient-mark-mode
> +	     (boundp 'mark-active) mark-active)
> +	(ispell-region (region-beginning) (region-end))

Just as a matter of taste: leave off the boundp tests.  They are
presumably for not making this code fail under XEmacs.  But that also
means that the change is not apparent to XEmacs developers when they
try using this code.  If they instead an error, they at least know
what to look for.  Or they can make the call whether they prefer to
complicate the code, or rather solve this with compatibility packages.

The alternative is to implement this _completely_.  Namely do
something like

(if (if (featurep 'xemacs)
        (and zmacs-regions (mark))
       (and transient-mark-mode mark-active))
  (ispell-region ...

But a half-baked implementation will complicate matters for our code
as well as not simplifying things for the XEmacs developers.  If you
don't have an XEmacs yourself for checking code like this, I'd tend to
suggest leaving out any compatibility stuff.  In contrast, it is ok to
check stuff like that in when suggested by XEmacs developers (and when
we have assignments for them in case they are necessary), because then
they have at least a good chance of having been tested and working.
But it is probably not worth the trouble if the results are
inconsistent: namely if some places in the file cater for XEmacs, and
some don't.  That is likely to mask trouble.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

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

* Re: ispell-region with M-$ in transient-mark-mode
  2005-01-18 10:48 ispell-region with M-$ in transient-mark-mode Juri Linkov
  2005-01-18 11:42 ` David Kastrup
@ 2005-01-18 19:40 ` Eli Zaretskii
  2005-01-19  0:33   ` Juri Linkov
  2005-01-20  2:14   ` Richard Stallman
  1 sibling, 2 replies; 31+ messages in thread
From: Eli Zaretskii @ 2005-01-18 19:40 UTC (permalink / raw)
  Cc: k.stevens, ispell-el-bugs, emacs-devel

> From: Juri Linkov <juri@jurta.org>
> Date: Tue, 18 Jan 2005 12:48:09 +0200
> Cc: k.stevens@ieee.org, ispell-el-bugs@itcorp.com
> 
> When a region is active in Transient Mark mode, typing M-$
> unexpectedly checks only one word, and quits.  What is more natural
> to do in such case is to call `ispell-region' on a selected region.

I don't like such a reinterpretation of a word-related command: it's
counterintuitive.  It is okay to do that with commands that by default
work on the whole buffer, but not with commands that work on a word.

Do we even have other *-word commands that modify their behavior in
such a way?

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

* Re: ispell-region with M-$ in transient-mark-mode
  2005-01-18 11:42 ` David Kastrup
@ 2005-01-19  0:28   ` Juri Linkov
  0 siblings, 0 replies; 31+ messages in thread
From: Juri Linkov @ 2005-01-19  0:28 UTC (permalink / raw)
  Cc: k.stevens, ispell-el-bugs, emacs-devel

David Kastrup <dak@gnu.org> writes:
> Juri Linkov <juri@jurta.org> writes:
>
>> +    (if (and (boundp 'transient-mark-mode) transient-mark-mode
>> +	     (boundp 'mark-active) mark-active)
>> +	(ispell-region (region-beginning) (region-end))
>
> Just as a matter of taste: leave off the boundp tests.  They are
> presumably for not making this code fail under XEmacs.  But that also
> means that the change is not apparent to XEmacs developers when they
> try using this code.  If they instead an error, they at least know
> what to look for.  Or they can make the call whether they prefer to
> complicate the code, or rather solve this with compatibility packages.

I copied this code from the `ispell' command where it has all those
boundp tests:

(defun ispell ()
  "Interactively check a region or buffer for spelling errors.
If `transient-mark-mode' is on, and a region is active, spell-check
that region.  Otherwise spell-check the buffer..."
  (interactive)
  (if (and (boundp 'transient-mark-mode) transient-mark-mode
	   (boundp 'mark-active) mark-active)
      (ispell-region (region-beginning) (region-end))
    (ispell-buffer)))

This code was added by the maintainer of ispell.el so I assume that
it's already guaranteed to work under XEmacs as well as all older Emacs
versions.

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

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

* Re: ispell-region with M-$ in transient-mark-mode
  2005-01-18 19:40 ` Eli Zaretskii
@ 2005-01-19  0:33   ` Juri Linkov
  2005-01-19  4:46     ` Eli Zaretskii
  2005-01-20  2:14   ` Richard Stallman
  1 sibling, 1 reply; 31+ messages in thread
From: Juri Linkov @ 2005-01-19  0:33 UTC (permalink / raw)
  Cc: k.stevens, ispell-el-bugs, emacs-devel

"Eli Zaretskii" <eliz@gnu.org> writes:
>> From: Juri Linkov <juri@jurta.org>
>> When a region is active in Transient Mark mode, typing M-$
>> unexpectedly checks only one word, and quits.  What is more natural
>> to do in such case is to call `ispell-region' on a selected region.
>
> I don't like such a reinterpretation of a word-related command: it's
> counterintuitive.  It is okay to do that with commands that by default
> work on the whole buffer, but not with commands that work on a word.

It's very intuitive to work on the active region when the user has
explicitly selected it in Transient Mark mode.

I suggested to add this to `ispell-word' because M-$ is only one
keybinding available to active ispell.  So typing M-$ is more
convenient than to execute the command `ispell' which also takes care
about calling `ispell-region' instead of `ispell-buffer' when the
region is active in Transient Mark mode.

Another counterargument for adding this to `ispell-word' is that
`ispell-word' already has other non-word semantics: with a prefix
argument it resumes interrupted spell-checking of a buffer or region.
I guess the reason for adding this non-word functionality to `ispell-word'
was to make M-$ to do more useful things.

> Do we even have other *-word commands that modify their behavior in
> such a way?

`C-h a -word$' displays not too many word-related commands.
Among them there are few that change the word under point:

upcase-word		      M-u
downcase-word		      M-l
kill-word		      M-d

But there is no need to modify their behavior for active regions
in Transient Mark mode because there already exist keybindings to
their corresponding region commands:

upcase-region		      C-x C-u
downcase-region		      C-x C-l
kill-region		      C-w

There is one word-related command that has no keybinding for its
region equivalent:

capitalize-word		      M-c

but perhaps there is no need to modify it because this is very rarely
used command.

>From all other commands I also have encountered three commands that
operate on non-word parts of the buffer and have no keybindings for
their region equivalents.  These commands are `fill-paragraph' (`M-q'),
`eval-last-sexp' (`C-x C-e') and `eval-defun' (`C-M-x').  I suggest to
modify them to call `fill-region' and `eval-region' when a region is
active in Transient Mark mode.

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

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

* Re: ispell-region with M-$ in transient-mark-mode
  2005-01-19  0:33   ` Juri Linkov
@ 2005-01-19  4:46     ` Eli Zaretskii
  2005-01-19  7:46       ` Juri Linkov
  0 siblings, 1 reply; 31+ messages in thread
From: Eli Zaretskii @ 2005-01-19  4:46 UTC (permalink / raw)
  Cc: k.stevens, ispell-el-bugs, emacs-devel

> Cc: emacs-devel@gnu.org, k.stevens@ieee.org,
> 	ispell-el-bugs@itcorp.com
> From: Juri Linkov <juri@jurta.org>
> Date: Wed, 19 Jan 2005 02:33:19 +0200
> 
> > I don't like such a reinterpretation of a word-related command: it's
> > counterintuitive.  It is okay to do that with commands that by default
> > work on the whole buffer, but not with commands that work on a word.
> 
> It's very intuitive to work on the active region when the user has
> explicitly selected it in Transient Mark mode.

Yes.  But word commands are IMHO not the ones that should be sensitive
to active region.

> I suggested to add this to `ispell-word' because M-$ is only one
> keybinding available to active ispell.

If that's the main reason, let's have a key binding for ispell-region.
(Of course, you can always bind it yourself if this is so important
for you.)

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

* Re: ispell-region with M-$ in transient-mark-mode
  2005-01-19  4:46     ` Eli Zaretskii
@ 2005-01-19  7:46       ` Juri Linkov
  2005-01-19  9:06         ` Kim F. Storm
  2005-01-19 17:58         ` Eli Zaretskii
  0 siblings, 2 replies; 31+ messages in thread
From: Juri Linkov @ 2005-01-19  7:46 UTC (permalink / raw)
  Cc: k.stevens, ispell-el-bugs, emacs-devel

"Eli Zaretskii" <eliz@gnu.org> writes:
>> From: Juri Linkov <juri@jurta.org>
>> It's very intuitive to work on the active region when the user has
>> explicitly selected it in Transient Mark mode.
>
> Yes.  But word commands are IMHO not the ones that should be sensitive
> to active region.

Word commands executed on active regions can be interpreted as
commands that should operate on every word in the region.

>> I suggested to add this to `ispell-word' because M-$ is only one
>> keybinding available to active ispell.
>
> If that's the main reason, let's have a key binding for ispell-region.
> (Of course, you can always bind it yourself if this is so important
> for you.)

I have plenty of personal key bindings in my .emacs.  What I want is
to make default key bindings useful for most Emacs users.

Adding a new key binding for ispell-region is not a bad solution.
Perhaps most natural is `C-x M-$' by analogy with `M-u' - `C-x C-u',
and `M-l' - `C-x C-l'.  And also `fill-region' could be bound to
`C-x M-q', and `eval-region' to `C-x C-M-x'.

I also have a better idea for ispell-region.  Currently `C-u M-$'
resumes spell-checking interrupted by the `X' command.  When there is
no interrupted ispell session then `C-u M-$' just displays the message:

    No session to continue.  Use 'X' command when checking!

Instead of this, I propose to call the command `ispell' which already
checks a region or a buffer depending on the values of `transient-mark-mode'
and `mark-active'.

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

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

* Re: ispell-region with M-$ in transient-mark-mode
  2005-01-19  7:46       ` Juri Linkov
@ 2005-01-19  9:06         ` Kim F. Storm
  2005-01-19 18:02           ` Eli Zaretskii
  2005-01-19 21:30           ` Luc Teirlinck
  2005-01-19 17:58         ` Eli Zaretskii
  1 sibling, 2 replies; 31+ messages in thread
From: Kim F. Storm @ 2005-01-19  9:06 UTC (permalink / raw)
  Cc: Eli Zaretskii, k.stevens, ispell-el-bugs, emacs-devel

Juri Linkov <juri@jurta.org> writes:

> "Eli Zaretskii" <eliz@gnu.org> writes:
>>> From: Juri Linkov <juri@jurta.org>
>>> It's very intuitive to work on the active region when the user has
>>> explicitly selected it in Transient Mark mode.
>>
>> Yes.  But word commands are IMHO not the ones that should be sensitive
>> to active region.
>
> Word commands executed on active regions can be interpreted as
> commands that should operate on every word in the region.

This definitely sounds logical to me!  At least with transient-mark-mode.

Also consider this example:

Put cursor on "definitely" above and type M-u -- whole word is upcased.

Instead, put mark at "d" and move cursor to "t", now do M-u.  

What would you expect?  That only DEFINI is upcased or the whole word ?
(Currently it upcases the whole word).

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

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

* Re: ispell-region with M-$ in transient-mark-mode
  2005-01-19  7:46       ` Juri Linkov
  2005-01-19  9:06         ` Kim F. Storm
@ 2005-01-19 17:58         ` Eli Zaretskii
  2005-01-20  0:40           ` Luc Teirlinck
  2005-01-20 21:32           ` Richard Stallman
  1 sibling, 2 replies; 31+ messages in thread
From: Eli Zaretskii @ 2005-01-19 17:58 UTC (permalink / raw)
  Cc: k.stevens, ispell-el-bugs, emacs-devel

> Cc: emacs-devel@gnu.org, k.stevens@ieee.org,
> 	ispell-el-bugs@itcorp.com
> From: Juri Linkov <juri@jurta.org>
> Date: Wed, 19 Jan 2005 09:46:48 +0200
> 
> Word commands executed on active regions can be interpreted as
> commands that should operate on every word in the region.

I won't expect that, and I think Emacs doesn't have this convention
anywhere else.

> I also have a better idea for ispell-region.  Currently `C-u M-$'
> resumes spell-checking interrupted by the `X' command.  When there is
> no interrupted ispell session then `C-u M-$' just displays the message:
> 
>     No session to continue.  Use 'X' command when checking!
> 
> Instead of this, I propose to call the command `ispell' which already
> checks a region or a buffer depending on the values of `transient-mark-mode'
> and `mark-active'.

IMHO this is a good idea.  In general, if we can do something useful
and sufficiently intuitive instead of throwing an error, we should.

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

* Re: ispell-region with M-$ in transient-mark-mode
  2005-01-19  9:06         ` Kim F. Storm
@ 2005-01-19 18:02           ` Eli Zaretskii
  2005-01-19 21:30           ` Luc Teirlinck
  1 sibling, 0 replies; 31+ messages in thread
From: Eli Zaretskii @ 2005-01-19 18:02 UTC (permalink / raw)
  Cc: juri, k.stevens, ispell-el-bugs, emacs-devel

> Cc: Eli Zaretskii <eliz@gnu.org>,  k.stevens@ieee.org,
> 	  ispell-el-bugs@itcorp.com,  emacs-devel@gnu.org
> From: storm@cua.dk (Kim F. Storm)
> Date: Wed, 19 Jan 2005 10:06:28 +0100
> 
> Put cursor on "definitely" above and type M-u -- whole word is upcased.
> 
> Instead, put mark at "d" and move cursor to "t", now do M-u.  
> 
> What would you expect?

I don't expect word-commands to change under an active region.

> (Currently it upcases the whole word).

That's what I'd expect.  But that's just me; perhaps others should
speak up their expectations.

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

* Re: ispell-region with M-$ in transient-mark-mode
  2005-01-19  9:06         ` Kim F. Storm
  2005-01-19 18:02           ` Eli Zaretskii
@ 2005-01-19 21:30           ` Luc Teirlinck
  2005-01-19 22:03             ` Kim F. Storm
  1 sibling, 1 reply; 31+ messages in thread
From: Luc Teirlinck @ 2005-01-19 21:30 UTC (permalink / raw)
  Cc: juri, eliz, k.stevens, ispell-el-bugs, emacs-devel

Kim Storm wrote:
   
   Also consider this example:

   Put cursor on "definitely" above and type M-u -- whole word is upcased.

   Instead, put mark at "d" and move cursor to "t", now do M-u.  

   What would you expect?  That only DEFINI is upcased or the whole word ?
   (Currently it upcases the whole word).

I would expect the result "definiTELY" and that is what actually
happens for me in `emacs -q' with transient mark mode enabled.  I do
not understand why for you the entire word gets upcased (which is
indeed very unexpected).  With a positive argument M-u is only
supposed to upcase _forward_.  Did you try this with `emacs -q'
(with transient-mark-mode enabled)?  DEFINItely would be even more
unexpected, with positive argument.  To get that do `M-- M-u'.

Sincerely,

Luc.

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

* Re: ispell-region with M-$ in transient-mark-mode
  2005-01-19 21:30           ` Luc Teirlinck
@ 2005-01-19 22:03             ` Kim F. Storm
  2005-01-20  0:19               ` Luc Teirlinck
  0 siblings, 1 reply; 31+ messages in thread
From: Kim F. Storm @ 2005-01-19 22:03 UTC (permalink / raw)
  Cc: juri, eliz, k.stevens, ispell-el-bugs, emacs-devel

Luc Teirlinck <teirllm@dms.auburn.edu> writes:

> Kim Storm wrote:
>    
>    Also consider this example:
>
>    Put cursor on "definitely" above and type M-u -- whole word is upcased.
>
>    Instead, put mark at "d" and move cursor to "t", now do M-u.  
>
>    What would you expect?  That only DEFINI is upcased or the whole word ?
>    (Currently it upcases the whole word).
>
> I would expect the result "definiTELY" and that is what actually
> happens for me in `emacs -q' with transient mark mode enabled.  I do
> not understand why for you the entire word gets upcased (which is
> indeed very unexpected).  

I cannot reproduce that either now -- I get the same result you do.

Most likely I marked the region from "t" to "d" so the cursor
was on "d" rather than "t" when I hit M-u.  Still, with transient
mark mode, I'm sure I would like M-u to DTRT which is -- upcase the 
region whether the cursor is on "d" or "t".

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

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

* Re: ispell-region with M-$ in transient-mark-mode
  2005-01-19 22:03             ` Kim F. Storm
@ 2005-01-20  0:19               ` Luc Teirlinck
  2005-01-20  8:18                 ` Kim F. Storm
  0 siblings, 1 reply; 31+ messages in thread
From: Luc Teirlinck @ 2005-01-20  0:19 UTC (permalink / raw)
  Cc: juri, eliz, k.stevens, ispell-el-bugs, emacs-devel

Kim Storm wrote:

  Still, with transient mark mode, I'm sure I would like M-u to DTRT
   which is -- upcase the region whether the cursor is on "d" or "t".

That would seem very counterintuitive (to me).  I am used to think of
M-{u,l,c} as closely related to M-f.  _If anything_, I might
intuitively expect them to keep the region active with transient mark
mode enabled, like M-f does.  That would probably be wrong however
(even though occasionally convenient), because M-{u,l,c} usually
change the buffer.

What is wrong with `C-x C-u'?  The region case commands are not used
that often that two keystrokes is too much.

Sincerely,

Luc.

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

* Re: ispell-region with M-$ in transient-mark-mode
  2005-01-19 17:58         ` Eli Zaretskii
@ 2005-01-20  0:40           ` Luc Teirlinck
  2005-01-20 21:32           ` Richard Stallman
  1 sibling, 0 replies; 31+ messages in thread
From: Luc Teirlinck @ 2005-01-20  0:40 UTC (permalink / raw)
  Cc: juri, k.stevens, ispell-el-bugs, emacs-devel

Eli Zaretskii wrote (in response to Juri Linkov);

   > Word commands executed on active regions can be interpreted as
   > commands that should operate on every word in the region.

   I won't expect that, and I think Emacs doesn't have this convention
   anywhere else.

I agree.  Sometimes a numeric argument of 0 is used to indicate
operating on the region, if a zero numeric argument otherwise would
make no sense (like `M-0 C-x a {g,l}').  If we bind C-u M-$ (or M-$
with any numeric argument) to ispell if there is no ispell session to
resume, then there would be very little reason to give a special
meaning to a zero numeric argument to M-$ however, and such a special
meaning could potentially confuse people.  They might then also
believe that M-3 M-$ checked the next three words, M--3 M-$ the
previous three and so on (which we could actually implement, but I
personally do _not_ believe that this would be very useful).

Sincerely,

Luc.

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

* Re: ispell-region with M-$ in transient-mark-mode
  2005-01-18 19:40 ` Eli Zaretskii
  2005-01-19  0:33   ` Juri Linkov
@ 2005-01-20  2:14   ` Richard Stallman
  1 sibling, 0 replies; 31+ messages in thread
From: Richard Stallman @ 2005-01-20  2:14 UTC (permalink / raw)
  Cc: juri, k.stevens, ispell-el-bugs, emacs-devel

    I don't like such a reinterpretation of a word-related command: it's
    counterintuitive.  It is okay to do that with commands that by default
    work on the whole buffer, but not with commands that work on a word.

I agree.

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

* Re: ispell-region with M-$ in transient-mark-mode
  2005-01-20  0:19               ` Luc Teirlinck
@ 2005-01-20  8:18                 ` Kim F. Storm
  2005-01-20  8:45                   ` David Kastrup
  0 siblings, 1 reply; 31+ messages in thread
From: Kim F. Storm @ 2005-01-20  8:18 UTC (permalink / raw)
  Cc: juri, eliz, k.stevens, ispell-el-bugs, emacs-devel

Luc Teirlinck <teirllm@dms.auburn.edu> writes:

> What is wrong with `C-x C-u'?  The region case commands are not used
> that often that two keystrokes is too much.

Because they are not used very often, it is hard to remember two
different bindings for upcase.

M-u in a region would mean "upcase every word in the region".

M-$ in a region would mean "ispell every word in the region".

That is simple and intuitive (IMO), at least with transient-mark-mode.

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

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

* Re: ispell-region with M-$ in transient-mark-mode
  2005-01-20  8:18                 ` Kim F. Storm
@ 2005-01-20  8:45                   ` David Kastrup
  2005-01-20  9:44                     ` Kim F. Storm
  2005-01-21  8:34                     ` Kai Großjohann
  0 siblings, 2 replies; 31+ messages in thread
From: David Kastrup @ 2005-01-20  8:45 UTC (permalink / raw)
  Cc: Luc Teirlinck, k.stevens, ispell-el-bugs, emacs-devel, juri, eliz

storm@cua.dk (Kim F. Storm) writes:

> Luc Teirlinck <teirllm@dms.auburn.edu> writes:
>
>> What is wrong with `C-x C-u'?  The region case commands are not used
>> that often that two keystrokes is too much.
>
> Because they are not used very often, it is hard to remember two
> different bindings for upcase.
>
> M-u in a region would mean "upcase every word in the region".
>
> M-$ in a region would mean "ispell every word in the region".
>
> That is simple and intuitive (IMO), at least with
> transient-mark-mode.

I am not so sure about that.  It is simple and intuitive if you have
_temporary_ transient-mark-mode enabled, possibly by using the mouse.
In this case we have an explicit act that set up the region.  However,
for people that use pc-selection-mode or just transient-mark-mode,
there often is an _unintended_ transient region.  I am not so sure
that it is intuitive in that case if it affects the word commands.

Now I am of the opinion that _permanent_ transient-mark-mode and its
cousins are an abomination in user interface design if I ever saw one.
But they are something we _also_ need to think of when saying
something like "at least with transient-mark-mode".

With _temporary_ transient-mark-mode, I share your opinion.  But not
with the permanent one.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

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

* Re: ispell-region with M-$ in transient-mark-mode
  2005-01-20  8:45                   ` David Kastrup
@ 2005-01-20  9:44                     ` Kim F. Storm
  2005-01-21  8:34                     ` Kai Großjohann
  1 sibling, 0 replies; 31+ messages in thread
From: Kim F. Storm @ 2005-01-20  9:44 UTC (permalink / raw)
  Cc: Luc Teirlinck, k.stevens, ispell-el-bugs, emacs-devel, juri, eliz

David Kastrup <dak@gnu.org> writes:

> storm@cua.dk (Kim F. Storm) writes:
>
>> Luc Teirlinck <teirllm@dms.auburn.edu> writes:
>>
>>> What is wrong with `C-x C-u'?  The region case commands are not used
>>> that often that two keystrokes is too much.
>>
>> Because they are not used very often, it is hard to remember two
>> different bindings for upcase.
>>
>> M-u in a region would mean "upcase every word in the region".
>>
>> M-$ in a region would mean "ispell every word in the region".
>>
>> That is simple and intuitive (IMO), at least with
>> transient-mark-mode.
>
> I am not so sure about that.  It is simple and intuitive if you have
> _temporary_ transient-mark-mode enabled, possibly by using the mouse.
> In this case we have an explicit act that set up the region.  However,
> for people that use pc-selection-mode or just transient-mark-mode,
> there often is an _unintended_ transient region.  I am not so sure
> that it is intuitive in that case if it affects the word commands.
>
> Now I am of the opinion that _permanent_ transient-mark-mode and its
> cousins are an abomination in user interface design if I ever saw one.
> But they are something we _also_ need to think of when saying
> something like "at least with transient-mark-mode".
>
> With _temporary_ transient-mark-mode, I share your opinion.  But not
> with the permanent one.

I use CUA which turns on transient-mark-mode permanently, but I never
have an "unintended" transient region as you say.  

Since I really haven't used transient-mark-mode without CUA for a very
long time, I may very well have an incomplete idea of how "plain
transient-mark-mode" behaves, so you may very well be right that
just letting this depend on transient-mark-mode would be bad.

I guess the CUA way is different from plain transient-mark-mode, as
CUA normally deactivates the mark unless you really want to have the
region highlighted.

So I rephase my opinion to:

 That is simple and intuitive (IMO), at least with CUA mode.

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

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

* Re: ispell-region with M-$ in transient-mark-mode
  2005-01-19 17:58         ` Eli Zaretskii
  2005-01-20  0:40           ` Luc Teirlinck
@ 2005-01-20 21:32           ` Richard Stallman
  2005-01-20 22:00             ` Geoff Kuenning
  2005-01-20 22:36             ` Han Boetes
  1 sibling, 2 replies; 31+ messages in thread
From: Richard Stallman @ 2005-01-20 21:32 UTC (permalink / raw)
  Cc: juri, k.stevens, ispell-el-bugs, emacs-devel

    > Instead of this, I propose to call the command `ispell' which already
    > checks a region or a buffer depending on the values of `transient-mark-mode'
    > and `mark-active'.

    IMHO this is a good idea.  In general, if we can do something useful
    and sufficiently intuitive instead of throwing an error, we should.

I would not object to this change.

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

* Re: ispell-region with M-$ in transient-mark-mode
  2005-01-20 21:32           ` Richard Stallman
@ 2005-01-20 22:00             ` Geoff Kuenning
  2005-01-20 22:17               ` David Kastrup
  2005-01-20 22:43               ` Luc Teirlinck
  2005-01-20 22:36             ` Han Boetes
  1 sibling, 2 replies; 31+ messages in thread
From: Geoff Kuenning @ 2005-01-20 22:00 UTC (permalink / raw)


>> Instead of this, I propose to call the command `ispell' which already
>> checks a region or a buffer depending on the values of `transient-mark-mode'
>> and `mark-active'.
> 
>     IMHO this is a good idea.  In general, if we can do something useful
>     and sufficiently intuitive instead of throwing an error, we should.

How would this work for those of us who don't use transient-mark-mode?
Would it always just check the current region?  I'd find that
acceptable, since I could just do C-x h before I run ispell.  (I
usually do that anyway; it's kind of comical how often I do C-x h and
then use ispell-buffer.)
-- 
    Geoff Kuenning   geoff@cs.hmc.edu   http://www.cs.hmc.edu/~geoff/

The DMCA criminalizes curiosity.  It would put Susie in jail for
taking her stereo apart to see how it works.

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

* Re: ispell-region with M-$ in transient-mark-mode
  2005-01-20 22:00             ` Geoff Kuenning
@ 2005-01-20 22:17               ` David Kastrup
  2005-01-20 22:23                 ` Geoff Kuenning
  2005-01-20 22:43               ` Luc Teirlinck
  1 sibling, 1 reply; 31+ messages in thread
From: David Kastrup @ 2005-01-20 22:17 UTC (permalink / raw)
  Cc: juri, Eli Zaretskii, k.stevens, emacs-devel

Geoff Kuenning <geoff@cs.hmc.edu> writes:

>>> Instead of this, I propose to call the command `ispell' which already
>>> checks a region or a buffer depending on the values of `transient-mark-mode'
>>> and `mark-active'.
>> 
>>     IMHO this is a good idea.  In general, if we can do something useful
>>     and sufficiently intuitive instead of throwing an error, we should.
>
> How would this work for those of us who don't use transient-mark-mode?
> Would it always just check the current region?

No.

> I'd find that acceptable, since I could just do C-x h before I run
> ispell.  (I usually do that anyway; it's kind of comical how often I
> do C-x h and then use ispell-buffer.)

If you want to just check the region, you'd use temporary transient
mark mode: C-u C-x C-x would activate that.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

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

* Re: ispell-region with M-$ in transient-mark-mode
  2005-01-20 22:17               ` David Kastrup
@ 2005-01-20 22:23                 ` Geoff Kuenning
  2005-01-20 23:11                   ` Luc Teirlinck
  0 siblings, 1 reply; 31+ messages in thread
From: Geoff Kuenning @ 2005-01-20 22:23 UTC (permalink / raw)
  Cc: juri, Eli Zaretskii, k.stevens, emacs-devel

> If you want to just check the region, you'd use temporary transient
> mark mode: C-u C-x C-x would activate that.

Yuck!  Then how about keeping the ispell-region and ispell-buffer
functions, but leaving them unbound by default?  Then those of us who
prefer the old UI could bind ispell-region to M-$.
-- 
    Geoff Kuenning   geoff@cs.hmc.edu   http://www.cs.hmc.edu/~geoff/

The most exciting phrase to hear in science, the one that heralds new
discoveries, is not "Eureka!" (I found it!) but "That's funny ..."
                -- Isaac Asimov

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

* Re: ispell-region with M-$ in transient-mark-mode
  2005-01-20 21:32           ` Richard Stallman
  2005-01-20 22:00             ` Geoff Kuenning
@ 2005-01-20 22:36             ` Han Boetes
  2005-01-21 20:10               ` Richard Stallman
  1 sibling, 1 reply; 31+ messages in thread
From: Han Boetes @ 2005-01-20 22:36 UTC (permalink / raw)


Richard Stallman wrote:
>     > Instead of this, I propose to call the command `ispell'
>     > which already checks a region or a buffer depending on the
>     > values of `transient-mark-mode' and `mark-active'.
>
>     IMHO this is a good idea. In general, if we can do something
>     useful and sufficiently intuitive instead of throwing an
>     error, we should.
>
> I would not object to this change.

Would this also apply to commands as downcase-word and upcase-word
for instance?



# Han

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

* Re: ispell-region with M-$ in transient-mark-mode
  2005-01-20 22:00             ` Geoff Kuenning
  2005-01-20 22:17               ` David Kastrup
@ 2005-01-20 22:43               ` Luc Teirlinck
  1 sibling, 0 replies; 31+ messages in thread
From: Luc Teirlinck @ 2005-01-20 22:43 UTC (permalink / raw)
  Cc: juri, eliz, k.stevens, emacs-devel

Geoff Kuenning  wrote:

   >> Instead of this, I propose to call the command `ispell' which already
   >> checks a region or a buffer depending on the values of `transient-mark-mode'
   >> and `mark-active'.
   > 
   >     IMHO this is a good idea.  In general, if we can do something useful
   >     and sufficiently intuitive instead of throwing an error, we should.

   How would this work for those of us who don't use transient-mark-mode?
   Would it always just check the current region?

No, ispell always checks the  entire buffer if transient-merk-mode is off:

  ispell is an interactive autoloaded Lisp function in `ispell'.
  (ispell)

  Interactively check a region or buffer for spelling errors.
  If `transient-mark-mode' is on, and a region is active, spell-check
  that region.  Otherwise spell-check the buffer.

Sincerely,

Luc.

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

* Re: ispell-region with M-$ in transient-mark-mode
  2005-01-20 22:23                 ` Geoff Kuenning
@ 2005-01-20 23:11                   ` Luc Teirlinck
  2005-01-21 16:26                     ` Eli Zaretskii
  0 siblings, 1 reply; 31+ messages in thread
From: Luc Teirlinck @ 2005-01-20 23:11 UTC (permalink / raw)
  Cc: juri, eliz, k.stevens, emacs-devel

Geoff Kuening wrote:

   Yuck!  Then how about keeping the ispell-region and ispell-buffer
   functions, but leaving them unbound by default?

Who is talking about getting rid of them?

   Then those of us who prefer the old UI could bind ispell-region to M-$.

What would prevent you from doing that?

and Han Boetes wrote:

   Would this also apply to commands as downcase-word and upcase-word
   for instance?

As I see it C-u M-u and friends would continue to operate on the next
four words, because C-u stands for a numeric argument of four.

What we are talking about is the following.  (Unless I am totally
misunderstanding things.)

Currently C-u M-$ resumes an ispell session is there is a session to
resume.  Otherwise, it currently throws an error.  The proposal is to
make C-u M-$ call `ispell' if there is no ispell session to resume
(instead of throwing an error).  Nothing would change in any situation
where currently no error is thrown.

Sincerely,

Luc.

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

* Re: ispell-region with M-$ in transient-mark-mode
  2005-01-20  8:45                   ` David Kastrup
  2005-01-20  9:44                     ` Kim F. Storm
@ 2005-01-21  8:34                     ` Kai Großjohann
  1 sibling, 0 replies; 31+ messages in thread
From: Kai Großjohann @ 2005-01-21  8:34 UTC (permalink / raw)


David Kastrup <dak@gnu.org> writes:

> However, for people that use pc-selection-mode or just
> transient-mark-mode, there often is an _unintended_ transient
> region.

When the region is active, it is highlighted.  It is nearly impossible
to overlook that highlighting.

Given that people are aware of the region's activeness, I don't think
they will be surprised by the behavior of the command.

Kai

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

* Re: ispell-region with M-$ in transient-mark-mode
  2005-01-20 23:11                   ` Luc Teirlinck
@ 2005-01-21 16:26                     ` Eli Zaretskii
  2005-01-22  2:53                       ` Richard Stallman
  0 siblings, 1 reply; 31+ messages in thread
From: Eli Zaretskii @ 2005-01-21 16:26 UTC (permalink / raw)
  Cc: juri, geoff, k.stevens, emacs-devel

> Date: Thu, 20 Jan 2005 17:11:51 -0600 (CST)
> From: Luc Teirlinck <teirllm@dms.auburn.edu>
> CC: dak@gnu.org, juri@jurta.org, eliz@gnu.org, k.stevens@ieee.org,
>         emacs-devel@gnu.org
> 
> What we are talking about is the following.  (Unless I am totally
> misunderstanding things.)
> 
> Currently C-u M-$ resumes an ispell session is there is a session to
> resume.  Otherwise, it currently throws an error.  The proposal is to
> make C-u M-$ call `ispell' if there is no ispell session to resume
> (instead of throwing an error).  Nothing would change in any situation
> where currently no error is thrown.

Yes, this is what was being discussed.  And no, it will not change
anything wrt active region or M-$ operation when such a region exists.

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

* Re: ispell-region with M-$ in transient-mark-mode
  2005-01-20 22:36             ` Han Boetes
@ 2005-01-21 20:10               ` Richard Stallman
  2005-01-21 20:44                 ` Han Boetes
  2005-01-21 21:25                 ` Luc Teirlinck
  0 siblings, 2 replies; 31+ messages in thread
From: Richard Stallman @ 2005-01-21 20:10 UTC (permalink / raw)
  Cc: emacs-devel

    >     > Instead of this, I propose to call the command `ispell'
    >     > which already checks a region or a buffer depending on the
    >     > values of `transient-mark-mode' and `mark-active'.

    Would this also apply to commands as downcase-word and upcase-word
    for instance?

No, because those are word commands.  This proposal has nothing
to do with word commands.  Or at least I thought it did not.

On rereading the words, I see that perhaps I misunderstood them the
first time.  I thought it was a proposal to change something about a
command that has to do with buffers and regions.  That's what I said I
would not object to.

Now I am not sure what the intention was.  So I can't say
I am in favor of it.

We should be focusing on making a release, not on changes in
Emacs interface features, so please let's not continue this
discussion.

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

* Re: ispell-region with M-$ in transient-mark-mode
  2005-01-21 20:10               ` Richard Stallman
@ 2005-01-21 20:44                 ` Han Boetes
  2005-01-21 21:25                 ` Luc Teirlinck
  1 sibling, 0 replies; 31+ messages in thread
From: Han Boetes @ 2005-01-21 20:44 UTC (permalink / raw)


Richard Stallman wrote:
> > > Instead of this, I propose to call the command `ispell'
> > > which already checks a region or a buffer depending on the
> > > values of `transient-mark-mode' and `mark-active'.
> >
> > Would this also apply to commands as downcase-word and upcase-
> > word for instance?
>
> No, because those are word commands. This proposal has nothing
> to do with word commands. Or at least I thought it did not.
>
> On rereading the words, I see that perhaps I misunderstood them
> the first time. I thought it was a proposal to change something
> about a command that has to do with buffers and regions. That's
> what I said I would not object to.
>
> Now I am not sure what the intention was. So I can't say I am in
> favor of it.
>
> We should be focusing on making a release, not on changes in
> Emacs interface features, so please let's not continue this
> discussion.

I am in favour of this change but I do realize this would be a
fundamental change in the behaviour of emacs.

So I would like to suggest to postpone this discussion until after
the next release.



# Han

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

* Re: ispell-region with M-$ in transient-mark-mode
  2005-01-21 20:10               ` Richard Stallman
  2005-01-21 20:44                 ` Han Boetes
@ 2005-01-21 21:25                 ` Luc Teirlinck
  1 sibling, 0 replies; 31+ messages in thread
From: Luc Teirlinck @ 2005-01-21 21:25 UTC (permalink / raw)
  Cc: han, emacs-devel

Richard Stallman wrote:

   No, because those are word commands.  This proposal has nothing
   to do with word commands.  Or at least I thought it did not.

The proposal had nothing to do with word commands.  While M-$ is a
word command, C-u M-$ is not a word command.  It resumes an
interrupted ispell session.  The proposal was that C-u M-$ would
start a new ispell process if there was no process to resume instead
of throwing an error, as it currently does.

Sincerely,

Luc.

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

* Re: ispell-region with M-$ in transient-mark-mode
  2005-01-21 16:26                     ` Eli Zaretskii
@ 2005-01-22  2:53                       ` Richard Stallman
  0 siblings, 0 replies; 31+ messages in thread
From: Richard Stallman @ 2005-01-22  2:53 UTC (permalink / raw)
  Cc: juri, geoff, teirllm, k.stevens, emacs-devel

    > Currently C-u M-$ resumes an ispell session is there is a session to
    > resume.  Otherwise, it currently throws an error.  The proposal is to
    > make C-u M-$ call `ispell' if there is no ispell session to resume
    > (instead of throwing an error).

That seems harmless to me.

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

end of thread, other threads:[~2005-01-22  2:53 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-18 10:48 ispell-region with M-$ in transient-mark-mode Juri Linkov
2005-01-18 11:42 ` David Kastrup
2005-01-19  0:28   ` Juri Linkov
2005-01-18 19:40 ` Eli Zaretskii
2005-01-19  0:33   ` Juri Linkov
2005-01-19  4:46     ` Eli Zaretskii
2005-01-19  7:46       ` Juri Linkov
2005-01-19  9:06         ` Kim F. Storm
2005-01-19 18:02           ` Eli Zaretskii
2005-01-19 21:30           ` Luc Teirlinck
2005-01-19 22:03             ` Kim F. Storm
2005-01-20  0:19               ` Luc Teirlinck
2005-01-20  8:18                 ` Kim F. Storm
2005-01-20  8:45                   ` David Kastrup
2005-01-20  9:44                     ` Kim F. Storm
2005-01-21  8:34                     ` Kai Großjohann
2005-01-19 17:58         ` Eli Zaretskii
2005-01-20  0:40           ` Luc Teirlinck
2005-01-20 21:32           ` Richard Stallman
2005-01-20 22:00             ` Geoff Kuenning
2005-01-20 22:17               ` David Kastrup
2005-01-20 22:23                 ` Geoff Kuenning
2005-01-20 23:11                   ` Luc Teirlinck
2005-01-21 16:26                     ` Eli Zaretskii
2005-01-22  2:53                       ` Richard Stallman
2005-01-20 22:43               ` Luc Teirlinck
2005-01-20 22:36             ` Han Boetes
2005-01-21 20:10               ` Richard Stallman
2005-01-21 20:44                 ` Han Boetes
2005-01-21 21:25                 ` Luc Teirlinck
2005-01-20  2:14   ` Richard Stallman

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