Browse Source

Use `split-string' instead of `org-split-string'

* contrib/lisp/org-depend.el (org-depend-trigger-todo):
(org-depend-block-todo):
* contrib/lisp/ox-bibtex.el (org-bibtex-get-arguments):
* contrib/lisp/ox-koma-letter.el (org-koma-letter-template):
* contrib/lisp/ox-taskjuggler.el (org-taskjuggler--build-unique-id):
(org-taskjuggler-resolve-dependencies):
* lisp/ob-core.el (org-babel-insert-result):
* lisp/org-agenda.el (org-search-view):
* lisp/org-lint.el (org-lint-duplicate-target):
(org-lint-wrong-header-value):
* lisp/org.el (org--setup-collect-keywords):
(org-make-org-heading-search-string):
(org-search-radio-target):
(org-local-logging):
(org-entry-add-to-multivalued-property):
(org-entry-remove-from-multivalued-property):
(org-entry-member-in-multivalued-property):
(org-entry-get-multivalued-property):
(org-entry-put-multivalued-property):
(org-wrap):
* lisp/ox-beamer.el (org-beamer-allowed-property-values):
* lisp/ox.el (org-export--get-subtree-options):
(org-export--get-inbuffer-options): Use `split-string' instead of
`org-split-string'.
Nicolas Goaziou 2 years ago
parent
commit
ea4e3dac6d

+ 2 - 2
contrib/lisp/org-depend.el

