branch: externals/org
commit d70f2806788dce06871287ef02c88ee08076dffc
Author: TEC <t...@tecosaur.com>
Commit: TEC <t...@tecosaur.com>

    org-macs: Allow for nil ffap-url-regexp
    
    * lisp/org-macs.el (org-url-p): `ffap-url-regexp' is allowed to be nil,
    which is taken to mean urls should not be matched.  When this is set,
    `string-match-p' errors.  To consider this case correctly, we check that
    `ffap-url-regexp' is non-nil before calling `string-match-p'.
    
    Reported-by: "Peder Stray" <peder.st...@gmail.com>
    <https://lists.gnu.org/archive/html/emacs-orgmode/2021-09/msg00004.html>
---
 lisp/org-macs.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org-macs.el b/lisp/org-macs.el
index 77458db..65db8f8 100644
--- a/lisp/org-macs.el
+++ b/lisp/org-macs.el
@@ -811,7 +811,7 @@ return nil."
 (defun org-url-p (s)
   "Non-nil if string S is a URL."
   (require 'ffap)
-  (string-match-p ffap-url-regexp s))
+  (and ffap-url-regexp (string-match-p ffap-url-regexp s)))
 
 
 ;;; String manipulation

Reply via email to