Re: [O] Special blocks with options in LaTeX export

2015-07-30 Thread Sebastien Vauban
Rasmus  writes:
> Suvayu Ali  writes:
>> I am trying to export special blocks with options.  But it seems the
>> options part is being ignored completely.  I expect the following:
>>
>>   #+begin_aside :options {Combinatorial background}
>>   It is all random!
>>   #+end_aside
>>
>> to be exported as:
>>
>>   \begin{aside}{Combinatorial background}
>>   It is all random!
>>   \end{aside}
>>
>> However what I get is without the extra argument to the environment.
>>
>> Am I missing something, or is this a bug?
>
> #+attr_latex: :options test
>
> #+begin_aside 
> random 
> #+end_aside

I think Suvayu uncovers something interesting: how do we give a "title"
to such an admonition (note, warning, tip, sidebar, etc.)?

If we want to export our document to multiple backends, we would be
forced to have:

--8<---cut here---start->8---
  #+attr_html: :options {By the way...}
  #+attr_latex: :options {By the way...}
  #+attr_odt: :options {By the way...}
  #+begin_note
  This is a useful note (with a title).
  #+end_note
--8<---cut here---end--->8---

Wouldn't it make more sense to get the title as part of the admonition,
as Suvayu tried it in his OP?

--8<---cut here---start->8---
  #+begin_note :options {By the way...}
  This is a useful note (with a title).
  #+end_note
--8<---cut here---end--->8---

Best regards,
  Seb

-- 
Sebastien Vauban




Re: [O] Special blocks with options in LaTeX export

2015-07-30 Thread Rasmus
Sebastien Vauban 
writes:

> Rasmus  writes:
>> Suvayu Ali  writes:
>>> I am trying to export special blocks with options.  But it seems the
>
>>> options part is being ignored completely.  I expect the following:
>>>
>>>   #+begin_aside :options {Combinatorial background}
>>>   It is all random!
>>>   #+end_aside
>>>
>>> to be exported as:
>>>
>>>   \begin{aside}{Combinatorial background}
>>>   It is all random!
>>>   \end{aside}
>>>
>>> However what I get is without the extra argument to the environment.
>>>
>>> Am I missing something, or is this a bug?
>>
>> #+attr_latex: :options test
>>
>> #+begin_aside 
>> random 
>> #+end_aside
>
> I think Suvayu uncovers something interesting: how do we give a "title"
> to such an admonition (note, warning, tip, sidebar, etc.)?
>
> If we want to export our document to multiple backends, we would be
> forced to have:
>
>   #+attr_html: :options {By the way...}
>   #+attr_latex: :options {By the way...}
>   #+attr_odt: :options {By the way...}
>   #+begin_note
>   This is a useful note (with a title).
>   #+end_note

Isn't this too stylized?   Wouldn't it rather be

#+attr_html: :options "title='BTW'"
#+attr_latex: :options {BTW}
#+begin_note
This is a useful note (with a title).
#+end_note

ox-html has not restrictions on attr_html BTW.

> Wouldn't it make more sense to get the title as part of the admonition,
> as Suvayu tried it in his OP?
>
>   #+begin_note :options {By the way...}
>   This is a useful note (with a title).
>   #+end_note

If you have something that should be shared across identically across
backends.  For a title I guess you'd use a caption, right?  A macro would
be a quick way to allow solutions once you know the right mapping between
the option element and backend transforming.

Rasmus

-- 
Dobbelt-A




Re: [O] How to make a non-GPL Org-mode exporter?

2015-07-30 Thread Oleh Krehel

Hi Aaron,

Aaron Ecay  writes:
>> Besides, CC-BY-NC-SA is compatible with GPL! Compatible. With GPL.
>
> This isn’t correct.  -NC licenses are non-Free (in the FSF sense of the
> word): 
> -SA licenses are Free, but not GPL-compatible, as indicated
> by the dashed orange line in the left-hand margin at:
> 

