Re: [O] Extraneous output from Python code blocks using :session option

2015-03-14 Thread Nicolas Goaziou
Kyle Meyer k...@kyleam.com writes:

 Thanks for your comments.  I've attached updated patches.

Thanks.

 Subject: [PATCH 1/2] ob-python.el: Allow indented code in sessions

 * lisp/ob-python.el (org-babel-python-evaluate-session): Recognize
 indented code in session and treat it differently to avoid syntax
 errors.

You also need to list new functions and variables in commit message,
e.g.,

  (org-babel-python-indented-lines-session-method): New variable.

 * lisp/ob-python.el (org-babel-python-evaluate-session): Strip extra leading
   ... and  from session output.

Ditto.

  (org-babel-python--strip-session-chars): New function.

 +(defun org-babel-python--strip-session-chars (string)
 +  Remove leading '' and '...' from STRING.
 +`org-babel-comint-with-output' splits the Python session output
 +by `comint-prompt-regexp' (which includes '' and '...'), but,
 +in some situations, these still make it through at the start of
 +the output string.

Wouldn't it be better to find the situations above at the source? If may
be due to some indentation problem at the beginning of the string, in
which case an `org-trim' within `org-babel-comint-with-output' could
solve it.

WDYT?


Regards,



Re: [O] BIDI and org-mime-htmlize

2015-03-14 Thread Dotan Cohen
On Fri, Mar 13, 2015 at 2:14 PM, Uwe Brauer o...@mat.ucm.es wrote:


 Hello

 GNU emacs 24 has BIDI support, for languages such as Hebrew and Arabic.

 However when I write an email, and send it via say gnus, the mail text
 received it is displayed correctly with one restriction: The text is
 displayed in most mail agents, at the left margin instead of the right
 margin (I cannot write this here, since it would not displayed
 correctly)

 Thunderbird offers BIDI email support via HTML. The relevant HTML
 elements seem to be

   body style=3Ddirection: rtl;

 So the question is could org-mime-htmlize support this element (on
 demand as well for example via (defvar org-mime-htmlize-rtl t)??


The responsibility for determining if the paragraph is RTL or LTR
depends on the client rading the email, not the author. Since most
clients are not RTL aware (Thunderbird needs an addon to make it RTL
aware) the email author can use HTML which allows one to mark the
paragraphs or entire mail as RTL.

If HTML mail is not an option, you can precede the mail (or every
paragraph, again this is reading-client dependent) with the
non-printing RLE (Right-to-Left Embedding) character.

More info here, including RLE character and other characters that you
can copy and paste into your emails:
http://dotancohen.com/howto/rtl_right_to_left.html

-- 
Dotan Cohen

http://gibberish.co.il
http://what-is-what.com



[O] Bug: Typo in manual [8.2.10 (release_8.2.10 @ /usr/share/emacs/24.4/lisp/org/)]

2015-03-14 Thread Reuben Thomas


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 section “@LaTeX{} and PDF export” says:

The
default @LaTeX{} output is designed for processing with @code{pdftex} or
@LaTeX{}

The last “@LaTeX{}” should presumably be “@code{latex}”.

Emacs  : GNU Emacs 24.4.1 (x86_64-pc-linux-gnu, GTK+ Version 3.10.8)
 of 2014-11-21 on skwd, modified by Debian
Package: Org-mode version 8.2.10 (release_8.2.10 @ 
/usr/share/emacs/24.4/lisp/org/)

current state:
==
(setq
 org-export-backends '(ascii html icalendar latex odt)
 org-tab-first-hook '(org-hide-block-toggle-maybe 
org-src-native-tab-command-maybe org-babel-hide-result-toggle-maybe 
org-babel-header-arg-expand)
 org-latex-classes '((article \\documentclass[11pt]{article} 
(\\section{%s} . \\section*{%s}) (\\subsection{%s} . \\subsection*{%s})
  (\\subsubsection{%s} . \\subsubsection*{%s}) 
(\\paragraph{%s} . \\paragraph*{%s}) (\\subparagraph{%s} . 
\\subparagraph*{%s}))
 (report \\documentclass[11pt]{report} (\\part{%s} . 
\\part*{%s}) (\\chapter{%s} . \\chapter*{%s}) (\\section{%s} . 
\\section*{%s})
  (\\subsection{%s} . \\subsection*{%s}) 
(\\subsubsection{%s} . \\subsubsection*{%s}))
 (book \\documentclass[11pt]{book} (\\part{%s} . 
\\part*{%s}) (\\chapter{%s} . \\chapter*{%s}) (\\section{%s} . 
\\section*{%s})
  (\\subsection{%s} . \\subsection*{%s}) 
(\\subsubsection{%s} . \\subsubsection*{%s}))
 (scrartcl \\documentclass{scrartcl} (\\section{%s} . 
\\section*{%s}) (\\subsection{%s} . \\subsection*{%s})
  (\\subsubsection{%s} . \\subsubsection*{%s}) 
(\\paragraph{%s} . \\paragraph*{%s}) (\\subparagraph{%s} . 
\\subparagraph*{%s}))
 )
 org-latex-default-packages-alist '((utf8x inputenc t) (T1 fontenc t) 
