Re: [O] export subtree

2015-12-10 Thread Andreas Leha
Hi Skip,

Skip Collins  writes:
> The export dispatcher allows me to export only the current subtree.
> This is nice, but I would like to avoid having to put point in just
> the right place before invoking the dispatcher. I have a document with
> lots of things in it. One of the top-level headlines contains the
> content of what I want to export. Is there a way to flag this heading
> and its contents as the main export document so that wherever my
> cursor is, when I export the document it only processes the correct
> heading, treating its text as the title of the document?

Try to run `org-export-dispatch' with a prefix from the second time
onwards (so, do C-u C-c C-e).

>From its docstring:

,
| When ARG is C-u, repeat the last export action, with the same set
| of options used back then, on the current buffer.
`

This might do what you want already.

Regards,
Andreas




Re: [O] Beamer export: metropolis-theme specific question

2015-12-10 Thread zang_news

Am 09.12.2015 12:45 schrieb Eric S Fraga:

On Tuesday,  8 Dec 2015 at 21:07, zang_n...@posteo.de wrote:

Dear fellow Orgers,

I like the metropolis beamer theme a lot [1], and I use it with Org
frequently. metropolis has a \plain macro that inserts a new, 
minimally
styled slide optimal for a short statement or an image. In plain 
latex,

I would do e.g.


[...]


I just cannot get my head around how to tell Org to do this! If I do

* a normal frame with title etc.
some content

#+BEGIN_LATEX
\plain{another normal frame with title etc.}
#+END_LATEX

* another normal frame with title etc.
some other content


This is really tricky because a headline in org both ends the preceding
frame and starts a new frame.  The only way I can think of is for you 
to

explicitly end and start the adjoining frames, as in:

#+begin_src org
  ,* a normal frame with title etc.
  some content

  ,#+BEGIN_LATEX
  \end{frame}
  \plain{another normal frame with title etc.}
  \begin{frame}{another normal frame with title etc.}
  ,#+END_LATEX

  some other content
#+end_src

This will be somewhat fragile, e.g. if previous frame has columns they
will also need to be terminated properly...


Thanks Eric, also for the explanation! This solution works for my setup, 
since I usually do not use columns.

Best, Christian



[O] Concerning `(letrec ((ignore)) ...)' in line 2718 of lisp/ox.el

2015-12-10 Thread Zack Piper
Hi,

When I attempt to export an Org document using the HTML backend (and
Org backend) I get (after the initial tangle, even a normal Org
document with the word "Example" fails):

╭
│ Wrong number of arguments: setq, 1
╰

So I proceed to use Edebug to find out why this is happening:

Line 2718, of `lisp/ox.el' causes it.

That line is

╭
│ (letrec ((ignore) ...))
╰

So I tried using `M-: (letrec ((ignore)) "test"), and get the same as before.

So my question is, why is this failing now? According to `magit-blame'
these lines haven't been touched in a while, so I'm genuinely not sure
why it does this now, and, of course, is there a fix?


Thanks!



[O] [PATCH] Implement RSS_FEED_URL option keyword

2015-12-10 Thread Arun Isaac

Hi,

I have implemented a new option keyword, RSS_FEED_URL, for the RSS
exporter backend.

The RSS_FEED_URL goes into the atom:link element that identifies the
feed's own URL.

http://www.rssboard.org/rss-profile#namespace-elements-atom-link

Currently, the feed URL is assumed to be html-link-home or
publishing-directory concatenated with the output filename of the
feed. This need not necessarily be so. So, the RSS_FEED_URL option
keyword is introduced to let the user customize the feed URL.

Please review the patch and consider for inclusion.

Thanks,
Arun Isaac.



signature.asc
Description: PGP signature
>From c0447601cd77ae8877f7ea42bdadcc4179cd0113 Mon Sep 17 00:00:00 2001
From: Arun Isaac 
Date: Fri, 11 Dec 2015 02:12:59 +0530
Subject: [PATCH] ox-rss: Implement RSS_FEED_URL option keyword

* contrib/lisp/ox-rss.el (org-rss-build-channel-info): Try to use the
  specified RSS_FEED_URL option keyword as publink before resorting to
  concatenating blogurl with output filename.

The RSS_FEED_URL goes into the atom:link element that identifies the
feed's own URL. Currently, the feed URL is assumed to be html-link-home
or publishing-directory concatenated with the output filename of the
feed. This need not always be so. So, the RSS_FEED_URL option keyword
is introduced to let the user customize the feed URL.
---
 contrib/lisp/ox-rss.el | 13 -
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/contrib/lisp/ox-rss.el b/contrib/lisp/ox-rss.el
index 4cdfe0e..39fce30 100644
--- a/contrib/lisp/ox-rss.el
+++ b/contrib/lisp/ox-rss.el
@@ -31,10 +31,11 @@
 ;; `org-rss-export-as-rss' (temporary buffer) and `org-rss-export-to-rss'
 ;; (as a ".xml" file).
 ;;
