emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/ivy-hydra 7774867 335/395: Guard against null Org headi


From: Basil L. Contovounesios
Subject: [elpa] externals/ivy-hydra 7774867 335/395: Guard against null Org heading
Date: Thu, 25 Feb 2021 08:32:33 -0500 (EST)

branch: externals/ivy-hydra
commit 77748673d3481f9fd1de91283c57ce535404c28f
Author: Basil L. Contovounesios <contovob@tcd.ie>
Commit: Basil L. Contovounesios <contovob@tcd.ie>

    Guard against null Org heading
    
    * counsel.el (counsel-outline-title-org): Don't pass null result of
    org-get-heading to replace-regexp-in-string.
    
    Fixes #2617
---
 counsel.el | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/counsel.el b/counsel.el
index 32a93bd..1a81caf 100644
--- a/counsel.el
+++ b/counsel.el
@@ -4980,11 +4980,12 @@ Intended as a value for the `:outline-title' setting in
   "Return title of current outline heading.
 Like `counsel-outline-title' (which see), but for `org-mode'
 buffers."
-  (let ((statistics-re "\\[[0-9]*\\(?:%\\|/[0-9]*\\)\\]")
+  (let ((statistics-re "\\[[0-9]*\\(?:%\\|/[0-9]*\\)]")
         (heading (apply #'org-get-heading (counsel--org-get-heading-args))))
-    (if counsel-org-headline-display-statistics
-        heading
-      (org-trim (replace-regexp-in-string statistics-re " " heading)))))
+    (cond (counsel-org-headline-display-statistics
+           heading)
+          (heading
+           (org-trim (replace-regexp-in-string statistics-re " " heading))))))
 
 (defun counsel-outline-title-markdown ()
   "Return title of current outline heading.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]