Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mooc-rr-ressources
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Learning Lab
mooc-rr-ressources
Commits
c2a72beb
Commit
c2a72beb
authored
Aug 24, 2018
by
Konrad Hinsen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Always use a named session for shell commands under Windows
parent
a5c9bbaf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
4 deletions
+14
-4
init.el
module2/ressources/rr_org/init.el
+7
-2
init.org
module2/ressources/rr_org/init.org
+7
-2
No files found.
module2/ressources/rr_org/init.el
View file @
c2a72beb
...
...
@@ -232,8 +232,13 @@ Entered on %U
(
add-to-list
'org-structure-template-alist
'
(
"PP"
"#+begin_src python :results file :session :var matplot_lib_filename=(org-babel-temp-file \"figure\" \".png\") :exports both\nimport matplotlib.pyplot as plt\n\nimport numpy\nx=numpy.linspace(-15,15)\nplt.figure(figsize=(10,5))\nplt.plot(x,numpy.cos(x)/x)\nplt.tight_layout()\n\nplt.savefig(matplot_lib_filename)\nmatplot_lib_filename\n#+end_src"
"<src lang=\"python\">\n\n</src>"
))
(
add-to-list
'org-structure-template-alist
'
(
"b"
"#+begin_src shell :results output :exports both\n\n#+end_src"
"<src lang=\"sh\">\n\n</src>"
))
(
if
(
memq
system-type
'
(
windows-nt
ms-dos
))
;; Non-session shell execution does not seem to work under Windows, so we use
;; a named session just like for B.
(
add-to-list
'org-structure-template-alist
'
(
"b"
"#+begin_src shell :session session :results output :exports both\n\n#+end_src"
"<src lang=\"sh\">\n\n</src>"
))
(
add-to-list
'org-structure-template-alist
'
(
"b"
"#+begin_src shell :results output :exports both\n\n#+end_src"
"<src lang=\"sh\">\n\n</src>"
)))
(
add-to-list
'org-structure-template-alist
'
(
"B"
"#+begin_src shell :session *shell* :results output :exports both \n\n#+end_src"
"<src lang=\"sh\">\n\n</src>"
))
...
...
module2/ressources/rr_org/init.org
View file @
c2a72beb
...
...
@@ -395,8 +395,13 @@ To use this type <p and then TAB
*** Bash "sh" code:
To use this type <b and then TAB
#+begin_src emacs-lisp :tangle init.el
(add-to-list 'org-structure-template-alist
'("b" "#+begin_src shell :results output :exports both\n\n#+end_src" "<src lang=\"sh\">\n\n</src>"))
(if (memq system-type '(windows-nt ms-dos))
;; Non-session shell execution does not seem to work under Windows, so we use
;; a named session just like for B.
(add-to-list 'org-structure-template-alist
'("b" "#+begin_src shell :session session :results output :exports both\n\n#+end_src" "<src lang=\"sh\">\n\n</src>"))
(add-to-list 'org-structure-template-alist
'("b" "#+begin_src shell :results output :exports both\n\n#+end_src" "<src lang=\"sh\">\n\n</src>")))
#+end_src
To use this type <B and then TAB. This comes with a session argument
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment