From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: ispell-region with M-$ in transient-mark-mode Date: Tue, 18 Jan 2005 12:48:09 +0200 Organization: JURTA Message-ID: <87zmz7m2qr.fsf@jurta.org> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1106047276 26074 80.91.229.6 (18 Jan 2005 11:21:16 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 18 Jan 2005 11:21:16 +0000 (UTC) Cc: k.stevens@ieee.org, ispell-el-bugs@itcorp.com Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jan 18 12:21:10 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CqrQ5-00034Z-00 for ; Tue, 18 Jan 2005 12:21:09 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Cqrbz-00084u-A0 for ged-emacs-devel@m.gmane.org; Tue, 18 Jan 2005 06:33:27 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1CqraC-0007jL-RZ for emacs-devel@gnu.org; Tue, 18 Jan 2005 06:31:37 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1CqraA-0007iz-Di for emacs-devel@gnu.org; Tue, 18 Jan 2005 06:31:35 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1CqrXV-000754-UT for emacs-devel@gnu.org; Tue, 18 Jan 2005 06:28:50 -0500 Original-Received: from [199.232.41.8] (helo=mx20.gnu.org) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1CqrCu-0005k8-N7 for emacs-devel@gnu.org; Tue, 18 Jan 2005 06:07:32 -0500 Original-Received: from [194.126.101.100] (helo=MXR-1.estpak.ee) by mx20.gnu.org with esmtp (Exim 4.34) id 1Cqr6E-0002yh-6Q for emacs-devel@gnu.org; Tue, 18 Jan 2005 06:00:38 -0500 Original-Received: from mail.neti.ee (80-235-38-192-dsl.mus.estpak.ee [80.235.38.192]) by MXR-1.estpak.ee (Postfix) with ESMTP id 26A1A14C31E; Tue, 18 Jan 2005 13:00:32 +0200 (EET) Original-To: emacs-devel@gnu.org User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux) X-Virus-Scanned: by amavisd-new-2.2.1 (20041222) (Debian) at neti.ee X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:32324 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:32324 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/