[O] Problem with ditaa when doing export from command line

2011-06-10 Thread Herbert Sitz
I'm trying to do an export by calling emacs from the command line like so:

emacs -batch --visit=myfilename --funcall org-export-as-html

The export works fine except the ditaa png from ditaa source block doesn't get
created.

I've run the export from within emacs and the ditaa png does get created.  The
export also stops to present me with dialog asking whether I want to process the
ditaa code, to which I respond Yes.  I don't get any dialog when I do the export
from the command line.

Is there some way to get the ditaa code working when I do the export from the
command line.

I'm running this on Windows7 if that makes any difference.

Thanks,

Herb




Re: [O] Problem with ditaa when doing export from command line

2011-06-10 Thread Carsten Dominik
Hi Herbert,

On Jun 10, 2011, at 9:33 AM, Herbert Sitz wrote:

 I'm trying to do an export by calling emacs from the command line like so:
 
 emacs -batch --visit=myfilename --funcall org-export-as-html

maybe you need to do

emacs -batch --visit=myfilename --eval '(setq org-confirm-babel-evaluate nil)' 
--funcall org-export-as-html

Also, note that when you run emacs with -batch, you init file is *not* 
evaluated,
so it does not help to have settings there..  Any settings you need must be 
on the command line,
of in a separate file that you will load with

   emacs -batch -l settings.el .

For some background info on the prompt about evaluation, check out

http://orgmode.org/manual/Code-evaluation-security.html#Code-evaluation-security

- Carsten

P.S.  How is the VIM port coming along?


 
 The export works fine except the ditaa png from ditaa source block doesn't get
 created.
 
 I've run the export from within emacs and the ditaa png does get created.  The
 export also stops to present me with dialog asking whether I want to process 
 the
 ditaa code, to which I respond Yes.  I don't get any dialog when I do the 
 export
 from the command line.
 
 Is there some way to get the ditaa code working when I do the export from the
 command line.
 
 I'm running this on Windows7 if that makes any difference.
 
 Thanks,
 
 Herb
 
 

- Carsten






[O] info documentation not in sync with pdf

2011-06-10 Thread Rainer M Krug
On Thu, Jun 9, 2011 at 5:37 PM, Eric Schulte schulte.e...@gmail.com wrote:

 Hi Rainer,

 There is a section on the :padline header argument in the Specific
 Header Arguments section of the Org-mode documentation, however you
 most likely need a more recent version of the documentation loaded.

 This header and documentation were added in March.


I am using  Org-mode version 7.5 (release_7.5.360.g374b7) and I found it in
the info documentation, but it is not in the pdf.

and I used the following script, to update it:

###
#!/bin/sh
cd ~/.emacs.d/org-mode-git/org-mode

# git clone git://repo.or.cz/org-mode.git
git pull
git gc

make clean
make
make doc
make info
###

and as far as I am aware, make doc is creating the pdf - and there is also
an org.log, which does not show any errors.

Strange - any ideas?

