Re: [Orgmode] Re: [Feature request] org-backup

2011-02-21 Thread Eric S Fraga
Bastien  writes:

> Marcelo de Moraes Serpa  writes:
>
>> Anyway, doesn't seem it's something hard to do, so I might as well
>> just try getting something implemented, could be a good exercise in
>> elisp.
>
> :)
>
> Let us know how it goes.
>
> PS: I'm with Dan on this.  For backing up directories, I use git repo.
> For backing up larger projects... well, I back up my whole $HOME.

For org files that are standalone such as the bucket for notes etc. on a
new project, I use RCS to keep them under version control wherever they
may be without having to put a whole directory under control of
git/hg/svn/darcs/...  Emacs handles RCS controlled files very well.

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1
: using Org-mode version 7.4 (release_7.4.509.g99aa5)

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Can I archive into datetree based on CLOSED date property

2011-02-21 Thread Puneeth Chaganti
On Mon, Feb 21, 2011 at 2:55 AM, Urs Rau (UK)  wrote:
> Hi,
>
> On 20 Feb 2011, at 10:55, Puneeth Chaganti wrote:
>
>> On Sun, Feb 20, 2011 at 3:58 PM, Urs Rau (UK)  wrote:
>>> Hi
>>> I would quite like to have a function that would work on a region , or on a 
>>> whole org file of todos and archive completed todos or a selected region 
>>> into a datetree in the archive file in such a way that all completed todo 
>>> items would be filed under the date on which their property says they were 
>>> completed or closed.
>>> Maybe it can already do it and I just need to learn how?
>>
>> Worg has a hack [1] by Osamu Okanu, that modifies the
>> org-archive-subtree function to archive into a datetree. Combining
>> this with the org-map-entries function, you should be able to achieve
>> what you want.
>>
>> Hope this helps,
>> Puneeth
>>
>
> Thanks. I am no elisp coder so this is likely beyond me. How hard would this 
> be to do in elisp?
>
> I guess the line of code from Osamu Okanu to ammend would be:
>
> (let* ((dct (decode-time (org-current-time)))
>
> and somehow get it to read the "CLOSED" date property where Osamu's code has 
> "org-current-time"?
>
> And then I have to somehow call up 'org-map-entries' function to process all 
> completed todo items.
>
> Is there a function that already knows what my actual 'completed' 
> org-todo-keywords items out of the full custom list of my 'org-todo-keywords' 
> are?

I've tried [1] to modify Osamu's defadvice to do what you want.  It
almost does what you want, except that I have not been able to
properly set the `org-map-continue-from' variable. (  May be someone
else can help. )

With the present function, you have to run the `org-map-entries'
function multiple times, until all your items have been archived.

Hope this helps,
Puneeth

[1] - https://gist.github.com/836799

ps: Please CC the list also, when replying to this email.

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: source code and parameters

2011-02-21 Thread Sébastien Vauban
Hi Andreas,

Andreas Leha wrote:
> When working with source code in org mode I like to keep the parameters
> in org-tables.  Especially since I have code in different languages that
> should share the same set of parameters.
>
> Problem is: When I tangle my source code blocks the tangled files loose
> the parameters.
>
> How do I deel best with parameters and source code blocks?

Could you show us a small example explaining what the problem is?

Best regards,
  Seb

-- 
Sébastien Vauban

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: Does Effort support hours only?

2011-02-21 Thread Lawrence Mitchell
Herbert Sitz wrote:
> Lawrence Mitchell  gmx.li> writes:
> Is it possible to specify estimated effort in something other than hours
> (0.5, or 0:30)?

>>> Being able to specify suffixes like `d' for days or `w' for weeks would be
>>> awesome. But I guess it's very, very complex, though.

>> Turns out probably not, unless I've missed something.  I think
>> this set of patches does what's necessary to allow duration
>> strings in effort properties.  And as a bonus its backwards
>> compatible to the old style.  Try it and see if it works, if it
>> does I'll roll it into a proper patch.


> Lawrence --

> I didn't test the patch, but it looks like it's hard coded to
> treat 24 hours as 1 day, 168 hours as 1 week, etc.  This seems
> like it would create more confusion than there was before.

> In the context of measuring effort I think it's far more common
> to treat, e.g, 8 hours as the equivalent of a day's work.  Most
> people have 5 day works weeks, but some don't. Etc.  In any
> case, giving user ability to set their own conversion factors
> seems like a much-needed part of this.

That is true.  The hard-coded values were just as an example.  It
would be reasonably trivial to introduce a variable that encoded
the number of hours a day's effort would contain.  The patch was
just an example that the changes would not be too sweeping.  In
fact, here's a patch on top that would allow user-customization:

diff --git a/lisp/org.el b/lisp/org.el
index 2027809..c3373fa 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -15473,27 +15473,41 @@ If no number is found, the return value is 0."
 (string-to-number (match-string 1 s)))
(t 0)))
 
