Re: [O] feature suggestion: apply datetime prompt magic to selected region

2011-10-06 Thread Brian van den Broek
On 6 Oct 2011 21:46, "Achim Gratz"  wrote:
>
> Brian van den Broek  writes:
> > It wouldn't stun me were orgmode already able to do what I have in
> > mind, but trying it and consulting the fine manual didn't suggest that
> > it does.
> [snip]
>
> I'm not exactly sure what you are trying to achieve, but it seems that
> you could define a keyboard macro for that?>

Hi Achim,

Thanks for the reply.

Indeed one could and perhaps I ought to have; my data was irregular, so I
didn't have the hope of quickly creating a robust macro. Since I had to
select regions by hand, a macro didn't seem worth it for the kill,
invocation of the datetime prompt, and yank within.

It just seemed that since orgmode parse text yanked into the dt prompt, it
would be in keeping with the general spirit of the mode to parse selected
text, too. But, as I said, it isn't a big deal.

I've weak elisp and know nothing of orgs internals. But, if there's no
uptake, maybe that'd be a small enough coding task for ?e to take some steps
to learning :-)

Best,

Brian vdB


[O] Create new date-tree entry in current file?

2011-10-06 Thread John Hendy
Is there a way to create a date-tree in my current file, or is the
only way to use a capture template pre-set to use a date-tree for the
headline? For projects I have a setup something like this:

---
* Tracking
Stores todos and such

* Journals
Stores chronological notes that aren't todos. Lets me know when I
worked on things.

* Reference
Odds and ends that aren't chronological, but that I might want to look at.
---

It would be awesome to be in a project file and then jump right to a
current date tree and start taking notes about something. Capture is
the only way I've seen to do this, but it seems to require a specific
file target, which means I need capture templates for every project
file, right? Or is there some option like (file+datetree
"~/['use-this-file].org") (just throwing something out there)?

Thanks for any comments.


John



Re: [O] Checkbox difficulties

2011-10-06 Thread Dave Abrahams

on Mon Oct 03 2011, Nick Dokos  wrote:

> Dave Abrahams  wrote:
>
>> 
>> on Mon Oct 03 2011, Nick Dokos  wrote:
>> 
>> > Dave Abrahams  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
>> 
>> Works!  Oh-so-awesome!  Shouldn't these capabilities be built-in and
>> shipped as first class Org features?
>> 
>
> Well, if the function can be made to work completely generally, maybe:
> as it stands, it is more a proof-of-concept than a complete solution.
>
> I added an entry in the FAQ on Worg about this - I figured this is the
> second time the question has been asked on the list: ergo it's a FAQ ;-)
>
>http://orgmode.org/worg/org-faq.html#sec-9-7
>
> You might want to read the entry: it includes a slightly revised function
> but it also includes a couple of caveats that explain why I think it's
> not a complete solution:

Thanks!  Here's a version that deals with at least one of your caveats:

(defun ndk/checkbox-list-complete ()
  (save-excursion
(org-back-to-heading t)
(when looking-at (concat 
  "^\\*+[ \t]+" 
  org-todo-regexp ;; first match group here
  "[ \t].*\\[" "\\(100%\\)\\|[0-9]+%" 
  "\\|" "\\([0-9]+\\)" "/" "\\([0-9]+\\)" "\\]")
  (if (or (match-string 2)
  (and (match-string 3)
   (equal (match-string 3) (match-string 4
  (org-todo 'done)
(org-todo 'todo)

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



Re: [O] Merge Properties into Template

2011-10-06 Thread Christian Moe

Hi,

On 10/6/11 5:56 PM, Richard Parsons wrote:
(...)

Firstly, thank you so much for taking the time to write some code,
which (even as a newbie) I was able to get running quickly and easily.


My pleasure. I'm finding my legs in elisp myself, and I often find a 
better solution to a problem I've been grappling with when I think 
about someone else's request. So it was in this case -- I had worked 
on an insanely complicated mail-merge setup, your post made me realize 
it could be done more simply.



Of practical benefit to me would be either: (a) make a new Org entry
and file it (as you suggest) or (b) simply put it in the kill ring, so
that I can yank it wherever I want.


I enclose a new version (below) that does (b), add to the kill ring.

We could also do (a), make an entry and refile it, but if this is what 
you want to do, I'd be more interested in looking into ways to do it 
with org-capture and avoid reinventing the wheel -- even if setting up 
org-capture templates is a little more involved than what you had in mind.



Again, thanks so much for your help, and also the other replies I
received.  I'm very impressed by the org-mode community responding so
quickly to my question.


Pass it forward!

Yours,
Christian



#+begin_src emacs-lisp
  (defun cm/org-merge (target)
"Fill a template headlined TARGET with the properties of the
  entry at point, replacing e.g. `[AGE]' with the contents of
  an :AGE: property. Use `[HEADLINE]' for the text of the entry
  heading."
(interactive "sTarget template: ")
(let ((props (org-entry-properties))
  prop
  template)
  (setq props (cons (cons "HEADLINE" (org-get-heading)) props))
  (save-excursion
(org-open-link-from-string (format "[[*%s]]" target) t)
(setq template (org-get-entry)))
  (dolist (p props)
(setq template
  (replace-regexp-in-string
   (format "\\[%s\\]" (car p))
   (cdr p)
   template t)))
  (kill-new template)
  (message template)))
#+end_src



Re: [O] feature suggestion: apply datetime prompt magic to selected region

2011-10-06 Thread Achim Gratz
Brian van den Broek  writes:
> It wouldn't stun me were orgmode already able to do what I have in
> mind, but trying it and consulting the fine manual didn't suggest that
> it does.
[snip]

I'm not exactly sure what you are trying to achieve, but it seems that
you could define a keyboard macro for that?


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Factory and User Sound Singles for Waldorf Blofeld:
http://Synth.Stromeko.net/Downloads.html#WaldorfSounds




[O] Bug: org-clock-marker dangling [7.7 (release_7.7.396.g25c21)]

2011-10-06 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 tried to reproduce this problem with an emacs -Q and couldn't, so I
don't know how much you can do with this, but here's the info anyway:

at the following line in `org-clock-out-if-current' I was getting an
error because `org-clock-marker' had the value `#'.

 (< (point) org-clock-marker)

I was changing from STARTED to DONE on an item that I was surprised to
see marked STARTED.  I don't remember clocking in on that item,
especially not in this emacs session.  I'd have expected it to be in
TODO.  I don't know under what circumstances org-clock-marker is likely
to dangle this way, but it seems like org ought to be more robust
against this scenario, since I managed to hit it.

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.396.g25c21)

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
   
"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
 

   (quote





 
("~/Documents/Tasks/todo.txt")





 )

[O] feature suggestion: apply datetime prompt magic to selected region

2011-10-06 Thread Brian van den Broek
Hi all,

It wouldn't stun me were orgmode already able to do what I have in
mind, but trying it and consulting the fine manual didn't suggest that
it does.

I very much appreciate orgmode's ability to parse the content of a
yank for date and time information while entering a timestamp. I think
it would be even cooler were orgmode able to parse the content of a
selected region and extract the same information, replacing the region
with the timestamp created on the basis of the text in the region.

It certainly is true that one can select the region, kill it, invoke
the datetime prompt, and then yank to achieve the same effect.
However, having just done that more than 50 times in a row with a
series of dates copied from a webpage, it has occurred to me that the
ability to move directly from a selected region to a datetime prompt
while skipping the kill and yank steps would have saved more than a
hundred key-chords.

Not revolutionary, and surely not a high priority, but I thought I'd
throw the idea out there in case any of the developers think it worth
the time to implement. If not, no biggie.

Thanks and best,

Brian vdB



[O] Bug: Error while exporting with LaTeX code block [7.7]

2011-10-06 Thread Truong Nghiem
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 created the following simple org file, with a code block in it:
 BEGIN 
This is a test.

#+BEGIN_SRC latex :exports none
\newcommand{\test}{Test}
#+END_SRC
 END 

Then exported it to LaTeX and had an error (backtrace attached).  The
error always happened regardless of the value of :exports.

Emacs  : GNU Emacs 23.3.50.1 (i386-apple-darwin9.8.0, NS
apple-appkit-949.54)
 of 2011-07-29 on braeburn.aquamacs.org - Aquamacs Distribution 2.3a
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-blocker-hook '(org-block-todo-from-children-or-siblings-or-parent)
 org-babel-load-languages '((R) (ditaa . t) (dot . t) (emacs-lisp . t)
(gnuplot . t) (haskell) (latex . t) (matlab . t)
(ocaml) (python . t) (ruby) (screen) (sh . t) (sql)
(sqlite))
 org-completion-use-ido t
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-babel-tangle-lang-exts '(("python" . "py") ("latex" . "tex")
  ("emacs-lisp" . "el"))
 org-export-blocks-postblock-hook '(org-exp-res/src-name-cleanup)
 org-export-latex-format-toc-function 'org-export-latex-format-toc-default
 org-support-shift-select t
 org-export-preprocess-hook '((lambda nil
   (org-set-local (quote org-complex-heading-regexp)
"^\\(\\*+\\)[
 
]+\\(?:\\(TODO\\|NEXT\\|STARTED\\|DONE\\|WAITING\\|CANCELLED\\|DEFERRED\\|PROJECT\\|FINISHED\\)\\>\\)?\\(?:[
]*\\(\\[#.\\]\\)\\)?[ ]*\\(.*?\\)\\(?:[
 ]+\\(:[[:alnum:]_@#%:]+:\\)\\)?[ ]*$")
   )
  )
 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-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 '((lambda nil
  (org-add-hook (quote change-major-mode-hook)
   (quote org-babel-show-result-all) (quote append) (quote local))
  )
 (lambda nil
  (org-add-hook (quote change-major-mode-hook)
   (quote org-show-block-all) (quote append) (quote local))
  )
 #[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
 (lambda nil (auto-fill-mode 1)))
 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-refile-use-outline-path 'file
 org-export-interblocks '((lob org-babel-exp-lob-one-liners)
  (src org-babel-exp-inline-src-blocks))
 org-enforce-todo-dependencies t
 org-agenda-skip-deadline-if-done t
 org-refile-allow-creating-parent-nodes 'confirm
 org-insert-mode-line-in-empty-file t
 org-occur-hook '(org-first-headline-recenter)
 org-export-preprocess-before-selecting-backend-code-hook
'(org-beamer-select-beamer-code)
 org-agenda-todo-ignore-deadlines t
 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))
 )
Debugger entered--Lisp error: (args-out-of-range "" -1 0)
  substring("" -1)
  (string= "\n" (substring body sub-length))
  (if (string= "\n" (substring body sub-length)) (substring body 0 sub-length) 
body)
  (let* ((body ...) (sub-length ...)) (if (string= "\n" ...) (substring body 0 
sub-length) body))
  (org-babel-clean-text-properties (let* (... ...) (if ... ... body)))
  (let* ((block-indentation ...) (lang ...) (lang-headers ...) (switches ...) 
(body ...) (p

Re: [O] Merge Properties into Template

2011-10-06 Thread Richard Parsons
Hi Christian

On Thu, Oct 6, 2011 at 1:50 PM, Christian Moe  wrote:
> Org doesn't already have a particular way to do this, I think, so a little
> elisp is called for. It's fairly easy with the Org Properties API.

Firstly, thank you so much for taking the time to write some code,
which (even as a newbie) I was able to get running quickly and easily.

> Here's a modest example that will work with your sample document:
..
> Evaluate this code. Then place point in the Fido entry, do `M-x
> cm/org-merge', and type `Dog Template' at the prompt.
>
> To improve on that, how do you want to use it?

My actual use case is that I want to merge data about letters and
phone calls into documents for printing with TeX.

> Once Fido's data are merged with the template, what do you want to do with
> the results? Mail them to someone? Export them to HTML? Make a new Org entry
> with the contents and file it somewhere?

Of practical benefit to me would be either: (a) make a new Org entry
and file it (as you suggest) or (b) simply put it in the kill ring, so
that I can yank it wherever I want.

Again, thanks so much for your help, and also the other replies I
received.  I'm very impressed by the org-mode community responding so
quickly to my question.

Richard



[O] How to suppress refile logging only for refiling from capture templates?

2011-10-06 Thread Brian van den Broek
Hi all,

I've been looking through the manual and have tried a few things that
might have worked, but I've not been able to accomplish my desire.

Is there any way to both in general log refiles and to suppress such
logging when refiling via use of a capture template?

I find the refile option from within the capture buffer most handy and
do in general want to log refiling events. But, in a real sense, when
refiling from the capture buffer, the item hasn't really come into
existence yet and so "refiling" it seems more like an initial filing.
(I am aware that the item does occur in an org prior to refiling, but
that seems like an implementation detail.) I am ending up with
everything refiled from captures having refile logging and this makes
for a lot of noise when I am trying to focus on genuinely refiled
items.

Thanks and best,

Brian vdB



[O] Option to keep drawers closed on org-agenda-show-and-scroll-up?

2011-10-06 Thread Edward DeMeulle
Is there an option that prevents all the drawers from opening when using
org-agenda-show-and-scroll-up (spacebar on Agenda view)? With all the
logged items I think I might prefer to have at least the option to keep
the drawers closed when using this option for a quick preview.

-ED-




Re: [O] [ANN] Org Mode parser v0.0.1 for NodeJs

2011-10-06 Thread Eric Schulte
This is great.

We should start a page on Worg with links to external tools for
manipulating Org-mode files.  Such a page could point to this
implementation as well as the python, ruby org libraries and maybe even
the Vim clone of Org-mode.

Thanks for sharing! -- Eric

Giovanni Giorgi  writes:

> Hi all,
>  I have just published my org-mode parser for the node-js javascript based 
> server:
>
> http://gioorgi.com/org-mode-parser/
>
> It is a Javascript parser for the Emacs Org-mode file format.
>
> I use org-mode as a database for some programs (like games) where I
> need to mix meta information to a bunch of long textual data.
>
> I wrote it because I was unable to find an implementation for my needs.
>
> I like too much org-mode to let nodejs without a parser, and as
> expected the simple org-mode format was easy to parse.
> I started from the Charles Cave's OrgNode python parser, but I need to
> modify it a lot because of JavaScript different nature.
>
> Please feel free to give me your feedback
>
> ---
> Gio's Blog http://gioorgi.com

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



Re: [O] [BABEL][PATCH] construct a table from the output of maxima code block

2011-10-06 Thread Eric Schulte
Sergey Litvinov  writes:

>> In any case, can you please post a patch against the standard
>> version?  Or, maybe easier, simply post ob-maxima.el as the other
>> changes are not necessary for me to test your patch.
>
> I though my previous patch was applied. It is still under review due to
> copyright papers.  I am attaching a patch against master branch and
> ob-maxima.el file.
>
> The commit message is
> ob-maxima.el: add input variables, png graphic
> output, table as an output
>

Yes, there are a number of very nice patches from Sergey which are still
in holding pending completion of the FSF copyright papers.  See [1] for
a list of pending patches -- the relevant ones are tagged "under
review".

Best -- Eric

>
>


Footnotes: 
[1]  http://patchwork.newartisans.com/project/org-mode/list/

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



Re: [O] [PATCH][babel] add a string input to ob-octave

2011-10-06 Thread Eric Schulte
Fantastic,

I will apply this as soon as your FSF attribution goes through.
Speaking of has there been any progress on that front?

Thanks -- Eric

Litvinov Sergey  writes:

>> In other words, replacing (or var "nil") with var would be enough
>
> Thanks. Fixed in the patch below. The patch also adds an ert test.
>
> From b4b679abdc7bec9f3033b50f81d567a0bb48b147 Mon Sep 17 00:00:00 2001
> From: Litvinov Sergey 
> Date: Sat, 1 Oct 2011 13:37:56 +0200
> Subject: [PATCH 2/2] Remove redundant condition check in ob-octave.el. Add a 
> test.
>
> ---
>  lisp/ob-octave.el   |4 ++--
>  testing/examples/ob-octave-test.org |6 --
>  testing/lisp/test-ob-octave.el  |6 ++
>  3 files changed, 12 insertions(+), 4 deletions(-)
>
> diff --git a/lisp/ob-octave.el b/lisp/ob-octave.el
> index cfc1f1d..f840739 100644
> --- a/lisp/ob-octave.el
> +++ b/lisp/ob-octave.el
> @@ -119,9 +119,9 @@ specifying a variable of the same value."
>(if (listp (car var)) "; " ",")) "]")
>  (cond
>   ((stringp var)
> -  (format "\'%s\'" (or var "nil")))
> +  (format "\'%s\'" var))
>   (t
> -  (format "%s" (or var "nil"))
> +  (format "%s" var)
>  
>  (defun org-babel-prep-session:octave (session params &optional matlabp)
>"Prepare SESSION according to the header arguments specified in PARAMS."
> diff --git a/testing/examples/ob-octave-test.org 
> b/testing/examples/ob-octave-test.org
> index 37cf3f9..97d9b00 100644
> --- a/testing/examples/ob-octave-test.org
> +++ b/testing/examples/ob-octave-test.org
> @@ -24,7 +24,6 @@ Input an integer variable
>  ans = s
>  #+end_src
>  
> -
>  Input an array
>  #+begin_src octave :exports results :results silent :var s='(1.0 2.0 3.0)
>  ans = s
> @@ -40,4 +39,7 @@ Input a string
>  ans = s(1:2)
>  #+end_src
>  
> -
> +Input elisp nil
> +#+begin_src octave :exports results :results silent :var s='nil
> +ans = s
> +#+end_src
> diff --git a/testing/lisp/test-ob-octave.el b/testing/lisp/test-ob-octave.el
> index f3972ec..145266d 100644
> --- a/testing/lisp/test-ob-octave.el
> +++ b/testing/lisp/test-ob-octave.el
> @@ -53,3 +53,9 @@
>  (org-babel-next-src-block 4)
>  (should (equal "te" (org-babel-execute-src-block)
>  
> +(ert-deftest ob-octave/input-nil ()
> +  "Input elisp nil"
> +  (org-test-at-id "cc2d82bb-2ac0-45be-a0c8-d1463b86a3ba"
> +(org-babel-next-src-block 5)
> +(should (equal nil (org-babel-execute-src-block)
> +

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



Re: [O] org-contacts: how to manage contacts; structure of meta data

2011-10-06 Thread Thorsten
Wes Hardaker  writes:

> FYI, the emacs package you're looking for with similar functionality is
> "rebox2" ( http://www.emacswiki.org/emacs/rebox2 )

I knew - or at least expected - that there must be something like
that. Thanks for the link.
-- 
Thorsten




Re: [O] Registration for Worg commit access

2011-10-06 Thread Jason Dunsmore
Martyn Jago  writes:

> Hi
>
> Would it be possible for someone to provide we with commit access to
> Worg?

Hi Martyn,

Here are the instructions for contributing to Worg:
http://orgmode.org/worg/worg-git.html#contribute-to-worg

Did you email Matt?

Regards,
Jason



[O] bad link on website

2011-10-06 Thread Brian van den Broek
Hi all,

The page  contains the text
   Links below point to the development version of the manual.
   If you want to read the latest released manuals (currently for
   Org 7.7), please browse this directory.
where "this directory" is a hyperlink to
.

Following that link yields a 404 Not Found.

Thanks and best,

Brian vdB



[O] Table formula not returning an error

2011-10-06 Thread Sebastien Vauban
Hello,

I was surprised by how 10 minutes was converted to 0.02 hour in a table:

| Tâche  | HH:MM | Frac |
|+---+--|
| Avril 2011 | 0:1O  | 0.02 |
|+---+--|
||   | 0.02 |
#+TBLFM: $3='(/ (float (org-hh:mm-string-to-minutes $2)) 
60.);%.2f::@3$3=vsum(@-I..@-II)

I took me less than 2 minutes to discover the problem -- wanna play the
"1 diff game" (in the table itself, not in the formula)? -- and fix it:

| Tâche  | HH:MM | Frac |
|+---+--|
| Avril 2011 |  0:10 | 0.17 |
|+---+--|
||   | 0.17 |
#+TBLFM: $3='(/ (float (org-hh:mm-string-to-minutes $2)) 
60.);%.2f::@3$3=vsum(@-I..@-II)

But I'm surprised I did not see any error reported.

Best regards,
  Seb

-- 
Sebastien Vauban




Re: [O] org-contacts: how to manage contacts; structure of meta data

2011-10-06 Thread Wes Hardaker
> On Thu, 6 Oct 2011 11:38:26 +0200, Karl Voit  said:

KV> yasnippet is superior to org-capture and it is not :-)

Well summarized :-).  The right tool for the right job definitely
matters here.

>> [how do you produce this nice insertions in your email?]

KV> As an Emacs user, you might not be delighted with my answer: I am
KV> using mutt[3] as MUA[4]. There I can choose my editor freely. For
KV> this purpose I am using vim 7.1. In vim I can use «boxes»[5]:

FYI, the emacs package you're looking for with similar functionality is
"rebox2" ( http://www.emacswiki.org/emacs/rebox2 )
-- 
Wes Hardaker 
My Pictures:  http://capturedonearth.com/
My Thoughts:  http://pontifications.hardakers.net/



Re: [O] Org-agenda-custom-commands, restrict Agenda to file/files?

2011-10-06 Thread suvayu ali
2011/10/6 Gustav Wikström :
> I want to simplify this with a custom-command. And here comes my problem,
> what is the option to restrict the agenda to a certain file? Changing the
> org-agenda-files list does not seem to make a difference when using a custom
> agenda.

Something like this should work. The variable list below is like a let binding.

("" "Some custom command"  "..."
 ((org-agenda-files (list "file1" "file2"))
  ()))

HTH

-- 
Suvayu

Open source is the future. It sets us free.



[O] Org-agenda-custom-commands, restrict Agenda to file/files?

2011-10-06 Thread Gustav Wikström
Hello!

I'm currently using the feature to restrict the org-agenda (C-a a) to a
certain file and then enable the log-mode. I do this to view all my clocked
time in that file. Currently this means opening the file and then open the
agenda with "C-a < a l"

I want to simplify this with a custom-command. And here comes my problem,
what is the option to restrict the agenda to a certain file? Changing the
org-agenda-files list does not seem to make a difference when using a custom
agenda.

It works for other custom agenda commands (see
http://orgmode.org/worg/org-tutorials/org-custom-agenda-commands.html#sec-4),
and it works interactively but I cannot get it to work with an agenda
command inside org-agenda-custom-commands.. Can someone enlighten me on this
subject?

Kind regards
Gustav


Re: [O] org-contacts: how to manage contacts; structure of meta data

2011-10-06 Thread Thorsten
Karl Voit  writes:

> yasnippet is superior to org-capture and it is not :-)

So considering both and choosing the most suited for the problem might
be a good idea. 

> As an Emacs user, you might not be delighted with my answer: I am
> using mutt[3] as MUA[4]. There I can choose my editor freely. For
> this purpose I am using vim 7.1. 

Uhhh ... I shouldn't have asked ;)

> But I also used to use Emacs for mail composing years ago and I do
> recall a similar method there.

I'm sure there are, since I have seen some elaborated emails here, but
I'm not sure where to look for them. In the Gnus and the Message manuals
I did not find anything related so far. 

Cheers
-- 
Thorsten




[O] feature suggestion: apply datetime prompt magic to selected region

2011-10-06 Thread Brian van den Broek
Hi all,

[Apologies to the mods and to all if this goes through twice;
I sent from the wrong gmail tab :-[ ]

It wouldn't stun me were orgmode already able to do what I have in
mind, but trying it and consulting the fine manual didn't suggest that
it does.

I very much appreciate orgmode's ability to parse the content of a
yank for date and time information while entering a timestamp. I think
it would be even cooler were orgmode able to parse the content of a
selected region and extract the same information, replacing the region
with the timestamp created on the basis of the text in the region.

It certainly is true that one can select the region, kill it, invoke
the datetime prompt, and then yank to achieve the same effect.
However, having just done that more than 50 times in a row with a
series of dates copied from a webpage, it has occurred to me that the
ability to move directly from a selected region to a datetime prompt
while skipping the kill and yank steps would have saved more than a
hundred key-chords.

Not revolutionary, and surely not a high priority, but I thought I'd
throw the idea out there in case any of the developers think it worth
the time to implement. If not, no biggie.

Thanks and best,

Brian vdB



Re: [O] Merge Properties into Template

2011-10-06 Thread Christian Moe

Hi,

Org doesn't already have a particular way to do this, I think, so a 
little elisp is called for. It's fairly easy with the Org Properties API.


Here's a modest example that will work with your sample document:

#+begin_src emacs-lisp
  (defun cm/org-merge (target)
"Fill a template headlined TARGET with the properties of the
  entry at point, replacing e.g. `[AGE]' with the contents of
  an :AGE: property. Use `[HEADLINE]' for the text of the entry
  heading."
(interactive "sTarget template: ")
(let ((props (org-entry-properties))
  prop
  template)
  (setq props (cons (cons "HEADLINE" (org-get-heading)) props))
  (save-excursion
(org-open-link-from-string (format "[[*%s]]" target))
(setq template (org-get-entry)))
  (dolist (p props)
(setq template
  (replace-regexp-in-string
   (format "\\[%s\\]" (car p))
   (cdr p)
   template t)))
  (message template)))
#+end_src

Evaluate this code. Then place point in the Fido entry, do `M-x 
cm/org-merge', and type `Dog Template' at the prompt.


To improve on that, how do you want to use it?
Once Fido's data are merged with the template, what do you want to do 
with the results? Mail them to someone? Export them to HTML? Make a 
new Org entry with the contents and file it somewhere?


Yours,
Christian




On 10/6/11 11:35 AM, Richard Parsons wrote:

Hi all

I'm new to emacs and I'm new to org-mode, apologies if I should have
found this myself, but I have searched and come up blank.

I have a node with properties and I would like to merge that data into
a template.  For example:

* Dogs
** Fido
   :PROPERTIES:
   :BREED:West Highland Terrier
   :COLOR:White
   :AGE:  2
   :END:
* Templates
** Dog Template
Your dog, called [HEADLINE], is a [COLOR] [BREED], who is [AGE] years old.

I want to merge the item called "Fido" into the template called "Dog Template".

Could someone point me to the right bit of the manual so I can learn
how to do this?  Or should I be looking to use a different elisp
module to achieve this, something that plays nicely with org-mode?

Many thanks
Richard







Re: [O] Merge Properties into Template

2011-10-06 Thread suvayu ali
On Thu, Oct 6, 2011 at 11:35 AM, Richard Parsons
 wrote:
> Could someone point me to the right bit of the manual so I can learn
> how to do this?

Maybe some custom lisp function using the property API will do the job?



-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] Appointment reminders in Orgmode

2011-10-06 Thread Nick Dokos
Angel de Vicente  wrote:

> Hi,
> 
> Carsten Dominik  writes:
> > I'd say this is clearly within the minimum self-search effort
> > expected before asking on the list, don't you agree?
> 
> indeed. Shame on me...
> 
> I had looked in the org manual (texinfo) for the word appointment but
> didn't find anything (but that's also my fault, since apparently I
> looked only in the headlines and not in the whole manual... need to get
> a coffee, I think).

There are also a couple of pointers on Worg (http://orgmode.org/worg),
in the FAQ iirc.

Nick




Re: [O] Merge Properties into Template; [babel]

2011-10-06 Thread Giovanni Ridolfi
Richard Parsons  writes:

 Hi Richard,
>
> I have a node with properties and I would like to merge that data into
> a template.  For example:
>
> * Dogs
> ** Fido
>   :PROPERTIES:
>   :BREED:West Highland Terrier
>   :COLOR:White
>   :AGE:  2
>   :END:
> * Templates
> ** Dog Template
> Your dog, called [HEADLINE], is a [COLOR] [BREED], who is [AGE] years old.
>
> I want to merge the item called "Fido" into the template called "Dog 
> Template".
>
> Could someone point me to the right bit of the manual 

I think that the only way to extract the information of a property,
in org, is column view.[1]

However you may be able to use something like perl or awk to extract the info
and babel to use in the org file.

I'm a babel ignorant. CCed Eric Schulte for help ;-)

hth,
Giovanni

[1] But you'll end with this:
* DOGS
** Fido 
  :PROPERTIES:
  :ID: dog 
  :COLUMNS: %dog %ITEM %is %BREED %whos %AGE %old
  :dog: Your dog, called
  :is: , is a
  :BREED:West Highland Terrier
  :COLOR:White
  :whos: , who is
  :AGE:  2
  :old: years old.
  :END:
** Templates
*** Dog Template
Your dog, called [HEADLINE], is a [COLOR] [BREED], who is [AGE] years old.
*** Dog column
#+BEGIN: columnview :hlines 1 :id dog
| dog  | ITEM| is | BREED | whos | AGE 
| old|
|--+-++---+--+-+|
| Your dog, called | ** Fido | , is a | West Highland Terrier | , who is |   2 
| years old. |
#+END





Re: [O] Org-special-blogs does not make well-formed xhtml

2011-10-06 Thread Christian Moe

Hi, Carsten,

I've submitted a patch separately. It seems to play nice with the 
enclosed test file.


If org-special-blocks is supposed to become part of the core (it's 
moved out of contrib, but we still have to require it), it might make 
sense to just move the html and latex formatting code into org-html.el 
and org-latex.el respectively, together with the handling of 
blockquotes, verses, centering etc.


Yours,
Christian

On 10/4/11 11:33 PM, Carsten Dominik wrote:

Hi Christian,

for now I have reverted the patch.  WOuld you like to work on a better one?

- Carsten

On 4.10.2011, at 21:01, Christian Moe wrote:


Hi,

Carsten, thanks.

Jambunathan's probably right, though, that this fix (while necessary) is 
incomplete. Sorry, I hadn't thought it through.

Now, when the first paragraph of a special block comes right after the #+BEGIN_WHATEVER line, it 
will just come as the first text node of the  block, and will not be wrapped in 
a  element. So among other things, any special CSS styling fors will not be 
applied to it.

It's not a big deal -- if you need a  (and often you really don't) the 
workaround is as simple as leaving an empty line between #+BEGIN_WHATEVER and the 
first paragraph.

But I guess it would be more consistent/expected/helpful behavior for special-blocks 
to start a new paragraph -- this time *after* the opening  tag and not 
around it!

Yours,
Christian


On 10/4/11 4:36 PM, Jambunathan K wrote:


Carsten Dominik   writes:

I see no reason to not uncomment this line.  Shall we just do this?


Shouldn't a paragraph be opened/closed while entering/leaving the div.

, See org-xhtml-format-environment
| (center
|  (case beg-end
|(BEGIN
|   (org-lparse-end-paragraph)
|   (insert "\n")
|   (org-lparse-begin-paragraph))
|(END
|   (org-lparse-end-paragraph)
|   (insert "\n")
|   (org-lparse-begin-paragraph
`

We can always open a paragraph gratis, because empty paragraphs are
pruned at the end of export.






#+style: 

Re: [O] PATCH Make org-open-at-point only ask once

2011-10-06 Thread Carsten Dominik

On Oct 6, 2011, at 11:51 AM, Anders Waldenborg wrote:

> For the record, I'm below the limit of a cumulative change of 20
> non-repetitive change lines.


Yes, I have marked the change as TINYCHANGE

- Carsten

> 
> On Thu, Oct 06, 2011 at 10:54:10AM +0200, Carsten Dominik wrote:
>> OK, I have accepted the patch.  Thanks
>> 
>> - Carsten
>> 
>> On Oct 6, 2011, at 10:43 AM, Anders Waldenborg wrote:
>> 
>>> On Thu, Oct 06, 2011 at 10:00:38AM +0200, Carsten Dominik wrote:
 Hi Anders, Nicolas
 
 I am wondering what the status of this patch is.  There was a discussion, 
 but I am not sure about the conclusion...
>>> 
>>> 
>>> Carsten,
>>> 
>>> I think that the simple patch still is valid, I'm including it again
>>> below.
>>> 
>>> The discussion was about my more intrusive alternative patch, and how
>>> links change their meaning depending on if the buffer is narrowed or
>>> not. I did start to hack up a alternative link resolver as a proof of
>>> concept to be able to better understand how links should work in case
>>> there are multiple targets, but unfortunately I got busy with other
>>> things.
>>> 
>>> anders
>>> 
>>> --
>>> 
>>> commit 54702f063ae2df48dec7f9feb80859a6b64002a4
>>> Author: Anders Waldenborg 
>>> Date:   Sat Aug 27 21:18:46 2011 +0200
>>> 
>>>   Make org-open-at-point only ask once whether new header should be created.
>>> 
>>>   When following "thisfile" links org-open-at-point is kind enough to
>>>   retry org-link-search again after widening the buffer it can't be
>>>   found. However org-link-search also asks the question "No match -
>>>   create this as a new heading? (y or n)" when target can't be
>>>   found. This means that the question is asked twice when following a
>>>   nonexistent link and answering no.
>>> 
>>>   This is fixed by setting org-link-search-inhibit-query in first try,
>>>   so only second invocation asks the question.
>>> 
>>> diff --git a/lisp/org.el b/lisp/org.el
>>> index d63b854..781de88 100644
>>> --- a/lisp/org.el
>>> +++ b/lisp/org.el
>>> @@ -9537,7 +9537,8 @@ application the system uses for this file type."
>>>   ((equal arg '(16)) ''org-occur)
>>>   (t nil))
>>>,pos)))
>>> -   (condition-case nil (eval cmd)
>>> +   (condition-case nil (let ((org-link-search-inhibit-query t))
>>> + (eval cmd))
>>>   (error (progn (widen) (eval cmd))
>>> 
>>>  (t
>> 
>> - Carsten
>> 
>> 
>> 
>> 
> 
> -- 

- Carsten






Re: [O] PATCH Make org-open-at-point only ask once

2011-10-06 Thread Anders Waldenborg
For the record, I'm below the limit of a cumulative change of 20
non-repetitive change lines.

On Thu, Oct 06, 2011 at 10:54:10AM +0200, Carsten Dominik wrote:
> OK, I have accepted the patch.  Thanks
> 
> - Carsten
> 
> On Oct 6, 2011, at 10:43 AM, Anders Waldenborg wrote:
> 
> > On Thu, Oct 06, 2011 at 10:00:38AM +0200, Carsten Dominik wrote:
> >> Hi Anders, Nicolas
> >> 
> >> I am wondering what the status of this patch is.  There was a discussion, 
> >> but I am not sure about the conclusion...
> > 
> > 
> > Carsten,
> > 
> > I think that the simple patch still is valid, I'm including it again
> > below.
> > 
> > The discussion was about my more intrusive alternative patch, and how
> > links change their meaning depending on if the buffer is narrowed or
> > not. I did start to hack up a alternative link resolver as a proof of
> > concept to be able to better understand how links should work in case
> > there are multiple targets, but unfortunately I got busy with other
> > things.
> > 
> > anders
> > 
> > --
> > 
> > commit 54702f063ae2df48dec7f9feb80859a6b64002a4
> > Author: Anders Waldenborg 
> > Date:   Sat Aug 27 21:18:46 2011 +0200
> > 
> >Make org-open-at-point only ask once whether new header should be 
> > created.
> > 
> >When following "thisfile" links org-open-at-point is kind enough to
> >retry org-link-search again after widening the buffer it can't be
> >found. However org-link-search also asks the question "No match -
> >create this as a new heading? (y or n)" when target can't be
> >found. This means that the question is asked twice when following a
> >nonexistent link and answering no.
> > 
> >This is fixed by setting org-link-search-inhibit-query in first try,
> >so only second invocation asks the question.
> > 
> > diff --git a/lisp/org.el b/lisp/org.el
> > index d63b854..781de88 100644
> > --- a/lisp/org.el
> > +++ b/lisp/org.el
> > @@ -9537,7 +9537,8 @@ application the system uses for this file type."
> >   ((equal arg '(16)) ''org-occur)
> >   (t nil))
> >,pos)))
> > -   (condition-case nil (eval cmd)
> > +   (condition-case nil (let ((org-link-search-inhibit-query t))
> > + (eval cmd))
> >   (error (progn (widen) (eval cmd))
> > 
> >  (t
> 
> - Carsten
> 
> 
> 
> 

-- 



[O] [PATCH] Special blocks: Make well-formed HTML

2011-10-06 Thread Christian Moe

* org-special-blocks.el
(org-special-blocks-convert-html-special-cookies): Close paragraph
before opening or closing the , and open paragraph after. Also
changed newline placement to be the same as for other blocks.

The problem was that special blocks did not produce well-formed HTML
because they  wrapped the opening and closing
 tags in  tags.

TINYCHANGE

This patch only borrows a few lines from the handling of `CENTER'
blocks in org-export-as-html.

---
 lisp/org-special-blocks.el |   22 +-
 1 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/lisp/org-special-blocks.el b/lisp/org-special-blocks.el
index 2da57f0..f4e6258 100644
--- a/lisp/org-special-blocks.el
+++ b/lisp/org-special-blocks.el
@@ -78,15 +78,19 @@ seen.  This is run after a few special cases are 
taken care of."


 (defvar line)
 (defun org-special-blocks-convert-html-special-cookies ()
-  "Converts the special cookies into div blocks."
-  ;; Uses the dynamically-bound variable `line'.
-  (when (string-match "^ORG-\\(.*\\)-\\(START\\|END\\)$" line)
-;(org-close-par-maybe)
-(message "%s" (match-string 1))
-(if (equal (match-string 2 line) "START")
-   (insert "\n")
-  (insert "\n"))
-(throw 'nextline nil)))
+"Converts the special cookies into div blocks."
+;; Uses the dynamically-bound variable `line'.
+(when (string-match "^ORG-\\(.*\\)-\\(START\\|END\\)$" line)
+  (message "%s" (match-string 1))
+  (when (equal (match-string 2 line) "START")
+(org-close-par-maybe)
+(insert "\n")
+(org-open-par))
+  (when (equal (match-string 2 line) "END")
+(org-close-par-maybe)
+(insert "\n")
+(org-open-par))
+  (throw 'nextline nil)))

 (add-hook 'org-export-html-after-blockquotes-hook
  'org-special-blocks-convert-html-special-cookies)
--
1.7.4.1




Re: [O] org-contacts: how to manage contacts; structure of meta data

2011-10-06 Thread Karl Voit
* Thorsten  wrote:
> Karl Voit  writes:
>
>> Without describing further attempts, I ended up with following
>> yasnippet[2] template for a new contact:
>
> Do you think that yasnippet is superior to org-capture or is it just a
> casuality that you prefered it to org-capture?

Oh, first I started with org-capture. One week later I started to
use yasnippet. I have to mention that I was using Emacs a decade ago
when I switched to vim. For Org-mode I returned to GNU Emacs. Now I
have to re-orienteer again what is available and how it works :-)

yasnippet is superior to org-capture and it is not :-)

What is missing with yasnippet is a quick capture method which
includes the destination for the new item.

What is great with yasnippet is, that you can define certain input
values that have to be entered. Those values can be re-used. So when
you take a look at my snippet, you recognize $1, $2, ...

And you recognize that $1 and $2 a re-used. I do have to enter $1
only once and it is inserted multiple times - depending on the
occurrence of $1 in the rest.

For the :TYPE: property I let yasnippet ask me, whether it is a
person or a company I am entering now. Handy.

>> ,
>> | # name : Org-contacts template for a person or a company
>> | # --
>> | ** $1 $2  :$1$2:
>> | :PROPERTIES:
>> | :TYPE: ${3:$$(yas/choose-value '("person" "company"))}
>> | :TITLE:
>> | :EMAIL: $4
>> | :URL:
>> | :MOBILE: 0043/
>> | :HOMEPHONE:
>> | :WORKPHONE:
>> | :PHONE:
>> | :COMPANY:
>> | :STREET:
>> | :POSTALCODE:
>> | :CITY:
>> | :COUNTRY: Österreich
>> | :END:
>> |
>> | first contact: $0
>> `
>
> Thats what I thought, that a single :ADDRESS: property is not very
> usefull or practical. 

You loose meta information and semantic description.

With my method you can generate sparse trees with people living in a
certain street, town or such things.

> So there is not something like a nested property,
> each piece of information needs its own property. 

I do think so. But I am new to Org-mode and might still miss certain
details.

> I think your list is pretty complete and usable. 

Thanks.

>> My current tags for contacts are defined in the header of my
>> contacts.org:
>>
>> ,[ first line of my contacts.org ]
>> | #+TAGS: job(j) friends(f) health(e) hotels(o) restaurants_bars(r) \
>> | sport(s) students_TU(t) relatives(r) company(c)
>> `
>
> [how do you produce this nice insertions in your email?]

As an Emacs user, you might not be delighted with my answer: I am
using mutt[3] as MUA[4]. There I can choose my editor freely. For
this purpose I am using vim 7.1. In vim I can use «boxes»[5]:

,[ a line from my .vimrc ]
| map ;1 :'<,'>!boxes -d boxquote
`

But I also used to use Emacs for mail composing years ago and I do
recall a similar method there.

> Thanks for your help

You're welcome!

  3. http://www.mutt.org/
  4. http://en.wikipedia.org/wiki/Mail_user_agent
  5. http://boxes.thomasjensen.com/
  6. As I recognize here, the vim referencing mechanism seem to be
 confused by the $1 and $2 from above and started with [3]. Cute.
-- 
Karl Voit




[O] Merge Properties into Template

2011-10-06 Thread Richard Parsons
Hi all

I'm new to emacs and I'm new to org-mode, apologies if I should have
found this myself, but I have searched and come up blank.

I have a node with properties and I would like to merge that data into
a template.  For example:

* Dogs
** Fido
  :PROPERTIES:
  :BREED:West Highland Terrier
  :COLOR:White
  :AGE:  2
  :END:
* Templates
** Dog Template
Your dog, called [HEADLINE], is a [COLOR] [BREED], who is [AGE] years old.

I want to merge the item called "Fido" into the template called "Dog Template".

Could someone point me to the right bit of the manual so I can learn
how to do this?  Or should I be looking to use a different elisp
module to achieve this, something that plays nicely with org-mode?

Many thanks
Richard



[O] Registration for Worg commit access

2011-10-06 Thread Martyn Jago
Hi

Would it be possible for someone to provide we with commit access to
Worg?

I'm adding and updating documentation for various testing activities.

I've registered with repo.org.cz and added my key

user name:  mjago

Best, Martyn




Re: [O] Bug: org-clone-subtree-with-time-shift shifts CREATED property of org-expiry.el

2011-10-06 Thread Karl Voit
* Bernt Hansen  wrote:
> Karl Voit  writes:
>
>> When an entry got processed by org-clone-subtree-with-time-shift,
>> its :CREATED: property gets shifted too:
>>
>> #+begin_example
>> * <2011-10-04 Tue> test
>> SCHEDULED: <2011-10-05 Wed>
>> :PROPERTIES:
>> :CREATED: <2011-10-04 Tue 17:27>
>> :END:
>> * <2011-10-11 Tue> test
>> SCHEDULED: <2011-10-12 Wed>
>> :PROPERTIES:
>> :CREATED: <2011-10-11 Tue 17:27>
>> :END:
>> #+end_example
>
> Where does this :CREATED: property come from?  The only code I can find
> is in contrib/lisp/org-expiry.el 

Yes, I am indeed using this package. To be honest, I have forgotten
that it is org-expiry.el which generates those :CREATED: properties.
But I do find it important to know, *when* an item was created.
Independently from any expiry functionality.

This is not only because I am doing
http://en.wikipedia.org/wiki/Lifelogging with
https://github.com/novoid/Memacs by the way.

> and since that isn't officially part of org-mode yet I don't know
> if it makes sense to have code in the cloning function to handle
> it.

Oh, I thought «contrib» is also «part of Org-mode» since it is in
the very same git repository. Thanks for clarification.

> Maybe (if there isn't already) the clone function could use some list of
> properties for special handling (ie drop this property, don't shift the
> date on that property, etc)
>
> If it can be generically handled then whatever code you include that
> adds functionality for the :CREATED: property can also update that list
> so it is handled in a sensible way.

I can think of different situations where such a mechanism would be
handy, yes. Is Bastien Guerry (creator of org-expiry.el) reading
here?

So for now I am afraid I have to either deactivate org-expiry.el or
remove any :CREATED: property before applying cloning.

-- 
Karl Voit




Re: [O] [PATCH] Bugfix for alignment of tag next to header name

2011-10-06 Thread Michael Brand
Hi Carsten

On Thu, Oct 6, 2011 at 09:45, Carsten Dominik 
> The patch looks good, but it did not show up on the patchwork server, 
> probably because you did attach it with the wrong mime type.  I have applied 
> it now, thanks.

Indeed: When attaching with the gmail web interface it seems that only
the file extension has an influence on the mime type. It uses
application/octet-stream for *.patch and text/plain for *.txt. For the
next patch I'll choose *.patch.txt when using the gmail web interface.

Michael



Re: [O] PATCH Make org-open-at-point only ask once

2011-10-06 Thread Carsten Dominik
OK, I have accepted the patch.  Thanks

- Carsten

On Oct 6, 2011, at 10:43 AM, Anders Waldenborg wrote:

> On Thu, Oct 06, 2011 at 10:00:38AM +0200, Carsten Dominik wrote:
>> Hi Anders, Nicolas
>> 
>> I am wondering what the status of this patch is.  There was a discussion, 
>> but I am not sure about the conclusion...
> 
> 
> Carsten,
> 
> I think that the simple patch still is valid, I'm including it again
> below.
> 
> The discussion was about my more intrusive alternative patch, and how
> links change their meaning depending on if the buffer is narrowed or
> not. I did start to hack up a alternative link resolver as a proof of
> concept to be able to better understand how links should work in case
> there are multiple targets, but unfortunately I got busy with other
> things.
> 
> anders
> 
> --
> 
> commit 54702f063ae2df48dec7f9feb80859a6b64002a4
> Author: Anders Waldenborg 
> Date:   Sat Aug 27 21:18:46 2011 +0200
> 
>Make org-open-at-point only ask once whether new header should be created.
> 
>When following "thisfile" links org-open-at-point is kind enough to
>retry org-link-search again after widening the buffer it can't be
>found. However org-link-search also asks the question "No match -
>create this as a new heading? (y or n)" when target can't be
>found. This means that the question is asked twice when following a
>nonexistent link and answering no.
> 
>This is fixed by setting org-link-search-inhibit-query in first try,
>so only second invocation asks the question.
> 
> diff --git a/lisp/org.el b/lisp/org.el
> index d63b854..781de88 100644
> --- a/lisp/org.el
> +++ b/lisp/org.el
> @@ -9537,7 +9537,8 @@ application the system uses for this file type."
> ((equal arg '(16)) ''org-occur)
> (t nil))
>  ,pos)))
> - (condition-case nil (eval cmd)
> + (condition-case nil (let ((org-link-search-inhibit-query t))
> +   (eval cmd))
> (error (progn (widen) (eval cmd))
> 
>(t

- Carsten






Re: [O] Appointment reminders in Orgmode

2011-10-06 Thread Angel de Vicente
Hi,

Carsten Dominik  writes:
> I'd say this is clearly within the minimum self-search effort
> expected before asking on the list, don't you agree?

indeed. Shame on me...

I had looked in the org manual (texinfo) for the word appointment but
didn't find anything (but that's also my fault, since apparently I
looked only in the headlines and not in the whole manual... need to get
a coffee, I think).
-- 
Ángel de Vicente
http://angel-de-vicente.blogspot.com/




Re: [O] PATCH Make org-open-at-point only ask once

2011-10-06 Thread Anders Waldenborg
On Thu, Oct 06, 2011 at 10:00:38AM +0200, Carsten Dominik wrote:
> Hi Anders, Nicolas
> 
> I am wondering what the status of this patch is.  There was a discussion, but 
> I am not sure about the conclusion...


Carsten,

I think that the simple patch still is valid, I'm including it again
below.

The discussion was about my more intrusive alternative patch, and how
links change their meaning depending on if the buffer is narrowed or
not. I did start to hack up a alternative link resolver as a proof of
concept to be able to better understand how links should work in case
there are multiple targets, but unfortunately I got busy with other
things.

 anders

--

commit 54702f063ae2df48dec7f9feb80859a6b64002a4
Author: Anders Waldenborg 
Date:   Sat Aug 27 21:18:46 2011 +0200

Make org-open-at-point only ask once whether new header should be created.

When following "thisfile" links org-open-at-point is kind enough to
retry org-link-search again after widening the buffer it can't be
found. However org-link-search also asks the question "No match -
create this as a new heading? (y or n)" when target can't be
found. This means that the question is asked twice when following a
nonexistent link and answering no.

This is fixed by setting org-link-search-inhibit-query in first try,
so only second invocation asks the question.

diff --git a/lisp/org.el b/lisp/org.el
index d63b854..781de88 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -9537,7 +9537,8 @@ application the system uses for this file type."
  ((equal arg '(16)) ''org-occur)
  (t nil))
   ,pos)))
-   (condition-case nil (eval cmd)
+   (condition-case nil (let ((org-link-search-inhibit-query t))
+ (eval cmd))
  (error (progn (widen) (eval cmd))
 
 (t



Re: [O] Appointment reminders in Orgmode

2011-10-06 Thread Carsten Dominik
Hi Angel,

On Oct 6, 2011, at 10:35 AM, Angel de Vicente wrote:

> Hi,
> 
> I'm moving all my appointments to OrgMode, and I'm trying to find a way
> to get reminders of those appointments (something like the
> AppointmentMode http://www.emacswiki.org/emacs/AppointmentMode).
> 
> Is there something that can be made to work with Org?

Google search for

 org-mode appointment reminders

gives me as the first hit

 http://orgmode.org/manual/Weekly_002fdaily-agenda.html

Which contains this text:

> Appointment reminders
> 
> Org can interact with Emacs appointments notification facility. To add all 
> the appointments of your agenda files, use the command org-agenda-to-appt. 
> This command also lets you filter through the list of your appointments and 
> add only those belonging to a specific category or matching a regular 
> expression. See the docstring for details.

I'd say this is clearly within the minimum self-search effort
expected before asking on the list, don't you agree?

- Carsten




[O] Appointment reminders in Orgmode

2011-10-06 Thread Angel de Vicente
Hi,

I'm moving all my appointments to OrgMode, and I'm trying to find a way
to get reminders of those appointments (something like the
AppointmentMode http://www.emacswiki.org/emacs/AppointmentMode).

Is there something that can be made to work with Org?

Thanks,
-- 
Ángel de Vicente
http://angel-de-vicente.blogspot.com/




Re: [O] [PATCH 0/5] loop over headlines in active region

2011-10-06 Thread Carsten Dominik
Hi David,

I see that this patch is still on the patchwork server.
What is the status, I remember that you dot a number of
comments

- Carsten

On Aug 25, 2011, at 6:25 AM, David Maus wrote:

> Hi Bastien,
> 
>> Great -- can you submit a patch against current git head?
> 
> Following 5 patches implement looping over headlines in active region
> for org-schedule and org-deadline. Invisible headlines are skipped and
> bulk-agenda commands work by binding the customization variable to nil
> before executing a command.
> 
> I've been running with this modification for 2 weeks now, using the
> feature occassionally without a visibile problem.
> 
> As for the macro: What stop me to implement a macro for the generic
> operation is that for now the macro would depend on the global
> customization variable. That's not a problem per se but according to
> my readings about macros (mostly in context of Common Lisp, but that
> shouldn't matter) it should be considered bad style.
> 
> I did some experiments with defining an `org-map-entries' MATCH of
> 'current that causes FUNC to be applied to the current heading
> only, but I'm not sure if this would be a right thing (tm) to do.
> 
> Best,
>  -- David
> 
> David Maus (5):
>  Extend scope 'region to include body of last headline in active
>region
>  Immediately return if scope is region but no region is active
>  New customization variable: Loop over headlines in active region
>  Skip invisible headlines when mapping over headlines in active region
>  Avoid conflict between bulk command and loop-over-headlines
> 
> 

- Carsten






Re: [O] headline navigation and refiling.

2011-10-06 Thread Carsten Dominik

On Oct 6, 2011, at 10:28 AM, Carsten Dominik wrote:

> 
> On Oct 5, 2011, at 5:43 PM, Dave Abrahams wrote:
> 
>> 
>> on Wed Oct 05 2011, Le Wang  wrote:
>> 
>>> But doesn't the fact that a user didn't know he could navigate with
>>> org-refile speak laudly for refactoring it into its own key-stroke?
> 
> We already have that:
> 
> (setq org-goto-max-level 10)
> (setq org-goto-interface 'outline-path-completion)

Maybe you also want

(setq org-outline-path-complete-in-steps nil)

- Carsten

> 
> The use the key `C-c C-j'.
> 
> Right now this uses te outline-path-completion of refile,
> if you want the vanilla refile interface, I would have to make a few
> small changes.
> 
> - Carsten
> 
> 
> 

- Carsten






Re: [O] headline navigation and refiling.

2011-10-06 Thread Carsten Dominik

On Oct 5, 2011, at 5:43 PM, Dave Abrahams wrote:

> 
> on Wed Oct 05 2011, Le Wang  wrote:
> 
>> But doesn't the fact that a user didn't know he could navigate with
>> org-refile speak laudly for refactoring it into its own key-stroke?

We already have that:

(setq org-goto-max-level 10)
(setq org-goto-interface 'outline-path-completion)

The use the key `C-c C-j'.

Right now this uses te outline-path-completion of refile,
if you want the vanilla refile interface, I would have to make a few
small changes.

- Carsten






Re: [O] [PATCH]: New Add defun org-mode-or-derived-mode-p

2011-10-06 Thread Carsten Dominik

On Sep 5, 2011, at 9:36 AM, Tassilo Horn wrote:

> Stefan Reichör  writes:
> 
> Hi Stefan,
> 
 +(defun org-mode-or-derived-mode-p ()
 +  "Check if the current buffer is in Org-mode or a derived mode."
 +  (if (derived-mode-p 'org-mode) t nil))
>>> 
>>> The if is superfluous.  And instead of a new function, I'd rather add an
>>> optional `derived' parameter to `org-mode-p'.
>> 
>> (derived-mode-p 'org-mode) returns either 'org-mode or nil
>> 
>> The reason for the if is, that (org-mode-p) returns either t or nil
> 
> Yes, but from an elisp perspective, 'org-mode is as true as t.
> 
> BTW: I'm not sure if there is any reasonable benefit for `org-mode-p',
> anyway.  Checking the rest of the emacs source tree, then the convention
> is to either use
> 
>  (eq major-mode 'foo-mode)
> 
> or
> 
>  (derived-mode-p 'foo-mode)
> 
> depending on what's needed.  I don't see why (org-mode-p) or even
> (org-mode-p 'derived) is clearer...

I agree, it is not clearer, only a bit more compact.
I don't think we should have a new function here.  Just make a patch
that used derived-mode-p in places where this is needed.  I would
accept such a patch.

- Carsten




[O] [Accepted] contrib/lisp/org-elisp-symbol: Set type if symbol is defuned but not fbound

2011-10-06 Thread Carsten Dominik
Patch 962 (http://patchwork.newartisans.com/patch/962/) is now "Accepted".

Maintainer comment: none

This relates to the following submission:

http://mid.gmane.org/%3C8739fkpp7v.wl%25dmaus%40ictsoc.de%3E

Here is the original message containing the patch:

> Content-Type: text/plain; charset="utf-8"
> MIME-Version: 1.0
> Content-Transfer-Encoding: 7bit
> Subject: [O] contrib/lisp/org-elisp-symbol: Set type if symbol is defuned but
>   not fbound
> Date: Sun, 25 Sep 2011 21:21:40 -
> From: David Maus 
> X-Patchwork-Id: 962
> Message-Id: <8739fkpp7v.wl%dm...@ictsoc.de>
> To: emacs-orgmode@gnu.org
> Cc: b...@altern.org
> 
> Another small patch for org-elisp-symbol: Set the symbol type to
> "Function or command" if it is defuned but not fbound when
> `org-elisp-symbol-store-link' is called.
> 
> Best,
>   -- David
> 
> ---
> OpenPGP... 0x99ADB83B5A4478E6
> Jabber dmj...@jabber.org
> Email. dm...@ictsoc.de
> >From 09f5f322d418afe34503d8758ad123cd6c8045a0 Mon Sep 17 00:00:00 2001
> From: David Maus 
> Date: Sun, 25 Sep 2011 18:16:54 +0200
> Subject: [PATCH] Set symbol type if defun but symbol not fbound
> 
> * org-elisp-symbol.el (org-elisp-symbol-store-link): Set symbol type
> if defun but symbol not fbound.
> 
> If the symbol is not fbound but defuned, set type to "function or
> command".
> ---
>  contrib/lisp/org-elisp-symbol.el |1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/contrib/lisp/org-elisp-symbol.el 
> b/contrib/lisp/org-elisp-symbol.el
> index 6eb8114..340272b 100644
> --- a/contrib/lisp/org-elisp-symbol.el
> +++ b/contrib/lisp/org-elisp-symbol.el
> @@ -106,6 +106,7 @@
> ((user-variable-p sym-name) "User variable")
> ((string= def "defvar") "Variable")
> ((string= def "defmacro") "Macro")
> +   ((string= def "defun") "Function or command")
> (t "Symbol")))
>(args (if (match-string 3)
>  (mapconcat (lambda (a) (unless (string-match "^&" a) a))
> 



[O] [Accepted] Bug: org-refile-targets doesn't say whether it's AND or OR [7.7 (release_7.7.351.gb8b5)]

2011-10-06 Thread Carsten Dominik
Patch 965 (http://patchwork.newartisans.com/patch/965/) is now "Accepted".

Maintainer comment: none

This relates to the following submission:

http://mid.gmane.org/%3C3103.1317268754%40alphaville.dokosmarshall.org%3E

Here is the original message containing the patch:

> Content-Type: text/plain; charset="utf-8"
> MIME-Version: 1.0
> Content-Transfer-Encoding: 7bit
> Subject: [O] Bug: org-refile-targets doesn't say whether it's AND or OR [7.7
>   (release_7.7.351.gb8b5)]
> Date: Thu, 29 Sep 2011 08:59:14 -
> From: Nick Dokos 
> X-Patchwork-Id: 965
> Message-Id: <3103.1317268...@alphaville.dokosmarshall.org>
> To: Dave Abrahams 
> Cc: nicholas.do...@hp.com, emacs-orgmode@gnu.org
> 
> Dave Abrahams  wrote:
> 
> > I would change the doc for org-refile-targets to say that the resulting
> > list of targets is the union of all the targets matched by each cons
> > cell.  I think you could take that pretty much verbatim.
> > 
> 
> How's this?
> 
> Nick
> 
> ---
> >From f853b04fb474493b3b7b8857794c9f120c5f7822 Mon Sep 17 00:00:00 2001
> From: Nick Dokos 
> Date: Wed, 28 Sep 2011 23:49:13 -0400
> Subject: [PATCH] Amplify the doc for org-refile-targets
> 
> * lisp/org.el: (org-refile-targets) Elaborated the documentation of
>the variable as suggested by Dave Abrahams.
> 
> TINYCHANGE
> 
> ---
> lisp/org.el |6 +-
>  1 files changed, 5 insertions(+), 1 deletions(-)
> 
> diff --git a/lisp/org.el b/lisp/org.el
> index 945d759..68c6912 100644
> --- a/lisp/org.el
> +++ b/lisp/org.el
> @@ -1864,7 +1864,7 @@ (defcustom org-log-refile nil
>  
>  (defcustom org-refile-targets nil
>"Targets for refiling entries with \\[org-refile].
> -This is list of cons cells.  Each cell contains:
> +This is a list of cons cells.  Each cell contains:
>  - a specification of the files to be considered, either a list of files,
>or a symbol whose function or variable value will be used to retrieve
>a file name or a list of file names.  If you use `org-agenda-files' for
> @@ -1886,6 +1886,10 @@ (defcustom org-refile-targets nil
>  Note that, when `org-odd-levels-only' is set, level corresponds to
>  order in hierarchy, not to the number of stars.
>  
> +Each element of this list generates a set of possible targets.
> +The union of these sets is presented (with completion) to
> +the user by `org-refile'.
> +
>  You can set the variable `org-refile-target-verify-function' to a function
>  to verify each headline found by the simple criteria above.
>  
> 



Re: [O] org-exp-bibtex.el patch for zotero-generated citekeys

2011-10-06 Thread Carsten Dominik
This patch has now been accepted.

- Carsten

On Sep 12, 2011, at 10:26 PM, Nik Putnam wrote:

> Dear Taru and orgmode community,
> 
> Org-mode export to HTML is a really useful thing, and I love the
> bibtex integration.
> 
> I had a problem exporting from org-mode to HTML, with bibtex.  I was
> able to fix it with a change to a regular expression
> org-exp-bibtex.el.  The diff is shown below.
> 
> (My bibtex citekeys were auto-created by zotero, and use underscores.
> Some even have dashes.)
> 
> I thought this might be useful to others as well.
> 
> Thanks,
> 
> Nik
> 
> --- a/contrib/lisp/org-exp-bibtex.el
> +++ b/contrib/lisp/org-exp-bibtex.el
> @@ -102,8 +102,9 @@
>   (save-match-data
> (insert-file-contents (concat file ".html"))
> (goto-char (point-min))
> - (while (re-search-forward "a
> name=\"\\(\\w+\\)\">\\(\\w+\\)" nil t)
> -   (setq oebp-cite-plist (cons (cons (match-string 1)
> (match-string 2)) oebp-cite-plist)))
> + (while (re-search-forward "a
> name=\"\\([a-z0-9A-Z_\\-]+\\)\">\\(\\w+\\)" nil t)
> +   (setq oebp-cite-plist (cons (cons (match-string 1)
> (match-string 2)) oebp-cite-plist))
> +   )
> (goto-char (point-min))
> (while (re-search-forward "" nil t)
>   (replace-match "" t t))
> 

- Carsten






Re: [O] PATCH Make org-open-at-point only ask once

2011-10-06 Thread Carsten Dominik
Hi Anders, Nicolas

I am wondering what the status of this patch is.  There was a discussion, but I 
am not sure about the conclusion...

- Carsten

On Aug 28, 2011, at 10:05 PM, Anders Waldenborg wrote:

> Hi!
> 
> If an org buffer is narrowed, and one tries to do org-open-at-point on
> a link that points to outside of the restriction it asks: "No match -
> create this as a new heading?". When answering no the buffer is
> widened and the reseach is done, and if the link still can't be
> resolved the question is asked again.
> 
> For nonexistant links this happens even if the buffer isn't narrowed -
> one needs to answer "n" twice.
> 
> I also attached an alternate patch which (IMHO) simplifies the
> implementation by hiding the hard work in a macro, and as a bonus it
> only calls org-link-search once. But it is much more intrusive.
> 
> anders
> 
> ;; simple testcase to show the bug
> (progn
>  (insert "* A\n\n* B\n\n[[A]]")
>  (org-narrow-to-subtree)
>  (org-open-at-point))
> 

- Carsten






Re: [O] [PATCH] Implement history facility for org-occur searches

2011-10-06 Thread Carsten Dominik
Hi Suvayu,

could you describe your use case for this addition?  When would you need
this above calling org-occur again and using the minibuffer
history to repeat your search?

- Carsten

On Aug 24, 2011, at 1:47 AM, Suvayu Ali wrote:

> Hi Bastien and everyone,
> 
> I wanted to implement a history facility for sparse trees. Since sparse
> trees use org-occur and org-scan-tags any such facility would need to
> be aware of both functions. My lisp foo proved to be too weak to
> understand org-scan-tags, so I implemented this only for org-occur
> searches.
> 
> With this patch one can traverse the sparse tree history for date,
> regular expression and TODO keyword searches with the
> org-occur-history-forward and org-occur-history-backward functions. One
> can also call the org-occur-history-next function interactively to jump
> to the nth history entry. This should also work for any other searches
> that uses org-occur as the backend.
> 
> Please feel free to modify the patch if there are better ways to
> implement this facility. Thank you.
> 
> -- 
> Suvayu
> 
> Open source is the future. It sets us free.
> <0001-Implement-history-facility-for-org-occur-searches.patch>

- Carsten






Re: [O] headline navigation and refiling.

2011-10-06 Thread Carsten Dominik

On Oct 6, 2011, at 9:34 AM, Tom wrote:

> Carsten Dominik  gmail.com> writes:
>> 
>>> Not a part of org, but I think this occur based library is brilliant:
>>> 
>> 
>> This is good and should be part of Org-mode.  Anyone knows who wrote this?
>> 
> 
> I wrote it, but this shouldn't be the part of Org, because it's a
> hack and I don't want to deal with copyright papers either
> for such a trivial package (I've written it in half an hour, so
> it's not very hard to reimplement it).
> 
> It's a hack, because it should not use occur at all. Occur is
> line oriented and the search should be able to treat an org
> headline and its text as a single entity when searching.
> 
> So it should be reimplemented from the ground up properly with the
> same dynamic interface, so that results are shown immediately as the
> user is typing, but it should be able to support the same boolean
> logic as org-search-view, so one can make intelligent searches with
> it.
> 
> 
> For example, +dog +wag should find headings like this
> 
> * the usual behavior of dogs
> 
> they wag their tails
> 
> 
> And the search output should show the matching heading and below
> that that part of the text which is matching and if possible it
> should color the matches (like in the occur output), so in the
> above case it would show something like this (with _ indicating
> coloring):
> 
> * the usual behavior of _dogs_
> they _wag_ their tails
> 
> 
> That's the version org should have included.
Fair enough.

- Carsten

> 
> 
> 

- Carsten






Re: [O] [PATCH] Bugfix for alignment of tag next to header name

2011-10-06 Thread Carsten Dominik

On Oct 6, 2011, at 8:58 AM, Michael Brand wrote:

> Hi all
> 
> This patch from me is still pending. Is something missing from my side
> or is it acceptable?

The patch looks good, but it did not show up on the patchwork server, probably 
because you did attach it with the wrong mime type.  I have applied it now, 
thanks.

- Carsten

> 
> Michael
> 
> On Sun, Jun 5, 2011 at 23:43, Michael Brand  
> wrote:
>> * org.el (org-align-tags-here): Correct calculation of alignment.
>> 
>> With org-tag-column set to e. g. 0 and before this change: Adding a
>> tag to an untagged heading placed the tag with a distance of 1 space
>> behind the heading name like expected. After editing the heading name
>> the distance was expected to remain 1 space but changed to 2 spaces.
> 







Re: [O] headline navigation and refiling.

2011-10-06 Thread Tom
Carsten Dominik  gmail.com> writes:
>
> > Not a part of org, but I think this occur based library is brilliant:
> > 
> 
> This is good and should be part of Org-mode.  Anyone knows who wrote this?
> 

I wrote it, but this shouldn't be the part of Org, because it's a
hack and I don't want to deal with copyright papers either
for such a trivial package (I've written it in half an hour, so
it's not very hard to reimplement it).

It's a hack, because it should not use occur at all. Occur is
line oriented and the search should be able to treat an org
headline and its text as a single entity when searching.

So it should be reimplemented from the ground up properly with the
same dynamic interface, so that results are shown immediately as the
user is typing, but it should be able to support the same boolean
logic as org-search-view, so one can make intelligent searches with
it.


For example, +dog +wag should find headings like this

* the usual behavior of dogs

they wag their tails


And the search output should show the matching heading and below
that that part of the text which is matching and if possible it
should color the matches (like in the occur output), so in the
above case it would show something like this (with _ indicating
coloring):

* the usual behavior of _dogs_
they _wag_ their tails


That's the version org should have included.