emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] babel header arguments tutorial?


From: Thomas S . Dye
Subject: Re: [O] babel header arguments tutorial?
Date: Sun, 27 Sep 2015 06:47:48 -1000
User-agent: mu4e 0.9.12-1c98835; emacs 24.5.1

Aloha Nick,

Nick Dokos <address@hidden> writes:

> Thomas S. Dye <address@hidden> writes:
>
>> Aloha Nick,
>>
>> Nick Dokos <address@hidden> writes:
>>
>>> The implementation on the page you linked contains a typo (capital P
>>> instead of lower-case p in python) and is much more prolix than it needs
>>> to be. You can get the same effect with
>>>
>>> # Local Variables:
>>> # org-babel-default-header-args:python: ((:session . "foo")))
>>> # End:
>>>
>>> This form should be preferred for just setting variables. The eval
>>> mechanism should be used only when absolutely necessary.
>>
>> Can you elaborate why the eval mechanism should be used only when
>> absolutely necessary?  You've mentioned that a few times but I haven't
>> run across similar warnings elsewhere.
>>
>
> It's a matter of safety: eval allows you to evaluate arbitrary lisp
> code. Doing that in a local-variables block which is run when you
> open the file can lead to all kinds of damage. If you get a file
> with an eval in the local variables section, you'd better be very
> sure before opening the file in emacs.
>
> Here's one warning:
>
> http://www.gnu.org/software/emacs/manual/html_node/emacs/Safe-File-Variables.html

Thanks for the clarification.  Emacs' built-in paranoia seems
appropriate, I guess.  I get asked if I want to evaluate local variables
that might not be safe and one of my choices is to say no, in which case
the file is opened without evaluating them.  At that point I can look at
the code they propose to run and convince myself there is no mischief.

All the best,
Tom

-- 
Thomas S. Dye
http://www.tsdye.com



reply via email to

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