Rainer


 ,
 | commit d0a4ed53f16ec84e042e7bb845ea80f6377c30cc
 | Author: Eric Schulte schulte.e...@gmail.com
 | Date:   Tue Mar 15 11:11:26 2011 -0600
 |
 | ob: new header argument `padline' controls newline padding around
 tangled code
 |
 | * lisp/ob-tangle.el (org-babel-spec-to-string): Check value of
 padline
 |   on tangling, no longer use the now-removed variable
 |   `org-babel-tangle-pad-newline'.
 | * lisp/ob.el (org-babel-header-arg-names): Add padline to the list of
 |   header argument names.
 |   (org-babel-default-header-args): Set the default value of padline
 to
 |   yes.
 |   (org-babel-merge-params): Cleaned up the merge logic, added
 padline.
 | * doc/org.texi (padline): Documentation of the new padline header
 |   argument.
 |
 `

 Best -- Eric

 Rainer M Krug r.m.k...@gmail.com writes:

  On Thu, Jun 9, 2011 at 4:46 PM, Eric Schulte schulte.e...@gmail.com
 wrote:
 
  Rainer M Krug r.m.k...@gmail.com writes:
 
   Hi
  
   when tangling the following with Org-mode version 7.5
   (release_7.5.358.g5194), test.R begins with an empty line - but when
   tangling with 7.5, it does not start with an empty line.
  
   The empty line occurs *after* the shebang. Empty lines are usually not
 a
   problem, but I am using
   http://orgmode.org/worg/org-contrib/babel/examples/Rpackage.html for
 a
   package, and this empty line makes my DESCRIPTION file invalid.
   For the moment I am reverting to 7.5, but it would be great if this
 could
  be
   fixed.
  
   * test
   #+begin_src R :tangle test.R :shebang
   This is
   a test
   #+end_src
  
 
  Hi Rainer,
 
  I actually believe that the current behavior is the more correct
  behavior, however I'm not sure if the default padding behavior is
  technically specified when no :padline header argument is given.
 
  The following combination of header arguments results in the desired
  behavior.  Note that the shebang line isn't required, I was just using
  it to easily view file contents and to see if an empty line was inserted
  between shebang and contents.
 
 
  Thanks - that is working. But :padline does not seem to be in the manual?
 
  Thanks for your help,
 
  Rainer
 
 
 
  #+begin_src R :tangle test.R :shebang #!/bin/cat :padline no
  This is
  a test
  #+end_src
 
  Best -- Eric
 
  --
  Eric Schulte
  http://cs.unm.edu/~eschulte/
 

 --
 Eric Schulte
 http://cs.unm.edu/~eschulte/




-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology,
UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :   +33 - (0)9 53 10 27 44
Cell:   +33 - (0)6 85 62 59 98
Fax (F):   +33 - (0)9 58 10 27 44

Fax (D):+49 - (0)3 21 21 25 22 44

email:  rai...@krugs.de

Skype:  RMkrug


Re: [O] Agenda Bulk Scatter bug

2011-06-10 Thread Carsten Dominik
Hi, I need a few testers:  Something very strange is going on here.

When I evaluate this form

(decode-time (days-to-time (time-to-days (current-time


I get a date in the year 3980.  I think this used to work.
Is there anyone who has an idea what is going on here?

Thanks

- Carsten

On Jun 4, 2011, at 6:54 AM, Robert Cunningham wrote:

 for a few weeks now, and including the git commit 
 af677f6d0667bacba72defeaee7e76557e68f8c8 that I last tested, the Agenda Bulk 
 Scatter (BS) has had a bug whereby items it reschedules have the DATE lost.
 
 As an example
 SCHEDULED 2011-12-12
 
 ends up as
 
 SCHEDULED 
 
 after BS
 
 
 org-mode 7.5 did not have the problem
 
 
 Cheers,
 
 RJ Cunningham
 

- Carsten






Re: [O] Audio/video file playback in org mode

2011-06-10 Thread Michael Brand
Hi Paul

Thank you very much for sharing this, I will benefit a lot and the
interactivity from within Emacs seems extremely useful. My recent
searches for how to play an Org link to an audio file didn't find any
result and I was about to work out something with mpg123. I planned to
define a new link type for this but your solution with file: looks
to me more like it should be and is also backwards compatible with
links already made with file:.

And even better if file: could also cover my requirement to have an
optional link search part that lets the player start and stop at a
specified time. Let me define the format like this:
- start to play in file at 00:03:21, stop at 00:06:54:
  [[file:some_podcast.mp3::00:03:21-00:06:54]]
- start to play in file at 00:03:21, play until end of file:
  [[file:some_podcast.mp3::00:03:21]]
- play the whole file:
  [[file:some_podcast.mp3]]

I would like to explicitly not allow [[file:some_podcast.mp3::03:21]]
as a shorter option with MM:SS because I would like to see XX:XX being
reserved for HH:MM without exception in Org. There was a recent
discussion covering this in the context of time calculation:
http://thread.gmane.org/gmane.emacs.orgmode/39487/focus=39840

Michael

On Thu, Jun 9, 2011 at 23:55, Paul Sexton psex...@xnet.co.nz wrote:
 I have spent a few hours figuring this out so I thought I would post it for
 the benefit of others.

 I am learning a language, and wanted to include hyperlinks to audio files
 within my org document, and be able to play each file by clicking on the
 link.

 I eventually discovered the variable 'org-file-apps' which allows you to
 associate particular applications with particular file types.

 I am using Bongo (https://github.com/dbrock/bongo) as the media player.
 EMMS is another actively developed media player, but setup looked too
 complicated at first glance.

 I am using MPlayer as the actual media player. This supports almost all
 audio and video file formats. Most importantly, it works on Windows as well
 as on Linux (VLC has a Windows port but it doesn't work with Bongo as the
 'fake-tty' interface is not implemented on Windows.)

 My current setup means that clicking on a link such as [[file:song.mp3]]
 adds it to the active Bongo playlist (in another buffer) and immediately
 starts playing it. Playback can be paused, fast-forwarded etc using
 Bongo.

 When Bongo plays a file it puts some icons in the modeline that
 resemble the 'play', 'stop' etc symbols, and can be used to control
 playback using the mouse. I found these worked erratically outside
 the actual Bongo playlist buffer, so I have instead bound some
 org-mode keys (ctrl + numpad keys) to the relevant functions.
 This is optional of course.

 I have only tested this with mp3 files, but it ought to work with
 video as well.


 My setup follows:
 ---

 ;;; Part 1. Bongo setup

 (add-to-list 'load-path /path/to/bongo))
 (autoload 'bongo bongo
  Start Bongo by switching to a Bongo buffer. t)

 (setq bongo-mplayer-program-name
      (case system-type
        ((windows-nt cygwin) c:\\Program Files\\MPlayer for 
 Windows\\MPlayer.exe)
        (t mplayer)))

 (setq bongo-enabled-backends '(mplayer))

 ;;; Part 2. Org setup

 (defvar av-file-regex
  (concat \\. (regexp-opt
                 (append bongo-audio-file-name-extensions
                         bongo-video-file-name-extensions)) $))

 (add-to-list 'org-file-apps
             (cons av-file-regex '(org-play-media-file file)))

 (defun org-play-media-file (filename)
  (with-bongo-buffer
    (bongo-insert-file filename)
    (backward-char)
    (bongo-play)))

 ;;; Part 3. Keybindings to allow control of playback within Org buffer
 ;;; (optional)

 ;; Numpad Ctrl-0: pause/resume
 (define-key org-mode-map (kbd C-kp-0) 'bongo-pause/resume)
 (define-key org-mode-map (kbd C-kp-insert) 'bongo-pause/resume)
 ;; Numpad Ctrl-.: stop current track, or restart from beginning if stopped
 (define-key org-mode-map (kbd C-kp-decimal) 'bongo-start/stop)
 (define-key org-mode-map (kbd C-kp-delete) 'bongo-start/stop)
 ;; Numpad Ctrl-PgUp, Ctrl-PgDn: raise/lower volume
 (define-key org-mode-map (kbd C-kp-prior) 'bongo-volume-raise)
 (define-key org-mode-map (kbd C-kp-next) 'bongo-volume-lower)
 (define-key org-mode-map (kbd C-kp-9) 'bongo-volume-raise)
 (define-key org-mode-map (kbd C-kp-3) 'bongo-volume-lower)
 ;; Numpad Ctrl-left, Ctrl-right: skip back/forward 10 seconds
 (define-key org-mode-map (kbd C-kp-left) 'bongo-seek-backward-10)
 (define-key org-mode-map (kbd C-kp-right) 'bongo-seek-forward-10)
 (define-key org-mode-map (kbd C-kp-4) 'bongo-seek-backward-10)
 (define-key org-mode-map (kbd C-kp-6) 'bongo-seek-forward-10)



Re: [O] Agenda Bulk Scatter bug

2011-06-10 Thread David Edmondson
* carsten.domi...@gmail.com [2011-06-10 Fri 09:20]
 Hi, I need a few testers:  Something very strange is going on here.

 When I evaluate this form

 (decode-time (days-to-time (time-to-days (current-time

 I get a date in the year 3980.  I think this used to work.
 Is there anyone who has an idea what is going on here?

(decode-time (days-to-time (time-to-days (current-time
 = (0 0 1 10 6 3980 2 t 3600)

With GNU Emacs 24.0.50.1 (x86_64-pc-linux-gnu, GTK+ Version 2.20.1) of
2011-02-10 on keller, modified by Debian.

(time-to-days) returns the number of days since 0001-12-31bce, which
(days-to-time) converts into a time value. That time value is relative
to 0001-12-31bce, _not_ relative to 1970-01-01, which is what
(decode-time) is expecting.

Hence you end up 1970 years out.




[O] Link translation in the HTML exporter

2011-06-10 Thread Horace Dynamite

Hello,

I must have done something stupid here, because everything used to work 
perfectly until I tried setting up Org publisher stuff.


My problem is that when I insert a link using C-c l in Emacs, everything 
is fine. I can click on it within Emacs and note that its there. After 
an HTML export, the link is broken, the exporter doesn't appear to be 
properly translating directory separators (for Windows) any more.


Example,

The result of C-c l is [[file:~/Notes/chuck.jpg]], the link works from 
within Emacs.


I run the HTML exporter.

The link is exported to this in the HTML source,

img  src=c:/Documents and Settings/Horace/My Documents/Notes/chuck.jpg  
c:/Documents%20and%20Settings/Charles/My%20Documents/Notes/chuck.jpgalt=c:/Documents and 
Settings/Horace/My Documents/Notes/chuck.jpg/


That didn't happen before I started fiddling. The only option I have in 
the preamble is LaTeX:nil. The only configuration related to org-publish 
is setting a project alist. I experience this problem both using the 
HTML exporter directly with C-c C-e h and with the org-publish-project 
command.


Thank you for reading,

Horace.



Re: [O] Link translation in the HTML exporter

2011-06-10 Thread Horace Dynamite

On 10/06/2011 12:19, Horace Dynamite wrote:

Hello,

I must have done something stupid here, because everything used to 
work perfectly until I tried setting up Org publisher stuff.



I'm not sure what was going on, but it's working now.

Sorry about this post.

Horace.



Re: [O] Auto-Fill (aka Word Wrap) of Headline Text

2011-06-10 Thread Darlan Cavalcante Moreira


Yes, the best way is to start the TODO description in the next line without
the the stars (otherwise it would be another headline). I usually try to
create short headlines, specially if that headline has a bunch of tags. For
instance
: * TODO Some TODO item
:   Some length description of that TODO item or some steps I need to do
:   to. Here I can use auto-fill without a problem,

If the reason you wanted a long TODO item is to provide enough information
in the agenda, then tags and the CATEGORY property are a better option
IMHO.

For simpler TODO items (that is, no schedule, deadlines, tags, etc) you may
prefer a list with check-boxes such as
: - [ ] This may also be used as a king of TODO item. Notice that
:   differently from headlines you can use auto-fill here without any
:   problem.
: - [X] You can toggle the state as done and not done with C-c C-c in
:   the first line.

I find lists with check-boxes specially useful when I have TODO items that
can be broken down into a sequence of steps. In that case I create the TODO
item and put the bullet list inside. Such as
: * TODO Some task [/]
:   - [ ] Step 1
:   - [ ] Step 2
:   - [ ] Etc.
If you put [/] in the TODO headline then whenever you mark one step as
done with C-c C-c then org will update it to [1/3] and so on.

Of course you can also use sub-headlines also with the TODO keyword for the
steps if that is better for you. Then you can schedule each step
separately, for instance. In that case it starts to look more like a
project then a simple task, but just do the way that fits better for you.

--
Darlan

At Fri, 10 Jun 2011 00:12:12 -0400,
Lex Fridman lexfrid...@gmail.com wrote:
 
 So, for a to-do list, if I want to write a lengthy description for a
 to-do item, do I need to start the description on the next line
 without the stars (*) at the beginning?
 
 I guess that makes sense. See, I thought of the headlines more as a
 bulleted list and not just a section heading tree...
 
 If you have any suggestions or guidance, let me know. Either way,
 thanks for the sanity check.
 
 - Lex
 
 On Thu, Jun 9, 2011 at 11:58 PM, Darlan Cavalcante Moreira
 darc...@gmail.com wrote:
 
  I think this is the correct behaviour, since headlines cannot span multiple
  lines (as far as I know).
 
  This is also the case for the fill-paragraph command. If you try to call
  fill-paragraph in a headline nothing happens.
 
  --
  Darlan
 
  At Thu, 9 Jun 2011 17:56:02 -0400,
  Lex Fridman lexfrid...@gmail.com wrote:
 
  I enable auto-fill (aka word wrap) with:
  (add-hook 'org-mode-hook 'turn-on-auto-fill)
 
  Now, while editting an org file, I check the minor modes with C-h m,
  and Auto-Fill is one of them. So when I type a long line it should
  automatically wrap, right? It does for regular text but NOT for when
  it's a headline (line starts with one or more *'s).
 
  I'm sorry if this is a trivial question, but I simply have not been
  able to find a solution. I'm using org-mode version 7.4 in emacs
  23.2.1 on Ubuntu 11.04.
 
 



Re: [O] [Bug] [Patch] List number start with the latex exporter

2011-06-10 Thread Nicolas Goaziou
Hello,

Darlan Cavalcante Moreira darc...@gmail.com writes:

 When using a numbered list it is possible to specify the start number using
 [@number] so that one can write
   1. one
   2. two
   20. [@20] twenty
   21. twenty one

 This works OK with the HTML exporter, but in the latex exporter
 the number will be one unity above the desired value.

 The reason why this happens is because the \item command in the enumerate
 environment in latex increments the counter before using it. Therefore,
 org-mode should set the enumeration counter to the desired value minus one.

 A patch is attached for the lisp/org-list.el file.

Thank you! Patch applied.

Regards,

-- 
Nicolas Goaziou



Re: [O] Auto-Fill (aka Word Wrap) of Headline Text

2011-06-10 Thread Jambunathan K

You can turn on longlines-mode. I see that fontification of the
headlines doesn't continue on to the continuation line. Nevertheless it
would permit having long headlines while having the convenience of it
(visually) wrapped around.

Jambunathan K.


Lex Fridman lexfrid...@gmail.com writes:

 So, for a to-do list, if I want to write a lengthy description for a
 to-do item, do I need to start the description on the next line
 without the stars (*) at the beginning?

 I guess that makes sense. See, I thought of the headlines more as a
 bulleted list and not just a section heading tree...

 If you have any suggestions or guidance, let me know. Either way,
 thanks for the sanity check.

 - Lex

 On Thu, Jun 9, 2011 at 11:58 PM, Darlan Cavalcante Moreira
 darc...@gmail.com wrote:

 I think this is the correct behaviour, since headlines cannot span multiple
 lines (as far as I know).

 This is also the case for the fill-paragraph command. If you try to call
 fill-paragraph in a headline nothing happens.

 --
 Darlan

 At Thu, 9 Jun 2011 17:56:02 -0400,
 Lex Fridman lexfrid...@gmail.com wrote:

 I enable auto-fill (aka word wrap) with:
 (add-hook 'org-mode-hook 'turn-on-auto-fill)

 Now, while editting an org file, I check the minor modes with C-h m,
 and Auto-Fill is one of them. So when I type a long line it should
 automatically wrap, right? It does for regular text but NOT for when
 it's a headline (line starts with one or more *'s).

 I'm sorry if this is a trivial question, but I simply have not been
 able to find a solution. I'm using org-mode version 7.4 in emacs
 23.2.1 on Ubuntu 11.04.





-- 



[O] [PATCH] doc bug [was: info documentation not in sync with pdf]

2011-06-10 Thread Nick Dokos
Rainer M Krug r.m.k...@gmail.com wrote:

 On Thu, Jun 9, 2011 at 5:37 PM, Eric Schulte schulte.e...@gmail.com wrote:
 
  Hi Rainer,
 
  There is a section on the :padline header argument in the Specific
  Header Arguments section of the Org-mode documentation, however you
  most likely need a more recent version of the documentation loaded.
 
  This header and documentation were added in March.
 
 
 I am using  Org-mode version 7.5 (release_7.5.360.g374b7) and I found it in
 the info documentation, but it is not in the pdf.
 

Doc bug:

diff --git a/doc/org.texi b/doc/org.texi
index eb97759..7caf680 100644
--- a/doc/org.texi
+++ b/doc/org.texi
@@ -12410,6 +12410,7 @@ references in the code block body in link comments.
 @end itemize
 
 @node padline, no-expand, comments, Specific header arguments
+@subsubsection @code{:padline}
 Control in insertion of padding lines around code block bodies in tangled
 code files.  The default value is @code{yes} which results in insertion of
 newlines before and after each tangled code block.  The following arguments
 

Nick




Re: [O] Problem with ditaa when doing export from command line

2011-06-10 Thread Herbert Sitz
Carsten Dominik carsten.dominik at gmail.com writes:

 On Jun 10, 2011, at 9:33 AM, Herbert Sitz wrote:
 
  I'm trying to do an export by calling emacs from the command line like so:
  
  emacs -batch --visit=myfilename --funcall org-export-as-html
 
 maybe you need to do
 
 emacs -batch --visit=myfilename --eval '(setq org-confirm-babel-evaluate nil)'
--funcall org-export-as-html
 

After adding the eval switch the export terminates shortly after starting.  I
get messages:
-
Adding c:/Program Files (x86)/Emacs/EmacsW32/lisp/ to load-path
OVERVIEW
End of file during parsing
-

Same message has happened in several files, doesn't matter whether there's ditaa
code block in .org file or not.  I also get basically same result if I load my
.emacs file explicitly, although in that case I see some 'Loading . . .'
messages before OVERVIEW and End of file message.


 Also, note that when you run emacs with -batch, you init file is *not*
evaluated, . . . 

Thanks for those tips, had forgotten about loading of settings, though .emacs
was still getting loaded. . .

 
 P.S.  How is the VIM port coming along?
 

It's coming along slowly but fairly steadily.  I'm trying to wrap up the current
loose ends and get a major update out.  For first time I will have menu system
and some (very) basic documentation.  Lack of discoverability and docs have
(understandably) hindered adoption for many people so far, I think.

Regards,

Herb







Re: [O] Define capture template with dynamic id target

2011-06-10 Thread Darlan Cavalcante Moreira

Thanks David,

I tried to follow your suggestion, but I found two problems (maybe because
I know little about lisp).

For instance, suppose I have a test.org file with the follow content
--8---cut here---start-8---
* 2011
  Every headline has an ID, but I have omitted here for brevity
*** May
* Sub-headline
  bla bla bla
*** June
* Sub-headline
  bla bla bla
--8---cut here---end---8---

I want the capture process to add an entry to the Sub-headline of June. If
I just use the file+headline and specify Sub-headline then it will add to
the Sub-headline in May. That's why I tried using IDs in the first
place. Also, every month I create a new month headline with the
Sub-headline and the capture process should add an entry to that
instead. That is the reason I wanted to get the ID from a function, instead
of just writing it in the capture template.


As far as I understand if I use the file+function target then the function
must return the headline name, but how can I say that I want the
Sub-headline of June and not of May? [first problem]

I found an org-id-find function that returns something like
(filename . characterPosition). Therefore, If there is a way to specify a
position where org should start looking for the headline then I could use
that to go to the correct Sub-headline.


Also, the file+headline target will add the entry as a child of the
specified headline, but file+function seems to add the entry as a sibling
of the headline returned by the function. [second problem] Is this intended
behaviour or is it a bug?

--
Thanks again,
Darlan


At Fri, 10 Jun 2011 07:31:43 +0200,
David Maus dm...@ictsoc.de wrote:
 
 [1  text/plain; US-ASCII (7bit)]
 At Thu, 09 Jun 2011 15:18:00 -0300,
 Darlan Cavalcante Moreira wrote:
 
 
  Hello List,
 
  I'm trying to create a few templates for org capture and I have found a
  weird behavior with the ID target type. It works OK if I use the ID
  directly like below
  #+begin_src emacs-lisp
(id Junho2011Contas)
  #+end_src
  but it does not find the ID if I try to get it from a function, such as
  #+begin_src emacs-lisp
(id (get-me-an-org-id-for-the-month Contas))
  #+end_src
 
 Org capture does not support executing a function in the ID target spec.
 
 C-h v org-capture-templates RET
 
 target   Specification of where the captured item should be placed.
  In Org-mode files, targets usually define a node.  Entries will
  become children of this node, other types will be added to the
  table or list in the body of this node.
 
  Most target specifications contain a file name.  If that file
  name is the empty string, it defaults to 
 `org-default-notes-file'.
  A file can also be given as a variable, function, or Emacs Lisp
  form.
 
  Valid values are:
 
  (file path/to/file)
  Text will be placed at the beginning or end of that file
 
  (id id of existing org entry)
  File as child of this entry, or in the body of the entry
 
  ...
 
 You might use the `function' target spec
 
  (function function-finding-location)
 Most general way, write your own function to find both
 file and location
 
 HTH,
   -- David
 --
 OpenPGP... 0x99ADB83B5A4478E6
 Jabber dmj...@jabber.org
 Email. dm...@ictsoc.de
 [2  application/pgp-signature (7bit)]
 



Re: [O] Problem with ditaa when doing export from command line

2011-06-10 Thread Herbert Sitz
Herbert Sitz hsitz at nwlink.com writes:

 
 Thanks for those tips, had forgotten about loading of settings, though .emacs
 was still getting loaded. . .
 

That was a typo, meant to say, I thought .emacs was still getting loaded.




Re: [O] Audio/video file playback in org mode

2011-06-10 Thread brian powell
* Something like this; respectively!?:

[[shell:mplayer -ss 00:03:21 -endpos 00:06:54 ~/some_podcast.mp3 ]]

[[shell:mplayer -ss 00:03:21 ~/some_podcast.mp3 ]]

[[shell:mplayer ~/some_podcast.mp3 ]]

VLC works great for this too.

[[file:...] works too of course, but you have to make a file association
(or like mentioned: 'org-file-apps') to mplayer or emacs OrgMode will just
open the file in a buffer.

Unclear about statement about earlier posts: I would like to explicitly not
allow...

P.S. Thanks for the link to BONGO--the EMACS buffer media player.
I made my own buffer media player and have used it for many years; but,
BONGO.el is wayly kuul too!


On Fri, Jun 10, 2011 at 4:28 AM, Michael Brand
michael.ch.br...@gmail.comwrote:

 Hi Paul

 Thank you very much for sharing this, I will benefit a lot and the
 interactivity from within Emacs seems extremely useful. My recent
 searches for how to play an Org link to an audio file didn't find any
 result and I was about to work out something with mpg123. I planned to
 define a new link type for this but your solution with file: looks
 to me more like it should be and is also backwards compatible with
 links already made with file:.

 And even better if file: could also cover my requirement to have an
 optional link search part that lets the player start and stop at a
 specified time. Let me define the format like this:
 - start to play in file at 00:03:21, stop at 00:06:54:
  [[file:some_podcast.mp3::00:03:21-00:06:54]]
 - start to play in file at 00:03:21, play until end of file:
  [[file:some_podcast.mp3::00:03:21]]
 - play the whole file:
  [[file:some_podcast.mp3]]

 I would like to explicitly not allow [[file:some_podcast.mp3::03:21]]
 as a shorter option with MM:SS because I would like to see XX:XX being
 reserved for HH:MM without exception in Org. There was a recent
 discussion covering this in the context of time calculation:
 http://thread.gmane.org/gmane.emacs.orgmode/39487/focus=39840

 Michael

 On Thu, Jun 9, 2011 at 23:55, Paul Sexton psex...@xnet.co.nz wrote:
  I have spent a few hours figuring this out so I thought I would post it
 for
  the benefit of others.
 
  I am learning a language, and wanted to include hyperlinks to audio files
  within my org document, and be able to play each file by clicking on the
  link.
 
  I eventually discovered the variable 'org-file-apps' which allows you to
  associate particular applications with particular file types.
 
  I am using Bongo (https://github.com/dbrock/bongo) as the media player.
  EMMS is another actively developed media player, but setup looked too
  complicated at first glance.



[O] Checkboxes and state toggling

2011-06-10 Thread Klaus Thoben
Dear List,
I wonder if following functionality is already implemented.

Could it be achieved that, if I have a checkbox list with a TODO state
in the headline and I toggle all of the checkboxes, that the TODO state
switches automatically to DONE?

I hope the following example makes my question even more clear. 

 * TODO Organize party [1/4]
   - [ ] call people
   - [X] order food
   - [ ] think about what music to play
   - [ ] talk to the neighbors

becomes

 * DONE Organize party [4/4]
   - [X] call people
   - [X] order food
   - [X] think about what music to play
   - [X] talk to the neighbors

Cheers,
Klaus




Re: [O] Adding xmpfilter as a results type

2011-06-10 Thread Eric Schulte
Hi Avdi,

Good idea!  This was easy to implement (the hardest part was installing
rcodetools).  The current Org-mode git head now supports a new result
type xmp which behaves as follows...

  #+begin_src ruby :results xmp code
2 + 2 # =
3.times{ puts :hello }
  #+end_src

  #+results:
  #+BEGIN_SRC ruby
  2 + 2 # = 4
  3.times{ puts :hello }
  #  hello
  #  hello
  #  hello
  #+END_SRC

Cheers -- Eric

Avdi Grimm gro...@inbox.avdi.org writes:

 Something I've been thinking about lately...

 If you have used Ruby you might be familiar with the 'xmpfilter'
 command which comes in the 'rcodetools' package. It's a filter that
 annotates a source file with the results of expressions, so:

 1 + 1 # =

 When run through xmpfilter would become:

 1 + 1 # = 2

 There's already an rcodetools.el which makes it pretty easy to run
 xmpfilter over the current region, or a whole buffer of Ruby code. But
 it would be sweet if this could become an alternate :results type for
 Ruby source listings, so I could just hit C-c C-c and get the
 xmpfilter version of the code.

 Any thoughts on how to make this work?

-- 
Eric Schulte
http://cs.unm.edu/~eschulte/



Re: [O] Status google calendar sync

2011-06-10 Thread Stephen Eglen
Was there any update regarding this interesting topic?  I'm keen to get
something working - what is current best practice for getting
.ics files made by org put onto google calendar, so that I can view them
on android?

Thanks, Stephen



Konrad Hinsen konrad.hin...@fastmail.net writes:

 On 14 Feb 2011, at 22:39, Marcelo de Moraes Serpa wrote:

 This would be awesome, and I think this is the path the emacs
 developers should take -- separating emacs into two, the GUI and the
 core elisp interpreter. I'm sure this wouldn't be easy, but imagine

 Emacs already has a batch mode, and very different GUI layers
 (terminal, X11, Mac, Windows), so I'd suspect that a no GUI version
 that can be compiled anywhere would not be so difficult. It may be
 more difficult to make a separate GUI layer, but that wouldn't be very
 important either from a practical point of view.

 BTW, another Emacs GUI I'd like to see is a Web-based one. Imagine
 connecting to your home machine from a Web browser and getting access
 to a copy of Emacs running there!

 Konrad.

 ___
 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: [O] Status google calendar sync

2011-06-10 Thread Arun Persaud
Hi

On 06/10/2011 09:58 AM, Stephen Eglen wrote:
 Was there any update regarding this interesting topic?  I'm keen to get
 something working - what is current best practice for getting
 .ics files made by org put onto google calendar, so that I can view them
 on android?
 
 Thanks, Stephen

Have a look at:

http://orgmode.org/worg/org-tutorials/org-google-sync.html

The above works well for me, so I haven't changed anything on it
recently, but let us know in case something doesn't work for you and we
can see if we can fix it.

Arun



Re: [O] Problem with ditaa when doing export from command line

2011-06-10 Thread Nick Dokos
Herbert Sitz hs...@nwlink.com wrote:

 Carsten Dominik carsten.dominik at gmail.com writes:
 
  On Jun 10, 2011, at 9:33 AM, Herbert Sitz wrote:
  
   I'm trying to do an export by calling emacs from the command line like so:
   
   emacs -batch --visit=myfilename --funcall org-export-as-html
  
  maybe you need to do
  
  emacs -batch --visit=myfilename --eval '(setq org-confirm-babel-evaluate 
  nil)'
 --funcall org-export-as-html
  
 
 After adding the eval switch the export terminates shortly after starting.  I
 get messages:
 -
 Adding c:/Program Files (x86)/Emacs/EmacsW32/lisp/ to load-path
 OVERVIEW
 End of file during parsing
 -
 
 Same message has happened in several files, doesn't matter whether there's 
 ditaa
 code block in .org file or not.  I also get basically same result if I load my
 .emacs file explicitly, although in that case I see some 'Loading . . .'
 messages before OVERVIEW and End of file message.
 
 
  Also, note that when you run emacs with -batch, you init file is *not*
 evaluated, . . . 
 
 Thanks for those tips, had forgotten about loading of settings, though .emacs
 was still getting loaded. . .
 

Works fine for me here, so there is probably a syntax error in the lisp
file(s) you load or the lisp code you eval - try using a minimal setup
file as shown below:

GNU Emacs 24.0.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.22.0) of 
2011-04-13
Org-mode version 7.5 (baseline.273.g889a48)


I do

   emacs -batch --visit=foo.org  -l export.el --funcall org-export-as-html


with export.el containing the following:

--8---cut here---start-8---
(setq org-confirm-babel-evaluate nil)
(require 'ob-ditaa)
(setq org-babel-temporary-directory tmp)
(setq org-ditaa-jar-path /home/nick/elisp/org-mode/contrib/scripts/ditaa.jar)
--8---cut here---end---8---


and foo.org containing the following:

--8---cut here---start-8---

* Export a picture

Need to load ob-ditaa to execute these:

#+begin_src ditaa :file image.png :cmdline -r :exports both
+-+
| cBLU|
| |
|++
||cPNK|
|||
+++
#+end_src

#+results:
[[file:image.png]]


#+begin_src ditaa :file image2.png :cmdline -r :exports both
++   +---++---+
|| --+ ditaa +-- |   |
|  Text  |   +---+|diagram|
|Document|   |!magic!||   |
| {d}|   |   ||   |
+---++   +---++---+
: ^
|   Lots of work  |
+-+
#+end_src

#+results:
[[file:image2.png]]

#+begin_src ditaa :file image3.png :cmdline -r :exports both
/\/-\
| cRED   | - | cBLU|
| page   ||  page   |
||| table   |
\/| |
  | |
  \-/

#+end_src

#+results:
[[file:image3.png]]
--8---cut here---end---8---


Nick



Re: [O] Checkboxes and state toggling

2011-06-10 Thread Nick Dokos
Klaus Thoben o22mailinglis...@imap.cc wrote:

 I wonder if following functionality is already implemented.
 
 Could it be achieved that, if I have a checkbox list with a TODO state
 in the headline and I toggle all of the checkboxes, that the TODO state
 switches automatically to DONE?
 
 I hope the following example makes my question even more clear. 
 
  * TODO Organize party [1/4]
- [ ] call people
- [X] order food
- [ ] think about what music to play
- [ ] talk to the neighbors
 
 becomes
 
  * DONE Organize party [4/4]
- [X] call people
- [X] order food
- [X] think about what music to play
- [X] talk to the neighbors
 

Here is one way to do that - cobbled together with various bits and
pieces that I found in org.el and org-list.el. In particular, I stole
the regexp from org.el where it is used to check how to fontify the
cookie. I used the org-get-checkbox-statistics-face function as a model
for the ``(if (match-end 1) ...'' structure afterwards (all I had to
do is the (org-todo 'done) calls instead of returning a face).

The initial part limiting the region is pretty standard org code: you'll
find  variations of it all over the place.

#+begin_src emacs-lisp
(add-to-list 'org-checkbox-statistics-hook (function 
ndk/checkbox-list-complete))

(defun ndk/checkbox-list-complete ()
  (save-excursion
(org-back-to-heading t)
(let ((beg (point)) end)
  (end-of-line)
  (setq end (point))
  (goto-char beg)
  ;; check for the cookie: [100%] or [N/N]
  (if (re-search-forward 
\\[\\([0-9]*%\\)\\]\\|\\[\\([0-9]*\\)/\\([0-9]*\\)\\] end t)
(if (match-end 1)
(if (equal (match-string 1) 100%)
;; all done - do the state change
(org-todo 'done))
  (if (and ( (match-end 2) (match-beginning 2))
   (equal (match-string 2) (match-string 3)))
  ;; all done - do the state change   
  (org-todo 'done
#+end_src

Nick








Re: [O] lists in tables

2011-06-10 Thread Michael Brand
Hi Uwe

On Thu, Jun 9, 2011 at 22:27, Uwe Brauer o...@mat.ucm.es wrote:
 And there is now easy way to allow more than one line per row?

No, there is no easy way.

The question is, what should be a row delimiter in a table. The answer
for an Org table is, each newline is also the end of the table row. Of
course it would be neat to enhance the Org table format with ... why
not the broken pipe ¦ to continue a multiline field
|+|
| field @1$1 | field @1$2 |
| field @2$1 | field @2$2 |
¦¦ automatically  ¦
¦¦ wraps over 3 lines ¦
| field @3$1 | field @3$2 |
|+|
|| 18   |
|+|
but this would mean a tremendous effort
- in extending the user interface (not the only question: in the same
  table you want some fields to wrap and some to truncate, right?
  (just kidding))
- in implementation
- in keeping all this consistent again

BTW the function org-table-wrap-region does only spread the contents
of _several table rows_ into again _several table rows_. Even that
function can not change that still one text line is one table row.

When I take notes only for myself I write sometimes
|--+|
| my_field_1_1 in @1$1 | my_field_1_2 in @1$2   |
| my_field_2_1 in @2$1 | my_field_2_2 pretends to wrap over |
|  | \ three lines but is just 3 fields |
|  | \ @2$2..@4$2 with one line each|
| my_field_3_1 in @5$1 | my_field_3_2 in @5$2   |
|--+|
with the help of the function org-table-wrap-region and manually
readjust \. But most of the useful things except e. g. auto
alignment of the table frames can not be used: S-up/S-down, export
of the table or spreadsheet and much more.

Look also here for more and how other people work around:
http://thread.gmane.org/gmane.emacs.orgmode/37756
http://thread.gmane.org/gmane.emacs.orgmode/31402/focus=31443
http://thread.gmane.org/gmane.emacs.orgmode/14630

Michael



Re: [O] Status google calendar sync

2011-06-10 Thread Stephen Eglen
Thank you very much Arun, this page looks great:

 http://orgmode.org/worg/org-tutorials/org-google-sync.html

When going from org - google, do I need to do anything about using
org-icalendar-store-UID?  I'd rather not have to populate my org files
with :ID: entries.

Stephen




[O] Can you clock two tasks at once?

2011-06-10 Thread Mark S.
Hi all,

Is there a way to clock two tasks at once?

I'm multitasking ;-)

Actually, sometimes a sub-part of task will have additional costs. Or you need 
to capture what part of your day is spent on the phone. Or you have someone 
else working for you. Lots of reasons to have a second clock running.

Mark



Re: [O] Status google calendar sync

2011-06-10 Thread Arun Persaud
Hi

 When going from org - google, do I need to do anything about using
 org-icalendar-store-UID?  I'd rather not have to populate my org files
 with :ID: entries.

I don't... however, I have to admit that I don't really know that much
about .ics files and the use of UID. The setup at the moment just works
for me and the appointments I want show up in google calendar (only ones
with a start and end time). One issue I still have is that they only
show up in an extra calendar and I have to copy them by hand into my
main calendar (so that other people can see them too)... this is ok for
me, since I don't have too many entries that go from org-google, mostly
I use the other direction google-org.

So there is still lots of room for improvement ;)

Anyway, here is the relevant part from my .emacs file just in case

;;; org - google export via .ics
(setq org-icalendar-use-UTC-date-time nil)
(setq org-icalendar-timezone America/Los_Angeles)

(defun org-mycal-export-limit ()
  Limit the export to items that have a date, time and a range. Also
exclude certain categories.
  (setq org-tst-regexp \\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} ...
[0-9]\\{2\\}:[0-9]\\{2\\}[^\r\n]*?\\))
  (setq org-tstr-regexp (concat org-tst-regexp --?-? org-tst-regexp))
  (save-excursion
; get categories
(setq mycategory (org-get-category))
; get start and end of tree
(org-back-to-heading t)
(setq mystart(point))
(org-end-of-subtree)
(setq myend  (point))
(goto-char mystart)
; search for timerange
(setq myresult (re-search-forward org-tstr-regexp myend t))
; search for categories to exclude
(setq mycatp (member mycategory org-export-exclude-category))
; return t if ok, nil when not ok
(if (and myresult (not mycatp)) t nil)))

(defun org-mycal-export ()
  (let ((org-icalendar-verify-function 'org-mycal-export-limit))
(org-export-icalendar-combine-agenda-files)))

and I export via a cron script doing

emacs --batch -l ~/.emacs  --eval '(defun ask-user-about-lock (file opp)
nil)' -f org-mycal-export

cheers
ARUN



Re: [O] Literate Programming - Continue a Source Block?

2011-06-10 Thread Eric Schulte

 I like the concision of the =original-name syntax used by noweb, but I
 would lean towards the use of a :noweb-append type header argument as
 suggested above because currently the names of blocks in Babel carry no
 semantic content and I'd prefer to leave it this way.

 I suppose it may also break compatibility in case someone out there uses
 the =symbol.

 Had it been thought of earlier, I would have preferred the default
 behavior being append if you have multiple blocks of the same name, and
 an explicit option *not* to append but to overwrite, but your idea makes
 the most sense with respect to preserving backward compatibility. 

 In addition to append, there probably should be another option for
 overwriting instead of appending (neither is possible right now).


I've just pushed up a patch which implements optional block combination
during tangling.  Specifically a new customization variable named
`org-babel-tangle-named-block-combination' is introduced which can take
the following values

