Commit 165f7383 authored by Bastien's avatar Bastien

Update Org to 9.3

parent 821de968
Pipeline #4229 failed with stage
in 59 minutes and 52 seconds
This diff is collapsed.
This diff is collapsed.
% Reference Card for Org Mode
\def\orgversionnumber{9.1.9}
\def\versionyear{2018} % latest update
\input emacsver.tex
\input org-version.tex
%**start of header
\newcount\columnsperpage
......@@ -79,9 +77,6 @@
\centerline{Released under the terms of the GNU General Public License}
\centerline{version 3 or later.}
\centerline{For more Emacs documentation, and the \TeX{} source for this card, see}
\centerline{the Emacs distribution, or {\tt https://www.gnu.org/software/emacs}}
\endgroup}
% make \bye not \outer so that the \def\bye in the \else clause below
......@@ -271,8 +266,10 @@
\def\threecol#1#2#3{\hskip\keyindent\relax#1\hfil&\kbd{#2}\hfil\quad
&\kbd{#3}\hfil\quad\cr}
\def\noteone{{\small \hfill [1]}}
\def\notetwo{{\small \hfill [2]}}
%\def\noteone{{\small \hfill [1]}}
%\def\notetwo{{\small \hfill [2]}}
\def\noteone{{\small [1]}}
\def\notetwo{{\small [2]}}
%**end of header
......@@ -292,6 +289,7 @@ \section{Visibility Cycling}
\key{restore property-dependent startup visibility}{C-u C-u TAB}
\metax{show the whole file, including drawers}{C-u C-u C-u TAB}
\key{reveal context around point}{C-c C-r}
\metax{toggle indented view}{M-x org-indent-mode}
\section{Motion}
......@@ -458,7 +456,7 @@ \section{Working with Code (Babel)}
\key{go to the next code block}{C-c C-v n}
\key{go to the previous code block}{C-c C-v p}
\key{demarcate a code block}{C-c C-v d}
\key{execute the next key sequence in the code edit buffer}{C-c C-v x}
\key{execute next key sequence in code edit buffer}{C-c C-v x}
\key{execute all code blocks in current buffer}{C-c C-v b}
\key{execute all code blocks in current subtree}{C-c C-v s}
\key{tangle code blocks in current file}{C-c C-v t}
......@@ -468,13 +466,14 @@ \section{Working with Code (Babel)}
\key{load the current code block into a session}{C-c C-v l}
\key{view sha1 hash of the current code block}{C-c C-v a}
\section{Completion}
\section{Completion and Template Insertion}
In-buffer completion completes TODO keywords at headline start, TeX
macros after ``{\tt \\}'', option keywords after ``{\tt \#-}'', TAGS
after ``{\tt :}'', and dictionary words elsewhere.
\key{complete word at point}{M-TAB}
\key{structure template (insert or wrap region)}{C-c C-,}
\newcolumn
......@@ -485,8 +484,8 @@ \section{Completion}
\section{TODO Items and Checkboxes}
\key{rotate the state of the current item}{C-c C-t}
\metax{select next/previous state}{S-LEFT/RIGHT}
\metax{select next/previous set}{C-S-LEFT/RIGHT}
\metax{select next/previous state}{\quad\quad S-LEFT/RIGHT}
\metax{select next/previous set}{\quad\quad\quad C-S-LEFT/RIGHT}
\key{toggle ORDERED property}{C-c C-x o}
\key{view TODO items in a sparse tree}{C-c / t}
......@@ -512,19 +511,19 @@ \section{Properties and Column View}
\key{set property/effort}{C-c C-x p/e}
\key{special commands in property lines}{C-c C-c}
\key{next/previous allowed value}{S-left/right}
\key{next/previous allowed value}{S-LEFT/RIGHT}
\key{turn on column view}{C-c C-x C-c}
\key{capture columns view in dynamic block}{C-c C-x i}
\key{quit column view}{q}
\key{show full value}{v}
\key{edit value}{e}
\metax{next/previous allowed value}{n/p or S-left/right}
\metax{next/previous allowed value}{n/p or S-LEFT/RIGHT}
\key{edit allowed values list}{a}
\key{make column wider/narrower}{> / <}
\key{move column left/right}{M-left/right}
\key{add new column}{M-S-right}
\key{Delete current column}{M-S-left}
\key{move column left/right}{M-LEFT/RIGHT}
\key{add new column}{M-S-RIGHT}
\key{Delete current column}{M-S-LEFT}
\section{Timestamps}
......@@ -536,8 +535,8 @@ \section{Timestamps}
\key{insert SCHEDULED timestamp}{C-c C-s}
\key{create sparse tree with all deadlines due}{C-c / d}
\key{the time between 2 dates in a time range}{C-c C-y}
\metax{change timestamp at cursor $\pm 1$ day}{S-RIGHT/LEFT\notetwo}
\key{change year/month/day at cursor by $\pm 1$}{S-UP/DOWN\notetwo}
\metax{change timestamp at cursor $\pm 1$ day}{\quad\quad\quad\quad S-RIGHT/LEFT \notetwo}
\key{change year/month/day at cursor by $\pm 1$}{S-UP/DOWN \notetwo}
\key{access the calendar for the current date}{C-c >}
\key{insert timestamp matching date in calendar}{C-c <}
\key{access agenda for current date}{C-c C-o}
......@@ -666,8 +665,6 @@ \section{Exporting and Publishing}
\key{toggle fixed width for entry or region}{C-c :}
\key{toggle pretty display of scripts, entities}{C-c C-x {\tt\char`\\}}
{\bf Comments: Text not being exported}
Lines starting with \kbd{\#} and subtrees starting with COMMENT are
never exported.
......
<!-- Copyright (C) 2003-2004, 2007-2019 Free Software Foundation, Inc.
This file is part of GNU Emacs.
GNU Emacs is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
GNU Emacs is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. -->
<?xml version="1.0"?>
<locatingRules xmlns="http://thaiopensource.com/ns/locating-rules/1.0">
<transformURI fromPattern="*.xml" toPattern="*.rnc"/>
<uri pattern="*.xsl" typeId="XSLT"/>
<uri pattern="*.html" typeId="XHTML"/>
<uri pattern="*.rng" typeId="RELAX NG"/>
<uri pattern="*.rdf" typeId="RDF"/>
<uri pattern="*.dbk" typeId="DocBook"/>
<namespace ns="http://www.w3.org/1999/XSL/Transform" typeId="XSLT"/>
<namespace ns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" typeId="RDF"/>
<namespace ns="http://www.w3.org/1999/xhtml" typeId="XHTML"/>
<namespace ns="http://relaxng.org/ns/structure/1.0" typeId="RELAX NG"/>
<namespace ns="http://thaiopensource.com/ns/locating-rules/1.0"
uri="locate.rnc"/>
<documentElement localName="stylesheet" typeId="XSLT"/>
<documentElement prefix="xsl" localName="transform" typeId="XSLT"/>
<documentElement localName="html" typeId="XHTML"/>
<documentElement localName="grammar" typeId="RELAX NG"/>
<documentElement prefix="" localName="article" typeId="DocBook"/>
<documentElement prefix="" localName="book" typeId="DocBook"/>
<documentElement prefix="" localName="chapter" typeId="DocBook"/>
<documentElement prefix="" localName="part" typeId="DocBook"/>
<documentElement prefix="" localName="refentry" typeId="DocBook"/>
<documentElement prefix="" localName="section" typeId="DocBook"/>
<documentElement localName="RDF" typeId="RDF"/>
<documentElement prefix="rdf" typeId="RDF"/>
<documentElement localName="locatingRules" uri="locate.rnc"/>
<typeId id="XSLT" uri="xslt.rnc"/>
<typeId id="RELAX NG" uri="relaxng.rnc"/>
<typeId id="XHTML" uri="xhtml.rnc"/>
<typeId id="DocBook" uri="docbook.rnc"/>
<typeId id="RDF" uri="rdfxml.rnc"/>
<documentElement prefix="office" typeId="OpenDocument"/>
<documentElement prefix="manifest" localName="manifest" typeId="OpenDocument Manifest"/>
<typeId id="OpenDocument" uri="od-schema-v1.2-os.rnc"/>
<typeId id="OpenDocument Manifest" uri="od-manifest-schema-v1.2-os.rnc"/>
</locatingRules>
......@@ -34,11 +34,9 @@
(require 'cc-mode)
(require 'ob)
(require 'org-macs)
(declare-function org-entry-get "org" (pom property &optional inherit literal-nil))
(declare-function org-remove-indentation "org" (code &optional n))
(declare-function org-trim "org" (s &optional keep-lead))
(defvar org-babel-tangle-lang-exts)
(add-to-list 'org-babel-tangle-lang-exts '("C++" . "cpp"))
......@@ -375,8 +373,8 @@ FORMAT can be either a format string or a function which is called with VAL."
(pcase (org-babel-C-val-to-base-type v)
(`stringp (setq type 'stringp))
(`floatp
(if (or (not type) (eq type 'integerp))
(setq type 'floatp)))
(when (or (not type) (eq type 'integerp))
(setq type 'floatp)))
(`integerp
(unless type (setq type 'integerp)))))
val)
......@@ -395,9 +393,9 @@ of the same value."
(setq val (string-to-char val))))
(let* ((type-data (org-babel-C-val-to-C-type val))
(type (car type-data))
(formated (org-babel-C-format-val type-data val))
(suffix (car formated))
(data (cdr formated)))
(formatted (org-babel-C-format-val type-data val))
(suffix (car formatted))
(data (cdr formatted)))
(format "%s %s%s = %s;"
type
var
......
......@@ -31,8 +31,8 @@
;;; Code:
(require 'ob)
(require 'org-macs)
(declare-function org-trim "org" (s &optional keep-lead))
(declare-function j-console-ensure-session "ext:j-console" ())
(defcustom org-babel-J-command "jconsole"
......
......@@ -27,6 +27,7 @@
;;; Code:
(require 'ob)
(require 'org-macs)
(require 'calc)
(require 'calc-trail)
(require 'calc-store)
......@@ -34,7 +35,6 @@
(declare-function calc-store-into "calc-store" (&optional var))
(declare-function calc-recall "calc-store" (&optional var))
(declare-function math-evaluate-expr "calc-ext" (x))
(declare-function org-trim "org" (s &optional keep-lead))
(defvar org-babel-default-header-args:calc nil
"Default arguments for evaluating a calc source block.")
......
......@@ -41,26 +41,30 @@
;;; Code:
(require 'cl-lib)
(require 'ob)
(require 'org-macs)
(declare-function cider-jack-in "ext:cider" (&optional prompt-project cljs-too))
(declare-function cider-current-connection "ext:cider-client" (&optional type))
(declare-function cider-current-ns "ext:cider-client" ())
(declare-function cider-repls "ext:cider-connection" (&optional type ensure))
(declare-function nrepl--merge "ext:nrepl-client" (dict1 dict2))
(declare-function nrepl-dict-get "ext:nrepl-client" (dict key))
(declare-function nrepl-dict-put "ext:nrepl-client" (dict key value))
(declare-function nrepl-request:eval "ext:nrepl-client"
(input callback connection &optional session ns line column additional-params))
(declare-function nrepl-sync-request:eval "ext:nrepl-client"
(input connection session &optional ns))
(declare-function org-trim "org" (s &optional keep-lead))
(declare-function nrepl-request:eval "ext:nrepl-client" (input callback connection &optional ns line column additional-params tooling))
(declare-function nrepl-sync-request:eval "ext:nrepl-client" (input connection &optional ns tooling))
(declare-function slime-eval "ext:slime" (sexp &optional package))
(defvar nrepl-sync-request-timeout)
(defvar cider-buffer-ns)
(defvar sesman-system)
(defvar cider-version)
(defvar org-babel-tangle-lang-exts)
(add-to-list 'org-babel-tangle-lang-exts '("clojure" . "clj"))
(defvar org-babel-default-header-args:clojure '())
(defvar org-babel-header-args:clojure '((package . :any)))
(defvar org-babel-header-args:clojure '((ns . :any)
(package . :any)))
(defcustom org-babel-clojure-sync-nrepl-timeout 10
"Timeout value, in seconds, of a Clojure sync call.
......@@ -80,19 +84,39 @@ If the value is nil, timeout is disabled."
(const :tag "cider" cider)
(const :tag "SLIME" slime)))
(defcustom org-babel-clojure-default-ns "user"
"Default Clojure namespace for source block when finding ns failed."
:type 'string
:group 'org-babel)
(defun org-babel-clojure-cider-current-ns ()
"Like `cider-current-ns' except `cider-find-ns'."
(or cider-buffer-ns
(let ((repl-buf (cider-current-connection)))
(and repl-buf (buffer-local-value 'cider-buffer-ns repl-buf)))
org-babel-clojure-default-ns))
(defun org-babel-expand-body:clojure (body params)
"Expand BODY according to PARAMS, return the expanded body."
(let* ((vars (org-babel--get-vars params))
(ns (or (cdr (assq :ns params))
(org-babel-clojure-cider-current-ns)))
(result-params (cdr (assq :result-params params)))
(print-level nil) (print-length nil)
(print-level nil)
(print-length nil)
(body (org-trim
(if (null vars) (org-trim body)
(concat "(let ["
(mapconcat
(lambda (var)
(format "%S (quote %S)" (car var) (cdr var)))
vars "\n ")
"]\n" body ")")))))
(concat
;; Source block specified namespace :ns.
(and (cdr (assq :ns params)) (format "(ns %s)\n" ns))
;; Variables binding.
(if (null vars) (org-trim body)
(format "(let [%s]\n%s)"
(mapconcat
(lambda (var)
(format "%S (quote %S)" (car var) (cdr var)))
vars
"\n ")
body))))))
(if (or (member "code" result-params)
(member "pp" result-params))
(format "(clojure.pprint/pprint (do %s))" body)
......@@ -102,9 +126,9 @@ If the value is nil, timeout is disabled."
"Execute a block of Clojure code with Babel.
The underlying process performed by the code block can be output
using the :show-process parameter."
(let ((expanded (org-babel-expand-body:clojure body params))
(response (list 'dict))
result)
(let* ((expanded (org-babel-expand-body:clojure body params))
(response (list 'dict))
result)
(cl-case org-babel-clojure-backend
(cider
(require 'cider)
......@@ -117,8 +141,7 @@ using the :show-process parameter."
(let ((nrepl-sync-request-timeout
org-babel-clojure-sync-nrepl-timeout))
(nrepl-sync-request:eval expanded
(cider-current-connection)
(cider-current-ns))))
(cider-current-connection))))
(setq result
(concat
(nrepl-dict-get response
......@@ -152,8 +175,7 @@ using the :show-process parameter."
(nrepl--merge response resp)
;; Update the status of the nREPL output session.
(setq status (nrepl-dict-get response "status")))
(cider-current-connection)
(cider-current-ns))
(cider-current-connection))
;; Wait until the nREPL code finished to be processed.
(while (not (member "done" status))
......@@ -193,6 +215,69 @@ using the :show-process parameter."
(condition-case nil (org-babel-script-escape result)
(error result)))))
(defun org-babel-clojure-initiate-session (&optional session _params)
"Initiate a session named SESSION according to PARAMS."
(when (and session (not (string= session "none")))
(save-window-excursion
(cond
((org-babel-comint-buffer-livep session) nil)
;; CIDER jack-in to the Clojure project directory.
((eq org-babel-clojure-backend 'cider)
(require 'cider)
(let ((session-buffer
(save-window-excursion
(if (version< cider-version "0.18.0")
;; Older CIDER (without sesman) still need to use
;; old way.
(cider-jack-in nil) ;jack-in without project
;; New CIDER (with sesman to manage sessions).
(unless (cider-repls)
(let ((sesman-system 'CIDER))
(call-interactively 'sesman-link-with-directory))))
(current-buffer))))
(when (org-babel-comint-buffer-livep session-buffer)
(sit-for .25)
session-buffer)))
((eq org-babel-clojure-backend 'slime)
(error "Session evaluation with SLIME is not supported"))
(t
(error "Session initiate failed")))
(get-buffer session))))
(defun org-babel-prep-session:clojure (session params)
"Prepare SESSION according to the header arguments specified in PARAMS."
(let ((session (org-babel-clojure-initiate-session session))
(var-lines (org-babel-variable-assignments:clojure params)))
(when session
(org-babel-comint-in-buffer session
(dolist (var var-lines)
(insert var)
(comint-send-input nil t)
(org-babel-comint-wait-for-output session)
(sit-for .1)
(goto-char (point-max)))))
session))
(defun org-babel-clojure-var-to-clojure (var)
"Convert src block's VAR to Clojure variable."
(cond
((listp var)
(replace-regexp-in-string "(" "'(" var))
((stringp var)
;; Wrap Babel passed-in header argument value with quotes in Clojure.
(format "\"%s\"" var))
(t
(format "%S" var))))
(defun org-babel-variable-assignments:clojure (params)
"Return a list of Clojure statements assigning the block's variables in PARAMS."
(mapcar
(lambda (pair)
(format "(def %s %s)"
(car pair)
(org-babel-clojure-var-to-clojure (cdr pair))))
(org-babel--get-vars params)))
(provide 'ob-clojure)
;;; ob-clojure.el ends here
......@@ -36,7 +36,7 @@
(defun org-babel-comint-buffer-livep (buffer)
"Check if BUFFER is a comint buffer with a live process."
(let ((buffer (if buffer (get-buffer buffer))))
(let ((buffer (when buffer (get-buffer buffer))))
(and buffer (buffer-live-p buffer) (get-buffer-process buffer) buffer)))
(defmacro org-babel-comint-in-buffer (buffer &rest body)
......
This diff is collapsed.
......@@ -69,6 +69,8 @@ This function is called by `org-babel-execute-src-block'."
(cmdline (or (cdr (assq :cmdline params))
(format "-T%s" (file-name-extension out-file))))
(cmd (or (cdr (assq :cmd params)) "dot"))
(coding-system-for-read 'utf-8) ;use utf-8 with sub-processes
(coding-system-for-write 'utf-8)
(in-file (org-babel-temp-file "dot-")))
(with-temp-file in-file
(insert (org-babel-expand-body:dot body params)))
......
......@@ -26,7 +26,13 @@
;; Org-Babel support for evaluating emacs-lisp code
;;; Code:
(require 'ob)
(require 'ob-core)
(declare-function org-babel--get-vars "ob" (params))
(declare-function org-babel-result-cond "ob" (result-params scalar-form &rest table-forms))
(declare-function org-babel-reassemble-table "ob" (table colnames rownames))
(declare-function org-babel-pick-name "ob" (names selector))
(defconst org-babel-header-args:emacs-lisp '((lexical . :any))
"Emacs-lisp specific header arguments.")
......@@ -34,10 +40,11 @@
(defvar org-babel-default-header-args:emacs-lisp '((:lexical . "no"))
"Default arguments for evaluating an emacs-lisp source block.
A value of \"yes\" or t causes src blocks to be eval'd using
A value of \"yes\" or t causes source blocks to be eval'd using
lexical scoping. It can also be an alist mapping symbols to
their value. It is used as the optional LEXICAL argument to
`eval', which see.")
their value. It is used both as the optional LEXICAL argument to
`eval', and as the value for `lexical-binding' in buffers created
by `org-edit-src-code'.")
(defun org-babel-expand-body:emacs-lisp (body params)
"Expand BODY according to PARAMS, return the expanded body."
......@@ -65,9 +72,7 @@ their value. It is used as the optional LEXICAL argument to
(member "pp" result-params))
(concat "(pp " body ")")
body))
(if (listp lexical)
lexical
(member lexical '("yes" "t"))))))
(org-babel-emacs-lisp-lexical lexical))))
(org-babel-result-cond result-params
(let ((print-level nil)
(print-length nil))
......@@ -82,6 +87,23 @@ their value. It is used as the optional LEXICAL argument to
(org-babel-pick-name (cdr (assq :rowname-names params))
(cdr (assq :rownames params))))))))
(defun org-babel-emacs-lisp-lexical (lexical)
"Interpret :lexical source block argument.
Convert LEXICAL into the form appropriate for `lexical-binding'
and the LEXICAL argument to `eval'."
(if (listp lexical)
lexical
(not (null (member lexical '("yes" "t"))))))
(defun org-babel-edit-prep:emacs-lisp (info)
"Set `lexical-binding' in Org edit buffer.
Set `lexical-binding' in Org edit buffer according to the
corresponding :lexical source block argument."
(setq lexical-binding
(org-babel-emacs-lisp-lexical
(org-babel-read
(cdr (assq :lexical (nth 2 info)))))))
(org-babel-make-language-alias "elisp" "emacs-lisp")
(provide 'ob-emacs-lisp)
......
;;; ob-eshell.el --- Babel Functions for Eshell -*- lexical-binding: t; -*-
;; Copyright (C) 2018 Free Software Foundation, Inc.
;; Author: stardiviner <numbchild@gmail.com>
;; Keywords: literate programming, reproducible research
;; Homepage: https://orgmode.org
;; This file is part of GNU Emacs.
;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
;; Org Babel support for evaluating Eshell source code.
;;; Code:
(require 'ob)
(require 'eshell)
(defvar org-babel-default-header-args:eshell '())
(defun org-babel-execute:eshell (body params)
"Execute a block of Eshell code BODY with PARAMS.
This function is called by `org-babel-execute-src-block'.
The BODY can be any code which allowed executed in Eshell.
Eshell allow to execute normal shell command and Elisp code.
More details please reference Eshell Info.
The PARAMS are variables assignments."
(let* ((session (org-babel-eshell-initiate-session
(cdr (assq :session params))))
(full-body (org-babel-expand-body:generic
body params (org-babel-variable-assignments:eshell params))))
(if session
(progn
(with-current-buffer session
(dolist (line (split-string full-body "\n"))
(goto-char eshell-last-output-end)
(insert line)
(eshell-send-input))
;; get output of last input
;; TODO: collect all output instead of last command's output.
(goto-char eshell-last-input-end)
(buffer-substring-no-properties (point) eshell-last-output-start)))
(with-temp-buffer
(eshell-command full-body t)
(buffer-string)))))
(defun org-babel-prep-session:eshell (session params)
"Prepare SESSION according to the header arguments specified in PARAMS."
(let* ((session (org-babel-eshell-initiate-session session))
;; Eshell session buffer is read from variable `eshell-buffer-name'.
(eshell-buffer-name session)
(var-lines (org-babel-variable-assignments:eshell params)))
(call-interactively #'eshell)
(mapc #'eshell-command var-lines)
session))
(defun ob-eshell-session-live-p (session)
"Non-nil if Eshell SESSION exists."
(get-buffer session))
(defun org-babel-eshell-initiate-session (&optional session _params)
"Initiate a session named SESSION."
(when (and session (not (string= session "none")))
(save-window-excursion
(unless (ob-eshell-session-live-p session)
(let ((eshell-buffer-name session)) (eshell))))
session))
(defun org-babel-variable-assignments:eshell (params)
"Convert ob-eshell :var specified variables into Eshell variables assignments."
(mapcar
(lambda (pair)
(format "(setq %s %S)" (car pair) (cdr pair)))
(org-babel--get-vars params)))
(defun org-babel-load-session:eshell (session body params)
"Load BODY into SESSION with PARAMS."
(save-window-excursion
(let ((buffer (org-babel-prep-session:eshell session params)))
(with-current-buffer buffer
(goto-char (point-max))
(insert (org-babel-chomp body)))
buffer)))
(provide 'ob-eshell)
;;; ob-eshell.el ends here
......@@ -32,8 +32,6 @@
(declare-function org-element-type "org-element" (element))
(declare-function org-escape-code-in-string "org-src" (s))
(declare-function org-export-copy-buffer "ox" ())
(declare-function org-fill-template "org" (template alist))
(declare-function org-get-indentation "org" (&optional line))
(declare-function org-in-commented-heading-p "org" (&optional no-inheritance))
(defvar org-src-preserve-indentation)
......@@ -85,7 +83,7 @@ none ---- do not display either code or results upon export
Assume point is at block opening line."
(interactive)
(save-excursion
(let* ((info (org-babel-get-src-block-info 'light))
(let* ((info (org-babel-get-src-block-info))
(lang (nth 0 info))
(raw-params (nth 2 info))
hash)
......@@ -108,7 +106,7 @@ Assume point is at block opening line."
(symbol-value lang-headers))
(append (org-babel-params-from-properties lang)
(list raw-params)))))))
(setf hash (org-babel-sha1-hash info)))
(setf hash (org-babel-sha1-hash info :export)))
(org-babel-exp-do-export info 'block hash)))))
(defcustom org-babel-exp-call-line-template
......@@ -210,9 +208,9 @@ this template."
(progn (goto-char end)
(skip-chars-forward " \t")
(point)))
;; Otherwise: remove inline src block but
;; preserve following white spaces. Then
;; insert value.
;; Otherwise: remove inline source block
;; but preserve following white spaces.
;; Then insert value.
(delete-region begin end)
(insert replacement)))))
((or `babel-call `inline-babel-call)
......@@ -244,7 +242,7 @@ this template."
(insert rep))))
(`src-block
(let ((match-start (copy-marker (match-beginning 0)))
(ind (org-get-indentation)))
(ind (current-indentation)))
;; Take care of matched block: compute
;; replacement string. In particular, a nil
;; REPLACEMENT means the block is left as-is
......
......@@ -33,9 +33,9 @@
;;; Code:
(require 'ob)
(require 'org-macs)
(declare-function forth-proc "ext:gforth" ())
(declare-function org-trim "org" (s &optional keep-lead))
(defvar org-babel-default-header-args:forth '((:session . "yes"))
"Default header arguments for forth code blocks.")
......
......@@ -28,13 +28,12 @@
;;; Code:
(require 'ob)
(require 'org-macs)
(require 'cc-mode)
(require 'cl-lib)
(declare-function org-entry-get "org"
(pom property &optional inherit literal-nil))
(declare-function org-remove-indentation "org" (code &optional n))
(declare-function org-trim "org" (s &optional keep-lead))
(defvar org-babel-tangle-lang-exts)
(add-to-list 'org-babel-tangle-lang-exts '("fortran" . "F90"))
......@@ -109,7 +108,7 @@ its header arguments."
"Wrap body in a \"program ... end program\" block if none exists."
(if (string-match "^[ \t]*program[ \t]*.*" (capitalize body))
(let ((vars (org-babel--get-vars params)))
(if vars (error "Cannot use :vars if `program' statement is present"))
(when vars (error "Cannot use :vars if `program' statement is present"))