From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Glenn Morris Newsgroups: gmane.emacs.bugs Subject: bug#50944: malformed :safe entry in several defcustoms Date: Sun, 03 Oct 2021 19:52:45 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31582"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) Cc: 50944@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Oct 04 01:53:11 2021 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 1mXBI7-000812-1L for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 04 Oct 2021 01:53:11 +0200 Original-Received: from localhost ([::1]:54738 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mXBI5-0001Iy-4c for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 03 Oct 2021 19:53:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39320) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mXBHz-0001If-Ck for bug-gnu-emacs@gnu.org; Sun, 03 Oct 2021 19:53:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51797) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mXBHz-00029r-5K for bug-gnu-emacs@gnu.org; Sun, 03 Oct 2021 19:53:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mXBHy-0000l1-45 for bug-gnu-emacs@gnu.org; Sun, 03 Oct 2021 19:53:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Glenn Morris Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 03 Oct 2021 23:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50944 X-GNU-PR-Package: emacs Original-Received: via spool by 50944-submit@debbugs.gnu.org id=B50944.16333051742897 (code B ref 50944); Sun, 03 Oct 2021 23:53:02 +0000 Original-Received: (at 50944) by debbugs.gnu.org; 3 Oct 2021 23:52:54 +0000 Original-Received: from localhost ([127.0.0.1]:35110 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mXBHq-0000kf-5K for submit@debbugs.gnu.org; Sun, 03 Oct 2021 19:52:54 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:34166) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mXBHn-0000kQ-Ts for 50944@debbugs.gnu.org; Sun, 03 Oct 2021 19:52:53 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:59454) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mXBHi-0001tB-Lp; Sun, 03 Oct 2021 19:52:46 -0400 Original-Received: from rgm by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1mXBHh-0007u7-94; Sun, 03 Oct 2021 19:52:45 -0400 X-Spook: pipeline remailers DNDO Sarin Jasmine CONUS Abbas Al X-Ran: ,e)QW*^+?P|U (Stefan Monnier's message of "Sat, 02 Oct 2021 16:01:41 -0400") 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" Xref: news.gmane.io gmane.emacs.bugs:216313 Archived-At: Stefan Monnier wrote: >> Around 30 defcustoms (mostly in Org) state ":safe t", which is incorrect. >> The safe-local-variable property should be a predicate function of one >> argument. > > The secondary bug here is that those errors should be flagged with > a warning. Run-time warning seems easy: --- a/lisp/files.el +++ b/lisp/files.el @@ -4042,7 +4042,7 @@ It is safe if any of these conditions are met: evaluates to a non-nil value with VAL as an argument." (or (member (cons sym val) safe-local-variable-values) (let ((safep (get sym 'safe-local-variable))) - (and (functionp safep) + (and safep ;; If the function signals an error, that means it ;; can't assure us that the value is safe. (with-demoted-errors (funcall safep val))))))