nilthe default, no behavior is changed

append the bodies of all blocks of the same name are appended
   during tangling

first  only the body of the first block of any given name is kept
   during tangling

last   only the body of the last block of any given name is kept during
   tangling


 Also, just on the side, I'm not sure it's documented anywhere what
 happens if you have multiple source code blocks of the same name. At the
 moment, it seems only the first is used (I would have expected the
 last). 


Yes, currently block names are intended to be unique, and some of the
Babel functionality (e.g., named block evaluation) make this assumption.

The behavior of multiple blocks with the same name is undefined
behavior.  I've expanded the relevant documentation.


 Thanks for the motivating example and the thorough explanation of
 behavior.

 I'll certainly put this on my long-term development queue, however, that
 does not guarantee an implementation in the near future.  If anyone is
 interested in this functionality and is up for writing some elisp I am
 happy to offer advice and code pointers immediately.

 Wish I knew elisp. Anyway, hopefully someone will get it done one day.


Hopefully this gets at the behavior you're after.  I'd be interested to
hear any thought you have on this new functionality.

Cheers -- Eric

-- 
Eric Schulte
http://cs.unm.edu/~eschulte/



Re: [O] Problem with ditaa when doing export from command line

2011-06-10 Thread Herbert Sitz
Nick Dokos nicholas.dokos at hp.com writes:
 Works fine for me here, so there is probably a syntax error in the lisp
 file(s) you load or the lisp code you eval - try using a minimal setup
 file as shown below:
 
 
 I do
 
