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

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

[elpa] master cdd7ada 094/399: counsel.el (counsel-url-expand): Avoid nu


From: Oleh Krehel
Subject: [elpa] master cdd7ada 094/399: counsel.el (counsel-url-expand): Avoid null error
Date: Sat, 20 Jul 2019 14:56:56 -0400 (EDT)

branch: master
commit cdd7ada733bced5dd1c0bcd071b3195cf0b8b5b6
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>

    counsel.el (counsel-url-expand): Avoid null error
---
 counsel.el | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/counsel.el b/counsel.el
index 1a6ab5b..6605d90 100644
--- a/counsel.el
+++ b/counsel.el
@@ -2114,15 +2114,16 @@ will be expanded according to its format.  This 
function is
 intended to be used in `ivy-ffap-url-functions' to browse the
 result as a URL."
   (let ((word-at-point (current-word)))
-    (cl-some
-     (lambda (pair)
-       (let ((regexp (car pair))
-             (formatter (cdr pair)))
-         (when (string-match regexp word-at-point)
-           (if (functionp formatter)
-               (funcall formatter word-at-point)
-             (format formatter word-at-point)))))
-     counsel-url-expansions-alist)))
+    (when word-at-point
+      (cl-some
+       (lambda (pair)
+         (let ((regexp (car pair))
+               (formatter (cdr pair)))
+           (when (string-match regexp word-at-point)
+             (if (functionp formatter)
+                 (funcall formatter word-at-point)
+               (format formatter word-at-point)))))
+       counsel-url-expansions-alist))))
 
 ;;** `counsel-recentf'
 (defvar recentf-list)



reply via email to

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