Re: [O] obtain ob-template.el for Babel language extension
On Sat, 12 Sep 2015 07:15:37 -1000 Thomas S. Dyewrote: > Aloha Joe, > > Joe Riel writes: > > > > No offense, but the help pages on the code blocks could really use > > improvement. > > Glad to have your help. The documentation is a community effort. Agreed. Because I'm new to this aspect of org, I'm reading the relevant manual pages for the first time. As such, it is easy to note deficiencies. I'll help to improve them. > > > For example, > > > > Exporting code blocks > > - > > Nowhere does this section explain *how* you can export a code block, > > nor are there any links to pages that are helpful. As a minimum it > > should include the relevant commands and the key bindings for > > exporting code blocks. Where are they? > > Typically, one doesn't export a code block by itself. Instead, one > exports a document that includes one or more code blocks. How to export > a document is covered in Chapter 12, Exporting. I figured that out eventually. There should be a link from the exporting code blocks section to chapter 12; not everyone reads manual in a linear fashion 8-). I'll submit that with the other suggestion (below). > > Evaluating code blocks > > -- > > The second paragraph states that only 'emacs-lisp' is enabled by > > default. Suppose I want to use something other than 'emacs-lisp', > > *how* do I enable that? The parenthetical comment states that the > > Languages section lists the supoported languages but doesn't mention > > that the explanation of enabling other languages is there. Better > > to not leave the reader hanging. How about this: > > > > "By default, the evaluation facility is only enabled for Lisp code > > blocks specified as ‘emacs-lisp’. See _Languages_ for instructions on > > enabling other languages and for a list of supported languages. See > > _Structure of code blocks_ for information on the syntax used to > > define a code block." > > I think this is an improvement. IMHO it is almost always a good thing > to get rid of parenthetical statements. Would you like to submit a > patch for org.texi? You'll find instructions here: > http://orgmode.org/worg/org-contribute.html#orgheadline1 > > Another problem is the outdated list of supported languages in Section > 14.7, Languages. Perhaps this could be replaced by a pointer to the > more complete list maintained on Worg? Should this section distinguish > the various levels of "support", e.g. core, contrib, and packages? > > All the best, > Tom > -- Joe Riel
Re: [O] obtain ob-template.el for Babel language extension
Aloha Joe, Joe Rielwrites: > > No offense, but the help pages on the code blocks could really use > improvement. Glad to have your help. The documentation is a community effort. > For example, > > Exporting code blocks > - > Nowhere does this section explain *how* you can export a code block, > nor are there any links to pages that are helpful. As a minimum it > should include the relevant commands and the key bindings for > exporting code blocks. Where are they? Typically, one doesn't export a code block by itself. Instead, one exports a document that includes one or more code blocks. How to export a document is covered in Chapter 12, Exporting. > Evaluating code blocks > -- > The second paragraph states that only 'emacs-lisp' is enabled by > default. Suppose I want to use something other than 'emacs-lisp', > *how* do I enable that? The parenthetical comment states that the > Languages section lists the supoported languages but doesn't mention > that the explanation of enabling other languages is there. Better > to not leave the reader hanging. How about this: > > "By default, the evaluation facility is only enabled for Lisp code > blocks specified as ‘emacs-lisp’. See _Languages_ for instructions on > enabling other languages and for a list of supported languages. See > _Structure of code blocks_ for information on the syntax used to > define a code block." I think this is an improvement. IMHO it is almost always a good thing to get rid of parenthetical statements. Would you like to submit a patch for org.texi? You'll find instructions here: http://orgmode.org/worg/org-contribute.html#orgheadline1 Another problem is the outdated list of supported languages in Section 14.7, Languages. Perhaps this could be replaced by a pointer to the more complete list maintained on Worg? Should this section distinguish the various levels of "support", e.g. core, contrib, and packages? All the best, Tom -- Thomas S. Dye http://www.tsdye.com
[O] [PATCH] small improvements to info page, Working with source code
The attached two patches make small improvements to the "Working with source code". This is my first time submitting patches to org, it's not entirely clear that I'm doing this correctly (i.e. sending them to the correct place). -- Joe Riel >From 2dad38f55c6c2e1dbe37eb7c5cdad94f5ed94ca9 Mon Sep 17 00:00:00 2001 From: Joe RielDate: Sat, 12 Sep 2015 11:30:06 -0700 Subject: [PATCH 1/2] * doc/org.texi: (Evaluating code blocks) Rewrite paragraph to state where to find information on enabling other languages. --- doc/org.texi | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/doc/org.texi b/doc/org.texi index ac7d3a4..1e67b62 100644 --- a/doc/org.texi +++ b/doc/org.texi @@ -14972,10 +14972,9 @@ and/or the name of the evaluated code block. The default value of @code{org-babel-results-keyword}. By default, the evaluation facility is only enabled for Lisp code blocks -specified as @code{emacs-lisp}. However, source code blocks in many languages -can be evaluated within Org mode (see @ref{Languages} for a list of supported -languages and @ref{Structure of code blocks} for information on the syntax -used to define a code block). +specified as @code{emacs-lisp}. See @ref{Languages} to enable other +supported languages. See @ref{Structure of code blocks} for information on +the syntax used to define a code block. @kindex C-c C-c There are a number of ways to evaluate code blocks. The simplest is to press -- 2.1.4 >From af923060170cdaba9eaa6701d0e8175837429d84 Mon Sep 17 00:00:00 2001 From: Joe Riel Date: Sat, 12 Sep 2015 11:36:50 -0700 Subject: [PATCH 2/2] * doc/org.texi: (Exporting code blocks) add link to Exporting Coming into this section without having read the chapter 12 is pretty confusing. The link is helpful. --- doc/org.texi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/org.texi b/doc/org.texi index 1e67b62..c630c7a 100644 --- a/doc/org.texi +++ b/doc/org.texi @@ -14851,7 +14851,8 @@ of code block evaluation, @emph{both} the code and the results of code block evaluation, or @emph{none}. For most languages, the default exports code. However, for some languages (e.g., @code{ditaa}) the default exports the results of code block evaluation. For information on exporting code block -bodies, see @ref{Literal examples}. +bodies, see @ref{Literal examples}. For information on exporting +parts of Org documents, see @ref{Exporting}. The @code{:exports} header argument can be used to specify export behavior (note that these arguments are only relevant for code blocks, not -- 2.1.4
Re: [O] Scheme code block gives false error message
Again, this code #+BEGIN_SRC scheme :session ch1 :exports both (define (bool-imply a b) (if (or (not a) b) #t #f)) #+END_SRC gives the error org-babel-scheme-execute-with-geiser: Invalid read syntax: "#" and this time attempting to use the function #+BEGIN_SRC scheme :session ch1 :exports both (bool-imply #t #f) #+END_SRC produces no #RESULTS: block, rather, again, the error (in Messages buffer) org-babel-scheme-execute-with-geiser: Invalid read syntax: "#" even though this is perfectly healthy code, and it works in the accompanying "ch1" REPL. Any ideas what's happening?
Re: [O] Scheme code block gives false error message
Lawrence Bottorffwrites: > Again, this code > > #+BEGIN_SRC scheme :session ch1 :exports both > (define (bool-imply a b) > (if (or (not a) b) #t #f)) > #+END_SRC > > gives the error > > org-babel-scheme-execute-with-geiser: Invalid read syntax: "#" > > and this time attempting to use the function > > #+BEGIN_SRC scheme :session ch1 :exports both > (bool-imply #t #f) > #+END_SRC > > produces no #RESULTS: block, rather, again, the error (in Messages buffer) > > org-babel-scheme-execute-with-geiser: Invalid read syntax: "#" > > even though this is perfectly healthy code, and it works in the accompanying > "ch1" REPL. Any ideas what's happening? > Your previous example worked for me (both with master and maint - I use guile, not chicken, but that should make no difference). But this one fails with the "Invalid read syntax error" and with the attached backtrace (running on maint - master gave the same error but I didn't get a backtrace). read("#f") (if (or (string= result "#") (string= result "#")) nil (read result)) (setq result (if (or (string= result "#") (string= result "#")) nil (read result))) (let ((repl-buffer (save-current-buffer (org-babel-scheme-get-repl impl repl (if (not (eq impl (org-babel-scheme-get-buffer-impl (current-buffer (progn (message "Implementation mismatch: %s (%s) %s (%s)" impl (symbolp impl) (org-babel-scheme-get-buffer-impl (current-buffer)) (symbolp (org-babel-scheme-get-buffer-impl (current-buffer)) (setq geiser-repl--repl repl-buffer) (setq geiser-impl--implementation nil) (setq result (if noninteractive (let ((original-message (symbol-function (quote message))) (current-message nil)) (unwind-protect (progn (defalias (quote message) (function ...)) (geiser-eval-region (point-min) (point-max)) current-message) (fset (quote message) original-message))) (progn (geiser-eval-region (point-min) (point-max)) (current-message (setq result (if (and (stringp result) (equal (substring result 0 3) "=> ")) (replace-regexp-in-string "^=> " "" result) "\"An error occurred.\"")) (if (not repl) (progn (save-current-buffer (set-buffer repl-buffer) (geiser-repl-exit)) (set-process-query-on-exit-flag (get-buffer-process repl-buffer) nil) (kill-buffer repl-buffer))) (setq result (if (or (string= result "#") (string= result "#")) nil (read result (progn (insert (format ";; -*- geiser-scheme-implementation: %s -*-" impl)) (newline) (insert (if output (format "(with-output-to-string (lambda () %s))" code) code)) (geiser-mode) (let ((repl-buffer (save-current-buffer (org-babel-scheme-get-repl impl repl (if (not (eq impl (org-babel-scheme-get-buffer-impl (current-buffer (progn (message "Implementation mismatch: %s (%s) %s (%s)" impl (symbolp impl) (org-babel-scheme-get-buffer-impl (current-buffer)) (symbolp (org-babel-scheme-get-buffer-impl (current-buffer)) (setq geiser-repl--repl repl-buffer) (setq geiser-impl--implementation nil) (setq result (if noninteractive (let ((original-message (symbol-function ...)) (current-message nil)) (unwind-protect (progn (defalias ... ...) (geiser-eval-region ... ...) current-message) (fset (quote message) original-message))) (progn (geiser-eval-region (point-min) (point-max)) (current-message (setq result (if (and (stringp result) (equal (substring result 0 3) "=> ")) (replace-regexp-in-string "^=> " "" result) "\"An error occurred.\"")) (if (not repl) (progn (save-current-buffer (set-buffer repl-buffer) (geiser-repl-exit)) (set-process-query-on-exit-flag (get-buffer-process repl-buffer) nil) (kill-buffer repl-buffer))) (setq result (if (or (string= result "#") (string= result "#")) nil (read result) (unwind-protect (progn (insert (format ";; -*- geiser-scheme-implementation: %s -*-" impl)) (newline) (insert (if output (format "(with-output-to-string (lambda () %s))" code) code)) (geiser-mode) (let ((repl-buffer (save-current-buffer (org-babel-scheme-get-repl impl repl (if (not (eq impl (org-babel-scheme-get-buffer-impl (current-buffer (progn (message "Implementation mismatch: %s (%s) %s (%s)" impl (symbolp impl) (org-babel-scheme-get-buffer-impl (current-buffer)) (symbolp (org-babel-scheme-get-buffer-impl ...) (setq geiser-repl--repl repl-buffer) (setq geiser-impl--implementation nil) (setq result (if noninteractive (let ((original-message ...) (current-message nil)) (unwind-protect (progn ... ... current-message) (fset ... original-message))) (progn (geiser-eval-region (point-min) (point-max)) (current-message (setq result (if (and (stringp result) (equal (substring result 0 3) "=> ")) (replace-regexp-in-string "^=> " "" result) "\"An error occurred.\"")) (if (not repl) (progn (save-current-buffer (set-buffer repl-buffer) (geiser-repl-exit)) (set-process-query-on-exit-flag (get-buffer-process repl-buffer) nil) (kill-buffer repl-buffer))) (setq result (if (or (string= result "#") (string= result "#")) nil (read
Re: [O] Bug: LaTeX source code blocks not exported in Markdown [8.3.1 (8.3.1-103-g366dc4-elpa @ /home/bitouze/.emacs.d/elpa/org-20150907/)]
Le 11/09/15 à 17h58, Nicolas Goazioua écrit : > Hello, Hi Nicolas and Charles, >> Expected behavior: >> >> ┌ >> │ #+BEGIN_SRC latex >> │ latex >> │ #+END_SRC >> └ >> >> gives: >> >> ┌ >> │ latex >> └ > > This is because latex block can be evaluated, which gives: > > #+RESULTS: > #+BEGIN_LaTeX > latex > #+END_LaTeX > > i.e., the generated results appear only when using latex export backend. > The original block is removed thereafter. You can use instead: > > #+BEGIN_SRC latex :exports code > latex > #+END_SRC Ooops, sorry for the noise due to this misuse. Regards. -- Denis
[O] babel: does have to be major-mode
Does the parameter to a BEGIN_SRC block have to be a major-mode? Or is there an alist that I can configure to map a language to a particular major-mode? -- Joe Riel
Re: [O] babel: does have to be major-mode
On Sat, 12 Sep 2015 08:33:46 -0700 Joe Rielwrote: > Does the parameter to a BEGIN_SRC block > have to be a major-mode? Or is there an alist that > I can configure to map a language to a particular > major-mode? > Found it, org-src-lang-modes. Reading the info page helped 8-). -- Joe Riel
[O] Bug: \vert{} exported to markdown not as expected [8.3.1 (8.3.1-103-g366dc4-elpa @ /home/bitouze/.emacs.d/elpa/org-20150907/)]
Remember to cover the basics, that is, what you expected to happen and what in fact did happen. You don't know how to make a good report? See http://orgmode.org/manual/Feedback.html#Feedback Your bug report will be posted to the Org-mode mailing list. The following file: #+NAME: test.org #+begin_src org Foo |bar_baz| Foo \vert{}bar\under{}baz\vert{} #+end_src is exported to markdown as follows: #+NAME: test.md #+begin_src markdown Foo |bar\_baz| Foo bar_baz #+end_src Whereas: - \under{} gives the expected underscore symbol (_), - \vert{} gives instead of the expected pipe symbol (|). Emacs : GNU Emacs 24.5.1 (i686-pc-linux-gnu, GTK+ Version 3.14.8) of 2015-06-29 on drums.chezmoi.fr Package: Org-mode version 8.3.1 (8.3.1-103-g366dc4-elpa @ /home/bitouze/.emacs.d/elpa/org-20150907/) current state: == (setq org-entities-user '(("nok" "{\\color{red}\\ding{55}}" nil "" "NOK" "NOK" "✘") ("ok" "{\\color{checkmark}\\ding{51}}" nil "" "OK" "OK" "✔") ) org-enforce-todo-checkbox-dependencies t org-inlinetask-default-state "TODO" org-agenda-search-view-always-boolean t org-agenda-log-mode-items '(clock) org-latex-format-headline-function 'leuven--org-latex-format-headline org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point org-babel-execute-safely-maybe) org-pretty-entities t org-latex-packages-alist '(("" "listings") ("" "xcolor") ("french" "babel")) org-html-format-inlinetask-function 'org-html-format-inlinetask-default-function org-stuck-projects '("+LEVEL=2/-DONE" ("TODO" "STRT") nil "") org-refile-use-cache t org-clock-in-resume t org-clock-out-when-done nil org-log-states-order-reversed nil org-odt-preferred-output-format "doc" org-agenda-sticky t org-goto-interface 'outline-path-completion outline-minor-mode-hook '(leuven--outline-minor-mode-hook (lambda nil (if (and outline-minor-mode (derived-mode-p (quote emacs-lisp-mode))) (progn (hide-sublevels 1000))) ) ) org-agenda-skip-scheduled-if-done t org-ellipsis " ►" org-clock-persist t org-archive-location "::* Archive" org-agenda-window-setup 'current-window org-adapt-indentation nil org-agenda-entry-text-leaders " │ " org-agenda-scheduled-leaders '("Scheduled " " ") org-clock-mode-line-total 'all org-tab-first-hook '(org-hide-block-toggle-maybe org-babel-hide-result-toggle-maybe org-babel-header-arg-expand) org-agenda-exporter-settings '((ps-number-of-columns 1) (ps-landscape-mode t) (htmlize-output-type (quote css))) org-archive-hook '(org-attach-archive-delete-maybe) org-refile-targets '((nil :maxlevel . 4) (nil :maxlevel . 2)) org-html-htmlize-output-type 'css org-modules '(org-info org-habit org-gnus org-id org-checklist) org-cycle-hook '(org-inlinetask-hide-tasks org-cycle-hide-archived-subtrees org-cycle-hide-drawers org-cycle-show-empty-lines org-optimize-window-after-visibility-change) org-html-checkbox-type 'unicode org-mime-send-subtree-hook '((lambda nil (org-entry-put (point) "mail_composed" (current-time-string))) ) org-agenda-before-write-hook '(org-agenda-add-entry-text) org-confirm-babel-evaluate nil org-speed-command-hook '(org-speed-command-default-hook org-babel-speed-command-hook) org-src-window-setup 'current-window org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default org-export-preprocess-hook '(leuven--org-export-preprocess-hook) org-clock-total-time-cell-format "%s" org-export-snippet-translation-alist '(("b" . "beamer") ("l" . "latex") ("h" . "html")) org-agenda-current-time-string "Right now" org-blocker-hook '(org-block-todo-from-checkboxes org-block-todo-from-children-or-siblings-or-parent) org-fontify-done-headline t org-agenda-skip-deadline-prewarning-if-scheduled 7 org-agenda-restore-windows-after-quit t org-return-follows-link t org-babel-pre-tangle-hook '(save-buffer) org-agenda-diary-file "~/org/diary.org" org-export-time-stamp-file nil org-occur-hook '(org-first-headline-recenter) org-emphasis-alist '(("*" bold "" "") ("/" italic "" "") ("_" underline "" "") ("=" org-verbatim "" "" verbatim) ("~" org-code "" "" verbatim)) org-font-lock-hook '(org-inlinetask-fontify) org-agenda-auto-exclude-function 'leuven--org-auto-exclude-function org-refile-target-verify-function 'bh/verify-refile-target org-speed-commands-user '(("y" org-todo-yesterday "DONE") ("d"
[O] Bug: Extra blank line in subitem list when exported to markdown [8.3.1 (8.3.1-103-g366dc4-elpa @ /home/bitouze/.emacs.d/elpa/org-20150907/)]
Remember to cover the basics, that is, what you expected to happen and what in fact did happen. You don't know how to make a good report? See http://orgmode.org/manual/Feedback.html#Feedback Your bug report will be posted to the Org-mode mailing list. When exported to markdown, an extra blank line is added in subitem lists, as shown by the following minimal example. #+NAME: test.org #+begin_src org - Foo 1 - Foo2: - Foo21 - Foo22 End of Foo2 item. #+end_src *Expected* behavior (note the *absence* of blank line after =Foo22=): #+NAME: test-ok.md #+begin_src markdown - Foo 1 - Foo2: - Foo21 - Foo22 End of Foo2 item. #+end_src *Current* behavior (note the blank line after =Foo22=): #+NAME: test.md #+begin_src markdown - Foo 1 - Foo2: - Foo21 - Foo22 End of Foo2 item. #+end_src This last =.md= code is interpreted by markdown engines as the following crazy =.html= code: #+begin_src html Foo 1 Foo21 Foo22 Foo2: End of Foo2 item. #+end_src Emacs : GNU Emacs 24.5.1 (i686-pc-linux-gnu, GTK+ Version 3.14.8) of 2015-06-29 on drums.chezmoi.fr Package: Org-mode version 8.3.1 (8.3.1-103-g366dc4-elpa @ /home/bitouze/.emacs.d/elpa/org-20150907/) current state: == (setq org-entities-user '(("nok" "{\\color{red}\\ding{55}}" nil "" "NOK" "NOK" "✘") ("ok" "{\\color{checkmark}\\ding{51}}" nil "" "OK" "OK" "✔") ) org-enforce-todo-checkbox-dependencies t org-inlinetask-default-state "TODO" org-agenda-search-view-always-boolean t org-agenda-log-mode-items '(clock) org-latex-format-headline-function 'leuven--org-latex-format-headline org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point org-babel-execute-safely-maybe) org-pretty-entities t org-latex-packages-alist '(("" "listings") ("" "xcolor") ("french" "babel")) org-html-format-inlinetask-function 'org-html-format-inlinetask-default-function org-stuck-projects '("+LEVEL=2/-DONE" ("TODO" "STRT") nil "") org-refile-use-cache t org-clock-in-resume t org-clock-out-when-done nil org-log-states-order-reversed nil org-odt-preferred-output-format "doc" org-agenda-sticky t org-goto-interface 'outline-path-completion outline-minor-mode-hook '(leuven--outline-minor-mode-hook (lambda nil (if (and outline-minor-mode (derived-mode-p (quote emacs-lisp-mode))) (progn (hide-sublevels 1000))) ) ) org-agenda-skip-scheduled-if-done t org-ellipsis " ►" org-clock-persist t org-archive-location "::* Archive" org-agenda-window-setup 'current-window org-adapt-indentation nil org-agenda-entry-text-leaders " │ " org-agenda-scheduled-leaders '("Scheduled " " ") org-clock-mode-line-total 'all org-tab-first-hook '(org-hide-block-toggle-maybe org-babel-hide-result-toggle-maybe org-babel-header-arg-expand) org-agenda-exporter-settings '((ps-number-of-columns 1) (ps-landscape-mode t) (htmlize-output-type (quote css))) org-archive-hook '(org-attach-archive-delete-maybe) org-refile-targets '((nil :maxlevel . 4) (nil :maxlevel . 2)) org-html-htmlize-output-type 'css org-modules '(org-info org-habit org-gnus org-id org-checklist) org-cycle-hook '(org-inlinetask-hide-tasks org-cycle-hide-archived-subtrees org-cycle-hide-drawers org-cycle-show-empty-lines org-optimize-window-after-visibility-change) org-html-checkbox-type 'unicode org-mime-send-subtree-hook '((lambda nil (org-entry-put (point) "mail_composed" (current-time-string))) ) org-agenda-before-write-hook '(org-agenda-add-entry-text) org-confirm-babel-evaluate nil org-speed-command-hook '(org-speed-command-default-hook org-babel-speed-command-hook) org-src-window-setup 'current-window org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default org-export-preprocess-hook '(leuven--org-export-preprocess-hook) org-clock-total-time-cell-format "%s" org-export-snippet-translation-alist '(("b" . "beamer") ("l" . "latex") ("h" . "html")) org-agenda-current-time-string "Right now" org-blocker-hook '(org-block-todo-from-checkboxes org-block-todo-from-children-or-siblings-or-parent) org-fontify-done-headline t org-agenda-skip-deadline-prewarning-if-scheduled 7 org-agenda-restore-windows-after-quit t org-return-follows-link t org-babel-pre-tangle-hook '(save-buffer) org-agenda-diary-file "~/org/diary.org" org-export-time-stamp-file nil org-occur-hook '(org-first-headline-recenter) org-emphasis-alist '(("*" bold ""
Re: [O] Favorite way of syncing?
Erik Hetznerwrites: > 3. git-auto-commit-mode with the following setup: AFAIK, You could probably also use git-annex-assistant for this (with "normal" git as well as "annex"). It's starting to get to a level where I'm only a bit hesitant to recommend it... Rasmus -- Tack, ni svenska vakttorn. Med plutonium tvingar vi dansken på knä!