From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs 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:41:14 +0300 Message-ID: <86wmp5uyh1.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36798"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 70321@debbugs.gnu.org To: Pedro Andres Aranda Gutierrez , Eshel Yaron Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Apr 10 15:42:28 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ruYDb-0009N4-NP for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 10 Apr 2024 15:42:27 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ruYD9-0008Bs-65; Wed, 10 Apr 2024 09:41:59 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ruYD7-0008BT-Gr for bug-gnu-emacs@gnu.org; Wed, 10 Apr 2024 09:41:57 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ruYD7-0002Lk-8H for bug-gnu-emacs@gnu.org; Wed, 10 Apr 2024 09:41:57 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ruYDE-0001JY-Cs for bug-gnu-emacs@gnu.org; Wed, 10 Apr 2024 09:42:04 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 10 Apr 2024 13:42:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70321 X-GNU-PR-Package: emacs Original-Received: via spool by 70321-submit@debbugs.gnu.org id=B70321.17127564994839 (code B ref 70321); Wed, 10 Apr 2024 13:42:04 +0000 Original-Received: (at 70321) by debbugs.gnu.org; 10 Apr 2024 13:41:39 +0000 Original-Received: from localhost ([127.0.0.1]:52369 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ruYCm-0001FZ-AU for submit@debbugs.gnu.org; Wed, 10 Apr 2024 09:41:38 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34640) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ruYCh-0001De-U1 for 70321@debbugs.gnu.org; Wed, 10 Apr 2024 09:41:33 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ruYCT-0002Is-Sl; Wed, 10 Apr 2024 09:41:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=6w4HA6LzrRTnpKFL8rT05jcNYxYDzQ5ZhXOhhGWyW1s=; b=Z7yQy4lrZoPf cTfRt+BPsvkVycMbg0chvgXUhwSwJqOdsYDO/1C41bnjbYrehTPi6j3O5gkxHrcGfz26hN6wWQW93 1lBnuDMm8EbaI/B31ZpkYXAOGqmFFMaqevNWK3p7b7+4kljkj57zj570lae+jZO8wSMN6+U3ZGhnf 98v6t7gVW5Kv3arJTT6wRD2HwxHm7ybkqIy8Wk0PChMDc5fn3tTfC6puNy09vd3RJMff8iTpL7wgB 3NhjpGehDjHXSSvd1i6M0aQLMRVMCMShwIpVk4DFbaVLi0+RHGKzJWo6u7yhcbtcIKAPI7RbjTZb5 ABNvr4pS9KZ54uY9YAfrIA==; In-Reply-To: (message from Pedro Andres Aranda Gutierrez on Wed, 10 Apr 2024 09:08:08 +0200) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:283049 Archived-At: > From: Pedro Andres Aranda Gutierrez > 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?