branch: externals/org
commit 3b49db87550e42522d67b5b9864b3d6bdc685b33
Author: Ihor Radchenko <yanta...@posteo.net>
Commit: Ihor Radchenko <yanta...@posteo.net>

    Revert "Prefer `string-search' when matching exact strings"
    
    This reverts commit e9110a8dd77c271248257f588c49796876500f22.
    
    `string-search' is not available in Emacs<28 and also always
    case-sensitive.
---
 lisp/ob-core.el     | 4 ++--
 lisp/org-agenda.el  | 2 +-
 lisp/org-persist.el | 2 +-
 lisp/ox-beamer.el   | 4 ++--
 lisp/ox-latex.el    | 4 ++--
 5 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/lisp/ob-core.el b/lisp/ob-core.el
index 9cc267f5a2..411ced2e29 100644
--- a/lisp/ob-core.el
+++ b/lisp/ob-core.el
@@ -175,7 +175,7 @@ This string must include a \"%s\" which will be replaced by 
the results."
      'safe-local-variable
      (lambda (value)
        (and (stringp value)
-           (string-search "%s" value))))
+           (string-match-p "%s" value))))
 
 (defcustom org-babel-hash-show-time nil
   "Non-nil means show the time the code block was evaluated in the result 
hash."
@@ -2060,7 +2060,7 @@ block of the same language with the previous."
         (stars (concat (make-string (or (org-current-level) 1) ?*) " "))
         (upper-case-p (and block
                            (let (case-fold-search)
-                             (string-search "#+BEGIN_SRC" block)))))
+                             (string-match-p "#\\+BEGIN_SRC" block)))))
     (if (and info start) ;; At src block, but not within blank lines after it.
         (mapc
          (lambda (place)
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 272010a257..57cddcfe9e 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -8288,7 +8288,7 @@ also press `-' or `+' to switch between filtering and 
excluding."
          (setq org-agenda-represented-categories
                ;; Enclose category names with a hyphen in double
                ;; quotes to process them specially in `org-agenda-filter'.
-               (mapcar (lambda (s) (if (string-search "-" s) (format "\"%s\"" 
s) s))
+               (mapcar (lambda (s) (if (string-match-p "-" s) (format "\"%s\"" 
s) s))
                        (nreverse (org-uniquify (delq nil categories)))))))))
 
 (defvar org-tag-groups-alist-for-agenda)
diff --git a/lisp/org-persist.el b/lisp/org-persist.el
index b98cfa3a84..81edcf6f28 100644
--- a/lisp/org-persist.el
+++ b/lisp/org-persist.el
@@ -426,7 +426,7 @@ FORMAT and ARGS are passed to `message'."
          ;; Remove problematic file.
          (unless (bufferp buffer-or-file) (delete-file buffer-or-file))
          ;; Do not report the known error to user.
-         (if (string-search "Invalid read syntax" (error-message-string err))
+         (if (string-match-p "Invalid read syntax" (error-message-string err))
              (message "Emacs reader failed to read data in %S. The error was: 
%S"
                       buffer-or-file (error-message-string err))
            (warn "Emacs reader failed to read data in %S. The error was: %S"
diff --git a/lisp/ox-beamer.el b/lisp/ox-beamer.el
index c58b0c6bcf..2f11994998 100644
--- a/lisp/ox-beamer.el
+++ b/lisp/ox-beamer.el
@@ -452,12 +452,12 @@ used as a communication channel."
                    ;; allowed by Beamer.
                    (and (not (member "allowframebreaks" options))
                         (not (cl-some (lambda (s) (string-match-p "^label=" s))
-                                    options))
+                                      options))
                         (list
                          (let ((label (org-beamer--get-label headline info)))
                            ;; Labels containing colons need to be
                            ;; wrapped within braces.
-                           (format (if (string-search ":" label)
+                           (format (if (string-match-p ":" label)
                                        "label={%s}"
                                      "label=%s")
                                    label))))))
diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index 7874101c70..776a011df1 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -2640,7 +2640,7 @@ could be a member of `org-latex-caption-above' or `math'."
         (regexp-opt '("table" "longtable" "tabular" "tabu" "longtabu")))
        env)
       'table)
-     ((string-search "figure" env) 'image)
+     ((string-match-p "figure" env) 'image)
      ((string-match-p
        (eval-when-compile
         (regexp-opt '("lstlisting" "listing" "verbatim" "minted")))
@@ -2796,7 +2796,7 @@ used as a communication channel."
         (when (and search-option
                    (equal filetype "pdf")
                    (string-match-p "\\`[0-9]+\\'" search-option)
-                   (not (string-search "page=" options)))
+                   (not (string-match-p "page=" options)))
           (setq options (concat options ",page=" search-option))))
       (setq image-code
            (format "\\includegraphics%s{%s}"

Reply via email to