diff --git a/latex.el b/latex.el index 643021d48e..68ed0f3389 100644 --- a/latex.el +++ b/latex.el @@ -1733,7 +1733,7 @@ This is necessary since index entries may contain commands and stuff.") (defun LaTeX-split-bibs (match) "Extract bibliography resources from MATCH. Split the string at commas and remove Biber file extensions." - (let ((bibs (TeX-split-string " *, *" (TeX-match-buffer match)))) + (let ((bibs (split-string (TeX-match-buffer match) " *, *"))) (dolist (bib bibs) (LaTeX-add-bibliographies (replace-regexp-in-string (concat "\\(?:\\." @@ -1841,7 +1841,7 @@ The value is actually the tail of the list of options given to PACKAGE." ;; Cleanup BibTeX/Biber files (setq LaTeX-auto-bibliography (apply #'append (mapcar (lambda (arg) - (TeX-split-string "," arg)) + (split-string arg ",")) LaTeX-auto-bibliography))) ;; Reset class and packages options for the current buffer @@ -1865,8 +1865,8 @@ The value is actually the tail of the list of options given to PACKAGE." ;; Treat documentclass/documentstyle specially. (if (or (string-equal "package" class) (string-equal "Package" class)) - (dolist (elt (TeX-split-string - "\\([ \t\r\n]\\|%[^\n\r]*[\n\r]\\|,\\)+" style)) + (dolist (elt (split-string + style "\\([ \t\r\n]\\|%[^\n\r]*[\n\r]\\|,\\)+")) ;; Append style to the style list. (add-to-list 'TeX-auto-file elt t) ;; Append to `LaTeX-provided-package-options' the name of the @@ -6856,7 +6856,7 @@ function would return non-nil and `(match-string 1)' would return (point-max) t) (setq optstr (TeX-match-buffer 1) docstyle (TeX-match-buffer 2) - optlist (TeX-split-string "," optstr)) + optlist (split-string optstr ",")) (if (search-forward-regexp "\\\\documentstyle{\\([^}]*\\)}" (point-max) t) diff --git a/style/babel.el b/style/babel.el index 548f2c85b1..9206dac088 100644 --- a/style/babel.el +++ b/style/babel.el @@ -115,7 +115,7 @@ ;; take the car of `LaTeX-provided-class-options'. (cdr (car LaTeX-provided-class-options)) (cdr (assoc "babel" LaTeX-provided-package-options)))) - (setq elt (TeX-split-string "=" elt)) + (setq elt (split-string elt "=")) (if (equal (car elt) "main") ;; Starting from version 3.9 of `babel' package, languages can be set ;; with the following syntax: @@ -126,7 +126,7 @@ (setq main-language (car (cdr elt))) ;; Get rid of the modifiers (`medieval' and `notilde' in the above ;; example). - (setq elt (car (TeX-split-string "\\." (car elt)))) + (setq elt (car (split-string (car elt) "\\."))) (if (member elt LaTeX-babel-language-list) ;; Append element to `active-languages' to respect loading order. ;; `babel' package uses as default language the last loaded one, diff --git a/tex.el b/tex.el index 2642c0b6e2..888a776a3b 100644 --- a/tex.el +++ b/tex.el @@ -2570,36 +2570,13 @@ be relative to that." :group 'TeX-file :type 'string) -(defun TeX-split-string (regexp string) - "Return a list of strings. -Given REGEXP the STRING is split into sections which in string was -separated by REGEXP. - -Examples: - - (TeX-split-string \"\:\" \"abc:def:ghi\") - -> (\"abc\" \"def\" \"ghi\") - - (TeX-split-string \" +\" \"dvips -Plw -p3 -c4 testfile.dvi\") - - -> (\"dvips\" \"-Plw\" \"-p3\" \"-c4\" \"testfile.dvi\") - -If REGEXP is nil, or \"\", an error will occur." - - (let ((start 0) result match) - (while (setq match (string-match regexp string start)) - (push (substring string start match) result) - (setq start (match-end 0))) - (push (substring string start) result) - (nreverse result))) - (defun TeX-parse-path (env) "Return a list if private TeX directories found in environment variable ENV." (let* ((value (getenv env)) (entries (and value - (TeX-split-string - (if (string-match ";" value) ";" ":") - value))) + (split-string + value + (if (string-match ";" value) ";" ":")))) (global (append '("/" "\\") (mapcar #'file-name-as-directory TeX-macro-global)))