( fixltx2e nil) ( graphicx t) ( longtable nil) ( float nil) ( 
wrapfig nil)
( rotating nil) (normalem ulem t) 
( amsmath t) ( textcomp t) ( marvosym t) ( wasysym t) ( 
amssymb t)
( hyperref nil) \\tolerance=1000 ( 
palatino nil))
 org-speed-command-hook '(org-speed-command-default-hook 
org-babel-speed-command-hook)
 org-occur-hook '(org-first-headline-recenter)
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-html-format-drawer-function '(lambda (name contents) contents)
 org-latex-format-inlinetask-function 'ignore
 org-confirm-shell-link-function 'yes-or-no-p
 org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default
 org-export-with-section-numbers nil
 org-file-apps '((auto-mode . emacs) (\\.mm\\' . default) (\\.x?html?\\' . 
default) (\\.pdf\\' . default) (t . xdg-open %s) (system . xdg-open %s))
 org-latex-format-headline-function 'org-latex-format-headline-default-function
 org-default-notes-file ~/Notes/Notes.org
 org-startup-indented t
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-latex-format-drawer-function '(lambda (name contents) contents)
 org-odt-format-headline-function 'ignore
 org-from-is-user-regexp \\Reuben Thomas\\
 org-src-mode-hook '(org-src-babel-configure-edit-buffer 
org-src-mode-configure-edit-buffer)
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-babel-pre-tangle-hook '(save-buffer)
 org-mode-hook '((lambda nil (local-set-key \351 (quote 
org-toggle-iimage-in-org))) window-margin-mode
 #[nil \300\301\302\303\304$\207 [org-add-hook 
change-major-mode-hook org-show-block-all append local] 5]
 #[nil \300\301\302\303\304$\207 [org-add-hook 
change-major-mode-hook org-babel-show-result-all append local] 5] 
org-babel-result-hide-spec
 org-babel-hide-all-hashes turn-on-eldoc-mode)
 org-ascii-format-drawer-function '(lambda (name contents width) contents)
 org-odt-format-inlinetask-function 'ignore
 org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point 
org-babel-execute-safely-maybe)
 org-directory ~/Notes
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers 
org-cycle-hide-inline-tasks org-cycle-show-empty-lines 
org-optimize-window-after-visibility-change)
 org-footnote-define-inline t
 org-confirm-elisp-link-function 'yes-or-no-p
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-odt-format-drawer-function '(lambda (name contents) contents)
 org-latex-default-class scrartcl
 org-html-format-headline-function 'ignore
 org-footnote-auto-label nil
 org-html-format-inlinetask-function 'ignore
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 org-latex-inputenc-alist '((utf8 . utf8x))
 )
-- 
http://rrt.sc3d.org/



[O] [Feature Request] Configure timing format

2015-03-14 Thread Koen van der Kruk
Hello,
I am planning to add a new feature to orgmode, but I don't know if there is
already something like I described below. I am also wondering if someone
could tell me how much time this is going to take.
I have a little experience with orgmode and emacs, but still have to learn
a lot.

Feature description:

It currently is not possible to configure the timing format to the
resolution you want. This project is about adding this feature to org-mode.
After implementation, it should be possible to chose any timing resolution
you want, ranging from precision to hours, quarters of an hour, seconds,
milliseconds, etc. The only limitation should be the internal timing
resolution of the operating system on which emacs runs. Moreover, all
functions associated with time (such as automatic calculation of durations
etc. etc. overlays, should also continue to work correctly). Milliseconds
may be overkill, but the point of this project is that it makes org-mode
abstract from a fixed timing resolution, it should be fully configurable.

