From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ergus Newsgroups: gmane.emacs.devel Subject: Syntax sugar question Date: Sun, 11 Apr 2021 05:07:11 +0200 Message-ID: <20210411030711.cpbbesqkuipt3lzc@Ergus> References: <20210411030711.cpbbesqkuipt3lzc.ref@Ergus> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13673"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Apr 11 05:08:35 2021 Return-path: Envelope-to: ged-emacs-devel@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 1lVQSg-0003TE-Kx for ged-emacs-devel@m.gmane-mx.org; Sun, 11 Apr 2021 05:08:34 +0200 Original-Received: from localhost ([::1]:38914 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lVQSf-0007xQ-Ji for ged-emacs-devel@m.gmane-mx.org; Sat, 10 Apr 2021 23:08:33 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36524) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lVQRo-0007Yc-4H for emacs-devel@gnu.org; Sat, 10 Apr 2021 23:07:40 -0400 Original-Received: from sonic311-15.consmr.mail.bf2.yahoo.com ([74.6.131.125]:38675) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lVQRl-0004Si-S3 for emacs-devel@gnu.org; Sat, 10 Apr 2021 23:07:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1618110455; bh=U63KgawjdmkjCNlcAEuO3ML7lXw9+Iqp4UNl8e2ueCw=; h=Date:From:To:Subject:References:From:Subject:Reply-To; b=GzxFlCX/QA1199bcfNXMFKKVTTEJgvWetNA8eKuVVpDYWShepjYX8v1t4H3aSfXVPOaq8Zbm+uUWWe4+5dUSEw6Lc40+D0ORRdeAAJFxNk5reFuOYeYKIA5fFpwGu50h/O7l9BaC/u6AdMmMGJqtWKyEeu0l1O4GcQi9oxeE7paQ5KkaMZZwirY27v0FYqSPh4+NXJVNp7ltAHXzz8QserhKE4LtGb5Gxdpk3PFkDgtgMWyl+SSnLPBo+b8WG8a9rD3SUKZYKg/Pc1aQR87UnfbMWucQOH/VYmEyky5SgsTdZIQkFsCyt07k3XfliIksHfh0WL12BeIHntfEZyFPVw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1618110455; bh=YEyRzD85W83iCtqGlapjXW0QzeQ+O/i11xghOnKi7Ew=; h=X-Sonic-MF:Date:From:To:Subject:From:Subject; b=V5JBVJa4efwXXv3ArikBYTXC2VtGIFzBeidUVcwrcRwoVuFEO72LyjjG+u2xj1NsCHEzylkCnJ9UqPOVDHKmhnPKMBFK61jRf5jJcsfk8HEYE0cRv2Ml2l9dr8JzmC1JqlfeEwygw1mb9KI/CMqWqH3e/Jp8/FKgGqCTyebArooBlHUYEjeGNcg73/TDmRBrmy+A22alucNUVWR0PzVPJnI7ZtOiQllCh53ccKPPqdpNdyXgEFsHX2X3rNc9f8vs+Tny2UjGaSVDXs7thSiYem18NfdtXhXRg6YovvMbA9ZJjkWMqNZ7Arsq9Kx2W4I1i+1jN3OBMyL6rZoNQf4GbA== X-YMail-OSG: 14sJIygVM1mtPi4o9X38EoHI0O6x5f8NxADcubVgzWegRzmxZDbo1FDUxiGGE8w eQkhYH98cLm5p4lqBtM6Nf84dFMU2uQCBRplLMCeGW9h1Je5.gAKFlbbEcGZKHJfiyQ442JYfCZo kx8WFZMEEC3XswqDH0I_4nGTK3KVF4cY3URhV2tgq_U9DWuToF0v863.OX70d_nd04N1AZ5dcWRl iNLkFQkLQQRu1A2OrgFlhoWXaCC.xCg8eVTmmODEFc.N.KprE23yhbSy71AV93e.jb7mvTwT1VDE X3QtXGGhhG1o6ErNU7hkK4AxidkcP_NfZ0cl2UWavymy6yxuQmJXgBUSkd7B4C1e8J6tfjJ8LYZK gK4vHtuEAB9d8jJwppQRdg0JKPCxndIFU.jLp4a2M4ZTXmWndQ2fXtJa4ku62ith2vkyugmdM2E9 mnaSYGqGfZ52JOdX4ZbMbc8w8KY8KK9msjlX7tT6hcm0YZHvNqZXhH.qIZ6QKwdRvVcumMiGL3Qg M7b9AyiRapbzI.Ssx4Cd7Jd8hOcm0EhCXForqT52lHpKeod.JmAHmJpf95RVc2mv.R.iZrwz367Y aCg6F.R0XrGyJOGuJS7H.KQytJzHit_MBRpDMEu6RmpfwUdIaItLXGpy4VDgAF5kWSEHZ.DPsxhm vid0a.elxcd3k.zrowk3viLLOUaRCnIQUEsVe3Qv_PFKSN8XQtdx5fvQIIJJjl6EK7Ik6MHDNnPp n711P9oT0LZneg2Nwzk61jK9OiebjSi9gTnxX2MtW73x9JY9Hinv5YirdjWIk1S.8cia7UEfH8Fq poI.8ENqn5pQ7Gv_ADvP1ZAwKi4mOwvoouyMHtAxD2 X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic311.consmr.mail.bf2.yahoo.com with HTTP; Sun, 11 Apr 2021 03:07:35 +0000 Original-Received: by kubenode549.mail-prod1.omega.ir2.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID e5268ebb3ad42ddf7c0775f4fd8311ac; Sun, 11 Apr 2021 03:07:29 +0000 (UTC) Content-Disposition: inline X-Mailer: WebService/1.1.18121 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.aol Apache-HttpAsyncClient/4.1.4 (Java/16) Received-SPF: pass client-ip=74.6.131.125; envelope-from=spacibba@aol.com; helo=sonic311-15.consmr.mail.bf2.yahoo.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:267851 Archived-At: Hi: Following something mentioned before I would like to repeat a question that IMO is so simple that there may be a reason why it is not implemented in this way. Why the minor modes variables are only t or nil? At the moment when we want to configure certain behavior we need to set an extra custom or create a secondary mode like: (setq myvar 'something) (mymode-name 1) or (mymode-name 1) (mymode-name-auxiliar 1) and of course in the code we need to check both and add the extra config in the init file for the user. Some modes need that myvar will be set before because in the minor-mode function there is code like: ``` (if mymode-name (if (eq myvar 'something) bla foo) elsething) ``` So finally the question is: Does it makes sense to add the possibility in define-minor-mode and related functions in order to do: (mymode-name 'something) So mymode-name will be 'something, myvar will disappear and the above code could become simpler either using cond and or pcase and a single nesting level condition? In principle this won't break backward compatibility and may improve readability and simplify several conditions. Does it makes sense? Best, Ergus