unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#67527: 30.0.50; FR: Add an option to disable ispell completion in text-mode
@ 2023-11-29 10:31 Eason Huang
  2023-11-29 13:18 ` Eli Zaretskii
  0 siblings, 1 reply; 22+ messages in thread
From: Eason Huang @ 2023-11-29 10:31 UTC (permalink / raw)
  To: 67527

Hello Emacs Dev team,

In the below commit, Emacs support ispell-completion-at-point in
text-mode.

https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=47e313e9805c527e590df4270062a9185ee9db78

But it would be nice to add an option to disable this feature.

Because when I enable the autocomplete by corfu or company, it will
always popup the candidate when I input English charectors.
I don't want to diable the autocomplete of corfu or company, because I
need it in org code block.


Workaroud:

Recently, I have to add this code snippet to disable it.

```
(with-eval-after-load 'org
  (add-hook 'text-mode-hook
            (lambda ()
              (remove-hook 'completion-at-point-functions 'ispell-completion-at-point t))))
```

Best Regard,

Eason Huang


In GNU Emacs 30.0.50 (build 1, x86_64-apple-darwin23.1.0, NS
 appkit-2487.20 Version 14.1.1 (Build 23B81), git sha1 7a5c91a2831) of 2023-11-28 built on
 macbook
Windowing system distributor 'Apple', version 10.3.2487
System Description:  macOS 14.1.1

Configured using:
 'configure --without-native-compilation --without-dbus
 'CPPFLAGS=-I/opt/local/include
 -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk'
 'LDFLAGS=-L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-rpath
 /opt/local/lib/gcc13
 -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
 -arch x86_64''

Configured features:
ACL GIF GLIB GMP GNUTLS JPEG JSON LCMS2 LIBXML2 MODULES NOTIFY KQUEUE NS
PDUMPER PNG RSVG SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER
WEBP XIM ZLIB

Important settings:
  value of $LC_CTYPE: en_US.UTF-8
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  minibuffer-regexp-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message mailcap yank-media puny dired
dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068
epg-config gnus-util text-property-search time-date subr-x mm-decode
mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader
cl-loaddefs cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util
mail-prsvr mail-utils rmc iso-transl tooltip cconv eldoc paren electric
uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel
term/ns-win ns-win ucs-normalize mule-util term/common-win touch-screen
tool-bar dnd fontset image regexp-opt fringe tabulated-list replace
newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar
rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock
font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq
simple cl-generic indonesian philippine cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms
cp51932 hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese composite emoji-zwj charscript charprop case-table
epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button
loaddefs theme-loaddefs faces cus-face macroexp files window
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget keymap hashtable-print-readable backquote threads kqueue
cocoa ns lcms2 multi-tty make-network-process emacs)

Memory information:
((conses 16 38070 9043) (symbols 48 5115 0) (strings 32 13097 2341)
 (string-bytes 1 375591) (vectors 16 10489)
 (vector-slots 8 163580 14202) (floats 8 21 23) (intervals 56 239 0)
 (buffers 992 10))






^ permalink raw reply	[flat|nested] 22+ messages in thread

* bug#67527: 30.0.50; FR: Add an option to disable ispell completion in text-mode
  2023-11-29 10:31 Eason Huang
@ 2023-11-29 13:18 ` Eli Zaretskii
  2023-11-29 13:45   ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 22+ messages in thread
From: Eli Zaretskii @ 2023-11-29 13:18 UTC (permalink / raw)
  To: Eason Huang, Eshel Yaron; +Cc: 67527

> From: Eason Huang <aqua0210@foxmail.com>
> Date: Wed, 29 Nov 2023 18:31:43 +0800
> 
> Hello Emacs Dev team,
> 
> In the below commit, Emacs support ispell-completion-at-point in
> text-mode.
> 
> https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=47e313e9805c527e590df4270062a9185ee9db78
> 
> But it would be nice to add an option to disable this feature.
> 
> Because when I enable the autocomplete by corfu or company, it will
> always popup the candidate when I input English charectors.
> I don't want to diable the autocomplete of corfu or company, because I
> need it in org code block.
> 
> 
> Workaroud:
> 
> Recently, I have to add this code snippet to disable it.
> 
> ```
> (with-eval-after-load 'org
>   (add-hook 'text-mode-hook
>             (lambda ()
>               (remove-hook 'completion-at-point-functions 'ispell-completion-at-point t))))
> ```

Adding Eshel to this discussion.





^ permalink raw reply	[flat|nested] 22+ messages in thread

* bug#67527: 30.0.50; FR: Add an option to disable ispell completion in text-mode
  2023-11-29 13:18 ` Eli Zaretskii
@ 2023-11-29 13:45   ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-11-29 14:03     ` Eason Huang
  0 siblings, 1 reply; 22+ messages in thread
From: Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-11-29 13:45 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Eason Huang, 67527

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Eason Huang <aqua0210@foxmail.com>
>>
>> In the below commit, Emacs support ispell-completion-at-point in
>> text-mode.
>>
>> https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=47e313e9805c527e590df4270062a9185ee9db78
>>
>> But it would be nice to add an option to disable this feature.
>>
>> Because when I enable the autocomplete by corfu or company, it will
>> always popup the candidate when I input English charectors.
>> I don't want to diable the autocomplete of corfu or company, because I
>> need it in org code block.
>>
>>
>> Workaroud:
>>
>> Recently, I have to add this code snippet to disable it.
>>
>> ```
>> (with-eval-after-load 'org
>>   (add-hook 'text-mode-hook
>>             (lambda ()
>>               (remove-hook 'completion-at-point-functions 'ispell-completion-at-point t))))
>> ```
>
> Adding Eshel to this discussion.

Thanks for pinging me.

Eason Huang, IIUC, you've globally set up your completion selection UI
to pop up automatically.  Before this commit, there were no completion
sources for text modes OOTB, so your global setting was equivalent in
practice to something that only affects non-text mode buffers, and that
was fine.  Is that correct?

If so, my suggestion would be to change your global autocomplete setting
such that it doesn't apply for text buffers, seeing as you don't seem to
want such automatic behavior in these buffers, instead of disabling the
completion source.

