all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* 'risky-local-variable-p' bug in regard of the 'safe-local-variable' property?
@ 2005-06-17 23:07 drkm
  0 siblings, 0 replies; only message in thread
From: drkm @ 2005-06-17 23:07 UTC (permalink / raw)


  Hi

  Imagine I have some variable, for which 'risky-local-variable-p'
returns 't'.  But I want to change this, and say this variable is
safe when I want to set it t 'nil'.  So I use something like:

    (put '...-function 'safe-local-variable 'null)

  But 'risky-local-variable-p' ends with:

    (or (null val)
        (not (funcall safep val)))))))

so it's not possible to say a variable is safe if I try to set it
to 'nil'.  Why?  I don't understand this.  And while it's correct
in regard of the 'risky-local-variable-p' docstring:

      "Non-nil if SYM could be dangerous as a file-local variable
    with value VAL.  If VAL is nil or omitted, the question is
    whether any value might be dangerous."

it's not correct in regard of the manual (info: (elisp)File Local
Variables):

    These rules can be overridden by giving the variable's name a
    non-`nil' `safe-local-variable' property.  If one gives it a
    `safe-local-variable' property of `t', then one can give the
    variable any file local value.  One can also give any symbol,
    including the above, a `safe-local-variable' property that is
    a function taking exactly one argument.  In that case, giving
    a variable with that name a file local value is only allowed
    if the function returns non-`nil' when called with that value
    as argument.

  So what's the correct meaning of:

    (put '...-function 'safe-local-variable 'null)

in this context?  And why the "(or (null val) ..."?

--drkm

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-06-17 23:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-17 23:07 'risky-local-variable-p' bug in regard of the 'safe-local-variable' property? drkm

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.