Re: [O] TODO keyword highlighting for headings with properties broken

2014-09-03 Thread wtm
Trevor,

Thanks so much for mentioning this.  I considered using these to roll back
to 8/25 but I wasn't sure how much performance I would lose if I  used the
.el files instead of the compiled .elc versions.  Or perhaps my assumption
is incorrect?  Is it ok to just byte-compile all of the .el files
manually?  I'm still very new to org-mode so please forgive my ignorance.

Will


On Wed, Sep 3, 2014 at 7:56 PM, Trevor Murphy 
wrote:

> Bruno Bigras  writes:
>
>  It would be nice if the ELPA package could be updated faster than that in
>> cases like this. I guess a couple of people must now have a broken org-mode
>> unless they switched to git like I did.
>>
>
> Chiming in with an alternative that I was pleased to discover -
> https://elpa.gnu.org/packages/org.html.  For those who want an easy way
> to roll back to the 8/25 snapshot.
> --
> Trevor Murphy
> GnuPG Key: 0x83881C0A
>
>
>


Re: [O] TODO keyword highlighting for headings with properties broken

2014-09-03 Thread Trevor Murphy

Bruno Bigras  writes:

It would be nice if the ELPA package could be updated faster 
than that in cases like this. I guess a couple of people must 
now have a broken org-mode unless they switched to git like I 
did. 


Chiming in with an alternative that I was pleased to discover - 
https://elpa.gnu.org/packages/org.html.  For those who want an 
easy way to roll back to the 8/25 snapshot. 


--
Trevor Murphy
GnuPG Key: 0x83881C0A




Re: [O] TODO keyword highlighting for headings with properties broken

2014-09-03 Thread Bruno Bigras
It would be nice if the ELPA package could be updated faster than that
in cases like this. I guess a couple of people must now have a broken
org-mode unless they switched to git like I did.

2014-09-03 17:16 GMT-04:00 wtm :
> Thanks, Nicolas.  ELPA seems to update every seven days and the last update
> appears to have been on Monday, September 1st.  Hopefully, it will be
> incorporated by 9/08!
>
>
> On Wed, Sep 3, 2014 at 2:46 PM, Nicolas Goaziou 
> wrote:
>>
>> Hello,
>>
>> wtm  writes:
>>
>> > I experienced the same problem.  Has the fix been applied to org in
>> > ELPA?
>> > It was not clear from my reading of earlier emails on this topic if the
>> > fix
>> > had been applied there or elsewhere.
>>
>> I applied it on maint, so it should go to ELPA soon.  When applied,
>> `org-property-re' should be:
>>
>>   "^\\(?4:[ ]*\\)\\(?1::\\(?2:.*?\\):\\)\\(?:\\(?3:$\\)\\|[
>> ]+\\(?3:.*?\\)\\)\\(?5:[]*\\)$"
>>
>>
>> Regards,
>>
>> --
>> Nicolas Goaziou
>
>



Re: [O] Please help with a filter

2014-09-03 Thread Rafael
Charles Berry  writes:

> Rafael  gmail.com> writes:
>
>> I want that the result of exporting to markdown the following two blocks
>> be identical:
>
>
> You probably want a derived backend taking 'md as the parent. 

Yes, that's what I feared.. :) I thought I could delay creating a
derived backend for later, but I guess now is the time. Thanks for your
answer, it was helpful indeed.






Re: [O] TODO keyword highlighting for headings with properties broken

2014-09-03 Thread wtm
Thanks, Nicolas.  ELPA seems to update every seven days and the last update
appears to have been on Monday, September 1st.  Hopefully, it will be
incorporated by 9/08!


On Wed, Sep 3, 2014 at 2:46 PM, Nicolas Goaziou 
wrote:

> Hello,
>
> wtm  writes:
>
> > I experienced the same problem.  Has the fix been applied to org in ELPA?
> > It was not clear from my reading of earlier emails on this topic if the
> fix
> > had been applied there or elsewhere.
>
> I applied it on maint, so it should go to ELPA soon.  When applied,
> `org-property-re' should be:
>
>   "^\\(?4:[ ]*\\)\\(?1::\\(?2:.*?\\):\\)\\(?:\\(?3:$\\)\\|[
>  ]+\\(?3:.*?\\)\\)\\(?5:[]*\\)$"
>
>
> Regards,
>
> --
> Nicolas Goaziou
>


[O] bug#18401: 24.4.50; emerge-files fails for org files

2014-09-03 Thread Glenn Morris
Detlev Zundel wrote:

> org-overview: `recenter'ing a window that does not display current-buffer.

This was apparently fixed in the Org repository months ago,
but still not in the Emacs one. Ref:

http://debbugs.gnu.org/cgi/bugreport.cgi?bug=17724#26

(We now have 4 separate Emacs reports for this.)





Re: [O] A key-binding for plotting

2014-09-03 Thread Thierry Banel
Le 03/09/2014 20:22, Nicolas Goaziou a écrit :
> Hello,
>
> Thierry Banel  writes:
>
>> Here is a patch for the info doc.
>> I added a few lines in the Org-Plot page.
> It looks good but I realized (a bit late) we cannot use "C-c p" as it is
> reserved to users, as any "C-c LETTER" combination.
>
>
> Regards,
>

Sorry, I was not aware of this rule.
But no worries, it is not late.
We will remove this key binding, and hopefully replace it with another one.

Maybe this could be an opportunity to define a dispatch key binding for
any past and future plotters,
beginning with Gnuplot and orgtbl-ascii-plot,
in the way org-agenda is a dispatcher for many information collectors.

Anyone, an idea for a key combination to plot data ?

Thierry




Re: [O] TODO keyword highlighting for headings with properties broken

2014-09-03 Thread Nicolas Goaziou
Hello,

wtm  writes:

> I experienced the same problem.  Has the fix been applied to org in ELPA?
> It was not clear from my reading of earlier emails on this topic if the fix
> had been applied there or elsewhere.

I applied it on maint, so it should go to ELPA soon.  When applied,
`org-property-re' should be:

  "^\\(?4:[ ]*\\)\\(?1::\\(?2:.*?\\):\\)\\(?:\\(?3:$\\)\\|[ 
]+\\(?3:.*?\\)\\)\\(?5:[]*\\)$"


Regards,

-- 
Nicolas Goaziou



Re: [O] TODO keyword highlighting for headings with properties broken

2014-09-03 Thread wtm
Hello,

I experienced the same problem.  Has the fix been applied to org in ELPA?
It was not clear from my reading of earlier emails on this topic if the fix
had been applied there or elsewhere.

Thanks,

Will


On Wed, Sep 3, 2014 at 12:58 PM, Nicolas Goaziou 
wrote:

> Hello,
>
> Erik Hetzner  writes:
>
> > Highlighting of TODO keywords for headings with properties in my org
> > files seems to have broken since I upgraded to org 20140901 (via org
> > mode ELPA). Rolling back to 20140825 fixes the problem. Here is a
> > sample file I tested after loading the new org-mode using emacs -Q:
> >
> > * TODO foo
> >   :PROPERTIES:
> >   :bar:  baz
> >   :END:
> >
> > If you remove the properties, the TODO highlights correctly.
>
> I think I fixed it yesterday. Please update if you can.
>
>
> Regards,
>
> --
> Nicolas Goaziou
>
>


Re: [O] Newlines in capture templates

2014-09-03 Thread Carlos Pita
Well, I've figured it out myself, it wasn't that hard. Here it is in
case someone else comes here looking for an answer in the future:

C-h v org-capture-templates:

