Re: [Orgmode] Question: org-remember and level1 target headline [resent]

2010-06-22 Thread Carsten Dominik

Hi Martin,

I am rejecting this patch, but only because because I think this issue
is taken care of in org-capture.el   Let me know if you do not agree.

Cheers, and thanks for your contribution!

- Carsten

On May 27, 2010, at 11:43 AM, Martin Pohlack wrote:


[resending to get into the patch tracker]

Hi,

On 15.05.2010 08:42, Carsten Dominik wrote:

On May 14, 2010, at 5:42 AM, Samuel Wales wrote:

On 2010-05-13, Martin Pohlackm...@os.inf.tu-dresden.de  wrote:

Is there interest to define remember targets via paths or via ID?


ID would be useful, I think.


ID certainly - path could be useful to avoid ambiguities.


Please find attached a first version of a patch adding support for IDs
as remember targets.

Feedback welcome.

Cheers,
Martin
org-remember-id.diff


- Carsten




___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Question: org-remember and level1 target headline [resent]

2010-06-22 Thread Martin Pohlack
On 22.06.2010 15:38, Martin Pohlack wrote:
 Is there documentation for migrating from org-remember or will there be
 once org-capture shows up in the manual?

Never mind the question, I just saw the exhaustive other mail describing
org-remember :-).

Cheers,
Martin

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Question: org-remember and level1 target headline [resent]

2010-06-22 Thread Martin Pohlack
On 22.06.2010 14:54, Carsten Dominik wrote:
 Hi Martin,
 
 I am rejecting this patch, but only because because I think this issue
 is taken care of in org-capture.el   Let me know if you do not agree.

The documentation for outline path looks promising.  Even header paths
are supported -- nice!

Is there documentation for migrating from org-remember or will there be
once org-capture shows up in the manual?

Cheers,
Martin

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Question: org-remember and level1 target headline [resent]

2010-06-22 Thread Carsten Dominik


On Jun 22, 2010, at 3:38 PM, Martin Pohlack wrote:


On 22.06.2010 14:54, Carsten Dominik wrote:

Hi Martin,

I am rejecting this patch, but only because because I think this  
issue

is taken care of in org-capture.el   Let me know if you do not agree.


The documentation for outline path looks promising.  Even header paths
are supported -- nice!

Is there documentation for migrating from org-remember or will there  
be

once org-capture shows up in the manual?


Basically do

  M-x org-capture-import-remember-templates

then customize org-capture-templates to check and modify the setup,
and then use org-capture from now on to remember stuff.

Most of the documentation is (as I said in my mail) currently in the  
docstrings of the command org-capture and of the variable org-capture- 
templates.


Cheers

- Carsten




___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Question: org-remember and level1 target headline [resent]

2010-05-27 Thread Martin Pohlack

[resending to get into the patch tracker]

Hi,

On 15.05.2010 08:42, Carsten Dominik wrote:

On May 14, 2010, at 5:42 AM, Samuel Wales wrote:

On 2010-05-13, Martin Pohlackm...@os.inf.tu-dresden.de  wrote:

Is there interest to define remember targets via paths or via ID?


ID would be useful, I think.


ID certainly - path could be useful to avoid ambiguities.


Please find attached a first version of a patch adding support for IDs
as remember targets.

Feedback welcome.

Cheers,
Martin
This patch adds support for specifying the ID of a target headline.

Open issues:
* Using a cons cell seems a bit ugly.  A string would be fine too but
  this is already used by the headline itself in the choice element.
* The visual appearance of the ID choice is suboptimal.  Is there any
  way to hide the const visually?
* The comments in the remember buffer seems to be setup wrong, where
  must I hook in to support IDs there?

diff --git a/home/mpohlack/src/org-mode/lisp/org-remember.el b/org-remember.el
index 59e015f..a0dbac4 100644
--- a/home/mpohlack/src/org-mode/lisp/org-remember.el
+++ b/org-remember.el
@@ -108,7 +108,8 @@ An optional fifth element can specify the headline in that file that should
 be offered first when the user is asked to file the entry.  The default
 headline is given in the variable `org-remember-default-headline'.  When
 this element is `top' or `bottom', the note will be placed as a level-1
