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

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

[elpa] externals/org d70f280: org-macs: Allow for nil ffap-url-regexp


From: ELPA Syncer
Subject: [elpa] externals/org d70f280: org-macs: Allow for nil ffap-url-regexp
Date: Wed, 1 Sep 2021 10:57:15 -0400 (EDT)

branch: externals/org
commit d70f2806788dce06871287ef02c88ee08076dffc
Author: TEC <tec@tecosaur.com>
Commit: TEC <tec@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.stray@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

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