[...]

 :empty-linesSet this to the number of lines the should be inserted
 before and after the new item.  Default 0, only common
 other value is 1.

 :empty-lines-before Set this to the number of lines the should be inserted
 before the new item.  Overrides :empty-lines for the
 number lines inserted before.

 :empty-lines-after  Set this to the number of lines the should be inserted
 after the new item.  Overrides :empty-lines for the
 number of lines inserted after.


Cheers
--
Carlos

Carlos Pita  writes:

> Hi all,
>
> I would like to separate the items in my capture files by a number of
> newlines, as in:
>
>   ** item 1
>
> content 1
>
> ** item 2
>
> content 2
>
>   ** item 3
>   
>   content 3
>   
> instead of:
>
>   ** item 1
>   
>   content 1
>   ** item 2
>   
>   content 2
>   ** item 3
>   
>   content 3
>   
> But org is removing the heading and trailing \n from my templates. Is
> there any way to avoid this, or to command org to automatically include
> newlines between captures?
>
> Thank you in advance
> --
> Carlos



Re: [O] navi equivalent to 'g' speed command?

2014-09-03 Thread Thorsten Jolitz
Alan Schmitt  writes:

>> Maybe you could switch to the git-versions?
>
> OK, I gave it a try, and I'm now using them.

Thanks, that make things easier. 

> I can already report that the 'g' speed command does not work as
> expected. It seems to work (it brings up a list of possible targets),
> but there are two issues.
>
> 1. The target does not include the current file, although I have this
>configuration:
>
> #+begin_src emacs-lisp
> (setq org-refile-targets
>   '((my-todo-file :maxlevel . 10)
> (nil :maxlevel . 10)))
> #+end_src
>
> 2. The current entry is actually refiled (instead of simply having the
>point move to the target).

As you can see when you look in the tj-outshine branch, I did a kind of
'industrial mass production of user-commands', i.e. I produced the
functions and the keybindings that port all Org commands to outshine
(using 'outshine-use-outorg'), but I did not have the time to check
them. Some might work out-of-the-box, others not, and other might not
make sense at all in Outshine. 

So I have to look at them one by one, and the next one I will check is
outshine-refile-targets, thx for your observations. 

> Maybe I should look into doing this the navi way. Assume you want to
> reach an entry with "foobar" in its title, but you don't know at what
> level this entry is. How would you do it?

As I wrote in my last mail, I think outshine-imenu (using idomenu, you
have to install that package for ido-style completion) does exacly what
you want - offer all file headers with smart completion, so you only
need to type 'foo' or so to get the "foobar" headline. Typing RET then
moves point to the headline.

-- 
cheers,
Thorsten




Re: [O] navi equivalent to 'g' speed command?

2014-09-03 Thread Alan Schmitt
On 2014-09-03 10:28, Thorsten Jolitz  writes:

> ok, it seems 'outshine-refile does works, but I'm not sufficiently used
> to it - it actually refiles the outshine headers I'm on, but that seems
> to be a configuration thing. 

Oops, I should have read this first.

> to match you use case, but I think what you really want is
>
>
> ,[ C-h f outshine-imenu RET ]
> | outshine-imenu is an interactive Lisp function in `outshine.el'.
> | 
> | It is bound to M-# M-p.
> | 
> | (outshine-imenu &optional PREFER-IMENU-P)
> | 
> | Convenience function for calling imenu/idomenu from outshine.
> `
>
> with idomenu installed from the package manager. 

