From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas S. Dye Subject: Re: babel header arguments tutorial? Date: Sun, 27 Sep 2015 06:47:48 -1000 Message-ID: References: <87zj08zvcl.fsf@pierrot.dokosmarshall.org> <87vbawziq2.fsf@pierrot.dokosmarshall.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52677) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZgF7V-000700-L3 for emacs-orgmode@gnu.org; Sun, 27 Sep 2015 12:48:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZgF7S-0006aS-Bv for emacs-orgmode@gnu.org; Sun, 27 Sep 2015 12:48:13 -0400 Received: from gproxy9-pub.mail.unifiedlayer.com ([69.89.20.122]:43194) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1ZgF7S-0006ZL-5D for emacs-orgmode@gnu.org; Sun, 27 Sep 2015 12:48:10 -0400 In-reply-to: <87vbawziq2.fsf@pierrot.dokosmarshall.org> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Nick Dokos Cc: emacs-orgmode@gnu.org Aloha Nick, Nick Dokos writes: > Thomas S. Dye writes: > >> Aloha Nick, >> >> Nick Dokos 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