Path: utzoo!yunexus!telly!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!shelby!portia!ssyx.ucsc.edu!ulmo From: ulmo@ssyx.ucsc.edu (scritzifchisted ulmo qzutvchsxik) Newsgroups: gnu.emacs.bug Subject: Spelling replacer replaces case inadvertantly Message-ID: <2820@portia.Stanford.EDU> Date: 8 Jun 89 08:57:38 GMT Article-I.D.: portia.2820 Sender: USENET News System Lines: 47 In Emacs 18.54, the spelling checker spell-buffer will take a word such as: The rong spelling in the sentence will be fixed. Rong spellings are bad. and may ask me to replace "Rong" with something, I enter "Wrong" of course! So emacs will ask me if I want to replace it for each instance, I say Yes for both, and it comes out like this: The Wrong spelling in the sentence will be fixed. Wrong spellings are bad. The spelling replacer should not alter case in this particular case. These implications may help Emacs determine what case was intended: - if the case of the replacement string matches the case of the string being replaced, this implies that case should be preserved (as the user preserved it himself) - if the case of the string being replaced does not match the string of the original question string to be replaced, then preserve case of replacee. (This should probably be a stronger rule than the one above.) Obviously user control and awareness would help: Telling what Emacs will do on ambigous replacements when asking for confirmation; Offering a few case possibilities: No - do not replace (current behavoir) Yes - replace with Emacs guess of case (as printed) Preserve - preserve case of word in text Replace - replace case of word in text with new word (this is current behavoir for Yes) Sigh, the issue of What to Do when the user presses R or P at an unambiguous spot comes about. Also, how do I get Emacs to show context before asking for the specific replacement name? I was entering an older document where most of its spellings were correct (about half the spell findings were older spellings, about half were my typos, from a couple of pages I copied verbatim). I wanted context so I could look each one up as it came up, but I ended up having to kludge it by just munging the word to something (to me) obviously wrong and hitting return. Luckily, I didn't have to go back to fix anything later, but luck isn't to be assumed. Perhaps Emacs should draw context after you haven't responded in a bit, but the timeframe would be harder to design than the smaller key oriented help Emacs already has in this manner. (sorry, I admit, I used vi for this posting, so I'm not bothering to use any spelling checkers. I sinned.)