[O] [babel] ob-C.el annoyances

2011-04-15 Thread Julien Fantin
Hi list, hi Eric,

I've been using ob-C to go through the KR book, and I've noticed a few
annoyances along the way.

* Use of the captial C identifier 

Support functions are defined as ob-C-*. In consequence, I need to
#+begin_src C to get a block to execute, because #+begin_src c fails
with No org-babel-execute function for c!. The problem is that I can't
edit the block since there is no C-mode. Defining an alias fixed the
issue, but it doesn't work OOTB, and doesn't feel like a good solution
at all.

Is there a reasoning behind this, or where you, as I suspect, trying to
define some support functions that would work for both C and C++ ?


* Feeding text into blocks

This is not directly related to ob-C.el, but I was looking for a way to
feed some text to a block's STDIN while it was executed by babel.  I
wanted to specifiy this text either inline from the block's header
arguments or from a dedicated text block.

It'd ideally look like this :

** Inline

#+begin_src c :feed foo bar
int main(void) {
while ((c = getchar()) != EOF) {
putchar(c);
}
return 0;
}
#+end_src

#+results:
: foo bar

** From a text block

#+source: my-stdin
#+begin_src text
foo bar
#+end_src

#+begin_src c :feed my-stdin
int main(void) {
while ((c = getchar()) != EOF) {
putchar(c);
}
return 0;
}
#+end_src

#+results:
: foo bar

TL;DR if this is already possible somehow please skip the following and let
me know :)

I couldn't figure out how to pipe the text from within babel though. So
I resorted to tangling the text blocks, and redefined
org-babel-C-execute to use that new header argument :feed. It gets
prepended to the cmdline in the org-babel-eval function call ; if foo is
an existing file it gets cat'ed through a pipe to the rest of the
cmdline in org-babel-eval, otherwise it is simply echo'ed. This is not
as good as what I described above, but after getting to use it, I really
think a generalization of this use-case is desirable.

Please let me know whar you think.

Regards,
Julien.




Re: [Orgmode] Re: FLOSS Weekly show about Org-mode

2010-09-24 Thread Julien Fantin
Just noticed the interview is available on iTunes.
http://itunes.apple.com/fr/podcast/floss-weekly-136-emacs-org/id368823654?i=87659805

Not sure how I'd watch it if I were on my gnu box though.

Cheers

On Thu, Sep 23, 2010 at 8:57 AM, Carsten Dominik
carsten.domi...@gmail.comwrote:


 On Sep 22, 2010, at 7:49 PM, Memnon Anon wrote:

  Puneeth puncha...@gmail.com writes:

  It was a wonderful interview. Always a pleasure watching Carsten talk
 about org-mode.


 *sigh*, I missed it.
 And my wlan sucks that much, I probably would not have enjoyed a live
 stream.

 So, when can I download the whole thing and watch it after the fact?


 Usually 2 to 3 days...

 - Carsten



 ___
 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


Re: [Orgmode] Re: Repeating tasks on specific days of the week

2010-09-15 Thread Julien Fantin
I had a similar question regarding scheduling habits, but didn't get an
answer...

I haven't done a great job of keeping up with those resolutions for now, but
can anyone confirm that with org-habit, that kind of scheduling will result
in a consistency graph displaying habit completion for that particular day
of the week ?

Cheers,
Julien
On Wed, Sep 15, 2010 at 7:00 AM, Jeff Horn jrhorn...@gmail.com wrote:

 Matt,

 Thanks for confirming that separate repeating tasks is the best solution.

 Best,
 Jeff

 On Mon, Sep 13, 2010 at 2:13 PM, Matt Lundin m...@imapmail.org wrote:
  Jeff Horn jrhorn...@gmail.com writes:
 
  Hi everyone!
 
  I was wondering how to create repeating tasks for, say, Tuesday and
  Thursday at noon. I found this on stack overflow: http://cl.ly/2K8c
 
  Is that really the best answer? Can this not be accomplished with
  symbolic expressions?
 
  Seems like a great feature for academics and students. Surely, I'm
  ignorant, and someone has a better solution than creating multiple
  repeating tasks?
 
  AFAIK, one cannot use complex symbolic expressions with repeating tasks;
  the moment a headline with such an expression is marked done, it is
  removed from the agenda. The only solution, at the moment, is to create
  different entries for each desired day of the week:
 
  --8---cut here---start-8---
  * Tuesday task
   SCHEDULED: 2010-09-14 Tue +1w
 
  * Thursday task
   SCHEDULED: 2010-09-16 Thu +1w
  --8---cut here---end---8---
 
  Best,
  Matt
 



 --
 Jeffrey Horn
 PhD Student in Economics
 George Mason University

 (704) 271-4797
 jh...@gmu.edu
 jrhorn...@gmail.com

 ___
 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: Src blocks fontification issue

2010-09-03 Thread Julien Fantin
Hi Dan,
thanks for the answer and the unsollicited tip :)

I tried opening the file with a bare emacs and the problem persists.

I use true indentation in my files, which I think isn't what most
people do, so maybe the parser gets confused by a combination of
blocks not starting at column 0, and some other formatting, but I'm
failing to see the pattern...

Here is one of the incriminated files:

http://pastebin.com/raw.php?i=yxdUmpKx

Hope this is any help...

Cheers

