diff --git a/contrib/lisp/org-contacts.el b/contrib/lisp/org-contacts.el index 72269de7e..309b9b963 100644 --- a/contrib/lisp/org-contacts.el +++ b/contrib/lisp/org-contacts.el @@ -317,16 +317,16 @@ cell corresponding to the contact properties. (cl-loop for contact in (org-contacts-db) if (or (and name-match - (org-string-match-p name-match + (string-match-p name-match (first contact))) (and prop-match (cl-find-if (lambda (prop) (and (string= (car prop-match) (car prop)) - (org-string-match-p (cdr prop-match) (cdr prop)))) + (string-match-p (cdr prop-match) (cdr prop)))) (caddr contact))) (and tags-match (cl-find-if (lambda (tag) - (org-string-match-p tags-match tag)) + (string-match-p tags-match tag)) (org-split-string (or (cdr (assoc-string "ALLTAGS" (caddr contact))) "") ":")))) collect contact))) @@ -505,7 +505,7 @@ prefixes rather than just the beginning of the string." A group FOO is composed of contacts with the tag FOO." (let* ((completion-ignore-case org-contacts-completion-ignore-case) - (group-completion-p (org-string-match-p + (group-completion-p (string-match-p (concat "^" org-contacts-group-prefix) string))) (when group-completion-p (let ((completion-list @@ -554,7 +554,7 @@ with BAR. See (org) Matching tags and properties for a complete description." (let* ((completion-ignore-case org-contacts-completion-ignore-case) - (completion-p (org-string-match-p + (completion-p (string-match-p (concat "^" org-contacts-tags-props-prefix) string))) (when completion-p (let ((result diff --git a/contrib/lisp/org-wl.el b/contrib/lisp/org-wl.el index 00bbf3253..befbc168c 100644 --- a/contrib/lisp/org-wl.el +++ b/contrib/lisp/org-wl.el @@ -291,7 +291,7 @@ for namazu index." ;; in the old buffer. (goto-char old-point)) (when article - (if (org-string-match-p "@" article) + (if (string-match-p "@" article) (wl-summary-jump-to-msg-by-message-id (org-add-angle-brackets article)) (or (wl-summary-jump-to-msg (string-to-number article)) diff --git a/contrib/lisp/ox-bibtex.el b/contrib/lisp/ox-bibtex.el index 4bf0a4b91..56dec3837 100644 --- a/contrib/lisp/ox-bibtex.el +++ b/contrib/lisp/ox-bibtex.el @@ -303,7 +303,7 @@ the HTML and ASCII backends." next) (while (and (setq next (org-export-get-next-element object info)) (or (and (stringp next) - (not (org-string-match-p "\\S-" next))) + (not (string-match-p "\\S-" next))) (org-bibtex-citation-p next))) (unless (stringp next) (push (org-bibtex-get-citation-key next) keys)) diff --git a/lisp/ob-core.el b/lisp/ob-core.el index 8bc07dd85..6e4362a3c 100644 --- a/lisp/ob-core.el +++ b/lisp/ob-core.el @@ -1801,7 +1801,7 @@ region is not active then the point is demarcated." (stars (concat (make-string (or (org-current-level) 1) ?*) " ")) (lower-case-p (and block (let (case-fold-search) - (org-string-match-p "#\\+begin_src" block))))) + (string-match-p "#\\+begin_src" block))))) (if info (mapc (lambda (place) diff --git a/lisp/ob-processing.el b/lisp/ob-processing.el index dfc4693e8..5a4596313 100644 --- a/lisp/ob-processing.el +++ b/lisp/ob-processing.el @@ -96,7 +96,7 @@ (progn (setq sketch-dir-candidate (make-temp-file "processing" t)) - (when (org-string-match-p + (when (string-match-p "-" (file-name-nondirectory sketch-dir-candidate)) (delete-directory sketch-dir-candidate) diff --git a/lisp/ob-stan.el b/lisp/ob-stan.el index 5faa8fc25..bf4e394df 100644 --- a/lisp/ob-stan.el +++ b/lisp/ob-stan.el @@ -69,7 +69,7 @@ Otherwise, write the Stan code directly to the named file." (or (cdr (assq :file params)) (user-error "Set :file argument to execute Stan blocks"))))) (if (or (not org-babel-stan-cmdstan-directory) - (org-string-match-p "\\.stan\\'" file)) + (string-match-p "\\.stan\\'" file)) (with-temp-file file (insert body)) (with-temp-file (concat file ".stan") (insert body)) (let ((default-directory org-babel-stan-cmdstan-directory)) diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index b47f8b6cb..298042bad 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -6441,7 +6441,7 @@ The flag is set if the currently compiled format contains a `%b'.") (defun org-agenda-get-category-icon (category) "Return an image for CATEGORY according to `org-agenda-category-icon-alist'." (dolist (entry org-agenda-category-icon-alist) - (when (org-string-match-p (car entry) category) + (when (string-match-p (car entry) category) (if (listp (cadr entry)) (return (cadr entry)) (return (apply 'create-image (cdr entry))))))) diff --git a/lisp/org-clock.el b/lisp/org-clock.el index 53dc0a214..03e6a2cc2 100644 --- a/lisp/org-clock.el +++ b/lisp/org-clock.el @@ -87,7 +87,7 @@ Return value is either a string, an integer, or nil." (cond ((equal p "nil") nil) ((equal p "t") (or (org-log-into-drawer) "LOGBOOK")) ((org-string-nw-p p) - (if (org-string-match-p "\\`[0-9]+\\'" p) (string-to-number p) p)) + (if (string-match-p "\\`[0-9]+\\'" p) (string-to-number p) p)) ((org-string-nw-p org-clock-into-drawer)) ((integerp org-clock-into-drawer) org-clock-into-drawer) ((not org-clock-into-drawer) nil) diff --git a/lisp/org-element.el b/lisp/org-element.el index 4079a5fcb..a4a2cc32c 100644 --- a/lisp/org-element.el +++ b/lisp/org-element.el @@ -3116,8 +3116,8 @@ Assume point is at the beginning of the link." ((string-match "\\`id:\\([-a-f0-9]+\\)\\'" raw-link) (setq type "id" path (match-string 1 raw-link))) ;; Code-ref type: PATH is the name of the reference. - ((and (org-string-match-p "\\`(" raw-link) - (org-string-match-p ")\\'" raw-link)) + ((and (string-match-p "\\`(" raw-link) + (string-match-p ")\\'" raw-link)) (setq type "coderef") (setq path (substring raw-link 1 -1))) ;; Custom-id type: PATH is the name of the custom id. diff --git a/lisp/org-lint.el b/lisp/org-lint.el index 444ab8032..ca69e9d1b 100644 --- a/lisp/org-lint.el +++ b/lisp/org-lint.el @@ -363,7 +363,7 @@ called with one argument, the key used for comparison." (lambda (k) (let ((key (org-element-property :key k))) (and (or (let ((case-fold-search t)) - (org-string-match-p "\\`ATTR_[-_A-Za-z0-9]+\\'" key)) + (string-match-p "\\`ATTR_[-_A-Za-z0-9]+\\'" key)) (member key keywords)) (list (org-element-property :post-affiliated k) (format "Orphaned affiliated keyword: \"%s\"" key)))))))) @@ -452,7 +452,7 @@ Use :header-args: instead" (list (org-element-property :post-affiliated b) "Invalid syntax in babel call block")) ((let ((h (org-element-property :end-header b))) - (and h (org-string-match-p "\\`\\[.*\\]\\'" h))) + (and h (string-match-p "\\`\\[.*\\]\\'" h))) (list (org-element-property :post-affiliated b) "Babel call's end header must not be wrapped within brackets")))))) @@ -738,7 +738,7 @@ Use \"export %s\" instead" (lambda (e) (let ((name (org-element-property :name e))) (and name - (org-string-match-p ":" name) + (string-match-p ":" name) (list (progn (goto-char (org-element-property :begin e)) (re-search-forward diff --git a/lisp/org-list.el b/lisp/org-list.el index dcd635694..57dedcd90 100644 --- a/lisp/org-list.el +++ b/lisp/org-list.el @@ -2095,8 +2095,8 @@ Possible values are: `folded', `children' or `subtree'. See (if (> start (+ ind org-list-description-max-indent)) (+ ind 5) start)) (+ (progn (goto-char (match-end 1)) (current-column)) (if (and org-list-two-spaces-after-bullet-regexp - (org-string-match-p org-list-two-spaces-after-bullet-regexp - (match-string 1))) + (string-match-p org-list-two-spaces-after-bullet-regexp + (match-string 1))) 2 1))))) diff --git a/lisp/org-macro.el b/lisp/org-macro.el index 0e650f56b..18e24deca 100644 --- a/lisp/org-macro.el +++ b/lisp/org-macro.el @@ -191,54 +191,54 @@ found in the buffer with no definition in TEMPLATES. Optional argument KEYWORDS, when non-nil is a list of keywords, as strings, where macro expansion is allowed." (org-with-wide-buffer - (goto-char (point-min)) - (let ((properties-regexp - (format "\\`EXPORT_%s\\+?\\'" (regexp-opt keywords))) - record) - (while (re-search-forward "{{{[-A-Za-z0-9_]" nil t) - (let* ((datum (save-match-data (org-element-context))) - (type (org-element-type datum)) - (macro - (cond - ((eq type 'macro) datum) - ;; In parsed keywords and associated node properties, - ;; force macro recognition. - ((or (and (eq type 'keyword) - (member (org-element-property :key datum) keywords)) - (and (eq type 'node-property) - (org-string-match-p - properties-regexp - (org-element-property :key datum)))) - (save-restriction - (narrow-to-region (match-beginning 0) (line-end-position)) - (org-element-map (org-element-parse-buffer) 'macro - #'identity nil t)))))) - (when macro - (let* ((value (org-macro-expand macro templates)) - (begin (org-element-property :begin macro)) - (signature (list begin - macro - (org-element-property :args macro)))) - ;; Avoid circular dependencies by checking if the same - ;; macro with the same arguments is expanded at the same - ;; position twice. - (cond ((member signature record) - (error "Circular macro expansion: %s" - (org-element-property :key macro))) - (value - (push signature record) - (delete-region - begin - ;; Preserve white spaces after the macro. - (progn (goto-char (org-element-property :end macro)) - (skip-chars-backward " \t") - (point))) - ;; Leave point before replacement in case of - ;; recursive expansions. - (save-excursion (insert value))) - (finalize - (error "Undefined Org macro: %s; aborting" - (org-element-property :key macro))))))))))) + (goto-char (point-min)) + (let ((properties-regexp + (format "\\`EXPORT_%s\\+?\\'" (regexp-opt keywords))) + record) + (while (re-search-forward "{{{[-A-Za-z0-9_]" nil t) + (let* ((datum (save-match-data (org-element-context))) + (type (org-element-type datum)) + (macro + (cond + ((eq type 'macro) datum) + ;; In parsed keywords and associated node properties, + ;; force macro recognition. + ((or (and (eq type 'keyword) + (member (org-element-property :key datum) keywords)) + (and (eq type 'node-property) + (string-match-p + properties-regexp + (org-element-property :key datum)))) + (save-restriction + (narrow-to-region (match-beginning 0) (line-end-position)) + (org-element-map (org-element-parse-buffer) 'macro + #'identity nil t)))))) + (when macro + (let* ((value (org-macro-expand macro templates)) + (begin (org-element-property :begin macro)) + (signature (list begin + macro + (org-element-property :args macro)))) + ;; Avoid circular dependencies by checking if the same + ;; macro with the same arguments is expanded at the same + ;; position twice. + (cond ((member signature record) + (error "Circular macro expansion: %s" + (org-element-property :key macro))) + (value + (push signature record) + (delete-region + begin + ;; Preserve white spaces after the macro. + (progn (goto-char (org-element-property :end macro)) + (skip-chars-backward " \t") + (point))) + ;; Leave point before replacement in case of + ;; recursive expansions. + (save-excursion (insert value))) + (finalize + (error "Undefined Org macro: %s; aborting" + (org-element-property :key macro))))))))))) (defun org-macro-escape-arguments (&rest args) "Build macro's arguments string from ARGS. diff --git a/lisp/org-plot.el b/lisp/org-plot.el index 867ad8acf..d014a8bfd 100644 --- a/lisp/org-plot.el +++ b/lisp/org-plot.el @@ -218,7 +218,7 @@ manner suitable for prepending to a user-specified script." (mapc ats lines) ; line (dolist (el sets) (funcall ats (format "set %s" el))) ; set ;; Unless specified otherwise, values are TAB separated. - (unless (org-string-match-p "^set datafile separator" script) + (unless (string-match-p "^set datafile separator" script) (funcall ats "set datafile separator \"\\t\"")) (when x-labels ; x labels (xtics) (funcall ats diff --git a/lisp/org-table.el b/lisp/org-table.el index 3d5960218..3a23862a7 100644 --- a/lisp/org-table.el +++ b/lisp/org-table.el @@ -689,7 +689,7 @@ extension of the given file name, and finally on the variable (or (car (delq nil (mapcar (lambda (f) - (and (org-string-match-p fileext f) f)) + (and (string-match-p fileext f) f)) formats))) org-table-export-default-format) t t) t t))) @@ -756,7 +756,7 @@ When nil, simply write \"#ERROR\" in corrupted fields.") ;; Table's rows. Separators are replaced by nil. Trailing ;; spaces are also removed. (lines (mapcar (lambda (l) - (and (not (org-string-match-p "\\`[ \t]*|-" l)) + (and (not (string-match-p "\\`[ \t]*|-" l)) (let ((l (org-trim l))) (remove-text-properties 0 (length l) '(display t org-cwidth t) l) @@ -833,7 +833,7 @@ edit. Full value is:\n" (unless (equal x "") (setq frac (/ (+ (* frac cnt) - (if (org-string-match-p org-table-number-regexp x) + (if (string-match-p org-table-number-regexp x) 1 0)) (cl-incf cnt))))) @@ -2313,7 +2313,7 @@ LOCATION is a buffer position, consider the formulas there." (cond ((not (match-end 2)) m) ;; Is it a column reference? - ((org-string-match-p "\\`$\\([0-9]+\\|[<>]+\\)\\'" m) m) + ((string-match-p "\\`$\\([0-9]+\\|[<>]+\\)\\'" m) m) ;; Since named columns are not possible in ;; LHS, assume this is a named field. (t (match-string 2 string))))) @@ -2926,7 +2926,7 @@ When CORNERS-ONLY is set, only return the corners of the range as a list (line1 column1 line2 column2) where line1 and line2 are line numbers relative to beginning of table, or TBEG, and column1 and column2 are table column numbers." - (let* ((desc (if (org-string-match-p "\\`\\$[0-9]+\\.\\.\\$[0-9]+\\'" desc) + (let* ((desc (if (string-match-p "\\`\\$[0-9]+\\.\\.\\$[0-9]+\\'" desc) (replace-regexp-in-string "\\$" "@0$" desc) desc)) (col (or col (org-table-current-column))) @@ -3170,7 +3170,7 @@ existing formula for column %s" new)) new)) (t old-lhs))))) - (if (org-string-match-p "\\`\\$[0-9]+\\'" lhs) + (if (string-match-p "\\`\\$[0-9]+\\'" lhs) (push (cons lhs rhs) eqlcol) (push (cons lhs rhs) eqlfield)))) (setq eqlcol (nreverse eqlcol)) @@ -3383,13 +3383,13 @@ function assumes the table is already analyzed (i.e., using (let ((lhs (car e)) (rhs (cdr e))) (cond - ((org-string-match-p "\\`@-?[-+0-9]+\\$-?[0-9]+\\'" lhs) + ((string-match-p "\\`@-?[-+0-9]+\\$-?[0-9]+\\'" lhs) ;; This just refers to one fixed field. (push e res)) - ((org-string-match-p "\\`[a-zA-Z][_a-zA-Z0-9]*\\'" lhs) + ((string-match-p "\\`[a-zA-Z][_a-zA-Z0-9]*\\'" lhs) ;; This just refers to one fixed named field. (push e res)) - ((org-string-match-p "\\`\\$[0-9]+\\'" lhs) + ((string-match-p "\\`\\$[0-9]+\\'" lhs) ;; Column formulas are treated specially and are not ;; expanded. (push e res)) @@ -3445,7 +3445,7 @@ borders of the table using the @< @> $< $> makers." "Replace $const with values in string F." (let ((start 0) (pp (/= (string-to-char f) ?')) - (duration (org-string-match-p ";.*[Tt].*\\'" f)) + (duration (string-match-p ";.*[Tt].*\\'" f)) (new (replace-regexp-in-string ; Check for column names. org-table-column-name-regexp (lambda (m) @@ -3988,10 +3988,10 @@ When LOCAL is non-nil, show references for the table at point." (when dest (setq name (substring dest 1)) (cond - ((org-string-match-p "\\`\\$[a-zA-Z][a-zA-Z0-9]*" dest) + ((string-match-p "\\`\\$[a-zA-Z][a-zA-Z0-9]*" dest) (org-table-goto-field dest)) - ((org-string-match-p "\\`@\\([1-9][0-9]*\\)\\$\\([1-9][0-9]*\\)\\'" - dest) + ((string-match-p "\\`@\\([1-9][0-9]*\\)\\$\\([1-9][0-9]*\\)\\'" + dest) (org-table-goto-field dest)) (t (org-table-goto-column (string-to-number name)))) (move-marker pos (point)) @@ -5197,7 +5197,7 @@ supported. It is also possible to use the following one: params))) (columns (let ((w (plist-get params :columns))) (cond ((not w) nil) - ((org-string-match-p "{\\|@columnfractions " w) w) + ((string-match-p "{\\|@columnfractions " w) w) (t (concat "@columnfractions " w)))))) (if (not columns) output (replace-regexp-in-string @@ -5438,7 +5438,7 @@ distinguished from a plain table name or ID." (save-match-data (let ((eq (org-table-formula-handle-first/last-rc (match-string 1 m)))) (org-table-get-range - (if (org-string-match-p "\\`\\$[0-9]+\\'" eq) + (if (string-match-p "\\`\\$[0-9]+\\'" eq) (concat "@0" eq) eq))))) form t t 1))) diff --git a/lisp/org.el b/lisp/org.el index 1e4a91df5..e183053fe 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -10200,7 +10200,7 @@ according to FMT (default from `org-email-link-description-format')." ;; square brackets). File links however, are ;; encoded since, e.g., spaces are significant. ((or (file-name-absolute-p link) - (org-string-match-p "\\`\\.\\.?/\\|[][]" link)) + (string-match-p "\\`\\.\\.?/\\|[][]" link)) (org-link-escape link)) (t link))) (description @@ -10752,13 +10752,11 @@ PATH is the sexp to evaluate, as a string." (let ((cmd path)) (if (or (and (org-string-nw-p org-confirm-elisp-link-not-regexp) - (org-string-match-p - org-confirm-elisp-link-not-regexp cmd)) + (string-match-p org-confirm-elisp-link-not-regexp cmd)) (not org-confirm-elisp-link-function) (funcall org-confirm-elisp-link-function (format "Execute \"%s\" as elisp? " - (org-add-props cmd nil - 'face 'org-warning)))) + (org-add-props cmd nil 'face 'org-warning)))) (message "%s => %s" cmd (if (eq (string-to-char cmd) ?\() (eval (read cmd)) @@ -10925,7 +10923,7 @@ link in a property drawer line." ((equal app "emacs") 'emacs) ((equal app "sys") 'system)) (cond ((not option) nil) - ((org-string-match-p "\\`[0-9]+\\'" option) + ((string-match-p "\\`[0-9]+\\'" option) (list (string-to-number option))) (t (list nil (org-link-unescape option))))))))) @@ -13878,16 +13876,16 @@ EXTRA is additional text that will be inserted into the notes buffer." org-log-note-effective-time)) (cons "%s" (cond ((not org-log-note-state) "") - ((org-string-match-p org-ts-regexp - org-log-note-state) + ((string-match-p org-ts-regexp + org-log-note-state) (format "\"[%s]\"" (substring org-log-note-state 1 -1))) (t (format "\"%s\"" org-log-note-state)))) (cons "%S" (cond ((not org-log-note-previous-state) "") - ((org-string-match-p org-ts-regexp - org-log-note-previous-state) + ((string-match-p org-ts-regexp + org-log-note-previous-state) (format "\"[%s]\"" (substring org-log-note-previous-state 1 -1))) @@ -14535,7 +14533,7 @@ also TODO lines." (if (or (eq t org-use-property-inheritance) (and (stringp org-use-property-inheritance) (let ((case-fold-search t)) - (org-string-match-p org-use-property-inheritance property))) + (string-match-p org-use-property-inheritance property))) (and (listp org-use-property-inheritance) (member-ignore-case property org-use-property-inheritance))) ;; Caching is not possible, check it directly. @@ -15688,7 +15686,7 @@ Being in this list makes sure that they are offered for completion.") "Non nil when string PROPERTY is a valid property name." (not (or (equal property "") - (org-string-match-p "\\s-" property)))) + (string-match-p "\\s-" property)))) (defun org--update-property-plist (key val props) "Associate KEY to VAL in alist PROPS. @@ -15993,7 +15991,7 @@ strings." ;; properties to be named as special properties. (while (re-search-forward org-property-re end t) (let* ((key (upcase (match-string-no-properties 2))) - (extendp (org-string-match-p "\\+\\'" key)) + (extendp (string-match-p "\\+\\'" key)) (key-base (if extendp (substring key 0 -1) key)) (value (match-string-no-properties 3))) (cond @@ -16336,7 +16334,7 @@ automatically performed, such drawers will be silently ignored." (let ((p (progn (looking-at org-property-re) (match-string-no-properties 2)))) ;; Only add true property name, not extension symbol. - (push (if (not (org-string-match-p "\\+\\'" p)) p + (push (if (not (string-match-p "\\+\\'" p)) p (substring p 0 -1)) props)) (forward-line)))) @@ -16404,7 +16402,7 @@ Point is left between drawer's boundaries." ;; With C-u, fall back on `org-insert-property-drawer' (arg (org-insert-property-drawer)) ;; Check validity of suggested drawer's name. - ((not (org-string-match-p org-drawer-regexp (format ":%s:" drawer))) + ((not (string-match-p org-drawer-regexp (format ":%s:" drawer))) (user-error "Invalid drawer name")) ;; With an active region, insert a drawer at point. ((not (org-region-active-p)) @@ -19722,8 +19720,8 @@ boundaries." (let ((parent (org-element-property :parent link))) (or (not (eq (org-element-type parent) 'link)) (not (cdr (org-element-contents parent))))) - (org-string-match-p file-extension-re - (org-element-property :path link))) + (string-match-p file-extension-re + (org-element-property :path link))) (let ((file (expand-file-name (org-link-unescape (org-element-property :path link))))) @@ -24120,8 +24118,8 @@ unless optional argument NO-INHERITANCE is non-nil." ((let ((headline (nth 4 (org-heading-components)))) (and headline (let ((case-fold-search nil)) - (org-string-match-p (concat "^" org-comment-string "\\(?: \\|$\\)") - headline))))) + (string-match-p (concat "^" org-comment-string "\\(?: \\|$\\)") + headline))))) (no-inheritance nil) (t (save-excursion (and (org-up-heading-safe) (org-in-commented-heading-p)))))) diff --git a/lisp/ox-ascii.el b/lisp/ox-ascii.el index 6c707f8d0..e954980f8 100644 --- a/lisp/ox-ascii.el +++ b/lisp/ox-ascii.el @@ -1480,14 +1480,14 @@ information." (org-ascii--justify-element (let ((case-fold-search t)) (cond - ((org-string-match-p "\\" value) + ((string-match-p "\\" value) (let ((depth (and (string-match "\\<[0-9]+\\>" value) (string-to-number (match-string 0 value)))) - (localp (org-string-match-p "\\" value))) + (localp (string-match-p "\\" value))) (org-ascii--build-toc info depth keyword localp))) - ((org-string-match-p "\\" value) + ((string-match-p "\\" value) (org-ascii--list-tables keyword info)) - ((org-string-match-p "\\" value) + ((string-match-p "\\" value) (org-ascii--list-listings keyword info)))) keyword info))))) diff --git a/lisp/ox-beamer.el b/lisp/ox-beamer.el index 4505e2c13..3b42f6066 100644 --- a/lisp/ox-beamer.el +++ b/lisp/ox-beamer.el @@ -451,7 +451,7 @@ used as a communication channel." (let ((label (org-beamer--get-label headline info))) ;; Labels containing colons need to be ;; wrapped within braces. - (format (if (org-string-match-p ":" label) + (format (if (string-match-p ":" label) "label={%s}" "label=%s") label))))))) diff --git a/lisp/ox-html.el b/lisp/ox-html.el index ce4694df1..cbcd65ec9 100644 --- a/lisp/ox-html.el +++ b/lisp/ox-html.el @@ -2743,7 +2743,7 @@ CONTENTS is nil. INFO is a plist holding contextual information." ((string-match "\\" value) (let ((depth (and (string-match "\\<[0-9]+\\>" value) (string-to-number (match-string 0 value)))) - (localp (org-string-match-p "\\" value))) + (localp (string-match-p "\\" value))) (org-html-toc depth info (and localp keyword)))) ((string= "listings" value) (org-html-list-of-listings info)) ((string= "tables" value) (org-html-list-of-tables info)))))))) diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index 090172693..991d5272e 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -1251,7 +1251,7 @@ Eventually, if FULL is non-nil, wrap label within \"\\label{}\"." (headline "sec:") (table "tab:") (latex-environment - (and (org-string-match-p + (and (string-match-p org-latex-math-environments-re (org-element-property :value datum)) "eq:")) @@ -1924,7 +1924,8 @@ holding contextual information." (format "\\begin{%s}\n" (if numberedp 'enumerate 'itemize))) ;; Itemize headline "\\item" - (and full-text (org-string-match-p "\\`[ \t]*\\[" full-text) + (and full-text + (string-match-p "\\`[ \t]*\\[" full-text) "\\relax") " " full-text "\n" headline-label @@ -1961,8 +1962,8 @@ holding contextual information." (lambda (k) (and (equal (org-element-property :key k) "TOC") (let ((v (org-element-property :value k))) - (and (org-string-match-p "\\" v) - (org-string-match-p "\\" v) + (and (string-match-p "\\" v) + (string-match-p "\\" v) (format "\\stopcontents[level-%d]" level))))) info t))))) (if (and opt-title @@ -2150,7 +2151,7 @@ contextual information." ;; unless the brackets comes from an initial export ;; snippet (i.e. it is inserted willingly by the user). ((and contents - (org-string-match-p "\\`[ \t]*\\[" contents) + (string-match-p "\\`[ \t]*\\[" contents) (not (let ((e (car (org-element-contents item)))) (and (eq (org-element-type e) 'paragraph) (let ((o (car (org-element-contents e)))) @@ -2182,8 +2183,8 @@ CONTENTS is nil. INFO is a plist holding contextual information." ((string= key "TOC") (let ((case-fold-search t)) (cond - ((org-string-match-p "\\" value) - (let* ((localp (org-string-match-p "\\" value)) + ((string-match-p "\\" value) + (let* ((localp (string-match-p "\\" value)) (parent (org-element-lineage keyword '(headline))) (level (if (not (and localp parent)) 0 (org-export-get-relative-level parent info))) @@ -2199,8 +2200,8 @@ CONTENTS is nil. INFO is a plist holding contextual information." \\printcontents[level-%d]{}{0}{%s}" level level (or depth "")) (concat depth (and depth "\n") "\\tableofcontents")))) - ((org-string-match-p "\\" value) "\\listoftables") - ((org-string-match-p "\\" value) + ((string-match-p "\\" value) "\\listoftables") + ((string-match-p "\\" value) (cl-case (plist-get info :latex-listings) ((nil) "\\listoffigures") (minted "\\listoflistings") @@ -2326,8 +2327,8 @@ used as a communication channel." (let ((search-option (org-element-property :search-option link))) (when (and search-option (equal filetype "pdf") - (org-string-match-p "\\`[0-9]+\\'" search-option) - (not (org-string-match-p "page=" options))) + (string-match-p "\\`[0-9]+\\'" search-option) + (not (string-match-p "page=" options))) (setq options (concat options ",page=" search-option)))) (setq image-code (format "\\includegraphics%s{%s}" @@ -2814,7 +2815,7 @@ contextual information." (custom-env (let ((caption-str (org-latex--caption/label-string src-block info)) (formatted-src (org-export-format-code-default src-block info))) - (if (org-string-match-p "\\`[a-zA-Z0-9]+\\'" custom-env) + (if (string-match-p "\\`[a-zA-Z0-9]+\\'" custom-env) (format "\\begin{%s}\n%s\\end{%s}\n" custom-env (concat (and caption-above-p caption-str) diff --git a/lisp/ox-odt.el b/lisp/ox-odt.el index 29a0b8573..4aee7b543 100644 --- a/lisp/ox-odt.el +++ b/lisp/ox-odt.el @@ -200,8 +200,7 @@ heuristically based on the values of `org-odt-lib-dir' and (file-readable-p (expand-file-name "OrgOdtStyles.xml" styles-dir))) - (message "Debug (ox-odt): Using styles under %s" - styles-dir) + (message "Debug (ox-odt): Using styles under %s" styles-dir) (throw 'styles-dir styles-dir))))))) (unless styles-dir (error "Error (ox-odt): Cannot find factory styles files, aborting")) @@ -2013,13 +2012,13 @@ information." ((string= key "TOC") (let ((case-fold-search t)) (cond - ((org-string-match-p "\\" value) + ((string-match-p "\\" value) (let ((depth (or (and (string-match "\\<[0-9]+\\>" value) (string-to-number (match-string 0 value))) (plist-get info :headline-levels))) - (localp (org-string-match-p "\\" value))) + (localp (string-match-p "\\" value))) (org-odt-toc depth info (and localp keyword)))) - ((org-string-match-p "tables\\|figures\\|listings" value) + ((string-match-p "tables\\|figures\\|listings" value) ;; FIXME (ignore)))))))) @@ -3765,7 +3764,7 @@ contextual information." nil processing-type) (buffer-substring-no-properties (point-min) (point-max))))) - (if (org-string-match-p "file:\\([^]]*\\)" link) link + (if (string-match-p "file:\\([^]]*\\)" link) link (message "LaTeX Conversion failed.") nil)))) (when org-link diff --git a/lisp/ox-texinfo.el b/lisp/ox-texinfo.el index be935fefa..e36c1e30e 100644 --- a/lisp/ox-texinfo.el +++ b/lisp/ox-texinfo.el @@ -548,7 +548,7 @@ holding export options." (name (symbol-name (or org-texinfo-coding-system buffer-file-coding-system)))) (dolist (system org-texinfo-supported-coding-systems "UTF-8") - (when (org-string-match-p (regexp-quote system) name) + (when (string-match-p (regexp-quote system) name) (throw 'coding-system system)))))) (language (plist-get info :language)) (case-fold-search nil)) @@ -585,7 +585,7 @@ holding export options." (let ((dirdesc (let ((desc (plist-get info :texinfo-dirdesc))) (cond ((not desc) nil) - ((org-string-match-p "\\.$" desc) desc) + ((string-match-p "\\.$" desc) desc) (t (concat desc ".")))))) (if dirdesc (format "%-23s %s" dirtitle dirdesc) dirtitle)) "\n" @@ -916,10 +916,10 @@ CONTENTS is nil. INFO is a plist holding contextual information." ((string= key "TINDEX") (format "@tindex %s" value)) ((string= key "VINDEX") (format "@vindex %s" value)) ((string= key "TOC") - (cond ((org-string-match-p "\\" value) + (cond ((string-match-p "\\" value) (concat "@listoffloats " (org-export-translate "Table" :utf-8 info))) - ((org-string-match-p "\\" value) + ((string-match-p "\\" value) (concat "@listoffloats " (org-export-translate "Listing" :utf-8 info)))))))) @@ -1307,8 +1307,8 @@ as a communication channel." "Transcode a SRC-BLOCK element from Org to Texinfo. CONTENTS holds the contents of the item. INFO is a plist holding contextual information." - (let* ((lisp (org-string-match-p "lisp" - (org-element-property :language src-block))) + (let* ((lisp (string-match-p "lisp" + (org-element-property :language src-block))) (code (org-texinfo--sanitize-content (org-export-format-code-default src-block info))) (value (format diff --git a/lisp/ox.el b/lisp/ox.el index 8472e9dee..929aa8c84 100644 --- a/lisp/ox.el +++ b/lisp/ox.el @@ -4151,8 +4151,8 @@ This only applies to links without a description." (catch 'exit (dolist (rule (or rules org-export-default-inline-image-rule)) (and (string= (org-element-property :type link) (car rule)) - (org-string-match-p (cdr rule) - (org-element-property :path link)) + (string-match-p (cdr rule) + (org-element-property :path link)) (throw 'exit t))))))) (defun org-export-resolve-coderef (ref info) @@ -4335,7 +4335,7 @@ has type \"radio\"." (defun org-export-file-uri (filename) "Return file URI associated to FILENAME." - (cond ((org-string-match-p "\\`//" filename) (concat "file:" filename)) + (cond ((string-match-p "\\`//" filename) (concat "file:" filename)) ((not (file-name-absolute-p filename)) filename) ((org-file-remote-p filename) (concat "file:/" filename)) (t (concat "file://" (expand-file-name filename))))) diff --git a/testing/lisp/test-org-table.el b/testing/lisp/test-org-table.el index c036ece4c..908ba707a 100644 --- a/testing/lisp/test-org-table.el +++ b/testing/lisp/test-org-table.el @@ -1434,7 +1434,7 @@ See also `test-org-table/copy-field'." ;; Test :raw parameter. (when (featurep 'ox-latex) (should - (org-string-match-p + (string-match-p "/a/" (orgtbl-to-generic (org-table-to-lisp "| /a/ | b |") '(:backend latex :raw t))))) @@ -1471,7 +1471,7 @@ See also `test-org-table/copy-field'." '(:environment "tabularx")))) ;; Test :booktabs parameter. (should - (org-string-match-p + (string-match-p "\\toprule" (orgtbl-to-latex (org-table-to-lisp "| a |") '(:booktabs t)))) ;; Handle LaTeX snippets. (should @@ -1479,7 +1479,7 @@ See also `test-org-table/copy-field'." (orgtbl-to-latex (org-table-to-lisp "| $x$ |") nil))) ;; Test pseudo objects and :raw parameter. (should - (org-string-match-p + (string-match-p "\\$x\\$" (orgtbl-to-latex (org-table-to-lisp "| $x$ |") '(:raw t))))) (ert-deftest test-org-table/to-html () @@ -1500,11 +1500,11 @@ See also `test-org-table/copy-field'." ")) ;; Test :attributes parameter. (should - (org-string-match-p + (string-match-p "" (orgtbl-to-html (org-table-to-lisp "| a |") '(:attributes nil)))) (should - (org-string-match-p + (string-match-p "
" (orgtbl-to-html (org-table-to-lisp "| a |") '(:attributes (:border "2")))))) @@ -1842,7 +1842,7 @@ is t, then new columns should be added as needed" (ert-deftest test-org-table/named-field () "Test formula with a named field." (should - (org-string-match-p + (string-match-p "| +| +1 +|" (org-test-with-temp-text " | | | @@ -1851,7 +1851,7 @@ is t, then new columns should be added as needed" (org-table-calc-current-TBLFM) (buffer-string)))) (should - (org-string-match-p + (string-match-p "| +| +1 +|" (org-test-with-temp-text " | _ | name | @@ -1863,7 +1863,7 @@ is t, then new columns should be added as needed" (ert-deftest test-org-table/named-column () "Test formula with a named field." (should - (org-string-match-p + (string-match-p "| +| +1 +| +1 +|" (org-test-with-temp-text " | ! | name | | @@ -1875,7 +1875,7 @@ is t, then new columns should be added as needed" (ert-deftest test-org-table/tab-indent () "Test named fields with tab indentation." (should - (org-string-match-p + (string-match-p "| # | 111 |" (org-test-with-temp-text " @@ -1890,7 +1890,7 @@ is t, then new columns should be added as needed" (ert-deftest test-org-table/first-rc () "Test \"$<\" and \"@<\" constructs in formulas." (should - (org-string-match-p + (string-match-p "| 1 | 2 |" (org-test-with-temp-text "| | 2 | @@ -1898,7 +1898,7 @@ is t, then new columns should be added as needed" (org-table-calc-current-TBLFM) (buffer-string)))) (should - (org-string-match-p + (string-match-p "| 2 |\n| 2 |" (org-test-with-temp-text "| 2 |\n| | @@ -1909,14 +1909,14 @@ is t, then new columns should be added as needed" (ert-deftest test-org-table/last-rc () "Test \"$>\" and \"@>\" constructs in formulas." (should - (org-string-match-p + (string-match-p "| 2 | 1 |" (org-test-with-temp-text "| 2 | |\n#+TBLFM: $>=1" (org-table-calc-current-TBLFM) (buffer-string)))) (should - (org-string-match-p + (string-match-p "| 2 |\n| 2 |" (org-test-with-temp-text "| 2 |\n| |\n#+TBLFM: @>$1=@<"