-;; This backend understands two new option keywords:
+;; This backend understands three new option keywords:
 ;;
 ;; #+RSS_EXTENSION: xml
 ;; #+RSS_IMAGE_URL: http://myblog.org/mypicture.jpg
+;; #+RSS_FEED_URL: http://myblog.org/feeds/blog.xml
 ;;
 ;; It uses #+HTML_LINK_HOME: to set the base url of the feed.
 ;;
@@ -127,6 +128,7 @@ When nil, Org will create ids using `org-icalendar-create-uid'."
 (: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-feed-url "RSS_FEED_URL" nil nil t)
 (:rss-categories nil nil org-rss-categories))
   :filters-alist '((:filter-final-output . org-rss-final-function))
   :translate-alist '((headline . org-rss-headline)
@@ -331,10 +333,11 @@ as a communication channel."
 	 (image (url-encode-url (plist-get info :rss-image-url)))
 	 (ifile (plist-get info :input-file))
 	 (publink
-	  (concat (file-name-as-directory blogurl)
-		  (file-name-nondirectory
-		   (file-name-sans-extension ifile))
-		  "." rssext)))
+	  (or (plist-get info :rss-feed-url)
+	  (concat (file-name-as-directory blogurl)
+		  (file-name-nondirectory
+		   (file-name-sans-extension ifile))
+		  "." rssext
 (format
  "\n%s
 
-- 
2.6.3



Re: [O] [PATCH] Implement RSS_FEED_URL option keyword

2015-12-10 Thread Arun Isaac
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Arun Isaac  writes:

> Currently, the feed URL is assumed to be html-link-home or
> publishing-directory concatenated with the output filename of the
> feed. This need not necessarily be so. So, the RSS_FEED_URL option
> keyword is introduced to let the user customize the feed URL.

Elaborating on this:

Currently, the feed is always assumed to be on the root of the server,
and the generated feed URL is something like
"http://foo.org/blog.xml;. But, the user might want to have the feed in
some subdirectory on the server (something like
"http://foo.org/feeds/blog.xml;).

As far as I understand, there is currently no way to do this. Hence, I
implemented RSS_FEED_URL to fill this void.
-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iQEcBAEBCAAGBQJWae+eAAoJEC4l7othgCuzpEwH/jSzkCt5529C6gGP3pMY7qb2
CgH7PaY86z3mmZWtcEysb0yGd/yQEPDezG3y2NMrUvnJthT0S1XCWTvzgtPrSYGn
+fRpoSLVDc+EIbC6WahAEXk5fAEi569EWEByfkCERvhqV5qSAeOfwelLmtaS5zAJ
j2aNHe0//+bCBNI1pKzOucQ2roY4nFQ8TRHDVLbM092Fm9pD093adMHpOILA/5vm
L88NHBz7Qm15zaDKyDFMwSHybjYk3V4bTF4m+VV7LE/W07aiq5tDHQsDRu0wo4jI
pGUWcJb9EdLdNwKavvzMKBGmdkCJp64iUwmbT7c/tozv+rU5l3bWalQ1ZI2klc0=
=v8WT
-END PGP SIGNATURE-



Re: [O] export subtree

2015-12-10 Thread Skip Collins
Andreas Leha  wrote:
>> The export dispatcher allows me to export only the current subtree.
>> This is nice, but I would like to avoid having to put point in just
>> the right place before invoking the dispatcher. I have a document with
>> lots of things in it. One of the top-level headlines contains the
>> content of what I want to export. Is there a way to flag this heading
>> and its contents as the main export document so that wherever my
>> cursor is, when I export the document it only processes the correct
>> heading, treating its text as the title of the document?
>
> Try to run `org-export-dispatch' with a prefix from the second time
> onwards (so, do C-u C-c C-e).

Good try, but it does not do what I want. It selects the subtree
currently at point, just as if I ran the dispatcher again and selected
the same options. It might be a nice enhancement if the dispatcher
remembered which subtree it used last time so that it really could
repeat a subtree export with the same options and from the same
subtree.



Re: [O] export subtree

2015-12-10 Thread Herbert Sitz
Not a perfect solution, buy I think you can use the #+SELECT_TAGS option to
set which tress will be exported by default, then tag your desired export
tree with that tag.  Then when you export the full buffer (not just a
subtree) it will choose the tree with that tag.

E.g.,
-
#+SELECT_TAGS: myexporttree

* Main tree :myexporttree:
fkjaldfk
** subhead
** subhead
* anoher heading 1
* another heading level 1
** subhead
** subhead


In org buffer above it will export only the first subtree now when you
export the entire buffer.  You should be able to export the others
selectively if you choose scope as 'subtree'.  And you can always comment
out or delete the SELECT_TAGS line if you want to export entire buffer.