What I like about 'org-refile' is that it's integrated with my setup
(currently helm, but I'm also trying icicle). Is is possible to have
such an integration with outshine?

Thanks,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7


signature.asc
Description: PGP signature


Re: [O] navi equivalent to 'g' speed command?

2014-09-03 Thread Alan Schmitt
> I just tried it out - this 
>
> ,
> | g  (org-refile t)
> `
>
> works in Outshine like in Org when using the tj-outshine branch from the
> github repo, assuming you have
>
> ,
> | (setq outshine-use-speed-commands t)
> `
>
> in you init file. 

Ah, good to know.

> All 3 libs (outshine, outorg and navi-mode) have developed quite a bit
> recently, but I want to include better tests for outorg and implement
> most of Org-mode's user API (like e.g. org-refile) via the
> `outshine-use-outorg' function before I merge the tj-outshine, tj-outorg
> and tj-navi branches into their repective masters.
>
> Maybe you could switch to the git-versions?

OK, I gave it a try, and I'm now using them. I can already report that
the 'g' speed command does not work as expected. It seems to work (it
brings up a list of possible targets), but there are two issues.

1. The target does not include the current file, although I have this
   configuration:

#+begin_src emacs-lisp
(setq org-refile-targets
  '((my-todo-file :maxlevel . 10)
(nil :maxlevel . 10)))
#+end_src

2. The current entry is actually refiled (instead of simply having the
   point move to the target).

Maybe I should look into doing this the navi way. Assume you want to
reach an entry with "foobar" in its title, but you don't know at what
level this entry is. How would you do it?

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7


signature.asc
Description: PGP signature


Re: [O] [PATCH] make orgtbl-ascii-plot easier to install

2014-09-03 Thread Nicolas Goaziou
Hello,

Thierry Banel  writes:

> Here is a patch for the info doc.
> I added a few lines in the Org-Plot page.

It looks good but I realized (a bit late) we cannot use "C-c p" as it is
reserved to users, as any "C-c LETTER" combination.


Regards,

-- 
Nicolas Goaziou



Re: [O] Typo in org guide

2014-09-03 Thread Nicolas Goaziou
Hello,

Alexis Roda  writes:

> the org guide "Release 8.2.7c" says in page 32, "12.1 Export options":
>
>   The whole set of lines can be inserted into the buffer with C-c C-e t.
>
> It should say:
>
>   The whole set of lines can be inserted into the buffer with C-c C-e #.

Fixed. Thank you.


Regards,

-- 
Nicolas Goaziou



Re: [O] TODO keyword highlighting for headings with properties broken

2014-09-03 Thread Nicolas Goaziou
Hello,

Erik Hetzner  writes:

> Highlighting of TODO keywords for headings with properties in my org
> files seems to have broken since I upgraded to org 20140901 (via org
> mode ELPA). Rolling back to 20140825 fixes the problem. Here is a
> sample file I tested after loading the new org-mode using emacs -Q:
>
> * TODO foo
>   :PROPERTIES:
>   :bar:  baz
>   :END:
>
> If you remove the properties, the TODO highlights correctly.

I think I fixed it yesterday. Please update if you can.


Regards,

-- 
Nicolas Goaziou



[O] TODO keyword highlighting for headings with properties broken

2014-09-03 Thread Erik Hetzner
Hi,

Highlighting of TODO keywords for headings with properties in my org
files seems to have broken since I upgraded to org 20140901 (via org
mode ELPA). Rolling back to 20140825 fixes the problem. Here is a
sample file I tested after loading the new org-mode using emacs -Q:

* TODO foo
  :PROPERTIES:
  :bar:  baz
  :END:

If you remove the properties, the TODO highlights correctly.

best, Erik

-- 
Sent from my free software system .



Re: [O] graphics for html and latex / pdf export?

2014-09-03 Thread Aaron Ecay
Hi Rainer,

One option is to use svg graphics, which are supported in latex (via the
svg package from CTAN) and in HTML (on almost all modern browsers:
).  The svg latex package supports
compiling with pdflatex out of the box and lualatex with a little
hackery; xelatex is not supported (you also need to install inkscape and
compile with a flag that allows latex code to execute shell commands).

Otherwise, you might be looking for something like this worg page:
.

And also search “by-backend” in the mailing list archives for other
relevant examples.

Hope this is helpful,

-- 
Aaron Ecay



[O] Typo in org guide

2014-09-03 Thread Alexis Roda

Hi all,
the org guide "Release 8.2.7c" says in page 32, "12.1 Export options":

  The whole set of lines can be inserted into the buffer with C-c C-e t.

It should say:

  The whole set of lines can be inserted into the buffer with C-c C-e #.


Regards



Re: [O] Tangling from code block and header arguments WAS: Format output of org-babel-tangle for exported file

2014-09-03 Thread Charles C. Berry

On Wed, 3 Sep 2014, Rainer M Krug wrote:


Charles Berry  writes:


Rainer M Krug  krugs.de> writes:



Hi

I am calling (org-bable-tangle) in a code block in an org file and I
would show the files resulting from the tangling in a nice format.



[original question nd answer deleted]



Thanks - this looks promising.

But I now have another problem: The result of tangling from a code block
is different then when calling interactively.

Consider the following org file:

--8<---cut here---start->8---
#+PROPERTY: header-args :tangle no

* DESCRIPTION File
:PROPERTIES:
:header-args+: :tangle ./DESCRIPTION
:END:

#+begin_src RDescr
test
#+end_src

* And the tangling
#+BEGIN_SRC emacs-lisp :results value
(mapconcat (lambda (x) (file-relative-name x "..")) (org-babel-tangle) "\n")
#+END_SRC

#+RESULTS:

--8<---cut here---end--->8---

When tangling interactively, the file DESCRIPTION is tangled properly.
But when I call (org-babel-tangle) from the code block, nothing is
tangled because in this case, the property =tangle= is equal to =no=
based on the file wide property setting in the beginning.

Is this a bug or is it simply not possible to tangle from a code block?


I think this is a bug.

Here is an ECM to demo it.

Note that the :tangle header arg for the 'Descr' src block is correctly 
rendered from the DESCRIPTION subtree, but not from the 'new heading' 
subtree.




--8<---cut here---start->8---
#+PROPERTY: header-args :tangle no

* DESCRIPTION File
:PROPERTIES:
:header-args: :tangle ./DESCRIPTION
:END:

#+NAME: Descr
#+begin_src RDescr
test
#+end_src

#+BEGIN_SRC emacs-lisp :results pp
  (save-excursion
(org-babel-goto-named-src-block "Descr")
(assoc :tangle (nth 2 (org-babel-get-src-block-info
#+END_SRC

#+RESULTS:
: (:tangle . "./DESCRIPTION")



* new heading

#+BEGIN_SRC emacs-lisp :results pp
  (save-excursion
(org-babel-goto-named-src-block "Descr")
(assoc :tangle (nth 2 (org-babel-get-src-block-info
#+END_SRC

#+RESULTS:
: (:tangle . "no")

--8<---cut here---end--->8---



HTH,

Chuck



Re: [O] Custom formatting during export

2014-09-03 Thread Thomas S. Dye
Aloha Gabe,

Gabe Becker  writes:

> orgmode developers and power-users,
>
> I'd like to be able to declare custom entities (apologies if I'm using that
> term incorrectly) within the text of an orgmode document which I can
> specify custom formatting for when my .org is exported, e.g. to PDF or HTML.
>
> I have a background in Docbook, so the analogue there would be defining a
> custom xml tag and then extending the XSL files to handle it as desired.
> Please see the following snippet:
>
>
> * section title
>
> Here is some text, but I want [specialthing: this bit here] to be formatted
> differently than [newanddifferent: this other big over here].
>
>
> Where I would have defined specific custom formatting rules for
> "specialthing" and "newanddifferent" type entities.
>
> Is there a way to do this in orgmode? If not, it seems like it would be a
> very useful feature (at least to me:) ). Note: I don't care about the
> syntax as long as the result is the same.
>
> Thanks for your help,
> ~G
> -- 
> Computational Biologist
> Genentech Research
> orgmode developers and power-users,

Macros, links, derived back-ends -- so many ways to achieve what you
want.  Here is another:

@@html:@@bold text@@html:@@

#+HTML: Literal HTML code for export

#+BEGIN_HTML
 All lines between these markers are exported literally
#+END_HTML

For pdf export via LaTeX there are @@latex, #+LATEX, and #+BEGIN_LATEX
... #+END_LATEX.

hth,
Tom

-- 
Thomas S. Dye
http://www.tsdye.com



Re: [O] Custom formatting during export

2014-09-03 Thread Julian Gehring

Hi Gabe,

Macro replacements [[http://orgmode.org/manual/Macro-replacement.html]] 
should be what you are looking for.


For example, the macro

#+MACRO: pkg  $1

would be called by

{{{pkg(PkgName)}}}

You can also use this to format your input for one or multiple backends

#+MACRO: M @@latex:\$1{@@$2@@latex:}@@

Let me know if this helps.

Best
Julian


On 03.09.2014 06:36, Gabe Becker wrote:

orgmode developers and power-users,

I'd like to be able to declare custom entities (apologies if I'm using
that term incorrectly) within the text of an orgmode document which I
can specify custom formatting for when my .org is exported, e.g. to PDF
or HTML.

I have a background in Docbook, so the analogue there would be defining
a custom xml tag and then extending the XSL files to handle it as
desired. Please see the following snippet:


* section title
Here is some text, but I want [specialthing: this bit here] to be
formatted differently than [newanddifferent: this other big over here].


Where I would have defined specific custom formatting rules for
"specialthing" and "newanddifferent" type entities.

Is there a way to do this in orgmode? If not, it seems like it would be
a very useful feature (at least to me:) ). Note: I don't care about the
syntax as long as the result is the same.

Thanks for your help,
~G
--
Computational Biologist
Genentech Research




Re: [O] Custom formatting during export

2014-09-03 Thread Richard Lawrence
Hi Gabe,

Gabe Becker  writes:

> * section title
>
> Here is some text, but I want [specialthing: this bit here] to be formatted
> differently than [newanddifferent: this other big over here].
>
>
> Where I would have defined specific custom formatting rules for
> "specialthing" and "newanddifferent" type entities.
>
> Is there a way to do this in orgmode? If not, it seems like it would be a
> very useful feature (at least to me:) ). Note: I don't care about the
> syntax as long as the result is the same.

Based on the syntax you chose for your example, you might be looking for
custom link types; see the documentation for the org-add-link-type
function:
--
(org-add-link-type TYPE &optional FOLLOW EXPORT)

Add TYPE to the list of `org-link-types'.
Re-compute all regular expressions depending on `org-link-types'

FOLLOW and EXPORT are two functions.

FOLLOW should take the link path as the single argument and do whatever
is necessary to follow the link, for example find a file or display
a mail message.

EXPORT should format the link path for export to one of the export formats.
It should be a function accepting three arguments:

  paththe path of the link, the text after the prefix (like "http:")
  descthe description of the link, if any, or a description added by
  org-export-normalize-links if there is none
  format  the export format, a symbol like `html' or `latex' or `ascii'..

The function may use the FORMAT information to return different values
depending on the format.  The return value will be put literally into
the exported file.  If the return value is nil, this means Org should
do what it normally does with links which do not have EXPORT defined.
--

You could define a custom link type for "specialthing", and then use the
export parameter to provide a function that will export the path 
of the link in a backend-specific way.  Then you would write

blah blah [[specialthing:whatever-path]] blah blah 

I'm sure there are good examples of how to do this on Worg, but I cannot
seem to find them at the moment...

If you need to do something more complicated than what custom link types
allow, Thorsten's suggestions are the place to start: Org has a lot of
ways to customize export output.
 
Best,
Richard




[O] graphics for html and latex / pdf export?

2014-09-03 Thread Rainer M Krug
Hi

I know this has been asked before, but I can't find it...

I would like to export a document which contains graphs generated in R
as html as well as latex / pdf. For LaTeX, I use output format pdf,
d=which does not work as inline picture for html export. How can I
automate the process, that all graphs which are included in org as e.g.

--8<---cut here---start->8---
#+begin_src R :file graph.pdf :results graphics
  plot(1,1)
#+end_src

#+RESULTS:
[[file:graph.pdf]]
--8<---cut here---end--->8---

are available for the html export as inline images (e.g. png)?

I remember some use of imagemagic? 

I could obviously do this manually in each code block, but I would
prefer a general solution, so that I can forget about it and it is working.

Thanks,

Rainer

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


pgpRSk6tr6uDG.pgp
Description: PGP signature


[O] Newlines in capture templates

2014-09-03 Thread Carlos Pita
Hi all,

I would like to separate the items in my capture files by a number of
newlines, as in:

** item 1

content 1

** item 2

content 2

** item 3

content 3

instead of:

** item 1

content 1
** item 2

content 2
** item 3

content 3

But org is removing the heading and trailing \n from my templates. Is
there any way to avoid this, or to command org to automatically include
newlines between captures?

Thank you in advance
--
Carlos







[O] Tangling from code block and header arguments WAS: Format output of org-babel-tangle for exported file

2014-09-03 Thread Rainer M Krug
Charles Berry  writes:

> Rainer M Krug  krugs.de> writes:
>
>> 
>> Hi
>> 
>> I am calling (org-bable-tangle) in a code block in an org file and I
>> would show the files resulting from the tangling in a nice format.
>> 
>> But I do not manage. I have the following at the moment:
>> 
>> --8<---cut here---start->8---
>> #+begin_src emacs-lisp 
>> (replace-regexp-in-string "[)\"]" ""
>>  (replace-regexp-in-string "[(]" "- "
>>   (replace-regexp-in-string " " "\n- "
>>(prin1-to-string (org-babel-tangle)
>> #+end_src
>> 
>
> [snip]
>
>> Which is neither elegant nor short, and I am sure I could do this
>> easier. Any suggestions?
>
> Something like this? Possibly with `(reverse (org-babel-tangle))'
>
> #+BEGIN_SRC emacs-lisp :results value
> (mapconcat (lambda (x) (file-relative-name x "..")) (org-babel-tangle) "\n")
> #+END_SRC

Thanks - this looks promising.

But I now have another problem: The result of tangling from a code block
is different then when calling interactively.

Consider the following org file:

--8<---cut here---start->8---
#+PROPERTY: header-args :tangle no

* DESCRIPTION File
:PROPERTIES:
:header-args+: :tangle ./DESCRIPTION
:END:

#+begin_src RDescr
test
#+end_src

* And the tangling
#+BEGIN_SRC emacs-lisp :results value
(mapconcat (lambda (x) (file-relative-name x "..")) (org-babel-tangle) "\n")
#+END_SRC

#+RESULTS:

--8<---cut here---end--->8---

When tangling interactively, the file DESCRIPTION is tangled properly.
But when I call (org-babel-tangle) from the code block, nothing is
tangled because in this case, the property =tangle= is equal to =no=
based on the file wide property setting in the beginning.

Is this a bug or is it simply not possible to tangle from a code block?

Thanks,

Rainer

>
>
> HTH,
>
> Chuck
>
>
>
>

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


pgpcwdLqoTezq.pgp
Description: PGP signature


Re: [O] Custom formatting during export

2014-09-03 Thread Thorsten Jolitz
Gabe Becker  writes:

> orgmode developers and power-users,
>
> I'd like to be able to declare custom entities (apologies if I'm using
> that term incorrectly) within the text of an orgmode document which I
> can specify custom formatting for when my .org is exported, e.g. to
> PDF or HTML.
>
> I have a background in Docbook, so the analogue there would be
> defining a custom xml tag and then extending the XSL files to handle
> it as desired. Please see the following snippet:
>
> * section title
> Here is some text, but I want [specialthing: this bit here] to be
> formatted differently than [newanddifferent: this other big over
> here].
>
> Where I would have defined specific custom formatting rules for
> "specialthing" and "newanddifferent" type entities.
>
> Is there a way to do this in orgmode? If not, it seems like it would
> be a very useful feature (at least to me:) ). Note: I don't care about
> the syntax as long as the result is the same.

