Re: [O] Bug: pdf page numbers in links are ignored when exporting to latex [8.2.7b (8.2.7b-13-gd8a0ee-elpa @ /home/moritz/.emacs.d/elpa/org-20140728/)]

2014-08-02 Thread Nicolas Goaziou
Hello,

Moritz Kiefer moritz.kie...@gmail.com writes:

 Hi, tried to fix those issues.

Applied. Thank you.


Regards,

-- 
Nicolas Goaziou



Re: [O] [RFC] Add commmand for wrapping sexp/region in src-blocks to Org?

2014-08-02 Thread Xebar Saram
Hi Thorsten and list

How are you?

small question. ive been using your amazing function daily last few days
and been lovin' it :)

i wonder if i could request a tiny related feature (this may be very easy
to do already).
i would like to assign hotkeys for 2 scenarios:

1) pre selected language for 1 line
2) pre selected language prompting for number of lines to wrap

so IE id assign F9-b to auto wrap current line with bash syntax while F9-l
would wrap in lisp
also F10-b would prompt me how man lines to wrap in bash etc

is that possible? thanks you again for all your wonderful work

kind regards

z



On Tue, Jul 29, 2014 at 6:36 PM, Thorsten Jolitz tjol...@gmail.com wrote:


 Hi List,

 I often missed the following command for wrapping existing content into
 src-blocks in the past, besides knowing about
 `org-babel-demarcate-block' and easy template insertion. Would it make
 sense to add it to Org-mode?

 I made it cover several use cases:

   - Wrap sexp at point - perfect when on first paren of a nested list,
 or when a string should be wrapped in a programming-mode, or a
 word in a text-mode.

   - Wrap region between point and +/- N lines forward/backward (very
 fast because no point movement is involved).

   - Wrap active region.

 Usage:

 1. wrap active region or (if none) sexp-at-point in emacs-lisp src-block

 ,
 | M-x org-wrap-in-src-block
 `

 2. wrap active region or (if none) sexp-at-point in src-block, prompt
