[O] Bug: Revert orgtbl-create-or-convert-from-region [6.33x]

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

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

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


[Feature request]

I think one great way to increase the usefulness of org-mode would be a
function which turns a table into a csv or tsv block of text again.

I assume that the functionality exists already in org-table-export, I
would just wish for this to be exposed as a function which converts the
table in place instead of writing it into a new file (org-table-export
does not allow overwriting the current file).

This would finally give a comfortable way to edit tsv or csv tables
without hassles in emacs.

---

Emacs  : GNU Emacs 23.2.1 (x86_64-pc-linux-gnu, GTK+ Version 2.24.4)
 of 2011-04-04 on crested, modified by Debian
Package: Org-mode version 6.33x

current state:
==
(setq
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-export-preprocess-hook '(org-export-blocks-preprocess)
 org-tab-first-hook '(org-hide-block-toggle-maybe)
 org-src-mode-hook '(org-src-mode-configure-edit-buffer)
 org-confirm-shell-link-function 'yes-or-no-p
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers org-
cycle-show-empty-lines
  org-optimize-window-after-visibility-change)
 org-mode-hook '(#[nil \300\301\302\303\304$\207 [org-add-hook change-major-
mode-hook org-show-block-all append local] 5])
 org-confirm-elisp-link-function 'yes-or-no-p
 org-occur-hook '(org-first-headline-recenter)
 )

-- 
Max-Planck-Institute for Dynamics and Self-Organization
Laboratory for Fluid Dynamics, Pattern Formation and Biocomplexity
Biomedical Physics Group

Am Fassberg 17
D-37077 Goettingen

(+49) 551 5176 373


signature.asc
Description: This is a digitally signed message part.


Re: [O] Bug: Revert orgtbl-create-or-convert-from-region [6.33x]

2013-08-05 Thread Thorsten Jolitz
Daniel Hornung daniel.horn...@ds.mpg.de writes:

 I think one great way to increase the usefulness of org-mode would be a
 function which turns a table into a csv or tsv block of text again.

 I assume that the functionality exists already in org-table-export, I
 would just wish for this to be exposed as a function which converts the
 table in place instead of writing it into a new file (org-table-export
 does not allow overwriting the current file).

 This would finally give a comfortable way to edit tsv or csv tables
 without hassles in emacs.

Would you need something more sophisticated than this?

#+TBLNAME: tbl
| header 1 | header 2 | header 3 |
|--+--+--|
| label1   |3 |   99 |
| label2   |2 |   66 |
| label3   |7 |  231 |
#+TBLFM: $3=$2*33

#+HEADER: :var table=tbl :hlines no
#+HEADER: :results list verbatim
#+begin_src emacs-lisp
(defun tbl2csv (table-as-lisp)
  (mapconcat
   (lambda (row)
 (mapconcat
  (lambda (cell)
 (format %s cell))
  row ,))
   table-as-lisp ,))

(tbl2csv table)
#+end_src

#+results:
: header 1,header 2,header 3,label1,3,99,label2,2,66,label3,7,231

--
cheers,
Thorsten




[O] Extending org-contacts with properties: naming properties

2013-08-05 Thread Karl Voit
Hi!

I want to extend my (IMHO already advanced) org-contacts setup with
information I gave *to* companies about myself: what email address I
gave them (I own a catch-all email domain)[1], what address they
stored about me (in case I am moving and want to update), what phone
number they got of me (land-line, mobile, nothing), and so on.

Example: http://paste.grml.org/1445/

I am unsure about the prefix of those information I gave away. In my
example, I was using INFORMED_. However, I got other candidates as
well (from IRC: ##English) and I am open for new ones:

  - mediated
  - assigned
  - passed
  - requested
  - connexidatum
  - stored
  - delivered

As a German speaking person, I would like to read about your
thoughts on the correct naming of this stuff. 

The crucial issues are that the prefix should be understood without
much description and that is does not get mixed up with information
I am storing about contacts.

Thanks!

  1. I guess this will be very handy to automatically derive my mail
 filter set-up (spam tools, procmail, ...) :-)

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

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




Re: [O] Bug: Revert orgtbl-create-or-convert-from-region [6.33x]

2013-08-05 Thread Daniel Hornung
On Monday, August 05, 2013 11:16:55 Thorsten Jolitz wrote:
 Daniel Hornung daniel.horn...@ds.mpg.de writes:
  I think one great way to increase the usefulness of org-mode would be a
  function which turns a table into a csv or tsv block of text again.
  
  I assume that the functionality exists already in org-table-export, I
  would just wish for this to be exposed as a function which converts the
  table in place instead of writing it into a new file (org-table-export
  does not allow overwriting the current file).
  
  This would finally give a comfortable way to edit tsv or csv tables
  without hassles in emacs.
 
 Would you need something more sophisticated than this?
 
 #+TBLNAME: tbl
 
 | header 1 | header 2 | header 3 |
 |
 |--+--+--|
 |
 | label1   |3 |   99 |
 | label2   |2 |   66 |
 | label3   |7 |  231 |
 
 #+TBLFM: $3=$2*33
 
 #+HEADER: :var table=tbl :hlines no
 #+HEADER: :results list verbatim
 #+begin_src emacs-lisp
 (defun tbl2csv (table-as-lisp)
   (mapconcat
(lambda (row)
  (mapconcat
   (lambda (cell)
  (format %s cell))
   row ,))
table-as-lisp ,))
 
 (tbl2csv table)
 #+end_src
 
 #+results:
 : header 1,header 2,header 3,label1,3,99,label2,2,66,label3,7,231
 
 --
 cheers,
 Thorsten

The idea looks OK, although I did not get it to run with C-x C-e (copied the 
content into a new buffer, entered org-mode and executed the elisp code).  For 
more specific handling of e.g. strings, the code used in
http://orgmode.org/w/?p=org-mode.git;a=blob;f=lisp/org-table.el;hb=HEAD#l601
looks more like it could be used already, though. Plus, it allows to specify 
the column and row separators (e.g. \t and \n).

Cheers,
Daniel

-- 
Max-Planck-Institute for Dynamics and Self-Organization
Laboratory for Fluid Dynamics, Pattern Formation and Biocomplexity
Biomedical Physics Group

Am Fassberg 17
D-37077 Goettingen

(+49) 551 5176 373


signature.asc
Description: This is a digitally signed message part.


[O] org-velocity in GUI

2013-08-05 Thread Chaitanya Krishna
Hello everyone,

I have recently started using emacs and org-mode and this is the first mail
to the list. In fact, shifted to emacs just to use org-mode.

I am having problems using org-velocity from within a GUI both on Linux
using GTK and with MacEmacs. On the terminal it works as it should
intuitively.

The problem occurs when there are more than two matches after a C-c v key
press and the search term. I get to the Follow: option in the mini-buffer
at the bottom, but pressing a number from the choice of (#1, or #2) does
not do anything. But clicking on one of the links does take me the part of
the search that I want to edit.

Is there something wrong that I am doing or is it a bug?

Any help is appreciated.

Cheers,
Chai

-- 
42


[O] Export of clocking times

2013-08-05 Thread Gian-Maria Daffré

Hello,

I am on GNU Emacs 23.4.1 and Org Version 6.33x.

Maybe I am missing something obvious, but the clocking times are not
exported when I hit C-c C-e (org-export-dispatch) for Latex export.

This org entry:

* July 2013
** Visits
   CLOCK: [2013-07-10 Wed 13:30]--2013-07-10 Wed 17:30 =  4:00
   - Visit 10.7 afternoon
   CLOCK: [2013-07-10 Wed 09:00]--[2013-07-10 Wed 12:00] =  3:00
   - Visit 10.7 morning


Results as follows in Latex:
** Visits
   - Visit 10.7 afternoon
   - Visit 10.7 morning

without the clocking times (which a customer requests).

Are clocking time not exported at all (i.e. only Clock Report shows
totals) or do I have to add a setting/variable that I do not see at the
moment?

Thanks for your help.

Best regards
Giammi

-- 
I kindly ask you not to send me attachments in proprietary file
formats, use open standards like PDF, HTML, RTF or plain text.




Re: [O] Bug: Revert orgtbl-create-or-convert-from-region [6.33x]

2013-08-05 Thread Thorsten Jolitz
Daniel Hornung daniel.horn...@ds.mpg.de writes:

 On Monday, August 05, 2013 11:16:55 Thorsten Jolitz wrote:
 Daniel Hornung daniel.horn...@ds.mpg.de writes:
  I think one great way to increase the usefulness of org-mode would be a
  function which turns a table into a csv or tsv block of text again.
  
  I assume that the functionality exists already in org-table-export, I
  would just wish for this to be exposed as a function which converts the
  table in place instead of writing it into a new file (org-table-export
  does not allow overwriting the current file).
  
  This would finally give a comfortable way to edit tsv or csv tables
  without hassles in emacs.
 
 Would you need something more sophisticated than this?
 
 #+TBLNAME: tbl
 
 | header 1 | header 2 | header 3 |
 |
 |--+--+--|
 |
 | label1   |3 |   99 |
 | label2   |2 |   66 |
 | label3   |7 |  231 |
 
 #+TBLFM: $3=$2*33
 
 #+HEADER: :var table=tbl :hlines no
 #+HEADER: :results list verbatim
 #+begin_src emacs-lisp
 (defun tbl2csv (table-as-lisp)
   (mapconcat
(lambda (row)
  (mapconcat
   (lambda (cell)
  (format %s cell))
   row ,))
table-as-lisp ,))
 
 (tbl2csv table)
 #+end_src
 
 #+results:
 : header 1,header 2,header 3,label1,3,99,label2,2,66,label3,7,231
 
 --
 cheers,
 Thorsten

 The idea looks OK, although I did not get it to run with C-x C-e (copied the 
 content into a new buffer, entered org-mode and executed the elisp
 code). 

Mmh...it works here ... the table looks a bit distorted in your post ...

 For more specific handling of e.g. strings, the code used in
 http://orgmode.org/w/?p=org-mode.git;a=blob;f=lisp/org-table.el;hb=HEAD#l601
 looks more like it could be used already, though. Plus, it allows to
 specify the column and row separators (e.g. \t and \n).

In tbl2csv, one could replace the two hardcoded , with function args
'col-separator' and 'row-separator'.

Or use something like this:

#+begin_src emacs-lisp
  (defun tj/insert-exported-table (optional insertion-point file)
(let ((tmp-file (or file (make-temp-file foo)))
  (insert-point (or insertion-point (1+ (org-table-end)
  (org-table-export tmp-file orgtbl-to-csv)
  (goto-char insert-point)
  (insert-file-contents tmp-file)))
#+end_src

#+results:
: tj/insert-exported-table

then do 'M-: (tj/insert-exported-table)' on this table:

| header 1 | header 2 | header 3 |
|--+--+--|
| label1   |3 |   99 |
| label2   |2 |   66 |
| label3   |7 |  231 |

header 1,header 2,header 3
label1,3,99
label2,2,66
label3,7,231

-- 
cheers,
Thorsten




Re: [O] Export of clocking times

2013-08-05 Thread Nick Dokos
gian-maria.daf...@giammi.com (Gian-Maria Daffré) writes:

 Hello,

 I am on GNU Emacs 23.4.1 and Org Version 6.33x.

 Maybe I am missing something obvious, but the clocking times are not
 exported when I hit C-c C-e (org-export-dispatch) for Latex export.

 This org entry:

 * July 2013
 ** Visits
CLOCK: [2013-07-10 Wed 13:30]--2013-07-10 Wed 17:30 =  4:00
- Visit 10.7 afternoon
CLOCK: [2013-07-10 Wed 09:00]--[2013-07-10 Wed 12:00] =  3:00
- Visit 10.7 morning


 Results as follows in Latex:
 ** Visits
- Visit 10.7 afternoon
- Visit 10.7 morning

 without the clocking times (which a customer requests).

 Are clocking time not exported at all (i.e. only Clock Report shows
 totals) or do I have to add a setting/variable that I do not see at the
 moment?


Try adding

--8---cut here---start-8---
#+OPTIONS: c:t
--8---cut here---end---8---

to your file (or customize the variable org-export-with-clocks
if you want it always).

-- 
Nick




Re: [O] Bug: Revert orgtbl-create-or-convert-from-region [6.33x]

2013-08-05 Thread Thorsten Jolitz
Thorsten Jolitz tjol...@gmail.com writes:

 Or use something like this:

 #+begin_src emacs-lisp
   (defun tj/insert-exported-table (optional insertion-point file)
 (let ((tmp-file (or file (make-temp-file foo)))
   (insert-point (or insertion-point (1+ (org-table-end)
   (org-table-export tmp-file orgtbl-to-csv)
   (goto-char insert-point)
   (insert-file-contents tmp-file)))
 #+end_src

actually, to make it more useful, it should be expanded to something like:

#+begin_src emacs-lisp
  (defun tj/insert-exported-table (optional insertion-point format file)
Insert table exportet to FILE with function FORMAT.
  Insertion position is either below the exportet table or INSERTION-POINT.
(interactive
 (cond
  ((equal current-prefix-arg nil) nil)
  ((equal current-prefix-arg '(4))
   (list
(read-number Insertion Point: )))
  ((equal current-prefix-arg '(16))
   (list
(read-number Insertion Point: )
;; enter without double quotes
(read-string Format: )))
  (t
   (list
(read-number Insertion Point: )
(read-string Format: )
(ido-read-file-name File: )
(let ((tmp-file (or file (make-temp-file foo)))
  (insert-point (or insertion-point (1+ (org-table-end
  (fmt (or format orgtbl-to-csv)))
  (org-table-export tmp-file fmt)
  (save-excursion
(goto-char insert-point)
(insert-file-contents tmp-file
#+end_src

#+results:
: tj/insert-exported-table

do 'M-x tj/insert-exported-table' on this table:

| header 1 | header 2 | header 3 |
|--+--+--|
| label1   |3 |   99 |
| label2   |2 |   66 |
| label3   |7 |  231 |

header 1,header 2,header 3
label1,3,99
label2,2,66
label3,7,231

-- 
cheers,
Thorsten




Re: [O] Export of clocking times

2013-08-05 Thread Gian-Maria Daffré

Nick Dokos ndo...@gmail.com writes:

 gian-maria.daf...@giammi.com (Gian-Maria Daffré) writes:

 Hello,

 I am on GNU Emacs 23.4.1 and Org Version 6.33x.

 Maybe I am missing something obvious, but the clocking times are not
 exported when I hit C-c C-e (org-export-dispatch) for Latex export.

 This org entry:

 * July 2013
 ** Visits
CLOCK: [2013-07-10 Wed 13:30]--2013-07-10 Wed 17:30 =  4:00
- Visit 10.7 afternoon
CLOCK: [2013-07-10 Wed 09:00]--[2013-07-10 Wed 12:00] =  3:00
- Visit 10.7 morning


 Results as follows in Latex:
 ** Visits
- Visit 10.7 afternoon
- Visit 10.7 morning

 without the clocking times (which a customer requests).

 Are clocking time not exported at all (i.e. only Clock Report shows
 totals) or do I have to add a setting/variable that I do not see at the
 moment?


 Try adding


 #+OPTIONS: c:t


 to your file (or customize the variable org-export-with-clocks
 if you want it always).


Added #+OPTIONS: c:t - clocking times do not appear.

Cannot customize the variable org-export-with-clocks as it is not
available. 

I have to assume then, that my current version of Org-Mode in Debian
Stable does not yet contain this feature.

Thanks anyway for your help.

Best,
Giammi

-- 
I kindly ask you not to send me attachments in proprietary file
formats, use open standards like PDF, HTML, RTF or plain text.




Re: [O] Export of clocking times

2013-08-05 Thread Nick Dokos
gian-maria.daf...@giammi.com (Gian-Maria Daffré) writes:

 Nick Dokos ndo...@gmail.com writes:

 gian-maria.daf...@giammi.com (Gian-Maria Daffré) writes:


 I am on GNU Emacs 23.4.1 and Org Version 6.33x.

 Added #+OPTIONS: c:t - clocking times do not appear.

 Cannot customize the variable org-export-with-clocks as it is not
 available. 

 I have to assume then, that my current version of Org-Mode in Debian
 Stable does not yet contain this feature.


Indeed - the first time around, I didn't notice the version of org you
are running: 6.33 is very old.

-- 
Nick




Re: [O] Bug: Revert orgtbl-create-or-convert-from-region [6.33x]

2013-08-05 Thread Nick Dokos
Thorsten Jolitz tjol...@gmail.com writes:

 Daniel Hornung daniel.horn...@ds.mpg.de writes:

 On Monday, August 05, 2013 11:16:55 Thorsten Jolitz wrote:
 Daniel Hornung daniel.horn...@ds.mpg.de writes:
  I think one great way to increase the usefulness of org-mode would be a
  function which turns a table into a csv or tsv block of text again.
  
  I assume that the functionality exists already in org-table-export, I
  would just wish for this to be exposed as a function which converts the
  table in place instead of writing it into a new file (org-table-export
  does not allow overwriting the current file).
  
  This would finally give a comfortable way to edit tsv or csv tables
  without hassles in emacs.
 
 Would you need something more sophisticated than this?
 
 #+TBLNAME: tbl
 
 | header 1 | header 2 | header 3 |
 |
 |--+--+--|
 |
 | label1   |3 |   99 |
 | label2   |2 |   66 |
 | label3   |7 |  231 |
 
 #+TBLFM: $3=$2*33
 
 #+HEADER: :var table=tbl :hlines no
 #+HEADER: :results list verbatim
 #+begin_src emacs-lisp
 (defun tbl2csv (table-as-lisp)
   (mapconcat
(lambda (row)
  (mapconcat
   (lambda (cell)
  (format %s cell))
   row ,))
table-as-lisp ,))
 
 (tbl2csv table)
 #+end_src
 
 #+results:
 : header 1,header 2,header 3,label1,3,99,label2,2,66,label3,7,231
 
 --
 cheers,
 Thorsten

 The idea looks OK, although I did not get it to run with C-x C-e (copied the 
 content into a new buffer, entered org-mode and executed the elisp
 code). 

 Mmh...it works here ... the table looks a bit distorted in your post ...

 For more specific handling of e.g. strings, the code used in
 http://orgmode.org/w/?p=org-mode.git;a=blob;f=lisp/org-table.el;hb=HEAD#l601
 looks more like it could be used already, though. Plus, it allows to
 specify the column and row separators (e.g. \t and \n).

 In tbl2csv, one could replace the two hardcoded , with function args
 'col-separator' and 'row-separator'.

 Or use something like this:

 #+begin_src emacs-lisp
   (defun tj/insert-exported-table (optional insertion-point file)
 (let ((tmp-file (or file (make-temp-file foo)))
   (insert-point (or insertion-point (1+ (org-table-end)
   (org-table-export tmp-file orgtbl-to-csv)
   (goto-char insert-point)
   (insert-file-contents tmp-file)))
 #+end_src

 #+results:
 : tj/insert-exported-table

 then do 'M-: (tj/insert-exported-table)' on this table:

 | header 1 | header 2 | header 3 |
 |--+--+--|
 | label1   |3 |   99 |
 | label2   |2 |   66 |
 | label3   |7 |  231 |

 header 1,header 2,header 3
 label1,3,99
 label2,2,66
 label3,7,231

There are orgtbl-to-tsv and orgtbl-to-csv (and orgtbl-to-generic which
the first two call) functions in org: it should be possible to use them
and avoid reinventing wheels.

-- 
Nick




[O] [BUG] Infinite loop in org-agenda-show-new-time

2013-08-05 Thread Matt Lundin
When the agenda buffer is filtered by tag, I find that rescheduling an
item (via org-agenda-do-date-later, org-agenda-schedule, etc.) often
results in an infinite loop.

I believe this loop occurs in the function org-agenda-show-new-time.

Here are the steps I took to debug this:

1. I add a counter to the function:

--8---cut here---start-8---
(defun org-agenda-show-new-time (marker stamp optional prefix)
  Show new date stamp via text properties.
  ;; We use text properties to make this undoable
  (let ((inhibit-read-only t))
(setq stamp (concat prefix  =  stamp  ))
(setq my-counter 0) ;; -- my addition
(save-excursion
  (goto-char (point-max))
  (while (not (bobp))
(when (equal marker (org-get-at-bol 'org-marker))
  (org-move-to-column (- (window-width) (length stamp)) t)
  (org-agenda-fix-tags-filter-overlays-at (point))
  (setq my-counter (1+ my-counter)) ;; -- also my addition
  (if (featurep 'xemacs)
  ;; Use `duplicable' property to trigger undo recording
  (let ((ex (make-extent nil nil))
(gl (make-glyph stamp)))
(set-glyph-face gl 'secondary-selection)
(set-extent-properties
 ex (list 'invisible t 'end-glyph gl 'duplicable t))
(insert-extent ex (1- (point)) (point-at-eol)))
(add-text-properties
 (1- (point)) (point-at-eol)
 (list 'display (org-add-props stamp nil
  'face 'secondary-selection
  (beginning-of-line 1))
(beginning-of-line 0)
--8---cut here---end---8---

2. I narrow an agenda diary buffer by tag (e.g., home).

3. I reschedule an item.

4. Emacs hangs.

5. I hit C-g to stop the process.

6. I check the value of my-counter. The longer I let the process run,
the higher the value of my-counter. E.g., letting it run for
approximately ten seconds results in the following:

--8---cut here---start-8---
my-counter's value is 32193

Documentation:
Not documented as a variable.
--8---cut here---end---8---

Without C-g the number will keep increasing indefinitely.

Thanks,
Matt



Re: [O] [BUG] Infinite loop in org-agenda-show-new-time

2013-08-05 Thread Nick Dokos
Matt Lundin m...@imapmail.org writes:

 When the agenda buffer is filtered by tag, I find that rescheduling an
 item (via org-agenda-do-date-later, org-agenda-schedule, etc.) often
 results in an infinite loop.

 I believe this loop occurs in the function org-agenda-show-new-time.

 Here are the steps I took to debug this:

 1. I add a counter to the function:


 2. I narrow an agenda diary buffer by tag (e.g., home).

 3. I reschedule an item.

 4. Emacs hangs.

 5. I hit C-g to stop the process.

 6. I check the value of my-counter. The longer I let the process run,
 the higher the value of my-counter. E.g., letting it run for
 approximately ten seconds results in the following:

 my-counter's value is 32193


My one feeble attempt to reproduce this failed. Looking at the code

--8---cut here---start-8---
  (while (not (bobp))
(when (equal marker (org-get-at-bol 'org-marker))
  (org-move-to-column (- (window-width) (length stamp)) t)
  (org-agenda-fix-tags-filter-overlays-at (point))
  ...
  (beginning-of-line 1))
(beginning-of-line 0)
--8---cut here---end---8---

let's assume we are not at the beginning of the buffer, so we don't exit
the loop that way.  If the when succeeds, we do a couple of things and
then do (beginning-of-line 1). This just takes us to the beginning of
the current line. But after the when is done, we do (beginning-of-line
0) which should take us to the previous line.  So we should be making
steady progress towards the beginning of the buffer and the loop should
terminate.

Since you can reproduce it (and you've already done the hard work of
figuring out where the inf loop is), maybe you can edebug the function
and step through it a couple of times to see what's happening.
-- 
Nick




[O] Detangle - How to get it to work

2013-08-05 Thread Paul Dumais
Hi, I think detangle is a must for collaborative work.

I think I have read the instructions correctly, yet I can't seem to
get it to work. Here is a minimal test:

Org file named test.org:
#+PROPERTY: comments link
* Some source
#+begin_src clojure :tangle yes
  (defn hello [] (println hello))
#+end_src

This produces the following file named test.clj upon tangling:

;; [[file:~/test.org::*Some%20source][Some\ source:1]]

(defn hello [] (println hello))

;; Some\ source:1 ends here

When I add a line to the file:
(def x 1)

 and save, then do M-x org-babel-detangle, it says:
Detangled 0 code blocks

Is there something I'm missing?

Thanks!



Re: [O] [BUG] Infinite loop in org-agenda-show-new-time

2013-08-05 Thread Matt Lundin
Nick Dokos ndo...@gmail.com writes:

 Matt Lundin m...@imapmail.org writes:

 My one feeble attempt to reproduce this failed. Looking at the code

Here are the steps to reproduce the problem:

1. Create file test.org with the following content:

--8---cut here---start-8---
* TODO A   :home:
  SCHEDULED: 2013-08-05 Mon
* TODO B   :work:
  SCHEDULED: 2013-08-05 Mon
* TODO C   :play:
  SCHEDULED: 2013-08-05 Mon
* TODO D   :home:
  SCHEDULED: 2013-08-05 Mon
* TODO E   :work:
  SCHEDULED: 2013-08-05 Mon
* TODO F   :play:
  SCHEDULED: 2013-08-05 Mon
* TODO G   :home:
  SCHEDULED: 2013-08-05 Mon
* TODO H   :work:
  SCHEDULED: 2013-08-05 Mon
* TODO I   :play:
  SCHEDULED: 2013-08-05 Mon
--8---cut here---end---8---

2. /usr/bin/emacs -Q 

3. find file test.org

4. M-x org-agenda - hit  to restrict to buffer and then a for
diary

5. / home

6. Attempt to reschedule one of the visible items.

   (while (not (bobp))
   (when (equal marker (org-get-at-bol 'org-marker))
 (org-move-to-column (- (window-width) (length stamp)) t)
 (org-agenda-fix-tags-filter-overlays-at (point))
   ...
 (beginning-of-line 1))
   (beginning-of-line 0)

 let's assume we are not at the beginning of the buffer, so we don't exit
 the loop that way.  If the when succeeds, we do a couple of things and
 then do (beginning-of-line 1). This just takes us to the beginning of
 the current line. But after the when is done, we do (beginning-of-line
 0) which should take us to the previous line.  So we should be making
 steady progress towards the beginning of the buffer and the loop should
 terminate.

 Since you can reproduce it (and you've already done the hard work of
 figuring out where the inf loop is), maybe you can edebug the function
 and step through it a couple of times to see what's happening.

Thanks for the pointers. Running edebug with the file above reveals that
org-move-to-column is not working with the invisible sections of the
buffer.

With the sample file above, I filter the agenda to display only items
tagged :home:.

--8---cut here---start-8---
Day-agenda (W32):
Monday  5 August 2013 W32
  test:   Scheduled:  TODO A  :home:
  test:   Scheduled:  TODO D  :home:
  test:   Scheduled:  TODO G  :home:
--8---cut here---end---8---

When stepping through org-agenda-do-date-later, edebug reveals that the
point goes to the end of the buffer, as expected and then works its way
backward. When it arrives at the beginning of the line with task G, it
finds and match and executes the following functions:

--8---cut here---start-8---
  (org-move-to-column (- (window-width) (length stamp)) t)
  (org-agenda-fix-tags-filter-overlays-at (point))
--8---cut here---end---8---

The problem is that org-move-to-column shifts the point several lines
forward. In fact, if I make all contents of the agenda buffer visible
after edebug executes org-move-to-column, I find that the point is now
all the way at the end of line I, which, of course, will trigger an
endless loop. In other words, org-move-to-column moves the point to the
end of the entire invisible section.

--8---cut here---start-8---
Day-agenda (W32):
Monday  5 August 2013 W32
  test:   Scheduled:  TODO A  :home:
  test:   Scheduled:  TODO B  :work:
  test:   Scheduled:  TODO C  :play:
  test:   Scheduled:  TODO D  :home:
  test:   Scheduled:  TODO E  :work:
  test:   Scheduled:  TODO F  :play:
  test:   Scheduled:  TODO G  :home:
  test:   Scheduled:  TODO H  :work:
  test:   Scheduled:  TODO I  :play:
--8---cut here---end---8---
  

Re: [O] How to trigger the clockcheck in an agenda view.

2013-08-05 Thread Sebastien Vauban
Rainer Stengele wrote:
 Am 7/29/2013 10:48 AM, schrieb Sebastien Vauban:
 Rainer Stengele wrote:
 Am 7/17/2013 2:07 PM, schrieb Rainer Stengele:
 Am 12.07.2013 10:06, schrieb Rainer Stengele:

 I want to start an aganda view over a week and immediately check the
 consistency of clock entries:

 I can't seem to find a way to trigger the clockcheck in the agenda view
 options.

 At the moment I have::

   (Aw
agenda + no todos - this week - log-mode - ARCHIVE included - clock 
 report
agenda 
(
 (org-agenda-sorting-strategy '(time-up priority-down))
 (org-agenda-span 'week)
 (org-agenda-start-with-log-mode t)
 (org-agenda-archives-mode t)
 (org-agenda-start-with-clockreport-mode t)
 ))

 Do I miss the variable to be set?

 Anybody?

 I know this is special, but I do not know how to check the existence of such
 a variable. If it doesn't I would suggest it as enhancement.
 
 The following does what you want:
 
 --8---cut here---start-8---
   (add-to-list 'org-agenda-custom-commands
'(rC Clock Review
  agenda 
  ((org-agenda-archives-mode t)
   (org-agenda-clockreport-mode t)
   (org-agenda-overriding-header Clocking Review)
   (org-agenda-show-log 'clockcheck)
   (org-agenda-span 'day))) t)
 --8---cut here---end---8---
 
 Best regards,
   Seb
 
 PS- I've been on holidays and still ahve ~300 Org posts to read...

 thank you for taking your precious time to consider my question!

No problem -- even if I'm not always on time on the ball...

 I replaced my configuration with exactly yours and it doesn't start with
 showing the clockchecks (time gaps etc.).
 I have to type v c to activate the clockcheck.

I wonder if the fact that I use a double key is not a problem here. In fact,
I missed sending this as well:

--8---cut here---start-8---
  (add-to-list 'org-agenda-custom-commands
   '(r . Review...) t)
--8---cut here---end---8---

 I run the latest org version from just 3 minutes ago.

Except the above, I definitely don't understand why it wouldn't work for you.
Can you reproduce the problem with a minimal Emacs config file (adding the
require of `org' and `org-agenda' before)?

Best regards,
  Seb

-- 
Sebastien Vauban




[O] [FeatureReq]: Move nodes in column view

2013-08-05 Thread Thomas Koch
Hi,

I'm just learning about column view. It might be very useful to work on scrum 
backlogs with column view and storypoints as a column.
It would be wonderful if I could move nodes up and down in column view to 
reorder the priority of backlog items represented as org nodes.

Is this possible already?

Regards,

Thomas Koch, http://www.koch.ro



[O] org-attach should detect git also higher in the filesystem

2013-08-05 Thread Thomas Koch
Hi,

I tested org-attach with the org file being inside a git repo. I observed that 
the auto-commit feature of org-attach seems to work only if the data directory 
is the root of a git repo (detected by looking for a .git folder in the data 
folder).

I'd like however to have the org file in the git repo too and the data folder 
being a sub-folder of the git repo. Actually I'd also like to use git-annex 
here.

Some options of git rev-parse might be helpful here instead of coding the repo 
detection check by hand in elisp: 

--show-toplevel
   Show the absolute path of the top-level directory.

--is-inside-work-tree
   When the current working directory is inside the work tree of the 
repository print true, otherwise false.

What do you think?

Regards,

Thomas Koch, http://www.koch.ro



Re: [O] [BUG] Infinite loop in org-agenda-show-new-time

2013-08-05 Thread Nick Dokos
Matt Lundin m...@imapmail.org writes:

 Nick Dokos ndo...@gmail.com writes:

 Matt Lundin m...@imapmail.org writes:

 My one feeble attempt to reproduce this failed. Looking at the code

 Here are the steps to reproduce the problem:


Thanks for the recipe: I still can't reproduce it - it just works for
me.

Org-mode version 8.0.7 (release_8.0.7-367-gd1d918 @
/home/nick/elisp/org-mode/lisp/)

GNU Emacs 24.3.50.2 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.10) of
2013-07-14 on pierrot


 Thanks for the pointers. Running edebug with the file above reveals that
 org-move-to-column is not working with the invisible sections of the
 buffer.

 With the sample file above, I filter the agenda to display only items
 tagged :home:.

 Day-agenda (W32):
 Monday  5 August 2013 W32
   test:   Scheduled:  TODO A  
 :home:
   test:   Scheduled:  TODO D  
 :home:
   test:   Scheduled:  TODO G  
 :home:

 When stepping through org-agenda-do-date-later, edebug reveals that the
 point goes to the end of the buffer, as expected and then works its way
 backward. When it arrives at the beginning of the line with task G, it
 finds and match and executes the following functions:

 (org-move-to-column (- (window-width) (length stamp)) t)
 (org-agenda-fix-tags-filter-overlays-at (point))

 The problem is that org-move-to-column shifts the point several lines
 forward. In fact, if I make all contents of the agenda buffer visible
 after edebug executes org-move-to-column, I find that the point is now
 all the way at the end of line I, which, of course, will trigger an
 endless loop. In other words, org-move-to-column moves the point to the
 end of the entire invisible section.


org-move-to-column is just a compatibility function that calls
move-to-column whose doc says:

  Move point to column COLUMN in the current line.

So I'm not sure why it ends up on a different line.

 This bug was introduced with the following commit:

 commit fafb5f3429c41cba1eddb9fc78d9f9e0980acbe2
 Author: Bastien Guerry b...@altern.org
 Date:   Mon Feb 11 14:56:38 2013 +0100

 org-agenda.el: Fix bug when displaying a temporary overlay
 
 * org-agenda.el (org-agenda-schedule, org-agenda-deadline):
 Cosmetic changes.
 (org-agenda-show-new-time): Fix bug when displaying a
 temporary overlay with the scheduled/deadline information.
 
 Thanks to Thomas Morgan for reporting this bug and testing the patch.

 This commit removed the local binding of buffer-invisibility-spec to
 nil in org-agenda-show-new-time.

 Here is the bug this change was meant to fix:

 http://permalink.gmane.org/gmane.emacs.orgmode/52667

 Might we revert this change? The original bug was cosmetic. This bug,
 however, interferes in an essential way with the functioning of agenda
 buffers.


So you revert that commit and the infloop goes away? I looked at the
functions briefly and I don't understand how this commit could affect
what move-to-column does.

Can you provide emacs and org versions? Maybe there is something weird
in what you use.
-- 
Nick




[O] three bugs/misfeatures in org-reveal (or is org-reveal the wrong way to reveal around point?)

2013-08-05 Thread Samuel Wales
I hope a kind soul can comment here.

For years I have been trying to make it so that you can go
to Org from Magit and have it reveal the way I want.

[All I want is what for me is a normal visibility state, which means a
visibility state that can be recreated using only arrow keys and TAB.]

Is org-reveal the wrong tool for this job?  Is there another tool that
works better for it?

The apparent bugs are in the comments below.

Thanks.

Samuel

P.S.  I am also hoping for the same effect upon going from the Org
agenda to the Org outline.

===

(defadvice magit-visit-item (after org-visibility activate compile)
  Make going to Org from Magit reveal canonically.
  (when (eq major-mode 'org-mode)
(alpha-org-reveal-canonically)))

(defun alpha-org-reveal-canonically ()
  Reveal around point canonically.

Canonical visibility means that the buffer is always in a
visibility state that can be created solely by arrow keys + TAB.

Thus, merely showing the next header without all of its siblings
is not canonical.  Also, showing children without showing the
parent's entry text is not canonical.
  (interactive)

  ;; bug 1: when point is in entry text, the first child of that
  ;; entry shows, but its siblings (i.e. the other children) do
  ;; not show, even though i have org-show-siblings and
  ;; org-show-hierarchy-above both set to t.
  ;;
  ;; the entry text must show because point is in it.  and
  ;; because it must show, so must all children.  how do i get it
  ;; to do this?
  ;;
  ;; bug 2: when point is on the first child headline, its
  ;; siblings show, but the entry text of its parent does not
  ;; show.  how do i get it to show the parent's entry text?
  ;;
  ;; bug 3: org-reveal takes several seconds to run.  is there a
  ;; way to speed it up?

  (org-reveal t)
  ;; (if ...)
  ;; (show-entry)
  )



Re: [O] Extending org-contacts with properties: naming properties

2013-08-05 Thread Samuel Wales
Provided?  Given?

-- 
The Kafka Pandemic: http://thekafkapandemic.blogspot.com

The disease DOES progress.  MANY people have died from it.  ANYBODY can get it.

Denmark: free Karina Hansen NOW.



[O] [PATCH] Emacs Org Babel Scheme (Geiser) support

2013-08-05 Thread Bruno Félix Rezende Ribeiro
   _

[PATCH] EMACS ORG BABEL SCHEME (GEISER) SUPPORT

  Bruno Félix Rezende Ribeiro
   _


This is a patch submission for the Emacs Org Babel Scheme support,
Geiser based, implementation (file ob-scheme.el).  It achieves the
following:

1. Removes the restriction on evaluated code's top-level definitions
   introduced in the major rewrite to support Geiser[1].  The previous
   evaluation procedure used to wrap the whole code in a
   `(with-output-to-string ...)' form before sending it to Geiser.  A
   more robust technique is employed in the evaluation procedure
   avoiding such arguable bugs that results from the artificial wrapping
   of code.  Now the Scheme code is not modified in any way before being
   interpreted by the REPL.  For instance it is possible to use the so
   common and necessary `(define ...)' top level statements[2].
2. A more sound and reliable communication mechanism is employed to
   process the return value, output and error yielded by the REPL and
   reported by Geiser to ob-scheme[3].  Previously ob-scheme and Geiser
   did communication over the echo area.[4] That behavior leads to
   inconsistent results when debugging code and potentially broken code
   if a minor change in Geiser's echo area output syntax were made[5].
3. Taking advantage of the new communication mechanism described in the
   previous item the evaluation error handling logic is extended to
   report REPL error messages directly into the result blocks instead of
   the ubiquitous and uninformative An error occurred.  message.
4. Frame window configuration restitution measures are implemented to
   prevent that Geiser spawns a persistent[6] window for each new
   invoked REPL session[7][8].

This patch has been tested only with Guile's Scheme implementation.  But
inasmuch ob-scheme does not interface directly to interpreters, but
rather to Geiser, the code should be implementation agnostic[9].

The ChangeLog follows:

,
| Babel Scheme:
|
|  * lisp/ob-scheme.el (org-babel-scheme-make-session-name): remove wrap
|around code to be evaluated and get evaluation result directly from
|`geiser-eval-region' respecting evaluation error messages and
|restoring frame's window configuration after it.
|(org-babel-scheme-get-repl): Restore frame's window configuration
|after asking Geiser to run the REPL.
|
| These changes fix:
|
| - a major regression from the older implementation that prevents code
|   with top-level definitions from being correctly evaluated.
| - the mechanism of communication with Geiser (before did over the echo
|   area).
| - a bug of reference to a nonexistent echo area message that occurred
|   whenever debugging (edebug) `org-babel-scheme-make-session-name'.
| - the report of evaluation errors.
| - the intrusive creation of REPL windows.
`

Thank you for your contribution to Free Software.  Best regards.

*Ps:*

- The ChangeLog entry is already included in the commit for Org
  maintainers' pleasure.
- Since the changes made sums up to more than 15 lines, so it does not
  classify as tiny change, and the code changed is part of Org's core,
  I will probably need to sign a FSF copyright assignment.  That will be
  no burden as I pretend to contribute to GNU Emacs whenever possible.



Footnotes
_

[1] See [{O} {PATCH} Babel support for scheme using geiser]
(https://lists.gnu.org/archive/html/emacs-orgmode/2013-01/msg00134.html).

[2] In fact, that is the main and original motivation behind this
patch.  Believe it or not the new ob-scheme implementation failed on
my first attempt to evaluate a snippet of scheme that happens to be
the result of the resolution of the first question of the famous [SICP
- Structure and Interpretation of Computer Programs]
(https://mitpress.mit.edu/sicp/sicp.html).  Odd is the fact that it is
a deliberated regression from the older implementation (cf. [1]).

[3] Now it uses the return value of a `geiser-eval-region' call which
is a loose association list containing all information needed.

[4] The echo area message was used by ob-scheme to detect an error on
evaluation and to transform valid result or output into a lisp object.

[5] It was impossible to debug the whole
`org-babel-scheme-execute-with-geiser' procedure because it relied on
the Geiser's echo area output that was generated several forms earlier
and, by the echo area's own nature/mechanism, had gone when the
programmer pressed a key to step to the next stop point in the edebug
process.  Whether that is a edebug or ob-scheme bug is arguable, but
certainly to use the echo area to inter-library communication is not a
good programming practice since the echo area is intended just as a
clue feature for human eyes.

[6] By persistent window I mean an auxiliary window that is not
removed in the end of the associated procedure's execution.


Re: [O] Detangle - How to get it to work

2013-08-05 Thread Paul Dumais
Ok, I have a work-around which involves handling an error in
ob-tangle.el. The bug is in the org-babel-tangle-jump-to-org function
where 'forward-char' is spitting out an unhandled error as it tries to
move beyond the end of the buffer.

Here's the diff for my simple (half) fix:

1 file changed, 4 insertions(+), 1 deletion(-)
 lisp/ob-tangle.el | 5 -

Modified   lisp/ob-tangle.el
diff --git a/lisp/ob-tangle.el b/lisp/ob-tangle.el
index 8141943..5cf50d4 100644
--- a/lisp/ob-tangle.el
+++ b/lisp/ob-tangle.el
@@ -542,7 +542,10 @@ which enable the original code blocks to be found.
   (org-edit-special)
   ;; Then move forward the correct number of characters in the
   ;; code buffer.
-  (forward-char (- mid body-start))
+  (condition-case err
+  (forward-char (- mid body-start))
+ (error (message mid %d body-start %d\nerror message: %s
+ mid body-start (error-message-string err
   ;; And return to the Org-mode buffer with the point in the right
   ;; place.
   (org-edit-src-exit)

The real fix would involve finding out why the (- mid body-start)
value is not calculated correctly and puts point beyond the end of the
buffer.

On Mon, Aug 5, 2013 at 1:36 PM, Paul Dumais p...@unstate.ca wrote:
 Hi, I think detangle is a must for collaborative work.

 I think I have read the instructions correctly, yet I can't seem to
 get it to work. Here is a minimal test:

 Org file named test.org:
 #+PROPERTY: comments link
 * Some source
 #+begin_src clojure :tangle yes
   (defn hello [] (println hello))
 #+end_src

 This produces the following file named test.clj upon tangling:

 ;; [[file:~/test.org::*Some%20source][Some\ source:1]]

 (defn hello [] (println hello))

 ;; Some\ source:1 ends here

 When I add a line to the file:
 (def x 1)

  and save, then do M-x org-babel-detangle, it says:
 Detangled 0 code blocks

 Is there something I'm missing?

 Thanks!



Re: [O] Extending org-contacts with properties: naming properties

2013-08-05 Thread David Rogers
Samuel Wales samolog...@gmail.com writes:

 Provided?  Given?

I agree that this kind of simple thing looks like a better
idea. However, it would also be nice to be able to call it some name
where a person who encounters the software capability but doesn't yet
know what it's for will understand what it's for just from reading the
name. Given is simple and sounds clear, but it doesn't say who did the
giving so the clarity is over-rated. CustomerInfoIGaveThem is a bit
long. :) (and TheirRecordOfMe is hardly any better.) :)

-- 
David



Re: [O] Extending org-contacts with properties: naming properties

2013-08-05 Thread Samuel Wales
Perhaps relaxing the understandability requirement in favor of
searchability would work.



Re: [O] Bug: Revert orgtbl-create-or-convert-from-region [6.33x]

2013-08-05 Thread Rustom Mody
I was writing up what I could make out of having program-files with inline
tables.
The example is done for python.  It is exactly what the OP wants but close
enough so giving it here.
This file shows two approaches for making python data structures from
orgtbl with both sender and receiver in same file.

The first table is made with single line comments
The second table is made using python's triple-quote feature
The third is the recipient for both/either of the above

To try out orgtbl minor mode needs to be active after python mode is active.
Also it does not quite work for org 6.33
---
For the first use M-x orgtbl-toggle-comment followed by C-c C-c (inside the
table) to send to recipient, followed by another M-x orgtbl-toggle-comment

For the second only C-c C-c in the sender table is sufficient


cut here

# #+ORGTBL: SEND marks orgtbl-to-generic :sep ,
#   | abe   | 1 | 2 | 3 | 4 | 10 |
#   | beth  | 3 | 1 | 5 | 7 | 16 |
#   | cathy | 5 | 6 | 7 | 5 | 23 |
# #+TBLFM: $6=$2+$3+$4+$5


orig_table = 

#+ORGTBL: SEND marks orgtbl-to-generic :lfmt   \%s\: [%s,%s,%s,%s,%s],
:llfmt   \%s\: [%s,%s,%s,%s,%s]
  | abe   | 1 | 2 | 3 | 4 | 10 |
  | beth  | 9 | 1 | 5 | 9 | 24 |
  | cathy | 5 | 6 | 7 | 5 | 23 |
#+TBLFM: $6=$2+$3+$4+$5


stud_db = {
# BEGIN RECEIVE ORGTBL marks
abe,1,2,3,4,10
beth,3,1,5,7,16
cathy,5,6,7,5,23
# END RECEIVE ORGTBL marks
}

--- cut here -



-- 
http://www.the-magus.in
http://blog.languager.org


Re: [O] Bug: Revert orgtbl-create-or-convert-from-region [6.33x]

2013-08-05 Thread Rustom Mody
On Tue, Aug 6, 2013 at 10:58 AM, Rustom Mody rustompm...@gmail.com wrote:

 I was writing up what I could make out of having program-files with inline
 tables.
 The example is done for python.  It is exactly what the OP wants but close
 enough


That was intended to be NOT exactly what the OP wants...