After an org buffer is parsed, the complete document is available as
nested list (parse tree), containing org elements and objects:

,[ C-h v org-element-all-elements RET ]
| org-element-all-elements is a variable defined in `org-element.el'.
| Its value is (babel-call center-block clock comment comment-block
| diary-sexp drawer dynamic-block example-block fixed-width
| footnote-definition headline horizontal-rule inlinetask item keyword
| latex-environment node-property paragraph plain-list planning
| property-drawer quote-block section special-block src-block table
| table-row verse-block)
| 
| Documentation: Complete list of element types.
`

,[ C-h v org-element-all-objects RET ]
| org-element-all-objects is a variable defined in `org-element.el'.
| Its value is (bold code entity export-snippet footnote-reference
| inline-babel-call inline-src-block italic line-break latex-fragment
| link macro radio-target statistics-cookie strike-through subscript
| superscript table-cell target timestamp underline verbatim)
| 
| Documentation:
| Complete list of object types.
`

The exporters have complete access to these elements, and define
dedicated functions for transforming each of them to the output format
(LATEX, HTML ...). 

So if you want latex output, but special treatment for a few elements,
the way to go is to define a new export backend that derives from latex:

,[ C-h f org-export-define-derived-backend RET ]
| org-export-define-derived-backend is a compiled Lisp function in
| `ox.el'.
| 
| (org-export-define-derived-backend CHILD PARENT &rest BODY)
| 
| Create a new back-end as a variant of an existing one.
| 
| CHILD is the name of the derived back-end.  PARENT is the name of
| the parent back-end.
| 
| BODY can start with pre-defined keyword arguments.  The following
| keywords are understood:
| 
|   :export-block
| 
| String, or list of strings, representing block names that
| will not be parsed.  This is used to specify blocks that will
| contain raw code specific to the back-end.  These blocks
| still have to be handled by the `special-block' type
| translator.
| 
|   :filters-alist
| 
| Alist of filters that will overwrite or complete filters
| defined in PARENT back-end.  See `org-export-filters-alist'
| for a list of allowed filters.
| 
|   :menu-entry
| 
| Menu entry for the export dispatcher.  See
| `org-export-define-backend' for more information about the
| expected value.
| 
|   :options-alist
| 
| Alist of back-end specific properties that will overwrite or
| complete those defined in PARENT back-end.  Refer to
| `org-export-options-alist' for more information about
| structure of the values.
| 
|   :translate-alist
| 
| Alist of element and object types and transcoders that will
| overwrite or complete transcode table from PARENT back-end.
| Refer to `org-export-define-backend' for detailed information
| about transcoders.
| 
| As an example, here is how one could define "my-latex" back-end
| as a variant of `latex' back-end with a custom template function:
| 
|   (org-export-define-derived-backend 'my-latex 'latex
|  :translate-alist '((template . my-latex-template-fun)))
| 
| The back-end could then be called with, for example:
| 
|   (org-export-to-buffer 'my-latex "*Test my-latex*")
`

-- 
cheers,
Thorsten




[O] Custom formatting during export

2014-09-03 Thread Gabe Becker
orgmode developers and power-users,

I'd like to be able to declare custom entities (apologies if I'm using that
term incorrectly) within the text of an orgmode document which I can
specify custom formatting for when my .org is exported, e.g. to PDF or HTML.

I have a background in Docbook, so the analogue there would be defining a
custom xml tag and then extending the XSL files to handle it as desired.
Please see the following snippet:


* section title

