emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] Fix refile bug
       [not found] <yes>
@ 2010-05-19  8:50 ` David Maus
  2010-05-19  8:50 ` [PATCH] Return empty list after refile cache was cleared David Maus
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: David Maus @ 2010-05-19  8:50 UTC (permalink / raw)
  To: emacs-orgmode

Attached patch fixes the problem first reported by Tassilo Horn in
[mid:87y6fhxc47.fsf@thinkpad.tsdh.de].  Problem was that
`org-refile-cache-get' returned an invalid refile target table after
the refile cache was cleared.

Available on git://github.com/dmj/dmj-org-mode.git quickfix

HTH
 -- David

David Maus (1):
  Return empty list after refile cache was cleared.

 lisp/ChangeLog |    5 +++++
 lisp/org.el    |    2 +-
 2 files changed, 6 insertions(+), 1 deletions(-)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] Return empty list after refile cache was cleared.
       [not found] <yes>
  2010-05-19  8:50 ` [PATCH] Fix refile bug David Maus
@ 2010-05-19  8:50 ` David Maus
  2010-05-19  9:39   ` Bastien
  2010-05-19 18:14 ` [PATCH] org.el: Create new ID property for cloned subtrees David Maus
  2010-05-19 18:14 ` [PATCH] Maybe create ID property in " David Maus
  3 siblings, 1 reply; 5+ messages in thread
From: David Maus @ 2010-05-19  8:50 UTC (permalink / raw)
  To: emacs-orgmode

---
 lisp/ChangeLog |    5 +++++
 lisp/org.el    |    2 +-
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 7cc28e4..01672a0 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2010-05-19  David Maus  <dmaus@ictsoc.de>
+
+	* org.el (org-refile-cache-get): Return empty list of targets
+	when cache was cleared.
+
 2010-05-17  Carsten Dominik  <carsten.dominik@gmail.com>
 
 	* org.el (org-refile-use-cache): New option.
