[O] Cannot export Latex to PDF when "Body Only" is "on"

2017-01-02 Thread Young-whan
There is no issue to export org to latex pdf when "Body Only" is "off"

But, when "Body Only" is "on", the export is failed always.

Comparing "Body Only" on and off case, the on-case doesn't have
\documentclass or \usepackage headers. It looks it has only body and that's
why converting pdf fails always.

I can generate the "Body Only" "off" and modify the tex manually and
convert it pdf by manually via pdflatex, but it is tedious work.

Is there any way to fix this issue?


Re: [O] "cannot Revert nonexistent file" on odt export

2017-01-02 Thread Matt Price
Please ignore the noise. I had added the odt template to the file to be
exported; it included the following line:

#+ODT_STYLES_FILE:

Which I guess overrode my setting for odt_styles_dir.

solved.


On Mon, Jan 2, 2017 at 8:59 PM, Matt Price  wrote:

> I tried and then reverted a very simple change ot ox-odt.el -- I wanted to
> export a unicode symbol instead of [ ] for an empty checkbox.
>
> After this, odt export fails mysteriously with the following:
>
> 
> Wrote /tmp/odt-3348W1J/meta.xml
> Using vacuous schema
> OpenDocument export failed: Cannot revert nonexistent file
> /tmp/odt-3348W1J/styles.xml
> Result: "OpenDocument export failed: Cannot revert nonexistent file
> /tmp/odt-3348W1J/styles.xml"
> 
>
> I tried instrumenting org-odt-export-to-odt but was not able to narrow the
> error down further than:
>
> (org-odt--export-wrap
>outfile
>(let* ((org-odt-embedded-images-count 0)
>   (org-odt-embedded-formulas-count 0)
>   (org-odt-automatic-styles nil)
>   (org-odt-object-counters nil)
>   ;; Let `htmlfontify' know that we are interested in collecting
>   ;; styles.
>   (hfy-user-sheet-assoc nil))
>  ;; Initialize content.xml and kick-off the export process.
>  (let ((output (org-export-as 'odt subtreep visible-only nil
> ext-plist))
>(out-buf (progn
>   (require 'nxml-mode)
>   (let ((nxml-auto-insert-xml-declaration-flag nil))
> (find-file-noselect
>  (concat org-odt-zip-dir "content.xml") t)
>(with-current-buffer out-buf (erase-buffer) (insert output)
>
>
> i don't seem to be able to instrument the org-odt--export-wrap macro, but
> maybe the error report comes from this section around line 4067:
>
> (error
> ;; Cleanup work directory and work files.
> (funcall --cleanup-xml-buffers)
> (message "OpenDocument export failed: %s"
>  (error-message-string err)
>
> This is with a pretty recent git master w/ a few changes applied only to
> ox-html.el.
>
> ~git diff master~
>
> shows no changes to ox-odt.el, but I restarted emacs and restarted my
> laptop just in case -- the problem still persists.
>
> Thanks!
>
> Matt
>
>
>


[O] "cannot Revert nonexistent file" on odt export

2017-01-02 Thread Matt Price
I tried and then reverted a very simple change ot ox-odt.el -- I wanted to
export a unicode symbol instead of [ ] for an empty checkbox.

After this, odt export fails mysteriously with the following:


Wrote /tmp/odt-3348W1J/meta.xml
Using vacuous schema
OpenDocument export failed: Cannot revert nonexistent file
/tmp/odt-3348W1J/styles.xml
Result: "OpenDocument export failed: Cannot revert nonexistent file
/tmp/odt-3348W1J/styles.xml"


I tried instrumenting org-odt-export-to-odt but was not able to narrow the
error down further than:

(org-odt--export-wrap
   outfile
   (let* ((org-odt-embedded-images-count 0)
  (org-odt-embedded-formulas-count 0)
  (org-odt-automatic-styles nil)
  (org-odt-object-counters nil)
  ;; Let `htmlfontify' know that we are interested in collecting
  ;; styles.
  (hfy-user-sheet-assoc nil))
 ;; Initialize content.xml and kick-off the export process.
 (let ((output (org-export-as 'odt subtreep visible-only nil ext-plist))
   (out-buf (progn
  (require 'nxml-mode)
  (let ((nxml-auto-insert-xml-declaration-flag nil))
(find-file-noselect
 (concat org-odt-zip-dir "content.xml") t)
   (with-current-buffer out-buf (erase-buffer) (insert output)


i don't seem to be able to instrument the org-odt--export-wrap macro, but
maybe the error report comes from this section around line 4067:

(error
;; Cleanup work directory and work files.
(funcall --cleanup-xml-buffers)
(message "OpenDocument export failed: %s"
 (error-message-string err)

This is with a pretty recent git master w/ a few changes applied only to
ox-html.el.

~git diff master~

shows no changes to ox-odt.el, but I restarted emacs and restarted my
laptop just in case -- the problem still persists.

Thanks!

Matt


Re: [O] Bug: Cannot tangle bash source blocks [9.0 (release_9.0-237-gccf2b9 @ /usr/local/share/emacs/site-lisp/org/)]

2017-01-02 Thread Thomas S. Dye
Aloha David,

David Dynerman writes:

> I cannot tangle a bash source block (via ob-shell) that contains
> variables. To reproduce, enter this into an org file:
>
> #+BEGIN_SRC bash :var HELLO="world" :tangle
> echo $HELLO
> #+END_SRC
>
> Then C-c C-v t RET
>
> This error is reported:
>
> org-babel-tangle-single-block: Wrong number of arguments: (2 . 4)

The :tangle keyword requires an argument, one of 'yes', 'no', or a path.

But I think your error message (which I can reproduce) is due to using
'bash' instead of 'shell' for the language of the source code block.

This works for me:

#+BEGIN_SRC shell :var HELLO="world" :tangle bash.sh
echo $HELLO
#+END_SRC

hth,
Tom
-- 
Thomas S. Dye
http://www.tsdye.com



[O] Bug: Cannot tangle bash source blocks [9.0 (release_9.0-237-gccf2b9 @ /usr/local/share/emacs/site-lisp/org/)]

2017-01-02 Thread David Dynerman
I cannot tangle a bash source block (via ob-shell) that contains
variables. To reproduce, enter this into an org file:

#+BEGIN_SRC bash :var HELLO="world" :tangle
echo $HELLO
#+END_SRC

Then C-c C-v t RET

This error is reported:

org-babel-tangle-single-block: Wrong number of arguments: (2 . 4)

No tangled output is produced. I can reproduce this in emacs -Q loading
a current version of org (237-gccf2b9) by executing the following first:

(add-to-list 'load-path "/usr/local/share/emacs/site-lisp/org")
(require 'org)
(require 'ob-shell)

This bug doesn't seem to apply to 8.2.10, since that version used ob-sh.

Emacs  : GNU Emacs 25.1.1 (x86_64-apple-darwin15.6.0, Carbon Version 157 AppKit 
1404.47)
 of 2016-11-24
Package: Org mode version 9.0 (release_9.0-237-gccf2b9 @ 
/usr/local/share/emacs/site-lisp/org/)

current state:
==
(setq
 org-tab-first-hook '(org-babel-hide-result-toggle-maybe
  org-babel-header-arg-expand)
 org-speed-command-hook '(org-speed-command-activate
  org-babel-speed-command-activate)
 org-occur-hook '(org-first-headline-recenter)
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-confirm-shell-link-function 'yes-or-no-p
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-src-mode-hook '(org-src-babel-configure-edit-buffer
 org-src-mode-configure-edit-buffer)
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-babel-pre-tangle-hook '(save-buffer)
 org-mode-hook '(#[0 "\300\301\302\303\304$\207"
   [add-hook change-major-mode-hook org-show-block-all append
local]
   5]
 #[0 "\300\301\302\303\304$\207"
   [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-bibtex-headline-format-function #[257 "\300\236A\207" [:title] 3 "\n\n(fn 
ENTRY)"]
 org-archive-hook '(org-attach-archive-delete-maybe)
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers
  org-cycle-show-empty-lines
  org-optimize-window-after-visibility-change)
 org-confirm-elisp-link-function 'yes-or-no-p
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-link-parameters '(("id" :follow org-id-open)
   ("rmail" :follow org-rmail-open :store
org-rmail-store-link)
   ("mhe" :follow org-mhe-open :store org-mhe-store-link)
   ("irc" :follow org-irc-visit :store org-irc-store-link)
   ("info" :follow org-info-open :export org-info-export
:store org-info-store-link)
   ("gnus" :follow org-gnus-open :store
org-gnus-store-link)
   ("docview" :follow org-docview-open :export
org-docview-export :store org-docview-store-link)
   ("bibtex" :follow org-bibtex-open :store
org-bibtex-store-link)
   ("bbdb" :follow org-bbdb-open :export org-bbdb-export
:complete org-bbdb-complete-link :store
org-bbdb-store-link)
   ("w3m" :store org-w3m-store-link) ("file+sys")
   ("file+emacs") ("doi" :follow org--open-doi-link)
   ("elisp" :follow org--open-elisp-link)
   ("file" :complete org-file-complete-link)
   ("ftp" :follow
(lambda (path) (browse-url (concat "ftp:" path
   ("help" :follow org--open-help-link)
   ("http" :follow
(lambda (path) (browse-url (concat "http:" path
   ("https" :follow
(lambda (path) (browse-url (concat "https:" path
   ("mailto" :follow
(lambda (path) (browse-url (concat "mailto:; path
   ("message" :follow
(lambda (path) (browse-url (concat "message:" path
   ("news" :follow
(lambda (path) (browse-url (concat "news:; path
   ("shell" :follow org--open-shell-link))
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 )




[O] Opening a LibreOffice file

2017-01-02 Thread Karl Voit
Hi!

I am unsure why but with my configuration, I can't open a
LibreOffice odp file.

By default, Emacs was showing me the content of the odp file as a
ZIP file, which is technically true but not helpful.

John Kitchin suggested setting org-file-apps manually. Here are the
results:

(setq org-file-apps '(
 ("\\.odp" . "/usr/bin/xdg-open %s")
;; Running xdg-open /home/user/path/2008-06-17_Bachelor_II.odp...done -> 
nothing opens
 ;;("\\.odp" . "/usr/lib/libreoffice/program/soffice %s") ;; opens LibreOffice 
with General I/O Error
 ;;("\\.odp\\'" . default) ;; runs odp2txt without any resulting file
 ;;("\\.odp" . "/home/vk/myodp.sh %s") ;; see below
 ("\\.png\\'" . default) ;; works: geeqie
 ("\\.jpg\\'" . default) ;; works: geeqie
 ("\\.jpeg\\'" . default) ;; works: geeqie
 (auto-mode . emacs) ;; whatever ;-)
 ("\\.pdf\\'" . default) ;; works: okular
))

As you can see, graphic files and PDF files works as expected.

The file "/home/user/path/2008-06-17_Bachelor_II.odp" exists and works with
manually invoking "xdg-open" or "libreoffice".

The configuration with "default", "open", or "xdg-open" writes a success
message but nothing happens: no app opens.

As you can see, I also tried a self-written wrapper script to debug the
situation:

,[ myodp.sh ]
| #!/bin/sh
|
| echo "===" >> ~/myodp.log
| echo "${1}" >> ~/myodp.log
| echo "DISPLAY: $DISPLAY" >> ~/myodp.log
| date >> ~/myodp.log
| /usr/bin/xdg-open "${1}" 2>&1 >>~/myodp.log
| date >> ~/myodp.log
| echo "end" >> ~/myodp.log
`

Its log output does not look suspicious nor is an error logged. The two date
outputs are always to the same second. No time-out or similar in between.

,[ content of myodp.log ]
| ===
| /home/user/path/2008-06-17_Bachelor_II.odp
| DISPLAY: :0.0
| Mon Jan  2 20:55:05 CET 2017
| Mon Jan  2 20:55:05 CET 2017
| end
`

Do you have an idea what I can do to kick-start LibreOffice?

-- 
get mail|git|SVN|photos|postings|SMS|phonecalls|RSS|CSV|XML into Org-mode:
   > get Memacs from https://github.com/novoid/Memacs <
Personal Information Management > http://Karl-Voit.at/tags/pim/
Emacs-related > http://Karl-Voit.at/tags/emacs/




Re: [O] speeding up Babel Gnuplot

2017-01-02 Thread Thierry Banel
Le 02/01/2017 00:34, Nicolas Goaziou a écrit :
> Hello,
>
> Thierry Banel  writes:
>
>> 1. Temporary generated twice
>> Because org-babel-gnuplot-process-vars is called twice.
>>
>> There is no obvious fix. Here is a dirty patch. It caches the name of
>> the temporary file in the 'param' list.
> This may not be an issue if `orgtbl-to-generic' is sufficiently fast.

I will look further into that.

>> 2. Quadratic behavior
>> The spot is at ox.el::5119(the lambda in org-export-table-row-number).
>>
>> This lambda is called a number of times equal to the square of thesize
>> of the table being plotted. For a 2000 rows table, this is
>> 2000x2000 = four millions times. The cache a few lines before does
>> nothelp because each row is visited only once.
> Fixed. Thank you.
>
> I also optimized a bit more `orgtbl-to-generic'. Hopefully, Babel
> Gnuplot should be responsive again of large tables.
>
Great improvement!
So,filling the org-export-table-row-numbercache at once was the way to go.

Thanks





Re: [O] Subtree macro

2017-01-02 Thread Nicolas Goaziou
Hello,

Ian Dunn  writes:

> Is there something like this macro in org?
>
> (defmacro org-with-subtree ( body)
>   "Evaluate BODY with the buffer narrowed to the current subtree."
>   (declare (debug (body)))
>   `(save-mark-and-excursion
>  (save-restriction
>(org-narrow-to-subtree)
>,@body)))

No, there isn't.

Regards,

-- 
Nicolas Goaziou



[O] Subtree macro

2017-01-02 Thread Ian Dunn

Is there something like this macro in org?

(defmacro org-with-subtree ( body)
  "Evaluate BODY with the buffer narrowed to the current subtree."
  (declare (debug (body)))
  `(save-mark-and-excursion
 (save-restriction
   (org-narrow-to-subtree)
   ,@body)))

--
Ian Dunn



[O] Fast Opening of Memacs Indexed Files (was: Elisp: help on string operations for fast file visiting)

2017-01-02 Thread Karl Voit
* Karl Voit  wrote:
> Hi!
>
> For Memacs[1], I'd like to come up with a very fast Org-mode method to
> open files independent of their location on your disk.

With the help of John Kitchin, I am now able to present you the
solution for the issue:

http://karl-voit.at/2017/01/01/memacs-grep/

In case you're using Memacs, this function might worth a look.

-- 
get mail|git|SVN|photos|postings|SMS|phonecalls|RSS|CSV|XML into Org-mode:
   > get Memacs from https://github.com/novoid/Memacs <
Personal Information Management > http://karl-voit.at/tags/pim/
Emacs-related > http://karl-voit.at/tags/emacs/