From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#59384: 29.0.50; Visiting files in Emacs Git pops up "unsafe variable" prompt Date: Sat, 19 Nov 2022 17:38:35 -0500 Message-ID: References: <83h6yv85h4.fsf@gnu.org> <86wn7qaiep.fsf@mail.linkov.net> <83pmdi7mx2.fsf@gnu.org> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35049"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 59384@debbugs.gnu.org, Juri Linkov To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 19 23:39:12 2022 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 1owWUR-0008rO-Eb for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 19 Nov 2022 23:39:11 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1owWUK-0003kC-9g; Sat, 19 Nov 2022 17:39:04 -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 1owWUI-0003k1-Ti for bug-gnu-emacs@gnu.org; Sat, 19 Nov 2022 17:39:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1owWUI-0006Ze-LW for bug-gnu-emacs@gnu.org; Sat, 19 Nov 2022 17:39:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1owWUI-00050R-6x for bug-gnu-emacs@gnu.org; Sat, 19 Nov 2022 17:39:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 19 Nov 2022 22:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59384 X-GNU-PR-Package: emacs Original-Received: via spool by 59384-submit@debbugs.gnu.org id=B59384.166889752719222 (code B ref 59384); Sat, 19 Nov 2022 22:39:02 +0000 Original-Received: (at 59384) by debbugs.gnu.org; 19 Nov 2022 22:38:47 +0000 Original-Received: from localhost ([127.0.0.1]:41611 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1owWU3-0004zy-3c for submit@debbugs.gnu.org; Sat, 19 Nov 2022 17:38:47 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:32819) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1owWTz-0004zj-Sy for 59384@debbugs.gnu.org; Sat, 19 Nov 2022 17:38:45 -0500 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 11CCD1000F2; Sat, 19 Nov 2022 17:38:38 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 7240F100099; Sat, 19 Nov 2022 17:38:36 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1668897516; bh=bxyZ80Oow/yOmU3DFkv6XwfIy/IC19z9BMp4boZT2Ds=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=WA6U3ENMRa6hfdSzutXOvcKPziF7cM5QwKOoJmvBQ7XK5kT0pmpoImKK8bgL4JVj0 VGtWlxqZ5Br3TogL70RuL0tF+mXgTrz9N77e7oykWYf4EYCX3dyBh5gKmJj6CZCyaw wHnZljXJhAAJp4Z2R46hFCy5649MhZeYgCsxTEHH4BIBP237mJVxkl3gKxQS5/ta0v JcK6+cetQncENzfLxyZIOKFD+ols+nHXBWug2W1AwYQWxkx3n9DBg66a9D4Nqfem1v N9uyqvW4yLZSo/hip4Ofhl4cyQ3IxldguMYib0ZMug6zgR4pjfBmkFl5M0tHTHsEVc D4YUcl7Cqor/w== Original-Received: from pastel (unknown [104.247.241.157]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 453A8120C2F; Sat, 19 Nov 2022 17:38:36 -0500 (EST) In-Reply-To: <83pmdi7mx2.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 19 Nov 2022 21:40:41 +0200") 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:248379 Archived-At: >> From: Juri Linkov >> Cc: 59384@debbugs.gnu.org >> Date: Sat, 19 Nov 2022 20:49:50 +0200 >> >> > vc-git-annotate-switches : "-w" >> > bug-reference-url-format : "https://debbugs.gnu.org/%s" >> > diff-add-log-use-relative-names : t >> > * vc-prepare-patches-separately : nil >> > c-file-style : "GNU" >> > c-noise-macro-names : ("INLINE" "NO_INLINE" "ATTRIBUTE_NO_SANITIZE_UNDEFINED" "UNINIT" "CALLBACK" "ALIGN_STACK") >> > electric-quote-comment : nil >> > electric-quote-string : nil >> > indent-tabs-mode : t >> > mode : bug-reference-prog >> > >> > The problem here AFAIU is that vc-prepare-patches-separately and its >> > 'safep' property is not known to Emacs until vc.el is loaded. >> > >> > One way of fixing this would be to autoload the defcustom of this >> > variable, but AFAIR this is sometimes frowned upon? >> >> Is there a standard solution already worked out for existing >> variables like `vc-git-annotate-switches'? > > Maybe it is, but if so, I'm not aware of it. > > Stefan, any advice? AFAIK the standard solution is one of: - try to arrange for the relevant package to be loaded before hack-local-variables does its thing. That often works for major-mode dependent variables, where we try and load the major mode early enough. For the above case I can't see a good way to use this approach. - autoload the (put ' 'safe-local-variable ...) Autoloading the `defcustom` is a *bad* idea. Stefan