So I'm not sure another user option is due here.  I think your
workaround is fine, if that works for you, of course.  But you could
just as well say `(setq-local corfu-auto nil)` in that hook, no?



Best,

Eshel





^ permalink raw reply	[flat|nested] 22+ messages in thread

* bug#67527: 30.0.50; FR: Add an option to disable ispell completion in text-mode
  2023-11-29 13:45   ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-11-29 14:03     ` Eason Huang
  2023-11-29 14:32       ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 22+ messages in thread
From: Eason Huang @ 2023-11-29 14:03 UTC (permalink / raw)
  To: Eshel Yaron; +Cc: Eli Zaretskii, 67527

Eshel Yaron <me@eshelyaron.com> writes:

> Eli Zaretskii <eliz@gnu.org> writes:
>
>>> From: Eason Huang <aqua0210@foxmail.com>
>>>
>>> In the below commit, Emacs support ispell-completion-at-point in
>>> text-mode.
>>>
>>> https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=47e313e9805c527e590df4270062a9185ee9db78
>>>
>>> But it would be nice to add an option to disable this feature.
>>>
>>> Because when I enable the autocomplete by corfu or company, it will
>>> always popup the candidate when I input English charectors.
>>> I don't want to diable the autocomplete of corfu or company, because I
>>> need it in org code block.
>>>
>>>
>>> Workaroud:
>>>
>>> Recently, I have to add this code snippet to disable it.
>>>
>>> ```
>>> (with-eval-after-load 'org
>>>   (add-hook 'text-mode-hook
>>>             (lambda ()
>>>               (remove-hook 'completion-at-point-functions 'ispell-completion-at-point t))))
>>> ```
>>
>> Adding Eshel to this discussion.
>
> Thanks for pinging me.
>
> Eason Huang, IIUC, you've globally set up your completion selection UI
> to pop up automatically.  Before this commit, there were no completion
> sources for text modes OOTB, so your global setting was equivalent in
> practice to something that only affects non-text mode buffers, and that
> was fine.  Is that correct?
No. It's correct on the text file (.txt), but not in org-mode
files. Because org-mode also derived from text-mode.

In my test.org file, I have emacs-lisp code block and so on. in the code
block I do need the UI to pop up automatically.

`C-h, v completion-at-point-functions` on org-mode buffer will get:
```
(cape-elisp-block cape-file tags-completion-at-point-function)
```


> If so, my suggestion would be to change your global autocomplete setting
> such that it doesn't apply for text buffers, seeing as you don't seem to
> want such automatic behavior in these buffers, instead of disabling the
> completion source.


> So I'm not sure another user option is due here.  I think your
> workaround is fine, if that works for you, of course.  But you could
> just as well say `(setq-local corfu-auto nil)` in that hook, no?

No. I need (setq-local corfu-auto t) on org-buffer



-- 
Eason Huang






^ permalink raw reply	[flat|nested] 22+ messages in thread

* bug#67527: 30.0.50; FR: Add an option to disable ispell completion in text-mode
  2023-11-29 14:03     ` Eason Huang
@ 2023-11-29 14:32       ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-11-30  7:46         ` Eason Huang
  0 siblings, 1 reply; 22+ messages in thread
From: Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-11-29 14:32 UTC (permalink / raw)
  To: Eason Huang; +Cc: Eli Zaretskii, 67527

Eason Huang <aqua0210@foxmail.com> writes:

> Eshel Yaron <me@eshelyaron.com> writes:
>
>> Eason Huang, IIUC, you've globally set up your completion selection UI
>> to pop up automatically.  Before this commit, there were no completion
>> sources for text modes OOTB, so your global setting was equivalent in
>> practice to something that only affects non-text mode buffers, and that
>> was fine.  Is that correct?
> No. It's correct on the text file (.txt), but not in org-mode
> files. Because org-mode also derived from text-mode.
> ...
>
>> If so, my suggestion would be to change your global autocomplete setting
>> such that it doesn't apply for text buffers, seeing as you don't seem to
>> want such automatic behavior in these buffers, instead of disabling the
>> completion source.
>> 
>> So I'm not sure another user option is due here.  I think your
>> workaround is fine, if that works for you, of course.  But you could
>> just as well say `(setq-local corfu-auto nil)` in that hook, no?
>
> No. I need (setq-local corfu-auto t) on org-buffer

Sure, and you can do that.  Again, whatever solution works best for
you.  I just highlighted that the behavior that you want to avoid
seems to be a consequence of a global setting that you don't in fact
want to apply it in all buffers.  Makes sense?





^ permalink raw reply	[flat|nested] 22+ messages in thread

* bug#67527: 30.0.50; FR: Add an option to disable ispell completion in text-mode
  2023-11-29 14:32       ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-11-30  7:46         ` Eason Huang
  2023-11-30  9:01           ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 22+ messages in thread
From: Eason Huang @ 2023-11-30  7:46 UTC (permalink / raw)
  To: Eshel Yaron; +Cc: Eli Zaretskii, 67527

Eshel Yaron <me@eshelyaron.com> writes:

> Eason Huang <aqua0210@foxmail.com> writes:
>
>> Eshel Yaron <me@eshelyaron.com> writes:
>>
>>> Eason Huang, IIUC, you've globally set up your completion selection UI
>>> to pop up automatically.  Before this commit, there were no completion
>>> sources for text modes OOTB, so your global setting was equivalent in
>>> practice to something that only affects non-text mode buffers, and that
>>> was fine.  Is that correct?
>> No. It's correct on the text file (.txt), but not in org-mode
>> files. Because org-mode also derived from text-mode.
>> ...
>>
>>> If so, my suggestion would be to change your global autocomplete setting
>>> such that it doesn't apply for text buffers, seeing as you don't seem to
>>> want such automatic behavior in these buffers, instead of disabling the
>>> completion source.
>>> 
>>> So I'm not sure another user option is due here.  I think your
>>> workaround is fine, if that works for you, of course.  But you could
>>> just as well say `(setq-local corfu-auto nil)` in that hook, no?
>>
>> No. I need (setq-local corfu-auto t) on org-buffer
>
> Sure, and you can do that.  Again, whatever solution works best for
> you.  I just highlighted that the behavior that you want to avoid
> seems to be a consequence of a global setting that you don't in fact
> want to apply it in all buffers.  Makes sense?
>