Re: [O] export subtree

2015-12-10 Thread Andreas Leha
Hi Skip,

Skip Collins  writes:
> Andreas Leha  wrote:
>>> The export dispatcher allows me to export only the current subtree.
>>> This is nice, but I would like to avoid having to put point in just
>>> the right place before invoking the dispatcher. I have a document with
>>> lots of things in it. One of the top-level headlines contains the
>>> content of what I want to export. Is there a way to flag this heading
>>> and its contents as the main export document so that wherever my
>>> cursor is, when I export the document it only processes the correct
>>> heading, treating its text as the title of the document?
>>
>> Try to run `org-export-dispatch' with a prefix from the second time
>> onwards (so, do C-u C-c C-e).
>
> Good try, but it does not do what I want. It selects the subtree
> currently at point, just as if I ran the dispatcher again and selected
> the same options. It might be a nice enhancement if the dispatcher
> remembered which subtree it used last time so that it really could
> repeat a subtree export with the same options and from the same
> subtree.

That is what it does for me.  As I said, you have to do the first export
the normal way.

What is your Org version (M-x org-version)?

Regards,
Andreas




Re: [O] export subtree

2015-12-10 Thread John Hendy
On Thu, Dec 10, 2015 at 6:27 PM, Herbert Sitz  wrote:
> Not a perfect solution, buy I think you can use the #+SELECT_TAGS option to
> set which tress will be exported by default, then tag your desired export
> tree with that tag.  Then when you export the full buffer (not just a
> subtree) it will choose the tree with that tag.
>

This was going to be my suggestion as well! In the case that a
majority of the document is desired for export, #+EXCLUDE_TAGS is
helpful as well. For reference:
- http://orgmode.org/manual/Export-settings.html

Export tags are fantastic, as one can add as many as desired and then
simply change the #+select_tags/#+exclude_tags target to generate a
bunch of variations from the same single .org file.

Maybe a little extreme and irrelevant to the OP need(s), but I've also
programmatically generated Org heading syntax with R, spit out
headlines with data driven content, inserted a \newpage at the end of
each, and then split them apart with stapler.[1] I was serving as a
financials secretary for a group at work, managing the budgets of many
chapter entities. This allowed me to start with a .csv with the target
spend for the next year, use R to create a document for each chapter,
and then send the chairs their tailored document vs. manually changing
figures and generating ~40 documents by hand. Worked slick! If any of
that sounds appealing/relevant, let me know and I can share an
example.


Best regards,
John

> E.g.,
> -
> #+SELECT_TAGS: myexporttree
>
> * Main tree :myexporttree:
> fkjaldfk
> ** subhead
> ** subhead
> * anoher heading 1
> * another heading level 1
> ** subhead
> ** subhead
> 
>
> In org buffer above it will export only the first subtree now when you
> export the entire buffer.  You should be able to export the others
> selectively if you choose scope as 'subtree'.  And you can always comment
> out or delete the SELECT_TAGS line if you want to export entire buffer.
>
>



Re: [O] export subtree

2015-12-10 Thread Skip Collins
Andreas Leha  wrote:
> Skip Collins  writes:
>>> Try to run `org-export-dispatch' with a prefix from the second time
>>> onwards (so, do C-u C-c C-e).
>>
>> Good try, but it does not do what I want. It selects the subtree
>> currently at point, just as if I ran the dispatcher again and selected
>> the same options. It might be a nice enhancement if the dispatcher
>> remembered which subtree it used last time so that it really could
>> repeat a subtree export with the same options and from the same
>> subtree.
>
> That is what it does for me.  As I said, you have to do the first export
> the normal way.

Okay, it works now. I had confused org by trying to get it to work
from an INCLUDEd file. When that did not work, I had gone back to the
parent file and it did not work there. If I stick within a single
buffer and do not try to export from another buffer, it works as you
describe.
Thanks.



[O] An issue with org-agenda-todo-list-sublevels

2015-12-10 Thread Marcin Borkowski
Hi list,

I have org-agenda-todo-list-sublevels set to nil.  However, given this
tree:

* DONE task
** TODO subtask

it turns out that the todo list in the agenda shows the "subtask" anyway.

Should it be so?  I would guess not.

The reason I'd like to exclude this "subtask" from displaying is
something like this: assume that I have a project, halfway done, which
must be postponed for some reason.  I'd like to be able to do this:

* SOMEDAY cool project
** DONE preparation
** TODO hard work

where SOMEDAY is a done-type keyword.

And of course, I don't want to be bothered by "hard work" in this case
in my global todo list.

Is there a way to achieve this?
(Org-mode version 8.3beta (release_8.3beta-1136-g0e7062).)

If not, can it be considered a feature request?

