0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-09-29 21:07:54 +00:00

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>
This commit is contained in:
TEC 2021-09-01 22:33:39 +08:00
parent b4e575ee87
commit d70f280678
Signed by: tec
GPG key ID: 779591AFDB81F06C

View file

@ -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