emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] local variables to initialize org buffer?


From: Eric S Fraga
Subject: Re: [O] local variables to initialize org buffer?
Date: Mon, 01 Apr 2019 07:37:15 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

On Sunday, 31 Mar 2019 at 21:05, Lawrence Bottorff wrote:
> I'm trying to figure out how to start up slime and do
> org-babel-execute-buffer when I open a certain org-mode file full of Lisp
> source code blocks. I guess
>
> Local Variables:
>  eval: (elisp-function)
>  End:
>
> is discouraged. 

It is discouraged but not disallowed.  I use this:

# eval: (esf/execute-startup-block)

where 

#+begin_src emacs-lisp
  (defun esf/execute-startup-block ()
    (interactive)
    (org-babel-goto-named-src-block "startup")
    (org-babel-execute-src-block))
#+end_src

which will execute any org src block named startup whenever I visit the
file (but with confirmation required).  It is incumbent on me knowing
that the src block is safe to execute and I only say yes for files that
are mine.

-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.2.2-324-gd58827



reply via email to

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