A cursory examination of org-agenda.el shows that the culprit is the
function org-agenda-get-todos, and that (probably) this is responsible:

--8<---cut here---start->8---
 (regexp (format org-heading-keyword-regexp-format
 (cond
  ((and org-select-this-todo-keyword
(equal org-select-this-todo-keyword "*"))
   org-todo-regexp)
  (org-select-this-todo-keyword
   (concat "\\("
   (mapconcat 'identity
  (org-split-string
   org-select-this-todo-keyword
   "|")
  "\\|") "\\)"))
  (t org-not-done-regexp
--8<---cut here---end--->8---

(notice the last line, with `org-not-done-regexp'!)

A possible course of action might be to change that line to use
`org-todo-regexp'; OTOH, the exclusion of tasks marked as done should be
then done differently.

(If there is any interest, I might try to look into it further.)

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University



[O] Bug: Need additional context 'protocol' for capture templates [8.3.2 (8.3.2-39-gd537a3-elpa @ /home/phil/.emacs.d/elpa/org-20151123/)]

2015-12-10 Thread Phil Hudson


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.


I set my web capture template's context to w3m-mode. I expected it still
to be accessible via remote org-protocol invocation from Conkeror, but
found that it was not when I tried my previously-working Conkeror
command for bookmarking the current page in Org. Removing the context
restriction from my web capture template re-enabled the command.

I propose the addition of a 'protocol' context and code to handle it. I
envision being able to specify that access to my web capture template is
restricted to 'w3m-mode', 'eww-mode' or 'protocol', for example.

Emacs  : GNU Emacs 24.5.1 (x86_64-unknown-linux-gnu, X toolkit, Xaw3d scroll 
bars)
 of 2015-04-25 on quiz
Package: Org-mode version 8.3.2 (8.3.2-39-gd537a3-elpa @ 
/home/phil/.emacs.d/elpa/org-20151123/)

current state:
==
(setq
org-id-locations-file "~/.emacs.d/org-id-locations"
org-hide-leading-stars t
org-tab-first-hook '(org-hide-block-toggle-maybe
org-babel-hide-result-toggle-maybe
org-babel-header-arg-expand)
org-mobile-files '(org-agenda-files "~/org/bookmarks.org"
  "~/org/Cygwin-install-checklist.org"
  "~/org/emacs-install-checklist.org"
  "~/org/Handles.org" "~/org/Home-LAN.org"
  "~/org/linux-install-checklist.org"
  "~/org/Mac-install-checklist.org"
  "~/org/Movies.org" "~/org/music.org" 
"~/org/Windows-install-checklist.org")
org-speed-command-hook '(org-speed-command-default-hook 
org-babel-speed-command-hook)
org-agenda-diary-file "~/SpiderOak/diary.org"
org-occur-hook '(org-first-headline-recenter)
org-metaup-hook '(org-babel-load-in-session-maybe)
org-log-done 'time
org-confirm-shell-link-function 'yes-or-no-p
org-finalize-agenda-hook '(ph/force-revert-google-calendar-org-buffer
  ph/un-mouse-highlight
  ph/org-agenda-to-appt)
org-mobile-before-process-capture-hook 
'(ph/force-revert-google-calendar-org-buffers)
org-special-ctrl-a/e t
org-agenda-prefix-format '((agenda . "%-6:c%?-12t%-13s") (timeline . "% s")
  (todo . "%-12:c")
  (tags . "%-12:c") (search . "%-12:c"))
org-agenda-custom-commands '(("n" "Agenda and all TODOs" ((agenda "" nil) 
(alltodo "" nil)) nil))
org-mobile-pre-push-hook '(ph/force-revert-google-calendar-org-buffers)
org-return-follows-link t
org-default-notes-file "~/org/notes.org"
org-capture-templates '(("w" "Capture from web browser such as Conkeror"
entry
(file+headline "~/org/bookmarks.org" "Web
capture")
"* %c %?\n  Sourced: %u\n\n  %i" :prepend t
:jump-to-captured t)
   ("t" "Capture a task" entry (file+headline
   "~/org/ToDo.org" 
"Incoming")
   "* TODO %?   %^G\n  SCHEDULED: %t\n
   %^{Effort}p\n  Created: %U"
   :prepend t :jump-to-captured t)
   ("b" "Capture a purchasing task" entry
   (file+headline "~/org/ToDo.org" "Incoming")
   "* TODO Bought %?  %^G:buy:work:\n
   SCHEDULED: %t\n  :PROPERTIES:\n
   :DATE_ORDERED: %u\n  :END:  %^{PRICE}p\n
   Created: %U" :prepend t :jump-to-captured t)
   ("h" "Capture a habit" entry (file+headline

"~/org/ToDo.org" "Incoming")
   "* TODO %?  %^G\n  SCHEDULED:
   <%(ph/current-date-and-day-for-habit)
   .+%^{Interval:|1d}>\n  :PROPERTIES:\n
   :STYLE:habit\n  :REPEAT_TO_STATE: TODO\n
   :END:\n  Created: %U" :prepend t
   :jump-to-captured t)
   ("c" "Capture a phone call to make" entry
   (file+headline "~/org/ToDo.org" "Incoming")
   "* TODO Called %(ph/capture-bbdb \"%a\"
   \"%:company\") on 

[O] export subtree

2015-12-10 Thread Skip Collins
The export dispatcher allows me to export only the current subtree.
This is nice, but I would like to avoid having to put point in just
the right place before invoking the dispatcher. I have a document with
lots of things in it. One of the top-level headlines contains the
content of what I want to export. Is there a way to flag this heading
and its contents as the main export document so that wherever my
cursor is, when I export the document it only processes the correct
heading, treating its text as the title of the document?



Re: [O] Proposal and RFC for improving ob-python

2015-12-10 Thread Kyle Meyer
Ondřej Grover  writes:

[...]

>> But what about when :results != value?  Doesn't your proposal only
>> handle returning the last value?
>>
> You mean :results output ? In that case it could just omit the
> "open(...).write(...) " part and capture anything the console prints before
> the primary prompt appears again.
> Or it could capture stdout into a file, but I think that's needlessly
> complicated:
>
> python -i << HEREDOC_END
> import sys
> sys.stdout = open()   # replace stdout with some file
> _ = block_eval("""
> 
> """)
> sys.stdout.close()
> sys.stdout = sys.__stdout__  # restore stdout
> HEREDOC_END

(I think you should rely on Org babel's shared utilities,
e.g. org-babel-eval and org-babel-eval-read-file, unless there is a
specific reason they won't do.  At any rate, right now I'm just trying
to get a picture of how block_eval would fit in.)

So these are the main options to consider for Python:

| | output | value |
|-++---|
| non-session | a  | b |
| session | c  | d |

a) Using block_eval here seems unhelpful here because the method in
   place is already simple:

   (org-babel-eval org-babel-python-command body)

b) block_eval replaces the need for dumping the code into a function.
   Using block_eval in org-babel-python-wrapper-method would allow you
   to get rid of the odd "return" use.

