From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: YE Newsgroups: gmane.emacs.help Subject: Re: '(emacs)Init Syntax' customizable minor mode variables Date: Thu, 11 Aug 2022 12:19:58 +0300 Message-ID: References: <87fsi35u22.fsf@web.de> Reply-To: YE Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1676"; mail-complaints-to="usenet@ciao.gmane.io" Cc: YE , Drew Adams , help-gnu-emacs@gnu.org To: Michael Heerdegen Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 11 11:22:06 2022 Return-path: Envelope-to: geh-help-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 1oM4OC-0000D0-H2 for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 11 Aug 2022 11:22:04 +0200 Original-Received: from localhost ([::1]:46856 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oM4OA-0006hD-T9 for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 11 Aug 2022 05:22:02 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52754) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oM4ML-0006bZ-U2 for help-gnu-emacs@gnu.org; Thu, 11 Aug 2022 05:20:18 -0400 Original-Received: from out0.migadu.com ([94.23.1.103]:32442) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oM4MH-00048b-Uo for help-gnu-emacs@gnu.org; Thu, 11 Aug 2022 05:20:09 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ego.team; s=key1; t=1660209600; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5+LP5STn102LPtg7izWcpY6HSogSPtvAhUCr1R1F6mY=; b=EGPiR2t9hlolHL2xjm9lMYieRsHorfir7KvDqpemkM6o/Uknt50DXQeXfh0o4eh2tHo+7i ubySvxxTTAN1GvyGPBbY6UX3CYn4QEbLT2liYfvz0SGhMZY7CiDcGqrd/Z8IMUXAyHR2cG rP3C7ZZX3QhDjXyIAY4yftfCaggzdb8= In-Reply-To: <87fsi35u22.fsf@web.de> (Michael Heerdegen's message of "Thu, 11 Aug 2022 05:37:57 +0200") X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: ego.team Received-SPF: pass client-ip=94.23.1.103; envelope-from=yet@ego.team; helo=out0.migadu.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:138797 Archived-At: Michael Heerdegen writes: > YE writes: > >> Could someone provide an example(s) for the "customizable minor mode >> variables" that "do special things to enable the mode"? > > Enabling a mode has a lot of side effects - it's no surprise that most > modes can't be enabled by just setting the mode's variable. Just as > adding "MODE" to the mode-line won't enable the mode. That's right. It's hard to comprehend that sentence also because one normally doesn't expect variables to perform an action, especially "to enable the mode". Typically, one expects functions to do the action and variables to store values. (I suppose it's rightful to say "normally" and "typically" here, looking from the point of view of an average modern programmer.) As Drew had already mentioned, part of this confusion comes from the fact 'defcustom' can not only store values but also do things (':set'). And which frustrates not aware users from time to time (when they try to change a user option value with an ubiquitous 'setq' but that doesn't work). > There are some special examples where setting the mode variable does > suffice to turn the mode, but that's due to the kind of implementation > (you can, for example, set up the mode so that it is on, more or less, > all the time, but permanently watches the variable and does nothing and > stays silent when the variable is nil). I find this example helpful, thank you. Does it mean the word "enable" in that paragraph should be read not as "turn on the minor mode" but rather "store a state marker for the turned on minor mode"? If it is so, than the source of my confusion regarding that sentence is found. The discussed sentence: > Some customizable minor mode variables do special things to enable > the mode when you set them with Customize, but ordinary =E2=80=98setq=E2= =80=99 won=E2=80=99t do > that; to enable the mode in your init file, call the minor mode command.