Re: [O] [ANN] org-bibtex.el --- convert between Org headings and bibtex entries

2011-04-24 Thread Eric Schulte
Matt Lundin m...@imapmail.org writes:

[...]
 I understand I may add to the types variable.  When using
 org-bibtex-create, I can enter any arbitrary field as a PROPERTY;
 however, org-bibtex ignores anything outside of the universe it knows
 about.  Would it be bad practice to allow the export of any arbitrary
 field type one has recorded?  I think the emacs bibtex-mode may
 recognize erroneous bibtex entries.   

 Bibtex-mode does indeed allow for arbitrary fields, as do bibtex and
 biblatex. AFAIK, they are simply ignored when processing a bib file. One
 limitation that arises when storing bibtex data as org properties is
 that properties drawers are used for much more. For instance, one would
 probably not want to see logging = {lognoterepeat}, in one's exported
 bibtex file.

 But for biblatex users, it would indeed be prohibitively expensive to
 have to inform org-mode ahead of time about the innumerable odd fields
 that various biblatex backends define.


There is already an option for an org-bibtex specific property name
prefix, (namely `org-bibtex-prefix').  Perhaps when this prefix is used,
and the `org-bibtex' functions is called with a prefix argument (note:
entirely different usage of the term prefix) then only entries which
begin with the `org-bibtex-prefix' would be exported...  I believe that
should provide a natural way for arbitrary fields to pass through
org-bibtex without the user needing to explicitly name them, or there
being any danger of contamination from existing org-mode properties.


 I am confused by the duplication of file names, though I can see that
 at some point one of the two will lose.  (Gauss's law of competitive
 exclusion, referring to the biological case of two species occupying
 the same ecological niche). 

 Eric, the more I think about this, the more my vote would be to package
 this new functionality separately.

 IMO, hyperlinking to external data in bib files is somewhat orthogonal
 to storing bib data within org files. In other words, the current
 org-bibtex.el complements bibtex-mode use, whereas the new org-bibtex
 functions, for the most part, are substitutes for bibtex-mode---i.e.,
 they re-implement much of its configuration and basic functionality.

 By packaging the new functionality separately perhaps we could lay the
 groundwork for internal, backend agnostic bibliographical export and
 formatting---not unlike the way in which org-contacts.el replaces bbdb.


Alright, I think I agree that separate packaging would be the best way
forward given the existing conventions wrt linking to functionality
rather than implementing said functionality.  Also, some integration
with the existing org-bibtex linking functions (as you've mentioned)
would probably address some of Tom's earlier requests for an easy means
of inserting bibtex entries.

The only question now is the one which originally lead me to simply dump
this into org-bibtex, namely, what is a good name?  The first options
that occur to me are
- org-bib
- org-reference
- org-cite

What do you think?  Any better suggestions?

Thanks -- Eric


 Wishful thinking?... :)

 Best,
 Matt

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



Re: [O] [ANN] org-bibtex.el --- convert between Org headings and bibtex entries

2011-04-24 Thread Eric Schulte
Alan E. Davis lngn...@gmail.com writes:

[...]
 
 Once this process is complete, I can see that being able to, in turn copy
 this entry to the clipboard would indeed be useful with org-bibtex .  I
 wonder if it's possible to set a pipe or one of those cryptic file types
 (fifo?) I cannot remember would either work, or whether the developers would
 agree to enabling this ability.


It sounds like asking the cb2bib developers to either automatically copy
completed entries to the clipboard, or to add a button implementing this
behavior would be ideal.  Barring that there is an existing xclip
utility (on debian: apt-get install xclip) which allows for piping data
to the clipboard, e.g. with

  cat ~/references.bib |xclip -selection clipboard

will copy the entirety of the references.bib file to the clipboard.

As for using xclip to automatically copy any changes to a file to the
clipboard, I'm not sure if that is possible, but this may be useful [1].

Best -- Eric

Footnotes: 
[1]  
http://www.howtoforge.com/triggering-commands-on-file-or-directory-changes-with-incron

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



Re: [O] Display missing/overlapping clock ranges

2011-04-24 Thread Carsten Dominik

On 13.4.2011, at 23:06, Bernt Hansen wrote:

 Paul Mead paul.d.m...@gmail.com writes:
 
 Rainer Stengele rainer.steng...@diplan.de writes:
 
 I do clock every task I work on during the whole day.
 At the end of the day or week I have to go over all clock entries in my 
 agenda
 and see if there are holes or overlappings in my clock tables.
 If yes I have to adjust the clocks.
 
 I read Bernt Hansen's comments on how he works with clocks
 (http://doc.norang.ca/org-mode.html#Clocking).
 
 What about a function showing the lacking clock ranges over
 the day while being in the agenda with log mode on?
 
 The function could even check for overlapping clock ranges and indicate 
 these
 or jump to these.
 
 Maybe it would even be good to be able to configure daily and weekly
 regular holes in the ranges, for example
 
 - daily lunch time from [12:00]--[13:00]
 - week end days (maybe with diary syntax)
 - working days (Monday to Friday for example)
 
 What do you think?
 
 -- Rainer
 
 I'd defintely use something which identified the gaps and overlaps as
 they're taking some time to find now that I have to account more closely
 for my time! I've been considering whether to raise this for a
 while. The 'regular holes' idea is good to, although not as important
 for me.
 
 Paul
 
 Hi Rainer and Paul,
 
 Locating gaps would be useful.  I've been meaning to investigate this
 but haven't spent any time on it yet.  With my current clocking setup
 I've found I get very few holes.  Checking the times is a task I do
 manually just before billing for my time.  I currently just use a visual
 scan of the daily agenda(s) including clocking lines displayed ensuring
 that the start and end times match over the clocking period.
 
 It should be possible to automate the check.  How should a filtered
 agenda be handled?  I expect you'd want to see the gaps for the entries
 that are filtered away otherwise it's only really meaningful when you
 look at the entire clocking data.
 
 The major problem I used to have was clocks that would be opened and
 never closed.  These were bad because they count as 0 minutes and
 without fixing those entries I don't bill for that time.  Since the
 invention of M-x org-resolve-clocks (which runs everytime I clock in) I
 now find these open clocks quickly and don't need to reconstruct the
 data a week later.  I haven't had this problem in a long time.
 
 Maybe something like the following mock up?
 
 --8---cut here---start-8---
 Day-agenda (W15):
 Wednesday  13 April 2011
  todo:7:09- 7:11 Clocked:   (0:02) Organization   
 :PERSONAL::
   7:11- 8:00 - Gap -   (0:49)
  org: 8:00- 8:12 Clocked:   (0:12) DONE Try to fix this bug   
  :ORG:WORK:tuning::
  todo:8:12- 8:26 Clocked:   (0:14) Organization   
 :PERSONAL::
  diary:   8:26- 9:06 Clocked:   (0:40) Breakfast
  todo:9:06- 9:30 Clocked:   (0:24) Task A 
 :PERSONAL::
   9:30-10:58 - Gap -   (1:28)
  10:00.. 
  todo:   10:58-11:11 Clocked:   (0:13) Organization   
 :PERSONAL::
  vvv -- Overlap -- vvv
  todo:   11:11-11:12 Clocked:   (0:01) Read Mail and News 
 :PERSONAL::
  todo:   11:10-11:14 Clocked:   (0:01) Organization   
 :PERSONAL::
  ^^^ -- Overlap -- ^^^
  todo:   11:14-11:15 Clocked:   (0:01) Read Mail and News 
 :PERSONAL::
  todo:   11:15-11:16 Clocked:   (0:01) Organization   
 :PERSONAL::
  12:00.. 
  14:00.. 
  16:00.. 
  11:16-16:33 - Gap -   (5:17)
  todo:   16:33.. Clocked:   (-) Read Mail and News
 :PERSONAL::
  16:43.. now - - - - - - - - - - - - - - - - - - - - - - - - -
  18:00.. 
  20:00.. 
 --8---cut here---end---8---


Hi Bernt, Rainer, Paul,

these are pretty good ideas, and since it is a holiday, I have some time,
so I have tried an implementation and just pushed it to the master.

This introduces a new key in the agenda, v c, which will check for
clocking issues and display them in a similar way as Bernt proposes.

The whole thing works like log view, so it applies to the currently
displayed span in the agenda, and it sticks if you move around
with f and b.  To get out of this view, press l to turn off
log view, for example.

Also, it is a special log view in that it only shows clocking
information, I believe this makes it more direct and useful.

There is a variable to configure what constitutes clocking issues.

[O] a new way to navigate your org files

2011-04-24 Thread Tom
I use org goto to jump quckly to headings, but the other day
I forgot the name of the heading, but I remembered its contents.
I thought it could be useful if I could navigate org files by content
too, so I quickly created this package as a sunday afternoon fun.

It is a wrapper around the multi-occur interface, so you can
simply type your search pattern and the occur results from your org
buffers are updated dynamically as you type.

Here it is:

;;; org-occur-goto.el -- search open org buffers with an occur interface

;;; Usage: M-x oog, then start typing
;;; 
;;; select from the occur matches with up/down/pgup/pgdown and press enter
;;; 
;;; the search string must be at least 3 characters long (by default)
;;;


(require 'cl)

(defvar oog-idle-delay 0.5)

(defvar oog-minimum-input-length 3)


(defvar oog-map 
  (let ((map (copy-keymap minibuffer-local-map)))
(define-key map (kbd down) 'oog-next-line)
(define-key map (kbd up) 'oog-previous-line)
(define-key map (kbd prior) 'oog-previous-page)
(define-key map (kbd next) 'oog-next-page)
   map))



(defun oog-previous-line ()
  (interactive)
  (oog-move-selection 'next-line -1))
 
 
(defun oog-next-line ()
  (interactive)
  (oog-move-selection 'next-line 1))
 
 
(defun oog-previous-page ()
  (interactive)
  (oog-move-selection 'scroll-down nil))
 
 
(defun oog-next-page ()
  (interactive)
  (oog-move-selection 'scroll-up nil))
 
 
(defun oog-move-selection (movefunc movearg)
  (let ((win (get-buffer-window *Occur*)))
(if win
(with-selected-window win
  (condition-case nil
  (funcall movefunc movearg)
(beginning-of-buffer (goto-char (point-min)))
(end-of-buffer (goto-char (point-max


(defun oog-check-input ()
  (when (sit-for oog-idle-delay)
(unless (equal (minibuffer-contents) oog-current-input)
  (setq oog-current-input (minibuffer-contents))

  (if ( (length oog-current-input) oog-minimum-input-length)
  (let ((win (get-buffer-window *Occur*)))
(if win
  (with-selected-window win
(setq buffer-read-only nil)
(erase-buffer

(save-excursion
  (flet ((message (rest args) nil))  ;; suppress occur messages
(multi-occur
 (remove nil (mapcar (lambda (buffer)
   (with-current-buffer buffer
 (if (eq major-mode 'org-mode)
 buffer)))
 (buffer-list)))
 oog-current-input))
  (unless (get-buffer *Occur*)
(message No matches.)))



(defun oog ()
  (interactive)
  (let (marker)
(save-window-excursion
  (add-hook 'post-command-hook 'oog-check-input)
  (setq oog-current-input nil)

  (unwind-protect
  (let ((minibuffer-local-map oog-map))
(read-string string: ))
 
(remove-hook 'post-command-hook 'oog-check-input))

  (let ((buf (get-buffer *Occur*)))
(if buf
(with-current-buffer buf
  (unless (= (buffer-size) 0)
(setq marker (occur-mode-find-occurrence)))

(switch-to-buffer (marker-buffer marker))
(goto-char marker)
(when (outline-invisible-p)
  (save-excursion
(outline-previous-visible-heading 1)
(org-show-subtree)






Re: [O] [ANN] org-bibtex.el --- convert between Org headings and bibtex entries

2011-04-24 Thread Christian Moe

On 4/24/11 4:21 PM, Eric Schulte wrote:

Matt Lundinm...@imapmail.org  writes:

(...)
Eric, the more I think about this, the more my vote would be to package
this new functionality separately.

IMO, hyperlinking to external data in bib files is somewhat orthogonal
to storing bib data within org files. In other words, the current
org-bibtex.el complements bibtex-mode use, whereas the new org-bibtex
functions, for the most part, are substitutes for bibtex-mode---i.e.,
they re-implement much of its configuration and basic functionality.

By packaging the new functionality separately perhaps we could lay the
groundwork for internal, backend agnostic bibliographical export and
formatting---not unlike the way in which org-contacts.el replaces bbdb.



Alright, I think I agree that separate packaging would be the best way
forward given the existing conventions wrt linking to functionality
rather than implementing said functionality.


The *conclusion* (where Eric Schulte's new bibtex functions should go) 
is not a big concern to me, but FWIW, the *premise* strikes me as 
unnecessarily restrictive.


I submit that, for any non-Org format or application foo, the module 
org-foo.el does not have to be restricted to providing an Org link 
type for foo. It seems a sensible namespace for e.g. foo-Org/Org-foo 
conversion functions as well. The fact that several modules so named 
*at present* only provide link functionality does not, I think, amount 
to a convention that this is all they should do.


 By packaging the new functionality separately perhaps we could lay the
 groundwork for internal, backend agnostic bibliographical export and
 formatting---not unlike the way in which org-contacts.el replaces bbdb.

That's a great aim. Still, a future bibliography module (be it 
org-bib, org-cite or whatever) could just as well rely, for bits 
of bibtex functionality, on some utilities packaged in org-bibtex.


Yours,
Christian




Re: [O] Bug: HTML blocks in macros called before lists break in 7.5

2011-04-24 Thread Nicolas Goaziou
Hello,

amscopub-m...@yahoo.com writes:

 #+MACRO: start #+BEGIN_HTML\n mydiv \n#+END_HTML
 #+MACRO: end  #+BEGIN_HTML\n /mydiv \n#+END_HTML


 * Hello world

 {{{start}}}
  1. Item 1
 {{{end}}}


[...]

 Anyway, the above code worked fine in 7.4. Then I upgraded to 7.5 and
 I now have literally hundreds of these broken lists.

I've pushed a fix for that problem, along with a better handling of
macros within lists. Your example is now exported correctly. Please tell
me if more complex macros still lead to errors.

Thank you for reporting this problem.

Regards,

-- 
Nicolas Goaziou



Re: [O] a new way to navigate your org files

2011-04-24 Thread Matt Lundin
Tom adatgyu...@gmail.com writes:

 I use org goto to jump quckly to headings, but the other day
 I forgot the name of the heading, but I remembered its contents.
 I thought it could be useful if I could navigate org files by content
 too, so I quickly created this package as a sunday afternoon fun.

 It is a wrapper around the multi-occur interface, so you can
 simply type your search pattern and the occur results from your org
 buffers are updated dynamically as you type.

This is great! Thanks for sharing.

Best,
Matt




Re: [O] a new way to navigate your org files

2011-04-24 Thread Suvayu Ali
Hi Tom,

On Sun, 24 Apr 2011 16:06:05 + (UTC)
Tom adatgyu...@gmail.com wrote:

 I use org goto to jump quckly to headings, but the other day
 I forgot the name of the heading, but I remembered its contents.
 I thought it could be useful if I could navigate org files by content
 too, so I quickly created this package as a sunday afternoon fun.
 
 It is a wrapper around the multi-occur interface, so you can
 simply type your search pattern and the occur results from your org
 buffers are updated dynamically as you type.

This is very useful. I made some enhancements in the attached patches.
The first one adds a very basic minibuffer history. You can navigate the
history by the usual `M-p' and `M-n'. The second patch fixes an issue,
now you can go to the first match by just hitting `RET' instead of
`down RET'.

