[O] A way to export to ODT

2018-05-15 Thread edgar
I want to share this little recipe in the hope that it is useful to 
someone. It is a partial solution to exporting with MathML to ODT from 
Org. I am not a fan of ODT, but my boss need DOCX like dope.


To get a working file
1. To get siunitx (partially) working, download 
[[https://github.com/Authorea/LaTeXML/blob/master/lib/LaTeXML/Package/siunitx.sty.ltxml][siunitx.sty.ltxml 
from Authorea's github.com]]
(there is an issue on the upstream 
[[https://github.com/brucemiller/LaTeXML][LaTeXML]] for this already; 
the author may be more motivated is someone else asks for it and/or 
helps) and save it somewhere (remember this location, you'll need it 
later). Here, ~~/.emacs.d/plugins~ is used.


   Do ~C-c C-c~ or ~C-c C-v C-e~ 
(src_emacs-lisp{(org-babel-execute-maybe)}) on the following block to 
add ~\mathrm{·}~ to the symbols (this removes italics from units). 
Change the path to the file accordingly.

   #+BEGIN_SRC bash
 sed -i "s-\(DefMacro.*\)'\([[:alpha:]]*\)'-\1'mathrm{\2}'-g" 
~/.emacs.d/plugins/siunitx.sty.ltxml

   #+END_SRC

   Add any required symbol to that same file (note that there is a ~\mm~ 
which should be ~\mmHg~; commit e134a5b @ Jul 24, 2017). Note that if 
you add something like ~DefMacro('\mm','some');~, strange things start 
to happen.


2. Install ~latexml~ (with ~latexmlmath~; 
https://dlmf.nist.gov/LaTeXML/get.html). Then, execute this command in 
Emacs (change ~latexmlmath~ to the actual path)

   #+BEGIN_SRC emacs-lisp
 (setq org-latex-to-mathml-convert-command
   "latexmlmath --presentationmathml=%o --preload=siunitx 
--path=~/.emacs.d/plugins/ --includestyles \"%i\"")

   #+END_SRC

3. Set the ~#+OPTIONS: LaTeX:t~ somewhere in the document

4. Export to odt with Org-mode (~C-c C-e o o~), and run this (you can do 
~C-c C-c~ on it; make sure that LibreOffice is not running)

   #+BEGIN_SRC shell
 libreoffice --headless --convert-to doc 
./.odt

   #+END_SRC

   You can use a template with the line (change file name accordingly). 
Modify the file at will.

   #+BEGIN_SRC org
 ,#+ODT_STYLES_FILE: "../Templates/odt-review-template.ott"
   #+END_SRC

-

ONLY AT VFEmail! - Use our Metadata Mitigator to keep your email out of the 
NSA's hands!
$24.95 ONETIME Lifetime accounts with Privacy Features!  
15GB disk! No bandwidth quotas!
Commercial and Bulk Mail Options!  



Re: [O] emacs

2018-05-15 Thread Nathan A
Previous email was sent my mistake, sorry about that.

On Tue, May 15, 2018 at 1:20 PM, Nathan A  wrote:
> evil go to center when using G
>
>
> (defun scroll-to-center-advice ( args)
>   (evil-scroll-line-to-center (line-number-at-pos)))
>
> (advice-add #'evil-goto-line :after #'scroll-to-center-advice)



[O] emacs

2018-05-15 Thread Nathan A
evil go to center when using G


(defun scroll-to-center-advice ( args)
  (evil-scroll-line-to-center (line-number-at-pos)))

(advice-add #'evil-goto-line :after #'scroll-to-center-advice)



Re: [O] Inheriting some local variables from source code block editing buffers

2018-05-15 Thread Göktuğ Kayaalp
On 2018-05-14 18:47 +02, Nicolas Goaziou  wrote:
> (org-element-property :header (org-element-at-point)) => (":foo bar")
[...]
>> I can't find any documentation on Org-mode's internal APIs and how
>> different parts fit together, so I'm having to figure things out reading
>> source code.
>
> See .

Thanks, and sorry.  I've been mostly ignoring Worg up until now, because
I haven't seen the worg/dev/ pages mentioned in the info manual (I'd
expect to see those pages mentioned in the Hacking section BTW, I can
send a patch mentioning them in a "Further resources" subsection there
if you'd like that added).

So, today I've started implementing a version of this that works like
this:

#+begin_example
  #+property: edit-bindings /varlist/
  * heading
  :properties:
  :edit_bindings: /varlist/
  :end:
  #+header: edit-bindings /varlist/
#+end_example


where scoping is like (x > y meaning x overrides y):

  header line bindings > subtree bindings > #+property bindings before
  the element

I'll send a complete patch soon.

Best,

-- 
İ. Göktuğ Kayaalp   
 024C 30DD 597D 142B 49AC
 40EB 465C D949 B101 2427



Re: [O] Irrelevant/misleading error message (due to bad syntax in init-file)

2018-05-15 Thread Nick Dokos
alain.coch...@unistra.fr writes:

>   ...
>   (setq org-agenda-files '"/tmp/bug-agenda.org") ; <- bad syntax!
> ...
> NB: there is no message caused by "-debug-init" related to the bad
> syntax in the setq instruction.
>

That's because it's legal: it's not bad syntax:

'"foo" is equivalent to (quote "foo"). Now `quote' inhibits
evaluation but since strings evaluate to themselves, it does
not matter whether you evaluate or not.

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




[O] [bug] in capture

2018-05-15 Thread Thomas Holst

Hi,

I encountered a bug in cature (so I think).

I have among other the following template:

#+begin_src emacs-lisp
  ("hr" "Rechnung erfassen" table-line
   (file+function "~/git/org-priv/Univ_Beih.org" 
th:capure-find-open-vers-regn)
   "| # | %^u | %^{Arzt/Apotheke} | %^{für wen|Lida|Oleg|Victor|Simon} 
| %^{Betrag} | %^u | | [[file:%c][link Beleg]] |"

   :table-line-pos "III-1" :immediate-finish t)
#+end_src

With org-mode from git I get an error when using this template:

: condition-case: Capture template ‘hr’: integer-or-marker-p

With git bisect I found that:

ab53ee2c3d3ad8a090823c5f0f22dfd626605b3c is the first bad commit
commit ab53ee2c3d3ad8a090823c5f0f22dfd626605b3c
Author: Nicolas Goaziou 
Date:   Mon Apr 30 00:52:57 2018 +0200

    org-capture: Fix capturing in a table

    * lisp/org-capture.el (org-capture-place-table-line): Rewrite function.
    * testing/lisp/test-org-capture.el (test-org-capture/table-line): New
  test.

:04 04 900f436884b24172403ede46422a853f7b4a497c 
cbb50728eaae22ab234cab05dcda5b53050395df M    lisp
:04 04 fd8fb9ee8fb1cf0ea3dd4694682932e4c3311a78 
f6abcbceb630e8e704bf8b9c3d41ad0d029a5725 M    testing


Prior to this commit everything is fine.

Was there a change in the syntax I missed?

Thanks for looking into this.

--
  Thomas




Re: [O] Typo on org-tag-alist

2018-05-15 Thread Bernt Hansen
Nicolas Goaziou  writes:

> Bernt Hansen  writes:
>
>> Nope.  I think you found another one (org-tag-persistent-alist) and
>> fixed that instead.  org-tag-alist is the one I reported.
>>
>> $ git grep -n engroup
>> lisp/org.el:3424:`:startgrouptag', `:grouptags', `:engroup',
>> `:endgrouptag' or
>>
>> Thanks for finding the other one :)
>
> Ah. Fixed too. Thank you.

Confirmed.  Thanks!

Bernt



[O] Irrelevant/misleading error message (due to bad syntax in init-file)

2018-05-15 Thread Alain . Cochard

Hello.  

I do the following.

The file ~/.emacs.debug contains:

  (add-to-list 'load-path "/home/cochard/Org/Coch-git/org-mode/lisp")
  (setq org-agenda-files '"/tmp/bug-agenda.org") ; <- bad syntax!
  (find-file "/tmp/bug-agenda2.org") ; <- empty file

The file /tmp/bug-agenda.org contains:

   * Foo :bar:

I run:

   emacs -debug-init -Q -l ~/.emacs.debug

NB: there is no message caused by "-debug-init" related to the bad
syntax in the setq instruction.

When in the empty "bug-agenda2.org", if I do "M-x org-agenda m" I, get
(temporarily) in the minibuffer:

   Use M-x make-directory RET RET to create the directory and its
   parents

In the minibuffer, if I type "" or "b" or "ba" or
"bar", I get "[No match]".  If after either of these 4 "" I
hit the "" key, I get:

   Non-existent agenda file ~/org/* Foo :bar:.  [R]emove from list or
   [A]bort?

NB: I don't have an "~/org" file or directory.

I have:

   Emacs : GNU Emacs 24.5.1 (x86_64-redhat-linux-gnu, GTK+ Version
   3.18.9) of 2016-04-11 on buildvm-25.phx2.fedoraproject.org Package:
   Org mode version 9.1.13 (release_9.1.13-755-gc46fcd @
   /home/cochard/Org/Coch-git/org-mode/lisp/)

I apologize if this issue is too minor (or otherwise inappropriate) to
be reported -- please let me know if so.

Regards


-- 
EOST (École et Observatoire des Sciences de la Terre) 
IPG (Institut de Physique du Globe) | alain.coch...@unistra.fr
5 rue René Descartes   [bureau 106] | Phone: +33 (0)3 68 85 50 44 
F-67084 Strasbourg Cedex, France| Fax:   +33 (0)3 68 85 01 25 



Re: [O] Proposal: references from code to text.

2018-05-15 Thread Eric S Fraga
On Tuesday, 15 May 2018 at 04:49, ZHUO QL (KDr2) wrote:
> 2. The bug Eric just found while putting a <> link within
> quotes, although, it may be easy to fix.  

I realised afterwards that it is not a bug but is a feature: org assumes
that anything before the << start of the link should be repeated on each
line of the incorporated src block.  This allows for easy incorporation
of code into a comment block, e.g. for C or sh etc.

-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.1.6-591-gee336b


signature.asc
Description: PGP signature


[O] Parsing of todo state log lines

2018-05-15 Thread Michael Brand
Hi all

There seems to be an inconsistency in parsing. When
org-log-states-order-reversed is nil (which I am new to) and a TODO
with the manually written state log lines

- State "DONE"   from "TODO"   [2018-05-12 Sat]
- State "DONE"   from  [2018-05-13 Sun]
- State "DONE"   from "TODO"   [2018-05-14 Mon]

is changed to DONE the new state log line is expected to go after the
third line but it goes after the first like if the second was missed
by the parser. When the same state log lines are in a habit they are
all recognized for the consistency graph where they appear as a star,
but still the new state log line goes after the first line.

Found in Org release_9.1.13-751-g9dcc522.

Michael



Re: [O] taskjuggler subtract scheduled and deadline

2018-05-15 Thread Christian Egli
Bastien  writes:

> @Christian: I don't remember if you are still using and
> maintaining ox-taskjuggler.el -- feel free to correct me
> if I'm wrong!

No I'm barely using it anymore, let alone maintaining it.

As for Edgars question

> Is there a way to set starting and ending times with a resolution of
> hours or minutes to be exported with taskjuggler?

AFAIK there isn't. Your patch was good start, but your expressions
inside the (or ...) were such that the one that collected the time was
never executed.

I see three options:

1. Hack the exported taskjuggler file. A hack but gets the job done
2. Try to use the START attribute on the node
3. Improve the source of ox-taskjuggler.el as you've started.

Hope that helps
Christian

-- 
Christian Egli
Swiss Library for the Blind, Visually Impaired and Print Disabled
Grubenstrasse 12, CH-8045 Zürich, Switzerland