[O] Patch on org-agenda-cmp-user-defined not called

2017-07-05 Thread Li Zhuo
-- 
lizhuo
From ed3ca2c1ea88b452fe3d324216740664de83a218 Mon Sep 17 00:00:00 2001
From: Vacker 
Date: Wed, 5 Jul 2017 19:38:01 +0800
Subject: [PATCH] fix `org-agenda-cmp-user-defined` not called when user has
 defined it

---
 lisp/org-agenda.el | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 652fada..3a0248e 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -7007,10 +7007,9 @@ their type."
 	 (alpha-down  (if alpha-up (- alpha-up) nil))
 	 (need-user-cmp   (org-em 'user-defined-up 'user-defined-down ss))
 	 user-defined-up user-defined-down)
-(if (and need-user-cmp org-agenda-cmp-user-defined
-	 (functionp org-agenda-cmp-user-defined))
+(if (and need-user-cmp (functionp 'org-agenda-cmp-user-defined))
 	(setq user-defined-up
-	  (funcall org-agenda-cmp-user-defined a b)
+	  (funcall 'org-agenda-cmp-user-defined a b)
 	  user-defined-down (if user-defined-up (- user-defined-up) nil)))
 (cdr (assoc
 	  (eval (cons 'or org-agenda-sorting-strategy-selected))
-- 
2.7.4



[O] possible org-refile bug fix

2013-12-22 Thread Li Zhuo
Dear maintainers,
   I may have found a bug relate to org-refile function,though I have not
push privileges,I submit a patch using git format-patch.
   Wait for your review, awesome Org mode!!
From 866b7be3536d92eb7d7b04cdd48a8b806b9b7253 Mon Sep 17 00:00:00 2001
From: Vacker fantans...@gmail.com
Date: Sun, 22 Dec 2013 16:33:28 +0800
Subject: [PATCH] check refile position when the position is not nil

# background
  when use ido-mode to refile,type a unexist heading always trigger error
'Please indicate a target file in the refile path'
even after set org-refile-allow-creating-parent-nodes to 'confirm
or 'file.

# debugging result see the code comments
---
 lisp/org.el | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lisp/org.el b/lisp/org.el
index 1f20bfd..84f2a60 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -11801,12 +11801,16 @@ this is used for the GOTO interface.
   (concat  (default  cbnex  : ))
 	 pa answ parent-target child parent old-hist)
 (setq old-hist org-refile-history)
+;;answ will be the new (not exist) heading you type through org-icompleting-read
 (setq answ (funcall cfunc prompt tbl nil (not new-nodes)
 			nil 'org-refile-history (or cdef (car org-refile-history
+;;but tbl is fixed not containing the new heading,
+;;so pa is always nil
+;;we could let org-refile-check-position work when pa is not nil
 (setq pa (or (assoc answ tbl) (assoc (concat answ /) tbl)))
-(org-refile-check-position pa)
 (if pa
 	(progn
+	  (org-refile-check-position pa)
 	  (when (or (not org-refile-history)
 		(not (eq old-hist org-refile-history))
 		(not (equal (car pa) (car org-refile-history
-- 
1.8.5.2