emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ispell-region with M-$ in transient-mark-mode


From: Juri Linkov
Subject: Re: ispell-region with M-$ in transient-mark-mode
Date: Wed, 19 Jan 2005 02:28:48 +0200
User-agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux)

David Kastrup <address@hidden> writes:
> Juri Linkov <address@hidden> 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/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]