emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [Patch] Fix check of previous-sibling in org-depend
@ 2017-07-12  0:37 Yuri Lensky
  2017-07-12 12:12 ` Nicolas Goaziou
  0 siblings, 1 reply; 2+ messages in thread
From: Yuri Lensky @ 2017-07-12  0:37 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org


[-- Attachment #1.1: Type: text/plain, Size: 119 bytes --]

The "previous-sibling" blocker sometimes checked the previous /visible/
heading,
instead of the true previous sibling.

[-- Attachment #1.2: Type: text/html, Size: 186 bytes --]

[-- Attachment #2: 0001-org-depend.el-Fix-check-for-previous-sibling-blocker.patch --]
[-- Type: application/octet-stream, Size: 1107 bytes --]

From 0b5ae17e7832a22c276a7afa3439fdb2a313de4b Mon Sep 17 00:00:00 2001
From: "Yuri D. Lensky" <ydlensky@gmail.com>
Date: Mon, 10 Jul 2017 16:21:52 -0700
Subject: [PATCH 1/2] org-depend.el: Fix check for previous-sibling blocker.

The "previous-sibling" blocker checked the previous /visible/ heading,
instead of the true previous sibling.
---
 contrib/lisp/org-depend.el | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/contrib/lisp/org-depend.el b/contrib/lisp/org-depend.el
index cd570c5..d1b9844 100644
--- a/contrib/lisp/org-depend.el
+++ b/contrib/lisp/org-depend.el
@@ -388,9 +388,8 @@ this ID property, that entry is also checked."
 		  (save-excursion
 		    (goto-char pos)
 		    ;; find the older sibling, exit if no more siblings
-		    (condition-case nil
-			(outline-backward-same-level 1)
-		      (error (throw 'ignore t)))
+		    (unless (org-get-last-sibling)
+		      (throw 'ignore t))
 		    ;; Check if this entry is not yet done and block
 		    (unless (org-entry-is-done-p)
 		      ;; return nil, to indicate that we block the change!
-- 
2.9.2.windows.1


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

* Re: [Patch] Fix check of previous-sibling in org-depend
  2017-07-12  0:37 [Patch] Fix check of previous-sibling in org-depend Yuri Lensky
@ 2017-07-12 12:12 ` Nicolas Goaziou
  0 siblings, 0 replies; 2+ messages in thread
From: Nicolas Goaziou @ 2017-07-12 12:12 UTC (permalink / raw)
  To: Yuri Lensky; +Cc: emacs-orgmode@gnu.org

Hello,

Yuri Lensky <ydl@ydl.cm> writes:

> The "previous-sibling" blocker sometimes checked the previous /visible/
> heading,
> instead of the true previous sibling.
> From 0b5ae17e7832a22c276a7afa3439fdb2a313de4b Mon Sep 17 00:00:00 2001
> From: "Yuri D. Lensky" <ydlensky@gmail.com>
> Date: Mon, 10 Jul 2017 16:21:52 -0700
> Subject: [PATCH 1/2] org-depend.el: Fix check for previous-sibling blocker.
>
> The "previous-sibling" blocker checked the previous /visible/ heading,
> instead of the true previous sibling.

Applied. Thank you.

Regards,

-- 
Nicolas Goaziou

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

end of thread, other threads:[~2017-07-12 12:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-12  0:37 [Patch] Fix check of previous-sibling in org-depend Yuri Lensky
2017-07-12 12:12 ` Nicolas Goaziou

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