Re: [O] How to say "I did that yesterday?"

2011-11-22 Thread Tom Prince
On Tue, 22 Nov 2011 21:02:48 -0800, Dave Abrahams  wrote:
> 
> on Tue Nov 22 2011, Erik Hetzner  wrote:
> 
> > At Tue, 22 Nov 2011 11:40:35 -0800,
> > Dave Abrahams wrote:
> >> 
> >
> >> 
> >> I often discover that I completed something a few days ago and I would
> >> like to mark it done with the appropriate date as though I had marked it
> >> done in the past.  That means, e.g., for a repeating event it might
> >> repeat sooner than if it had been done today.  Is there a way?
> >
> > M-x org-todo-yesterday ?
> 
> Heh, that doesn't seem to work from the agenda, though :(
> 

M-x org-agenda-todo-yesteday

:)

Although, it should in princple, be possible to detect running in tha
agenda, and handle that automatically. I guess there are probably issues
with that.

  Tom



Re: [O] [BUG] org-table: time difference delivers wrong results

2011-11-22 Thread Daniel Bausch
Anyone?  It might be a duplicate of what Gustav Wiktröm reported on 1st of 
September, but his problem was not resolved, either.

Daniel

Am Dienstag 15. November 2011, 22:12:45 schrieb Daniel Bausch:
> Hello list,
> 
> consider the following example:
> |A | B | C |
> |
> |--+---+---|
> |
> | 07:11:00 | -08:00:00 | -01:11:00 |
> 
> #+TBLFM: $3=$1+$2;T
> 
> I think the result in the third column is wrong.  I expect 0 hours and 49
> minutes, negative (-00:49:00).
> 
> The following does not work, too:
> |A | C |
> |
> |--+---|
> |
> | 07:11:00 | -01:11:00 |
> 
> #+TBLFM: $2=$1-28800;T
> 
> Daniel




Re: [O] [PATCH] Avoid lisp error with (org-deadline nil "+1d")

2011-11-22 Thread Carsten Dominik
Fixed, thanks, please verify.

- Carsten

On 23.11.2011, at 07:14, Peter Münster wrote:

> On Tue, Nov 22 2011, Carsten Dominik wrote:
> 
>> This is not allowed, we cannot define a variable defined in another package.
> 
> Oh, pardon.
> 
> 
>> Can you send a backtrace of the error, please?
> 
> Of course (from "emacs -Q"):
> 
> --8<---cut here---start->8---
> Debugger entered--Lisp error: (void-variable parse-time-weekdays)
>  org-read-date-get-relative("+1d" (20172 36366 853978) (20170 55280))
>  org-read-date-analyze("+1d" (20170 55280) (0 0 0 22 11 2011 2 nil 3600))
>  byte-code("\306>\203J.  \203.   ;\203J.\307\310 
> \"\203J.\212\311\312!\210\212\313 
> \210`).\314\315=\203-.\202..\f\n\312#\203I.\316\317!.\320\321\322.!\".3.\205G.\323.!.4)\203y.
>   ;\203i.\307\310 \"\203i.\320\321\324.3\325.3!#\"\202x.  
> \206x.\326\327\330\327\211.3.4&..5\203\244.\331\235\203\244.\315=\203\217.6\202\221.7\332\261.\210\333
>  
> .8\327\211\211.9C&.\210\327.\212\214\327\211\211\211\211.:.;.<.=\311\312!\210\334.>\335P!\210\317\225b\210i.=\336\225b\210m\203\324.\337c\210\202\327.\317u\210\204\351.\334\340.?P!\204\351.\341\342\327\"\210\334.>!\204\f.\334\343.@\344Q!\203\f.\316\317!.A\232\204\f.\336\224\336\225}\210\202!.\345\337!\210\346u\210``}\210.B\203!.\347.=!\210.CB.<.<\203s.<\211A.<@\211.;\315=\203C.\314\327\312#\204b.;\350=\203R.\314\f\327\312#\204b.;\351=\203'.\314.D\327\312#\203'.\352\353!\210\334\354!\203'.\352\353!\210\202'.\334\355!\203}.\352\353!\210.B\203\213.n\203\213.\347.=!\210\203\375.n\204\237.`Sf\356=\204\237.\332\202\240.\353\315=\203\253.6\202\276.\350=\203\266.7\202\276.\351=\205\276.E\332\261.\210\333
>  
> .8\206\321.\351=\205\321.F\351=\327\211.9C&.n\204\367.`Sf\356=\204\367.\327f\357>\204\367.m\204\367.\332\202\370.\353c\210\317\210eb\210~\210\334\360!\203.`Sf\361\232\203.`S\362
>  |\210..\207" [what time end org-scheduled-time-regexp 
> org-deadline-time-regexp ts (scheduled deadline) string-match "^[-+]+[0-9]" 
> org-back-to-heading t outline-next-heading re-search-forward scheduled 
> match-string 1 apply encode-time org-parse-time-string org-get-compact-tod 
> org-read-date-analyze decode-time org-read-date nil to-time (scheduled 
> deadline) " " org-insert-time-stamp looking-at "\\( *\\)[^.\n]*" 0 "\n" "[
>  ]*" throw exit "[^.\n]*?" "[^.\n]*" insert-before-markers -1 
> org-indent-to-column deadline closed replace-match "" "--+<[^>]+>" "^[ 
> ]+" 32 (32 10) "[   ]*\n" 10 ...] 8)
>  org-add-planning-info(deadline "+1d" closed)
>  org-deadline(nil "+1d")
>  eval((org-deadline nil "+1d") nil)
>  eval-expression((org-deadline nil "+1d") nil)
>  call-interactively(eval-expression nil nil)
> --8<---cut here---end--->8---
> 
> -- 
>   Peter
> 
> 




Re: [O] [PATCH] Avoid lisp error with (org-deadline nil "+1d")

2011-11-22 Thread Peter Münster
On Tue, Nov 22 2011, Carsten Dominik wrote:

> This is not allowed, we cannot define a variable defined in another package.

Oh, pardon.


> Can you send a backtrace of the error, please?

Of course (from "emacs -Q"):

--8<---cut here---start->8---
Debugger entered--Lisp error: (void-variable parse-time-weekdays)
  org-read-date-get-relative("+1d" (20172 36366 853978) (20170 55280))
  org-read-date-analyze("+1d" (20170 55280) (0 0 0 22 11 2011 2 nil 3600))
  byte-code("\306>\203J.   \203.  ;\203J.\307\310 
\"\203J.\212\311\312!\210\212\313 
\210`).\314\315=\203-.\202..\f\n\312#\203I.\316\317!.\320\321\322.!\".3.\205G.\323.!.4)\203y.
  ;\203i.\307\310 \"\203i.\320\321\324.3\325.3!#\"\202x.  
\206x.\326\327\330\327\211.3.4&..5\203\244.\331\235\203\244.\315=\203\217.6\202\221.7\332\261.\210\333
 
.8\327\211\211.9C&.\210\327.\212\214\327\211\211\211\211.:.;.<.=\311\312!\210\334.>\335P!\210\317\225b\210i.=\336\225b\210m\203\324.\337c\210\202\327.\317u\210\204\351.\334\340.?P!\204\351.\341\342\327\"\210\334.>!\204\f.\334\343.@\344Q!\203\f.\316\317!.A\232\204\f.\336\224\336\225}\210\202!.\345\337!\210\346u\210``}\210.B\203!.\347.=!\210.CB.<.<\203s.<\211A.<@\211.;\315=\203C.\314\327\312#\204b.;\350=\203R.\314\f\327\312#\204b.;\351=\203'.\314.D\327\312#\203'.\352\353!\210\334\354!\203'.\352\353!\210\202'.\334\355!\203}.\352\353!\210.B\203\213.n\203\213.\347.=!\210\203\375.n\204\237.`Sf\356=\204\237.\332\202\240.\353\315=\203\253.6\202\276.\350=\203\266.7\202\276.\351=\205\276.E\332\261.\210\333
 
