From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Steven Allen via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#74511: 31.0.50; `dictionary-search-interface' overrides the user's customization of `dictionary-read-word-function' Date: Mon, 25 Nov 2024 11:27:39 -0800 Message-ID: <878qt73yhg.fsf@stebalien.com> References: <878qt8pik7.fsf@stebalien.com> <86sergihd5.fsf@gnu.org> <875xocpdxr.fsf@stebalien.com> <86plmjiko0.fsf@gnu.org> Reply-To: Steven Allen Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18846"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 74511@debbugs.gnu.org To: Eshel Yaron , Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Nov 25 20:28:30 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 1tFel2-0004iO-VD for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 25 Nov 2024 20:28:30 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tFekk-0004TU-LA; Mon, 25 Nov 2024 14:28:13 -0500 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 1tFekc-0004SZ-Hf for bug-gnu-emacs@gnu.org; Mon, 25 Nov 2024 14:28:04 -0500 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 1tFekc-0008Mi-43 for bug-gnu-emacs@gnu.org; Mon, 25 Nov 2024 14:28:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=/hKgBHOgHHeNBSdM0KJY509GR9dvxTfIhZo2gU56f0A=; b=jPGlyxIBhCG7s0VjuJRkg3gDgv4oPezyC4MvuPEKBi0W77cGgad0qyYAIRRKu0JNFJE7w0/pzp7NFaxwkrfCLirX1EDYwcgTTqkbEAcZx4d8Ja/C1kwFGMzpLZn03EssV/2xRmDPc6zSRpUPCGeJh1bsl7WV7IwXf/jLnqGS4A7y30yihtp2nQklr7IrN/3ODm3z3ZNgE7zCsn6ikezffBDJaE3MRLf0wgcMoTMxnqmgo7KJX9gMKAsbcI40LYTQyq/R0nkjKIuWsAz9A6FW8yCnKjzDJwTOcg/MmVp2K+WkAfB8QbT0XJYjgEF0/Yv7H9wi6Go4ZwrrNRAFWpiI2g==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tFekb-0008Ms-VC for bug-gnu-emacs@gnu.org; Mon, 25 Nov 2024 14:28:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Steven Allen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 25 Nov 2024 19:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74511 X-GNU-PR-Package: emacs Original-Received: via spool by 74511-submit@debbugs.gnu.org id=B74511.173256287332143 (code B ref 74511); Mon, 25 Nov 2024 19:28:01 +0000 Original-Received: (at 74511) by debbugs.gnu.org; 25 Nov 2024 19:27:53 +0000 Original-Received: from localhost ([127.0.0.1]:40872 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tFekS-0008ML-DY for submit@debbugs.gnu.org; Mon, 25 Nov 2024 14:27:53 -0500 Original-Received: from fout-a5-smtp.messagingengine.com ([103.168.172.148]:59407) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tFekM-0008Lp-VC for 74511@debbugs.gnu.org; Mon, 25 Nov 2024 14:27:47 -0500 Original-Received: from phl-compute-05.internal (phl-compute-05.phl.internal [10.202.2.45]) by mailfout.phl.internal (Postfix) with ESMTP id CE0531380650; Mon, 25 Nov 2024 14:27:41 -0500 (EST) Original-Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-05.internal (MEProxy); Mon, 25 Nov 2024 14:27:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=stebalien.com; h=cc:cc:content-type:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm3; t=1732562861; x= 1732649261; bh=/hKgBHOgHHeNBSdM0KJY509GR9dvxTfIhZo2gU56f0A=; b=H NojuB0nbHL2tNYcrXBPrmwPFZQaQiVkMAl3SEcHq/VouiRuHUx+F44UPiQBGfHxg J4iNOBOvhQcljOLFLKPvhwa1TzdjfjDoZ8QppcogDR3tdquTfi8SgVnaWaZPm6kF iA3oIYE/RteCV4mpvifwT24NW7fscri4WYkliKYYyrFuHnu3HSB7vlhw0kQhQumN Z0L9+VJQIDOdx0M7EgVqbh0avhKoEouGfjlluhma1XzFFjI0Zi4evWIlJzdEZ/kW 3WOHzzoVLqMuJf2mfj9fj2p40xmg8nbrjwVV9viclEW046kavmg0be+Zl+nrhCoN ad28lI5xPm/K4sdA5syAQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1732562861; x=1732649261; bh=/hKgBHOgHHeNBSdM0KJY509GR9dvxTfIhZo 2gU56f0A=; b=aRv5lEjL6fMlXhL694NZOWjibXjQync109hd6S2PsHeO0O4orpO Xm8gv1gkREYFzYUSnLqNgi4juxX+BdzyYn5CsccUpo6e7/4Vlfa+fVHnJ0vHCJ8J h6imWJTw8/qsVxNIY1SeSBcABgYlOaJXasukb2mZf7e6YbZs/pRkpn8UDqsuQp+y v5gveWp8EdpT+Hmn34cmiL4IbYDWoV+2LIHpdhhggRDmIDR3mS/gYYZLaUYDs9iw hdIehC1K/6uC5b3J2EJw9TDNVtYbivjZGwS37dmIFhFyDvOCAb1hKFzjTO6BeVgp gfDX04xAqXBOLzjd4A2jlRUzmTDc5BmWhKA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrgeehgdduvdefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephffvvefujghffffkgggtsehttdertddttddtnecu hfhrohhmpefuthgvvhgvnhcutehllhgvnhcuoehsthgvvhgvnhesshhtvggsrghlihgvnh drtghomheqnecuggftrfgrthhtvghrnhepvdekheekgeelheehgefgudelkeethffhgfeu ffetkeegtddvfeduuddttdejjedvnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrg hmpehmrghilhhfrhhomhepshhtvghvvghnsehsthgvsggrlhhivghnrdgtohhmpdhnsggp rhgtphhtthhopeefpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehmvgesvghshh gvlhihrghrohhnrdgtohhmpdhrtghpthhtohepvghlihiisehgnhhurdhorhhgpdhrtghp thhtohepjeegheduudesuggvsggsuhhgshdrghhnuhdrohhrgh X-ME-Proxy: Feedback-ID: ie8a146a7:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 25 Nov 2024 14:27:40 -0500 (EST) In-Reply-To: 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:295957 Archived-At: Eshel Yaron writes: > Hi, > > Eli Zaretskii writes: > >>> From: Steven Allen >>> Cc: 74511@debbugs.gnu.org >>> Date: Sun, 24 Nov 2024 12:36:00 -0800 >>> >>> Eli Zaretskii writes: >>> >>> >> Date: Sun, 24 Nov 2024 10:56:08 -0800 >>> >> From: Steven Allen via "Bug reports for GNU Emacs, >>> >> the Swiss army knife of text editors" >>> >> >>> >> >>> >> If the user customizes `dictionary-read-word-function' then loads the >>> >> dictionary package, the value of `dictionary-read-word-function' will be >>> >> overridden when `dictionary-search-interface' is loaded. To reproduce: >>> >> >>> >> 1. Run emacs with `emacs -Q`. >>> >> 2. Open a scratch buffer and evaluate the following: >>> >> >>> >> (setopt dictionary-read-word-function 'dictionary-completing-read-word) >>> >> (require 'dictionary) >>> >> (message "%S" dictionary-read-word-function) >>> >> >>> >> I'd expect `dictionary-read-word-function' to be >>> >> `dictionary-completing-read-word' but instead it gets reset back to the >>> >> default, `dictionary-read-dictionary-default'. I can work around this by >>> >> calling `setopt' after loading the `dictionary' package, but ideally >>> >> that wouldn't be necessary. >>> > >>> > You are supposed to customize dictionary-search-interface if you want >>> > this mode of operation. >>> >>> In addition to dictionary-search-interface, there are three separately >>> customizable variables: >>> >>> - dictionary-display-definition-function >>> - dictionary-read-word-function >>> - dictionary-read-dictionary-function >>> >>> I'd expect dictionary-search-interface to override the defaults for >>> these variables, but I wouldn't expect it to completely clobber any user >>> customizations of said variables. >>> >>> If these variables cannot be customized, I'd expect them to be "defvar" >>> not "defcustom". Although that would be rather unfortunate because, >>> while I want to enable minibuffer completion for words/dictionaries, I'd >>> also like to use the real dictionary mode (not the help buffer). >>> >>> Adding ":initialize 'custom-initialize-changed" to >>> dictionary-search-interface would make it possible to specify either >>> dictionary-search-interface or any of the other variables (but not both >>> at the same time). >> >> Eshel, would you please look into this? IMO, we should at least >> improve the documentation to clarify these subtleties. Bonus points >> for allowing users to customize the other options without clobbering >> them when the package is loaded or dictionary-search-interface is >> customized. > > Thank you Steven, for reporting this issue, and Eli, for pinging me. > > The patch below tries to do both: > > - it adds a few words to the docstring of dictionary-search-interface > which explain that this option can only be meaningfully set after > loading dictionary.el, and > - it avoids clobbering existing settings for the other options during > initialization. It still overrides existing settings for the other > options if you set dictionary-search-interface after dictionary.el, > because that's the intended behavior when customizing this option. > > WDYT? > Is adding the following to `dictionary-search-interface' not sufficient? :initialize 'custom-initialize-changed That would apply the `dictionary-search-interface' setting if and only if specified by the user while still alowing the user to, e.g., use the customize interface.