Merge branch 'maint' into emacs-sync

This commit is contained in:
Kyle Meyer 2017-01-29 13:27:07 -05:00
commit a726fc83db
3 changed files with 43 additions and 29 deletions

View File

@ -522,21 +522,22 @@ as `org-src-fontify-natively' is non-nil."
(with-current-buffer
(get-buffer-create
(format " *org-src-fontification:%s*" lang-mode))
(erase-buffer)
;; Add string and a final space to ensure property change.
(insert string " ")
(unless (eq major-mode lang-mode) (funcall lang-mode))
(org-font-lock-ensure)
(let ((pos (point-min)) next)
(while (setq next (next-property-change pos))
;; Handle additional properties from font-lock, so as to
;; preserve, e.g., composition.
(dolist (prop (cons 'face font-lock-extra-managed-props))
(let ((new-prop (get-text-property pos prop)))
(put-text-property
(+ start (1- pos)) (1- (+ start next)) prop new-prop
org-buffer)))
(setq pos next))))
(let ((inhibit-modification-hooks nil))
(erase-buffer)
;; Add string and a final space to ensure property change.
(insert string " ")
(unless (eq major-mode lang-mode) (funcall lang-mode))
(org-font-lock-ensure)
(let ((pos (point-min)) next)
(while (setq next (next-property-change pos))
;; Handle additional properties from font-lock, so as to
;; preserve, e.g., composition.
(dolist (prop (cons 'face font-lock-extra-managed-props))
(let ((new-prop (get-text-property pos prop)))
(put-text-property
(+ start (1- pos)) (1- (+ start next)) prop new-prop
org-buffer)))
(setq pos next)))))
;; Add Org faces.
(let ((src-face (nth 1 (assoc-string lang org-src-block-faces t))))
(when (or (facep src-face) (listp src-face))

View File

@ -9766,8 +9766,8 @@ sub-tree if optional argument INHERIT is non-nil."
;; TPROP is a text property symbol.
(put-text-property start end tprop p)
;; TPROP is an alist with (property . function) elements.
(pcase-dolist (`(,p . ,f) tprop)
(put-text-property start end p (funcall f p))))))))
(pcase-dolist (`(,prop . ,f) tprop)
(put-text-property start end prop (funcall f p))))))))
(defun org-refresh-category-properties ()
"Refresh category text properties in the buffer."
@ -13459,7 +13459,7 @@ TYPE is either `deadline' or `scheduled'. See `org-deadline' or
(string-match org-repeat-re time)
(match-string 1 time))
(and (org-string-nw-p old-date)
(string-match "\\([.+-]+[0-9]+ [hdwmy]\
(string-match "\\([.+-]+[0-9]+[hdwmy]\
\\(?:[/ ][-+]?[0-9]+[hdwmy]\\)?\\)"
old-date)
(match-string 1 old-date)))))
@ -21117,11 +21117,6 @@ This command does many different things, depending on context:
(funcall org-finish-function))
((org-babel-hash-at-point))
((run-hook-with-args-until-success 'org-ctrl-c-ctrl-c-hook))
((save-excursion (beginning-of-line) (looking-at-p "[ \t]*$"))
(or (run-hook-with-args-until-success 'org-ctrl-c-ctrl-c-final-hook)
(user-error
(substitute-command-keys
"`\\[org-ctrl-c-ctrl-c]' can do nothing useful here"))))
(t
(let* ((context
(org-element-lineage
@ -21145,7 +21140,21 @@ This command does many different things, depending on context:
(setq context parent)
(setq type 'item))))
;; Act according to type of element or object at point.
;;
;; Do nothing on a blank line, except if it is contained in
;; a src block. Hence, we first check if point is in such
;; a block and then if it is at a blank line.
(pcase type
((or `inline-src-block `src-block)
(unless org-babel-no-eval-on-ctrl-c-ctrl-c
(org-babel-eval-wipe-error-buffer)
(org-babel-execute-src-block
current-prefix-arg (org-babel-get-src-block-info nil context))))
((guard (org-match-line "[ \t]*$"))
(or (run-hook-with-args-until-success 'org-ctrl-c-ctrl-c-final-hook)
(user-error
(substitute-command-keys
"`\\[org-ctrl-c-ctrl-c]' can do nothing useful here"))))
((or `babel-call `inline-babel-call)
(let ((info (org-babel-lob-get-info context)))
(when info (org-babel-execute-src-block nil info))))
@ -21161,11 +21170,6 @@ This command does many different things, depending on context:
((or `headline `inlinetask)
(save-excursion (goto-char (org-element-property :begin context))
(call-interactively #'org-set-tags)))
((or `inline-src-block `src-block)
(unless org-babel-no-eval-on-ctrl-c-ctrl-c
(org-babel-eval-wipe-error-buffer)
(org-babel-execute-src-block
current-prefix-arg (org-babel-get-src-block-info nil context))))
(`item
;; At an item: `C-u C-u' sets checkbox to "[-]"
;; unconditionally, whereas `C-u' will toggle its presence.

View File

@ -4227,7 +4227,16 @@ Paragraph<point>"
(goto-char (point-max))
(org-schedule nil "2012-03-29"))
(replace-regexp-in-string
"\\( [.A-Za-z]+\\)>" "" (buffer-string) nil nil 1)))))
"\\( [.A-Za-z]+\\)>" "" (buffer-string) nil nil 1))))
(should
;; check if a repeater survives re-scheduling.
(string-match-p
"\\* H\nSCHEDULED: <2017-02-01 [.A-Za-z]* \\+\\+7d>\n"
(org-test-with-temp-text "* H\nSCHEDULED: <2017-01-19 ++7d>\n"
(let ((org-adapt-indentation nil)
(org-last-inserted-timestamp nil))
(org-schedule nil "2017-02-01"))
(buffer-string)))))
;;; Property API