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.devel Subject: Arguing for a nilp function and where to put it Date: Sat, 1 Apr 2023 07:37:44 +0200 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23995"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Apr 01 07:39:15 2023 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 1piTxL-00066l-1i for ged-emacs-devel@m.gmane-mx.org; Sat, 01 Apr 2023 07:39:15 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1piTwO-0008K9-HH; Sat, 01 Apr 2023 01:38:16 -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 1piTwM-0008IH-BN for emacs-devel@gnu.org; Sat, 01 Apr 2023 01:38:14 -0400 Original-Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1piTwK-0003Z1-Q1 for emacs-devel@gnu.org; Sat, 01 Apr 2023 01:38:14 -0400 Original-Received: by mail-ed1-x529.google.com with SMTP id h8so97869029ede.8 for ; Fri, 31 Mar 2023 22:38:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680327491; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=S9y5Zxvxd42+IOA4O7YP8dG8aPamAPY/u8999Y1MgRo=; b=qlAD6tbV3yV+ncxpCOC/8VjMC8fYgYRX1BpDCunI7HToxzq2NaqAB11Fu6IHADPR5U JFKnwJGNL47wmuEWDjAAFHcZ4/jKzY3XSSvyJXGjajT3+u3RcEkKX6KLuWNXXVWfZYTa vd0t8Oui1MCVDIJGPViTBPV7Rf2FvfgHXW9x5/7XG7ubllxcu95N+Ypx4Rq1po09iJSc nYSwCFiVw/hgASMpxC8PiQpK2whoUvr7Sbxdb5L9vkUgq9UMdhebsuHsfnHuB5coUT0P iDzgEjZgTog6/ftquRRMPgccJeAh2cahtvfuSohE9cAkDb0jO8CvWB+7AiGQ/fjm1K9b 6jeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680327491; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=S9y5Zxvxd42+IOA4O7YP8dG8aPamAPY/u8999Y1MgRo=; b=GBPpKcoc8qRz1I04w6BVipuiD3Pe88msfEUMHDBPdPAijNNfmxpN3pspmtZNnM038S Dn0k3C0BtUBudyHpUaCGZqhLJ9G9Fi06U7dHfnwPahbJw+YBgdfasW/8xRce18Q6ZxvT JDLeMAblT6DvPbkbRjofzkXltk9iFfVGaY72tEiScGZhplVC1o7Vp6GPGGzBqVk6tEoU DNlU/GLSxYKNNlzRUf7zktLgNWwVlMza0hBJGsGr8q8NBwJUTm1RDiqgXQU5gafE7bNH GnZypCZT7Reb6rS23BJFG3sMc8AGYtE2EC7XnylSud7MWYZp5lBaLzsOSJQWfbt43kfb ErXg== X-Gm-Message-State: AAQBX9eRW0a5/UD1hHaBXncsDMpuwCjFN2/IcKhA15wj9BA8RlOVqMU0 k4kAcvTLVZC7v+aS1c/EUuoHr0yxqjVApoiaQjnBeKNfFW7oBw== X-Google-Smtp-Source: AKy350ZLUQjwjO2sHco/HTq4hjT+kaksCPLXXIzeUXvEhdHNX48O0Rub6ozhSKZSzkdznDLjfnc3E8mcFC+5Vrf+VNM= X-Received: by 2002:a17:906:81da:b0:92f:b329:cb75 with SMTP id e26-20020a17090681da00b0092fb329cb75mr7380301ejx.5.1680327490979; Fri, 31 Mar 2023 22:38:10 -0700 (PDT) Received-SPF: pass client-ip=2a00:1450:4864:20::529; envelope-from=paaguti@gmail.com; helo=mail-ed1-x529.google.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, 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.29 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:304957 Archived-At: Use case for a nilp function: I have a buffer-local variable with a default value, and I want to allow to (silently) set it to nil (and only to nil) from .dir-locals.el or Local Variables. Currently I have (defun nilp(v) (unless v t)) and I use it with (put ' 'safe-local-variable #'nilp) which is much cleaner than (put ' 'safe-local-variable (lambda (p) (unless p t))) every time I need it. I think other people may benefit from having this simple function as part of Emacs and I'm not sure whether the elisp form would be better than something more lower level like integerp and in which file it would reside best. /PA -- 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