From: Lawrence Bottorff <borgauf@gmail.com>
To: Lawrence Bottorff <borgauf@gmail.com>,
emacs-orgmode Mailinglist <emacs-orgmode@gnu.org>
Subject: Re: local variables to initialize org buffer?
Date: Mon, 1 Apr 2019 11:33:50 -0500 [thread overview]
Message-ID: <CAFAhFSXodwZf2_nEo-D0tGp0n9zBZ8Zyhj9gU+9rUwvuSyaBWA@mail.gmail.com> (raw)
In-Reply-To: <87h8bi9qp0.fsf@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1868 bytes --]
I've got this in my config.org , which is called by my init.el:
#+begin_src emacs-lisp
(defun borgauf/execute-startup-block ()
(interactive)
(progn (org-babel-goto-named-src-block "startup")
(org-babel-execute-src-block)))
#+end_src
then in my org-mode file I have this at the bottom:
* Comments
#+name: startup
#+BEGIN_SRC emacs-lisp :results silent
;(progn (slime) (org-babel-execute-buffer))
(slime)
(org-babel-execute-buffer)
#+END_SRC
# Local Variables:
# eval: (borgauf/execute-startup-block)
# End:
This is starting the slime repl just fine, but not doing the
(org-babel-execute-buffer). I can then manually run C-c C-v b and it indeed
runs all the code blocks. So, I'm guessing that after the (slime) is
performed, it doesn't return focus to my calling org-mode buffer and
the (org-babel-execute-buffer) is running to no avail in the slime repl
buffer?
On Mon, Apr 1, 2019 at 1:37 AM Eric S Fraga <esflists@gmail.com> wrote:
> 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
>
[-- Attachment #2: Type: text/html, Size: 2796 bytes --]
prev parent reply other threads:[~2019-04-01 16:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-01 2:05 local variables to initialize org buffer? Lawrence Bottorff
2019-04-01 2:33 ` Berry, Charles
2019-04-01 3:59 ` Lawrence Bottorff
2019-04-01 16:13 ` Berry, Charles
2019-04-01 6:37 ` Eric S Fraga
2019-04-01 16:33 ` Lawrence Bottorff [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=CAFAhFSXodwZf2_nEo-D0tGp0n9zBZ8Zyhj9gU+9rUwvuSyaBWA@mail.gmail.com \
--to=borgauf@gmail.com \
--cc=emacs-orgmode@gnu.org \
/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).