[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#8613: "mode:" for minor-mode breaks set-visited-file-name

From: Stefan Monnier
Subject: bug#8613: "mode:" for minor-mode breaks set-visited-file-name
Date: Mon, 09 May 2011 19:44:46 -0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

>> (string-match "-mode\\'" (symbol-name (car form))))))
>                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> Does not compute.

Not sure why it wouldn't compute, but I'll trust you on that one.

> Anyway, that would work, tho' perhaps it could just be hard-coded in
> hack-one-local-variable-eval-safep, since the safety of mode: is not
> customizable at present, and having hooks with non-empty defaults is
> sub-optimal.

Agreed.  As mentioned recently, I'm fine with a non-nil hook as long as
it's preloaded and not defcustom.  But I think safe-local-eval-functions
would be a likely defcustom, so it should be nil.

> The only reason I could see needing :safe as an argument was if someone
> had some hypothetical minor-mode that for some reason was not safe. In
> which case, passing ":safe nil" seems like the simplest thing to me,
> rather than eg ":safe 'no", or inverting the whole thing to use :risky
> instead of :safe.

I prefer :risky.  It's always handy to be able to do things like
:foo (plist-get <bar> :foo), so ":foo nil" should behave the same as
its absence.

> But, there's no option to do this with mode:, so this is not needed to
> replace mode: for minor-modes.

Agreed.  If/when we need it we can add a :risky.  In the mean time if
someone really needs it she can add a (put 'mode
'safe-local-eval-function nil) after the define-minor-mode.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]