GNU bug report logs - #28104
25.2; autoload defcustom should put safe-local-variable

Previous Next

Package: emacs;

Reported by: Allen Li <vianchielfaura <at> gmail.com>

Date: Tue, 15 Aug 2017 21:31:02 UTC

Severity: wishlist

Found in version 25.2

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 28104 <at> debbugs.gnu.org (full text, mbox):

From: Allen Li <vianchielfaura <at> gmail.com>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 28104 <at> debbugs.gnu.org
Subject: Re: bug#28104: 25.2; autoload defcustom should put safe-local-variable
Date: Tue, 15 Aug 2017 20:29:53 -0700
On Tue, Aug 15, 2017 at 4:57 PM, Glenn Morris <rgm <at> gnu.org> wrote:
>
> It's rare to need to autoload a defcustom.

What are some intended use cases for an autoloaded defcustom?  For me,
applying safe-local-variable seems like a leading use case.

I'm fine with writing

(defcustom foo nil
  "Doc"
  :safe 'symbolp)
;;;###autoload
(put 'foo 'safe-local-variable 'symbolp)

But that seems redundant, and especially so in such use cases where
you would want to autoload the defcustom.

;;;###autoload
(defcustom foo nil
  "Doc"
  :safe 'symbolp)
;;;###autoload
(put 'foo 'safe-local-variable 'symbolp)

You could omit the :safe in defcustom, I suppose, but the
inconsistency bugs me; defcustom can be autoloaded and defcustom can
set safe-local-variable, but not both at the same time.  It makes
either feature feel like it was tacked on as an afterthought and not
part of a homogeneous whole.

> If you need to autoload the safety property, specify it separately,
> and autoload just that statement. Otherwise I suppose you could wrap
> the defcustom in a progn and autoload the whole thing.




This bug report was last modified 4 years and 13 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.