From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Pedro Andres Aranda Gutierrez 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:47:08 +0200 Message-ID: References: <86wmp5uyh1.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000074feb30615bf1e86" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38048"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 70321@debbugs.gnu.org, Eshel Yaron To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Apr 10 16:48:20 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 1ruZFK-0009eO-Pr for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 10 Apr 2024 16:48:18 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ruZF0-0003sD-6Q; Wed, 10 Apr 2024 10:47:58 -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 1ruZEy-0003rq-2B for bug-gnu-emacs@gnu.org; Wed, 10 Apr 2024 10:47:56 -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 1ruZEx-00062y-Ps for bug-gnu-emacs@gnu.org; Wed, 10 Apr 2024 10:47:55 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ruZF6-0002uU-5N for bug-gnu-emacs@gnu.org; Wed, 10 Apr 2024 10:48:04 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Pedro Andres Aranda Gutierrez Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 10 Apr 2024 14:48:03 +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.171276047911134 (code B ref 70321); Wed, 10 Apr 2024 14:48:03 +0000 Original-Received: (at 70321) by debbugs.gnu.org; 10 Apr 2024 14:47:59 +0000 Original-Received: from localhost ([127.0.0.1]:54160 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ruZEx-0002sp-8v for submit@debbugs.gnu.org; Wed, 10 Apr 2024 10:47:59 -0400 Original-Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]:53726) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ruZEq-0002qd-R1 for 70321@debbugs.gnu.org; Wed, 10 Apr 2024 10:47:52 -0400 Original-Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-a51a80b190bso362349066b.3 for <70321@debbugs.gnu.org>; Wed, 10 Apr 2024 07:47:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712760454; x=1713365254; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=efMWiYCShcEAx3puS6n+GOfJb7j2aZhOGJhGPSHuwjM=; b=QEcvn5srGqCNO5VQ27PmnJBiosUI3PnJM51/MvAzehciyt6Af9golh0hHZ3BsFia4a 6KA7m5BMOUkqy8c4HIMC73EIKC0lpiJGM6HcwlmJVVvbhFjURw3My67Et/6G7p7QMyej 9FNNMWtoM06URY2PgrA1YAKLqTWPwQ+hM8Ibyn0aApcEse+2J9tEHniQfBAcZ6DM+OHV gLCXZMCZMbbS+zOR8w3FEHXgZ5Y65VMT2NMcZhmIpTWUx4y+iqynq18C3wScH1fA0WsL pucV1+HBZCPjCL8recIM3SC6jLsx61swb4Z+ICKVfmKQ2Fr9Sdm38Ej0rBjkmHXk6h51 CCSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712760454; x=1713365254; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=efMWiYCShcEAx3puS6n+GOfJb7j2aZhOGJhGPSHuwjM=; b=OgGWJafGzFPw8pBNs8V+NendJNFCWndoQxzxaglG9/mecESRFSrpBHoh5WdbJUMCIF 7HkyW/qNJwb01z/Cjo50SRM4y7wx3e5ZH6TOKhBQ+q/tq5CqIHCwVrO4kodJ8sZu7ska v2pIjaFEVYJSA9rUxFWR0xPJNfgHzksCZ6MjYntYYNC4Euxz1jwWXf4x/ki6ub7vJzHe mPwfYH0qABgl7A9Gax6LwxTw95r+2aKAR1FTdv5Dpi1X91k0Oqif4ha51gvwoQHBaadp ibnBB8KvHiAtZqhH417deNk78t7re7ArHJFj9giNa1YoPkr7xBvnNi42qFZ06SKSq2lP H99g== X-Forwarded-Encrypted: i=1; AJvYcCX2eRwpJlk5vhnDawwsdyCv5FbYqtiEr3tchdhBneKPspxGF/ClVUwR/mSrNQnwEGQidgPoH1jwAFUBdmhSd6swJgzE/og= X-Gm-Message-State: AOJu0YxNZpMvJRzBa5l0w62wlGLhEzxJgnqAhcDaU46DAXduWCrxhvwa t5hRQ/XH/yK4sQlr83qLopVP5bZEzEJoiEElkNm30bY0PDTKfL/oTUY9FCJm7FfdbAcIvjItGDr HF3OfOWQYCMIeJHQAiJkSqasyjzk= X-Google-Smtp-Source: AGHT+IEe3TGthP+srImzC1dGsShZc0NvbZSnBZ0mwQLkIErjNddAJRUQv+4U3zqRgWS38cKf3iShLwbYKGFjJFzlmW8= X-Received: by 2002:a50:bb05:0:b0:56d:fca8:d2d6 with SMTP id y5-20020a50bb05000000b0056dfca8d2d6mr2342851ede.6.1712760454180; Wed, 10 Apr 2024 07:47:34 -0700 (PDT) In-Reply-To: <86wmp5uyh1.fsf@gnu.org> 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:283051 Archived-At: --00000000000074feb30615bf1e86 Content-Type: text/plain; charset="UTF-8" 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 wrote: > > 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? > -- 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 --00000000000074feb30615bf1e86 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Wonderful... those three lines are helpful. Could they mak= e it to Emacs base or to the manual?

On Wed, 10 Apr 2024 at 15:41, Eli Zaret= skii <eliz@gnu.org> wrote:
> From: Pedro Andre= s 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)<= br> >
> ---cut here---
> (setq inhibit-startup-screen t)
>
> (defun auto-complete-text-off ()
>=C2=A0 =C2=A0(message "Trying to turn off ispell completion...&quo= t;)
>=C2=A0 =C2=A0(setopt text-mode-ispell-word-completion nil))
>
> (add-hook 'org-mode-hook #'auto-complete-text-off)
> (add-hook 'org-mode-hook #'(lambda()
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (ispell-change-dictionary "en_GB&qu= ot;)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (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 t= he 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.=C2=A0 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:

=C2=A0 (defun auto-complete-text-off ()
=C2=A0 =C2=A0 (message "Trying to turn off ispell completion...")=
=C2=A0 =C2=A0 (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 bea= ntwortet 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 ru= n a leader-deposed hook here, but we can't yet

--00000000000074feb30615bf1e86--