@@ -225,7 +225,7 @@ This does two different kinds of triggers:
       ;; Lets see if this entry has a TRIGGER property.
       ;; If yes, split it up on whitespace.
       (setq trigger (org-entry-get pos "TRIGGER")
-	    triggers (and trigger (org-split-string trigger "[ \t]+")))
+	    triggers (and trigger (split-string trigger)))
 
       ;; Go through all the triggers
       (while (setq tr (pop triggers))
@@ -383,7 +383,7 @@ this ID property, that entry is also checked."
 	    ;; Lets see if we will allow it.  Find the BLOCKER property
 	    ;; and split it on whitespace.
 	    (setq blocker (org-entry-get pos "BLOCKER")
-		  blockers (and blocker (org-split-string blocker "[ \t]+")))
+		  blockers (and blocker (split-string blocker)))
 
 	    ;; go through all the blockers
 	    (while (setq bl (pop blockers))

+ 1 - 1
contrib/lisp/ox-bibtex.el

@@ -124,7 +124,7 @@ contains a list of strings to be passed as options to
     (and value
          (string-match "\\(\\S-+\\)[ \t]+\\(\\S-+\\)\\(.*\\)" value)
          (let (options limit)
-           (dolist (arg (org-split-string (match-string 3 value))
+           (dolist (arg (split-string (match-string 3 value))
                         ;; Return value.
                         (list :options (nreverse options) :limit limit))
              (let* ((s (split-string arg ":"))

+ 3 - 3
contrib/lisp/ox-koma-letter.el

@@ -659,8 +659,8 @@ holding export options."
    ;; variables, then we insert LCO files, and, eventually, we insert
    ;; settings coming from buffer keywords.
    (org-koma-letter--build-settings 'global info)
-   (mapconcat #'(lambda (file) (format "\\LoadLetterOption{%s}\n" file))
-	      (org-split-string (or (plist-get info :lco) "") " ")
+   (mapconcat (lambda (file) (format "\\LoadLetterOption{%s}\n" file))
+	      (split-string (or (plist-get info :lco) ""))
 	      "")
    (org-koma-letter--build-settings 'buffer info)
    ;; Date.
@@ -717,7 +717,7 @@ holding export options."
    (format "\\closing{%s}\n"
 	   (org-koma-letter--keyword-or-headline
 	    :closing (lambda (h i) (eq (org-koma-letter--special-tag h i)
-				'closing))
+				       'closing))
 	    info))
    (org-koma-letter--special-contents-inline
     (plist-get info :special-tags-after-closing) info)

+ 3 - 3
contrib/lisp/ox-taskjuggler.el

@@ -520,7 +520,7 @@ headline or finally add more underscore characters (\"_\")."
   (let ((id (org-string-nw-p (org-element-property :TASK_ID item))))
     ;; If an id is specified, use it, as long as it's unique.
     (if (and id (not (member id unique-ids))) id
-      (let* ((parts (org-split-string (org-element-property :raw-value item)))
+      (let* ((parts (split-string (org-element-property :raw-value item)))
 	     (id (org-taskjuggler--clean-id (downcase (pop parts)))))
 	;; Try to add more parts of the headline to make it unique.
 	(while (and (car parts) (member id unique-ids))
@@ -554,8 +554,8 @@ channel."
          (let ((deps (concat (org-element-property :BLOCKER task)
                              (org-element-property :DEPENDS task))))
            (and deps
-                (org-split-string (replace-regexp-in-string "{.*?}" "" deps)
-                                  "[ ,]* +"))))
+                (split-string (replace-regexp-in-string "{.*?}" "" deps)
+			      "[ ,]* +"))))
         depends)
     (when deps-ids
       ;; Find tasks with :task_id: property matching id in DEPS-IDS.

+ 1 - 1
lisp/ob-core.el

@@ -2355,7 +2355,7 @@ INFO may provide the values of these header arguments (in the
 		   ((assq :wrap (nth 2 info))
 		    (let ((name (or (cdr (assq :wrap (nth 2 info))) "RESULTS")))
 		      (funcall wrap (concat "#+BEGIN_" name)
-			       (concat "#+END_" (car (org-split-string name)))
+			       (concat "#+END_" (car (split-string name)))
 			       nil nil (concat "{{{results(@@" name ":") "@@)}}}")))
 		   ((member "html" result-params)
 		    (funcall wrap "#+BEGIN_EXPORT html" "#+END_EXPORT" nil nil

+ 1 - 1
lisp/org-agenda.el

@@ -4425,7 +4425,7 @@ in `org-agenda-text-search-extra-files'."
       (if (or org-agenda-search-view-always-boolean
 	      (member (string-to-char words) '(?- ?+ ?\{)))
 	  (setq boolean t))
-      (setq words (org-split-string words))
+      (setq words (split-string words))
       (let (www w)
 	(while (setq w (pop words))
 	  (while (and (string-match "\\\\\\'" w) words)

+ 2 - 2
lisp/org-lint.el

@@ -353,7 +353,7 @@ called with one argument, the key used for comparison."
   (org-lint--collect-duplicates
    ast
    'target
-   (lambda (target) (org-split-string (org-element-property :value target)))
+   (lambda (target) (split-string (org-element-property :value target)))
    (lambda (target _) (org-element-property :begin target))
    (lambda (key)
      (format "Duplicate target <<%s>>" (mapconcat #'identity key " ")))))
@@ -1000,7 +1000,7 @@ Use \"export %s\" instead"
 	      (unless (memq allowed-values '(:any nil))
 		(let ((values (cdr header))
 		      groups-alist)
-		  (dolist (v (if (stringp values) (org-split-string values)
+		  (dolist (v (if (stringp values) (split-string values)
 			       (list values)))
 		    (let ((valid-value nil))
 		      (catch 'exit

+ 21 - 24
lisp/org.el

@@ -5085,7 +5085,7 @@ Return value contains the following keys: `archive', `category',
 	      ((equal key "CONSTANTS")
 	       (let* ((constants (assq 'constants alist))
 		      (store (cdr constants)))
-		 (dolist (pair (org-split-string value))
+		 (dolist (pair (split-string value))
 		   (when (string-match "^\\([a-zA-Z0][_a-zA-Z0-9]*\\)=\\(.*\\)"
 				       pair)
 		     (let* ((name (match-string 1 pair))
@@ -5100,7 +5100,7 @@ Return value contains the following keys: `archive', `category',
 		 (let ((old (assq 'filetags alist))
 		       (new (apply #'nconc
 				   (mapcar (lambda (x) (org-split-string x ":"))
-					   (org-split-string value)))))
+					   (split-string value)))))
 		   (if old (setcdr old (append new (cdr old)))
 		     (push (cons 'filetags new) alist)))))
 	      ((equal key "LINK")
@@ -5116,7 +5116,7 @@ Return value contains the following keys: `archive', `category',
 		 (push (cons 'scripts (read (match-string 1 value))) alist)))
 	      ((equal key "PRIORITIES")
 	       (push (cons 'priorities
-			   (let ((prio (org-split-string value)))
+			   (let ((prio (split-string value)))
 			     (if (< (length prio) 3) '(?A ?C ?B)
 			       (mapcar #'string-to-char prio))))
 		     alist))
@@ -5133,8 +5133,8 @@ Return value contains the following keys: `archive', `category',
 	       (let ((startup (assq 'startup alist)))
 		 (if startup
 		     (setcdr startup
-			     (append (cdr startup) (org-split-string value)))
-		   (push (cons 'startup (org-split-string value)) alist))))
+			     (append (cdr startup) (split-string value)))
+		   (push (cons 'startup (split-string value)) alist))))
 	      ((equal key "TAGS")
 	       (let ((tag-cell (assq 'tags alist)))
 		 (if tag-cell
@@ -5143,7 +5143,7 @@ Return value contains the following keys: `archive', `category',
 	      ((member key '("TODO" "SEQ_TODO" "TYP_TODO"))
 	       (let ((todo (assq 'todo alist))
 		     (value (cons (if (equal key "TYP_TODO") 'type 'sequence)
-				  (org-split-string value))))
+				  (split-string value))))
 		 (if todo (push value (cdr todo))
 		   (push (list 'todo value) alist))))
 	      ((equal key "SETUPFILE")
@@ -9913,7 +9913,7 @@ according to FMT (default from `org-email-link-description-format')."
 		      (org-back-to-heading t)
 		      (org-element-property :raw-value (org-element-at-point))))))
 	(lines org-context-in-file-links))
-    (or string (setq s (concat "*" s)))  ; Add * for headlines
+    (unless string (setq s (concat "*" s))) ;Add * for headlines
     (setq s (replace-regexp-in-string "\\[[0-9]+%\\]\\|\\[[0-9]+/[0-9]+\\]" "" s))
     (when (and string (integerp lines) (> lines 0))
       (let ((slines (org-split-string s "\n")))
@@ -9922,7 +9922,7 @@ according to FMT (default from `org-email-link-description-format')."
 		   'identity
 		   (reverse (nthcdr (- (length slines) lines)
 				    (reverse slines))) "\n")))))
-    (mapconcat 'identity (org-split-string s "[ \t]+") " ")))
+    (mapconcat #'identity (split-string s) " ")))
 
 (defun org-make-link-string (link &optional description)
   "Make a link with brackets, consisting of LINK and DESCRIPTION."
@@ -10814,7 +10814,7 @@ the window configuration before `org-open-at-point' was called using:
 White spaces are not significant."
   (let ((re (format "<<<%s>>>"
 		    (mapconcat #'regexp-quote
-			       (org-split-string target "[ \t\n]+")
+			       (split-string target)
 			       "[ \t]+\\(?:\n[ \t]*\\)?")))
 	(origin (point)))
     (goto-char (point-min))
@@ -12856,7 +12856,7 @@ This hook runs even if there is no statistics cookie present, in which case
   (setq org-log-done nil
         org-log-repeat nil
         org-todo-log-states nil)
-  (dolist (w (org-split-string value))
+  (dolist (w (split-string value))
     (let (a)
       (cond
        ((setq a (assoc w org-startup-options))
@@ -15828,44 +15828,41 @@ non-nil when a property was removed."
 (defun org-entry-add-to-multivalued-property (pom property value)
   "Add VALUE to the words in the PROPERTY in entry at point-or-marker POM."
   (let* ((old (org-entry-get pom property))
-	 (values (and old (org-split-string old "[ \t]"))))
+	 (values (and old (split-string old))))
     (setq value (org-entry-protect-space value))
     (unless (member value values)
       (setq values (append values (list value)))
-      (org-entry-put pom property
-		     (mapconcat 'identity values " ")))))
+      (org-entry-put pom property (mapconcat #'identity values " ")))))
 
 (defun org-entry-remove-from-multivalued-property (pom property value)
   "Remove VALUE from words in the PROPERTY in entry at point-or-marker POM."
   (let* ((old (org-entry-get pom property))
-	 (values (and old (org-split-string old "[ \t]"))))
+	 (values (and old (split-string old))))
     (setq value (org-entry-protect-space value))
     (when (member value values)
       (setq values (delete value values))
-      (org-entry-put pom property
-		     (mapconcat 'identity values " ")))))
+      (org-entry-put pom property (mapconcat #'identity values " ")))))
 
 (defun org-entry-member-in-multivalued-property (pom property value)
   "Is VALUE one of the words in the PROPERTY in entry at point-or-marker POM?"
   (let* ((old (org-entry-get pom property))
-	 (values (and old (org-split-string old "[ \t]"))))
+	 (values (and old (split-string old))))
     (setq value (org-entry-protect-space value))
     (member value values)))
 
 (defun org-entry-get-multivalued-property (pom property)
   "Return a list of values in a multivalued property."
   (let* ((value (org-entry-get pom property))
-	 (values (and value (org-split-string value "[ \t]"))))
-    (mapcar 'org-entry-restore-space values)))
+	 (values (and value (split-string value))))
+    (mapcar #'org-entry-restore-space values)))
 
 (defun org-entry-put-multivalued-property (pom property &rest values)
   "Set multivalued PROPERTY at point-or-marker POM to VALUES.
 VALUES should be a list of strings.  Spaces will be protected."
-  (org-entry-put pom property
-		 (mapconcat 'org-entry-protect-space values " "))
+  (org-entry-put pom property (mapconcat #'org-entry-protect-space values " "))
   (let* ((value (org-entry-get pom property))
-	 (values (and value (org-split-string value "[ \t]"))))
-    (mapcar 'org-entry-restore-space values)))
+	 (values (and value (split-string value))))
+    (mapcar #'org-entry-restore-space values)))
 
 (defun org-entry-protect-space (s)
   "Protect spaces and newline in string S."
@@ -21864,7 +21861,7 @@ wrapped to the length of that word.
 IF WIDTH is nil and LINES is non-nil, the string is forced into at most that
 many lines, whatever width that takes.
 The return value is a list of lines, without newlines at the end."
-  (let* ((words (org-split-string string "[ \t\n]+"))
+  (let* ((words (split-string string))
 	 (maxword (apply 'max (mapcar 'org-string-width words)))
 	 w ll)
     (cond (width

+ 3 - 3
lisp/ox-beamer.el

@@ -935,9 +935,9 @@ value."
 			 org-beamer-environments-default)))
    ((and (equal property "BEAMER_col")
 	 (not (org-entry-get nil (concat property "_ALL") 'inherit)))
-    ;; If no allowed values for BEAMER_col have been defined,
-    ;; supply some
-    (org-split-string org-beamer-column-widths " "))))
+    ;; If no allowed values for BEAMER_col have been defined, supply
+    ;; some.
+    (split-string org-beamer-column-widths " "))))
 
 (add-hook 'org-property-allowed-value-functions
 	  'org-beamer-allowed-property-values)

+ 2 - 2
lisp/ox.el

@@ -1452,7 +1452,7 @@ for export.  Return options as a plist."
 				  (parse
 				   (org-element-parse-secondary-string
 				    value (org-element-restriction 'keyword)))
-				  (split (org-split-string value))
+				  (split (split-string value))
 				  (t value))))))))))))
 
 (defun org-export--get-inbuffer-options (&optional backend)
@@ -1560,7 +1560,7 @@ Assume buffer is in Org mode.  Narrowing, if any, is ignored."
 					   "\n"
 					   (org-trim val))))
 				 (split `(,@(plist-get plist property)
-					  ,@(org-split-string val)))
+					  ,@(split-string val)))
 				 ((t) val)
 				 (otherwise
 				  (if (not (plist-member plist property)) val