[comp.emacs] query anomaly

jr@LF-SERVER-2.BBN.COM (John Robinson) (11/12/87)

The problem is not with query-replace, but with the way spell-region
calls it.  Spell.el notices when any words from the spell filter
differ only in capitalization, but unfortunately the capitalization of
the first occurence is the one used in the query-replace, so if it is
mixed case, the wrong things happen.

This can be fixed two ways:

1.  Modify (create your private version of) the filter spell to
include a lower-casifying step: change the line like

	deroff -w $F | sort -u | /usr/lib/spell

to

	deroff -w $F | sort -uf | /usr/lib/spell

This seems (at least on the Sun) to preserve only the all-lowercase
variant.

2.  Do the following in spell.el: change the expr

	 (setq word (buffer-substring (point)
				      (progn (end-of-line) (point))))

to

 	 (setq word (downcase (buffer-substring (point)
				      (progn (end-of-line) (point)))))

I'd vote for the latter to be adopted in spell.el, since the original
behavior of /usr/bin/spell might be critical elsewhere.

Of course, there is always ispell...

/jr
------- Forwarded Message

Date:    Tue, 10 Nov 87 09:41:00 -0400 
From:    Steve Azmier <STEVE%YULIBRA.BITNET@WISCVM.WISC.EDU>
To:      jr@BBN.COM
Subject: query anomaly


Thanks John...I agree that is how query-replace works...unfortunately the
context I was using it when the problem occurred was the spell.el program.
Since it flags capitalized mistakes first (it is alphabetical - ascii order),
I am left with the problem of having the FROM-String capitalized, so in fact
the query-replace is not designed to handle this case.

Regards Steve

------- End of Forwarded Message