+(defcustom org-effort-durations
+  `(("h" . 60)
+("d" . ,(* 60 8))
+("w" . ,(* 60 8 5))
+("m" . ,(* 60 8 5 4))
+("y" . ,(* 60 8 5 40)))
+  "Conversion factor to minutes for an effort modifier.
+
+Each entry has the form (MODIFIER . MINUTES).
+
+In an effort string, a number followed by MODIFIER is multiplied
+by the specified number of MINUTES to obtain an effort in
+minutes.
+
+For example, if the value of this variable is ((\"hours\" . 60)), then an
+effort string \"2hours\" is equivalent to 120 minutes."
+  :group 'org-agenda
+  :type '(alist :key-type (string :tag "Modifier")
+   :value-type (number :tag "Minutes")))
+
 (defun org-duration-string-to-minutes (s)
   "Convert a duration string S to minutes.
 
-A bare number is interpreted as minutes, the following suffixes are
-recognised:
- h - hours
- d - days
- w - weeks (7 days)
- m - months (30 days)
- y - years (365 days)
+A bare number is interpreted as minutes, modifiers can be set by
+customizing `org-effort-durations' (which see).
 
 Entries containing a colon are interpreted as H:MM by
 `org-hh:mm-string-to-minutes'."
-  (let ((conversion `(("h" . 60)
- ("d" . ,(* 60 24))
- ("w" . ,(* 60 24 7))
- ("m" . ,(* 60 24 7 30))
- ("y" . ,(* 60 24 7 365
-   (result 0))
-(while (string-match "\\([0-9]+\\)\\([hdwmy]\\)" s)
-  (incf result (* (cdr (assoc (match-string 2 s) conversion))
+  (let ((result 0)
+   (regex (rx (group (1+ (any "0-9")))
+  (0+ (syntax whitespace))
+  (group
+   (eval (cons 'or (mapcar 'car org-effort-durations)))
+(while (string-match regex s)
+  (incf result (* (cdr (assoc (match-string 2 s) org-effort-durations))
  (string-to-number (match-string 1 s
   (setq s (replace-match "" nil t s)))
 (incf result (org-hh:mm-string-to-minutes s))

-- 
Lawrence Mitchell 


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: [PATCH] indentation for section headings vs bulleted lists

2011-02-21 Thread Giovanni Ridolfi
--- Lun 21/2/11, Linus Arver  ha scritto:
> Da: Linus Arver  Lunedì 21 febbraio 2011, 01:04
> On Mon, Feb 21, 2011 at 12:26:30AM
> +0100, Nicolas wrote:
> > Hello,
> > 
> > Here is an attempt to solve the problem at hand.
> > 
> > Linus, would you mind testing it and reporting back?
> > 
> 
> Brilliant, I just applied your patch to the git version and
> everything  works nicely as I had hoped!

In Linus's example file there was no heading, I think this is 
*not* a  "regular example".

- file from Linus 
#+STARTUP: indent

- asd fas fdsf sdf sdfasdf sadf sadf 
  - asd fas fdsf sdf sdfasdf sadf sad

* asd fas fdsf sdf sdfasdf sadf sadf 
** asd fas fdsf sdf sdfasdf sadf sadf dasf df df dsf dsf sdf ds fds d fdf dsaf 
dsf dsf dsf df
--

The manual states: " Within an entry of the outline tree,".

Nicolas, does this constrain still apply with the 'new' 
way of handling lists?

cheers,
Giovanni




___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: [babel] Suggestions: GRASS GIS und Lilypond

2011-02-21 Thread Martyn Jago
Shelagh Manton  writes:

> On Sun, 20 Feb 2011 20:37:19 +, Shelagh Manton wrote:
>
>> On Thu, 17 Feb 2011 18:40:23 +, Martyn Jago wrote:
>> 
>>> Hi
>>> 
>>> I would be interested in a solution to lilypond within org, and would
>>> be happy to fork on github and help out (I currently have some time
>>> too).
>>> 
>>> Martyn
>> 
>> Ok Martyn,
>> 
>> I've put what I have done in a git repo on github.
>> 
>> g...@github.com:sshelagh/ob-lilypond.git
>> 
>> Things that need looking into.
>> 
>> The paths that are being generated so that the results block can find
>> the images.
>> 
>> The lilypond commands that tell it to make a "snippet" picture. I
>> started looking into this as it seems to have changed since I last used
>> lilypond this way. I researched the switches but never actually tested
>> them. -D preview.
>> 
>> I wonder how the changing syntax of lilypond can be dealt with? Will we
>> need to test for lilypond versions?
>> 
>> Best wishes
>> 
>> Shelagh
>> 
>> 
>> 
>>> Shelagh Manton  writes:
>>> 
 On Tue, 15 Feb 2011 10:59:19 +0100, Christian Moe wrote:

> Earlier thread on Lilypond:
> http://comments.gmane.org/gmane.emacs.orgmode/31324
> 
> 
>
> Oops! I think this is the write access address. The following is the non-
> write access address.
>
> git://github.com/sshelagh/ob-lilypond.git
>
> Shelagh
> [snip]
>
>
> ___
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

Hi Shelagh

Thanks, I'll take a look.

Regards

Martyn




___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: [babel][patch] C++ inconsistencies

2011-02-21 Thread Martyn Jago
"Eric Schulte"  writes:

 [...]

> Hi Martyn,
>
> Thanks for sharing this patch, it looks great.  Also, I would love to
> include your YAML support.  It's better to have partial YAML support
> than none, and any skeleton can serve as the foundation for more
> sophisticated support.
>
> Would you be willing to sign the FSF copyright attribution?  If so then
> I can apply the patch and add the YAML support as soon as the process
> begins.  See http://orgmode.org/worg/org-contribute.html
>
> Thanks! -- Eric

Hi Eric

The FSF process is in progress - I'm currently waiting for the agreement
to sign. I'll tidy up the YAML export.

Regards

Martyn



---

Org-mode version 7.4
GNU Emacs 24.0.50.1 (i686-pc-linux-gnu, GTK+ Version 2.24.0) of
2011-02-18

>>
>> ___
>> Emacs-orgmode mailing list
>> Please use `Reply All' to send replies to the list.
>> Emacs-orgmode@gnu.org
>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>
> ___
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Bug: Tangling indirect buffers [7.4]

2011-02-21 Thread Shaun Johnson

Tangling from an indirect buffer fails with the following stack trace:

  Debugger entered--Lisp error: (wrong-type-argument stringp nil)
file-name-nondirectory(nil)
(message "tangled %d code block%s from %s" block-counter (if (= block-counter 1) "" 
"s") (file-name-nondirectory (buffer-file-name ...)))
(let ((block-counter 0) (org-babel-default-header-args ...) path-collector) (mapc (lambda ... ...) 
(org-babel-tangle-collect-blocks lang)) (message "tangled %d code block%s from %s" block-counter 
(if ... "" "s") (file-name-nondirectory ...)) (when org-babel-post-tangle-hook (mapc ... 
path-collector)) path-collector)
(save-excursion (let (... ... path-collector) (mapc ... ...) (message "tangled 
%d code block%s from %s" block-counter ... ...) (when org-babel-post-tangle-hook 
...) path-collector))
org-babel-tangle()
call-interactively(org-babel-tangle nil nil)

The problem seems to be in this fragment of org-babel-tangle:

  (message "tangled %d code block%s from %s" block-counter
   (if (= block-counter 1) "" "s")
   (file-name-nondirectory (buffer-file-name (current-buffer

On an indirect buffer buffer-file-name returns nil, replacing this by:

  (message "tangled %d code block%s from %s" block-counter
   (if (= block-counter 1) "" "s")
   (file-name-nondirectory (buffer-file-name
(or (buffer-base-buffer) 
(current-buffer)

seems to do the right thing.

Shaun.

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.




Emacs  : GNU Emacs 23.2.1 (i386-mingw-nt5.1.2600)
 of 2010-05-08 on G41R2F1
Package: Org-mode version 7.4

current state:
==
(setq
 org-emphasis-alist '(("*" bold "" "") ("/" italic "" "")
  ("_" underline ""
   "")
  ("=" org-code "" "" verbatim)
  ("~" org-verbatim "" "" verbatim))
 org-export-latex-after-initial-vars-hook '(org-beamer-after-initial-vars)
 org-speed-command-hook '(org-speed-command-default-hook 
org-babel-speed-command-hook)
 org-agenda-include-diary t
 org-clock-into-drawer "CLOCK"
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-babel-tangle-lang-exts '(("magik" . "magik") ("emacs-lisp" . "el"))
 org-id-method 'org
 org-export-blocks-postblock-hook '(org-exp-res/src-name-cleanup)
 org-log-note-clock-out t
 org-export-latex-format-toc-function 'org-export-latex-format-toc-default
 org-hide-emphasis-markers t
 org-tab-first-hook '(org-hide-block-toggle-maybe 
org-src-native-tab-command-maybe
  org-babel-hide-result-toggle-maybe)
 org-src-mode-hook '(org-src-babel-configure-edit-buffer
 org-src-mode-configure-edit-buffer)
 org-confirm-shell-link-function 'yes-or-no-p
 org-reveal-start-hook '(org-decrypt-entry)
 org-export-first-hook '(org-beamer-initialize-open-trackers)
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-directory "~/Org"
 org-babel-pre-tangle-hook '(save-buffer)
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers
  org-cycle-show-empty-lines
  org-optimize-window-after-visibility-change)
 org-export-preprocess-before-normalizing-links-hook 
'(org-remove-file-link-modifiers)
 org-mode-hook '((lambda nil
  (org-add-hook (quote change-major-mode-hook)
   (quote org-babel-show-result-all) (quote append) (quote 
local))
  )
 (lambda nil
  (setq org-mouse-context-menu-function (quote 
org-mouse-context-menu))
  (when (memq (quote context-menu) org-mouse-features)
   (org-defkey org-mouse-map [mouse-3] nil)
   (org-defkey org-mode-map [mouse-3]
(quote org-mouse-show-context-menu))
   )
  (org-defkey org-mode-map [down-mouse-1] (quote 
org-mouse-down-mouse))
  (when (memq (quote context-menu) org-mouse-features)
   (org-defkey org-mouse-map [C-drag-mouse-1]
(quote org-mouse-move-tree))
   (org-defkey org-mouse-map [C-down-mouse-1]
(quote org-mouse-move-tree-start))
   )
  (when (memq (quote yank-link) org-mouse-features)
   (org-defkey org-mode-map [S-mouse-2] (quote 
org-mouse-yank-link))
   (org-defkey org-mode-map [drag-mouse-3] (quote 
org-mouse-yank-link))
   )
  (when (memq (quote move-tree) org-mouse-features)
   (org-defk

[Orgmode] question about capture templates

2011-02-21 Thread Filippo A. Salustri
Hi,

I would really like to be able to vary the file into which a captured item
goes.  Specifically, I'd like to insert the item into whatever file I was
visiting when I started the capture.

I've been trying something like this:

> ("m" "Message" entry (file+datetree (buffer-file-name
> (buffer-base-buffer))) "* MSG @ %U %?\n %a")


But the (buffer-file-name (buffer-base-buffer)) doesn't work because the
item keeps ending up in the default capture file.

Can anyone suggest a way to do this?

Cheers.
Fil Salustri

-- 
Filippo A. Salustri, Ph.D., P.Eng.
Mechanical and Industrial Engineering
Ryerson University
350 Victoria St, Toronto, ON
M5B 2K3, Canada
Tel: 416/979-5000 ext 7749
Fax: 416/979-5265
Email: salus...@ryerson.ca
http://deseng.ryerson.ca/~fil/
___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] [babel] Including TikZ diagrams as figures in export

2011-02-21 Thread Jeff Horn
On Sun, Feb 20, 2011 at 8:56 PM, Erik Iverson  wrote:
> See http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-LaTeX.html
> and search for "tikz" for an example.  I think you do need to use the :file
> argument
> for this to have org-mode take care of it automatically.

Thanks for the link. I was glad to find out I could include a TikZ
library in the code block instead of the LaTeX header!

> Alternatively, you could just include *all* the latex you want, including
> constructing your own figure environment and caption and refs, in the latex
> code block.

This is the workaround I've used thus far. I don't like it very much,
since it is fragile w.r.t. HTML export.

>> 4) (optional) To be able to seamlessly export to both LaTeX and HTML
>
> So should the HTML exporter generate a PNG file then, as opposed to PDF?
> This is possible, but requires some 'conditional' elisp code in your :file
> source block argument.  I think I can help if that's indeed what you want.

This would be handy information to have, but definitely not a top
priority ATM. (That is, if you're busy, feel free to put this on low
priority!)

>> And somewhat unrelated, is ":results" now deprecated in favor of
>> ":exports"? What about ":file"? I'm sufficiently new to babel that these all
>> seem like they could be taken care of with a single header argument with
>> many options...
>
> Not deprecated at all according to my understanding:
>
> :results determines how the results are collected from a process. So, in R,
> we
> might want the standard output ':results output' or we might just want the
> last
> value returned by the code block, ':results value'.  This determines what is
> inserted into the org-mode buffer or the export stream when the code block
> is evaluated.
>
> :exports determines if the code and/or the results will be inserted upon
> exporting. *If* the results are inserted, then :results will determine how.
>
> :file is useful for code blocks that generate graphical output, such as
> tikz.
> This will divert the output into the named file, and exporting will insert
> that file.  In the org-mode buffer, a link will be inserted. If a png file
> is
> generated, it can even be displayed inline in the org-mode buffer if you
> turn
> on that functionality.

This was also extremely helpful in clarifying my thinking. I
particularly liked the interplay between exports/results. I need more
practice, and more time with the docs. :)

Jeff

-- 
Jeffrey Horn
http://www.failuretorefrain.com/jeff/

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: question about capture templates

2011-02-21 Thread Sébastien Vauban
Hi Filippo,

"Filippo A. Salustri" wrote:
> I would really like to be able to vary the file into which a captured item
> goes.  Specifically, I'd like to insert the item into whatever file I was
> visiting when I started the capture.
>
> I've been trying something like this:
>
>> ("m" "Message" entry (file+datetree (buffer-file-name
>> (buffer-base-buffer))) "* MSG @ %U %?\n %a")
>
> But the (buffer-file-name (buffer-base-buffer)) doesn't work because the
> item keeps ending up in the default capture file.
>
> Can anyone suggest a way to do this?

You have to use backquotes so that expressions are considered as code to
execute, instead of data. See Emacs manual.

In your case, something like this should do it (untested):

#+begin_src emacs-lisp
(setq org-capture-templates
 `(("m" "Message" entry (file+datetree
   ,(buffer-file-name (buffer-base-buffer))) "* MSG @ %U %?\n %a")))
#+end_src

See backquote used instead of quote.
See comma in front of functions and variables.

Here, though, I'm not sure whether another comma is needed or not in front of
=buffer-base-buffer=.

Best regards,
  Seb

-- 
Sébastien Vauban


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] question about capture templates

2011-02-21 Thread Matthew Sauer
I use remember and I set the org-remember-interactive-interface variable
to refile.  Now if I C-c it prompts me for my refile location I want to
send the item to land at.  If I C-u C-c C-c it goes to the default
listed in the capture template.  Handy since I have one TODO template
but it could land in one of four files, one Homework Template for school
and two files (taking two classes) that it could land in.  Especially
handy since I can't seem to have more than 5 remember templates causing
it to become more about style of capture going to any destination I
choose than style and destination for the templates.   Oh, and I made my
default destination a Refile bucket that then has to be sorted to the
appropriate location.

Matthew Sauer
Sent From GNUS in emacs
"Did I mention I love this thing?"

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] question about capture templates

2011-02-21 Thread Matthew Sauer


Correction , it is C-1 C-c C-c to go to the default location.  

C-u C-c C-c goes into the interactive mode and then visits the location
stored.

Matt

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: question about capture templates

2011-02-21 Thread Richard Lawrence
Sébastien Vauban 
writes:

> "Filippo A. Salustri" wrote:
>> I would really like to be able to vary the file into which a captured item
>> goes.  Specifically, I'd like to insert the item into whatever file I was
>> visiting when I started the capture.

> You have to use backquotes so that expressions are considered as code to
> execute, instead of data. See Emacs manual.

I'm not sure that backquotes will do what the OP wants.  Backquotes will
allow the OP to compute the value of a target file at the time the (setq
org-capture templates ...) form is evaluated.  The OP needs a way to
determine the target file at the time of capture (right?), not at the
time the variable is set.

Unfortunately, I don't have any suggestions on how to hack that.  If the
target of most captures can be determined based on their type, maybe you
can just use the refile mechanism (C-c C-w instead of C-c C-c) to
manually handle the exceptions.  If not, maybe look into wrapping
or replacing org-capture-refile somehow.

Best,
Richard


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Unable to select source code blocks

2011-02-21 Thread Eric S Fraga
Giorgio Valoti  writes:

> Hi,

> I don’t know if I’m missing something but I can’t get the
> org-babel-goto-named-src-block to work. When I invoke it on the sample
> file below the autocompletion shows nil and nothing else and if insert
> the source code block name I get a no match. I’m using org 7.4 with
> Emacs 23.2.
>
> * Source code navigation test
>   #+srcname: test
>   #+begin_src sh
> echo 'hello world'
>   #+end_src
>
>   #+results: test
>   : hello world
> * Another item, another source code block
>   #+srcname: test2
>   #+begin_src sh
> echo 'ciao mondo'
>   #+end_src
>
>   #+results: test2
>   : ciao mondo
> * and so on
>
> Thank you in advance
> --
> Giorgio Valoti

Giorgio,

this works just fine for me; I don't know what you mean by
autocompletion but I use ido-everywhere and both test and test2 appear
in the prompt for =org-babel-goto-named-src-block=.

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1
: using Org-mode version 7.4 (release_7.4.509.g99aa5)

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] [babel] Including TikZ diagrams as figures in export

2011-02-21 Thread Andreas Leha
Hi Jeffrey,

the attached sample file works for me.

The html is only sub-optimal, though, as it just includes a link to a
pdf file.

Cheers,
Andreas



Am 21.02.2011 02:56, schrieb Erik Iverson:
> Jeffrey,
>
>> Now, I'd like to integrate them into an org document. I'd like:
>> 1) To use babel to handle the TikZ source
>
> This is possible.
>
>> 2) To wrap the resulting drawing in a figure environment for
>> automatic numbering and centering
>
> See
> http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-LaTeX.html
> and search for "tikz" for an example.  I think you do need to use the
> :file argument
> for this to have org-mode take care of it automatically.
>
> Alternatively, you could just include *all* the latex you want, including
> constructing your own figure environment and caption and refs, in the
> latex
> code block.
>
>> 3) To be able to refer to the figure elsewhere in the document
>
> Should be possible with either approach above.
>
>> 4) (optional) To be able to seamlessly export to both LaTeX and HTML
>
> So should the HTML exporter generate a PNG file then, as opposed to PDF?
> This is possible, but requires some 'conditional' elisp code in your
> :file
> source block argument.  I think I can help if that's indeed what you
> want.
>
>> And somewhat unrelated, is ":results" now deprecated in favor of
>> ":exports"? What about ":file"? I'm sufficiently new to babel that
>> these all seem like they could be taken care of with a single header
>> argument with many options...
>
> Not deprecated at all according to my understanding:
>
> :results determines how the results are collected from a process. So,
> in R, we
> might want the standard output ':results output' or we might just want
> the last
> value returned by the code block, ':results value'.  This determines
> what is
> inserted into the org-mode buffer or the export stream when the code
> block
> is evaluated.
>
> :exports determines if the code and/or the results will be inserted upon
> exporting. *If* the results are inserted, then :results will determine
> how.
>
> :file is useful for code blocks that generate graphical output, such
> as tikz.
> This will divert the output into the named file, and exporting will
> insert
> that file.  In the org-mode buffer, a link will be inserted. If a png
> file is
> generated, it can even be displayed inline in the org-mode buffer if
> you turn
> on that functionality.
>
>
> ___
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

#+LATEX_HEADER: \usepackage{tikz}

* Tikz Sample
  In figure \ref{fig:tikz_sample} you can see something.
  
  #+srcname: tikz_sample
  #+begin_src latex :exports (if (eq backend 'latex) "none" "results") :file 
tikz_sample.pdf :headers '("\\usepackage{tikz}")
\usetikzlibrary{arrows}
\tikzstyle{int}=[draw, fill=blue!20, minimum size=2em]
\tikzstyle{init} = [pin edge={to-,thin,black}]

\begin{tikzpicture}[node distance=2.5cm,auto,>=latex']
\node [int, pin={[init]above:$v_0$}] (a) {$\frac{1}{s}$};
\node (b) [left of=a,node distance=2cm, coordinate] {a};
\node [int, pin={[init]above:$p_0$}] (c) [right of=a] {$\frac{1}{s}$};
\node [coordinate] (end) [right of=c, node distance=2cm]{};
\path[->] (b) edge node {$a$} (a);
\path[->] (a) edge node {$v$} (c);
\draw[->] (c) edge node {$p$} (end) ;
\end{tikzpicture}
   #+end_src

   #+begin_src latex :noweb yes
 \begin{figure}
   \centering
   <>
   \caption[Tikz]{Tikz}\label{fig:tikz_sample}
 \end{figure}
   #+end_src


smime.p7s
Description: S/MIME Cryptographic Signature
___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] [babel] Including TikZ diagrams as figures in export

2011-02-21 Thread Eric Schulte
Jeff Horn  writes:

> On Sun, Feb 20, 2011 at 8:56 PM, Erik Iverson  wrote:
>> See http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-LaTeX.html
>> and search for "tikz" for an example.  I think you do need to use the :file
>> argument
>> for this to have org-mode take care of it automatically.
>
> Thanks for the link. I was glad to find out I could include a TikZ
> library in the code block instead of the LaTeX header!
>
>> Alternatively, you could just include *all* the latex you want, including
>> constructing your own figure environment and caption and refs, in the latex
>> code block.
>
> This is the workaround I've used thus far. I don't like it very much,
> since it is fragile w.r.t. HTML export.
>

I agree this is not ideal.  The solution here is for the Org-mode
exporter to recognize blocks as figure-wrapable items.  This would solve
the above, as well as make it possible to reference exported source
code, verbatim environments, quotes, etc...

I haven't looked at the org exporter to see how large of a change this
would be, however I'll put this on my growing TODO list.

>
>>> 4) (optional) To be able to seamlessly export to both LaTeX and HTML
>>
>> So should the HTML exporter generate a PNG file then, as opposed to PDF?
>> This is possible, but requires some 'conditional' elisp code in your :file
>> source block argument.  I think I can help if that's indeed what you want.
>
> This would be handy information to have, but definitely not a top
> priority ATM. (That is, if you're busy, feel free to put this on low
> priority!)
>
>>> And somewhat unrelated, is ":results" now deprecated in favor of
>>> ":exports"? What about ":file"? I'm sufficiently new to babel that these all
>>> seem like they could be taken care of with a single header argument with
>>> many options...
>>
>> Not deprecated at all according to my understanding:
>>

:results is not deprecated, the Org manual maintains an up-to-date list
of code block header arguments.
http://orgmode.org/manual/Working-With-Source-Code.html

Cheers -- Eric

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: [babel] some lisp/slime progress

2011-02-21 Thread Eric Schulte
Erik Iverson  writes:

> Hello,
>
> I recently posted on the inability of ob-lisp.el to
> submit multiple forms to a running CL session and return
> the result.
>
> http://permalink.gmane.org/gmane.emacs.orgmode/37325
>
> I have made some progress in fixing this, but it *required
> defining a new function in SLIME, so I do not post this
> as a patch to org-mode, since it depends on more than
> org-mode*.  I don't know if this is something that truly
> belongs in SLIME, so I may follow-up on that mailing list.
>

It looks like you've inserted an orgmode specific function into slime?
Maybe your slime patch could be changed to the introduction of a new
hook to which this org-mode specific function could be bound?  I imagine
the slime mailing list would know the best solution here.

>
> NB: this only works when :session is specified.
>

I think it is reasonable for the :session header argument to be added to
an `org-babel-default-header-args:lisp' variable defined in ob-lisp.
That would remove the need to constantly specify :session.  This is
similar to the ob-clojure approach, which by default always uses a slime
session.

>
> In SLIME swank.lisp, I define:
>
> (defslimefun interactive-eval-region-orgmode (string)
>(with-buffer-syntax ()
>  (with-retry-restart (:msg "Retry SLIME interactive evaluation request.")
>(list (format nil "~{~S~^~%~}" (eval-region string))
>
>
> Then, in ob-lisp.el, apply the following patch.
>
> diff --git a/lisp/ob-lisp.el b/lisp/ob-lisp.el
> index 600b79e..2980cc8 100644
> --- a/lisp/ob-lisp.el
> +++ b/lisp/ob-lisp.el
> @@ -78,7 +78,11 @@ This function is called by `org-babel-execute-src-block'"
>(if session
>;; session evaluation
>(save-window-excursion
> -   (cadr (slime-eval `(swank:eval-and-grab-output ,full-body
> +(with-temp-buffer
> +  (insert full-body)
> +  (slime-eval
> +   `(swank:interactive-eval-region-orgmode
> + ,(buffer-substring-no-properties (point-min) (point-max))
>  ;; external evaluation
>  (let ((script-file (org-babel-temp-file "lisp-script-")))
>(with-temp-file script-file
>
> Then, things like the following work, where I assume you've already
> started M-x slime.
>
> #+begin_src emacs-lisp :session
>
> (defvar test1 "test1 value")
> (defvar test2 "test2 value")
> test2
>
> #+end_src
>
> #+results:
> : test2 value
>

Great, I look forward to playing with this as soon as I find some
time...

Thanks for sharing -- Eric

>
>
> Best Regards,
> --Erik Iverson

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Two questions about using a =#+begin_src emacs-lisp= block

2011-02-21 Thread Eric Schulte
Chris Malone  writes:

> Hi,
>
> First off, my =org-mode= is up-to-date - just did a =git pull && make clean
> && make=.  Needless to say, the following were an issue before then...
>
> * Question 1:
> Is there a way to force, upon export, an =emacs-lisp= session to be run
> within the current buffer?  For instance, the following code
>
> ===
> #+begin_src emacs-lisp :exports both
>  (buffer-file-name)
>
> #+end_src
> ===
>
> exports to LaTeX as
>
> ===
> \begin{verbatim}
>
> (buffer-file-name)
>
> \end{verbatim}
>
>
>
>
> ===
>
> In other words, as far as I can tell, the code is passed to the interpreter,
> which does not know about the current buffer information, and therefore the
> result of the =emacs-lisp= code is an empty string.  By contrast, if I use
> =C-c C-c= to evaluate the code block, then I get the proper result printed
> in the =.org= buffer:
>

Hi Chris,

This is due to the fact that during export Org-mode copies the entire
buffer contents into a new export buffer (which is not associated with
any file, hence `buffer-file-name' returning nothing).  This is done so
that the exporter can operate destructively on the file contents without
affecting the original buffer.

There is a way to work around this issue.  The "header arguments" to
code blocks are calculated in the original buffer (so that things like
references will correctly resolve).  Given this, the following code
block will generate the output you are seeking...

#+begin_src emacs-lisp :var file-name=(buffer-file-name) :exports both
  file-name
#+end_src

>
> ===
> #+results:
>
> : /home/cmalone/org_tests/python_class_lstings.org
> ===
>
> Ultimately, I'd like to, upon export, have a =emacs-lisp= code block that
> does a regexp search on the file and returns a list of matches, which can
> then be placed in a =latex= code block.  This sort of action suffers from
> the same issue as the =(buffer-file-name)= code - in essence this is a
> minimal (non)working example.
>
> * Question 2:
> Why does the following code, upon export, ask if I want to evaluate the
> =emacs-lisp= code *TWICE* and then give a /Invalid read syntax: "#"/ error
> in the message window?:
>
> ===
> #+begin_src emacs-lisp :exports
> both
>  (buffer-file-name)
>
> #+end_src
> #+begin_src sh :exports
> both
>   ls
> -l
> #+end_src
> ===
>
> Note that this works fine as long as the =:exports= tag for the =emacs-lisp=
> code block is *NOT* =both= or =results=.  Also note that the value of the
> =:exports= tag on the =sh= code block is irelevant for this error to
> appear.  Also, it doesn't have to be this particular combination of
> =emacs-lisp= and =sh= blocks; for instance it fails with an =emacs-lisp= and
> a =python= source block.
>

I can't reproduce this bug, try setting `org-confirm-babel-evaluate' to
nil.

Best -- Eric

>
> Is this a bug?
>
> Chris

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: [babel][patch] C++ inconsistencies

2011-02-21 Thread Eric Schulte
Martyn Jago  writes:

> "Eric Schulte"  writes:
>
>  [...]
>
>> Hi Martyn,
>>
>> Thanks for sharing this patch, it looks great.  Also, I would love to
>> include your YAML support.  It's better to have partial YAML support
>> than none, and any skeleton can serve as the foundation for more
>> sophisticated support.
>>
>> Would you be willing to sign the FSF copyright attribution?  If so then
>> I can apply the patch and add the YAML support as soon as the process
>> begins.  See http://orgmode.org/worg/org-contribute.html
>>
>> Thanks! -- Eric
>
> Hi Eric
>
> The FSF process is in progress - I'm currently waiting for the agreement
> to sign. I'll tidy up the YAML export.
>

Hi Martyn,

That's great news.  A just had trouble trying to apply your earlier
patch, could you reproduce the patch with 

git diff > cpp.patch

then re-send the resulting patch as an attachment?

Thanks -- Eric

>
> Regards
>
> Martyn
>
>

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: [PATCH] indentation for section headings vs bulleted lists

2011-02-21 Thread Nicolas
Hello,

Giovanni Ridolfi  writes:

> In Linus's example file there was no heading, I think this is 
> *not* a  "regular example".
>
> The manual states: " Within an entry of the outline tree,".
>
> Nicolas, does this constrain still apply with the 'new' 
> way of handling lists?

It should work anywhere in an outline tree and before first headline, if
that's your question. So there is no constrain on lists.

Please note that the patch isn't ready for submission yet. I'll include
some speed improvements (scanning every list in section every 0.2s sure
sounds a bit scary) and a bit of polishing a bit later.

Regards,

-- 
Nicolas

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: source code and parameters

2011-02-21 Thread Andreas Leha
Can not reproduce this anymore.  My variables are exported nicely now. 
Sorry for the noise.

- Andreas

Am 21.02.2011 10:06, schrieb Sébastien Vauban:
> Hi Andreas,
>
> Andreas Leha wrote:
>   
>> When working with source code in org mode I like to keep the parameters
>> in org-tables.  Especially since I have code in different languages that
>> should share the same set of parameters.
>>
>> Problem is: When I tangle my source code blocks the tangled files loose
>> the parameters.
>>
>> How do I deel best with parameters and source code blocks?
>> 
> Could you show us a small example explaining what the problem is?
>
> Best regards,
>   Seb
>
>   



smime.p7s
Description: S/MIME Cryptographic Signature
___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Two questions about using a =#+begin_src emacs-lisp= block

2011-02-21 Thread Chris Malone
On Mon, Feb 21, 2011 at 12:17 PM, Eric Schulte wrote:

> Chris Malone  writes:
>
> > Hi,
> >
> > First off, my =org-mode= is up-to-date - just did a =git pull && make
> clean
> > && make=.  Needless to say, the following were an issue before then...
> >
> > * Question 1:
> > Is there a way to force, upon export, an =emacs-lisp= session to be run
> > within the current buffer?  For instance, the following code
> >
> > ===
> > #+begin_src emacs-lisp :exports both
> >  (buffer-file-name)
> >
> > #+end_src
> > ===
> >
> > exports to LaTeX as
> >
> > ===
> > \begin{verbatim}
> >
> > (buffer-file-name)
> >
> > \end{verbatim}
> >
> >
> >
> >
> > ===
> >
> > In other words, as far as I can tell, the code is passed to the
> interpreter,
> > which does not know about the current buffer information, and therefore
> the
> > result of the =emacs-lisp= code is an empty string.  By contrast, if I
> use
> > =C-c C-c= to evaluate the code block, then I get the proper result
> printed
> > in the =.org= buffer:
> >
>
> Hi Chris,
>
> This is due to the fact that during export Org-mode copies the entire
> buffer contents into a new export buffer (which is not associated with
> any file, hence `buffer-file-name' returning nothing).  This is done so
> that the exporter can operate destructively on the file contents without
> affecting the original buffer.
>
> There is a way to work around this issue.  The "header arguments" to
> code blocks are calculated in the original buffer (so that things like
> references will correctly resolve).  Given this, the following code
> block will generate the output you are seeking...
>
> #+begin_src emacs-lisp :var file-name=(buffer-file-name) :exports both
>  file-name
> #+end_src
>
> Hi Eric,

Thanks for this workaround - this does exactly what I want.


> >
> > ===
> > #+results:
> >
> > : /home/cmalone/org_tests/python_class_lstings.org
> > ===
> >
> > Ultimately, I'd like to, upon export, have a =emacs-lisp= code block that
> > does a regexp search on the file and returns a list of matches, which can
> > then be placed in a =latex= code block.  This sort of action suffers from
> > the same issue as the =(buffer-file-name)= code - in essence this is a
> > minimal (non)working example.
> >
> > * Question 2:
> > Why does the following code, upon export, ask if I want to evaluate the
> > =emacs-lisp= code *TWICE* and then give a /Invalid read syntax: "#"/
> error
> > in the message window?:
> >
> > ===
> > #+begin_src emacs-lisp :exports
> > both
> >  (buffer-file-name)
> >
> > #+end_src
> > #+begin_src sh :exports
> > both
> >   ls
> > -l
> > #+end_src
> > ===
> >
> > Note that this works fine as long as the =:exports= tag for the
> =emacs-lisp=
> > code block is *NOT* =both= or =results=.  Also note that the value of the
> > =:exports= tag on the =sh= code block is irelevant for this error to
> > appear.  Also, it doesn't have to be this particular combination of
> > =emacs-lisp= and =sh= blocks; for instance it fails with an =emacs-lisp=
> and
> > a =python= source block.
> >
>
> I can't reproduce this bug, try setting `org-confirm-babel-evaluate' to
> nil.
>
> Best -- Eric
>
> >
> > Is this a bug?
> >
> > Chris
>

I added =(setq org-confirm-babel-evaluate nil)= to my =.emacs= file, and
indeed I am not asked about evaluating the code block, but I'm still getting
the invalid syntax error when =org-babel-exp= is called the second time on
the =emacs-lisp= code block.  I should mention that this is somewhere in the
byte-code, as the error is:

byte-code: Invalid read syntax: "#"

in the *Messages* buffer.  I still don't fully understand why it should be
evaluating that code block twice.

Chris
___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] [babel] Including TikZ diagrams as figures in export

2011-02-21 Thread Jeff Horn
Andreas,

Thanks for the example. I particularly like the use of the noweb to
make the blocks work together. I'll adopt this technique until the
exporter is modified (no rush, Eric!). This is a great workable
solution.

Jeff

On Mon, Feb 21, 2011 at 11:44 AM, Andreas Leha
 wrote:
> Hi Jeffrey,
>
> the attached sample file works for me.
>
> The html is only sub-optimal, though, as it just includes a link to a
> pdf file.
>
> Cheers,
> Andreas
>
>
>
> Am 21.02.2011 02:56, schrieb Erik Iverson:
>> Jeffrey,
>>
>>> Now, I'd like to integrate them into an org document. I'd like:
>>> 1) To use babel to handle the TikZ source
>>
>> This is possible.
>>
>>> 2) To wrap the resulting drawing in a figure environment for
>>> automatic numbering and centering
>>
>> See
>> http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-LaTeX.html
>> and search for "tikz" for an example.  I think you do need to use the
>> :file argument
>> for this to have org-mode take care of it automatically.
>>
>> Alternatively, you could just include *all* the latex you want, including
>> constructing your own figure environment and caption and refs, in the
>> latex
>> code block.
>>
>>> 3) To be able to refer to the figure elsewhere in the document
>>
>> Should be possible with either approach above.
>>
>>> 4) (optional) To be able to seamlessly export to both LaTeX and HTML
>>
>> So should the HTML exporter generate a PNG file then, as opposed to PDF?
>> This is possible, but requires some 'conditional' elisp code in your
>> :file
>> source block argument.  I think I can help if that's indeed what you
>> want.
>>
>>> And somewhat unrelated, is ":results" now deprecated in favor of
>>> ":exports"? What about ":file"? I'm sufficiently new to babel that
>>> these all seem like they could be taken care of with a single header
>>> argument with many options...
>>
>> Not deprecated at all according to my understanding:
>>
>> :results determines how the results are collected from a process. So,
>> in R, we
>> might want the standard output ':results output' or we might just want
>> the last
>> value returned by the code block, ':results value'.  This determines
>> what is
>> inserted into the org-mode buffer or the export stream when the code
>> block
>> is evaluated.
>>
>> :exports determines if the code and/or the results will be inserted upon
>> exporting. *If* the results are inserted, then :results will determine
>> how.
>>
>> :file is useful for code blocks that generate graphical output, such
>> as tikz.
>> This will divert the output into the named file, and exporting will
>> insert
>> that file.  In the org-mode buffer, a link will be inserted. If a png
>> file is
>> generated, it can even be displayed inline in the org-mode buffer if
>> you turn
>> on that functionality.
>>
>>
>> ___
>> Emacs-orgmode mailing list
>> Please use `Reply All' to send replies to the list.
>> Emacs-orgmode@gnu.org
>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>
>
> ___
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>
>



-- 
Jeffrey Horn
http://www.failuretorefrain.com/jeff/

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] [babel] Including TikZ diagrams as figures in export

2011-02-21 Thread Jeff Horn
On Mon, Feb 21, 2011 at 11:57 AM, Eric Schulte  wrote:
> :results is not deprecated, the Org manual maintains an up-to-date list
> of code block header arguments.
> http://orgmode.org/manual/Working-With-Source-Code.html

Thanks for your eternal patience, with regard to me RTFM. Google
search for org mode are a reflex now, since Worg usually has specific
use examples (sometimes good blog posts turn up, too). But searching
for "org mode babel" usually makes my head spin.

I really dig literate research, but am mostly ignorant of the
techniques, so its hard for to know what to search "for". But, headers
are an example where I could have easily found the answer if I read
the manual.

-- 
Jeffrey Horn
http://www.failuretorefrain.com/jeff/

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] [babel] Passing an org table block to Eric Schulte's booktabs function

2011-02-21 Thread Jeff Horn
I've recently tried getting pretty tables in LaTeX export using Eric
Schulte's function from Worg:


http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-LaTeX.html#sec-5_2

The problem is that passing the table to the function produces an
error, specifically "wrong type of argument: listp".

Any ideas about what to do differently? Here's a quick example:

* Test Table
Have a look at Table \ref{tab:example}.
#+srcname: es-booktabs
#+begin_src emacs-lisp :var table='((:head) hline (:body)) :exports none
(flet ((to-tab (tab)
   (orgtbl-to-generic
(mapcar (lambda (lis)
  (if (listp lis)
  (mapcar (lambda (el)
(if (stringp el)
el
  (format "%S" el))) lis)
lis)) tab)
(list :lend " " :sep " & " :hline "\\hline"
  (org-fill-template
   "
\\toprule
%table
\\bottomrule\n"
   (list
(cons "table"
  ;; only use \midrule if it looks like there are column headers
  (if (equal 'hline (second table))
  (concat (to-tab (list (first table)))
  "\n\\midrule\n"
  (to-tab (cddr table)))
(to-tab table))
#+end_src
#+srcname: tab-example
#+begin_src org :results replace :exports none
   ,||   | Column Player | |
   ,|+---+---+-|
   ,| /  | < |   | >   |
   ,||   | A | B   |
   ,| Row Player | A | 1,2   | 3,4 |
   ,|| B | 5,6   | 7,8 |
#+end_src
#+begin_src latex :noweb yes
 \begin{table}[htb!]
   \centering
   \caption{A test table}
   \label{tab:example}
   \begin{tabular}{rl}
 <>
   \end{tabular}
 \end{table}
#+end_src

-- 
Jeffrey Horn
http://www.failuretorefrain.com/jeff/

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: Announcing org-contacts, a bbdb-like contact manager for Org

2011-02-21 Thread Julien Danjou
On Sat, Feb 12 2011, Tassilo Horn wrote:

> @Julien: Here's a patch for org-contacts.el which uses Stefan's
> suggestion to fix the completion in the case-insensitive case.

Patch merged, and soon to be pushed.

-- 
Julien Danjou
❱ http://julien.danjou.info


pgp0SQsXh2iGF.pgp
Description: PGP signature
___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Bug: unexpected behaviour of org-mark-entry-for-agenda-action [7.01trans]

2011-02-21 Thread kinouchou

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.


Hello,

I tried to use org-mark-entry-for-agenda-action (C-c C-x C-k). But
when, inside the agenda, I tried to select a specific date AND hour (k
s),
with the timegrid, only the date was scheduled.
I think it would be better to have both the date and the time
scheduled.
What do you think?

kinouchou

Emacs  : GNU Emacs 23.2.1 (i486-pc-linux-gnu, GTK+ Version 2.20.1)
 of 2010-09-02 on rutherfordium, modified by Debian
Package: Org-mode version 7.01trans

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Two questions about using a =#+begin_src emacs-lisp= block

2011-02-21 Thread Eric Schulte
Chris Malone  writes:
[...]
>
> I added =(setq org-confirm-babel-evaluate nil)= to my =.emacs= file, and 
> indeed I am not asked about evaluating the code block, but I'm still getting 
> the invalid
> syntax error when =org-babel-exp= is called the second time on the 
> =emacs-lisp= code block.? I should mention that this is somewhere in the 
> byte-code, as the error
> is:
>
> byte-code: Invalid read syntax: "#"
>
> in the *Messages* buffer.? I still don't fully understand why it should be 
> evaluating that code block twice.
>

Hmm, it may be worth cleaning out all compiled .elc files from within
Org-mode, the calling org-reload, and see if the problem persists.

Best -- Eric

>
> Chris

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] [babel] Passing an org table block to Eric Schulte's booktabs function

2011-02-21 Thread Thomas S. Dye

Aloha Jeff,

Do the instructions here work for you?

http://orgmode.org/worg/org-tutorials/org-latex-export.html#sec-12_1

hth,
Tom

On Feb 21, 2011, at 9:34 AM, Jeff Horn wrote:


I've recently tried getting pretty tables in LaTeX export using Eric
Schulte's function from Worg:

   http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-LaTeX.html#sec-5_2

The problem is that passing the table to the function produces an
error, specifically "wrong type of argument: listp".

Any ideas about what to do differently? Here's a quick example:

* Test Table
Have a look at Table \ref{tab:example}.
#+srcname: es-booktabs
#+begin_src emacs-lisp :var table='((:head) hline (:body)) :exports  
none

(flet ((to-tab (tab)
  (orgtbl-to-generic
   (mapcar (lambda (lis)
 (if (listp lis)
 (mapcar (lambda (el)
   (if (stringp el)
   el
 (format "%S" el))) lis)
   lis)) tab)
   (list :lend " " :sep " & " :hline "\\hline"
 (org-fill-template
  "
\\toprule
%table
\\bottomrule\n"
  (list
   (cons "table"
 ;; only use \midrule if it looks like there are column  
headers

 (if (equal 'hline (second table))
 (concat (to-tab (list (first table)))
 "\n\\midrule\n"
 (to-tab (cddr table)))
   (to-tab table))
#+end_src
#+srcname: tab-example
#+begin_src org :results replace :exports none
  ,||   | Column Player | |
  ,|+---+---+-|
  ,| /  | < |   | >   |
  ,||   | A | B   |
  ,| Row Player | A | 1,2   | 3,4 |
  ,|| B | 5,6   | 7,8 |
#+end_src
#+begin_src latex :noweb yes
\begin{table}[htb!]
  \centering
  \caption{A test table}
  \label{tab:example}
  \begin{tabular}{rl}
<>
  \end{tabular}
\end{table}
#+end_src

--
Jeffrey Horn
http://www.failuretorefrain.com/jeff/

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: A way to export agenda with links into org-files to html ?

2011-02-21 Thread Marc-Oliver Ihm

Am 05.02.2011 22:46, schrieb Marc-Oliver Ihm:

Hello,

I have some co-workers with whom I would like to share my notes from org
and even some of the todos, which are recorded there.

Unfortunately they are not very emacs savy, so that I need another way
besides emacs to give access to this information. Html is an obvious
option.

The html exporter gives excellent results for all of my org-files and
with org-write-agenda it is very easy to write the agenda to file.

However, in the html-version of the agenda there are no links.

Is there a way around this or is there another way to do this ?

I know, there have been discussions on this topic, but I have found no
solution yet.

Is there a way ?

Any help would be appreciated.

with kind regards, Marc-Oliver Ihm


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode



Thanx for holding up this thread while I was away :-)

To be me more precise than my original posting: With "links" in the 
agenda buffer, I meant the feature, that precssing return in the agenda 
buffer sends one to the corresponding position in the original buffer.


It would be very useful, if such "links" could be converted to 
html-links when exporting the agenda.


Thanx for considering such a feature.

kind regards, Marc-Oliver Ihm


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: question about capture templates

2011-02-21 Thread Sébastien Vauban
Hi Richard,

Richard Lawrence wrote:
> Sébastien Vauban  writes:
>> "Filippo A. Salustri" wrote:
>>> I would really like to be able to vary the file into which a captured item
>>> goes. Specifically, I'd like to insert the item into whatever file I was
>>> visiting when I started the capture.
>
>> You have to use backquotes so that expressions are considered as code to
>> execute, instead of data. See Emacs manual.
>
> I'm not sure that backquotes will do what the OP wants. Backquotes will
> allow the OP to compute the value of a target file at the time the (setq
> org-capture templates ...) form is evaluated. The OP needs a way to
> determine the target file at the time of capture (right?), not at the time
> the variable is set.

You're definitely right. I missed the distinction "at Org launch time" vs "at
execution time"... Pull my answer off the records ;-)

Best regards,
  Seb

-- 
Sébastien Vauban


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: Two questions about using a =#+begin_src emacs-lisp= block

2011-02-21 Thread Eric Schulte
[...]
>>
>> This is due to the fact that during export Org-mode copies the entire
>> buffer contents into a new export buffer (which is not associated with
>> any file, hence `buffer-file-name' returning nothing).  This is done so
>> that the exporter can operate destructively on the file contents without
>> affecting the original buffer.
>
> Ideally this should be an implementation detail that is completely
> hidden from the user. So I'd say that the fact that execution on export
> does not behave like interactive execution is a bug. Should we consider
> fixing this?
>

I'd push back on considering this a bug.

Babel currently makes no guarantees about the location in which
evaluation takes place (other than the :dir header argument), and I
would consider it an implementation detail that evaluation of emacs-lisp
does sometimes take place inside the Org-mode buffer (this is not true,
nor could it be for any other language).  By contrast Babel *does*
guarantee that header arguments are resolved in the original Org-mode
buffer, a guarantee that we explicitly maintain during export despite
the Org-mode buffer shuffling.

Best -- Eric

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: Two questions about using a =#+begin_src emacs-lisp= block

2011-02-21 Thread Dan Davison
"Eric Schulte"  writes:

> Chris Malone  writes:
>
>> Hi,
>>
>> First off, my =org-mode= is up-to-date - just did a =git pull && make clean
>> && make=.  Needless to say, the following were an issue before then...
>>
>> * Question 1:
>> Is there a way to force, upon export, an =emacs-lisp= session to be run
>> within the current buffer?  For instance, the following code
>>
>> ===
>> #+begin_src emacs-lisp :exports both
>>  (buffer-file-name)
>>
>> #+end_src
>> ===
>>
>> exports to LaTeX as
>>
>> ===
>> \begin{verbatim}
>>
>> (buffer-file-name)
>>
>> \end{verbatim}
>>
>>
>>
>>
>> ===
>>
>> In other words, as far as I can tell, the code is passed to the interpreter,
>> which does not know about the current buffer information, and therefore the
>> result of the =emacs-lisp= code is an empty string.  By contrast, if I use
>> =C-c C-c= to evaluate the code block, then I get the proper result printed
>> in the =.org= buffer:
>>
>
> Hi Chris,
>
> This is due to the fact that during export Org-mode copies the entire
> buffer contents into a new export buffer (which is not associated with
> any file, hence `buffer-file-name' returning nothing).  This is done so
> that the exporter can operate destructively on the file contents without
> affecting the original buffer.

Ideally this should be an implementation detail that is completely
hidden from the user. So I'd say that the fact that execution on export
does not behave like interactive execution is a bug. Should we consider
fixing this?

>
> There is a way to work around this issue.  The "header arguments" to
> code blocks are calculated in the original buffer (so that things like
> references will correctly resolve).  Given this, the following code
> block will generate the output you are seeking...
>
> #+begin_src emacs-lisp :var file-name=(buffer-file-name) :exports both
>   file-name
> #+end_src
>
>>
>> ===
>> #+results:
>>
>> : /home/cmalone/org_tests/python_class_lstings.org
>> ===
>>
>> Ultimately, I'd like to, upon export, have a =emacs-lisp= code block that
>> does a regexp search on the file and returns a list of matches, which can
>> then be placed in a =latex= code block.  This sort of action suffers from
>> the same issue as the =(buffer-file-name)= code - in essence this is a
>> minimal (non)working example.
>>
>> * Question 2:
>> Why does the following code, upon export, ask if I want to evaluate the
>> =emacs-lisp= code *TWICE* and then give a /Invalid read syntax: "#"/ error
>> in the message window?:
>>
>> ===
>> #+begin_src emacs-lisp :exports
>> both
>>  (buffer-file-name)
>>
>> #+end_src
>> #+begin_src sh :exports
>> both
>>   ls
>> -l
>> #+end_src
>> ===
>>
>> Note that this works fine as long as the =:exports= tag for the =emacs-lisp=
>> code block is *NOT* =both= or =results=.  Also note that the value of the
>> =:exports= tag on the =sh= code block is irelevant for this error to
>> appear.  Also, it doesn't have to be this particular combination of
>> =emacs-lisp= and =sh= blocks; for instance it fails with an =emacs-lisp= and
>> a =python= source block.
>>
>
> I can't reproduce this bug, try setting `org-confirm-babel-evaluate' to
> nil.
>
> Best -- Eric
>
>>
>> Is this a bug?
>>
>> Chris
>
> ___
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] inserting images in HTML export

2011-02-21 Thread Julian Burgos
Dear list,

Here is another of my newbie questions.

As many others, I´m exploring ways to export my nice org-mode document
(with R code that generates output and graphs) into word or open
office.  My colleagues do not use org mode or LaTex, so I need to
generate a word or open office document .  It doesn´t have to be
pretty, as it is only for reviewing purposes, but needs to include all
figures and tables.

It seems that the easiest way to go is to export HTML and read it
directly with Word.  My only problem is that I cannot figure out how
to make org mode generate an HTML document with the figures embedded
in it.  Instead, I get hyperlinks to the figures.  I´ve tried adding
this to my emacs file:

(setq org-export-html-inline-images t)

but had no luck.

Here is an example on how I am inserting the images in my org-mode
file.  When exporting to LaTex everything works fine.

#+CAPTION: Estimated effects of bottom type and Modiolus on Actinaria abundance.
#+LABEL: fig:Acgam
#+ATTR_LaTeX: width=14cm
[[./images/Actinaria_gamplots.pdf]]

Many thanks for any guidance,


-- 
Julian Mariano Burgos
Hafrannsóknastofnunin/Marine Research Institute
Skúlagata 4, 121 Reykjavík, Iceland
Sími/Telephone : +354-5752037
Bréfsími/Telefax:  +354-5752001
Netfang/Email: jul...@hafro.is, jmbur...@uw.edu

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: Context-sensitive word count in org mode (elisp)

2011-02-21 Thread Samuel Wales
Out of curiosity, has anybody compared the results that this provides
with exporting to HTML, rendering with a browser (including
emacs-w3m), and counting words that way?

-- 
The Kafka Pandemic:
http://thekafkapandemic.blogspot.com/2010/12/welcome-to-kafka-pandemic-two-forces_9182.html
I support the Whittemore-Peterson Institute (WPI)
===
I want to see the original (pre-hold) Lo et al. 2010 NIH/FDA/Harvard MLV paper.

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] inserting images in HTML export

2011-02-21 Thread Erik Iverson

I think this is simply because you're generating a PDF, which
can't really be displayed 'in html'.  Try generating a bitmap
format such as PNG.  That should work!

On 02/21/2011 05:26 PM, Julian Burgos wrote:

Dear list,

Here is another of my newbie questions.

As many others, I´m exploring ways to export my nice org-mode document
(with R code that generates output and graphs) into word or open
office.  My colleagues do not use org mode or LaTex, so I need to
generate a word or open office document .  It doesn´t have to be
pretty, as it is only for reviewing purposes, but needs to include all
figures and tables.

It seems that the easiest way to go is to export HTML and read it
directly with Word.  My only problem is that I cannot figure out how
to make org mode generate an HTML document with the figures embedded
in it.  Instead, I get hyperlinks to the figures.  I´ve tried adding
this to my emacs file:

(setq org-export-html-inline-images t)

but had no luck.

Here is an example on how I am inserting the images in my org-mode
file.  When exporting to LaTex everything works fine.

#+CAPTION: Estimated effects of bottom type and Modiolus on Actinaria abundance.
#+LABEL: fig:Acgam
#+ATTR_LaTeX: width=14cm
[[./images/Actinaria_gamplots.pdf]]

Many thanks for any guidance,





___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] bug: footnotes look in comments

2011-02-21 Thread Samuel Wales
If you put a commented partial footnote in an org file and export, the
exported text will be corrupted.

Example:

This is a line of text.
#(fn::this is a footnote

===

If you later have a link in the text, a closing bracket in the link
will put the output out of order.

Thanks.

Samuel

-- 
The Kafka Pandemic:
http://thekafkapandemic.blogspot.com/2010/12/welcome-to-kafka-pandemic-two-forces_9182.html
I support the Whittemore-Peterson Institute (WPI)
===
I want to see the original (pre-hold) Lo et al. 2010 NIH/FDA/Harvard MLV paper.

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: question about capture templates

2011-02-21 Thread Filippo A. Salustri
Thanks to everyone for the varied and thoughtful responses.  I didn't think
of backquotes, but I know about them from Scheme, and no, they shouldn't
work in this case.

Very frustrating.  org-capture clearly has the original buffer handy (for %a
stuff) yet I can't get it out of there without hacking the org code, which I
am loathe to do.  Hmmm.  I'll think some more.  If I come up with anything;
I'll report it.

Cheers.
Fil

2011/2/21 Sébastien Vauban 

> Hi Richard,
>
> Richard Lawrence wrote:
> > Sébastien Vauban  writes:
> >> "Filippo A. Salustri" wrote:
> >>> I would really like to be able to vary the file into which a captured
> item
> >>> goes. Specifically, I'd like to insert the item into whatever file I
> was
> >>> visiting when I started the capture.
> >
> >> You have to use backquotes so that expressions are considered as code to
> >> execute, instead of data. See Emacs manual.
> >
> > I'm not sure that backquotes will do what the OP wants. Backquotes will
> > allow the OP to compute the value of a target file at the time the (setq
> > org-capture templates ...) form is evaluated. The OP needs a way to
> > determine the target file at the time of capture (right?), not at the
> time
> > the variable is set.
>
> You're definitely right. I missed the distinction "at Org launch time" vs
> "at
> execution time"... Pull my answer off the records ;-)
>
> Best regards,
>  Seb
>
> --
> Sébastien Vauban
>
>
> ___
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>



-- 
Filippo A. Salustri, Ph.D., P.Eng.
Mechanical and Industrial Engineering
Ryerson University
350 Victoria St, Toronto, ON
M5B 2K3, Canada
Tel: 416/979-5000 ext 7749
Fax: 416/979-5265
Email: salus...@ryerson.ca
http://deseng.ryerson.ca/~fil/
___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: question about capture templates

2011-02-21 Thread Richard Lawrence
"Filippo A. Salustri"  writes:

> org-capture clearly has the original buffer handy (for %a
> stuff) yet I can't get it out of there without hacking the org code, which I
> am loathe to do.

I too was in a situation just today where I was calling org-capture
programatically, and needed access to stuff in the calling environment.
My solution (which may not be very good, and may not work for you) is to
dynamically scope the calling environment stuff that I need into the
org-capture call, like so:

#+begin_src emacs-lisp
; in the calling code, I scope some val I need into `foo...'
(let ((foo some-val-I-need))
  (org-capture nil "tm"))
#+end_src

Then, in the template identified by "tm", I have S-expression expansion
that operates on foo, even though it wasn't explicitly passed as a
parameter, e.g.:

* My capture template
  The car of foo is %(car foo).
  The cdr of foo is %(cdr foo).
  %a
  etc. ...

This works well enough for me, though it may feel kind of icky, since
from the template writer's perspective, `foo' looks like a global
variable whose value could be coming from anywhere. Accordingly, then,
this solution is mostly useful if you know that you're going to be using
the template via custom Elisp calls to org-capture, and not via the
usual capture interface, so that you can guarantee that `foo' has a
useful value when the template is expanded.

One gotcha: S-expressions in templates are apparently always evaluated
as function calls -- you can't just directly access a string value, like
%(foo).

Hope that's helpful!

Richard

P.S. Since you say you have Scheme experience: note that this solution
would NOT work in Scheme, since Scheme, unlike Emacs Lisp, is lexically
scoped.


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: question about capture templates

2011-02-21 Thread Nick Dokos
Filippo A. Salustri  wrote:


> Very frustrating.  org-capture clearly has the original buffer handy (for %=
> a
> stuff) yet I can't get it out of there without hacking the org code, which =
> I
> am loathe to do.  Hmmm.  I'll think some more.  If I come up with anything;
> I'll report it.
> 

The original buffer is accessible in the capture context using

(org-capture-get :original-buffer)

as Carsten pointed out in the following post:

http://thread.gmane.org/gmane.emacs.orgmode/35759/focus=35799

HTH,
Nick

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode