[O] Re-marking agenda entries, with advice on org-agenda-bulk-action in .emacs

2011-10-02 Thread netty hacky
Hello,

The issue of re-marking agenda entries has been raised before:
http://lists.gnu.org/archive/html/emacs-orgmode/2011-02/msg00200.html

I am facing the same problem.  I always do more than one bulk actions on the
same set of agenda entries, so having to re-mark them manually has been a
pain.  The org-agenda-bulk-mark-regexp command sort of helped, but I still
prefer the Dired behavior of retaining the mark after action is performed,
(typing one 'U' is much less keystroke than any manual re-marking).

Anyway, I put the following piece of code in .emacs to give me the Dired
like behavior.  It seems to work for me.  Since I'm new to Emacs Lisp and
this is the 2nd day I'm hacking Org-mode code, could anyone help spot
anything I did stupid here that may shoot me in the foot?  Much appreciated.

(eval-after-load 'org-agenda
  '(defadvice org-agenda-bulk-action (around bulk-re-mark
 (optional arg)
 activate)
 Re-mark entries marked before action.
 (let ((entries (copy-sequence org-agenda-bulk-marked-entries)))
   ad-do-it
   (let (pos (cnt 0) (cntskip 0) (msg (current-message)))
 (dolist (e entries)
   (setq pos (text-property-any (point-min) (point-max)
'org-hd-marker e))
   (if (not pos)
   (setq cntskip (1+ cntskip))
 (goto-char pos)
 (call-interactively 'org-agenda-bulk-mark)
 (setq cnt (1+ cnt
 (message %s (%d entries re-marked, %d skipped) msg cnt
cntskip)

Cheers,
Net
P.S. I would like to express my sincere gratitude to all who helped make
Org-mode such a beautiful piece of software and a life-changing experience.


Re: [O] % (org-agenda-bulk-mark-regexp) in agenda view problems

2011-10-02 Thread netty hacky
Sorry, didn't realized I wasn't sending email in plain text.

On Sat, Oct 1, 2011 at 3:14 PM, netty hacky netty.ha...@gmail.com wrote:

 Hi Bastien,

 I found a third problem of org-agenda-bulk-mark-regexp, it does not work well 
 on daily/weekly agenda view.  Basically it chokes on lines that is not a 
 regular headline, like date labels, dairy entries and grid lines.

 So to show I am not merely a leech on this list, I come up with my version 
 here, most of the ugly code are to deal with the way org-agenda-bulk-mark 
 works now (e.g., returning nil when successful):

 (defun org-agenda-bulk-mark-regexp (regexp)
   Mark entries match REGEXP.
   (interactive sMark entries matching regexp: )
     (save-excursion
   (goto-char (point-min))
   (let ((entries-marked 0))
     (while (not (eobp))
   (unless (and
    (not (get-char-property (point) 'invisible))
    (not (org-get-at-bol 'org-agenda-diary-link))
    (org-get-at-bol 'org-hd-marker)
    (let (txt-property)
  (setq txt-property (get-char-property (point) 'txt))
  (string-match regexp txt-property))
    (not (call-interactively 'org-agenda-bulk-mark))
    (setq entries-marked (+ entries-marked 1)))
     (beginning-of-line 2)))
     (if (zerop entries-marked)
     (message No entry matching this regexp.)
   (message %d entries marked for bulk action entries-marked)

 Thanks,
 Net

 On Sat, Oct 1, 2011 at 12:38 AM, netty hacky netty.ha...@gmail.com wrote:

 Hi Bastien,

 I'm having two problems with the % command (org-agenda-bulk-mark-regexp) in 
 Org-mode agenda view.

 1.  If I use . as the search string, I get Wrong type argument: 
 number-or-marker-p, nil.  And my workaround is to change the line (let 
 (entries-marked) in org-agenda.el to (let ((entries-marked 0)).

 2. If I use .* as the search string, I get Wrong type argument: stringp, 
 nil.  After some edebugging, I found the reason is that in 
 org-agenda-bulk-mark-regexp, re-search-forward moved the point to the end of 
 the line (since .* matches the whole line), causing (get-text-property 
 (point) 'txt) to return nil, in turn caused string-match to throw the 
 error.  I think this may happen to other regexps, as long as the strings 
 matched include the last character in the line.  I'm new to Emacs Lisp so 
 I'm not sure how to fix this one.

 Wondering why it seems only me having these two problems.

 I am using MacPorts' Emacs and Org-mode:
 Emacs  : GNU Emacs 23.3.1 (x86_64-apple-darwin10.8.0)
 Package: Org-mode version 7.7

 Thanks,
 Net





Re: [O] Re-marking agenda entries, with advice on org-agenda-bulk-action in .emacs

2011-10-02 Thread netty hacky
My bad, didn't realized I wasn't sending email in plain txt.

On Sun, Oct 2, 2011 at 2:13 AM, netty hacky netty.ha...@gmail.com wrote:
 Hello,

 The issue of re-marking agenda entries has been raised before:
 http://lists.gnu.org/archive/html/emacs-orgmode/2011-02/msg00200.html

 I am facing the same problem.  I always do more than one bulk actions on the
 same set of agenda entries, so having to re-mark them manually has been a
 pain.  The org-agenda-bulk-mark-regexp command sort of helped, but I still
 prefer the Dired behavior of retaining the mark after action is performed,
 (typing one 'U' is much less keystroke than any manual re-marking).

 Anyway, I put the following piece of code in .emacs to give me the Dired
 like behavior.  It seems to work for me.  Since I'm new to Emacs Lisp and
 this is the 2nd day I'm hacking Org-mode code, could anyone help spot
 anything I did stupid here that may shoot me in the foot?  Much appreciated.

 (eval-after-load 'org-agenda
   '(defadvice org-agenda-bulk-action (around bulk-re-mark
  (optional arg)
  activate)
  Re-mark entries marked before action.
  (let ((entries (copy-sequence org-agenda-bulk-marked-entries)))
    ad-do-it
    (let (pos (cnt 0) (cntskip 0) (msg (current-message)))
  (dolist (e entries)
    (setq pos (text-property-any (point-min) (point-max)
 'org-hd-marker e))
    (if (not pos)
    (setq cntskip (1+ cntskip))
  (goto-char pos)
  (call-interactively 'org-agenda-bulk-mark)
  (setq cnt (1+ cnt
  (message %s (%d entries re-marked, %d skipped) msg cnt
 cntskip)

 Cheers,
 Net
 P.S. I would like to express my sincere gratitude to all who helped make
 Org-mode such a beautiful piece of software and a life-changing experience.




[O] Patch for bug in adjusting time ranges in Agenda

2011-10-02 Thread Niels Giesen
Hi Orgers,

The discussion in the recent thread Time range end in agenda view not
displayed prompted me to take a closer look at time/date ranges in the
Agenda view. I noticed that the commands `org-agenda-do-date-later' and
`org-agenda-do-date-earlier' do not work correctly on timestamp ranges,
in that they only shift the rightmost timestamp in the range. The patch
below should fix this.

#+begin_src diff
  From 2e6b64dc8dcae0fd312729af96ab10d8d2e9d91b Mon Sep 17 00:00:00 2001
  From: Niels Giesen niels.gie...@gmail.com
  Date: Sun, 2 Oct 2011 09:15:21 +0200
  Subject: [PATCH] Fix shift-adjusting time and date ranges from within Agenda.
  
  ,* org-mode/lisp/org-agenda.el (org-agenda-date-later): Adjust both
start and end timestamp for a range, and set
`org-last-changed-timestamp' to a representation of the new range.
  ---
   lisp/org-agenda.el |8 +++-
   1 files changed, 7 insertions(+), 1 deletions(-)
  
  diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
  index b1fa5f5..e4c1053 100644
  --- a/lisp/org-agenda.el
  +++ b/lisp/org-agenda.el
  @@ -7517,7 +7517,13 @@ the same tree node, and the headline of the tree node 
in the Org-mode file.
  (goto-char pos)
  (if (not (org-at-timestamp-p))
 (error Cannot find time stamp))
  -   (org-timestamp-change arg (or what 'day)))
  +   (org-timestamp-change arg (or what 'day))
  +   (when (org-at-date-range-p)
  + (let ((end org-last-changed-timestamp))
  +   (re-search-backward org-tr-regexp-both)
  +   (org-timestamp-change arg (or what 'day))
  +   (setq org-last-changed-timestamp
  +(concat org-last-changed-timestamp -- end)
(org-agenda-show-new-time marker org-last-changed-timestamp))
   (message Time stamp changed to %s org-last-changed-timestamp)))
   
  -- 
  1.7.2.5
  
  
#+end_src

Regards,
niels
--
http://pft.github.com



[O] Patch for numbering continuation in source blocks.

2011-10-02 Thread Niels Giesen
NOTE: I have tried earlier to send this patch with git send-email,
  but apparently failed; here's a new, inlined attempt.

  The documentation for numbering source code blocks says:

#+begin_quote
If you use a `+n' switch, the numbering from the previous
numbered snippet will be continued in the current one.
#+end_quote

  But that is not exactly what happens; what happens is that the
numbering from the previous snippet will be continued in the current
one. That is, when the previous snippet is numbered its numbering will
continue, but if there is a previous numbered snippet A with, say, 14
lines followed by an unnumbered snippet B followed by a numbered
snippet C, then the numbers for C will start at 1, regardless of the +
in the +n switch, whereas my reading of the documentation leads me to
think it ought to continue at 15, disregarding the presence any
unnumbered sections in between.

Reason for me for the +n switch to comply with (my reading of) the
documentation is that I would like to document a long, line-numbered,
function but intersperse it with short code samples without line
numbering that explain parts of the long function.

This patch of course may break existing org files where +n was
specified but -n intended.

#+begin_src diff
  From 4d34d5f2fe10a956d3359dfd40f19de25202df5f Mon Sep 17 00:00:00 2001
  From: Niels Giesen niels.gie...@gmail.com
  Date: Fri, 16 Sep 2011 17:22:47 +0200
  Subject: [PATCH] Continue numbering from any previous numbered snippet with 
+n, even when previous numbered snippet does not immediately precede it.
  
  ,* org-mode/lisp/org-exp.el (org-export-number-lines):
  
Check whether number parameter (this is a numbered block!) is
non-nil as well as whether cont is nil (this numbered block should
*not* continue numbering where we left off before!) before resetting
the count to zero.
  
From the docs:
  
  If you use a `+n' switch, the numbering from the previous
  numbered snippet will be continued in the current one.
  
With this change I believe the code complies with the docs.
  ---
   lisp/org-exp.el |2 +-
   1 files changed, 1 insertions(+), 1 deletions(-)
  
  diff --git a/lisp/org-exp.el b/lisp/org-exp.el
  index 9884a31..12590e1 100644
  --- a/lisp/org-exp.el
  +++ b/lisp/org-exp.el
  @@ -2731,7 +2731,7 @@ INDENT was the original indentation of the block.
   (defun org-export-number-lines (text optional skip1 skip2 number cont
   replace-labels label-format)
 (setq skip1 (or skip1 0) skip2 (or skip2 0))
  -  (if (not cont) (setq org-export-last-code-line-counter-value 0))
  +  (if (and number (not cont)) (setq org-export-last-code-line-counter-value 
0))
 (with-temp-buffer
   (insert text)
   (goto-char (point-max))
  -- 
  1.7.4.1
  
  
#+end_src

Regards,
niels
--
http://pft.github.com



[O] Bug: spreadsheet [7.7]

2011-10-02 Thread Paul Stansell
Hello,

I think I have found a bug in the spreadsheet of orgmode.

To reproduce the bug do the following:

Edit this file with emacs orgmode.

Place the cursor in the small table below and type C-c } to toggle on the
display a labelled grid giving the cell references.

Change the c=1 in the CONSTANTS line to c=2 and refresh this line with C-c
C-c.

Put the cursor on the TBLFM line and refresh this line with C-c C-c.

An I*1 appears above the table which should not appear and can't be
removed with the usual emacs commands.


  |---|
  | 1 |
  |---|
#+TBLFM: $1=$c
#+CONSTANTS: c=1



Emacs  : GNU Emacs 23.1.1 (i386-redhat-linux-gnu, GTK+ Version 2.18.9)
 of 2010-06-03 on xb-01.phx2.fedoraproject.org
Package: Org-mode version 7.7

current state:
==
(setq
 org-export-latex-after-initial-vars-hook '(org-beamer-after-initial-vars)
 org-speed-command-hook '(org-speed-command-default-hook
  org-babel-speed-command-hook)
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-export-blocks-postblock-hook '(org-exp-res/src-name-cleanup)
 org-export-latex-format-toc-function 'org-export-latex-format-toc-default
 org-tab-first-hook '(org-hide-block-toggle-maybe
  org-src-native-tab-command-maybe
  org-babel-hide-result-toggle-maybe)
 org-src-mode-hook '(org-src-babel-configure-edit-buffer
 org-src-mode-configure-edit-buffer)
 org-confirm-shell-link-function 'yes-or-no-p
 org-export-first-hook '(org-beamer-initialize-open-trackers)
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-babel-pre-tangle-hook '(save-buffer)
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers
  org-cycle-show-empty-lines
  org-optimize-window-after-visibility-change)
 org-export-preprocess-before-normalizing-links-hook
'(org-remove-file-link-modifiers)
 org-mode-hook '(#[nil \300\301\302\303\304$\207
   [org-add-hook change-major-mode-hook org-show-block-all
append local]
   5]
 #[nil \300\301\302\303\304$\207
   [org-add-hook change-major-mode-hook
org-babel-show-result-all append local]
   5]
 org-babel-result-hide-spec org-babel-hide-all-hashes)
 org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point
  org-babel-execute-safely-maybe)
 org-confirm-elisp-link-function 'yes-or-no-p
 org-export-interblocks '((lob org-babel-exp-lob-one-liners)
  (src org-babel-exp-inline-src-blocks))
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 org-occur-hook '(org-first-headline-recenter)
 org-export-preprocess-before-selecting-backend-code-hook
'(org-beamer-select-beamer-code)
 org-export-latex-final-hook '(org-beamer-amend-header org-beamer-fix-toc
   org-beamer-auto-fragile-frames
   org-beamer-place-default-actions-for-lists)
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-export-blocks '((src org-babel-exp-src-block nil)
 (comment org-export-blocks-format-comment t)
 (ditaa org-export-blocks-format-ditaa nil)
 (dot org-export-blocks-format-dot nil))
 )



[O] [PATCH] Re: Latex Export: Place Caption Below Table

2011-10-02 Thread Thomas S. Dye
Nick Dokos nicholas.do...@hp.com writes:

 Thomas S. Dye t...@tsdye.com wrote:

 Eric S Fraga e.fr...@ucl.ac.uk writes:
 
  Jakob Lombacher kont...@lombacher.net writes:
 
  Hi,
 
  if I export a document to latex, the caption of a table is always on the 
  top.
 
  How can I place it at the bottom? Is there a parameter to config it?
 
  No, the placement is (currently) fixed to come before the tabular (or
  alternative) environment.  Line 1970 or thereabouts in
  org-latex.el.  Should be straightforward to modify although it is a
  quite common convention to have the caption above the table...
 
 Hi Eric,
 
 Are you able to propose a patch?  This came up in my work recently with
 a journal that puts captions below a table (and ends them with a
 period!).  
 

 It's just a matter of emitting the \caption after the contents of the
 table, rather than before:

 ,
 | \begin{table}[htb]
 | \begin{center}
 | \begin{tabular}{rr}
 | ...
 | \end{tabular}
 | \end{center}
 | \caption{Squares}
 | \end{table}
 `

 instead of

 ,
 | \begin{table}[htb]
 | \caption{Squares}
 | \begin{center}
 | \begin{tabular}{rr}
 | ...
 | \end{tabular}
 | \end{center}
 | \end{table}
 `


 The following patch (deliberately hidden as a binary octet-stream to keep it
 out of patchwork) will do that - but IMO, it would be better to have yet 
 another
 user-settable option to control the placement.

 Nick



Aloha all,

The inlined patch introduces a variable
org-export-latex-table-caption-above to control the placement of table
captions.  Thanks to Nick Dokos for leading the way on this.

Tom

From 3809f751afb8fffab1e07f7f4d6e607ed5a77b5b Mon Sep 17 00:00:00 2001
From: Tom Dye t...@tsdye.com
Date: Sun, 2 Oct 2011 05:49:52 -1000
Subject: [PATCH] * lisp/org-latex.el: added variable to toggle captions below tables

---
 lisp/org-latex.el |   15 +++
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/lisp/org-latex.el b/lisp/org-latex.el
index 17626b5..f91b93e 100644
--- a/lisp/org-latex.el
+++ b/lisp/org-latex.el
@@ -73,7 +73,7 @@
 	  org-deadline-string \\|
 	  org-closed-string\\))
   Regexp matching special time planning keywords plus the time after it.)
-
+(defvar org-export-latex-table-caption-above t)
 (defvar org-re-quote)  ; dynamically scoped from org.el
 (defvar org-commentsp) ; dynamically scoped from org.el
 
@@ -1965,13 +1965,13 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER.
 (concat \\begin{longtable}{ align }\n)
   (if floatp
 			  (format \\begin{%s}%s\n tblenv placement)))
-(if floatp
+(if (and floatp org-export-latex-table-caption-above) 
 (format
  \\caption%s{%s} %s
  (if shortn (concat [ shortn ]) )
  (or caption )
 			 (if label (format \\label{%s} label) )))
-(if (and longtblp caption) \n \n)
+			(if (and longtblp caption) \n \n)
 (if (and org-export-latex-tables-centered (not longtblp))
 \\begin{center}\n)
 (if (not longtblp)
@@ -1993,6 +1993,12 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER.
 (if (not longtblp) (format \n\\end{%s} tabular-env))
 (if longtblp \n (if org-export-latex-tables-centered
   \n\\end{center}\n \n))
+(if (and floatp (not org-export-latex-table-caption-above)) 
+(format
+ \\caption%s{%s} %s
+ (if shortn (concat [ shortn ]) )
+ (or caption )
+			 (if label (format \\label{%s} label) )))
 (if longtblp
 \\end{longtable}
   (if floatp (format \\end{%s} tblenv)
@@ -2042,11 +2048,12 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER.
   (setq tbl (concat \\begin{center}\n tbl \\end{center})))
 (when floatp
   (setq tbl (concat \\begin{table}\n
+			(if (not org-export-latex-table-caption-above) tbl) 
 			(format \\caption%s{%s%s}\n
 (if shortn (format [%s] shortn) )
 (if label (format \\label{%s} label) )
 (or caption ))
-			tbl
+			(if org-export-latex-table-caption-above tbl) 
 			\n\\end{table}\n)))
 (insert (org-export-latex-protect-string tbl
 
-- 
1.7.1


-- 
Thomas S. Dye
http://www.tsdye.com


Re: [O] Bug: spreadsheet [7.7]

2011-10-02 Thread Nick Dokos
Paul Stansell paulstans...@gmail.com wrote:

 To reproduce the bug do the following:
 
 Edit this file with emacs orgmode.
 
 Place the cursor in the small table below and type C-c } to toggle on the
 display a labelled grid giving the cell references.
 
 Change the c=1 in the CONSTANTS line to c=2 and refresh this line with C-c
 C-c.
 
 Put the cursor on the TBLFM line and refresh this line with C-c C-c.
 
 An I*1 appears above the table which should not appear and can't be
 removed with the usual emacs commands.
 
 
   |---|
   | 1 |
   |---|
 #+TBLFM: $1=$c
 #+CONSTANTS: c=1
 

Yup: I can reproduce it too. Toggling the table coordinates inserts
overlays and apparently something is out of sync and that particular
overlay does not get deleted appropriately.

You can check that there is an overlay there by placing the cursor
right after it and evaluating

 (overlay-at (point))

which should return a list of overlays at point. Assuming that you
get a non-nil result with just that one overlay in the list, you can
delete it with

 (delete-overlay (car (overlay-at (point

Haven't figured out why it gets left over though.

Nick




[O] Bug: Undocumented behavior [7.7 (release_7.7.83.g258aa)]

2011-10-02 Thread Dave Abrahams


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.


`C-u C-c C-c' on a checkbox seems to make it disappear.  If that's
intentional it should be documented.  Otherwise, it should be fixed.

Emacs  : GNU Emacs 23.3.1 (x86_64-apple-darwin10.8.0, Carbon Version 1.6.0 
AppKit 1038.36)
 of 2011-09-12 on pluto.luannocracy.com
Package: Org-mode version 7.7 (release_7.7.83.g258aa)

current state:
==
(setq
 org-x-backends '(ox-org ox-redmine)
 org-agenda-deadline-leaders '(D:  D%d: )
 org-clock-in-switch-to-state STARTED
 org-agenda-skip-scheduled-if-deadline-is-shown t
 org-export-latex-after-initial-vars-hook '(org-beamer-after-initial-vars)
 org-special-ctrl-a/e '(nil . t)
 org-x-redmine-title-prefix-match-function 'org-x-redmine-title-prefix-match
 org-speed-command-hook '(org-speed-command-default-hook 
org-babel-speed-command-hook)
 org-agenda-custom-commands '((E Errands (next 3 days) tags
   
ErrandTODO\DONE\TODO\CANCELED\STYLE\habit\SCHEDULED\+3d\
   ((org-agenda-overriding-header Errands (next 3 
days))

)
   )
  (A Priority #A tasks agenda 
   ((org-agenda-ndays 1)
(org-agenda-overriding-header Today's priority 
#A tasks: )
(org-agenda-skip-function
 (quote (org-agenda-skip-entry-if (quote 
notregexp) \\=.*\\[#A\\])))
)
   )
  (b Priority #A and #B tasks agenda 
   ((org-agenda-ndays 1)
(org-agenda-overriding-header Today's priority 
#A and #B tasks: )
(org-agenda-skip-function
 (quote (org-agenda-skip-entry-if (quote 
regexp) \\=.*\\[#C\\])))
)
   )
  (w Waiting/delegated tasks tags 
TODO=\WAITING\|TODO=\DELEGATED\
   ((org-agenda-overriding-header 
Waiting/delegated tasks:)
(org-agenda-sorting-strategy
 (quote (todo-state-up priority-down 
category-up)))
)
   )
  (p Unprioritized tasks tags
   
AREA\Work\TODO\\TODO{DONE\\|CANCELED\\|NOTE\\|PROJECT\\|DEFERRED\\|SOMEDAY}
   ((org-agenda-files
 

   (quote





 
(~/Documents/Tasks/todo.txt)





 )
 

   )


  (org-agenda-overriding-header 
Unprioritized tasks: )


  (org-agenda-skip-function

   

   (quote


  

Re: [O] Checkbox difficulties

2011-10-02 Thread John Hendy
On Sun, Oct 2, 2011 at 2:06 PM, Dave Abrahams d...@boostpro.com wrote:


 Hi!

 I'm having two problems with checkboxes:

 1. They're hard to navigate to.  I have a task with 4 checkboxed
   sub-items, and it's very fiddly getting my cursor in position to
   check them off.  Is there a trick for this?


From anywhere on the line/item containing the checkbox, C-c C-c toggles the
checkbox.


 2. When I have a repeating TODO item with checkbox dependencies, the
   boxes remain checked even when the TODO-DONE auto-rescheduling event
   happens.  Is there a way to get tehm unchecked?


Highlight the whole region (from first one, C-space, then navigate to last
one) and do C-c C-x C-b to toggle them all (assuming that the first one is
done and you want them all reset to undone).
--- http://orgmode.org/manual/Checkboxes.html

Do these help?


John

Many thanks in advance,

 --
 Dave Abrahams
 BoostPro Computing
 http://www.boostpro.com





Re: [O] Checkbox difficulties

2011-10-02 Thread Nicolas Goaziou
Hello,

Dave Abrahams d...@boostpro.com writes:

 I'm having two problems with checkboxes:

 1. They're hard to navigate to.  I have a task with 4 checkboxed
sub-items, and it's very fiddly getting my cursor in position to
check them off.  Is there a trick for this?

No. I use C-s to navigate to the check-boxes, like any other text.
Also, you can use S-up and S-down once you have reached an item. I don't
use these, though.

 2. When I have a repeating TODO item with checkbox dependencies, the
boxes remain checked even when the TODO-DONE auto-rescheduling event
happens.  Is there a way to get tehm unchecked?

You may have a look to org-checklist.el in contrib directory.  It
exactly does that.

Regards,

-- 
Nicolas Goaziou



Re: [O] Bug: Undocumented behavior [7.7 (release_7.7.83.g258aa)]

2011-10-02 Thread Nicolas Goaziou
Dave Abrahams d...@boostpro.com writes:

 `C-u C-c C-c' on a checkbox seems to make it disappear.  If that's
 intentional it should be documented.  Otherwise, it should be fixed.

It is already documented. According to the manual, in 5.6 Checkboxes,
at the C-c C-c line: Toggle checkbox status or (with prefix arg)
checkbox presence at point.

Regards,

-- 
Nicolas Goaziou



Re: [O] Hide drawers in indirect buffers?

2011-10-02 Thread Dave Abrahams

on Sat Oct 01 2011, Dave Abrahams dave-AT-boostpro.com wrote:

 When I initially request an indirect buffer for an item (especially from
 the agenda) it shows up with all its drawers open.  I'd prefer it if
 they were closed by default.  Is there a way to do that?

To follow up my own post...

This is actually very surprising, because the entry shows up in a state
that can't be reached by tabbing on its headline, with all the drawers
open.  If you run (org-show-entry) in the indirect buffer it goes into a
less-noisy configuration.

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com




[O] Bug: Feature-request: `org-after-checkbox-statistics-hook' [7.7 (release_7.7.370.g8e44ba)]

2011-10-02 Thread Dave Abrahams


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.


I was using checkboxes for a group of subtasks, and was surprised when
the following (which I lifted from the manual) wasn't causing the parent
item to be marked DONE upon checking the last box.

--8---cut here---start-8---
(defun dwa/org-summary-todo (n-done n-not-done)
  Switch entry to DONE when all subentries are done, to TODO otherwise.
  (let (org-log-done org-log-states)   ; turn off logging
(org-todo (if (= n-not-done 0) DONE TODO
(add-hook 'org-after-todo-statistics-hook 'dwa/org-summary-todo)
--8---cut here---end---8---

So I set some debugger breakpoints and realized that code wasn't even
getting called.  There's a completely separate wad of code in org-list
that handles checkbox statistics.  So naturally, there's a hook, which I
added my TODO-DONE function to:

--8---cut here---start-8---
(add-hook 'org-checkbox-statistics-hook 'dwa/org-summary-todo)
--8---cut here---end---8---

But `org-checkbox-statistics-hook' is a list of nullary functions, so of
course this broke since my function expects N-DONE and N-NOT-DONE.  I
looked around for an easy way to determine N-DONE and N-NOT-DONE but it
doesn't seem to exist; it's buried in the logic of
org-update-checkbox-count... I think.  What I need is a hook that acts
like org-after-todo-statistics-hook, but for checkboxes.

Emacs  : GNU Emacs 23.3.1 (x86_64-apple-darwin10.8.0, Carbon Version 1.6.0 
AppKit 1038.36)
 of 2011-09-12 on pluto.luannocracy.com
Package: Org-mode version 7.7 (release_7.7.370.g8e44ba)

current state:
==
(setq
 org-x-backends '(ox-org ox-redmine)
 org-agenda-deadline-leaders '(D:  D%d: )
 org-clock-in-switch-to-state STARTED
 org-agenda-skip-scheduled-if-deadline-is-shown t
 org-export-latex-after-initial-vars-hook '(org-beamer-after-initial-vars)
 org-special-ctrl-a/e '(nil . t)
 org-x-redmine-title-prefix-match-function 'org-x-redmine-title-prefix-match
 org-speed-command-hook '(org-speed-command-default-hook 
org-babel-speed-command-hook)
 org-agenda-custom-commands '((E Errands (next 3 days) tags
   
ErrandTODO\DONE\TODO\CANCELED\STYLE\habit\SCHEDULED\+3d\
   ((org-agenda-overriding-header Errands (next 3 
days))

)
   )
  (A Priority #A tasks agenda 
   ((org-agenda-ndays 1)
(org-agenda-overriding-header Today's priority 
#A tasks: )
(org-agenda-skip-function
 (quote (org-agenda-skip-entry-if (quote 
notregexp) \\=.*\\[#A\\])))
)
   )
  (b Priority #A and #B tasks agenda 
   ((org-agenda-ndays 1)
(org-agenda-overriding-header Today's priority 
#A and #B tasks: )
(org-agenda-skip-function
 (quote (org-agenda-skip-entry-if (quote 
regexp) \\=.*\\[#C\\])))
)
   )
  (w Waiting/delegated tasks tags
   TODO=\WAITING\|TODO=\DELEGATED\
   ((org-agenda-overriding-header 
Waiting/delegated tasks:)
(org-agenda-sorting-strategy
 (quote (todo-state-up priority-down 
category-up)))
)
   )
  (p Unprioritized tasks tags
   
AREA\Work\TODO\\TODO{DONE\\|CANCELED\\|NOTE\\|PROJECT\\|DEFERRED\\|SOMEDAY}
   ((org-agenda-files
 

   (quote





 
(~/Documents/Tasks/todo.txt)
  

Re: [O] Checkbox difficulties

2011-10-02 Thread Dave Abrahams

on Sun Oct 02 2011, Dave Abrahams dave-AT-boostpro.com wrote:

 on Sun Oct 02 2011, Nicolas Goaziou n.goaziou-AT-gmail.com wrote:

 Hello,

 Dave Abrahams d...@boostpro.com writes:

 I'm having two problems with checkboxes:

 1. They're hard to navigate to.  I have a task with 4 checkboxed
sub-items, and it's very fiddly getting my cursor in position to
check them off.  Is there a trick for this?

 No. I use C-s to navigate to the check-boxes, like any other text.
 Also, you can use S-up and S-down once you have reached an item. I don't
 use these, though.

 Thanks.  Since I realized it will work anywhere in the list item (and
 not just in between the `[ ]'s, I don't have too much to complain
 about.

Actually I just realized `C-M-n' and `C-M-p' effectively do just what I
want, jumping quickly among checkboxes.

 You may have a look to org-checklist.el in contrib directory.  It
 exactly does that.

 Wow, that's awesome... we're *so* close... but how do I get it to
 automatically mark the item DONE when the last box is checked?
^^
Still want that one.

Cheers,
-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com



Re: [O] Bug: Undocumented behavior [7.7 (release_7.7.83.g258aa)]

2011-10-02 Thread Dave Abrahams

on Sun Oct 02 2011, Nicolas Goaziou n.goaziou-AT-gmail.com wrote:

 Dave Abrahams d...@boostpro.com writes:

 `C-u C-c C-c' on a checkbox seems to make it disappear.  If that's
 intentional it should be documented.  Otherwise, it should be fixed.

 It is already documented. According to the manual, in 5.6 Checkboxes,
 at the C-c C-c line: Toggle checkbox status or (with prefix arg)
 checkbox presence at point.

Okay, sorry, it's left out of the docstring, which is extensive
enough to fool the casual reader (me) into thinking it's complete.

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com



[O] Bug: incorrect indentation of DEADLINE [7.7]

2011-10-02 Thread Paul Stansell
Hello,

I think I have found a very minor bug in the current org mode.  The is
a bug present when using:

  Org-mode version 7.7 with

  GNU Emacs 23.1.1 (i386-redhat-linux-gnu, GTK+ Version 2.18.9) of
  2010-06-03 on xb-01.phx2.fedoraproject.org


To reproduce the bug do:

Start emacs on this email file with
  emacs --no-init-file --load bug.el bug.org

Place the cursor on the TODO line below and press tab to expand the
entry.

Type C-c C-t

The DEALINE line is in indented by 1 space when it should not be.

Note that the presence of (setq org-log-done t) in bug.el causes the
indentation,
without this line there is no unwanted indentation.

Thanks for your help!




Emacs  : GNU Emacs 23.1.1 (i386-redhat-linux-gnu, GTK+ Version 2.18.9)
 of 2010-06-03 on xb-01.phx2.fedoraproject.org
Package: Org-mode version 7.7

current state:
==
(setq
 org-log-done 'time
 org-export-latex-after-initial-vars-hook '(org-beamer-after-initial-vars)
 org-speed-command-hook '(org-speed-command-default-hook
  org-babel-speed-command-hook)
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-export-blocks-postblock-hook '(org-exp-res/src-name-cleanup)
 org-export-latex-format-toc-function 'org-export-latex-format-toc-default
 org-tab-first-hook '(org-hide-block-toggle-maybe
  org-src-native-tab-command-maybe
  org-babel-hide-result-toggle-maybe)
 org-src-mode-hook '(org-src-babel-configure-edit-buffer
 org-src-mode-configure-edit-buffer)
 org-confirm-shell-link-function 'yes-or-no-p
 org-export-first-hook '(org-beamer-initialize-open-trackers)
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-babel-pre-tangle-hook '(save-buffer)
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers
  org-cycle-show-empty-lines
  org-optimize-window-after-visibility-change)
 org-export-preprocess-before-normalizing-links-hook
'(org-remove-file-link-modifiers)
 org-mode-hook '(#[nil \300\301\302\303\304$\207
   [org-add-hook change-major-mode-hook org-show-block-all
append local]
   5]
 #[nil \300\301\302\303\304$\207
   [org-add-hook change-major-mode-hook
org-babel-show-result-all append local]
   5]
 org-babel-result-hide-spec org-babel-hide-all-hashes)
 org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point
  org-babel-execute-safely-maybe)
 org-confirm-elisp-link-function 'yes-or-no-p
 org-export-interblocks '((lob org-babel-exp-lob-one-liners)
  (src org-babel-exp-inline-src-blocks))
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 org-occur-hook '(org-first-headline-recenter)
 org-export-preprocess-before-selecting-backend-code-hook
'(org-beamer-select-beamer-code)
 org-export-latex-final-hook '(org-beamer-amend-header org-beamer-fix-toc
   org-beamer-auto-fragile-frames
   org-beamer-place-default-actions-for-lists)
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-export-blocks '((src org-babel-exp-src-block nil)
 (comment org-export-blocks-format-comment t)
 (ditaa org-export-blocks-format-ditaa nil)
 (dot org-export-blocks-format-dot nil))
 )

(add-to-list 'load-path ~/local/share/emacs/site-lisp/org)
(require 'org-install)
(add-to-list 'auto-mode-alist '(\\.org$ . org-mode))

;; The presence of this line causes the indent bug.
(setq org-log-done t)


bug.org
Description: Lotus Organizer


[O] Bug in LaTeX export for links with underscores in captions. (Easy to fix for elispers)

2011-10-02 Thread Magnus Nilsson
This is a bug which elisp-driven orgers with access to the git
repository can fix quickly.

* Linking to [[a_file.txt][a file with underscore]] in a headline works well
with LaTeX export

#+CAPTION: Linking [[a_file.txt][a file with underscore]] in a caption does
_not_ work well with LaTeX export.
[[/Path_to_figure/figure.png]]

The reason is because org-export-latex-links processes the figure's
caption with org-export-latex-fontify-headline, which in turn
processes the caption's link (with altered underscores for some
reason). For example,
(org-export-latex-fontify-headline [[/Path_to_figure/figure.png][a file
with underscore]])
returns
#(\\href{file://./Path\\_{}to\\_{}figure/figure.png}{a file with
underscore} 14 15 (org-attr nil) 15 24 (org-protected t org-attr nil) 24 25
(org-protected t org-attr nil) 25 28 (org-protected t org-attr nil) 28 35
(org-protected t org-attr nil) 35 46 (org-attr nil))

There must be a way to process links (whose path contains underscores)
within captions to floats correctly.

Best regards,
Magnus


Re: [O] Checkbox difficulties

2011-10-02 Thread Nick Dokos
Dave Abrahams d...@boostpro.com wrote:


 Wow, that's awesome... we're *so* close... but how do I get it to
 automatically mark the item DONE when the last box is checked?
 

Take a look at

 http://thread.gmane.org/gmane.emacs.orgmode/42715/focus=42721

Nick