浏览代码

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 8 年之前
父节点
当前提交
ea4e3dac6d
共有 10 个文件被更改,包括 39 次插入42 次删除
  1. 2 2
      contrib/lisp/org-depend.el
  2. 1 1
      contrib/lisp/ox-bibtex.el
  3. 3 3
      contrib/lisp/ox-koma-letter.el
  4. 3 3
      contrib/lisp/ox-taskjuggler.el
  5. 1 1
      lisp/ob-core.el
  6. 1 1
      lisp/org-agenda.el
  7. 2 2
      lisp/org-lint.el
  8. 21 24
      lisp/org.el
  9. 3 3
      lisp/ox-beamer.el
  10. 2 2
      lisp/ox.el

+ 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.
       ;; Lets see if this entry has a TRIGGER property.
       ;; If yes, split it up on whitespace.
       ;; If yes, split it up on whitespace.
       (setq trigger (org-entry-get pos "TRIGGER")
       (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
       ;; Go through all the triggers
       (while (setq tr (pop 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
 	    ;; Lets see if we will allow it.  Find the BLOCKER property
 	    ;; and split it on whitespace.
 	    ;; and split it on whitespace.
 	    (setq blocker (org-entry-get pos "BLOCKER")
 	    (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
 	    ;; go through all the blockers
 	    (while (setq bl (pop 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
     (and value
          (string-match "\\(\\S-+\\)[ \t]+\\(\\S-+\\)\\(.*\\)" value)
          (string-match "\\(\\S-+\\)[ \t]+\\(\\S-+\\)\\(.*\\)" value)
          (let (options limit)
          (let (options limit)
-           (dolist (arg (org-split-string (match-string 3 value))
+           (dolist (arg (split-string (match-string 3 value))
                         ;; Return value.
                         ;; Return value.
                         (list :options (nreverse options) :limit limit))
                         (list :options (nreverse options) :limit limit))
              (let* ((s (split-string arg ":"))
              (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
    ;; variables, then we insert LCO files, and, eventually, we insert
    ;; settings coming from buffer keywords.
    ;; settings coming from buffer keywords.
    (org-koma-letter--build-settings 'global info)
    (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)
    (org-koma-letter--build-settings 'buffer info)
    ;; Date.
    ;; Date.
@@ -717,7 +717,7 @@ holding export options."
    (format "\\closing{%s}\n"
    (format "\\closing{%s}\n"
 	   (org-koma-letter--keyword-or-headline
 	   (org-koma-letter--keyword-or-headline
 	    :closing (lambda (h i) (eq (org-koma-letter--special-tag h i)
 	    :closing (lambda (h i) (eq (org-koma-letter--special-tag h i)
-				'closing))
+				       'closing))
 	    info))
 	    info))
    (org-koma-letter--special-contents-inline
    (org-koma-letter--special-contents-inline
     (plist-get info :special-tags-after-closing) info)
     (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))))
   (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 an id is specified, use it, as long as it's unique.
     (if (and id (not (member id unique-ids))) id
     (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)))))
 	     (id (org-taskjuggler--clean-id (downcase (pop parts)))))
 	;; Try to add more parts of the headline to make it unique.
 	;; Try to add more parts of the headline to make it unique.
 	(while (and (car parts) (member id unique-ids))
 	(while (and (car parts) (member id unique-ids))
@@ -554,8 +554,8 @@ channel."
          (let ((deps (concat (org-element-property :BLOCKER task)
          (let ((deps (concat (org-element-property :BLOCKER task)
                              (org-element-property :DEPENDS task))))
                              (org-element-property :DEPENDS task))))
            (and deps
            (and deps
-                (org-split-string (replace-regexp-in-string "{.*?}" "" deps)
-                                  "[ ,]* +"))))
+                (split-string (replace-regexp-in-string "{.*?}" "" deps)
+			      "[ ,]* +"))))
         depends)
         depends)
     (when deps-ids
     (when deps-ids
       ;; Find tasks with :task_id: property matching id in 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))
 		   ((assq :wrap (nth 2 info))
 		    (let ((name (or (cdr (assq :wrap (nth 2 info))) "RESULTS")))
 		    (let ((name (or (cdr (assq :wrap (nth 2 info))) "RESULTS")))
 		      (funcall wrap (concat "#+BEGIN_" name)
 		      (funcall wrap (concat "#+BEGIN_" name)
-			       (concat "#+END_" (car (org-split-string name)))
+			       (concat "#+END_" (car (split-string name)))
 			       nil nil (concat "{{{results(@@" name ":") "@@)}}}")))
 			       nil nil (concat "{{{results(@@" name ":") "@@)}}}")))
 		   ((member "html" result-params)
 		   ((member "html" result-params)
 		    (funcall wrap "#+BEGIN_EXPORT html" "#+END_EXPORT" nil nil
 		    (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
       (if (or org-agenda-search-view-always-boolean
 	      (member (string-to-char words) '(?- ?+ ?\{)))
 	      (member (string-to-char words) '(?- ?+ ?\{)))
 	  (setq boolean t))
 	  (setq boolean t))
-      (setq words (org-split-string words))
+      (setq words (split-string words))
       (let (www w)
       (let (www w)
 	(while (setq w (pop words))
 	(while (setq w (pop words))
 	  (while (and (string-match "\\\\\\'" w) 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
   (org-lint--collect-duplicates
    ast
    ast
    'target
    '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 (target _) (org-element-property :begin target))
    (lambda (key)
    (lambda (key)
      (format "Duplicate target <<%s>>" (mapconcat #'identity key " ")))))
      (format "Duplicate target <<%s>>" (mapconcat #'identity key " ")))))
@@ -1000,7 +1000,7 @@ Use \"export %s\" instead"
 	      (unless (memq allowed-values '(:any nil))
 	      (unless (memq allowed-values '(:any nil))
 		(let ((values (cdr header))
 		(let ((values (cdr header))
 		      groups-alist)
 		      groups-alist)
-		  (dolist (v (if (stringp values) (org-split-string values)
+		  (dolist (v (if (stringp values) (split-string values)
 			       (list values)))
 			       (list values)))
 		    (let ((valid-value nil))
 		    (let ((valid-value nil))
 		      (catch 'exit
 		      (catch 'exit

+ 21 - 24
lisp/org.el

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

+ 3 - 3
lisp/ox-beamer.el

@@ -935,9 +935,9 @@ value."
 			 org-beamer-environments-default)))
 			 org-beamer-environments-default)))
    ((and (equal property "BEAMER_col")
    ((and (equal property "BEAMER_col")
 	 (not (org-entry-get nil (concat property "_ALL") 'inherit)))
 	 (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
 (add-hook 'org-property-allowed-value-functions
 	  'org-beamer-allowed-property-values)
 	  'org-beamer-allowed-property-values)

+ 2 - 2
lisp/ox.el

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