From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.devel Subject: Re: Unsafe local variable in eglot.el Date: Fri, 10 Mar 2023 08:44:43 +0100 Message-ID: <87pm9hoxpp.fsf@gnu.org> References: <83mt4m2w23.fsf@gnu.org> <831qly2l5k.fsf@gnu.org> <877cvqyupi.fsf@gnu.org> <87356ejcg8.fsf@gmail.com> 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="22270"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.9.22; emacs 30.0.50 Cc: Eli Zaretskii , emacs-devel@gnu.org, Sam Steingold To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Mar 10 08:47:35 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 1paXTS-0005Zp-OK for ged-emacs-devel@m.gmane-mx.org; Fri, 10 Mar 2023 08:47:34 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1paXSa-0006hA-OV; Fri, 10 Mar 2023 02:46:42 -0500 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 1paXSW-0006gr-Nf for emacs-devel@gnu.org; Fri, 10 Mar 2023 02:46:36 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1paXSV-000173-0F; Fri, 10 Mar 2023 02:46:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-reply-to:Date:Subject:To:From: References; bh=NTnHvqoT5PbpUTrTNl+n888ksE2oLTiUmWxwnE6z63c=; b=cFZG+X3PCJqakO e2krZvTGBcE+MXvFrD8NI5RH3yAaoMCqhvz6rEGaFV/2pDEYKq3AZa3PBcApjpJ1Fs7nckGosWCXi cHtByflJdKWdr9ZkSTLgv6vebGM3pyIaWaVJFfswjPyF2KV+Sh0U5UdoDRf60IRIxLY4hi03HtZ2X vsNJKz29wNs8UMKg7oDpYFb9WDU2U1oIi8oimc+VUdls4xtmh4viCQuzOQr+UZZnWfqYHwdX1q1DX svlRO25h8gSBYNAjydj0N75yAxyA+8VdSNKR0HqC3gHeYABah0z92ohKDjM9OmW3jGi36/O+wqUiH AR1wdrlVU9R4TClDIGeg==; Original-Received: from auth2-smtp.messagingengine.com ([66.111.4.228]) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1paXSQ-0007xt-M2; Fri, 10 Mar 2023 02:46:32 -0500 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailauth.nyi.internal (Postfix) with ESMTP id 3E2BB27C0054; Fri, 10 Mar 2023 02:46:30 -0500 (EST) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Fri, 10 Mar 2023 02:46:30 -0500 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvddujedguddtlecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpehffgfhvfevufffjgfkgggtgfesthhqredttderjeenucfhrhhomhepvfgr shhsihhlohcujfhorhhnuceothhsughhsehgnhhurdhorhhgqeenucggtffrrghtthgvrh hnpeduteeiteehieevjeegvdejgeegteeifeefgeevjefgueejvdekhefhtdefudffueen ucffohhmrghinhepvghlrdhsohenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmh epmhgrihhlfhhrohhmpehthhhorhhnodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhi thihqdekieejfeekjeekgedqieefhedvleekqdhtshguhheppehgnhhurdhorhhgsehfrg hsthhmrghilhdrfhhm X-ME-Proxy: Feedback-ID: ib2b94485:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 10 Mar 2023 02:46:28 -0500 (EST) In-reply-to: <87356ejcg8.fsf@gmail.com> 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:304230 Archived-At: Jo=C3=A3o T=C3=A1vora writes: >> Not sure what to do here. Maybe adding an autoload-cookie to >> eglot--debbugs-or-github-bug-uri does the trick? Of course, then you >> cannot find eglot.el without loading it at the same time... > > See my 01b65d442a commit to Emacs 29. It's autoloading a "progn" > block in eglot.el. So visiting the file with bug-reference-mode does > trigger a call to the helper function, which now exists. But that > call by itself won't cause eglot.el to to be loaded. It's not very > elegant, but it does solve the program effectively, I think (and the > links work, of course). Ah, and indeed that's the documented way according to (info "(elisp) File Local Variables"): --8<---------------cut here---------------start------------->8--- When defining a user option using =E2=80=98defcustom=E2=80=99, you can s= et its =E2=80=98safe-local-variable=E2=80=99 property by adding the arguments =E2= =80=98:safe FUNCTION=E2=80=99 to =E2=80=98defcustom=E2=80=99 (*note Variable Definitions::). However, a = safety predicate defined using =E2=80=98:safe=E2=80=99 will only be known once the= package that contains the =E2=80=98defcustom=E2=80=99 is loaded, which is often too late= . As an alternative, you can use the autoload cookie (*note Autoload::) to assign the option its safety predicate, like this: ;;;###autoload (put 'VAR 'safe-local-variable 'PRED) The safe value definitions specified with =E2=80=98autoload=E2=80=99 are co= pied into the package=E2=80=99s autoloads file (=E2=80=98loaddefs.el=E2=80=99 for most pa= ckages bundled with Emacs), and are known to Emacs since the beginning of a session. --8<---------------cut here---------------end--------------->8--- Great that it works now as intended. Bye, Tassilo