emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Thomas S. Dye <tsd@tsdye.com>
To: Nick Dokos <ndokos@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: babel header arguments tutorial?
Date: Sun, 27 Sep 2015 06:47:48 -1000	[thread overview]
Message-ID: <m237xzyfkb.fsf@tsdye.com> (raw)
In-Reply-To: <87vbawziq2.fsf@pierrot.dokosmarshall.org>

Aloha Nick,

Nick Dokos <ndokos@gmail.com> writes:

> Thomas S. Dye <tsd@tsdye.com> writes:
>
>> Aloha Nick,
>>
>> Nick Dokos <ndokos@gmail.com> 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

      parent reply	other threads:[~2015-09-27 16:48 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-26 18:39 babel header arguments tutorial? Lawrence Bottorff
2015-09-26 21:39 ` Charles C. Berry
2015-09-27  8:22   ` Modification dates in Worg (was: babel header arguments tutorial?) Michael Strey
2015-09-28 15:04     ` Ista Zahn
2015-09-29  8:06       ` Modification dates in Worg Michael Strey
2015-09-29 14:38         ` Ista Zahn
2015-09-26 22:09 ` babel header arguments tutorial? Nick Dokos
2015-09-26 22:43   ` Thomas S. Dye
2015-09-27  2:41     ` Nick Dokos
2015-09-27 16:28       ` Lawrence Bottorff
2015-09-27 19:51         ` Nick Dokos
2015-09-27 16:47       ` Thomas S. Dye [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m237xzyfkb.fsf@tsdye.com \
    --to=tsd@tsdye.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=ndokos@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).