diff options
author | Kyle Meyer <kyle@kyleam.com> | 2015-10-31 12:36:16 -0400 |
---|---|---|
committer | Kyle Meyer <kyle@kyleam.com> | 2015-10-31 12:47:17 -0400 |
commit | 59d706219bf0434cceacda18e3d291c241648199 (patch) | |
tree | 3a0cb64d801253aa14b69db97c7b04a47d73cede | |
parent | 1ec47568f4a9032edf6b48caa32d2f4df4c70790 (diff) | |
download | org-mode-59d706219bf0434cceacda18e3d291c241648199.tar.gz |
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 <simon.thum@gmx.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/102411>
-rwxr-xr-x | lisp/org.el | 1 | ||||
-rw-r--r-- | testing/lisp/test-org.el | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/lisp/org.el b/lisp/org.el index 3ac7780..1f73dd1 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 efd8c3d..b4dff70 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 ">>") |