GNU bug report logs - #52331
M-$ doesn't respect subword mode

Previous Next

Package: emacs;

Reported by: Paul Pogonyshev <pogonyshev <at> gmail.com>

Date: Mon, 6 Dec 2021 15:11:02 UTC

Severity: normal

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: André A. Gomes <andremegafone <at> gmail.com>
Cc: 52331 <at> debbugs.gnu.org, pogonyshev <at> gmail.com
Subject: bug#52331: M-$ doesn't respect subword mode
Date: Mon, 06 Dec 2021 19:45:35 +0200
> From: André A. Gomes <andremegafone <at> gmail.com>
> Cc: pogonyshev <at> gmail.com,  52331 <at> debbugs.gnu.org
> Date: Mon, 06 Dec 2021 17:21:28 +0000
> 
> > It's not that easy, unfortunately.  ispell.el has its own rules for
> > what is a word, and the rules aren't static, they are determined
> > dynamically by the definition of the dictionary. That's because of at
> > least 2 reasons: (1) the rules must match what the dictionary
> > considers a word, and (2) spell-checking is expected to work in
> > buffers that mix several languages, so the rules need to be sensitive
> > to the language of the dictionary and reject "words" whose letters are
> > not part of the language.
> 
> Correct, my comment was over simplistic.  But I don't see where my
> reasoning fails.  I can't think of an example where calling
> word-at-point before the ispell rules kick in would make harm.  What am
> I missing?

See ispell-get-word, I think it will explain what I meant.  This is
what ispell.el is using to determine what is a "word".

> > So perhaps a better approach is to teach subword-mode about the word
> > rules of ispell.el, not the other way around.  Patches welcome.
> 
> I don't see how this could help.  Care to expand a bit?

subword-mode uses regular expressions to find where the word begins
and ends.  Either use different regexps (derived from what ispell.el
uses) when spell-checking, or make ispell.el define its own
subword-forward/backward-functions for subword-mode to use instead of
its defaults.




This bug report was last modified 3 years and 192 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.