Thanks for clarifying. Maybe I should switch to CC-BY-SA instead.
Theoretically, I wouldn't want someone to simply mirror my blog and put
ads on it. But I guess it would be fine if a link to my blog is
provided, since then the reader is then aware of the option for ad-free
posts.

On the other hand, I wouldn't want to restrict anyone from significantly
building upon my content and making money from that.

--Oleh



Re: [O] Commit ceae5d651b80295f35c01ecfc53661c7e8eceba7 Breaks syncing with Android

2015-07-30 Thread Oleh Krehel

Hi Charles,

Charles Philip Chan  writes:

>
> Just want to let you know, this commit:
>
> ,
> | commit ceae5d651b80295f35c01ecfc53661c7e8eceba7
> | Author: Oleh Krehel 
> | Date:   Tue Jul 28 15:06:25 2015 +0200
> | 
> | lisp/org.el (org-set-tags): Simplify the code
> | 
> | * lisp/org.el (org-set-tags): Prefer let* to multi-variable setq,
> | ...skipping...
> | org-mobile: Tiny fix in creating index.org file
> | 
> | * lisp/org-mobile.el (org-mobile-create-index-file):
> | Eliminate cloning of `#+READONLY' property in the `index.org' file.
> | A sublists of `org-todo-keywords' don't need to contain the `|'.
> | 
> | TINYCHANGE
> `
>
> broke syncing with mobileorg on Android. After I revert to commit
> 5f3d8037a5099ca92db7edbf95ced22f0adefbef everything was fine.
>

I'm pretty sure my commit isn't to blame  and you meant this one:

c15db80e32d22dace184203f6f03a0b586bb4b50
Author: Sergey Gordienko 
Date:   Fri Jun 26 17:44:20 2015 +0300

org-mobile: Tiny fix in creating index.org file

* lisp/org-mobile.el (org-mobile-create-index-file):
Eliminate cloning of `#+READONLY' property in the `index.org' file.
A sublists of `org-todo-keywords' don't need to contain the `|'.

TINYCHANGE

--Oleh



Re: [O] "Capture"-like browser plugin?

2015-07-30 Thread Nick Dokos
Jay Dresser  writes:

> Peter Davis  pfdstudio.com> writes:
>> Frequently when I'm doing a Web search and find pages I like, I want to 
> save a link to the page, along with the
>> title and perhaps a
>> few notes. Something like org-mode's capture would be great, but I'd like 
> to initiate it from a browser. I
>> imaging hitting a plugin
>> button on the the browser's toolbar to open emacs via emacsclient, and 
> essentially do a capture with the
>> link and whatever text I
>> care to enter.
>> 
>> Has anyone seen or heard of or written something like this?
>> 
>> Thanks!
>> -pd
>
> Not sure that you need a plug-in or extension, I just use this bookmarklet:
>
> javascript:location.href='org-
> protocol://capture://x/'+encodeURIComponent(location.href)+'/'+encodeURIComp
> onent(document.title)+'/'+encodeURIComponent(prompt('Tags?'))
>
> It prompts for the tags, which I separate with ":" (to be org-like).
> This works fine in Chromium and I would think Firefox too.
>

But you still need to register the protocol with the browser. And that
registration step has proven problematic in the past.

-- 
Nick




[O] match on any TODO state

2015-07-30 Thread Xebar Saram
Hi
I created this function which works well.

 (defun z/org-sparse-todo ()
(interactive)
(org-match-sparse-tree t "+TODO=\"TODO\""))

my question is how can i match on ANY todo state and not just literaly TODO
ie if i have this in my org file

#+TODO: TODO(t) EXP(e) | SUBMITTED(s) K_TRACK(k) PAUSED(p) DONE(d)

how can i match it by all the todos like TODO and EXP

Best

Z


Re: [O] match on any TODO state

