فهرست منبع

* lisp/ol.el (org-insert-link): Fix edge case when ALL-PREFIXES is nil

Fix `rx-to-string' error when no link types are registered in Org.

See https://orgmode.org/list/8bbccdb4-52f4-b9b5-eb10-252bb15108ec@gmail.com
Ihor Radchenko 2 سال پیش
والد
کامیت
3858a97ac3
1فایلهای تغییر یافته به همراه2 افزوده شده و 1 حذف شده
  1. 2 1
      lisp/ol.el

+ 2 - 1
lisp/ol.el

@@ -1976,7 +1976,8 @@ Use TAB to complete link prefixes, then RET for type-specific completion support
     (unless auto-desc
       (let* ((type
               (cond
-               ((string-match (rx-to-string `(: string-start (submatch (or ,@all-prefixes)) ":")) link)
+               ((and all-prefixes
+                     (string-match (rx-to-string `(: string-start (submatch (or ,@all-prefixes)) ":")) link))
                 (match-string 1 link))
                ((file-name-absolute-p link) "file")
                ((string-match "\\`\\.\\.?/" link) "file")))