Update Org to v9.1.6

Please note this is a bugfix release. See etc/ORG-NEWS for details.
This commit is contained in:
Rasmus 2018-01-22 15:57:42 +01:00
parent fa582153f7
commit bb396a369c
31 changed files with 247 additions and 177 deletions

View file

@ -4,8 +4,8 @@
@settitle The Org Manual @settitle The Org Manual
@include docstyle.texi @include docstyle.texi
@set VERSION 9.1.4 @set VERSION 9.1.6
@set DATE 2017-09-17 @set DATE 2018-01-03
@c Version and Contact Info @c Version and Contact Info
@set MAINTAINERSITE @uref{http://orgmode.org,maintainers web page} @set MAINTAINERSITE @uref{http://orgmode.org,maintainers web page}

View file

@ -635,7 +635,7 @@ state to take effect (making a frame visible, for example).
* Changes in Specialized Modes and Packages in Emacs 26.1 * Changes in Specialized Modes and Packages in Emacs 26.1
--- ---
** Emacs 26.1 comes with Org v9.1.4. ** Emacs 26.1 comes with Org v9.1.6.
See the file ORG-NEWS for user-visible changes in Org. See the file ORG-NEWS for user-visible changes in Org.
--- ---

View file

@ -1,6 +1,6 @@
% Reference Card for Org Mode % Reference Card for Org Mode
\def\orgversionnumber{9.1.4} \def\orgversionnumber{9.1.6}
\def\versionyear{2017} % latest update \def\versionyear{2018} % latest update
\input emacsver.tex \input emacsver.tex
%**start of header %**start of header

View file

@ -74,7 +74,6 @@
(declare-function org-mark-ring-push "org" (&optional pos buffer)) (declare-function org-mark-ring-push "org" (&optional pos buffer))
(declare-function org-narrow-to-subtree "org" ()) (declare-function org-narrow-to-subtree "org" ())
(declare-function org-next-block "org" (arg &optional backward block-regexp)) (declare-function org-next-block "org" (arg &optional backward block-regexp))
(declare-function org-number-sequence "org-compat" (from &optional to inc))
(declare-function org-open-at-point "org" (&optional in-emacs reference-buffer)) (declare-function org-open-at-point "org" (&optional in-emacs reference-buffer))
(declare-function org-outline-overlay-data "org" (&optional use-markers)) (declare-function org-outline-overlay-data "org" (&optional use-markers))
(declare-function org-previous-block "org" (arg &optional block-regexp)) (declare-function org-previous-block "org" (arg &optional block-regexp))
@ -82,7 +81,7 @@
(declare-function org-reverse-string "org" (string)) (declare-function org-reverse-string "org" (string))
(declare-function org-set-outline-overlay-data "org" (data)) (declare-function org-set-outline-overlay-data "org" (data))
(declare-function org-show-context "org" (&optional key)) (declare-function org-show-context "org" (&optional key))
(declare-function org-src-coderef-format "org-src" (element)) (declare-function org-src-coderef-format "org-src" (&optional element))
(declare-function org-src-coderef-regexp "org-src" (fmt &optional label)) (declare-function org-src-coderef-regexp "org-src" (fmt &optional label))
(declare-function org-table-align "org-table" ()) (declare-function org-table-align "org-table" ())
(declare-function org-table-end "org-table" (&optional table-type)) (declare-function org-table-end "org-table" (&optional table-type))
@ -2476,7 +2475,7 @@ in the buffer."
(point)))))) (point))))))
(defun org-babel-result-to-file (result &optional description) (defun org-babel-result-to-file (result &optional description)
"Convert RESULT into an `org-mode' link with optional DESCRIPTION. "Convert RESULT into an Org link with optional DESCRIPTION.
If the `default-directory' is different from the containing If the `default-directory' is different from the containing
file's directory then expand relative links." file's directory then expand relative links."
(when (stringp result) (when (stringp result)
@ -2761,22 +2760,27 @@ block but are passed literally to the \"example-block\"."
(if org-babel-use-quick-and-dirty-noweb-expansion (if org-babel-use-quick-and-dirty-noweb-expansion
(while (re-search-forward rx nil t) (while (re-search-forward rx nil t)
(let* ((i (org-babel-get-src-block-info 'light)) (let* ((i (org-babel-get-src-block-info 'light))
(body (org-babel-expand-noweb-references i)) (body (if (org-babel-noweb-p (nth 2 i) :eval)
(org-babel-expand-noweb-references i)
(nth 1 i)))
(sep (or (cdr (assq :noweb-sep (nth 2 i))) (sep (or (cdr (assq :noweb-sep (nth 2 i)))
"\n")) "\n"))
(full (if comment (full (if comment
(let ((cs (org-babel-tangle-comment-links i))) (let ((cs (org-babel-tangle-comment-links i)))
(concat (funcall c-wrap (car cs)) "\n" (concat (funcall c-wrap (car cs)) "\n"
body "\n" body "\n"
(funcall c-wrap (cadr cs)))) (funcall c-wrap (cadr cs))))
body))) body)))
(setq expansion (cons sep (cons full expansion))))) (setq expansion (cons sep (cons full expansion)))))
(org-babel-map-src-blocks nil (org-babel-map-src-blocks nil
(let ((i (org-babel-get-src-block-info 'light))) (let ((i (let ((org-babel-current-src-block-location (point)))
(org-babel-get-src-block-info 'light))))
(when (equal (or (cdr (assq :noweb-ref (nth 2 i))) (when (equal (or (cdr (assq :noweb-ref (nth 2 i)))
(nth 4 i)) (nth 4 i))
source-name) source-name)
(let* ((body (org-babel-expand-noweb-references i)) (let* ((body (if (org-babel-noweb-p (nth 2 i) :eval)
(org-babel-expand-noweb-references i)
(nth 1 i)))
(sep (or (cdr (assq :noweb-sep (nth 2 i))) (sep (or (cdr (assq :noweb-sep (nth 2 i)))
"\n")) "\n"))
(full (if comment (full (if comment

View file

@ -58,9 +58,13 @@ returned is the value of the last form in BODY. Assume that
point is at the beginning of the Babel block." point is at the beginning of the Babel block."
(declare (indent 1) (debug body)) (declare (indent 1) (debug body))
`(let ((source (get-text-property (point) 'org-reference))) `(let ((source (get-text-property (point) 'org-reference)))
(with-current-buffer org-babel-exp-reference-buffer ;; Source blocks created during export process (e.g., by other
;; source blocks) are not referenced. In this case, do not move
;; point at all.
(with-current-buffer (if source org-babel-exp-reference-buffer
(current-buffer))
(org-with-wide-buffer (org-with-wide-buffer
(goto-char source) (when source (goto-char source))
,@body)))) ,@body))))
(defun org-babel-exp-src-block () (defun org-babel-exp-src-block ()

View file

@ -116,6 +116,8 @@ code."
(timefmt (cdr (assq :timefmt params))) (timefmt (cdr (assq :timefmt params)))
(time-ind (or (cdr (assq :timeind params)) (time-ind (or (cdr (assq :timeind params))
(when timefmt 1))) (when timefmt 1)))
(directory (and (buffer-file-name)
(file-name-directory (buffer-file-name))))
(add-to-body (lambda (text) (setq body (concat text "\n" body))))) (add-to-body (lambda (text) (setq body (concat text "\n" body)))))
;; append header argument settings to body ;; append header argument settings to body
(when title (funcall add-to-body (format "set title '%s'" title))) (when title (funcall add-to-body (format "set title '%s'" title)))
@ -161,7 +163,10 @@ code."
(format "\\$%s" (car pair)) (cdr pair) body))) (format "\\$%s" (car pair)) (cdr pair) body)))
vars) vars)
(when prologue (funcall add-to-body prologue)) (when prologue (funcall add-to-body prologue))
(when epilogue (setq body (concat body "\n" epilogue)))) (when epilogue (setq body (concat body "\n" epilogue)))
;; Setting the directory needs to be done first so that
;; subsequent 'output' directive goes to the right place.
(when directory (funcall add-to-body (format "cd '%s'" directory))))
body)) body))
(defun org-babel-execute:gnuplot (body params) (defun org-babel-execute:gnuplot (body params)

View file

@ -59,14 +59,23 @@
(defvar org-babel-haskell-eoe "\"org-babel-haskell-eoe\"") (defvar org-babel-haskell-eoe "\"org-babel-haskell-eoe\"")
(defvar haskell-prompt-regexp)
(defun org-babel-execute:haskell (body params) (defun org-babel-execute:haskell (body params)
"Execute a block of Haskell code." "Execute a block of Haskell code."
(require 'inf-haskell)
(add-hook 'inferior-haskell-hook
(lambda ()
(setq-local comint-prompt-regexp
(concat haskell-prompt-regexp "\\|^λ?> "))))
(let* ((session (cdr (assq :session params))) (let* ((session (cdr (assq :session params)))
(result-type (cdr (assq :result-type params))) (result-type (cdr (assq :result-type params)))
(full-body (org-babel-expand-body:generic (full-body (org-babel-expand-body:generic
body params body params
(org-babel-variable-assignments:haskell params))) (org-babel-variable-assignments:haskell params)))
(session (org-babel-haskell-initiate-session session params)) (session (org-babel-haskell-initiate-session session params))
(comint-preoutput-filter-functions
(cons 'ansi-color-filter-apply comint-preoutput-filter-functions))
(raw (org-babel-comint-with-output (raw (org-babel-comint-with-output
(session org-babel-haskell-eoe t full-body) (session org-babel-haskell-eoe t full-body)
(insert (org-trim full-body)) (insert (org-trim full-body))

View file

@ -39,9 +39,9 @@
;; directory). ;; directory).
;; Although it might seem more natural to use Emacs Lisp for most ;; Although it might seem more natural to use Emacs Lisp for most
;; Lisp-based programming tasks inside Org-Mode, an Emacs library ;; Lisp-based programming tasks inside Org, an Emacs library written
;; written in Emacs Lisp, PicoLisp has at least two outstanding ;; in Emacs Lisp, PicoLisp has at least two outstanding features that
;; features that make it a valuable addition to Org-Babel: ;; make it a valuable addition to Org Babel:
;; PicoLisp _is_ an object-oriented database with a Prolog-based query ;; PicoLisp _is_ an object-oriented database with a Prolog-based query
;; language implemented in PicoLisp (Pilog). Database objects are ;; language implemented in PicoLisp (Pilog). Database objects are

View file

@ -239,6 +239,15 @@ def main():
open('%s', 'w').write( pprint.pformat(main()) )") open('%s', 'w').write( pprint.pformat(main()) )")
(defconst org-babel-python--exec-tmpfile
(concat
"__org_babel_python_fname = '%s'; "
"__org_babel_python_fh = open(__org_babel_python_fname); "
"exec(compile("
"__org_babel_python_fh.read(), __org_babel_python_fname, 'exec'"
")); "
"__org_babel_python_fh.close()"))
(defun org-babel-python-evaluate (defun org-babel-python-evaluate
(session body &optional result-type result-params preamble) (session body &optional result-type result-params preamble)
"Evaluate BODY as Python code." "Evaluate BODY as Python code."
@ -306,16 +315,23 @@ last statement in BODY, as elisp."
(results (results
(pcase result-type (pcase result-type
(`output (`output
(mapconcat (let ((body (if (string-match-p ".\n+." body) ; Multiline
#'org-trim (let ((tmp-src-file (org-babel-temp-file
(butlast "python-")))
(org-babel-comint-with-output (with-temp-file tmp-src-file (insert body))
(session org-babel-python-eoe-indicator t body) (format org-babel-python--exec-tmpfile
(funcall input-body body) tmp-src-file))
(funcall send-wait) (funcall send-wait) body)))
(insert org-babel-python-eoe-indicator) (mapconcat
(funcall send-wait)) #'org-trim
2) "\n")) (butlast
(org-babel-comint-with-output
(session org-babel-python-eoe-indicator t body)
(funcall input-body body)
(funcall send-wait) (funcall send-wait)
(insert org-babel-python-eoe-indicator)
(funcall send-wait))
2) "\n")))
(`value (`value
(let ((tmp-file (org-babel-temp-file "python-"))) (let ((tmp-file (org-babel-temp-file "python-")))
(org-babel-comint-with-output (org-babel-comint-with-output

View file

@ -65,24 +65,21 @@
(declare-function org-show-context "org" (&optional key)) (declare-function org-show-context "org" (&optional key))
(declare-function org-trim "org" (s &optional keep-lead)) (declare-function org-trim "org" (s &optional keep-lead))
(defvar org-babel-ref-split-regexp
"[ \f\t\n\r\v]*\\(.+?\\)[ \f\t\n\r\v]*=[ \f\t\n\r\v]*\\(.+\\)[ \f\t\n\r\v]*")
(defvar org-babel-update-intermediate nil (defvar org-babel-update-intermediate nil
"Update the in-buffer results of code blocks executed to resolve references.") "Update the in-buffer results of code blocks executed to resolve references.")
(defun org-babel-ref-parse (assignment) (defun org-babel-ref-parse (assignment)
"Parse a variable ASSIGNMENT in a header argument. "Parse a variable ASSIGNMENT in a header argument.
If the right hand side of the assignment has a literal value If the right hand side of the assignment has a literal value
return that value, otherwise interpret as a reference to an return that value, otherwise interpret it as a reference to an
external resource and find its value using external resource and find its value using `org-babel-ref-resolve'.
`org-babel-ref-resolve'. Return a list with two elements. The
first element of the list will be the name of the variable, and Return a list with two elements: the name of the variable, and an
the second will be an emacs-lisp representation of the value of Emacs Lisp representation of the value of the variable."
the variable." (when (string-match "\\(.+?\\)=" assignment)
(when (string-match org-babel-ref-split-regexp assignment) (let ((var (org-trim (match-string 1 assignment)))
(let ((var (match-string 1 assignment)) (ref (org-trim (substring assignment (match-end 0)))))
(ref (match-string 2 assignment)))
(cons (intern var) (cons (intern var)
(let ((out (save-excursion (let ((out (save-excursion
(when org-babel-current-src-block-location (when org-babel-current-src-block-location

View file

@ -40,6 +40,7 @@
;;; Code: ;;; Code:
(require 'ob) (require 'ob)
(require 'geiser nil t) (require 'geiser nil t)
(require 'geiser-impl nil t)
(defvar geiser-repl--repl) ; Defined in geiser-repl.el (defvar geiser-repl--repl) ; Defined in geiser-repl.el
(defvar geiser-impl--implementation) ; Defined in geiser-impl.el (defvar geiser-impl--implementation) ; Defined in geiser-impl.el
(defvar geiser-default-implementation) ; Defined in geiser-impl.el (defvar geiser-default-implementation) ; Defined in geiser-impl.el

View file

@ -49,11 +49,12 @@
(defcustom org-babel-stan-cmdstan-directory nil (defcustom org-babel-stan-cmdstan-directory nil
"CmdStan source directory. "CmdStan source directory.
'make' will be called from this directory to compile the Stan Call \"make\" from this directory to compile the Stan block.
block. When nil, executing Stan blocks dumps the content to a When nil, executing Stan blocks dumps the content to a file."
plain text file."
:group 'org-babel :group 'org-babel
:type 'string) :type '(choice
(directory :tag "Compilation directory")
(const :tag "Dump to a file" nil)))
(defvar org-babel-default-header-args:stan (defvar org-babel-default-header-args:stan
'((:results . "file"))) '((:results . "file")))

View file

@ -395,35 +395,35 @@ the daily/weekly agenda, see `org-agenda-skip-function'.")
(choice (choice
:tag "Condition type" :tag "Condition type"
(list :tag "Regexp matches" :inline t (list :tag "Regexp matches" :inline t
(const :format "" 'regexp) (const :format "" regexp)
(regexp)) (regexp))
(list :tag "Regexp does not match" :inline t (list :tag "Regexp does not match" :inline t
(const :format "" 'notregexp) (const :format "" notregexp)
(regexp)) (regexp))
(list :tag "TODO state is" :inline t (list :tag "TODO state is" :inline t
(const 'todo) (const todo)
(choice (choice
(const :tag "Any not-done state" 'todo) (const :tag "Any not-done state" todo)
(const :tag "Any done state" 'done) (const :tag "Any done state" done)
(const :tag "Any state" 'any) (const :tag "Any state" any)
(list :tag "Keyword list" (list :tag "Keyword list"
(const :format "" quote) (const :format "" quote)
(repeat (string :tag "Keyword"))))) (repeat (string :tag "Keyword")))))
(list :tag "TODO state is not" :inline t (list :tag "TODO state is not" :inline t
(const 'nottodo) (const nottodo)
(choice (choice
(const :tag "Any not-done state" 'todo) (const :tag "Any not-done state" todo)
(const :tag "Any done state" 'done) (const :tag "Any done state" done)
(const :tag "Any state" 'any) (const :tag "Any state" any)
(list :tag "Keyword list" (list :tag "Keyword list"
(const :format "" quote) (const :format "" quote)
(repeat (string :tag "Keyword"))))) (repeat (string :tag "Keyword")))))
(const :tag "scheduled" 'scheduled) (const :tag "scheduled" scheduled)
(const :tag "not scheduled" 'notscheduled) (const :tag "not scheduled" notscheduled)
(const :tag "deadline" 'deadline) (const :tag "deadline" deadline)
(const :tag "no deadline" 'notdeadline) (const :tag "no deadline" notdeadline)
(const :tag "timestamp" 'timestamp) (const :tag "timestamp" timestamp)
(const :tag "no timestamp" 'nottimestamp)))))) (const :tag "no timestamp" nottimestamp))))))
(list :tag "Non-standard skipping condition" (list :tag "Non-standard skipping condition"
:value (org-agenda-skip-function) :value (org-agenda-skip-function)
(const org-agenda-skip-function) (const org-agenda-skip-function)
@ -3563,7 +3563,7 @@ removed from the entry content. Currently only `planning' is allowed here."
txt)) txt))
(defun org-check-for-org-mode () (defun org-check-for-org-mode ()
"Make sure current buffer is in org-mode. Error if not." "Make sure current buffer is in Org mode. Error if not."
(or (derived-mode-p 'org-mode) (or (derived-mode-p 'org-mode)
(error "Cannot execute Org agenda command on buffer in %s" (error "Cannot execute Org agenda command on buffer in %s"
major-mode))) major-mode)))
@ -4509,7 +4509,7 @@ is active."
(with-current-buffer buffer (with-current-buffer buffer
(with-syntax-table (org-search-syntax-table) (with-syntax-table (org-search-syntax-table)
(unless (derived-mode-p 'org-mode) (unless (derived-mode-p 'org-mode)
(error "Agenda file %s is not in `org-mode'" file)) (error "Agenda file %s is not in Org mode" file))
(let ((case-fold-search t)) (let ((case-fold-search t))
(save-excursion (save-excursion
(save-restriction (save-restriction
@ -4774,7 +4774,7 @@ The prefix arg TODO-ONLY limits the search to TODO entries."
rtnall (append rtnall rtn)) rtnall (append rtnall rtn))
(with-current-buffer buffer (with-current-buffer buffer
(unless (derived-mode-p 'org-mode) (unless (derived-mode-p 'org-mode)
(error "Agenda file %s is not in `org-mode'" file)) (error "Agenda file %s is not in Org mode" file))
(save-excursion (save-excursion
(save-restriction (save-restriction
(if (eq buffer org-agenda-restrict) (if (eq buffer org-agenda-restrict)
@ -5067,9 +5067,9 @@ of what a project is and how to check if it stuck, customize the variable
(defun org-agenda-cleanup-fancy-diary () (defun org-agenda-cleanup-fancy-diary ()
"Remove unwanted stuff in buffer created by `fancy-diary-display'. "Remove unwanted stuff in buffer created by `fancy-diary-display'.
This gets rid of the date, the underline under the date, and This gets rid of the date, the underline under the date, and the
the dummy entry installed by `org-mode' to ensure non-empty diary for each dummy entry installed by Org mode to ensure non-empty diary for
date. It also removes lines that contain only whitespace." each date. It also removes lines that contain only whitespace."
(goto-char (point-min)) (goto-char (point-min))
(if (looking-at ".*?:[ \t]*") (if (looking-at ".*?:[ \t]*")
(progn (progn
@ -5214,7 +5214,7 @@ the documentation of `org-diary'."
(list (format "ORG-AGENDA-ERROR: No such org-file %s" file)) (list (format "ORG-AGENDA-ERROR: No such org-file %s" file))
(with-current-buffer buffer (with-current-buffer buffer
(unless (derived-mode-p 'org-mode) (unless (derived-mode-p 'org-mode)
(error "Agenda file %s is not in `org-mode'" file)) (error "Agenda file %s is not in Org mode" file))
(setq org-agenda-buffer (or org-agenda-buffer buffer)) (setq org-agenda-buffer (or org-agenda-buffer buffer))
(setf org-agenda-current-date date) (setf org-agenda-current-date date)
(save-excursion (save-excursion

View file

@ -429,7 +429,7 @@ Archiving time is retained in the ARCHIVE_TIME node property."
(looking-at org-outline-regexp) (looking-at org-outline-regexp)
(setq leader (match-string 0) (setq leader (match-string 0)
level (funcall outline-level)) level (funcall outline-level))
(setq pos (point)) (setq pos (point-marker))
(condition-case nil (condition-case nil
(outline-up-heading 1 t) (outline-up-heading 1 t)
(error (setq e (point-max)) (goto-char (point-min)))) (error (setq e (point-max)) (goto-char (point-min))))

View file

@ -927,18 +927,24 @@ Store them in the capture property list."
(_ (error "Cannot find target ID \"%s\"" id)))) (_ (error "Cannot find target ID \"%s\"" id))))
(`(file+headline ,path ,headline) (`(file+headline ,path ,headline)
(set-buffer (org-capture-target-buffer path)) (set-buffer (org-capture-target-buffer path))
;; Org expects the target file to be in Org mode, otherwise
;; it throws an error. However, the default notes files
;; should work out of the box. In this case, we switch it to
;; Org mode.
(unless (derived-mode-p 'org-mode) (unless (derived-mode-p 'org-mode)
(error "Target buffer \"%s\" for file+headline not in Org mode" (org-display-warning
(current-buffer))) (format "Capture requirement: switching buffer %S to Org mode"
(current-buffer)))
(org-mode))
(org-capture-put-target-region-and-position) (org-capture-put-target-region-and-position)
(widen) (widen)
(goto-char (point-min)) (goto-char (point-min))
(if (re-search-forward (format org-complex-heading-regexp-format (if (re-search-forward (format org-complex-heading-regexp-format
(regexp-quote headline)) (regexp-quote headline))
nil t) nil t)
(goto-char (line-beginning-position)) (beginning-of-line)
(goto-char (point-max)) (goto-char (point-max))
(or (bolp) (insert "\n")) (unless (bolp) (insert "\n"))
(insert "* " headline "\n") (insert "* " headline "\n")
(beginning-of-line 0))) (beginning-of-line 0)))
(`(file+olp ,path . ,outline-path) (`(file+olp ,path . ,outline-path)

View file

@ -1456,8 +1456,7 @@ The time is always returned as UTC."
(day (nth 3 dt))) (day (nth 3 dt)))
(if (< hour org-extend-today-until) (setf (nth 3 dt) (1- day))) (if (< hour org-extend-today-until) (setf (nth 3 dt) (1- day)))
(setf (nth 2 dt) org-extend-today-until) (setf (nth 2 dt) org-extend-today-until)
(setq dt (append (list 0 0) (nthcdr 2 dt) '(t))) (apply #'encode-time (append (list 0 0) (nthcdr 2 dt)))))
(apply #'encode-time dt)))
((or (equal cmt "all") ((or (equal cmt "all")
(and (or (not cmt) (equal cmt "auto")) (and (or (not cmt) (equal cmt "auto"))
(not lr))) (not lr)))

View file

@ -32,12 +32,12 @@
(require 'cl-lib) (require 'cl-lib)
(require 'org-macs) (require 'org-macs)
(declare-function org-at-table.el-p "org" (&optional table-type)) (declare-function org-at-table.el-p "org" ())
(declare-function org-element-at-point "org-element" ()) (declare-function org-element-at-point "org-element" ())
(declare-function org-element-type "org-element" (element)) (declare-function org-element-type "org-element" (element))
(declare-function org-end-of-subtree "org" (&optional invisible-ok to-heading)) (declare-function org-end-of-subtree "org" (&optional invisible-ok to-heading))
(declare-function org-link-set-parameters "org" (type &rest rest)) (declare-function org-link-set-parameters "org" (type &rest rest))
(declare-function org-table-end (&optional table-type)) (declare-function org-table-end "org-table" (&optional table-type))
(declare-function outline-next-heading "outline" ()) (declare-function outline-next-heading "outline" ())
(declare-function table--at-cell-p "table" (position &optional object at-column)) (declare-function table--at-cell-p "table" (position &optional object at-column))

View file

@ -51,7 +51,7 @@
(require 'cl-lib) (require 'cl-lib)
(require 'org-macs) (require 'org-macs)
(declare-function org-trim "org-trim" (s &optional keep-lead)) (declare-function org-trim "org" (s &optional keep-lead))
;;; Public variables ;;; Public variables
@ -99,8 +99,8 @@ sure to call the following command:
:set (lambda (var val) (set-default var val) (org-duration-set-regexps)) :set (lambda (var val) (set-default var val) (org-duration-set-regexps))
:initialize 'custom-initialize-changed :initialize 'custom-initialize-changed
:type '(choice :type '(choice
(const :tag "H:MM" 'h:mm) (const :tag "H:MM" h:mm)
(const :tag "H:MM:SS" 'h:mm:ss) (const :tag "H:MM:SS" h:mm:ss)
(alist :key-type (string :tag "Unit") (alist :key-type (string :tag "Unit")
:value-type (number :tag "Modifier")))) :value-type (number :tag "Modifier"))))

View file

@ -45,7 +45,7 @@
(declare-function org-element-property "org-element" (property element)) (declare-function org-element-property "org-element" (property element))
(declare-function org-element-type "org-element" (element)) (declare-function org-element-type "org-element" (element))
(declare-function org-end-of-subtree "org" (&optional invisible-ok to-heading)) (declare-function org-end-of-subtree "org" (&optional invisible-ok to-heading))
(declare-function org-fill-paragraph "org" (&optional justify)) (declare-function org-fill-paragraph "org" (&optional justify region))
(declare-function org-in-block-p "org" (names)) (declare-function org-in-block-p "org" (names))
(declare-function org-in-regexp "org" (re &optional nlines visually)) (declare-function org-in-regexp "org" (re &optional nlines visually))
(declare-function org-in-verbatim-emphasis "org" ()) (declare-function org-in-verbatim-emphasis "org" ())

View file

@ -182,24 +182,28 @@ The number of levels is controlled by `org-inlinetask-min-level'."
(defun org-inlinetask-goto-end () (defun org-inlinetask-goto-end ()
"Go to the end of the inline task at point. "Go to the end of the inline task at point.
Return point." Return point."
(save-match-data (save-match-data
(beginning-of-line) (beginning-of-line)
(let* ((case-fold-search t) (let* ((case-fold-search t)
(inlinetask-re (org-inlinetask-outline-regexp)) (inlinetask-re (org-inlinetask-outline-regexp))
(task-end-re (concat inlinetask-re "END[ \t]*$"))) (task-end-re (concat inlinetask-re "END[ \t]*$")))
(cond (cond
((looking-at task-end-re)) ((looking-at-p task-end-re)
((looking-at inlinetask-re) (forward-line))
(forward-line) ((looking-at-p inlinetask-re)
(cond (forward-line)
((looking-at task-end-re)) (cond
((looking-at inlinetask-re)) ((looking-at-p task-end-re) (forward-line))
((org-inlinetask-in-task-p) ((looking-at-p inlinetask-re))
(re-search-forward inlinetask-re nil t)))) ((org-inlinetask-in-task-p)
(t (re-search-forward inlinetask-re nil t))) (re-search-forward inlinetask-re nil t)
(end-of-line) (forward-line))
(point)))) (t nil)))
(t
(re-search-forward inlinetask-re nil t)
(forward-line)))))
(point))
(defun org-inlinetask-get-task-level () (defun org-inlinetask-get-task-level ()
"Get the level of the inline task around. "Get the level of the inline task around.
@ -330,7 +334,9 @@ This function is meant to be used in `org-cycle-hook'."
(org-inlinetask-goto-end))))) (org-inlinetask-goto-end)))))
(`children (`children
(save-excursion (save-excursion
(while (and (outline-next-heading) (org-inlinetask-at-task-p)) (while
(or (org-inlinetask-at-task-p)
(and (outline-next-heading) (org-inlinetask-at-task-p)))
(org-inlinetask-toggle-visibility) (org-inlinetask-toggle-visibility)
(org-inlinetask-goto-end)))))) (org-inlinetask-goto-end))))))

View file

@ -41,11 +41,6 @@
;;;; Customization variables ;;;; Customization variables
(defgroup org-complete nil
"Outline-based notes management and organizer."
:tag "Org"
:group 'org)
(defvar org-drawer-regexp) (defvar org-drawer-regexp)
(defvar org-property-re) (defvar org-property-re)
(defvar org-current-tag-alist) (defvar org-current-tag-alist)

View file

@ -644,17 +644,30 @@ nil When nil, the command tries to be smart and figure out the
(org-table-align)))) (org-table-align))))
;;;###autoload ;;;###autoload
(defun org-table-import (file arg) (defun org-table-import (file separator)
"Import FILE as a table. "Import FILE as a table.
The file is assumed to be tab-separated. Such files can be produced by most
spreadsheet and database applications. If no tabs (at least one per line) The command tries to be smart and figure out the separator in the
are found, lines will be split on whitespace into fields." following way:
- when each line contains a TAB, assume TAB-separated material
- when each line contains a comma, assume CSV material
- else, assume one or more SPACE characters as separator.
When non-nil, SEPARATOR specifies the field separator in the
lines. It can have the following values:
(4) Use the comma as a field separator
(16) Use a TAB as field separator
(64) Prompt for a regular expression as field separator
integer When a number, use that many spaces, or a TAB, as field separator
regexp When a regular expression, use it to match the separator."
(interactive "f\nP") (interactive "f\nP")
(or (bolp) (newline)) (unless (bolp) (insert "\n"))
(let ((beg (point)) (let ((beg (point))
(pm (point-max))) (pm (point-max)))
(insert-file-contents file) (insert-file-contents file)
(org-table-convert-region beg (+ (point) (- (point-max) pm)) arg))) (org-table-convert-region beg (+ (point) (- (point-max) pm)) separator)))
;;;###autoload ;;;###autoload
@ -1166,7 +1179,7 @@ to a number. In the case of a timestamp, increment by days."
(- (org-time-string-to-absolute txt) (- (org-time-string-to-absolute txt)
(org-time-string-to-absolute txt-up))) (org-time-string-to-absolute txt-up)))
((string-match org-ts-regexp3 txt) 1) ((string-match org-ts-regexp3 txt) 1)
((string-match "\\([-+]\\)?[0-9]+\\(?:\.[0-9]+\\)?" txt-up) ((string-match "\\([-+]\\)?\\(?:[0-9]+\\)?\\(?:\.[0-9]+\\)?" txt-up)
(- (string-to-number txt) (- (string-to-number txt)
(string-to-number (match-string 0 txt-up)))) (string-to-number (match-string 0 txt-up))))
(t 1))) (t 1)))
@ -4311,14 +4324,14 @@ FACE, when non-nil, for the highlight."
;;;###autoload ;;;###autoload
(define-minor-mode orgtbl-mode (define-minor-mode orgtbl-mode
"The `org-mode' table editor as a minor mode for use in other modes." "The Org mode table editor as a minor mode for use in other modes."
:lighter " OrgTbl" :keymap orgtbl-mode-map :lighter " OrgTbl" :keymap orgtbl-mode-map
(org-load-modules-maybe) (org-load-modules-maybe)
(cond (cond
((derived-mode-p 'org-mode) ((derived-mode-p 'org-mode)
;; Exit without error, in case some hook functions calls this ;; Exit without error, in case some hook functions calls this by
;; by accident in org-mode. ;; accident in Org mode.
(message "Orgtbl-mode is not useful in org-mode, command ignored")) (message "Orgtbl mode is not useful in Org mode, command ignored"))
(orgtbl-mode (orgtbl-mode
(and (orgtbl-setup) (defun orgtbl-setup () nil)) ;; FIXME: Yuck!?! (and (orgtbl-setup) (defun orgtbl-setup () nil)) ;; FIXME: Yuck!?!
;; Make sure we are first in minor-mode-map-alist ;; Make sure we are first in minor-mode-map-alist

View file

@ -5,13 +5,13 @@
(defun org-release () (defun org-release ()
"The release version of Org. "The release version of Org.
Inserted by installing Org mode or when a release is made." Inserted by installing Org mode or when a release is made."
(let ((org-release "9.1.4")) (let ((org-release "9.1.6"))
org-release)) org-release))
;;;###autoload ;;;###autoload
(defun org-git-version () (defun org-git-version ()
"The Git version of org-mode. "The Git version of Org mode.
Inserted by installing Org or when a release is made." Inserted by installing Org or when a release is made."
(let ((org-git-version "release_9.1.4-44-gfe7310")) (let ((org-git-version "release_9.1.6-50-g96b33f"))
org-git-version)) org-git-version))
(provide 'org-version) (provide 'org-version)

View file

@ -57,7 +57,7 @@
:description (or w3m-current-title w3m-current-url)))) :description (or w3m-current-title w3m-current-url))))
(defun org-w3m-copy-for-org-mode () (defun org-w3m-copy-for-org-mode ()
"Copy current buffer content or active region with `org-mode' style links. "Copy current buffer content or active region with Org style links.
This will encode `link-title' and `link-location' with This will encode `link-title' and `link-location' with
`org-make-link-string', and insert the transformed test into the kill ring, `org-make-link-string', and insert the transformed test into the kill ring,
so that it can be yanked into an Org buffer with links working correctly." so that it can be yanked into an Org buffer with links working correctly."
@ -94,7 +94,7 @@ so that it can be yanked into an Org buffer with links working correctly."
;; get link title at current point. ;; get link title at current point.
(setq link-title (buffer-substring (point) (setq link-title (buffer-substring (point)
(org-w3m-get-anchor-end))) (org-w3m-get-anchor-end)))
;; concat `org-mode' style url to `return-content'. ;; concat Org style url to `return-content'.
(setq return-content (concat return-content (setq return-content (concat return-content
(org-make-link-string (org-make-link-string
link-location link-title)))) link-location link-title))))

View file

@ -749,7 +749,7 @@ For export specific modules, see also `org-export-backends'."
(const :tag "C panel: Simple routines for us with bad memory" org-panel) (const :tag "C panel: Simple routines for us with bad memory" org-panel)
(const :tag "C registry: A registry for Org links" org-registry) (const :tag "C registry: A registry for Org links" org-registry)
(const :tag "C screen: Visit screen sessions through Org links" org-screen) (const :tag "C screen: Visit screen sessions through Org links" org-screen)
(const :tag "C secretary: Team management with org-mode" org-secretary) (const :tag "C secretary: Team management with Org" org-secretary)
(const :tag "C sqlinsert: Convert Org tables to SQL insertions" orgtbl-sqlinsert) (const :tag "C sqlinsert: Convert Org tables to SQL insertions" orgtbl-sqlinsert)
(const :tag "C toc: Table of contents for Org buffer" org-toc) (const :tag "C toc: Table of contents for Org buffer" org-toc)
(const :tag "C track: Keep up with Org mode development" org-track) (const :tag "C track: Keep up with Org mode development" org-track)
@ -1710,7 +1710,7 @@ doesn't specify any upper case character."
:type '(choice :type '(choice
(const :tag "Case-sensitive" nil) (const :tag "Case-sensitive" nil)
(const :tag "Case-insensitive" t) (const :tag "Case-insensitive" t)
(const :tag "Case-insensitive for lower case searches only" 'smart))) (const :tag "Case-insensitive for lower case searches only" smart)))
(defcustom org-occur-hook '(org-first-headline-recenter) (defcustom org-occur-hook '(org-first-headline-recenter)
"Hook that is run after `org-occur' has constructed a sparse tree. "Hook that is run after `org-occur' has constructed a sparse tree.
@ -4167,7 +4167,10 @@ A string will be inserted as-is in the header of the document."
(list :tag "options/package pair" (list :tag "options/package pair"
(string :tag "options") (string :tag "options")
(string :tag "package") (string :tag "package")
(boolean :tag "Snippet")) (boolean :tag "Snippet")
(choice
(const :tag "For all compilers" nil)
(repeat :tag "Allowed compiler" string)))
(string :tag "A line of LaTeX")))) (string :tag "A line of LaTeX"))))
(defcustom org-latex-packages-alist nil (defcustom org-latex-packages-alist nil
@ -4870,7 +4873,7 @@ After a match, the following groups carry important information:
("beamer" org-startup-with-beamer-mode t) ("beamer" org-startup-with-beamer-mode t)
("entitiespretty" org-pretty-entities t) ("entitiespretty" org-pretty-entities t)
("entitiesplain" org-pretty-entities nil)) ("entitiesplain" org-pretty-entities nil))
"Variable associated with STARTUP options for org-mode. "Variable associated with STARTUP options for Org.
Each element is a list of three items: the startup options (as written Each element is a list of three items: the startup options (as written
in the #+STARTUP line), the corresponding variable, and the value to set in the #+STARTUP line), the corresponding variable, and the value to set
this variable to if the option is found. An optional forth element PUSH this variable to if the option is found. An optional forth element PUSH
@ -5934,7 +5937,7 @@ by a #."
(defun org-fontify-meta-lines-and-blocks (limit) (defun org-fontify-meta-lines-and-blocks (limit)
(condition-case nil (condition-case nil
(org-fontify-meta-lines-and-blocks-1 limit) (org-fontify-meta-lines-and-blocks-1 limit)
(error (message "org-mode fontification error in %S at %d" (error (message "Org mode fontification error in %S at %d"
(current-buffer) (current-buffer)
(line-number-at-pos))))) (line-number-at-pos)))))
@ -6925,6 +6928,7 @@ If POS is nil, use `point' instead."
(org-list-set-item-visibility (point-at-bol) struct 'children) (org-list-set-item-visibility (point-at-bol) struct 'children)
(org-show-entry) (org-show-entry)
(org-with-limited-levels (org-show-children)) (org-with-limited-levels (org-show-children))
(org-show-set-visibility 'canonical)
;; FIXME: This slows down the func way too much. ;; FIXME: This slows down the func way too much.
;; How keep drawers hidden in subtree anyway? ;; How keep drawers hidden in subtree anyway?
;; (when (memq 'org-cycle-hide-drawers org-cycle-hook) ;; (when (memq 'org-cycle-hide-drawers org-cycle-hook)
@ -7019,20 +7023,22 @@ With a numeric prefix, show all headlines up to that level."
(save-excursion (save-excursion
(org-back-to-heading t) (org-back-to-heading t)
(outline-hide-subtree) (outline-hide-subtree)
(org-reveal) (org-reveal))
(cond (cond
((equal state "folded") ((equal state "folded")
(outline-hide-subtree)) (outline-hide-subtree)
((equal state "children") (org-end-of-subtree t t))
(org-show-hidden-entry) ((equal state "children")
(org-show-children)) (org-show-hidden-entry)
((equal state "content") (org-show-children))
(save-excursion ((equal state "content")
(save-restriction (save-excursion
(org-narrow-to-subtree) (save-restriction
(org-content)))) (org-narrow-to-subtree)
((member state '("all" "showall")) (org-content)))
(outline-show-subtree))))))) (org-end-of-subtree t t))
((member state '("all" "showall"))
(outline-show-subtree))))))
(unless no-cleanup (unless no-cleanup
(org-cycle-hide-archived-subtrees 'all) (org-cycle-hide-archived-subtrees 'all)
(org-cycle-hide-drawers 'all) (org-cycle-hide-drawers 'all)
@ -7181,11 +7187,12 @@ are at least `org-cycle-separator-lines' empty lines before the headline."
"Return `org-agenda-files' list, plus all open Org files. "Return `org-agenda-files' list, plus all open Org files.
This is useful for operations that need to scan all of a user's This is useful for operations that need to scan all of a user's
open and agenda-wise Org files." open and agenda-wise Org files."
(let ((files (mapcar 'expand-file-name (org-agenda-files)))) (let ((files (mapcar #'expand-file-name (org-agenda-files))))
(dolist (buf (buffer-list)) (dolist (buf (buffer-list))
(with-current-buffer buf (with-current-buffer buf
(when (and (derived-mode-p 'org-mode) (buffer-file-name)) (when (and (derived-mode-p 'org-mode) (buffer-file-name))
(cl-pushnew (expand-file-name (buffer-file-name)) files)))) (cl-pushnew (expand-file-name (buffer-file-name)) files
:test #'equal))))
files)) files))
(defsubst org-entry-beginning-position () (defsubst org-entry-beginning-position ()
@ -9949,20 +9956,24 @@ according to FMT (default from `org-email-link-description-format')."
(reverse slines))) "\n"))))) (reverse slines))) "\n")))))
(mapconcat #'identity (split-string s) " "))) (mapconcat #'identity (split-string s) " ")))
(defconst org-link-escape-chars
;;%20 %5B %5D %25
'(?\s ?\[ ?\] ?%)
"List of characters that should be escaped in a link when stored to Org.
This is the list that is used for internal purposes.")
(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."
(unless (org-string-nw-p link) (error "Empty link")) (unless (org-string-nw-p link) (error "Empty link"))
(let ((uri (cond ((string-match org-link-types-re link) (let ((uri (cond ((string-match org-link-types-re link)
(concat (match-string 1 link) (concat (match-string 1 link)
(org-link-escape (substring link (match-end 1))))) (org-link-escape (substring link (match-end 1)))))
;; For readability, url-encode internal links only
;; when absolutely needed (i.e, when they contain
;; square brackets). File links however, are
;; encoded since, e.g., spaces are significant.
((or (file-name-absolute-p link) ((or (file-name-absolute-p link)
(string-match-p "\\`\\.\\.?/\\|[][]" link)) (string-match-p "\\`\\.\\.?/" link))
(org-link-escape link)) (org-link-escape link))
(t link))) ;; For readability, do not encode space characters
;; in fuzzy links.
(t (org-link-escape link (remq ?\s org-link-escape-chars)))))
(description (description
(and (org-string-nw-p description) (and (org-string-nw-p description)
;; Remove brackets from description, as they are fatal. ;; Remove brackets from description, as they are fatal.
@ -9973,12 +9984,6 @@ according to FMT (default from `org-email-link-description-format')."
uri uri
(if description (format "[%s]" description) "")))) (if description (format "[%s]" description) ""))))
(defconst org-link-escape-chars
;;%20 %5B %5D %25
'(?\s ?\[ ?\] ?%)
"List of characters that should be escaped in a link when stored to Org.
This is the list that is used for internal purposes.")
(defun org-link-escape (text &optional table merge) (defun org-link-escape (text &optional table merge)
"Return percent escaped representation of TEXT. "Return percent escaped representation of TEXT.
TEXT is a string with the text to escape. TEXT is a string with the text to escape.
@ -10280,11 +10285,19 @@ Use TAB to complete link prefixes, then RET for type-specific completion support
;; We are linking to this same file, with a search option ;; We are linking to this same file, with a search option
(setq link search))))) (setq link search)))))
;; Check if we can/should use a relative path. If yes, simplify the link ;; Check if we can/should use a relative path. If yes, simplify
;; the link.
(let ((case-fold-search nil)) (let ((case-fold-search nil))
(when (string-match "\\`\\(file\\|docview\\):" link) (when (string-match "\\`\\(file\\|docview\\):" link)
(let* ((type (match-string-no-properties 0 link)) (let* ((type (match-string-no-properties 0 link))
(path (substring-no-properties link (match-end 0))) (path-start (match-end 0))
(search (and (string-match "::\\(.*\\)\\'" link)
(match-string 1 link)))
(path
(if search
(substring-no-properties
link path-start (match-beginning 0))
(substring-no-properties link (match-end 0))))
(origpath path)) (origpath path))
(cond (cond
((or (eq org-link-file-path-type 'absolute) ((or (eq org-link-file-path-type 'absolute)
@ -10305,7 +10318,7 @@ Use TAB to complete link prefixes, then RET for type-specific completion support
(setq path (substring (expand-file-name path) (setq path (substring (expand-file-name path)
(match-end 0))) (match-end 0)))
(setq path (abbreviate-file-name (expand-file-name path))))))) (setq path (abbreviate-file-name (expand-file-name path)))))))
(setq link (concat type path)) (setq link (concat type path (and search (concat "::" search))))
(when (equal desc origpath) (when (equal desc origpath)
(setq desc path))))) (setq desc path)))))
@ -12185,7 +12198,7 @@ There are two templates for each key, the first uses the original Org syntax,
the second uses Emacs Muse-like syntax tags. These Muse-like tags become the second uses Emacs Muse-like syntax tags. These Muse-like tags become
the default when the /org-mtags.el/ module has been loaded. See also the the default when the /org-mtags.el/ module has been loaded. See also the
variable `org-mtags-prefer-muse-templates'." variable `org-mtags-prefer-muse-templates'."
:group 'org-completion :group 'org-edit-structure
:type '(repeat :type '(repeat
(list (list
(string :tag "Key") (string :tag "Key")
@ -12377,7 +12390,7 @@ When called through ELisp, arg is also interpreted in the following way:
(or (looking-at (concat " +" org-todo-regexp "\\( +\\|[ \t]*$\\)")) (or (looking-at (concat " +" org-todo-regexp "\\( +\\|[ \t]*$\\)"))
(looking-at "\\(?: *\\|[ \t]*$\\)")) (looking-at "\\(?: *\\|[ \t]*$\\)"))
(let* ((match-data (match-data)) (let* ((match-data (match-data))
(startpos (point-at-bol)) (startpos (copy-marker (line-beginning-position)))
(logging (save-match-data (org-entry-get nil "LOGGING" t t))) (logging (save-match-data (org-entry-get nil "LOGGING" t t)))
(org-log-done org-log-done) (org-log-done org-log-done)
(org-log-repeat org-log-repeat) (org-log-repeat org-log-repeat)

View file

@ -174,11 +174,11 @@ through `org-beamer-environments-extra' variable.")
("quotation" "q" "\\begin{quotation}%a %% %h" "\\end{quotation}") ("quotation" "q" "\\begin{quotation}%a %% %h" "\\end{quotation}")
("quote" "Q" "\\begin{quote}%a %% %h" "\\end{quote}") ("quote" "Q" "\\begin{quote}%a %% %h" "\\end{quote}")
("structureenv" "s" "\\begin{structureenv}%a %% %h" "\\end{structureenv}") ("structureenv" "s" "\\begin{structureenv}%a %% %h" "\\end{structureenv}")
("theorem" "t" "\\begin{theorem}%a%U" "\\end{theorem}") ("theorem" "t" "\\begin{theorem}%a[%h]" "\\end{theorem}")
("definition" "d" "\\begin{definition}%a%U" "\\end{definition}") ("definition" "d" "\\begin{definition}%a[%h]" "\\end{definition}")
("example" "e" "\\begin{example}%a%U" "\\end{example}") ("example" "e" "\\begin{example}%a[%h]" "\\end{example}")
("exampleblock" "E" "\\begin{exampleblock}%a{%h}" "\\end{exampleblock}") ("exampleblock" "E" "\\begin{exampleblock}%a{%h}" "\\end{exampleblock}")
("proof" "p" "\\begin{proof}%a%U" "\\end{proof}") ("proof" "p" "\\begin{proof}%a[%h]" "\\end{proof}")
("beamercolorbox" "o" "\\begin{beamercolorbox}%o{%h}" "\\end{beamercolorbox}")) ("beamercolorbox" "o" "\\begin{beamercolorbox}%o{%h}" "\\end{beamercolorbox}"))
"Environments triggered by properties in Beamer export. "Environments triggered by properties in Beamer export.
These are the defaults - for user definitions, see These are the defaults - for user definitions, see

View file

@ -2180,19 +2180,16 @@ contextual information."
(nth (1- level) '("i" "ii" "iii" "iv")) (nth (1- level) '("i" "ii" "iii" "iv"))
(1- count))))) (1- count)))))
(checkbox (cl-case (org-element-property :checkbox item) (checkbox (cl-case (org-element-property :checkbox item)
(on "$\\boxtimes$ ") (on "$\\boxtimes$")
(off "$\\square$ ") (off "$\\square$")
(trans "$\\boxminus$ "))) (trans "$\\boxminus$")))
(tag (let ((tag (org-element-property :tag item))) (tag (let ((tag (org-element-property :tag item)))
;; Check-boxes must belong to the tag. (and tag (org-export-data tag info)))))
(and tag (format "[{%s}] "
(concat checkbox
(org-export-data tag info)))))))
(concat counter (concat counter
"\\item" "\\item"
(cond (cond
(tag) ((and checkbox tag) (format "[{%s %s}] " checkbox tag))
(checkbox (concat " " checkbox)) ((or checkbox tag) (format "[{%s}] " (or checkbox tag)))
;; Without a tag or a check-box, if CONTENTS starts with ;; Without a tag or a check-box, if CONTENTS starts with
;; an opening square bracket, add "\relax" to "\item", ;; an opening square bracket, add "\relax" to "\item",
;; unless the brackets comes from an initial export ;; unless the brackets comes from an initial export

View file

@ -500,14 +500,15 @@ TEXT is the string to transcode. INFO is a plist holding
contextual information." contextual information."
(when (plist-get info :with-smart-quotes) (when (plist-get info :with-smart-quotes)
(setq text (org-export-activate-smart-quotes text :html info))) (setq text (org-export-activate-smart-quotes text :html info)))
;; The below series of replacements in `text' is order sensitive.
;; Protect `, *, _, and \
(setq text (replace-regexp-in-string "[`*_\\]" "\\\\\\&" text))
;; Protect ambiguous #. This will protect # at the beginning of ;; Protect ambiguous #. This will protect # at the beginning of
;; a line, but not at the beginning of a paragraph. See ;; a line, but not at the beginning of a paragraph. See
;; `org-md-paragraph'. ;; `org-md-paragraph'.
(setq text (replace-regexp-in-string "\n#" "\n\\\\#" text)) (setq text (replace-regexp-in-string "\n#" "\n\\\\#" text))
;; Protect ambiguous ! ;; Protect ambiguous !
(setq text (replace-regexp-in-string "\\(!\\)\\[" "\\\\!" text nil nil 1)) (setq text (replace-regexp-in-string "\\(!\\)\\[" "\\\\!" text nil nil 1))
;; Protect `, *, _ and \
(setq text (replace-regexp-in-string "[`*_\\]" "\\\\\\&" text))
;; Handle special strings, if required. ;; Handle special strings, if required.
(when (plist-get info :with-special-strings) (when (plist-get info :with-special-strings)
(setq text (org-html-convert-special-strings text))) (setq text (org-html-convert-special-strings text)))

View file

@ -721,16 +721,17 @@ nil Ignore math snippets.
imagemagick to convert pdf files to png files. imagemagick to convert pdf files to png files.
`mathjax' Do MathJax preprocessing and arrange for MathJax.js to `mathjax' Do MathJax preprocessing and arrange for MathJax.js to
be loaded. be loaded.
t Synonym for `mathjax'."
Any other symbol is a synonym for `mathjax'."
:group 'org-export-odt :group 'org-export-odt
:version "24.4" :version "24.4"
:package-version '(Org . "8.0") :package-version '(Org . "8.0")
:type '(choice :type '(choice
(const :tag "Do not process math in any way" nil) (const :tag "Do not process math in any way" nil)
(const :tag "Leave math verbatim" verbatim)
(const :tag "Use dvipng to make images" dvipng) (const :tag "Use dvipng to make images" dvipng)
(const :tag "Use imagemagick to make images" imagemagick) (const :tag "Use imagemagick to make images" imagemagick)
(const :tag "Use MathJax to display math" mathjax) (other :tag "Use MathJax to display math" mathjax)))
(const :tag "Leave math verbatim" verbatim)))
;;;; Links ;;;; Links

View file

@ -57,10 +57,10 @@ Every function in this hook will be called with two arguments:
the name of the original file and the name of the file the name of the original file and the name of the file
produced.") produced.")
(defgroup org-publish nil (defgroup org-export-publish nil
"Options for publishing a set of files." "Options for publishing a set of files."
:tag "Org Publishing" :tag "Org Publishing"
:group 'org) :group 'org-export)
(defcustom org-publish-project-alist nil (defcustom org-publish-project-alist nil
"Association list to control publishing behavior. "Association list to control publishing behavior.

View file

@ -3699,7 +3699,9 @@ the communication channel used for export, as a plist."
:translate-alist all-transcoders :translate-alist all-transcoders
:exported-data (make-hash-table :test #'eq :size 401))))) :exported-data (make-hash-table :test #'eq :size 401)))))
;; `:internal-references' are shared across back-ends. ;; `:internal-references' are shared across back-ends.
(prog1 (funcall transcoder data contents new-info) (prog1 (if (eq type 'plain-text)
(funcall transcoder data new-info)
(funcall transcoder data contents new-info))
(plist-put info :internal-references (plist-put info :internal-references
(plist-get new-info :internal-references))))))) (plist-get new-info :internal-references)))))))