emacs -batch --visit=foo.org  -l export.el --funcall org-export-as-html
 
 with export.el containing the following:
 
 --8---cut here---start-8---
  setq org-confirm-babel-evaluate nil)
  require 'ob-ditaa)
  setq org-babel-temporary-directory tmp)
setq org-ditaa-jar-path /home/nick/elisp/org-mode/contrib/scripts/ditaa.jar)
 --8---cut here---end---8---
 

Nick -- Thanks very much, I did get it working with your help.  

However I could not get it to work if I used an --eval in the 
command line, had to move the assignment into setting.el to get it to work.  
Did you get it to work with an --eval statement in the command line?

-- Herb





Re: [O] Agenda Bulk Scatter bug

2011-06-10 Thread Achim Gratz
Carsten Dominik carsten.domi...@gmail.com writes:

 When I evaluate this form

 (decode-time (days-to-time (time-to-days (current-time


 I get a date in the year 3980.  I think this used to work.
 Is there anyone who has an idea what is going on here?

If I evaluate this form in the scratch buffer (no org-mode loaded), I get the
following backtrace:

  debug(error (error Invalid time specification))
  decode-time((968068 42752))
  eval((decode-time (days-to-time (time-to-days ...
  eval-last-sexp-1(t)
  eval-last-sexp(t)
  eval-print-last-sexp()
  call-interactively(eval-print-last-sexp nil nil)

(version)
GNU Emacs 23.2.1 (i586-suse-linux-gnu, GTK+ Version 2.22.1)
 of 2011-06-07 on build40

(current-time)
(19954 27377 237772)
(time-to-days (current-time))
734298
(days-to-time (time-to-days (current-time)))
(968068 42752)
 ^^
this doesn't fit into a 16bit integer...


Achim.
-- 
+[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]+

Waldorf MIDI Implementation  additional documentation:
http://Synth.Stromeko.net/Downloads.html#WaldorfDocs




Re: [O] Literate Programming - Continue a Source Block?

2011-06-10 Thread Achim Gratz
Eric Schulte schulte.e...@gmail.com writes:

 append the bodies of all blocks of the same name are appended
during tangling

Shouldn't this be called concat(enate) or collate?  Or, since
several blocks with the same name seem a bit dubious, would it not be
cleaner to have an index part to the block name and a range expression
for the concatenation during tangling?  I might want to tangle them in
different order than their appearance in the source, for instance.


Achim.
-- 
+[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]+

SD adaptations for Waldorf Q V3.00R3 and Q+ V3.54R2:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada




Re: [O] Problem with ditaa when doing export from command line

2011-06-10 Thread Nick Dokos
Herbert Sitz hs...@nwlink.com wrote:

 Nick Dokos nicholas.dokos at hp.com writes:
  Works fine for me here, so there is probably a syntax error in the lisp
  file(s) you load or the lisp code you eval - try using a minimal setup
  file as shown below:
  
  
  I do
  
 emacs -batch --visit=foo.org  -l export.el --funcall org-export-as-html
  
  with export.el containing the following:
  
  --8---cut here---start-8---
   setq org-confirm-babel-evaluate nil)
   require 'ob-ditaa)
   setq org-babel-temporary-directory tmp)
 setq org-ditaa-jar-path 
 /home/nick/elisp/org-mode/contrib/scripts/ditaa.jar)
  --8---cut here---end---8---
  
 
 Nick -- Thanks very much, I did get it working with your help.  
 
 However I could not get it to work if I used an --eval in the 
 command line, had to move the assignment into setting.el to get it to work.  
 Did you get it to work with an --eval statement in the command line?
 

That's probably a quoting problem (you are on Windoze, right?) The command line
on Windoze sucks raw eggs (well, not just the command line, but I'm biased :-).

On Linux, I used two kinds of quotes in order to protect the vulnerable 
characters
inside each lisp sexp (you could also use backslashes strategically):

   emacs -batch --visit foo.org --eval '(setq org-confirm-babel-evaluate nil)'\
--eval (require 'ob-ditaa)\
--eval '(setq org-babel-temporary-directory 
tmp)'\
--eval '(setq org-ditaa-jar-path 
/home/nick/elisp/org-mode/contrib/scripts/ditaa.jar)'\
--funcall org-export-as-html

Inconvenient, but it works.

Nick




Re: [O] Agenda Bulk Scatter bug

2011-06-10 Thread Nick Dokos
Achim Gratz strom...@nexgo.de wrote:

 (version)
 GNU Emacs 23.2.1 (i586-suse-linux-gnu, GTK+ Version 2.22.1)
  of 2011-06-07 on build40
 
 (current-time)
 (19954 27377 237772)
 (time-to-days (current-time))
 734298
 (days-to-time (time-to-days (current-time)))
 (968068 42752)
  ^^
 this doesn't fit into a 16bit integer...
 

That's what I thought at first too, until I read David Edmondson's mail:
He points out that decode-time assumes seconds since the Unix epoch
whereas time-to-days calculates the offset in days since early CE, hence the
calculation is off by 1970 years.

I did a git blame on time-to-days and days-to-time and nothing seems to
have changed recently, so I'd guess Carsten just misremembered.

Nick




Re: [O] Can you clock two tasks at once?

2011-06-10 Thread Bernt Hansen
Mark S. throa...@yahoo.com writes:

 Hi all,

 Is there a way to clock two tasks at once?

 I'm multitasking ;-)

 Actually, sometimes a sub-part of task will have additional costs. Or
 you need to capture what part of your day is spent on the phone. Or
 you have someone else working for you. Lots of reasons to have a
 second clock running.

 Mark



No, you can only clock one thing at a time.  Nothings stops you from
creating a tree for your clocked project where some clocked phone
subtasks are under the tree so the time is appropriately allocated.

Clocking is set up for a single user currently.

-- 
Bernt



Re: [O] Literate Programming - Continue a Source Block?

2011-06-10 Thread Eric Schulte
Achim Gratz strom...@nexgo.de writes:

 Eric Schulte schulte.e...@gmail.com writes:

 append the bodies of all blocks of the same name are appended
during tangling

 Shouldn't this be called concat(enate) or collate?

I think append is just as clear as concatenate, and collate implies
shuffling which is not happening.

 Or, since several blocks with the same name seem a bit dubious, would
 it not be cleaner to have an index part to the block name and a range
 expression for the concatenation during tangling?  I might want to
 tangle them in different order than their appearance in the source,
 for instance.


I'm wary of adding too much duplicate functionality.  It is already
possible to organize the tangling of many named code blocks using noweb
reference expansion (a feature which I've used myself on real projects
in the past).  This existing method allows for unique block names and
for arbitrary tangling order.

Simplicity is the only reason that the new name-based appending behavior
was implemented, simplicity which (in my opinion) is lost when the user
defines a naming and sorting schema.

Cheers -- Eric



 Achim.

-- 
Eric Schulte
http://cs.unm.edu/~eschulte/



Re: [O] Problem with ditaa when doing export from command line

2011-06-10 Thread Herbert Sitz
Nick Dokos nicholas.dokos at hp.com writes:
That's a quoting problem (you are on Windoze, right?) The command line
on Windoze sucks raw eggs (well, not just the command line, but I'm biased .

You are correct, sir!  Thanks, it is indeed a quoting problem.

 
 On Linux, I used two kinds of quotes in order to protect the 
 vulnerable characters
 inside each lisp sexp (you could also use backslashes strategically):
 
emacs -batch --visit foo.org --eval '(setq org-confirm-babel-evaluate 
 nil)'\
 --eval (require 'ob-ditaa)\
 --eval '(setq org-babel-temporary-directory
tmp)'\
 --eval '(setq org-ditaa-jar-path
/home/nick/elisp/org-mode/contrib/scripts/ditaa.jar)'\
 --funcall org-export-as-html
 
 Inconvenient, but it works.

Okay, here's what seems to work on Windoze.  Don't laugh:

emacs -batch --visit foo.org ^
   --eval ^(setq org-confirm-babel-evaluate nil)^ ^
   --eval ^(require 'ob-ditaa)^ ^
   --eval ^(setq org-babel-temporary-directory \^tmp\^)^ ^
   --eval ^(setq org-ditaa-jar-path \^/home/nick/elisp/org-mode
/contrib/scripts/ditaa.jar\^)^ ^
   --funcall org-export-as-html

There is actually some reason to the rhyme, which is explained here:
http://blogs.msdn.com/b/twistylittlepassagesallalike/archive/2011/04/23/everyone-quotes-arguments-the-wrong-way.aspx

Thanks again.

-- Herb







Re: [O] Agenda Bulk Scatter bug

2011-06-10 Thread Michael Brand
Hi Carsten

On Fri, Jun 10, 2011 at 10:20, Carsten Dominik
carsten.domi...@gmail.com wrote:
 When I evaluate this form
 (decode-time (days-to-time (time-to-days (current-time
 I get a date in the year 3980.  I think this used to work.
 Is there anyone who has an idea what is going on here?

Same here (except the I think this used to work) on GNU Emacs 23.3.1
x86_64-apple-darwin that is 64 bit and has also the famous time_t with
64 bits. The error reported by others comes from time_t with 32 bits.
decode-time checks for overflow of time_t before either passing it to
the system call localtime(const time_t *), or giving the error.

But since it's only a mismatch of current-time with base 1970 and
time-to-days with base 1bec, is
(decode-time (days-to-time (- (time-to-days (current-time))
(time-to-days '(0 0)
what you need? Why the *days* function, for some rounding?

Michael



Re: [O] Passing font size to exported LaTeX table

2011-06-10 Thread Suvayu Ali
Hello everyone,

On Wed, 1 Jun 2011 12:08:25 -0700
Suvayu Ali fatkasuvayu+li...@gmail.com wrote:

 On Wed, 01 Jun 2011 14:50:34 -0400
 Nick Dokos nicholas.do...@hp.com wrote:
 
  soapbox I've tried to keep a neutral tone in (most of) the rest of
  the mail, but I have to say that I think clever hacks like this are
  too clever for their own good - they are at best an accident of
  implementation. The fact that the trick uses the placement option in
  order to change the font testifies to that.
 
 After the very clear description above, I agree 100%. I will remove my
 addition to the manual and instead try to improve the #+ATTR_LaTeX:
 documentation based on your code commentary. At the moment I am
 facing a very important deadline for the 8th of June, I will submit a
 revised patch after that.
 

I have attached a patch removing the hack from the manual and making
some other small improvements to the latex export of images. However I
did leave in one sentence regarding the placement option which alludes
that a hack is possible.

Please let me know if this is an improvement.

  They should certainly be documented as hacks on Worg, but I'm not
  sure they should be documented in the manual. Of course, it may
  happen that a really good hack (by some definition of really
  good) should be elevated to a standard and documented in the
  manual, but IMO this one does not qualify. /soapbox
  
 
 Along with the revisions for the manual, I will document my hack on
 Worg.

I made an account with repo.or.cz. I will soon push the changes
documenting the hack on Worg.

-- 
Suvayu

Open source is the future. It sets us free.
From 7f66dba736136fc1a2ee8e2d4fbce47e07db3ca6 Mon Sep 17 00:00:00 2001
From: Suvayu Ali (ThinkPad) fatkasuvayu+li...@gmail.com
Date: Fri, 10 Jun 2011 14:57:48 -0700
Subject: [PATCH] Improve Images in LaTeX export documentation

* Mention use of keywords like multicolumn and float
* Remove previous mention of hack with placement option
  as per comments on the mailing list. Hack better
  suited for Worg.
---
 doc/org.texi |   30 --
 1 files changed, 12 insertions(+), 18 deletions(-)

diff --git a/doc/org.texi b/doc/org.texi
index 92343de..c98bd53 100644
--- a/doc/org.texi
+++ b/doc/org.texi
@@ -10207,24 +10207,14 @@ output file resulting from @LaTeX{} processing.  Org 
will use an
 @code{\includegraphics} macro to insert the image.  If you have specified a
 caption and/or a label as described in @ref{Images and tables}, the figure
 will be wrapped into a @code{figure} environment and thus become a floating
-element.  You can use an @code{#+ATTR_LaTeX:} line to specify the various
-options that can be used in the optional argument of the
-@code{\includegraphics} macro.  To modify the placement option of the
-@code{figure} environment, add something like @samp{placement=[h!]} to the
-Attributes. It is to be noted this option can be used with tables as well.
-The options are passed as the placement option to floating environments like
-@code{figure} or @code{table}. One can pass other compatible options as well.
-For example the @code{#+ATTR_LaTeX:} line below is exported as the
-@code{figure} environment below it.
-
-@cindex #+ATTR_LaTeX
-@example
-#+ATTR_LaTeX: placement=[options]\footnotesize
-
-\begin@{figure@}[options]\footnotesize
-...
-\end@{figure@}
-@end example
+element.  You can use an @code{#+ATTR_LaTeX:} line to specify various other
+options.  You can ask org to export an image as a float without specifying
+a label or a caption by using the keyword @code{float} in this line.  Various
+optional arguments to the @code{\includegraphics} macro can also be specified
+in this fashion.  To modify the placement option of the floating environment,
+add something like @samp{placement=[h!]} to the attributes.  It is to be noted
+this option can be used with tables as well.  One can also pass other
+compatible options.
 
 If you would like to let text flow around the image, add the word @samp{wrap}
 to the @code{#+ATTR_LaTeX:} line, which will make the figure occupy the left
@@ -10246,6 +10236,10 @@ for @code{\includegraphics} and @code{wrapfigure}.
 [[./img/hst.png]]
 @end example
 
+If you wish to include an image which spans multiple columns in a page,
+you can use the keyword @code{multicolumn} in the @code{#+ATTR_LaTeX}
+line. This will export the image wrapped in a @code{figure*} environment.
+
 If you need references to a label created in this way, write
 @samp{\ref@{fig:SED-HR4049@}} just like in @LaTeX{}.
 
-- 
1.7.4.4



Re: [O] Literate Programming - Continue a Source Block?

2011-06-10 Thread Neeum Zawan
Eric Schulte schulte.e...@gmail.com writes:

 I like the concision of the =original-name syntax used by noweb, but I
 would lean towards the use of a :noweb-append type header argument as
 suggested above because currently the names of blocks in Babel carry no
 semantic content and I'd prefer to leave it this way.

 I suppose it may also break compatibility in case someone out there uses
 the =symbol.

 Had it been thought of earlier, I would have preferred the default
 behavior being append if you have multiple blocks of the same name, and
 an explicit option *not* to append but to overwrite, but your idea makes
 the most sense with respect to preserving backward compatibility. 

 In addition to append, there probably should be another option for
 overwriting instead of appending (neither is possible right now).


 I've just pushed up a patch which implements optional block combination
 during tangling.  Specifically a new customization variable named
 `org-babel-tangle-named-block-combination' is introduced which can take
 the following values

This does solve the problems I have, but I think the noweb-append header
option discussed earlier is much more flexible. The potential problems
with a custom variable is that it can't be set at a per-buffer or
per-document level. I was thinking along the lines of:

:noweb-append option

where option is one of:

- nil (the default)

- append (appends to the block of the same name as it is up to that
  point in the document - acts as nil if this is the first block of that
  name).

- overwrite (overwrites the block as it is up to that point - acts as
  nil if this is the first block).

I think these three provide all the abilities of what you proposed, but
allows for much more. Some additional benefits:

1. Can be set at a per-buffer level or a per-block level. 

2. Can selectively append/overwrite. One scenario where this would be
   useful is where you may have had some source blocks that had been
   appended, but then later on as the project evolves, you decide to
   rewrite much of that code. You can then just do an overwrite
   (i.e. erases all that you had up to that point), and then again allow
   for the new code to be evolved with possible future appends (so
   multiple appends/overwrites in one document). You may have reason to
   keep the old code in the document for some reason or other. If that
   didn't make sense I can explain in more detail.

 Hopefully this gets at the behavior you're after.  I'd be interested to
 hear any thought you have on this new functionality.

I don't want to make it sound like I'm complaining above. What you've
proposed probably takes care of my current needs (and I imagine is a bit
easier to code than what I've proposed) - but I just think having a new
header for the source block would make it much more flexible. 

I haven't yet tried the new patch - I'll have to figure out how to do a
custom babel install (at the moment I get it via orgmode which is
installed system-wide). Is it possible for me to just install babel in
my custom emacs directory and not have it impact other aspects of
org-mode? 

Thanks for the quick commit!

-- 
My neighbor has a circular driveway. He never leaves home.


 




Re: [O] Literate Programming - Continue a Source Block?

2011-06-10 Thread Neeum Zawan
Achim Gratz strom...@nexgo.de writes:

 Eric Schulte schulte.e...@gmail.com writes:

 append the bodies of all blocks of the same name are appended
during tangling

 several blocks with the same name seem a bit dubious, would it not be
 cleaner to have an index part to the block name and a range expression
 for the concatenation during tangling?  I might want to tangle them in
 different order than their appearance in the source, for instance.

For my purposes, an index would be too much to maintain, and while I
wouldn't mind it as an option, I wouldn't want to *have* to use them if
all I want is to append and/or overwrite. 

The solution I proposed in my response to Eric may meet you halfway
there in some ways.

When I initially wrote about this problem, my goal was simply to enable
what could easily be done with noweb (and of course, I actually had a
need for it). I actually have very little experience with LP, so I don't
know in practice what will work and what won't.

The initial benefit that I can see with indexing is that one may want to
add some lines in the middle of a block. However, this can only really
work if you just happen to end/begin your source blocks at that
point. If you didn't know in advance that you'd add some lines in the
middle, then you likely didn't end/begin your blocks at that point, and
you'll have to go and artificially begin/end your blocks there. This may
seem confusing to a reader, so it makes sense to put an explicit noweb
style reference. 

If, on the other hand, you knew it in advance, you probably should put
the noweb reference any way.

My comments are from the perspective of my use case for LP, and I can
see people may use LP for other reasons, so if you have a better
scenario, let us know.








Re: [O] Audio/video file playback in org mode

2011-06-10 Thread Paul Sexton
Thanks Michael, I'm glad you think it will be helpful. I have implemented
something like what you have requested here. I have hived this code off 
into a separate file called org-player.el.

You can get it at:

http://bitbucket.org/eeeickythump/org-player/

I intend to add it to worg in the next little while.

Links can now contain times to start playback, as follows:

[[file:/path/to/song.mp3::2:43]]  Starts playback at 2 min 43 sec.
[[file:/path/to/song.mp3::1:10:45]]   Starts playback at 1 hr 10 min 45 sec.
[[file:/path/to/song.mp3::3m15s]] Starts playback at 3 min 15 sec.
[[file:/path/to/song.mp3::49s]]   Starts playback at 0 min 49 sec.
[[file:/path/to/song.mp3::1h21m10s]]  Starts playback at 1 hr 21 min 10 sec.

As you see I have made XX:YY mean minutes and seconds, as it seems more 
logical to me for this particular purpose. If there is a compelling reason 
to interpret XX:YY as hours and minutes in these links then I am not totally
 opposed to changing it, but I think many people would find it confusing and 
counterintuitive.

In all cases playback continues until the end of the file. I couldn't find 
a way to implement playback of 'snippets' with a specified start and end 
time, unfortunately.

Cheers
Paul







Re: [O] Audio/video file playback in org mode

2011-06-10 Thread Paul Sexton
brian powell briangpowellms at gmail.com writes:


 * Something like this; respectively!?: 
 
 [[shell:mplayer -ss 00:03:21 -endpos 00:06:54 ~/some_podcast.mp3 ]]
 [[shell:mplayer -ss 00:03:21 ~/some_podcast.mp3 ]]
 [[shell:mplayer ~/some_podcast.mp3 ]]

The troubles with using shell commands in hyperlinks:
1. Only works in the operating system and directory structure where
   you were when you wrote the link;
2. No ability to stop playback, pause, etc, unless you run the
   program as a GUI, which means (horror!) doing something outside 
   Emacs.

 VLC works great for this too.

In windows VLC works as a shell command, but doesn't work with Bongo.

 P.S. Thanks for the link to BONGO--the EMACS buffer media player.
 I made my own buffer media player and have used it for many years; but,
BONGO.el is wayly kuul too!

You're welcome. Are you aware of EMMS, it seems to be Bongo's main rival (I
haven't tried it).

Paul





Re: [O] org-agenda-custom-commands have a serious bug!?

2011-06-10 Thread zw963

thanks everyone~
additional to a 'g' shortcut key is work fine.

i know kill-buffer is not appropriate in this situation,
but I define shortcut key 'f2' - kill-this-buffer.
and I have a habit use f2 to close current window buffer. 
 RET--open heading buffer-- make change -- f2 kill-buffer,
and return the org-agenda view.

error occur in this case.

thanks.

2011-06-11 



zw963 



发件人: Nick Dokos 
发送时间: 2011-06-09  22:24:50 
收件人: zw963 
抄送: nicholas.dokos; emacs-orgmode 
主题: Re: [O] org-agenda-custom-commands have a serious bug!? 
 
zw963 zw...@163.com wrote:
 i have use org-agenda-custom-commands manage my thought and idea.
 when open my agenda custom view, I often require modified some heading 
 content. 
 when I use org-agenda-switch-to (shortcut key enter) open and make changes,
 save and kill this buffer return to org-agenda-command window, move point to 
 other heading, 
 but it have a error tips.wrong type argument: stringp,nil
 if i try to open other heading use enter,I open a unpredictable org buffer.
 what a horrible.
 
 only I quit org-agenda-commands buffer, and reenter,i can work file.
 
I can't reproduce this with the standard agenda view on Org-mode version
7.5 (baseline.265.gcfb05)
If it requires the custom agenda view to reproduce, you have to provide that.
What version of orgmode are you using? See section 1.4, Feedback, of the
manual on how to report a bug.
Nick