Here is some text, but I want [specialthing: this bit here] to be formatted
differently than [newanddifferent: this other big over here].


Where I would have defined specific custom formatting rules for
"specialthing" and "newanddifferent" type entities.

Is there a way to do this in orgmode? If not, it seems like it would be a
very useful feature (at least to me:) ). Note: I don't care about the
syntax as long as the result is the same.

Thanks for your help,
~G
-- 
Computational Biologist
Genentech Research


Re: [O] Format output of org-babel-tangle for exported file

2014-09-03 Thread Charles Berry
Rainer M Krug  krugs.de> writes:

> 
> Hi
> 
> I am calling (org-bable-tangle) in a code block in an org file and I
> would show the files resulting from the tangling in a nice format.
> 
> But I do not manage. I have the following at the moment:
> 
> --8<---cut here---start->8---
> #+begin_src emacs-lisp 
> (replace-regexp-in-string "[)\"]" ""
>  (replace-regexp-in-string "[(]" "- "
>   (replace-regexp-in-string " " "\n- "
>(prin1-to-string (org-babel-tangle)
> #+end_src
> 

[snip]

> Which is neither elegant nor short, and I am sure I could do this
> easier. Any suggestions?

Something like this? Possibly with `(reverse (org-babel-tangle))'

#+BEGIN_SRC emacs-lisp :results value
(mapconcat (lambda (x) (file-relative-name x "..")) (org-babel-tangle) "\n")
#+END_SRC


HTH,

Chuck





Re: [O] Getting lots of Emacs crashes

2014-09-03 Thread Doug Lewan
> -Original Message-
> Behalf Of Noah Slater
> Sent: Monday, 2014 September 01 16:06
> To: emacs-orgmode
> Subject: [O] Getting lots of Emacs crashes
> 
> Hello,
> 
> I'm getting a lot of Emacs crashes recently using Org. Is there any
> way I can help to debug why this is happening?

Noah,

You might consider running emacs under a debugger. It will trap the crash and 
then you can ask where it happened, i.e. a stack trace. The information might 
be of more interest to an emacs developer than to you.

GNU software should not crash. From the emacs info (a description of a typical 
crash):
If Emacs accesses an invalid memory location ("segmentation fault"), or
exits with an operating system error message that indicates a problem
in the program (as opposed to something like "disk full"), then it is
certainly a bug.
The stack trace (along with all the other information that belongs in a bug 
report) can be very helpful.

,Doug
Douglas Lewan
Shubert Ticketing
(201) 489-8600 ext 224 or ext 4335

"This is a slow pup," he said continuing his ascent.


[O] Bug: (org-babel-result-names) should not return nil [8.2.7c (8.2.7c-1-gf5065b-elpa @ c:/Users/andrea/AppData/Roaming/.emacs.d/elpa/org-20140804/)]

2014-09-03 Thread Andrea Rossetti

Hello everyone,

  if I create this org example: 

#+NAME: blah
#+BEGIN_SRC emacs-lisp :exports results
  (+ 2 3)
#+END_SRC

#+RESULTS: blah
: 5


  I can't execute the command

M-x org-babel-goto-named-result RET blah RET

  because "blah" is not listed in the available
choices.

  The problem seems to boil down to this function:

M-S-; (org-babel-result-names) RET

  I would expect two results in the message mode line,
but I only get a nil. 

  I explored function org-babel-result-names in ob-core.el,
the body contains a (match-string 4) but I believe it
should be changed into (match-string 6).

  If I apply that change, (org-babel-result-names) returns
two results, and org-babel-goto-named-result provides the
expected choice (just "blah" in the example).

  Is it reproducible for you as well? Does it make sense
for you too? Kindest regards,

Andrea


Re: [O] Format output of org-babel-tangle for exported file

2014-09-03 Thread Rainer M Krug

Some further information, as I just realized that it is not working:
In the message buffer I get the following output:
,
| executing Emacs-Lisp code block...
| Saving file 
/Users/rainerkrug/Documents/Projects/IFN/ProductivityMixedStands/prodMixStands.org...
| Wrote 
/Users/rainerkrug/Documents/Projects/IFN/ProductivityMixedStands/prodMixStands.org
| Wrote 
/Users/rainerkrug/Documents/Projects/IFN/ProductivityMixedStands/prodMixStands.R
 [7 times]
| Wrote 
/Users/rainerkrug/Documents/Projects/IFN/ProductivityMixedStands/R/initializeAnalysis.R
 [8 times]
| Wrote 
/Users/rainerkrug/Documents/Projects/IFN/ProductivityMixedStands/R/loadIFN.R
| Wrote 
/Users/rainerkrug/Documents/Projects/IFN/ProductivityMixedStands/R/loadIFNcompetition.R
| Wrote 
/Users/rainerkrug/Documents/Projects/IFN/ProductivityMixedStands/R/loadIFNqmd.R
| Wrote 
/Users/rainerkrug/Documents/Projects/IFN/ProductivityMixedStands/R/loadIFNstl.R
| Wrote 
/Users/rainerkrug/Documents/Projects/IFN/ProductivityMixedStands/R/selectPlotsVallet.R
| Wrote 
/Users/rainerkrug/Documents/Projects/IFN/ProductivityMixedStands/R/plot.frontier.R
| Wrote /Users/rainerkrug/Documents/Projects/IFN/ProductivityMixedStands/R/SDI.R
| Wrote 
/Users/rainerkrug/Documents/Projects/IFN/ProductivityMixedStands/prodMixStands.R
 [11 times]
| Wrote 
/Users/rainerkrug/Documents/Projects/IFN/ProductivityMixedStands/prodMixStands.RDescr
| Wrote 
/Users/rainerkrug/Documents/Projects/IFN/ProductivityMixedStands/prodMixStands.makefile
 [7 times]
| Wrote 
/Users/rainerkrug/Documents/Projects/IFN/ProductivityMixedStands/prodMixStands.el
 [7 times]
| Tangled 48 code blocks from prodMixStands.org
| Wrote 
/Users/rainerkrug/Documents/Projects/IFN/ProductivityMixedStands/prodMixStands.RDescr
| Wrote /Users/rainerkrug/Documents/Projects/IFN/ProductivityMixedStands/R/SDI.R
| Wrote 
/Users/rainerkrug/Documents/Projects/IFN/ProductivityMixedStands/R/plot.frontier.R
| Wrote 
/Users/rainerkrug/Documents/Projects/IFN/ProductivityMixedStands/R/selectPlotsVallet.R
| Wrote 
/Users/rainerkrug/Documents/Projects/IFN/ProductivityMixedStands/R/loadIFNstl.R
| Wrote 
/Users/rainerkrug/Documents/Projects/IFN/ProductivityMixedStands/R/loadIFNqmd.R
| Wrote 
/Users/rainerkrug/Documents/Projects/IFN/ProductivityMixedStands/R/loadIFNcompetition.R
| Wrote 
/Users/rainerkrug/Documents/Projects/IFN/ProductivityMixedStands/R/loadIFN.R
| Wrote 
/Users/rainerkrug/Documents/Projects/IFN/ProductivityMixedStands/R/initializeAnalysis.R
| Wrote 
/Users/rainerkrug/Documents/Projects/IFN/ProductivityMixedStands/prodMixStands.R
| Code block evaluation complete.
`

So not all files tangled are passed on in the script (I assume because
of the length?). In addition, not all files resulting from the tangling
are in the message buffer (I am tangling a ./DESCRIPTION file as well).

How can I get all names resulting from the tangling in the results block
of the code block?

Rainer


Rainer M Krug  writes:

> Hi
>
> I am calling (org-bable-tangle) in a code block in an org file and I
> would show the files resulting from the tangling in a nice format.
>
> But I do not manage. I have the following at the moment:
>
> #+begin_src emacs-lisp 
> (replace-regexp-in-string "[)\"]" ""
>  (replace-regexp-in-string "[(]" "- "
>   (replace-regexp-in-string " " "\n- "
>(prin1-to-string (org-babel-tangle)
> #+end_src
>
> #+RESULTS:
> #+begin_example
> - 
> /Users/rainerkrug/Documents/Projects/IFN/ProductivityMixedStands/prodMixStands.el
> - 
> /Users/rainerkrug/Documents/Projects/IFN/ProductivityMixedStands/prodMixStands.makefile
> - 
> /Users/rainerkrug/Documents/Projects/IFN/ProductivityMixedStands/prodMixStands.RDescr
> - ./R/SDI.R
> - ./R/plot.frontier.R
> - ./R/selectPlotsVallet.R
> - ./R/loadIFNstl.R
> - ./R/loadIFNqmd.R
> - ./R/loadIFNcompetition.R
> - ./R/loadIFN.R
> - ./R/initializeAnalysis.R
> - 
> /Users/rainerkrug/Documents/Projects/IFN/ProductivityMixedStands/prodMixStands.R
> #+end_example
>
> Which is neither elegant nor short, and I am sure I could do this
> easier. Any suggestions?
>
> Rainer

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


pgpFCXBj6dBWB.pgp
Description: PGP signature


Re: [O] Unit conversions and symbolic mathematics with Babel

2014-09-03 Thread Brett Viren
Hi,

die...@duenenhof-wilhelm.de (H. Dieter Wilhelm) writes:

>   But what is missing is to assign variables within a source block
>   
> #+BEGIN_SRC calc :var L1 = "5 mm" 
> L2 := cvun( L1, m)
> #+END_SRC
>   
>   Unfortunately this is not working.  Do you have an idea how to
>   implement this?
>
> - Are you using (better) alternatives?

I like Python and in Python I like Pint for units.

  http://pint.readthedocs.org

Below is an example org document that should "run" and shows a couple
ways to use snippets of Pint code to do unit conversion.  Not shown but
Pint Quantity objects support arithmetic so are useful for carrying
units through some calculation.

For assigning to variables - presumably for use in later blocks - maybe
you can investigate using the :session header argument to source blocks.


Have fun,
-Brett.

One way to install Pint is:

#+BEGIN_SRC sh :results silent
  pip install --user pint
#+END_SRC

Here is an example:

#+name: uconv
#+header: :var val="10m" :var unit="inch" 
#+BEGIN_SRC python
  import pint
  units = pint.UnitRegistry()
  return units.Quantity(val).to(unit)
#+END_SRC

#+RESULTS: uconv
: 393.700787402 inch

Now call =uconv= do to some other conversion:

#+call: uconv("2.54cm","inch")

#+RESULTS:
: 1.0 inch


pgpGnSjfoKUX4.pgp
Description: PGP signature


[O] Format output of org-babel-tangle for exported file

2014-09-03 Thread Rainer M Krug
Hi

I am calling (org-bable-tangle) in a code block in an org file and I
would show the files resulting from the tangling in a nice format.

But I do not manage. I have the following at the moment:

--8<---cut here---start->8---
#+begin_src emacs-lisp 
(replace-regexp-in-string "[)\"]" ""
 (replace-regexp-in-string "[(]" "- "
  (replace-regexp-in-string " " "\n- "
   (prin1-to-string (org-babel-tangle)
#+end_src

#+RESULTS:
#+begin_example
- 
/Users/rainerkrug/Documents/Projects/IFN/ProductivityMixedStands/prodMixStands.el
- 
/Users/rainerkrug/Documents/Projects/IFN/ProductivityMixedStands/prodMixStands.makefile
- 
/Users/rainerkrug/Documents/Projects/IFN/ProductivityMixedStands/prodMixStands.RDescr
- ./R/SDI.R
- ./R/plot.frontier.R
- ./R/selectPlotsVallet.R
- ./R/loadIFNstl.R
- ./R/loadIFNqmd.R
- ./R/loadIFNcompetition.R
- ./R/loadIFN.R
- ./R/initializeAnalysis.R
- 
/Users/rainerkrug/Documents/Projects/IFN/ProductivityMixedStands/prodMixStands.R
#+end_example
--8<---cut here---end--->8---

Which is neither elegant nor short, and I am sure I could do this
easier. Any suggestions?

Rainer

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


pgpa8eG02qwfx.pgp
Description: PGP signature


Re: [O] Moving my init.el to Org

2014-09-03 Thread Rainer M Krug
Oleh  writes:

>>> I'm using a one .el file per mode approach, with around 4000 lines
>>> split into 40 files.
>>>
>>> This approach simplifies things a lot: for instance I haven't touched
>>> Javascript in ages, but all my customizations for it are sitting in
>>> javascript.el without getting in the way of the stuff that I'm using
>>> now. They aren't even loaded unless I open a js file.
>>
>> Interesting - is your configuration online, so that one could take a
>> look at it? I did not find them on your github page?
>
> It's not online since it's a hassle to put it up.

No problem.

>
>> Or how do you do it, that the e.g. javascript.el is only loaded when a
>> js file is opened? Because this is exactly what I would like to have.
>
> It's a three-part setup that goes like this.
> In hooks.el that's loaded unconditionally:
>
> ...
> (add-hook 'java-mode-hook 'oleh-java-hook)
> (add-hook 'tuareg-mode-hook 'oleh-tuareg-hook)
> (add-hook 'js-mode-hook 'oleh-javascript-hook)
> (add-hook 'markdown-mode-hook 'oleh-markdown-hook)
> ...
>
> In modes/javascript.el that's not loaded:
>
> ;;;###autoload
> (defun oleh-javascript-hook ()
>   (smart-insert-operator-hook)
>   (moz-minor-mode 1)
>   (define-key js-mode-map (kbd "") 'js-f5)
>   (define-key js-mode-map (kbd "C-") 'js-C-f5)
>   ...
>   )
>
> And this function generates the autoloads when a new file is added:
>
> ;;;###autoload
> (defun update-all-autoloads ()
>   (interactive)
>   (let ((generated-autoload-file (concat emacs.d "loaddefs.el")))
> (when (not (file-exists-p generated-autoload-file))
>   (with-current-buffer (find-file-noselect generated-autoload-file)
> (insert ";;") ;; create the file with non-zero size to
> appease autoload
> (save-buffer)))
> (mapcar #'update-directory-autoloads
> '("" "oleh" "oleh/modes" "matlab-emacs"
>
> The file loaddefs.el is loaded unconditionally as well.  So when a js
> file is opened, `js-mode-hook` is called and the autoloaded
> `oleh-javascript-hook` is called, making sure that
> "oleh/modes/javascript.el" is loaded.

Thanks - looks like an interesting approach which avoids having to use
use-package or req-package.

Thanks a lot for the info,

Rainer
 

>
> regards,
> Oleh
>
>

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


pgpdAVhkrdMG4.pgp
Description: PGP signature


Re: [O] Moving my init.el to Org

2014-09-03 Thread Oleh
>> I'm using a one .el file per mode approach, with around 4000 lines
>> split into 40 files.
>>
>> This approach simplifies things a lot: for instance I haven't touched
>> Javascript in ages, but all my customizations for it are sitting in
>> javascript.el without getting in the way of the stuff that I'm using
>> now. They aren't even loaded unless I open a js file.
>
> Interesting - is your configuration online, so that one could take a
> look at it? I did not find them on your github page?

It's not online since it's a hassle to put it up.

> Or how do you do it, that the e.g. javascript.el is only loaded when a
> js file is opened? Because this is exactly what I would like to have.

It's a three-part setup that goes like this.
In hooks.el that's loaded unconditionally:

...
(add-hook 'java-mode-hook 'oleh-java-hook)
(add-hook 'tuareg-mode-hook 'oleh-tuareg-hook)
(add-hook 'js-mode-hook 'oleh-javascript-hook)
(add-hook 'markdown-mode-hook 'oleh-markdown-hook)
...

In modes/javascript.el that's not loaded:

;;;###autoload
(defun oleh-javascript-hook ()
  (smart-insert-operator-hook)
  (moz-minor-mode 1)
  (define-key js-mode-map (kbd "") 'js-f5)
  (define-key js-mode-map (kbd "C-") 'js-C-f5)
  ...
  )

And this function generates the autoloads when a new file is added:

;;;###autoload
(defun update-all-autoloads ()
  (interactive)
  (let ((generated-autoload-file (concat emacs.d "loaddefs.el")))
(when (not (file-exists-p generated-autoload-file))
  (with-current-buffer (find-file-noselect generated-autoload-file)
(insert ";;") ;; create the file with non-zero size to
appease autoload
(save-buffer)))
(mapcar #'update-directory-autoloads
'("" "oleh" "oleh/modes" "matlab-emacs"

The file loaddefs.el is loaded unconditionally as well.  So when a js
file is opened, `js-mode-hook` is called and the autoloaded
`oleh-javascript-hook` is called, making sure that
"oleh/modes/javascript.el" is loaded.

regards,
Oleh



Re: [O] Command to open up any agenda file?

2014-09-03 Thread Eric S Fraga
On Monday,  1 Sep 2014 at 22:11, Thorsten Jolitz wrote:

[...]

> don't know if this exists in Org, but defining you agenda-files as a
> project you might be able to use projectile:

Thorsten,

Thanks for the heads up on projectile.  I'd forgotten about this
package.  I've now installed it and it's excellent.  And, for the OP, it
does work well with my agenda files as they are a separate project under
git!

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.4.50.1, Org release_8.3beta-309-gd4e4b1



Re: [O] navi equivalent to 'g' speed command?

2014-09-03 Thread Thorsten Jolitz
Alan Schmitt  writes:

> On 2014-09-03 09:18, Thorsten Jolitz  writes:
>
>> Alan Schmitt  writes:
>>
>> Hello,
>>
>>> I very often use the org speed command 'g' to navigate to a headline
>>> (it opens a completion buffer that I can use to quickly fuzzy match the
>>> target). Is there an equivalent navi workflow for non-org buffer in
>>> outshine mode?
>>
>> Hmm... which command do you mean? I get
>>
>> ,
>> | User-defined Speed commands
>> | ===
>> | 
>> | Built-in Speed commands
>> | ===
>> | 
>> | Outline Navigation
>> | --
>> | [...]
>> | g   (org-refile t)
>> `
>>
>> but thats not the one you are talking about, right?
>
> Yes, it's the one I mean. Don't let the "refile" fool you: the 't'
> argument means nothing is actually refiled during the jump to the
> target. I use it all the time.

ok, it seems 'outshine-refile does works, but I'm not sufficiently used
to it - it actually refiles the outshine headers I'm on, but that seems
to be a configuration thing. 

I could expand 

#+BEGIN_SRC emacs-lisp
(defun outshine-refile ()
  "Call outorg to trigger `org-refile'."
  (interactive)
  (outshine-use-outorg 'org-refile))
#+END_SRC

to something like

#+BEGIN_SRC emacs-lisp
(defun outshine-refile (&optional arg)
  "Call outorg to trigger `org-refile'."
  (interactive "P")
  (if arg
 (outshine-use-outorg 'org-refile nil nil t)
(outshine-use-outorg 'org-refile)))
#+END_SRC

to match you use case, but I think what you really want is


,[ C-h f outshine-imenu RET ]
| outshine-imenu is an interactive Lisp function in `outshine.el'.
| 
| It is bound to M-# M-p.
| 
| (outshine-imenu &optional PREFER-IMENU-P)
| 
| Convenience function for calling imenu/idomenu from outshine.
`

with idomenu installed from the package manager. 

-- 
cheers,
Thorsten




Re: [O] navi equivalent to 'g' speed command?

2014-09-03 Thread Thorsten Jolitz
Thorsten Jolitz  writes:

> Alan Schmitt  writes:
>
> Hello,
>
>> I very often use the org speed command 'g' to navigate to a headline
>> (it opens a completion buffer that I can use to quickly fuzzy match the
>> target). Is there an equivalent navi workflow for non-org buffer in
>> outshine mode?
>
> Hmm... which command do you mean? I get

> | g   (org-refile t)
> `
>
> but thats not the one you are talking about, right?

I just tried it out - this 

,
| g  (org-refile t)
`

works in Outshine like in Org when using the tj-outshine branch from the
github repo, assuming you have

,
| (setq outshine-use-speed-commands t)
`

in you init file. 

All 3 libs (outshine, outorg and navi-mode) have developed quite a bit
recently, but I want to include better tests for outorg and implement
most of Org-mode's user API (like e.g. org-refile) via the
`outshine-use-outorg' function before I merge the tj-outshine, tj-outorg
and tj-navi branches into their repective masters.

Maybe you could switch to the git-versions? Would be great for me to
have the development branches tested by somebody else, and you would get
the `outshine-use-outorg' functionality, which (in theory at least)
allows to call any Org command from Outshine. In the real world some
commands work out of the box (e.g. org-refile and org-priority), but
others would need some special handling (i.e. clocking with outshine
headers works only 'more-or-less').

There are so many Org commands, it will take some time to check if they
make sense in Outshine too, if they work out of the box or need some
extra hacking. But with the development version of outshine, one can
simply try if something like this works without any extra effort:

#+BEGIN_SRC emacs-lisp
(defun outshine-priority ()
  "Call outorg to trigger `org-priority'."
  (interactive)
  (outshine-use-outorg 'org-priority))
#+END_SRC

-- 
cheers,
Thorsten




Re: [O] navi equivalent to 'g' speed command?

2014-09-03 Thread Alan Schmitt
On 2014-09-03 09:18, Thorsten Jolitz  writes:

> Alan Schmitt  writes:
>
> Hello,
>
>> I very often use the org speed command 'g' to navigate to a headline
>> (it opens a completion buffer that I can use to quickly fuzzy match the
>> target). Is there an equivalent navi workflow for non-org buffer in
>> outshine mode?
>
> Hmm... which command do you mean? I get
>
> ,
> | User-defined Speed commands
> | ===
> | 
> | Built-in Speed commands
> | ===
> | 
> | Outline Navigation
> | --
> | [...]
> | g   (org-refile t)
> `
>
> but thats not the one you are talking about, right?

Yes, it's the one I mean. Don't let the "refile" fool you: the 't'
argument means nothing is actually refiled during the jump to the
target. I use it all the time.

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7


signature.asc
Description: PGP signature


Re: [O] Unit conversions and symbolic mathematics with Babel

2014-09-03 Thread Eric Abrahamsen
die...@duenenhof-wilhelm.de (H. Dieter Wilhelm) writes:

> Hello Org,
>
> for some engineering most often I need estimations with unit
> conversions, Emacs Calc is perfect for this.
>
> When it comes to reporting and documentation I'd like to do it with
> org-mode, of course.  For numerical stuff and visualisation purposes I'm
> using already R and TikZ. But for unit conversions and symbolic maths
> I'm in a bind when trying to do this with free programs.

If you're on a linux of some sort, you probably have the "units" command
line program installed. That's sort of the mother of all unit
converters, as far as I'm concerned -- you could call out to it and
return the results. What do you think?

> - R :: Do you have experience with a units packages under the R-project?
>   What I've seen so far is not so reassuring...
>
> - Maxima :: I think there is a nice and intuitive units package for
>   maxima.  But this would mean learning an additional tool and mentally
>   switching between both within one document.
>
> - Calc :: I'd prefer to do it with Calc but the Babel interface is
>   (yet?) restricted
>
>   For example, I can define functions and do some unit conversions:
>
> #+BEGIN_SRC emacs-lisp
> (defmath cvun(a b)
> (math-convert-units a b))
> #+END_SRC
>
>
> #+RESULTS:
> : calcFunc-cvun
>
> #+BEGIN_SRC calc :var L1 = "5 mm" 
> cvun( L1, m)
> #+END_SRC
>
>
> #+RESULTS:
> : 5e-3 m
>
>   But what is missing is to assign variables within a source block
>   
>
> #+BEGIN_SRC calc :var L1 = "5 mm" 
> L2 := cvun( L1, m)
> #+END_SRC
>
>   
>   Unfortunately this is not working.  Do you have an idea how to
>   implement this?
>
> - Are you using (better) alternatives?
>
> Thanks for your insights
>
>Dieter




Re: [O] navi equivalent to 'g' speed command?

2014-09-03 Thread Thorsten Jolitz
Alan Schmitt  writes:

Hello,

> I very often use the org speed command 'g' to navigate to a headline
> (it opens a completion buffer that I can use to quickly fuzzy match the
> target). Is there an equivalent navi workflow for non-org buffer in
> outshine mode?

Hmm... which command do you mean? I get

,
| User-defined Speed commands
| ===
| 
| Built-in Speed commands
| ===
| 
| Outline Navigation
| --
| [...]
| g   (org-refile t)
`

but thats not the one you are talking about, right?

-- 
cheers,
Thorsten




Re: [O] Unit conversions and symbolic mathematics with Babel

2014-09-03 Thread Alan Schmitt
On 2014-09-03 08:54, die...@duenenhof-wilhelm.de (H. Dieter Wilhelm) writes:

>   But what is missing is to assign variables within a source block
>   
>
> #+BEGIN_SRC calc :var L1 = "5 mm" 
> L2 := cvun( L1, m)
> #+END_SRC
>
>   
>   Unfortunately this is not working.  Do you have an idea how to
>   implement this?

It seems that you could use block chaining. Here is an extract of some
code I use to compute stats for my book keeping:

#+name: monthly_average
#+begin_src emacs-lisp :var starty=2014 :var startm=3 :var amount=100 
  (let* ((tm (decode-time))
 (cmonth (nth 4 tm))
 (cyear (nth 5 tm))
 (nbmonths (+ (* 12 (- cyear starty)) (- cmonth startm
(calc-eval "round($ / $$, 2)" nil amount nbmonths))
#+end_src

#+name: ledger_average
#+begin_src emacs-lisp :var b="Quotidien" :var sy=2014 :var sm=3  :var 
sd="2014-03-01" :var p="Expenses:"
  (let* ((per (format "from %d-%d-01 to this month" sy sm))
 (a (org-sbe call_ledger (bucket (eval b)) (prefix (eval p)) (period 
(eval per)
(org-sbe monthly_average (amount (eval a)) (starty (eval sy)) (startm (eval 
sm
#+end_src

The last line of the second block calls the first block to do its
computation. The first block does not have to be in emacs-lisp, but
I don't know calc well enough to do it directly in calc.

Best,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7


signature.asc
Description: PGP signature


Re: [O] Normalizing tags

2014-09-03 Thread Christian Moe

Brett Witty writes:

> Hi,
>
> Has anyone made a module to normalize tags across your entire setup?

Not that I know of.

> That is if you have "Blog" and "blog" as tags, then you fix it as one
> or the other, or "hint" and "tip" tags being collapsed.
>
> If not, would people be interested in that?

There may not be a lot of demand for it since tags are bounded by colons
and can be easily search-replaced. Of course, a function that flags up
all the possible duplicates and queries you for the preferred form could
be a time-saver.

If you're planning to write one: 

In addition to capitalization ("Blog"/"blog"), it would be useful to
look for English singular/plural ("blog"/"blogs") -- but let the user
beware ("aid" and "aids" may not be the same tag).

People tagging their documents in other languages might find some kind
of pattern-matching option helpful.

What I would find *really* nice, now that Org supports tag groups, is a
function to normalize old documents where entries are tagged with both a
group tag and its members. That is, given

  #+TAGS: { music : classical rock folk }

and a heading like 

  * Woody Guthrie  :music:American:folk:

the function would remove the redundant group tag to yield

  * Woody Guthrie  :American:folk:

Yours,
Christian



Re: [O] [Babel] Source block highlighting in Beamer ...

2014-09-03 Thread Alan Schmitt
On 2014-09-02 20:19, aditya siram  writes:

> Hi all,
> How do I get code on my beamer slides to print with color and
> highlighting? I'm doing the standard:
>
> #+BEGIN_SRC blah
> 
> #+END_SRC
>
> but all my source blocks come out the same.

First have a look at the generated tex: what environment is used for
these blocks?

You can then have a look at
http://orgmode.org/manual/Literal-examples.html#fn-1 :

> Fontified code chunks in LaTeX can be achieved using either the
> listings or the minted package. Refer to org-latex-listings
> documentation for details.

I personally use minted.

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7


signature.asc
Description: PGP signature


[O] Unit conversions and symbolic mathematics with Babel

2014-09-03 Thread H. Dieter Wilhelm
Hello Org,

for some engineering most often I need estimations with unit
conversions, Emacs Calc is perfect for this.

When it comes to reporting and documentation I'd like to do it with
org-mode, of course.  For numerical stuff and visualisation purposes I'm
using already R and TikZ. But for unit conversions and symbolic maths
I'm in a bind when trying to do this with free programs.

- R :: Do you have experience with a units packages under the R-project?
  What I've seen so far is not so reassuring...

- Maxima :: I think there is a nice and intuitive units package for
  maxima.  But this would mean learning an additional tool and mentally
  switching between both within one document.

- Calc :: I'd prefer to do it with Calc but the Babel interface is
  (yet?) restricted

  For example, I can define functions and do some unit conversions:

#+BEGIN_SRC emacs-lisp
(defmath cvun(a b)
  (math-convert-units a b))
#+END_SRC

#+RESULTS:
: calcFunc-cvun

#+BEGIN_SRC calc :var L1 = "5 mm" 
cvun( L1, m)
#+END_SRC

#+RESULTS:
: 5e-3 m

  But what is missing is to assign variables within a source block
  
#+BEGIN_SRC calc :var L1 = "5 mm" 
L2 := cvun( L1, m)
#+END_SRC
  
  Unfortunately this is not working.  Do you have an idea how to
  implement this?

- Are you using (better) alternatives?

Thanks for your insights

   Dieter
-- 
Best wishes
H. Dieter Wilhelm
Darmstadt, Germany




Re: [O] Getting lots of Emacs crashes

2014-09-03 Thread Thorsten Jolitz
Noah Slater  writes:

Hello,

> I'm getting a lot of Emacs crashes recently using Org. Is there any
> way I can help to debug why this is happening?

I managed to crash Emacs yesterday too, refiling an Org task. I was
pointed to this url with a recipe to extract usefull information from
the backtrace:

,
| https://www.gnu.org/software/emacs/manual/html_node/emacs/Crashing.html
`

It did not work in my case though, since I seem to have a 'stripped
binary' (I never heard that before), but if it works for you, you can send
the converted backtrace to emacs-bugs (M-x report-emacs-bug). 

-- 
cheers,
Thorsten