From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Always-true predicate? Date: Fri, 19 Feb 2021 09:42:34 -0500 Message-ID: References: <875z2qoqc6.fsf@gnus.org> <87eehcsal4.fsf@gmail.com> <83zh002zjm.fsf@gnu.org> <83k0r42nca.fsf@gnu.org> <87lfbkrx9r.fsf@gnus.org> 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="1370"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Eli Zaretskii , Stefan Kangas , rpluim@gmail.com, rms@gnu.org, emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Feb 19 15:43:29 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 1lD70C-0000Gs-KU for ged-emacs-devel@m.gmane-mx.org; Fri, 19 Feb 2021 15:43:28 +0100 Original-Received: from localhost ([::1]:52810 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lD70B-0008LC-LH for ged-emacs-devel@m.gmane-mx.org; Fri, 19 Feb 2021 09:43:27 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60626) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lD6zU-0007SJ-7K for emacs-devel@gnu.org; Fri, 19 Feb 2021 09:42:44 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:2482) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lD6zP-0001o2-FN; Fri, 19 Feb 2021 09:42:43 -0500 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 5D49710022E; Fri, 19 Feb 2021 09:42:37 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id D5B451000CF; Fri, 19 Feb 2021 09:42:35 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1613745755; bh=9ZBzue/paKddQnSU8qLq9aLk1eCNojHQgzsta/UAoVQ=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=P5w3Nx2Q/Uoru4oyKWf4Z2BtoIoXhkkwrl/LHrs4DW3RKYxCGYbw7HXU3qHLG0nx1 EWvnKKJepgWleWxb8yRP47NIWprZbjijcpHXeHTUrzH8ynfsv54nNShRFlIF3Q6efh 9JP0G/9mksleDBuxJeFbTPuR44cBmzPRtM+VUfWnY2QL/JYKvSODTKHlQnrjO0eaX6 niBBLueoGnw39CmTr2RFDG3+WGjZoJuPTFsIrmSErxfF7FE3wqHi8eloZL2rs2ez+v Jbg7M42qQ8P/6DnRFe3gGKP0vz6A8yHP36rFVUGsJxqHEMEQeWgIatHuKsbqLM9zDQ yjhrLhTtJaWhg== Original-Received: from alfajor (unknown [216.154.41.47]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 9832D12025D; Fri, 19 Feb 2021 09:42:35 -0500 (EST) In-Reply-To: <87lfbkrx9r.fsf@gnus.org> (Lars Ingebrigtsen's message of "Fri, 19 Feb 2021 14:40:32 +0100") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, 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:265261 Archived-At: >> And then we have this annoyance from "C-h v" as well: >> >> read-extended-command-predicate is a variable defined in =E2=80=98simp= le.el=E2=80=99. >> Its value is >> #f(compiled-function >> (s b) >> #) >> >> That's not very useful display for a user option. > > That's what prompted my query about adding something like `always'. > (Although I've been missing the predicate for years.) I love functions, and am in no small part to blame for the use of functions like `ignore` as default value of variables (more often `defvar` than `defcustom`, but still), but indeed giving name to those functions is important: it's not just that `always` saves a few bytes over `(lambda (&rest _) t)` in the `.el` file (and then again in the `.elc` and in RAM), but also that `C-h v` gives more readable output (and if that value ever finds its way elsewhere, you can easily jump to its definition). > I think using function values in user options is fine -- the Emacs > developers can never get cover all behavioural permutations that people > would like to see, so allowing them to supply their own code is helpful. I fully agree. But Eli is right that there's a tension and we should be careful not to use too often (and we should work at trying to make sure you don't need to know those functions when working with those vars, which is already taken care of in `customize-variables` but not in `set-variable`). Stefan