user for Org-Babel language

 ,
 | C-u M-x org-wrap-in-src-block
 `

 3. prompt user for Org-Babel language and number of lines to wrap
 (forward or backward)

 ,
 | C-u C-u M-x org-wrap-in-src-block
 `


 #+begin_src emacs-lisp
 (defun org-wrap-in-src-block (optional lang lines)
   Wrap sexp-at-point or region in src-block.

 Use Org-Babel LANGuage for the src-block if given, Emacs-Lisp
 otherwise. A region instead of the sexp-at-point is wrapped if
 either

- optional argument LINES is an (positive or negative) integer
- or the region is active

 In the first case the region is determined by moving +/- LINES
 forward/backward from point using `forward-line', in the second
 case the active region is used.

 When called with prefix argument 'C-u', prompt the user for the
 Org-Babel language to use. When called with two prefix arguments
 'C-u C-u', prompt the user for both the Org-Babel language to use
 and the number of lines to be wrapped.
   (interactive
(cond
 ((equal current-prefix-arg nil) nil)
 ((equal current-prefix-arg '(4))
  (list
   (ido-completing-read Org-Babel language: 
(mapcar
 (lambda (--lang)
   (symbol-name (car --lang)))
 org-babel-load-languages)
nil nil nil nil emacs-lisp)))
 ((equal current-prefix-arg '(16))
  (list
   (ido-completing-read Org-Babel language: 
(mapcar
 (lambda (--lang)
   (symbol-name (car --lang)))
 org-babel-load-languages)
nil nil nil nil emacs-lisp)
   (read-number Number of lines to wrap:  1)
   (let* ((language (or lang emacs-lisp))
  (beg (or (and (not lines)
(region-active-p)
(region-beginning))
   (point)))
  (marker (save-excursion (goto-char beg) (point-marker)))
  (bol (save-excursion (goto-char beg) (bolp)))
  (end (cond
(lines (save-excursion
 (forward-line lines) (point)))
((region-active-p)(region-end))
(t (save-excursion
 (forward-sexp) (point)
  (cut-strg (buffer-substring beg end)))
 (delete-region beg end)
 (goto-char (marker-position marker))
 (insert
  (format
   %s#+begin_src %s\n%s%s#+end_src\n
   (if (or (and lines ( lines 0)) bol)  \n)
   language
   cut-strg
   (if lines  \n)))
 (set-marker marker nil)))
 #+end_src

 --
 cheers,
 Thorsten





Re: [O] Bug: html export of radio targets incorrect [8.2.7b (8.2.7b-1-ga5beff-elpa @ /home/vgrinshp/apps/share/emacs/24.3.50/lisp/org/)]

2014-08-02 Thread Nicolas Goaziou
Hello,

Vadim Grinshpun vgrin...@akamai.com writes:

 My org document has radiotargets where one target is contained within
 another as a substring. E.g., something like this:

   bar 
   foo_bar_baz

 When I try to export via HTML (process described below),
 the visible text of the links referring to these targets is mangled (as
 if interpreted twice).
 The resulting HTML of a radio target link to foo_bar_baz looks like this:
   a href=#foo_bar_bazfoo_lt;a href=#bargt;barlt;/agt;_baz/a
 The text is, naturally, rendered as:
foo_a href=#barbar/a_baz

 So while the link target is correct, the text of the link is not.

 Please let me know what additional info is needed, if any.

IIRC, the bug was fixed in Org 8.3.


Regards,

-- 
Nicolas Goaziou



Re: [O] [RFC] Add commmand for wrapping sexp/region in src-blocks to Org?

2014-08-02 Thread Nicolas Goaziou
Hello,

Thorsten Jolitz tjol...@gmail.com writes:

 I often missed the following command for wrapping existing content into
 src-blocks in the past, besides knowing about
 `org-babel-demarcate-block' and easy template insertion. Would it make
 sense to add it to Org-mode?

 I made it cover several use cases:


[...]

   - Wrap region between point and +/- N lines forward/backward (very
 fast because no point movement is involved).

This is not really useful as, with muscle memory, you'll probably mark
the appropriate region instead of counting lines. Also it requires the
point to be at the center of the area you want to wrap.

   - Wrap active region.

Why limiting it to source blocks? One may want to wrap region with,
e.g., a quote block.

Also, with a prefix argument, it would be nice to edit the block
containing point (change its type), or remove it completely.


Regards,

-- 
Nicolas Goaziou



Re: [O] Issue with multiple references to the same footnote in LaTeX export

2014-08-02 Thread Nicolas Goaziou
Hello,

Aaron Ecay aarone...@gmail.com writes:

 Duh, forgot to include the list in this reply.

 On Sun, Jul 13, 2014 at 10:50 PM, Aaron Ecay aarone...@gmail.com wrote:
 Hi York,

 It’s not a totally trivial problem from the LaTeX side.  This stack
 exchange answer outlines what could be a solution:
 http://tex.stackexchange.com/a/54240.  Inside the
 ‘org-latex-footnote-reference’ function, org should generate a \label
 inside the argument to \footnote, and then use \ref for subsequent
 references.

I'm not certain that it would work with, e.g., nested footnotes.
A proof-of-concept would help in this case.


Regards,

-- 
Nicolas Goaziou



[O] Generating agenda endless-loop

2014-08-02 Thread Karl Voit
Hi!

My agenda generally works. However, sometimes, by working with Emacs
I get to the status where I can not re-generate the agenda: it is
in an endless loop with 100% of its Emacs-CPU-core. I can quit by
pressing M-g. After re-starting Emacs, it works again without
modifying my Org-files or the Emacs configuration.

Here is a profiler CPU report after I quit the endless loop for
about a minute or so:

,
| - command-execute   55462  97%
|  - call-interactively   55462  97%
|   - org-agenda  53803  94%
|- byte-code  53803  94%
| - call-interactively53779  94%
|  - org-agenda-list  53779  94%
|   - byte-code   53779  94%
|- org-agenda-prepare 53779  94%
| - org-agenda-prepare-buffers53775  94%
|  - byte-code53739  94%
|   - org-end-of-subtree  25278  44%
|- org-back-to-heading10825  19%
| - outline-back-to-heading   10777  18%
|outline-on-heading-p  1473   2%
|+ org-outline-level   2688   4%
|   - org-at-heading-p11354  19%
|  outline-on-heading-p9272  16%
|   + org-refresh-stats-properties   16   0%
| org-set-regexps-and-options-for-tags8   0%
|   org-agenda-files  4   0%
| + org-agenda-get-restriction-and-command   24   0%
|   + byte-code1630   2%
|   + minibuffer-complete25   0%
|   + execute-extended-command4   0%
| + timer-event-handler1161   2%
| + ... 199   0%
`

Do you have any suggestion how I can check this out any further or
get rid of this behavior?



GNU Emacs 24.3.50.1 (x86_64-pc-linux-gnu, GTK+ Version 3.4.2) of
2014-01-01 on gkar, modified by Debian

Org-mode version 8.2.6 (release_8.2.6-1062-g0e303a) ... I got this
issue since a couple of months with various Org-versions.

-- 
mail|git|SVN|photos|postings|SMS|phonecalls|RSS|CSV|XML to Org-mode:
get Memacs from https://github.com/novoid/Memacs 

https://github.com/novoid/extract_pdf_annotations_to_orgmode + more on github




[O] Change in HTML Header Export

2014-08-02 Thread Mike-Personal
Good Morning

I have noticed that recent versions of Org mode export differently than before. 
(I haven’t looked yet for a specific commit that changes this, but can 
depending on the reply below).

Numbered headings used to be exported as:

h2 id=sec-1span class=section-number-21/span Background/h2

Today they are exported as:

h2 id=sec-11 Background/h2

I have custom CSS that would format the number differently based on the 
span/span tags.

Is this accidental (a bug) or intentional (a design change)?


-- 
Mike McLean
mike.mcl...@pobox.com

Re: [O] Generating agenda endless-loop

2014-08-02 Thread Nick Dokos
Karl Voit devn...@karl-voit.at writes:

 My agenda generally works. However, sometimes, by working with Emacs
 I get to the status where I can not re-generate the agenda: it is
 in an endless loop with 100% of its Emacs-CPU-core. I can quit by
 pressing M-g. After re-starting Emacs, it works again without
 modifying my Org-files or the Emacs configuration.

 Here is a profiler CPU report after I quit the endless loop for
 about a minute or so:

 ...

 Do you have any suggestion how I can check this out any further or
 get rid of this behavior?


It might be useful to M-x toggle-debug-on-error and try the agenda
command again: if it gets stuck in the loop again, a C-g will produce a
backtrace that might shed some light.

-- 
Nick




Re: [O] Change in HTML Header Export

2014-08-02 Thread Nicolas Goaziou
Hello,

Mike-Personal mike.mcl...@pobox.com writes:

 I have noticed that recent versions of Org mode export differently than 
 before. (I haven’t looked yet for a specific commit that changes this, but 
 can depending on the reply below).

 Numbered headings used to be exported as:

 h2 id=sec-1span class=section-number-21/span Background/h2

 Today they are exported as:

 h2 id=sec-11 Background/h2

 I have custom CSS that would format the number differently based on the 
 span/span tags.

 Is this accidental (a bug) or intentional (a design change)?

The former. This should be fixed. Thank you.


Regards,

-- 
Nicolas Goaziou



[O] TODO's and cookies

2014-08-02 Thread Sharon Kimble
I've been looking for some time how to extend cookies in an org-mode file
with loads of TODO's. In my specific case I am writing a book, and this
file has the plan of the book, with each section its own TODO, and ditto
for the chapters. Some of the sections are IN-PROGRESS or DONE, others
still TODO. So its looking like this -

* TODO Universal Herbs 2014 [1/8] [12%] 
** DONE CHAPTER 1 - preface [5/5] [100%]
*** DONE Disclaimer
*** DONE Introduction
*** DONE Please note
*** DONE Acknowledgements
*** DONE About the author
** TODO CHAPTER 2 - preamble [9/11] [81%]
** TODO CHAPTER 3 - Herbs [9/19] [47%]
*** DONE Alfalfa
CLOSED: [2014-07-31 Thu 02:16]
*** TODO Angelica
*** TODO Anise
*** DONE Black Cohosh
CLOSED: [2014-07-31 Thu 02:16]
*** DONE Cannabis
CLOSED: [2014-07-31 Thu 02:16]
*** DONE Chaste Tree/Berry
CLOSED: [2014-07-31 Thu 02:17]
*** TODO Dates
*** TODO Dill
*** DONE Don Quai
CLOSED: [2014-07-31 Thu 02:17]
*** TODO Fennel
*** TODO Fenugreek
*** IN-PROGRESS Ginseng
*** TODO Kudzu
*** TODO Liquorice
*** TODO Motherwort
*** DONE Red Clover
CLOSED: [2014-07-31 Thu 02:17]
*** DONE Sage
CLOSED: [2014-07-31 Thu 02:17]
*** DONE Saw Palmetto
CLOSED: [2014-07-31 Thu 02:18]
*** DONE Soya
CLOSED: [2014-07-31 Thu 02:18]
snip

By the first TODO which is the title its showing -  [1/8] [12%] - which
is showing that there are 8 chapters, and its 12% completed. But, is it
possible to also get an overall count of all the sections/TODO's completed 
please?

I've been looking at http://orgmode.org/manual/Checkboxes.html#Checkboxes
and have set up cookies as in that file. I've found 
org-checkbox-hierarchical-statistics
and have set it up here in my setup-orgmode.el -
--8---cut here---start-8---
(setq org-checkbox-hierarchical-statistics t)
(setq org-todo-hierarchical-statistics t)
--8---cut here---end---8---
which is not working with my TODO's. I've been trying to evaluate it with C-c 
#
but I can't get it to work.

So is it possible to get an overall impression of my project from its
TODO/IN-PROGRESS/DONE states please, using the cookies as above?

Thanks
Sharon.
-- 
A taste of linux = http://www.sharons.org.uk
my git repo = https://bitbucket.org/boudiccas/dots
TGmeds = http://www.tgmeds.org.uk
Debian testing, fluxbox 1.3.5, emacs 24.3.92.1


signature.asc
Description: PGP signature


[O] Bug: can not export pdf file [8.2.7c (8.2.7c-elpa @ /Users/mac/.emacs.d/elpa/org-20140730/)]

2014-08-02 Thread 童俊翔

Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good report?  See

 http://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org-mode mailing list.

When I press C-c C-e l o, *Messages* shows:

/bin/bash: xelatex: command not found
/bin/bash: bibtex: command not found
/bin/bash: xelatex: command not found [2 times]
org-latex-compile: PDF file ./LapRPHepatectomy.pdf wasn't produced

my mactex has updated to the latest version.

How to deal with this problem?

Emacs  : GNU Emacs 24.3.1 (x86_64-apple-darwin, NS apple-appkit-1038.36)
of 2013-03-13 on bob.porkrind.org
Package: Org-mode version 8.2.7c (8.2.7c-elpa @ 
/Users/mac/.emacs.d/elpa/org-20140730/)

current state:
==
(setq
org-tab-first-hook '(org-hide-block-toggle-maybe
  org-src-native-tab-command-maybe
  org-babel-hide-result-toggle-maybe
  org-babel-header-arg-expand)
org-speed-command-hook '(org-speed-command-default-hook
  org-babel-speed-command-hook)
org-occur-hook '(org-first-headline-recenter)
org-metaup-hook '(org-babel-load-in-session-maybe)
org-html-format-drawer-function '(lambda (name contents) contents)
org-latex-format-inlinetask-function 'ignore
org-confirm-shell-link-function 'yes-or-no-p
org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default
org-latex-pdf-process '(xelatex %f bibtex %b xelatex %f
 xelatex %f)
org-latex-format-headline-function 'org-latex-format-headline-default-function
org-after-todo-state-change-hook '(org-clock-out-if-current)
org-latex-format-drawer-function '(lambda (name contents) contents)
org-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 '(#[nil \300\301\302\303\304$\207
   [org-add-hook change-major-mode-hook
org-show-block-all append local]
   5]
 #[nil \300\301\302\303\304$\207
   [org-add-hook change-major-mode-hook
org-babel-show-result-all append local]
   5]
 org-babel-result-hide-spec org-babel-hide-all-hashes
 org-mode-reftex-setup)
org-ascii-format-drawer-function '(lambda (name contents width) contents)
org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point
  org-babel-execute-safely-maybe)
org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers
  org-cycle-hide-inline-tasks org-cycle-show-empty-lines
  org-optimize-window-after-visibility-change)
org-confirm-elisp-link-function 'yes-or-no-p
org-metadown-hook '(org-babel-pop-to-session-maybe)
org-html-format-headline-function 'ignore
org-html-format-inlinetask-function 'ignore
org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
outline-minor-mode-prefix [(control o)]
)



Re: [O] [POLL] Syntax change: make \[...\] non-inline (+1)

2014-08-02 Thread Nicolas Goaziou
Hello,

Rasmus ras...@gmx.us writes:

 It works sensibly in latex-mode.  If your text is

My displayed \[equation\]
is here

 M-q will make it 

My displayed \[equation\] is here

 But 

My displayed
\[equation\]
is here

 Is unaltered by M-q (though it was not obvious to me how tex-mode.el
 implemented this).

 I didn't read the other thread is details, but it seems the most
 sensible thing to do is alter the org fill function(s).  These seems
 to rely on org-element, though, and I'm guessing that is why a syntax
 change is necessary, yes?

As explained in the original thread, this is not quite possible. Unlike
to LaTeX, Org puts a strong emphasis on the difference between inline
and non-inline blocks. You can write

  #+begin_center
  contents
  #+end_center

but not

  #+begin_center contents #+end_center

As you know, it doesn't matter much in LaTeX,

  \begin{equation} contents \end{equation}

is as fine as

  \begin{equation}
  contents
  \end{equation}

Of course, it would be possible to add extra code in filling functions
(and more) to mimic this behaviour, but that would really go against the
syntax.

Org is not LaTeX, nor it is meant to mimic it. \[...\] are either inline
or not, like every other construct. In the first case, M-q will fill
them within a paragraph. In the second case, it will not be possible to
have \[...\] in the middle of the line. Hence the poll.

IMO, filling \[...\] is a minor issue since you can write, e.g.,

  \begin{displaymath}
  ...
  \end{displaymath}

when you absolutely don't want M-q to be active. There is no strong
incentive to alter syntax or filling functions.


Regards,

-- 
Nicolas Goaziou



Re: [O] how to use :options-alist in org-export-define-derived-backend ?

2014-08-02 Thread Nicolas Goaziou
Hello,

Bastien b...@gnu.org writes:

 Yes.  But I know see your point about the default title being useless
 most of the times.  So I'm fine with the proposed change in master.

Applied.


Regards,

-- 
Nicolas Goaziou



Re: [O] [PATCH] ox-bibtex.el: Extend to use bibtex files not in current, working directory

2014-08-02 Thread Nicolas Goaziou
Hello,

Konrad Herbst k.her...@stud.uni-heidelberg.de writes:

 From: Konrad Herbst k.her...@stud.uni-heidelberg.de
 Date: Wed, 9 Jul 2014 15:26:10 +0200
 Subject: [PATCH] ox-bibtex.el: Extend to use bibtex files not in current
  working directory

 * contrib/lisp/ox-bibtex.el (org-bibtex-process-bib-files): Process
 bibtexfilename so that it does not have to be in the same directory.

Applied. Thank you.


Regards,

-- 
Nicolas Goaziou



Re: [O] File name with space

2014-08-02 Thread Karl Voit
* Chris Henderson henders...@gmail.com wrote:

 How do I link a local file or folder that has space? Looks like the link
 goes broken.

 e.g. file+sys:///Users/chris/projects/marketing plan for 2014 -- doesn't
 work.

Besides the solution posted before, I prefer:

[[file+sys:///Users/chris/projects/marketing plan for 2014]]

-- 
mail|git|SVN|photos|postings|SMS|phonecalls|RSS|CSV|XML to Org-mode:
get Memacs from https://github.com/novoid/Memacs 

https://github.com/novoid/extract_pdf_annotations_to_orgmode + more on github




Re: [O] org agenda clock check shows strange clocking gaps at beginning of day

2014-08-02 Thread Gregor Zattler
Hi Bastien, org developers,
* Bastien b...@gnu.org [27. Jul. 2014]:
 Gregor Zattler telegr...@gmx.net writes:
 
 All three clocking items belong to the same heading.  I'm fine
 with the first clocking gabp.  But why is there a gap of 7536
 minutes shown although ‘org-agenda-clock-consistency-checks’ is
 at default values (gap-around 4:00)?
 
 I've never seen this error -- can you reproduce it consistently?

Yes.  With my org agenda files there are at least two such
errors.  One vanishes with emacs -Q, but not the other.

But both depend on highly private and fairly large org files.
I'll try to reproduce with sharable data but do not have the time
to investigate ATM.  I'll report back when I have something to
share. 

Ciao, Gregor
-- 
 -... --- .-. . -.. ..--.. ...-.-



Re: [O] Bug: can not export pdf file [8.2.7c (8.2.7c-elpa @ /Users/mac/.emacs.d/elpa/org-20140730/)]

2014-08-02 Thread Rasmus
Hi,

童俊翔 tongjunxi...@gmail.com writes:

 When I press C-c C-e l o, *Messages* shows:

 /bin/bash: xelatex: command not found
 /bin/bash: bibtex: command not found
 /bin/bash: xelatex: command not found [2 times]
 org-latex-compile: PDF file ./LapRPHepatectomy.pdf wasn't produced

 my mactex has updated to the latest version.

Are they in your PATH?  I.e. do you get sensible output when you do
xelatex -v
in your terminal?

—Rasmus

-- 
And I faced endless streams of vendor-approved Ikea furniture. . .




Re: [O] Export org-mode buffer to dynamic html document (collapse/expand details)

2014-08-02 Thread M



 Von: Robert Eckl eck...@gmx.de
 Datum: Thu, 31 Jul 2014 18:50:21 +0200
 An: emacs-orgmode@gnu.org
 Betreff: Re: [O] Export org-mode buffer to dynamic html document
 (collapse/expand details)

 
 I would recommend a look into
 https://github.com/SebastianRose/org-info-js/tree/master
  
 or http://orgmode.org/worg/code/org-info-js/index.org.html
 
 There are described various possible views in html with
 folding/unfolding, similar emacs folding.
 
 You can switch between the views with m, goto (n)ext or (p)revious
 item, help with ?
 
 IIRC You can realize this with the follwoing to lines in your org-file
 and export this to html with c-c c-e h h (or o):
 
 #+HTML_HEAD_EXTRA: link rel=stylesheet
 href=http://orgmode.org/worg/style/worg.css; type=text/css
 #+INFOJS_OPT: view:info toc:nil ftoc:yes ltoc:above  mouse:underline buttons:0
 path:http://orgmode.org/org-info.js

Thanks Robert (and to those who developed those features) - that's just
awesome!
I'll have to figure out the best setting for me, but the results I got in
first tests (thanks to your suggested settings) are already very promising!

One question: what's the difference between Exporting and Publishing in
org-mode?
I assume that exporting can be done only for one org file at a time (or for
a region in it), while publishing normally acts on multiple files at once -
is that true?

One second question:
is it also possible to export or publish agenda views with hyperlinks
pointing to the details of each task/heading?

Kind regards

Martin 





Re: [O] Export org-mode buffer to dynamic html document (collapse/expand details)

2014-08-02 Thread M
 Von: Daniel Clemente n142...@gmail.com
 Datum: Fri, 01 Aug 2014 03:01:31 +0700
 An: Martin Beck elwood...@web.de
 Cc: emacs orgmode-mailinglist emacs-orgmode@gnu.org
 Betreff: Re: [O] Export org-mode buffer to dynamic html document
 (collapse/expand details)
 
 
 I did a custom solution, very simple, with jQuery. You may use it:
 
 Demo:
   http://www.danielclemente.com/hacer/emacs.html
 Code:
   http://www.danielclemente.com/pagina/esquemadorg.js
   http://www.danielclemente.com/pagina/esquemadorg.css
 
 
 - The JS and CSS applies to the normal org export.
 - The index of contents is itself collapsable.
 - The hyperlinking was tricky because if the link destination is collapsed you
 have to open it automatically (including its parents).
 - There's a button to disable the outline (text: „ver todo seguido“)
 
 

Hi Daniel,

thanks a lot for this - really good work and it also looks great.
Firstly, I'll discover the standard exporting/publishing features in
org-mode, but I'll definitely get back to your great solution later.

Martin





[O] How to programmatically use/edit data provided on capture

2014-08-02 Thread Marcin Antczak

Hi all!

I got capture template with prompts to collect some properties:

#+BEGIN_SRC
* TODO %\1 / Some task description
   :PROPERTIES:
   :NAME: %^{NAME}
   :END:
#+END_SRC

My question is: How to get information on user input data to transform 
this data before capture finalize.


For example: I got variable NAME and would like to use function like 
(s-dashed-words string) from s.el to make sure that my NAME is valid and 
converted to dashed syntax.


Let's say that my input is: New random project

I would like to have:

#+begin_src
* TODO new-random-project / Some task description
   :PROPERTIES:
   :NAME: New random project
   :END:
#+end_src

While currently I got:

#+begin_src
* TODO New random project / Some task description
   :PROPERTIES:
   :NAME: New random project
   :END:
#+end_src

I have been trying:

#+BEGIN_SRC
* TODO %(custom-dashify-function %\1) / Some task description
   :PROPERTIES:
   :NAME: %^{NAME}
   :END:
#+END_SRC

or

#+BEGIN_SRC
* TODO %(custom-dashify-function %\\1) / Some task description
   :PROPERTIES:
   :NAME: %^{NAME}
   :END:
#+END_SRC

But apparently function is executed before %\1 is replaced by my data 
and it dodesn't work.
Could someone help me to write function that would get data I provided 
for property NAME, convert using s-dashed-words and return to template 
before finalize?



Marcin