-entry at the beginning or end of the file, respectively.
+entry at the beginning or end of the file, respectively.  You can also specify
+the `ID' of a target headline.
 
 An optional sixth element specifies the contexts in which the template
 will be offered to the user.  This element can be a list of major modes
@@ -195,7 +196,8 @@ calendar   |  %:type %:date
 		 (const :tag Use `org-remember-default-headline' nil)
 		 (const :tag At beginning of file top)
 		 (const :tag At end of file bottom)
-		 (const :tag In a date tree date-tree))
+		 (const :tag In a date tree date-tree)
+ (cons :tag ID (const :tag  ID) (string :tag ID)))
 		(choice :tag Context
 		 (const :tag Use in all contexts nil)
 		 (const :tag Use in all contexts t)
@@ -974,6 +976,10 @@ See also the variable `org-reverse-note-order'.
 		(org-datetree-find-date-create reference-date)
 		(setq reversed nil)
 		(setq org-goto-start-pos (point)))
+	   ((consp heading)
+		(setq org-goto-start-pos (org-find-entry-with-id (cdr heading)))
+(when (not org-goto-start-pos)
+  (error Target headline with ID '%s' not found (cdr heading
 	   ((and (stringp heading) (string-match \\S- heading))
 		(goto-char (point-min))
 		(if (re-search-forward


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Question: org-remember and level1 target headline

2010-05-18 Thread Martin Pohlack
Hi,

On 15.05.2010 08:42, Carsten Dominik wrote:
 On May 14, 2010, at 5:42 AM, Samuel Wales wrote:
 On 2010-05-13, Martin Pohlackm...@os.inf.tu-dresden.de  wrote:
 Is there interest to define remember targets via paths or via ID?

 ID would be useful, I think.

 ID certainly - path could be useful to avoid ambiguities.

Please find attached a first version of a patch adding support for IDs
as remember targets.

Feedback welcome.

Cheers,
Martin

This patch adds support for specifying the ID of a target headline.

Open issues:
* Using a cons cell seems a bit ugly.  A string would be fine too but
  this is already used by the headline itself in the choice element.
* The visual appearance of the ID choice is suboptimal.  Is there any
  way to hide the const visually?
* The comments in the remember buffer seems to be setup wrong, where
  must I hook in to support IDs there?

diff --git a/home/mpohlack/src/org-mode/lisp/org-remember.el b/org-remember.el
index 59e015f..a0dbac4 100644
--- a/home/mpohlack/src/org-mode/lisp/org-remember.el
+++ b/org-remember.el
@@ -108,7 +108,8 @@ An optional fifth element can specify the headline in that file that should
 be offered first when the user is asked to file the entry.  The default
 headline is given in the variable `org-remember-default-headline'.  When
 this element is `top' or `bottom', the note will be placed as a level-1
-entry at the beginning or end of the file, respectively.
+entry at the beginning or end of the file, respectively.  You can also specify
+the `ID' of a target headline.
 
 An optional sixth element specifies the contexts in which the template
 will be offered to the user.  This element can be a list of major modes
@@ -195,7 +196,8 @@ calendar   |  %:type %:date
 		 (const :tag Use `org-remember-default-headline' nil)
 		 (const :tag At beginning of file top)
 		 (const :tag At end of file bottom)
-		 (const :tag In a date tree date-tree))
+		 (const :tag In a date tree date-tree)
+ (cons :tag ID (const :tag  ID) (string :tag ID)))
 		(choice :tag Context
 		 (const :tag Use in all contexts nil)
 		 (const :tag Use in all contexts t)
@@ -974,6 +976,10 @@ See also the variable `org-reverse-note-order'.
 		(org-datetree-find-date-create reference-date)
 		(setq reversed nil)
 		(setq org-goto-start-pos (point)))
+	   ((consp heading)
+		(setq org-goto-start-pos (org-find-entry-with-id (cdr heading)))
+(when (not org-goto-start-pos)
+  (error Target headline with ID '%s' not found (cdr heading
 	   ((and (stringp heading) (string-match \\S- heading))
 		(goto-char (point-min))
 		(if (re-search-forward

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Question: org-remember and level1 target headline

2010-05-15 Thread Carsten Dominik


On May 14, 2010, at 5:42 AM, Samuel Wales wrote:


On 2010-05-13, Martin Pohlack m...@os.inf.tu-dresden.de wrote:

Is there interest to define remember targets via paths or via ID?


ID would be useful, I think.


ID certainly - path could be useful to avoid ambiguities.

- Carsten


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Question: org-remember and level1 target headline

2010-05-13 Thread Martin Pohlack
Hi,

interest in this problem was indicated to me in private mail, so let my
sum up my findings so far.

I walked through the code in org-remember.el:org-remember-handler.

There seems to be no support for path traversal for the non-interactive
case.  The first headline matching is found regardless of its depth.

I now use the following structure for my plan files:

* Inbox
*** Inbox:host1
*** Inbox:host2
*** Inbox:host3

I use these two functions for computing the current target headline:

--
(defun my-host-name ()
  Returns the name of the current host minus the domain.
  (let ((hostname (downcase (system-name
(save-match-data
  (substring hostname (string-match ^[^.]+ hostname)
  (match-end 0)

(defun my-org-remember-headline ()
  (concatenate 'string Inbox: (my-host-name)))
--

In one of the interactive paths in org-remember-handler, org-refile
infrastructure is used for inquiring a target from the user.  When
refiling, / in headline names are replaced with \.  Verbatim \ in
headlines are also presented as \.  That means that test/test and
test\test cannot be distinguished for refiling.

Is there a specification of what are valid characters in a headline?

Is there interest to define remember targets via paths or via ID?

Cheers,
Martin

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Question: org-remember and level1 target headline

2010-05-13 Thread Eric S Fraga
On Thu, 13 May 2010 17:48:22 +0200, Martin Pohlack m...@os.inf.tu-dresden.de 
wrote:
 
 Hi,
 
 interest in this problem was indicated to me in private mail, so let my
 sum up my findings so far.

[...]

 I use these two functions for computing the current target headline:

Thanks for these.  Useful to have a summary of the situation and your
solution is straightforward enough!
-- 
Eric S Fraga
GnuPG: 8F5C 279D 3907 E14A 5C29  570D C891 93D8 FFFC F67D
___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Question: org-remember and level1 target headline

2010-05-13 Thread Samuel Wales
On 2010-05-13, Martin Pohlack m...@os.inf.tu-dresden.de wrote:
 Is there interest to define remember targets via paths or via ID?

ID would be useful, I think.

-- 
Q: How many CDC scientists does it take to change a lightbulb?
A: You only think it's dark. [CDC has denied a deadly disease for 25 years]
==
Retrovirus: http://www.wpinstitute.org/xmrv/index.html

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Question: org-remember and level1 target headline

2010-05-11 Thread Martin Pohlack

Let my rephrase the question.

How do I specify the target for a org-remember template such that new 
entries become children of b:


* a
** b
*** new entry

If I specify a/b, a new node named a/b is created

* a
** b
* a/b
** new entry

Cheers,
Martin

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Question: org-remember and level1 target headline

2010-05-10 Thread Martin Pohlack
Hi all,

to practically prevent merge conflicts between the different machines
that I use I want to capture new items not directly under the global
Inbox headline, but under Inbox/$HOSTNAME.

For example, I often capture new items on my desktop and my notebook
and later sync.  The new items will always conflict as they are placed as
last child of Inbox.

I now switched my org-remember templates from statically specifying
Inbox as target headline to a helper function:

--

(defun my-host-name ()
  Returns the name of the current host minus the domain.
  (let ((hostname (downcase (system-name
(save-match-data
  (substring hostname (string-match ^[^.]+ hostname) (match-end 0)

(defun my-org-remember-headline ()
  (concatenate 'string Inbox/ (my-host-name)))

--

The problem now is that I would like the target to be:

* Inbox
*** $HOSTNAME
* new item

Instead, I get this:

* Inbox/$HOSTNAME
*** new items

My question now is how to specify the headline hierarchy here?

Cheers,
Martin

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode