emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] org babel before excute hook


From: Henning Redestig
Subject: Re: [O] org babel before excute hook
Date: Mon, 14 Oct 2013 08:45:28 +0200

if anyone is interested in this, a simple defadvice appears to be a good option, I put

(defadvice org-babel-execute-maybe (around org-babel-stop-on-collision)
  "stop execution of result file defined more than once"
  (let ((info (org-babel-get-src-block-info)))
    (setq result-file (cdr (assoc :file (nth 2 info))))
    (if (save-excursion
          (goto-char 0)
          (re-search-forward (concat ":file +" result-file) nil t)
          (re-search-forward (concat ":file +" result-file) nil t))
        (error (concat result-file " defined in more than one source block"))
      ad-do-it)))
(ad-activate 'org-babel-execute-maybe)


in my .emacs and appear to get the desired functionality




2013/10/13 Samuel Wales <address@hidden>
In case it helps, there is org-confirm-babel-evaluate.

(But I have not found it to be useful, because it does not seem to
place point in a place where you can check properties, etc.)

Samuel

--
The Kafka Pandemic: http://thekafkapandemic.blogspot.com

The disease DOES progress.  MANY people have died from it.  ANYBODY can get it.

Denmark: free Karina Hansen NOW.


reply via email to

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