diff --git a/lisp/org.el b/lisp/org.el
index d002dab..4ede91f 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -9526,7 +9526,7 @@ on the system \"/user@host:\"."
   "Retrieve the cached value for refile targets given by IDENTIFIERS."
   (cond
    ((not org-refile-cache) nil)
-   ((not org-refile-use-cache) (org-refile-cache-clear))
+   ((not org-refile-use-cache) (org-refile-cache-clear) nil)
    (t
     (let ((set (cdr (assoc (sha1 (prin1-to-string identifiers))
 			   org-refile-cache))))
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] Return empty list after refile cache was cleared.
  2010-05-19  8:50 ` [PATCH] Return empty list after refile cache was cleared David Maus
@ 2010-05-19  9:39   ` Bastien
  0 siblings, 0 replies; 5+ messages in thread
From: Bastien @ 2010-05-19  9:39 UTC (permalink / raw)
  To: David Maus; +Cc: emacs-orgmode

Applied, thanks.

David Maus <dmaus@ictsoc.de> writes:

> ---
>  lisp/ChangeLog |    5 +++++
>  lisp/org.el    |    2 +-
>  2 files changed, 6 insertions(+), 1 deletions(-)
>
> diff --git a/lisp/ChangeLog b/lisp/ChangeLog
> index 7cc28e4..01672a0 100644
> --- a/lisp/ChangeLog
> +++ b/lisp/ChangeLog
> @@ -1,3 +1,8 @@
> +2010-05-19  David Maus  <dmaus@ictsoc.de>
> +
> +	* org.el (org-refile-cache-get): Return empty list of targets
> +	when cache was cleared.
> +
>  2010-05-17  Carsten Dominik  <carsten.dominik@gmail.com>
>  
>  	* org.el (org-refile-use-cache): New option.
> diff --git a/lisp/org.el b/lisp/org.el
> index d002dab..4ede91f 100644
> --- a/lisp/org.el
> +++ b/lisp/org.el
> @@ -9526,7 +9526,7 @@ on the system \"/user@host:\"."
>    "Retrieve the cached value for refile targets given by IDENTIFIERS."
>    (cond
>     ((not org-refile-cache) nil)
> -   ((not org-refile-use-cache) (org-refile-cache-clear))
> +   ((not org-refile-use-cache) (org-refile-cache-clear) nil)
>     (t
>      (let ((set (cdr (assoc (sha1 (prin1-to-string identifiers))
>  			   org-refile-cache))))

-- 
 Bastien

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] org.el: Create new ID property for cloned subtrees
       [not found] <yes>
  2010-05-19  8:50 ` [PATCH] Fix refile bug David Maus
  2010-05-19  8:50 ` [PATCH] Return empty list after refile cache was cleared David Maus
@ 2010-05-19 18:14 ` David Maus
  2010-05-19 18:14 ` [PATCH] Maybe create ID property in " David Maus
  3 siblings, 0 replies; 5+ messages in thread
From: David Maus @ 2010-05-19 18:14 UTC (permalink / raw)
  To: emacs-orgmode

The clones of a subtree that has a ID property now get a shiny new ID,
too.

HTH
  -- David

David Maus (1):
  Maybe create ID property in cloned subtrees.

 lisp/ChangeLog |    2 ++
 lisp/org.el    |   18 ++++++++++--------
 2 files changed, 12 insertions(+), 8 deletions(-)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] Maybe create ID property in cloned subtrees.
       [not found] <yes>
                   ` (2 preceding siblings ...)
  2010-05-19 18:14 ` [PATCH] org.el: Create new ID property for cloned subtrees David Maus
@ 2010-05-19 18:14 ` David Maus
  3 siblings, 0 replies; 5+ messages in thread
From: David Maus @ 2010-05-19 18:14 UTC (permalink / raw)
  To: emacs-orgmode

---
 lisp/ChangeLog |    2 ++
 lisp/org.el    |   18 ++++++++++--------
 2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 01672a0..ec2fa36 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -2,6 +2,8 @@
 
 	* org.el (org-refile-cache-get): Return empty list of targets
 	when cache was cleared.
+	(org-clone-subtree-with-time-shift): Maybe create ID property
+	in cloned subtrees.
 
 2010-05-17  Carsten Dominik  <carsten.dominik@gmail.com>
 
diff --git a/lisp/org.el b/lisp/org.el
index 4ede91f..64da60a 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -7170,7 +7170,7 @@ the following will happen:
 I this way you can spell out a number of instances of a repeating task,
 and still retain the repeater to cover future instances of the task."
   (interactive "nNumber of clones to produce: \nsDate shift per clone (e.g. +1w, empty to copy unchanged): ")
-  (let (beg end template task
+  (let (beg end template task idprop
 	    shift-n shift-what doshift nmin nmax (n-no-remove -1))
     (if (not (and (integerp n) (> n 0)))
 	(error "Invalid number of replications %s" n))
@@ -7187,15 +7187,11 @@ and still retain the repeater to cover future instances of the task."
     (setq nmin 1 nmax n)
     (org-back-to-heading t)
     (setq beg (point))
+    (setq idprop (org-entry-get nil "ID"))
     (org-end-of-subtree t t)
     (or (bolp) (insert "\n"))
     (setq end (point))
-    (setq template (let ((tmpl (buffer-substring beg end)))
-		     (with-temp-buffer
-		       (insert tmpl)
-		       (org-mode)
-		       (org-entry-delete nil "ID")
-		       (buffer-string))))
+    (setq template (buffer-substring beg end))
     (when (and doshift
 	       (string-match "<[^<>\n]+ \\+[0-9]+[dwmy][^<>\n]*>" template))
       (delete-region beg end)
@@ -7204,11 +7200,17 @@ and still retain the repeater to cover future instances of the task."
     (goto-char end)
     (loop for n from nmin to nmax do
 	  (if (not doshift)
-	      (setq task template)
+	      (setq task (if (not idprop) template
+			   (with-temp-buffer
+			     (insert template)
+			     (org-mode)
+			     (org-id-get-create t)
+			     (buffer-string))))
 	    (with-temp-buffer
 	      (insert template)
 	      (org-mode)
 	      (goto-char (point-min))
+	      (if idprop (org-id-get-create t))
 	      (while (re-search-forward org-ts-regexp-both nil t)
 		(org-timestamp-change (* n shift-n) shift-what))
 	      (unless (= n n-no-remove)
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-05-19 18:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <yes>
2010-05-19  8:50 ` [PATCH] Fix refile bug David Maus
2010-05-19  8:50 ` [PATCH] Return empty list after refile cache was cleared David Maus
2010-05-19  9:39   ` Bastien
2010-05-19 18:14 ` [PATCH] org.el: Create new ID property for cloned subtrees David Maus
2010-05-19 18:14 ` [PATCH] Maybe create ID property in " David Maus

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).