Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emacs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
emacs
emacs
Commits
165f7383
Commit
165f7383
authored
Dec 03, 2019
by
Bastien
2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Org to 9.3
parent
821de968
Pipeline
#4229
failed with stage
in 59 minutes and 52 seconds
Changes
101
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
101 changed files
with
34729 additions
and
27082 deletions
+34729
-27082
doc/misc/org.texi
doc/misc/org.texi
+16090
-12905
etc/ORG-NEWS
etc/ORG-NEWS
+912
-10
etc/refcards/orgcard.tex
etc/refcards/orgcard.tex
+18
-21
etc/schema/schemas.xml
etc/schema/schemas.xml
+1
-58
lisp/org/ob-C.el
lisp/org/ob-C.el
+6
-8
lisp/org/ob-J.el
lisp/org/ob-J.el
+1
-1
lisp/org/ob-calc.el
lisp/org/ob-calc.el
+1
-1
lisp/org/ob-clojure.el
lisp/org/ob-clojure.el
+106
-21
lisp/org/ob-comint.el
lisp/org/ob-comint.el
+1
-1
lisp/org/ob-core.el
lisp/org/ob-core.el
+218
-217
lisp/org/ob-dot.el
lisp/org/ob-dot.el
+2
-0
lisp/org/ob-emacs-lisp.el
lisp/org/ob-emacs-lisp.el
+29
-7
lisp/org/ob-eshell.el
lisp/org/ob-eshell.el
+102
-0
lisp/org/ob-exp.el
lisp/org/ob-exp.el
+6
-8
lisp/org/ob-forth.el
lisp/org/ob-forth.el
+1
-1
lisp/org/ob-fortran.el
lisp/org/ob-fortran.el
+2
-3
lisp/org/ob-gnuplot.el
lisp/org/ob-gnuplot.el
+1
-1
lisp/org/ob-haskell.el
lisp/org/ob-haskell.el
+5
-7
lisp/org/ob-js.el
lisp/org/ob-js.el
+80
-38
lisp/org/ob-keys.el
lisp/org/ob-keys.el
+0
-106
lisp/org/ob-latex.el
lisp/org/ob-latex.el
+1
-1
lisp/org/ob-lilypond.el
lisp/org/ob-lilypond.el
+4
-2
lisp/org/ob-lisp.el
lisp/org/ob-lisp.el
+2
-2
lisp/org/ob-lob.el
lisp/org/ob-lob.el
+3
-4
lisp/org/ob-lua.el
lisp/org/ob-lua.el
+4
-5
lisp/org/ob-ocaml.el
lisp/org/ob-ocaml.el
+3
-3
lisp/org/ob-octave.el
lisp/org/ob-octave.el
+8
-10
lisp/org/ob-plantuml.el
lisp/org/ob-plantuml.el
+11
-6
lisp/org/ob-python.el
lisp/org/ob-python.el
+17
-6
lisp/org/ob-ref.el
lisp/org/ob-ref.el
+3
-3
lisp/org/ob-ruby.el
lisp/org/ob-ruby.el
+1
-1
lisp/org/ob-scheme.el
lisp/org/ob-scheme.el
+7
-5
lisp/org/ob-sed.el
lisp/org/ob-sed.el
+2
-2
lisp/org/ob-shell.el
lisp/org/ob-shell.el
+58
-59
lisp/org/ob-sql.el
lisp/org/ob-sql.el
+45
-7
lisp/org/ob-sqlite.el
lisp/org/ob-sqlite.el
+0
-1
lisp/org/ob-table.el
lisp/org/ob-table.el
+1
-2
lisp/org/ob-tangle.el
lisp/org/ob-tangle.el
+29
-48
lisp/org/ob-vala.el
lisp/org/ob-vala.el
+1
-2
lisp/org/ob.el
lisp/org/ob.el
+1
-1
lisp/org/ol-bbdb.el
lisp/org/ol-bbdb.el
+20
-18
lisp/org/ol-bibtex.el
lisp/org/ol-bibtex.el
+23
-8
lisp/org/ol-docview.el
lisp/org/ol-docview.el
+11
-10
lisp/org/ol-eshell.el
lisp/org/ol-eshell.el
+9
-7
lisp/org/ol-eww.el
lisp/org/ol-eww.el
+17
-16
lisp/org/ol-gnus.el
lisp/org/ol-gnus.el
+22
-18
lisp/org/ol-info.el
lisp/org/ol-info.el
+7
-7
lisp/org/ol-irc.el
lisp/org/ol-irc.el
+20
-7
lisp/org/ol-mhe.el
lisp/org/ol-mhe.el
+8
-8
lisp/org/ol-rmail.el
lisp/org/ol-rmail.el
+8
-8
lisp/org/ol-w3m.el
lisp/org/ol-w3m.el
+24
-23
lisp/org/ol.el
lisp/org/ol.el
+1907
-0
lisp/org/org-agenda.el
lisp/org/org-agenda.el
+1098
-771
lisp/org/org-archive.el
lisp/org/org-archive.el
+61
-72
lisp/org/org-attach-git.el
lisp/org/org-attach-git.el
+119
-0
lisp/org/org-attach.el
lisp/org/org-attach.el
+464
-284
lisp/org/org-capture.el
lisp/org/org-capture.el
+372
-408
lisp/org/org-clock.el
lisp/org/org-clock.el
+356
-307
lisp/org/org-colview.el
lisp/org/org-colview.el
+198
-127
lisp/org/org-compat.el
lisp/org/org-compat.el
+631
-100
lisp/org/org-crypt.el
lisp/org/org-crypt.el
+1
-1
lisp/org/org-duration.el
lisp/org/org-duration.el
+0
-1
lisp/org/org-element.el
lisp/org/org-element.el
+266
-164
lisp/org/org-entities.el
lisp/org/org-entities.el
+5
-5
lisp/org/org-faces.el
lisp/org/org-faces.el
+17
-11
lisp/org/org-feed.el
lisp/org/org-feed.el
+3
-4
lisp/org/org-footnote.el
lisp/org/org-footnote.el
+310
-301
lisp/org/org-goto.el
lisp/org/org-goto.el
+312
-0
lisp/org/org-habit.el
lisp/org/org-habit.el
+51
-25
lisp/org/org-id.el
lisp/org/org-id.el
+105
-83
lisp/org/org-indent.el
lisp/org/org-indent.el
+37
-36
lisp/org/org-inlinetask.el
lisp/org/org-inlinetask.el
+37
-43
lisp/org/org-keys.el
lisp/org/org-keys.el
+924
-0
lisp/org/org-lint.el
lisp/org/org-lint.el
+48
-28
lisp/org/org-list.el
lisp/org/org-list.el
+102
-211
lisp/org/org-macro.el
lisp/org/org-macro.el
+173
-107
lisp/org/org-macs.el
lisp/org/org-macs.el
+998
-240
lisp/org/org-mobile.el
lisp/org/org-mobile.el
+58
-43
lisp/org/org-mouse.el
lisp/org/org-mouse.el
+6
-16
lisp/org/org-num.el
lisp/org/org-num.el
+469
-0
lisp/org/org-pcomplete.el
lisp/org/org-pcomplete.el
+154
-99
lisp/org/org-plot.el
lisp/org/org-plot.el
+1
-1
lisp/org/org-protocol.el
lisp/org/org-protocol.el
+47
-48
lisp/org/org-src.el
lisp/org/org-src.el
+153
-96
lisp/org/org-table.el
lisp/org/org-table.el
+2324
-1629
lisp/org/org-tempo.el
lisp/org/org-tempo.el
+188
-0
lisp/org/org-timer.el
lisp/org/org-timer.el
+20
-15
lisp/org/org-version.el
lisp/org/org-version.el
+2
-2
lisp/org/org.el
lisp/org/org.el
+3462
-7134
lisp/org/ox-ascii.el
lisp/org/ox-ascii.el
+40
-21
lisp/org/ox-beamer.el
lisp/org/ox-beamer.el
+52
-38
lisp/org/ox-html.el
lisp/org/ox-html.el
+281
-176
lisp/org/ox-icalendar.el
lisp/org/ox-icalendar.el
+84
-39
lisp/org/ox-latex.el
lisp/org/ox-latex.el
+265
-280
lisp/org/ox-man.el
lisp/org/ox-man.el
+1
-1
lisp/org/ox-md.el
lisp/org/ox-md.el
+24
-22
lisp/org/ox-odt.el
lisp/org/ox-odt.el
+34
-34
lisp/org/ox-org.el
lisp/org/ox-org.el
+8
-5
lisp/org/ox-publish.el
lisp/org/ox-publish.el
+55
-36
lisp/org/ox-texinfo.el
lisp/org/ox-texinfo.el
+146
-136
lisp/org/ox.el
lisp/org/ox.el
+308
-168
No files found.
doc/misc/org.texi
View file @
165f7383
This diff is collapsed.
Click to expand it.
etc/ORG-NEWS
View file @
165f7383
This diff is collapsed.
Click to expand it.
etc/refcards/orgcard.tex
View file @
165f7383
% 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.
...
...
etc/schema/schemas.xml
View file @
165f7383
<!-- 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>
lisp/org/ob-C.el
View file @
165f7383
...
...
@@ -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
)))
(
format
t
ed
(
org-babel-C-format-val
type-data
val
))
(
suffix
(
car
format
t
ed
))
(
data
(
cdr
format
t
ed
)))
(
format
"%s %s%s = %s;"
type
var
...
...
lisp/org/ob-J.el
View file @
165f7383
...
...
@@ -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"
...
...
lisp/org/ob-calc.el
View file @
165f7383
...
...
@@ -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."
)
...
...
lisp/org/ob-clojure.el
View file @
165f7383
...
...
@@ -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
lisp/org/ob-comint.el
View file @
165f7383
...
...
@@ -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
)
...
...
lisp/org/ob-core.el
View file @
165f7383
This diff is collapsed.
Click to expand it.
lisp/org/ob-dot.el
View file @
165f7383
...
...
@@ -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
)))
...
...
lisp/org/ob-emacs-lisp.el
View file @
165f7383
...
...
@@ -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 s
rc
blocks to be eval'd using
A value of \"yes\" or t causes s
ource
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
)
...
...
lisp/org/ob-eshell.el
0 → 100644
View file @
165f7383
;;; 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
)))