unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
Cc: k.stevens@ieee.org, ispell-el-bugs@itcorp.com
Subject: ispell-region with M-$ in transient-mark-mode
Date: Tue, 18 Jan 2005 12:48:09 +0200	[thread overview]
Message-ID: <87zmz7m2qr.fsf@jurta.org> (raw)

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/

             reply	other threads:[~2005-01-18 10:48 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-18 10:48 Juri Linkov [this message]
2005-01-18 11:42 ` ispell-region with M-$ in transient-mark-mode 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

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zmz7m2qr.fsf@jurta.org \
    --to=juri@jurta.org \
    --cc=ispell-el-bugs@itcorp.com \
    --cc=k.stevens@ieee.org \
    /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 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).