summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--contrib/lisp/org-index.el2
-rw-r--r--contrib/lisp/org-mime.el2
-rw-r--r--contrib/lisp/org-notify.el4
-rw-r--r--contrib/lisp/ox-koma-letter.el13
-rw-r--r--contrib/scripts/org-docco.org2
-rw-r--r--etc/ORG-NEWS93
-rw-r--r--lisp/ob-C.el8
-rw-r--r--lisp/ob-R.el8
-rw-r--r--lisp/ob-awk.el2
-rw-r--r--lisp/ob-calc.el2
-rw-r--r--lisp/ob-clojure.el2
-rw-r--r--lisp/ob-comint.el2
-rw-r--r--lisp/ob-coq.el2
-rw-r--r--lisp/ob-core.el61
-rw-r--r--lisp/ob-css.el2
-rw-r--r--lisp/ob-ditaa.el2
-rw-r--r--lisp/ob-dot.el4
-rw-r--r--lisp/ob-emacs-lisp.el2
-rw-r--r--lisp/ob-eval.el2
-rw-r--r--lisp/ob-exp.el6
-rw-r--r--lisp/ob-fortran.el9
-rw-r--r--lisp/ob-gnuplot.el2
-rw-r--r--lisp/ob-groovy.el6
-rw-r--r--lisp/ob-haskell.el2
-rw-r--r--lisp/ob-io.el6
-rw-r--r--lisp/ob-java.el2
-rw-r--r--lisp/ob-js.el2
-rw-r--r--lisp/ob-keys.el2
-rw-r--r--lisp/ob-latex.el4
-rw-r--r--lisp/ob-ledger.el2
-rw-r--r--lisp/ob-lilypond.el4
-rw-r--r--lisp/ob-lisp.el2
-rw-r--r--lisp/ob-lob.el8
-rw-r--r--lisp/ob-makefile.el2
-rw-r--r--lisp/ob-matlab.el2
-rw-r--r--lisp/ob-maxima.el2
-rw-r--r--lisp/ob-mscgen.el2
-rw-r--r--lisp/ob-octave.el10
-rw-r--r--lisp/ob-org.el2
-rw-r--r--lisp/ob-perl.el6
-rw-r--r--lisp/ob-picolisp.el2
-rw-r--r--lisp/ob-plantuml.el2
-rw-r--r--lisp/ob-python.el14
-rw-r--r--lisp/ob-ref.el6
-rw-r--r--lisp/ob-ruby.el12
-rw-r--r--lisp/ob-sass.el2
-rw-r--r--lisp/ob-scala.el6
-rw-r--r--lisp/ob-scheme.el4
-rw-r--r--lisp/ob-screen.el2
-rw-r--r--lisp/ob-shell.el6
-rw-r--r--lisp/ob-shen.el2
-rw-r--r--lisp/ob-sql.el6
-rw-r--r--lisp/ob-sqlite.el4
-rw-r--r--lisp/ob-table.el4
-rw-r--r--lisp/ob-tangle.el22
-rw-r--r--lisp/ob.el2
-rw-r--r--lisp/org-agenda.el165
-rw-r--r--lisp/org-archive.el2
-rw-r--r--lisp/org-attach.el2
-rw-r--r--lisp/org-bbdb.el2
-rw-r--r--lisp/org-bibtex.el6
-rw-r--r--lisp/org-capture.el10
-rw-r--r--lisp/org-clock.el69
-rw-r--r--lisp/org-colview.el57
-rw-r--r--lisp/org-compat.el4
-rw-r--r--lisp/org-crypt.el13
-rw-r--r--lisp/org-ctags.el11
-rw-r--r--lisp/org-datetree.el74
-rw-r--r--lisp/org-docview.el2
-rw-r--r--lisp/org-element.el102
-rw-r--r--lisp/org-entities.el6
-rw-r--r--lisp/org-eshell.el2
-rw-r--r--lisp/org-faces.el4
-rw-r--r--lisp/org-feed.el5
-rw-r--r--lisp/org-footnote.el30
-rw-r--r--lisp/org-gnus.el4
-rw-r--r--lisp/org-habit.el2
-rw-r--r--lisp/org-id.el5
-rw-r--r--lisp/org-indent.el156
-rw-r--r--lisp/org-info.el2
-rw-r--r--lisp/org-inlinetask.el2
-rw-r--r--lisp/org-irc.el6
-rw-r--r--lisp/org-list.el54
-rw-r--r--lisp/org-loaddefs.el95
-rw-r--r--lisp/org-macro.el2
-rw-r--r--lisp/org-macs.el4
-rw-r--r--lisp/org-mhe.el2
-rw-r--r--lisp/org-mobile.el2
-rw-r--r--lisp/org-mouse.el12
-rw-r--r--lisp/org-plot.el2
-rw-r--r--lisp/org-protocol.el26
-rw-r--r--lisp/org-rmail.el2
-rw-r--r--lisp/org-src.el69
-rw-r--r--lisp/org-table.el181
-rw-r--r--lisp/org-timer.el58
-rw-r--r--lisp/org-version.el4
-rw-r--r--lisp/org-w3m.el2
-rwxr-xr-xlisp/org.el745
-rw-r--r--lisp/ox-html.el91
-rw-r--r--lisp/ox-icalendar.el4
-rw-r--r--lisp/ox-latex.el44
-rw-r--r--lisp/ox-man.el10
-rw-r--r--lisp/ox-md.el96
-rw-r--r--lisp/ox-odt.el93
-rw-r--r--lisp/ox-org.el2
-rw-r--r--lisp/ox-publish.el8
-rw-r--r--lisp/ox-texinfo.el12
-rw-r--r--lisp/ox.el333
-rw-r--r--mk/version.mk4
109 files changed, 1623 insertions, 1471 deletions
diff --git a/contrib/lisp/org-index.el b/contrib/lisp/org-index.el
index 26edc85..52bd2fc 100644
--- a/contrib/lisp/org-index.el
+++ b/contrib/lisp/org-index.el
@@ -69,7 +69,7 @@
;;
;; The latest tested version of this file can always be found at:
;;
-;; http://orgmode.org/w/org-mode.git?p=org-mode.git;a=blob_plain;f=contrib/lisp/org-index.el;hb=HEAD
+;; http://orgmode.org/cgit.cgi/org-mode.git/plain/contrib/lisp/org-index.el
;;; Change Log:
diff --git a/contrib/lisp/org-mime.el b/contrib/lisp/org-mime.el
index 078ebef..682f635 100644
--- a/contrib/lisp/org-mime.el
+++ b/contrib/lisp/org-mime.el
@@ -285,7 +285,7 @@ otherwise export the entire body."
(defun org-mime-compose (body fmt file &optional to subject headers)
(require 'message)
- (message-mail to subject headers nil)
+ (compose-mail to subject headers nil)
(message-goto-body)
(let ((bhook
(lambda (body fmt)
diff --git a/contrib/lisp/org-notify.el b/contrib/lisp/org-notify.el
index da2c96f..8bcca9f 100644
--- a/contrib/lisp/org-notify.el
+++ b/contrib/lisp/org-notify.el
@@ -120,7 +120,7 @@ simple timestamp string."
"Create one todo item."
(macrolet ((get (k) `(plist-get list ,k))
(pr (k v) `(setq result (plist-put result ,k ,v))))
- (let* ((list (nth 1 heading)) (notify (or (get :notify) "default"))
+ (let* ((list (nth 1 heading)) (notify (or (get :NOTIFY) "default"))
(deadline (org-notify-convert-deadline (get :deadline)))
(heading (get :raw-value))
result)
@@ -148,7 +148,7 @@ simple timestamp string."
'headline 'org-notify-make-todo)))))
(defun org-notify-maybe-too-late (diff period heading)
- "Print waring message, when notified significantly later than defined by
+ "Print warning message, when notified significantly later than defined by
PERIOD."
(if (> (/ diff period) 1.5)
(message "Warning: notification for \"%s\" behind schedule!" heading))
diff --git a/contrib/lisp/ox-koma-letter.el b/contrib/lisp/ox-koma-letter.el
index 8ba380c..e6fed3b 100644
--- a/contrib/lisp/ox-koma-letter.el
+++ b/contrib/lisp/ox-koma-letter.el
@@ -435,7 +435,8 @@ e.g. \"title-subject:t\"."
(:inbuffer-with-backaddress nil "backaddress" 'koma-letter:empty)
(:inbuffer-with-email nil "email" 'koma-letter:empty)
(:inbuffer-with-foldmarks nil "foldmarks" 'koma-letter:empty)
- (:inbuffer-with-phone nil "phone" 'koma-letter:empty))
+ (:inbuffer-with-phone nil "phone" 'koma-letter:empty)
+ (:inbuffer-with-place nil "place" 'koma-letter:empty))
:translate-alist '((export-block . org-koma-letter-export-block)
(export-snippet . org-koma-letter-export-snippet)
(headline . org-koma-letter-headline)
@@ -734,9 +735,13 @@ a communication channel."
(format "\\KOMAoption{backaddress}{%s}\n"
(if (plist-get info :with-backaddress) "true" "false")))
;; Place.
- (and (funcall check-scope 'place)
- (format "\\setkomavar{place}{%s}\n"
- (if (plist-get info :with-place) (plist-get info :place) "")))
+ (let ((with-place-set (funcall check-scope 'with-place))
+ (place-set (funcall check-scope 'place)))
+ (and (or (and with-place-set place-set)
+ (and (eq scope 'buffer) (or with-place-set place-set)))
+ (format "\\setkomavar{place}{%s}\n"
+ (if (plist-get info :with-place) (plist-get info :place)
+ ""))))
;; Folding marks.
(and (funcall check-scope 'with-foldmarks)
(let ((foldmarks (plist-get info :with-foldmarks)))
diff --git a/contrib/scripts/org-docco.org b/contrib/scripts/org-docco.org
index d846aa3..cb75359 100644
--- a/contrib/scripts/org-docco.org
+++ b/contrib/scripts/org-docco.org
@@ -5,7 +5,7 @@
The =docco= tool (see http://jashkenas.github.com/docco/) generates
HTML from JavaScript source code providing an attractive side-by-side
-display of source code and comments. This file (see [[http://orgmode.org/w/?p=org-mode.git;a=blob_plain;f=contrib/scripts/org-docco.org;hb=HEAD][org-docco.org]])
+display of source code and comments. This file (see [[http://orgmode.org/cgit.cgi/org-mode.git/plain/contrib/scripts/org-docco.org][org-docco.org]])
generates the same type of output from Org-mode documents with code
embedded in code blocks.
diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index a14f3a3..779ed76 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -1,7 +1,7 @@
ORG NEWS -- history of user-visible changes. -*- org -*-
#+LINK: doc http://orgmode.org/worg/doc.html#%s
-#+LINK: git http://orgmode.org/w/?p=org-mode.git;a=commit;h=%s
+#+LINK: git http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=%s
Copyright (C) 2012-2015 Free Software Foundation, Inc.
See the end of the file for license conditions.
@@ -25,7 +25,7 @@ The following function will repair them:
#+BEGIN_SRC emacs-lisp
(defun org-repair-property-drawers ()
"Fix properties drawers in current buffer.
- Ignore non Org buffers."
+Ignore non Org buffers."
(when (eq major-mode 'org-mode)
(org-with-wide-buffer
(goto-char (point-min))
@@ -51,7 +51,18 @@ The following function will repair them:
(match-beginning 0)
(min (1+ (match-end 0)) end)))
(unless (bolp) (insert "\n"))))))))))))
-#+END_SRC
+#+END_SRC
+
+*** Using "COMMENT" is now equivalent to commenting with "#"
+
+If you used "COMMENT" in headlines to prevent a subtree from being
+exported, you can still do it but all information within the subtree
+is now commented out, i.e. no #+OPTIONS line will be parsed or taken
+into account when exporting.
+
+If you want to exclude a headline from export while using its contents
+for setting options, use =:noexport:= (see =org-export-exclude-tags=.)
+
*** =#+CATEGORY= keywords no longer apply partially to document
It was possible to use several such keywords and have them apply to
@@ -67,12 +78,13 @@ properties to set category for a subtree, e.g.,
:CATEGORY: some category
:END:
#+END_SRC
+
*** New variable to control visibility when revealing a location
-~org-show-following-heading~, ~org-show-siblings~,
-~org-show-entry-below~ and ~org-show-hierarchy-above~ no longer exist.
-Instead, visibility is controlled through a single variable:
-~org-show-context-detail~, which see.
+~org-show-following-heading~, ~org-show-siblings~, ~org-show-entry-below~
+and ~org-show-hierarchy-above~ no longer exist. Instead, visibility is
+controlled through a single variable: ~org-show-context-detail~, which
+see.
*** Replace disputed keys again when reading a date
@@ -85,7 +97,26 @@ Keybinding for reading date can be customized with a new variable
*** No default title is provided when =TITLE= keyword is missing
Skipping =TITLE= keyword no longer provides the current file name, or
-buffer name, as the title. Instead, simply ignore the title.
+buffer name, as the title. Instead, simply ignore the title.
+
+*** Default bindings of =C-c C-n= and =C-c C-p= changed
+
+The key sequences =C-c C-n= and =C-c C-p= are now bound to
+~org-next-visible-heading~ and ~org-next-visible-heading~ respectively,
+rather than the =outline-mode= versions of these functions. The Org
+version of these functions skips over inline tasks (and even-level
+headlines when ~org-odd-levels-only~ is set).
+
+*** ~org-element-context~ no longer return objects in keywords
+
+~org-element-context~ used to return objects on some keywords, i.e.,
+=TITLE=, =DATE= and =AUTHOR=. It now returns only the keyword.
+
+*** ~org-timer-default-timer~ type changed from number to string
+
+If you have, in your configuration, something like =(setq
+org-timer-default-timer 10)= replace it with =(setq
+org-timer-default-timer "10")=.
*** Functions signature changes
@@ -98,32 +129,13 @@ docstring for more information.
- ~org-latex-format-headline-function~
- ~org-latex-format-inlinetask-function~
- ~org-link-search~
-
-*** Default bindings of =C-c C-n= and =C-c C-p= changed
-
-The key sequences =C-c C-n= and =C-c C-p= are now bound to
-~org-next-visible-heading~ and ~org-next-visible-heading~
-respectively, rather than the =outline-mode= versions of these
-functions. The Org version of these functions skips over inline tasks
-(and even-level headlines when ~org-odd-levels-only~ is set).
-
-*** ~org-element-context~ no longer return objects in keywords
-
-~org-element-context~ used to return objects on some keywords, i.e.,
-=TITLE=, =DATE= and =AUTHOR=. It now returns only the keyword.
+** New features
*** Behavior of ~org-return~ changed
If point is before or after the headline title, insert a new line
without changing the headline.
-*** ~org-timer-default-timer~ type changed from number to string
-
-If you have, in your configuration, something like =(setq
-org-timer-default-timer 10)= replace it with =(setq
-org-timer-default-timer "10")=.
-** New features
-
*** Hierarchies of tags
The functionality of nesting tags in hierarchies is added to org-mode.
This is the generalization of what was previously called "Tag groups"
@@ -309,6 +321,15 @@ more features. See docstring for details.
Functions in this filter are applied on the body of the exported
document, befor wrapping it within the template.
+*** New :environment parameter when exporting example blocks to LaTeX
+
+: #+ATTR_LATEX: :environment myverbatim
+: #+BEGIN_EXAMPLE
+: This sentence is false.
+: #+END_EXAMPLE
+
+will be exported using =@samp(myverbatim)= instead of =@samp(verbatim)=.
+
*** Various improvements on radio tables
Radio tables feature now relies on Org's export framework ("ox.el").
@@ -518,10 +539,15 @@ two of them, as if this option was nil (default value).
*** ~org-export-with-creator~ is a boolean
-Special ~comment~ value is no longer allowed. It is possible to use
-a body filter to add comments about the creator at the end of the
+Special ~comment~ value is no longer allowed. It is possible to use a
+body filter to add comments about the creator at the end of the
document instead.
+*** Removed option =org-html-use-unicode-chars=
+
+Setting this to non-nil was problematic as it converted characters
+everywhere in the buffer, possibly corrupting URLs.
+
*** Removed option =org-babel-sh-command=
This undocumented option defaulted to the value of =shell-file-name=
@@ -621,8 +647,7 @@ now.
*** When exporting, throw an error on unresolved id/fuzzy links and code refs
-This helps spotting wrong links.
-
+This helps spotting wrong links.
* Version 8.2
** Incompatible changes
@@ -1865,7 +1890,7 @@ See http://orgmode.org/elpa/
**** New =todo-unblocked= and =nottodo-unblocked= skip conditions
- See the [[http://orgmode.org/w/?p%3Dorg-mode.git%3Ba%3Dcommit%3Bh%3Df426da][git commit]] for more explanations.
+ See the [[http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=f426da][git commit]] for more explanations.
**** Allow category filtering in the agenda
@@ -2182,7 +2207,7 @@ See http://orgmode.org/elpa/
Thanks to Carsten for implementing this.
**** ODT: Add support for ODT export in org-bbdb.el
-**** ODT: Add support for indented tables (see [[http://orgmode.org/w/?p%3Dorg-mode.git%3Ba%3Dcommit%3Bh%3De9fd33][this commit]] for details)
+**** ODT: Add support for indented tables (see [[http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=e9fd33][this commit]] for details)
**** ODT: Improve the conversion from ODT to other formats
**** ASCII: Swap the level-1/level-2 characters to underline the headlines
**** Support for Chinese, simplified Chinese, Russian, Ukrainian and Japanese
diff --git a/lisp/ob-C.el b/lisp/ob-C.el
index 8d5ff2f..64e9d20 100644
--- a/lisp/ob-C.el
+++ b/lisp/ob-C.el
@@ -1,6 +1,6 @@
;;; ob-C.el --- org-babel functions for C and similar languages
-;; Copyright (C) 2010-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2015 Free Software Foundation, Inc.
;; Author: Eric Schulte
;; Thierry Banel
@@ -331,9 +331,9 @@ FORMAT can be either a format string or a function which is called with VAL."
(defun org-babel-C-val-to-base-type (val)
"Determine the base type of VAL which may be
-'integerp if all base values are integers
-'floatp if all base values are either floating points or integers
-'stringp otherwise."
+`integerp' if all base values are integers
+`floatp' if all base values are either floating points or integers
+`stringp' otherwise."
(cond
((integerp val) 'integerp)
((floatp val) 'floatp)
diff --git a/lisp/ob-R.el b/lisp/ob-R.el
index ac84d7d..4bd6eea 100644
--- a/lisp/ob-R.el
+++ b/lisp/ob-R.el
@@ -381,8 +381,8 @@ Has four %s escapes to be filled in:
(defun org-babel-R-evaluate-external-process
(body result-type result-params column-names-p row-names-p)
"Evaluate BODY in external R process.
-If RESULT-TYPE equals 'output then return standard output as a
-string. If RESULT-TYPE equals 'value then return the value of the
+If RESULT-TYPE equals `output' then return standard output as a
+string. If RESULT-TYPE equals `value' then return the value of the
last statement in BODY, as elisp."
(case result-type
(value
@@ -409,8 +409,8 @@ last statement in BODY, as elisp."
(defun org-babel-R-evaluate-session
(session body result-type result-params column-names-p row-names-p)
"Evaluate BODY in SESSION.
-If RESULT-TYPE equals 'output then return standard output as a
-string. If RESULT-TYPE equals 'value then return the value of the
+If RESULT-TYPE equals `output' then return standard output as a
+string. If RESULT-TYPE equals `value' then return the value of the
last statement in BODY, as elisp."
(case result-type
(value
diff --git a/lisp/ob-awk.el b/lisp/ob-awk.el
index a96ba1a..eb03b46 100644
--- a/lisp/ob-awk.el
+++ b/lisp/ob-awk.el
@@ -1,6 +1,6 @@
;;; ob-awk.el --- org-babel functions for awk evaluation
-;; Copyright (C) 2011-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2011-2015 Free Software Foundation, Inc.
;; Author: Eric Schulte
;; Keywords: literate programming, reproducible research
diff --git a/lisp/ob-calc.el b/lisp/ob-calc.el
index cdb528a..5dec244 100644
--- a/lisp/ob-calc.el
+++ b/lisp/ob-calc.el
@@ -1,6 +1,6 @@
;;; ob-calc.el --- org-babel functions for calc code evaluation
-;; Copyright (C) 2010-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2015 Free Software Foundation, Inc.
;; Author: Eric Schulte
;; Keywords: literate programming, reproducible research
diff --git a/lisp/ob-clojure.el b/lisp/ob-clojure.el
index 21a3ef8..68f748c 100644
--- a/lisp/ob-clojure.el
+++ b/lisp/ob-clojure.el
@@ -1,6 +1,6 @@
;;; ob-clojure.el --- org-babel functions for clojure evaluation
-;; Copyright (C) 2009-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2015 Free Software Foundation, Inc.
;; Author: Joel Boehland, Eric Schulte, Oleh Krehel
;;
diff --git a/lisp/ob-comint.el b/lisp/ob-comint.el
index 7c768d3..afbbf84 100644
--- a/lisp/ob-comint.el
+++ b/lisp/ob-comint.el
@@ -1,6 +1,6 @@
;;; ob-comint.el --- org-babel functions for interaction with comint buffers
-;; Copyright (C) 2009-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2015 Free Software Foundation, Inc.
;; Author: Eric Schulte
;; Keywords: literate programming, reproducible research, comint
diff --git a/lisp/ob-coq.el b/lisp/ob-coq.el
index b6ebcff..0147786 100644
--- a/lisp/ob-coq.el
+++ b/lisp/ob-coq.el
@@ -1,6 +1,6 @@
;;; ob-coq.el --- org-babel functions for Coq
-;; Copyright (C) 2010-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2015 Free Software Foundation, Inc.
;; Author: Eric Schulte
;; Keywords: literate programming, reproducible research
diff --git a/lisp/ob-core.el b/lisp/ob-core.el
index 30020f7..9545871 100644
--- a/lisp/ob-core.el
+++ b/lisp/ob-core.el
@@ -110,6 +110,7 @@
(defcustom org-confirm-babel-evaluate t
"Confirm before evaluation.
+\\<org-mode-map>\
Require confirmation before interactively evaluating code
blocks in Org-mode buffers. The default value of this variable
is t, meaning confirmation is required for any code block
@@ -122,10 +123,11 @@ execution or nil if no prompt is required.
Warning: Disabling confirmation may result in accidental
evaluation of potentially harmful code. It may be advisable
-remove code block execution from C-c C-c as further protection
+remove code block execution from \\[org-ctrl-c-ctrl-c] \
+as further protection
against accidental code block evaluation. The
`org-babel-no-eval-on-ctrl-c-ctrl-c' variable can be used to
-remove code block execution from the C-c C-c keybinding."
+remove code block execution from the \\[org-ctrl-c-ctrl-c] keybinding."
:group 'org-babel
:version "24.1"
:type '(choice boolean function))
@@ -133,7 +135,8 @@ remove code block execution from the C-c C-c keybinding."
(put 'org-confirm-babel-evaluate 'safe-local-variable (lambda (x) (eq x t)))
(defcustom org-babel-no-eval-on-ctrl-c-ctrl-c nil
- "Remove code block evaluation from the C-c C-c key binding."
+ "\\<org-mode-map>\
+Remove code block evaluation from the \\[org-ctrl-c-ctrl-c] key binding."
:group 'org-babel
:version "24.1"
:type 'boolean)
@@ -321,8 +324,8 @@ name of the code block."
Do not query the user."
(org-babel-check-confirm-evaluate info
(not (when noeval
- (message (format "Evaluation of this%scode-block%sis disabled."
- code-block block-name))))))
+ (message "Evaluation of this%scode-block%sis disabled."
+ code-block block-name)))))
;; dynamically scoped for asynchronous export
(defvar org-babel-confirm-evaluate-answer-no)
@@ -348,8 +351,8 @@ of potentially harmful code."
(yes-or-no-p
(format "Evaluate this%scode block%son your system? "
code-block block-name)))
- (message (format "Evaluation of this%scode-block%sis aborted."
- code-block block-name)))))))
+ (message "Evaluation of this%scode-block%sis aborted."
+ code-block block-name))))))
;;;###autoload
(defun org-babel-execute-safely-maybe ()
@@ -511,7 +514,7 @@ The list can have entries of the following forms:
"Return a function that determines whether a list of header args are safe.
Intended usage is:
-\(put 'org-babel-default-header-args 'safe-local-variable
+\(put \\='org-babel-default-header-args \\='safe-local-variable
(org-babel-header-args-safe-p org-babel-safe-header-args)
This allows org-babel languages to extend the list of safe values for
@@ -555,7 +558,7 @@ be saved in the second match data.")
(defvar org-babel-result-w-name-regexp
(concat org-babel-result-regexp
- "\\([^ ()\f\t\n\r\v]+\\)\\(\(\\(.*\\)\)\\|\\)"))
+ "\\([^ ()\f\t\n\r\v]+\\)\\((\\(.*\\))\\|\\)"))
(defvar org-babel-min-lines-for-block-output 10
"The minimum number of lines for block output.
@@ -1309,8 +1312,9 @@ the `org-mode-hook'."
(defun org-babel-hash-at-point (&optional point)
"Return the value of the hash at POINT.
+\\<org-mode-map>\
The hash is also added as the last element of the kill ring.
-This can be called with C-c C-c."
+This can be called with \\[org-ctrl-c-ctrl-c]."
(interactive)
(let ((hash (car (delq nil (mapcar
(lambda (ol) (overlay-get ol 'babel-hash))
@@ -1438,17 +1442,16 @@ specified in the properties of the current outline entry."
(defvar org-src-preserve-indentation) ;; declare defcustom from org-src
(defun org-babel-parse-src-block-match ()
"Parse the results from a match of the `org-babel-src-block-regexp'."
- (let* ((block-indentation (length (match-string 1)))
- (lang (org-no-properties (match-string 2)))
+ (let* ((block-indentation (string-width (match-string 1)))
+ (lang (org-match-string-no-properties 2))
(lang-headers (intern (concat "org-babel-default-header-args:" lang)))
(switches (match-string 3))
- (body (org-no-properties
- (let* ((body (match-string 5))
- (sub-length (- (length body) 1)))
- (if (and (> sub-length 0)
- (string= "\n" (substring body sub-length)))
- (substring body 0 sub-length)
- (or body "")))))
+ (body (let* ((body (org-match-string-no-properties 5))
+ (sub-length (- (length body) 1)))
+ (if (and (> sub-length 0)
+ (string= "\n" (substring body sub-length)))
+ (substring body 0 sub-length)
+ (or body ""))))
(preserve-indentation (or org-src-preserve-indentation
(save-match-data
(string-match "-i\\>" switches)))))
@@ -1598,7 +1601,7 @@ shown below.
;; row and column names
(defun org-babel-del-hlines (table)
- "Remove all 'hlines from TABLE."
+ "Remove all `hlines' from TABLE."
(remq 'hline table))
(defun org-babel-get-colnames (table)
@@ -1751,7 +1754,7 @@ If the point is not on a source block then return nil."
(if point
;; taken from `org-open-at-point'
(progn (org-mark-ring-push) (goto-char point) (org-show-context))
- (message "source-code block '%s' not found in this buffer" name))))
+ (message "source-code block `%s' not found in this buffer" name))))
(defun org-babel-find-named-block (name)
"Find a named source-code block.
@@ -1785,7 +1788,7 @@ to `org-babel-named-src-block-regexp'."
(if point
;; taken from `org-open-at-point'
(progn (goto-char point) (org-show-context))
- (message "result '%s' not found in this buffer" name))))
+ (message "result `%s' not found in this buffer" name))))
(defun org-babel-find-named-result (name &optional point)
"Find a named result.
@@ -1972,8 +1975,8 @@ following the source block."
(goto-char end)
(unless beg
(if (looking-at "[\n\r]") (forward-char 1) (insert "\n")))
+ (when (wholenump indent) (indent-to indent))
(insert (concat
- (when (wholenump indent) (make-string indent ? ))
"#+" org-babel-results-keyword
(when hash
(if org-babel-hash-show-time
@@ -1984,7 +1987,7 @@ following the source block."
(when name (concat " " name)) "\n"))
(unless beg (insert "\n") (backward-char))
(beginning-of-line 0)
- (if hash (org-babel-hide-hash))
+ (when hash (org-babel-hide-hash))
(point)))))
(defvar org-block-regexp)
@@ -2406,7 +2409,7 @@ file's directory then expand relative links."
'org-babel-examplify-region "25.1")
(defun org-babel-examplify-region (beg end &optional results-switches)
- "Comment out region using the inline '==' or ': ' org example quote."
+ "Comment out region using the inline `==' or `: ' org example quote."
(interactive "*r")
(let ((chars-between (lambda (b e)
(not (string-match "^[\\s]*$"
@@ -2621,7 +2624,7 @@ CONTEXT may be one of :tangle, :export or :eval."
"Expand Noweb references in the body of the current source code block.
For example the following reference would be replaced with the
-body of the source-code block named 'example-block'.
+body of the source-code block named `example-block'.
<<example-block>>
@@ -2634,7 +2637,7 @@ This function must be called from inside of the buffer containing
the source-code block which holds BODY.
In addition the following syntax can be used to insert the
-results of evaluating the source-code block named 'example-block'.
+results of evaluating the source-code block named `example-block'.
<<example-block()>>
@@ -2671,7 +2674,7 @@ block but are passed literally to the \"example-block\"."
(setq index (point))
(while (and (re-search-forward (org-babel-noweb-wrap) nil t))
(save-match-data (setf source-name (match-string 1)))
- (save-match-data (setq evaluate (string-match "\(.*\)" source-name)))
+ (save-match-data (setq evaluate (string-match "(.*)" source-name)))
(save-match-data
(setq prefix
(buffer-substring (match-beginning 0)
@@ -2845,7 +2848,7 @@ block but are passed literally to the \"example-block\"."
(defun org-babel-read (cell &optional inhibit-lisp-eval)
"Convert the string value of CELL to a number if appropriate.
Otherwise if CELL looks like lisp (meaning it starts with a
-\"(\", \"'\", \"\\=`\" or a \"[\") then read and evaluate it as
+\"(\", \"\\='\", \"\\=`\" or a \"[\") then read and evaluate it as
lisp, otherwise return it unmodified as a string. Optional
argument INHIBIT-LISP-EVAL inhibits lisp evaluation for
situations in which is it not appropriate."
diff --git a/lisp/ob-css.el b/lisp/ob-css.el
index 2fedb35..a0f0ad1 100644
--- a/lisp/ob-css.el
+++ b/lisp/ob-css.el
@@ -1,6 +1,6 @@
;;; ob-css.el --- org-babel functions for css evaluation
-;; Copyright (C) 2009-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2015 Free Software Foundation, Inc.
;; Author: Eric Schulte
;; Keywords: literate programming, reproducible research
diff --git a/lisp/ob-ditaa.el b/lisp/ob-ditaa.el
index 888cafc..081cddf 100644
--- a/lisp/ob-ditaa.el
+++ b/lisp/ob-ditaa.el
@@ -1,6 +1,6 @@
;;; ob-ditaa.el --- org-babel functions for ditaa evaluation
-;; Copyright (C) 2009-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2015 Free Software Foundation, Inc.
;; Author: Eric Schulte
;; Keywords: literate programming, reproducible research
diff --git a/lisp/ob-dot.el b/lisp/ob-dot.el
index 1e399e7..7488980 100644
--- a/lisp/ob-dot.el
+++ b/lisp/ob-dot.el
@@ -1,6 +1,6 @@
;;; ob-dot.el --- org-babel functions for dot evaluation
-;; Copyright (C) 2009-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2015 Free Software Foundation, Inc.
;; Author: Eric Schulte
;; Keywords: literate programming, reproducible research
@@ -53,7 +53,7 @@
(value (cdr pair)))
(setq body
(replace-regexp-in-string
- (concat "\$" (regexp-quote name))
+ (concat "$" (regexp-quote name))
(if (stringp value) value (format "%S" value))
body
t
diff --git a/lisp/ob-emacs-lisp.el b/lisp/ob-emacs-lisp.el
index f9f3671..5eb7003 100644
--- a/lisp/ob-emacs-lisp.el
+++ b/lisp/ob-emacs-lisp.el
@@ -1,6 +1,6 @@
;;; ob-emacs-lisp.el --- org-babel functions for emacs-lisp code evaluation
-;; Copyright (C) 2009-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2015 Free Software Foundation, Inc.
;; Author: Eric Schulte
;; Keywords: literate programming, reproducible research
diff --git a/lisp/ob-eval.el b/lisp/ob-eval.el
index b3ce2af..d94b695 100644
--- a/lisp/ob-eval.el
+++ b/lisp/ob-eval.el
@@ -1,6 +1,6 @@
;;; ob-eval.el --- org-babel functions for external code evaluation
-;; Copyright (C) 2009-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2015 Free Software Foundation, Inc.
;; Author: Eric Schulte
;; Keywords: literate programming, reproducible research, comint
diff --git a/lisp/ob-exp.el b/lisp/ob-exp.el
index 9707141..38086df 100644
--- a/lisp/ob-exp.el
+++ b/lisp/ob-exp.el
@@ -1,6 +1,6 @@
;;; ob-exp.el --- Exportation of org-babel source blocks
-;; Copyright (C) 2009-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2015 Free Software Foundation, Inc.
;; Authors: Eric Schulte
;; Dan Davison
@@ -54,7 +54,7 @@
(defcustom org-export-babel-evaluate t
"Switch controlling code evaluation during export.
When set to nil no code will be evaluated as part of the export
-process. When set to 'inline-only, only inline code blocks will
+process. When set to `inline-only', only inline code blocks will
be executed."
:group 'org-babel
:version "24.1"
@@ -99,7 +99,7 @@ be executed."
(defun org-babel-exp-src-block (&rest headers)
"Process source block for export.
-Depending on the 'export' headers argument, replace the source
+Depending on the `export' headers argument, replace the source
code block like this:
both ---- display the code and the results
diff --git a/lisp/ob-fortran.el b/lisp/ob-fortran.el
index baeb4ba..6390536 100644
--- a/lisp/ob-fortran.el
+++ b/lisp/ob-fortran.el
@@ -1,6 +1,6 @@
;;; ob-fortran.el --- org-babel functions for fortran
-;; Copyright (C) 2011-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2011-2015 Free Software Foundation, Inc.
;; Authors: Sergey Litvinov
;; Eric Schulte
@@ -110,7 +110,7 @@ it's header arguments."
"Wrap body in a \"program ... end program\" block if none exists."
(if (string-match "^[ \t]*program[ \t]*.*" (capitalize body))
(let ((vars (mapcar #'cdr (org-babel-get-header params :var))))
- (if vars (error "Cannot use :vars if 'program' statement is present"))
+ (if vars (error "Cannot use :vars if `program' statement is present"))
body)
(format "program main\n%s\nend program main\n" body)))
@@ -149,15 +149,14 @@ of the same value."
;; val is a matrix
((and (listp val) (org-every #'listp val))
(format "real, parameter :: %S(%d,%d) = transpose( reshape( %s , (/ %d, %d /) ) )\n"
- var (length val) (length (car val))
+ var (length val) (length (car val))
(org-babel-fortran-transform-list val)
(length (car val)) (length val)))
((listp val)
(format "real, parameter :: %S(%d) = %s\n"
var (length val) (org-babel-fortran-transform-list val)))
(t
- (error (format "the type of parameter %s is not supported by ob-fortran"
- var))))))
+ (error "the type of parameter %s is not supported by ob-fortran" var)))))
(defun org-babel-fortran-transform-list (val)
"Return a fortran representation of enclose syntactic lists."
diff --git a/lisp/ob-gnuplot.el b/lisp/ob-gnuplot.el
index a350186..8490b16 100644
--- a/lisp/ob-gnuplot.el
+++ b/lisp/ob-gnuplot.el
@@ -1,6 +1,6 @@
;;; ob-gnuplot.el --- org-babel functions for gnuplot evaluation
-;; Copyright (C) 2009-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2015 Free Software Foundation, Inc.
;; Author: Eric Schulte
;; Keywords: literate programming, reproducible research
diff --git a/lisp/ob-groovy.el b/lisp/ob-groovy.el
index 8797ec9..8c0498e 100644
--- a/lisp/ob-groovy.el
+++ b/lisp/ob-groovy.el
@@ -1,6 +1,6 @@
;;; ob-groovy.el --- org-babel functions for Groovy evaluation
-;; Copyright (C) 2013-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2013-2015 Free Software Foundation, Inc.
;; Author: Miro Bezjak
;; Keywords: literate programming, reproducible research
@@ -80,8 +80,8 @@ println(new Runner().run())
(defun org-babel-groovy-evaluate
(session body &optional result-type result-params)
"Evaluate BODY in external Groovy process.
-If RESULT-TYPE equals 'output then return standard output as a string.
-If RESULT-TYPE equals 'value then return the value of the last statement
+If RESULT-TYPE equals `output' then return standard output as a string.
+If RESULT-TYPE equals `value' then return the value of the last statement
in BODY as elisp."
(when session (error "Sessions are not (yet) supported for Groovy"))
(case result-type
diff --git a/lisp/ob-haskell.el b/lisp/ob-haskell.el
index 2e1d390..e7e9cb4 100644
--- a/lisp/ob-haskell.el
+++ b/lisp/ob-haskell.el
@@ -1,6 +1,6 @@
;;; ob-haskell.el --- org-babel functions for haskell evaluation
-;; Copyright (C) 2009-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2015 Free Software Foundation, Inc.
;; Author: Eric Schulte
;; Keywords: literate programming, reproducible research
diff --git a/lisp/ob-io.el b/lisp/ob-io.el
index c309b88..4f32383 100644
--- a/lisp/ob-io.el
+++ b/lisp/ob-io.el
@@ -1,6 +1,6 @@
;;; ob-io.el --- org-babel functions for Io evaluation
-;; Copyright (C) 2012-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2012-2015 Free Software Foundation, Inc.
;; Author: Andrzej Lichnerowicz
;; Keywords: literate programming, reproducible research
@@ -71,8 +71,8 @@ called by `org-babel-execute-src-block'"
(defun org-babel-io-evaluate (session body &optional result-type result-params)
"Evaluate BODY in external Io process.
-If RESULT-TYPE equals 'output then return standard output as a string.
-If RESULT-TYPE equals 'value then return the value of the last statement
+If RESULT-TYPE equals `output' then return standard output as a string.
+If RESULT-TYPE equals `value' then return the value of the last statement
in BODY as elisp."
(when session (error "Sessions are not (yet) supported for Io"))
(case result-type
diff --git a/lisp/ob-java.el b/lisp/ob-java.el
index 8c64171..f808911 100644
--- a/lisp/ob-java.el
+++ b/lisp/ob-java.el
@@ -1,6 +1,6 @@
;;; ob-java.el --- org-babel functions for java evaluation
-;; Copyright (C) 2011-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2011-2015 Free Software Foundation, Inc.
;; Author: Eric Schulte
;; Keywords: literate programming, reproducible research
diff --git a/lisp/ob-js.el b/lisp/ob-js.el
index e126787..f8ce300 100644
--- a/lisp/ob-js.el
+++ b/lisp/ob-js.el
@@ -1,6 +1,6 @@
;;; ob-js.el --- org-babel functions for Javascript
-;; Copyright (C) 2010-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2015 Free Software Foundation, Inc.
;; Author: Eric Schulte
;; Keywords: literate programming, reproducible research, js
diff --git a/lisp/ob-keys.el b/lisp/ob-keys.el
index dc1f437..7b70998 100644
--- a/lisp/ob-keys.el
+++ b/lisp/ob-keys.el
@@ -1,6 +1,6 @@
;;; ob-keys.el --- key bindings for org-babel
-;; Copyright (C) 2009-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2015 Free Software Foundation, Inc.
;; Author: Eric Schulte
;; Keywords: literate programming, reproducible research
diff --git a/lisp/ob-latex.el b/lisp/ob-latex.el
index 4efa78d..8b3e5e8 100644
--- a/lisp/ob-latex.el
+++ b/lisp/ob-latex.el
@@ -1,6 +1,6 @@
;;; ob-latex.el --- org-babel functions for latex "evaluation"
-;; Copyright (C) 2009-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2015 Free Software Foundation, Inc.
;; Author: Eric Schulte
;; Keywords: literate programming, reproducible research
@@ -205,7 +205,7 @@ This function is called by `org-babel-execute-src-block'."
"Generate a file from a pdf file using imagemagick."
(let ((cmd (concat "convert " im-in-options " " pdffile " "
im-out-options " " out-file)))
- (message (concat "Converting pdffile file " cmd "..."))
+ (message "Converting pdffile file %s..." cmd)
(shell-command cmd)))
(defun org-babel-latex-tex-to-pdf (file)
diff --git a/lisp/ob-ledger.el b/lisp/ob-ledger.el
index 806fec6..cda2d32 100644
--- a/lisp/ob-ledger.el
+++ b/lisp/ob-ledger.el
@@ -1,6 +1,6 @@
;;; ob-ledger.el --- org-babel functions for ledger evaluation
-;; Copyright (C) 2010-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2015 Free Software Foundation, Inc.
;; Author: Eric S Fraga
;; Keywords: literate programming, reproducible research, accounting
diff --git a/lisp/ob-lilypond.el b/lisp/ob-lilypond.el
index c7ad576..eba8423 100644
--- a/lisp/ob-lilypond.el
+++ b/lisp/ob-lilypond.el
@@ -1,6 +1,6 @@
;;; ob-lilypond.el --- org-babel functions for lilypond evaluation
-;; Copyright (C) 2010-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2015 Free Software Foundation, Inc.
;; Author: Martyn Jago
;; Keywords: babel language, literate programming
@@ -130,7 +130,7 @@ blocks.")
(value (cdr pair)))
(setq body
(replace-regexp-in-string
- (concat "\$" (regexp-quote name))
+ (concat "$" (regexp-quote name))
(if (stringp value) value (format "%S" value))
body))))
vars)
diff --git a/lisp/ob-lisp.el b/lisp/ob-lisp.el
index a59dab3..bd80dee 100644
--- a/lisp/ob-lisp.el
+++ b/lisp/ob-lisp.el
@@ -1,6 +1,6 @@
;;; ob-lisp.el --- org-babel functions for common lisp evaluation
-;; Copyright (C) 2009-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2015 Free Software Foundation, Inc.
;; Authors: Joel Boehland
;; Eric Schulte
diff --git a/lisp/ob-lob.el b/lisp/ob-lob.el
index 0267f44..c285b0c 100644
--- a/lisp/ob-lob.el
+++ b/lisp/ob-lob.el
@@ -64,14 +64,14 @@ To add files to this list use the `org-babel-lob-ingest' command."
(defconst org-babel-block-lob-one-liner-regexp
(concat
- "^\\([ \t]*?\\)#\\+call:[ \t]+\\([^\(\)\n]+?\\)\\(\\[\\(.*\\)\\]\\|\\(\\)\\)"
- "\(\\([^\n]*?\\)\)\\(\\[.+\\]\\|\\)[ \t]*\\(\\([^\n]*\\)\\)?")
+ "^\\([ \t]*?\\)#\\+call:[ \t]+\\([^()\n]+?\\)\\(\\[\\(.*\\)\\]\\|\\(\\)\\)"
+ "(\\([^\n]*?\\))\\(\\[.+\\]\\|\\)[ \t]*\\(\\([^\n]*\\)\\)?")
"Regexp to match non-inline calls to predefined source block functions.")
(defconst org-babel-inline-lob-one-liner-regexp
(concat
- "\\([^\n]*?\\)call_\\([^\(\)[:space:]\n]+?\\)\\(\\[\\(.*?\\)\\]\\|\\(\\)\\)"
- "\(\\(.*?\\)\)\\(\\[\\(.*?\\)\\]\\)?")
+ "\\([^\n]*?\\)call_\\([^()[:space:]\n]+?\\)\\(\\[\\(.*?\\)\\]\\|\\(\\)\\)"
+ "(\\(.*?\\))\\(\\[\\(.*?\\)\\]\\)?")
"Regexp to match inline calls to predefined source block functions.")
(defconst org-babel-lob-one-liner-regexp
diff --git a/lisp/ob-makefile.el b/lisp/ob-makefile.el
index af7e66e..b43a9b3 100644
--- a/lisp/ob-makefile.el
+++ b/lisp/ob-makefile.el
@@ -1,6 +1,6 @@
;;; ob-makefile.el --- org-babel functions for makefile evaluation
-;; Copyright (C) 2009-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2015 Free Software Foundation, Inc.
;; Author: Eric Schulte
;; Thomas S. Dye
diff --git a/lisp/ob-matlab.el b/lisp/ob-matlab.el
index ef77de3..31464f9 100644
--- a/lisp/ob-matlab.el
+++ b/lisp/ob-matlab.el
@@ -1,6 +1,6 @@
;;; ob-matlab.el --- org-babel support for matlab evaluation
-;; Copyright (C) 2010-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2015 Free Software Foundation, Inc.
;; Author: Dan Davison
;; Keywords: literate programming, reproducible research
diff --git a/lisp/ob-maxima.el b/lisp/ob-maxima.el
index 4e559d1..02e96b8 100644
--- a/lisp/ob-maxima.el
+++ b/lisp/ob-maxima.el
@@ -1,6 +1,6 @@
;;; ob-maxima.el --- org-babel functions for maxima evaluation
-;; Copyright (C) 2009-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2015 Free Software Foundation, Inc.
;; Author: Eric S Fraga
;; Eric Schulte
diff --git a/lisp/ob-mscgen.el b/lisp/ob-mscgen.el
index 4a4dc05..6d57210 100644
--- a/lisp/ob-mscgen.el
+++ b/lisp/ob-mscgen.el
@@ -1,6 +1,6 @@
;;; ob-msc.el --- org-babel functions for mscgen evaluation
-;; Copyright (C) 2010-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2015 Free Software Foundation, Inc.
;; Author: Juan Pechiar
;; Keywords: literate programming, reproducible research
diff --git a/lisp/ob-octave.el b/lisp/ob-octave.el
index 14b55d2..dbd9100 100644
--- a/lisp/ob-octave.el
+++ b/lisp/ob-octave.el
@@ -1,6 +1,6 @@
;;; ob-octave.el --- org-babel functions for octave and matlab evaluation
-;; Copyright (C) 2010-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2015 Free Software Foundation, Inc.
;; Author: Dan Davison
;; Keywords: literate programming, reproducible research
@@ -61,7 +61,7 @@ if ischar(ans), fid = fopen('%s', 'w'); fprintf(fid, '%%s\\n', ans); fclose(fid)
else, dlmwrite('%s', ans, '\\t')
end")
-(defvar org-babel-octave-eoe-indicator "\'org_babel_eoe\'")
+(defvar org-babel-octave-eoe-indicator "'org_babel_eoe'")
(defvar org-babel-octave-eoe-output "ans = org_babel_eoe")
@@ -128,7 +128,7 @@ specifying a variable of the same value."
(if (listp (car var)) "; " ",")) "]")
(cond
((stringp var)
- (format "\'%s\'" var))
+ (format "'%s'" var))
(t
(format "%s" var)))))
@@ -168,8 +168,8 @@ create. Return the initialized session."
(defun org-babel-octave-evaluate
(session body result-type &optional matlabp)
"Pass BODY to the octave process in SESSION.
-If RESULT-TYPE equals 'output then return the outputs of the
-statements in BODY, if RESULT-TYPE equals 'value then return the
+If RESULT-TYPE equals `output' then return the outputs of the
+statements in BODY, if RESULT-TYPE equals `value' then return the
value of the last statement in BODY, as elisp."
(if session
(org-babel-octave-evaluate-session session body result-type matlabp)
diff --git a/lisp/ob-org.el b/lisp/ob-org.el
index bc02f23..ab0db67 100644
--- a/lisp/ob-org.el
+++ b/lisp/ob-org.el
@@ -1,6 +1,6 @@
;;; ob-org.el --- org-babel functions for org code block evaluation
-;; Copyright (C) 2010-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2015 Free Software Foundation, Inc.
;; Author: Eric Schulte
;; Keywords: literate programming, reproducible research
diff --git a/lisp/ob-perl.el b/lisp/ob-perl.el
index ff4cbea..67d48d7 100644
--- a/lisp/ob-perl.el
+++ b/lisp/ob-perl.el
@@ -1,6 +1,6 @@
;;; ob-perl.el --- org-babel functions for perl evaluation
-;; Copyright (C) 2009-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2015 Free Software Foundation, Inc.
;; Authors: Dan Davison
;; Eric Schulte
@@ -127,8 +127,8 @@ specifying a var of the same value."
(defun org-babel-perl-evaluate (session ibody &optional result-type result-params)
"Pass BODY to the Perl process in SESSION.
-If RESULT-TYPE equals 'output then return a list of the outputs
-of the statements in BODY, if RESULT-TYPE equals 'value then
+If RESULT-TYPE equals `output' then return a list of the outputs
+of the statements in BODY, if RESULT-TYPE equals `value' then
return the value of the last statement in BODY, as elisp."
(when session (error "Sessions are not supported for Perl"))
(let* ((body (concat org-babel-perl-preface ibody))
diff --git a/lisp/ob-picolisp.el b/lisp/ob-picolisp.el
index b240138..5b696f1 100644
--- a/lisp/ob-picolisp.el
+++ b/lisp/ob-picolisp.el
@@ -1,6 +1,6 @@
;;; ob-picolisp.el --- org-babel functions for picolisp evaluation
-;; Copyright (C) 2010-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2015 Free Software Foundation, Inc.
;; Authors: Thorsten Jolitz
;; Eric Schulte
diff --git a/lisp/ob-plantuml.el b/lisp/ob-plantuml.el
index ebc5a10..f0f7220 100644
--- a/lisp/ob-plantuml.el
+++ b/lisp/ob-plantuml.el
@@ -1,6 +1,6 @@
;;; ob-plantuml.el --- org-babel functions for plantuml evaluation
-;; Copyright (C) 2010-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2015 Free Software Foundation, Inc.
;; Author: Zhang Weize
;; Keywords: literate programming, reproducible research
diff --git a/lisp/ob-python.el b/lisp/ob-python.el
index dd3cc66..3a9b8f6 100644
--- a/lisp/ob-python.el
+++ b/lisp/ob-python.el
@@ -50,7 +50,7 @@
(defcustom org-babel-python-mode
(if (or (featurep 'xemacs) (featurep 'python-mode)) 'python-mode 'python)
"Preferred python mode for use in running python interactively.
-This will typically be either 'python or 'python-mode."
+This will typically be either `python' or `python-mode'."
:group 'org-babel
:version "24.4"
:package-version '(Org . "8.0")
@@ -64,7 +64,7 @@ This will typically be either 'python or 'python-mode."
:type 'string)
(defcustom org-babel-python-None-to 'hline
- "Replace 'None' in python tables with this before returning."
+ "Replace `None' in python tables with this before returning."
:group 'org-babel
:version "24.4"
:package-version '(Org . "8.0")
@@ -250,8 +250,8 @@ open('%s', 'w').write( pprint.pformat(main()) )")
(defun org-babel-python-evaluate-external-process
(body &optional result-type result-params preamble)
"Evaluate BODY in external python process.
-If RESULT-TYPE equals 'output then return standard output as a
-string. If RESULT-TYPE equals 'value then return the value of the
+If RESULT-TYPE equals `output' then return standard output as a
+string. If RESULT-TYPE equals `value' then return the value of the
last statement in BODY, as elisp."
(let ((raw
(case result-type
@@ -282,8 +282,8 @@ last statement in BODY, as elisp."
(defun org-babel-python-evaluate-session
(session body &optional result-type result-params)
"Pass BODY to the Python process in SESSION.
-If RESULT-TYPE equals 'output then return standard output as a
-string. If RESULT-TYPE equals 'value then return the value of the
+If RESULT-TYPE equals `output' then return standard output as a
+string. If RESULT-TYPE equals `value' then return the value of the
last statement in BODY, as elisp."
(let* ((send-wait (lambda () (comint-send-input nil t) (sleep-for 0 5)))
(dump-last-value
@@ -334,7 +334,7 @@ last statement in BODY, as elisp."
(org-babel-python-table-or-string results)))))
(defun org-babel-python-read-string (string)
- "Strip 's from around Python string."
+ "Strip \\='s from around Python string."
(if (string-match "^'\\([^\000]+\\)'$" string)
(match-string 1 string)
string))
diff --git a/lisp/ob-ref.el b/lisp/ob-ref.el
index b8a921e..6e690ab 100644
--- a/lisp/ob-ref.el
+++ b/lisp/ob-ref.el
@@ -139,7 +139,7 @@ the variable."
(setq ref (substring ref 0 (match-beginning 0))))
;; assign any arguments to pass to source block
(when (string-match
- "^\\(.+?\\)\\(\\[\\(.*\\)\\]\\|\\(\\)\\)\(\\(.*\\)\)$" ref)
+ "^\\(.+?\\)\\(\\[\\(.*\\)\\]\\|\\(\\)\\)(\\(.*\\))$" ref)
(setq new-refere (match-string 1 ref))
(setq new-header-args (match-string 3 ref))
(setq new-referent (match-string 5 ref))
@@ -177,7 +177,7 @@ the variable."
;; buffer (marker-buffer id-loc)
;; loc (marker-position id-loc))
;; (move-marker id-loc nil)
- (error "Reference '%s' not found in this buffer" ref))
+ (error "Reference `%s' not found in this buffer" ref))
(cond
(lob-info (setq type 'lob))
(id (setq type 'id))
@@ -234,7 +234,7 @@ returned, or an empty string or \"*\" both of which are
interpreted to mean the entire range and as such are equivalent
to \"0:-1\"."
(if (and (> (length index) 0) (string-match "^\\([^,]*\\),?" index))
- (let* ((ind-re "\\(\\([-[:digit:]]+\\):\\([-[:digit:]]+\\)\\|\*\\)")
+ (let* ((ind-re "\\(\\([-[:digit:]]+\\):\\([-[:digit:]]+\\)\\|\\*\\)")
(lgth (length lis))
(portion (match-string 1 index))
(remainder (substring index (match-end 0)))
diff --git a/lisp/ob-ruby.el b/lisp/ob-ruby.el
index 2134fad..780b7bc 100644
--- a/lisp/ob-ruby.el
+++ b/lisp/ob-ruby.el
@@ -1,6 +1,6 @@
;;; ob-ruby.el --- org-babel functions for ruby evaluation
-;; Copyright (C) 2009-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2015 Free Software Foundation, Inc.
;; Author: Eric Schulte
;; Keywords: literate programming, reproducible research
@@ -187,8 +187,8 @@ end
(defun org-babel-ruby-evaluate
(buffer body &optional result-type result-params)
"Pass BODY to the Ruby process in BUFFER.
-If RESULT-TYPE equals 'output then return a list of the outputs
-of the statements in BODY, if RESULT-TYPE equals 'value then
+If RESULT-TYPE equals `output' then return a list of the outputs
+of the statements in BODY, if RESULT-TYPE equals `value' then
return the value of the last statement in BODY, as elisp."
(if (not buffer)
;; external process evaluation
@@ -201,11 +201,7 @@ return the value of the last statement in BODY, as elisp."
org-babel-ruby-pp-wrapper-method
org-babel-ruby-wrapper-method)
body (org-babel-process-file-name tmp-file 'noquote)))
- (let ((raw (org-babel-eval-read-file tmp-file)))
- (if (or (member "code" result-params)
- (member "pp" result-params))
- raw
- (org-babel-ruby-table-or-string raw))))))
+ (org-babel-eval-read-file tmp-file))))
;; comint session evaluation
(case result-type
(output
diff --git a/lisp/ob-sass.el b/lisp/ob-sass.el
index 78c0c95..a39248d 100644
--- a/lisp/ob-sass.el
+++ b/lisp/ob-sass.el
@@ -1,6 +1,6 @@
;;; ob-sass.el --- org-babel functions for the sass css generation language
-;; Copyright (C) 2009-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2015 Free Software Foundation, Inc.
;; Author: Eric Schulte
;; Keywords: literate programming, reproducible research
diff --git a/lisp/ob-scala.el b/lisp/ob-scala.el
index 838bc8f..dfb72dd 100644
--- a/lisp/ob-scala.el
+++ b/lisp/ob-scala.el
@@ -1,6 +1,6 @@
;;; ob-scala.el --- org-babel functions for Scala evaluation
-;; Copyright (C) 2012-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2012-2015 Free Software Foundation, Inc.
;; Author: Andrzej Lichnerowicz
;; Keywords: literate programming, reproducible research
@@ -78,8 +78,8 @@ print(str_result)
(defun org-babel-scala-evaluate
(session body &optional result-type result-params)
"Evaluate BODY in external Scala process.
-If RESULT-TYPE equals 'output then return standard output as a string.
-If RESULT-TYPE equals 'value then return the value of the last statement
+If RESULT-TYPE equals `output' then return standard output as a string.
+If RESULT-TYPE equals `value' then return the value of the last statement
in BODY as elisp."
(when session (error "Sessions are not (yet) supported for Scala"))
(case result-type
diff --git a/lisp/ob-scheme.el b/lisp/ob-scheme.el
index 2095534..2d7f3e6 100644
--- a/lisp/ob-scheme.el
+++ b/lisp/ob-scheme.el
@@ -1,6 +1,6 @@
;;; ob-scheme.el --- org-babel functions for Scheme
-;; Copyright (C) 2010-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2015 Free Software Foundation, Inc.
;; Authors: Eric Schulte
;; Michael Gauland
@@ -109,7 +109,7 @@ For a named session, the buffer name will be the session name.
If the session is unnamed (nil), generate a name.
-If the session is 'none', use nil for the session name, and
+If the session is `none', use nil for the session name, and
org-babel-scheme-execute-with-geiser will use a temporary session."
(let ((result
(cond ((not name)
diff --git a/lisp/ob-screen.el b/lisp/ob-screen.el
index 1d4ccdd..54ae5e1 100644
--- a/lisp/ob-screen.el
+++ b/lisp/ob-screen.el
@@ -1,6 +1,6 @@
;;; ob-screen.el --- org-babel support for interactive terminal
-;; Copyright (C) 2009-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2015 Free Software Foundation, Inc.
;; Author: Benjamin Andresen
;; Keywords: literate programming, interactive shell
diff --git a/lisp/ob-shell.el b/lisp/ob-shell.el
index 3ee2f4d..84f4fa8 100644
--- a/lisp/ob-shell.el
+++ b/lisp/ob-shell.el
@@ -1,6 +1,6 @@
;;; ob-shell.el --- org-babel functions for shell evaluation
-;; Copyright (C) 2009-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2015 Free Software Foundation, Inc.
;; Author: Eric Schulte
;; Keywords: literate programming, reproducible research
@@ -184,8 +184,8 @@ var of the same value."
(defun org-babel-sh-evaluate (session body &optional params stdin cmdline)
"Pass BODY to the Shell process in BUFFER.
-If RESULT-TYPE equals 'output then return a list of the outputs
-of the statements in BODY, if RESULT-TYPE equals 'value then
+If RESULT-TYPE equals `output' then return a list of the outputs
+of the statements in BODY, if RESULT-TYPE equals `value' then
return the value of the last statement in BODY."
(let ((results
(cond
diff --git a/lisp/ob-shen.el b/lisp/ob-shen.el
index e40e45c..190d69b 100644
--- a/lisp/ob-shen.el
+++ b/lisp/ob-shen.el
@@ -1,6 +1,6 @@
;;; ob-shen.el --- org-babel functions for Shen
-;; Copyright (C) 2010-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2015 Free Software Foundation, Inc.
;; Author: Eric Schulte
;; Keywords: literate programming, reproducible research, shen
diff --git a/lisp/ob-sql.el b/lisp/ob-sql.el
index c29b175..a039613 100644
--- a/lisp/ob-sql.el
+++ b/lisp/ob-sql.el
@@ -1,6 +1,6 @@
;;; ob-sql.el --- org-babel functions for sql evaluation
-;; Copyright (C) 2009-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2015 Free Software Foundation, Inc.
;; Author: Eric Schulte
;; Keywords: literate programming, reproducible research
@@ -119,7 +119,7 @@ This function is called by `org-babel-execute-src-block'."
('dbi (format "dbish --batch %s < %s | sed '%s' > %s"
(or cmdline "")
(org-babel-process-file-name in-file)
- "/^+/d;s/^\|//;s/(NULL)/ /g;$d"
+ "/^+/d;s/^|//;s/(NULL)/ /g;$d"
(org-babel-process-file-name out-file)))
('monetdb (format "mclient -f tab %s < %s > %s"
(or cmdline "")
@@ -202,7 +202,7 @@ This function is called by `org-babel-execute-src-block'."
(lambda (pair)
(setq body
(replace-regexp-in-string
- (format "\$%s" (car pair)) ;FIXME: "\$" == "$"!
+ (format "$%s" (car pair))
(let ((val (cdr pair)))
(if (listp val)
(let ((data-file (org-babel-temp-file "sql-data-")))
diff --git a/lisp/ob-sqlite.el b/lisp/ob-sqlite.el
index 098626f..18d7fc8 100644
--- a/lisp/ob-sqlite.el
+++ b/lisp/ob-sqlite.el
@@ -1,6 +1,6 @@
;;; ob-sqlite.el --- org-babel functions for sqlite database interaction
-;; Copyright (C) 2010-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2015 Free Software Foundation, Inc.
;; Author: Eric Schulte
;; Keywords: literate programming, reproducible research
@@ -119,7 +119,7 @@ This function is called by `org-babel-execute-src-block'."
(lambda (pair)
(setq body
(replace-regexp-in-string
- (format "\$%s" (car pair)) ;FIXME: "\$" == "$"!
+ (format "$%s" (car pair))
(let ((val (cdr pair)))
(if (listp val)
(let ((data-file (org-babel-temp-file "sqlite-data-")))
diff --git a/lisp/ob-table.el b/lisp/ob-table.el
index b2a8da6..ec7450e 100644
--- a/lisp/ob-table.el
+++ b/lisp/ob-table.el
@@ -1,6 +1,6 @@
;;; ob-table.el --- support for calling org-babel functions from tables
-;; Copyright (C) 2009-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2015 Free Software Foundation, Inc.
;; Author: Eric Schulte
;; Keywords: literate programming, reproducible research
@@ -94,7 +94,7 @@ the header argument which can then be passed before all variables
as shown in the example below.
| 1 | 2 | :file nothing.png | nothing.png |
-#+TBLFM: @1$4='(org-sbe test-sbe $3 (x $1) (y $2))"
+#+TBLFM: @1$4=\\='(org-sbe test-sbe $3 (x $1) (y $2))"
(declare (debug (form form)))
(let* ((header-args (if (stringp (car variables)) (car variables) ""))
(variables (if (stringp (car variables)) (cdr variables) variables)))
diff --git a/lisp/ob-tangle.el b/lisp/ob-tangle.el
index 385d8e2..f822e3f 100644
--- a/lisp/ob-tangle.el
+++ b/lisp/ob-tangle.el
@@ -1,6 +1,6 @@
;;; ob-tangle.el --- extract source code from org-mode files
-;; Copyright (C) 2009-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2015 Free Software Foundation, Inc.
;; Author: Eric Schulte
;; Keywords: literate programming, reproducible research
@@ -242,7 +242,7 @@ used to limit the exported source code blocks by language."
(base-name (cond
((string= "yes" tangle)
(file-name-sans-extension
- (buffer-file-name)))
+ (nth 1 spec)))
((string= "no" tangle) nil)
((> (length tangle) 0) tangle)))
(file-name (when base-name
@@ -332,7 +332,7 @@ Insert the source-code specified by SPEC into the current source
code file. This function uses `comment-region' which assumes
that the appropriate major-mode is set. SPEC has the form:
- \(start-line file link source-name params body comment)"
+ (start-line file link source-name params body comment)"
(let* ((start-line (nth 0 spec))
(file (if org-babel-tangle-use-relative-file-links
(file-relative-name (nth 1 spec))
@@ -362,13 +362,17 @@ that the appropriate major-mode is set. SPEC has the form:
(when (and comments (not (string= comments "no"))
(> (length text) 0))
(if org-babel-tangle-uncomment-comments
- ;; just plain comments with no processing
+ ;; Plain comments: no processing.
(insert text)
- ;; ensure comments are made to be
- ;; comments, and add a trailing newline
+ ;; Ensure comments are made to be
+ ;; comments, and add a trailing
+ ;; newline. Also ignore invisible
+ ;; characters when commenting.
(comment-region
- (point) (progn (insert text) (point)))
- (end-of-line nil)
+ (point)
+ (progn (insert (org-no-properties text))
+ (point)))
+ (end-of-line)
(insert "\n"))))))
(when comment (funcall insert-comment comment))
(when link-p
@@ -427,7 +431,7 @@ list to be used by `org-babel-tangle' directly."
(start-line
(save-restriction (widen)
(+ 1 (line-number-at-pos (point)))))
- (file (buffer-file-name))
+ (file (buffer-file-name (buffer-base-buffer)))
(src-lang (nth 0 info))
(params (nth 2 info))
(extra (nth 3 info))
diff --git a/lisp/ob.el b/lisp/ob.el
index 87657fe..42137c2 100644
--- a/lisp/ob.el
+++ b/lisp/ob.el
@@ -1,6 +1,6 @@
;;; ob.el --- working with code blocks in org-mode
-;; Copyright (C) 2009-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2015 Free Software Foundation, Inc.
;; Authors: Eric Schulte
;; Keywords: literate programming, reproducible research
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index c5cd21d..0725d9e 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -153,7 +153,7 @@ before assigned to the variables. So make sure to quote values you do
*not* want evaluated, for example
(setq org-agenda-exporter-settings
- '((ps-print-color-p 'black-white)))"
+ \\='((ps-print-color-p \\='black-white)))"
:group 'org-agenda-export
:type '(repeat
(list
@@ -440,7 +440,7 @@ This will be spliced into the custom type of
(defcustom org-agenda-custom-commands
- '(("n" "Agenda and all TODO's" ((agenda "") (alltodo ""))))
+ '(("n" "Agenda and all TODOs" ((agenda "") (alltodo ""))))
"Custom commands for the agenda.
These commands will be offered on the splash screen displayed by the
agenda dispatcher \\[org-agenda]. Each entry is a list like this:
@@ -504,7 +504,7 @@ are prefix commands. For the dispatcher to display useful information, you
should provide a description for the prefix, like
(setq org-agenda-custom-commands
- '((\"h\" . \"HOME + Name tag searches\") ; describe prefix \"h\"
+ \\='((\"h\" . \"HOME + Name tag searches\") ; describe prefix \"h\"
(\"hl\" tags \"+HOME+Lisa\")
(\"hp\" tags \"+HOME+Peter\")
(\"hk\" tags \"+HOME+Kim\")))"
@@ -1211,7 +1211,7 @@ For example, 9:30am would become 09:30 rather than 9:30."
:type 'boolean)
(defun org-agenda-time-of-day-to-ampm (time)
- "Convert TIME of a string like '13:45' to an AM/PM style time string."
+ "Convert TIME of a string like \"13:45\" to an AM/PM style time string."
(let* ((hour-number (string-to-number (substring time 0 -3)))
(minute (substring time -2))
(ampm "am"))
@@ -1292,12 +1292,14 @@ given here."
(defcustom org-agenda-log-mode-items '(closed clock)
"List of items that should be shown in agenda log mode.
+\\<org-agenda-mode-map>\
This list may contain the following symbols:
closed Show entries that have been closed on that day.
clock Show entries that have received clocked time on that day.
state Show all logged state changes.
-Note that instead of changing this variable, you can also press `C-u l' in
+Note that instead of changing this variable, you can also press \
+`\\[universal-argument] \\[org-agenda-log-mode]' in
the agenda to display all available LOG items temporarily."
:group 'org-agenda-daily/weekly
:type '(set :greedy t (const closed) (const clock) (const state)))
@@ -1792,7 +1794,7 @@ When non-nil, this must be the number of minutes, e.g. 60 for one hour."
(defcustom org-agenda-show-inherited-tags t
"Non-nil means show inherited tags in each agenda line.
-When this option is set to 'always, it take precedences over
+When this option is set to `always', it take precedences over
`org-agenda-use-tag-inheritance' and inherited tags are shown
in every agenda.
@@ -1801,8 +1803,8 @@ shown when they are available, i.e. when the value of
`org-agenda-use-tag-inheritance' has been taken into account.
This can be set to a list of agenda types in which the agenda
-must display the inherited tags. Available types are 'todo,
-'agenda, 'search and 'timeline.
+must display the inherited tags. Available types are `todo',
+`agenda', `search' and `timeline'.
When set to nil, never show inherited tags in agenda lines."
:group 'org-agenda-line-format
@@ -1823,10 +1825,10 @@ controlled by `org-use-tag-inheritance'. In other agenda types,
agenda entries. Still, you may want the agenda to be aware of
the inherited tags anyway, e.g. for later tag filtering.
-Allowed value are 'todo, 'search, 'timeline and 'agenda.
+Allowed value are `todo', `search', `timeline' and `agenda'.
This variable has no effect if `org-agenda-show-inherited-tags'
-is set to 'always. In that case, the agenda is aware of those
+is set to `always'. In that case, the agenda is aware of those
tags.
The default value sets tags in every agenda type. Setting this
@@ -1932,7 +1934,7 @@ list as second element:
For example, to display a 16px horizontal space for Emacs
category, you can use:
- (\"Emacs\" '(space . (:width (16))))"
+ (\"Emacs\" \\='(space . (:width (16))))"
:group 'org-agenda-line-format
:version "24.1"
:type '(alist :key-type (string :tag "Regexp matching category")
@@ -1975,7 +1977,8 @@ estimate."
:type 'boolean)
(defcustom org-agenda-auto-exclude-function nil
- "A function called with a tag to decide if it is filtered on '/ RET'.
+ "A function called with a tag to decide if it is filtered on \
+\\<org-agenda-mode-map>`\\[org-agenda-filter-by-tag] RET'.
The sole argument to the function, which is called once for each
possible tag, is a string giving the name of the tag. The
function should return either nil if the tag should be included
@@ -1990,7 +1993,7 @@ the lower-case version of all tags."
"Alist of characters and custom functions for bulk actions.
For example, this value makes those two functions available:
- '((?R set-category)
+ \\='((?R set-category)
(?C bulk-cut))
With selected entries in an agenda buffer, `B R' will call
@@ -2006,7 +2009,7 @@ If STRING is non-nil, the text property will be fetched from position 0
in that string. If STRING is nil, it will be fetched from the beginning
of the current line."
(org-with-gensyms (marker)
- `(let ((,marker (get-text-property (if string 0 (point-at-bol))
+ `(let ((,marker (get-text-property (if ,string 0 (point-at-bol))
'org-hd-marker ,string)))
(with-current-buffer (marker-buffer ,marker)
(save-excursion
@@ -2547,7 +2550,7 @@ For example, if you have a custom agenda command \"p\" and you
want this command to be accessible only from plain text files,
use this:
- '((\"p\" ((in-file . \"\\\\.txt\\\\'\"))))
+ \\='((\"p\" ((in-file . \"\\\\.txt\\\\'\"))))
Here are the available contexts definitions:
@@ -2565,7 +2568,7 @@ accessible if there is at least one valid check.
You can also bind a key to another agenda custom command
depending on contextual rules.
- '((\"p\" \"q\" ((in-file . \"\\\\.txt\\\\'\"))))
+ \\='((\"p\" \"q\" ((in-file . \"\\\\.txt\\\\'\"))))
Here it means: in .txt files, use \"p\" as the key for the
agenda command otherwise associated with \"q\". (The command
@@ -3851,41 +3854,42 @@ FILTER-ALIST is an alist of filters we need to apply when
(defvar org-depend-tag-blocked)
(defun org-agenda-dim-blocked-tasks (&optional invisible)
- "Dim currently blocked TODO's in the agenda display.
+ "Dim currently blocked TODOs in the agenda display.
When INVISIBLE is non-nil, hide currently blocked TODO instead of
dimming them."
(interactive "P")
(when (org-called-interactively-p 'interactive)
(message "Dim or hide blocked tasks..."))
- (mapc (lambda (o) (if (eq (overlay-get o 'org-type) 'org-blocked-todo)
- (delete-overlay o)))
- (overlays-in (point-min) (point-max)))
+ (dolist (o (overlays-in (point-min) (point-max)))
+ (when (eq (overlay-get o 'org-type) 'org-blocked-todo)
+ (delete-overlay o)))
(save-excursion
(let ((inhibit-read-only t)
(org-depend-tag-blocked nil)
- (invis (or (not (null invisible))
- (eq org-agenda-dim-blocked-tasks 'invisible)))
- org-blocked-by-checkboxes
- invis1 b e p ov h l)
+ org-blocked-by-checkboxes)
(goto-char (point-min))
- (while (let ((pos (next-single-property-change (point) 'todo-state)))
- (and pos (goto-char (1+ pos))))
- (setq org-blocked-by-checkboxes nil invis1 invis)
+ (while (let ((pos (text-property-not-all
+ (point) (point-max) 'todo-state nil)))
+ (when pos (goto-char pos)))
+ (setq org-blocked-by-checkboxes nil)
(let ((marker (org-get-at-bol 'org-hd-marker)))
- (when (and marker
+ (when (and (markerp marker)
(with-current-buffer (marker-buffer marker)
(save-excursion (goto-char marker)
(org-entry-blocked-p))))
- (if org-blocked-by-checkboxes (setq invis1 nil))
- (setq b (if invis1
- (max (point-min) (1- (point-at-bol)))
- (point-at-bol))
- e (point-at-eol)
- ov (make-overlay b e))
- (if invis1
- (overlay-put ov 'invisible t)
- (overlay-put ov 'face 'org-agenda-dimmed-todo-face))
- (overlay-put ov 'org-type 'org-blocked-todo))))))
+ ;; Entries blocked by checkboxes cannot be made invisible.
+ ;; See `org-agenda-dim-blocked-tasks' for details.
+ (let* ((really-invisible
+ (and (not org-blocked-by-checkboxes)
+ (or invisible (eq org-agenda-dim-blocked-tasks
+ 'invisible))))
+ (ov (make-overlay (if really-invisible (line-end-position 0)
+ (line-beginning-position))
+ (line-end-position))))
+ (if really-invisible (overlay-put ov 'invisible t)
+ (overlay-put ov 'face 'org-agenda-dimmed-todo-face))
+ (overlay-put ov 'org-type 'org-blocked-todo))))
+ (forward-line))))
(when (org-called-interactively-p 'interactive)
(message "Dim or hide blocked tasks...done")))
@@ -4638,7 +4642,8 @@ in `org-agenda-text-search-extra-files'."
(goto-char (1- end))
(throw :skip t)))
(if todo-only
- (cons (concat "^\*+[ \t]+" org-not-done-regexp)
+ (cons (concat "^\\*+[ \t]+"
+ org-not-done-regexp)
regexps+)
regexps+))
(goto-char beg)
@@ -4680,7 +4685,12 @@ in `org-agenda-text-search-extra-files'."
(add-text-properties pos (1- (point)) (list 'face 'org-warning))
(setq pos (point))
(unless org-agenda-multi
- (insert "Press `[', `]' to add/sub word, `{', `}' to add/sub regexp, `C-u r' to edit\n")
+ (insert (substitute-command-keys "\
+Press `\\[org-agenda-manipulate-query-add]', \
+`\\[org-agenda-manipulate-query-subtract]' to add/sub word, \
+`\\[org-agenda-manipulate-query-add-re]', \
+`\\[org-agenda-manipulate-query-subtract-re]' to add/sub regexp, \
+`\\[universal-argument] \\[org-agenda-redo]' to edit\n"))
(add-text-properties pos (1- (point))
(list 'face 'org-agenda-structure))))
(org-agenda-mark-header-line (point-min))
@@ -4774,7 +4784,8 @@ for a keyword. A numeric prefix directly selects the Nth keyword in
org-select-this-todo-keyword))
(setq pos (point))
(unless org-agenda-multi
- (insert "Available with `N r': (0)[ALL]")
+ (insert (substitute-command-keys "Available with \
+`N \\[org-agenda-redo]': (0)[ALL]"))
(let ((n 0) s)
(mapc (lambda (x)
(setq s (format "(%d)%s" (setq n (1+ n)) x))
@@ -4869,7 +4880,9 @@ The prefix arg TODO-ONLY limits the search to TODO entries."
(add-text-properties pos (1- (point)) (list 'face 'org-warning))
(setq pos (point))
(unless org-agenda-multi
- (insert "Press `C-u r' to search again with new search string\n"))
+ (insert (substitute-command-keys
+ "Press `\\[universal-argument] \\[org-agenda-redo]' \
+to search again with new search string\n")))
(add-text-properties pos (1- (point)) (list 'face 'org-agenda-structure)))
(org-agenda-mark-header-line (point-min))
(when rtnall
@@ -4968,13 +4981,13 @@ the `regexp' or `notregexp' element.
`todo' and `nottodo' accept as an argument a list of todo
keywords, which may include \"*\" to match any todo keyword.
- (org-agenda-skip-entry-if 'todo '(\"TODO\" \"WAITING\"))
+ (org-agenda-skip-entry-if \\='todo \\='(\"TODO\" \"WAITING\"))
would skip all entries with \"TODO\" or \"WAITING\" keywords.
Instead of a list, a keyword class may be given. For example:
- (org-agenda-skip-entry-if 'nottodo 'done)
+ (org-agenda-skip-entry-if \\='nottodo \\='done)
would skip entries that haven't been marked with any of \"DONE\"
keywords. Possible classes are: `todo', `done', `any'.
@@ -7115,7 +7128,7 @@ their type."
(defun org-agenda-set-restriction-lock (&optional type)
"Set restriction lock for agenda, to current subtree or file.
Restriction will be the file if TYPE is `file', or if type is the
-universal prefix '(4), or if the cursor is before the first headline
+universal prefix \\='(4), or if the cursor is before the first headline
in the file. Otherwise, restriction will be to the current subtree."
(interactive "P")
(org-agenda-remove-restriction-lock 'noupdate)
@@ -7168,7 +7181,9 @@ in the file. Otherwise, restriction will be to the current subtree."
(defun org-agenda-maybe-redo ()
"If there is any window showing the agenda view, update it."
- (let ((w (get-buffer-window org-agenda-buffer-name t))
+ (let ((w (get-buffer-window (or org-agenda-this-buffer-name
+ org-agenda-buffer-name)
+ t))
(w0 (selected-window)))
(when w
(select-window w)
@@ -7184,7 +7199,7 @@ in the file. Otherwise, restriction will be to the current subtree."
(defun org-agenda-check-type (error &rest types)
"Check if agenda buffer is of allowed type.
If ERROR is non-nil, throw an error, otherwise just return nil.
-Allowed types are 'agenda 'timeline 'todo 'tags 'search."
+Allowed types are `agenda' `timeline' `todo' `tags' `search'."
(if (not org-agenda-type)
(error "No Org agenda currently displayed")
(if (memq org-agenda-type types)
@@ -7259,8 +7274,7 @@ touched. Also, exit the agenda even if it is in column view."
(defun org-agenda-kill-all-agenda-buffers ()
"Kill all buffers in `org-agenda-mode'.
-This is used when toggling sticky agendas.
-You can also explicitly invoke it with `C-c a C-k'."
+This is used when toggling sticky agendas."
(interactive)
(let (blist)
(dolist (buf (buffer-list))
@@ -7349,8 +7363,11 @@ in the agenda."
(defvar org-agenda-filtered-by-category nil)
(defun org-agenda-filter-by-category (strip)
- "Keep only those lines in the agenda buffer that have a specific category.
-The category is that of the current line."
+ "Filter lines in the agenda buffer that have a specific category.
+The category is that of the current line.
+Without prefix argument, keep only the lines of that category.
+With a prefix argument, exclude the lines of that category.
+"
(interactive "P")
(if (and org-agenda-filtered-by-category
org-agenda-category-filter)
@@ -7360,7 +7377,7 @@ The category is that of the current line."
((and cat strip)
(org-agenda-filter-apply
(push (concat "-" cat) org-agenda-category-filter) 'category))
- ((and cat)
+ (cat
(org-agenda-filter-apply
(setq org-agenda-category-filter
(list (concat "+" cat))) 'category))
@@ -8164,7 +8181,8 @@ so that the date SD will be in that range."
"Toggle log mode in an agenda buffer.
With argument SPECIAL, show all possible log items, not only the ones
configured in `org-agenda-log-mode-items'.
-With a double `C-u' prefix arg, show *only* log items, nothing else."
+With a double \\[universal-argument] prefix arg, show *only* \
+log items, nothing else."
(interactive "P")
(org-agenda-check-type t 'agenda 'timeline)
(setq org-agenda-show-log
@@ -8388,13 +8406,13 @@ When called with a prefix argument, include all archive files as well."
(org-show-context 'agenda)
(save-excursion
(and (outline-next-heading)
- (org-flag-heading nil)))) ; show the next heading
- (when (outline-invisible-p)
- (show-entry)) ; display invisible text
- (recenter (/ (window-height) 2))
- (org-back-to-heading t)
- (if (re-search-forward org-complex-heading-regexp nil t)
- (goto-char (match-beginning 4)))
+ (org-flag-heading nil))) ; show the next heading
+ (when (outline-invisible-p)
+ (show-entry)) ; display invisible text
+ (recenter (/ (window-height) 2))
+ (org-back-to-heading t)
+ (if (re-search-forward org-complex-heading-regexp nil t)
+ (goto-char (match-beginning 4))))
(run-hooks 'org-agenda-after-show-hook)
(and highlight (org-highlight (point-at-bol) (point-at-eol)))))
@@ -8511,8 +8529,10 @@ If this information is not given, the function uses the tree at point."
(defun org-agenda-refile (&optional goto rfloc no-update)
"Refile the item at point.
-When GOTO is 0 or '(64) or \\[universal-argument] \\[universal-argument] \\[universal-argument], clear the refile cache.
-When GOTO is '(16) or \\[universal-argument] \\[universal-argument], go to the location of the last refiled item.
+When GOTO is 0 or \\='(64) or a triple \\[universal-argument] prefix argument,
+clear the refile cache.
+When GOTO is \\='(16) or a double \\[universal-argument] prefix argument,
+go to the location of the last refiled item.
RFLOC can be a refile location obtained in a different way.
When NO-UPDATE is non-nil, don't redo the agenda buffer."
(interactive "P")
@@ -8593,7 +8613,9 @@ It also looks at the text of the entry itself."
(symbol-value var))))))
(defun org-agenda-switch-to (&optional delete-other-windows)
- "Go to the Org-mode file which contains the item at point."
+ "Go to the Org mode file which contains the item at point.
+When optional argument DELETE-OTHER-WINDOWS is non-nil, the
+displayed Org file fills the frame."
(interactive)
(if (and org-return-follows-link
(not (org-get-at-bol 'org-marker))
@@ -8605,17 +8627,11 @@ It also looks at the text of the entry itself."
(pos (marker-position marker)))
(unless buffer (user-error "Trying to switch to non-existent buffer"))
(org-pop-to-buffer-same-window buffer)
- (and delete-other-windows (delete-other-windows))
+ (when delete-other-windows (delete-other-windows))
(widen)
(goto-char pos)
- (org-back-to-heading t)
(when (derived-mode-p 'org-mode)
(org-show-context 'agenda)
- (save-excursion
- (and (outline-next-heading)
- (org-flag-heading nil))) ; show the next heading
- (when (outline-invisible-p)
- (show-entry)) ; display invisible text
(run-hooks 'org-agenda-after-show-hook)))))
(defun org-agenda-goto-mouse (ev)
@@ -9682,7 +9698,7 @@ This is a command that has to be installed in `calendar-mode-map'."
"Hebrew: " (calendar-hebrew-date-string date) " (until sunset)\n"
"Islamic: " (calendar-islamic-date-string date) " (until sunset)\n"
"French: " (calendar-french-date-string date) "\n"
- "Baha'i: " (calendar-bahai-date-string date) " (until sunset)\n"
+ "Bahá’í: " (calendar-bahai-date-string date) " (until sunset)\n"
"Mayan: " (calendar-mayan-date-string date) "\n"
"Coptic: " (calendar-coptic-date-string date) "\n"
"Ethiopic: " (calendar-ethiopic-date-string date) "\n"
@@ -10061,7 +10077,8 @@ tag and (if present) the flagging note."
(replace-match "\n" t t))
(goto-char (point-min))
(select-window win)
- (message "Flagging note pushed to kill ring. Press [?] again to remove tag and note"))))
+ (message (substitute-command-keys "Flagging note pushed to kill ring. \
+Press \\[org-agenda-show-the-flagging-note] again to remove tag and note")))))
(defun org-agenda-remove-flag (marker)
"Remove the FLAGGED tag and any flagging note in the entry."
@@ -10098,9 +10115,9 @@ calling the function returns nil. This function takes one
argument: an entry from `org-agenda-get-day-entries'.
FILTER can also be an alist with the car of each cell being
-either 'headline or 'category. For example:
+either `headline' or `category'. For example:
- '((headline \"IMPORTANT\")
+ \\='((headline \"IMPORTANT\")
(category \"Work\"))
will only add headlines containing IMPORTANT or headlines
diff --git a/lisp/org-archive.el b/lisp/org-archive.el
index bbe95ed..2919fda 100644
--- a/lisp/org-archive.el
+++ b/lisp/org-archive.el
@@ -1,6 +1,6 @@
;;; org-archive.el --- Archiving for Org-mode
-;; Copyright (C) 2004-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2004-2015 Free Software Foundation, Inc.
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
diff --git a/lisp/org-attach.el b/lisp/org-attach.el
index 7f61910..fb4c385 100644
--- a/lisp/org-attach.el
+++ b/lisp/org-attach.el
@@ -1,6 +1,6 @@
;;; org-attach.el --- Manage file attachments to org-mode tasks
-;; Copyright (C) 2008-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2015 Free Software Foundation, Inc.
;; Author: John Wiegley <johnw@newartisans.com>
;; Keywords: org data task
diff --git a/lisp/org-bbdb.el b/lisp/org-bbdb.el
index 78f9b71..c489385 100644
--- a/lisp/org-bbdb.el
+++ b/lisp/org-bbdb.el
@@ -1,6 +1,6 @@
;;; org-bbdb.el --- Support for links to BBDB entries from within Org-mode
-;; Copyright (C) 2004-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2004-2015 Free Software Foundation, Inc.
;; Authors: Carsten Dominik <carsten at orgmode dot org>
;; Thomas Baumann <thomas dot baumann at ch dot tum dot de>
diff --git a/lisp/org-bibtex.el b/lisp/org-bibtex.el
index 7b2ed48..4622702 100644
--- a/lisp/org-bibtex.el
+++ b/lisp/org-bibtex.el
@@ -1,6 +1,6 @@
;;; org-bibtex.el --- Org links to BibTeX entries
;;
-;; Copyright (C) 2007-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2015 Free Software Foundation, Inc.
;;
;; Authors: Bastien Guerry <bzg@gnu.org>
;; Carsten Dominik <carsten dot dominik at gmail dot com>
@@ -195,7 +195,7 @@
(:howpublished . "How something strange has been published. The first word should be capitalized.")
(:institution . "The sponsoring institution of a technical report.")
(:journal . "A journal name.")
- (:key . "Used for alphabetizing, cross-referencing, and creating a label when the author information is missing. This field should not be confused with the key that appears in the \cite command and at the beginning of the database entry.")
+ (:key . "Used for alphabetizing, cross-referencing, and creating a label when the author information is missing. This field should not be confused with the key that appears in the \\cite command and at the beginning of the database entry.")
(:month . "The month in which the work was published or, for an unpublished work, in which it was written. You should use the standard three-letter abbreviation,")
(:note . "Any additional information that can help the reader. The first word should be capitalized.")
(:number . "Any additional information that can help the reader. The first word should be capitalized.")
@@ -221,7 +221,7 @@
(defcustom org-bibtex-prefix nil
"Optional prefix for all bibtex property names.
-For example setting to 'BIB_' would allow interoperability with fireforg."
+For example setting to `BIB_' would allow interoperability with fireforg."
:group 'org-bibtex
:version "24.1"
:type '(choice
diff --git a/lisp/org-capture.el b/lisp/org-capture.el
index bfdb475..67dc319 100644
--- a/lisp/org-capture.el
+++ b/lisp/org-capture.el
@@ -435,7 +435,9 @@ Turning on this mode runs the normal hook `org-capture-mode-hook'."
nil " Rem" org-capture-mode-map
(org-set-local
'header-line-format
- "Capture buffer. Finish `C-c C-c', refile `C-c C-w', abort `C-c C-k'."))
+ (substitute-command-keys
+ "\\<org-capture-mode-map>Capture buffer. Finish \\[org-capture-finalize], \
+refile \\[org-capture-refile], abort \\[org-capture-kill].")))
(define-key org-capture-mode-map "\C-c\C-c" 'org-capture-finalize)
(define-key org-capture-mode-map "\C-c\C-k" 'org-capture-kill)
(define-key org-capture-mode-map "\C-c\C-w" 'org-capture-refile)
@@ -460,7 +462,7 @@ For example, if you have a capture template \"c\" and you want
this template to be accessible only from `message-mode' buffers,
use this:
- '((\"c\" ((in-mode . \"message-mode\"))))
+ \\='((\"c\" ((in-mode . \"message-mode\"))))
Here are the available contexts definitions:
@@ -478,7 +480,7 @@ accessible if there is at least one valid check.
You can also bind a key to another agenda custom command
depending on contextual rules.
- '((\"c\" \"d\" ((in-mode . \"message-mode\"))))
+ \\='((\"c\" \"d\" ((in-mode . \"message-mode\"))))
Here it means: in `message-mode buffers', use \"c\" as the
key for the capture template otherwise associated with \"d\".
@@ -1608,7 +1610,7 @@ The template may still contain \"%?\" for cursor positioning."
(delete-region start end)
(condition-case error
(insert-file-contents filename)
- (error (insert (format "%%![Couldn't insert %s: %s]"
+ (error (insert (format "%%![Couldn not insert %s: %s]"
filename error)))))))
;; The current time
diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index 6e34483..84d032c 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -1,6 +1,6 @@
;;; org-clock.el --- The time clocking code for Org-mode
-;; Copyright (C) 2004-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2004-2015 Free Software Foundation, Inc.
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
@@ -94,9 +94,10 @@ Return value is either a string, an integer, or nil."
(defcustom org-clock-out-when-done t
"When non-nil, clock will be stopped when the clocked entry is marked DONE.
+\\<org-mode-map>\
DONE here means any DONE-like state.
A nil value means clock will keep running until stopped explicitly with
-`C-c C-x C-o', or until the clock is started in a different item.
+`\\[org-clock-out]', or until the clock is started in a different item.
Instead of t, this can also be a list of TODO states that should trigger
clocking out."
:group 'org-clock
@@ -400,8 +401,8 @@ nil current clock is not displayed"
(defcustom org-clock-frame-title-format '(t org-mode-line-string)
"The value for `frame-title-format' when clocking in.
-When `org-clock-clocked-in-display' is set to 'frame-title
-or 'both, clocking in will replace `frame-title-format' with
+When `org-clock-clocked-in-display' is set to `frame-title'
+or `both', clocking in will replace `frame-title-format' with
this value. Clocking out will restore `frame-title-format'.
`org-frame-title-string' is a format string using the same
@@ -556,6 +557,13 @@ of a different task.")
(mapc (lambda (m) (org-check-and-save-marker m beg end))
org-clock-history))
+(defun org-clock-drawer-name ()
+ "Return clock drawer's name for current entry, or nil."
+ (let ((drawer (org-clock-into-drawer)))
+ (cond ((integerp drawer) (org-log-into-drawer))
+ ((stringp drawer) drawer)
+ (t nil))))
+
(defun org-clocking-buffer ()
"Return the clocking buffer if we are currently clocking a task or nil."
(marker-buffer org-clock-marker))
@@ -771,8 +779,9 @@ Notification is shown only once."
(unless org-clock-notification-was-shown
(setq org-clock-notification-was-shown t)
(org-notify
- (format "Task '%s' should be finished by now. (%s)"
- org-clock-heading org-clock-effort) org-clock-sound))
+ (format-message "Task `%s' should be finished by now. (%s)"
+ org-clock-heading org-clock-effort)
+ org-clock-sound))
(setq org-clock-notification-was-shown nil)))))
(defun org-notify (notification &optional play-sound)
@@ -950,7 +959,7 @@ If necessary, clock-out of the currently active clock."
(when drawer
(org-with-wide-buffer
(let ((drawer-re (format "^[ \t]*:%s:[ \t]*$"
- (regexp-quote (or drawer "LOGBOOK"))))
+ (regexp-quote (if (stringp drawer) drawer "LOGBOOK"))))
(beg (save-excursion (outline-back-to-heading t) (point))))
(catch 'exit
(while (re-search-backward drawer-re beg t)
@@ -987,7 +996,7 @@ was started."
(org-clock-jump-to-current-clock clock))
(unless org-clock-resolve-expert
(with-output-to-temp-buffer "*Org Clock*"
- (princ "Select a Clock Resolution Command:
+ (princ (format-message "Select a Clock Resolution Command:
i/q Ignore this question; the same as keeping all the idle time.
@@ -997,7 +1006,7 @@ k/K Keep X minutes of the idle time (default is all). If this
clocked back in at the present time.
g/G Indicate that you \"got back\" X minutes ago. This is quite
- different from 'k': it clocks you out from the beginning of
+ different from `k': it clocks you out from the beginning of
the idle period and clock you back in X minutes ago.
s/S Subtract the idle time from the current clock. This is the
@@ -1009,7 +1018,7 @@ C Cancel the open timer altogether. It will be as though you
j/J Jump to the current clock, to make manual adjustments.
For all these options, using uppercase makes your final state
-to be CLOCKED OUT.")))
+to be CLOCKED OUT."))))
(org-fit-window-to-buffer (get-buffer-window "*Org Clock*"))
(let (char-pressed)
(when (featurep 'xemacs)
@@ -1286,7 +1295,7 @@ make this the default behavior.)"
(looking-at
(concat "^[ \t]*" org-clock-string
" \\[\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}"
- " *\\sw+\.? +[012][0-9]:[0-5][0-9]\\)\\][ \t]*$")))
+ " *\\sw+.? +[012][0-9]:[0-5][0-9]\\)\\][ \t]*$")))
(message "Matched %s" (match-string 1))
(setq ts (concat "[" (match-string 1) "]"))
(goto-char (match-end 1))
@@ -1451,10 +1460,7 @@ line and position cursor in that line."
(let* ((beg (line-beginning-position 2))
(end (save-excursion (outline-next-heading) (point)))
(org-clock-into-drawer (org-clock-into-drawer))
- (drawer (cond
- ((not org-clock-into-drawer) nil)
- ((stringp org-clock-into-drawer) org-clock-into-drawer)
- (t "LOGBOOK"))))
+ (drawer (org-clock-drawer-name)))
;; Look for a running clock if FIND-UNCLOSED in non-nil.
(when find-unclosed
(let ((open-clock-re
@@ -1646,18 +1652,19 @@ to, overriding the existing value of `org-clock-out-switch-to-state'."
(add-hook 'org-clock-out-hook 'org-clock-remove-empty-clock-drawer)
-(defun org-clock-remove-empty-clock-drawer nil
- "Remove empty clock drawer in the current subtree."
- (let ((clock-drawer (org-log-into-drawer))
- (end (save-excursion (org-end-of-subtree t t))))
- (when clock-drawer
- (save-excursion
- (org-back-to-heading t)
- (while (and (< (point) end)
- (search-forward clock-drawer end t))
- (goto-char (match-beginning 0))
- (org-remove-empty-drawer-at (point))
- (forward-line 1))))))
+(defun org-clock-remove-empty-clock-drawer ()
+ "Remove empty clock drawers in current subtree."
+ (save-excursion
+ (org-back-to-heading t)
+ (org-map-tree
+ (lambda ()
+ (let ((drawer (org-clock-drawer-name))
+ (case-fold-search t))
+ (when drawer
+ (let ((re (format "^[ \t]*:%s:[ \t]*$" (regexp-quote drawer)))
+ (end (save-excursion (outline-next-heading))))
+ (while (re-search-forward re end t)
+ (org-remove-empty-drawer-at (point))))))))))
(defun org-clock-timestamps-up (&optional n)
"Increase CLOCK timestamps at cursor.
@@ -1673,7 +1680,7 @@ Optional argument N tells to change by that many units."
(defun org-clock-timestamps-change (updown &optional n)
"Change CLOCK timestamps synchronously at cursor.
-UPDOWN tells whether to change 'up or 'down.
+UPDOWN tells whether to change `up' or `down'.
Optional argument N tells to change by that many units."
(setq org-ts-what nil)
(when (org-at-timestamp-p t)
@@ -2403,7 +2410,8 @@ the currently selected interval size."
(setq scope (org-agenda-files t))
(setq scope (org-add-archive-files scope)))
((eq scope 'file-with-archives)
- (setq scope (org-add-archive-files (list (buffer-file-name)))
+ (setq scope (and buffer-file-name
+ (org-add-archive-files (list buffer-file-name)))
one-file-with-archives t)))
(setq scope-is-list (and scope (listp scope)))
(if scope-is-list
@@ -2419,7 +2427,8 @@ the currently selected interval size."
;; Just from the current file
(save-restriction
;; get the right range into the restriction
- (org-agenda-prepare-buffers (list (buffer-file-name)))
+ (org-agenda-prepare-buffers (list (or (buffer-file-name)
+ (current-buffer))))
(cond
((not scope)) ; use the restriction as it is now
((eq scope 'file) (widen))
diff --git a/lisp/org-colview.el b/lisp/org-colview.el
index 251f425..3838531 100644
--- a/lisp/org-colview.el
+++ b/lisp/org-colview.el
@@ -1,6 +1,6 @@
;;; org-colview.el --- Column View in Org-mode
-;; Copyright (C) 2004-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2004-2015 Free Software Foundation, Inc.
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
@@ -146,11 +146,15 @@ This is the compiled version of the format.")
"--"
["Quit" org-columns-quit t]))
+(defun org-columns--value (property pos)
+ "Return value for PROPERTY at buffer position POS."
+ (or (cdr (assoc-string property (get-text-property pos 'org-summaries) t))
+ (org-entry-get pos property 'selective t)))
+
(defun org-columns-new-overlay (beg end &optional string face)
"Create a new column overlay and add it to the list."
(let ((ov (make-overlay beg end)))
(overlay-put ov 'face (or face 'secondary-selection))
- (remove-text-properties 0 (length string) '(face nil) string)
(org-overlay-display ov string face)
(push ov org-columns-overlays)
ov))
@@ -206,9 +210,7 @@ This is the compiled version of the format.")
(val (or (cdr ass) ""))
(modval
(cond
- ((and org-columns-modify-value-for-display-function
- (functionp
- org-columns-modify-value-for-display-function))
+ ((functionp org-columns-modify-value-for-display-function)
(funcall org-columns-modify-value-for-display-function
title val))
((equal property "ITEM") (org-columns-compact-links val))
@@ -220,7 +222,23 @@ This is the compiled version of the format.")
(org-columns-number-to-string
(funcall calc (org-columns-string-to-number val fm)) fm))))
(string
- (format f (org-columns-add-ellipses (or modval val) width)))
+ (format f
+ (let ((v (org-columns-add-ellipses
+ (or modval val) width)))
+ (cond
+ ((equal property "PRIORITY")
+ (propertize v 'face (org-get-priority-face val)))
+ ((equal property "TAGS")
+ (if (not org-tags-special-faces-re)
+ (propertize v 'face 'org-tag)
+ (replace-regexp-in-string
+ org-tags-special-faces-re
+ (lambda (m)
+ (propertize m 'face (org-get-tag-face m)))
+ v nil nil 1)))
+ ((equal property "TODO")
+ (propertize v 'face (org-get-todo-face val)))
+ (t v)))))
(ov (org-columns-new-overlay
(point) (1+ (point)) string (if dateline face1 face))))
(overlay-put ov 'keymap org-columns-map)
@@ -662,11 +680,14 @@ around it."
fmt))
(defun org-columns-goto-top-level ()
- (when (condition-case nil (org-back-to-heading) (error nil))
- (org-entry-get nil "COLUMNS" t))
- (if (marker-position org-entry-property-inherited-from)
- (move-marker org-columns-top-level-marker org-entry-property-inherited-from)
- (move-marker org-columns-top-level-marker (point))))
+ "Move to the beginning of the column view area.
+Also sets `org-columns-top-level-marker' to the new position."
+ (goto-char
+ (move-marker
+ org-columns-top-level-marker
+ (cond ((org-before-first-heading-p) (point-min))
+ ((org-entry-get nil "COLUMNS" t) org-entry-property-inherited-from)
+ (t (org-back-to-heading) (point))))))
;;;###autoload
(defun org-columns (&optional columns-fmt-string)
@@ -685,9 +706,8 @@ When COLUMNS-FMT-STRING is non-nil, use it as the column format."
(save-excursion
(save-restriction
(narrow-to-region
- org-columns-top-level-marker
- (or (ignore-errors (org-end-of-subtree t t)) (point-max)))
- (goto-char (point-min))
+ (point)
+ (if (org-at-heading-p) (org-end-of-subtree t t) (point-max)))
(when (assoc "CLOCKSUM" org-columns-current-fmt-compiled)
(org-clock-sum))
(when (assoc "CLOCKSUM_T" org-columns-current-fmt-compiled)
@@ -697,10 +717,9 @@ When COLUMNS-FMT-STRING is non-nil, use it as the column format."
(org-map-entries
(lambda ()
(cons (point)
- (mapcar
- (lambda (p)
- (cons p (org-entry-get nil p 'selective t)))
- column-names)))
+ (mapcar (lambda (p)
+ (cons p (org-columns--value p (point))))
+ column-names)))
nil nil (and org-columns-skip-archived-trees 'archive))))
(when cache
(org-set-local 'org-columns-current-maxwidths
@@ -1397,7 +1416,7 @@ and tailing newline characters."
(org-with-point-at m
(mapcar
(lambda (name)
- (let ((value (org-entry-get (point) name 'selective t)))
+ (let ((value (org-columns--value name (point))))
(cons
name
(if (and org-agenda-columns-add-appointments-to-effort-sum
diff --git a/lisp/org-compat.el b/lisp/org-compat.el
index a762b8e..d4dcdff 100644
--- a/lisp/org-compat.el
+++ b/lisp/org-compat.el
@@ -404,6 +404,10 @@ Pass BUFFER to the XEmacs version of `move-to-column'."
(unless (fboundp 'user-error)
(defalias 'user-error 'error))
+;; ‘format-message’ is available only from 25 on
+(unless (fboundp 'format-message)
+ (defalias 'format-message 'format))
+
;; `font-lock-ensure' is only available from 24.4.50 on
(unless (fboundp 'font-lock-ensure)
(defalias 'font-lock-ensure 'font-lock-fontify-buffer))
diff --git a/lisp/org-crypt.el b/lisp/org-crypt.el
index 46fd3e6..59804a5 100644
--- a/lisp/org-crypt.el
+++ b/lisp/org-crypt.el
@@ -1,6 +1,6 @@
;;; org-crypt.el --- Public key encryption for org-mode entries
-;; Copyright (C) 2007-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2015 Free Software Foundation, Inc.
;; Emacs Lisp Archive Entry
;; Filename: org-crypt.el
@@ -104,10 +104,10 @@ t : Disable auto-save-mode for the current buffer
nil : Leave auto-save-mode enabled.
This may cause data to be written to disk unencrypted!
-'ask : Ask user whether or not to disable auto-save-mode
+`ask' : Ask user whether or not to disable auto-save-mode
for the current buffer.
-'encrypt : Leave auto-save-mode enabled for the current buffer,
+`encrypt': Leave auto-save-mode enabled for the current buffer,
but automatically re-encrypt all decrypted entries
*before* auto-saving.
NOTE: This only works for entries which have a tag
@@ -133,9 +133,10 @@ See `org-crypt-disable-auto-save'."
(and
(eq org-crypt-disable-auto-save 'ask)
(y-or-n-p "org-decrypt: auto-save-mode may cause leakage. Disable it for current buffer? ")))
- (message (concat "org-decrypt: Disabling auto-save-mode for " (or (buffer-file-name) (current-buffer))))
- ; The argument to auto-save-mode has to be "-1", since
- ; giving a "nil" argument toggles instead of disabling.
+ (message "org-decrypt: Disabling auto-save-mode for %s"
+ (or (buffer-file-name) (current-buffer)))
+ ;; The argument to auto-save-mode has to be "-1", since
+ ;; giving a "nil" argument toggles instead of disabling.
(auto-save-mode -1))
((eq org-crypt-disable-auto-save nil)
(message "org-decrypt: Decrypting entry with auto-save-mode enabled. This may cause leakage."))
diff --git a/lisp/org-ctags.el b/lisp/org-ctags.el
index faf543b..e5435e3 100644
--- a/lisp/org-ctags.el
+++ b/lisp/org-ctags.el
@@ -1,6 +1,6 @@
;;; org-ctags.el - Integrate Emacs "tags" facility with org mode.
;;
-;; Copyright (C) 2007-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2015 Free Software Foundation, Inc.
;; Author: Paul Sexton <eeeickythump@gmail.com>
@@ -394,7 +394,8 @@ the new file."
(org-open-file filename t))
((or (eql create t)
(and (eql create 'ask)
- (y-or-n-p (format "File `%s.org' not found; create?" name))))
+ (y-or-n-p (format-message
+ "File `%s.org' not found; create?" name))))
(org-ctags-open-file filename name))
(t ;; File does not exist, and we don't want to create it.
nil))))
@@ -433,8 +434,8 @@ the heading a destination for the tag `NAME'."
"This function is intended to be used in ORG-OPEN-LINK-FUNCTIONS.
Wrapper for org-ctags-append-topic, which first asks the user if they want
to append a new topic."
- (if (y-or-n-p (format "Topic `%s' not found; append to end of buffer?"
- name))
+ (if (y-or-n-p (format-message
+ "Topic `%s' not found; append to end of buffer?" name))
(org-ctags-append-topic name narrowp)
nil))
@@ -455,7 +456,7 @@ to rebuild (update) the TAGS file."
Wrapper for org-ctags-rebuild-tags-file-then-find-tag."
(if (and (buffer-file-name)
(y-or-n-p
- (format
+ (format-message
"Tag `%s' not found. Rebuild table `%s/TAGS' and look again?"
name
(file-name-directory (buffer-file-name)))))
diff --git a/lisp/org-datetree.el b/lisp/org-datetree.el
index 0646c3b..a97a9d0 100644
--- a/lisp/org-datetree.el
+++ b/lisp/org-datetree.el
@@ -1,6 +1,6 @@
;;; org-datetree.el --- Create date entries in a tree
-;; Copyright (C) 2009-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2015 Free Software Foundation, Inc.
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
@@ -39,7 +39,8 @@ property (any value), the date tree will become a subtree under that entry,
so the base level will be properly adjusted.")
(defcustom org-datetree-add-timestamp nil
- "When non-nil, add a time stamp when create a datetree entry."
+ "When non-nil, add a time stamp matching date of entry.
+Added time stamp is active unless value is `inactive'."
:group 'org-capture
:version "24.3"
:type '(choice
@@ -53,23 +54,22 @@ so the base level will be properly adjusted.")
If KEEP-RESTRICTION is non-nil, do not widen the buffer.
When it is nil, the buffer will be widened to make sure an existing date
tree can be found."
- (let ((year (nth 2 date))
- (month (car date))
- (day (nth 1 date)))
- (org-set-local 'org-datetree-base-level 1)
- (or keep-restriction (widen))
- (goto-char (point-min))
- (save-restriction
- (when (re-search-forward "^[ \t]*:DATE_TREE:[ \t]+\\S-" nil t)
- (org-back-to-heading t)
+ (org-set-local 'org-datetree-base-level 1)
+ (or keep-restriction (widen))
+ (save-restriction
+ (let ((prop (org-find-property "DATE_TREE")))
+ (when prop
+ (goto-char prop)
(org-set-local 'org-datetree-base-level
- (org-get-valid-level (funcall outline-level) 1))
- (org-narrow-to-subtree))
- (goto-char (point-min))
+ (org-get-valid-level (org-current-level) 1))
+ (org-narrow-to-subtree)))
+ (goto-char (point-min))
+ (let ((year (nth 2 date))
+ (month (car date))
+ (day (nth 1 date)))
(org-datetree-find-year-create year)
(org-datetree-find-month-create year month)
- (org-datetree-find-day-create year month day)
- (goto-char (prog1 (point) (widen))))))
+ (org-datetree-find-day-create year month day))))
(defun org-datetree-find-year-create (year)
"Find the YEAR datetree or create it."
@@ -131,28 +131,30 @@ tree can be found."
(org-datetree-insert-line year month day)))))
(defun org-datetree-insert-line (year &optional month day)
- (let ((pos (point)) ts-type)
- (skip-chars-backward " \t\n")
- (delete-region (point) pos)
- (insert "\n" (make-string org-datetree-base-level ?*) " \n")
- (backward-char 1)
- (if month (org-do-demote))
- (if day (org-do-demote))
- (insert (format "%d" year))
- (when month
- (insert (format "-%02d" month))
- (if day
- (insert (format "-%02d %s"
- day (format-time-string
- "%A" (encode-time 0 0 0 day month year))))
- (insert (format " %s"
- (format-time-string
- "%B" (encode-time 0 0 0 1 month year))))))
- (when (and day (setq ts-type org-datetree-add-timestamp))
+ (delete-region (save-excursion (skip-chars-backward " \t\n") (point)) (point))
+ (insert "\n" (make-string org-datetree-base-level ?*) " \n")
+ (backward-char)
+ (when month (org-do-demote))
+ (when day (org-do-demote))
+ (insert (format "%d" year))
+ (when month
+ (insert
+ (format "-%02d" month)
+ (if day
+ (format "-%02d %s"
+ day
+ (format-time-string "%A" (encode-time 0 0 0 day month year)))
+ (format " %s"
+ (format-time-string "%B" (encode-time 0 0 0 1 month year))))))
+ (when (and day org-datetree-add-timestamp)
+ (save-excursion
(insert "\n")
(org-indent-line)
- (org-insert-time-stamp (encode-time 0 0 0 day month year) nil ts-type))
- (beginning-of-line 1)))
+ (org-insert-time-stamp
+ (encode-time 0 0 0 day month year)
+ nil
+ (eq org-datetree-add-timestamp 'inactive))))
+ (beginning-of-line))
(defun org-datetree-file-entry-under (txt date)
"Insert a node TXT into the date tree under DATE."
diff --git a/lisp/org-docview.el b/lisp/org-docview.el
index 479f4ff..e3bf5fd 100644
--- a/lisp/org-docview.el
+++ b/lisp/org-docview.el
@@ -61,7 +61,7 @@
(setq path (org-link-escape (expand-file-name path)))
(cond
((eq format 'html) (format "<a href=\"%s\">%s</a>" path desc))
- ((eq format 'latex) (format "\href{%s}{%s}" path desc))
+ ((eq format 'latex) (format "\\href{%s}{%s}" path desc))
((eq format 'ascii) (format "%s (%s)" desc path))
(t path)))))
diff --git a/lisp/org-element.el b/lisp/org-element.el
index c7e76e8..1fbedd1 100644
--- a/lisp/org-element.el
+++ b/lisp/org-element.el
@@ -3059,11 +3059,10 @@ Assume point is at the beginning of the link."
;; (e.g., insert [[shell:ls%20*.org]] instead of
;; [[shell:ls *.org]], which defeats Org's focus on
;; simplicity.
- (setq raw-link (org-translate-link
- (org-link-expand-abbrev
- (replace-regexp-in-string
- "[ \t]*\n[ \t]*" " "
- (org-match-string-no-properties 1)))))
+ (setq raw-link (org-link-expand-abbrev
+ (replace-regexp-in-string
+ "[ \t]*\n[ \t]*" " "
+ (org-match-string-no-properties 1))))
;; Determine TYPE of link and set PATH accordingly. According
;; to RFC 3986, remove whitespaces from URI in external links.
;; In internal ones, treat indentation as a single space.
@@ -3116,36 +3115,52 @@ Assume point is at the beginning of the link."
;; In any case, deduce end point after trailing white space from
;; LINK-END variable.
(save-excursion
- (setq post-blank (progn (goto-char link-end) (skip-chars-forward " \t"))
- end (point))
- ;; Special "file" type link processing. Extract opening
- ;; application and search option, if any. Also normalize URI.
- (when (string-match "\\`file\\(?:\\+\\(.+\\)\\)?\\'" type)
- (setq application (match-string 1 type) type "file")
- (when (string-match "::\\(.*\\)\\'" path)
- (setq search-option (match-string 1 path)
- path (replace-match "" nil nil path)))
- (setq path (replace-regexp-in-string "\\`/+" "/" path)))
- (list 'link
- (list :type type
- :path path
- :raw-link (or raw-link path)
- :application application
- :search-option search-option
- :begin begin
- :end end
- :contents-begin contents-begin
- :contents-end contents-end
- :post-blank post-blank))))))
+ (setq post-blank
+ (progn (goto-char link-end) (skip-chars-forward " \t")))
+ (setq end (point)))
+ ;; Special "file" type link processing. Extract opening
+ ;; application and search option, if any. Also normalize URI.
+ (when (string-match "\\`file\\(?:\\+\\(.+\\)\\)?\\'" type)
+ (setq application (match-string 1 type) type "file")
+ (when (string-match "::\\(.*\\)\\'" path)
+ (setq search-option (match-string 1 path))
+ (setq path (replace-match "" nil nil path)))
+ (setq path (replace-regexp-in-string "\\`///+" "/" path)))
+ ;; Translate link, if `org-link-translation-function' is set.
+ (let ((trans (and (functionp org-link-translation-function)
+ (funcall org-link-translation-function type path))))
+ (when trans
+ (setq type (car trans))
+ (setq path (cdr trans))))
+ (list 'link
+ (list :type type
+ :path path
+ :raw-link (or raw-link path)
+ :application application
+ :search-option search-option
+ :begin begin
+ :end end
+ :contents-begin contents-begin
+ :contents-end contents-end
+ :post-blank post-blank)))))
(defun org-element-link-interpreter (link contents)
"Interpret LINK object as Org syntax.
CONTENTS is the contents of the object, or nil."
(let ((type (org-element-property :type link))
- (raw-link (org-element-property :raw-link link)))
- (if (string= type "radio") raw-link
+ (path (org-element-property :path link)))
+ (if (string= type "radio") path
(format "[[%s]%s]"
- raw-link
+ (cond ((string= type "coderef") (format "(%s)" path))
+ ((string= type "custom-id") (concat "#" path))
+ ((string= type "file")
+ (let ((app (org-element-property :application link))
+ (opt (org-element-property :search-option link)))
+ (concat type (and app (concat "+" app)) ":"
+ path
+ (and opt (concat "::" opt)))))
+ ((string= type "fuzzy") path)
+ (t (concat type ":" path)))
(if contents (format "[%s]" contents) "")))))
@@ -3866,8 +3881,9 @@ position of point and CDR is nil."
(and dualp
(let ((sec (org-match-string-no-properties 2)))
(if (or (not sec) (not parsedp)) sec
- (org-element--parse-objects
- (match-beginning 2) (match-end 2) nil restrict)))))
+ (save-match-data
+ (org-element--parse-objects
+ (match-beginning 2) (match-end 2) nil restrict))))))
;; Attribute a property name to KWD.
(kwd-sym (and kwd (intern (concat ":" (downcase kwd))))))
;; Now set final shape for VALUE.
@@ -4026,30 +4042,30 @@ Assuming TREE is a variable containing an Org buffer parse tree,
the following example will return a flat list of all `src-block'
and `example-block' elements in it:
- \(org-element-map tree '(example-block src-block) #'identity)
+ (org-element-map tree \\='(example-block src-block) #\\='identity)
The following snippet will find the first headline with a level
of 1 and a \"phone\" tag, and will return its beginning position:
- \(org-element-map tree 'headline
- \(lambda (hl)
- \(and (= (org-element-property :level hl) 1)
- \(member \"phone\" (org-element-property :tags hl))
- \(org-element-property :begin hl)))
+ (org-element-map tree \\='headline
+ (lambda (hl)
+ (and (= (org-element-property :level hl) 1)
+ (member \"phone\" (org-element-property :tags hl))
+ (org-element-property :begin hl)))
nil t)
The next example will return a flat list of all `plain-list' type
elements in TREE that are not a sub-list themselves:
- \(org-element-map tree 'plain-list #'identity nil nil 'plain-list)
+ (org-element-map tree \\='plain-list #\\='identity nil nil \\='plain-list)
Eventually, this example will return a flat list of all `bold'
type objects containing a `latex-snippet' type object, even
looking into captions:
- \(org-element-map tree 'bold
- \(lambda (b)
- \(and (org-element-map b 'latex-snippet #'identity nil t) b))
+ (org-element-map tree \\='bold
+ (lambda (b)
+ (and (org-element-map b \\='latex-snippet #\\='identity nil t) b))
nil nil nil t)"
;; Ensure TYPES and NO-RECURSION are a list, even of one element.
(let* ((types (if (listp types) types (list types)))
@@ -4888,6 +4904,7 @@ This function assumes `org-element--cache' is a valid AVL tree."
(defsubst org-element--cache-active-p ()
"Non-nil when cache is active in current buffer."
(and org-element-use-cache
+ org-element--cache
(or (derived-mode-p 'org-mode) orgstruct-mode)))
(defun org-element--cache-find (pos &optional side)
@@ -5600,7 +5617,8 @@ buffers."
(interactive "P")
(dolist (buffer (if all (buffer-list) (list (current-buffer))))
(with-current-buffer buffer
- (when (org-element--cache-active-p)
+ (when (and org-element-use-cache
+ (or (derived-mode-p 'org-mode) orgstruct-mode))
(org-set-local 'org-element--cache
(avl-tree-create #'org-element--cache-compare))
(org-set-local 'org-element--cache-objects (make-hash-table :test #'eq))
diff --git a/lisp/org-entities.el b/lisp/org-entities.el
index f0f7b54..112088d 100644
--- a/lisp/org-entities.el
+++ b/lisp/org-entities.el
@@ -326,7 +326,7 @@ packages to be loaded, add these packages to `org-latex-packages-alist'."
("deg" "\\textdegree{}" nil "&deg;" "degree" "°" "°")
("prime" "\\prime" t "&prime;" "'" "'" "′")
("Prime" "\\prime{}\\prime" t "&Prime;" "''" "''" "″")
- ("infin" "\\propto" t "&infin;" "[infinity]" "[infinity]" "∞")
+ ("infin" "\\infty" t "&infin;" "[infinity]" "[infinity]" "∞")
("infty" "\\infty" t "&infin;" "[infinity]" "[infinity]" "∞")
("prop" "\\propto" t "&prop;" "[proportional to]" "[proportional to]" "∝")
("propto" "\\propto" t "&prop;" "[proportional to]" "[proportional to]" "∝")
@@ -361,8 +361,8 @@ packages to be loaded, add these packages to `org-latex-packages-alist'."
("lessgtr" "\\lessgtr" t "&lessgtr;" "[less than or greater than]" "[less than or greater than]" "≶")
("lesseqgtr" "\\lesseqgtr" t "&lesseqgtr;" "[less than or equal or greater than or equal]" "[less than or equal or greater than or equal]" "⋚")
("ll" "\\ll" t "&Lt;" "<<" "<<" "≪")
- ("Ll" "\lll" t "&Ll;" "<<<" "<<<" "⋘")
- ("lll" "\lll" t "&Ll;" "<<<" "<<<" "⋘")
+ ("Ll" "\\lll" t "&Ll;" "<<<" "<<<" "⋘")
+ ("lll" "\\lll" t "&Ll;" "<<<" "<<<" "⋘")
("gg" "\\gg" t "&Gt;" ">>" ">>" "≫")
("Gg" "\\ggg" t "&Gg;" ">>>" ">>>" "⋙")
("ggg" "\\ggg" t "&Gg;" ">>>" ">>>" "⋙")
diff --git a/lisp/org-eshell.el b/lisp/org-eshell.el
index 1256bc3..115b333 100644
--- a/lisp/org-eshell.el
+++ b/lisp/org-eshell.el
@@ -1,6 +1,6 @@
;;; org-eshell.el - Support for links to working directories in eshell
-;; Copyright (C) 2011-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2011-2015 Free Software Foundation, Inc.
;; Author: Konrad Hinsen <konrad.hinsen AT fastmail.net>
diff --git a/lisp/org-faces.el b/lisp/org-faces.el
index 36f810e..0a1ce1d 100644
--- a/lisp/org-faces.el
+++ b/lisp/org-faces.el
@@ -1,6 +1,6 @@
;;; org-faces.el --- Face definitions for Org-mode.
-;; Copyright (C) 2004-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2004-2015 Free Software Foundation, Inc.
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
@@ -669,7 +669,7 @@ which days belong to the weekend."
(0.0 . default))
"Faces for showing deadlines in the agenda.
This is a list of cons cells. The cdr of each cell is a face to be used,
-and it can also just be like '(:foreground \"yellow\").
+and it can also just be like \\='(:foreground \"yellow\").
Each car is a fraction of the head-warning time that must have passed for
this the face in the cdr to be used for display. The numbers must be
given in descending order. The head-warning time is normally taken
diff --git a/lisp/org-feed.el b/lisp/org-feed.el
index 71a424f..6990e75 100644
--- a/lisp/org-feed.el
+++ b/lisp/org-feed.el
@@ -1,6 +1,6 @@
;;; org-feed.el --- Add RSS feed items to Org files
;;
-;; Copyright (C) 2009-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2015 Free Software Foundation, Inc.
;;
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
@@ -690,7 +690,8 @@ formatted as a string, not the original XML data."
(xml-node-children content)))))
(t
(setq entry (plist-put entry :description
- (format "Unknown '%s' content." type)))))))
+ (format-message
+ "Unknown `%s' content." type)))))))
entry))
(provide 'org-feed)
diff --git a/lisp/org-footnote.el b/lisp/org-footnote.el
index 7396609..10e95ee 100644
--- a/lisp/org-footnote.el
+++ b/lisp/org-footnote.el
@@ -387,7 +387,7 @@ value if point was successfully moved."
(user-error "Definition is outside narrowed part of buffer")))
(org-mark-ring-push)
(goto-char def-start)
- (looking-at (format "\\[%s[]:]" label))
+ (looking-at (format "\\[%s[]:] ?" label))
(goto-char (match-end 0))
(org-show-context 'link-search)
(when (derived-mode-p 'org-mode)
@@ -552,13 +552,19 @@ or new, let the user edit the definition of the footnote."
(org-footnote-auto-adjust-maybe))
(t
(insert "[" label "]")
- (let ((l (copy-marker (org-footnote-create-definition label))))
- (org-footnote-auto-adjust-maybe)
- (or (ignore-errors (org-footnote-goto-definition label l))
- ;; Since definition was created outside current
- ;; scope, edit it remotely.
- (progn (set-marker l nil)
- (org-edit-footnote-reference))))))))
+ (let ((p (org-footnote-create-definition label)))
+ ;; `org-footnote-goto-definition' needs to be called
+ ;; after `org-footnote-auto-adjust-maybe'. Otherwise
+ ;; both label and location of the definition are lost.
+ ;; On the contrary, it needs to be called before
+ ;; `org-edit-footnote-reference' so that the remote
+ ;; editing buffer can display the correct label.
+ (if (ignore-errors (org-footnote-goto-definition label p))
+ (org-footnote-auto-adjust-maybe)
+ ;; Definition was created outside current scope: edit
+ ;; it remotely.
+ (org-footnote-auto-adjust-maybe)
+ (org-edit-footnote-reference)))))))
(defvar org-blank-before-new-entry) ; Silence byte-compiler.
(defun org-footnote-create-definition (label)
@@ -655,6 +661,14 @@ offer additional commands in a menu."
(let* ((context (and (not special) (org-element-context)))
(type (org-element-type context)))
(cond
+ ;; On white space after element, insert a new footnote.
+ ((and context
+ (> (point)
+ (save-excursion
+ (goto-char (org-element-property :end context))
+ (skip-chars-backward " \t")
+ (point))))
+ (org-footnote-new))
((eq type 'footnote-reference)
(let ((label (org-element-property :label context)))
(cond
diff --git a/lisp/org-gnus.el b/lisp/org-gnus.el
index c0087a1..c7b46af 100644
--- a/lisp/org-gnus.el
+++ b/lisp/org-gnus.el
@@ -1,6 +1,6 @@
;;; org-gnus.el --- Support for links to Gnus groups and messages from within Org-mode
-;; Copyright (C) 2004-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2004-2015 Free Software Foundation, Inc.
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Tassilo Horn <tassilo at member dot fsf dot org>
@@ -295,7 +295,7 @@ If `org-store-link' was called with a prefix arg the meaning of
(group (gnus-group-jump-to-group group))))
(defun org-gnus-no-new-news ()
- "Like `M-x gnus' but doesn't check for new news."
+ "Like `\\[gnus]' but doesn't check for new news."
(if (not (gnus-alive-p)) (if org-gnus-no-server (gnus-no-server) (gnus))))
(provide 'org-gnus)
diff --git a/lisp/org-habit.el b/lisp/org-habit.el
index 338aabc..69d1912 100644
--- a/lisp/org-habit.el
+++ b/lisp/org-habit.el
@@ -181,7 +181,7 @@ This list represents a \"habit\" for the rest of this module."
(error "Habit %s has no scheduled date" habit-entry))
(unless scheduled-repeat
(error
- "Habit '%s' has no scheduled repeat period or has an incorrect one"
+ "Habit `%s' has no scheduled repeat period or has an incorrect one"
habit-entry))
(setq sr-days (org-habit-duration-to-days scheduled-repeat)
sr-type (progn (string-match "[\\.+]?\\+" scheduled-repeat)
diff --git a/lisp/org-id.el b/lisp/org-id.el
index fdd0ff0..f86ef22 100644
--- a/lisp/org-id.el
+++ b/lisp/org-id.el
@@ -1,6 +1,6 @@
;;; org-id.el --- Global identifiers for Org-mode entries
;;
-;; Copyright (C) 2008-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2015 Free Software Foundation, Inc.
;;
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
@@ -87,6 +87,7 @@
'org-link-to-org-use-id 'org-id-link-to-org-use-id "24.3")
(defcustom org-id-link-to-org-use-id nil
"Non-nil means storing a link to an Org file will use entry IDs.
+\\<org-mode-map>\
The variable can have the following values:
@@ -101,7 +102,7 @@ create-if-interactive
call `org-capture' that automatically and preemptively creates a
link. If you do want to get an ID link in a capture template to
an entry not having an ID, create it first by explicitly creating
- a link to it, using `C-c C-l' first.
+ a link to it, using `\\[org-insert-link]' first.
create-if-interactive-and-no-custom-id
Like create-if-interactive, but do not create an ID if there is
diff --git a/lisp/org-indent.el b/lisp/org-indent.el
index fa5f060..197042d 100644
--- a/lisp/org-indent.el
+++ b/lisp/org-indent.el
@@ -1,5 +1,5 @@
;;; org-indent.el --- Dynamic indentation for Org-mode
-;; Copyright (C) 2009-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2015 Free Software Foundation, Inc.
;;
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
@@ -52,20 +52,6 @@
:tag "Org Indent"
:group 'org)
-(defconst org-indent-max 40
- "Maximum indentation in characters.")
-(defconst org-indent-max-levels 20
- "Maximum added level through virtual indentation, in characters.
-
-It is computed by multiplying `org-indent-indentation-per-level'
-minus one by actual level of the headline minus one.")
-
-(defvar org-indent-strings nil
- "Vector with all indentation strings.
-It will be set in `org-indent-initialize'.")
-(defvar org-indent-stars nil
- "Vector with all indentation star strings.
-It will be set in `org-indent-initialize'.")
(defvar org-indent-inlinetask-first-star (org-add-props "*" '(face org-warning))
"First star of inline tasks, with correct face.")
(defvar org-indent-agent-timer nil
@@ -92,15 +78,12 @@ This is used locally in each buffer being initialized.")
It is modified by `org-indent-notify-modified-headline'.")
-(defcustom org-indent-boundary-char ?\ ; comment to protect space char
+(defcustom org-indent-boundary-char ?\s
"The end of the virtual indentation strings, a single-character string.
The default is just a space, but if you wish, you can use \"|\" or so.
This can be useful on a terminal window - under a windowing system,
-it may be prettier to customize the org-indent face."
+it may be prettier to customize the `org-indent' face."
:group 'org-indent
- :set (lambda (var val)
- (set var val)
- (and org-indent-strings (org-indent-initialize)))
:type 'character)
(defcustom org-indent-mode-turns-off-org-adapt-indentation t
@@ -121,30 +104,12 @@ turn on `org-hide-leading-stars'."
:group 'org-indent
:type 'integer)
-(defface org-indent
- (org-compatible-face nil nil)
+(defface org-indent '((t (:inherit org-hide)))
"Face for outline indentation.
The default is to make it look like whitespace. But you may find it
useful to make it ever so slightly different."
:group 'org-faces)
-(defun org-indent-initialize ()
- "Initialize the indentation strings."
- (setq org-indent-strings (make-vector (1+ org-indent-max) nil))
- (setq org-indent-stars (make-vector (1+ org-indent-max) nil))
- (aset org-indent-strings 0 nil)
- (aset org-indent-stars 0 nil)
- (loop for i from 1 to org-indent-max do
- (aset org-indent-strings i
- (org-add-props
- (concat (make-string (1- i) ?\ )
- (char-to-string org-indent-boundary-char))
- nil 'face 'org-indent)))
- (loop for i from 1 to org-indent-max-levels do
- (aset org-indent-stars i
- (org-add-props (make-string i ?*)
- nil 'face 'org-hide))))
-
(defsubst org-indent-remove-properties (beg end)
"Remove indentations between BEG and END."
(org-with-silent-modifications
@@ -174,7 +139,6 @@ during idle time."
(org-indent-mode
;; mode was turned on.
(org-set-local 'indent-tabs-mode nil)
- (or org-indent-strings (org-indent-initialize))
(org-set-local 'org-indent-initial-marker (copy-marker 1))
(when org-indent-mode-turns-off-org-adapt-indentation
(org-set-local 'org-adapt-indentation nil))
@@ -281,34 +245,41 @@ a time value."
(setq org-indent-agentized-buffers
(delq buffer org-indent-agentized-buffers))))))))
-(defsubst org-indent-set-line-properties (l w h)
+(defun org-indent-set-line-properties (level indentation &optional heading)
"Set prefix properties on current line an move to next one.
-Prefix properties `line-prefix' and `wrap-prefix' in current line
-are set to, respectively, length L and W.
-
-If H is non-nil, `line-prefix' will be starred. If H is
-`inline', the first star will have `org-warning' face.
-
-Assume point is at beginning of line."
- (let ((line (cond
- ((eq 'inline h)
- (let ((stars (aref org-indent-stars
- (min l org-indent-max-levels))))
- (and stars
- (if (org-bound-and-true-p org-inlinetask-show-first-star)
- (concat org-indent-inlinetask-first-star
- (substring stars 1))
- stars))))
- (h (aref org-indent-stars
- (min l org-indent-max-levels)))
- (t (aref org-indent-strings
- (min l org-indent-max)))))
- (wrap (aref org-indent-strings (min w org-indent-max))))
+LEVEL is the current level of heading. INDENTATION is the
+expected indentation when wrapping line.
+
+When optional argument HEADING is non-nil, assume line is at
+a heading. Moreover, if is is `inlinetask', the first star will
+have `org-warning' face."
+ (let* ((stars (if (<= level 1) ""
+ (make-string (* (1- org-indent-indentation-per-level)
+ (1- level))
+ ?*)))
+ (line
+ (cond
+ ((and (org-bound-and-true-p org-inlinetask-show-first-star)
+ (eq heading 'inlinetask))
+ (concat org-indent-inlinetask-first-star
+ (org-add-props (substring stars 1) nil 'face 'org-hide)))
+ (heading (org-add-props stars nil 'face 'org-hide))
+ (t (concat (org-add-props (concat stars (make-string level ?*))
+ nil 'face 'org-indent)
+ (and (> level 0)
+ (char-to-string org-indent-boundary-char))))))
+ (wrap
+ (org-add-props
+ (concat stars
+ (make-string level ?*)
+ (if heading " "
+ (make-string (+ indentation (min level 1)) ?\s)))
+ nil 'face 'org-indent)))
;; Add properties down to the next line to indent empty lines.
- (add-text-properties (point) (min (1+ (point-at-eol)) (point-max))
+ (add-text-properties (line-beginning-position) (line-beginning-position 2)
`(line-prefix ,line wrap-prefix ,wrap)))
- (forward-line 1))
+ (forward-line))
(defun org-indent-add-properties (beg end &optional delay)
"Add indentation properties between BEG and END.
@@ -322,26 +293,14 @@ stopped."
(org-with-wide-buffer
(goto-char beg)
(beginning-of-line)
- ;; 1. Initialize prefix at BEG. This is done by storing two
- ;; variables: INLINE-PF and PF, representing respectively
- ;; length of current `line-prefix' when line is inside an
- ;; inline task or not.
+ ;; Initialize prefix at BEG, according to current entry's level.
(let* ((case-fold-search t)
(limited-re (org-get-limited-outline-regexp))
- (added-ind-per-lvl (abs (1- org-indent-indentation-per-level)))
- (pf (save-excursion
- (and (ignore-errors (let ((outline-regexp limited-re))
- (org-back-to-heading t)))
- (+ (* org-indent-indentation-per-level
- (- (match-end 0) (match-beginning 0) 2)) 2))))
- (pf-inline (and (featurep 'org-inlinetask)
- (org-inlinetask-in-task-p)
- (+ (* org-indent-indentation-per-level
- (1- (org-inlinetask-get-task-level))) 2)))
+ (level (or (org-current-level) 0))
(time-limit (and delay (time-add (current-time) delay))))
- ;; 2. For each line, set `line-prefix' and `wrap-prefix'
- ;; properties depending on the type of line (headline,
- ;; inline task, item or other).
+ ;; For each line, set `line-prefix' and `wrap-prefix'
+ ;; properties depending on the type of line (headline, inline
+ ;; task, item or other).
(org-with-silent-modifications
(while (and (<= (point) end) (not (eobp)))
(cond
@@ -354,38 +313,23 @@ stopped."
((and delay (time-less-p time-limit (current-time)))
(setq org-indent-agent-resume-timer
(run-with-idle-timer
- (time-add (current-idle-time)
- org-indent-agent-resume-delay)
+ (time-add (current-idle-time) org-indent-agent-resume-delay)
nil #'org-indent-initialize-agent))
(throw 'interrupt (point)))
;; Headline or inline task.
((looking-at org-outline-regexp)
(let* ((nstars (- (match-end 0) (match-beginning 0) 1))
- (line (* added-ind-per-lvl (1- nstars)))
- (wrap (+ line (1+ nstars))))
- (cond
- ;; Headline: new value for PF.
- ((looking-at limited-re)
- (org-indent-set-line-properties line wrap t)
- (setq pf wrap))
- ;; End of inline task: PF-INLINE is now nil.
- ((looking-at "\\*+ end[ \t]*$")
- (org-indent-set-line-properties line wrap 'inline)
- (setq pf-inline nil))
- ;; Start of inline task. Determine if it contains
- ;; text, or if it is only one line long. Set
- ;; PF-INLINE accordingly.
- (t (org-indent-set-line-properties line wrap 'inline)
- (setq pf-inline (and (org-inlinetask-in-task-p) wrap))))))
+ (type (or (org-looking-at-p limited-re) 'inlinetask)))
+ (org-indent-set-line-properties nstars 0 type)
+ ;; At an headline, define new value for LEVEL.
+ (unless (eq type 'inlinetask) (setq level nstars))))
;; List item: `wrap-prefix' is set where body starts.
((org-at-item-p)
- (let* ((line (or pf-inline pf 0))
- (wrap (+ (org-list-item-body-column (point)) line)))
- (org-indent-set-line-properties line wrap nil)))
- ;; Normal line: use PF-INLINE, PF or nil as prefixes.
- (t (let* ((line (or pf-inline pf 0))
- (wrap (+ line (org-get-indentation))))
- (org-indent-set-line-properties line wrap nil))))))))))
+ (org-indent-set-line-properties
+ level (org-list-item-body-column (point))))
+ ;; Regular line.
+ (t
+ (org-indent-set-line-properties level (org-get-indentation))))))))))
(defun org-indent-notify-modified-headline (beg end)
"Set `org-indent-modified-headline-flag' depending on context.
diff --git a/lisp/org-info.el b/lisp/org-info.el
index b7c9466..b9f7ba0 100644
--- a/lisp/org-info.el
+++ b/lisp/org-info.el
@@ -1,6 +1,6 @@
;;; org-info.el --- Support for links to Info nodes from within Org-Mode
-;; Copyright (C) 2004-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2004-2015 Free Software Foundation, Inc.
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
diff --git a/lisp/org-inlinetask.el b/lisp/org-inlinetask.el
index 75654b4..7e15b44 100644
--- a/lisp/org-inlinetask.el
+++ b/lisp/org-inlinetask.el
@@ -1,6 +1,6 @@
;;; org-inlinetask.el --- Tasks independent of outline hierarchy
-;; Copyright (C) 2009-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2015 Free Software Foundation, Inc.
;;
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
diff --git a/lisp/org-irc.el b/lisp/org-irc.el
index 8f9761b..1ec69d8 100644
--- a/lisp/org-irc.el
+++ b/lisp/org-irc.el
@@ -1,6 +1,6 @@
;;; org-irc.el --- Store links to IRC sessions
;;
-;; Copyright (C) 2008-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2015 Free Software Foundation, Inc.
;;
;; Author: Philip Jackson <emacs@shellarchive.co.uk>
;; Keywords: erc, irc, link, org
@@ -108,7 +108,7 @@ attributes that are found."
(defun org-irc-ellipsify-description (string &optional after)
"Remove unnecessary white space from STRING and add ellipses if necessary.
Strip starting and ending white space from STRING and replace any
-chars that the value AFTER with '...'"
+chars that the value AFTER with `...'"
(let* ((after (number-to-string (or after 30)))
(replace-map (list (cons "^[ \t]*" "")
(cons "[ \t]*$" "")
@@ -172,7 +172,7 @@ the session itself."
(org-store-link-props
:type "irc"
:link (concat "irc:/" link-text)
- :description (concat "irc session '" link-text "'")
+ :description (concat "irc session `" link-text "'")
:server (car (car link))
:port (or (string-to-number (cadr (pop link))) erc-default-port)
:nick (pop link))
diff --git a/lisp/org-list.el b/lisp/org-list.el
index b23f49b..d7369ad 100644
--- a/lisp/org-list.el
+++ b/lisp/org-list.el
@@ -176,7 +176,7 @@ to the bullet that should be used when this item is demoted.
For example,
(setq org-list-demote-modify-bullet
- '((\"+\" . \"-\") (\"-\" . \"+\") (\"*\" . \"+\")))
+ \\='((\"+\" . \"-\") (\"-\" . \"+\") (\"*\" . \"+\")))
will make
@@ -622,11 +622,11 @@ point-at-bol:
will get the following structure:
-\(\(1 0 \"- \" nil \"[X]\" nil 97\)
- \(18 2 \"1. \" nil nil nil 34\)
- \(34 2 \"5. \" \"5\" nil nil 55\)
- \(97 0 \"- \" nil nil nil 131\)
- \(109 2 \"+ \" nil nil \"tag\" 131\)
+ ((1 0 \"- \" nil \"[X]\" nil 97)
+ (18 2 \"1. \" nil nil nil 34)
+ (34 2 \"5. \" \"5\" nil nil 55)
+ (97 0 \"- \" nil nil nil 131)
+ (109 2 \"+ \" nil nil \"tag\" 131))
Assume point is at an item."
(save-excursion
@@ -2036,7 +2036,7 @@ previous item, plus ARGS extra arguments.
FUNCTION is applied on items in reverse order.
-As an example, \(org-apply-on-list \(lambda \(result\) \(1+ result\)\) 0\)
+As an example, \(org-apply-on-list \(lambda \(result) \(1+ result)) 0)
will return the number of items in the current list.
Sublists of the list are skipped. Cursor is always at the
@@ -2527,17 +2527,20 @@ With optional prefix argument ALL, do this for the whole buffer."
(let* ((container
(org-element-lineage
context
- '(drawer center-block dynamic-block inlinetask plain-list
+ '(drawer center-block dynamic-block inlinetask item
quote-block special-block verse-block)))
- (beg (if container (org-element-property :begin container)
+ (beg (if container
+ (org-element-property :contents-begin container)
(save-excursion
- (org-with-limited-levels (outline-previous-heading))
+ (org-with-limited-levels
+ (outline-previous-heading))
(point)))))
(or (cdr (assq beg cache))
(save-excursion
(goto-char beg)
(let ((end
- (if container (org-element-property :end container)
+ (if container
+ (org-element-property :contents-end container)
(save-excursion
(org-with-limited-levels (outline-next-heading))
(point))))
@@ -2547,18 +2550,21 @@ With optional prefix argument ALL, do this for the whole buffer."
(when (eq (org-element-type element) 'item)
(push (org-element-property :structure element)
structs)
- (goto-char (org-element-property
- :end
- (org-element-property :parent
- element))))))
+ ;; Skip whole list since we have its
+ ;; structure anyway.
+ (while (setq element (org-element-lineage
+ element '(plain-list)))
+ (goto-char
+ (min (org-element-property :end element)
+ end))))))
;; Cache count for cookies applying to the same
;; area. Then return it.
(let ((count
(funcall count-boxes
(and (eq (org-element-type container)
- 'plain-list)
+ 'item)
(org-element-property
- :contents-begin container))
+ :begin container))
structs
recursivep)))
(push (cons beg count) cache)
@@ -2946,13 +2952,13 @@ For example, the following list:
will be parsed as:
-\(ordered
- \(nil \"first item\"
- \(unordered
- \(nil \"sub-item one\"\)
- \(nil \"[CBON] sub-item two\"\)\)
- \"more text in first item\"\)
- \(3 \"last item\"\)\)
+ (ordered
+ (nil \"first item\"
+ (unordered
+ (nil \"sub-item one\")
+ (nil \"[CBON] sub-item two\"))
+ \"more text in first item\")
+ (3 \"last item\"))
Point is left at list end."
(defvar parse-item) ;FIXME: Or use `cl-labels' or `letrec'.
diff --git a/lisp/org-loaddefs.el b/lisp/org-loaddefs.el
index a05f6ed..cfd12fb 100644
--- a/lisp/org-loaddefs.el
+++ b/lisp/org-loaddefs.el
@@ -14,7 +14,7 @@
;;;;;; org-babel-execute-src-block org-babel-pop-to-session-maybe
;;;;;; org-babel-load-in-session-maybe org-babel-expand-src-block-maybe
;;;;;; org-babel-view-src-block-info org-babel-execute-maybe org-babel-execute-safely-maybe)
-;;;;;; "ob-core" "ob-core.el" "27b1718c5a3754547f6de3163c7729c5")
+;;;;;; "ob-core" "ob-core.el" "83c23eb7ea9b45eb61844eb96a1e0499")
;;; Generated autoloads from ob-core.el
(autoload 'org-babel-execute-safely-maybe "ob-core" "\
@@ -235,7 +235,7 @@ Mark current src block.
;;;***
;;;### (autoloads (org-babel-describe-bindings) "ob-keys" "ob-keys.el"
-;;;;;; "1fce4dfc8c9bc9770247390ec93adcef")
+;;;;;; "120511b104b79537595411024cdbd951")
;;; Generated autoloads from ob-keys.el
(autoload 'org-babel-describe-bindings "ob-keys" "\
@@ -246,7 +246,7 @@ Describe all keybindings behind `org-babel-key-prefix'.
;;;***
;;;### (autoloads (org-babel-lob-get-info org-babel-lob-execute-maybe)
-;;;;;; "ob-lob" "ob-lob.el" "dc5eea39f8ebcd4f8965f663f02abfa9")
+;;;;;; "ob-lob" "ob-lob.el" "4c4edc59eb6dd8eafc0568bed1be0cbe")
;;; Generated autoloads from ob-lob.el
(autoload 'org-babel-lob-execute-maybe "ob-lob" "\
@@ -264,7 +264,7 @@ Return a Library of Babel function call as a string.
;;;***
;;;### (autoloads (org-babel-tangle org-babel-tangle-file) "ob-tangle"
-;;;;;; "ob-tangle.el" "c9a4c888ee47a00c4b16e7c06a9da2fb")
+;;;;;; "ob-tangle.el" "dacdacb67ec6b7ce5a3ca79dfe9aa403")
;;; Generated autoloads from ob-tangle.el
(autoload 'org-babel-tangle-file "ob-tangle" "\
@@ -298,7 +298,7 @@ used to limit the exported source code blocks by language.
;;;;;; org-search-view org-agenda-list org-batch-store-agenda-views
;;;;;; org-store-agenda-views org-batch-agenda-csv org-batch-agenda
;;;;;; org-agenda org-toggle-sticky-agenda) "org-agenda" "org-agenda.el"
-;;;;;; (21953 39595))
+;;;;;; (22026 7479))
;;; Generated autoloads from org-agenda.el
(autoload 'org-toggle-sticky-agenda "org-agenda" "\
@@ -523,7 +523,7 @@ Do we have a reason to ignore this TODO entry because it has a time stamp?
(autoload 'org-agenda-set-restriction-lock "org-agenda" "\
Set restriction lock for agenda, to current subtree or file.
Restriction will be the file if TYPE is `file', or if type is the
-universal prefix '(4), or if the cursor is before the first headline
+universal prefix \\='(4), or if the cursor is before the first headline
in the file. Otherwise, restriction will be to the current subtree.
\(fn &optional TYPE)" t nil)
@@ -550,9 +550,9 @@ calling the function returns nil. This function takes one
argument: an entry from `org-agenda-get-day-entries'.
FILTER can also be an alist with the car of each cell being
-either 'headline or 'category. For example:
+either `headline' or `category'. For example:
- '((headline \"IMPORTANT\")
+ \\='((headline \"IMPORTANT\")
(category \"Work\"))
will only add headlines containing IMPORTANT or headlines
@@ -574,7 +574,7 @@ to override `appt-message-warning-time'.
;;;### (autoloads (org-archive-subtree-default-with-confirmation
;;;;;; org-archive-subtree-default org-toggle-archive-tag org-archive-to-archive-sibling
;;;;;; org-archive-subtree org-add-archive-files) "org-archive"
-;;;;;; "org-archive.el" "dd008794802cf282283f2eaea0be6472")
+;;;;;; "org-archive.el" "3d45871a918bccfda0ed5aa8ce2828f8")
;;; Generated autoloads from org-archive.el
(autoload 'org-add-archive-files "org-archive" "\
@@ -629,7 +629,7 @@ This command is set with the variable `org-archive-default-command'.
;;;***
-;;;### (autoloads (org-attach) "org-attach" "org-attach.el" "87e6c32edc4111854e92b00480f6c067")
+;;;### (autoloads (org-attach) "org-attach" "org-attach.el" "02c6d147939c83c1311423492e8bbda3")
;;; Generated autoloads from org-attach.el
(autoload 'org-attach "org-attach" "\
@@ -641,7 +641,7 @@ Shows a list of commands and prompts for another key to execute a command.
;;;***
;;;### (autoloads (org-bbdb-anniversaries) "org-bbdb" "org-bbdb.el"
-;;;;;; "9c763cddfbb993fadd3201dfb83142cc")
+;;;;;; "7b7a2669c8c50375f19fac9b951a3cdc")
;;; Generated autoloads from org-bbdb.el
(autoload 'org-bbdb-anniversaries "org-bbdb" "\
@@ -652,8 +652,8 @@ Extract anniversaries from BBDB for display in the agenda.
;;;***
;;;### (autoloads (org-capture-import-remember-templates org-capture
-;;;;;; org-capture-string) "org-capture" "org-capture.el" (21953
-;;;;;; 39595))
+;;;;;; org-capture-string) "org-capture" "org-capture.el" (22016
+;;;;;; 58042))
;;; Generated autoloads from org-capture.el
(autoload 'org-capture-string "org-capture" "\
@@ -700,7 +700,7 @@ Set `org-capture-templates' to be similar to `org-remember-templates'.
;;;;;; org-clock-remove-overlays org-clock-display org-clock-sum
;;;;;; org-clock-goto org-clock-cancel org-clock-out org-clock-in-last
;;;;;; org-clock-in org-resolve-clocks) "org-clock" "org-clock.el"
-;;;;;; "31fb247d73be8ef0f10b058807e0f204")
+;;;;;; "2eb22f60f3e90e0c103ec1389f7da830")
;;; Generated autoloads from org-clock.el
(autoload 'org-resolve-clocks "org-clock" "\
@@ -832,7 +832,7 @@ Otherwise, return nil.
;;;### (autoloads (org-agenda-columns org-insert-columns-dblock org-dblock-write:columnview
;;;;;; org-columns-number-to-string org-columns-compute org-columns
;;;;;; org-columns-get-format-and-top-level org-columns-remove-overlays)
-;;;;;; "org-colview" "org-colview.el" (21953 39608))
+;;;;;; "org-colview" "org-colview.el" (21964 9912))
;;; Generated autoloads from org-colview.el
(autoload 'org-columns-remove-overlays "org-colview" "\
@@ -896,7 +896,7 @@ Turn on or update column view in the agenda.
;;;***
;;;### (autoloads (org-check-version) "org-compat" "org-compat.el"
-;;;;;; (21953 39595))
+;;;;;; (22016 58042))
;;; Generated autoloads from org-compat.el
(autoload 'org-check-version "org-compat" "\
@@ -907,7 +907,7 @@ Try very hard to provide sensible version strings.
;;;***
;;;### (autoloads (org-datetree-find-date-create) "org-datetree"
-;;;;;; "org-datetree.el" "448ccbc2749a60a5e276fc3c9a9c5605")
+;;;;;; "org-datetree.el" "f59e07b5e58409e8f540661bb1de0721")
;;; Generated autoloads from org-datetree.el
(autoload 'org-datetree-find-date-create "org-datetree" "\
@@ -922,7 +922,7 @@ tree can be found.
;;;### (autoloads (org-element-context org-element-at-point org-element-cache-refresh
;;;;;; org-element-cache-reset org-element-interpret-data org-element-update-syntax)
-;;;;;; "org-element" "org-element.el" "fb24e830f6df86a96975959e67d14086")
+;;;;;; "org-element" "org-element.el" "63ae8089b96f8937b454a2f868747ad3")
;;; Generated autoloads from org-element.el
(autoload 'org-element-update-syntax "org-element" "\
@@ -995,7 +995,7 @@ Providing it allows for quicker computation.
;;;***
;;;### (autoloads (org-feed-show-raw-feed org-feed-goto-inbox org-feed-update
-;;;;;; org-feed-update-all) "org-feed" "org-feed.el" "7276e68d6993fe39cd340cbd5af3faed")
+;;;;;; org-feed-update-all) "org-feed" "org-feed.el" "c83eadc8f56f6f3040b7535597a183db")
;;; Generated autoloads from org-feed.el
(autoload 'org-feed-update-all "org-feed" "\
@@ -1023,7 +1023,7 @@ Show the raw feed buffer of a feed.
;;;***
;;;### (autoloads (org-footnote-normalize org-footnote-action) "org-footnote"
-;;;;;; "org-footnote.el" "8993166fd3c05349a3031b75152b4ae4")
+;;;;;; "org-footnote.el" "69cb58a7f018fde2fd452ebca8ed0fc6")
;;; Generated autoloads from org-footnote.el
(autoload 'org-footnote-action "org-footnote" "\
@@ -1058,7 +1058,7 @@ referenced sequence.
;;;### (autoloads (org-id-store-link org-id-find-id-file org-id-update-id-locations
;;;;;; org-id-new org-id-find org-id-goto org-id-get-with-outline-drilling
;;;;;; org-id-get-with-outline-path-completion org-id-get org-id-copy
-;;;;;; org-id-get-create) "org-id" "org-id.el" "82e762bd5cca2e3d24252745fca306d7")
+;;;;;; org-id-get-create) "org-id" "org-id.el" "ac9eb6c84780e6492017c2d7326f3801")
;;; Generated autoloads from org-id.el
(autoload 'org-id-get-create "org-id" "\
@@ -1152,7 +1152,7 @@ Store a link to the current entry, using its ID.
;;;***
;;;### (autoloads (org-indent-mode) "org-indent" "org-indent.el"
-;;;;;; "3d658901e4f096f04688498e4a709eb5")
+;;;;;; "0a614b4056871d7fd7a5f3b89cbf801c")
;;; Generated autoloads from org-indent.el
(autoload 'org-indent-mode "org-indent" "\
@@ -1169,7 +1169,7 @@ during idle time.
;;;***
-;;;### (autoloads (org-irc-store-link) "org-irc" "org-irc.el" "2432d5cd8271c05b0e8778cd26bf11ab")
+;;;### (autoloads (org-irc-store-link) "org-irc" "org-irc.el" "e6ac5be44b417efe7e54a291ea8eb7a8")
;;; Generated autoloads from org-irc.el
(autoload 'org-irc-store-link "org-irc" "\
@@ -1180,7 +1180,7 @@ Dispatch to the appropriate function to store a link to an IRC session.
;;;***
;;;### (autoloads (org-load-noerror-mustsuffix) "org-macs" "org-macs.el"
-;;;;;; (21953 39595))
+;;;;;; (22016 58042))
;;; Generated autoloads from org-macs.el
(autoload 'org-load-noerror-mustsuffix "org-macs" "\
@@ -1191,7 +1191,7 @@ Load FILE with optional arguments NOERROR and MUSTSUFFIX. Drop the MUSTSUFFIX a
;;;***
;;;### (autoloads (org-mobile-pull org-mobile-push) "org-mobile"
-;;;;;; "org-mobile.el" "74e62a65b33ac841139cfd3f5e0b2607")
+;;;;;; "org-mobile.el" "fa167263b2f8f3a5352fc25dbe49b69b")
;;; Generated autoloads from org-mobile.el
(autoload 'org-mobile-push "org-mobile" "\
@@ -1210,7 +1210,7 @@ agenda view showing the flagged items.
;;;***
-;;;### (autoloads (org-plot/gnuplot) "org-plot" "org-plot.el" "d127faa9ca32ef2814c5542901d23e1b")
+;;;### (autoloads (org-plot/gnuplot) "org-plot" "org-plot.el" "f96ae5dc9400f35859c4d0c001fa4d74")
;;; Generated autoloads from org-plot.el
(autoload 'org-plot/gnuplot "org-plot" "\
@@ -1243,7 +1243,7 @@ line directly before or after the table.
;;;;;; org-table-begin org-table-align org-table-export org-table-import
;;;;;; org-table-convert-region org-table-create org-table-create-or-convert-from-region
;;;;;; org-table-create-with-table\.el) "org-table" "org-table.el"
-;;;;;; "3c552212688594ce7023f85d4896c1ce")
+;;;;;; "bcde30b64542d0ebe3c477feee93db48")
;;; Generated autoloads from org-table.el
(autoload 'org-table-create-with-table\.el "org-table" "\
@@ -1277,9 +1277,9 @@ slightly, to make sure a beginning of line in the first line is included.
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
+\(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 as field separator
regexp When a regular expression, use it to match the separator
nil When nil, the command tries to be smart and figure out the
@@ -1920,7 +1920,7 @@ characters width of the plot. ASK may also be the
;;;***
;;;### (autoloads (org-timer-set-timer org-timer-item org-timer-change-times-in-region
-;;;;;; org-timer org-timer-start) "org-timer" "org-timer.el" "9d49e9d50eb1f36a4ab176711617bb7c")
+;;;;;; org-timer org-timer-start) "org-timer" "org-timer.el" "c2c017e6e415e473788ee20d76f930de")
;;; Generated autoloads from org-timer.el
(autoload 'org-timer-start "org-timer" "\
@@ -1985,7 +1985,7 @@ using three `C-u' prefix arguments.
;;;***
;;;### (autoloads (org-git-version org-release) "org-version" "org-version.el"
-;;;;;; (21953 62521))
+;;;;;; (22026 39838))
;;; Generated autoloads from org-version.el
(autoload 'org-release "org-version" "\
@@ -2011,7 +2011,7 @@ The location of ODT styles.")
;;;;;; org-run-like-in-org-mode turn-on-orgstruct++ turn-on-orgstruct
;;;;;; orgstruct-mode org-global-cycle org-cycle org-mode org-clock-persistence-insinuate
;;;;;; turn-on-orgtbl org-version org-babel-load-file org-babel-do-load-languages)
-;;;;;; "org" "org.el" (21953 39608))
+;;;;;; "org" "org.el" (22026 7479))
;;; Generated autoloads from org.el
(autoload 'org-babel-do-load-languages "org" "\
@@ -2080,11 +2080,10 @@ in special contexts.
1. OVERVIEW: Show only top-level headlines.
2. CONTENTS: Show all headlines of all levels, but no body text.
3. SHOW ALL: Show everything.
- When called with two `C-u C-u' prefixes, switch to the startup visibility,
+ With a double \\[universal-argument] prefix argument, switch to the startup visibility,
determined by the variable `org-startup-folded', and by any VISIBILITY
properties in the buffer.
- When called with three `C-u C-u C-u' prefixed, show the entire buffer,
- including any drawers.
+ With a triple \\[universal-argument] prefix argument, show the entire buffer, including any drawers.
- When inside a table, re-align the table and move to the next field.
@@ -2113,7 +2112,7 @@ in special contexts.
- Special case: if point is at the beginning of the buffer and there is
no headline in line 1, this function will act as if called with prefix arg
- (C-u TAB, same as S-TAB) also when called without prefix arg.
+ (\\[universal-argument] TAB, same as S-TAB) also when called without prefix arg.
But only if also the variable `org-cycle-global-at-bob' is t.
\(fn &optional ARG)" t nil)
@@ -2475,7 +2474,7 @@ Return output file name.
;;;### (autoloads (org-html-publish-to-html org-html-export-to-html
;;;;;; org-html-convert-region-to-html org-html-export-as-html org-html-htmlize-generate-css)
-;;;;;; "ox-html" "ox-html.el" "5fc66ebdbfcdb365f9829aeee3ea9cdf")
+;;;;;; "ox-html" "ox-html.el" "9fb7643fff02146d2dc738be2ff135fd")
;;; Generated autoloads from ox-html.el
(put 'org-html-head-include-default-style 'safe-local-variable 'booleanp)
@@ -2583,7 +2582,7 @@ Return output file name.
;;;### (autoloads (org-icalendar-combine-agenda-files org-icalendar-export-agenda-files
;;;;;; org-icalendar-export-to-ics) "ox-icalendar" "ox-icalendar.el"
-;;;;;; "19a94da1c24f86d71442d4eddeca7bf6")
+;;;;;; "5426fe8de7686769a87909e9e5a99643")
;;; Generated autoloads from ox-icalendar.el
(autoload 'org-icalendar-export-to-ics "ox-icalendar" "\
@@ -2635,7 +2634,7 @@ The file is stored under the name chosen in
;;;### (autoloads (org-latex-publish-to-pdf org-latex-publish-to-latex
;;;;;; org-latex-export-to-pdf org-latex-export-to-latex org-latex-convert-region-to-latex
-;;;;;; org-latex-export-as-latex) "ox-latex" "ox-latex.el" "a0a2774cca9ba998c2c96498dc9c43e7")
+;;;;;; org-latex-export-as-latex) "ox-latex" "ox-latex.el" "5f41129e2e6ee18dbec2dd8cfb4e2d05")
;;; Generated autoloads from ox-latex.el
(autoload 'org-latex-export-as-latex "ox-latex" "\
@@ -2762,7 +2761,7 @@ Return output file name.
;;;### (autoloads (org-md-publish-to-md org-md-export-to-markdown
;;;;;; org-md-convert-region-to-md org-md-export-as-markdown) "ox-md"
-;;;;;; "ox-md.el" "aed5f0514558ef19cd7d064500334fd9")
+;;;;;; "ox-md.el" "448de11a6a5c4e6b6ed29146698b78d4")
;;; Generated autoloads from ox-md.el
(autoload 'org-md-export-as-markdown "ox-md" "\
@@ -2835,7 +2834,7 @@ Return output file name.
;;;***
;;;### (autoloads (org-odt-convert org-odt-export-to-odt org-odt-export-as-odf-and-open
-;;;;;; org-odt-export-as-odf) "ox-odt" "ox-odt.el" "dc1cbff3d250945dc07382e984ccd766")
+;;;;;; org-odt-export-as-odf) "ox-odt" "ox-odt.el" "d3e8e12b388f84ec7e74e8e63a7c057a")
;;; Generated autoloads from ox-odt.el
(put 'org-odt-preferred-output-format 'safe-local-variable 'stringp)
@@ -2898,7 +2897,7 @@ using `org-open-file'.
;;;***
;;;### (autoloads (org-org-publish-to-org org-org-export-to-org org-org-export-as-org)
-;;;;;; "ox-org" "ox-org.el" "145aafa32bb230b10f3d751f58667b46")
+;;;;;; "ox-org" "ox-org.el" "8cb6bb87ee534a12af804fdc8ba36494")
;;; Generated autoloads from ox-org.el
(autoload 'org-org-export-as-org "ox-org" "\
@@ -2978,7 +2977,7 @@ Return output file name.
;;;### (autoloads (org-publish-current-project org-publish-current-file
;;;;;; org-publish-all org-publish) "ox-publish" "ox-publish.el"
-;;;;;; "00f9feea8a4428e599e429136e990d7b")
+;;;;;; "5675ef912592d842ef2bcb7256ba4441")
;;; Generated autoloads from ox-publish.el
(defalias 'org-publish-project 'org-publish)
@@ -3022,7 +3021,7 @@ the project.
;;;***
;;;### (autoloads (org-texinfo-convert-region-to-texinfo org-texinfo-publish-to-texinfo)
-;;;;;; "ox-texinfo" "ox-texinfo.el" "1648d91d4d39e779443c416e4680fc24")
+;;;;;; "ox-texinfo" "ox-texinfo.el" "9c7a7460ca076741bad9862293c76e4e")
;;; Generated autoloads from ox-texinfo.el
(autoload 'org-texinfo-publish-to-texinfo "ox-texinfo" "\
@@ -3048,7 +3047,7 @@ this command to convert it.
;;;### (autoloads (org-export-dispatch org-export-to-file org-export-to-buffer
;;;;;; org-export-insert-default-template org-export-replace-region-by
-;;;;;; org-export-string-as org-export-as) "ox" "ox.el" "cfe1d1e32456aaf6f81d882d87ef49fc")
+;;;;;; org-export-string-as org-export-as) "ox" "ox.el" "36d7ca3073e166c11f17a18ab55ebd10")
;;; Generated autoloads from ox.el
(autoload 'org-export-as "ox" "\
@@ -3148,7 +3147,7 @@ use it to set a major mode there, e.g,
(defun org-latex-export-as-latex
(&optional async subtreep visible-only body-only ext-plist)
(interactive)
- (org-export-to-buffer 'latex \"*Org LATEX Export*\"
+ (org-export-to-buffer \\='latex \"*Org LATEX Export*\"
async subtreep visible-only body-only ext-plist (lambda () (LaTeX-mode))))
This function returns BUFFER.
@@ -3180,7 +3179,7 @@ to send the output file through additional processing, e.g,
(&optional async subtreep visible-only body-only ext-plist)
(interactive)
(let ((outfile (org-export-output-file-name \".tex\" subtreep)))
- (org-export-to-file 'latex outfile
+ (org-export-to-file \\='latex outfile
async subtreep visible-only body-only ext-plist
(lambda (file) (org-latex-compile file)))
diff --git a/lisp/org-macro.el b/lisp/org-macro.el
index 65795f6..e808972 100644
--- a/lisp/org-macro.el
+++ b/lisp/org-macro.el
@@ -106,6 +106,8 @@ Return an alist containing all macro templates found."
(org-remove-double-quotes val))))
(unless (member file files)
(with-temp-buffer
+ (setq default-directory
+ (file-name-directory file))
(org-mode)
(insert (org-file-contents file 'noerror))
(setq templates
diff --git a/lisp/org-macs.el b/lisp/org-macs.el
index a4af386..d6dcca8 100644
--- a/lisp/org-macs.el
+++ b/lisp/org-macs.el
@@ -1,6 +1,6 @@
;;; org-macs.el --- Top-level definitions for Org-mode
-;; Copyright (C) 2004-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2004-2015 Free Software Foundation, Inc.
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
@@ -138,7 +138,7 @@ Otherwise return nil."
;; FIXME: Slated for removal. Current Org mode does not support Emacs < 22
(defmacro org-maybe-intangible (props)
- "Add '(intangible t) to PROPS if Emacs version is earlier than Emacs 22.
+ "Add \\='(intangible t) to PROPS if Emacs version is earlier than Emacs 22.
In Emacs 21, invisible text is not avoided by the command loop, so the
intangible property is needed to make sure point skips this text.
In Emacs 22, this is not necessary. The intangible text property has
diff --git a/lisp/org-mhe.el b/lisp/org-mhe.el
index bdd6e15..e184440 100644
--- a/lisp/org-mhe.el
+++ b/lisp/org-mhe.el
@@ -1,6 +1,6 @@
;;; org-mhe.el --- Support for links to MH-E messages from within Org-mode
-;; Copyright (C) 2004-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2004-2015 Free Software Foundation, Inc.
;; Author: Thomas Baumann <thomas dot baumann at ch dot tum dot de>
;; Keywords: outlines, hypermedia, calendar, wp
diff --git a/lisp/org-mobile.el b/lisp/org-mobile.el
index 293de79..6c7c8d0 100644
--- a/lisp/org-mobile.el
+++ b/lisp/org-mobile.el
@@ -1,5 +1,5 @@
;;; org-mobile.el --- Code for asymmetric sync with a mobile device
-;; Copyright (C) 2009-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2015 Free Software Foundation, Inc.
;;
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
diff --git a/lisp/org-mouse.el b/lisp/org-mouse.el
index 42b666d..c2fa46a 100644
--- a/lisp/org-mouse.el
+++ b/lisp/org-mouse.el
@@ -1,6 +1,6 @@
;;; org-mouse.el --- Better mouse support for org-mode
-;; Copyright (C) 2006-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2006-2015 Free Software Foundation, Inc.
;; Author: Piotr Zielinski <piotr dot zielinski at gmail dot com>
;; Maintainer: Carsten Dominik <carsten at orgmode dot org>
@@ -377,7 +377,7 @@ nor a function, elements of KEYWORDS are used directly."
(defvar org-mouse-priority-regexp "\\[#\\([A-Z]\\)\\]"
"Regular expression matching the priority indicator.
Differs from `org-priority-regexp' in that it doesn't contain the
-leading '.*?'.")
+leading `.*?'.")
(defun org-mouse-get-priority (&optional default)
"Return the priority of the current headline.
@@ -538,7 +538,7 @@ SCHEDULED: or DEADLINE: or ANYTHINGLIKETHIS:"
((stringp (nth 2 entry))
(concat (org-mouse-agenda-type (nth 1 entry))
(nth 2 entry)))
- (t "Agenda Command '%s'"))
+ (t "Agenda Command `%s'"))
30))))
"--"
["Delete Blank Lines" delete-blank-lines
@@ -565,7 +565,7 @@ SCHEDULED: or DEADLINE: or ANYTHINGLIKETHIS:"
(save-excursion (org-apply-on-list wrap-fun nil)))))
(defun org-mouse-bolp ()
- "Return true if there only spaces, tabs, and '*' before point.
+ "Return true if there only spaces, tabs, and `*' before point.
This means, between the beginning of line and the point."
(save-excursion
(skip-chars-backward " \t*") (bolp)))
@@ -707,9 +707,9 @@ This means, between the beginning of line and the point."
((org-mouse-looking-at ":\\([A-Za-z0-9_]+\\):" "A-Za-z0-9_" -1) ;tags
(popup-menu
`(nil
- [,(format "Display '%s'" (match-string 1))
+ [,(format-message "Display `%s'" (match-string 1))
(org-tags-view nil ,(match-string 1))]
- [,(format "Sparse Tree '%s'" (match-string 1))
+ [,(format-message "Sparse Tree `%s'" (match-string 1))
(org-tags-sparse-tree nil ,(match-string 1))]
"--"
,@(org-mouse-tag-menu))))
diff --git a/lisp/org-plot.el b/lisp/org-plot.el
index a089f34..90a7f36 100644
--- a/lisp/org-plot.el
+++ b/lisp/org-plot.el
@@ -94,7 +94,7 @@ Return value is the point at the beginning of the table."
(goto-char (org-table-begin)))
(defun org-plot/collect-options (&optional params)
- "Collect options from an org-plot '#+Plot:' line.
+ "Collect options from an org-plot `#+Plot:' line.
Accepts an optional property list PARAMS, to which the options
will be added. Returns the resulting property list."
(interactive)
diff --git a/lisp/org-protocol.el b/lisp/org-protocol.el
index 4dfdb6c..339f2b7 100644
--- a/lisp/org-protocol.el
+++ b/lisp/org-protocol.el
@@ -1,6 +1,6 @@
;;; org-protocol.el --- Intercept calls from emacsclient to trigger custom actions.
;;
-;; Copyright (C) 2008-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2015 Free Software Foundation, Inc.
;;
;; Authors: Bastien Guerry <bzg@gnu.org>
;; Daniel M German <dmg AT uvic DOT org>
@@ -197,7 +197,7 @@ Possible properties are:
Example:
(setq org-protocol-project-alist
- '((\"http://orgmode.org/worg/\"
+ \\='((\"http://orgmode.org/worg/\"
:online-suffix \".php\"
:working-suffix \".org\"
:base-url \"http://orgmode.org/worg/\"
@@ -251,7 +251,7 @@ kill-client - If t, kill the client immediately, once the sub-protocol is
Here is an example:
(setq org-protocol-protocol-alist
- '((\"my-protocol\"
+ \\='((\"my-protocol\"
:protocol \"my-protocol\"
:function my-protocol-handler-function)
(\"your-protocol\"
@@ -303,7 +303,7 @@ part."
(defun org-protocol-flatten-greedy (param-list &optional strip-path replacement)
"Greedy handlers might receive a list like this from emacsclient:
- '((\"/dir/org-protocol:/greedy:/~/path1\" (23 . 12)) (\"/dir/param\")
+ ((\"/dir/org-protocol:/greedy:/~/path1\" (23 . 12)) (\"/dir/param\"))
where \"/dir/\" is the absolute path to emacsclients working directory. This
function transforms it into a flat list using `org-protocol-flatten' and
transforms the elements of that list as follows:
@@ -347,7 +347,7 @@ returned list."
(defun org-protocol-flatten (l)
"Greedy handlers might receive a list like this from emacsclient:
- '( (\"/dir/org-protocol:/greedy:/~/path1\" (23 . 12)) (\"/dir/param\")
+ ((\"/dir/org-protocol:/greedy:/~/path1\" (23 . 12)) (\"/dir/param\"))
where \"/dir/\" is the absolute path to emacsclients working directory.
This function transforms it into a flat list."
(if (null l) ()
@@ -365,9 +365,9 @@ link's URL to the `kill-ring'.
The location for a browser's bookmark has to look like this:
- javascript:location.href='org-protocol://store-link://'+ \\
+ javascript:location.href=\\='org-protocol://store-link://\\='+ \\
encodeURIComponent(location.href)
- encodeURIComponent(document.title)+'/'+ \\
+ encodeURIComponent(document.title)+\\='/\\='+ \\
Don't use `escape()'! Use `encodeURIComponent()' instead. The title of the page
could contain slashes and the location definitely will.
@@ -394,18 +394,18 @@ The sub-protocol used to reach this function is set in
`org-protocol-protocol-alist'.
This function detects an URL, title and optional text, separated
-by '/'. The location for a browser's bookmark looks like this:
+by `/'. The location for a browser's bookmark looks like this:
- javascript:location.href='org-protocol://capture://'+ \\
- encodeURIComponent(location.href)+'/' \\
- encodeURIComponent(document.title)+'/'+ \\
+ javascript:location.href=\\='org-protocol://capture://\\='+ \\
+ encodeURIComponent(location.href)+\\='/\\=' \\
+ encodeURIComponent(document.title)+\\='/\\='+ \\
encodeURIComponent(window.getSelection())
By default, it uses the character `org-protocol-default-template-key',
which should be associated with a template in `org-capture-templates'.
But you may prepend the encoded URL with a character and a slash like so:
- javascript:location.href='org-protocol://capture://b/'+ ...
+ javascript:location.href=\\='org-protocol://capture://b/\\='+ ...
Now template ?b will be used."
(if (and (boundp 'org-stored-links)
@@ -455,7 +455,7 @@ in `org-protocol-project-alist'.
The location for a browser's bookmark should look like this:
- javascript:location.href='org-protocol://open-source://'+ \\
+ javascript:location.href=\\='org-protocol://open-source://\\='+ \\
encodeURIComponent(location.href)"
;; As we enter this function for a match on our protocol, the return value
;; defaults to nil.
diff --git a/lisp/org-rmail.el b/lisp/org-rmail.el
index 90d2fa1..af47e0f 100644
--- a/lisp/org-rmail.el
+++ b/lisp/org-rmail.el
@@ -1,6 +1,6 @@
;;; org-rmail.el --- Support for links to Rmail messages from within Org-mode
-;; Copyright (C) 2004-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2004-2015 Free Software Foundation, Inc.
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
diff --git a/lisp/org-src.el b/lisp/org-src.el
index 8529494..9c205e1 100644
--- a/lisp/org-src.el
+++ b/lisp/org-src.el
@@ -283,37 +283,35 @@ which see. BEG and END are buffer positions."
DATUM is an element or object. Return a list (BEG END CONTENTS)
where BEG and END are buffer positions and CONTENTS is a string."
(let ((type (org-element-type datum)))
- (cond
- ((eq type 'footnote-definition)
- (let* ((beg (org-with-wide-buffer
- (goto-char (org-element-property :post-affiliated datum))
- (search-forward "]")))
- (end (or (org-element-property :contents-end datum) beg)))
- (list beg end (buffer-substring-no-properties beg end))))
- ((org-element-property :contents-begin datum)
- (let ((beg (org-element-property :contents-begin datum))
- (end (org-element-property :contents-end datum)))
- (list beg end (buffer-substring-no-properties beg end))))
- ((memq type '(example-block export-block src-block))
- (list (org-with-wide-buffer
- (goto-char (org-element-property :post-affiliated datum))
- (line-beginning-position 2))
- (org-with-wide-buffer
- (goto-char (org-element-property :end datum))
- (skip-chars-backward " \r\t\n")
- (line-beginning-position 1))
- (org-element-property :value datum)))
- ((memq type '(fixed-width table))
- (let ((beg (org-element-property :post-affiliated datum))
- (end (org-with-wide-buffer
- (goto-char (org-element-property :end datum))
- (skip-chars-backward " \r\t\n")
- (line-beginning-position 2))))
- (list beg
- end
- (if (eq type 'fixed-width) (org-element-property :value datum)
- (buffer-substring-no-properties beg end)))))
- (t (error "Unsupported element or object: %s" type)))))
+ (org-with-wide-buffer
+ (cond
+ ((eq type 'footnote-definition)
+ (let* ((beg (progn
+ (goto-char (org-element-property :post-affiliated datum))
+ (search-forward "]")))
+ (end (or (org-element-property :contents-end datum) beg)))
+ (list beg end (buffer-substring-no-properties beg end))))
+ ((org-element-property :contents-begin datum)
+ (let ((beg (org-element-property :contents-begin datum))
+ (end (org-element-property :contents-end datum)))
+ (list beg end (buffer-substring-no-properties beg end))))
+ ((memq type '(example-block export-block src-block))
+ (list (progn (goto-char (org-element-property :post-affiliated datum))
+ (line-beginning-position 2))
+ (progn (goto-char (org-element-property :end datum))
+ (skip-chars-backward " \r\t\n")
+ (line-beginning-position 1))
+ (org-element-property :value datum)))
+ ((memq type '(fixed-width table))
+ (let ((beg (org-element-property :post-affiliated datum))
+ (end (progn (goto-char (org-element-property :end datum))
+ (skip-chars-backward " \r\t\n")
+ (line-beginning-position 2))))
+ (list beg
+ end
+ (if (eq type 'fixed-width) (org-element-property :value datum)
+ (buffer-substring-no-properties beg end)))))
+ (t (error "Unsupported element or object: %s" type))))))
(defun org-src--make-source-overlay (beg end edit-buffer)
"Create overlay between BEG and END positions and return it.
@@ -659,9 +657,9 @@ This command is not bound to a key by default, to avoid conflicts
with language major mode bindings. To bind it to C-c @ in all
language major modes, you could use
- (add-hook 'org-src-mode-hook
+ (add-hook \\='org-src-mode-hook
(lambda () (define-key org-src-mode-map \"\\C-c@\"
- 'org-src-do-key-sequence-at-code-block)))
+ \\='org-src-do-key-sequence-at-code-block)))
In that case, for example, C-c @ t issued in code edit buffers
would tangle the current Org code block, C-c @ e would execute
@@ -721,6 +719,7 @@ If BUFFER is non-nil, test it instead."
(unless label (user-error "Cannot edit remotely anonymous footnotes"))
(let* ((definition (org-with-wide-buffer
(org-footnote-goto-definition label)
+ (backward-char)
(org-element-context)))
(inline (eq (org-element-type definition) 'footnote-reference))
(contents
@@ -758,7 +757,9 @@ If BUFFER is non-nil, test it instead."
;; table's structure.
(when ,(org-element-lineage definition '(table-cell))
(while (search-forward "\n" nil t) (delete-char -1)))))
- contents
+ (concat contents
+ (and (not (org-element-property :contents-begin definition))
+ " "))
'remote))
;; Report success.
t))
diff --git a/lisp/org-table.el b/lisp/org-table.el
index 62de402..ba79690 100644
--- a/lisp/org-table.el
+++ b/lisp/org-table.el
@@ -47,12 +47,18 @@
(declare-function org-element-map "org-element"
(data types fun
&optional info first-match no-recursion with-affiliated))
+(declare-function org-element-parse-buffer "org-element"
+ (&optional granularity visible-only))
(declare-function org-element-property "org-element" (property element))
+(declare-function org-element-type "org-element" (element))
-(declare-function org-export-string-as "ox"
- (string backend &optional body-only ext-plist))
-(declare-function org-export-create-backend "ox")
-(declare-function org-export-get-backend "ox" (name))
+(declare-function org-export-create-backend "org-export" (&rest rest))
+(declare-function org-export-data-with-backend "org-export" (arg1 arg2 arg3))
+(declare-function org-export-first-sibling-p "org-export" (arg1 arg2))
+(declare-function org-export-get-backend "org-export" (arg1))
+(declare-function org-export-get-environment "org-export" (&optional arg1 arg2 arg3))
+(declare-function org-export-table-has-special-column-p "org-export" (arg1))
+(declare-function org-export-table-row-is-special-p "org-export" (arg1 arg2))
(declare-function calc-eval "calc" (str &optional separator &rest args))
@@ -278,9 +284,9 @@ relies on the variables to be present in the list."
(defcustom org-table-duration-custom-format 'hours
"Format for the output of calc computations like $1+$2;t.
-The default value is 'hours, and will output the results as a
-number of hours. Other allowed values are 'seconds, 'minutes and
-'days, and the output will be a fraction of seconds, minutes or
+The default value is `hours', and will output the results as a
+number of hours. Other allowed values are `seconds', `minutes' and
+`days', and the output will be a fraction of seconds, minutes or
days."
:group 'org-table-calculation
:version "24.1"
@@ -323,7 +329,7 @@ The car of each element is a name of a constant, without the `$' before it.
The cdr is the value as a string. For example, if you'd like to use the
speed of light in a formula, you would configure
- (setq org-table-formula-constants '((\"c\" . \"299792458.\")))
+ (setq org-table-formula-constants \\='((\"c\" . \"299792458.\")))
and then use it in an equation like `$1*$c'.
@@ -337,7 +343,9 @@ Constants can also be defined on a per-file basis using a line like
(defcustom org-table-allow-automatic-line-recalculation t
"Non-nil means lines marked with |#| or |*| will be recomputed automatically.
-Automatically means when TAB or RET or C-c C-c are pressed in the line."
+\\<org-mode-map>\
+Automatically means when TAB or RET or \\[org-ctrl-c-ctrl-c] \
+are pressed in the line."
:group 'org-table-calculation
:type 'boolean)
@@ -555,9 +563,9 @@ slightly, to make sure a beginning of line in the first line is included.
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
+(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 as field separator
regexp When a regular expression, use it to match the separator
nil When nil, the command tries to be smart and figure out the
@@ -2560,14 +2568,14 @@ This function assumes the table is already analyzed (i.e., using
(cond
((cdr (assoc ref org-table-named-field-locations)))
((string-match "\\`@\\([1-9][0-9]*\\)\\$\\([1-9][0-9]*\\)\\'" ref)
- (cons (condition-case nil
+ (list (condition-case nil
(aref org-table-dlines
(string-to-number (match-string 1 ref)))
(error (user-error "Invalid row number in %s" ref)))
(string-to-number (match-string 2 ref))))
(t (user-error "Unknown field: %s" ref))))
(line (car coordinates))
- (column (cdr coordinates))
+ (column (nth 1 coordinates))
(create-new-column (if (functionp create-column-p)
(funcall create-column-p column)
create-column-p)))
@@ -3029,7 +3037,7 @@ search, as a string."
KEEP-EMPTY indicated to keep empty fields, default is to skip them.
NUMBERS indicates that everything should be converted to numbers.
LISPP non-nil means to return something appropriate for a Lisp
-list, 'literal is for the format specifier L."
+list, `literal' is for the format specifier L."
;; Calc nan (not a number) is used for the conversion of the empty
;; field to a reference for several reasons: (i) It is accepted in a
;; Calc formula (e. g. "" or "()" would result in a Calc error).
@@ -3384,7 +3392,7 @@ formulas that use a range of rows or columns, it may often be better
to anchor the formula with \"I\" row markers, or to offset from the
borders of the table using the @< @> $< $> makers."
(let (n nmax len char (start 0))
- (while (string-match "\\([@$]\\)\\(<+\\|>+\\)\\|\\(remote([^\)]+)\\)"
+ (while (string-match "\\([@$]\\)\\(<+\\|>+\\)\\|\\(remote([^)]+)\\)"
s start)
(if (match-end 3)
(setq start (match-end 3))
@@ -3549,8 +3557,10 @@ Parameters get priority."
(when (eq org-table-use-standard-references t)
(org-table-fedit-toggle-ref-type))
(org-goto-line startline)
- (message "Edit formulas, finish with `C-c C-c' or `C-c ' '. \
-See menu for more commands.")))
+ (message
+ (substitute-command-keys "\\<org-mode-map>\
+Edit formulas, finish with `\\[org-ctrl-c-ctrl-c]' or `\\[org-edit-special]'. \
+See menu for more commands."))))
(defun org-table-fedit-post-command ()
(when (not (memq this-command '(lisp-complete-symbol)))
@@ -4772,72 +4782,85 @@ This may be either a string or a function of two arguments:
example \"%s\\\\times10^{%s}\". This may also be a property
list with column numbers and format strings or functions.
:fmt will still be applied after :efmt."
- (let ((backend (plist-get params :backend))
- ;; Disable user-defined export filters and hooks.
- (org-export-filters-alist nil)
- (org-export-before-parsing-hook nil)
- (org-export-before-processing-hook nil))
- (when (and backend (symbolp backend) (not (org-export-get-backend backend)))
- (user-error "Unknown :backend value"))
- (when (or (not backend) (plist-get params :raw)) (require 'ox-org))
- ;; Remove final newline.
- (substring
- (org-export-string-as
- ;; Return TABLE as Org syntax. Tolerate non-string cells.
- (with-output-to-string
+ (let* ((backend (plist-get params :backend))
+ (custom-backend
+ ;; Build a custom back-end according to PARAMS. Before
+ ;; defining a translator, check if there is anything to do.
+ ;; When there isn't, let BACKEND handle the element.
+ (org-export-create-backend
+ :parent (or backend 'org)
+ :transcoders
+ `((table . ,(org-table--to-generic-table params))
+ (table-row . ,(org-table--to-generic-row params))
+ (table-cell . ,(org-table--to-generic-cell params))
+ ;; Macros are not going to be expanded. However, no
+ ;; regular back-end has a transcoder for them. We
+ ;; provide one so they are not ignored, but displayed
+ ;; as-is instead.
+ (macro . (lambda (m c i) (org-element-macro-interpreter m nil))))))
+ data info)
+ ;; Store TABLE as Org syntax in DATA. Tolerate non-string cells.
+ ;; Initialize communication channel in INFO.
+ (with-temp-buffer
+ (let ((org-inhibit-startup t)) (org-mode))
+ (let ((standard-output (current-buffer)))
(dolist (e table)
(cond ((eq e 'hline) (princ "|--\n"))
((consp e)
(princ "| ") (dolist (c e) (princ c) (princ " |"))
(princ "\n")))))
- ;; Build a custom back-end according to PARAMS. Before defining
- ;; a translator, check if there is anything to do. When there
- ;; isn't, let BACKEND handle the element.
- (org-export-create-backend
- :parent (or backend 'org)
- :filters
- '((:filter-parse-tree
- ;; Handle :skip parameter.
- (lambda (tree backend info)
- (let ((skip (plist-get info :skip)))
- (when skip
- (unless (wholenump skip) (user-error "Wrong :skip value"))
- (let ((n 0))
- (org-element-map tree 'table-row
- (lambda (row)
- (if (>= n skip) t
- (org-element-extract-element row)
- (incf n)
- nil))
- info t))
- tree)))
- ;; Handle :skipcols parameter.
- (lambda (tree backend info)
- (let ((skipcols (plist-get info :skipcols)))
- (when skipcols
- (unless (consp skipcols) (user-error "Wrong :skipcols value"))
- (org-element-map tree 'table
- (lambda (table)
- (let ((specialp
- (org-export-table-has-special-column-p table)))
- (dolist (row (org-element-contents table))
- (when (eq (org-element-property :type row) 'standard)
- (let ((c 1))
- (dolist (cell (nthcdr (if specialp 1 0)
- (org-element-contents row)))
- (when (memq c skipcols)
- (org-element-extract-element cell))
- (incf c)))))))
- info)
- tree)))))
- :transcoders
- `((table . ,(org-table--to-generic-table params))
- (table-row . ,(org-table--to-generic-row params))
- (table-cell . ,(org-table--to-generic-cell params))
- ;; Section. Return contents to avoid garbage around table.
- (section . (lambda (s c i) c))))
- 'body-only (org-combine-plists params '(:with-tables t)))
- 0 -1)))
+ (setq data
+ (org-element-map (org-element-parse-buffer) 'table
+ #'identity nil t))
+ (setq info (org-export-get-environment backend nil params)))
+ (when (and backend (symbolp backend) (not (org-export-get-backend backend)))
+ (user-error "Unknown :backend value"))
+ (when (or (not backend) (plist-get info :raw)) (require 'ox-org))
+ ;; Handle :skip parameter.
+ (let ((skip (plist-get info :skip)))
+ (when skip
+ (unless (wholenump skip) (user-error "Wrong :skip value"))
+ (let ((n 0))
+ (org-element-map data 'table-row
+ (lambda (row)
+ (if (>= n skip) t
+ (org-element-extract-element row)
+ (incf n)
+ nil))
+ nil t))))
+ ;; Handle :skipcols parameter.
+ (let ((skipcols (plist-get info :skipcols)))
+ (when skipcols
+ (unless (consp skipcols) (user-error "Wrong :skipcols value"))
+ (org-element-map data 'table
+ (lambda (table)
+ (let ((specialp (org-export-table-has-special-column-p table)))
+ (dolist (row (org-element-contents table))
+ (when (eq (org-element-property :type row) 'standard)
+ (let ((c 1))
+ (dolist (cell (nthcdr (if specialp 1 0)
+ (org-element-contents row)))
+ (when (memq c skipcols)
+ (org-element-extract-element cell))
+ (incf c))))))))))
+ ;; Since we are going to export using a low-level mechanism,
+ ;; ignore special column and special rows manually.
+ (let ((special? (org-export-table-has-special-column-p data))
+ ignore)
+ (org-element-map data (if special? '(table-cell table-row) 'table-row)
+ (lambda (datum)
+ (when (if (eq (org-element-type datum) 'table-row)
+ (org-export-table-row-is-special-p datum nil)
+ (org-export-first-sibling-p datum nil))
+ (push datum ignore))))
+ (setq info (plist-put info :ignore-list ignore)))
+ ;; We use a low-level mechanism to export DATA so as to skip all
+ ;; usual pre-processing and post-processing, i.e., hooks, filters,
+ ;; Babel code evaluation, include keywords and macro expansion,
+ ;; and filters.
+ (let ((output (org-export-data-with-backend data custom-backend info)))
+ ;; Remove final newline.
+ (if (org-string-nw-p output) (substring-no-properties output 0 -1) ""))))
(defun org-table--generic-apply (value name &optional with-cons &rest args)
(cond ((null value) nil)
diff --git a/lisp/org-timer.el b/lisp/org-timer.el
index 2c51b42..0758ed2 100644
--- a/lisp/org-timer.el
+++ b/lisp/org-timer.el
@@ -1,6 +1,6 @@
;;; org-timer.el --- Timer code for Org mode
-;; Copyright (C) 2008-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2015 Free Software Foundation, Inc.
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
@@ -49,7 +49,7 @@
(defvar org-timer-countdown-timer nil
"Current countdown timer.
This is a timer object if there is an active countdown timer,
-'paused' if there is a paused countdown timer, and nil
+`paused' if there is a paused countdown timer, and nil
otherwise.")
(defvar org-timer-countdown-timer-title nil
@@ -163,13 +163,12 @@ With prefix arg STOP, stop it entirely."
(let ((start-secs (org-float-time org-timer-start-time))
(pause-secs (org-float-time org-timer-pause-time)))
(if org-timer-countdown-timer
- (progn
- (let ((new-secs (- start-secs pause-secs)))
- (setq org-timer-countdown-timer
- (org-timer--run-countdown-timer
- new-secs org-timer-countdown-timer-title))
- (setq org-timer-start-time
- (time-add (current-time) (seconds-to-time new-secs)))))
+ (let ((new-secs (- start-secs pause-secs)))
+ (setq org-timer-countdown-timer
+ (org-timer--run-countdown-timer
+ new-secs org-timer-countdown-timer-title))
+ (setq org-timer-start-time
+ (time-add (current-time) (seconds-to-time new-secs))))
(setq org-timer-start-time
;; Pass `current-time' result to `org-float-time'
;; (instead of calling without arguments) so that only
@@ -184,10 +183,10 @@ With prefix arg STOP, stop it entirely."
;; pause timer
(when org-timer-countdown-timer
(cancel-timer org-timer-countdown-timer)
- (setq org-timer-countdown-timer 'pause))
+ (setq org-timer-countdown-timer 'paused))
(run-hooks 'org-timer-pause-hook)
(setq org-timer-pause-time (current-time))
- (org-timer-set-mode-line 'pause)
+ (org-timer-set-mode-line 'paused)
(message "Timer paused at %s" (org-timer-value-string)))))
(defun org-timer-stop ()
@@ -332,7 +331,7 @@ If the integer is negative, the string will start with \"-\"."
(defun org-timer-set-mode-line (value)
"Set the mode-line display for relative or countdown timer.
-VALUE can be `on', `off', or `pause'."
+VALUE can be `on', `off', or `paused'."
(when (or (eq org-timer-display 'mode-line)
(eq org-timer-display 'both))
(or global-mode-string (setq global-mode-string '("")))
@@ -358,7 +357,7 @@ VALUE can be `on', `off', or `pause'."
(setq frame-title-format
(delq 'org-timer-mode-line-string frame-title-format)))
(force-mode-line-update))
- ((equal value 'pause)
+ ((equal value 'paused)
(when org-timer-mode-line-timer
(cancel-timer org-timer-mode-line-timer)
(setq org-timer-mode-line-timer nil)))
@@ -450,23 +449,22 @@ using three `C-u' prefix arguments."
(org-timer-show-remaining-time)
(let ((secs (org-timer-hms-to-secs (org-timer-fix-incomplete minutes)))
(hl (org-timer--get-timer-title)))
- (if (or (not org-timer-countdown-timer)
- (equal opt '(16))
- (y-or-n-p "Replace current timer? "))
- (progn
- (when (timerp org-timer-countdown-timer)
- (cancel-timer org-timer-countdown-timer))
- (setq org-timer-countdown-timer-title
- (org-timer--get-timer-title))
- (setq org-timer-countdown-timer
- (org-timer--run-countdown-timer
- secs org-timer-countdown-timer-title))
- (run-hooks 'org-timer-set-hook)
- (setq org-timer-start-time
- (time-add (current-time) (seconds-to-time secs)))
- (setq org-timer-pause-time nil)
- (org-timer-set-mode-line 'on))
- (message "No timer set"))))))
+ (if (and org-timer-countdown-timer
+ (not (or (equal opt '(16))
+ (y-or-n-p "Replace current timer? "))))
+ (message "No timer set")
+ (when (timerp org-timer-countdown-timer)
+ (cancel-timer org-timer-countdown-timer))
+ (setq org-timer-countdown-timer-title
+ (org-timer--get-timer-title))
+ (setq org-timer-countdown-timer
+ (org-timer--run-countdown-timer
+ secs org-timer-countdown-timer-title))
+ (run-hooks 'org-timer-set-hook)
+ (setq org-timer-start-time
+ (time-add (current-time) (seconds-to-time secs)))
+ (setq org-timer-pause-time nil)
+ (org-timer-set-mode-line 'on))))))
(defun org-timer--run-countdown-timer (secs title)
"Start countdown timer that will last SECS.
diff --git a/lisp/org-version.el b/lisp/org-version.el
index 6f2c936..08f47bf 100644
--- a/lisp/org-version.el
+++ b/lisp/org-version.el
@@ -5,13 +5,13 @@
(defun org-release ()
"The release version of org-mode.
Inserted by installing org-mode or when a release is made."
- (let ((org-release "8.3.1"))
+ (let ((org-release "8.3.2"))
org-release))
;;;###autoload
(defun org-git-version ()
"The Git version of org-mode.
Inserted by installing org-mode or when a release is made."
- (let ((org-git-version "8.3.1-dist"))
+ (let ((org-git-version "8.3.2-dist"))
org-git-version))
;;;###autoload
(defvar org-odt-data-dir "/usr/share/emacs/etc/org"
diff --git a/lisp/org-w3m.el b/lisp/org-w3m.el
index c8ddc82..24693de 100644
--- a/lisp/org-w3m.el
+++ b/lisp/org-w3m.el
@@ -1,6 +1,6 @@
;;; org-w3m.el --- Support from copy and paste from w3m to Org-mode
-;; Copyright (C) 2008-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2015 Free Software Foundation, Inc.
;; Author: Andy Stewart <lazycat dot manatee at gmail dot com>
;; Keywords: outlines, hypermedia, calendar, wp
diff --git a/lisp/org.el b/lisp/org.el
index b6f1da7..ea6c955 100755
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -492,7 +492,7 @@ Group 1 contains drawer's name or \"END\".")
(defconst org-property-drawer-re
(concat "^[ \t]*:PROPERTIES:[ \t]*\n"
- "\\(?:[ \t]*:\\S-+:\\(?: .*\\)?[ \t]*\n\\)*"
+ "\\(?:[ \t]*:\\S-+:\\(?: .*\\)?[ \t]*\n\\)*?"
"[ \t]*:END:[ \t]*$")
"Matches an entire property drawer.")
@@ -680,7 +680,7 @@ core modules, nor modules from the CONTRIB directory). Just add symbols
to the end of the list. If the package is called org-xyz.el, then you need
to add the symbol `xyz', and the package must have a call to:
- \(provide 'org-xyz)
+ (provide \\='org-xyz)
For export specific modules, see also `org-export-backends'."
:group 'org
@@ -764,26 +764,26 @@ need to make a change while Emacs is running, use the customize
interface or run the following code, where VAL stands for the new
value of the variable, after updating it:
- \(progn
- \(setq org-export-registered-backends
- \(org-remove-if-not
- \(lambda (backend)
- \(let ((name (org-export-backend-name backend)))
- \(or (memq name val)
- \(catch 'parentp
- \(dolist (b val)
- \(and (org-export-derived-backend-p b name)
- \(throw 'parentp t)))))))
+ (progn
+ (setq org-export-registered-backends
+ (org-remove-if-not
+ (lambda (backend)
+ (let ((name (org-export-backend-name backend)))
+ (or (memq name val)
+ (catch \\='parentp
+ (dolist (b val)
+ (and (org-export-derived-backend-p b name)
+ (throw \\='parentp t)))))))
org-export-registered-backends))
- \(let ((new-list (mapcar #'org-export-backend-name
+ (let ((new-list (mapcar #\\='org-export-backend-name
org-export-registered-backends)))
- \(dolist (backend val)
- \(cond
- \((not (load (format \"ox-%s\" backend) t t))
- \(message \"Problems while trying to load export back-end `%s'\"
+ (dolist (backend val)
+ (cond
+ ((not (load (format \"ox-%s\" backend) t t))
+ (message \"Problems while trying to load export back-end \\=`%s\\='\"
backend))
- \((not (memq backend new-list)) (push backend new-list))))
- \(set-default 'org-export-backends new-list)))
+ ((not (memq backend new-list)) (push backend new-list))))
+ (set-default \\='org-export-backends new-list)))
Adding a back-end to this list will also pull the back-end it
depends on, if any."
@@ -849,6 +849,7 @@ depends on, if any."
(defcustom org-support-shift-select nil
"Non-nil means make shift-cursor commands select text when possible.
+\\<org-mode-map>\
In Emacs 23, when `shift-select-mode' is on, shifted cursor keys
start selecting a region, or enlarge regions started in this way.
@@ -875,10 +876,13 @@ if the cursor is exactly on the bullet.
If you set this variable to the symbol `always', then the keys
will not be special in headlines, property lines, and item lines,
to make shift selection work there as well. If this is what you
-want, you can use the following alternative commands: `C-c C-t'
-and `C-c ,' to change TODO state and priority, `C-u C-u C-c C-t'
-can be used to switch TODO sets, `C-c -' to cycle item bullet
-types, and properties can be edited by hand or in column view.
+want, you can use the following alternative commands:
+`\\[org-todo]' and `\\[org-priority]' \
+to change TODO state and priority,
+`\\[universal-argument] \\[universal-argument] \\[org-todo]' \
+can be used to switch TODO sets,
+`\\[org-ctrl-c-minus]' to cycle item bullet types,
+and properties can be edited by hand or in column view.
However, when the cursor is on a timestamp, shift-cursor commands
will still edit the time stamp - this is just too good to give up.
@@ -1677,10 +1681,12 @@ changed by an edit command."
(defcustom org-remove-highlights-with-change t
"Non-nil means any change to the buffer will remove temporary highlights.
+\\<org-mode-map>\
Such highlights are created by `org-occur' and `org-clock-display'.
-When nil, `C-c C-c' needs to be used to get rid of the highlights.
+When nil, `\\[org-ctrl-c-ctrl-c]' needs to be used \
+to get rid of the highlights.
The highlights created by `org-toggle-latex-fragment' always need
-`C-c C-x C-l' to be removed."
+`\\[org-toggle-latex-fragment]' to be removed."
:group 'org-sparse-trees
:group 'org-time
:type 'boolean)
@@ -1774,8 +1780,8 @@ links in Org-mode buffers can have an optional tag after a double colon, e.g.
[[linkkey:tag][description]]
-The 'linkkey' must be a word word, starting with a letter, followed
-by letters, numbers, '-' or '_'.
+The `linkkey' must be a word word, starting with a letter, followed
+by letters, numbers, `-' or `_'.
If REPLACE is a string, the tag will simply be appended to create the link.
If the string contains \"%s\", the tag will be inserted there. If the string
@@ -2204,7 +2210,7 @@ file identifier are
filename matches the regexp. If you want to
use groups here, use shy groups.
- Example: (\"\\.x?html\\'\" . \"firefox %s\")
+ Example: (\"\\.x?html\\\\='\" . \"firefox %s\")
(\"\\(?:xhtml\\|html\\)\" . \"firefox %s\")
to open *.html and *.xhtml with firefox.
@@ -2220,7 +2226,7 @@ file identifier are
In a custom lisp form, you can access the group matches with
(match-string n link).
- Example: (\"\\.pdf::\\(\\d+\\)\\'\" . \"evince -p %1 %s\")
+ Example: (\"\\.pdf::\\(\\d+\\)\\\\='\" . \"evince -p %1 %s\")
to open [[file:document.pdf::5]] with evince at page 5.
`directory' Matches a directory
@@ -2435,12 +2441,15 @@ of the subtree."
(defcustom org-refile-use-cache nil
"Non-nil means cache refile targets to speed up the process.
+\\<org-mode-map>\
The cache for a particular file will be updated automatically when
the buffer has been killed, or when any of the marker used for flagging
refile targets no longer points at a live buffer.
If you have added new entries to a buffer that might themselves be targets,
-you need to clear the cache manually by pressing `C-0 C-c C-w' or, if you
-find that easier, `C-u C-u C-u C-c C-w'."
+you need to clear the cache manually by pressing `C-0 \\[org-refile]' or,
+if you find that easier, \
+`\\[universal-argument] \\[universal-argument] \\[universal-argument] \
+\\[org-refile]'."
:group 'org-refile
:version "24.1"
:type 'boolean)
@@ -2623,7 +2632,8 @@ more information."
(const type)))
(defcustom org-use-fast-todo-selection t
- "Non-nil means use the fast todo selection scheme with C-c C-t.
+ "\\<org-mode-map>\
+Non-nil means use the fast todo selection scheme with \\[org-todo].
This variable describes if and under what circumstances the cycling
mechanism for TODO keywords will be replaced by a single-key, direct
selection scheme.
@@ -2631,8 +2641,9 @@ selection scheme.
When nil, fast selection is never used.
When the symbol `prefix', it will be used when `org-todo' is called
-with a prefix argument, i.e. `C-u C-c C-t' in an Org-mode buffer, and
-`C-u t' in an agenda buffer.
+with a prefix argument, i.e. `\\[universal-argument] \\[org-todo]' \
+in an Org-mode buffer, and
+`\\[universal-argument] t' in an agenda buffer.
When t, fast selection is used by default. In this case, the prefix
argument forces cycling instead.
@@ -2712,7 +2723,7 @@ TODO state changes
------------------
:type todo-state-change
:from previous state (keyword as a string), or nil, or a symbol
- 'todo' or 'done', to indicate the general type of state.
+ `todo' or `done', to indicate the general type of state.
:to new state, like in :from")
(defcustom org-enforce-todo-dependencies nil
@@ -3098,6 +3109,7 @@ as an argument and return the numeric priority."
(defcustom org-time-stamp-rounding-minutes '(0 5)
"Number of minutes to round time stamps to.
+\\<org-mode-map>\
These are two values, the first applies when first creating a time stamp.
The second applies when changing it with the commands `S-up' and `S-down'.
When changing the time stamp, this means that it will change in steps
@@ -3107,7 +3119,8 @@ When a setting is 0 or 1, insert the time unmodified. Useful rounding
numbers should be factors of 60, so for example 5, 10, 15.
When this is larger than 1, you can still force an exact time stamp by using
-a double prefix argument to a time stamp command like `C-c .' or `C-c !',
+a double prefix argument to a time stamp command like \
+`\\[org-time-stamp]' or `\\[org-time-stamp-inactive],
and by using a prefix arg to `S-up/down' to specify the exact number
of minutes to shift."
:group 'org-time
@@ -3178,7 +3191,7 @@ its value is 0.
For example,
- \(:days \"%dd\" :hours \"%d\" :require-hours t :minutes \":%02d\"
+ (:days \"%dd\" :hours \"%d\" :require-hours t :minutes \":%02d\"
:require-minutes t)
means durations longer than a day will be expressed in days,
@@ -3188,7 +3201,7 @@ hour).
The value
- \(:days \"%dd\" :minutes \"%dm\")
+ (:days \"%dd\" :minutes \"%dm\")
means durations longer than a day will be expressed in days and
minutes, and durations less than a day will be expressed entirely
@@ -3518,10 +3531,10 @@ Instead of customizing this variable directly, you might want to
set it locally for capture buffers, because there no list of
tags in that file can be created dynamically (there are none).
- (add-hook 'org-capture-mode-hook
+ (add-hook \\='org-capture-mode-hook
(lambda ()
(set (make-local-variable
- 'org-complete-tags-always-offer-all-agenda-tags)
+ \\='org-complete-tags-always-offer-all-agenda-tags)
t)))"
:group 'org-tags
:version "24.1"
@@ -3854,7 +3867,8 @@ regular expression will be included."
(defcustom org-agenda-text-search-extra-files nil
"List of extra files to be searched by text search commands.
These files will be searched in addition to the agenda files by the
-commands `org-search-view' (`C-c a s') and `org-occur-in-agenda-files'.
+commands `org-search-view' (`\\[org-agenda] s') \
+and `org-occur-in-agenda-files'.
Note that these files will only be searched for text search commands,
not for the other agenda views like todo lists, tag searches or the weekly
agenda. This variable is intended to list notes and possibly archive files
@@ -4114,7 +4128,7 @@ a string.
A cell is of the format
- \(\"options\" \"package\" SNIPPET-FLAG)
+ (\"options\" \"package\" SNIPPET-FLAG)
If SNIPPET-FLAG is non-nil, the package also needs to be included
when compiling LaTeX snippets into images for inclusion into
@@ -4143,7 +4157,7 @@ Each element is either a cell or a string.
A cell is of the format:
- \(\"options\" \"package\" SNIPPET-FLAG)
+ (\"options\" \"package\" SNIPPET-FLAG)
SNIPPET-FLAG, when non-nil, indicates that this package is also
needed when turning LaTeX snippets into images for inclusion into
@@ -4200,7 +4214,7 @@ lines to the buffer:
(defcustom org-hidden-keywords nil
"List of symbols corresponding to keywords to be hidden the org buffer.
-For example, a value '(title) for this list will make the document's title
+For example, a value \\='(title) for this list will make the document's title
appear in the buffer without the initial #+TITLE: keyword."
:group 'org-appearance
:version "24.1"
@@ -4498,13 +4512,14 @@ Normal means, no org-mode-specific context."
"Non-nil if the cursor is inside an Org table.
If TABLE-TYPE is non-nil, also check for table.el-type tables.
If `org-enable-table-editor' is nil, return nil unconditionally."
- (and org-enable-table-editor
- (save-excursion
- (beginning-of-line)
- (org-looking-at-p (if table-type "[ \t]*[|+]" "[ \t]*|")))
- (let ((element (org-element-lineage (org-element-at-point) '(table) t)))
- (and element
- (or table-type (eq (org-element-property :type element) 'org))))))
+ (and
+ org-enable-table-editor
+ (save-excursion
+ (beginning-of-line)
+ (org-looking-at-p (if table-type "[ \t]*[|+]" "[ \t]*|")))
+ (or (not (derived-mode-p 'org-mode))
+ (let ((e (org-element-lineage (org-element-at-point) '(table) t)))
+ (and e (or table-type (eq (org-element-property :type e) 'org)))))))
(defsubst org-table-p () (org-at-table-p))
(defun org-at-table.el-p ()
@@ -4752,6 +4767,8 @@ Otherwise, these types are allowed:
(let ((case-fold-search nil)
(re (concat org-outline-regexp-bol ".*:" org-archive-tag ":")))
(goto-char beg)
+ ;; Include headline point is currently on.
+ (beginning-of-line)
(while (and (< (point) end) (re-search-forward re end t))
(when (member org-archive-tag (org-get-tags))
(org-flag-subtree t)
@@ -5191,6 +5208,7 @@ Return value contains the following keys: `archive', `category',
(org-remove-double-quotes value)))))
(when (and f (file-readable-p f) (not (member f files)))
(with-temp-buffer
+ (setq default-directory (file-name-directory f))
(insert-file-contents f)
(setq alist
;; Fake Org mode to benefit from cache
@@ -5420,8 +5438,9 @@ The following commands are available:
(define-key org-mode-map [menu-bar show] 'undefined))
(org-load-modules-maybe)
- (easy-menu-add org-org-menu)
- (easy-menu-add org-tbl-menu)
+ (when (featurep 'xemacs)
+ (easy-menu-add org-org-menu)
+ (easy-menu-add org-tbl-menu))
(org-install-agenda-files-menu)
(if org-descriptive-links (add-to-invisibility-spec '(org-link)))
(add-to-invisibility-spec '(org-cwidth))
@@ -5713,7 +5732,8 @@ This should be called after the variable `org-link-types' has changed."
"\\([^" org-non-link-chars " ]"
"[^\t\n\r]*\\)")
org-angle-link-re
- (format "<%s:\\(\n?\\(?:[^>\n]+\n?\\)*\\)>" types-re)
+ (format "<%s:\\([^>\n]*\\(?:\n[ \t]*[^> \t\n][^>\n]*\\)*\\)>"
+ types-re)
org-plain-link-re
(concat
"\\<" types-re ":"
@@ -6360,7 +6380,6 @@ needs to be inserted at a specific position in the font-lock sequence.")
":\\).*$")
'(1 'org-tag-group prepend)))
;; Special keywords
- (list (concat "\\<" org-comment-string) '(0 'org-special-keyword t))
(list (concat "\\<" org-deadline-string) '(0 'org-special-keyword t))
(list (concat "\\<" org-scheduled-string) '(0 'org-special-keyword t))
(list (concat "\\<" org-closed-string) '(0 'org-special-keyword t))
@@ -6392,7 +6411,7 @@ needs to be inserted at a specific position in the font-lock sequence.")
'(org-activate-code (1 'org-code t))
;; COMMENT
(list (format
- "^\\*\\(?: +%s\\)?\\(?: +\\[#[A-Z0-9]\\]\\)? +\\(?9:%s\\)\\(?: \\|$\\)"
+ "^\\*+\\(?: +%s\\)?\\(?: +\\[#[A-Z0-9]\\]\\)? +\\(?9:%s\\)\\(?: \\|$\\)"
org-todo-regexp
org-comment-string)
'(9 'org-special-keyword t))
@@ -6500,6 +6519,14 @@ needs to be inserted at a specific position in the font-lock sequence.")
((eq n 2) org-f)
(t (if org-level-color-stars-only nil org-f))))
+(defun org-face-from-face-or-color (context inherit face-or-color)
+ "Create a face list that inherits INHERIT, but sets the foreground color.
+When FACE-OR-COLOR is not a string, just return it."
+ (if (stringp face-or-color)
+ (list :inherit inherit
+ (cdr (assoc context org-faces-easy-properties))
+ face-or-color)
+ face-or-color))
(defun org-get-todo-face (kwd)
"Get the right face for a TODO keyword KWD.
@@ -6510,14 +6537,28 @@ If KWD is a number, get the corresponding match group."
(and (member kwd org-done-keywords) 'org-done)
'org-todo))
-(defun org-face-from-face-or-color (context inherit face-or-color)
- "Create a face list that inherits INHERIT, but sets the foreground color.
-When FACE-OR-COLOR is not a string, just return it."
- (if (stringp face-or-color)
- (list :inherit inherit
- (cdr (assoc context org-faces-easy-properties))
- face-or-color)
- face-or-color))
+(defun org-get-priority-face (priority)
+ "Get the right face for PRIORITY.
+PRIORITY is a character."
+ (or (org-face-from-face-or-color
+ 'priority 'org-priority (cdr (assq priority org-priority-faces)))
+ 'org-priority))
+
+(defun org-get-tag-face (tag)
+ "Get the right face for TAG.
+If TAG is a number, get the corresponding match group."
+ (let ((tag (if (wholenump tag) (match-string tag) tag)))
+ (or (org-face-from-face-or-color
+ 'tag 'org-tag (cdr (assoc tag org-tag-faces)))
+ 'org-tag)))
+
+(defun org-font-lock-add-priority-faces (limit)
+ "Add the special priority faces."
+ (while (re-search-forward "^\\*+ .*?\\(\\[#\\(.\\)\\]\\)" limit t)
+ (add-text-properties
+ (match-beginning 1) (match-end 1)
+ (list 'face (org-get-priority-face (string-to-char (match-string 2)))
+ 'font-lock-fontified t))))
(defun org-font-lock-add-tag-faces (limit)
"Add the special tag faces."
@@ -6528,27 +6569,6 @@ When FACE-OR-COLOR is not a string, just return it."
'font-lock-fontified t))
(backward-char 1))))
-(defun org-font-lock-add-priority-faces (limit)
- "Add the special priority faces."
- (while (re-search-forward "\\[#\\([A-Z0-9]\\)\\]" limit t)
- (when (save-match-data (org-at-heading-p))
- (add-text-properties
- (match-beginning 0) (match-end 0)
- (list 'face (or (org-face-from-face-or-color
- 'priority 'org-priority
- (cdr (assoc (char-after (match-beginning 1))
- org-priority-faces)))
- 'org-priority)
- 'font-lock-fontified t)))))
-
-(defun org-get-tag-face (kwd)
- "Get the right face for a TODO keyword KWD.
-If KWD is a number, get the corresponding match group."
- (if (numberp kwd) (setq kwd (match-string kwd)))
- (or (org-face-from-face-or-color
- 'tag 'org-tag (cdr (assoc kwd org-tag-faces)))
- 'org-tag))
-
(defun org-unfontify-region (beg end &optional maybe_loudly)
"Remove fontification and activation overlays from links."
(font-lock-default-unfontify-region beg end)
@@ -6652,11 +6672,12 @@ in special contexts.
1. OVERVIEW: Show only top-level headlines.
2. CONTENTS: Show all headlines of all levels, but no body text.
3. SHOW ALL: Show everything.
- When called with two `C-u C-u' prefixes, switch to the startup visibility,
+ With a double \\[universal-argument] prefix argument, \
+switch to the startup visibility,
determined by the variable `org-startup-folded', and by any VISIBILITY
properties in the buffer.
- When called with three `C-u C-u C-u' prefixed, show the entire buffer,
- including any drawers.
+ With a triple \\[universal-argument] prefix argument, \
+show the entire buffer, including any drawers.
- When inside a table, re-align the table and move to the next field.
@@ -6685,7 +6706,7 @@ in special contexts.
- Special case: if point is at the beginning of the buffer and there is
no headline in line 1, this function will act as if called with prefix arg
- (C-u TAB, same as S-TAB) also when called without prefix arg.
+ (\\[universal-argument] TAB, same as S-TAB) also when called without prefix arg.
But only if also the variable `org-cycle-global-at-bob' is t."
(interactive "P")
(org-load-modules-maybe)
@@ -6736,7 +6757,8 @@ in special contexts.
;; Table: enter it or move to the next field.
((org-at-table-p 'any)
(if (org-at-table.el-p)
- (message "Use C-c ' to edit table.el tables")
+ (message "%s" (substitute-command-keys "\\<org-mode-map>\
+Use \\[org-edit-special] to edit table.el tables"))
(if arg (org-table-edit-field t)
(org-table-justify-field-maybe)
(call-interactively 'org-table-next-field))))
@@ -7386,9 +7408,8 @@ a block. Return a non-nil value when toggling is successful."
(setq org-goto-map
(let ((map (make-sparse-keymap)))
(let ((cmds '(isearch-forward isearch-backward kill-ring-save set-mark-command
- mouse-drag-region universal-argument org-occur))
- cmd)
- (while (setq cmd (pop cmds))
+ mouse-drag-region universal-argument org-occur)))
+ (dolist (cmd cmds)
(substitute-key-definition cmd cmd map global-map)))
(suppress-keymap map)
(org-defkey map "\C-m" 'org-goto-ret)
@@ -8039,18 +8060,17 @@ See also `org-promote'."
(org-fix-position-after-promote))
(defun org-demote-subtree ()
- "Demote the entire subtree. See `org-demote'.
-See also `org-promote'."
+ "Demote the entire subtree.
+See `org-demote' and `org-promote'."
(interactive)
(save-excursion
(org-with-limited-levels (org-map-tree 'org-demote)))
(org-fix-position-after-promote))
-
(defun org-do-promote ()
"Promote the current heading higher up the tree.
-If the region is active in `transient-mark-mode', promote all headings
-in the region."
+If the region is active in `transient-mark-mode', promote all
+headings in the region."
(interactive)
(save-excursion
(if (org-region-active-p)
@@ -8060,8 +8080,8 @@ in the region."
(defun org-do-demote ()
"Demote the current heading lower down the tree.
-If the region is active in `transient-mark-mode', demote all headings
-in the region."
+If the region is active in `transient-mark-mode', demote all
+headings in the region."
(interactive)
(save-excursion
(if (org-region-active-p)
@@ -8070,7 +8090,7 @@ in the region."
(org-fix-position-after-promote))
(defun org-fix-position-after-promote ()
- "Make sure that after pro/demotion cursor position is right."
+ "Fix cursor position and indentation after demoting/promoting."
(let ((pos (point)))
(when (save-excursion
(beginning-of-line 1)
@@ -8835,7 +8855,8 @@ Optional argument WITH-CASE means sort case-sensitively."
(while (string-match org-bracket-link-regexp s)
(setq s (replace-match (if (match-end 2)
(match-string 3 s)
- (match-string 1 s)) t t s)))
+ (match-string 1 s))
+ t t s)))
(let ((st (format " %s " s)))
(while (string-match org-emph-re st)
(setq st (replace-match (format " %s " (match-string 4 st)) t t st)))
@@ -9350,10 +9371,11 @@ definitions."
(list (car c) (car c) (cadr c)))
((string= "" (cadr c))
(list (car c) (car c) (caddr c)))
- (t c))) contexts))
- (a alist) c r s)
+ (t c)))
+ contexts))
+ (a alist) r s)
;; loop over all commands or templates
- (while (setq c (pop a))
+ (dolist (c a)
(let (vrules repl)
(cond
((not (assoc (car c) contexts))
@@ -9363,7 +9385,8 @@ definitions."
(car c) contexts)))
(mapc (lambda (vr)
(when (not (equal (car vr) (cadr vr)))
- (setq repl vr))) vrules)
+ (setq repl vr)))
+ vrules)
(if (not repl) (push c r)
(push (cadr repl) s)
(push
@@ -9380,14 +9403,16 @@ definitions."
(let ((tpl (car x)))
(when (not (delq
nil
- (mapcar (lambda(y)
- (equal y tpl)) s))) x)))
+ (mapcar (lambda (y)
+ (equal y tpl))
+ s)))
+ x)))
(reverse r))))))
(defun org-contextualize-validate-key (key contexts)
"Check CONTEXTS for agenda or capture KEY."
- (let (r rr res)
- (while (setq r (pop contexts))
+ (let (rr res)
+ (dolist (r contexts)
(mapc
(lambda (rr)
(when
@@ -9737,7 +9762,8 @@ active region."
(funcall (caar sfuns)))
(setq link (plist-get org-store-link-plist :link)
desc (or (plist-get org-store-link-plist
- :description) link))))
+ :description)
+ link))))
;; Store a link from a source code buffer.
((org-src-edit-buffer-p)
@@ -9924,7 +9950,8 @@ active region."
;; Return the link
(if (not (and (or (org-called-interactively-p 'any)
- executing-kbd-macro) link))
+ executing-kbd-macro)
+ link))
(or agenda-link (and link (org-make-link-string link desc)))
(push (list link desc) org-stored-links)
(message "Stored: %s" (or desc link))
@@ -10554,14 +10581,9 @@ If the link is in hidden text, expose it."
(defun org-translate-link (s)
"Translate a link string if a translation function has been defined."
- (if (and org-link-translation-function
- (fboundp org-link-translation-function)
- (string-match "\\([a-zA-Z0-9]+\\):\\(.*\\)" s))
- (progn
- (setq s (funcall org-link-translation-function
- (match-string 1 s) (match-string 2 s)))
- (concat (car s) ":" (cdr s)))
- s))
+ (with-temp-buffer
+ (insert (org-trim s))
+ (org-trim (org-element-interpret-data (org-element-context)))))
(defun org-translate-link-from-planner (type path)
"Translate a link from Emacs Planner syntax so that Org can follow it.
@@ -10675,9 +10697,9 @@ link in a property drawer line."
;; the closest one.
(org-element-lineage
(org-element-context)
- '(comment comment-block footnote-definition footnote-reference
- headline inlinetask keyword link node-property
- timestamp)
+ '(clock comment comment-block footnote-definition
+ footnote-reference headline inlinetask keyword link
+ node-property timestamp)
t))
(type (org-element-type context))
(value (org-element-property :value context)))
@@ -10709,6 +10731,13 @@ link in a property drawer line."
(org-open-at-point))
(require 'org-attach)
(org-attach-reveal 'if-exists))))
+ ;; On a clock line, make sure point is on the timestamp
+ ;; before opening it.
+ ((and (eq type 'clock)
+ value
+ (>= (point) (org-element-property :begin value))
+ (<= (point) (org-element-property :end value)))
+ (org-follow-timestamp-link))
;; Do nothing on white spaces after an object, unless point
;; is right after it.
((> (point)
@@ -10819,7 +10848,7 @@ link in a property drawer line."
(call-interactively (read cmd))))
(user-error "Abort"))))
((equal type "id")
- (require 'ord-id)
+ (require 'org-id)
(funcall (nth 1 (assoc "id" org-link-protocols)) path))
((member type '("coderef" "custom-id" "fuzzy" "radio"))
(unless (run-hook-with-args-until-success
@@ -11112,18 +11141,18 @@ of matched result, with is either `dedicated' or `fuzzy'."
"\\[[0-9]*\\(?:%\\|/[0-9]*\\)\\]"
wspaceopt
"\\)"))
- (sep (concat "\\(?:" wspace "+\\|" cookie "+\\)"))
+ (sep (concat "\\(?:\\(?:" wspace "\\|" cookie "\\)+\\)"))
(re (concat
org-outline-regexp-bol
"\\(?:" org-todo-regexp "[ \t]+\\)?"
"\\(?:\\[#.\\][ \t]+\\)?"
"\\(?:" org-comment-string "[ \t]+\\)?"
- sep "*"
+ sep "?"
(let ((title (mapconcat #'regexp-quote
words
- (concat sep "+"))))
+ sep)))
(if starred (substring title 1) title))
- sep "*"
+ sep "?"
(org-re "\\(?:[ \t]+:[[:alnum:]_@#%%:]+:\\)?")
"[ \t]*$")))
(goto-char (point-min))
@@ -11445,7 +11474,7 @@ org-open-file.
It assumes that is the case when the entry uses a regular
expression which has at least one grouping construct and the
action is either a lisp form or a command string containing
-'%1', i.e. using at least one subexpression match as a
+`%1', i.e. using at least one subexpression match as a
parameter."
(let ((selector (car entry))
(action (cdr entry)))
@@ -11516,12 +11545,9 @@ on the system \"/user@host:\"."
((eq t org-reverse-note-order) t)
((not (listp org-reverse-note-order)) nil)
(t (catch 'exit
- (let ((all org-reverse-note-order)
- entry)
- (while (setq entry (pop all))
- (if (string-match (car entry) buffer-file-name)
- (throw 'exit (cdr entry))))
- nil)))))
+ (dolist (entry org-reverse-note-order)
+ (if (string-match (car entry) buffer-file-name)
+ (throw 'exit (cdr entry))))))))
(defvar org-refile-target-table nil
"The list of refile targets, created by `org-refile'.")
@@ -11586,10 +11612,10 @@ on the system \"/user@host:\"."
(let ((case-fold-search nil)
;; otherwise org confuses "TODO" as a kw and "Todo" as a word
(entries (or org-refile-targets '((nil . (:level . 1)))))
- targets tgs txt re files f desc descre fast-path-p level pos0)
+ targets tgs txt re files desc descre fast-path-p level pos0)
(message "Getting targets...")
(with-current-buffer (or default-buffer (current-buffer))
- (while (setq entry (pop entries))
+ (dolist (entry entries)
(setq files (car entry) desc (cdr entry))
(setq fast-path-p nil)
(cond
@@ -11622,7 +11648,7 @@ on the system \"/user@host:\"."
(cdr desc)))
"\\}[ \t]")))
(t (error "Bad refiling target description %s" desc)))
- (while (setq f (pop files))
+ (dolist (f files)
(with-current-buffer
(if (bufferp f) f (org-get-agenda-file-buffer f))
(or
@@ -11650,7 +11676,7 @@ on the system \"/user@host:\"."
(setq level (org-reduced-level
(- (match-end 1) (match-beginning 1)))
txt (org-link-display-format (match-string 4))
- txt (replace-regexp-in-string "\\( *\[[0-9]+/?[0-9]*%?\]\\)+$" "" txt)
+ txt (replace-regexp-in-string "\\( *[[0-9]+/?[0-9]*%?]\\)+$" "" txt)
re (format org-complex-heading-regexp-format
(regexp-quote (match-string 4))))
(when org-refile-use-outline-path
@@ -12483,11 +12509,11 @@ With a numeric prefix arg of 0, inhibit note taking for the change.
With a numeric prefix arg of -1, cancel repeater to allow marking as DONE.
When called through ELisp, arg is also interpreted in the following way:
-'none -> empty state
+`none' -> empty state
\"\"(empty string) -> switch to empty state
-'done -> switch to DONE
-'nextset -> switch to the next set of keywords
-'previousset -> switch to the previous set of keywords
+`done' -> switch to DONE
+`nextset' -> switch to the next set of keywords
+`previousset' -> switch to the previous set of keywords
\"WAITING\" -> switch to the specified keyword, but only if it
really is a member of `org-todo-keywords'."
(interactive "P")
@@ -12839,16 +12865,15 @@ changes because there are unchecked boxes in this entry."
t))) ; do not block
(defun org-entry-blocked-p ()
- "Is the current entry blocked?"
- (org-with-silent-modifications
- (if (org-entry-get nil "NOBLOCKING")
- nil ;; Never block this entry
- (not (run-hook-with-args-until-failure
- 'org-blocker-hook
- (list :type 'todo-state-change
- :position (point)
- :from 'todo
- :to 'done))))))
+ "Non-nil if entry at point is blocked."
+ (and (not (org-entry-get nil "NOBLOCKING"))
+ (member (org-entry-get nil "TODO") org-not-done-keywords)
+ (not (run-hook-with-args-until-failure
+ 'org-blocker-hook
+ (list :type 'todo-state-change
+ :position (point)
+ :from 'todo
+ :to 'done)))))
(defun org-update-statistics-cookies (all)
"Update the statistics cookie, either from TODO or from checkboxes.
@@ -13023,20 +13048,19 @@ This hook runs even if there is no statistics cookie present, in which case
(defun org-local-logging (value)
"Get logging settings from a property VALUE."
- (let* (words w a)
- ;; directly set the variables, they are already local.
- (setq org-log-done nil
- org-log-repeat nil
- org-todo-log-states nil)
- (setq words (org-split-string value))
- (while (setq w (pop words))
+ ;; Directly set the variables, they are already local.
+ (setq org-log-done nil
+ org-log-repeat nil
+ org-todo-log-states nil)
+ (dolist (w (org-split-string value))
+ (let (a)
(cond
((setq a (assoc w org-startup-options))
- (and (member (nth 1 a) '(org-log-done org-log-repeat))
- (set (nth 1 a) (nth 2 a))))
+ (and (member (nth 1 a) '(org-log-done org-log-repeat))
+ (set (nth 1 a) (nth 2 a))))
((setq a (org-extract-log-state-settings w))
- (and (member (car a) org-todo-keywords-1)
- (push a org-todo-log-states)))))))
+ (and (member (car a) org-todo-keywords-1)
+ (push a org-todo-log-states)))))))
(defun org-get-todo-sequence-head (kwd)
"Return the head of the TODO sequence to which KWD belongs.
@@ -13136,7 +13160,14 @@ Returns the new TODO keyword, or nil if no state change should occur."
(match-string 2))))
(defun org-at-date-range-p (&optional inactive-ok)
- "Is the cursor inside a date range?"
+ "Non-nil if point is inside a date range.
+
+When optional argument INACTIVE-OK is non-nil, also consider
+inactive time ranges.
+
+When this function returns a non-nil value, match data is set
+according to `org-tr-regexp-both' or `org-tr-regexp', depending
+on INACTIVE-OK."
(interactive)
(save-excursion
(catch 'exit
@@ -13327,11 +13358,12 @@ can either be an Org date like \"2011-07-24\" or a delta like \"+2d\"."
(user-error "No deadline information to update"))))
(t
(org-add-planning-info 'deadline time 'closed)
- (when (and old-date org-log-redeadline
- (not (equal old-date
- (substring org-last-inserted-timestamp 1 -1))))
- (org-add-log-setup 'redeadline nil old-date 'findpos
- org-log-redeadline))
+ (when (and old-date
+ org-log-redeadline
+ (not (equal old-date org-last-inserted-timestamp)))
+ (org-add-log-setup
+ 'redeadline org-last-inserted-timestamp old-date 'findpos
+ org-log-redeadline))
(when repeater
(save-excursion
(org-back-to-heading t)
@@ -13398,11 +13430,12 @@ either be an Org date like \"2011-07-24\" or a delta like \"+2d\"."
(user-error "No scheduled information to update"))))
(t
(org-add-planning-info 'scheduled time 'closed)
- (when (and old-date org-log-reschedule
- (not (equal old-date
- (substring org-last-inserted-timestamp 1 -1))))
- (org-add-log-setup 'reschedule nil old-date 'findpos
- org-log-reschedule))
+ (when (and old-date
+ org-log-reschedule
+ (not (equal old-date org-last-inserted-timestamp)))
+ (org-add-log-setup
+ 'reschedule org-last-inserted-timestamp old-date 'findpos
+ org-log-reschedule))
(when repeater
(save-excursion
(org-back-to-heading t)
@@ -13516,25 +13549,33 @@ WHAT entry will also be removed."
(dolist (type (if what (cons what remove) remove))
(save-excursion
(when (re-search-forward
- (concat
- " *"
- (case type
- (closed org-closed-time-regexp)
- (deadline org-deadline-time-regexp)
- (scheduled org-scheduled-time-regexp)
- (otherwise
- (error "Invalid planning type: %s" type))))
+ (case type
+ (closed org-closed-time-regexp)
+ (deadline org-deadline-time-regexp)
+ (scheduled org-scheduled-time-regexp)
+ (otherwise
+ (error "Invalid planning type: %s" type)))
(line-end-position) t)
- (replace-match "")
- (when (looking-at "--+<[^>]+>") (replace-match ""))
- (when (and (not what) (eq type 'closed))
- (save-excursion
- (beginning-of-line)
- (when (looking-at "[ \t]*$")
- (delete-region (point)
- (line-beginning-position 2)))))))
- ;; Remove leading white spaces.
- (when (looking-at "[ \t]+") (replace-match ""))))
+ ;; Delete until next keyword or end of line.
+ (delete-region
+ (match-beginning 0)
+ (if (re-search-forward org-keyword-time-not-clock-regexp
+ (line-end-position)
+ t)
+ (match-beginning 0)
+ (line-end-position))))))
+ ;; If there is nothing more to add and no more keyword
+ ;; is left, remove the line completely.
+ (if (and (org-looking-at-p "[ \t]*$") (not what))
+ (delete-region (line-beginning-position)
+ (line-beginning-position 2))
+ ;; If we removed last keyword, do not leave trailing
+ ;; white space at the end of line.
+ (let ((p (point)))
+ (save-excursion
+ (end-of-line)
+ (unless (= (skip-chars-backward " \t" p) 0)
+ (delete-region (point) (line-end-position)))))))
((not what) (throw 'exit nil)) ; Nothing to do.
(t (insert-before-markers "\n")
(backward-char 1)
@@ -13905,6 +13946,7 @@ that the match should indeed be shown."
;; hide everything
(org-overview))
(while (re-search-forward regexp nil t)
+ (backward-char) ;; FIXME: Match timestamps at the end of a headline
(when (or (not callback)
(save-match-data (funcall callback)))
(setq cnt (1+ cnt))
@@ -14419,7 +14461,7 @@ must be bound around the form's evaluation: todo, the TODO keyword
at the entry (or nil of none); and tags-list, the list of all tags
at the entry including inherited ones. Additionally, the category
of the entry (if any) must be specified as the text property
-'org-category on the headline.
+`org-category' on the headline.
See also `org-scan-tags'.
"
@@ -14532,7 +14574,7 @@ See also `org-scan-tags'.
(if (or (not todomatch) (not (string-match "\\S-" todomatch)))
(setq todomatcher t)
(setq orterms (org-split-string todomatch "|") orlist nil)
- (while (setq term (pop orterms))
+ (dolist (term orterms)
(while (string-match re term)
(setq minus (and (match-end 1)
(equal (match-string 1 term) "-"))
@@ -14616,7 +14658,8 @@ When DOWNCASE is non-nil, expand downcased TAGS."
(with-syntax-table stable
(string-match
(concat "\\(?1:[+-]?\\)\\(?2:\\<"
- (regexp-opt taggroups-keys) "\\>\\)") return-match)))
+ (regexp-opt taggroups-keys) "\\>\\)")
+ return-match)))
(let* ((dir (match-string 1 return-match))
(tag (match-string 2 return-match))
(tag (if downcased (downcase tag) tag)))
@@ -14822,7 +14865,8 @@ ignore inherited ones."
(reverse (delete-dups
(reverse (append
(org-remove-uninherited-tags
- org-file-tags) tags)))))))))
+ org-file-tags)
+ tags)))))))))
(defun org-add-prop-inherited (s)
(add-text-properties 0 (length s) '(inherited t) s)
@@ -15294,7 +15338,8 @@ Returns the new tags string, or nil to not change the current settings."
"Tag: "
(or buffer-tags
(with-current-buffer buf
- (org-get-buffer-tags)))))
+ (setq buffer-tags
+ (org-get-buffer-tags))))))
(quit (setq tg "")))
(when (string-match "\\S-" tg)
(add-to-list 'buffer-tags (list tg))
@@ -15477,7 +15522,7 @@ a *different* entry, you cannot use these techniques."
(if (not scope)
(progn
(org-agenda-prepare-buffers
- (list (buffer-file-name (current-buffer))))
+ (and buffer-file-name (list buffer-file-name)))
(setq res (org-scan-tags func matcher todo-only start-level)))
;; Get the right scope
(cond
@@ -15489,11 +15534,11 @@ a *different* entry, you cannot use these techniques."
(setq scope (org-agenda-files t))
(setq scope (org-add-archive-files scope)))
((eq scope 'file)
- (setq scope (list (buffer-file-name))))
+ (setq scope (and buffer-file-name (list buffer-file-name))))
((eq scope 'file-with-archives)
(setq scope (org-add-archive-files (list (buffer-file-name))))))
(org-agenda-prepare-buffers scope)
- (while (setq file (pop scope))
+ (dolist (file scope)
(with-current-buffer (org-find-base-buffer-visiting file)
(save-excursion
(save-restriction
@@ -15699,13 +15744,16 @@ strings."
props))
(when specific (throw 'exit props)))
(when (or (not specific) (string= specific "TODO"))
- (when (and (looking-at org-todo-line-regexp) (match-end 2))
- (push (cons "TODO" (org-match-string-no-properties 2)) props))
+ (let ((case-fold-search nil))
+ (when (and (looking-at org-todo-line-regexp) (match-end 2))
+ (push (cons "TODO" (org-match-string-no-properties 2)) props)))
(when specific (throw 'exit props)))
(when (or (not specific) (string= specific "PRIORITY"))
- (when (looking-at org-priority-regexp)
- (push (cons "PRIORITY" (org-match-string-no-properties 2))
- props))
+ (push (cons "PRIORITY"
+ (if (looking-at org-priority-regexp)
+ (org-match-string-no-properties 2)
+ (char-to-string org-default-priority)))
+ props)
(when specific (throw 'exit props)))
(when (or (not specific) (string= specific "FILE"))
(push (cons "FILE" (buffer-file-name (buffer-base-buffer)))
@@ -15840,7 +15888,7 @@ strings."
(push (cons "CATEGORY" (org-get-category beg)) props)
(when (string= specific "CATEGORY") (throw 'exit props)))
;; Return value.
- (append (get-text-property beg 'org-summaries) props))))))
+ props)))))
(defun org-property--local-values (property literal-nil)
"Return value for PROPERTY in current entry.
@@ -16197,11 +16245,15 @@ COLUMN formats in the current buffer."
(forward-line)
(when (org-looking-at-p org-planning-line-re) (forward-line))
(unless (org-looking-at-p org-property-drawer-re)
- (let ((inhibit-read-only t))
- (unless (bolp) (insert "\n"))
- (let ((begin (point)))
- (insert ":PROPERTIES:\n:END:\n")
- (org-indent-region begin (point)))))))
+ ;; Make sure we start editing a line from current entry, not from
+ ;; next one. It prevents extending text properties or overlays
+ ;; belonging to the latter.
+ (when (bolp) (backward-char))
+ (let ((begin (1+ (point)))
+ (inhibit-read-only t))
+ (insert "\n:PROPERTIES:\n:END:")
+ (when (eobp) (insert "\n"))
+ (org-indent-region begin (point))))))
(defun org-insert-drawer (&optional arg drawer)
"Insert a drawer at point.
@@ -16524,7 +16576,7 @@ only headings."
(widen)
(setq limit (point-max))
(goto-char (point-min))
- (while (setq heading (pop path))
+ (dolist (heading path)
(setq re (format org-complex-heading-regexp-format
(regexp-quote heading)))
(setq cnt 0 pos (point))
@@ -16567,9 +16619,9 @@ a priority cookie and tags in the standard locations."
When the target headline is found, return a marker to this location."
(let ((files (directory-files (or dir default-directory)
t "\\`[^.#].*\\.org\\'"))
- file visiting m buffer)
+ visiting m buffer)
(catch 'found
- (while (setq file (pop files))
+ (dolist (file files)
(message "trying %s" file)
(setq visiting (org-find-base-buffer-visiting file))
(setq buffer (or visiting (find-file-noselect file)))
@@ -16617,13 +16669,10 @@ with the current time without prompting the user.
When called from lisp, the timestamp is inactive if INACTIVE is
non-nil."
(interactive "P")
- (let* ((ts
- (cond ((org-at-date-range-p t)
- (save-excursion
- (goto-char (match-beginning 0))
- (looking-at (if inactive org-ts-regexp-both org-ts-regexp)))
- (match-string 0))
- ((org-at-timestamp-p t) (match-string 0))))
+ (let* ((ts (cond
+ ((org-at-date-range-p t)
+ (match-string (if (< (point) (- (match-beginning 2) 2)) 1 2)))
+ ((org-at-timestamp-p t) (match-string 0))))
;; Default time is either the timestamp at point or today.
;; When entering a range, only the range start is considered.
(default-time (if (not ts) (current-time)
@@ -16828,7 +16877,7 @@ While prompting, a calendar is popped up - you can also select the
date with the mouse (button 1). The calendar shows a period of three
months. To scroll it to other months, use the keys `>' and `<'.
If you don't like the calendar, turn it off with
- \(setq org-read-date-popup-calendar nil)
+ (setq org-read-date-popup-calendar nil)
With optional argument TO-TIME, the date will immediately be converted
to an internal time.
@@ -17427,7 +17476,6 @@ days. If the prefix is a raw \\[universal-argument] prefix, all deadlines are s
(regexp (concat "\\<" org-deadline-string " *<\\([^>]+\\)>"))
(callback
(lambda () (org-deadline-close (match-string 1) org-warn-days))))
-
(message "%d deadlines past-due or due within %d days"
(org-occur regexp nil callback)
org-warn-days)))
@@ -17464,12 +17512,13 @@ both scheduled and deadline timestamps."
(regexp (org-re-timestamp org-ts-type))
(callback
`(lambda ()
- (and ,(if (memq org-ts-type '(active inactive all))
- '(eq (org-element-type (org-element-context)) 'timestamp)
- '(org-at-planning-p))
- (time-less-p
- (org-time-string-to-time (match-string 1))
- (org-time-string-to-time date))))))
+ (let ((match (match-string 1)))
+ (and ,(if (memq org-ts-type '(active inactive all))
+ '(eq (org-element-type (org-element-context)) 'timestamp)
+ '(org-at-planning-p))
+ (time-less-p
+ (org-time-string-to-time match)
+ (org-time-string-to-time date)))))))
(message "%d entries before %s"
(org-occur regexp nil callback) date)))
@@ -17480,12 +17529,13 @@ both scheduled and deadline timestamps."
(regexp (org-re-timestamp org-ts-type))
(callback
`(lambda ()
- (and ,(if (memq org-ts-type '(active inactive all))
- '(eq (org-element-type (org-element-context)) 'timestamp)
- '(org-at-planning-p))
- (not (time-less-p
- (org-time-string-to-time (match-string 1))
- (org-time-string-to-time date)))))))
+ (let ((match (match-string 1)))
+ (and ,(if (memq org-ts-type '(active inactive all))
+ '(eq (org-element-type (org-element-context)) 'timestamp)
+ '(org-at-planning-p))
+ (not (time-less-p
+ (org-time-string-to-time match)
+ (org-time-string-to-time date))))))))
(message "%d entries after %s"
(org-occur regexp nil callback) date)))
@@ -17595,7 +17645,7 @@ days in order to avoid rounding problems."
(error (error "Bad timestamp `%s'%s\nError was: %s"
s (if (not (and buffer pos))
""
- (format " at %d in buffer `%s'" pos buffer))
+ (format-message " at %d in buffer `%s'" pos buffer))
(cdr errdata)))))
(defun org-time-string-to-seconds (s)
@@ -17624,7 +17674,7 @@ The variable `date' is bound by the calendar when this is called."
(error (error "Bad timestamp `%s'%s\nError was: %s"
s (if (not (and buffer pos))
""
- (format " at %d in buffer `%s'" pos buffer))
+ (format-message " at %d in buffer `%s'" pos buffer))
(cdr errdata))))))))
(defun org-days-to-iso-week (days)
@@ -17850,7 +17900,14 @@ With prefix ARG, change that many days."
(org-timestamp-change (- (prefix-numeric-value arg)) 'day) 'updown))
(defun org-at-timestamp-p (&optional inactive-ok)
- "Determine if the cursor is in or at a timestamp."
+ "Non-nil if point is inside a timestamp.
+
+When optional argument INACTIVE-OK is non-nil, also consider
+inactive timestamps.
+
+When this function returns a non-nil value, match data is set
+according to `org-ts-regexp3' or `org-ts-regexp2', depending on
+INACTIVE-OK."
(interactive)
(let* ((tsr (if inactive-ok org-ts-regexp3 org-ts-regexp2))
(pos (point))
@@ -18055,7 +18112,7 @@ When SUPPRESS-TMP-DELAY is non-nil, suppress delays like \"--2d\"."
(setq m (+ m n)))
(if (< m 0) (setq m (+ m 60) h (1- h)))
(if (> m 59) (setq m (- m 60) h (1+ h)))
- (setq h (min 24 (max 0 h)))
+ (setq h (mod h 24))
(setq ng 1 new (format "-%02d:%02d" h m)))
((org-pos-in-match-range pos 6)
(setq ng 6 new (car (rassoc (+ n (cdr (assoc (match-string 6 s) idx))) idx))))
@@ -18416,7 +18473,7 @@ If EXCLUDE-TMP is non-nil, ignore temporary buffers."
((eq predicate 'files)
(lambda (b) (with-current-buffer b (derived-mode-p 'org-mode))))
((eq predicate 'export)
- (lambda (b) (string-match "\*Org .*Export" (buffer-name b))))
+ (lambda (b) (string-match "\\*Org .*Export" (buffer-name b))))
((eq predicate 'agenda)
(lambda (b)
(with-current-buffer b
@@ -18425,7 +18482,7 @@ If EXCLUDE-TMP is non-nil, ignore temporary buffers."
(member (file-truename bfn) agenda-files)))))
(t (lambda (b) (with-current-buffer b
(or (derived-mode-p 'org-mode)
- (string-match "\*Org .*Export"
+ (string-match "\\*Org .*Export"
(buffer-name b)))))))))
(delq nil
(mapcar
@@ -18545,18 +18602,15 @@ un-expanded file names."
If the current buffer visits an agenda file, find the next one in the list.
If the current buffer does not, find the first agenda file."
(interactive)
- (let* ((fs (org-agenda-files t))
- (files (append fs (list (car fs))))
- (tcf (if buffer-file-name (file-truename buffer-file-name)))
+ (let* ((fs (or (org-agenda-files t)
+ (user-error "No agenda files")))
+ (files (copy-sequence fs))
+ (tcf (and buffer-file-name (file-truename buffer-file-name)))
file)
- (unless files (user-error "No agenda files"))
- (catch 'exit
- (while (setq file (pop files))
- (if (equal (file-truename file) tcf)
- (when (car files)
- (find-file (car files))
- (throw 'exit t))))
- (find-file (car fs)))
+ (when tcf
+ (while (and (setq file (pop files))
+ (not (equal (file-truename file) tcf)))))
+ (find-file (car (or files fs)))
(if (buffer-base-buffer) (org-pop-to-buffer-same-window (buffer-base-buffer)))))
(defun org-agenda-file-to-front (&optional to-end)
@@ -18638,8 +18692,8 @@ which might be released later."
"Release all buffers in list, asking the user for confirmation when needed.
When a buffer is unmodified, it is just killed. When modified, it is saved
\(if the user agrees) and then killed."
- (let (buf file)
- (while (setq buf (pop blist))
+ (let (file)
+ (dolist (buf blist)
(setq file (buffer-file-name buf))
(when (and (buffer-modified-p buf)
file
@@ -18661,7 +18715,7 @@ When a buffer is unmodified, it is just killed. When modified, it is saved
org-tag-groups-alist-for-agenda nil)
(save-excursion
(save-restriction
- (while (setq file (pop files))
+ (dolist (file files)
(catch 'nextfile
(if (bufferp file)
(set-buffer file)
@@ -18702,7 +18756,7 @@ When a buffer is unmodified, it is just killed. When modified, it is saved
(if (org-at-heading-p t)
(add-text-properties (point-at-bol) (org-end-of-subtree t) pa))))
(goto-char (point-min))
- (setq re (format "^\\* .*\\<%s\\>" org-comment-string))
+ (setq re (format "^\\*+ .*\\<%s\\>" org-comment-string))
(while (re-search-forward re nil t)
(when (save-match-data (org-in-commented-heading-p t))
(add-text-properties
@@ -19727,7 +19781,7 @@ boundaries."
(org-defkey org-mode-map "\C-i" 'org-cycle)
(org-defkey org-mode-map [(tab)] 'org-cycle)
(org-defkey org-mode-map [(control tab)] 'org-force-cycle-archived)
-(org-defkey org-mode-map "\M-\t" 'pcomplete)
+(org-defkey org-mode-map "\M-\t" #'pcomplete)
;; The following line is necessary under Suse GNU/Linux
(unless (featurep 'xemacs)
(org-defkey org-mode-map [S-iso-lefttab] 'org-shifttab))
@@ -19796,7 +19850,7 @@ boundaries."
(org-defkey org-mode-map [?\C-c (right)] 'org-shiftright)
(org-defkey org-mode-map [?\C-c ?\C-x (right)] 'org-shiftcontrolright)
(org-defkey org-mode-map [?\C-c ?\C-x (left)] 'org-shiftcontrolleft)
- (org-defkey org-mode-map [?\e (tab)] 'pcomplete)
+ (org-defkey org-mode-map [?\e (tab)] #'pcomplete)
(org-defkey org-mode-map [?\e (shift return)] 'org-insert-todo-heading)
(org-defkey org-mode-map [?\e (shift left)] 'org-shiftmetaleft)
(org-defkey org-mode-map [?\e (shift right)] 'org-shiftmetaright)
@@ -21166,7 +21220,8 @@ This command does many different things, depending on context:
;; a `table.el' type, just give up. At a table row or
;; cell, maybe recalculate line but always align table.
(if (eq (org-element-property :type context) 'table.el)
- (message "Use C-c ' to edit table.el tables")
+ (message "%s" (substitute-command-keys "\\<org-mode-map>\
+Use \\[org-edit-special] to edit table.el tables"))
(let ((org-enable-table-editor t))
(if (or (eq type 'table)
;; Check if point is at a TBLFM line.
@@ -21267,66 +21322,58 @@ will not happen if point is in a table or on a \"dead\"
object (e.g., within a comment). In these case, you need to use
`org-open-at-point' directly."
(interactive)
- (if (and (not (bolp))
+ (let* ((context (if org-return-follows-link (org-element-context)
+ (org-element-at-point)))
+ (type (org-element-type context)))
+ (cond
+ ;; In a table, call `org-table-next-row'.
+ ((or (and (eq type 'table)
+ (>= (point) (org-element-property :contents-begin context))
+ (< (point) (org-element-property :contents-end context)))
+ (org-element-lineage context '(table-row table-cell) t))
+ (org-table-justify-field-maybe)
+ (call-interactively #'org-table-next-row))
+ ;; On a link or a timestamp but not on white spaces after it,
+ ;; call `org-open-line' if `org-return-follows-link' allows it.
+ ((and org-return-follows-link
+ (memq type '(link timestamp))
+ (< (point)
+ (save-excursion (goto-char (org-element-property :end context))
+ (skip-chars-backward " \t")
+ (point))))
+ (call-interactively #'org-open-at-point))
+ ;; Insert newline in heading, but preserve tags.
+ ((and (not (bolp))
(save-excursion (beginning-of-line)
(looking-at org-complex-heading-regexp)))
- ;; At headline.
- (let ((tags-column (when (match-beginning 5)
- (save-excursion (goto-char (match-beginning 5))
- (current-column))))
- ;; Test if before or after headline title.
- (string (when (and (match-end 4)
- (not (or (< (point)
- (or (match-end 3)
- (match-end 2)
- (save-excursion
- (goto-char (match-beginning 4))
- (skip-chars-backward " \t")
- (point))))
- (and (match-beginning 5)
- (>= (point) (match-beginning 5))))))
- ;; Point is on headline keywords, tags or cookies. Do not break
- ;; them: add a newline after the headline instead.
- (org-string-nw-p
- (delete-and-extract-region (point) (match-end 4))))))
- ;; Adjust alignment of tags.
- (when (and tags-column string)
- (org-align-tags-here (if org-auto-align-tags
- org-tags-column
- tags-column)))
+ ;; At headline. Split line. However, if point is on keyword,
+ ;; priority cookie or tags, do not break any of them: add
+ ;; a newline after the headline instead.
+ (let ((tags-column (and (match-beginning 5)
+ (save-excursion (goto-char (match-beginning 5))
+ (current-column))))
+ (string
+ (when (and (match-end 4)
+ (>= (point)
+ (or (match-end 3) (match-end 2) (1+ (match-end 1))))
+ (<= (point) (match-end 4)))
+ (delete-and-extract-region (point) (match-end 4)))))
+ (when (and tags-column string) ; Adjust tag alignment.
+ (org-align-tags-here
+ (if org-auto-align-tags org-tags-column tags-column)))
(end-of-line)
(org-show-entry)
(if indent (newline-and-indent) (newline))
- (and string (save-excursion (insert (org-trim string)))))
- (let* ((context (if org-return-follows-link (org-element-context)
- (org-element-at-point)))
- (type (org-element-type context)))
- (cond
- ;; In a table, call `org-table-next-row'.
- ((or (and (eq type 'table)
- (>= (point) (org-element-property :contents-begin context))
- (< (point) (org-element-property :contents-end context)))
- (org-element-lineage context '(table-row table-cell) t))
- (org-table-justify-field-maybe)
- (call-interactively #'org-table-next-row))
- ;; On a link or a timestamp but not on white spaces after it,
- ;; call `org-open-line' if `org-return-follows-link' allows it.
- ((and org-return-follows-link
- (memq type '(link timestamp))
- (< (point)
- (save-excursion (goto-char (org-element-property :end context))
- (skip-chars-backward " \t")
- (point))))
- (call-interactively #'org-open-at-point))
- ;; In a list, make sure indenting keeps trailing text within.
- ((and indent
- (not (eolp))
- (org-element-lineage context '(item)))
- (let ((trailing-data
- (delete-and-extract-region (point) (line-end-position))))
- (newline-and-indent)
- (save-excursion (insert trailing-data))))
- (t (if indent (newline-and-indent) (newline)))))))
+ (when string (save-excursion (insert (org-trim string))))))
+ ;; In a list, make sure indenting keeps trailing text within.
+ ((and indent
+ (not (eolp))
+ (org-element-lineage context '(item)))
+ (let ((trailing-data
+ (delete-and-extract-region (point) (line-end-position))))
+ (newline-and-indent)
+ (save-excursion (insert trailing-data))))
+ (t (if indent (newline-and-indent) (newline))))))
(defun org-return-indent ()
"Goto next table row or insert a newline and indent.
@@ -21599,11 +21646,11 @@ number of stars to add."
(forward-line)))))))
(unless toggled (message "Cannot toggle heading from here"))))
-(defun org-meta-return (&optional arg)
+(defun org-meta-return (&optional _arg)
"Insert a new heading or wrap a region in a table.
Calls `org-insert-heading' or `org-table-wrap-region', depending
on context. See the individual commands for more information."
- (interactive "P")
+ (interactive)
(org-check-before-invisible-edit 'insert)
(or (run-hook-with-args-until-success 'org-metareturn-hook)
(call-interactively (if (org-at-table-p) #'org-table-wrap-region
@@ -21896,6 +21943,7 @@ output buffer into your mail program, as it gives us important
information about your Org-mode version and configuration."
(interactive)
(require 'reporter)
+ (defvar reporter-prompt-for-summary-p)
(org-load-modules-maybe)
(org-require-autoloaded-modules)
(let ((reporter-prompt-for-summary-p "Bug report subject: "))
@@ -22144,11 +22192,13 @@ upon the next fontification round."
'invisible 'org-link s))
(setq s (concat (substring s 0 b)
(substring s (or (next-single-property-change
- b 'invisible s) (length s)))))))
+ b 'invisible s)
+ (length s)))))))
(while (setq b (text-property-any 0 (length s) 'org-cwidth t s))
(setq s (concat (substring s 0 b)
(substring s (or (next-single-property-change
- b 'org-cwidth s) (length s))))))
+ b 'org-cwidth s)
+ (length s))))))
(setq l (string-width s) b -1)
(while (setq b (text-property-any (1+ b) (length s) 'org-dwidth t s))
(setq l (- l (get-text-property b 'org-dwidth-n s))))
@@ -22245,11 +22295,9 @@ N may optionally be the number of spaces to remove."
(defun org-fill-template (template alist)
"Find each %key of ALIST in TEMPLATE and replace it."
- (let ((case-fold-search nil)
- entry key value)
- (setq alist (sort (copy-sequence alist)
- (lambda (a b) (< (length (car a)) (length (car b))))))
- (while (setq entry (pop alist))
+ (let ((case-fold-search nil))
+ (dolist (entry (sort (copy-sequence alist)
+ (lambda (a b) (< (length (car a)) (length (car b))))))
(setq template
(replace-regexp-in-string
(concat "%" (regexp-quote (car entry)))
@@ -22537,23 +22585,24 @@ block from point."
names))
nil)))
-(defun org-occur-in-agenda-files (regexp &optional nlines)
+(defun org-occur-in-agenda-files (regexp &optional _nlines)
"Call `multi-occur' with buffers for all agenda files."
- (interactive "sOrg-files matching: \np")
+ (interactive "sOrg-files matching: ")
(let* ((files (org-agenda-files))
- (tnames (mapcar 'file-truename files))
- (extra org-agenda-text-search-extra-files)
- f)
+ (tnames (mapcar #'file-truename files))
+ (extra org-agenda-text-search-extra-files))
(when (eq (car extra) 'agenda-archives)
(setq extra (cdr extra))
(setq files (org-add-archive-files files)))
- (while (setq f (pop extra))
+ (dolist (f extra)
(unless (member (file-truename f) tnames)
- (add-to-list 'files f 'append)
- (add-to-list 'tnames (file-truename f) 'append)))
+ (unless (member f files) (setq files (append files (list f))))
+ (setq tnames (append tnames (list (file-truename f))))))
(multi-occur
(mapcar (lambda (x)
(with-current-buffer
+ ;; FIXME: Why not just (find-file-noselect x)?
+ ;; Is it to avoid the "revert buffer" prompt?
(or (get-file-buffer x) (find-file-noselect x))
(widen)
(current-buffer)))
@@ -22603,8 +22652,8 @@ for the search purpose."
For example, in this alist:
-\(org-uniquify-alist '((a 1) (b 2) (a 3)))
- => '((a 1 3) (b 2))
+\(org-uniquify-alist \\='((a 1) (b 2) (a 3)))
+ => \\='((a 1 3) (b 2))
merge (a 1) and (a 3) into (a 1 3).
@@ -22738,7 +22787,7 @@ so values can contain further %-escapes if they are define later in TABLE."
(case-fold-search nil)
(pchg 0)
e re rpl)
- (while (setq e (pop tbl))
+ (dolist (e tbl)
(setq re (concat "%-?[0-9.]*" (substring (car e) 1)))
(when (and (cdr e) (string-match re (cdr e)))
(let ((sref (substring (cdr e) (match-beginning 0) (match-end 0)))
@@ -22801,7 +22850,7 @@ This works in the calendar and in the agenda, anywhere else it just
returns the current time.
If WITH-TIME is non-nil, returns the time of the event at point (in
the agenda) or the current time of the day."
- (let (date day defd tp tm hod mod)
+ (let (date day defd tp hod mod)
(when with-time
(setq tp (get-text-property (point) 'time))
(when (and tp (string-match "\\([0-9][0-9]\\):\\([0-9][0-9]\\)" tp))
@@ -23634,7 +23683,7 @@ major mode."
(insert "# ")))
(defvar comment-empty-lines) ; From newcomment.el.
-(defun org-comment-or-uncomment-region (beg end &rest ignore)
+(defun org-comment-or-uncomment-region (beg end &rest _)
"Comment or uncomment each non-blank line in the region.
Uncomment each non-blank line between BEG and END if it only
contains commented lines. Otherwise, comment them. If region is
@@ -23801,6 +23850,10 @@ it has a `diary' type."
;;; Other stuff.
+(defvar reftex-docstruct-symbol)
+(defvar reftex-cite-format)
+(defvar org--rds)
+
(defun org-reftex-citation ()
"Use reftex-citation to insert a citation into the buffer.
This looks for a line like
@@ -23815,9 +23868,9 @@ into the buffer.
Export of such citations to both LaTeX and HTML is handled by the contributed
package ox-bibtex by Taru Karttunen."
(interactive)
- (let ((reftex-docstruct-symbol 'rds)
+ (let ((reftex-docstruct-symbol 'org--rds)
(reftex-cite-format "\\cite{%l}")
- rds bib)
+ org--rds bib)
(save-excursion
(save-restriction
(widen)
@@ -23828,7 +23881,7 @@ package ox-bibtex by Taru Karttunen."
(re-search-backward re nil t))))
(user-error "No bibliography defined in file")
(setq bib (concat (match-string 1) ".bib")
- rds (list (list 'bib bib)))))))
+ org--rds (list (list 'bib bib)))))))
(call-interactively 'reftex-citation)))
;;;; Functions extending outline functionality
@@ -23945,11 +23998,11 @@ the cursor is already beyond the end of the headline."
(define-key org-mode-map "\C-a" 'org-beginning-of-line)
(define-key org-mode-map "\C-e" 'org-end-of-line)
-(defun org-backward-sentence (&optional arg)
+(defun org-backward-sentence (&optional _arg)
"Go to beginning of sentence, or beginning of table field.
This will call `backward-sentence' or `org-table-beginning-of-field',
depending on context."
- (interactive "P")
+ (interactive)
(let* ((element (org-element-at-point))
(contents-begin (org-element-property :contents-begin element))
(table (org-element-lineage element '(table) t)))
@@ -23965,11 +24018,11 @@ depending on context."
(org-element-property :contents-end element)))
(call-interactively #'backward-sentence)))))
-(defun org-forward-sentence (&optional arg)
+(defun org-forward-sentence (&optional _arg)
"Go to end of sentence, or end of table field.
This will call `forward-sentence' or `org-table-end-of-field',
depending on context."
- (interactive "P")
+ (interactive)
(let* ((element (org-element-at-point))
(contents-end (org-element-property :contents-end element))
(table (org-element-lineage element '(table) t)))
@@ -23991,9 +24044,9 @@ depending on context."
(define-key org-mode-map "\M-a" 'org-backward-sentence)
(define-key org-mode-map "\M-e" 'org-forward-sentence)
-(defun org-kill-line (&optional arg)
+(defun org-kill-line (&optional _arg)
"Kill line, to tags or end of line."
- (interactive "P")
+ (interactive)
(cond
((or (not org-special-ctrl-k)
(bolp)
diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index 679792a..960bee8 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -161,7 +161,6 @@
(:html-todo-kwd-class-prefix nil nil org-html-todo-kwd-class-prefix)
(:html-toplevel-hlevel nil nil org-html-toplevel-hlevel)
(:html-use-infojs nil nil org-html-use-infojs)
- (:html-use-unicode-chars nil nil org-html-use-unicode-chars)
(:html-validation-link nil nil org-html-validation-link)
(:html-viewport nil nil org-html-viewport)
(:html-inline-images nil nil org-html-inline-images)
@@ -608,13 +607,6 @@ Warning: non-nil may break indentation of source code blocks."
:package-version '(Org . "8.0")
:type 'boolean)
-(defcustom org-html-use-unicode-chars nil
- "Non-nil means to use unicode characters instead of HTML entities."
- :group 'org-export-html
- :version "24.4"
- :package-version '(Org . "8.0")
- :type 'boolean)
-
;;;; Drawers
(defcustom org-html-format-drawer-function (lambda (name contents) contents)
@@ -881,7 +873,7 @@ you can reuse them:
For example:
\(setq org-html-table-row-tags
- (cons '(cond (top-row-p \"<tr class=\\\"tr-top\\\">\")
+ (cons \\='(cond (top-row-p \"<tr class=\\\"tr-top\\\">\")
(bottom-row-p \"<tr class=\\\"tr-bottom\\\">\")
(t (if (= (mod row-number 2) 1)
\"<tr class=\\\"tr-odd\\\">\"
@@ -1005,7 +997,7 @@ org-info.js for your website."
(content "div" "content")
(postamble "div" "postamble"))
"Alist of the three section elements for HTML export.
-The car of each entry is one of 'preamble, 'content or 'postamble.
+The car of each entry is one of `preamble', `content' or `postamble'.
The cdrs of each entry are the ELEMENT_TYPE and ID for each
section of the exported document.
@@ -1184,7 +1176,7 @@ MathJax CDN Terms of Service.
(defcustom org-html-postamble 'auto
"Non-nil means insert a postamble in HTML export.
-When set to 'auto, check against the
+When set to `auto', check against the
`org-export-with-author/email/creator/date' variables to set the
content of the postamble. When set to a string, use this string
as the postamble. When t, insert a string as defined by the
@@ -1481,6 +1473,12 @@ CSS classes, then this prefix can be very useful."
(let ((dt (downcase (plist-get info :html-doctype))))
(member dt '("html5" "xhtml5" "<!doctype html>"))))
+(defun org-html--html5-fancy-p (info)
+ "Non-nil when exporting to HTML5 with fancy elements.
+INFO is the current state of the export process, as a plist."
+ (and (plist-get info :html-html5-fancy)
+ (org-html-html5-p info)))
+
(defun org-html-close-tag (tag attr info)
(concat "<" tag " " attr
(if (org-html-xhtml-p info) " />" ">")))
@@ -1511,8 +1509,7 @@ attributes with a nil value will be omitted from the result."
INFO is a plist used as a communication channel. When optional
arguments CAPTION and LABEL are given, use them for caption and
\"id\" attribute."
- (let ((html5-fancy (and (org-html-html5-p info)
- (plist-get info :html-html5-fancy))))
+ (let ((html5-fancy (org-html--html5-fancy-p info)))
(format (if html5-fancy "\n<figure%s>%s%s\n</figure>"
"\n<div%s class=\"figure\">%s%s\n</div>")
;; ID.
@@ -1814,7 +1811,7 @@ used in the preamble or postamble."
(defun org-html--build-pre/postamble (type info)
"Return document preamble or postamble as a string, or nil.
-TYPE is either 'preamble or 'postamble, INFO is a plist used as a
+TYPE is either `preamble' or `postamble', INFO is a plist used as a
communication channel."
(let ((section (plist-get info (intern (format ":html-%s" type))))
(spec (org-html-format-spec info)))
@@ -1937,16 +1934,17 @@ holding export options."
;; Document title.
(when (plist-get info :with-title)
(let ((title (plist-get info :title))
- (subtitle (plist-get info :subtitle)))
+ (subtitle (plist-get info :subtitle))
+ (html5-fancy (org-html--html5-fancy-p info)))
(when title
(format
- (if (plist-get info :html-html5-fancy)
+ (if html5-fancy
"<header>\n<h1 class=\"title\">%s</h1>\n%s</header>"
"<h1 class=\"title\">%s%s</h1>\n")
(org-export-data title info)
(if subtitle
(format
- (if (plist-get info :html-html5-fancy)
+ (if html5-fancy
"<p class=\"subtitle\">%s</p>\n"
"\n<br>\n<span class=\"subtitle\">%s</span>\n")
(org-export-data subtitle info))
@@ -2141,8 +2139,7 @@ of contents as a string, or nil if it is empty."
(org-html--toc-text toc-entries)
"</div>\n")))
(if scope toc
- (let ((outer-tag (if (and (org-html-html5-p info)
- (plist-get info :html-html5-fancy))
+ (let ((outer-tag (if (org-html--html5-fancy-p info)
"nav"
"div")))
(concat (format "<%s id=\"table-of-contents\">\n" outer-tag)
@@ -2308,7 +2305,7 @@ contextual information."
"Transcode a CENTER-BLOCK element from Org to HTML.
CONTENTS holds the contents of the block. INFO is a plist
holding contextual information."
- (format "<div class=\"center\">\n%s</div>" contents))
+ (format "<div class=\"org-center\">\n%s</div>" contents))
;;;; Clock
@@ -2784,7 +2781,7 @@ Bind `org-html-standalone-image-predicate' to constrain paragraph
further. For example, to check for only captioned standalone
images, set it to:
- \(lambda (paragraph) (org-element-property :caption paragraph))"
+ (lambda (paragraph) (org-element-property :caption paragraph))"
(let ((paragraph (case (org-element-type element)
(paragraph element)
(link (org-export-get-parent element)))))
@@ -2814,17 +2811,16 @@ INFO is a plist holding contextual information. See
(org-trim (plist-get info :html-link-home))))
(use-abs-url (plist-get info :html-link-use-abs-url))
(link-org-files-as-html-maybe
- (function
- (lambda (raw-path info)
- "Treat links to `file.org' as links to `file.html', if needed.
- See `org-html-link-org-files-as-html'."
- (cond
- ((and (plist-get info :html-link-org-files-as-html)
- (string= ".org"
- (downcase (file-name-extension raw-path "."))))
- (concat (file-name-sans-extension raw-path) "."
- (plist-get info :html-extension)))
- (t raw-path)))))
+ (lambda (raw-path info)
+ ;; Treat links to `file.org' as links to `file.html', if
+ ;; needed. See `org-html-link-org-files-as-html'.
+ (cond
+ ((and (plist-get info :html-link-org-files-as-html)
+ (string= ".org"
+ (downcase (file-name-extension raw-path "."))))
+ (concat (file-name-sans-extension raw-path) "."
+ (plist-get info :html-extension)))
+ (t raw-path))))
(type (org-element-property :type link))
(raw-path (org-element-property :path link))
;; Ensure DESC really exists, or set it to nil.
@@ -2832,9 +2828,8 @@ INFO is a plist holding contextual information. See
(path
(cond
((member type '("http" "https" "ftp" "mailto"))
- (org-html-encode-plain-text
- (org-link-escape-browser
- (org-link-unescape (concat type ":" raw-path)))))
+ (org-link-escape-browser
+ (org-link-unescape (concat type ":" raw-path))))
((string= type "file")
;; Treat links to ".org" files as ".html", if needed.
(setq raw-path
@@ -2953,21 +2948,25 @@ INFO is a plist holding contextual information. See
;; Coderef: replace link with the reference name or the
;; equivalent line number.
((string= type "coderef")
- (let ((fragment (concat "coderef-" path)))
+ (let ((fragment (concat "coderef-" (org-html-encode-plain-text path))))
(format "<a href=\"#%s\"%s%s>%s</a>"
fragment
- (org-trim
- (format (concat "class=\"coderef\""
- " onmouseover=\"CodeHighlightOn(this, '%s');\""
- " onmouseout=\"CodeHighlightOff(this, '%s');\"")
- fragment fragment))
+ (format "class=\"coderef\" onmouseover=\"CodeHighlightOn(this, \
+'%s');\" onmouseout=\"CodeHighlightOff(this, '%s');\""
+ fragment fragment)
attributes
(format (org-export-get-coderef-format path desc)
(org-export-resolve-coderef path info)))))
;; External link with a description part.
- ((and path desc) (format "<a href=\"%s\"%s>%s</a>" path attributes desc))
+ ((and path desc) (format "<a href=\"%s\"%s>%s</a>"
+ (org-html-encode-plain-text path)
+ attributes
+ desc))
;; External link without a description part.
- (path (format "<a href=\"%s\"%s>%s</a>" path attributes path))
+ (path (format "<a href=\"%s\"%s>%s</a>"
+ (org-html-encode-plain-text path)
+ attributes
+ path))
;; No path, only description. Try to do something useful.
(t (format "<i>%s</i>" desc)))))
@@ -3189,8 +3188,7 @@ CONTENTS holds the contents of the block. INFO is a plist
holding contextual information."
(let* ((block-type (org-element-property :type special-block))
(contents (or contents ""))
- (html5-fancy (and (org-html-html5-p info)
- (plist-get info :html-html5-fancy)
+ (html5-fancy (and (org-html--html5-fancy-p info)
(member block-type org-html-html5-elements)))
(attributes (org-export-read-attribute :attr_html special-block)))
(unless html5-fancy
@@ -3500,9 +3498,6 @@ contextual information."
(set-auto-mode t)
(if (plist-get info :html-indent)
(indent-region (point-min) (point-max)))
- (when (plist-get info :html-use-unicode-chars)
- (require 'mm-url)
- (mm-url-decode-entities))
(buffer-substring-no-properties (point-min) (point-max))))
diff --git a/lisp/ox-icalendar.el b/lisp/ox-icalendar.el
index 6778eae..aefddf8 100644
--- a/lisp/ox-icalendar.el
+++ b/lisp/ox-icalendar.el
@@ -1,6 +1,6 @@
;;; ox-icalendar.el --- iCalendar Back-End for Org Export Engine
-;; Copyright (C) 2004-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2004-2015 Free Software Foundation, Inc.
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Nicolas Goaziou <n dot goaziou at gmail dot com>
@@ -450,7 +450,7 @@ or subject for the event."
;; characters with literal \n.
(replace-regexp-in-string
"[ \t]*\n" "\\n"
- (replace-regexp-in-string "[\\,;]" "\\\&" s)
+ (replace-regexp-in-string "[\\,;]" "\\\\\\&" s)
nil t)))
(defun org-icalendar-fold-string (s)
diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index c3eb1ea..1840a54 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -426,9 +426,9 @@ references."
If #+LATEX_CLASS is set in the buffer, use its value and the
associated information. Here is the structure of each cell:
- \(class-name
+ (class-name
header-string
- \(numbered-section . unnumbered-section)
+ (numbered-section . unnumbered-section)
...)
The header string
@@ -499,11 +499,11 @@ section string and will be replaced by the title of the section.
Instead of a cons cell (numbered . unnumbered), you can also
provide a list of 2 or 4 elements,
- \(numbered-open numbered-close)
+ (numbered-open numbered-close)
or
- \(numbered-open numbered-close unnumbered-open unnumbered-close)
+ (numbered-open numbered-close unnumbered-open unnumbered-close)
providing opening and closing strings for a LaTeX environment
that should represent the document section. The opening clause
@@ -610,12 +610,18 @@ This format string may contain these elements:
If you need to use a \"%\" character, you need to escape it
like that: \"%%\".
+As a special case, a nil value prevents template from being
+inserted.
+
Setting :latex-hyperref-template in publishing projects will take
precedence over this variable."
:group 'org-export-latex
:version "25.1"
:package-version '(Org . "8.3")
- :type '(string :tag "Format string"))
+ :type '(choice (const :tag "No template" nil)
+ (string :tag "Format string")))
+(define-obsolete-variable-alias
+ 'org-latex-with-hyperref 'org-latex-hyperref-template "25.1")
;;;; Headline
@@ -873,21 +879,21 @@ listings package, and if you want to have color, the color
package. Just add these to `org-latex-packages-alist', for
example using customize, or with something like:
- \(require 'ox-latex)
- \(add-to-list 'org-latex-packages-alist '(\"\" \"listings\"))
- \(add-to-list 'org-latex-packages-alist '(\"\" \"color\"))
+ (require \\='ox-latex)
+ (add-to-list \\='org-latex-packages-alist \\='(\"\" \"listings\"))
+ (add-to-list \\='org-latex-packages-alist \\='(\"\" \"color\"))
Alternatively,
- \(setq org-latex-listings 'minted)
+ (setq org-latex-listings \\='minted)
causes source code to be exported using the minted package as
opposed to listings. If you want to use minted, you need to add
the minted package to `org-latex-packages-alist', for example
using customize, or with
- \(require 'ox-latex)
- \(add-to-list 'org-latex-packages-alist '(\"newfloat\" \"minted\"))
+ (require \\='ox-latex)
+ (add-to-list \\='org-latex-packages-alist \\='(\"newfloat\" \"minted\"))
In addition, it is necessary to install pygments
\(http://pygments.org), and to configure the variable
@@ -940,9 +946,9 @@ These options are supplied as a comma-separated list to the
a list containing two strings: the name of the option, and the
value. For example,
- \(setq org-latex-listings-options
- '((\"basicstyle\" \"\\\\small\")
- \(\"keywordstyle\" \"\\\\color{black}\\\\bfseries\\\\underbar\")))
+ (setq org-latex-listings-options
+ \\='((\"basicstyle\" \"\\\\small\")
+ (\"keywordstyle\" \"\\\\color{black}\\\\bfseries\\\\underbar\")))
will typeset the code in a small size font with underlined, bold
black keywords.
@@ -993,8 +999,8 @@ These options are supplied within square brackets in
be a list containing two strings: the name of the option, and the
value. For example,
- \(setq org-latex-minted-options
- '\((\"bgcolor\" \"bg\") \(\"frame\" \"lines\")))
+ (setq org-latex-minted-options
+ '((\"bgcolor\" \"bg\") (\"frame\" \"lines\")))
will result in src blocks being exported with
@@ -1020,8 +1026,8 @@ block-specific options, you may use the following syntax:
It is used during export of src blocks by the listings and minted
latex packages. For example,
- \(setq org-latex-custom-lang-environments
- '\(\(python \"pythoncode\"\)\)\)
+ (setq org-latex-custom-lang-environments
+ '((python \"pythoncode\")))
would have the effect that if org encounters begin_src python
during latex export it will output
@@ -3433,7 +3439,7 @@ Return PDF file name or an error if it couldn't be produced."
default-directory))
(time (current-time))
warnings)
- (unless snippet (message (format "Processing LaTeX file %s..." texfile)))
+ (unless snippet (message "Processing LaTeX file %s..." texfile))
(save-window-excursion
(cond
;; A function is provided: Apply it.
diff --git a/lisp/ox-man.el b/lisp/ox-man.el
index 6388a55..a5d0d49 100644
--- a/lisp/ox-man.el
+++ b/lisp/ox-man.el
@@ -210,8 +210,8 @@ in this list - but it does not hurt if it is present."
It is used during export of src blocks by the listings and
man packages. For example,
- \(setq org-man-custom-lang-environments
- '\(\(python \"pythoncode\"\)\)\)
+ (setq org-man-custom-lang-environments
+ '((python \"pythoncode\")))
would have the effect that if org encounters begin_src python
during man export."
@@ -1196,7 +1196,7 @@ Return PDF file name or an error if it couldn't be produced."
(file-name-directory full-name)
default-directory))
errors)
- (message (format "Processing Groff file %s..." file))
+ (message "Processing Groff file %s..." file)
(save-window-excursion
(cond
;; A function is provided: Apply it.
@@ -1225,8 +1225,8 @@ Return PDF file name or an error if it couldn't be produced."
;; Check for process failure. Provide collected errors if
;; possible.
(if (not (file-exists-p pdffile))
- (error (concat (format "PDF file %s wasn't produced" pdffile)
- (when errors (concat ": " errors))))
+ (error "PDF file %s wasn't produced%s" pdffile
+ (if errors (concat ": " errors) ""))
;; Else remove log files, when specified, and signal end of
;; process to user, along with any error encountered.
(when org-man-remove-logfiles
diff --git a/lisp/ox-md.el b/lisp/ox-md.el
index e4291e5..602c149 100644
--- a/lisp/ox-md.el
+++ b/lisp/ox-md.el
@@ -107,7 +107,8 @@ to this rule:
1. Preserve blank lines between sibling items in a plain list,
2. In an item, remove any blank line before the very first
- paragraph and the next sub-list.
+ paragraph and the next sub-list when the latter ends the
+ current item.
Assume BACKEND is `md'."
(org-element-map tree (remq 'item org-element-all-elements)
@@ -116,9 +117,10 @@ Assume BACKEND is `md'."
e :post-blank
(if (and (eq (org-element-type e) 'paragraph)
(eq (org-element-type (org-element-property :parent e)) 'item)
- (eq (org-element-type (org-export-get-next-element e info))
- 'plain-list)
- (not (org-export-get-previous-element e info)))
+ (org-export-first-sibling-p e info)
+ (let ((next (org-export-get-next-element e info)))
+ (and (eq (org-element-type next) 'plain-list)
+ (not (org-export-get-next-element next info)))))
0
1))))
;; Return updated tree.
@@ -196,8 +198,9 @@ a communication channel."
(and char (format "[#%c] " char)))))
(anchor
(and (plist-get info :with-toc)
- (org-html--anchor
- (org-export-get-reference headline info) nil nil info)))
+ (format "<a id=\"%s\"></a>"
+ (or (org-element-property :CUSTOM_ID headline)
+ (org-export-get-reference headline info)))))
;; Headline text without tags.
(heading (concat todo priority title))
(style (plist-get info :md-headline-style)))
@@ -213,7 +216,7 @@ a communication channel."
(car (last (org-export-get-headline-number
headline info))))
"."))))
- (concat bullet (make-string (- 4 (length bullet)) ? ) heading tags
+ (concat bullet (make-string (- 4 (length bullet)) ?\s) heading tags
"\n\n"
(and contents
(replace-regexp-in-string "^" " " contents)))))
@@ -224,7 +227,8 @@ a communication channel."
"\n\n"
contents))
;; Use "atx" style.
- (t (concat (make-string level ?#) " " heading tags anchor "\n\n" contents))))))
+ (t (concat (make-string level ?#) " " heading tags anchor "\n\n"
+ contents))))))
;;;; Horizontal Rule
@@ -301,33 +305,50 @@ channel."
CONTENTS is the link's description. INFO is a plist used as
a communication channel."
(let ((link-org-files-as-md
- (function
- (lambda (raw-path)
- ;; Treat links to `file.org' as links to `file.md'.
- (if (string= ".org" (downcase (file-name-extension raw-path ".")))
- (concat (file-name-sans-extension raw-path) ".md")
- raw-path))))
+ (lambda (raw-path)
+ ;; Treat links to `file.org' as links to `file.md'.
+ (if (string= ".org" (downcase (file-name-extension raw-path ".")))
+ (concat (file-name-sans-extension raw-path) ".md")
+ raw-path)))
(type (org-element-property :type link)))
(cond
;; Link type is handled by a special function.
((org-export-custom-protocol-maybe link contents 'md))
- ((member type '("custom-id" "id"))
- (let ((destination (org-export-resolve-id-link link info)))
- (if (stringp destination) ; External file.
- (let ((path (funcall link-org-files-as-md destination)))
- (if (not contents) (format "<%s>" path)
- (format "[%s](%s)" contents path)))
- (concat
- (and contents (concat contents " "))
- (format "(%s)"
- (format (org-export-translate "See section %s" :html info)
- (if (org-export-numbered-headline-p destination info)
- (mapconcat #'number-to-string
- (org-export-get-headline-number
- destination info)
- ".")
- (org-export-data
- (org-element-property :title destination) info))))))))
+ ((member type '("custom-id" "id" "fuzzy"))
+ (let ((destination (if (string= type "fuzzy")
+ (org-export-resolve-fuzzy-link link info)
+ (org-export-resolve-id-link link info))))
+ (case (org-element-type destination)
+ (plain-text ; External file.
+ (let ((path (funcall link-org-files-as-md destination)))
+ (if (not contents) (format "<%s>" path)
+ (format "[%s](%s)" contents path))))
+ (headline
+ (format
+ "[%s](#%s)"
+ ;; Description.
+ (cond ((org-string-nw-p contents))
+ ((org-export-numbered-headline-p destination info)
+ (mapconcat #'number-to-string
+ (org-export-get-headline-number destination info)
+ "."))
+ (t (org-export-data (org-element-property :title destination)
+ info)))
+ ;; Reference.
+ (or (org-element-property :CUSTOM_ID destination)
+ (org-export-get-reference destination info))))
+ (t
+ (let ((description
+ (or (org-string-nw-p contents)
+ (let ((number (org-export-get-ordinal destination info)))
+ (cond
+ ((not number) nil)
+ ((atom number) (number-to-string number))
+ (t (mapconcat #'number-to-string number ".")))))))
+ (when description
+ (format "[%s](#%s)"
+ description
+ (org-export-get-reference destination info))))))))
((org-export-inline-image-p link org-html-inline-image-rules)
(let ((path (let ((raw-path (org-element-property :path link)))
(if (not (file-name-absolute-p raw-path)) raw-path
@@ -343,19 +364,6 @@ a communication channel."
(format (org-export-get-coderef-format ref contents)
(org-export-resolve-coderef ref info))))
((equal type "radio") contents)
- ((equal type "fuzzy")
- (let ((destination (org-export-resolve-fuzzy-link link info)))
- (if (org-string-nw-p contents) contents
- (when destination
- (let ((number (org-export-get-ordinal destination info)))
- (if number
- (if (atom number) (number-to-string number)
- (mapconcat #'number-to-string number "."))
- ;; Unnumbered headline.
- (and (eq 'headline (org-element-type destination))
- ;; BUG: shouldn't headlines have a form like [ref](name) in md?
- (org-export-data
- (org-element-property :title destination) info))))))))
(t (let* ((raw-path (org-element-property :path link))
(path
(cond
diff --git a/lisp/ox-odt.el b/lisp/ox-odt.el
index e578a17..75353a0 100644
--- a/lisp/ox-odt.el
+++ b/lisp/ox-odt.el
@@ -245,13 +245,13 @@ standard Emacs.")
(defvar org-odt-automatic-styles '()
"Registry of automatic styles for various OBJECT-TYPEs.
The variable has the following form:
-\(\(OBJECT-TYPE-A
- \(\(OBJECT-NAME-A.1 OBJECT-PROPS-A.1\)
- \(OBJECT-NAME-A.2 OBJECT-PROPS-A.2\) ...\)\)
- \(OBJECT-TYPE-B
- \(\(OBJECT-NAME-B.1 OBJECT-PROPS-B.1\)
- \(OBJECT-NAME-B.2 OBJECT-PROPS-B.2\) ...\)\)
- ...\).
+ ((OBJECT-TYPE-A
+ ((OBJECT-NAME-A.1 OBJECT-PROPS-A.1)
+ (OBJECT-NAME-A.2 OBJECT-PROPS-A.2) ...))
+ (OBJECT-TYPE-B
+ ((OBJECT-NAME-B.1 OBJECT-PROPS-B.1)
+ (OBJECT-NAME-B.2 OBJECT-PROPS-B.2) ...))
+ ...).
OBJECT-TYPEs could be \"Section\", \"Table\", \"Figure\" etc.
OBJECT-PROPS is (typically) a plist created by passing
@@ -306,7 +306,7 @@ according to the default face identified by the `htmlfontify'.")
This is an alist where each element is of the form:
- \(STYLE-NAME ATTACH-FMT REF-MODE REF-FMT)
+ (STYLE-NAME ATTACH-FMT REF-MODE REF-FMT)
ATTACH-FMT controls how labels and captions are attached to an
entity. It may contain following specifiers - %e and %c. %e is
@@ -333,7 +333,7 @@ See also `org-odt-format-label'.")
This is a list where each entry is of the form:
- \(CATEGORY-HANDLE OD-VARIABLE LABEL-STYLE CATEGORY-NAME ENUMERATOR-PREDICATE)
+ (CATEGORY-HANDLE OD-VARIABLE LABEL-STYLE CATEGORY-NAME ENUMERATOR-PREDICATE)
CATEGORY_HANDLE identifies the captionable entity in question.
@@ -685,11 +685,11 @@ The default value simply returns the value of CONTENTS."
"Function to format headline text.
This function will be called with 5 arguments:
-TODO the todo keyword \(string or nil\).
-TODO-TYPE the type of todo \(symbol: `todo', `done', nil\)
-PRIORITY the priority of the headline \(integer or nil\)
-TEXT the main headline text \(string\).
-TAGS the tags string, separated with colons \(string or nil\).
+TODO the todo keyword (string or nil).
+TODO-TYPE the type of todo (symbol: `todo', `done', nil)
+PRIORITY the priority of the headline (integer or nil)
+TEXT the main headline text (string).
+TAGS the tags string, separated with colons (string or nil).
The function result will be used as headline text."
:group 'org-export-odt
@@ -867,11 +867,11 @@ ON-OR-OFF := t | nil
For example, with the following configuration
\(setq org-odt-table-styles
- '\(\(\"TableWithHeaderRowsAndColumns\" \"Custom\"
- \(\(use-first-row-styles . t\)
- \(use-first-column-styles . t\)\)\)
- \(\"TableWithHeaderColumns\" \"Custom\"
- \(\(use-first-column-styles . t\)\)\)\)\)
+ '((\"TableWithHeaderRowsAndColumns\" \"Custom\"
+ ((use-first-row-styles . t)
+ (use-first-column-styles . t)))
+ (\"TableWithHeaderColumns\" \"Custom\"
+ ((use-first-column-styles . t)))))
1. A table associated with \"TableWithHeaderRowsAndColumns\"
style will use the following table-cell styles -
@@ -1175,14 +1175,15 @@ table of contents as a string, or nil."
;; /TOC/, as otherwise there will be duplicated anchors one in TOC
;; and one in the document body.
;;
- ;; FIXME: Are there any other objects that need to be suppressed
- ;; within TOC?
+ ;; Likewise, links, footnote references and regular targets are also
+ ;; suppressed.
(let* ((headlines (org-export-collect-headlines info depth scope))
(backend (org-export-create-backend
:parent (org-export-backend-name (plist-get info :back-end))
- :transcoders (mapcar
- (lambda (type) (cons type (lambda (d c i) c)))
- (list 'radio-target)))))
+ :transcoders '((footnote-reference . ignore)
+ (link . (lambda (object c i) c))
+ (radio-target . (lambda (object c i) c))
+ (target . ignore)))))
(when headlines
(org-odt--format-toc
(and (not scope) (org-export-translate "Table of Contents" :utf-8 info))
@@ -1410,8 +1411,8 @@ original parsed data. INFO is a plist holding export options."
((member styles-file-type '("odt" "ott"))
(org-odt--zip-extract styles-file "styles.xml" org-odt-zip-dir)))))
(t
- (error (format "Invalid specification of styles.xml file: %S"
- (plist-get info :odt-styles-file)))))
+ (error "Invalid specification of styles.xml file: %S"
+ (plist-get info :odt-styles-file))))
;; create a manifest entry for styles.xml
(org-odt-create-manifest-file-entry "text/xml" "styles.xml")
@@ -1765,8 +1766,6 @@ CONTENTS is nil. INFO is a plist holding contextual information."
((not
(org-export-footnote-first-reference-p footnote-reference info nil t))
(funcall --format-footnote-reference n))
- ;; Inline definitions are secondary strings.
- ;; Non-inline footnotes definitions are full Org data.
(t
(let* ((raw (org-export-get-footnote-definition
footnote-reference info))
@@ -1784,9 +1783,14 @@ CONTENTS is nil. INFO is a plist holding contextual information."
"OrgFootnoteCenter"
"OrgFootnoteQuotations")))))
info))))
- (if (eq (org-element-type raw) 'org-data) def
- (format "\n<text:p text:style-name=\"%s\">%s</text:p>"
- "Footnote" def)))))
+ ;; Inline definitions are secondary strings. We
+ ;; need to wrap them within a paragraph.
+ (if (memq (org-element-type (car (org-element-contents raw)))
+ org-element-all-elements)
+ def
+ (format
+ "\n<text:p text:style-name=\"Footnote\">%s</text:p>"
+ def)))))
(funcall --format-footnote-definition n def))))))))
@@ -2781,17 +2785,10 @@ INFO is a plist holding contextual information. See
(org-export-resolve-fuzzy-link link info)
(org-export-resolve-id-link link info))))
(case (org-element-type destination)
- ;; Case 1: Fuzzy link points nowhere.
- ('nil
- (format "<text:span text:style-name=\"%s\">%s</text:span>"
- "Emphasis"
- (or desc
- (org-export-data (org-element-property :raw-link link)
- info))))
- ;; Case 2: Fuzzy link points to a headline.
+ ;; Fuzzy link points to a headline. If there's
+ ;; a description, create a hyperlink. Otherwise, try to
+ ;; provide a meaningful description.
(headline
- ;; If there's a description, create a hyperlink.
- ;; Otherwise, try to provide a meaningful description.
(if (not desc) (org-odt-link--infer-description destination info)
(let ((label
(or (and (string= type "custom-id")
@@ -2800,15 +2797,15 @@ INFO is a plist holding contextual information. See
(format
"<text:a xlink:type=\"simple\" xlink:href=\"#%s\">%s</text:a>"
label desc))))
- ;; Case 3: Fuzzy link points to a target.
+ ;; Fuzzy link points to a target. If there's a description,
+ ;; create a hyperlink. Otherwise, try to provide
+ ;; a meaningful description.
(target
- ;; If there's a description, create a hyperlink.
- ;; Otherwise, try to provide a meaningful description.
(format "<text:a xlink:type=\"simple\" xlink:href=\"#%s\">%s</text:a>"
(org-export-get-reference destination info)
(or desc (org-export-get-ordinal destination info))))
- ;; Case 4: Fuzzy link points to some element (e.g., an
- ;; inline image, a math formula or a table).
+ ;; Fuzzy link points to some element (e.g., an inline image,
+ ;; a math formula or a table).
(otherwise
(let ((label-reference
(ignore-errors
@@ -4118,8 +4115,8 @@ contextual information."
nil standard-output nil (cdr cmd)))))
(or (zerop exitcode)
(error (concat "Unable to create OpenDocument file."
- (format " Zip failed with error (%s)"
- err-string)))))
+ " Zip failed with error (%s)")
+ err-string)))
cmds)))
;; Move the zip file from temporary work directory to
;; user-mandated location.
diff --git a/lisp/ox-org.el b/lisp/ox-org.el
index 82262e0..b395577 100644
--- a/lisp/ox-org.el
+++ b/lisp/ox-org.el
@@ -45,7 +45,7 @@ look bad if different people with different fontification setup
work on the same website. When this variable is non-nil,
creating an htmlized version of an Org buffer using
`org-org-export-as-org' will include a link to this URL if the
-setting of `org-html-htmlize-output-type' is 'css."
+setting of `org-html-htmlize-output-type' is `css'."
:group 'org-export-org
:type '(choice
(const :tag "Don't include external stylesheet link" nil)
diff --git a/lisp/ox-publish.el b/lisp/ox-publish.el
index 9f49f24..20cacf9 100644
--- a/lisp/ox-publish.el
+++ b/lisp/ox-publish.el
@@ -67,7 +67,7 @@ produced.")
(defcustom org-publish-project-alist nil
"Association list to control publishing behavior.
-Each element of the alist is a publishing 'project.' The CAR of
+Each element of the alist is a publishing project. The CAR of
each element is a string, uniquely identifying the project. The
CDR of each element is in one of the following forms:
@@ -75,12 +75,12 @@ CDR of each element is in one of the following forms:
alternating keys and values, specifying parameters for the
publishing process.
- \(:property value :property value ... )
+ (:property value :property value ... )
2. A meta-project definition, specifying of a list of
sub-projects:
- \(:components (\"project-1\" \"project-2\" ...))
+ (:components (\"project-1\" \"project-2\" ...))
When the CDR of an element of org-publish-project-alist is in
this second form, the elements of the list after `:components'
@@ -717,7 +717,7 @@ If `:auto-sitemap' is set, publish the sitemap too. If
(defun org-publish-org-sitemap (project &optional sitemap-filename)
"Create a sitemap of pages in set defined by PROJECT.
Optionally set the filename of the sitemap with SITEMAP-FILENAME.
-Default for SITEMAP-FILENAME is 'sitemap.org'."
+Default for SITEMAP-FILENAME is `sitemap.org'."
(let* ((project-plist (cdr project))
(dir (file-name-as-directory
(plist-get project-plist :base-directory)))
diff --git a/lisp/ox-texinfo.el b/lisp/ox-texinfo.el
index df56b67..c8c6554 100644
--- a/lisp/ox-texinfo.el
+++ b/lisp/ox-texinfo.el
@@ -153,9 +153,9 @@ If nil it will default to `buffer-file-coding-system'."
If #+TEXINFO_CLASS is set in the buffer, use its value and the
associated information. Here is the structure of each cell:
- \(class-name
+ (class-name
header-string
- \(numbered-section . unnumbered-section)
+ (numbered-section . unnumbered-section)
...)
@@ -1589,7 +1589,7 @@ Return INFO file name or an error if it couldn't be produced."
(file-name-directory full-name)
default-directory))
errors)
- (message (format "Processing Texinfo file %s..." file))
+ (message "Processing Texinfo file %s..." file)
(save-window-excursion
;; Replace %b, %f and %o with appropriate values in each command
;; before applying it. Output is redirected to "*Org INFO
@@ -1611,8 +1611,8 @@ Return INFO file name or an error if it couldn't be produced."
;; Check for process failure. Provide collected errors if
;; possible.
(if (not (file-exists-p infofile))
- (error (concat (format "INFO file %s wasn't produced" infofile)
- (when errors (concat ": " errors))))
+ (error "INFO file %s wasn't produced%s" infofile
+ (if errors (concat ": " errors) ""))
;; Else remove log files, when specified, and signal end of
;; process to user, along with any error encountered.
(when org-texinfo-remove-logfiles
@@ -1655,7 +1655,7 @@ none."
(re-search-forward "requires a sectioning" nil t))
(setq errors (concat errors " [invalid section command]")))
(when (save-excursion
- (re-search-forward "\\[unexpected\]" nil t))
+ (re-search-forward "\\[unexpected\ ]" nil t))
(setq errors (concat errors " [unexpected error]")))
(when (save-excursion
(re-search-forward "misplaced " nil t))
diff --git a/lisp/ox.el b/lisp/ox.el
index a0b7d45..e2fa4be 100644
--- a/lisp/ox.el
+++ b/lisp/ox.el
@@ -1,6 +1,6 @@
;;; ox.el --- Generic Export Engine for Org Mode
-;; Copyright (C) 2012-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2012-2015 Free Software Foundation, Inc.
;; Author: Nicolas Goaziou <n.goaziou at gmail dot com>
;; Keywords: outlines, hypermedia, calendar, wp
@@ -802,7 +802,7 @@ is nil. You can also allow them through local buffer variables."
This variable allows to provide shortcuts for export snippets.
-For example, with a value of '\(\(\"h\" . \"html\"\)\), the
+For example, with a value of \\='((\"h\" . \"html\")), the
HTML back-end will recognize the contents of \"@@h:<b>@@\" as
HTML code while every other back-end will ignore it."
:group 'org-export-general
@@ -883,7 +883,7 @@ output is restricted to body only, \"s\" when it is restricted to
the current subtree, \"v\" when only visible elements are
considered for export, \"f\" when publishing functions should be
passed the FORCE argument and \"a\" when the export should be
-asynchronous). Also, \[?] allows to switch back to standard
+asynchronous). Also, [?] allows to switch back to standard
mode."
:group 'org-export-general
:version "24.4"
@@ -1094,7 +1094,7 @@ keywords are understood:
Menu entry for the export dispatcher. It should be a list
like:
- '(KEY DESCRIPTION-OR-ORDINAL ACTION-OR-MENU)
+ \\='(KEY DESCRIPTION-OR-ORDINAL ACTION-OR-MENU)
where :
@@ -1118,30 +1118,30 @@ keywords are understood:
If it is an alist, associations should follow the
pattern:
- '(KEY DESCRIPTION ACTION)
+ \\='(KEY DESCRIPTION ACTION)
where KEY, DESCRIPTION and ACTION are described above.
Valid values include:
- '(?m \"My Special Back-end\" my-special-export-function)
+ \\='(?m \"My Special Back-end\" my-special-export-function)
or
- '(?l \"Export to LaTeX\"
- \(?p \"As PDF file\" org-latex-export-to-pdf)
- \(?o \"As PDF file and open\"
- \(lambda (a s v b)
- \(if a (org-latex-export-to-pdf t s v b)
- \(org-open-file
- \(org-latex-export-to-pdf nil s v b)))))))
+ \\='(?l \"Export to LaTeX\"
+ (?p \"As PDF file\" org-latex-export-to-pdf)
+ (?o \"As PDF file and open\"
+ (lambda (a s v b)
+ (if a (org-latex-export-to-pdf t s v b)
+ (org-open-file
+ (org-latex-export-to-pdf nil s v b)))))))
or the following, which will be added to the previous
sub-menu,
- '(?l 1
- \((?B \"As TEX buffer (Beamer)\" org-beamer-export-as-latex)
- \(?P \"As PDF file (Beamer)\" org-beamer-export-to-pdf)))
+ \\='(?l 1
+ ((?B \"As TEX buffer (Beamer)\" org-beamer-export-as-latex)
+ (?P \"As PDF file (Beamer)\" org-beamer-export-to-pdf)))
:options-alist
@@ -1215,12 +1215,12 @@ keywords are understood:
As an example, here is how one could define \"my-latex\" back-end
as a variant of `latex' back-end with a custom template function:
- \(org-export-define-derived-backend 'my-latex 'latex
- :translate-alist '((template . my-latex-template-fun)))
+ (org-export-define-derived-backend \\='my-latex \\='latex
+ :translate-alist \\='((template . my-latex-template-fun)))
The back-end could then be called with, for example:
- \(org-export-to-buffer 'my-latex \"*Test my-latex*\")"
+ (org-export-to-buffer \\='my-latex \"*Test my-latex*\")"
(declare (indent 2))
(let (blocks filters menu-entry options transcoders contents)
(while (keywordp (car body))
@@ -1339,21 +1339,24 @@ inferior to file-local settings."
Optional argument BACKEND is an export back-end, as returned by,
e.g., `org-export-create-backend'. It specifies which back-end
specific items to read, if any."
- (let ((all
- (mapcar
- (lambda (o) (cons (nth 2 o) (car o)))
- ;; Priority is given to back-end specific options.
- (append (and backend (org-export-get-all-options backend))
- org-export-options-alist)))
- (start)
- plist)
- (while (string-match "\\(.+?\\):\\((.*?)\\|\\S-*\\)[ \t\n]*" options start)
- (setq start (match-end 0))
- (let ((property (cdr (assoc-string (match-string 1 options) all t))))
- (when property
- (setq plist
- (plist-put plist property (read (match-string 2 options)))))))
- plist))
+ (let ((line
+ (let ((s 0) alist)
+ (while (string-match "\\(.+?\\):\\((.*?)\\|\\S-*\\)[ \t]*" options s)
+ (setq s (match-end 0))
+ (push (cons (match-string 1 options)
+ (read (match-string 2 options)))
+ alist))
+ alist))
+ ;; Priority is given to back-end specific options.
+ (all (append (and backend (org-export-get-all-options backend))
+ org-export-options-alist))
+ (plist))
+ (when line
+ (dolist (entry all plist)
+ (let ((item (nth 2 entry)))
+ (when item
+ (let ((v (assoc-string item line t)))
+ (when v (setq plist (plist-put plist (car entry) (cdr v)))))))))))
(defun org-export--get-subtree-options (&optional backend)
"Get export options in subtree at point.
@@ -1369,14 +1372,14 @@ for export. Return options as a plist."
(let ((plist
;; EXPORT_OPTIONS are parsed in a non-standard way. Take
;; care of them right from the start.
- (let ((o (org-entry-get (point) "EXPORT_OPTIONS")))
+ (let ((o (org-entry-get (point) "EXPORT_OPTIONS" 'selective)))
(and o (org-export--parse-option-keyword o backend))))
;; Take care of EXPORT_TITLE. If it isn't defined, use
;; headline's title (with no todo keyword, priority cookie or
;; tag) as its fallback value.
(cache (list
(cons "TITLE"
- (or (org-entry-get (point) "EXPORT_TITLE")
+ (or (org-entry-get (point) "EXPORT_TITLE" 'selective)
(progn (looking-at org-complex-heading-regexp)
(org-match-string-no-properties 4))))))
;; Look for both general keywords and back-end specific
@@ -1391,7 +1394,8 @@ for export. Return options as a plist."
(let ((value
(or (cdr (assoc keyword cache))
(let ((v (org-entry-get (point)
- (concat "EXPORT_" keyword))))
+ (concat "EXPORT_" keyword)
+ 'selective)))
(push (cons keyword v) cache) v))))
(when value
(setq plist
@@ -1451,6 +1455,8 @@ Assume buffer is in Org mode. Narrowing, if any, is ignored."
;; Avoid circular dependencies.
(unless (member file files)
(with-temp-buffer
+ (setq default-directory
+ (file-name-directory file))
(insert (org-file-contents file 'noerror))
(let ((org-inhibit-startup t)) (org-mode))
(setq plist (funcall get-options
@@ -1582,6 +1588,8 @@ an alist where associations are (VARIABLE-NAME VALUE)."
(org-remove-double-quotes val))))
(unless (member file files)
(with-temp-buffer
+ (setq default-directory
+ (file-name-directory file))
(let ((org-inhibit-startup t)) (org-mode))
(insert (org-file-contents file 'noerror))
(setq alist
@@ -1675,7 +1683,7 @@ DATA is the parse tree. OPTIONS is the plist holding export
options.
Return an alist whose key is a headline and value is its
-associated numbering \(in the shape of a list of numbers\) or nil
+associated numbering \(in the shape of a list of numbers) or nil
for a footnotes section."
(let ((numbering (make-vector org-export-max-depth 0)))
(org-element-map data 'headline
@@ -2627,13 +2635,12 @@ from tree."
;; If headline is archived but tree below has to
;; be skipped, remove contents.
(org-element-set-contents data)
- ;; Move into secondary string, if any.
- (let ((sec-prop
- (cdr (assq type org-element-secondary-value-alist))))
- (when sec-prop
- (mapc walk-data (org-element-property sec-prop data))))
;; Move into recursive objects/elements.
- (mapc walk-data (org-element-contents data)))))))))
+ (mapc walk-data (org-element-contents data)))
+ ;; Move into secondary string, if any.
+ (dolist (p (cdr (assq type
+ org-element-secondary-value-alist)))
+ (mapc walk-data (org-element-property p data)))))))))
;; If a select tag is active, also ignore the section before the
;; first headline, if any.
(when selected
@@ -2731,7 +2738,7 @@ returned by the function."
;; Splice NEW at BLOB location in parse tree.
(dolist (e new (org-element-extract-element blob))
(unless (string= e "") (org-element-insert-before e blob))))))
- info)
+ info nil nil t)
;; Return modified parse tree.
data)
@@ -3342,24 +3349,6 @@ Return a string of lines to be included in the format expected by
(while (< (point) end) (incf counter) (forward-line))
counter))))))))
-(defun org-export--update-footnote-label (ref-begin digit-label id)
- "Prefix footnote-label at point REF-BEGIN in buffer with ID.
-
-REF-BEGIN corresponds to the property `:begin' of objects of type
-footnote-definition and footnote-reference.
-
-If DIGIT-LABEL is non-nil the label is assumed to be of the form
-\[N] where N is one or more numbers.
-
-Return the new label."
- (goto-char (1+ ref-begin))
- (buffer-substring (point)
- (progn
- (if digit-label (insert (format "fn:%d-" id))
- (forward-char 3)
- (insert (format "%d-" id)))
- (1- (search-forward "]")))))
-
(defun org-export--prepare-file-contents
(file &optional lines ind minlevel id footnotes)
"Prepare contents of FILE for inclusion and return it as a string.
@@ -3370,20 +3359,20 @@ lines, include only those lines.
Optional argument IND, when non-nil, is an integer specifying the
global indentation of returned contents. Since its purpose is to
allow an included file to stay in the same environment it was
-created \(i.e. a list item), it doesn't apply past the first
+created (e.g., a list item), it doesn't apply past the first
headline encountered.
Optional argument MINLEVEL, when non-nil, is an integer
specifying the level that any top-level headline in the included
file should have.
+
Optional argument ID is an integer that will be inserted before
each footnote definition and reference if FILE is an Org file.
This is useful to avoid conflicts when more than one Org file
with footnotes is included in a document.
Optional argument FOOTNOTES is a hash-table to store footnotes in
-the included document.
-"
+the included document."
(with-temp-buffer
(insert-file-contents file)
(when lines
@@ -3412,7 +3401,7 @@ the included document.
(delete-region (point) (point-max))
;; If IND is set, preserve indentation of include keyword until
;; the first headline encountered.
- (when ind
+ (when (and ind (> ind 0))
(unless (eq major-mode 'org-mode)
(let ((org-inhibit-startup t)) (org-mode)))
(goto-char (point-min))
@@ -3434,57 +3423,66 @@ the included document.
(let ((levels (org-map-entries
(lambda () (org-reduced-level (org-current-level))))))
(when levels
- (let ((offset (- minlevel (apply 'min levels))))
+ (let ((offset (- minlevel (apply #'min levels))))
(unless (zerop offset)
(when org-odd-levels-only (setq offset (* offset 2)))
;; Only change stars, don't bother moving whole
;; sections.
(org-map-entries
- (lambda () (if (< offset 0) (delete-char (abs offset))
- (insert (make-string offset ?*)))))))))))
+ (lambda ()
+ (if (< offset 0) (delete-char (abs offset))
+ (insert (make-string offset ?*)))))))))))
;; Append ID to all footnote references and definitions, so they
;; become file specific and cannot collide with footnotes in other
- ;; included files. Further, collect relevant footnotes outside of
- ;; LINES.
+ ;; included files. Further, collect relevant footnote definitions
+ ;; outside of LINES, in order to reintroduce them later.
(when id
(let ((marker-min (point-min-marker))
- (marker-max (point-max-marker)))
+ (marker-max (point-max-marker))
+ (get-new-label
+ (lambda (label)
+ ;; Generate new label from LABEL. If LABEL is akin to
+ ;; [1] convert it to [fn:--ID-1]. Otherwise add "-ID-"
+ ;; after "fn:".
+ (if (org-string-match-p "\\`[0-9]+\\'" label)
+ (format "fn:--%d-%s" id label)
+ (format "fn:-%d-%s" id (substring label 3)))))
+ (set-new-label
+ (lambda (f old new)
+ ;; Replace OLD label with NEW in footnote F.
+ (save-excursion
+ (goto-char (1+ (org-element-property :begin f)))
+ (looking-at (regexp-quote old))
+ (replace-match new))))
+ (seen-alist))
(goto-char (point-min))
(while (re-search-forward org-footnote-re nil t)
- (let ((reference (org-element-context)))
- (when (eq (org-element-type reference) 'footnote-reference)
- (let* ((label (org-element-property :label reference))
- (digit-label
- (and label (org-string-match-p "\\`[0-9]+\\'" label))))
+ (let ((footnote (save-excursion
+ (backward-char)
+ (org-element-context))))
+ (when (memq (org-element-type footnote)
+ '(footnote-definition footnote-reference))
+ (let* ((label (org-element-property :label footnote)))
;; Update the footnote-reference at point and collect
;; the new label, which is only used for footnotes
;; outsides LINES.
(when label
- ;; If label is akin to [1] convert it to [fn:ID-1].
- ;; Otherwise add "ID-" after "fn:".
- (let ((new-label (org-export--update-footnote-label
- (org-element-property :begin reference)
- digit-label id)))
- (unless (eq (org-element-property :type reference) 'inline)
- (org-with-wide-buffer
- (let* ((definition (org-footnote-get-definition label))
- (beginning (nth 1 definition)))
- (unless definition
- (error
- "Definition not found for footnote %s in file %s"
- label file))
- (if (or (< beginning marker-min)
- (> beginning marker-max))
+ (let ((seen (cdr (assoc label seen-alist))))
+ (if seen (funcall set-new-label footnote label seen)
+ (let ((new (funcall get-new-label label)))
+ (push (cons label new) seen-alist)
+ (org-with-wide-buffer
+ (let* ((def (org-footnote-get-definition label))
+ (beg (nth 1 def)))
+ (when (and def
+ (or (< beg marker-min)
+ (>= beg marker-max)))
;; Store since footnote-definition is
;; outside of LINES.
- (puthash new-label
- (org-element-normalize-string
- (nth 3 definition))
- footnotes)
- ;; Update label of definition since it is
- ;; included directly.
- (org-export--update-footnote-label
- beginning digit-label id)))))))))))
+ (puthash new
+ (org-element-normalize-string (nth 3 def))
+ footnotes))))
+ (funcall set-new-label footnote label new)))))))))
(set-marker marker-min nil)
(set-marker marker-max nil)))
(org-element-normalize-string (buffer-string))))
@@ -4045,7 +4043,7 @@ PATH is the link path. DESC is its description."
Optional argument is a set of RULES defining inline images. It
is an alist where associations have the following shape:
- \(TYPE . REGEXP)
+ (TYPE . REGEXP)
Applying a rule means apply REGEXP against LINK's path when its
type is TYPE. The function will return a non-nil value if any of
@@ -4096,12 +4094,12 @@ error if no block contains REF."
INFO is a plist holding contextual information.
-Return value can be an object, an element, or nil:
+Return value can be an object or an element:
- If LINK path matches a target object (i.e. <<path>>) return it.
- If LINK path exactly matches the name affiliated keyword
- \(i.e. #+NAME: path) of an element, return that element.
+ (i.e. #+NAME: path) of an element, return that element.
- If LINK path exactly matches any headline name, return that
element.
@@ -4201,12 +4199,10 @@ has type \"radio\"."
(defun org-export-file-uri (filename)
"Return file URI associated to FILENAME."
- (if (not (file-name-absolute-p filename)) filename
- (concat "file:/"
- (and (not (org-file-remote-p filename)) "/")
- (if (org-string-match-p "\\`~" filename)
- (expand-file-name filename)
- filename))))
+ (cond ((org-string-match-p "\\`//" filename) (concat "file:" filename))
+ ((not (file-name-absolute-p filename)) filename)
+ ((org-file-remote-p filename) (concat "file:/" filename))
+ (t (concat "file://" (expand-file-name filename)))))
;;;; For References
@@ -5173,62 +5169,65 @@ INFO is the current export state, as a plist."
table)))
(value (gethash parent cache 'missing-data)))
(if (not (eq value 'missing-data)) (cdr (assq s value))
- (let (level1-open level2-open full-status)
+ (let (level1-open full-status)
(org-element-map parent 'plain-text
(lambda (text)
(let ((start 0) current-status)
(while (setq start (string-match "['\"]" text start))
- (incf start)
(push
(cond
((equal (match-string 0 text) "\"")
(setf level1-open (not level1-open))
- (setf level2-open nil)
(if level1-open 'opening-double-quote 'closing-double-quote))
;; Not already in a level 1 quote: this is an
;; apostrophe.
((not level1-open) 'apostrophe)
- ;; Apostrophe.
- ((org-string-match-p "\\S-'\\S-" text) 'apostrophe)
- ;; Apostrophe at the beginning of a string. Check
- ;; white space at the end of the last object.
- ((and (org-string-match-p "\\`'\\S-" text)
- (let ((p (org-export-get-previous-element text info)))
- (and p
- (if (stringp p)
- (not (org-string-match-p "[ \t]\\'" p))
- (memq (org-element-property :post-blank p)
- '(0 nil))))))
- 'apostrophe)
- ;; Apostrophe at the end of a string. Check white
- ;; space at the beginning of the next object, which
- ;; can only happen if that object is a string.
- ((and (org-string-match-p "\\S-'\\'" text)
- (let ((n (org-export-get-next-element text info)))
- (and n
- (not (and (stringp n)
- (org-string-match-p "\\`[ \t]" n))))))
- 'apostrophe)
- ;; Lonesome apostrophe. Check white space around
- ;; both ends.
- ((and (equal text "'")
- (let ((p (org-export-get-previous-element text info)))
- (and p
- (if (stringp p)
- (not (org-string-match-p "[ \t]\\'" p))
- (memq (org-element-property :post-blank p)
- '(0 nil)))
- (let ((n (org-export-get-next-element text info)))
- (and n
- (not (and (stringp n)
- (org-string-match-p "\\`[ \t]"
- n))))))))
- 'apostrophe)
- ;; Else, consider it as a level 2 quote.
- (t (setf level2-open (not level2-open))
- (if level2-open 'opening-single-quote
- 'closing-single-quote)))
- current-status))
+ ;; Extract previous char and next char. As
+ ;; a special case, they can also be set to `blank',
+ ;; `no-blank' or nil. Then determine if current
+ ;; match is allowed as an opening quote or a closing
+ ;; quote.
+ (t
+ (let* ((previous
+ (if (> start 0) (substring text (1- start) start)
+ (let ((p (org-export-get-previous-element
+ text info)))
+ (cond ((not p) nil)
+ ((stringp p) (substring p (1- (length p))))
+ ((memq (org-element-property :post-blank p)
+ '(0 nil))
+ 'no-blank)
+ (t 'blank)))))
+ (next
+ (if (< (1+ start) (length text))
+ (substring text (1+ start) (+ start 2))
+ (let ((n (org-export-get-next-element text info)))
+ (cond ((not n) nil)
+ ((stringp n) (substring n 0 1))
+ (t 'no-blank)))))
+ (allow-open
+ (and (if (stringp previous)
+ (string-match "\\s\"\\|\\s-\\|\\s("
+ previous)
+ (memq previous '(blank nil)))
+ (if (stringp next)
+ (string-match "\\w\\|\\s.\\|\\s_" next)
+ (eq next 'no-blank))))
+ (allow-close
+ (and (if (stringp previous)
+ (string-match "\\w\\|\\s.\\|\\s_" previous)
+ (eq previous 'no-blank))
+ (if (stringp next)
+ (string-match "\\s-\\|\\s)\\|\\s.\\|\\s\""
+ next)
+ (memq next '(blank nil))))))
+ (cond
+ ((and allow-open allow-close) (error "Should not happen"))
+ (allow-open 'opening-single-quote)
+ (allow-close 'closing-single-quote)
+ (t 'apostrophe)))))
+ current-status)
+ (setq start (1+ start)))
(when current-status
(push (cons text (nreverse current-status)) full-status))))
info nil org-element-recursive-objects)
@@ -5760,7 +5759,7 @@ and `org-export-to-file' for more specialized functions."
(kill-buffer proc-buffer))))
(org-export-add-to-stack proc-buffer nil p)
(ding)
- (message "Process '%s' exited abnormally" p))
+ (message "Process `%s' exited abnormally" p))
(unless org-export-async-debug
(delete-file ,,temp-file)))))))))))))
@@ -5793,10 +5792,10 @@ no argument. It is always called within the current process,
from BUFFER, with point at its beginning. Export back-ends can
use it to set a major mode there, e.g,
- \(defun org-latex-export-as-latex
- \(&optional async subtreep visible-only body-only ext-plist)
- \(interactive)
- \(org-export-to-buffer 'latex \"*Org LATEX Export*\"
+ (defun org-latex-export-as-latex
+ (&optional async subtreep visible-only body-only ext-plist)
+ (interactive)
+ (org-export-to-buffer \\='latex \"*Org LATEX Export*\"
async subtreep visible-only body-only ext-plist (lambda () (LaTeX-mode))))
This function returns BUFFER."
@@ -5853,13 +5852,13 @@ argument and happens asynchronously when ASYNC is non-nil. It
has to return a file name, or nil. Export back-ends can use this
to send the output file through additional processing, e.g,
- \(defun org-latex-export-to-latex
- \(&optional async subtreep visible-only body-only ext-plist)
- \(interactive)
- \(let ((outfile (org-export-output-file-name \".tex\" subtreep)))
- \(org-export-to-file 'latex outfile
+ (defun org-latex-export-to-latex
+ (&optional async subtreep visible-only body-only ext-plist)
+ (interactive)
+ (let ((outfile (org-export-output-file-name \".tex\" subtreep)))
+ (org-export-to-file \\='latex outfile
async subtreep visible-only body-only ext-plist
- \(lambda (file) (org-latex-compile file)))
+ (lambda (file) (org-latex-compile file)))
The function returns either a file name returned by POST-PROCESS,
or FILE."
@@ -5916,7 +5915,7 @@ Return file name as a string."
(org-entry-get
(save-excursion
(ignore-errors (org-back-to-heading) (point)))
- "EXPORT_FILE_NAME" t))
+ "EXPORT_FILE_NAME" 'selective))
;; File name may be extracted from buffer's associated
;; file, if any.
(and visited-file (file-name-nondirectory visited-file))
@@ -6189,7 +6188,7 @@ is nil when this menu hasn't been selected yet.
EXPERTP, when non-nil, triggers expert UI. In that case, no help
buffer is provided, but indications about currently active
-options are given in the prompt. Moreover, \[?] allows to switch
+options are given in the prompt. Moreover, [?] allows to switch
back to standard interface."
(let* ((fontify-key
(lambda (key &optional access-key)
diff --git a/mk/version.mk b/mk/version.mk
index 877cfee..284aff6 100644
--- a/mk/version.mk
+++ b/mk/version.mk
@@ -1,2 +1,2 @@
-ORGVERSION ?= 8.3.1
-GITVERSION ?= 8.3.1-dist
+ORGVERSION ?= 8.3.2
+GITVERSION ?= 8.3.2-dist