Browse Source

Agenda: Fix bug with killing entries from the agenda

Nicolas Goaziou writes:

> As I was saying in anoter post, it looks like there's something
> weird happening when using C-k in agenda view:
>
> 1. Create two new remember entries (i.e. test and test2) with the
> same tag (I used @office)
> 2. Narrow down the agenda view to only see the @office entries.
> 3. Kill the last but one entry (it should be "test") : both of
> "test" and "test2" disappear frow the view. Actually, "test2" is
> not properly killed, but it is scary nonetheless.
>
> It only happens with two last entries.
>
> Is anyone able to reproduce this ?
Carsten Dominik 16 years ago
parent
commit
3ee470daa1
2 changed files with 4 additions and 1 deletions
  1. 3 0
      lisp/ChangeLog
  2. 1 1
      lisp/org-agenda.el

+ 3 - 0
lisp/ChangeLog

@@ -1,5 +1,8 @@
 2009-05-23  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* org-agenda.el (org-remove-subtree-entries-from-agenda): Reduce
+	range for marker position checking.
+
 	* org-latex.el (org-export-latex-first-lines): Fix bug when
 	exporting a region.
 

+ 1 - 1
lisp/org-agenda.el

@@ -5349,7 +5349,7 @@ If this information is not given, the function uses the tree at point."
 		     (equal buf (marker-buffer m))
 		     (setq p (marker-position m))
 		     (>= p beg)
-		     (<= p end))
+		     (< p end))
 	    (let ((inhibit-read-only t))
 	      (delete-region (point-at-bol) (1+ (point-at-eol)))))
 	  (beginning-of-line 0))))))