diff options
author | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2017-09-07 14:38:23 +0200 |
---|---|---|
committer | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2017-09-07 14:38:23 +0200 |
commit | ad1c0faa7e5624a69f8c63bf033ceb9c0d2c8bfa (patch) | |
tree | f4a378d3ef0248734360db8d636b42e6618df550 | |
parent | d41c256ea2c78f2a1481799053320739bce56d3d (diff) | |
parent | f1a1cad93a1648942a3999f0b133fcc3e58d7a96 (diff) | |
download | org-mode-ad1c0faa7e5624a69f8c63bf033ceb9c0d2c8bfa.tar.gz |
Merge branch 'maint'
-rw-r--r-- | contrib/lisp/org-depend.el | 4 | ||||
-rw-r--r-- | contrib/lisp/ox-bibtex.el | 2 | ||||
-rw-r--r-- | contrib/lisp/ox-koma-letter.el | 6 | ||||
-rw-r--r-- | contrib/lisp/ox-taskjuggler.el | 6 | ||||
-rw-r--r-- | etc/ORG-NEWS | 2 | ||||
-rw-r--r-- | lisp/ob-core.el | 2 | ||||
-rw-r--r-- | lisp/org-agenda.el | 2 | ||||
-rw-r--r-- | lisp/org-lint.el | 4 | ||||
-rw-r--r-- | lisp/org.el | 45 | ||||
-rw-r--r-- | lisp/ox-beamer.el | 6 | ||||
-rw-r--r-- | lisp/ox.el | 4 |
11 files changed, 41 insertions, 42 deletions
diff --git a/contrib/lisp/org-depend.el b/contrib/lisp/org-depend.el index d442c02..78a07cf 100644 --- a/contrib/lisp/org-depend.el +++ b/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)) diff --git a/contrib/lisp/ox-bibtex.el b/contrib/lisp/ox-bibtex.el index fb34a5e..47e2d5d 100644 --- a/contrib/lisp/ox-bibtex.el +++ b/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 ":")) diff --git a/contrib/lisp/ox-koma-letter.el b/contrib/lisp/ox-koma-letter.el index b842348..e029811 100644 --- a/contrib/lisp/ox-koma-letter.el +++ b/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) diff --git a/contrib/lisp/ox-taskjuggler.el b/contrib/lisp/ox-taskjuggler.el index aee7ae9..5dd9b22 100644 --- a/contrib/lisp/ox-taskjuggler.el +++ b/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. diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index 41cc3f9..e6ad838 100644 --- a/etc/ORG-NEWS +++ b/etc/ORG-NEWS @@ -148,6 +148,8 @@ details. Use "/!" markup when filtering TODO keywords to get only not-done TODO keywords. +*** ~org-split-string~ returns ~("")~ when called on an empty string +It used to return nil. *** Removal of =ob-scala.el= See [[https://github.com/ensime/emacs-scala-mode/issues/114][this github issue]]. diff --git a/lisp/ob-core.el b/lisp/ob-core.el index d25908d..b1fd5ff 100644 --- a/lisp/ob-core.el +++ b/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 diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index e668bd9..0698b32 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -4438,7 +4438,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) diff --git a/lisp/org-lint.el b/lisp/org-lint.el index a79b037..ba25a0a 100644 --- a/lisp/org-lint.el +++ b/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 diff --git a/lisp/org.el b/lisp/org.el index a644a57..21782e7 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -5095,7 +5095,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)) @@ -5110,7 +5110,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") @@ -5126,7 +5126,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)) @@ -5143,8 +5143,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 @@ -5153,7 +5153,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") @@ -9917,7 +9917,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"))) @@ -9926,7 +9926,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." @@ -10818,7 +10818,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)) @@ -12860,7 +12860,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)) @@ -15832,44 +15832,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." @@ -21870,7 +21867,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 diff --git a/lisp/ox-beamer.el b/lisp/ox-beamer.el index e721550..1e02058 100644 --- a/lisp/ox-beamer.el +++ b/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) @@ -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 |