c) Currently, this is handled by inserting the body lines one at a time
   and then getting the output by splitting on the prompt.  Aside from
   race condition issues, this has limitations with handling blank lines
   in the body.

   block_eval could help here because the whole body could be sent
   through as one line of input to the prompt.  This should resolve most
   issues with prompt splitting, as well as lift the body formatting
   restrictions for sessions.

   However, the main issue I see with this is that I think it would lose
   the main distinction between session and non-session for ":results
   output" that is discussed in (info "(org) Results of evaluation"):

   #+BEGIN_SRC python :results output
print "hello"
2
print "bye"
   #+END_SRC

   #+RESULTS:
   : hello
   : bye

   versus this

   #+BEGIN_SRC python :results output :session
print "hello"
2
print "bye"
   #+END_SRC

   #+RESULTS:
   : hello
   : 2
   : bye

d) The variable _ is assigned the last value by the shell, so the
   current mechanism should work even if block_eval is used as described
   in c.

I've attached a quick-and-dirty patch, just for discussion.  At least
under light testing, it resolves the issues I listed in my previous
response [1].  It does have the change in behavior discussed in c, which
I see as problematic.

It also raises the issue of how to incorporate the block_eval code.  I
think there are two main options.

* Require the user have the module installed and import it.

* Make the module into a snippet to go into the ob-python.el.

The first option is what the current patch does.  The problem is that it
requires users to install an external module.  The second option avoids
that but is uglier and harder to maintain.


[1] There's a remaining issue, which I believe is specific to newer
versions of python.el, where the first time a session block is
executed, it doesn't wait for the shell to load up before sending
input.

>From 642370236f6ca06e70ea32866eedcdba161fd2c4 Mon Sep 17 00:00:00 2001
From: Kyle Meyer 
Date: Thu, 10 Dec 2015 22:09:05 -0500
Subject: [PATCH] WIP lisp/ob-python.el: Use block_eval

---
 lisp/ob-python.el | 108 +++---
 1 file changed, 54 insertions(+), 54 deletions(-)

