>From c1a36c4f87bf3506c77ea2d19f74cb9e84040390 Mon Sep 17 00:00:00 2001 From: Rasmus
Date: Sat, 5 May 2018 20:12:31 +0200 Subject: [PATCH] Update Org to v9.1.12 Please note this is a bugfix release. See etc/ORG-NEWS for details. --- doc/misc/org.texi | 24 ++++++----- etc/refcards/orgcard.tex | 2 +- lisp/org/ob-python.el | 16 ++++++- lisp/org/ob-sed.el | 4 +- lisp/org/org-agenda.el | 20 ++++----- lisp/org/org-attach.el | 3 +- lisp/org/org-capture.el | 24 ++++------- lisp/org/org-eww.el | 17 ++++---- lisp/org/org-inlinetask.el | 33 +++++++------- lisp/org/org-table.el | 2 +- lisp/org/org-version.el | 4 +- lisp/org/org-w3m.el | 17 ++++---- lisp/org/org.el | 88 +++++++++++++++++++++++++++----------- lisp/org/ox-md.el | 11 +++-- 14 files changed, 158 insertions(+), 107 deletions(-) diff --git a/doc/misc/org.texi b/doc/misc/org.texi index 08ba33605e..5fb3efe52a 100644 --- a/doc/misc/org.texi +++ b/doc/misc/org.texi @@ -4,8 +4,8 @@ @settitle The Org Manual @include docstyle.texi address@hidden VERSION 9.1.9 address@hidden DATE 2018-03-22 address@hidden VERSION 9.1.12 address@hidden DATE 2018-04-27 @c Version and Contact Info @set MAINTAINERSITE @uref{https://orgmode.org,maintainers web page} @@ -7595,7 +7595,7 @@ To use this feature, add a bookmark with an arbitrary name, e.g. @samp{Org: capture} and enter this as @samp{Location}: @example -javascript:location.href='org-protocol://template=x'+ +javascript:location.href='org-protocol://capture?template=x'+ '&url='+encodeURIComponent(window.location.href)+ '&title='+encodeURIComponent(document.title)+ '&body='+encodeURIComponent(window.getSelection()); @@ -8664,9 +8664,13 @@ ranges can be specified with two timestamps, like @c @address@hidden<2005-05-10 Tue 20:30>--<2005-05-10 Tue 22:15>}}. -In the headline of the entry itself, a time(range) may also appear as -plain text (like @samp{12:45} or a @samp{8:30-1pm}). If the agenda -integrates the Emacs diary (@pxref{Weekly/daily agenda}), time address@hidden org-agenda-search-headline-for-time +In the headline of the entry itself, a time(range) may also appear as plain +text (like @samp{12:45} or a @samp{8:30-1pm})@footnote{You can, however, +disable this by setting @code{org-agenda-search-headline-for-time} variable +to a @code{nil} value.}. + +If the agenda integrates the Emacs diary (@pxref{Weekly/daily agenda}), time specifications in diary entries are recognized as well. For agenda display, Org mode extracts the time and displays it in a @@ -12671,12 +12675,12 @@ The @LaTeX{} export back-end converts horizontal rules by the specified @section Markdown export @cindex Markdown export -The Markdown export back-end, @code{md}, converts an Org file to a Markdown +The Markdown export back-end, @code{md}, converts an Org file to Markdown format, as defined at @url{http://daringfireball.net/projects/markdown/}. -Since @code{md} is built on top of the HTML back-end, any Org constructs not -supported by Markdown, such as tables, the underlying @code{html} back-end -(@pxref{HTML export}) converts them. +The @code{md} back-end is built on top of the HTML back-end (@pxref{HTML +export}). As a consequence, it converts every Org construct not supported by +Markdown syntax, such as tables, to HTML. @subheading Markdown export commands diff --git a/etc/refcards/orgcard.tex b/etc/refcards/orgcard.tex index 91cc03f1f1..c0edf394a7 100644 --- a/etc/refcards/orgcard.tex +++ b/etc/refcards/orgcard.tex @@ -1,5 +1,5 @@ % Reference Card for Org Mode -\def\orgversionnumber{9.1.9} +\def\orgversionnumber{9.1.12} \def\versionyear{2018} % latest update \input emacsver.tex diff --git a/lisp/org/ob-python.el b/lisp/org/ob-python.el index 9f1234bac5..a44e5a5183 100644 --- a/lisp/org/ob-python.el +++ b/lisp/org/ob-python.el @@ -308,9 +308,21 @@ last statement in BODY, as elisp." (list (format "open('%s', 'w').write(str(_))" (org-babel-process-file-name tmp-file 'noquote))))))) + (last-indent 0) (input-body (lambda (body) - (mapc (lambda (line) (insert line) (funcall send-wait)) - (split-string body "[\r\n]")) + (dolist (line (split-string body "[\r\n]")) + ;; Insert a blank line to end an indent + ;; block. + (let ((curr-indent (string-match "\\S-" line))) + (if curr-indent + (progn + (when (< curr-indent last-indent) + (insert "") + (funcall send-wait)) + (setq last-indent curr-indent)) + (setq last-indent 0))) + (insert line) + (funcall send-wait)) (funcall send-wait))) (results (pcase result-type diff --git a/lisp/org/ob-sed.el b/lisp/org/ob-sed.el index b2c80f88c0..ca8b7545fe 100644 --- a/lisp/org/ob-sed.el +++ b/lisp/org/ob-sed.el @@ -4,7 +4,7 @@ ;; Author: Bjarte Johansen ;; Keywords: literate programming, reproducible research -;; Version: 0.1.0 +;; Version: 0.1.1 ;; This file is part of GNU Emacs. @@ -79,7 +79,7 @@ function is called by `org-babel-execute-src-block'." (cmd (mapconcat #'identity (remq nil (list org-babel-sed-command - (format "--file=\"%s\"" code-file) + (format "-f \"%s\"" code-file) cmd-line in-file)) " "))) diff --git a/lisp/org/org-agenda.el b/lisp/org/org-agenda.el index 5bbf5e34ee..322480cf25 100644 --- a/lisp/org/org-agenda.el +++ b/lisp/org/org-agenda.el @@ -4261,8 +4261,9 @@ items if they have an hour specification like [h]h:mm." (insert tbl))) (goto-char (point-min)) (or org-agenda-multi (org-agenda-fit-window-to-buffer)) - (unless (and (pos-visible-in-window-p (point-min)) - (pos-visible-in-window-p (point-max))) + (unless (or (not (get-buffer-window)) + (and (pos-visible-in-window-p (point-min)) + (pos-visible-in-window-p (point-max)))) (goto-char (1- (point-max))) (recenter -1) (if (not (pos-visible-in-window-p (or start-pos 1))) @@ -4486,9 +4487,9 @@ is active." (setq files (org-agenda-files nil 'ifmode)) ;; 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) + (when (eq (car org-agenda-text-search-extra-files) 'agenda-archives) + (pop org-agenda-text-search-extra-files) + (unless (get 'org-agenda-files 'org-restrict) (setq files (org-add-archive-files files)))) ;; Uniquify files. However, let `org-check-agenda-file' handle ;; non-existent ones. @@ -4750,11 +4751,11 @@ The prefix arg TODO-ONLY limits the search to TODO entries." (format "*Org Agenda(%s:%s)*" (or org-keys (or (and todo-only "M") "m")) match) (format "*Org Agenda(%s)*" (or (and todo-only "M") "m"))))) + (setq matcher (org-make-tags-matcher match)) ;; Prepare agendas (and `org-tag-alist-for-agenda') before ;; expanding tags within `org-make-tags-matcher' (org-agenda-prepare (concat "TAGS " match)) - (setq matcher (org-make-tags-matcher match) - match (car matcher) + (setq match (car matcher) matcher (cdr matcher)) (org-compile-prefix-format 'tags) (org-set-sorting-strategy 'tags) @@ -6003,10 +6004,7 @@ specification like [h]h:mm." org-deadline-warning-days)) ;; Set pre-warning to deadline. (t 0)))) - (wdays (if suppress-prewarning - (let ((org-deadline-warning-days suppress-prewarning)) - (org-get-wdays s)) - (org-get-wdays s)))) + (wdays (or suppress-prewarning (org-get-wdays s)))) (cond ;; Only display deadlines at their base date, at future ;; repeat occurrences or in today agenda. diff --git a/lisp/org/org-attach.el b/lisp/org/org-attach.el index 9774e3a797..86516e2702 100644 --- a/lisp/org/org-attach.el +++ b/lisp/org/org-attach.el @@ -319,7 +319,8 @@ the ATTACH_DIR property) their own attachment directory." (defun org-attach-annex-get-maybe (path) "Call git annex get PATH (via shell) if using git annex. Signals an error if the file content is not available and it was not retrieved." - (let ((path-relative (file-relative-name path))) + (let* ((default-directory (expand-file-name org-attach-directory)) + (path-relative (file-relative-name path))) (when (and (org-attach-use-annex) (not (string-equal diff --git a/lisp/org/org-capture.el b/lisp/org/org-capture.el index 3de386c69d..cd54491fc9 100644 --- a/lisp/org/org-capture.el +++ b/lisp/org/org-capture.el @@ -743,9 +743,7 @@ captured item after finalizing." (org-with-point-at clock-in-task (org-clock-in))) (message "Interrupted clock has been resumed")))) - (let ((beg (point-min)) - (end (point-max)) - (abort-note nil)) + (let ((abort-note nil)) ;; Store the size of the capture buffer (org-capture-put :captured-entry-size (- (point-max) (point-min))) (widen) @@ -753,16 +751,11 @@ captured item after finalizing." (org-capture-put :insertion-point (point)) (if org-note-abort - (let ((m1 (org-capture-get :begin-marker 'local)) - (m2 (org-capture-get :end-marker 'local))) - (if (and m1 m2 (= m1 beg) (= m2 end)) - (progn - (setq m2 (if (cdr (assq 'heading org-blank-before-new-entry)) - m2 (1+ m2)) - m2 (if (< (point-max) m2) (point-max) m2)) - (setq abort-note 'clean) - (kill-region m1 m2)) - (setq abort-note 'dirty))) + (let ((beg (org-capture-get :begin-marker 'local)) + (end (org-capture-get :end-marker 'local))) + (if (not (and beg end)) (setq abort-note 'dirty) + (setq abort-note t) + (org-with-wide-buffer (kill-region beg end)))) ;; Postprocessing: Update Statistics cookies, do the sorting (when (derived-mode-p 'org-mode) @@ -1010,7 +1003,7 @@ Store them in the capture property list." ;; Use 00:00 when no time is given for another ;; date than today? (apply #'encode-time - (append '(0 0 0) + (append `(0 0 ,org-extend-today-until) (cl-cdddr (decode-time prompt-time))))) ((string-match "\\([^ ]+\\)--?[^ ]+[ ]+\\(.*\\)" org-read-date-final-answer) @@ -1607,7 +1600,8 @@ The template may still contain \"%?\" for cursor positioning." (v-c (and kill-ring (current-kill 0))) (v-x (or (org-get-x-clipboard 'PRIMARY) (org-get-x-clipboard 'CLIPBOARD) - (org-get-x-clipboard 'SECONDARY))) + (org-get-x-clipboard 'SECONDARY) + "")) ;ensure it is a string ;; `initial' and `annotation' might have been passed. But if ;; the property list has them, we prefer those values. (v-i (or (plist-get org-store-link-plist :initial) diff --git a/lisp/org/org-eww.el b/lisp/org/org-eww.el index 1b6112adbb..34c4fca690 100644 --- a/lisp/org/org-eww.el +++ b/lisp/org/org-eww.el @@ -93,11 +93,12 @@ Otherwise point is not moved. Return point." (defun org-eww-copy-for-org-mode () "Copy current buffer content or active region with `org-mode' style links. This will encode `link-title' and `link-location' with -`org-make-link-string', and insert the transformed test into the kill ring, -so that it can be yanked into an Org mode buffer with links working correctly. +`org-make-link-string' and insert the transformed text into the +kill ring, so that it can be yanked into an Org mode buffer with +links working correctly. -Further lines starting with a star get quoted with a comma to keep -the structure of the Org file." +Further lines starting with a star get quoted with a comma to +keep the structure of the Org file." (interactive) (let* ((regionp (org-region-active-p)) (transform-start (point-min)) @@ -140,13 +141,13 @@ the structure of the Org file." ;; concat `org-mode' style url to `return-content'. (setq return-content (concat return-content - (if (stringp link-location) - ;; hint: link-location is different for form-elements. + (if (org-string-nw-p link-location) + ;; Hint: link-location is different + ;; for form-elements. (org-make-link-string link-location link-title) link-title)))) (goto-char temp-position) ; reset point before jump next anchor - (setq out-bound t) ; for break out `while' loop - )) + (setq out-bound t))) ; for break out `while' loop ;; Add the rest until end of the region to be copied. (when (< (point) transform-end) (setq return-content diff --git a/lisp/org/org-inlinetask.el b/lisp/org/org-inlinetask.el index 08fc268d0d..d95db321ac 100644 --- a/lisp/org/org-inlinetask.el +++ b/lisp/org/org-inlinetask.el @@ -152,24 +152,24 @@ The number of levels is controlled by `org-inlinetask-min-level'." org-inlinetask-min-level))) (format "^\\(\\*\\{%d,\\}\\)[ \t]+" nstars))) +(defun org-inlinetask-end-p () + "Return a non-nil value if point is on inline task's END part." + (let ((case-fold-search t)) + (org-match-line (concat (org-inlinetask-outline-regexp) "END[ \t]*$")))) + (defun org-inlinetask-at-task-p () - "Return true if point is at beginning of an inline task." - (save-excursion - (beginning-of-line) - (and (looking-at (concat (org-inlinetask-outline-regexp) "\\(.*\\)")) - (not (string-match "^end[ \t]*$" (downcase (match-string 2))))))) + "Return non-nil if point is at beginning of an inline task." + (and (org-match-line (concat (org-inlinetask-outline-regexp) "\\(.*\\)")) + (not (org-inlinetask-end-p)))) (defun org-inlinetask-in-task-p () "Return true if point is inside an inline task." (save-excursion (beginning-of-line) - (let* ((case-fold-search t) - (stars-re (org-inlinetask-outline-regexp)) - (task-beg-re (concat stars-re "\\(?:.*\\)")) - (task-end-re (concat stars-re "END[ \t]*$"))) - (or (looking-at-p task-beg-re) + (let ((case-fold-search t)) + (or (looking-at-p (concat (org-inlinetask-outline-regexp) "\\(?:.*\\)")) (and (re-search-forward "^\\*+[ \t]+" nil t) - (progn (beginning-of-line) (looking-at-p task-end-re))))))) + (org-inlinetask-end-p)))))) (defun org-inlinetask-goto-beginning () "Go to the beginning of the inline task at point." @@ -177,7 +177,7 @@ The number of levels is controlled by `org-inlinetask-min-level'." (let ((case-fold-search t) (inlinetask-re (org-inlinetask-outline-regexp))) (re-search-backward inlinetask-re nil t) - (when (looking-at-p (concat inlinetask-re "END[ \t]*$")) + (when (org-inlinetask-end-p) (re-search-backward inlinetask-re nil t)))) (defun org-inlinetask-goto-end () @@ -185,16 +185,15 @@ The number of levels is controlled by `org-inlinetask-min-level'." Return point." (save-match-data (beginning-of-line) - (let* ((case-fold-search t) - (inlinetask-re (org-inlinetask-outline-regexp)) - (task-end-re (concat inlinetask-re "END[ \t]*$"))) + (let ((case-fold-search t) + (inlinetask-re (org-inlinetask-outline-regexp))) (cond - ((looking-at-p task-end-re) + ((org-inlinetask-end-p) (forward-line)) ((looking-at-p inlinetask-re) (forward-line) (cond - ((looking-at-p task-end-re) (forward-line)) + ((org-inlinetask-end-p) (forward-line)) ((looking-at-p inlinetask-re)) ((org-inlinetask-in-task-p) (re-search-forward inlinetask-re nil t) diff --git a/lisp/org/org-table.el b/lisp/org/org-table.el index dcf7430363..e451350224 100644 --- a/lisp/org/org-table.el +++ b/lisp/org/org-table.el @@ -824,7 +824,7 @@ When nil, simply write \"#ERROR\" in corrupted fields.") ;; Find fields that are wider than FMAX, and shorten them. (when fmax (dolist (x column) - (when (> (string-width x) fmax) + (when (> (org-string-width x) fmax) (org-add-props x nil 'help-echo (concat diff --git a/lisp/org/org-version.el b/lisp/org/org-version.el index 132ad2b303..90fc425849 100644 --- a/lisp/org/org-version.el +++ b/lisp/org/org-version.el @@ -5,13 +5,13 @@ (defun org-release () "The release version of Org. Inserted by installing Org mode or when a release is made." - (let ((org-release "9.1.9")) + (let ((org-release "9.1.12")) org-release)) ;;;###autoload (defun org-git-version () "The Git version of Org mode. Inserted by installing Org or when a release is made." - (let ((org-git-version "release_9.1.9-65-g5e4542")) + (let ((org-git-version "release_9.1.12-72-gc9d49a")) org-git-version)) (provide 'org-version) diff --git a/lisp/org/org-w3m.el b/lisp/org/org-w3m.el index 9690c8e90c..b2dfc7787c 100644 --- a/lisp/org/org-w3m.el +++ b/lisp/org/org-w3m.el @@ -76,13 +76,13 @@ so that it can be yanked into an Org buffer with links working correctly." (message "Transforming links...") (save-excursion (goto-char transform-start) - (while (and (not out-bound) ; still inside region to copy + (while (and (not out-bound) ; still inside region to copy (not (org-w3m-no-next-link-p))) ; no next link current buffer ;; store current point before jump next anchor (setq temp-position (point)) ;; move to next anchor when current point is not at anchor (or (get-text-property (point) 'w3m-href-anchor) (org-w3m-get-next-link-start)) - (if (<= (point) transform-end) ; if point is inside transform bound + (if (<= (point) transform-end) ; if point is inside transform bound (progn ;; get content between two links. (if (> (point) temp-position) @@ -95,12 +95,13 @@ so that it can be yanked into an Org buffer with links working correctly." (setq link-title (buffer-substring (point) (org-w3m-get-anchor-end))) ;; concat Org style url to `return-content'. - (setq return-content (concat return-content - (org-make-link-string - link-location link-title)))) - (goto-char temp-position) ; reset point before jump next anchor - (setq out-bound t) ; for break out `while' loop - )) + (setq return-content + (concat return-content + (if (org-string-nw-p link-location) + (org-make-link-string link-location link-title) + link-title)))) + (goto-char temp-position) ; reset point before jump next anchor + (setq out-bound t))) ; for break out `while' loop ;; add the rest until end of the region to be copied (if (< (point) transform-end) (setq return-content diff --git a/lisp/org/org.el b/lisp/org/org.el index 1373861ad1..626198155f 100644 --- a/lisp/org/org.el +++ b/lisp/org/org.el @@ -7,7 +7,7 @@ ;; Maintainer: Carsten Dominik