Maybe I don't make myself clear!

1. I do confirm that I need to enable corfu-auto in org-mode, and it is
useful in code block such as the belwo code in org buffer:

#+begin_src emacs-lisp
;; input some code here will get auto completion
(message "Hello")
#+end_src

2. It's not a good idear to add `ispell-completion-at-point` to
`completion-at-point-functions` by default.

3. Anyway, I can use the below code to rollback to the behavior before
the commit.
```
(add-hook 'text-mode-hook
          (lambda ()
            (remove-hook 'completion-at-point-functions
            'ispell-completion-at-point t)))
```

If you decide that no need to add an option to prevent adding
`ispell-completion-at-point` to completion-at-point-functions by
default, feel free to closed this bug report
(It's not a bug, I just want to provide some advice from a user view).

Best Regards,
Eason Huang






^ permalink raw reply	[flat|nested] 22+ messages in thread

* bug#67527: 30.0.50; FR: Add an option to disable ispell completion in text-mode
  2023-11-30  7:46         ` Eason Huang
@ 2023-11-30  9:01           ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-12-16  8:37             ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 22+ messages in thread
From: Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-11-30  9:01 UTC (permalink / raw)
  To: Eason Huang; +Cc: Eli Zaretskii, 67527

Eason Huang <aqua0210@foxmail.com> writes:

> Eshel Yaron <me@eshelyaron.com> writes:
>
>> Eason Huang <aqua0210@foxmail.com> writes:
>>
>>> Eshel Yaron <me@eshelyaron.com> writes:
>>>
>>>> ...I'm not sure another user option is due here.  I think your
>>>> workaround is fine, if that works for you, of course.  But you could
>>>> just as well say `(setq-local corfu-auto nil)` in that hook, no?
>>>
>>> No. I need (setq-local corfu-auto t) on org-buffer
>>
>> Sure, and you can do that.  Again, whatever solution works best for
>> you.  I just highlighted that the behavior that you want to avoid
>> seems to be a consequence of a global setting that you don't in fact
>> want to apply it in all buffers.  Makes sense?
>
> Maybe I don't make myself clear!
>

I do understand, I believe.  I'm sorry if I gave you a different impression.

> 2. It's not a good idear to add `ispell-completion-at-point` to
> `completion-at-point-functions` by default.

Here I, respectfully, disagree.  I understand that this has an unwelcome
effect for your particular setup, but I think that that's because this
setup made a brittle assumption about an undocumented and incidental
property of `text-mode` (the property of not providing any capfs).

> 3. Anyway, I can use the below code to rollback to the behavior before
> the commit.
>
> ```
> (add-hook 'text-mode-hook
>           (lambda ()
>             (remove-hook 'completion-at-point-functions
>             'ispell-completion-at-point t)))
> ```

Indeed, it's easy enough to adapt if you happen not to like this capf.
Which is why I don't think a dedicated user option is in order.
Regarding this specific way of adapting, my suggestion was instead to go
with something that still allows you to use word completion in text
buffers, but that's just a friendly suggestion, and maybe you simply
don't need word completion at all.

> If you decide that no need to add an option to prevent adding
> `ispell-completion-at-point` to completion-at-point-functions by
> default, feel free to closed this bug report (It's not a bug, I just
> want to provide some advice from a user view).

I appreciate your advice and your valuable user perspective.  As I
mentioned earlier, I think that such a user option would be redundant.
I wonder how others feel about this, though.


Cheers,

Eshel





^ permalink raw reply	[flat|nested] 22+ messages in thread

* bug#67527: 30.0.50; FR: Add an option to disable ispell completion in text-mode
  2023-11-30  9:01           ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-12-16  8:37             ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-12-16  9:34               ` Daniel Mendler
  0 siblings, 1 reply; 22+ messages in thread
From: Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-12-16  8:37 UTC (permalink / raw)
  To: Eason Huang; +Cc: Daniel Mendler, Eli Zaretskii, 67527, Dmitry Gutov

Eshel Yaron <me@eshelyaron.com> writes:

> Eason Huang <aqua0210@foxmail.com> writes:
>
>> It's not a good idear to add `ispell-completion-at-point` to
>> `completion-at-point-functions` by default.
>> ...
>> Anyway, I can use the below code to rollback to the behavior before
>> the commit.
>>
>> ```
>> (add-hook 'text-mode-hook
>>           (lambda ()
>>             (remove-hook 'completion-at-point-functions
>>             'ispell-completion-at-point t)))
>> ```
>
> Indeed, it's easy enough to adapt if you happen not to like this capf.
> Which is why I don't think a dedicated user option is in order.
> ...
> I wonder how others feel about this, though.

I surveyed a bunch of user configurations online, and saw that it is not
that uncommon for people to globally enable automatic completion pop ups
with company and corfu.  As Eason Huang reports, the new
`ispell-completion-at-point` probably makes such pop ups rather noisy.

I see that Dmitry (CC'd) already addressed this in company (by skipping
this capf).  I suppose corfu could do something along the same lines
(CC'ing Daniel as well)...  Do you guys think that's a reasonable remedy?


Eshel





^ permalink raw reply	[flat|nested] 22+ messages in thread

* bug#67527: 30.0.50; FR: Add an option to disable ispell completion in text-mode
  2023-12-16  8:37             ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-12-16  9:34               ` Daniel Mendler
  2023-12-16 12:23                 ` Dmitry Gutov
  0 siblings, 1 reply; 22+ messages in thread
From: Daniel Mendler @ 2023-12-16  9:34 UTC (permalink / raw)
  To: Eshel Yaron, Eason Huang; +Cc: Dmitry Gutov, Eli Zaretskii, 67527

On 12/16/23 09:37, Eshel Yaron wrote:
> I surveyed a bunch of user configurations online, and saw that it is not
> that uncommon for people to globally enable automatic completion pop ups
> with company and corfu.  As Eason Huang reports, the new
> `ispell-completion-at-point` probably makes such pop ups rather noisy.
> 
> I see that Dmitry (CC'd) already addressed this in company (by skipping
> this capf).  I suppose corfu could do something along the same lines
> (CC'ing Daniel as well)...  Do you guys think that's a reasonable remedy?

Corfu does not modify the completion-at-point-functions variable itself.
It leaves that to the users and major mode authors.

Daniel





^ permalink raw reply	[flat|nested] 22+ messages in thread

* bug#67527: 30.0.50; FR: Add an option to disable ispell completion in text-mode
  2023-12-16  9:34               ` Daniel Mendler
@ 2023-12-16 12:23                 ` Dmitry Gutov
  0 siblings, 0 replies; 22+ messages in thread
From: Dmitry Gutov @ 2023-12-16 12:23 UTC (permalink / raw)
  To: Daniel Mendler, Eshel Yaron, Eason Huang; +Cc: Eli Zaretskii, 67527

On 16/12/2023 11:34, Daniel Mendler wrote:
> On 12/16/23 09:37, Eshel Yaron wrote:
>> I surveyed a bunch of user configurations online, and saw that it is not
>> that uncommon for people to globally enable automatic completion pop ups
>> with company and corfu.  As Eason Huang reports, the new
>> `ispell-completion-at-point` probably makes such pop ups rather noisy.
>>
>> I see that Dmitry (CC'd) already addressed this in company (by skipping
>> this capf).  I suppose corfu could do something along the same lines
>> (CC'ing Daniel as well)...  Do you guys think that's a reasonable remedy?
> Corfu does not modify the completion-at-point-functions variable itself.
> It leaves that to the users and major mode authors.

I think that's okay: company skips this capf because it has another 
completion source configured by default (which also "will always popup 
the candidate when I input English charectors").

Corfu doesn't and follows the current CAPF configuration. In which case 
showing the ispell results seems reasonable. Though of course some might 
not like that. I don't know whether that merits a new user option.





^ permalink raw reply	[flat|nested] 22+ messages in thread

* bug#67527: 30.0.50; FR: Add an option to disable ispell completion in text-mode
       [not found] <m2jzq0j1f4.fsf@foxmail.com>
@ 2024-01-08 17:55 ` Simon Manning
  2024-01-09 13:33   ` Eli Zaretskii
  0 siblings, 1 reply; 22+ messages in thread
From: Simon Manning @ 2024-01-08 17:55 UTC (permalink / raw)
  To: 67527

[-- Attachment #1: Type: text/plain, Size: 264 bytes --]

For what it's worth, I've hit the same issue as Eason and have had to use
the same workaround. The behavior is quite annoying with this (I think
quite common?) setup because you can't really type without completion
popups for simple words continuously showing up.

[-- Attachment #2: Type: text/html, Size: 298 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* bug#67527: 30.0.50; FR: Add an option to disable ispell completion in text-mode
  2024-01-08 17:55 ` bug#67527: 30.0.50; FR: Add an option to disable ispell completion in text-mode Simon Manning
@ 2024-01-09 13:33   ` Eli Zaretskii
  2024-01-12 12:46     ` Eason Huang
  0 siblings, 1 reply; 22+ messages in thread
From: Eli Zaretskii @ 2024-01-09 13:33 UTC (permalink / raw)
  To: Simon Manning, Eason Huang; +Cc: 67527

> From: Simon Manning <simon@ecksd.com>
> Date: Mon, 8 Jan 2024 12:55:00 -0500
> 
> For what it's worth, I've hit the same issue as Eason and have had to use the same workaround. The
> behavior is quite annoying with this (I think quite common?) setup because you can't really type
> without completion popups for simple words continuously showing up.

We add ispell-completion-at-point to completion-at-point-functions
with DEPTH of 10.  So if other packages use DEPTH omitted or nil when
adding their functions to completion-at-point-functions, they should
be called before ispell-completion-at-point.  Does that happen?  if
not, why not?  If it does happen, why isn't that a good enough
resolution of the situation where several candidates compete for the
privilege of providing a completion?

I took a liberty to add back Eason to the discussion, in the hope that
he could explain why DEPTH of 10 didn't solve his situation.

Thanks.





^ permalink raw reply	[flat|nested] 22+ messages in thread

* bug#67527: 30.0.50; FR: Add an option to disable ispell completion in text-mode
  2024-01-09 13:33   ` Eli Zaretskii
@ 2024-01-12 12:46     ` Eason Huang
  2024-01-12 14:09       ` Eli Zaretskii
  0 siblings, 1 reply; 22+ messages in thread
From: Eason Huang @ 2024-01-12 12:46 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 67527, Simon Manning

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Simon Manning <simon@ecksd.com>
>> Date: Mon, 8 Jan 2024 12:55:00 -0500
>> 
>> For what it's worth, I've hit the same issue as Eason and have had to use the same workaround. The
>> behavior is quite annoying with this (I think quite common?) setup because you can't really type
>> without completion popups for simple words continuously showing up.
>
> We add ispell-completion-at-point to completion-at-point-functions
> with DEPTH of 10.  So if other packages use DEPTH omitted or nil when
> adding their functions to completion-at-point-functions, they should
> be called before ispell-completion-at-point.  Does that happen?  if
> not, why not?  If it does happen, why isn't that a good enough
> resolution of the situation where several candidates compete for the
> privilege of providing a completion?
>
> I took a liberty to add back Eason to the discussion, in the hope that
> he could explain why DEPTH of 10 didn't solve his situation.
>
Because I don't have any ohter capf backends in the org buffer(outside
the SRC code block), ispell-completion-at-point is the only one.

When the cursor is inside the SRC code block, no this issue.

-- 
Eason Huang






^ permalink raw reply	[flat|nested] 22+ messages in thread

* bug#67527: 30.0.50; FR: Add an option to disable ispell completion in text-mode
  2024-01-12 12:46     ` Eason Huang
@ 2024-01-12 14:09       ` Eli Zaretskii
  2024-01-13  9:03         ` Eason Huang
  0 siblings, 1 reply; 22+ messages in thread
From: Eli Zaretskii @ 2024-01-12 14:09 UTC (permalink / raw)
  To: Eason Huang; +Cc: 67527, simon

> From: Eason Huang <aqua0210@foxmail.com>
> Cc: Simon Manning <simon@ecksd.com>,  67527@debbugs.gnu.org
> Date: Fri, 12 Jan 2024 20:46:09 +0800
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> >> From: Simon Manning <simon@ecksd.com>
> >> Date: Mon, 8 Jan 2024 12:55:00 -0500
> >> 
> >> For what it's worth, I've hit the same issue as Eason and have had to use the same workaround. The
> >> behavior is quite annoying with this (I think quite common?) setup because you can't really type
> >> without completion popups for simple words continuously showing up.
> >
> > We add ispell-completion-at-point to completion-at-point-functions
> > with DEPTH of 10.  So if other packages use DEPTH omitted or nil when
> > adding their functions to completion-at-point-functions, they should
> > be called before ispell-completion-at-point.  Does that happen?  if
> > not, why not?  If it does happen, why isn't that a good enough
> > resolution of the situation where several candidates compete for the
> > privilege of providing a completion?
> >
> > I took a liberty to add back Eason to the discussion, in the hope that
> > he could explain why DEPTH of 10 didn't solve his situation.
> >
> Because I don't have any ohter capf backends in the org buffer(outside
> the SRC code block), ispell-completion-at-point is the only one.
> 
> When the cursor is inside the SRC code block, no this issue.

I guess I'm confused.  In your original report, which started this
discussion, you said:

  Because when I enable the autocomplete by corfu or company, it will
  always popup the candidate when I input English characters.
  I don't want to diable the autocomplete of corfu or company, because I
  need it in org code block.

I was asking about that part in your report -- how did the new support
for completion-at-point in text mode and its descendants change the
behavior when you enable autocomplete by corfu or company, and why
were you talking about disabling autocomplete of corfu and company?





^ permalink raw reply	[flat|nested] 22+ messages in thread

* bug#67527: 30.0.50; FR: Add an option to disable ispell completion in text-mode
  2024-01-12 14:09       ` Eli Zaretskii
@ 2024-01-13  9:03         ` Eason Huang
  2024-01-20  9:19           ` Eli Zaretskii
  0 siblings, 1 reply; 22+ messages in thread
From: Eason Huang @ 2024-01-13  9:03 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 67527, simon

Eli Zaretskii <eliz@gnu.org> writes:

>> > I took a liberty to add back Eason to the discussion, in the hope that
>> > he could explain why DEPTH of 10 didn't solve his situation.
>> >
>> Because I don't have any ohter capf backends in the org buffer(outside
>> the SRC code block), ispell-completion-at-point is the only one.
>> 
>> When the cursor is inside the SRC code block, no this issue.
>
> I guess I'm confused.  In your original report, which started this
> discussion, you said:
>
>   Because when I enable the autocomplete by corfu or company, it will
>   always popup the candidate when I input English characters.
>   I don't want to diable the autocomplete of corfu or company, because I
>   need it in org code block.
>
> I was asking about that part in your report -- how did the new support
> for completion-at-point in text mode and its descendants change the
> behavior when you enable autocomplete by corfu or company, and why
> were you talking about disabling autocomplete of corfu and company?
>

I have `cape-elisp-block` capf backend in org-buffer, and it only
works in code block, that's why I need the autocomplete.

I also need the `flyspell-mode` in org-mode, the `flyspell-mode` will add
ispell-completion-at-point to capf, but when I input characters in
org-buffer, I don't need the ispell-completion-at-point backend.

Anyway, the below workaround works for me:

```
(add-hook 'text-mode-hook
          (lambda ()
            (remove-hook 'completion-at-point-functions 'ispell-completion-at-point t)))
```

-- 
Eason Huang






^ permalink raw reply	[flat|nested] 22+ messages in thread

* bug#67527: 30.0.50; FR: Add an option to disable ispell completion in text-mode
  2024-01-13  9:03         ` Eason Huang
@ 2024-01-20  9:19           ` Eli Zaretskii
  2024-01-20  9:46             ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 22+ messages in thread
From: Eli Zaretskii @ 2024-01-20  9:19 UTC (permalink / raw)
  To: Eason Huang, Eshel Yaron; +Cc: 67527, simon

> From: Eason Huang <aqua0210@foxmail.com>
> Cc: 67527@debbugs.gnu.org,  simon@ecksd.com
> Date: Sat, 13 Jan 2024 17:03:28 +0800
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > I guess I'm confused.  In your original report, which started this
> > discussion, you said:
> >
> >   Because when I enable the autocomplete by corfu or company, it will
> >   always popup the candidate when I input English characters.
> >   I don't want to diable the autocomplete of corfu or company, because I
> >   need it in org code block.
> >
> > I was asking about that part in your report -- how did the new support
> > for completion-at-point in text mode and its descendants change the
> > behavior when you enable autocomplete by corfu or company, and why
> > were you talking about disabling autocomplete of corfu and company?
> >
> 
> I have `cape-elisp-block` capf backend in org-buffer, and it only
> works in code block, that's why I need the autocomplete.
> 
> I also need the `flyspell-mode` in org-mode, the `flyspell-mode` will add
> ispell-completion-at-point to capf, but when I input characters in
> org-buffer, I don't need the ispell-completion-at-point backend.
> 
> Anyway, the below workaround works for me:
> 
> ```
> (add-hook 'text-mode-hook
>           (lambda ()
>             (remove-hook 'completion-at-point-functions 'ispell-completion-at-point t)))
> ```

Thanks.

Eshel, given this feedback, I think it would make sense to add a new
defcustom that would make text-mode avoid adding
ispell-completion-at-point to completion-at-point-functions.  Would
you please submit such a change and the documentation changes to go
with it?  TIA.





^ permalink raw reply	[flat|nested] 22+ messages in thread

* bug#67527: 30.0.50; FR: Add an option to disable ispell completion in text-mode
  2024-01-20  9:19           ` Eli Zaretskii
@ 2024-01-20  9:46             ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-01-20 10:28               ` Eli Zaretskii
  0 siblings, 1 reply; 22+ messages in thread
From: Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-01-20  9:46 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 67527, Eason Huang, Eshel Yaron, simon

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Eason Huang <aqua0210@foxmail.com>
>> Cc: 67527@debbugs.gnu.org,  simon@ecksd.com
>> Date: Sat, 13 Jan 2024 17:03:28 +0800
>> 
>> Eli Zaretskii <eliz@gnu.org> writes:
>> 
>> > I guess I'm confused.  In your original report, which started this
>> > discussion, you said:
>> >
>> >   Because when I enable the autocomplete by corfu or company, it will
>> >   always popup the candidate when I input English characters.
>> >   I don't want to diable the autocomplete of corfu or company, because I
>> >   need it in org code block.
>> >
>> > I was asking about that part in your report -- how did the new support
>> > for completion-at-point in text mode and its descendants change the
>> > behavior when you enable autocomplete by corfu or company, and why
>> > were you talking about disabling autocomplete of corfu and company?
>> >
>> 
>> I have `cape-elisp-block` capf backend in org-buffer, and it only
>> works in code block, that's why I need the autocomplete.
>> 
>> I also need the `flyspell-mode` in org-mode, the `flyspell-mode` will add
>> ispell-completion-at-point to capf, but when I input characters in
>> org-buffer, I don't need the ispell-completion-at-point backend.
>> 
>> Anyway, the below workaround works for me:
>> 
>> ```
>> (add-hook 'text-mode-hook
>>           (lambda ()
>>             (remove-hook 'completion-at-point-functions 'ispell-completion-at-point t)))
>> ```
>
> Thanks.
>
> Eshel, given this feedback, I think it would make sense to add a new
> defcustom that would make text-mode avoid adding
> ispell-completion-at-point to completion-at-point-functions.  Would
> you please submit such a change and the documentation changes to go
> with it?  TIA.

Maybe the existing defcustom `text-mode-meta-tab-ispell-complete-word'
could be renamed and reused, taking three values? This way we avoid
introducing multiple defcustoms for tweaking the same feature.

- `command': Bind `ispell-complete-word' to TAB.
- `capf': Add `ispell-completion-at-point' to the
  `completion-at-point-functions'.
- `nil': None of the above.

Daniel





^ permalink raw reply	[flat|nested] 22+ messages in thread

* bug#67527: 30.0.50; FR: Add an option to disable ispell completion in text-mode
  2024-01-20  9:46             ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-01-20 10:28               ` Eli Zaretskii
  2024-01-20 10:33                 ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 22+ messages in thread
From: Eli Zaretskii @ 2024-01-20 10:28 UTC (permalink / raw)
  To: Daniel Mendler; +Cc: 67527, aqua0210, me, simon

> From: Daniel Mendler <mail@daniel-mendler.de>
> Cc: Eason Huang <aqua0210@foxmail.com>,  Eshel Yaron <me@eshelyaron.com>,
>   67527@debbugs.gnu.org,  simon@ecksd.com
> Date: Sat, 20 Jan 2024 10:46:00 +0100
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > Eshel, given this feedback, I think it would make sense to add a new
> > defcustom that would make text-mode avoid adding
> > ispell-completion-at-point to completion-at-point-functions.  Would
> > you please submit such a change and the documentation changes to go
> > with it?  TIA.
> 
> Maybe the existing defcustom `text-mode-meta-tab-ispell-complete-word'
> could be renamed and reused, taking three values? This way we avoid
> introducing multiple defcustoms for tweaking the same feature.
> 
> - `command': Bind `ispell-complete-word' to TAB.
> - `capf': Add `ispell-completion-at-point' to the
>   `completion-at-point-functions'.
> - `nil': None of the above.

Reused, yes.  Renamed, I'd rather prefer we avoided that, as it causes
compatibility problems.  If we can extend its list of valid values to
support this aspect as well, it would be good.





^ permalink raw reply	[flat|nested] 22+ messages in thread

* bug#67527: 30.0.50; FR: Add an option to disable ispell completion in text-mode
  2024-01-20 10:28               ` Eli Zaretskii
@ 2024-01-20 10:33                 ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-01-20 10:56                   ` Eli Zaretskii
  0 siblings, 1 reply; 22+ messages in thread
From: Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-01-20 10:33 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 67527, aqua0210, me, simon

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Daniel Mendler <mail@daniel-mendler.de>
>> Cc: Eason Huang <aqua0210@foxmail.com>,  Eshel Yaron <me@eshelyaron.com>,
>>   67527@debbugs.gnu.org,  simon@ecksd.com
>> Date: Sat, 20 Jan 2024 10:46:00 +0100
>> 
>> Eli Zaretskii <eliz@gnu.org> writes:
>> 
>> > Eshel, given this feedback, I think it would make sense to add a new
>> > defcustom that would make text-mode avoid adding
>> > ispell-completion-at-point to completion-at-point-functions.  Would
>> > you please submit such a change and the documentation changes to go
>> > with it?  TIA.
>> 
>> Maybe the existing defcustom `text-mode-meta-tab-ispell-complete-word'
>> could be renamed and reused, taking three values? This way we avoid
>> introducing multiple defcustoms for tweaking the same feature.
>> 
>> - `command': Bind `ispell-complete-word' to TAB.
>> - `capf': Add `ispell-completion-at-point' to the
>>   `completion-at-point-functions'.
>> - `nil': None of the above.
>
> Reused, yes.  Renamed, I'd rather prefer we avoided that, as it causes
> compatibility problems.  If we can extend its list of valid values to
> support this aspect as well, it would be good.

Iiuc the variable was introduced a short while ago on Emacs master, so
renaming it may still be possible?

Daniel





^ permalink raw reply	[flat|nested] 22+ messages in thread

* bug#67527: 30.0.50; FR: Add an option to disable ispell completion in text-mode
  2024-01-20 10:33                 ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-01-20 10:56                   ` Eli Zaretskii
  2024-01-20 11:33                     ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 22+ messages in thread
From: Eli Zaretskii @ 2024-01-20 10:56 UTC (permalink / raw)
  To: Daniel Mendler; +Cc: 67527, aqua0210, me, simon

> From: Daniel Mendler <mail@daniel-mendler.de>
> Cc: aqua0210@foxmail.com,  me@eshelyaron.com,  67527@debbugs.gnu.org,
>   simon@ecksd.com
> Date: Sat, 20 Jan 2024 11:33:47 +0100
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> >> From: Daniel Mendler <mail@daniel-mendler.de>
> >> Cc: Eason Huang <aqua0210@foxmail.com>,  Eshel Yaron <me@eshelyaron.com>,
> >>   67527@debbugs.gnu.org,  simon@ecksd.com
> >> Date: Sat, 20 Jan 2024 10:46:00 +0100
> >> 
> >> Eli Zaretskii <eliz@gnu.org> writes:
> >> 
> >> > Eshel, given this feedback, I think it would make sense to add a new
> >> > defcustom that would make text-mode avoid adding
> >> > ispell-completion-at-point to completion-at-point-functions.  Would
> >> > you please submit such a change and the documentation changes to go
> >> > with it?  TIA.
> >> 
> >> Maybe the existing defcustom `text-mode-meta-tab-ispell-complete-word'
> >> could be renamed and reused, taking three values? This way we avoid
> >> introducing multiple defcustoms for tweaking the same feature.
> >> 
> >> - `command': Bind `ispell-complete-word' to TAB.
> >> - `capf': Add `ispell-completion-at-point' to the
> >>   `completion-at-point-functions'.
> >> - `nil': None of the above.
> >
> > Reused, yes.  Renamed, I'd rather prefer we avoided that, as it causes
> > compatibility problems.  If we can extend its list of valid values to
> > support this aspect as well, it would be good.
> 
> Iiuc the variable was introduced a short while ago on Emacs master, so
> renaming it may still be possible?

Oh, I think I confused it with another option.  Yes, if it was
introduced recently on master, we can rename it.





^ permalink raw reply	[flat|nested] 22+ messages in thread

* bug#67527: 30.0.50; FR: Add an option to disable ispell completion in text-mode
  2024-01-20 10:56                   ` Eli Zaretskii
@ 2024-01-20 11:33                     ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-01-27  9:56                       ` Eli Zaretskii
  0 siblings, 1 reply; 22+ messages in thread
From: Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-01-20 11:33 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Daniel Mendler, aqua0210, 67527, simon

[-- Attachment #1: Type: text/plain, Size: 1447 bytes --]

Hi,

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Daniel Mendler <mail@daniel-mendler.de>
>>
>> Eli Zaretskii <eliz@gnu.org> writes:
>>
>> >> From: Daniel Mendler <mail@daniel-mendler.de>
>> >>
>> >> Eli Zaretskii <eliz@gnu.org> writes:
>> >>
>> >> > Eshel, given this feedback, I think it would make sense to add a new
>> >> > defcustom that would make text-mode avoid adding
>> >> > ispell-completion-at-point to completion-at-point-functions.  Would
>> >> > you please submit such a change and the documentation changes to go
>> >> > with it?  TIA.
>> >>
>> >> Maybe the existing defcustom `text-mode-meta-tab-ispell-complete-word'
>> >> could be renamed and reused, taking three values? This way we avoid
>> >> introducing multiple defcustoms for tweaking the same feature.
>> >>
>> >> - `command': Bind `ispell-complete-word' to TAB.
>> >> - `capf': Add `ispell-completion-at-point' to the
>> >>   `completion-at-point-functions'.
>> >> - `nil': None of the above.
>> >
>> > Reused, yes.  Renamed, I'd rather prefer we avoided that, as it causes
>> > compatibility problems.  If we can extend its list of valid values to
>> > support this aspect as well, it would be good.
>>
>> Iiuc the variable was introduced a short while ago on Emacs master, so
>> renaming it may still be possible?
>
> Oh, I think I confused it with another option.  Yes, if it was
> introduced recently on master, we can rename it.

SGTM, see attached patch below.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Optionally-avoid-extending-c-a-p-f-in-Text-mode-Bug-.patch --]
[-- Type: text/x-patch, Size: 3975 bytes --]

From 8ed03422c140be6a7f6f5352c2906b52a7c22a1d Mon Sep 17 00:00:00 2001
From: Eshel Yaron <me@eshelyaron.com>
Date: Sat, 20 Jan 2024 12:24:32 +0100
Subject: [PATCH] Optionally avoid extending 'c-a-p-f' in Text mode (Bug#67527)

* lisp/textmodes/text-mode.el
(text-mode-meta-tab-ispell-complete-word): Rename to...
(text-mode-ispell-word-completion): ...this.  Extend with another
option 'completion-at-point'.
(text-mode): Only extend 'completion-at-point-functions' when
'text-mode-ispell-word-completion' is 'completion-at-point'.

* etc/NEWS: Update.
---
 etc/NEWS                    | 13 +++++++------
 lisp/textmodes/text-mode.el | 19 ++++++++++++++-----
 2 files changed, 21 insertions(+), 11 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index 013d76eb44b..c1b34d2765e 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1404,12 +1404,13 @@ files and save the changes.
 
 +++
 ** 'M-TAB' now invokes 'completion-at-point' also in Text mode.
-Text mode no longer binds 'M-TAB' to 'ispell-complete-word', and
-instead this mode arranges for 'completion-at-point', globally bound
-to 'M-TAB', to perform word completion as well.  If you want 'M-TAB'
-to invoke 'ispell-complete-word', as it did in previous Emacs
-versions, customize the new user option
-'text-mode-meta-tab-ispell-complete-word' to non-nil.
+By default, Text mode no longer binds 'M-TAB' to
+'ispell-complete-word'.  Instead this mode arranges for
+'completion-at-point', globally bound to 'M-TAB', to perform word
+completion as well.  You can have Text mode bind 'M-TAB' to
+'ispell-complete-word' as it did in previous Emacs versions, or
+disable Ispell word completion in Text mode altogether, by customizing
+the new user option 'text-mode-ispell-word-completion'.
 
 ** 'pp' and 'pp-to-string' now always include a terminating newline.
 In the past they included a terminating newline in most cases but not all.
diff --git a/lisp/textmodes/text-mode.el b/lisp/textmodes/text-mode.el
index 7d3b47a9c03..87f6668cecb 100644
--- a/lisp/textmodes/text-mode.el
+++ b/lisp/textmodes/text-mode.el
@@ -75,8 +75,15 @@ text-mode-map
 Many other modes, such as `mail-mode' and `outline-mode', inherit
 all the commands defined in this map.")
 
-(defcustom text-mode-meta-tab-ispell-complete-word nil
-  "Whether M-TAB invokes `ispell-complete-word' in Text mode.
+(defcustom text-mode-ispell-word-completion 'completion-at-point
+  "How Text mode provides Ispell word completion.
+
+By default, this option is set to `completion-at-point', which
+means that Text mode adds an Ispell word completion function to
+`completion-at-point-functions'.  Any other non-nil value says to
+bind M-TAB directly to `ispell-complete-word' instead.  If this
+is nil, Text mode neither binds M-TAB to `ispell-complete-word'
+nor does it extend `completion-at-point-functions'.
 
 This user option only takes effect when you customize it in
 Custom or with `setopt', not with `setq'."
@@ -84,8 +91,9 @@ text-mode-meta-tab-ispell-complete-word
   :type 'boolean
   :version "30.1"
   :set (lambda (sym val)
-         (if (set sym val)
-	     (keymap-set text-mode-map "C-M-i" #'ispell-complete-word)
+         (if (and (set sym val)
+                  (not (eq val 'completion-at-point)))
+             (keymap-set text-mode-map "C-M-i" #'ispell-complete-word)
            (keymap-unset text-mode-map "C-M-i" t))))
 
 (easy-menu-define text-mode-menu text-mode-map
@@ -144,7 +152,8 @@ text-mode
   ;; Enable text conversion in this buffer.
   (setq-local text-conversion-style t)
   (add-hook 'context-menu-functions 'text-mode-context-menu 10 t)
-  (add-hook 'completion-at-point-functions #'ispell-completion-at-point 10 t))
+  (when (eq text-mode-ispell-word-completion 'completion-at-point)
+    (add-hook 'completion-at-point-functions #'ispell-completion-at-point 10 t)))
 
 (define-derived-mode paragraph-indent-text-mode text-mode "Parindent"
   "Major mode for editing text, with leading spaces starting a paragraph.
-- 
2.42.0


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* bug#67527: 30.0.50; FR: Add an option to disable ispell completion in text-mode
  2024-01-20 11:33                     ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-01-27  9:56                       ` Eli Zaretskii
  0 siblings, 0 replies; 22+ messages in thread
From: Eli Zaretskii @ 2024-01-27  9:56 UTC (permalink / raw)
  To: Eshel Yaron; +Cc: mail, aqua0210, 67527-done, simon

> From: Eshel Yaron <me@eshelyaron.com>
> Cc: Daniel Mendler <mail@daniel-mendler.de>,  aqua0210@foxmail.com,
>   67527@debbugs.gnu.org,  simon@ecksd.com
> Date: Sat, 20 Jan 2024 12:33:25 +0100
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> >> From: Daniel Mendler <mail@daniel-mendler.de>
> >>
> >> Eli Zaretskii <eliz@gnu.org> writes:
> >>
> >> >> From: Daniel Mendler <mail@daniel-mendler.de>
> >> >>
> >> >> Eli Zaretskii <eliz@gnu.org> writes:
> >> >>
> >> >> > Eshel, given this feedback, I think it would make sense to add a new
> >> >> > defcustom that would make text-mode avoid adding
> >> >> > ispell-completion-at-point to completion-at-point-functions.  Would
> >> >> > you please submit such a change and the documentation changes to go
> >> >> > with it?  TIA.
> >> >>
> >> >> Maybe the existing defcustom `text-mode-meta-tab-ispell-complete-word'
> >> >> could be renamed and reused, taking three values? This way we avoid
> >> >> introducing multiple defcustoms for tweaking the same feature.
> >> >>
> >> >> - `command': Bind `ispell-complete-word' to TAB.
> >> >> - `capf': Add `ispell-completion-at-point' to the
> >> >>   `completion-at-point-functions'.
> >> >> - `nil': None of the above.
> >> >
> >> > Reused, yes.  Renamed, I'd rather prefer we avoided that, as it causes
> >> > compatibility problems.  If we can extend its list of valid values to
> >> > support this aspect as well, it would be good.
> >>
> >> Iiuc the variable was introduced a short while ago on Emacs master, so
> >> renaming it may still be possible?
> >
> > Oh, I think I confused it with another option.  Yes, if it was
> > introduced recently on master, we can rename it.
> 
> SGTM, see attached patch below.

Thanks, installed on master, and closing the bug.





^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2024-01-27  9:56 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <m2jzq0j1f4.fsf@foxmail.com>
2024-01-08 17:55 ` bug#67527: 30.0.50; FR: Add an option to disable ispell completion in text-mode Simon Manning
2024-01-09 13:33   ` Eli Zaretskii
2024-01-12 12:46     ` Eason Huang
2024-01-12 14:09       ` Eli Zaretskii
2024-01-13  9:03         ` Eason Huang
2024-01-20  9:19           ` Eli Zaretskii
2024-01-20  9:46             ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-20 10:28               ` Eli Zaretskii
2024-01-20 10:33                 ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-20 10:56                   ` Eli Zaretskii
2024-01-20 11:33                     ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-27  9:56                       ` Eli Zaretskii
2023-11-29 10:31 Eason Huang
2023-11-29 13:18 ` Eli Zaretskii
2023-11-29 13:45   ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-29 14:03     ` Eason Huang
2023-11-29 14:32       ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-30  7:46         ` Eason Huang
2023-11-30  9:01           ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-16  8:37             ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-16  9:34               ` Daniel Mendler
2023-12-16 12:23                 ` Dmitry Gutov

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).