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

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

[elpa] externals/org 07b6a0e044 48/50: compat: Use org- wrapper for stri


From: ELPA Syncer
Subject: [elpa] externals/org 07b6a0e044 48/50: compat: Use org- wrapper for string-equal-ignore-case compatibility
Date: Tue, 4 Oct 2022 21:58:02 -0400 (EDT)

branch: externals/org
commit 07b6a0e0449caafb755bebb8def2754b29487048
Author: Kyle Meyer <kyle@kyleam.com>
Commit: Kyle Meyer <kyle@kyleam.com>

    compat: Use org- wrapper for string-equal-ignore-case compatibility
    
    * lisp/org-compat.el (org-string-equal-ignore-case): New compatibility
    function.
    (org-mode-flyspell-verify):
    * lisp/ob-core.el (org-babel-results-keyword):
    (org-babel-insert-result):
    * lisp/org-lint.el (org-lint-duplicate-custom-id):
    * lisp/ox.el (org-export-resolve-radio-link):
    Use org-string-equal-ignore-case.
    
    Prefer an explicit org- wrapper to isolate the kludge and avoid any
    confusion about where it is defined.
    
    This is a follow-up to the port of Emacs's 70341cab3.
---
 lisp/ob-core.el    |  8 ++++----
 lisp/org-compat.el | 10 +++++++---
 lisp/org-lint.el   |  2 +-
 lisp/ox.el         |  3 +--
 4 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/lisp/ob-core.el b/lisp/ob-core.el
index 5e821d932c..27947111ff 100644
--- a/lisp/ob-core.el
+++ b/lisp/ob-core.el
@@ -144,7 +144,7 @@ used."
   :type 'string
   :safe (lambda (v)
          (and (stringp v)
-              (string-equal-ignore-case "RESULTS" v))))
+              (org-string-equal-ignore-case "RESULTS" v))))
 
 (defcustom org-babel-noweb-wrap-start "<<"
   "String used to begin a noweb reference in a code block.
@@ -2491,7 +2491,7 @@ INFO may provide the values of these header arguments (in 
the
                       ;; Escape contents from "export" wrap.  Wrap
                       ;; inline results within an export snippet with
                       ;; appropriate value.
-                      ((string-equal-ignore-case type "export")
+                      ((org-string-equal-ignore-case type "export")
                        (let ((backend (pcase split
                                         (`(,_) "none")
                                         (`(,_ ,b . ,_) b))))
@@ -2502,14 +2502,14 @@ INFO may provide the values of these header arguments 
(in the
                                           backend) "@@)}}}")))
                       ;; Escape contents from "example" wrap.  Mark
                       ;; inline results as verbatim.
-                      ((string-equal-ignore-case type "example")
+                      ((org-string-equal-ignore-case type "example")
                        (funcall wrap
                                 opening-line closing-line
                                 nil nil
                                 "{{{results(=" "=)}}}"))
                       ;; Escape contents from "src" wrap.  Mark
                       ;; inline results as inline source code.
-                      ((string-equal-ignore-case type "src")
+                      ((org-string-equal-ignore-case type "src")
                        (let ((inline-open
                               (pcase split
                                 (`(,_)
diff --git a/lisp/org-compat.el b/lisp/org-compat.el
index 9032212b7f..b8ed3ddc36 100644
--- a/lisp/org-compat.el
+++ b/lisp/org-compat.el
@@ -76,6 +76,9 @@
 (declare-function org-fold-show-all "org-fold" (&optional types))
 (declare-function org-fold-show-children "org-fold" (&optional level))
 (declare-function org-fold-show-entry "org-fold" (&optional hide-drawers))
+;; `org-string-equal-ignore-case' is in _this_ file but isn't at the
+;; top-level.
+(declare-function org-string-equal-ignore-case "org-compat" (string1 string2))
 
 (defvar calendar-mode-map)
 (defvar org-complex-heading-regexp)
@@ -116,9 +119,10 @@ the symbol of the calling function, for example."
       (when (not (equal attr cachedattr))
         (puthash sym attr org-file-has-changed-p--hash-table)))))
 
-(unless (fboundp 'string-equal-ignore-case)
+(if (fboundp 'string-equal-ignore-case)
+    (defalias 'org-string-equal-ignore-case #'string-equal-ignore-case)
   ;; From Emacs subr.el.
-  (defun string-equal-ignore-case (string1 string2)
+  (defun org-string-equal-ignore-case (string1 string2)
     "Like `string-equal', but case-insensitive.
 Upper-case and lower-case letters are treated as equal.
 Unibyte strings are converted to multibyte for comparison."
@@ -1358,7 +1362,7 @@ ELEMENT is the element at point."
          (and log
               (let ((drawer (org-element-lineage element '(drawer))))
                 (and drawer
-                     (string-equal-ignore-case
+                     (org-string-equal-ignore-case
                       log (org-element-property :drawer-name drawer))))))
        nil)
        (t
diff --git a/lisp/org-lint.el b/lisp/org-lint.el
index e8511103fd..a9fe2b7e62 100644
--- a/lisp/org-lint.el
+++ b/lisp/org-lint.el
@@ -383,7 +383,7 @@ called with one argument, the key used for comparison."
    ast
    'node-property
    (lambda (property)
-     (and (string-equal-ignore-case
+     (and (org-string-equal-ignore-case
            "CUSTOM_ID" (org-element-property :key property))
          (org-element-property :value property)))
    (lambda (property _) (org-element-property :begin property))
diff --git a/lisp/ox.el b/lisp/ox.el
index 1cb0dea06c..37cee1674c 100644
--- a/lisp/ox.el
+++ b/lisp/ox.el
@@ -82,7 +82,6 @@
 (require 'org-element)
 (require 'org-macro)
 (require 'tabulated-list)
-(require 'subr-x)
 
 (declare-function org-src-coderef-format "org-src" (&optional element))
 (declare-function org-src-coderef-regexp "org-src" (fmt &optional label))
@@ -4457,7 +4456,7 @@ has type \"radio\"."
   (let ((path (org-string-clean-whitespace (org-element-property :path link))))
     (org-element-map (plist-get info :parse-tree) 'radio-target
       (lambda (radio)
-       (and (string-equal-ignore-case
+       (and (org-string-equal-ignore-case
              (org-string-clean-whitespace (org-element-property :value radio))
               path)
             radio))



reply via email to

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