From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Joost Kremers Newsgroups: gmane.emacs.devel Subject: Re: Policy for declaring safe local variable values Date: Fri, 08 Oct 2021 11:55:44 +0200 Message-ID: <877denu95f.fsf@fastmail.fm> References: <87bl3z98zk.fsf@posteo.de> 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="22854"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.6.6; emacs 27.2.50 Cc: emacs-devel@gnu.org To: Titus von der Malsburg Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Oct 08 12:03:41 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 1mYmj5-0005ll-Hj for ged-emacs-devel@m.gmane-mx.org; Fri, 08 Oct 2021 12:03:40 +0200 Original-Received: from localhost ([::1]:50360 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mYmj4-0003tM-Ix for ged-emacs-devel@m.gmane-mx.org; Fri, 08 Oct 2021 06:03:38 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55348) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mYmi0-0002MF-AE for emacs-devel@gnu.org; Fri, 08 Oct 2021 06:02:32 -0400 Original-Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:35879) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mYmhx-0000vA-47 for emacs-devel@gnu.org; Fri, 08 Oct 2021 06:02:32 -0400 Original-Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 66A1E3200D25; Fri, 8 Oct 2021 06:02:24 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Fri, 08 Oct 2021 06:02:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= references:from:to:cc:subject:date:in-reply-to:message-id :mime-version:content-type:content-transfer-encoding; s=fm1; bh= d8ldZ59xN3i/sleRR05V6OsqM9II+M5N4cY0hGbGTaU=; b=mDhSSXCUAhOyKY7b YCX1yu3UezXIY5syBRJJvZ/sMEbBusOo7flLvH/TcpkWq7cixWKZHRA1sh0L3Ilj Qd0I5IUs/alJAXGoGV8sQnqjBK7pTTl0RJ13OhTuNH0/VKclL1r5C06CmUzKf+bh fjFY0T2z9rziuzfoXl9RFY/3FMRofZtK0QX/olnNFsl1NktpAINrjTwRT/AxxBXH y0SHcxiigdHJ5pEzrLJ2/K/WJcywah2er51xdugRS2ja5E1ZqcCS/HVS6sy6ItpW ZOwixy2PMDPHqcObQeiBYkgLFFXxoKHbp7717dw/uAvGXfqf+nL2Vq2Y9vQ04dxo FxFMgw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=d8ldZ59xN3i/sleRR05V6OsqM9II+M5N4cY0hGbGT aU=; b=NhEEInyhu+NLbXtuxNttbRaDANXHYy1l0bhOhAuQKmJk2CmoRK8Mo2PQO /bHH2HS16FVJnwwe9taPWDuXjRiKGLrUr2qfJwZ8IaJgxVXmGE4NlDYx/WtMQ6/w maLKsbSwhBBQHHUr+ehrUlkjDtNWrTlCadCS7+mRM93Olym78QjwPjBz6guGiVSK ZgVkFkrBDBHxpJlHLGq7YWLXKosyy/7k1DKIgWfm9Grtu0uwb4RxOLWSmEpIpyO1 vZ7XmyP7EmXkoCofWjquJfzOT0+AETNF9XLpswyQy8HkLPDOfDJi2o//hE2BhUjC C1s4L2O1ZCw29sga6dmb/cbio+O0g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrvddttddgvdduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfhgfhffvufffjgfkgggtgfesthhqredttderjeenucfhrhhomheplfhoohhs thcumfhrvghmvghrshcuoehjohhoshhtkhhrvghmvghrshesfhgrshhtmhgrihhlrdhfmh eqnecuggftrfgrthhtvghrnhepvddvgfeghfdtiefhvedvvddtjefhleejveeltdelffev hfeijeekhfdutdffgeefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrg hilhhfrhhomhepjhhoohhsthhkrhgvmhgvrhhssehfrghsthhmrghilhdrfhhm X-ME-Proxy: Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 8 Oct 2021 06:02:23 -0400 (EDT) In-reply-to: <87bl3z98zk.fsf@posteo.de> Received-SPF: pass client-ip=64.147.123.24; envelope-from=joostkremers@fastmail.fm; helo=wout1-smtp.messagingengine.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-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:276545 Archived-At: On Fri, Oct 08 2021, Titus von der Malsburg wrote: > I have a configuration variable (in package bibtex-completion) that can u= sefully be set to a local value via a =E2=80=98Local Variable=E2=80=98 comm= ent in the file. E.g: > > # Local Variables: > # bibtex-completion-bibliography: "/path/to/bibliography.bib" > # End: > > However, it=E2=80=99s annoying that users have to confirm that the local = value for this > variable is safe every time they open a file with a different value for t= hat > variable. Fun fact: answering your e-mail in Emacs I got the same question. :-) > Question: Can I declare the variable safe for local values in my > package, e.g. > > (put 'bibtex-completion-bibliography 'safe-local-variable (lambda (_) t)) > > or would that violate Emacs conventions? `defcustom` even has a keyword for it (`:safe`), so I don't think it violat= es any conventions. TBH, I use this method in some of my packages and it never occurred to me it might be against conventions... --=20 Joost Kremers Life has its moments