On Fri, Sep 3, 2010 at 12:48 AM, Dan Davison davi...@stats.ox.ac.uk wrote:
 Julien Fantin julien.fan...@gmail.com writes:

 First congratulations on adding in-line fontification to source
 blocks, that's a great addition.

 However, since I pulled those changes, a recurring issue I've been
 having has become even more annoying.

 When opening an org file, some src blocks headers don't seem to get
 parsed properly, and now as a result, don't get fontified.
 They are functional though, since they properly get tangled, and C-c '
 performs as expected.
 If I edit the header line, or the ones directly before and after it,
 the block gets back to normal.

 Here is a screenshot to make things clearer, as you can see there are
 no differences in formatting, and those properties drawer don't have
 anything weird, just a single ID.

 http://imagebin.org/112413

 I was meaning to post a screenshot with whitespace-mode on to stress
 that there are no apparent formatting differences, but it turned out
 activating it fixed the issue !

 Not sure what I can do to further help debugging this ?

 Hi Julien,

 I don't have any clever ideas about this, so I'm just going to suggest
 the obvious: first a sanity check that it doesn't occur with emacs
 -Q. Then some sort of quasi-binary search through your emacs
 customisations. It looks like you're storing your emacs customisation in
 an Org file, so you can knock out entire trees with :tangle: no
 properties.

 Dan

 p.s. On a completely unrelated note, if you haven't already tried it:

 (add-hook 'emacs-lisp-mode-hook 'pretty-lambdas)

 where the `pretty-lambdas' function is in starter-kit-defuns.org at
 git://github.com/eschulte/emacs-starter-kit.git

 (defun pretty-lambdas ()
  (font-lock-add-keywords
   nil `(((?\\(lambda)
          (0 (progn (compose-region (match-beginning 1) (match-end 1)
                                    ,(make-char 'greek-iso8859-7 107))
                    nil))


 Cheers

 ___
 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


Re: [Orgmode] Re: Native TAB in code blocks

2010-09-03 Thread Julien Fantin
Another great addition Dan, thanks !

Cheers

On Thu, Sep 2, 2010 at 10:36 PM, Dan Davison davi...@stats.ox.ac.uk wrote:
 Carsten Dominik carsten.domi...@gmail.com writes:

 On Thu, Sep 2, 2010 at 9:06 PM, Dan Davison davi...@stats.ox.ac.uk wrote:
 Erik Iverson er...@ccbr.umn.edu writes:

 Dan,

 Thank you to David and yourself for this great feature.  I have
 absolutely no opinion about the default on/off, except to say it
 looks great on.

 Is your TAB key patch[1] in master yet?
 http://www.mail-archive.com/emacs-orgmode@gnu.org/msg28640.html

 Hi Erik,

 Since these[1] changes, language-native TAB can be achieved in code
 blocks via C-c C-v C-x TAB and C-c C-v x TAB. We can add this to
 org-tab-first-hook, controlled by a variable `org-src-tab-acts-natively'
 as below. Carsten -- would you like to add this to Org, or leave it as a
 user customisation?

 I think we can add this to Org.  Maybe default off, for now?

 OK, done. So

 (setq org-src-tab-acts-natively t)

 to turn it on.

 Dan


 - Carten


 Dan


 --8---cut here---start-8---
 diff --git a/lisp/org-src.el b/lisp/org-src.el
 index 6c09cbd..d1948cc 100644
 --- a/lisp/org-src.el
 +++ b/lisp/org-src.el
 @@ -715,6 +715,19 @@ Org-babel commands.
      (call-interactively
       (lookup-key org-babel-map key)

 +(defvar org-src-tab-acts-natively nil
 +  If non-nil, the effect of TAB in a code block is as if it were
 +issued in the language major mode buffer.)
 +
 +(defun org-src-native-tab-command-maybe ()
 +  Perform language-specific TAB action.
 +Alter code block according to effect of TAB in the language major
 +mode.
 +  (and org-src-tab-acts-natively
 +       (org-babel-do-key-sequence-in-edit-buffer (kbd TAB
 +
 +(add-hook 'org-tab-first-hook 'org-src-native-tab-command-maybe)
 +
  (defun org-src-font-lock-fontify-block (lang start end)
   Fontify code block.
  This function is called by emacs automatic fontification, as long
 --8---cut here---end---8---


 Footnotes:

 [1] http://thread.gmane.org/gmane.emacs.orgmode/28950




 Dan Davison wrote:
 I've just pushed changes which mean that Org now fontifies code in code
 blocks. Currently, this is turned on by default, so it would be helpful
 if people could report any problems, and opinions as to whether it
 should be on or off by default.

 To turn it off, use

 (setq org-src-fontify-natively nil)

 With it off, there are two functions for manually fontifying code
 blocks: `org-src-fontify-block' and `org-src-fontify-buffer'.

 With it on, on my netbook, there is a slight delay when typing in code
 blocks of over 100 lines in length, and this is pronounced in code
 blocks of several hundred lines.

 Just to be clear, this is fontification only -- no other language major
 mode features -- so the default method of editing code is still C-c '
 (org-edit-src-code).

 Thanks to David O'Toole for the original patch. The final version of the
 patch is based on Carsten's suggestions for a more efficient
 implementation.

 Dan


 Dan Davison davi...@stats.ox.ac.uk writes:

 Dan Davison davi...@stats.ox.ac.uk writes:

 David O'Toole dto1...@gmail.com writes:

 I've got a preliminary patch that adds optional native fontification
 for source blocks. It uses the block's declared mode to fontify the
 block text. So now blocks look the way they should, and this opens the
 way to further enhancements.
 Hi David,

 This is great! Here's a patch which allows the src blocks to have
 switches and header args, and also uses `org-src-lang-modes' to find the
 major mode.
 I'm resending this as a match against the current master branch, and as
 an attachment so that it goes into the patchwork system. I am keeping
 this line of patches in branch `src-block-fontification' at
 git://github.com/dandavison/org-devel.git

 Dan


 ___
 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



 ___
 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 

[Orgmode] Re: cannot enable org-habit

2010-09-03 Thread Julien Fantin
Joseph, it's already all here, but for the sake of clarity :

;; Enable state logging enable for the TODO state i.e. the ! part
 (setq org-todo-keywords
   (quote
((sequence TODO(t!) NEXT(n!) | DONE(d!))
 (sequence WAIT(w@/!) SOMEDAY(s@/!) | CANCELLED(c@/!)

;; Add it to the list of modules
(add-to-list 'org-modules 'org-habit)

;; And finally require it
(require 'org-habit)

Happy habit monitoring :)
Cheers

On Thu, Sep 2, 2010 at 8:04 PM, Joseph Buchignani
joseph.buchign...@gmail.com wrote:
 Julien, it sounds like you're doing something different than what's in the
 manual.

 Could you paste exactly the code you used in your .emacs to include
 org-habit in the modules list and then activate it? I guess it would be two
 separate lines?

 Thanks,
 JB

 On Fri, Sep 3, 2010 at 1:26 AM, Julien Fantin julien.fan...@gmail.com
 wrote:

 Thanks Noorul, this helped me fix the error, and I now have it working !
 I should mention that I do need to (require 'org-habit) after it's
 been added to the modules list, in order to actually activate it.



 On Thu, Sep 2, 2010 at 7:17 PM, Noorul Islam noo...@noorul.com wrote:
  On Thursday, September 2, 2010, Julien Fantin julien.fan...@gmail.com
  wrote:
  I'm watching this as I wasn't able to enable this module either.
 
  I have state logging enable with :
    (setq org-todo-keywords
          (quote
           ((sequence TODO(t!) NEXT(n!) | DONE(d!))
            (sequence WAIT(w@/!) SOMEDAY(s@/!) |
  CANCELLED(c@/!)
 
  And org-habit is configured with :
   (add-to-list 'org-modules 'org-habit)
 
  Which doesn't seems to work either...
 
  If I try o (require 'org-habit) though, I'll get an error when
  building the agenda with C-c a a :
  org-habit-duration-to-days: Wrong type argument: stringp, nil
 
 
  If you pull the latest version from git repo, you won't get this
  error, instead a meaningful error message will be displayed.
 
  Thanks and Regards
  Noorul
 



 --
 Ignore the following. It is a nonsense sentence that disables Google ads
 from displaying next to my emails by triggering sensitive keywords.

 I enjoy the massacre of ads. This sentence will slaughter ads without a
 messy bloodbath.


___
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: Src blocks fontification issue

2010-09-03 Thread Julien Fantin
I'm sorry if I implied that this issue appeared since your changes
Dan, as it's not the case indeed.

I tried un-indenting the scr block headers, and the problem goes away,
so I'd say it's definitely related to the handling of indented
headers.

I looked at that commit and the regexps do take care of detecting
them, but I'm afraid the code is too involved for me to be of any
help...

I hope this can get fixed, if not I might consider sticking to col 0
for src blocks...

Cheers

On Fri, Sep 3, 2010 at 5:23 PM, Dan Davison davi...@stats.ox.ac.uk wrote:
 Julien Fantin julien.fan...@gmail.com writes:

 I tried opening the file with a bare emacs and the problem persists.

 I use true indentation in my files, which I think isn't what most
 people do, so maybe the parser gets confused by a combination of
 blocks not starting at column 0, and some other formatting, but I'm
 failing to see the pattern...

 Me too. While you may well be right that I have broken something, first
 let's concentrate on what appears to be a long-standing bug; in fact I
 think it has never worked correctly. Basic fontification of src blocks
 elements was introduced over a year ago at this commit

 --8---cut here---start-8---
 commit 476493d3b300b8dc379ea7e42c974461d6f3dfb5
 Author: Carsten Dominik carsten.domi...@gmail.com
 Date:   Sat May 23 22:58:38 2009 +0200

    Fontification: Better treatment of #+ lines and blocks

    The content of blocks like #+begin_example will be marked with a
    separate face.  That same face is also used for single lines
    introducing text for specific backends.
 --8---cut here---end---8---

 Priot to that commit the whole block, and the begin_src end_src lines
 had no special fontification. After that commit, a test file (below)
 based on yours is not correctly fontified on startup. It is correctly
 fontified when font-lock is triggered subsequently by some keyborad
 input nearby. But it seems very sensitive to changes in the test file
 and I haven't worked out what's going on.

 Test file: the final code block is not fontified, nor are the BEGIN_SRC
 and END_SRC lines. (emacs 24, org commit 476493d3b300 and subsequent)

 --8---cut here---start-8---
 * Setup
  #+BEGIN_SRC emacs-lisp
    (add-to-list 'auto-mode-alist '(\\.\\(org\\|org_archive\\|txt\\)$ . 
 org-mode))
    (add-hook 'org-mode-hook
              '(lambda ()
                 (auto-fill-mode t)
                 (define-key org-mode-map (kbd RET) 'org-return-indent)
                 (flyspell-mode 1)))


    ;; windmove fix
    (add-hook 'org-shiftup-final-hook 'windmove-up)
    (add-hook 'org-shiftleft-final-hook 'windmove-left)
    (add-hook 'org-shiftdown-final-hook 'windmove-down)
    (add-hook 'org-shiftright-final-hook 'windmove-right)
  #+END_SRC
 ** Helpers
  #+BEGIN_SRC emacs-lisp
   (defun is-bogus-file-p (file)
     Return t if file is a temporary file as in .#foo or a . .. reference 
 returned by directory-files
     (or (member file '(. ..))
         (string-match ^.#.+ file)))
  #+END_SRC
 * Customization
  #+BEGIN_SRC emacs-lisp
  (setq org-return-follows-link t
        org-special-ctrl-a/e t
        org-special-ctrl-k t
        org-completion-use-ido t
        org-log-into-drawer t
        org-startup-indented nil
        org-hide-leading-stars t
        org-startup-folded t
        org-empty-line-terminates-plain-lists t
        org-adapt-indentation t
        org-yank-folded-subtrees t
        org-M-RET-may-split-line nil
        org-enforce-todo-dependencies t
        org-enforce-todo-checkbox-dependencies t)

  ;; (setq org-blank-before-new-entry '((heading . always)
  ;;                                    (plain-list-item . always)))
  #+END_SRC
 --8---cut here---end---8---


 Dan


 Here is one of the incriminated files:

 http://pastebin.com/raw.php?i=yxdUmpKx

 Hope this is any help...

 Cheers

 On Fri, Sep 3, 2010 at 12:48 AM, Dan Davison davi...@stats.ox.ac.uk wrote:
 Julien Fantin julien.fan...@gmail.com writes:

 First congratulations on adding in-line fontification to source
 blocks, that's a great addition.

 However, since I pulled those changes, a recurring issue I've been
 having has become even more annoying.

 When opening an org file, some src blocks headers don't seem to get
 parsed properly, and now as a result, don't get fontified.
 They are functional though, since they properly get tangled, and C-c '
 performs as expected.
 If I edit the header line, or the ones directly before and after it,
 the block gets back to normal.

 Here is a screenshot to make things clearer, as you can see there are
 no differences in formatting, and those properties drawer don't have
 anything weird, just a single ID.

 http://imagebin.org/112413

 I was meaning to post a screenshot with whitespace-mode on to stress
 that there are no apparent formatting differences, but it turned

Re: [Orgmode] Re: Src blocks fontification issue

2010-09-03 Thread Julien Fantin
Carsten, I'll look into it when I get a chance, even though I doubt
I'll be able to fix it if you describe it as tricky yourself ;)

Any pointers on where to start looking though ?

Cheers

On Fri, Sep 3, 2010 at 7:56 PM, Carsten Dominik
carsten.domi...@gmail.com wrote:

 On Sep 3, 2010, at 5:23 PM, Dan Davison wrote:

 Julien Fantin julien.fan...@gmail.com writes:

 I tried opening the file with a bare emacs and the problem persists.

 I use true indentation in my files, which I think isn't what most
 people do, so maybe the parser gets confused by a combination of
 blocks not starting at column 0, and some other formatting, but I'm
 failing to see the pattern...

 Me too. While you may well be right that I have broken something, first
 let's concentrate on what appears to be a long-standing bug; in fact I
 think it has never worked correctly. Basic fontification of src blocks
 elements was introduced over a year ago at this commit

 --8---cut here---start-8---
 commit 476493d3b300b8dc379ea7e42c974461d6f3dfb5
 Author: Carsten Dominik carsten.domi...@gmail.com
 Date:   Sat May 23 22:58:38 2009 +0200

   Fontification: Better treatment of #+ lines and blocks

   The content of blocks like #+begin_example will be marked with a
   separate face.  That same face is also used for single lines
   introducing text for specific backends.
 --8---cut here---end---8---

 I remember that this was quite tricky to implement, lots of problems because
 you have to scan outside of the range font-lock wants to look at etc.
 Would be great if you could find out how to fix this.

 Before this patch, the text in block would be fontified like org-mode, which
 looked terrible ... :)

 - Carsten



 Priot to that commit the whole block, and the begin_src end_src lines
 had no special fontification. After that commit, a test file (below)
 based on yours is not correctly fontified on startup. It is correctly
 fontified when font-lock is triggered subsequently by some keyborad
 input nearby. But it seems very sensitive to changes in the test file
 and I haven't worked out what's going on.

 Test file: the final code block is not fontified, nor are the BEGIN_SRC
 and END_SRC lines. (emacs 24, org commit 476493d3b300 and subsequent)

 --8---cut here---start-8---
 * Setup
  #+BEGIN_SRC emacs-lisp
   (add-to-list 'auto-mode-alist '(\\.\\(org\\|org_archive\\|txt\\)$ .
 org-mode))
   (add-hook 'org-mode-hook
             '(lambda ()
                (auto-fill-mode t)
                (define-key org-mode-map (kbd RET) 'org-return-indent)
                (flyspell-mode 1)))


   ;; windmove fix
   (add-hook 'org-shiftup-final-hook 'windmove-up)
   (add-hook 'org-shiftleft-final-hook 'windmove-left)
   (add-hook 'org-shiftdown-final-hook 'windmove-down)
   (add-hook 'org-shiftright-final-hook 'windmove-right)
  #+END_SRC
 ** Helpers
  #+BEGIN_SRC emacs-lisp
  (defun is-bogus-file-p (file)
    Return t if file is a temporary file as in .#foo or a . .. reference
 returned by directory-files
    (or (member file '(. ..))
        (string-match ^.#.+ file)))
  #+END_SRC
 * Customization
  #+BEGIN_SRC emacs-lisp
  (setq org-return-follows-link t
       org-special-ctrl-a/e t
       org-special-ctrl-k t
       org-completion-use-ido t
       org-log-into-drawer t
       org-startup-indented nil
       org-hide-leading-stars t
       org-startup-folded t
       org-empty-line-terminates-plain-lists t
       org-adapt-indentation t
       org-yank-folded-subtrees t
       org-M-RET-may-split-line nil
       org-enforce-todo-dependencies t
       org-enforce-todo-checkbox-dependencies t)

  ;; (setq org-blank-before-new-entry '((heading . always)
  ;;                                    (plain-list-item . always)))
  #+END_SRC
 --8---cut here---end---8---


 Dan


 Here is one of the incriminated files:

 http://pastebin.com/raw.php?i=yxdUmpKx

 Hope this is any help...

 Cheers

 On Fri, Sep 3, 2010 at 12:48 AM, Dan Davison davi...@stats.ox.ac.uk
 wrote:

 Julien Fantin julien.fan...@gmail.com writes:

 First congratulations on adding in-line fontification to source
 blocks, that's a great addition.

 However, since I pulled those changes, a recurring issue I've been
 having has become even more annoying.

 When opening an org file, some src blocks headers don't seem to get
 parsed properly, and now as a result, don't get fontified.
 They are functional though, since they properly get tangled, and C-c '
 performs as expected.
 If I edit the header line, or the ones directly before and after it,
 the block gets back to normal.

 Here is a screenshot to make things clearer, as you can see there are
 no differences in formatting, and those properties drawer don't have
 anything weird, just a single ID.

 http://imagebin.org/112413

 I was meaning to post a screenshot with whitespace-mode on to stress

[Orgmode] Weekdays vs. weekends scheduling

2010-09-03 Thread Julien Fantin
I've been playing with org-habit, trying to setup different habits for
weekdays and weekends.
But I couldn't figure out a way to use repeat intervals to schedule
something for every weekdays or every weekends...

The only work around I came up with is to schedule the item once for
each day of the week, with a +1w interval.
But this is a poor solution, since the consistency graph will report
the completion state for that particular day of the week which isn't
very useful with habits...

Has anyone else had a similar use case and came up with a solution ?

Cheers

___
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] cannot enable org-habit

2010-09-02 Thread Julien Fantin
I'm watching this as I wasn't able to enable this module either.

I have state logging enable with :
  (setq org-todo-keywords
(quote
 ((sequence TODO(t!) NEXT(n!) | DONE(d!))
  (sequence WAIT(w@/!) SOMEDAY(s@/!) | CANCELLED(c@/!)

And org-habit is configured with :
 (add-to-list 'org-modules 'org-habit)

Which doesn't seems to work either...

If I try o (require 'org-habit) though, I'll get an error when
building the agenda with C-c a a :
org-habit-duration-to-days: Wrong type argument: stringp, nil


On Thu, Sep 2, 2010 at 4:40 PM, Bastien bastien.gue...@wikimedia.fr wrote:
 Joseph Buchignani joseph.buchign...@gmail.com writes:

 I presume there ought to be some sort of entry in my agenda, or the k key
 should do something. I get nothing. Here is my setup:

   * org-mode 7.01h
   * emacs file included below.

 The relevant portion is (add-to-list 'org-modules 'org-habit), which I have
 enabled in my .emacs, to no avail.

 What am I missing?

 Are you logging your DONE state?

 From the manual:

  6. You must also have state logging for the `DONE' state enabled, in
     order for historical data to be represented in the consistency
     graph.  If it's not enabled it's not an error, but the consistency
     graphs will be largely meaningless.

 --
  Bastien

 ___
 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: cannot enable org-habit

2010-09-02 Thread Julien Fantin
Thanks Noorul, this helped me fix the error, and I now have it working !
I should mention that I do need to (require 'org-habit) after it's
been added to the modules list, in order to actually activate it.



On Thu, Sep 2, 2010 at 7:17 PM, Noorul Islam noo...@noorul.com wrote:
 On Thursday, September 2, 2010, Julien Fantin julien.fan...@gmail.com wrote:
 I'm watching this as I wasn't able to enable this module either.

 I have state logging enable with :
   (setq org-todo-keywords
         (quote
          ((sequence TODO(t!) NEXT(n!) | DONE(d!))
           (sequence WAIT(w@/!) SOMEDAY(s@/!) | CANCELLED(c@/!)

 And org-habit is configured with :
  (add-to-list 'org-modules 'org-habit)

 Which doesn't seems to work either...

 If I try o (require 'org-habit) though, I'll get an error when
 building the agenda with C-c a a :
 org-habit-duration-to-days: Wrong type argument: stringp, nil


 If you pull the latest version from git repo, you won't get this
 error, instead a meaningful error message will be displayed.

 Thanks and Regards
 Noorul


___
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] Src blocks fontification issue

2010-09-02 Thread Julien Fantin
First congratulations on adding in-line fontification to source
blocks, that's a great addition.

However, since I pulled those changes, a recurring issue I've been
having has become even more annoying.

When opening an org file, some src blocks headers don't seem to get
parsed properly, and now as a result, don't get fontified.
They are functional though, since they properly get tangled, and C-c '
performs as expected.
If I edit the header line, or the ones directly before and after it,
the block gets back to normal.

Here is a screenshot to make things clearer, as you can see there are
no differences in formatting, and those properties drawer don't have
anything weird, just a single ID.

http://imagebin.org/112413

I was meaning to post a screenshot with whitespace-mode on to stress
that there are no apparent formatting differences, but it turned out
activating it fixed the issue !

Not sure what I can do to further help debugging this ?

Cheers

___
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] org-startup-indented shifts columns in column-view

2010-07-22 Thread Julien Fantin
Great job Dominik,

I have in fact went the true indentation way since then, and don't
miss org-indent-mode actually.

I've managed to get the src blocks to behave the same way, by seting
org-preserve-indentation to nil and org-edit-src-content to 0. So what
I described in the other thread is actually a non-issue, and could be
adapted with proper configuration settings.

All in all this is very nice, I was just a few tweaks away from
getting the almost exact same beahviour without using org-indent-mode,
and I like the idea of looking at the actual file without any magic.
I was also pleasantly surprised to find out that the indentation is
automatically adapted on headlines promotion and demotion commands.

Org-mode never ceases to amaze...

Cheers

On Thu, Jul 22, 2010 at 10:45 AM, Carsten Dominik domi...@uva.nl wrote:

 On Jul 22, 2010, at 10:14 AM, Carsten Dominik wrote:


 On Jul 13, 2010, at 5:11 PM, Julien Fantin wrote:

 Thanks for noticing Dominik,

 Reverting back to regular indentation is what I've done,

 THis is not what I mean.

 What I mean is that you can turn off org-indent-mode just while you
 use column view.  Basically, define yourself a function key to toggle
 org-indent-mode, and turn it off before entering column view,
 and on afterwards.  Very likely, the fix for this issue will eventually
 do this automatically, but it is not trivial to do this and make sure
 that everything else will still work correctly.  Will be a while
 before I get to this.

 Just minutes after sending this message I realized, that there is
 a simple way to fix this issue, by overruling the line-prefix and
 wrap-prefix text properties in the overlays that are used
 for column view. Works like a charm, and is a very simple fix.

 - Carsten



 however, I'm
 afraid I have something else to report on that...
 I mentionned this  issue in a separate thread :
 http://article.gmane.org/gmane.emacs.orgmode/27388/

 I hope that Dan Davison will find time to look into this question.

 - Carsten


 cheers

 On Tue, Jul 13, 2010 at 2:14 PM, Carsten Dominik
 carsten.domi...@gmail.com wrote:

 On Jul 6, 2010, at 9:55 PM, Julien Fantin wrote:

 I've been using the org-startup-indented and org-adapt-indentation
 variables for sometime, but I just realized that org-startup-indented
 when
 set to true, ends up shifting the cloumns in column-view according to
 the
 headline level.

 So headline 2 is shifted by 1 character to the right, headline 3 by 2
 characters and so forth.

 Is this the expected behaviour ? I hope not, because I'd like to use
 both
 features, but it makes the column-view quite impractical.

 Hi Julien,

 this is indeed a bug.  As it is not trivial to fix it,
 I will only be able to get to it after the release.
 As a work-around for now, turn off org-indent-mode before
 switching to column view.

 - Carsten



 - Carsten




 - Carsten





___
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] org-babel and emacs init

2010-07-15 Thread Julien Fantin
Still had some issues with your function Eric, but finally found the
time to make it work on my system.
Posting it here since I didn't use reply all the first time around,
and someone else might find it useful.

(defun my-org-babel-load-file (file)
  (let ((orig-file (expand-file-name file dotfiles-dir))
(tmp-file (make-temp-file my-ob-load nil .org)))
(with-temp-file tmp-file
  (insert-file-contents orig-file))
(org-babel-load-file tmp-file)))

Thanks for your help !

Cheers

On Sat, Jul 3, 2010 at 3:56 AM, Eric Schulte schulte.e...@gmail.com wrote:
 Hi Julien,

 Org-mode prefers when it is used in buffers that are associated with
 files.  The following version creates temporary files for each load.  It
 will litter your /tmp directory instead of your emacs directory --
 although it shouldn't be hard to add a quick cleanup at the end of the
 function.

 Cheers -- Eric


 (defun my-org-babel-load-file (file)
   (let ((tmp-file (make-temp-file my-ob-load)))
 (with-temp-file tmp-file
   (insert-file-contents
(expand-file-name file dotfiles-dir))
   (org-mode)
   (org-babel-execute-buffer


 Julien Fantin julien.fan...@gmail.com writes:

 Hi eric,
 I'v been trying to find a way to avoid the tangling involved in using
 org-babel-load-file when loading my config, as it clobbers my emacs directoy
 with files I don't use.

 But I'm getting errors with this function :

 (defun my-org-babel-load-file (file)
   (with-temp-buffer (insert-file-contents (expand-file-name file
 dotfiles-dir))
                     (org-mode)
                     (org-babel-execute-buffer)))

 (my-org-babel-load-file init.org)

 It's giving me a hard time apparently due to org-babel-insert-result calling
 orgtbl-to-orgtbl on blocks of emacs-lisp which return nil.

  Could you suggest how to do this properly ?

 cheers and congratulations on the integration !

 On Mon, Jun 28, 2010 at 7:59 PM, Eric Schulte schulte.e...@gmail.comwrote:

 Hi Richard,

 Happy this is sorted out.  A similar startup example is available in the
 init.el file in my copy of the Emacs Starter Kit [1], which also tangles
 all configuration from org files.

 Cheers -- Eric

 Richard Riley rile...@gmail.com writes:

  Firstly  : Carsten and Eric I emailed you privately as I had no news
  access - pls ignore. Problem solved.
 
  With the latest git pull for org-mode I couldn't start my emacs because
  my init files are org files untangled using babel. Here is an updated
  init.el which which uses the new names and pulls in  ob-tangle.
 
 
  (setq dotfiles-dir (file-name-directory (or (buffer-file-name)
 load-file-name)))
 
  (let* ((org-dir (expand-file-name
                   lisp (expand-file-name
                           org-mode dotfiles-dir)))
         (org-contrib-dir (expand-file-name
                           lisp (expand-file-name
                                 contrib (expand-file-name
                                              .. org-dir
         (load-path (append (list org-dir org-contrib-dir (concat org-dir
 /babel))
                            (or load-path nil
    (message %s org-dir)
    ;; load up Org-mode and Org-babel
    (require 'org-install)
    (require 'ob)
    (require 'ob-tangle)
  )

 Footnotes:
 [1]  http://github.com/eschulte/emacs-starter-kit/blob/master/init.el


 ___
 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


Re: [Orgmode] org-startup-indented shifts columns in column-view

2010-07-13 Thread Julien Fantin
Thanks for noticing Dominik,

Reverting back to regular indentation is what I've done, however, I'm
afraid I have something else to report on that...
I mentionned this  issue in a separate thread :
http://article.gmane.org/gmane.emacs.orgmode/27388/

cheers

On Tue, Jul 13, 2010 at 2:14 PM, Carsten Dominik
carsten.domi...@gmail.com wrote:

 On Jul 6, 2010, at 9:55 PM, Julien Fantin wrote:

 I've been using the org-startup-indented and org-adapt-indentation
 variables for sometime, but I just realized that org-startup-indented when
 set to true, ends up shifting the cloumns in column-view according to the
 headline level.

 So headline 2 is shifted by 1 character to the right, headline 3 by 2
 characters and so forth.

 Is this the expected behaviour ? I hope not, because I'd like to use both
 features, but it makes the column-view quite impractical.

 Hi Julien,

 this is indeed a bug.  As it is not trivial to fix it,
 I will only be able to get to it after the release.
 As a work-around for now, turn off org-indent-mode before
 switching to column view.

 - Carsten



___
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] Indentation of src blocks with org-adapt-indentation

2010-07-11 Thread Julien Fantin
I've reverted back from using fake indetation provided by
org-indent-mode, to regular indentation, since the latest git pull
fixed some issues that makes it much more usable (so thanks for that
!).

However src blocks only behave properly if starting on column 0,
otherwise, editing it with C-' will include the headline level's
indentation added to the code's own indentation.

Wouldn't it make more sense, to have blocks stick to the regular
indentation level, while org-edit-special would strip the meaningless
spaces that result from the headline level  ?

Cheers

___
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] How to setup xdg for org-protocol ?

2010-07-10 Thread Julien Fantin
I've been struggling this morning trying to get org-protocol setup on my
linux box (via http://orgmode.org/worg/org-contrib/org-protocol.php)

I can't get a web-browser to register org-protcol with emacsclient, as I'm
not using a desktop environment (plain startx and openbox), I'm pretty sure
this is an xdg config issue.
However, despite reading through the specs I couldn't fathom the proper
settings.

In chromium, the external application comes up, and calls xdg-open
org-protocol://subprotocol/... which ends up firing a new chromium frame

In firefox, I've tried setting network.protocol-handler.app.org-protocol to
an empty string or my emacsclient path, anyhow I get the following error
message :
Firefox doesn't know how to open this address, because the protocol
(org-protocol) isn't associated with any program without showing any
external application selection  dialog.


Has anyone already adressed this ?

Cheers
___
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] org-startup-indented shifts columns in column-view

2010-07-06 Thread Julien Fantin
I've been using the org-startup-indented and org-adapt-indentation variables
for sometime, but I just realized that org-startup-indented when set to
true, ends up shifting the cloumns in column-view according to the headline
level.

So headline 2 is shifted by 1 character to the right, headline 3 by 2
characters and so forth.

Is this the expected behaviour ? I hope not, because I'd like to use both
features, but it makes the column-view quite impractical.

Cheers !
___
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] org-capture : latest git pull, template selection broken ?

2010-07-06 Thread Julien Fantin
With the org-capture-templates described in the doc, right after the
template selection, the buffer disappears, and the empty template gets
written to the target file.
The following messages are output :
Clipboard pasted as level 2 subtree

Has the template selection changed, or is this a bug ?

Cheers
___
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] org-capture-templates : should symbols work as a file target ?

2010-07-05 Thread Julien Fantin
Hi folks,

I'v been trying to setup an org-capture template using a symbol as the file
target, but this raises an error.
Someone on IRC mentionned this is probably a bug, but I'm not experienced
enough to be sure I'm not simply misusing it...


Here is the bit of config in question:


* Files
#+BEGIN_SRC emacs-lisp
(setq org-directory  (concat (getenv HOME) /org/))
(setq organizer (concat org-directory organizer.org))
#+END_SRC

* Capture
#+BEGIN_SRC emacs-lisp
(setq org-default-notes-files organizer)
#+END_SRC

** Templates
#+BEGIN_SRC emacs-lisp
(setq org-capture-templates
   `(
(t Task entry
 (file+headline  organizer Tasks)
 * TODO %?\n%U)

(j Journal entry
 (file+datetree ~/org/journal.org)
 * %?\nEntered on %U\n %i\n %a)
))
#+END_SRC


Which results in the following message when the first template is selected
 after executing org-capture:

org-find-base-buffer-visiting: Wrong type argument: stringp, organizer

So is this actually a bug ?
If not, could anyone enlighten me as to how I could manage to reuse this
'organizer in the form ?

Cheers !
___
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] [org-babel] How to refer to a specific property when it is defined multiple times?

2010-03-26 Thread Julien Fantin
Consider the following :

* heading A
:PROPERTIES:
:BUSY_PROPERTY: AAA
:END:
* heading B
:PROPERTIES:
:BUSY_PROPERTY: BBB
:END:

#+begin_src emacs-lisp  :var test=(org-entry-get nil BUSY_PROPERTY t)
test
#+end_src
#+results:
: BBB

#+begin_src emacs-lisp  :var test=(org-property-values BUSY_PROPERTY)
test
#+end_src
#+results:
| BBB | AAA |


Is there a way I can refer to my BUSY_PROPERTY, in the context of particular
heading ?
Has shown above, I can not get a reference to the heading it was defined in.
Is there a way to deal with those namespacing conerns right now ?

Note : This emacs-lisp evaluation in src headers has only been recently
implemented by Eric schulte.

cheers
___
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] org-babel-load-file can't use properties drawers ?

2010-02-28 Thread Julien Fantin
I've been using this init file to load my org-mode-contained emacs
configuration  :

;;; init.el --- Where all the magic begins
;;
;; This file loads both
;; - Org-mode : http://orgmode.org/ and
;; - Org-babel:
http://orgmode.org/worg/org-contrib/babel/org-babel.php#library-of-babel
;;
;; It then loads the rest of our Emacs initialization from Emacs lisp
;; embedded in literate Org-mode files.
;; Load up Org Mode and Org Babel for elisp embedded in Org Mode files
(setq dotfiles-dir (file-name-directory (or (buffer-file-name)
load-file-name)))

(let* ((org-dir (expand-file-name
 lisp (expand-file-name
 org-mode (expand-file-name
elisp dotfiles-dir
   (org-contrib-dir (expand-file-name
 lisp (expand-file-name
 contrib (expand-file-name
.. org-dir
   (load-path (append (list org-dir org-contrib-dir)
  (or load-path nil
  ;; load up Org-mode and Org-babel
  (require 'org-install)
  (require 'org-babel-init)
  (require 'org-babel-emacs-lisp))
;; load up all literate org-mode files in this directory
(mapc 'org-babel-load-file (directory-files dotfiles-dir t \\.org$))
;;; init.el ends here


It's been working nicely until I tried to clean things up by setting some
commonly used variables  in properties drawers, and access them from
emacs-lisp src blocks.

The following illustrates my intent, and will behave as expected with
org-babel-execute-buffer, but fails when it is loaded by org-babel-load-file
:

* Configuration
:PROPERTIES:
:ELISP-DIR:~/emacs.d/elisp/
:END:

** Load Path
#+begin_src emacs-lisp
(add-to-list 'load-path (org-entry-get nil ELISP-DIR t))
#+end_src

From my understanding, orb-babel-load-file tangles then loads the file,
losing the variables in the process.

I've been using this function to get the expected behaviour, but the default
somewhat breaks expectations, don't you think ?
 (defun
ba/org-babel-load-file (file) (with-temp-buffer
(insert-file-contents
file) (org-mode) (org-babel-execute-buffer)))

Or, is there a cleaner way to achieve this ?

Regards,
julien
___
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] Annotations from pdf viewer in Linux ?

2010-02-12 Thread Julien Fantin
I've seen some instructions on seting up org-annotation-helper for adobe
acrobat on worg :
http://orgmode.org/worg/org-contrib/org-protocol.php#acrobat-reader-setup

I'd be very interested in integrating this workflow into my linux
configuration.

Does anyone know of a pdf viewer that would allow to do use the setup
described in the link above ?

If not, I guess some shell scripting could do the trick, and I'd love to
hear about that...

cheers
___
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