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

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