From 59d706219bf0434cceacda18e3d291c241648199 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Sat, 31 Oct 2015 12:36:16 -0400 Subject: [PATCH] org-format-outline-path: Ignore nil path elements * lisp/org.el (org-format-outline-path): Ignore nil path elements. * testing/lisp/test-org.el (test-org/format-outline-path): Add test. The PATH argument shouldn't contain a nil item. However, this didn't fail before 1c74002, and helm-get-org-candidates-in-file relies on this behavior, so prevent it from failing now. Reported-by: Simon Thum --- lisp/org.el | 1 + testing/lisp/test-org.el | 3 +++ 2 files changed, 4 insertions(+) diff --git a/lisp/org.el b/lisp/org.el index 3ac7780ff..1f73dd152 100755 --- a/lisp/org.el +++ b/lisp/org.el @@ -11751,6 +11751,7 @@ such as the file name. SEPARATOR is inserted between the different parts of the path, the default is \"/\"." (setq width (or width 79)) + (setq path (delq nil path)) (unless (> width 0) (user-error "Argument `width' must be positive")) (setq separator (or separator "/")) diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el index efd8c3dc8..b4dff701c 100644 --- a/testing/lisp/test-org.el +++ b/testing/lisp/test-org.el @@ -1319,6 +1319,9 @@ (should (string= (org-format-outline-path '()) "")) + (should + (string= (org-format-outline-path '(nil)) + "")) ;; Empty path and prefix. (should (string= (org-format-outline-path '() nil ">>") -- 2.11.4.GIT