2015-07-30 Thread Nick Dokos
Xebar Saram  writes:

> Hi 
> I created this function which works well.
>
>  (defun z/org-sparse-todo ()
>     (interactive)
>     (org-match-sparse-tree t "+TODO=\"TODO\""))
>
> my question is how can i match on ANY todo state and not just literaly TODO
> ie if i have this in my org file 
>
> #+TODO: TODO(t) EXP(e) | SUBMITTED(s) K_TRACK(k) PAUSED(p) DONE(d) 
>
> how can i match it by all the todos like TODO and EXP
>

Untested, but it looks to me as if

(org-match-sparse-tree t)

should work.

--
Nick





[O] TBLFM added to updated table as result of a emacs-lisp src block

2015-07-30 Thread Miguel Ruiz
Hi,

I'm trying to make the following (modified) code works:
(https://eschulte.github.io/org-scraps/scraps/2011-08-19-updating-a-table.html)

#+name: OneTable
| 0 | 0 | 0 |
| 0 | 0 | 0 |
| 0 | 0 | 0 |

#+name: AnotherTable
#+begin_src emacs-lisp :var table=OneTable
  (setf (nth 1 table) '(2 2 2))
  (setq table (cons 'hline table))  
  (setq table (append table '(hline)))
  (setq table (append table '(("Total"
  (setq table (append table '(("\n#+TBLFM: 
@>$>=vsum(@I$>..@>>$>)::@>$>>=vsum(@I$>>..@>>$>>)::"
  table
#+end_src

At this point, it's ok for me but I need to put :: at the end to make it 
calculates sums because the | remaining. 
I'm aware I'm appending TBLFM to the table in a not orthodox way.

Is there a canonical way I could proceed in?

TIA

Miguel Ruiz.


Can't remember your password? Do you need a strong and secure password?
Use Password manager! It stores your passwords & protects your account.
Check it out at http://mysecurelogon.com/password-manager





Re: [O] match on any TODO state

2015-07-30 Thread Daimrod
Xebar Saram  writes:

> Hi 
> I created this function which works well.
>
>  (defun z/org-sparse-todo ()
>     (interactive)
>     (org-match-sparse-tree t "+TODO=\"TODO\""))
>
> my question is how can i match on ANY todo state and not just literaly TODO
> ie if i have this in my org file 
>
> #+TODO: TODO(t) EXP(e) | SUBMITTED(s) K_TRACK(k) PAUSED(p) DONE(d) 
>
> how can i match it by all the todos like TODO and EXP

In the agenda match, I use TODO<>"".
That is, all TODO keywords that aren't empty.

Best,

-- 
Daimrod/Greg


signature.asc
Description: PGP signature


Re: [O] Commit ceae5d651b80295f35c01ecfc53661c7e8eceba7 Breaks syncing with Android

2015-07-30 Thread Charles Philip Chan
On 30 Jul 2015, ohwoeo...@gmail.com wrote:

Hi Oleh:

> I'm pretty sure my commit isn't to blame  and you meant this one:
>
> c15db80e32d22dace184203f6f03a0b586bb4b50
> Author: Sergey Gordienko 
> Date:   Fri Jun 26 17:44:20 2015 +0300
>
> org-mobile: Tiny fix in creating index.org file
>
> * lisp/org-mobile.el (org-mobile-create-index-file):
> Eliminate cloning of `#+READONLY' property in the `index.org' file.
> A sublists of `org-todo-keywords' don't need to contain the `|'.
>
> TINYCHANGE
>
> --Oleh

Yes, this is the one I meant. Sorry for quoting the wrong commit.

Charles

-- 
LILO, you've got me on my knees!
(from David Black, dbl...@pilot.njin.net, with apologies to Derek and the
Dominos, and Werner Almsberger)


signature.asc
Description: PGP signature


Re: [O] evaluate TBLFM

2015-07-30 Thread Charles Millar

FWIW, the code in Miguel Ruiz's post earlier today

"TBLFM added to updated table as result of a emacs-lisp src block"

has pretty much answered my questions. Thank you, Miguel.

I'm not sure if it the most efficient or even elegant but here is what I 
came up with, so please comment and correct if there is a better way


#+Name: ATableP
#+begin_src rec data: Foo.rec :type Bar :fields date,Description,Amount 
:results silent

#+end_src
#+TBLNAME: ATable
src emacs-lisp :var table=ATableP :exports results
  (setq table (cons 'hline table))
  (setq table (cons '("Date" "Description" "Inventory") table))
  (setq table (append table '(("|Total"
  (setq table (append table '(("\n#+TBLFM: 
@>$>=vsum(@I$>..@>>$>);%.2f::"

  table
#+end_src
#+ATTR_LATEX: :environment longtable :align p{60pt}p{280pt}N{8}{2}
#+TBLNAME: SCHEDA
| date | Description | Amount| (resulting table, after C-c C-v s)
|||---|
| 6-7   | blah| 1.00  |
| 6-8   | blah blah|2.00   |
| | Total   |3.00|


On 06/11/2015 03:45 PM, Charles Millar wrote:

Hi,

I am learning how to use org-babel and want to export (LaTeX) a table 
with the final column added at final row, which should be inserted. 
The entire process would take place upon exporting to LaTeX/pdf


Desired result (roughly speaking)

| date | Description | Amount|
|||---|
| 6-7   | blah| 1.00  |
| 6-8   | blah blah|2.00   |
| ||3.00| (this row to be 
inserted and then column 3 added) (Also nice if a hline were inserted 
before the last row)


The table is generated from a recutils data base and essentially this 
is the set up



#+Name: ATable
#+begin_src rec data: Foo.rec :type Bar :fields date,Description,Amount
#+end_src

#+TBLNAME: ATable
#+TBLFM: @>$>=vsum(@I$>..@>>$>);%.2f

I have read Using Code Blocks in Org Tables in the Worg Babel 
Introduction and searched the lists and am not sure of how to 
implement this.


At the moment I am more interested in solving the column sum problem; 
i can kludge an  added row using a dummy record in the database.


Charlie Millar







[O] Infinite loop using :post header argument that calls a emacs-lisp src block

2015-07-30 Thread Charles Millar
emacs version GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 
3.10.7) of 2014-03-07 on lamiak, modified by Debian
Org-mode version 8.3beta (release_8.3beta-1302-g00142f @ 
/usr/share/emacs/site-lisp/org-mode/lisp/)


the following produces a table with header, hline, a row with TOTAl and 
#+TBLFM immediately after the table


#+NAME: SCHEDAP
#+begin_src rec :data foo.rec :type bar :fields 
AssetDate,Description,Basis :results silent

 (some recutils sexes)
#+end_src
#+NAME: SCHEDA
#+begin_src emacs-lisp :var table=SCHEDAP :export results
  (setq table (cons 'hline table))
  (setq table (cons '("Date" "Description" "Basis") table))
  (setq table (append table '(("|Total"
  (setq table (append table '(("\n#+TBLFM: 
@>$>=vsum(@I$>..@>>$>);%.2f::"

  table
#+end_src
#+TBLNAME: SCHEDA

What I would like to use is

#+NAME: insertstuff
#+begin_src emacs-lisp :var table=() :results silent
  (setq table (cons 'hline table))
  (setq table (cons '("Date" "Description" "Basis") table))
  (setq table (append table '(("|Total"
  (setq table (append table '(("\n#+TBLFM: 
@>$>=vsum(@I$>..@>>$>);%.2f::"

  table
#+end_src


#+NAME: SCHEDA
#+begin_src rec :data foo.rec :type bar :fields 
AssetDate,Description,Basis :post insertstuff :var table=SCHEDA

 (some recutils sexes)
#+end_src
#+TBLNAME: SCHEDA

which results in an infinite loop, or so it appears.

What am I missing? Or, is the first example my only choice?

Charlie Millar



Re: [O] Infinite loop using :post header argument that calls a emacs-lisp src block

2015-07-30 Thread Charles Millar
I neglected to mention that the elisp code is based on Miguel Ruiz's 
post to this list earlier today.


On 07/30/2015 09:49 PM, Charles Millar wrote:
emacs version GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 
3.10.7) of 2014-03-07 on lamiak, modified by Debian
Org-mode version 8.3beta (release_8.3beta-1302-g00142f @ 
/usr/share/emacs/site-lisp/org-mode/lisp/)


the following produces a table with header, hline, a row with TOTAl 
and #+TBLFM immediately after the table


#+NAME: SCHEDAP
#+begin_src rec :data foo.rec :type bar :fields 
AssetDate,Description,Basis :results silent

 (some recutils sexes)
#+end_src
#+NAME: SCHEDA
#+begin_src emacs-lisp :var table=SCHEDAP :export results
  (setq table (cons 'hline table))
  (setq table (cons '("Date" "Description" "Basis") table))
  (setq table (append table '(("|Total"
  (setq table (append table '(("\n#+TBLFM: 
@>$>=vsum(@I$>..@>>$>);%.2f::"

  table
#+end_src
#+TBLNAME: SCHEDA

What I would like to use is

#+NAME: insertstuff
#+begin_src emacs-lisp :var table=() :results silent
  (setq table (cons 'hline table))
  (setq table (cons '("Date" "Description" "Basis") table))
  (setq table (append table '(("|Total"
  (setq table (append table '(("\n#+TBLFM: 
@>$>=vsum(@I$>..@>>$>);%.2f::"

  table
#+end_src


#+NAME: SCHEDA
#+begin_src rec :data foo.rec :type bar :fields 
AssetDate,Description,Basis :post insertstuff :var table=SCHEDA

 (some recutils sexes)
#+end_src
#+TBLNAME: SCHEDA

which results in an infinite loop, or so it appears.

What am I missing? Or, is the first example my only choice?

Charlie Millar







Re: [O] Insert org-id Link at Point via Outline Path Completion

2015-07-30 Thread Xebar Saram
i also have a similar workflow and would love to hear Dominic if you found
a solution for this or if anyone on the list has other suggestions?

best

Z

On Tue, May 12, 2015 at 10:57 PM, Dominic Surano 
wrote:

> Hello,
>
> I use org-mode a lot like a wiki so links to other org-mode headings are
> very common. Currently, I navigate to the heading or pull it up in an
> agenda view, store the link with C-l, going back to where I want to
> insert the link, then insert the link with C-c C-l RET. This is a bit
> time consuming.
>
> Instead, I would prefer to map a key that allows me to insert a link at
> the current point using tab completion similar to org-refile (C-c C-w).
> Looking through org-id.el, it seems like org-id-get-with-outline-path
> completion was designed for this purpose. I tried:
>
> (global-set-key "\C-ci" (lambda () (interactive) (org-id-get-with
> outline-path-completion)))
>
> but it didn't work as intended. Anyone have any ideas?
>
> Thanks!
> -D
>
> For reference, I have the following set in my configuration:
>
> ;; Use global IDs
> (require 'org-id)
> (setq org-id-link-to-org-use-id t)
>
> ;; Update ID file .org-id-locations on startup
> (org-id-update-id-locations)
>
> ;; Targets include this file and any file contributing to the agenda -
> up to 9 levels deep
> (setq org-refile-targets (quote ((nil :maxlevel . 9)
>  (org-agenda-files :maxlevel . 9
> (setq org-refile-use-outline-path 'file)
> (setq org-outline-path-complete-in-steps t)
> (setq org-refile-allow-creating-parent-nodes t)
>
>
>