From: Pedro Andres Aranda Gutierrez <paaguti@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 70321@debbugs.gnu.org, Eshel Yaron <me@eshelyaron.com>
Subject: bug#70321: Can not turn completion-at-point on a per-mode basis on modes derived from text-mode
Date: Wed, 10 Apr 2024 16:47:08 +0200 [thread overview]
Message-ID: <CAO48Bk9eK1ocOAex6ppDVnz8y-=fXVwO_A9vPsFg_G7p3AOxCQ@mail.gmail.com> (raw)
In-Reply-To: <86wmp5uyh1.fsf@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 2169 bytes --]
Wonderful... those three lines are helpful. Could they make it to Emacs
base or to the manual?
On Wed, 10 Apr 2024 at 15:41, Eli Zaretskii <eliz@gnu.org> wrote:
> > From: Pedro Andres Aranda Gutierrez <paaguti@gmail.com>
> > Date: Wed, 10 Apr 2024 09:08:08 +0200
> >
> > Place the following file as init.el in a directory (e.g. ~/.demacs.d)
> >
> > ---cut here---
> > (setq inhibit-startup-screen t)
> >
> > (defun auto-complete-text-off ()
> > (message "Trying to turn off ispell completion...")
> > (setopt text-mode-ispell-word-completion nil))
> >
> > (add-hook 'org-mode-hook #'auto-complete-text-off)
> > (add-hook 'org-mode-hook #'(lambda()
> > (ispell-change-dictionary "en_GB")
> > (flyspell-mode t)))
> > ---cut here---
> >
> > Open a text file and C-h C-v completion-at-point-functions. You should
> see
> > ispell-completion-at-point in the list of completion functions
> >
> > Open a .org file and C-h C-v completion-at-point-functions. You see
> > ispell-completion-at-point in the list of completion functions, when the
> expected behaviour
> > is that ispell-completion-at-point is *not* in the list.
>
> You cannot set this option in a mode hook, that's not how it is
> supposed to be used. If you customize the option to nil, any buffer
> under Text mode or its derivative created afterwards will have the
> completion turned off, that's the intended use of the option.
>
> If you want to disable the completion selectively in a mode hook of
> some descendant of Text mode, you need to remove
> ispell-completion-at-point from the appropriate hook explicitly:
>
> (defun auto-complete-text-off ()
> (message "Trying to turn off ispell completion...")
> (remove-hook 'completion-at-point-functions
> #'ispell-completion-at-point t))
>
> I see no bug here, just a misunderstanding.
>
> Eshel, am I missing something here?
>
--
Fragen sind nicht da, um beantwortet zu werden,
Fragen sind da um gestellt zu werden
Georg Kreisler
Headaches with a Juju log:
unit-basic-16: 09:17:36 WARNING juju.worker.uniter.operation we should run
a leader-deposed hook here, but we can't yet
[-- Attachment #2: Type: text/html, Size: 3052 bytes --]
next prev parent reply other threads:[~2024-04-10 14:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-10 7:08 bug#70321: Can not turn completion-at-point on a per-mode basis on modes derived from text-mode Pedro Andres Aranda Gutierrez
2024-04-10 13:41 ` Eli Zaretskii
2024-04-10 14:47 ` Pedro Andres Aranda Gutierrez [this message]
2024-04-11 5:52 ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-11 7:59 ` Pedro Andres Aranda Gutierrez
2024-04-12 7:36 ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAO48Bk9eK1ocOAex6ppDVnz8y-=fXVwO_A9vPsFg_G7p3AOxCQ@mail.gmail.com' \
--to=paaguti@gmail.com \
--cc=70321@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=me@eshelyaron.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).