Merge branch 'maint' into emacs-sync

This commit is contained in:
Kyle Meyer 2017-09-17 10:36:29 -04:00
commit 879dfddd87
35 changed files with 378 additions and 303 deletions

View File

@ -81,9 +81,9 @@
;; TODO: temporary can't find way to let sclang output to stdout for org-babel.
(:output . "none")))
;;;###autoload
(with-eval-after-load "org"
(add-to-list 'org-src-lang-modes '("sclang" . sclang)))
(eval-after-load "org"
'(progn
(add-to-list 'org-src-lang-modes '("sclang" . sclang))))
;;; ----------------------------------------------------------------------------

View File

@ -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))

View File

@ -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 ":"))

View File

@ -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)

View File

@ -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.

View File

@ -15501,10 +15501,10 @@ For more examples of header arguments for @code{#+CALL:} lines,
@cindex code block, library
The ``Library of Babel'' is a collection of code blocks. Like a function
library, these code blocks can be called from other Org files. This
collection is in a repository file in Org mode format in the @samp{doc}
directory of Org mode installation. For remote code block evaluation syntax,
@pxref{Evaluating code blocks}.
library, these code blocks can be called from other Org files. A collection
of useful code blocks is available on
@uref{http://orgmode.org/worg/library-of-babel.html,Worg}. For remote code
block evaluation syntax, @pxref{Evaluating code blocks}.
@kindex C-c C-v i
For any user to add code to the library, first save the code in regular

View File

@ -2537,7 +2537,7 @@ Use @kbd{C-c C-v l} to load the code blocks from an Org-mode files into the
``Library of Babel'', these blocks can then be evaluated from any Org-mode
buffer. A collection of generally useful code blocks is accessible through
Org-modes community-driven documentation on
@uref{http://orgmode.org/worg/libary-of-babel.html,Worg}.
@uref{http://orgmode.org/worg/library-of-babel.html,Worg}.
@subheading Header Arguments
Many aspects of the evaluation and export of code blocks are controlled

View File

@ -98,6 +98,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]].

View File

@ -241,11 +241,9 @@ should be asked whether to allow evaluation."
(query (or (equal eval "query")
(and export (equal eval "query-export"))
(if (functionp org-confirm-babel-evaluate)
(save-excursion
(goto-char (nth 5 info))
(funcall org-confirm-babel-evaluate
;; language, code block body
(nth 0 info) (nth 1 info)))
(funcall org-confirm-babel-evaluate
;; Language, code block body.
(nth 0 info) (nth 1 info))
org-confirm-babel-evaluate))))
(cond
(noeval nil)
@ -2355,7 +2353,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

View File

@ -89,7 +89,7 @@ you can leave the string empty on this case."
(string :tag "Lilypond ")
(string :tag "PDF Viewer ")
(string :tag "MIDI Player"))
:version "24.3"
:version "24.4"
:package-version '(Org . "8.2.7")
:set
(lambda (_symbol value)

View File

@ -49,7 +49,7 @@
(defcustom org-babel-lua-command "lua"
"Name of the command for executing Lua code."
:version "24.5"
:version "26.1"
:package-version '(Org . "8.3")
:group 'org-babel
:type 'string)
@ -58,21 +58,21 @@
"Preferred lua mode for use in running lua interactively.
This will typically be 'lua-mode."
:group 'org-babel
:version "24.5"
:version "26.1"
:package-version '(Org . "8.3")
:type 'symbol)
(defcustom org-babel-lua-hline-to "None"
"Replace hlines in incoming tables with this when translating to lua."
:group 'org-babel
:version "24.5"
:version "26.1"
:package-version '(Org . "8.3")
:type 'string)
(defcustom org-babel-lua-None-to 'hline
"Replace 'None' in lua tables with this before returning."
:group 'org-babel
:version "24.5"
:version "26.1"
:package-version '(Org . "8.3")
:type 'symbol)

View File

@ -44,12 +44,18 @@
(defvar geiser-impl--implementation) ; Defined in geiser-impl.el
(defvar geiser-default-implementation) ; Defined in geiser-impl.el
(defvar geiser-active-implementations) ; Defined in geiser-impl.el
(defvar geiser-debug-show-debug-p) ; Defined in geiser-debug.el
(defvar geiser-debug-jump-to-debug-p) ; Defined in geiser-debug.el
(defvar geiser-repl-use-other-window) ; Defined in geiser-repl.el
(defvar geiser-repl-window-allow-split) ; Defined in geiser-repl.el
(declare-function run-geiser "ext:geiser-repl" (impl))
(declare-function geiser-mode "ext:geiser-mode" ())
(declare-function geiser-eval-region "ext:geiser-mode"
(start end &optional and-go raw nomsg))
(declare-function geiser-repl-exit "ext:geiser-repl" (&optional arg))
(declare-function geiser-eval--retort-output "ext:geiser-eval" (ret))
(declare-function geiser-eval--retort-result-str "ext:geiser-eval" (ret prefix))
(defcustom org-babel-scheme-null-to 'hline
"Replace `null' and empty lists in scheme tables with this before returning."
@ -150,35 +156,31 @@ is true; otherwise returns the last value."
(with-temp-buffer
(insert (format ";; -*- geiser-scheme-implementation: %s -*-" impl))
(newline)
(insert (if output
(format "(with-output-to-string (lambda () %s))" code)
code))
(insert code)
(geiser-mode)
(let ((repl-buffer (save-current-buffer
(org-babel-scheme-get-repl impl repl))))
(when (not (eq impl (org-babel-scheme-get-buffer-impl
(current-buffer))))
(message "Implementation mismatch: %s (%s) %s (%s)" impl (symbolp impl)
(org-babel-scheme-get-buffer-impl (current-buffer))
(symbolp (org-babel-scheme-get-buffer-impl
(current-buffer)))))
(setq geiser-repl--repl repl-buffer)
(setq geiser-impl--implementation nil)
(setq result (org-babel-scheme-capture-current-message
(geiser-eval-region (point-min) (point-max))))
(setq result
(if (and (stringp result) (equal (substring result 0 3) "=> "))
(replace-regexp-in-string "^=> " "" result)
"\"An error occurred.\""))
(when (not repl)
(save-current-buffer (set-buffer repl-buffer)
(geiser-repl-exit))
(set-process-query-on-exit-flag (get-buffer-process repl-buffer) nil)
(kill-buffer repl-buffer))
(setq result (if (or (string= result "#<void>")
(string= result "#<unspecified>"))
nil
result))))
(let ((geiser-repl-window-allow-split nil)
(geiser-repl-use-other-window nil))
(let ((repl-buffer (save-current-buffer
(org-babel-scheme-get-repl impl repl))))
(when (not (eq impl (org-babel-scheme-get-buffer-impl
(current-buffer))))
(message "Implementation mismatch: %s (%s) %s (%s)" impl (symbolp impl)
(org-babel-scheme-get-buffer-impl (current-buffer))
(symbolp (org-babel-scheme-get-buffer-impl
(current-buffer)))))
(setq geiser-repl--repl repl-buffer)
(setq geiser-impl--implementation nil)
(let ((geiser-debug-jump-to-debug-p nil)
(geiser-debug-show-debug-p nil))
(let ((ret (geiser-eval-region (point-min) (point-max))))
(setq result (if output
(geiser-eval--retort-output ret)
(geiser-eval--retort-result-str ret "")))))
(when (not repl)
(save-current-buffer (set-buffer repl-buffer)
(geiser-repl-exit))
(set-process-query-on-exit-flag (get-buffer-process repl-buffer) nil)
(kill-buffer repl-buffer)))))
result))
(defun org-babel-scheme--table-or-string (results)

View File

@ -123,10 +123,7 @@ This function is called by `org-babel-execute-src-block'."
(if (listp val)
(let ((data-file (org-babel-temp-file "sqlite-data-")))
(with-temp-file data-file
(insert (orgtbl-to-csv
val '(:fmt (lambda (el) (if (stringp el)
el
(format "%S" el)))))))
(insert (orgtbl-to-csv val nil)))
data-file)
(if (stringp val) val (format "%S" val))))
body)))

View File

@ -1445,7 +1445,7 @@ E.g. when this is set to 1, the search view will only
show headlines of level 1. When set to 0, the default
value, don't limit agenda view by outline level."
:group 'org-agenda-search-view
:version "24.4"
:version "26.1"
:package-version '(Org . "8.3")
:type 'integer)
@ -4368,8 +4368,9 @@ as a whole, to include whitespace.
with a colon, this will mean that the (non-regexp) snippets of the
Boolean search must match as full words.
This command searches the agenda files, and in addition the files listed
in `org-agenda-text-search-extra-files'."
This command searches the agenda files, and in addition the files
listed in `org-agenda-text-search-extra-files' unless a restriction lock
is active."
(interactive "P")
(if org-agenda-overriding-arguments
(setq todo-only (car org-agenda-overriding-arguments)
@ -4425,7 +4426,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)
@ -4479,10 +4480,20 @@ in `org-agenda-text-search-extra-files'."
(if hdl-only (setq regexp (concat org-outline-regexp-bol ".*?"
regexp))))
(setq files (org-agenda-files nil 'ifmode))
(when (eq (car org-agenda-text-search-extra-files) 'agenda-archives)
(pop org-agenda-text-search-extra-files)
(setq files (org-add-archive-files files)))
(setq files (append files org-agenda-text-search-extra-files)
;; Add `org-agenda-text-search-extra-files' unless there is some
;; restriction.
(unless (get 'org-agenda-files 'org-restrict)
(when (eq (car org-agenda-text-search-extra-files) 'agenda-archives)
(pop org-agenda-text-search-extra-files)
(setq files (org-add-archive-files files))))
;; Uniquify files. However, let `org-check-agenda-file' handle
;; non-existent ones.
(setq files (cl-remove-duplicates
(append files org-agenda-text-search-extra-files)
:test (lambda (a b)
(and (file-exists-p a)
(file-exists-p b)
(file-equal-p a b))))
rtnall nil)
(while (setq file (pop files))
(setq ee nil)
@ -4537,12 +4548,12 @@ in `org-agenda-text-search-extra-files'."
(point-at-bol)
(if hdl-only (point-at-eol) end)))
(mapc (lambda (wr) (when (string-match wr str)
(goto-char (1- end))
(throw :skip t)))
(goto-char (1- end))
(throw :skip t)))
regexps-)
(mapc (lambda (wr) (unless (string-match wr str)
(goto-char (1- end))
(throw :skip t)))
(goto-char (1- end))
(throw :skip t)))
(if todo-only
(cons (concat "^\\*+[ \t]+"
org-not-done-regexp)
@ -4867,39 +4878,41 @@ keywords. Possible classes are: `todo', `done', `any'.
If any of these conditions is met, this function returns the end point of
the entity, causing the search to continue from there. This is a function
that can be put into `org-agenda-skip-function' for the duration of a command."
(let (beg end m)
(org-back-to-heading t)
(setq beg (point)
end (if subtree
(progn (org-end-of-subtree t) (point))
(progn (outline-next-heading) (1- (point)))))
(goto-char beg)
(org-back-to-heading t)
(let* ((beg (point))
(end (if subtree (save-excursion (org-end-of-subtree t) (point))
(org-entry-end-position)))
(planning-end (if subtree end (line-end-position 2)))
m)
(and
(or
(and (memq 'scheduled conditions)
(re-search-forward org-scheduled-time-regexp end t))
(and (memq 'notscheduled conditions)
(not (re-search-forward org-scheduled-time-regexp end t)))
(and (memq 'deadline conditions)
(re-search-forward org-deadline-time-regexp end t))
(and (memq 'notdeadline conditions)
(not (re-search-forward org-deadline-time-regexp end t)))
(and (memq 'timestamp conditions)
(re-search-forward org-ts-regexp end t))
(and (memq 'nottimestamp conditions)
(not (re-search-forward org-ts-regexp end t)))
(and (setq m (memq 'regexp conditions))
(stringp (nth 1 m))
(re-search-forward (nth 1 m) end t))
(and (setq m (memq 'notregexp conditions))
(stringp (nth 1 m))
(not (re-search-forward (nth 1 m) end t)))
(and (or
(setq m (memq 'nottodo conditions))
(setq m (memq 'todo-unblocked conditions))
(setq m (memq 'nottodo-unblocked conditions))
(setq m (memq 'todo conditions)))
(org-agenda-skip-if-todo m end)))
(or (and (memq 'scheduled conditions)
(re-search-forward org-scheduled-time-regexp planning-end t))
(and (memq 'notscheduled conditions)
(not
(save-excursion
(re-search-forward org-scheduled-time-regexp planning-end t))))
(and (memq 'deadline conditions)
(re-search-forward org-deadline-time-regexp planning-end t))
(and (memq 'notdeadline conditions)
(not
(save-excursion
(re-search-forward org-deadline-time-regexp planning-end t))))
(and (memq 'timestamp conditions)
(re-search-forward org-ts-regexp end t))
(and (memq 'nottimestamp conditions)
(not (save-excursion (re-search-forward org-ts-regexp end t))))
(and (setq m (memq 'regexp conditions))
(stringp (nth 1 m))
(re-search-forward (nth 1 m) end t))
(and (setq m (memq 'notregexp conditions))
(stringp (nth 1 m))
(not (save-excursion (re-search-forward (nth 1 m) end t))))
(and (or
(setq m (memq 'nottodo conditions))
(setq m (memq 'todo-unblocked conditions))
(setq m (memq 'nottodo-unblocked conditions))
(setq m (memq 'todo conditions)))
(org-agenda-skip-if-todo m end)))
end)))
(defun org-agenda-skip-if-todo (args end)
@ -4908,43 +4921,36 @@ ARGS is a list with first element either `todo', `nottodo',
`todo-unblocked' or `nottodo-unblocked'. The remainder is either
a list of TODO keywords, or a state symbol `todo' or `done' or
`any'."
(let ((kw (car args))
(arg (cadr args))
todo-wds todo-re)
(setq todo-wds
(org-uniquify
(cond
((listp arg) ;; list of keywords
(if (member "*" arg)
(mapcar 'substring-no-properties org-todo-keywords-1)
arg))
((symbolp arg) ;; keyword class name
(cond
((eq arg 'todo)
(org-delete-all org-done-keywords
(mapcar 'substring-no-properties
org-todo-keywords-1)))
((eq arg 'done) org-done-keywords)
((eq arg 'any)
(mapcar 'substring-no-properties org-todo-keywords-1)))))))
(setq todo-re
(concat "^\\*+[ \t]+\\<\\("
(mapconcat 'identity todo-wds "\\|")
"\\)\\>"))
(cond
((eq kw 'todo) (re-search-forward todo-re end t))
((eq kw 'nottodo) (not (re-search-forward todo-re end t)))
((eq kw 'todo-unblocked)
(catch 'unblocked
(while (re-search-forward todo-re end t)
(or (org-entry-blocked-p) (throw 'unblocked t)))
nil))
((eq kw 'nottodo-unblocked)
(catch 'unblocked
(while (re-search-forward todo-re end t)
(or (org-entry-blocked-p) (throw 'unblocked nil)))
t))
)))
(let ((todo-re
(concat "^\\*+[ \t]+"
(regexp-opt
(pcase args
(`(,_ todo)
(org-delete-all org-done-keywords
(copy-sequence org-todo-keywords-1)))
(`(,_ done) org-done-keywords)
(`(,_ any) org-todo-keywords-1)
(`(,_ ,(pred atom))
(error "Invalid TODO class or type: %S" args))
(`(,_ ,(pred (member "*"))) org-todo-keywords-1)
(`(,_ ,todo-list) todo-list))
'words))))
(pcase args
(`(todo . ,_)
(let (case-fold-search) (re-search-forward todo-re end t)))
(`(nottodo . ,_)
(not (let (case-fold-search) (re-search-forward todo-re end t))))
(`(todo-unblocked . ,_)
(catch :unblocked
(while (let (case-fold-search) (re-search-forward todo-re end t))
(when (org-entry-blocked-p) (throw :unblocked t)))
nil))
(`(nottodo-unblocked . ,_)
(catch :unblocked
(while (let (case-fold-search) (re-search-forward todo-re end t))
(when (org-entry-blocked-p) (throw :unblocked nil)))
t))
(`(,type . ,_) (error "Unknown TODO skip type: %S" type)))))
;;;###autoload
(defun org-agenda-list-stuck-projects (&rest ignore)
@ -5717,7 +5723,8 @@ then those holidays will be skipped."
(list
(if (memq 'closed items) (concat "\\<" org-closed-string))
(if (memq 'clock items) (concat "\\<" org-clock-string))
(if (memq 'state items) "- State \"\\([a-zA-Z0-9]+\\)\".*?"))))
(if (memq 'state items)
(format "- State \"%s\".*?" org-todo-regexp)))))
(parts-re (if parts (mapconcat 'identity parts "\\|")
(error "`org-agenda-log-mode-items' is empty")))
(regexp (concat

View File

@ -144,7 +144,7 @@ When set to `query', ask the user instead."
"Confirmation preference for automatically getting annex files.
If \\='ask, prompt using `y-or-n-p'. If t, always get. If nil, never get."
:group 'org-attach
:package-version '(Org . "9")
:package-version '(Org . "9.0")
:version "26.1"
:type '(choice
(const :tag "confirm with `y-or-n-p'" ask)

View File

@ -1097,7 +1097,7 @@ may have been stored before."
(defun org-capture-place-entry ()
"Place the template as a new Org entry."
(let ((reversed? (org-capture-get :prepend))
level)
(level 1))
(when (org-capture-get :exact-position)
(goto-char (org-capture-get :exact-position)))
(cond

View File

@ -272,11 +272,13 @@ When optional argument CANONICAL is non-nil, refer to
When optional argument CANONICAL is non-nil, ignore
`org-duration-units' and use standard time units value.
As a special case, a bare number represents minutes.
A bare number is translated into minutes. The empty string is
translated into 0.0.
Return value as a float. Raise an error if duration format is
not recognized."
(cond
((equal duration "") 0.0)
((numberp duration) (float duration))
((string-match-p org-duration--h:mm-re duration)
(pcase-let ((`(,hours ,minutes ,seconds)

View File

@ -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

View File

@ -920,7 +920,10 @@ Throw an error when not at an export block."
(unless (and (eq (org-element-type element) 'export-block)
(org-src--on-datum-p element))
(user-error "Not in an export block"))
(let* ((type (downcase (org-element-property :type element)))
(let* ((type (downcase (or (org-element-property :type element)
;; Missing export-block type. Fallback
;; to default mode.
"fundamental")))
(mode (org-src--get-lang-mode type)))
(unless (functionp mode) (error "No such language mode: %s" mode))
(org-src--edit-element

View File

@ -1184,7 +1184,7 @@ to a number. In the case of a timestamp, increment by days."
(setq txt (calc-eval (concat txt "+" (number-to-string inc)))))
(insert txt)
(org-move-to-column col)
(if (and org-table-copy-increment (org-at-timestamp-p))
(if (and org-table-copy-increment (org-at-timestamp-p 'lax))
(org-timestamp-up-day inc)
(org-table-maybe-recalculate-line))
(org-table-align)

View File

@ -1928,10 +1928,10 @@ in the Org buffer so that the change takes effect."
(defcustom org-make-link-description-function nil
"Function to use for generating link descriptions from links.
When nil, the link location will be used. This function must take
two parameters: the first one is the link, the second one is the
description generated by `org-insert-link'. The function should
return the description to use."
This function must take two parameters: the first one is the
link, the second one is the description generated by
`org-insert-link'. The function should return the description to
use."
:group 'org-link
:type '(choice (const nil) (function)))
@ -2053,7 +2053,7 @@ In tables, the special behavior of RET has precedence."
A longer mouse click will still set point. Needs to be set
before org.el is loaded."
:group 'org-link-follow
:version "24.4"
:version "26.1"
:package-version '(Org . "8.3")
:type '(choice
(const :tag "A double click follows the link" double)
@ -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")
@ -5552,10 +5552,13 @@ The following commands are available:
;; Update `customize-package-emacs-version-alist'
(add-to-list 'customize-package-emacs-version-alist
'(Org ("6.21b" . "23.1") ("6.33x" . "23.2")
("7.8.11" . "24.1") ("7.9.4" . "24.3")
("8.2.6" . "24.4") ("8.2.10" . "24.5")
("9.0" . "26.1")))
'(Org ("8.0" . "24.4")
("8.1" . "24.4")
("8.2" . "24.4")
("8.2.7" . "24.4")
("8.3" . "26.1")
("9.0" . "26.1")
("9.1" . "26.1")))
(defvar org-mode-transpose-word-syntax-table
(let ((st (make-syntax-table text-mode-syntax-table)))
@ -5903,7 +5906,7 @@ This includes angle, plain, and bracket links."
"When non-nil, fontify code in code blocks.
See also the `org-block' face."
:type 'boolean
:version "24.4"
:version "26.1"
:package-version '(Org . "8.3")
:group 'org-appearance
:group 'org-babel)
@ -9065,7 +9068,7 @@ function is being called interactively."
"Regexp that matches the custom prefix of Org headlines in
orgstruct(++)-mode."
:group 'org
:version "24.4"
:version "26.1"
:package-version '(Org . "8.3")
:type 'regexp)
;;;###autoload(put 'orgstruct-heading-prefix-regexp 'safe-local-variable 'stringp)
@ -9913,7 +9916,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 +9925,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."
@ -10143,15 +10146,14 @@ the current directory or below.
A `\\[universal-argument] \\[universal-argument] \\[universal-argument]' \
prefix negates `org-keep-stored-link-after-insertion'.
If `org-make-link-description-function' is non-nil, this function will be
called with the link target, and the result will be the default
link description.
If the LINK-LOCATION parameter is non-nil, this value will be used as
the link location instead of reading one interactively.
If the DEFAULT-DESCRIPTION parameter is non-nil, this value will be used
as the default description."
If the DEFAULT-DESCRIPTION parameter is non-nil, this value will
be used as the default description. Otherwise, if
`org-make-link-description-function' is non-nil, this function
will be called with the link target, and the result will be the
default link description."
(interactive "P")
(let* ((wcf (current-window-configuration))
(origbuf (current-buffer))
@ -10285,17 +10287,19 @@ Use TAB to complete link prefixes, then RET for type-specific completion support
(when (equal desc origpath)
(setq desc path)))))
(if org-make-link-description-function
(setq desc
(or (condition-case nil
(funcall org-make-link-description-function link desc)
(error (progn (message "Can't get link description from `%s'"
(symbol-name org-make-link-description-function))
(sit-for 2) nil)))
(read-string "Description: " default-description)))
(if default-description (setq desc default-description)
(setq desc (or (and auto-desc desc)
(read-string "Description: " desc)))))
(unless auto-desc
(let ((initial-input
(cond
(default-description)
((not org-make-link-description-function) desc)
(t (condition-case nil
(funcall org-make-link-description-function link desc)
(error
(message "Can't get link description from `%s'"
(symbol-name org-make-link-description-function))
(sit-for 2)
nil))))))
(setq desc (read-string "Description: " initial-input))))
(unless (string-match "\\S-" desc) (setq desc nil))
(when remove (apply 'delete-region remove))
@ -10814,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))
@ -12856,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))
@ -13049,8 +13053,9 @@ This function is run automatically after each state change to a DONE state."
;; a clock, set LAST_REPEAT property.
(when (or org-log-repeat
(catch :clock
(while (re-search-forward org-clock-line-re end t)
(when (org-at-clock-log-p) (throw :clock t)))))
(save-excursion
(while (re-search-forward org-clock-line-re end t)
(when (org-at-clock-log-p) (throw :clock t))))))
(org-entry-put nil "LAST_REPEAT" (format-time-string
(org-time-stamp-format t t)
(current-time))))
@ -15828,44 +15833,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."
@ -19480,6 +19482,7 @@ COMMANDS is a list of alternating OLDDEF NEWDEF command names."
(org-defkey org-mode-map [(shift return)] 'org-table-copy-down)
(org-defkey org-mode-map [(meta shift return)] 'org-insert-todo-heading)
(org-defkey org-mode-map [(meta return)] 'org-meta-return)
(org-defkey org-mode-map (kbd "M-RET") #'org-meta-return)
;; Cursor keys with modifiers
(org-defkey org-mode-map [(meta left)] 'org-metaleft)
@ -21864,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
@ -23592,23 +23595,28 @@ depending on context."
This will call `forward-sentence' or `org-table-end-of-field',
depending on context."
(interactive)
(let* ((element (org-element-at-point))
(contents-end (org-element-property :contents-end element))
(table (org-element-lineage element '(table) t)))
(if (and table
(>= (point) (org-element-property :contents-begin table))
(< (point) contents-end))
(call-interactively #'org-table-end-of-field)
(if (and (org-at-heading-p)
(save-restriction (skip-chars-forward " \t") (not (eolp))))
(save-restriction
(when (and contents-end
(> (point-max) contents-end)
;; Skip blank lines between elements.
(< (org-element-property :end element)
(save-excursion (goto-char contents-end)
(skip-chars-forward " \r\t\n"))))
(narrow-to-region (org-element-property :contents-begin element)
contents-end))
(call-interactively #'forward-sentence)))))
(narrow-to-region (line-beginning-position) (line-end-position))
(call-interactively #'forward-sentence))
(let* ((element (org-element-at-point))
(contents-end (org-element-property :contents-end element))
(table (org-element-lineage element '(table) t)))
(if (and table
(>= (point) (org-element-property :contents-begin table))
(< (point) contents-end))
(call-interactively #'org-table-end-of-field)
(save-restriction
(when (and contents-end
(> (point-max) contents-end)
;; Skip blank lines between elements.
(< (org-element-property :end element)
(save-excursion (goto-char contents-end)
(skip-chars-forward " \r\t\n"))))
(narrow-to-region (org-element-property :contents-begin element)
contents-end))
(call-interactively #'forward-sentence))))))
(define-key org-mode-map "\M-a" 'org-backward-sentence)
(define-key org-mode-map "\M-e" 'org-forward-sentence)

View File

@ -401,7 +401,7 @@ The function must accept nine parameters:
The function should return either the string to be exported or
nil to ignore the inline task."
:group 'org-export-ascii
:version "24.4"
:version "26.1"
:package-version '(Org . "8.3")
:type 'function)

View File

@ -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)

View File

@ -1910,7 +1910,7 @@ INFO is a plist used as a communication channel."
INFO is a plist used as a communication channel."
(when (and (memq (plist-get info :with-latex) '(mathjax t))
(org-element-map (plist-get info :parse-tree)
'(latex-fragment latex-environment) 'identity info t))
'(latex-fragment latex-environment) #'identity info t nil t))
(let ((template (plist-get info :html-mathjax-template))
(options (plist-get info :html-mathjax-options))
(in-buffer (or (plist-get info :html-mathjax) "")))

View File

@ -865,7 +865,7 @@ The function should return the string to be exported.
The default function simply returns the value of CONTENTS."
:group 'org-export-latex
:version "24.4"
:version "26.1"
:package-version '(Org . "8.3")
:type 'function)
@ -956,7 +956,7 @@ parameter for the listings package. If the mode name and the
listings name are the same, the language does not need an entry
in this list - but it does not hurt if it is present."
:group 'org-export-latex
:version "24.4"
:version "26.1"
:package-version '(Org . "8.3")
:type '(repeat
(list

View File

@ -656,7 +656,7 @@ The function should return the string to be exported.
The default value simply returns the value of CONTENTS."
:group 'org-export-odt
:version "24.4"
:version "26.1"
:package-version '(Org . "8.3")
:type 'function)

View File

@ -1573,6 +1573,7 @@ contextual information."
;;; Interactive functions
;;;###autoload
(defun org-texinfo-export-to-texinfo
(&optional async subtreep visible-only body-only ext-plist)
"Export current buffer to a Texinfo file.
@ -1607,6 +1608,7 @@ Return output file's name."
(org-export-to-file 'texinfo outfile
async subtreep visible-only body-only ext-plist)))
;;;###autoload
(defun org-texinfo-export-to-info
(&optional async subtreep visible-only body-only ext-plist)
"Export current buffer to Texinfo then process through to INFO.

View File

@ -594,7 +594,7 @@ properties to export, as strings.
This option can also be set with the OPTIONS keyword,
e.g. \"prop:t\"."
:group 'org-export-general
:version "24.4"
:version "26.1"
:package-version '(Org . "8.3")
:type '(choice
(const :tag "All properties" t)
@ -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

View File

@ -162,7 +162,7 @@
(ert-deftest ob-lilypond/ly-gen-html ()
(should (boundp 'org-babel-lilypond-gen-html)))
(ert-deftest ob-lilypond/ly-gen-html ()
(ert-deftest ob-lilypond/ly-gen-pdf ()
(should (boundp 'org-babel-lilypond-gen-pdf)))
(ert-deftest ob-lilypond/use-eps ()

View File

@ -41,29 +41,50 @@
(ert-deftest test-ob-scheme/prologue ()
"Test :prologue parameter."
(equal "#+begin_src scheme :prologue \"(define x 2)\"
(should
(equal "#+begin_src scheme :prologue \"(define x 2)\"
x
#+end_src
#+RESULTS:
: 2
"
(org-test-with-temp-text
"#+begin_src scheme :prologue \"(define x 2)\"\nx\n#+end_src"
(org-babel-execute-maybe)
(buffer-string)))
(equal
"#+begin_src scheme :prologue \"(define x 2)\" :var y=1
(org-test-with-temp-text
"#+begin_src scheme :prologue \"(define x 2)\"\nx\n#+end_src"
(org-babel-execute-maybe)
(buffer-string))))
(should
(equal
"#+begin_src scheme :prologue \"(define x 2)\" :var y=1
x
#+end_src
#+RESULTS:
: 2
"
(org-test-with-temp-text
"#+begin_src scheme :prologue \"(define x 2)\" :var y=1\nx\n#+end_src"
(org-babel-execute-maybe)
(buffer-string))))
(org-test-with-temp-text
"#+begin_src scheme :prologue \"(define x 2)\" :var y=1\nx\n#+end_src"
(org-babel-execute-maybe)
(buffer-string)))))
(ert-deftest test-ob-scheme/unspecified ()
"Test <#unspecified> return value."
(should
(equal "#+begin_src scheme
\(define (mysquare x)
(* x x))
#+end_src
#+RESULTS:
: #<unspecified>
"
(org-test-with-temp-text
"#+begin_src scheme
(define (mysquare x)
(* x x))
#+end_src"
(org-babel-execute-maybe)
(buffer-string)))))
(provide 'test-ob-scheme)

View File

@ -62,29 +62,30 @@ ob-comint.el, which was not previously tested."
(ert-deftest ob-shell/generic-uses-no-assoc-arrays ()
"No associative arrays for generic"
(org-test-at-id "bec1a5b0-4619-4450-a8c0-2a746b44bf8d"
(org-babel-next-src-block)
(should (equal "first one second two third three"
(org-babel-execute-src-block)))))
(should
(equal "first one second two third three"
(org-test-at-id "bec1a5b0-4619-4450-a8c0-2a746b44bf8d"
(org-babel-next-src-block)
(org-babel-execute-src-block))))
(should
(equal "bread 2 kg spaghetti 20 cm milk 50 dl"
(org-test-at-id "82320a48-3409-49d7-85c9-5de1c6d3ff87"
(org-babel-next-src-block)
(org-babel-execute-src-block)))))
(ert-deftest ob-shell/bash-uses-assoc-arrays ()
"Bash associative arrays"
(org-test-at-id "bec1a5b0-4619-4450-a8c0-2a746b44bf8d"
(org-babel-next-src-block 2)
(should (equal "two" (org-babel-execute-src-block)))))
(ert-deftest ob-shell/generic-uses-no-assoc-arrays ()
"No associative arrays for generic"
(org-test-at-id "82320a48-3409-49d7-85c9-5de1c6d3ff87"
(org-babel-next-src-block)
(should (equal "bread 2 kg spaghetti 20 cm milk 50 dl"
(org-babel-execute-src-block)))))
(ert-deftest ob-shell/bash-uses-assoc-arrays ()
"Bash associative arrays as strings for the row"
(org-test-at-id "82320a48-3409-49d7-85c9-5de1c6d3ff87"
(org-babel-next-src-block 2)
(should (equal "20 cm" (org-babel-execute-src-block)))))
(should
(equal "two"
(org-test-at-id "bec1a5b0-4619-4450-a8c0-2a746b44bf8d"
(org-babel-next-src-block 2)
(org-babel-execute-src-block))))
;; Bash associative arrays as strings for the row.
(should
(equal "20 cm"
(org-test-at-id "82320a48-3409-49d7-85c9-5de1c6d3ff87"
(org-babel-next-src-block 2)
(org-babel-execute-src-block)))))
(ert-deftest ob-shell/simple-list ()
"Test list variables in shell."

View File

@ -0,0 +1,45 @@
;;; test-ob-sqlite.el --- tests for ob-sqlite.el
;; Copyright (C) 2017 Eduardo Bellani
;; Author: Eduardo Bellani <ebellani@gmail.com>
;; Keywords: lisp
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
;;; Code:
(org-test-for-executable "sqlite")
(unless (featurep 'ob-sqlite)
(signal 'missing-test-dependency "Support for sqlite code blocks"))
(ert-deftest ob-sqlite/table-variables-with-commas ()
"Test of a table variable that contains commas. This garantees that this code path results in a valid CSV."
(should
(equal '(("Mr Test A. Sql"
"Minister for Science, Eternal Happiness, and Finance"))
(org-test-with-temp-text
"#+name: test_table1
| \"Mr Test A. Sql\" | Minister for Science, Eternal Happiness, and Finance |
#+begin_src sqlite :db /tmp/test.db :var tb=test_table1
drop table if exists TestTable;
create table TestTable(person, job);
.mode csv TestTable
.import $tb TestTable
select * from TestTable;
#+end_src"
(org-babel-next-src-block)
(org-babel-execute-src-block)))))
;;; test-ob-sqlite.el ends here

View File

@ -923,21 +923,6 @@ replacement happens correctly."
* next heading")))
'("sh" "emacs-lisp")))
(ert-deftest test-ob/org-babel-remove-result--results-list ()
"Test `org-babel-remove-result' with :results list."
(test-ob-verify-result-and-removed-result
"- 1
- 2
- 3
- (quote (4 5))"
"* org-babel-remove-result
#+begin_src emacs-lisp :results list
'(1 2 3 '(4 5))
#+end_src
* next heading"))
(ert-deftest test-ob/org-babel-results-indented-wrap ()
"Ensure that wrapped results are inserted correction when indented.
If not inserted correctly then the second evaluation will fail
@ -967,18 +952,6 @@ trying to find the :END: marker."
(should (search-forward "[[file:foo][bar]]" nil t))
(should (search-forward "[[file:foo][foo]]" nil t))))
(ert-deftest test-ob/org-babel-remove-result--results-pp ()
"Test `org-babel-remove-result' with :results pp."
(test-ob-verify-result-and-removed-result
": \"I /am/ working!\""
"* org-babel-remove-result
#+begin_src emacs-lisp :results pp
\"I /am/ working!\")
#+end_src
* next heading"))
(ert-deftest test-ob/inline-src_blk-preceded-punct-preceded-by-point ()
(let ((test-line ".src_emacs-lisp[ :results verbatim ]{ \"x\" }")
(org-babel-inline-result-wrap "=%s="))
@ -1034,19 +1007,6 @@ replacement happens correctly."
(buffer-substring-no-properties
(point-min) (point-max))))))
(ert-deftest test-ob/org-babel-remove-result--results-default ()
"Test `org-babel-remove-result' with default :results."
(mapcar (lambda (language)
(test-ob-verify-result-and-removed-result
"\n"
(concat
"* org-babel-remove-result
#+begin_src " language "
#+end_src
* next heading")))
'("sh" "emacs-lisp")))
(ert-deftest test-ob/org-babel-remove-result--results-list ()
"Test `org-babel-remove-result' with :results list."
(test-ob-verify-result-and-removed-result

View File

@ -35,6 +35,8 @@
(should (= (org-duration-to-minutes "2") 2))
(should (= (org-duration-to-minutes "2.5") 2.5))
(should (= (org-duration-to-minutes 1) 1))
;; Special case: the empty string is 0.0.
(should (= (org-duration-to-minutes "") 0.0))
;; Support custom units.
(should (= 4
(let ((org-duration-units '(("longmin" . 2)))

View File

@ -3412,6 +3412,18 @@ SCHEDULED: <2017-05-06 Sat>
;; on blank lines in-between.
(should
(org-test-with-temp-text "Paragraph 1.<point>\n\nParagraph 2."
(org-forward-sentence)
(eobp)))
;; On a headline, stop at the end of the line, unless point is
;; already there.
(should
(equal
"* Headline"
(org-test-with-temp-text "* <point>Headline\nSentence."
(org-forward-sentence)
(buffer-substring-no-properties (line-beginning-position) (point)))))
(should
(org-test-with-temp-text "* Headline<point>\nSentence."
(org-forward-sentence)
(eobp))))
@ -6035,7 +6047,7 @@ Paragraph<point>"
(cl-letf (((symbol-function 'org-add-log-setup)
(lambda (&rest args) nil)))
(org-test-with-temp-text
"* TODO H\n<2012-03-29 Thu. +2y>\nCLOCK: [2012-03-29 Thu 16:40]"
"* TODO H\n<2012-03-29 Thu +2y>\nCLOCK: [2012-03-29 Thu 16:40]"
(org-todo "DONE")
(buffer-string))))))
;; When a SCHEDULED entry has no repeater, remove it upon repeating
@ -6047,6 +6059,19 @@ Paragraph<point>"
(org-test-with-temp-text
"* TODO H\nSCHEDULED: <2014-03-04 Tue>\n<2012-03-29 Thu +2y>"
(org-todo "DONE")
(buffer-string)))))
;; Properly advance repeater even when a clock entry is specified
;; and `org-log-repeat' is nil.
(should
(string-match-p
"SCHEDULED: <2014-03-29"
(let ((org-log-repeat nil)
(org-todo-keywords '((sequence "TODO" "DONE"))))
(org-test-with-temp-text
"* TODO H
SCHEDULED: <2012-03-29 Thu +2y>
CLOCK: [2012-03-29 Thu 10:00]--[2012-03-29 Thu 16:40] => 6:40"
(org-todo "DONE")
(buffer-string))))))