diff --git a/lisp/ob-python.el b/lisp/ob-python.el
index 95a06f5..baaaf82 100644
--- a/lisp/ob-python.el
+++ b/lisp/ob-python.el
@@ -224,19 +224,18 @@ (defun org-babel-python-initiate-session ( session _params)
 
 (defvar org-babel-python-eoe-indicator "'org_babel_python_eoe'"
   "A string to indicate that evaluation has completed.")
-(defconst org-babel-python-wrapper-method
-  "
-def main():
-%s
 
-open('%s', 'w').write( str(main()) )")
+(defconst org-babel-python-block-eval-import
+  "from block_eval import block_eval as _ob_python_eval")
+
+(defconst org-babel-python-wrapper-method
+  (concat org-babel-python-block-eval-import "
+open('%s', 'w').write(str(_ob_python_eval('%s')))"))
 (defconst org-babel-python-pp-wrapper-method
-  "
+  (concat org-babel-python-block-eval-import "
 import pprint
-def main():
-%s
-
-open('%s', 'w').write( pprint.pformat(main()) )")
+from block_eval import block_eval as _ob_python_eval
+open('%s', 'w').write(pprint.pformat(str(_ob_python_eval('%s'"))
 
 (defun org-babel-python-evaluate
   (session body  result-type result-params preamble)
@@ -247,6 +246,9 @@ (defun org-babel-python-evaluate
 

Re: [O] export subtree

2015-12-10 Thread John Hendy
On Thu, Dec 10, 2015 at 8:50 PM, Skip Collins  wrote:
> Herbert Sitz  wrote:
>> * Main tree :myexporttree:
>> fkjaldfk
>> ** subhead
>> ** subhead
>> * anoher heading 1
>> * another heading level 1
>> ** subhead
>> ** subhead
>
> I did try using the default SELECT_TAG :export: on my main document
> subtree. The problem is that the subtree is not "promoted" to the main
> level. In your example, the title would not become "Main tree" as it
> would if I selected subtree export in the dispatcher.
>

Ah. Agreed on the behavior. I missed your specific request and agree
this doesn't work.

Thinking about it more, using select_tags as a potential solution to
your export of a subtree without navigating to it, problems could
arise if more than one were tagged. If multiple same-level headlines
were tagged with the select_tag, which one should Org use as the
"master" for the document title/level structure?

It sounds like the C-u option did work for you, correct? If so, glad
you found a solution!


John



Re: [O] Intermixed date in koma-letter export

2015-12-10 Thread York Zhao
No, this still doesn't work. I just tested with my .emacs having only two
lines:

#+BEGIN_SRC emacs-lisp
  (require 'org "/usr/local/share/emacs/site-lisp/org/org")
  (require 'ox-koma-letter
   (locate-user-emacs-file
"path/to/org-mode/contrib/lisp/ox-koma-letter"))
#+END_SRC
the org-mode version is from git commit "a198d81". M-x org-version gives:

Org-mode version 8.3.2 (release_8.3.2-378-ga198d8 @
/usr/local/share/emacs/site-lisp/org/)

I then copied the text from your email exactly as:

#+BEGIN_EXAMPLE
* letter 1
:PROPERTIES:
:EXPORT_DATE: 2015-10-26 Monday
:END:
** to
:to:
The Org list
** To whom it may concern,
txt
* letter 2
:PROPERTIES:
:EXPORT_DATE: 2015-12-03 Thursday
:END:
** to
:to:
list
** To whom it may concern,
txt
#+END_EXAMPLE

I selected the "letter 1" subtree, pressed C-cekp, opened the pdf file. But
the
date is still "Dec 12, 2015".

Hope this helps,\\
York

On Thu, Dec 10, 2015 at 10:45 AM, Rasmus  wrote:

> Hi,
>
> York Zhao  writes:
>
> > Thanks for your help. However, adding the :EXPORT_DATE: property doesn't
> > work. Firstly, there's an error: "PDF file produced with errors.".
>
> You have to add an address, e.g.
>
> * letter 1
> :PROPERTIES:
> :EXPORT_DATE: 2015-10-26 Monday
> :END:
> ** to
> :to:
> The Org list
> ** To whom it may concern,
> txt
> * letter 2
> :PROPERTIES:
> :EXPORT_DATE: 2015-12-03 Thursday
> :END:
> ** to
> :to:
> list
> ** To whom it may concern,
> txt
>
> > Secondly, even though it still produced a PDF output, the date is always
> > today's date which is wrong.
>
> I cannot reproduce.  I get this as part of exporting the first subtree
> (I click: C-c C-e C-s k L)
>
>  \date{2015-10-26 Monday}
>
> Hope it helps,
> Rasmus
>
> --
> Enough with the bla bla!
>
>
>


Re: [O] export subtree

2015-12-10 Thread Skip Collins
Herbert Sitz  wrote:
> * Main tree :myexporttree:
> fkjaldfk
> ** subhead
> ** subhead
> * anoher heading 1
> * another heading level 1
> ** subhead
> ** subhead

I did try using the default SELECT_TAG :export: on my main document
subtree. The problem is that the subtree is not "promoted" to the main
level. In your example, the title would not become "Main tree" as it
would if I selected subtree export in the dispatcher.



[O] orgtbl in latex files, problem

2015-12-10 Thread Uwe Brauer
Hello

I swear that usually worked in my latex files.
Situation:

In my latex file I have orgtbl-mode enabled, I insert 

A radio table and I obtain
,
| 
| \documentclass[12pt]{article}
| \begin{document}
| % BEGIN RECEIVE ORGTBL test
| % END RECEIVE ORGTBL test
| \begin{comment}
| #+ORGTBL: SEND test orgtbl-to-latex  :lend " \\hline"
| | 3 | 4 |
| |   |   |
| \end{comment}
`

\end{document}
Now when the cursor is on the table, decribe key C-c C-c returns
,
| 
| C-c C-c runs the command orgtbl-hijacker-command-1002 (found in
| orgtbl-mode-map), which is an interactive Lisp function.
| 
| It is bound to C-c C-c.
| 
| (orgtbl-hijacker-command-1002 ARG)
| 
| In tables, run ‘org-ctrl-c-ctrl-c’.
| Outside of tables, run the binding of ‘C-c C-c’.
`

Since I have the setting

(add-hook
 'orgtbl-mode-hook
 (lambda ()
   (org-defkey orgtbl-mode-map "\C-c\C-c"
   (orgtbl-make-binding 'org-ctrl-c-ctrl-c 1002 "\C-c\C-c"


However when I put the cursor on the table and run C-c C-c it returns

user-error: C-c C-c can do nothing useful at this location


What is wrong? I am sure that worked before.

Uwe Brauer 




[O] [solved] (was: orgtbl in latex files, problem)

2015-12-10 Thread Uwe Brauer
>>> "Uwe" == Uwe Brauer  writes:

> Hello
> I swear that usually worked in my latex files.
> Situation:


Sorry the problem was caused by these lines in my init file:

 (add-hook
  'orgtbl-mode-hook
  (lambda ()
(org-defkey orgtbl-mode-map "\C-c\C-c"
(orgtbl-make-binding 'org-ctrl-c-ctrl-c 1002 "\C-c\C-c"

After I removed them, everyting was normal again.




[O] Reference cannot be resolved without publishing

2015-12-10 Thread Alan Schmitt
Hello,

I have the following files I want to export to html:

common.org:
--8<---cut here---start->8---
#+TITLE: Unison Binaries
#+OPTIONS: toc:nil num:nil
#+HTML_HEAD: 

* sidebar
  :PROPERTIES:
  :CUSTOM_ID: sidebar
  :HTML_CONTAINER_CLASS: container-sidebar
  :END:

- [[file:index.org::#OSX][Mac OS X]]
--8<---cut here---end--->8---

index.org (extract)
--8<---cut here---start->8---
#+INCLUDE: "common.org"

* body
  :PROPERTIES:
  :CUSTOM_ID: mainbody
  :HTML_CONTAINER_CLASS: container-mainbody
  :END:

** Unison Binaries

*** Mac OS X
:PROPERTIES:
:CUSTOM_ID: OSX
:END:
--8<---cut here---end--->8---

When I try to export index.org to index.html, I get:

Reference "#OSX" in file "index.org" cannot be resolved without
publishing

What does it mean? And why can't the reference be resolved? Should I not
use CUSTOM_ID for relative links?

Thanks,

Alan


-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Athmospheric CO₂ (Updated December 6, 2015, Mauna Loa Obs.): 400.80 ppm


signature.asc
Description: PGP signature


Re: [O] org-mode fontification error

2015-12-10 Thread Zack Piper
> You haven't modified your load-path in this minimal config, so you're
> using the built-in Org version, as indicated in your Org version output
> above.

That was it! Thanks! Sorry for the noise.

-- 
Zack Piper  http://apertron.net



Re: [O] org-element-at-point and special blocks

2015-12-10 Thread Rasmus
Hi Nicolas,

Thanks for the helpful reply.

Nicolas Goaziou  writes:

>> Is there a reason why org-element-at-point reports the type to be a
>> paragraph for special blocks?  E.g. in the examples at the bottom of this
>> mail, where | is the cursor, the types are: export-block, src-block and
>> paragraph with a nested special block.
>
> This is a corner-case. `org-element-at-point' returns the closest
> element at point, but prefers to see an empty paragraph than a special
> block, for consistency. I.e., when point is within block boundaries, you
> never return `special-block'.

Out of curiosity, why is it "more" consistent to return paragraph here?

>> Is there a neat way to detect if point is inside a block?  I’m trying to
>> write a function for structures (e.g. #+begin_latex) that works like
>> org-babel-demarcate-block.
>
> (org-element-lineage (org-element-at-point) '(special-block) t)

That's very cool.  Thanks.

Rasmus

-- 
Even a three-legged dog has three good legs to lose




Re: [O] Intermixed date in koma-letter export

2015-12-10 Thread Rasmus
Hi,

York Zhao  writes:

> Thanks for your help. However, adding the :EXPORT_DATE: property doesn't
> work. Firstly, there's an error: "PDF file produced with errors.".

You have to add an address, e.g.

* letter 1
:PROPERTIES:
:EXPORT_DATE: 2015-10-26 Monday
:END:
** to:to:
The Org list
** To whom it may concern,
txt
* letter 2
:PROPERTIES:
:EXPORT_DATE: 2015-12-03 Thursday
:END:
** to:to:
list
** To whom it may concern,
txt

> Secondly, even though it still produced a PDF output, the date is always
> today's date which is wrong.

I cannot reproduce.  I get this as part of exporting the first subtree
(I click: C-c C-e C-s k L)

 \date{2015-10-26 Monday}

Hope it helps,
Rasmus

-- 
Enough with the bla bla!




Re: [O] org-element-at-point and special blocks

2015-12-10 Thread Nicolas Goaziou
Rasmus  writes:

> Out of curiosity, why is it "more" consistent to return paragraph
> here?

Notwithstanding this case, if `org-element-at-point' returns
`special-block', you /know/ that you are either on block boundaries
(#+begin_special or #+end_special) or on any affiliated keyword above,
but /never/ within the block.

If `org-element-at-point' returns `special-block' here, you create an
exception, which you have to handle later on.

Besides, the truly empty contents are

  #+begin_special
  #+end_special

therefore, I'm not shocked if

  #+begin_special
  
  #+end_special

is a special block with an empty paragraph instead.

Regards,



[O] org-mode fontification error

2015-12-10 Thread Zack Piper
(Apologies for the second email, didn’t see it go through...)

When attempting to open an Org file (such as my own `config.org'), I
get "org-mode fontification error" appear in the mini-buffer.

I can reproduce it using the following:

Org-mode version 8.2.10 (release_8.2.10 @
/home/zack/ins/share/emacs/25.0.50/lisp/org/) (latest Git master)

GNU Emacs 25.0.50.7 (x86_64-suse-linux-gnu, GTK+ Version 3.16.7) of 2015-12-10
Git: d75849e937af0ecbcdc7bf621aa9bcd43aa75df4

╭[ r.el ]
│ (require 'org)
│ (setq org-src-fontify-natively t)
│ 
│ (find-file "r.org")
╰

╭[ $ ]
│ emacs -Q -l r.el
╰

╭[ r.org ]
│ #+BEGIN_SRC emacs-lisp
│ (message "test")
│ #+END_SRC
╰

All the above produce "org-mode fontification error", and results in
no code blocks being fontified.

Thanks!


Re: [O] "org-mode fontification error" on master

2015-12-10 Thread Zack Piper
Please refer to the second email I sent (14:35) as I feel this is
better.

Due to technical problems with my email system I sent two different
ones and didn’t think to look in the logs, my apologies.



[O] "org-mode fontification error" on master

2015-12-10 Thread Zack Piper
Hi,

I'm using Org mode from master, when I attempt to open an Org file
with code blocks while `org-src-fontify-natively' as `t' I get
"org-mode fontification error", I appear to be able to reproduce this
using a minimal config.


╭
│ (require 'org)
│ (require 'ob-tangle)
│ (setq org-src-fontify-natively t)
│ 
│ (find-file "~/.emacs.d/config.org")
╰

Which is loaded via:

‘emacs -Q -l r.el’

Emacs is also latest from the ‘emacs-25’ branch.

Thanks!

-- 
Zack Piper  https://apertron.net



Re: [O] org-mode fontification error

2015-12-10 Thread Kyle Meyer
Zack Piper  writes:

> When attempting to open an Org file (such as my own `config.org'), I
> get "org-mode fontification error" appear in the mini-buffer.
>
> I can reproduce it using the following:
>
> Org-mode version 8.2.10 (release_8.2.10 @
> /home/zack/ins/share/emacs/25.0.50/lisp/org/) (latest Git master)
>
> GNU Emacs 25.0.50.7 (x86_64-suse-linux-gnu, GTK+ Version 3.16.7) of 2015-12-10
> Git: d75849e937af0ecbcdc7bf621aa9bcd43aa75df4
>
> ╭[ r.el ]
> │ (require 'org)
> │ (setq org-src-fontify-natively t)
> │ 
> │ (find-file "r.org")
> ╰

You haven't modified your load-path in this minimal config, so you're
using the built-in Org version, as indicated in your Org version output
above.

>
> ╭[ $ ]
> │ emacs -Q -l r.el
> ╰
>
> ╭[ r.org ]
> │ #+BEGIN_SRC emacs-lisp
> │ (message "test")
> │ #+END_SRC
> ╰
>
> All the above produce "org-mode fontification error", and results in
> no code blocks being fontified.

I'm not able to reproduce this on master (64aee4692) with (a somewhat
old) build of Emacs 25.

-- 
Kyle