Thanks in advance,

Yours Faithfully,

Koen

P.S. My apologies if someone already asked the same sort question, or if I
didn't follow the mailing list rules.


[O] [ox, patch] Keywords what should go in ox?

2015-03-14 Thread Rasmus
Hi,

First, as discussed a while back we want to move DESCRIPTION and KEYWORDS
out of ox.el as they are specific to certain backends.  The first patch
does this.

Second, I want to add support for printing keywords.  This patch is still
rough (i.e. no need commenting), but before proceeding I want to discuss
some things.  The goal is to allow cool stuff like:

   #+begin_abstract
 Read my paper, please...
 #+keywords: org, markup
   #+end_abstract

And eventually:

   #+tile: my fancy blog
   #+keywords: org, markup

Where 'org' and 'markup' would magically become links to indexes (like on
them fancy blogs on the interwebs).  I'm still not sure how to do the
latter (see TODO comment in patch).

So, I'm in a dilemma now.  On the one hand, ox should probably not include
too much cruft that is specific to certain backends.  OTOH, stuff like the
repetition of org-BACKEND-with-keywords and org-BACKEND-keywords-prefix is
a bit annoying (cf. patch).

Another idea I want to discuss.  I use prefix to designate what is
printed before the :.  By default the translated value of Keywords.
Would it make sense to make this configurable in the file, e.g. as

  #+KEYWORDS: [my prefix: ] key0, key1, 

—Rasmus

-- 
To err is human. To screw up 10⁶ times per second, you need a computer
From 033f7b89f9f7d8a6776bc0758b0bd2db69eb24d1 Mon Sep 17 00:00:00 2001
From: Rasmus ras...@gmx.us
Date: Fri, 13 Mar 2015 21:38:26 +0100
Subject: [PATCH 1/2] ox: Move KEYWORD and DESCRIPTION out of ox

* ox.el: Remove KEYWORD and DESCRIPTION.
* ox-deck.el, ox-rss.el, ox-html, ox-latex, ox-odt, ox-org: Add
  keyword and description.
* org.texi (Export settings): Explicit state which backends
  support DESCRIPTION and KEYWORDS.
---
 contrib/lisp/ox-deck.el | 4 +++-
 contrib/lisp/ox-rss.el  | 4 +++-
 doc/org.texi| 9 ++---
 lisp/ox-html.el | 2 ++
 lisp/ox-latex.el| 2 ++
 lisp/ox-odt.el  | 2 ++
 lisp/ox-org.el  | 2 ++
 lisp/ox.el  | 2 --
 8 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/contrib/lisp/ox-deck.el b/contrib/lisp/ox-deck.el
index 0ebde41..7155863 100644
--- a/contrib/lisp/ox-deck.el
+++ b/contrib/lisp/ox-deck.el
@@ -51,7 +51,9 @@
 	  (if a (org-deck-export-to-html t s v b)
 		(org-open-file (org-deck-export-to-html nil s v b)))
   :options-alist
-  '((:html-link-home HTML_LINK_HOME nil nil)
+  '((:description DESCRIPTION nil nil newline)
+(:keywords KEYWORDS nil nil space)
+(:html-link-home HTML_LINK_HOME nil nil)
 (:html-link-up HTML_LINK_UP nil nil)
 (:deck-postamble DECK_POSTAMBLE nil org-deck-postamble newline)
 (:deck-preamble DECK_PREAMBLE nil org-deck-preamble newline)
