Re: [O] Babel: reusing language-specific functions

2014-10-08 Thread Jarmo Hurri
t...@tsdye.com (Thomas S. Dye) writes:

>> Jarmo Hurri  writes:
>>> I have a language-specific function - in this case Asymptote, but it
>>> could be e.g. C as well - that I want to use in a number of different
>>> source blocks of the same language in an Org file. How do I accomplish
>>> this?
> Or, perhaps use the noweb syntax.
>
>
> #+NAME: foo
> #+BEGIN_SRC emacs-lisp
>   (defun foo (x) (+ x 2))
> #+END_SRC
>
> #+results: foo
> : foo
> #+begin_src emacs-lisp :noweb yes
> <>
> (foo 3)
> #+end_src
>
> #+results:
> : 5

Yes, this is a perfect solution. You can use noweb to include any code
block, not only function definitions. Thanks!

Jarmo




Re: [O] auto hiding src blocks upon toggling headers

2014-10-08 Thread John Kitchin
Sorry for the weird from email below. This was from me. I have a
separate email setup in Emacs for a class I am teaching.

Instructor account  writes:

> Adriaan Sticker  writes:
>
> This is not perfect but it seems close:
>
> #+BEGIN_SRC emacs-lisp
> (defun my-hide (state)
>   (message "%s" state)
>   (if (or (eq state 'children)
> (eq state 'subtree))
>   (save-restriction
>   (org-narrow-to-subtree)
>   (org-hide-block-all
>
> (add-hook 'org-cycle-hook 'my-hide)
> #+END_SRC
>
>
>
>
>> Hi all
>>
>> Is there a way to automatically hide a source block when toggling the
>> fold status of the parent header.
>>
>> Currently the hide status is remembered when folding its parent
>> headers but this turned out not to be to practical in my current
>> workflow.
>>
>> Greetings
>>

-- 
---
John Kitchin
Professor
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
http://kitchingroup.cheme.cmu.edu



Re: [O] auto hiding src blocks upon toggling headers

2014-10-08 Thread Instructor account
Adriaan Sticker  writes:

This is not perfect but it seems close:

#+BEGIN_SRC emacs-lisp
(defun my-hide (state)
  (message "%s" state)
  (if (or (eq state 'children)
  (eq state 'subtree))
  (save-restriction
(org-narrow-to-subtree)
(org-hide-block-all

(add-hook 'org-cycle-hook 'my-hide)
#+END_SRC




> Hi all
>
> Is there a way to automatically hide a source block when toggling the
> fold status of the parent header.
>
> Currently the hide status is remembered when folding its parent
> headers but this turned out not to be to practical in my current
> workflow.
>
> Greetings
>

-- 
---
John Kitchin
Professor
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
http://kitchingroup.cheme.cmu.edu



Re: [O] select-tags in derived backend without effect?

2014-10-08 Thread Per Unneberg
Following up on my own message as I found the error (my bad!); the
export functions I use in the derived backend, e.g.
org-latex-export-to-pdf, still use the original backend:

(defun org-latex-export-to-pdf
  (&optional async subtreep visible-only body-only ext-plist)
  ...
  (interactive)
  (let ((outfile (org-export-output-file-name ".tex" subtreep)))
(org-export-to-file 'latex outfile
^^
  async subtreep visible-only body-only ext-plist
  (lambda (file) (org-latex-compile file)

I have obviously missed this point as it is also pointed out at the end
of section 12.15, as I see now on closer inspection.

/P

Per Unneberg  writes:

> Hi,
>
> I'm currently experimenting exporting notes from my beamer
> presentations as articles via use of the beamerarticle package. In
> some cases, I only want to export the *notes* to the article. This can
> be achieved easily enough by setting #+SELECT_TAGS: B_noteNH B_note,
> but it would be a hassle to remove/insert this statement everytime I
> need/don't need non-note material. Therefore, I tried defining a
> derived backend with the following settings:
>
>  (org-export-define-derived-backend 'beamerarticlenotes 'latex
> :export-block '("LATEX" "TEX") :menu-entry '(?n "Notes export" ( (?M
> "As LaTeX buffer (LaTeX notes)" org-latex-export-as-latex) (?m "As
> LaTeX file (LaTeX notes)" org-latex-export-to-latex) (?N "As PDF file
> and open (LaTeX notes)" (lambda (a s v b) (if a
> (org-latex-export-to-pdf t s v b) (org-open-file
> (org-latex-export-to-pdf nil s v b)))
> 
> :options-alist '( (:author "AUTHOR" nil "John Doe" t)
> (:select-tags "SELECT_TAGS" nil "B_noteNH" split) ) )
>
> However, I must be doing something wrong as adding this backend and
> running C-c C-e n N on the MWE below does not work. Moreover, the
> author name does not change to John Doe, which I included just for
> testing. I'm running without startup file (emacs -Q), pointing to
> release tag release_8.2.8. Adding #+SELECT_TAGS: B_noteNH and running
> C-c C-e l o does give the desired result.
>
> Any help would be appreciated.
>
> Thanks,
>
> Per
>
>
> MWE:
>
> #+STARTUP: indent beamer
> #+OPTIONS: H:1 tags:nil
> #+LATEX_HEADER: \usepackage{beamerarticle} * Frame ** Block Block 1
>
> * Notes :B_noteNH: :PROPERTIES: :BEAMER_env: noteNH :END: Some notes



Re: [O] Bug: customizing HTML export postamble [8.2.7c (8.2.7c-61-g4b9146-elpa @ /home/christos/.emacs.d/elpa/org-20140908/)]

2014-10-08 Thread Nick Dokos
Gitsis Christos  writes:

> I was trying to translate the postamble in HTML export in order to
> translate it in greek and I faced an issue.
>
> 1) Setting org-html-postamble to auto generates a postamble different
> than setting it to t and leaving org-html-postamble-format to
> default. The differences are a) the date string is "Created:" in the
> first case and "Date:" in the second, and b) most importantly, in the
> second case the Date does not show up at all.
>

Adding

#+DATE: 

to your file would fill it in, but it probably should have a default.

> 2) I would also like to ask about the author field in the postamble of
> my index page.
> It was different (strangely, it was my linux username@my hostname, but
> ok, I guess, since my index.org is
> automatically generated and I have no author set for it) How can I set
> it by the way?
>

#+AUTHOR: A.U. Thor

--
Nick




Re: [O] [PATCH] read.table in variable transfer caused sometimes "function not found" error - small change

2014-10-08 Thread Charles C. Berry

On Wed, 8 Oct 2014, Rainer M Krug wrote:


"Charles C. Berry"  writes:


On Wed, 8 Oct 2014, Rainer M Krug wrote:


"Charles C. Berry"  writes:


On Mon, 6 Oct 2014, Rainer M Krug wrote:


Hi

The variable transfer of tables from org to R caused sometimes 'could
not find function "read.table"' errors (e.g. when the file was tangled
into a ./data directory which was loaded by the function
devtools::load_all("./")). This can easily be fixed by adding the package
name to the call in R, i.e. replacing =read.table()= with
=utils::read.table()= which is done in this patch.


It does fix that one case.

But I wonder if that is the best way.

The heart of the matter is that load_all eventually calls sys.source,
which can be persnickety about finding objects on the search path. See
?sys.source.

If the src block you tangle to ./data/ has any code that uses any
other objects from utils, stats, datasets or whatever, you will be in
the same pickle.


Exactly - that is true. But it is the same when putting this in a
package (as far as I am aware).



Do you mean that putting `x <- rnorm(10)' into a data/*.R file will
fail when you try to build and check?

In fact, `R CMD build' will execute it and save the result as a
data/*.rda file. And check will go through.

devtools::load_all (calling load_data) fails to do that. Which is why
I think this is a devtools issue.


OK - point taken. But I still think that the =utils::read.table()= would
not hurt, rather make the variable transfer safer.



What you want to change is in a defconst. So, the user can override with a 
file-local version.


So, making the change really is harmless.

Maybe add a note to the docstring to say that using `utils::read.table' 
assures that `read.table' always can be found just in case anyone ever 
asks.


Chuck



Re: [O] Other editors supporting Org-Mode

2014-10-08 Thread Thorsten Jolitz
gregory mitchell  writes:

>> My intended use-case is editing Org syntax in HTML text-areas, and it
>> would be a marvellous solution to give the users a pre-configured
>> specialized Emacs(server) and help them to configure their web-brower(s)
>> to call emacs(client) as an external editor when editing text-areas in
>> web formulas.
>
>
> I've been wanting to use ace.js for this purpose, but I haven't gotten
> around to it yet.
>
> https://github.com/ajaxorg/ace/wiki/Creating-or-Extending-an-Edit-Mode

This looks pretty interesting too, no idea about the pros&cons in
comparison with TinyMCE. 

With all this online editors, it seems to be mostly about highlighting
and indentation (and maybe folding):

,
| Defining a Mode
| 
| Every language needs a mode. A mode contains the paths to a
| language's syntax highlighting rules, indentation rules, and code
| folding rules. Without defining a mode, Ace won't know anything
| about the finer aspects of your language.
`

but with Org-mode one would need commands like C-c C-t, C-c C-x p, C-c ,
etc etc too, i.e. smart/fast tag, property, priority, timestamp,
planning, table, list ... handling (only syntax level editing of
course). 

I don't know if this could at all be implemented with these extendable
web-editors. 

-- 
cheers,
Thorsten




Re: [O] Other editors supporting Org-Mode

2014-10-08 Thread gregory mitchell
> My intended use-case is editing Org syntax in HTML text-areas, and it
> would be a marvellous solution to give the users a pre-configured
> specialized Emacs(server) and help them to configure their web-brower(s)
> to call emacs(client) as an external editor when editing text-areas in
> web formulas.


I've been wanting to use ace.js for this purpose, but I haven't gotten
around to it yet.

https://github.com/ajaxorg/ace/wiki/Creating-or-Extending-an-Edit-Mode



Re: [O] Other editors supporting Org-Mode

2014-10-08 Thread Paul Rudin
Manuel Schneckenreither 
writes:

> I couldn't find anything on the web about it. Therefore, I like to ask
> you if anyone knows a program (another editor) which supports Org mode.

Depends what you mean by "supports". I sometimes have to use windows
computers on which I can't install emacs (long story). I edit some of my
.org files with notepad!

The advantage of plain text is that pretty much every text editor can be
used to read/modify the files, even if you can't do all the stuff that
you're used to with emacs.




Re: [O] Other editors supporting Org-Mode

2014-10-08 Thread Thorsten Jolitz
jorge.alfaro-muri...@yale.edu (Jorge A. Alfaro-Murillo) writes:

> hymie! writes: 
>
>> I would suggest, rather than adapting more editors to support 
>> Org, creating a stand-alone program that "compiles" and manages 
>> Org functions separate from the act of editing them.
>
> Perhaps the easiest thing would be an emacs configuration that 
> makes emacs just an org editor for Word users:

My intended use-case is editing Org syntax in HTML text-areas, and it
would be a marvellous solution to give the users a pre-configured
specialized Emacs(server) and help them to configure their web-brower(s)
to call emacs(client) as an external editor when editing text-areas in
web formulas.

Marvellous, but unfortunately a bit optimistic IMO and too
dangerous. When going this route, it should rather be Zile or Nano or
another preinstalled minimal editor (what would it be on Windows? what
on Apple) without Emac's (destructive) power.

Did anybody on the list tried to extend Zile/Nano/? or their MS Windows
or Apple equivalent, and can share experiences?

Or what about extending TinyMCE (http://www.tinymce.com/) for some Org
syntax support? I don't know how hard this would be, if at all possible,
but from the user-perspective this might be the easiest solution.

-- 
cheers,
Thorsten




[O] (void-variable ignore) in

2014-10-08 Thread Julien Cubizolles

I get this error when exporting an org file in async mode. The export
itself goes fine (the correct file is created) but something seems to go
wrong at the end. Sorry for the long lines...

Julien.

--8<---cut here---start->8---
Debugger entered--Lisp error: (void-variable ignore)
  (funcall ignore results)
  (let ((results (with-current-buffer proc-buffer (goto-char (point-max)) 
(backward-sexp) (read (current-buffer) (funcall ignore results))
  (unwind-protect (let ((results (with-current-buffer proc-buffer (goto-char 
(point-max)) (backward-sexp) (read (current-buffer) (funcall ignore 
results)) (unless org-export-async-debug (and (get-buffer proc-buffer) 
(kill-buffer proc-buffer
  (if (zerop (process-exit-status p)) (unwind-protect (let ((results 
(with-current-buffer proc-buffer (goto-char (point-max)) (backward-sexp) (read 
(current-buffer) (funcall ignore results)) (unless org-export-async-debug 
(and (get-buffer proc-buffer) (kill-buffer proc-buffer 
(org-export-add-to-stack proc-buffer nil p) (ding) (message "Process '%s' 
exited abnormally" p))
  (unwind-protect (if (zerop (process-exit-status p)) (unwind-protect (let 
((results (with-current-buffer proc-buffer (goto-char ...) (backward-sexp) 
(read ... (funcall ignore results)) (unless org-export-async-debug (and 
(get-buffer proc-buffer) (kill-buffer proc-buffer (org-export-add-to-stack 
proc-buffer nil p) (ding) (message "Process '%s' exited abnormally" p)) (unless 
org-export-async-debug (delete-file "/tmp/org-export-process198726Ro")))
  (progn (unwind-protect (if (zerop (process-exit-status p)) (unwind-protect 
(let ((results (with-current-buffer proc-buffer ... ... ...))) (funcall ignore 
results)) (unless org-export-async-debug (and (get-buffer proc-buffer) 
(kill-buffer proc-buffer (org-export-add-to-stack proc-buffer nil p) (ding) 
(message "Process '%s' exited abnormally" p)) (unless org-export-async-debug 
(delete-file "/tmp/org-export-process198726Ro"
  (if (eq (process-status p) (quote exit)) (progn (unwind-protect (if (zerop 
(process-exit-status p)) (unwind-protect (let ((results ...)) (funcall ignore 
results)) (unless org-export-async-debug (and (get-buffer proc-buffer) 
(kill-buffer proc-buffer (org-export-add-to-stack proc-buffer nil p) (ding) 
(message "Process '%s' exited abnormally" p)) (unless org-export-async-debug 
(delete-file "/tmp/org-export-process198726Ro")
  (when (eq (process-status p) (quote exit)) (unwind-protect (if (zerop 
(process-exit-status p)) (unwind-protect (let ((results (with-current-buffer 
proc-buffer ... ... ...))) (funcall ignore results)) (unless 
org-export-async-debug (and (get-buffer proc-buffer) (kill-buffer 
proc-buffer (org-export-add-to-stack proc-buffer nil p) (ding) (message 
"Process '%s' exited abnormally" p)) (unless org-export-async-debug 
(delete-file "/tmp/org-export-process198726Ro"
  (let ((proc-buffer (process-buffer p))) (when (eq (process-status p) (quote 
exit)) (unwind-protect (if (zerop (process-exit-status p)) (unwind-protect (let 
((results ...)) (funcall ignore results)) (unless org-export-async-debug (and 
(get-buffer proc-buffer) (kill-buffer proc-buffer (org-export-add-to-stack 
proc-buffer nil p) (ding) (message "Process '%s' exited abnormally" p)) (unless 
org-export-async-debug (delete-file "/tmp/org-export-process198726Ro")
  (lambda (p status) (let ((proc-buffer (process-buffer p))) (when (eq 
(process-status p) (quote exit)) (unwind-protect (if (zerop 
(process-exit-status p)) (unwind-protect (let (...) (funcall ignore results)) 
(unless org-export-async-debug (and ... ...))) (org-export-add-to-stack 
proc-buffer nil p) (ding) (message "Process '%s' exited abnormally" p)) (unless 
org-export-async-debug (delete-file 
"/tmp/org-export-process198726Ro"))(# 
"finished\n")
--8<---cut here---end--->8---




Re: [O] select-tags in derived backend without effect?

2014-10-08 Thread Nicolas Goaziou
Hello,

Per Unneberg  writes:

> I'm currently experimenting exporting notes from my beamer presentations
> as articles via use of the beamerarticle package. In some cases, I only
> want to export the *notes* to the article. This can be achieved easily
> enough by setting #+SELECT_TAGS: B_noteNH B_note, but it would be a
> hassle to remove/insert this statement everytime I need/don't need
> non-note material. Therefore, I tried defining a derived backend with
> the following settings:
>
>  (org-export-define-derived-backend 'beamerarticlenotes 'latex
> :export-block '("LATEX" "TEX")
> :menu-entry
> '(?n "Notes export"
>  (
>   (?M "As LaTeX buffer (LaTeX notes)" org-latex-export-as-latex)
>   (?m "As LaTeX file (LaTeX notes)" org-latex-export-to-latex)
>   (?N "As PDF file and open (LaTeX notes)" 
>   (lambda (a s v b)
> (if a (org-latex-export-to-pdf t s v b)
>   (org-open-file (org-latex-export-to-pdf nil s v b)))
> 
> :options-alist
> '(
>   (:author "AUTHOR" nil "John Doe" t)
>   (:select-tags "SELECT_TAGS" nil "B_noteNH" split)
>   )
>)
>
> However, I must be doing something wrong as adding this backend and
> running C-c C-e n N on the MWE below does not work. Moreover, the author
> name does not change to John Doe, which I included just for testing. I'm
> running without startup file (emacs -Q), pointing to release tag
> release_8.2.8. Adding #+SELECT_TAGS: B_noteNH and running C-c C-e l o
> does give the desired result.
>
> Any help would be appreciated.

Your derived back-end calls `org-latex-export-as-latex', which in turn,
calls `latex' back-end. IOW, you are using functions that ignore your
back-end.

You need to write an export function that will use your back-end.
Another option is to use EXT-PLIST argument from existing functions.

BTW, `split' behaviour implies that value is a list. So select-tags
should be ("B_noteNH").


Regards,

-- 
Nicolas Goaziou



Re: [O] debugging export error

2014-10-08 Thread Nicolas Goaziou
Hello,

Charles Berry  writes:

> I am trying to debug a subtree export. 
>
> I get 
>
> member-ignore-case: Wrong type argument: stringp, nil
>
> and it seems to come from `org-export-get-environment' but if I instrument
> that function, the error goes away whether I step thru it or `c' on entry.
>
> Likewise, if I M-x debug-on-entry and just `c' on entry, I get no error.
>
> Bisecting the file with the subtree I am trying to export, I can find things
> - like removing an unused src block - that when changed get rid of the 
> error.
>
> But I'd really like to know what is going on here and not being able to
> see the problem thru a debugger is a frustration.
>
> Advice appreciated.

M-x toggle-debug-on-error and running an uncompiled Org should give you
a better starting point.


Regards,

-- 
Nicolas Goaziou



[O] debugging export error

2014-10-08 Thread Charles Berry

I am trying to debug a subtree export. 

I get 

member-ignore-case: Wrong type argument: stringp, nil

and it seems to come from `org-export-get-environment' but if I instrument
that function, the error goes away whether I step thru it or `c' on entry.

Likewise, if I M-x debug-on-entry and just `c' on entry, I get no error.

Bisecting the file with the subtree I am trying to export, I can find things
- like removing an unused src block - that when changed get rid of the 
error.

But I'd really like to know what is going on here and not being able to
see the problem thru a debugger is a frustration.

Advice appreciated.

Chuck





[O] Bug: customizing HTML export postamble [8.2.7c (8.2.7c-61-g4b9146-elpa @ /home/christos/.emacs.d/elpa/org-20140908/)]

2014-10-08 Thread Gitsis Christos
Hello,

I was trying to translate the postamble in HTML export in order to
translate it in greek and I faced multiple issues.

1) Setting org-html-postamble to auto generates a postamble different
than setting it to t and leaving org-html-postamble-format to
default. The differences are a) the date string is "Created:" in the
first case and "Date:" in the second, and b) most importantly, in the
second case the Date does not show up at all

2) I added a new language to org-html-postamble-format so that in the
end it looked like

(("el" "Συγγραφέας: %a (%e)
Ημερομηνία: %d
%c") ("en" "Author: %a (%e)
Date: %d
%c
%v"))

I set org-export-default-language to "el" and I got unexpected results.
Strangely, I observed that the postamble of my index.html page was
translated in greek, but
a) the Date was missing (naturally)
b) the author field was different (strangely, it was my linux
username@my hostname, but ok, I guess, since my index.org is
automatically generated and I have no author set for it -- how do I
set it by the way?)
and c) the rest of the pages were in english, and with
org-html-postamble = t ("Date:" + empty date)



Emacs  : GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.12.2)
 of 2014-09-12 on gandalf
Package: Org-mode version 8.2.7c (8.2.7c-61-g4b9146-elpa @
/home/christos/.emacs.d/elpa/org-20140908/)

current state:
==
(setq
 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-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-date-timestamp-format "%Y-%m-%d"
 org-latex-format-headline-function 'org-latex-format-headline-default-function
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-latex-format-drawer-function '(lambda (name contents) contents)
 org-from-is-user-regexp nil
 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-export-copy-to-kill-ring t
 org-mode-hook '(#[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)
 org-export-with-tags 'not-in-toc
 org-ascii-format-drawer-function '(lambda (name contents width) contents)
 org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point
org-babel-execute-safely-maybe)
 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-export-with-drawers nil
 org-confirm-elisp-link-function 'yes-or-no-p
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-html-format-headline-function 'ignore
 org-babel-load-languages '((ditaa . t))
 org-html-format-inlinetask-function 'ignore
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 org-publish-project-alist '(("website" :components ("website-content"))
 ("website-content" :language "el" :base-directory
"~/org/chessblog/" :base-extension "org" :publishing-directory
  "~/public_html/chessblog/" :recursive t
:publishing-function org-html-publish-to-html :export-with-tags nil
  :headline-levels 3 :with-toc t :section-numbers nil
:auto-sitemap t :sitemap-filename "index.org" :sitemap-title
  "Σκακιστική Προπόνηση" :timestamp t :exclude-tags
("noexport" "todo") :exclude "data.org"
  :html-head-include-default-style nil
:html-html5-fancy t :html-link-use-abs-url t :html-link-home "."
:html-head
  "
  ")
 )
 )



Re: [O] Bug: customizing HTML export postamble [8.2.7c (8.2.7c-61-g4b9146-elpa @ /home/christos/.emacs.d/elpa/org-20140908/)]

2014-10-08 Thread Gitsis Christos
Hello,

I want to correct a mistake I had made before, actually a blunder from my part.

I was trying to translate the postamble in HTML export in order to
translate it in greek and I faced an issue.

1) Setting org-html-postamble to auto generates a postamble different
than setting it to t and leaving org-html-postamble-format to
default. The differences are a) the date string is "Created:" in the
first case and "Date:" in the second, and b) most importantly, in the
second case the Date does not show up at all.

2) I would also like to ask about the author field in the postamble of
my index page.
It was different (strangely, it was my linux username@my hostname, but
ok, I guess, since my index.org is
automatically generated and I have no author set for it) How can I set
it by the way?



Emacs  : GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.12.2)
 of 2014-09-12 on gandalf
Package: Org-mode version 8.2.7c (8.2.7c-61-g4b9146-elpa @
/home/christos/.emacs.d/elpa/org-20140908/)

current state:
==
(setq
 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-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-date-timestamp-format "%Y-%m-%d"
 org-latex-format-headline-function 'org-latex-format-headline-default-function
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-latex-format-drawer-function '(lambda (name contents) contents)
 org-from-is-user-regexp nil
 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-export-copy-to-kill-ring t
 org-mode-hook '(#[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)
 org-export-with-tags 'not-in-toc
 org-ascii-format-drawer-function '(lambda (name contents width) contents)
 org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point
org-babel-execute-safely-maybe)
 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-export-with-drawers nil
 org-confirm-elisp-link-function 'yes-or-no-p
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-html-format-headline-function 'ignore
 org-babel-load-languages '((ditaa . t))
 org-html-format-inlinetask-function 'ignore
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 org-publish-project-alist '(("website" :components ("website-content"))
 ("website-content" :language "el" :base-directory
"~/org/chessblog/" :base-extension "org" :publishing-directory
  "~/public_html/chessblog/" :recursive t
:publishing-function org-html-publish-to-html :export-with-tags nil
  :headline-levels 3 :with-toc t :section-numbers nil
:auto-sitemap t :sitemap-filename "index.org" :sitemap-title
  "Σκακιστική Προπόνηση" :timestamp t :exclude-tags
("noexport" "todo") :exclude "data.org"
  :html-head-include-default-style nil
:html-html5-fancy t :html-link-use-abs-url t :html-link-home "."
:html-head
  "
  ")
 )
 )



Re: [O] Other editors supporting Org-Mode

2014-10-08 Thread Jorge A. Alfaro-Murillo
hymie! writes: 

I would suggest, rather than adapting more editors to support 
Org, creating a stand-alone program that "compiles" and manages 
Org functions separate from the act of editing them.


Perhaps the easiest thing would be an emacs configuration that 
makes emacs just an org editor for Word users:


#+BEGIN_SRC emacs-lisp
 (setq-default major-mode 'org-mode)
 (setq initial-major-mode 'org-mode)
 (setq initial-buffer-choice "~/Untitled.org")
 (setq inhibit-startup-message t)
 (setq initial-scratch-message nil)
 (cua-mode)
 (require 'printing)
 (pr-update-menus)

#+END_SRC

And many many (define-key org-mode-map ...) to change default 
keybindings and make, e.g., C-a mark-whole-buffer, C-s 
save-buffer, C-p pr-txt-buffer, etc. It doesn't matter if the 
bindings lose their default binding as long as there is a way to 
activate the action in the menus.


The menus should be rewritten, and "Tools" and anything that can 
make you lose focus on the current buffer should be removed, 
"Buffers" should be renamed "Files opened", etc. There should be 
one whole menu for Org-export to avoid the *Org Export Dispatch* 
buffer and in general, any "special-mode derived" buffer should be 
avoided.


The toolbar should have many more org-only buttons that emacs-org 
users generally activate with keybindings: DEMOTE/PROMOTE, INSERT 
TIME, INSERT SOURCE BLOCK, etc.


This would be an emacs just to edit org-files (and perhaps also 
running code with babel). There wouldn't be access to the agenda, 
without the user freaking out and not knowing how to exit (unless 
it is always opened on a separate frame I guess). But I think 
achieving agenda capabilities in another editor would also be very 
difficult.


Best,
--
Jorge.




Re: [O] [PATCH] read.table in variable transfer caused sometimes "function not found" error - small change

2014-10-08 Thread Rainer M Krug
"Charles C. Berry"  writes:

> On Wed, 8 Oct 2014, Rainer M Krug wrote:
>
>> "Charles C. Berry"  writes:
>>
>>> On Mon, 6 Oct 2014, Rainer M Krug wrote:
>>>
 Hi

 The variable transfer of tables from org to R caused sometimes 'could
 not find function "read.table"' errors (e.g. when the file was tangled
 into a ./data directory which was loaded by the function
 devtools::load_all("./")). This can easily be fixed by adding the package
 name to the call in R, i.e. replacing =read.table()= with
 =utils::read.table()= which is done in this patch.
>>>
>>> It does fix that one case.
>>>
>>> But I wonder if that is the best way.
>>>
>>> The heart of the matter is that load_all eventually calls sys.source,
>>> which can be persnickety about finding objects on the search path. See
>>> ?sys.source.
>>>
>>> If the src block you tangle to ./data/ has any code that uses any
>>> other objects from utils, stats, datasets or whatever, you will be in
>>> the same pickle.
>>
>> Exactly - that is true. But it is the same when putting this in a
>> package (as far as I am aware).
>>
>
> Do you mean that putting `x <- rnorm(10)' into a data/*.R file will
> fail when you try to build and check?
>
> In fact, `R CMD build' will execute it and save the result as a
> data/*.rda file. And check will go through.
>
> devtools::load_all (calling load_data) fails to do that. Which is why
> I think this is a devtools issue.

OK - point taken. But I still think that the =utils::read.table()= would
not hurt, rather make the variable transfer safer.

Rainer

>
> Chuck
>
>

-- 
Rainer M. Krug
email: Rainerkrugsde
PGP: 0x0F52F982


pgpcHdQDfGFOb.pgp
Description: PGP signature


Re: [O] Other editors supporting Org-Mode

2014-10-08 Thread Thorsten Jolitz
hy...@lactose.homelinux.net (hymie!) writes:

> In our last episode, the evil Dr. Lacto had captured our hero,
>   Manuel Schneckenreither
> , who said:
>>Hi fellows,
>>
>>I couldn't find anything on the web about it. Therefore, I like to ask
>>you if anyone knows a program (another editor) which supports Org mode.
>
> I would suggest, rather than adapting more editors to support Org,
> creating a stand-alone program that "compiles" and manages Org functions
> separate from the act of editing them.

but that program does exist already and is called Emacs, right?

I'm writing this email in Emacs instance

#+BEGIN_SRC emacs-lisp
 (emacs-pid)
#+END_SRC

#+results:
: 275

but external program PicoLisp can use another Emacs instance as
standalone program to execute Emacs Lisp (and thus all of Org-mode's
functionality):

#+BEGIN_SRC picolisp :results pp
 (de emx (Exe . @)
   (in
  (list 'emacs "--no-site-file" "--batch"
 (extract
'((X)
  (cond
 ((num? (car (info X)))
 (pack "--load=" X) )
 ((= `(char "(") (char X))
 (pack "--eval=" X) ) ) )
(rest) ) )
  (eval Exe) ) )

(emx '(read) "(princ (emacs-pid))")
#+END_SRC

#+results:
: 1388

Instead of (princ (emacs-pid)) you could just as well load org-mode and
then call (org-element-parse-buffer ...) or whatever.

PicoLisp is no editor, and there is no editor written in this
language, but assume Java or JS programs can do the same - how would
that help editing Org-mode syntax in editors that are written in that
languages?

Just curious, I would like to find a way to make editing Org syntax
easier for the masses (of non Emacs users).

-- 
cheers,
Thorsten




Re: [O] Other editors supporting Org-Mode

2014-10-08 Thread Stefan Blaschke
Manuel Schneckenreither  student.uibk.ac.at> 
writes:

> 
> Hi fellows,
> 
> I couldn't find anything on the web about it. Therefore, I like to ask
> you if anyone knows a program (another editor) which supports Org mode.
> 

Hi,

there's a package for Sublime Text:
https://github.com/danielmagnussons/orgmode

cheers Stefan





Re: [O] Other editors supporting Org-Mode

2014-10-08 Thread hymie!
In our last episode, the evil Dr. Lacto had captured our hero,
  Manuel Schneckenreither , who 
said:
>Hi fellows,
>
>I couldn't find anything on the web about it. Therefore, I like to ask
>you if anyone knows a program (another editor) which supports Org mode.

I would suggest, rather than adapting more editors to support Org,
creating a stand-alone program that "compiles" and manages Org functions
separate from the act of editing them.

The same way that I edit a TeX file, and then run "tex" to process
it into a DVI file that I can view; or the same way that I edit an
HTML file, and then pull it up in Firefox to view it.  I can edit
my Org file, then I can run my Org processor and view the file,
view my agenda...

I realize that there is a lot of functionality that gets lost, but I
think that much of what is lost is "shortcuts".  I can easily, for example,
change the word TODO to DONE in my editor, or add a SCHEDULED line...
On the other hand, you already have emacs as the "supported" Org editor,
while adding do-it-yourself support for other editors as well.

It just seems to me that writing Org For Emacs, Org For Vim, Org For
Notepad, Org For Whatever Mac Uses, Org for Vile ... is duplicating
too much effort that a single Org For Java might simplify.

Anyway, just thinking out loud.

--hymie!http://lactose.homelinux.net/~hymiehy...@lactose.homelinux.net
---




Re: [O] Other editors supporting Org-Mode

2014-10-08 Thread Thorsten Jolitz
Manuel Schneckenreither 
writes:

Hi,

> I couldn't find anything on the web about it. Therefore, I like to ask
> you if anyone knows a program (another editor) which supports Org mode.

I recently asked about browser editors that give some support for Org
syntax, but with no results. I think it would be really useful to have
some basic insertion/editing support for Org syntax in the Word
Prozessors used by the masses like MS Word and Clones and popular rich
text browser editiors, nothing fancy, just enough to make writing basic
Org docs comfortable.

Insertion snippets/skeletons would be a start, then maybe some 'quick
navigation' commands. To bad that we can't have this by writing a few
quick Emacs Lisp functions, somebody would need to know enough about
Java, JS, HTML5 etc. and have some insight into the popular editors to
make this happen. 

-- 
cheers,
Thorsten




[O] What is the deal with `org-agenda-skip-deadline-prewarning-if-scheduled', 'pre-scheduled, and specific deadline lead times?

2014-10-08 Thread Trevor Murphy
Hi, list!  tl;dr given the setting alluded to in the subject line, 
I'm
dissatisfied with the behavior of the following example 
(scheduling and

deadline timestrings use "today" as pseudocode):

* TODO check deadline skipping with specific lead time and 
 'pre-scheduled

DEADLINE:  SCHEDULED: 

I would like to hack the code to change the behavior, but I'm 
concerned about
breaking a zillion other things at the same time.  Comments and 
suggestions

welcome.

Still with me?  Longer description below:

The documentation says
(http://orgmode.org/manual/Deadlines-and-scheduling.html):

You can specify a different lead time for warnings for specific 
deadlines
using the following syntax.  Here is an example with a warning 
period of 5
days =DEADLINE: <2004-02-29 Sun -5d>=.  This warning is 
deactivated if the

task gets scheduled and you set
=org-agenda-skip-deadline-prewarning-if-scheduled= to =t=.

I have o-a-s-d-p-i-s set to 'pre-scheduled.  Suppose today is 
Wednesday,
2014-10-08, and I create an agenda file "example.org" with the 
following

contents:

* TODO check deadline skipping with specific lead time
DEADLINE: <2014-10-10 Fri> SCHEDULED: <2014-10-09 Thu>

Then the deadline warning does not appear in today's agenda.  This 
is what I
want, and I think this is what I should expect with the 
'pre-scheduled

setting.

However, if I use the following contents instead (note the 
specified warning

period):

* TODO check deadline skipping with specific lead time
DEADLINE: <2014-10-10 Fri -3d> SCHEDULED: <2014-10-09 Thu>

The deadline warning *reappears* in today's agenda.  I think this 
is a bug.  I
think I've ruled out the personal-configuration sources of the 
behavior, and
instead traced it to the following code in 
`org-agenda-get-deadlines':


 (setq wdays (if suppress-prewarning
 (let ((org-deadline-warning-days 
 suppress-prewarning))

   (org-get-wdays s))
   (org-get-wdays s))
   ...)

In `org-agenda-get-deadlines', with o-a-s-d-p-i-s set to 
'pre-scheduled, the
code stores the gap between scheduling and deadline information in 
the local
variable `suppress-prewarning'.  As you can see in the citation 
above, o-a-g-d
then let-binds the user option `org-deadline-warning-days' to 
match and calls
`org-get-wdays' to figure out the appropriate amount of 
warning-day lead time.


But!  Check out what `org-get-wdays' does with specific warning 
periods in the deadline timestring:


 (cond
   ...
  ((string-match "-\\([0-9]+\\)\\([hdwmy]\\)\\(\\'\\|>\\| \\)" 
  ts)

   ;; lead time is specified.
   (floor (* (string-to-number (match-string 1 ts))
 (cdr (assoc (match-string 2 ts)
 '(("d" . 1)("w" . 7)
   ("m" . 30.4) ("y" . 365.25)
   ("h" . 0.041667)))

`org-get-wdays' never checks `org-deadline-warning-days' in this 
branch, and
so never gets a chance to see the `suppress-prewarning' 
information passed in

from `org-agenda-get-deadlines'.

At this point I'm stuck.  I'd like to hack into `org-get-wdays' 
some code that
says "Yes, there's a specific warning period.  However, there's 
also some
prewarning suppression going on, so we should take that into 
consideration."
But I'd like to avoid changing the existing behavior for when 
there is no
prewarning suppression and the specific warning period just 
happens to be

longer than the user option `org-deadline-warning-days'.

If you're still reading, thanks.  Please let me know if you have 
any

suggestions, questions, or comments about what I'm trying to do.

--
Trevor Murphy
GnuPG Key: 0x83881C0A




Re: [O] [PATCH] read.table in variable transfer caused sometimes "function not found" error - small change

2014-10-08 Thread Charles C. Berry

On Wed, 8 Oct 2014, Rainer M Krug wrote:


"Charles C. Berry"  writes:


On Mon, 6 Oct 2014, Rainer M Krug wrote:


Hi

The variable transfer of tables from org to R caused sometimes 'could
not find function "read.table"' errors (e.g. when the file was tangled
into a ./data directory which was loaded by the function
devtools::load_all("./")). This can easily be fixed by adding the package
name to the call in R, i.e. replacing =read.table()= with
=utils::read.table()= which is done in this patch.


It does fix that one case.

But I wonder if that is the best way.

The heart of the matter is that load_all eventually calls sys.source,
which can be persnickety about finding objects on the search path. See
?sys.source.

If the src block you tangle to ./data/ has any code that uses any
other objects from utils, stats, datasets or whatever, you will be in
the same pickle.


Exactly - that is true. But it is the same when putting this in a
package (as far as I am aware).



Do you mean that putting `x <- rnorm(10)' into a data/*.R file will fail 
when you try to build and check?


In fact, `R CMD build' will execute it and save the result as a data/*.rda 
file. And check will go through.


devtools::load_all (calling load_data) fails to do that. Which is why I 
think this is a devtools issue.


Chuck



Re: [O] Other editors supporting Org-Mode

2014-10-08 Thread Albert Krewinkel
Hi,

Manuel Schneckenreither 
writes:

> I couldn't find anything on the web about it. Therefore, I like to ask
> you if anyone knows a program (another editor) which supports Org mode.
>
> The idea behind this is, that I like to do collaboration with several
> other persons, which don't use emacs nor vim (they are "normal" Windows
> users). As org mode uses raw text git could be used as control version
> system, which handles merging, etc. So it would be perfect for
> collaborating on a document.
>
> This means, I am looking for an editor which works like a normal editor
> (Word, gedit, etc) and supports Org mode.

I always thought vim and emacs where normal and everything else is the
exception ;)

> Does anyone know such an editor?

I'm not aware of any editor capabale of that.  The best I can come up
with is to use markdown (or docx) as an exchange format and to convert
it back to org locally using pandoc.  That way you can at least continue
to use emacs and org, while your collaborators could use Writemonkey,
Word or something similar.

It's not a great solution, but since doing the right things
(i.e. teaching them emacs) seems out of the question, it's qutie likely
as good as it gets.

Cheers,
Albert

-- 
Albert Krewinkel
GPG: 8eed e3e2 e8c5 6f18 81fe  e836 388d c0b2 1f63 1124

-- 
Albert Krewinkel
GPG: 8eed e3e2 e8c5 6f18 81fe  e836 388d c0b2 1f63 1124



[O] Other editors supporting Org-Mode

2014-10-08 Thread Manuel Schneckenreither
Hi fellows,

I couldn't find anything on the web about it. Therefore, I like to ask
you if anyone knows a program (another editor) which supports Org mode.

The idea behind this is, that I like to do collaboration with several
other persons, which don't use emacs nor vim (they are "normal" Windows
users). As org mode uses raw text git could be used as control version
system, which handles merging, etc. So it would be perfect for
collaborating on a document.

This means, I am looking for an editor which works like a normal editor
(Word, gedit, etc) and supports Org mode.

Does anyone know such an editor?


Best regards

Manuel



[O] auto hiding src blocks upon toggling headers

2014-10-08 Thread Adriaan Sticker
Hi all

Is there a way to automatically hide a source block when toggling the fold
status of the parent  header.

Currently the hide status is remembered when folding its parent headers but
this turned out not to be to practical in my current workflow.

Greetings


[O] [BUG][babel] Tangling into directories does not add directories to org file

2014-10-08 Thread Rainer M Krug
When in the tangling taerget a directory is specified, this is not
reflected in the comments in the tangled file when comments are set to
include links:

,
|* `link' The code block is wrapped in comments which contain
|  pointers back to the original Org file from which the code was
|  tangled.
`

In the org file =prodMixStands.org=:

,
| :PROPERTIES:
| :header-args+: :tangle ./R/update.cache.R
| :END:
| #+begin_src R 
| test
| #+end_src
`

results in the file =update.cache.R= in a link to the file
=prodMixStands.org= and not =./../prodMixstands.org=:

,
|  ## [[file:prodMixStands.org::*Begin][Begin:1]]
`

This is particularly bad when using ess and developer mode to develop a
package.

Cheers,

Rainer

-- 
Rainer M. Krug
email: Rainerkrugsde
PGP: 0x0F52F982


pgpRXgbpkJmeP.pgp
Description: PGP signature


[O] orgguide.texi and @noindent

2014-10-08 Thread David Arroyo Menendez

 Hello,

 I'm the maintainer of orgguide.texi in spanish, I've added a break line
 after the @noindent. It gives me troubles with po4a.

 Thanks.



[O] select-tags in derived backend without effect?

2014-10-08 Thread Per Unneberg
Hi,

I'm currently experimenting exporting notes from my beamer presentations
as articles via use of the beamerarticle package. In some cases, I only
want to export the *notes* to the article. This can be achieved easily
enough by setting #+SELECT_TAGS: B_noteNH B_note, but it would be a
hassle to remove/insert this statement everytime I need/don't need
non-note material. Therefore, I tried defining a derived backend with
the following settings:

 (org-export-define-derived-backend 'beamerarticlenotes 'latex
:export-block '("LATEX" "TEX")
:menu-entry
'(?n "Notes export"
 (
  (?M "As LaTeX buffer (LaTeX notes)" org-latex-export-as-latex)
  (?m "As LaTeX file (LaTeX notes)" org-latex-export-to-latex)
  (?N "As PDF file and open (LaTeX notes)" 
  (lambda (a s v b)
(if a (org-latex-export-to-pdf t s v b)
  (org-open-file (org-latex-export-to-pdf nil s v b)))

:options-alist
'(
  (:author "AUTHOR" nil "John Doe" t)
  (:select-tags "SELECT_TAGS" nil "B_noteNH" split)
  )
   )

However, I must be doing something wrong as adding this backend and
running C-c C-e n N on the MWE below does not work. Moreover, the author
name does not change to John Doe, which I included just for testing. I'm
running without startup file (emacs -Q), pointing to release tag
release_8.2.8. Adding #+SELECT_TAGS: B_noteNH and running C-c C-e l o
does give the desired result.

Any help would be appreciated.

Thanks,

Per


MWE:

#+STARTUP: indent beamer
#+OPTIONS: H:1 tags:nil
#+LATEX_HEADER: \usepackage{beamerarticle}
* Frame
** Block
Block 1

* Notes:B_noteNH:
:PROPERTIES:
:BEAMER_env: noteNH
:END:
Some notes







Re: [O] Help exporting to-do list as LaTeX/PDF

2014-10-08 Thread Andreas Yankopolus
>> ...
>> kpathsea: Running mktexpk --mfmode / --bdpi 600 --mag 1+0/600 --dpi 600 
>> ecbx1200
>> 
>> kpathsea: Running mktexfmt mf.base
>> mktexpk: Mismatched mode ljfour and resolution 600; ignoring mode.
>> mktexpk: Running mf-nowin -progname=mf \mode:=ljfour; mag:=1+0/600; 
>> nonstopmode; input ecbx1200
>> This is METAFONT, Version 2.718281 (Web2C 2013)
>> 
>> kpathsea: Running mktexfmt mf.base
>> I can't find the base file `mf.base'!
> 
>> It took a while to get to this point, and I had to install a number of
>> font packages from the pkgsrc tex-* collection. I do have tex-ec-1.0
>> and tex-eco-1.3 installed. But it seems like the problem is more with
>> metafont, which is completely beyond me.
> 
> Yeah, this looks to me like your setup is attempting to load (or build??) a
> font as part of the compilation process.  As far as I know, that is not
> something that should be required when compiling an Org document
> exported to LaTeX with the default options.
> 
> What are the values of your
> 
> org-latex-default-packages-alist
> org-latex-packages-alist
> org-latex-pdf-process
> 
> variables?  And what does the header of the exported .tex file look
> like?
> 
> I guess the way to debug this is to remove the packages that are loaded
> in the exported .tex file, one at a time, until you discover the one
> that is at fault here.  (If it's not some particular package, but
> rather TeX/LaTeX itself that's trying to use METAFONT, I think you're in
> deeper waters..

Thanks for the troubleshooting ideas. I'm getting XeTeX set up on my system an 
will verify that it works with TeXShop. Then I'll try getting Org Mode 
configured to use it as the LaTeX process.


Re: [O] [PATCH] WAS Re: Bug: problem w/ R code blocks [8.3beta (release_8.3beta-362-ga92789 /usr/local/share/emacs/site-lisp/org/)]

2014-10-08 Thread Henrik Singmann


I unfortunately can confirm that org-babel-R-initiate-session contains the 
lines you mentioned at exactly 15 lines down. Deleting ob-R.elc (which was of 
the same date as ob-R.el) didn't affect anything as did reloading org 
uncompiled (C-u C-c C-x !).

Henrik

Am 08.10.2014 um 03:21 schrieb Charles Berry:

Henrik Singmann  psychologie.uni-freiburg.de> writes:



Dear all,

Sorry to resurrect this thread but I still have the issue discussed here.

I get "Error: could not find

function ".ess.eval"" when inside an R code block with :session *R* but
not without :session *R*.



Please confirm that when you do

  M-x find-function RET org-babel-R-initiate-session RET

and scroll down 15 lines:

  M-1 M-5 

you see something like this:

   (ess-wait-for-process
(get-process (or ess-local-process-name
 ess-current-process-name)))


If not, there is something broken in your setup.

If you do see that code, please do

  C-x d 


and verify that ob-R.el is older than ob-R.elc. If it is not older delete
ob-R.elc and restart.

Let us know how it goes either way.

Chuck






--
Dr. Henrik Singmann
Albert-Ludwigs-Universität Freiburg, Germany
http://www.psychologie.uni-freiburg.de/Members/singmann




Re: [O] [PATCH] read.table in variable transfer caused sometimes "function not found" error - small change

2014-10-08 Thread Rainer M Krug
"Charles C. Berry"  writes:

> On Mon, 6 Oct 2014, Rainer M Krug wrote:
>
>> Hi
>>
>> The variable transfer of tables from org to R caused sometimes 'could
>> not find function "read.table"' errors (e.g. when the file was tangled
>> into a ./data directory which was loaded by the function
>> devtools::load_all("./")). This can easily be fixed by adding the package
>> name to the call in R, i.e. replacing =read.table()= with
>> =utils::read.table()= which is done in this patch.
>
> It does fix that one case.
>
> But I wonder if that is the best way.
>
> The heart of the matter is that load_all eventually calls sys.source,
> which can be persnickety about finding objects on the search path. See
> ?sys.source.
>
> If the src block you tangle to ./data/ has any code that uses any
> other objects from utils, stats, datasets or whatever, you will be in
> the same pickle.

Exactly - that is true. But it is the same when putting this in a
package (as far as I am aware).

>
> Arguably, this is a bug in devtools::load_data. And maybe it would be
> better to beg the maintainer for a fix or an extension that
> accomodates your case.

I don't know - As far as I understand, it is the same behaviour as if it
would be loaded from a package - i.e. =library()= so it would not be a
bug but it emulates the behaviour of library(), which it should.

>
>>
>> In R the calls read.table and utils::read.table are interchangeable (the
>> second one is actually preferred) so no negative effects can be
>> expected.
>
> What if the user has intentionally masked read.table or the eventual
> package provides its own read.table?

I would not go there - I see the variable as a mechanism similar to the
call to library() in R, which should behave absolutely equal everywhere,
even if functions are re-defined. If one wants to have a non standard
behaviour in this step, one could always re-define the way variables are
transferred, or, the better approach, do it afterwards.

So I think the use of =utils::read.table()= is preferable to the risky
use of only =read.table=, exactly because of the re-definition issue you
raise.

So I would opt to apply this patch as it makes the variable transfer
more stable.

Cheers,

Rainer 

>
> HTH,
>
> Chuck
>
>

-- 
Rainer M. Krug
email: Rainerkrugsde
PGP: 0x0F52F982


pgpFvwcDz40GY.pgp
Description: PGP signature


Re: [O] Org-element once again

2014-10-08 Thread Eric Abrahamsen
Thorsten Jolitz  writes:

> Eric Abrahamsen  writes:
>
>> Marcin Borkowski  writes:
>>
>>> Hi list,
>>>
>>> does there exist any place I could find the specs of the org-element
>>> data structure?  From what I can see, it is a list whose car is the type
>>> of the element, then a (somewhat mysterious or me) plist follows, and
>>> then the children.  Where could I find more info?  If the answer is
>>> "read the source, Luke" ;-) , which functions should I start with?
>>>
>>> Best,
>>
>> Have you looked at this page?
>>
>> http://orgmode.org/worg/dev/org-element-api.html
>>
>> That and the pages linked from it seem to cover most of what's going on.
>>
>> The mysterious plist holds all the properties for a given element. Most
>> are generated by the parsing process (eg :contents-begin and
>> :contents-end, see the link above for all the different properties the
>> various elements/objects might get), while headlines will also have
>> their actual property-drawer properties put into the list.
>>
>> The only thing that remains a little opaque to me is the "section"
>> element, which apparently gets wrapped around a heading's subtree. I
>> don't know what it does, but it's never gotten in my way so I haven't
>> worried about it.
>
> in simple terms, the data structure is just:
>
> ,
> | (element-typ (plist) (section))
> `
>
> i.e. the plist describes the element itself, the section is its
> content. 
>
>
> * TODO Test :@home:
>   DEADLINE: <2014-10-09 Do>
>   :PROPERTIES:
>   :ARCHIVE:  foo
>   :END:
>
>
> org-element-at-point does not parse the contents of an element, it
> thus simply returns
>
> ,
> | (element-typ (plist))
> `
>
> #+NAME: foo
> #+BEGIN_SRC emacs-lisp
>
>  (save-excursion
>  (outline-previous-heading)
>  (org-element-at-point))
> #+END_SRC
>
> # [:results pp]
> #+results:
> : (headline
> :  (:raw-value "Test" :begin 1432 :end 2214 :pre-blank 0 :contents-begin 1452 
> :contents-end 2214 :level 1 :priority nil :tags
> :  ("@home")
> :  :todo-keyword "TODO" :todo-type todo :post-blank 0 
> :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 1432 
> :deadline
> :  (timestamp
> : (:type active :raw-value "<2014-10-09 Do>" :year-start 2014
> :month-start 10 :day-start 9 :hour-start nil :minute-start nil
> :year-end 2014 :month-end 10 :day-end 9 :hour-end nil :minute-end nil
> :begin 1464 :end 1479 :post-blank 0))
> :  :ARCHIVE "foo" :title "Test"))
>
> #+NAME: bar
> #+BEGIN_SRC emacs-lisp :var x=foo 
>
>  (org-element-interpret-data x) 
> #+END_SRC
>
> #+results: bar
> : * TODO Test :@home:
>
>
> so this is (just) the element (headline) as specified by its plist.
>
> You can get the contents e.g. with 
>
> #+BEGIN_SRC emacs-lisp :results wrap
> (require 'org-dp-lib)
>  (save-excursion
>  (outline-previous-heading)
>  (org-dp-contents nil t)))
> #+END_SRC
>
> #+results:
> :RESULTS:
> DEADLINE: <2014-10-09 Do>
> :PROPERTIES:
> :ARCHIVE:  foo
> :END:
>
> [...]
> :END:
>
> but the default org-element-parse-buffer parses everything (when specified), 
> the
> contents too, so it would give you 
>
> ,
> | (element-typ (plist) (section))
> `
>
> with section recursively containing other elements with the same
> structure -> a nested list.

Interesting! I didn't realize that all elements came with a section when
you parsed the buffer, thanks for pointing that out.

E




Re: [O] Org-element once again

2014-10-08 Thread Thorsten Jolitz
Eric Abrahamsen  writes:

> Marcin Borkowski  writes:
>
>> Hi list,
>>
>> does there exist any place I could find the specs of the org-element
>> data structure?  From what I can see, it is a list whose car is the type
>> of the element, then a (somewhat mysterious or me) plist follows, and
>> then the children.  Where could I find more info?  If the answer is
>> "read the source, Luke" ;-) , which functions should I start with?
>>
>> Best,
>
> Have you looked at this page?
>
> http://orgmode.org/worg/dev/org-element-api.html
>
> That and the pages linked from it seem to cover most of what's going on.
>
> The mysterious plist holds all the properties for a given element. Most
> are generated by the parsing process (eg :contents-begin and
> :contents-end, see the link above for all the different properties the
> various elements/objects might get), while headlines will also have
> their actual property-drawer properties put into the list.
>
> The only thing that remains a little opaque to me is the "section"
> element, which apparently gets wrapped around a heading's subtree. I
> don't know what it does, but it's never gotten in my way so I haven't
> worried about it.

in simple terms, the data structure is just:

,
| (element-typ (plist) (section))
`

i.e. the plist describes the element itself, the section is its
content. 


* TODO Test :@home:
  DEADLINE: <2014-10-09 Do>
  :PROPERTIES:
  :ARCHIVE:  foo
  :END:


org-element-at-point does not parse the contents of an element, it
thus simply returns

,
| (element-typ (plist))
`


#+NAME: foo
#+BEGIN_SRC emacs-lisp
 (save-excursion
 (outline-previous-heading)
 (org-element-at-point))
#+END_SRC

# [:results pp]
#+results:
: (headline
:  (:raw-value "Test" :begin 1432 :end 2214 :pre-blank 0 :contents-begin 1452 
:contents-end 2214 :level 1 :priority nil :tags
:("@home")
::todo-keyword "TODO" :todo-type todo :post-blank 0 
:footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 1432 
:deadline
:(timestamp
: (:type active :raw-value "<2014-10-09 Do>" :year-start 2014 
:month-start 10 :day-start 9 :hour-start nil :minute-start nil :year-end 2014 
:month-end 10 :day-end 9 :hour-end nil :minute-end nil :begin 1464 :end 1479 
:post-blank 0))
::ARCHIVE "foo" :title "Test"))

#+NAME: bar
#+BEGIN_SRC emacs-lisp :var x=foo 
 (org-element-interpret-data x) 
#+END_SRC

#+results: bar
: * TODO Test :@home:

so this is (just) the element (headline) as specified by its plist.

You can get the contents e.g. with 

#+BEGIN_SRC emacs-lisp :results wrap
(require 'org-dp-lib)
 (save-excursion
 (outline-previous-heading)
 (org-dp-contents nil t)))
#+END_SRC

#+results:
:RESULTS:
DEADLINE: <2014-10-09 Do>
:PROPERTIES:
:ARCHIVE:  foo
:END:

[...]
:END:

but the default org-element-parse-buffer parses everything (when specified), the
contents too, so it would give you 

,
| (element-typ (plist) (section))
`

with section recursively containing other elements with the same
structure -> a nested list.

-- 
cheers,
Thorsten