.8\206\321.\351=\205\321.F\351=\327\211.9C&.n\204\367.`Sf\356=\204\367.\327f\357>\204\367.m\204\367.\332\202\370.\353c\210\317\210eb\210~\210\334\360!\203.`Sf\361\232\203.`S\362
 |\210..\207" [what time end org-scheduled-time-regexp 
org-deadline-time-regexp ts (scheduled deadline) string-match "^[-+]+[0-9]" 
org-back-to-heading t outline-next-heading re-search-forward scheduled 
match-string 1 apply encode-time org-parse-time-string org-get-compact-tod 
org-read-date-analyze decode-time org-read-date nil to-time (scheduled 
deadline) " " org-insert-time-stamp looking-at "\\( *\\)[^.\n]*" 0 "\n" "[  
   ]*" throw exit "[^.\n]*?" "[^.\n]*" insert-before-markers -1 
org-indent-to-column deadline closed replace-match "" "--+<[^>]+>" "^[ ]+" 
32 (32 10) "[   ]*\n" 10 ...] 8)
  org-add-planning-info(deadline "+1d" closed)
  org-deadline(nil "+1d")
  eval((org-deadline nil "+1d") nil)
  eval-expression((org-deadline nil "+1d") nil)
  call-interactively(eval-expression nil nil)
--8<---cut here---end--->8---

-- 
   Peter




Re: [O] [OT] CSV to Org

2011-11-22 Thread Nick Dokos
Samuel Wales  wrote:

> Hmm, thanks for your comments.  I can see the appeal of a Python-ish
> solution, but I was thinking maybe some elisp (or even a package or a
> part of Org) instead.  Then it could grow to a generally useful
> importer.
> 

The trouble is that CSV is a very loosely defined format, with many
variations and dialects. The nice thing about the python solution is
that it takes care of many of these variations.

If somebody does take up your challenge, I would strongly advise that
they should consult the csv python module (or equivalent modules in
other languages, depending on their preferred language) and the design
document for it (PEP 305 - at http://www.python.org/dev/peps/pep-0305/ )
and try to translate it into elisp, rather than striking off on their
own.

Nick





Re: [O] How to say "I did that yesterday?"

2011-11-22 Thread Dave Abrahams

on Tue Nov 22 2011, Erik Hetzner  wrote:

> At Tue, 22 Nov 2011 11:40:35 -0800,
> Dave Abrahams wrote:
>> 
>
>> 
>> I often discover that I completed something a few days ago and I would
>> like to mark it done with the appropriate date as though I had marked it
>> done in the past.  That means, e.g., for a repeating event it might
>> repeat sooner than if it had been done today.  Is there a way?
>
> M-x org-todo-yesterday ?

Heh, that doesn't seem to work from the agenda, though :(

--8<---cut here---start->8---
Debugger entered--Lisp error: (error "Before first headline at position 1142 in 
buffer *Org Agenda*")
  signal(error ("Before first headline at position 1142 in buffer *Org 
Agenda*"))
  error("Before first headline at position %d in buffer %s" 1142 #)
  (condition-case nil (outline-back-to-heading invisible-ok) (error (error 
"Before first headline at position %d in buffer %s" ... ...)))
  org-back-to-heading(t)
  (catch (quote exit) (org-back-to-heading t) (if (looking-at 
org-outline-regexp) (goto-char ...)) (or (looking-at ...) (looking-at "\\(?: 
*\\|[]*$\\)")) (let* (... ... ... ... ... ... ... ... ... ... ... ... 
... ... ... ... ... ... ... ... ... dolog now-done-p) (when org-blocker-hook 
... ...) (store-match-data match-data) (replace-match next t t) (unless ... 
...) (unless head ...) (when ... ...) (setq org-last-todo-state-is-todo ...) 
(setq now-done-p ...) (and logging ...) (when ... ... ... ... ... ...) 
(org-todo-trigger-tag-changes state) (and org-auto-align-tags ... ...) (when 
org-provide-todo-statistics ...) (run-hooks ...) (if ... ...) 
(put-text-property ... ... ... head) (when now-done-p ... ...) (if ... ...) 
(when org-trigger-hook ...)))
  (save-excursion (catch (quote exit) (org-back-to-heading t) (if ... ...) (or 
... ...) (let* ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... 
... ... ... ...)))
  (let ((org-blocker-hook org-blocker-hook) (case-fold-search nil)) (when 
(equal arg ...) (setq arg nil org-blocker-hook nil)) (when (and 
org-blocker-hook ...) (setq org-blocker-hook nil)) (save-excursion (catch ... 
... ... ... ...)))
  org-todo((4))
  (let* ((hour ...) (org-extend-today-until ...)) (org-todo arg))
  org-todo-yesterday((4))
  call-interactively(org-todo-yesterday t nil)
  execute-extended-command((4))
  call-interactively(execute-extended-command nil nil)
--8<---cut here---end--->8---

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




[O] Bug: org-todo-yesterday doesn't work from agenda buffer [7.7 (release_7.7.548.g9a442.dirty)]

2011-11-22 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.


Debugger entered--Lisp error: (error "Before first headline at position 1142 in 
buffer *Org Agenda*")
  signal(error ("Before first headline at position 1142 in buffer *Org 
Agenda*"))
  error("Before first headline at position %d in buffer %s" 1142 #)
  (condition-case nil (outline-back-to-heading invisible-ok) (error (error 
"Before first headline at position %d in buffer %s" ... ...)))
  org-back-to-heading(t)
  (catch (quote exit) (org-back-to-heading t) (if (looking-at 
org-outline-regexp) (goto-char ...)) (or (looking-at ...) (looking-at "\\(?: 
*\\|[]*$\\)")) (let* (... ... ... ... ... ... ... ... ... ... ... ... 
... ... ... ... ... ... ... ... ... dolog now-done-p) (when org-blocker-hook 
... ...) (store-match-data match-data) (replace-match next t t) (unless ... 
...) (unless head ...) (when ... ...) (setq org-last-todo-state-is-todo ...) 
(setq now-done-p ...) (and logging ...) (when ... ... ... ... ... ...) 
(org-todo-trigger-tag-changes state) (and org-auto-align-tags ... ...) (when 
org-provide-todo-statistics ...) (run-hooks ...) (if ... ...) 
(put-text-property ... ... ... head) (when now-done-p ... ...) (if ... ...) 
(when org-trigger-hook ...)))
  (save-excursion (catch (quote exit) (org-back-to-heading t) (if ... ...) (or 
... ...) (let* ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... 
... ... ... ...)))
  (let ((org-blocker-hook org-blocker-hook) (case-fold-search nil)) (when 
(equal arg ...) (setq arg nil org-blocker-hook nil)) (when (and 
org-blocker-hook ...) (setq org-blocker-hook nil)) (save-excursion (catch ... 
... ... ... ...)))
  org-todo((4))
  (let* ((hour ...) (org-extend-today-until ...)) (org-todo arg))
  org-todo-yesterday((4))
  call-interactively(org-todo-yesterday t nil)
  execute-extended-command((4))
  call-interactively(execute-extended-command nil nil)


Emacs  : GNU Emacs 23.3.1 (x86_64-apple-darwin11.2.0, Carbon Version 1.6.0 
AppKit 1138.23)
 of 2011-11-13 on pluto.luannocracy.com
Package: Org-mode version 7.7 (release_7.7.548.g9a442.dirty)

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-default-priority 67
 org-speed-command-hook '(org-speed-command-default-hook 
org-babel-speed-command-hook)
 org-agenda-custom-commands '(("E" "Errands (next 3 days)" tags
   
"Errand&TODO<>\"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
 


[O] [PATCH] Bug: org-clock-out-if-current => "marker does not point anywhere" [7.7 (release_7.7.397.g5adafd)]

2011-11-22 Thread Dave Abrahams

The following patch fixes the bug.

--8<---cut here---start->8---
diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index e026d93..b47ac66 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -1697,6 +1697,7 @@ from the `before-change-functions' in the current buffer."
 This is used to stop the clock after a TODO entry is marked DONE,
 and is only done if the variable `org-clock-out-when-done' is not nil."
   (when (and org-clock-out-when-done
+(marker-buffer org-clock-marker)
 (or (and (eq t org-clock-out-when-done)
  (member state org-done-keywords))
 (and (listp org-clock-out-when-done)
--8<---cut here---end--->8---


on Fri Nov 18 2011, Dave Abrahams  wrote:

> 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.
>
> 
>
> The bug is caused by the following lines:
>
>(< (point) org-clock-marker)
>(> (save-excursion (outline-next-heading) (point))
>
> where org-clock-marker is `#'
>   org-clock-out-if-current()
>   run-hooks(org-after-todo-state-change-hook)
>   byte-code("\306\307!\210\310!\203..\311\225Sb\210\310\312  
> \313Q!\204..\310\314!\210\302 .\315 .\302 
> .\316\216\317\320\321\307\211$*..@.@.A.A.B.B\322\323!.C\311\224.D\324.C!.E\325.E.F\"\211.GA@.H\326.G8.I\327.G8.J.C\206i.\330.K\307.L.C.M\235\211.NA.O.P\203\242..Q\331\232\203\214..R\332=\204\235..Q\204\242..R\203\242..R\332=\204\242.\333
>  
> \202\367..Q\334\232\203\300..R\203\263..P\204\300.\335\336\337\340.M\"\320\307$\202\367..Q\341=\203\335..C\203\327..O\205\367..O@\202\367..M@\202\367..Q\342=\203...N.M\232?\205\367..C\203..\343.MG.OG\344#.M8\202\367..M.S\345.S!@)\202\367..R\307=\203#..Q\346\232\203#.\320\211.Q\206\367..Q\203\247..Q\330\232\2033.\320\202\367..Q\347=\203>.\320\202\367..Q\350=\203P..I\206\367..T@\202\367..Q\351=\203g..E.U\235A@\206\367..U@\202\367..Q\352=\203\205.\353.U!.U.E.U\235A@\206\201..U@)\202\367..Q.M\235@\206\367..Q;\203\234.\354\355.Q\"\202\367.\356.Q!S.M8\202\367..N\204\267..E\206\367..M@\202\367..C.J\232\203\303.\320\202\367..O\204\314.\320\202\367..H\357>\203\364..V.W=\203\341..O@\202\367..OG\311V\205\367..I\206\367..T@\202\367..O@.X\360\361.X.K#\206...X\211.X\203..\362.X\362Q\202..\362.Y\363\364\365.C\366.X\367\257.Z\320\211.[.\\.:\203j..C.T\235?.]\212\302
>  
> .\370\216\212\214~\210\371\372.Z\"-\204j.\373\374!\203[.\354\375.C.X#\210\202j.\376\375.C.X#\210\377\201g.\320\"\210\201h.\n!\210\201i..Y\307\211#\210\201j..D!\204\216.\376\201k.\201l..Y!\"\210.E\204\262.\324.X!.E\325.E.F\"\211.GA@.H\326.G8.I\327.G8.J.Q\201m.>\203\344.\376\201n.\343.^G\201o.\325.X.^\".^>G#.^G\201p.\201q.\325.X.^\"\362#$\210.X.T\235?.].X.T\235\205\372..C.T\235?.\\.\203..\201r.
> !\210.B\204...@\203\271.._\307=\204\271..Q\201s.>\204\271.\325.X.B\"A@\2063.\344\325.C.B\"8\211.[\201t.=\203K.._\201t.=\203K.\201u..[.X\203j..X.`\235\203j..C.`\235\204j.\201v.\320\211\201w.#\210.\\\203\236..@\203\236.\201v.\201w.\201x.
>  
> \"\210.[\204\236..@\201t.=\203\236.\201y.\350.X.C\201z.\201t.%\210.X\203\271..[\203\271.\201y.\201X..X.C\201z..[%\210\201{..X!\210.a\203\321..b\204\321.\201|.\320\307\"\210.c\203\333.\201}.
>  \210\201~.\201.!\210.Q\203\366..X.T\235\204\366.\324.X!.E\201\200.\315 
> \201\201. \201\202..E$\210.\\\203*.\201\203.\201d.!\203#.\302 
> .\201\204.\216\201\205. .d*\201\206..X!\210\201\207. 
> \203f.n\204f.\212\201\210.\323!\210\310.e!)\203f.`\344\211\225\206M.\323\225\\W\203f.\344\225\206Y.\323\225b\210\310\362!\203f.\201\211.
>  \210.f\205v.\212\201\212.\201f..Z\")..\207" [org-outline-regexp 
> org-todo-regexp match-data startpos save-match-data-internal logging 
> org-back-to-heading t looking-at 0 " +" "\\( +\\|$\\)" " *" point-at-bol 
> ((byte-code "\301\302\"\207" [save-match-data-internal set-match-data 
> evaporate] 3)) org-entry-get nil "LOGGING" match-string 1 
> org-get-todo-sequence-head assoc 3 4 "" (4) prefix org-fast-todo-selection 
> (4) org-icompleting-read "State: " mapcar #[(x) "C\207" [x] 1] right left - 
> 2 last (4) none done nextset previousset reverse error "State `%s' not valid 
> in this file" prefix-numeric-value (type priority) 
> run-hook-with-args-until-success org-todo-get-default-hook ...] 10)
>   org-todo(done)
>   (if (or (match-string 2) (and ... ...)) (org-todo (quote done)) (org-todo 
> (quote todo)))
>   (progn (if (or ... ...) (org-todo ...) (org-todo ...)))
>   (if (looking-at (concat "^\\*+[ ]+" org-todo-regexp "[  ].*\\[" "\\(?:" 
> "\\(?2:100%\\)\\|[0-9]+%" "\\|" "\\(?3:[0-9]+\\)" "/" "\\(?4:[0-9]+\\)" "\\)" 
> "\\]")) (progn (if ... ... ...)))
>   (when (looking-at (concat "^\\*+[   ]+" org-todo-regexp "[  ].*\\[" "\\(?:" 
> "\\(?2:100%\

Re: [O] [BUG] Inconsistency in src block hiding

2011-11-22 Thread Eric Schulte
>
> Consider the following cases:
>
> #+name: one-more
> #+header: :var k=2
> #+begin_src emacs-lisp
> (1+ k)
> #+end_src
>
> #+header: :var k=2
> #+name: one-more
> #+begin_src emacs-lisp
> (1+ k)
> #+end_src
>
> #+attr_html: :textarea t :height 10 :width 40
> #+name: unique-name
> #+begin_example
> Edit me!
> #+end_example
>
> Note that the second case doesn't appear to be legal, as executing the
> block errors out with "Symbol's value as variable is void: k". I don't
> think that there should be any imposed order in affiliated keywords.
>

I would say that the first and third should be valid constructions, but
the second should not.  This is for two reasons.

1. As you point out the second is not currently supported, and generally
   changing the code should be avoided.

2. More importantly, unlike the #+attr_html line in the third example,
   the #+header line *only* applies to code blocks and not to any other
   Org-mode element.  Given that I think it is part of the code block in
   a more intimate way than #+name is part of the code block, and thus
   should not be separated from the code block by a name.  In effect I
   think of the code block (including the #+header line) as an Org-mode
   object, and the #+name line as something applied to that element as a
   whole.

I suppose I would yield to you on this point as you actually have a
systematic way of defining Org-mode objects and keywords (org-elements),
where as all I have is intuition and the vague notion that option two
above "looks ugly" to me.

Although, that said I don't really look forward to the task of changing
the code to allow any arbitrary sequence of #+name and #+header
arguments prefixing a code block as it will complicate the current code
significantly.

>
> Anyway, in the first case, block will be hidden only when TAB is pressed
> on the "#+begin_src" line.

In the current code it will also be hidden if TAB is pressed on the
#+name line.

> In the second case, block can be hidden when TAB is pressed on both
> the "#+name:" and the "#+begin_" line, with two different
> results. That's confusing.
>

I did work out a version of this patch in which when tab was pressed on
the #+name line, only the code block was hidden, however in my
conception where names can be applied to any Org-mode object, and
intervening #+header lines are part of the code block it seemed more
consistent to hide the whole object following the name, so e.g., hiding
this with TAB on #+name

#+name: one-more
#+header: :var k=2
#+begin_src emacs-lisp
(1+ k)
#+end_src

should result in this (as it does now)

#+name: one-more...

rather than this

#+name: one-more
#+header: :var k=2
#+begin_src emacs-lisp...

>
> Only lines below "#+begin_" should be hidden, with TAB pressed on any
> keyword. Affiliated keywords should always be visible.
>

I see your view, and it is consistent, it is just different from mine.

>
>
>>> If you have, from top to bottom, "name", "results" "header", nothing
>>> will fold.  In all those cases, I think a consistent behaviour could
>>> be to hide the block, with any number of keywords above, and TAB
>>> pressed at any of them.
>>>
>>
>> Yes, I would agree, the hiding should be smart enough to find the whole
>> unit and hide it.  I'll take a look at the code.
>
> Or rely on Org Elements... *coughs*
>

:) I agree, Ideally I would love to only manipulate the list provided by
org-element.el, however now I am more concerned with changes before the
upcoming Emacs merge before the release of Emacs24.  So relying on
org-elements is not currently an option.

>
>>> I'm not sure that "#+results:" or "#+name:" keywords should allow to
>>> hide whole parts of the buffer. I realize that toggling "#+results:"
>>> visibility has been in core for a while. But now that every Org blob can
>>> have a "#+name" attached to it, one can hide almost anything in the
>>> buffer.
>>>
>>> Until now we could hide contents with headlines, blocks, drawers, and
>>> items (with an option to prevent it). And we had a global mechanism to
>>> handle visibility toggling just fine (namely S-TAB with different
>>> numbers of prefixes). But hiding independently each list, table or
>>> paragraph with no possibility to make them appear in groups just doesn't
>>> sound right.
>>>
>>> Hence, I suggest to think again about it: we can live happily with
>>> outlines, blocks and drawers as folding entities.
>>>
>>
>> The hiding was added because code blocks occasionally generate *huge*
>> results which make it impossible to read further down in the buffer.
>> Hiding such large results can be very useful when you want to keep the
>> data in-buffer, but still want to be able to read down the page.
>
> Then wraps a drawer around the result. Their purpose is to hide
> arbitrary large parts of a buffer. Why inventing yet another way?
>

I like this idea, and would be happy to strip all hiding functionality
away from results... It it possible to wrap all result types (e.g.,
scalar, raw org tex

Re: [O] [OT] CSV to Org

2011-11-22 Thread Samuel Wales
Hi Nick,

Thanks for your comments.  I can see the appeal of an external tool,
but I was thinking maybe some elisp (or even a package or a
part of Org) could do it instead.  Then it could maybe even grow to
become a generally useful
importer.  I am useless at Python.

Samuel



Re: [O] [OT] CSV to Org

2011-11-22 Thread Samuel Wales
Hmm, thanks for your comments.  I can see the appeal of a Python-ish
solution, but I was thinking maybe some elisp (or even a package or a
part of Org) instead.  Then it could grow to a generally useful
importer.



Re: [O] [bug] problem with odt export with latex \ref

2011-11-22 Thread Jambunathan K

This should be fixed now.

The problem was triggered because of inter-mixing label references and
the italics style in the same line.

> Hello all,
>
> Herbert's recent posting of a link to a video showing off the ODT
> exporter, I decided it was time I finally tried this out.  I can export
> a document with no errors but when I try to open the document in
> libreoffice, I get a dialog box with an error message:
>
> ,
> | Read error.
> | Format error discovered in the file in sub-document content.xml at
> | 302,64(row,col).
> `
>
> The lines (in a test org file) in question are these:
>
>   We have solved the optimisation problem,
>   eq. \ref{eq:optimisation-problem}, using the /Strawberry/
>  
> and the generated xml (lines 301-302) is:
>
>   We have solved the optimisation problem,
>   eq.  text:style-name="Emphasis">>, using the /Strawberry
>
> The problem appears to be with the latex \ref{eq:optimisation-problem}
> entity.  I am happy if these are not properly translated but it would be
> great if an error did not preclude loading the resulting ODT file.
>
> Many thanks,
> eric

-- 



Re: [O] How to say "I did that yesterday?"

2011-11-22 Thread Dave Abrahams

on Tue Nov 22 2011, Erik Hetzner  wrote:

> At Tue, 22 Nov 2011 11:40:35 -0800,
> Dave Abrahams wrote:
>> 
>
>> 
>> I often discover that I completed something a few days ago and I would
>> like to mark it done with the appropriate date as though I had marked it
>> done in the past.  That means, e.g., for a repeating event it might
>> repeat sooner than if it had been done today.  Is there a way?
>
> M-x org-todo-yesterday ?
>
> If there is a way to do this for days further in the past, I would
> welcome it! I also find myself wanting to do this often. Right now I
> just mark it done, then manually adjust the log entries.
>
> best, Erik
> Sent from my free software system .


org-todo-yesterday clearly shows how it could be done.  Heh, we could
have org-todo respond to negative prefix args by shifting the date back
that many days and then prompting for state as though `C-u' had been
pressed.

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



Re: [O] [OT] CSV to Org

2011-11-22 Thread Nick Dokos
Samuel Wales  wrote:

> I have an old CSV that looks like this.  I'd like to convert
> it to Org format.
> 
> I think I want to use properties for every field except Name
> (headline) and Note (body text with \r\n meaning newline).
> 
> What is the best way to do this?
> 
> "Na&me","&W","&H","A","B","N&et","&File","&Title","&Org","Addr&1","C&i","&St","&Zip","Addr&2","&Pc","&Note","gp","a&k","g&c","&Do","g&a"
> "some name something","823-2323","233-2323 as a a a a as","2323
> something","","2323 fax?  
> fax!","soao-sss.ss","","","","","","","","","",0,0,0,0,0
> "bob and sylvia
> whosit","","","","","syl...@sss.stanford.edu","","","","","","ca","","","","friend
> sss\r\nw\r\nzsdd\r\n\r\n",0,0,0,0,0
> ...
> 
> More generally, I wonder if there is a general mechanism, as I imagine
> this (with variations) is pretty common.
> 

Personally, I'd write a little python program to do the transformation.
There is a csv module that turns a record into a list of fields. IIRC,
there is also one that turns a record into a dict, so you can get the fields
by name. I can dig further if you are interested.

The following code comes straight from the docs:

--8<---cut here---start->8---
import csv
reader = csv.reader(open("foo.csv", "rb"))
for row in reader:
print row
--8<---cut here---end--->8---

On your example, it gives

,
| ['Na&me', '&W', '&H', 'A', 'B', 'N&et', '&File', '&Title', '&Org', 'Addr&1', 
'C&i', '&St', '&Zip', 'Addr&2', '&Pc', '&Note', 'gp', 'a&k', 'g&c', '&Do', 
'g&a']
| ['some name something', '823-2323', '233-2323 as a a a a as', 
'2323\nsomething', '', '2323 fax?  \nfax!', 'soao-sss.ss', '', '', '', '', 
'', '', '', '', '', '0', '0', '0', '0', '0']
| ['bob and sylvia\nwhosit', '', '', '', '', 'syl...@sss.stanford.edu', '', 
'', '', '', '', 'ca', '', '', '', 
'friend\nsss\\r\\nw\\r\\nzsdd\\r\\n\\r\\n', '0', '0', '0', '0', '0']
`

So row[0] is the name, row[15] is the note, etc. Ruby, perl, etc. can
probably do it easily too.

You probably want something like this, with obvious extensions for other 
properties -
but note that cr/nl handling leaves a lot to be desired:

--8<---cut here---start->8---
import csv
reader = csv.reader(open("foo.csv", "rb"))
titles = reader.next()
for row in reader:
print "* %s\n:PROPERTIES:\n:%s:\t%s\n:END:\n\n%s\n" % (row[0], titles[1], 
row[1], row[15])
--8<---cut here---end--->8---

Output:

,
| * some name something
| :PROPERTIES:
| :&W:  823-2323
| :END:
| 
| 
| 
| * bob and sylvia
| whosit
| :PROPERTIES:
| :&W:  
| :END:
| 
| friend
| sss\r\nw\r\nzsdd\r\n\r\n
| 
`

(This is python 2.6 btw - things are different in python 3).

HTH,
Nick




Re: [O] Updating Worg re standard source block syntax

2011-11-22 Thread Nick Dokos
Martyn Jago  wrote:

> There are literally hundreds of uses of #+srcname and #+source within
> Worg - should I be updating these to #+name ? In other words, does Worg
> reflect the last official release (the Emacs release), or the bleeding
> edge (I tend to assume the latter because of the Org community spirit of
> Worg), but I fail to find any specific notice regarding this.
> 
> Advice would be appreciated since I've found myself appreciating, and
> adding to Worg more and more - and it seems to me it is a real quality of
> Org that Worg can exist in the first place.
> 

Is there any way to find out what the org version is at the worg site?
This is something that I've wondered about in the past, but I keep
forgetting to ask the question. E.g. it would be good to know the
version, so when I make a change to worg content and test the change by
publishing the site locally, I can use the exact version that is going
to be used on the real site. Right now, I test with whatever version is
running on my machine, which can lead to false conclusions (both positive
and negative).

Nick





[O] [OT] CSV to Org

2011-11-22 Thread Samuel Wales
I have an old CSV that looks like this.  I'd like to convert
it to Org format.

I think I want to use properties for every field except Name
(headline) and Note (body text with \r\n meaning newline).

What is the best way to do this?

"Na&me","&W","&H","A","B","N&et","&File","&Title","&Org","Addr&1","C&i","&St","&Zip","Addr&2","&Pc","&Note","gp","a&k","g&c","&Do","g&a"
"some name something","823-2323","233-2323 as a a a a as","2323
something","","2323 fax?  
fax!","soao-sss.ss","","","","","","","","","",0,0,0,0,0
"bob and sylvia
whosit","","","","","syl...@sss.stanford.edu","","","","","","ca","","","","friend
sss\r\nw\r\nzsdd\r\n\r\n",0,0,0,0,0
...

More generally, I wonder if there is a general mechanism, as I imagine
this (with variations) is pretty common.

I am aware of the table importer.

Thanks.



Re: [O] How to say "I did that yesterday?"

2011-11-22 Thread Dave Abrahams

on Tue Nov 22 2011, Michael Brand  wrote:

> Hi Dave
>
> On Tue, Nov 22, 2011 at 20:40, Dave Abrahams  wrote:
>> [...] for a repeating event it might
>> repeat sooner than if it had been done today. [...]
>
> Are you looking for habits?
> http://orgmode.org/manual/Tracking-your-habits.html#Tracking-your-habits

No, I'm alreay using habits!  But if I have a habit to shave every three
days and sometime in the past two days I forgot to mark that I shaved, I
need a way to record that fact without habits letting me slide for a day
and a half past the time I should shave next.

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



Re: [O] [PATCH] Avoid lisp error with (org-deadline nil "+1d")

2011-11-22 Thread Carsten Dominik

On 21.11.2011, at 23:39, Peter Münster wrote:

> * lisp/org.el (parse-time-weekdays): Must not be void.
> 
> TINYCHANGE
> ---
> lisp/org.el |2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/lisp/org.el b/lisp/org.el
> index 253703b..41d418a 100644
> --- a/lisp/org.el
> +++ b/lisp/org.el
> @@ -15229,7 +15229,7 @@ user."
> (setq org-read-date-analyze-futurep futurep)
> (list second minute hour day month year)))
> 
> -(defvar parse-time-weekdays)
> +(defvar parse-time-weekdays nil)

This is not allowed, we cannot define a variable defined in another package.
Can you send a backtrace of the error, please?

- Carsten

> 
> (defun org-read-date-get-relative (s today default)
>   "Check string S for special relative date string.
> -- 
> 1.7.3.4
> 
> 
> 




Re: [O] Updating Worg re standard source block syntax

2011-11-22 Thread Nick Dokos
Martyn Jago  wrote:

> Hi
> 
> There are literally hundreds of uses of #+srcname and #+source within
> Worg - should I be updating these to #+name ? In other words, does Worg
> reflect the last official release (the Emacs release), or the bleeding
> edge (I tend to assume the latter because of the Org community spirit of
> Worg), but I fail to find any specific notice regarding this.
> 
> Advice would be appreciated since I've found myself appreciating, and
> adding to Worg more and more - and it seems to me it is a real quality of
> Org that Worg can exist in the first place.
> 

I think it needs to be coordinated: the change in the content must go in
at the same time as org-mode is updated on the site.

Nick



Re: [O] How to say "I did that yesterday?"

2011-11-22 Thread Erik Hetzner
At Tue, 22 Nov 2011 11:40:35 -0800,
Dave Abrahams wrote:
> 
> 
> I often discover that I completed something a few days ago and I would
> like to mark it done with the appropriate date as though I had marked it
> done in the past.  That means, e.g., for a repeating event it might
> repeat sooner than if it had been done today.  Is there a way?

M-x org-todo-yesterday ?

If there is a way to do this for days further in the past, I would
welcome it! I also find myself wanting to do this often. Right now I
just mark it done, then manually adjust the log entries.

best, Erik
Sent from my free software system .


[O] Updating Worg re standard source block syntax

2011-11-22 Thread Martyn Jago
Hi

There are literally hundreds of uses of #+srcname and #+source within
Worg - should I be updating these to #+name ? In other words, does Worg
reflect the last official release (the Emacs release), or the bleeding
edge (I tend to assume the latter because of the Org community spirit of
Worg), but I fail to find any specific notice regarding this.

Advice would be appreciated since I've found myself appreciating, and
adding to Worg more and more - and it seems to me it is a real quality of
Org that Worg can exist in the first place.

Best, Martyn




Re: [O] Not overwriting unchanged source code files when tangling

2011-11-22 Thread Nick Dokos
Allen S. Rout  wrote:

> On 11/19/2011 01:32 PM, Holger Hoefling wrote:
> > Hi everyone,
> >
> > I wanted to thank everyone for their helpful suggestions and wanted to
> > share the best solutions I heard of and found.
> >
> > One solution is to include a rule in the makefile for every sourcecode
> > file that that copies it and only updates the copy if something has
> > changed (see Nick's email below).
> >
> 
> Or tangle to one directory, and then copy to another;  then there's
> one rule for all of the transitions.
> 
> 
> work/%: tangle/%
>   @cmp --silent  $< $@ || ( echo "Updating $@" ; cp $< $@ )
> 
> I liked Nick's "cmp" invocation; I started out with diff. :)
> 

I first saw it in Kernighan and Pike's "Unix Programming Environment"
(1984!).  I'm sure the trick went back even further.

Nick





Re: [O] Add publishing with utf8

2011-11-22 Thread Olaf Dietsche
"sindikat"  writes:

> I added this to my .emacs: 
>
> (set-language-environment "UTF-8")
> (prefer-coding-system 'utf-8-unix)

This is what I use. Even when I open a new file, the buffer coding
system is chosen as utf-8-unix, shown as U: in the mode line.

Maybe your environment is setup differently? What is the value of LANG
or LC_ALL or any other LC_* environment variable?

I have set LANG=de_DE.utf8.

> (org-export-html-coding-system 'utf-8-unix) 
>
> but Emacs still opens files with pure ASCII as undecided-unix, thus 
> producing wrong iso-8859-1 in my charsets again. I don't know what to do. 
> Is there any way to force Emacs open any file as utf-8?

Maybe C-h v file-coding-system-alist RET helps, if setting the
environment doesn't solve your problem.

Regards, Olaf



Re: [O] Not overwriting unchanged source code files when tangling

2011-11-22 Thread Allen S. Rout

On 11/19/2011 01:32 PM, Holger Hoefling wrote:

Hi everyone,

I wanted to thank everyone for their helpful suggestions and wanted to
share the best solutions I heard of and found.

One solution is to include a rule in the makefile for every sourcecode
file that that copies it and only updates the copy if something has
changed (see Nick's email below).



Or tangle to one directory, and then copy to another;  then there's one 
rule for all of the transitions.



work/%: tangle/%
@cmp --silent  $< $@ || ( echo "Updating $@" ; cp $< $@ )

I liked Nick's "cmp" invocation; I started out with diff. :)


- Allen S. Rout




Re: [O] Add publishing with utf8

2011-11-22 Thread Nick Dokos
sindikat  wrote:

> I added this to my .emacs: 
> 
> (set-language-environment "UTF-8")
> (prefer-coding-system 'utf-8-unix)
> (org-export-html-coding-system 'utf-8-unix) 
> 

This last one is wrong:

(setq org-export-html-coding-system 'utf-8-unix) 

might work better. This might be all you have to do, if Jambunathan K is
correct.

Nick



Re: [O] HTML export and Zotero-friendly headers

2011-11-22 Thread Christian Moe

Hi, Adam Smith,

You're repeating my misunderstanding -- that's not what he's looking 
for, see the thread above.


Christian

On 11/22/11 7:35 PM, adam.smith wrote:



Yes, though it doesn't need to be only COinS.  Zotero supports a number
of different formats, but COinS looks like it may be the easiest and the
most concise.


You're aware that bibliographies exported as HTML from Zotero already
contain COinS?











Re: [O] How to say "I did that yesterday?"

2011-11-22 Thread Michael Brand
Hi Dave

On Tue, Nov 22, 2011 at 20:40, Dave Abrahams  wrote:
> [...] for a repeating event it might
> repeat sooner than if it had been done today. [...]

Are you looking for habits?
http://orgmode.org/manual/Tracking-your-habits.html#Tracking-your-habits

Michael



Re: [O] How to say "I did that yesterday?"

2011-11-22 Thread Greg Troxel

  I often discover that I completed something a few days ago and I would
  like to mark it done with the appropriate date as though I had marked it
  done in the past.  That means, e.g., for a repeating event it might
  repeat sooner than if it had been done today.  Is there a way?

I also want to to that, basically binding 'now' to a particular time in
the past and then executing a todo state change (to effect the log, and
also the next scheduled time).
I wonder if replacing the calls to get now with a function that looks at
a variable and doing

  (setq now-var (now))
  (do-whatever)

would be enough to get it to do what I want.



pgp51ksUxPmLw.pgp
Description: PGP signature


[O] [bug] problem with odt export with latex \ref

2011-11-22 Thread Eric S Fraga
Hello all,

Herbert's recent posting of a link to a video showing off the ODT
exporter, I decided it was time I finally tried this out.  I can export
a document with no errors but when I try to open the document in
libreoffice, I get a dialog box with an error message:

,
| Read error.
| Format error discovered in the file in sub-document content.xml at
| 302,64(row,col).
`

The lines (in a test org file) in question are these:

--8<---cut here---start->8---
  We have solved the optimisation problem,
  eq. \ref{eq:optimisation-problem}, using the /Strawberry/
--8<---cut here---end--->8---
 
and the generated xml (lines 301-302) is:

--8<---cut here---start->8---
  We have solved the optimisation problem,
  eq. >, using the /Strawberry
--8<---cut here---end--->8---

The problem appears to be with the latex \ref{eq:optimisation-problem}
entity.  I am happy if these are not properly translated but it would be
great if an error did not preclude loading the resulting ODT file.

Many thanks,
eric

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.90.1
: using Org-mode version 7.7 (release_7.7.583.gedef1)



Re: [O] Add publishing with utf8

2011-11-22 Thread sindikat
I added this to my .emacs: 


(set-language-environment "UTF-8")
(prefer-coding-system 'utf-8-unix)
(org-export-html-coding-system 'utf-8-unix) 

but Emacs still opens files with pure ASCII as undecided-unix, thus 
producing wrong iso-8859-1 in my charsets again. I don't know what to do. 
Is there any way to force Emacs open any file as utf-8?




Re: [O] How to say "I did that yesterday?"

2011-11-22 Thread Peter Münster
On Tue, Nov 22 2011, Dave Abrahams wrote:

> I often discover that I completed something a few days ago and I would
> like to mark it done with the appropriate date as though I had marked it
> done in the past.  That means, e.g., for a repeating event it might
> repeat sooner than if it had been done today.  Is there a way?

Not exactly what you want, but it might help. Some code for easy
modifying time stamps with C-left, C-right, M-left and M-right:

--8<---cut here---start->8---
(defvar pm/org-ctrlleft-hook nil
  "Hook for functions attaching themselves to `C-left'.")

(defvar pm/org-ctrlright-hook nil
  "Hook for functions attaching themselves to `C-right'.")

(defun pm/org-meta-left ()
  "Decrease the date in the time stamp by one hour."
  (when (org-at-timestamp-p) (org-timestamp-change -60 'minute) t))

(defun pm/org-meta-right ()
  "Increase the date in the time stamp by one hour."
  (when (org-at-timestamp-p) (org-timestamp-change 60 'minute) t))

(defun pm/org-ctrl-left ()
  "Decrease the date in the time stamp by one day."
  (when (org-at-timestamp-p) (org-timestamp-down-day) t))

(defun pm/org-ctrl-right ()
  "Increase the date in the time stamp by one day."
  (when (org-at-timestamp-p) (org-timestamp-up-day) t))

(defun pm/org-ctrlleft ()
  "Run the functions in `pm/org-ctrlleft-hook'."
  (interactive)
  (run-hook-with-args-until-success 'pm/org-ctrlleft-hook))

(defun pm/org-ctrlright ()
  "Run the functions in `pm/org-ctrlright-hook'."
  (interactive)
  (run-hook-with-args-until-success 'pm/org-ctrlright-hook))

(add-hook 'org-metaleft-hook 'pm/org-meta-left)
(add-hook 'org-metaright-hook'pm/org-meta-right)
(add-hook 'pm/org-ctrlleft-hook  'pm/org-ctrl-left)
(add-hook 'pm/org-ctrlright-hook 'pm/org-ctrl-right)

(org-defkey org-mode-map [(control left)]  'pm/org-ctrlleft)
(org-defkey org-mode-map [(control right)] 'pm/org-ctrlright)
--8<---cut here---end--->8---

-- 
   Peter




[O] How to say "I did that yesterday?"

2011-11-22 Thread Dave Abrahams

I often discover that I completed something a few days ago and I would
like to mark it done with the appropriate date as though I had marked it
done in the past.  That means, e.g., for a repeating event it might
repeat sooner than if it had been done today.  Is there a way?

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





Re: [O] HTML export and Zotero-friendly headers

2011-11-22 Thread adam . smith

> Yes, though it doesn't need to be only COinS.  Zotero supports a number
> of different formats, but COinS looks like it may be the easiest and the
> most concise.
> 
You're aware that bibliographies exported as HTML from Zotero already 
contain COinS?







Re: [O] [BUG] Inconsistency in src block hiding

2011-11-22 Thread Nicolas Goaziou
Hello,

Eric Schulte  writes:

> Nicolas Goaziou  writes:
>
>> It is inconsistent when keywords stack on top of each other. If you have
>> only a "#+name:" keyword, block with fold at the "#+name:" level. If you
>> have both "#+name:" and, for example "#+results" below, block will fold
>> at the "#+result:" level and TAB will not respond at "#+name:".
>
> Can you provide an example, I'm thinking that what you describe may not
> be legal syntax.

Consider the following cases:

--8<---cut here---start->8---
#+name: one-more
#+header: :var k=2
#+begin_src emacs-lisp
(1+ k)
#+end_src

#+header: :var k=2
#+name: one-more
#+begin_src emacs-lisp
(1+ k)
#+end_src

#+attr_html: :textarea t :height 10 :width 40
#+name: unique-name
#+begin_example
Edit me!
#+end_example
--8<---cut here---end--->8---

Note that the second case doesn't appear to be legal, as executing the
block errors out with "Symbol's value as variable is void: k". I don't
think that there should be any imposed order in affiliated keywords.

Anyway, in the first case, block will be hidden only when TAB is pressed
on the "#+begin_src" line. In the second case, block can be hidden when
TAB is pressed on both the "#+name:" and the "#+begin_" line, with two
different results. That's confusing.

Only lines below "#+begin_" should be hidden, with TAB pressed on any
keyword. Affiliated keywords should always be visible.


>> If you have, from top to bottom, "name", "results" "header", nothing
>> will fold.  In all those cases, I think a consistent behaviour could
>> be to hide the block, with any number of keywords above, and TAB
>> pressed at any of them.
>>
>
> Yes, I would agree, the hiding should be smart enough to find the whole
> unit and hide it.  I'll take a look at the code.

Or rely on Org Elements... *coughs*

>> I'm not sure that "#+results:" or "#+name:" keywords should allow to
>> hide whole parts of the buffer. I realize that toggling "#+results:"
>> visibility has been in core for a while. But now that every Org blob can
>> have a "#+name" attached to it, one can hide almost anything in the
>> buffer.
>>
>> Until now we could hide contents with headlines, blocks, drawers, and
>> items (with an option to prevent it). And we had a global mechanism to
>> handle visibility toggling just fine (namely S-TAB with different
>> numbers of prefixes). But hiding independently each list, table or
>> paragraph with no possibility to make them appear in groups just doesn't
>> sound right.
>>
>> Hence, I suggest to think again about it: we can live happily with
>> outlines, blocks and drawers as folding entities.
>>
>
> The hiding was added because code blocks occasionally generate *huge*
> results which make it impossible to read further down in the buffer.
> Hiding such large results can be very useful when you want to keep the
> data in-buffer, but still want to be able to read down the page.

Then wraps a drawer around the result. Their purpose is to hide
arbitrary large parts of a buffer. Why inventing yet another way?

> Is there a way to bring the hiding of results more in-line with the
> other methods of hiding in Org-mode?  Should S-Tab be made to toggle the
> hidden states of named entities as well as outline levels?

Again, drawers are in-line with standard hiding methods. Though, their
behaviour with regards to export needs to be changed (i.e. by default
simply export contents of the drawer instead of ignoring it).

I think we should drop any "#+result:" or "#+name:" hiding and take
another route. It's not their job anyway.

>> `org-export-blocks-preprocess' will remove all "#+name:" keywords in the
>> buffer.  It mustn't: again "#+name:" is a general naming mechanism for
>> almost any Org syntax. It may/will be also used for other purpose than
>> Babel. That information is important even after blocks have been
>> processed.
>>
>
> I'll take a look at this and submit a patch.

You took care of the problem even before I could thank you for thinking
about fixing it.


Regards,

-- 
Nicolas Goaziou



[O] [PATCH] Org-Velocity rewrite

2011-11-22 Thread Paul M. Rodriguez

This is a rewrite of Org-Velocity for speed. Delays due to file size
should no longer be perceptible. I have also added in-line previews of
entry contents and dropped support for Org-Remember.

Paul Rodriguez.

diff --git a/contrib/lisp/org-velocity.el b/contrib/lisp/org-velocity.el
index aae96b3..b288cda 100644
--- a/contrib/lisp/org-velocity.el
+++ b/contrib/lisp/org-velocity.el
@@ -4,7 +4,7 @@
 
 ;; Author: Paul M. Rodriguez 
 ;; Created: 2010-05-05
-;; Version: 2.4
+;; Version: 3.0
 
 ;; This file is not part of GNU Emacs.
 
@@ -58,7 +58,7 @@
 ;;; Usage:
 ;; (require 'org-velocity)
 ;; (setq org-velocity-bucket (expand-file-name "bucket.org" org-directory))
-;; (global-set-key (kbd "C-c v") 'org-velocity-read)
+;; (global-set-key (kbd "C-c v") 'org-velocity)
 
 ;;; Code:
 (require 'org)
@@ -85,6 +85,12 @@
   :type 'boolean
   :safe 'booleanp)
 
+(defcustom org-velocity-show-previews t
+  "Show previews of the text of each heading?"
+  :group 'velocity
+  :type 'boolean
+  :safe 'booleanp)
+
 (defcustom org-velocity-exit-on-match nil
   "When searching incrementally, exit on a single match?"
   :group 'org-velocity
@@ -97,14 +103,6 @@
   :type 'boolean
   :safe 'booleanp)
 
-(defcustom org-velocity-max-depth nil
-  "Ignore headings deeper than this."
-  :group 'org-velocity
-  :type '(choice
-  (const :tag "No maximum depth" nil)
-  (integer :tag "Set maximum depth"))
-  :safe (lambda (v) (or (null v) (wholenump v
-
 (defcustom org-velocity-use-search-ring t
   "Push search to `search-ring' when visiting an entry?
 
@@ -132,12 +130,6 @@ file."
   (const :tag "Use completion" t))
   :safe 'booleanp)
 
-(defcustom org-velocity-edit-indirectly t
-  "Edit entries in an indirect buffer or just visit the file?"
-  :group 'org-velocity
-  :type 'boolean
-  :safe 'booleanp)
-
 (defcustom org-velocity-search-method 'phrase
   "Match on whole phrase, any word, or all words?"
   :group 'org-velocity
@@ -148,28 +140,6 @@ file."
   (const :tag "Match a regular expression" regexp))
   :safe (lambda (v) (memq v '(phrase any all regexp
 
-(defcustom org-velocity-create-method 'capture
-  "Prefer `org-capture', `org-remember', or neither?"
-  :group 'org-velocity
-  :type '(choice
-	  (const :tag "Prefer capture > remember > default." capture)
-	  (const :tag "Prefer remember > default." remember)
-	  (const :tag "Edit in buffer." buffer))
-  :safe (lambda (v) (memq v '(capture remember buffer
-
-(defcustom org-velocity-remember-templates
-  '(("Velocity entry"
- ?v
- "* %:search\n\n%i%?"
- nil
- bottom))
-  "Use these templates with `org-remember'.
-Meanwhile `org-default-notes-file' is bound to `org-velocity-use-file'.
-The keyword :search inserts the current search.
-See the documentation for `org-remember-templates'."
-  :group 'org-velocity
-  :type (or (get 'org-remember-templates 'custom-type) 'list))
-
 (defcustom org-velocity-capture-templates
   '(("v"
  "Velocity entry"
@@ -177,19 +147,48 @@ See the documentation for `org-remember-templates'."
  (file "")
  "* %:search\n\n%i%?"))
   "Use these template with `org-capture'.
-Meanwhile `org-default-notes-file' is bound to `org-velocity-use-file'.
+Meanwhile `org-default-notes-file' is bound to `org-velocity-bucket-file'.
 The keyword :search inserts the current search.
 See the documentation for `org-capture-templates'."
   :group 'org-velocity
   :type (or (get 'org-capture-templates 'custom-type) 'list))
 
-(defstruct (org-velocity-heading
-	(:constructor org-velocity-make-heading
-  (&aux (components (org-heading-components
-	(:type list))
-  (marker (point-marker))
-  (name (nth 4 components))
-  (level (nth 0 components)))
+(defsubst org-velocity-grab-preview ()
+  "Grab preview of a subtree.
+The length of the preview is determined by `window-width'.
+
+Replace all contiguous whitespace with single spaces."
+  (let ((start (progn
+ (forward-line 1)
+ (if (looking-at org-property-start-re)
+ (re-search-forward org-property-end-re)
+   (1- (point))
+(mapconcat
+ #'identity
+ (split-string
+  (buffer-substring-no-properties
+   start
+   (min
+(+ start (window-width))
+(point-max
+ " ")))
+
+(defstruct org-velocity-heading buffer position name level preview)
+
+(defsubst org-velocity-nearest-heading (position)
+  "Return last heading at POSITION.
+If there is no last heading, return nil."
+  (save-excursion
+(goto-char position)
+(re-search-backward org-velocity-heading-regexp)
+(let ((components (org-heading-components)))
+  (make-org-velocity-heading
+   :buffer (current-buffer)
+   :position (point)
+   :name (nth 4 components)
+   :level (nth 0 components)
+   :preview (if org-velocity-show-previews
+(org-velocity-grab-preview))
 
 (defconst org-velocity-index
   (eval-wh

Re: [O] [org-babel] switching off (re-)evaluation of code blocks during Org export

2011-11-22 Thread Eric Schulte
Bernt Hansen  writes:

> Eric Schulte  writes:
>
>>>
>>> Hence, maybe we should be able to set 2 possible behaviors[1] for the
>>>`eval'
>>> parameter:
>>>
>>> - one for the interactive mode (yes/query/no), and
>>> - one for the export mode (yes/no, and maybe query as well?).
>>>
>>
>> Agreed,
>>
>> The eval header argument now supports the following four options
>> (updated in the manual under "Specific header arguments").
>>
>> | no or never   | no evaluation anytime |
>> | query | query before evaluation anytime   |
>> | no-eval or never-eval | no evaluation during export   |
>> | query-eval| query before evaluation during export |
>>
>> Thanks for the suggestion
>
> Hi Eric,
>
> Should the last two be named export-no, export-never, and export-query.
> That seems more self-documenting to me.
>

Oh!, I miss-typed the above it should read as follows.

| no or never   | no evaluation anytime |
| query | query before evaluation anytime   |
| no-export or never-export | no evaluation during export   |
| query-export  | query before evaluation during export |

Thanks for catching this, the documentation has the correct terms.

Best,

>
> I'm going to be confused about the difference between 'no' and 'no-eval'
> in the future.  Since the eval header argument already has 'eval' in it
> is it not more useful to specify these values are export related?
>
> Regards,
> Bernt

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



Re: [O] [org-babel] switching off (re-)evaluation of code blocks during Org export

2011-11-22 Thread Bernt Hansen
Eric Schulte  writes:

>>
>> Hence, maybe we should be able to set 2 possible behaviors[1] for the
>>`eval'
>> parameter:
>>
>> - one for the interactive mode (yes/query/no), and
>> - one for the export mode (yes/no, and maybe query as well?).
>>
>
> Agreed,
>
> The eval header argument now supports the following four options
> (updated in the manual under "Specific header arguments").
>
> | no or never   | no evaluation anytime |
> | query | query before evaluation anytime   |
> | no-eval or never-eval | no evaluation during export   |
> | query-eval| query before evaluation during export |
>
> Thanks for the suggestion

Hi Eric,

Should the last two be named export-no, export-never, and export-query.
That seems more self-documenting to me.

I'm going to be confused about the difference between 'no' and 'no-eval'
in the future.  Since the eval header argument already has 'eval' in it
is it not more useful to specify these values are export related?

Regards,
Bernt



Re: [O] [PATCH] new babel latex feature :imagemagick

2011-11-22 Thread Eric Schulte
Applied, thanks -- Eric

Andreas Leha  writes:

> FSF papers are signed and the process is completed - so the revert can
> be reverted now (the patch should still apply).
> Sorry for the long delay...
>
>

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



Re: [O] [BUG] Inconsistency in src block hiding

2011-11-22 Thread Eric Schulte
>> If you have, from top to bottom, "name", "results" "header", nothing
>> will fold.  In all those cases, I think a consistent behaviour could
>> be to hide the block, with any number of keywords above, and TAB
>> pressed at any of them.
>>
>
> Yes, I would agree, the hiding should be smart enough to find the whole
> unit and hide it.  I'll take a look at the code.
>

I've just pushed up a fix for this issue.

>> `org-export-blocks-preprocess' will remove all "#+name:" keywords in the
>> buffer.  It mustn't: again "#+name:" is a general naming mechanism for
>> almost any Org syntax. It may/will be also used for other purpose than
>> Babel. That information is important even after blocks have been
>> processed.
>>
>
> I'll take a look at this and submit a patch.
>

And this one as well

Cheers,

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



Re: [O] [org-babel] switching off (re-)evaluation of code blocks during Org export

2011-11-22 Thread Eric Schulte
>
> Hence, maybe we should be able to set 2 possible behaviors[1] for the
>`eval'
> parameter:
>
> - one for the interactive mode (yes/query/no), and
> - one for the export mode (yes/no, and maybe query as well?).
>

Agreed,

The eval header argument now supports the following four options
(updated in the manual under "Specific header arguments").

| no or never   | no evaluation anytime |
| query | query before evaluation anytime   |
| no-eval or never-eval | no evaluation during export   |
| query-eval| query before evaluation during export |

Thanks for the suggestion

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



Re: [O] [ANN] Org Elements in contrib

2011-11-22 Thread Thomas S. Dye
Aloha Nicolas,

This looks brilliant.  The interactive functions seem to know their way
around my various org-mode files.  Looking forward to the generic
exporter and the LaTeX back-end.

All the best,
Tom

Nicolas Goaziou  writes:

> Hello,
>
>
> I've added org-element.el in contrib directory. It is a complete parser
> and interpreter for Org syntax.
>
> While it was written to be extensible, it is also an attempt to
> normalize current syntax and provide guidance for its evolution.
>
> Org syntax can be divided into three categories: "Greater elements",
> "Elements" and "Objects".
>
> An object can be defined anywhere on a line. It may span over more than
> a line but never contains a blank one. Objects belong to the following
> types: `emphasis', `entity', `export-snippet', `footnote-reference',
> `inline-babel-call', `inline-src-block', `latex-fragment', `line-break',
> `link', `macro', `radio-target', `statistics-cookie', `subscript',
> `superscript', `target', `time-stamp' and `verbatim'.
>
> An element always starts and ends at the beginning of a line. The only
> element's type containing objects is called a `paragraph'. Other types
> are: `comment', `comment-block', `example-block', `export-block',
> `fixed-width', `horizontal-rule', `keyword', `latex-environment',
> `babel-call', `property-drawer', `quote-section', `src-block', `table'
> and `verse-block'.
>
> Elements containing paragraphs are called greater elements. Concerned
> types are: `center-block', `drawer', `dynamic-block',
> `footnote-definition', `headline', `inlinetask', `item', `plain-list',
> `quote-block' and `special-block'.
>
> Greater elements (excepted `headline' and `item' types) and elements
> (excepted `keyword', `babel-call', and `property-drawer' types) can have
> a fixed set of keywords as attributes. Those are called "affiliated
> keywords", to distinguish them from others keywords, which are
> full-fledged elements. In particular, the "name" affiliated keyword
> allows to label almost any element in an Org buffer.
>
> Notwithstanding affiliated keywords, each greater element, element and
> object has a fixed set of properties attached to it. Among them, three
> are shared by all types: `:begin' and `:end', which refer to the
> beginning and ending buffer positions of the considered element or
> object, and `:post-blank', which holds the number of blank lines, or
> white spaces, at its end.
>
> Some elements also have special properties whose value can hold objects
> themselves (i.e. an item tag, an headline name, a table cell). Such
> values are called "secondary strings".
>
> Lisp-wise, an element or an object can be represented as a list. It
> follows the pattern (TYPE PROPERTIES CONTENTS), where: TYPE is a symbol
> describing the Org element or object. PROPERTIES is the property list
> attached to it. See docstring of appropriate parsing function to get an
> exhaustive list. CONTENTS is a list of elements, objects or raw strings
> contained in the current element or object, when applicable.
>
> An Org buffer is a nested list of such elements and objects, whose type
> is `org-data' and properties is nil.
>
> The first part of this file implements a parser and an interpreter for
> each type of Org syntax.
>
> The next two parts introduce two accessors and a function retrieving the
> smallest element containing point (respectively
> `org-element-get-property', `org-element-get-contents' and
> `org-element-at-point').
>
> The following part creates a fully recursive buffer parser. It also
> provides a tool to map a function to elements or objects matching some
> criteria in the parse tree. Functions of interest are
> `org-element-parse-buffer', `org-element-map' and, to a lesser extent,
> `org-element-parse-secondary-string'.
>
> The penultimate part is the cradle of an interpreter for the obtained
> parse tree: `org-element-interpret-data' (and its relative,
> `org-element-interpret-secondary').
>
> The library ends by furnishing a set of interactive tools for element's
> navigation and manipulation.
>
> More specifically, that last part includes some tools like
> `org-element-forward', `org-element-backward',
> `org-element-drag-forward', `org-element-drag-backward',
> `org-element-mark-element', `org-element-up',
> `org-element-unindent-buffer'... 
>
> For the impatient (well, not quite as you're still reading this), you
> can evaluate the following examples in an Org buffer :
>
>(org-element-parse-buffer)
>   (org-element-parse-buffer 'headline)
>(org-element-parse-buffer 'headline 'visible-only)
>
> Also, the following code will parse the buffer, interpret the parsed
> tree, and create a canonical copy of it (no indentation, lowercased
> blocks, standard keywords):
>
> #+begin_src org
> (let ((out (org-element-interpret-data (org-element-parse-buffer
>   (switch-to-buffer (get-buffer-create "*Bijectivep*"))
>   (erase-buffer)
>   (insert out)
>   (goto-char (po

Re: [O] HTML export and Zotero-friendly headers

2011-11-22 Thread Erik L. Arneson
On Tue, 22 Nov 2011, Christian Moe wrote:
> Hi,
>
> Then I misunderstood you, sorry about the noise (to both Eriks, A. and
> H.). I thought you meant including Zotero-readable metadata for each
> citation in the Org document.

No problem.  I tried to be clear, but obviously I wasn't.  :)

> Do I then understand correctly that what you want to do is simply to
> generate one COinS snippet with metadata about the document itself
> (author, title, etc.)?

Yes, though it doesn't need to be only COinS.  Zotero supports a number
of different formats, but COinS looks like it may be the easiest and the
most concise.

-- 
Erik L. Arneson 
  GPG Key ID : 1024D/62DA1D25   BitCoin : 1LqvuGUqJ4ZUSoE7YE9ngETjwp4yZ2uSdP
  Office : +1.541.291.9776Skype : callto://pymander
   http://www.leisurenouveau.com/ http://www.transformason.org/




Re: [O] : Search for missing :END:

2011-11-22 Thread Nick Dokos
Olaf Dietsche  wrote:

> Nick Dokos  writes:
> 
> [snip]
> > But assuming that you are getting some error from org, you don't know
> > where the problem is and you are trying to find it, it will be simpler
> > to just use egrep:
> >
> > grep -E -n ':PROPERTIES:|:END:' foo.org
> >
> > will filter out the relevant lines, so all you have to do is scan the
> > output by eye and spot any irregularity (consecutive :PROPERTIES: or
> > consecutive :END: lines). Even if you have hundreds of them, that's
> > *easy* for humans to do.[fn:2]
> >
> > Or, if you prefer, you can write trivial validation programs to operate
> > on the output, e.g.:
> >
> > grep -E -n ':PROPERTIES:|:END:' foo.org | tee foo.out | grep PROP | 
> > wc -l
> > grep END foo.out | wc -l
> >
> > (the counts 'd better be the same).
> 
> Since you might have other drawers as well (LOGBOOK, CLOCK), the counts
> need not be the same.
> 

Indeed - you might have user-defined drawers as well and they all contribute the
:END: part, so the begin part will have to be fleshed out accordingly. But the
generalization is easy and eyeballing the output is pretty effective: if you
miss some drawer types, the repeating :END: stands out like a sore thumb.

>
> NB: At least GNU grep knows how to search for multiple regexps:
> $ grep -e :PROPERTIES: -e :END: foo.org
> So, no need for egrep here.
> 

Ok - thanks.

Nick



Re: [O] TABLES: split cells on columns

2011-11-22 Thread Michael Brand
Hi Daniel

On Tue, Nov 22, 2011 at 15:26, Daniel Martins  wrote:
> Thank you very much!!!
> Just one point
> In my case at least M- does not insert a new line!
  ^

Yes, my fault. Corrigendum:

1) M-S- to add the new row
2) mark the region from "t" down to any char from the field below
3) M-Ret

Michael



[O] [babel] (Almost) Add SQL*Plus engine

2011-11-22 Thread Sebastien Vauban
Hi Eric,

I almost added the engine `sqlplus' (from Oracle Instant client) to `ob-sql':

#+begin_src emacs-lisp
  ('sqlplus (format "sqlplus -S %s @%s > %s"
  (or cmdline "")
  (org-babel-process-file-name in-file)
  (org-babel-process-file-name out-file)))
#+end_src

where:

- `S' is to remove the Oracle banner
- `user/pass@server' is the logon info (given as `cmdline')
- `@file' is the way to pass an SQL script to be run (file name is preceded by
  an `@' sign).

BUT the code block to be executed is saved by Babel in Windows' TEMP
directory, for example under a file whose full path is:

c:\WINDOWS\TEMP\babel-511607b\sql-in-5116n4J

There is no file extension there. This becomes important... as SQL*Plus seems
to always add the `sql' extension to the script file name, when they don't
have one:

#+begin_src sh
  $ sqlplus -S user/pass@server @c\:/WINDOWS/TEMP/babel-511607b/sql-in-5116n4J
^^
  SP2-0310: unable to open file 
"c:/WINDOWS/TEMP/babel-511607b/sql-in-5116n4J.sql"
#+end_src  
^^

If I go and add an `sql' extension to that temporary file, in the file system,
the script is well read and executed:

#+begin_src sql
  $ sqlplus -S user/pass@server 
@c\:/WINDOWS/TEMP/babel-511607b/sql-in-5116n4J.sql

^^
  SELECT * FROM employees
*
  ERROR at line 1:
  ORA-00942: table or view does not exist
#+end_src

Here, the command is executed, but fails because it's just a sample command,
and there is no such table.

So, in order to get the `sqlplus' engine working, it seems necessary to add
the language extension to the file name hosting temporarily the code snippet.

In a way, it's even cleaner: would we open it under Emacs, we directly get the
proper highlighting, etc. But there was maybe a reason it hadn't been done
that way?

What do you think?

Best regards,
  Seb

-- 
Sebastien Vauban




Re: [O] TABLES: split cells on columns

2011-11-22 Thread Daniel Martins
Thank you very much!!!

Just one point

In my case at least M- does not insert a new line!


>From the comment of the key sequence:



--


  org-metadown is an interactive compiled Lisp function in `org.el'.

(org-metadown &optional ARG)

Move subtree down or move table row down.
Calls `org-move-subtree-down' or `org-table-move-row' or
`org-move-item-down', depending on context.  See the individual
commands for more information.

[back] [forward]


2011/11/21 Michael Brand 

> Hi Daniel
>
> Yes, there is:
> 1) M- to add the new line
> 2) mark the region from "t" down to any char from the field below
> 3) M-Ret
>
> The opposite direction is:
> - C-u M-Ret to join the content of a field to the one above
>
> See also C-h f org-table-wrap-region for more tricks.
>
> Michael
>
> On Mon, Nov 21, 2011 at 14:31, Daniel Martins  wrote:
> > The feature of remove/add cell is quite important. Should be a feature
> > request.
> > Another important feature request is to split cells.
> > Example (copying and paste the example above)
> >
> > Example:
> > I have the following table:
> > |1 |1 |
> > |2 | two words|
> > |3 |4 |
> > |4 |  |
> > Now I want to split cell  @2$2 and thus move the second part to the
> > following cell below  in column 2 down one step.
> > After:
> > |1 |1 |
> > |2 |   two|
> > |  | words|
> > |3 |4 |
> > |4 |  |
> >
> >
> > I do it several times when I put much comments on an entry and the column
> > becomes much wider.
> > It is several commands (sometimes with rectangles, sometimes not
> depending
> > on the remaining of the table) .
> > Is there an easy way to do this?
>


Re: [O] Babel Tangling Only Blocks Under One Heading in a File with Multiple Blocks.

2011-11-22 Thread Ian Barton

On 22/11/11 13:46, Rainer M Krug wrote:



On Tue, Nov 22, 2011 at 2:36 PM, Ian Barton mailto:li...@wilkesley.net>> wrote:

I am using org to keep configuration files for my various servers. A
typical file might look like:

* Postfix
** main.cf 
#+BEGIN_SRC sh :tangle
~/dropbox/configuration_files/__wilkesley.org/postfix/main.cf
 :exports none :noweb yes

#+END_SRC
** master.cf 

* Dovecot
** dovecot.conf

Mostly I only change one configuration file and don't need to tangle
every block in my org file. Is there any method to only tangle files
under a particular heading? Thus I could regenerate just my Postfix
config files and not my Dovecot ones.


Check org-narrow-to-subtree - you can narrow to subtree and then tangle.

Cheers,



Thanks, that does the job nicely.

Ian.




Re: [O] [ANN] Org Elements in contrib

2011-11-22 Thread Brian Wightman
On Mon, Nov 21, 2011 at 12:50 PM, Nicolas Goaziou  wrote:
> I've added org-element.el in contrib directory. It is a complete parser
> and interpreter for Org syntax.
>
> While it was written to be extensible, it is also an attempt to
> normalize current syntax and provide guidance for its evolution.

This is also a good thing (IMO) from the viewpoint of being able to
provide external (non-org-mode) parsers for org-mode files.  If
org-element is the canonical definition of org syntax (not semantics,
just syntax), all other parsers must adhere to this or they are in
error.

A slight evolution of this would be to have this definition defined in
the tests, and have org-element, or any other parser, adhere to those
tests.  Defining a canon for org-mode syntax is, in any form, a big
step forward.

Brian



Re: [O] Babel Tangling Only Blocks Under One Heading in a File with Multiple Blocks.

2011-11-22 Thread Rainer M Krug
On Tue, Nov 22, 2011 at 2:36 PM, Ian Barton  wrote:

> I am using org to keep configuration files for my various servers. A
> typical file might look like:
>
> * Postfix
> ** main.cf
> #+BEGIN_SRC sh :tangle ~/dropbox/configuration_files/**
> wilkesley.org/postfix/main.cf :exports 
> none :noweb yes
>
> #+END_SRC
> ** master.cf
>
> * Dovecot
> ** dovecot.conf
>
> Mostly I only change one configuration file and don't need to tangle every
> block in my org file. Is there any method to only tangle files under a
> particular heading? Thus I could regenerate just my Postfix config files
> and not my Dovecot ones.
>

Check org-narrow-to-subtree - you can narrow to subtree and then tangle.

Cheers,

Rainer


>
> Ian.
>
>


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

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

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

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

email:  rai...@krugs.de

Skype:  RMkrug


[O] Babel Tangling Only Blocks Under One Heading in a File with Multiple Blocks.

2011-11-22 Thread Ian Barton
I am using org to keep configuration files for my various servers. A 
typical file might look like:


* Postfix
** main.cf
#+BEGIN_SRC sh :tangle 
~/dropbox/configuration_files/wilkesley.org/postfix/main.cf :exports 
none :noweb yes


#+END_SRC
** master.cf

* Dovecot
** dovecot.conf

Mostly I only change one configuration file and don't need to tangle 
every block in my org file. Is there any method to only tangle files 
under a particular heading? Thus I could regenerate just my Postfix 
config files and not my Dovecot ones.


Ian.



Re: [O] [PATCH] new babel latex feature :imagemagick

2011-11-22 Thread Andreas Leha
FSF papers are signed and the process is completed - so the revert can
be reverted now (the patch should still apply).
Sorry for the long delay...




Re: [O] [org-babel] switching off (re-)evaluation of code blocks during Org export

2011-11-22 Thread Sebastien Vauban
Hi Eric,

Eric Schulte wrote:
> Torsten Anders  writes:
>> Thanks a lot for your kind replies. However, this is not yet quite what I am 
>> after.
>>
>> I want to be able to manually execute each code block, but not
>> automatically whenever the whole document is rendered. So, I would
>> always switch on/off "eval never". Hm...
>
> I've just pushed up a patch which adds a new option to the "eval" header
> argument. Setting eval to "non-export" will now allow interactive
> evaluation, but will inhibit code block evaluation during export. This
> should address your need as I understand it.

It certainly is a good addition, but wouldn't it be better to add an
orthogonal argument for the "exports" stuff, that is a second parameter?

I mean: you've added `non-export' which maps to:

- `yes' for interactive evaluation
- `never' for export

I'm sure a guy (or a woman) will ask in a short future for:

- `query' for interactive evaluation
- `never' for export.

Hence, maybe we should be able to set 2 possible behaviors[1] for the `eval'
parameter:

- one for the interactive mode (yes/query/no), and
- one for the export mode (yes/no, and maybe query as well?).

Best regards,
  Seb

Footnotes:

[1] Like for results, where we can give up to 3 options:
`:results output scalar raw'

-- 
Sebastien Vauban




Re: [O] HTML export and Zotero-friendly headers

2011-11-22 Thread Christian Moe

Hi,

Then I misunderstood you, sorry about the noise (to both Eriks, A. and 
H.). I thought you meant including Zotero-readable metadata for each 
citation in the Org document.


Do I then understand correctly that what you want to do is simply to 
generate one COinS snippet with metadata about the document itself 
(author, title, etc.)?


Yours,
Christian



On 11/21/11 10:14 PM, Erik L. Arneson wrote:


I thought zotero-plain was used to add citations.  What I'm trying to do
is use org-mode to export HTML files with Zotero-friendly headers that
the Zotero plugin will pick-up on in the browser.

I can make the COinS  snippets myself using the tool available on
the COinS website, but it would be handy if org-mode could do that
automatically using the org header data that already exists.





Re: [O] : Search for missing :END:

2011-11-22 Thread Olaf Dietsche
Nick Dokos  writes:

[snip]
> But assuming that you are getting some error from org, you don't know
> where the problem is and you are trying to find it, it will be simpler
> to just use egrep:
>
> grep -E -n ':PROPERTIES:|:END:' foo.org
>
> will filter out the relevant lines, so all you have to do is scan the
> output by eye and spot any irregularity (consecutive :PROPERTIES: or
> consecutive :END: lines). Even if you have hundreds of them, that's
> *easy* for humans to do.[fn:2]
>
> Or, if you prefer, you can write trivial validation programs to operate
> on the output, e.g.:
>
> grep -E -n ':PROPERTIES:|:END:' foo.org | tee foo.out | grep PROP | 
> wc -l
>   grep END foo.out | wc -l
>
> (the counts 'd better be the same).

Since you might have other drawers as well (LOGBOOK, CLOCK), the counts
need not be the same.

Regards, Olaf

NB: At least GNU grep knows how to search for multiple regexps:
$ grep -e :PROPERTIES: -e :END: foo.org
So, no need for egrep here.



Re: [O] Add publishing with utf8

2011-11-22 Thread Jambunathan K

> My html files are exported with charset=utf-8. I believe that that's
> because my org-mode buffers are utf-8 and ultimately because I've
> set LANG=en_US.UTF-8.
>
> Try the following when visiting your org file (actually, a backup of
> your org file :-))
>
>  o C-x RET f utf-8 RET
>
>  o Save the file.
>
>  o Then export it to HTML.

C-h v org-export-html-coding-system

How about customizing the above variable?

> HTH,
> Nick
>
>
>

-- 



Re: [O] New version of VimOrganizer, an Org-mode clone in Vim

2011-11-22 Thread Eric S Fraga
Tom Short  writes:

> On Thu, Nov 3, 2011 at 7:26 PM, Herbert Sitz  wrote:
>> Michael Brand  gmail.com> writes:
>>>
>
>>> or at a similar place that there is also the possibility to have the
>>> vi modal editing paradigm and most of the vi key bindings within Emacs
>>> itself by using a vi emulation like Viper mode. (I use Emacs with
>>> Viper mode all the time to have the best of both worlds.)
>>>
>>> Michael
>>>
>>
>> Michael -- No problem, this issue was of course brought up when I started the
>> project a year or so ago.  Actually for the many Vim users who have tried to
>> make the transition to Emacs I think it is pretty well known that there are
>> several different Vim emulators for Emacs.  (Evil is a fairly new one I still
>> want to try out; I'm not sure but I think it's by same team and intended to
>> supplant Vimpulse, which itself extends Viper:  http://gitorious.org/evil )
>
> Evil is very nice. I like it a lot and could never get used to
> Vimpulse. It is intended to replace Viper/Vimpulse. I second your idea
> of better org integration. See here for a start of a customization:
>
> http://zuttobenkyou.wordpress.com/tag/orgmode/
>
> Anyway, I'm looking forward to trying VimOrganizer.
>

I have been using evil for several months now.  It works very very
well.  I also had tried previous VI emulation attempts (viper, vimpulse)
but none stuck.  Evil has.  It works particularly well with org mode in
my experience.  Highly recommended if you want vi + emacs, as I do.

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.90.1
: using Org-mode version 7.7 (release_7.7.582.g36939)