diff --git a/contrib/lisp/ox-rss.el b/contrib/lisp/ox-rss.el
index 67b925f..8d3cc27 100644
--- a/contrib/lisp/ox-rss.el
+++ b/contrib/lisp/ox-rss.el
@@ -122,7 +122,9 @@ When nil, Org will create ids using `org-icalendar-create-uid'.
 	  (if a (org-rss-export-to-rss t s v)
 		(org-open-file (org-rss-export-to-rss nil s v)))
   :options-alist
-  '((:with-toc nil nil nil) ;; Never include HTML's toc
+  '((:description DESCRIPTION nil nil newline)
+(:keywords KEYWORDS nil nil space)
+(:with-toc nil nil nil) ;; Never include HTML's toc
 (:rss-extension RSS_EXTENSION nil org-rss-extension)
 (:rss-image-url RSS_IMAGE_URL nil org-rss-image-url)
 (:rss-categories nil nil org-rss-categories))
diff --git a/doc/org.texi b/doc/org.texi
index 632eb19..8fd958c 100644
--- a/doc/org.texi
+++ b/doc/org.texi
@@ -10612,7 +10612,9 @@ exported.}.
 @item DESCRIPTION
 @cindex #+DESCRIPTION
 The document description.  Back-ends handle it as they see fit (e.g., for the
-XHTML meta tag), if at all.  You can use several such keywords for long
+XHTML meta tag), if at all.  The description-keyword is used in
+@LaTeX{}-backends (see @var{org-latex-hyperref-template}), the HTML backend,
+and the ODT backend.  You can use several such keywords for long
 descriptions.
 
 @item EMAIL
@@ -10623,8 +10625,9 @@ The email address (@code{user-mail-address}).
 @item KEYWORDS
 @cindex #+KEYWORDS
 The keywords defining the contents of the document.  Back-ends handle it as
-they see fit (e.g., for the XHTML meta tag), if at all.  You can use several
-such keywords if the list is long.
+they see fit (e.g., for the XHTML meta tag), if at all.  Keywords are used in
+@LaTeX{} backends, (see @var{org-latex-hyperref-template}), the HTML backend,
+and the ODT backend.  You can use several such keywords if the list is long.
 
 @item LANGUAGE
 @cindex #+LANGUAGE
diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index 92fe3d9..21e6122 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -110,6 +110,8 @@
   :options-alist
   '((:html-doctype HTML_DOCTYPE nil org-html-doctype)
 (:html-container HTML_CONTAINER nil org-html-container-element)
+(:description DESCRIPTION nil nil newline)
+(:keywords KEYWORDS nil nil space)
 (:html-html5-fancy nil html5-fancy 

Re: [O] Multicite syntax

2015-03-14 Thread Richard Lawrence
Hi Nicolas,

Nicolas Goaziou m...@nicolasgoaziou.fr writes:

 Agreed. I introduced yet another syntax change in wip-cite branch.

 Now there are two separate objects citation and citation-reference.
 So the following multicite 

   [cite:prefix; pre @a post; @b]

 is parsed like

   (citation (:prefix prefix :parenthetical nil) 
(citation-reference (:key a :prefix pre :suffix post))
(citation-reference (:key b)))

With this change, what's the proper way to get the citation-references
inside a citation?  Before this change, one could simply do:

(org-element-property :references citation) 

to get the references in a citation; what's the equivalent incantation
now?

Your example here makes it look like I should be able to do something
like:

#+BEGIN_SRC elisp
(let* ((citation (org-element-context))
   (references
  (remove-if-not
   (lambda (o) (and (listp o) (eq (car o) 'citation-reference)))
   citation)))
   ; ...
   )
#+END_SRC

But, AFAICT, citation objects do not actually have citation-reference
objects within them, at least when returned by org-element-context.

I'm sure there is something simple I am misunderstanding here about how
nested objects work...can you enlighten me?  

Thanks!

Best,
Richard




[O] Properties drawer

2015-03-14 Thread Nicolas Calderon
Hi,

I'm currently using the org-treat-insert-todo-heading-as-state-change
and I log state changes, which means that when I create a heading it
automatically inserts a logbook drawer. I like to keep my property
drawers near the heading, but their position doesn't seem to be
anchored as tags are. After entering my heading, if I press RET, I end
up pushing the drawers further down and inserting text between the
heading and the drawers.  I also try to assign ids from the get go,
for further referencing, so I have 2 drawers (logbook and properties).
Skipping all that and inserting text after is a bit annoying. Is there
an easy way to ensure the drawers always stay nicely tucked under the
headings? I'm looking for something like whatever keeps the tags in
place no matter what.

Thanks,

--
Nicolas Calderon Asselin



Re: [O] Bug: Typo in manual [8.2.10 (release_8.2.10 @ /usr/share/emacs/24.4/lisp/org/)]

2015-03-14 Thread Rasmus
Reuben Thomas r...@sc3d.org writes:
 The section “@LaTeX{} and PDF export” says:

 The
 default @LaTeX{} output is designed for processing with @code{pdftex} or
 @LaTeX{}

 The last “@LaTeX{}” should presumably be “@code{latex}”.


Thanks.  Fixed in 5fe3a68.

—Rasmus

-- 
What will be next?