Thanks a lot for writing this. :)

-- 
Suvayu

Open source is the future. It sets us free.
From 08c35bcf7cc3b290f8421236c4bc5e3345398ff0 Mon Sep 17 00:00:00 2001
From: Suvayu Ali fatkasuvayu+li...@gmail.com
Date: Sun, 24 Apr 2011 12:20:27 -0700
Subject: [PATCH 1/2] Add minibuffer history to org-occur-goto

---
 lisp/org-occur-goto.el |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lisp/org-occur-goto.el b/lisp/org-occur-goto.el
index e2af3fb..ccef330 100644
--- a/lisp/org-occur-goto.el
+++ b/lisp/org-occur-goto.el
@@ -90,7 +90,7 @@
 
  (unwind-protect
  (let ((minibuffer-local-map oog-map))
-   (read-string string: ))
+   (read-string string:  nil 'oog-history-list))
 
(remove-hook 'post-command-hook 'oog-check-input))
 
-- 
1.7.3.4

From 1742551e8e19abaa272e444fa8c27afd76a7e6b8 Mon Sep 17 00:00:00 2001
From: Suvayu Ali fatkasuvayu+li...@gmail.com
Date: Sun, 24 Apr 2011 13:10:19 -0700
Subject: [PATCH 2/2] oog: can got to first match by hitting RET

---
 lisp/org-occur-goto.el |5 -
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/lisp/org-occur-goto.el b/lisp/org-occur-goto.el
index ccef330..7398daf 100644
--- a/lisp/org-occur-goto.el
+++ b/lisp/org-occur-goto.el
@@ -98,7 +98,10 @@
(if buf
(with-current-buffer buf
  (unless (= (buffer-size) 0)
-   (setq marker (occur-mode-find-occurrence)))
+   (setq marker (if (eq (line-number-at-pos (point)) 1)
+(progn (forward-line)
+   (occur-mode-find-occurrence))
+			  (occur-mode-find-occurrence
 
(switch-to-buffer (marker-buffer marker))
(goto-char marker)
-- 
1.7.3.4



[O] capture template: help w table-line target.

2011-04-24 Thread Stinky Wizzleteet

Hi all,

Christopher Allan Webber was so gracious to share his personal org setup
for dieting, now I'm adapting his org-remember-template:


(setq org-capture-templates
  '((w weigh-in entry
 (file+headline ~/.org/Diet.org diet)
 
* CAL-IN Diet for day %t 
%^{Weight}p
| Food / Exercise | Calories | Quantity | Total |
|-+--+--+---|
| %^{Food}   |%^{Calories} |%^{Quantity} | |
|-+--+--+---|
| Total   |  |  |   |
#+TBLFM: $4=$2*$3::$LR4=vsum(@2$4..@-I$4)
)))

This works allright, this capture template is used once every day to
start the table (christopher: how does one do a CAL-OUT ?)
It creates a headline for every day with the table.
During the day the org file needs to stay opened so one can fill the
table with food/exercise items.
Now, I understand org-capture has more functionality than org-remember,
like a capture template that adds a line to a table, totally apt for
this situation:

(f food or exercise table-line
(file+headline ~/.org/Diet.org diet)
| %^{Food}   |%^{Calories} |%^{Quantity} | |
:table-line-pos II-1 )

But I' having trouble getting the target right.
This works like a charm on an org file that just has a table, but I need
to figure out a way how to grab the last table (or better even, *todays*
table, if not there, will create one, but I guess this is for future)
Can anyone point me in the right direction on how to add a table line to
the last table in an org file. Or the table in the last child of
headline diet ?

help a noob out,plz.

tips are greatly appreciated,

thx wzzl

-- 
Stinky Wizzleteet thinks: 
You will have a long and unpleasant discussion with your supervisor.




Re: [O] [ANN] org-bibtex.el --- convert between Org headings and bibtex entries

2011-04-24 Thread Alan E. Davis
On Mon, Apr 25, 2011 at 12:29 AM, Eric Schulte schulte.e...@gmail.comwrote:


 It sounds like asking the cb2bib developers to either automatically copy
 completed entries to the clipboard, or to add a button implementing this
 behavior would be ideal.


Indeed, this is about what cb2Bib does, to a good extent, depending on the
nature of the reference.  A simple text reference, like

 S J Hickson. On the Sexual Cells and the Early Stages in the Development of
Millepora plicata. Philosophical Transactions of the Royal Society of
London. B 179, 193 - 204 (1888).

may not completely be resolved (not sure in this case): the template on
cb2Bib will be partially filled in, and it may require a couple of quick
steps to complete the template and save.  Unplugging, one may then enter the
abstract or other fields, then save.




   cat ~/references.bib |xclip -selection clipboard

 will copy the entirety of the references.bib file to the clipboard.

 This is good.  Thank you.  This will certainly be helpful in some cases.

The case for cb2Bib is somewhat different, as once the template is filled
in, one may save it to .bib file, and one may select which file.  If one
were able to use a pipe, xclip, or a fifo file, perhaps this could be made
immediately available to org-bibtex-read.

Alan


Re: [O] Display missing/overlapping clock ranges

2011-04-24 Thread Rainer Stengele
Am 24.04.2011 17:30, schrieb Carsten Dominik:
 On 13.4.2011, at 23:06, Bernt Hansen wrote:

 Paul Mead paul.d.m...@gmail.com writes:

 Rainer Stengele rainer.steng...@diplan.de writes:

 I do clock every task I work on during the whole day.
 At the end of the day or week I have to go over all clock entries in my 
 agenda
 and see if there are holes or overlappings in my clock tables.
 If yes I have to adjust the clocks.

 I read Bernt Hansen's comments on how he works with clocks
 (http://doc.norang.ca/org-mode.html#Clocking).

 What about a function showing the lacking clock ranges over
 the day while being in the agenda with log mode on?

 The function could even check for overlapping clock ranges and indicate 
 these
 or jump to these.

 Maybe it would even be good to be able to configure daily and weekly
 regular holes in the ranges, for example

 - daily lunch time from [12:00]--[13:00]
 - week end days (maybe with diary syntax)
 - working days (Monday to Friday for example)

 What do you think?

 -- Rainer
 I'd defintely use something which identified the gaps and overlaps as
 they're taking some time to find now that I have to account more closely
 for my time! I've been considering whether to raise this for a
 while. The 'regular holes' idea is good to, although not as important
 for me.

 Paul
 Hi Rainer and Paul,

 Locating gaps would be useful.  I've been meaning to investigate this
 but haven't spent any time on it yet.  With my current clocking setup
 I've found I get very few holes.  Checking the times is a task I do
 manually just before billing for my time.  I currently just use a visual
 scan of the daily agenda(s) including clocking lines displayed ensuring
 that the start and end times match over the clocking period.

 It should be possible to automate the check.  How should a filtered
 agenda be handled?  I expect you'd want to see the gaps for the entries
 that are filtered away otherwise it's only really meaningful when you
 look at the entire clocking data.

 The major problem I used to have was clocks that would be opened and
 never closed.  These were bad because they count as 0 minutes and
 without fixing those entries I don't bill for that time.  Since the
 invention of M-x org-resolve-clocks (which runs everytime I clock in) I
 now find these open clocks quickly and don't need to reconstruct the
 data a week later.  I haven't had this problem in a long time.

 Maybe something like the following mock up?

 --8---cut here---start-8---
 Day-agenda (W15):
 Wednesday  13 April 2011
  todo:7:09- 7:11 Clocked:   (0:02) Organization  
  :PERSONAL::
   7:11- 8:00 - Gap -   (0:49)
  org: 8:00- 8:12 Clocked:   (0:12) DONE Try to fix this bug  
   :ORG:WORK:tuning::
  todo:8:12- 8:26 Clocked:   (0:14) Organization  
  :PERSONAL::
  diary:   8:26- 9:06 Clocked:   (0:40) Breakfast
  todo:9:06- 9:30 Clocked:   (0:24) Task A
  :PERSONAL::
   9:30-10:58 - Gap -   (1:28)
  10:00.. 
  todo:   10:58-11:11 Clocked:   (0:13) Organization  
  :PERSONAL::
  vvv -- Overlap -- vvv
  todo:   11:11-11:12 Clocked:   (0:01) Read Mail and News
  :PERSONAL::
  todo:   11:10-11:14 Clocked:   (0:01) Organization  
  :PERSONAL::
  ^^^ -- Overlap -- ^^^
  todo:   11:14-11:15 Clocked:   (0:01) Read Mail and News
  :PERSONAL::
  todo:   11:15-11:16 Clocked:   (0:01) Organization  
  :PERSONAL::
  12:00.. 
  14:00.. 
  16:00.. 
  11:16-16:33 - Gap -   (5:17)
  todo:   16:33.. Clocked:   (-) Read Mail and News   
  :PERSONAL::
  16:43.. now - - - - - - - - - - - - - - - - - - - - - - - - 
 -
  18:00.. 
  20:00.. 
 --8---cut here---end---8---

 Hi Bernt, Rainer, Paul,

 these are pretty good ideas, and since it is a holiday, I have some time,
 so I have tried an implementation and just pushed it to the master.

 This introduces a new key in the agenda, v c, which will check for
 clocking issues and display them in a similar way as Bernt proposes.

 The whole thing works like log view, so it applies to the currently
 displayed span in the agenda, and it sticks if you move around
 with f and b.  To get out of this view, press l to turn off
 log view, for example.

 Also, it is a special log view in that it only shows clocking
 information, I believe this makes it more direct and useful.

 There is a variable to 

Re: [O] Display missing/overlapping clock ranges

2011-04-24 Thread Carsten Dominik

On 24.4.2011, at 23:48, Rainer Stengele wrote:

 Am 24.04.2011 17:30, schrieb Carsten Dominik:
 On 13.4.2011, at 23:06, Bernt Hansen wrote:
 
 Paul Mead paul.d.m...@gmail.com writes:
 
 Rainer Stengele rainer.steng...@diplan.de writes:
 
 I do clock every task I work on during the whole day.
 At the end of the day or week I have to go over all clock entries in my 
 agenda
 and see if there are holes or overlappings in my clock tables.
 If yes I have to adjust the clocks.
 
 I read Bernt Hansen's comments on how he works with clocks
 (http://doc.norang.ca/org-mode.html#Clocking).
 
 What about a function showing the lacking clock ranges over
 the day while being in the agenda with log mode on?
 
 The function could even check for overlapping clock ranges and indicate 
 these
 or jump to these.
 
 Maybe it would even be good to be able to configure daily and weekly
 regular holes in the ranges, for example
 
 - daily lunch time from [12:00]--[13:00]
 - week end days (maybe with diary syntax)
 - working days (Monday to Friday for example)
 
 What do you think?
 
 -- Rainer
 I'd defintely use something which identified the gaps and overlaps as
 they're taking some time to find now that I have to account more closely
 for my time! I've been considering whether to raise this for a
 while. The 'regular holes' idea is good to, although not as important
 for me.
 
 Paul
 Hi Rainer and Paul,
 
 Locating gaps would be useful.  I've been meaning to investigate this
 but haven't spent any time on it yet.  With my current clocking setup
 I've found I get very few holes.  Checking the times is a task I do
 manually just before billing for my time.  I currently just use a visual
 scan of the daily agenda(s) including clocking lines displayed ensuring
 that the start and end times match over the clocking period.
 
 It should be possible to automate the check.  How should a filtered
 agenda be handled?  I expect you'd want to see the gaps for the entries
 that are filtered away otherwise it's only really meaningful when you
 look at the entire clocking data.
 
 The major problem I used to have was clocks that would be opened and
 never closed.  These were bad because they count as 0 minutes and
 without fixing those entries I don't bill for that time.  Since the
 invention of M-x org-resolve-clocks (which runs everytime I clock in) I
 now find these open clocks quickly and don't need to reconstruct the
 data a week later.  I haven't had this problem in a long time.
 
 Maybe something like the following mock up?
 
 --8---cut here---start-8---
 Day-agenda (W15):
 Wednesday  13 April 2011
 todo:7:09- 7:11 Clocked:   (0:02) Organization  
  :PERSONAL::
  7:11- 8:00 - Gap -   (0:49)
 org: 8:00- 8:12 Clocked:   (0:12) DONE Try to fix this bug  
   :ORG:WORK:tuning::
 todo:8:12- 8:26 Clocked:   (0:14) Organization  
  :PERSONAL::
 diary:   8:26- 9:06 Clocked:   (0:40) Breakfast
 todo:9:06- 9:30 Clocked:   (0:24) Task A
  :PERSONAL::
  9:30-10:58 - Gap -   (1:28)
 10:00.. 
 todo:   10:58-11:11 Clocked:   (0:13) Organization  
  :PERSONAL::
 vvv -- Overlap -- vvv
 todo:   11:11-11:12 Clocked:   (0:01) Read Mail and News
  :PERSONAL::
 todo:   11:10-11:14 Clocked:   (0:01) Organization  
  :PERSONAL::
 ^^^ -- Overlap -- ^^^
 todo:   11:14-11:15 Clocked:   (0:01) Read Mail and News
  :PERSONAL::
 todo:   11:15-11:16 Clocked:   (0:01) Organization  
  :PERSONAL::
 12:00.. 
 14:00.. 
 16:00.. 
 11:16-16:33 - Gap -   (5:17)
 todo:   16:33.. Clocked:   (-) Read Mail and News   
  :PERSONAL::
 16:43.. now - - - - - - - - - - - - - - - - - - - - - - - - 
 -
 18:00.. 
 20:00.. 
 --8---cut here---end---8---
 
 Hi Bernt, Rainer, Paul,
 
 these are pretty good ideas, and since it is a holiday, I have some time,
 so I have tried an implementation and just pushed it to the master.
 
 This introduces a new key in the agenda, v c, which will check for
 clocking issues and display them in a similar way as Bernt proposes.
 
 The whole thing works like log view, so it applies to the currently
 displayed span in the agenda, and it sticks if you move around
 with f and b.  To get out of this view, press l to turn off
 log view, for example.
 
 Also, it is a special log view in that it only shows clocking
 information, I believe this makes it more 

[O] [PATCH] org-html.el: Fix export of table.el tables.

2011-04-24 Thread Jambunathan K

Changelog
-

org-html.el: Fix export of table.el tables.

* lisp/org-html.el (org-export-as-html): Don't expand non-data
lines of table.el tables.
(org-html-expand): Removed the (buggy) test for non-data lines
in table.el tables. The test is now done as part of
org-export-as-html.
(org-format-table-table-html-using-table-generate-source):
Added test for spanning of cells in table.el tables using
table.el's own library routine. Optionlly Suppress export of
simple table.el tables.
(org-format-table-html): Removed the (buggy) test for spanned
table.el tables. The test is now done as part of
org-format-table-table-html-using-table-generate-source.


From 3c8ff02efa0d2a4a08fe5341b9faa1de193048e9 Mon Sep 17 00:00:00 2001
From: Jambunathan K kjambunat...@gmail.com
Date: Mon, 25 Apr 2011 03:35:03 +0530
Subject: [PATCH] org-html: Fix export of table.el tables.

* lisp/org-html.el (org-export-as-html): Don't expand non-data
lines of table.el tables.
(org-html-expand): Removed the (buggy) test for non-data lines
in table.el tables. The test is now done as part of
org-export-as-html.
(org-format-table-table-html-using-table-generate-source):
Added test for spanning of cells in table.el tables using
table.el's own library routine. Optionlly Suppress export of
simple table.el tables.
(org-format-table-html): Removed the (buggy) test for spanned
table.el tables. The test is now done as part of
org-format-table-table-html-using-table-generate-source.
---
 lisp/org-html.el |   72 +++--
 1 files changed, 37 insertions(+), 35 deletions(-)

diff --git a/lisp/org-html.el b/lisp/org-html.el
index 7a4564d..29bb825 100644
--- a/lisp/org-html.el
+++ b/lisp/org-html.el
@@ -1543,6 +1543,7 @@ lang=\%s\ xml:lang=\%s\
 	  ;; handle @.. HTML tags (replace @gt;..lt; by ..)
 	  ;; Also handle sub_superscripts and checkboxes
 	  (or (string-match org-table-hline-regexp line)
+	  (string-match ^[ \t]*\\([+]-\\||[ ]\\)[-+ |]*[+|][ \t]*$ line)
 	  (setq line (org-html-expand line)))
 
 	  ;; Format the links
@@ -1888,24 +1889,13 @@ NO-CSS is passed to the exporter.
   (if (string-match ^[ \t]*| (car lines))
   ;; A normal org table
   (org-format-org-table-html lines nil no-css)
-;; Table made by table.el - test for spanning
-(let* ((hlines (delq nil (mapcar
-			  (lambda (x)
-(if (string-match ^[ \t]*\\+- x) x
-  nil))
-			  lines)))
-	   (first (car hlines))
-	   (ll (and (string-match \\S-+ first)
-		(match-string 0 first)))
-	   (re (concat ^[ \t]* (regexp-quote ll)))
-	   (spanning (delq nil (mapcar (lambda (x) (not (string-match re x)))
-   hlines
-  (if (and (not spanning)
-	   (not org-export-prefer-native-exporter-for-tables))
-	  ;; We can use my own converter with HTML conversions
-	  (org-format-table-table-html lines)
-	;; Need to use the code generator in table.el, with the original text.
-	(org-format-table-table-html-using-table-generate-source olines)
+;; Table made by table.el 
+(or (org-format-table-table-html-using-table-generate-source
+	 olines (not org-export-prefer-native-exporter-for-tables))
+	;; We are here only when table.el table has NO col or row
+	;; spanning and the user prefers using org's own converter for
+	;; exporting of such simple table.el tables.
+	(org-format-table-table-html lines
 
 (defvar org-table-number-fraction) ; defined in org-table.el
 (defun org-format-org-table-html (lines optional splice no-css)
@@ -2116,10 +2106,20 @@ But it has the disadvantage, that no cell- or row-spanning is allowed.
 (setq html (concat html /table\n))
 html))
 
-(defun org-format-table-table-html-using-table-generate-source (lines)
+(defun org-format-table-table-html-using-table-generate-source (lines
+optional
+spanned-only)
   Format a table into html, using `table-generate-source' from table.el.
-This has the advantage that cell- or row-spanning is allowed.
-But it has the disadvantage, that Org-mode's HTML conversions cannot be used.
+Use SPANNED-ONLY to suppress exporting of simple table.el tables.
+
+When SPANNED-ONLY is nil, all table.el tables are exported.  When
+SPANNED-ONLY is non-nil, only tables with either row or column
+spans are exported.
+
+This routine returns the generated source or nil as appropriate.
+
+Refer docstring of `org-export-prefer-native-exporter-for-tables'
+for further information.
   (require 'table)
   (with-current-buffer (get-buffer-create  org-tmp1 )
 (erase-buffer)
@@ -2128,10 +2128,14 @@ But it has the disadvantage, that Org-mode's HTML conversions cannot be used.
 (if (not (re-search-forward |[^+] nil t))
 	(error Error processing table))
 (table-recognize-table)
-(with-current-buffer (get-buffer-create  org-tmp2 ) (erase-buffer))
-(table-generate-source 'html  org-tmp2 )
-(set-buffer  org-tmp2 )
-(buffer-substring (point-min) (point-max
+(when (or (not spanned-only)
+	  (let* 

Re: [O] [PATCH] org-html.el: Fix export of table.el tables.

2011-04-24 Thread Jambunathan K

 org-html.el: Fix export of table.el tables.

The original mail contains an org file as an attachment which contains
sample table.el tables used for sanitizing the patch.

Forgot to add this note to my earlier mail.

Jambunathan K.

-- 



Re: [O] Display missing/overlapping clock ranges

2011-04-24 Thread Bernt Hansen
Carsten Dominik carsten.domi...@gmail.com writes:

 these are pretty good ideas, and since it is a holiday, I have some time,
 so I have tried an implementation and just pushed it to the master.


 Testing and feedback would be much appreciated.
 Also, it is not really useful to use this on a filtered agenda view,
 but testing of this would be appreciated as well.

Thanks Carsten!  I'll take a closer look at this on Tuesday when I'm
back in the office.  My initial reaction is it's *awesome*!  :)

Best Regards,
Bernt



[O] DITAA and Unicode characters [babel]

2011-04-24 Thread Juan Pechiar
Hi,

Out of the box, ob-ditaa does not work with non-ascii characters.

I looked into the problem in order to answer a user request on
StackOverflow (yes, there are org-mode questions posted there instead
of here!).

http://stackoverflow.com/questions/5758498/problem-with-ditaa-and-foreign-characters-in-org-mode

In order for ditaa to accept UTF-8 characters in the input file, it
must be called with the corresponding property setting:

   java -Dfile.encoding=UTF-8 -jar path/to/ditaa.jar ...

Attached is a dirty patch for hard-coding this property setting.

I don't know what the proper way of setting this property should be:

 - somehow setting it system-wide (any Java guru out there?).

 - or adding a customization to ob-ditaa.el for this property

 - or adding magic to ob-ditaa so that the same encoding of the buffer
   gets set to this Java property

I can help with the implementation if given some feedback on the above
options.

Regards,
.j.
diff --git a/lisp/ob-ditaa.el b/lisp/ob-ditaa.el
index 20b5c42..dc17a4d 100644
--- a/lisp/ob-ditaa.el
+++ b/lisp/ob-ditaa.el
@@ -55,7 +55,7 @@ This function is called by `org-babel-execute-src-block'.
 		(cdr (assoc :file params
 	 (cmdline (cdr (assoc :cmdline params)))
 	 (in-file (org-babel-temp-file ditaa-))
-	 (cmd (concat java -jar 
+	 (cmd (concat java -Dfile.encoding=UTF-8 -jar 
 		  (shell-quote-argument
 		   (expand-file-name org-ditaa-jar-path))
 		cmdline