diff options
author | memeplex <carlosjosepita@gmail.com> | 2019-03-09 17:49:52 -0300 |
---|---|---|
committer | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2019-03-10 11:13:45 +0100 |
commit | 116a58b368773638186867931ec030152569e398 (patch) | |
tree | f5e3a12eb936d3565183ce2110271a0f454638dc | |
parent | cebd6417b2335d47b902bdc2d121694f75428f32 (diff) | |
download | org-mode-116a58b368773638186867931ec030152569e398.tar.gz |
org-agenda: Fix nil-nil comparison in tags and alpha
* lisp/org-agenda.el (org-cmp-alpha):
(org-cmp-tag): Don't favor a particular ordering when both lhs and rhs
are nil.
-rw-r--r-- | lisp/org-agenda.el | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index 572a42c..069abbe 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -6990,7 +6990,8 @@ The optional argument TYPE tells the agenda type." "\\([ \t]*\\[[a-zA-Z0-9]\\]\\)? *") tb) (setq tb (substring tb (match-end 0)))) (setq tb (downcase tb))) - (cond ((not ta) +1) + (cond ((not (or ta tb)) nil) + ((not ta) +1) ((not tb) -1) ((string-lessp ta tb) -1) ((string-lessp tb ta) +1)))) @@ -6999,7 +7000,8 @@ The optional argument TYPE tells the agenda type." "Compare the string values of the first tags of A and B." (let ((ta (car (last (get-text-property 1 'tags a)))) (tb (car (last (get-text-property 1 'tags b))))) - (cond ((not ta) +1) + (cond ((not (or ta tb)) nil) + ((not ta) +1) ((not tb) -1) ((string-lessp ta tb) -1) ((string-lessp tb ta) +1)))) |