]> code.delx.au - gnu-emacs/commitdiff
Merge Org 8.2.6-1.
authorBastien Guerry <bzg@gnu.org>
Tue, 22 Apr 2014 14:07:45 +0000 (16:07 +0200)
committerBastien Guerry <bzg@gnu.org>
Tue, 22 Apr 2014 14:07:45 +0000 (16:07 +0200)
The last merge was from 8.2.5c, but many important bugs got
fixed between 8.2.5c and 8.2.6-1.

33 files changed:
doc/misc/ChangeLog
doc/misc/org.texi
lisp/org/ChangeLog
lisp/org/ob-core.el
lisp/org/ob-exp.el
lisp/org/ob-gnuplot.el
lisp/org/ob-python.el
lisp/org/ob-ref.el
lisp/org/ob-table.el
lisp/org/org-agenda.el
lisp/org/org-bibtex.el
lisp/org/org-capture.el
lisp/org/org-clock.el
lisp/org/org-colview.el
lisp/org/org-compat.el
lisp/org/org-element.el
lisp/org/org-entities.el
lisp/org/org-mobile.el
lisp/org/org-src.el
lisp/org/org-table.el
lisp/org/org-timer.el
lisp/org/org-version.el
lisp/org/org.el
lisp/org/ox-ascii.el
lisp/org/ox-beamer.el
lisp/org/ox-html.el
lisp/org/ox-latex.el
lisp/org/ox-man.el
lisp/org/ox-md.el
lisp/org/ox-odt.el
lisp/org/ox-publish.el
lisp/org/ox-texinfo.el
lisp/org/ox.el

index a7ee54890124d9dcb34a357f74626801fad1caaf..d80a44b2db8309c69f733f56fbee4b396fb43701 100644 (file)
@@ -1,3 +1,31 @@
+2014-04-22  Bastien Guerry  <bzg@gnu.org>
+
+       * org.texi (Installation): Be more clear on why installing Org
+       through ELPA should be done without loading any Org file.
+
+       * org.texi (Emphasis and monospace): Document the use of
+       =verbatim= and ~code~ to be consistent with
+       `org-element-text-markup-successor'.
+
+       * org.texi (In-buffer settings, Radio tables): Tiny fixes.
+
+       * org.texi (Initial visibility):
+       * org.texi (Literal examples): Fix typos.
+
+2014-04-22  Michael Brand  <michael.ch.brand@gmail.com>
+
+       * org.texi (Column attributes): Add a sentence to point out
+       the dependency on the format specifier.
+
+2014-04-22  Nicolas Goaziou  <n.goaziou@gmail.com>
+
+       * org.texi (The Export Dispatcher): Reformulation.
+
+       * org.texi (@LaTeX{} specific attributes): Update manual.
+
+       * org.texi (Top, Exporting): Org has its own documentation and
+       should therefore be removed from "Other build-in back-ends".
+
 2014-03-26  Paul Eggert  <eggert@cs.ucla.edu>
 
        * texinfo.tex: Update from gnulib.
index c6b8c90293fb5b81bf971adbfe77345435594059..48a6fe56cf6a0b50ae8e5befe1b7e19c64c52c95 100644 (file)
@@ -2,7 +2,7 @@
 @c %**start of header
 @setfilename ../../info/org
 @settitle The Org Manual
-@set VERSION 8.2.5c
+@set VERSION 8.2.6
 
 @c Version and Contact Info
 @set MAINTAINERSITE @uref{http://orgmode.org,maintainers web page}
@@ -275,7 +275,7 @@ modify this GNU manual.''
 
 @dircategory Emacs editing modes
 @direntry
-* Org Mode: (org).              Outline-based notes management and organizer.
+* Org Mode: (org).      Outline-based notes management and organizer
 @end direntry
 
 @titlepage
@@ -585,8 +585,8 @@ Exporting
 * OpenDocument Text export::    Exporting to OpenDocument Text
 * Org export::                  Exporting to Org
 * iCalendar export::            Exporting to iCalendar
-* Other built-in back-ends::    Exporting to @code{Texinfo}, a man page, or Org
-* Export in foreign buffers::   Author tables in lists in Org syntax
+* Other built-in back-ends::    Exporting to @code{Texinfo} or a man page
+* Export in foreign buffers::   Author tables and lists in Org syntax
 * Advanced configuration::      Fine-tuning the export output
 
 HTML export
@@ -877,7 +877,11 @@ We @b{strongly recommend} to stick to a single installation method.
 
 Recent Emacs distributions include a packaging system which lets you install
 Elisp libraries.  You can install Org with @kbd{M-x package-install RET org}.
-You need to do this in a session where no @code{.org} file has been visited.
+
+@noindent @b{Important}: you need to do this in a session where no @code{.org} file has
+been visited, i.e. where no Org built-in function have been loaded.
+Otherwise autoload Org functions will mess up the installation.
+
 Then, to make sure your Org configuration is taken into account, initialize
 the package system with @code{(package-initialize)} in your @file{.emacs}
 before setting any Org option.  If you want to use Org's package repository,
@@ -1339,7 +1343,7 @@ When Emacs first visits an Org file, the global state is set to OVERVIEW,
 i.e., only the top level headlines are visible@footnote{When
 @code{org-agenda-inhibit-startup} is non-@code{nil}, Org will not honor the default
 visibility state when first opening a file for the agenda (@pxref{Speeding up
-your agendas}).}  This can be configured through the variable
+your agendas}).}.  This can be configured through the variable
 @code{org-startup-folded}, or on a per-file basis by adding one of the
 following lines anywhere in the buffer:
 
@@ -5525,6 +5529,9 @@ of 5 to 20 days, representing what to expect if everything goes either
 extremely well or extremely poorly.  In contrast, @code{est+} estimates the
 full job more realistically, at 10--15 days.
 
+Numbers are right-aligned when a format specifier with an explicit width like
+@code{%5d} or @code{%5.1f} is used.
+
 Here is an example for a complete columns definition, along with allowed
 values.
 
@@ -9729,8 +9736,8 @@ multiple footnotes side by side.
 @vindex org-fontify-emphasized-text
 @vindex org-emphasis-regexp-components
 @vindex org-emphasis-alist
-You can make words @b{*bold*}, @i{/italic/}, _underlined_, @code{=code=}
-and @code{~verbatim~}, and, if you must, @samp{+strike-through+}.  Text
+You can make words @b{*bold*}, @i{/italic/}, _underlined_, @code{=verbatim=}
+and @code{~code~}, and, if you must, @samp{+strike-through+}.  Text
 in the code and verbatim string is not processed for Org mode specific
 syntax, it is exported verbatim.
 
@@ -9888,7 +9895,7 @@ Here is an example:
 @example
 #+BEGIN_SRC emacs-lisp -n -r
 (save-excursion                  (ref:sc)
-   (goto-char (point-min))       (ref:jump)
+   (goto-char (point-min)))      (ref:jump)
 #+END_SRC
 In line [[(sc)]] we remember the current position.  [[(jump)][Line (jump)]]
 jumps to point-min.
@@ -10358,8 +10365,8 @@ in the iCalendar format.
 * OpenDocument Text export::    Exporting to OpenDocument Text
 * Org export::                  Exporting to Org
 * iCalendar export::            Exporting to iCalendar
-* Other built-in back-ends::    Exporting to @code{Texinfo}, a man page, or Org
-* Export in foreign buffers::   Author tables in lists in Org syntax
+* Other built-in back-ends::    Exporting to @code{Texinfo} or a man page
+* Export in foreign buffers::   Author tables and lists in Org syntax
 * Advanced configuration::      Fine-tuning the export output
 @end menu
 
@@ -10400,10 +10407,10 @@ export dispatcher with the following key combinations:
 Toggle asynchronous export.  Asynchronous export uses an external Emacs
 process that is configured with a specified initialization file.
 
-While exporting asynchronously, the output is not displayed.  It is stored in
-a list called ``the export stack'', and can be viewed from there.  The stack
-can be reached by calling the dispatcher with a double @kbd{C-u} prefix
-argument, or with @kbd{&} key from the dispatcher.
+While exporting asynchronously, the output is not displayed, but stored in
+a place called ``the export stack''.  This stack can be displayed by calling
+the dispatcher with a double @kbd{C-u} prefix argument, or with @kbd{&} key
+from the dispatcher menu.
 
 @vindex org-export-in-background
 To make this behavior the default, customize the variable
@@ -11762,13 +11769,12 @@ the @LaTeX{} @code{\includegraphics} macro will be commented out.
 @cindex plain lists, in @LaTeX{} export
 
 Plain lists accept two optional attributes: @code{:environment} and
-@code{:options}.  The first one allows the use of a non-standard
-environment (e.g., @samp{inparaenum}).  The second one specifies
-optional arguments for that environment (square brackets may be
-omitted).
+@code{:options}.  The first one allows the use of a non-standard environment
+(e.g., @samp{inparaenum}).  The second one specifies additional arguments for
+that environment.
 
 @example
-#+ATTR_LATEX: :environment compactitem :options $\circ$
+#+ATTR_LATEX: :environment compactitem :options [$\circ$]
 - you need ``paralist'' package to reproduce this example.
 @end example
 
@@ -13773,8 +13779,13 @@ can be used to map arbitrary language names to existing major modes.
 @item org-src-window-setup
 Controls the way Emacs windows are rearranged when the edit buffer is created.
 @item org-src-preserve-indentation
-This variable is especially useful for tangling languages such as
-Python, in which whitespace indentation in the output is critical.
+By default, the value is @code{nil}, which means that when code blocks are
+evaluated during export or tangled, they are re-inserted into the code block,
+which may replace sequences of spaces with tab characters.  When non-nil,
+whitespace in code blocks will be preserved during export or tangling,
+exactly as it appears.  This variable is especially useful for tangling
+languages such as Python, in which whitespace indentation in the output is
+critical.
 @item org-src-ask-before-returning-to-edit-buffer
 By default, Org will ask before returning to an open edit buffer.  Set this
 variable to @code{nil} to switch without asking.
@@ -15827,7 +15838,7 @@ The corresponding variable is @code{org-archive-location}.
 This line sets the category for the agenda file.  The category applies
 for all subsequent lines until the next @samp{#+CATEGORY} line, or the
 end of the file.  The first such line also applies to any entries before it.
-@item #+COLUMNS: %25ITEM .....
+@item #+COLUMNS: %25ITEM ...
 @cindex property, COLUMNS
 Set the default format for columns view.  This format applies when
 columns view is invoked in locations where no @code{COLUMNS} property
@@ -15842,11 +15853,11 @@ The global version of this variable is
 @item #+FILETAGS: :tag1:tag2:tag3:
 Set tags that can be inherited by any entry in the file, including the
 top-level entries.
-@item #+DRAWERS: NAME1 .....
+@item #+DRAWERS: NAME1 ...
 @vindex org-drawers
 Set the file-local set of additional drawers.  The corresponding global
 variable is @code{org-drawers}.
-@item #+LINK:  linkword replace
+@item #+LINK: linkword replace
 @vindex org-link-abbrev-alist
 These lines (several are allowed) specify link abbreviations.
 @xref{Link abbreviations}.  The corresponding variable is
@@ -16862,7 +16873,7 @@ Orgtbl mode how to translate this table and where to install it.  For
 example:
 @cindex #+ORGTBL
 @example
-#+ORGTBL: SEND table_name translation_function arguments....
+#+ORGTBL: SEND table_name translation_function arguments...
 @end example
 
 @noindent
index 0995f9039574cc1c40dcd3872465ab4e506bedd5..c1e3c9998d061986195fef207ef5ecd6ace8c5d6 100644 (file)
@@ -1,3 +1,529 @@
+2014-04-22  Aaron Ecay  <aaronecay@gmail.com>
+
+       * org-src.el (org-edit-src-exit): Place an undo boundary before
+       writing changes back to parent buffer.
+
+2014-04-22  Achim Gratz  <Stromeko@Stromeko.DE>
+
+       * ob-gnuplot.el (org-babel-gnuplot-process-vars):
+       `org-babel-gnuplot-table-to-data´ expects a table, so we need to
+       construct one when Babel hands us a vector.
+
+       * ob-ref.el (org-babel-ref-parse): If
+       `org-babel-current-src-block-location' is a marker, it can be from
+       another buffer, use marker-position instead in this case.
+
+2014-04-22  Arun Persaud  <apersaud@lbl.gov>  (tiny change)
+
+       * org-src.el (org-edit-src-exit): Don't add indentation on empty
+       lines.
+
+2014-04-22  Bastien Guerry  <bzg@gnu.org>
+
+       * org.el (org-insert-heading): Fix behavior when point is at the
+       beginning of a heading or a list item.  Enhance docstring.
+
+       * ox-html.el (org-html-infojs-install-script): Don't install
+       infojs scripts when #+INFOJS_OPT: is empty.
+
+       * org.el (org-mode): Fix the use of `org-*-element' functions for
+       C-M-a and C-M-e but fix C-M-e.
+
+       * org-agenda.el (org-agenda-search-view): Fix tag.
+
+       * org.el (org-check-before-invisible-edit): Don't just cycle, show
+       the subtree, as cycling may leave the current heading folded.
+       (org-contextualize-validate-key): Fix wrong test.
+
+       * org-bibtex.el (org-bibtex-headline): Don't throw an error when
+       trying to add a keyword field to a BibTeX entry that is not known
+       by BibTeX or defined by the user.
+       (org-bibtex, org-bibtex-no-export-tags): Fix docstrings.
+
+       * ox-latex.el (org-latex-src-block): Fix wrong propagation of
+       labels and captions when using the listings environment.
+
+       * org.el (org-sort-entries): Fix the number of blank lines to
+       keep for the last entry to sort.
+
+       * org-clock.el (org-clock-put-overlay): Fix display when
+       `org-indent-mode' is on.
+
+       * org.el (org-sort-entries): Allow to sort by clocking time.
+
+       * org-agenda.el (org-agenda-finalize): Apply all filters
+       correctly.
+
+       * org.el (org-update-dblock): Use `save-excursion' instead of
+       `save-window-excursion' so that blocks can edit other windows and
+       change the window layout.
+
+       * org-agenda.el (org-agenda-mode): Disable `indent-tabs-mode'.
+       (org-agenda-dim-blocked-tasks): Make overlays intangible.
+       (org-agenda-show-new-time): Fix bug when deleting a timestamp
+       right after changing it.
+       (org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item)
+       (org-agenda-get-sexps, org-agenda-filter-by-regexp)
+       (org-agenda-filter-top-headline-apply): Fix indentation.
+
+       * org.el (org-cycle): Try `org-try-cdlatex-tab' before trying
+       to edit/move as in a table.
+
+       * org-agenda.el (org-agenda-show-new-time): Don't use
+       `move-beginning-of-line' as it is slower and not needed.
+
+       * org-compat.el (org-move-to-column): Temporarily set
+       `buffer-invisibility-spec' more accurately.
+
+       * ox-latex.el (org-latex-text-markup-alist): Use \ul{...} for
+       underlining instead of \uline{...} as requiring the hyperref
+       package makes \uline{...} unusable on headline.
+
+       * org.el (org-latex-default-packages-alist): Add the "soul"
+       package.
+
+       * org.el (org-refresh-properties): Don't add the property to
+       the whole subtree, only to the part between the beginning of
+       the headline and the end of the "content", before any other
+       headline.  This fix a bug about properties displayed as
+       inherited in the agenda, where Org properties are checked
+       against text properties.
+
+       * ox-latex.el (org-latex--text-markup): Replace newlines by
+       whitespaces in \verb constructs.
+
+       * org-agenda.el (org-agenda-filter-hide-line): Hide from the
+       beginning of the line to the beginning of the next line.
+       (org-agenda-show-new-time): Use `move-beginning-of-line' and
+       `move-end-of-line'.
+       (org-agenda-drag-line-forward): Adapt to the new definition of
+       hidden filtered lines.
+
+       * org-compat.el (org-move-to-column): Always ignore invisible
+       text in agenda buffer, and when there is both a bracket link
+       and '(org-link) as a member of `buffer-invisibility-spec'.
+       Add a docstring.
+
+       * org.el (org-align-tags-here): Add docstring and remove useless
+       arguments when calling `org-move-to-column'.
+
+       * org-table.el (org-table-copy-down)
+       (org-table-find-dataline, org-table-move-row)
+       (org-table-insert-hline, org-table-kill-row):
+       * org-agenda.el (org-agenda-next-item)
+       (org-agenda-previous-item, org-agenda-todo)
+       (org-agenda-priority, org-agenda-show-new-time)
+       (org-agenda-clock-in, org-agenda-clock-out): Remove useless
+       arguments when calling `org-move-to-column'.
+
+       * org.el (org-refile): Fix calling with a numeric prefix argument
+       of 3 to refile and keep.
+
+       * org-clock.el (org-clock-get-table-data): When :link is `t' in
+       the clocktable parameters, bracket links in the clocktable should
+       only contain their description, other C-c C-o will try to open the
+       bracket link at point instead of the headline.
+
+       * org-agenda.el (org-agenda-todo): Always restore the window state
+       after `org-agenda-change-all-lines' has been called.
+       (org-agenda-open-link): Don't throw an error when trying to open a
+       link when the point is on a place that is not associated with a
+       buffer.
+
+       * ox-latex.el (org-latex-link): Escape `%' characters.
+
+       * org.el (org-entry-get-with-inheritance): Remove wrong quote.
+       (org-entry-get): Only try to combine file properties with local
+       properties when the property drawer contains such local property,
+       not when the property drawer exists.
+
+       * ox-latex.el (org-latex-link):
+       * ox-html.el (org-html-link):
+       * ox-beamer.el (org-beamer-link): Fix links to radio targets.
+
+       * ox-ascii.el (org-ascii-link): For links to a radio target, use
+       the link, not the target.
+
+       * org.el (org-do-emphasis-faces): Explicitly prevent nested
+       emphasis.
+       (org-insert-heading): Don't remove whitespaces following an empty
+       headline.
+
+       * org-timer.el (org-timer-stop): Set `org-timer-current-timer' to
+       nil.
+
+       * org.el (org-store-link): Ensure desc is not nil before matching
+       a regexp against it.  Fall back on an empty string when no
+       description is available.
+
+       * org-agenda.el (org-agenda-list-stuck-projects): Bugfix: set
+       `org-agenda-buffer-name'.
+
+       * org-capture.el (org-capture-finalize): Ensure to widen the
+       buffer when the target buffer is not initially narrowed.
+
+       * org-compat.el (org-move-to-column): Fix bug about ignoring
+       bracket links visibility status in tables with S-RET.
+
+       * org-src.el (org-edit-src-find-region-and-lang): Check if we are
+       in a table.el table last.
+
+       * org.el (org-delete-property): Don't suggest to delete the
+       CATEGORY property when the category is not explicitely set in the
+       property drawer.  Also enforce matching when completing.
+       (org-insert-heading): Fix regression: with two universal prefixes,
+       insert heading at the end of the subtree.
+       (org-insert-todo-heading): Bugfix: only enforce the first TODO
+       state when arg is '(4).
+
+       * org-agenda.el (org-agenda-skip-subtree-if): Fix docstring.
+
+       * org.el (org-contextualize-validate-key): Fix bug: perform the
+       check even when (buffer-file-name) returns `nil'.
+
+       * org-colview.el (org-columns-display-here): Let-bind `fm'.
+
+       * org.el (org-emphasis-alist): Use `org-verbatim' for =text=
+       and `org-code' for ~text~.
+       (org-open-link-marker): Fix typo in docstring.
+
+       * org-colview.el (org-columns-display-here): Fix the column
+       view for numbers with a format specifier (e.g. {+; %5.1f}).
+
+       * org-src.el (org-edit-src-code): Throw a warning instead of
+       an error when loading the mode fails, otherwise the user is
+       left with unusable buffers.
+
+       * org-table.el (org-table-copy-down)
+       (org-table-find-dataline, org-table-move-row)
+       (org-table-insert-hline, org-table-kill-row): Use
+       `org-move-to-column' with the IGNORE-INVISIBLE arg set to `t', so
+       that abbreviated rows don't interfer with setting the cursor back
+       at the correct position.
+
+       * org.el (org-agenda-prepare-buffers): Use `save-excursion'
+       instead of `save-window-excursion'.
+       (org-file-contents): Return an empty string instead of the
+       message.
+       (org-open-at-point): Fix bug when opening a plain link followed by
+       a bracket link.
+       (org-ctrl-c-ctrl-c): Fix behavior when hitting C-c C-c on LaTeX
+       formulas in tables.
+       (org-refile--get-location): New internal function using a wider
+       set of possible refile locations.
+       (org-refile-get-location): Use it.
+       (org-refile): Fix bug when refiling the last subtree of the
+       buffer: don't leave out the last character.
+       (org-sort-entries): Restore the point location when there is
+       nothing to sort.
+
+       * org-table.el (org-table-field-info): Throw a user error when not
+       at a table.
+
+       * org-agenda.el (org-agenda-drag-line-forward): Call
+       `org-agenda-mark-clocking-task' when done.
+       (org-agenda-mark-clocking-task): Small refactoring.
+
+       * org-compat.el (org-set-transient-map): Alias pointing at
+       `set-transient-map' if defined, at `set-temporary-overlay-map'
+       otherwise.
+
+       * org-agenda.el (org-agenda-next-item)
+       (org-agenda-previous-item, org-agenda-toggle-archive-tag)
+       (org-agenda-todo, org-agenda-priority, org-agenda-clock-in)
+       (org-agenda-clock-out): Put the cursor back on the correct
+       column, when possible.
+       (org-agenda-todo): When `org-clock-out-when-done' is `t', also
+       remove the current clock overlay.
+
+       * org.el (org-format-latex-options): Fix docstring.
+
+       * ox.el (org-export--get-subtree-options): When using the headline
+       as a title for a subtree export, only take the true heading, no
+       TODO keyword, no priority cookie, no tag.
+
+       * org.el (customize-package-emacs-version-alist): Fix Org version
+       for Emacs 24.4.
+
+       * org.el (org-demote): Ignore invisible text when aligning tags.
+       (org-set-tags): When JUST-ALIGN is 'ignore-column, ignore
+       invisible text when restoring the cursor to the correct column.
+
+       * ob-python.el (org-babel-python-var-to-python): Bugfix: Strip
+       properties before formatting the results.
+
+       * org-agenda.el (org-agenda-regexp-filter-preset): Fix typo in
+       docstring.
+       (org-agenda-reapply-filters): New function.
+       (org-agenda-drag-line-forward): Rewrite to fix a bug when used
+       in filtered agendas.
+       (org-agenda-drag-line-backward): Rewrite using
+       `org-agenda-drag-line-forward'.
+
+       * ob-table.el (org-sbe): Rename from `sbe'.
+
+       * org.el (org-store-link): When a link has been stored, always
+       returns it.
+
+       * ob-python.el (org-babel-python-var-to-python): Fix code typo.
+
+       * org-entities.el (org-entities-help): Prevent the display of
+       pretty entities, as this help buffer is meant to list literal
+       strings, not utf-8 representations.
+
+2014-04-22  Benjamin Drieu  <bdrieu@april.org>
+
+       * org.el (org-store-link): Fix selection of the function to store
+       the link.
+
+2014-04-22  Ilya Shlyakhter  <ilya_shl@alum.mit.edu>
+
+       * org.el (org-entry-get-with-inheritance): Temporarily let-bind
+       `org-file-properties', `org-global-properties' and
+       `org-global-properties-fixed' to nil before calling
+       `org-entry-get' on entries up the hierarchy from the queried
+       entry.
+
+2014-04-22  Justin Gordon  <justin.gordon@gmail.com>
+
+       * ox-md (org-md-separate-elements): Fix blank line insertion
+       between elements.
+
+       * ox-md.el (org-md-inner-template): New function.
+
+2014-04-22  Leonard Randall  <leonard.a.randall@gmail.com>  (tiny change)
+
+       * org-bibtex.el (org-bibtex-headline): Fix insertion of keywords
+       of unknown BibTeX entries.
+
+2014-04-22  Markus Hauck  <markus1189@gmail.com>  (tiny change)
+
+       * org-agenda.el (org-agenda-get-scheduled): If
+       `org-agenda-skip-scheduled-if-deadline-is-shown' is set to
+       'repeated-after-deadline, still show tasks without any deadline
+
+2014-04-22  Michael Brand  <michael.ch.brand@gmail.com>
+
+       * org-table.el (org-table-fix-formulas): Handle multiple #+TBLFM
+       lines with `forward-line'.
+
+2014-04-22  Michael Weylandt  <michael.weylandt@gmail.com>  (tiny change)
+
+       * ox-latex.el (org-latex-export-to-latex): Downcase the language
+       name when using minted highlighting for src block exports.
+
+2014-04-22  Nick Dokos  <ndokos@gmail.com>
+
+       * org-mobile.el (org-mobile-create-index-file): delete :grouptags
+       entries from tags list when creating the org-mobile index file.
+
+2014-04-22  Nicolas Goaziou  <n.goaziou@gmail.com>
+
+       * ox.el (org-export-copy-to-kill-ring): Comply to docstrings
+       standards.
+
+       * org.el (org-sparse-tree): Fix code typo.  Small refactoring.
+
+       * ox-latex.el (org-latex-link):
+       * ox-html.el (org-html-link):  Do not expand absolute file names
+       and do not try to fix hierarchy part, as it is already taken care of
+       at the parser level.
+
+       * ox-md.el (org-md-link): Ditto.  Also fix absolute file names.
+
+       * ox-odt.el (org-odt-link):
+       * ox-man.el (org-man-link):
+       * ox-texinfo.el (org-texinfo-link):
+       * org-element.el (org-element-link-parser): Fix ill-defined "file"
+       type links.  Expand absolute file names in the process.
+
+       * org.el (org-make-link-regexps): Use `regexp-opt' instead of
+       `mapconcat' and `regexp-quote'.
+
+       * ox-html.el (org-html-link):
+       * ox-latex.el (org-latex-link):
+       * ox-man.el (org-man-link):
+       * ox-odt.el (org-odt-link):
+       * ox-html.el (org-html-link):
+       * ox-latex.el (org-latex-link):
+       * ox-man.el (org-man-link):
+       * ox-odt.el (org-odt-link):
+       * ox-texinfo.el (org-texinfo-link): Append "//" after some link
+       types.
+
+       * ox-md.el (org-md-link):
+       * org.el (org-make-link-regexps): Allow optional double slashes
+       after type.  Small refactoring.
+
+       * org-element.el (org-element-headline-parser): Tiny refactoring.
+
+       * org-element.el (org-element-headline-parser): Correctly parse
+       blank lines after a headline.
+
+       * org-element.el (org-element-table-cell-parser)
+       (org-element-table-cell-successor): Recognize cell even when last
+       vertical bar is missing.
+
+       * ox-md.el (org-md-example-block): handle switches and references
+       in source blocks.
+
+       * org.el (org-latex-packages-alist)
+       (org-latex-default-packages-alist): Update docstrings.
+
+       * ox-ascii.el (org-ascii--unique-links): Ignore white spaces when
+       uniquifying links in section.
+
+       * ox-odt.el (org-odt-template): Ignore blank titles.
+
+       * ox-publish.el (org-publish-find-title): Fix (invalid-read-syntax
+       "#").
+
+       * ox-ascii.el (org-ascii-link):
+       * ox-beamer.el (org-beamer-link):
+       * ox-html.el (org-html-link):
+       * ox-latex.el (org-latex-link):
+       * ox-md.el (org-md-link):
+       * ox-odt.el (org-odt-link): Update radio target export according
+       to recent changes.
+
+       * org-element.el (org-element-all-successors)
+       (org-element-object-restrictions): Prioritize `link' over other
+       successors in order to find radio links starting with another
+       syntax object (e.g., an entity).  Also allow text markup within
+       radio targets.
+       (org-element-link-parser): Add contents to radio targets.
+
+       * org.el (org-make-target-link-regexp): Fix regexp so it can match
+       targets starting with an Org object (e.g., an entity).
+       (org-ctrl-c-ctrl-c): Fix function when applied on an object contained
+       within a radio target.
+
+       * org.el (org-mode): Change "\" and "~" characters syntax from
+       `punctuation' to `symbol' so they are on par with other characters
+       used in Org syntax (e.g., "/", "*"...).
+
+       * ox-beamer.el (org-beamer-publish-to-pdf):
+       * ox-latex.el (org-latex-publish-to-pdf): Ensure ".tex" file is
+       generated in the same directory as the ".org" file.
+
+       * ox-latex.el (org-latex-headline): Hard-code "\underline" in
+       sections because "\uline" ("ulem" package) returns an error and
+       "\ul" ("soul" package) doesn't support chinese characters.
+
+       * ox-ascii.el (org-ascii-link): Correctly handle case mismatch
+       between radio targets and radio links.
+
+       * org-element.el (org-element-link-parser): "radio" links have
+       their path downcased to avoid introducing case mismatch with their
+       relative radio target.  With this change it is also necessary to
+       add contents to them, since `:path' property no longer matches
+       real value of the link.
+       (org-element-radio-target-parser): Downcase value as explained
+       above.  Store the initial value in a new `:raw-value' property.
+
+       * org-element.el (org-element-context): Fix parsing of bold
+       objects at the beginning of a headline.
+
+       * org-element.el (org-element-context): Fix timestamps parsing.
+
+       * ox-beamer.el (org-beamer-item): Insert the export snippet right
+       after the first \item, not all of them.
+
+       * org-element.el (org-element--list-struct): Fix regexp.
+
+       * org-element.el (org-element-inlinetask-parser): Fix parsing when
+       regular and degenerate inlinetasks are mixed in the section.
+
+       * ox-md.el (org-md-link): Generate md links to other Org files
+       instead of html links.  Do not confuse caption and alt-text.
+       Provide "img" as default alt-text.
+
+       * org-element.el (org-element-normalize-contents): Do not ignore
+       empty lines when an object follows.
+       (org-element-interpret-data): Do not remove properties by
+       side-effect when interpreting a string, as it also removes them
+       from the parse tree, making the string unusable without its
+       :parent property.
+
+       * ob-exp.el (org-babel-exp-process-buffer): Also check
+       `org-src-preserve-indentation' to know when to preserve indentation.
+       (org-babel-exp-code-template): Include switches in template.
+       (org-babel-exp-code): Provide %switches placeholder.
+
+       * ox-latex.el (org-latex-plain-list): Do not automatically
+       enclose value for :options attribute within square brackets.
+       Instead, append them verbatim next to the block name, as special
+       blocks do.
+
+       * ob-exp.el (org-babel-exp-code): Fix export of src blocks with
+       flags.
+       (org-babel-exp-process-buffer): Make processing more robust when
+       results are inserted before source block or when source block is
+       followed by multiple blank lines.
+
+       * ox.el (org-export-insert-default-template): Only insert
+       keywords and options relatives to the selected back-end.  Ignore
+       those relatives to its parent in the case of a derived back-end.
+
+       * ox-beamer.el: Remove unnecessary package definitions in default
+       class.
+
+       * ox-latex.el (org-latex-headline, org-latex-item): Fix items
+       starting with a square bracket.
+
+       * org.el (org-mode-restart): Fix turning off `org-indent-mode'
+       when necessary.
+       (org-get-previous-line-level): Do not call `org-current-level'
+       twice unless necessary.  Also, avoid using `line-number-at-pos'
+       when the information needed is to know if point is in the first
+       line of the visible part of the buffer.
+
+       * ob-core.el (org-babel-get-inline-src-block-matches): Do not
+       compute line number if all is needed is to know if we're on the
+       first one.
+
+       * ox-md.el (org-md-item): Do not return an error when exporting
+       an empty item.
+
+       * ox-beamer.el (org-beamer-select-environment): Function doesn't
+       work if fast tag selection is disabled, so make sure it is always
+       on, independently on user's configuration.
+
+2014-04-22  Nikolai Weibull  <now@disu.se>  (tiny change)
+
+       * org.el (org-mode): Add guard around set-face-foreground.
+
+2014-04-22  Rasmus  <w530@pank.eu>
+
+       * ox-html.el (org-html-html5-elements): Drop reference to hgroup.
+
+2014-04-22  Rick Frankel  <rick@rickster.com>
+
+       * ox-html.el (org-html-link): Unescape org-escaped links an
+       re-escape for html (browser).
+
+2014-04-22  Sacha Chua  <sacha@sachachua.com>
+
+       * org.el (org-refresh-properties): Don't throw an error when
+       reaching the end of the buffer.
+
+2014-04-22  Stefan-W. Hahn  <stefan.hahn@s-hahn.de>  (tiny change)
+
+       * org-bibtex.el (org-bibtex-read): Check string length before
+       using aref.
+
+2014-04-22  Yasushi SHOJI  <yashi@atmark-techno.com>
+
+       * ox-ascii.el (org-ascii--current-text-width): Convert `length'
+       to `string-width'.
+       (org-ascii--build-title, org-ascii--build-toc)
+       (org-ascii--list-listings, org-ascii--list-tables)
+       (org-ascii-template--document-title)
+       (org-ascii-inner-template, org-ascii-format-inlinetask-default)
+       (org-ascii-format-inlinetask-default, org-ascii-item
+       (org-ascii--table-cell-width, org-ascii-table-cell)
+       (org-ascii--current-text-width): Likewise.
+
 2014-02-25  Glenn Morris  <rgm@gnu.org>
 
        * org-version.el (org-odt-data-dir):
index f06cdaf7972d8d3a02a031519909468204d86dc5..e8943c6656114113d33b3583f79f8321fcf03dc9 100644 (file)
@@ -217,7 +217,7 @@ Returns non-nil if match-data set"
   (let ((src-at-0-p (save-excursion
                      (beginning-of-line 1)
                      (string= "src" (thing-at-point 'word))))
-       (first-line-p (= 1 (line-number-at-pos)))
+       (first-line-p (= (line-beginning-position) (point-min)))
        (orig (point)))
     (let ((search-for (cond ((and src-at-0-p first-line-p  "src_"))
                            (first-line-p "[[:punct:] \t]src_")
index 74581421591a554a088abf19a0b6dd7b323a67a4..6d65496dbd4ed540515c7f93448a01456d06b63d 100644 (file)
@@ -169,8 +169,12 @@ this template."
                            (backward-char)
                            (save-match-data (org-element-context))))
                 (type (org-element-type element))
-                (beg-el (org-element-property :begin element))
-                (end-el (org-element-property :end element)))
+                (begin (copy-marker (org-element-property :begin element)))
+                (end (copy-marker
+                      (save-excursion
+                        (goto-char (org-element-property :end element))
+                        (skip-chars-backward " \r\t\n")
+                        (point)))))
            (case type
              (inline-src-block
               (let* ((info (org-babel-parse-inline-src-block-match))
@@ -181,24 +185,21 @@ this template."
                           (org-babel-expand-noweb-references
                            info (org-babel-exp-get-export-buffer))
                         (nth 1 info)))
-                (goto-char beg-el)
+                (goto-char begin)
                 (let ((replacement (org-babel-exp-do-export info 'inline)))
                   (if (equal replacement "")
                       ;; Replacement code is empty: remove inline src
                       ;; block, including extra white space that
                       ;; might have been created when inserting
                       ;; results.
-                      (delete-region beg-el
-                                     (progn (goto-char end-el)
+                      (delete-region begin
+                                     (progn (goto-char end)
                                             (skip-chars-forward " \t")
                                             (point)))
                     ;; Otherwise: remove inline src block but
                     ;; preserve following white spaces.  Then insert
                     ;; value.
-                    (delete-region beg-el
-                                   (progn (goto-char end-el)
-                                          (skip-chars-backward " \t")
-                                          (point)))
+                    (delete-region begin end)
                     (insert replacement)))))
              ((babel-call inline-babel-call)
               (let* ((lob-info (org-babel-lob-get-info))
@@ -229,8 +230,8 @@ this template."
                 ;; results.
                 (if (equal rep "")
                     (delete-region
-                     beg-el
-                     (progn (goto-char end-el)
+                     begin
+                     (progn (goto-char end)
                             (if (not (eq type 'babel-call))
                                 (progn (skip-chars-forward " \t") (point))
                               (skip-chars-forward " \r\t\n")
@@ -238,25 +239,17 @@ this template."
                   ;; Otherwise, preserve following white
                   ;; spaces/newlines and then, insert replacement
                   ;; string.
-                  (goto-char beg-el)
-                  (delete-region beg-el
-                                 (progn (goto-char end-el)
-                                        (skip-chars-backward " \r\t\n")
-                                        (point)))
+                  (goto-char begin)
+                  (delete-region begin end)
                   (insert rep))))
              (src-block
-              (let* ((match-start (match-beginning 0))
-                     ;; Make sure we don't remove any blank lines
-                     ;; after the block when replacing it.
-                     (block-end (save-excursion
-                                  (goto-char end-el)
-                                  (skip-chars-backward " \r\t\n")
-                                  (line-end-position)))
+              (let* ((match-start (copy-marker (match-beginning 0)))
                      (ind (org-get-indentation))
                      (headers
                       (cons
                        (org-element-property :language element)
-                       (let ((params (org-element-property :parameters element)))
+                       (let ((params (org-element-property :parameters
+                                                           element)))
                          (and params (org-split-string params "[ \t]+"))))))
                 ;; Take care of matched block: compute replacement
                 ;; string.  In particular, a nil REPLACEMENT means
@@ -264,21 +257,31 @@ this template."
                 ;; string should remove the block.
                 (let ((replacement (progn (goto-char match-start)
                                           (org-babel-exp-src-block headers))))
-                  (cond ((not replacement) (goto-char block-end))
+                  (cond ((not replacement) (goto-char end))
                         ((equal replacement "")
-                         (delete-region beg-el end-el))
+                         (goto-char end)
+                         (skip-chars-forward " \r\t\n")
+                         (beginning-of-line)
+                         (delete-region begin (point)))
                         (t
                          (goto-char match-start)
-                         (delete-region (point) block-end)
+                         (delete-region (point)
+                                        (save-excursion (goto-char end)
+                                                        (line-end-position)))
                          (insert replacement)
-                         (if (org-element-property :preserve-indent element)
+                         (if (or org-src-preserve-indentation
+                                 (org-element-property :preserve-indent
+                                                       element))
                              ;; Indent only the code block markers.
                              (save-excursion (skip-chars-backward " \r\t\n")
                                              (indent-line-to ind)
                                              (goto-char match-start)
                                              (indent-line-to ind))
                            ;; Indent everything.
-                           (indent-rigidly match-start (point) ind))))))))))))))
+                           (indent-rigidly match-start (point) ind)))))
+                (set-marker match-start nil))))
+           (set-marker begin nil)
+           (set-marker end nil)))))))
 
 (defun org-babel-in-example-or-verbatim ()
   "Return true if point is in example or verbatim code.
@@ -308,7 +311,7 @@ The function respects the value of the :exports header argument."
             (org-babel-exp-code info)))))
 
 (defcustom org-babel-exp-code-template
-  "#+BEGIN_SRC %lang%flags\n%body\n#+END_SRC"
+  "#+BEGIN_SRC %lang%switches%flags\n%body\n#+END_SRC"
   "Template used to export the body of code blocks.
 This template may be customized to include additional information
 such as the code block name, or the values of particular header
@@ -318,6 +321,7 @@ and the following %keys may be used.
  lang ------ the language of the code block
  name ------ the name of the code block
  body ------ the body of the code block
+ switches -- the switches associated to the code block
  flags ----- the flags passed to the code block
 
 In addition to the keys mentioned above, every header argument
@@ -340,11 +344,14 @@ replaced with its value."
    org-babel-exp-code-template
    `(("lang"  . ,(nth 0 info))
      ("body"  . ,(org-escape-code-in-string (nth 1 info)))
+     ("switches" . ,(let ((f (nth 3 info)))
+                     (and (org-string-nw-p f) (concat " " f))))
+     ("flags" . ,(let ((f (assq :flags (nth 2 info))))
+                  (and f (concat " " (cdr f)))))
      ,@(mapcar (lambda (pair)
                 (cons (substring (symbol-name (car pair)) 1)
                       (format "%S" (cdr pair))))
               (nth 2 info))
-     ("flags" . ,(let ((f (nth 3 info))) (when f (concat " " f))))
      ("name"  . ,(or (nth 4 info) "")))))
 
 (defun org-babel-exp-results (info type &optional silent hash)
index 8767e88e4c3fcd796612fccb4558de07abadf2f8..ffe5dcf59df36c3d7d266078b0a1aa9c3b3eb3a9 100644 (file)
@@ -85,10 +85,15 @@ code."
      (lambda (pair)
        (cons
        (car pair) ;; variable name
-       (if (listp (cdr pair)) ;; variable value
-           (org-babel-gnuplot-table-to-data
-            (cdr pair) (org-babel-temp-file "gnuplot-") params)
-         (cdr pair))))
+       (let* ((val (cdr pair)) ;; variable value
+              (lp  (listp val)))
+         (if lp
+             (org-babel-gnuplot-table-to-data
+              (let* ((first  (car val))
+                     (tablep (or (listp first) (symbolp first))))
+                (if tablep val (mapcar 'list val)))
+              (org-babel-temp-file "gnuplot-") params)
+         val))))
      (mapcar #'cdr (org-babel-get-header params :var)))))
 
 (defun org-babel-expand-body:gnuplot (body params)
index 145768272a688c698039f833315c2c27afd6556d..baa5764ac42f04a4119f8d04374a14a9b3b2ad63 100644 (file)
@@ -137,7 +137,7 @@ specifying a variable of the same value."
        org-babel-python-hline-to
       (format
        (if (and (stringp var) (string-match "[\n\r]" var)) "\"\"%S\"\"" "%S")
-       var))))
+       (if (stringp var) (substring-no-properties var) var)))))
 
 (defun org-babel-python-table-or-string (results)
   "Convert RESULTS into an appropriate elisp value.
index ece99c559a29a8598fc88a029102f0633898ef4d..152af86a8ef6c54a5a5d62021606c9660741b6b6 100644 (file)
@@ -85,7 +85,9 @@ the variable."
       (cons (intern var)
            (let ((out (save-excursion
                         (when org-babel-current-src-block-location
-                          (goto-char org-babel-current-src-block-location))
+                          (goto-char (if (markerp org-babel-current-src-block-location)
+                                         (marker-position org-babel-current-src-block-location)
+                                       org-babel-current-src-block-location)))
                         (org-babel-read ref))))
              (if (equal out ref)
                  (if (string-match "^\".*\"$" ref)
index f7c5526d4381a503000768d94fc273b12b039424..831e3521f83857fd82cc8f999e9ae78b4943a78a 100644 (file)
@@ -24,7 +24,7 @@
 ;;; Commentary:
 
 ;; Should allow calling functions from org-mode tables using the
-;; function `sbe' as so...
+;; function `org-sbe' as so...
 
 ;; #+begin_src emacs-lisp :results silent
 ;;   (defun fibbd (n) (if (< n 2) 1 (+ (fibbd (- n 1)) (fibbd (- n 2)))))
@@ -47,7 +47,7 @@
 ;; |        7 |        |
 ;; |        8 |        |
 ;; |        9 |        |
-;; #+TBLFM: $2='(sbe 'fibbd (n $1))
+;; #+TBLFM: $2='(org-sbe 'fibbd (n $1))
 
 ;;; Code:
 (require 'ob-core)
@@ -60,14 +60,14 @@ character and replace it with ellipses."
       (concat (substring string 0 (match-beginning 0))
              (if (match-string 1 string) "...")) string))
 
-(defmacro sbe (source-block &rest variables) ;FIXME: Namespace prefix!
+(defmacro org-sbe (source-block &rest variables)
   "Return the results of calling SOURCE-BLOCK with VARIABLES.
 Each element of VARIABLES should be a two
 element list, whose first element is the name of the variable and
 second element is a string of its value.  The following call to
-`sbe' would be equivalent to the following source code block.
+`org-sbe' would be equivalent to the following source code block.
 
- (sbe 'source-block (n $2) (m 3))
+ (org-sbe 'source-block (n $2) (m 3))
 
 #+begin_src emacs-lisp :var results=source-block(n=val_at_col_2, m=3) :results silent
 results
@@ -84,7 +84,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='(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)))
index ccf08a2c97b0353c817aaebe0560d8ad497538cc..18fada15de88d2cf7736629350f8a6f57800393c 100644 (file)
@@ -649,8 +649,8 @@ of custom agenda commands."
   :tag "Org Agenda Match View"
   :group 'org-agenda)
 (defgroup org-agenda-search-view nil
-  "Options concerning the general tags/property/todo match agenda view."
-  :tag "Org Agenda Match View"
+  "Options concerning the search agenda view."
+  :tag "Org Agenda Search View"
   :group 'org-agenda)
 
 (defvar org-agenda-archives-mode nil
@@ -2144,6 +2144,7 @@ The following commands are available:
   ;; Keep global-font-lock-mode from turning on font-lock-mode
   (org-set-local 'font-lock-global-modes (list 'not major-mode))
   (setq mode-name "Org-Agenda")
+  (setq indent-tabs-mode nil)
   (use-local-map org-agenda-mode-map)
   (easy-menu-add org-agenda-menu)
   (if org-startup-truncated (setq truncate-lines t))
@@ -3579,7 +3580,7 @@ the global options and expect it to be applied to the entire view.")
 
 (defvar org-agenda-regexp-filter-preset nil
   "A preset of the regexp filter used for secondary agenda filtering.
-This must be a list of strings, each string must be a single category
+This must be a list of strings, each string must be a single regexp
 preceded by \"+\" or \"-\".
 This variable should not be set directly, but agenda custom commands can
 bind it in the options section.  The preset filter is a global property of
@@ -3718,12 +3719,7 @@ generating a new one."
          (org-agenda-fontify-priorities))
        (when (and org-agenda-dim-blocked-tasks org-blocker-hook)
          (org-agenda-dim-blocked-tasks))
-       ;; We need to widen when `org-agenda-finalize' is called from
-       ;; `org-agenda-change-all-lines' (e.g. in `org-agenda-clock-in')
-       (when org-clock-current-task
-         (save-restriction
-           (widen)
-           (org-agenda-mark-clocking-task)))
+       (org-agenda-mark-clocking-task)
        (when org-agenda-entry-text-mode
          (org-agenda-entry-text-hide)
          (org-agenda-entry-text-show))
@@ -3750,30 +3746,44 @@ generating a new one."
                                             (delete-dups
                                              (mapcar 'downcase (org-get-tags-at))))))))))
        (run-hooks 'org-agenda-finalize-hook)
-       (when (or org-agenda-tag-filter (get 'org-agenda-tag-filter :preset-filter))
+       (when org-agenda-tag-filter
          (org-agenda-filter-apply org-agenda-tag-filter 'tag))
-       (when (or org-agenda-category-filter (get 'org-agenda-category-filter :preset-filter))
+       (when (get 'org-agenda-tag-filter :preset-filter)
+         (org-agenda-filter-apply
+          (get 'org-agenda-tag-filter :preset-filter) 'tag))
+       (when org-agenda-category-filter
          (org-agenda-filter-apply org-agenda-category-filter 'category))
-       (when (or org-agenda-regexp-filter (get 'org-agenda-regexp-filter :preset-filter))
+       (when (get 'org-agenda-category-filter :preset-filter)
+         (org-agenda-filter-apply
+          (get 'org-agenda-category-filter :preset-filter) 'category))
+       (when org-agenda-regexp-filter
          (org-agenda-filter-apply org-agenda-regexp-filter 'regexp))
+       (when (get 'org-agenda-regexp-filter :preset-filter)
+         (org-agenda-filter-apply
+          (get 'org-agenda-regexp-filter :preset-filter) 'regexp))
        (org-add-hook 'kill-buffer-hook 'org-agenda-reset-markers 'append 'local)))))
 
 (defun org-agenda-mark-clocking-task ()
   "Mark the current clock entry in the agenda if it is present."
-  (org-agenda-unmark-clocking-task)
-  (when (marker-buffer org-clock-hd-marker)
-    (save-excursion
-      (goto-char (point-min))
-      (let (s ov)
-       (while (setq s (next-single-property-change (point) 'org-hd-marker))
-         (goto-char s)
-         (when (equal (org-get-at-bol 'org-hd-marker)
-                      org-clock-hd-marker)
-           (setq ov (make-overlay (point-at-bol) (1+ (point-at-eol))))
-           (overlay-put ov 'type 'org-agenda-clocking)
-           (overlay-put ov 'face 'org-agenda-clocking)
-           (overlay-put ov 'help-echo
-                        "The clock is running in this item")))))))
+  ;; We need to widen when `org-agenda-finalize' is called from
+  ;; `org-agenda-change-all-lines' (e.g. in `org-agenda-clock-in')
+  (when org-clock-current-task
+    (save-restriction
+      (widen)
+      (org-agenda-unmark-clocking-task)
+      (when (marker-buffer org-clock-hd-marker)
+       (save-excursion
+         (goto-char (point-min))
+         (let (s ov)
+           (while (setq s (next-single-property-change (point) 'org-hd-marker))
+             (goto-char s)
+             (when (equal (org-get-at-bol 'org-hd-marker)
+                          org-clock-hd-marker)
+               (setq ov (make-overlay (point-at-bol) (1+ (point-at-eol))))
+               (overlay-put ov 'type 'org-agenda-clocking)
+               (overlay-put ov 'face 'org-agenda-clocking)
+               (overlay-put ov 'help-echo
+                            "The clock is running in this item")))))))))
 
 (defun org-agenda-unmark-clocking-task ()
   "Unmark the current clocking task."
@@ -3851,11 +3861,12 @@ dimming them."
                  e (point-at-eol)
                  ov (make-overlay b e))
            (if invis1
-               (overlay-put ov 'invisible t)
+               (progn (overlay-put ov 'invisible t)
+                      (overlay-put ov 'intangible t))
              (overlay-put ov 'face 'org-agenda-dimmed-todo-face))
            (overlay-put ov 'org-type 'org-blocked-todo))))))
-    (when (org-called-interactively-p 'interactive)
-      (message "Dim or hide blocked tasks...done")))
+  (when (org-called-interactively-p 'interactive)
+    (message "Dim or hide blocked tasks...done")))
 
 (defvar org-agenda-skip-function nil
   "Function to be called at each match during agenda construction.
@@ -4917,7 +4928,7 @@ See `org-agenda-skip-if' for details."
   (org-agenda-skip-if nil conditions))
 
 (defun org-agenda-skip-subtree-if (&rest conditions)
-  "Skip entry if any of CONDITIONS is true.
+  "Skip subtree if any of CONDITIONS is true.
 See `org-agenda-skip-if' for details."
   (org-agenda-skip-if t conditions))
 
@@ -5086,6 +5097,7 @@ of what a project is and how to check if it stuck, customize the variable
              (mapconcat 'identity re-list "\\|")
            (error "No information how to identify unstuck projects")))
     (org-tags-view nil matcher)
+    (setq org-agenda-buffer-name (buffer-name))
     (with-current-buffer org-agenda-buffer-name
       (setq org-agenda-redo-command
            `(org-agenda-list-stuck-projects ,current-prefix-arg)))))
@@ -5453,7 +5465,7 @@ This function is invoked if `org-agenda-todo-ignore-deadlines',
 
 ;;;###autoload
 (defun org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item
-  (&optional end)
+    (&optional end)
   "Do we have a reason to ignore this TODO entry because it has a time stamp?"
   (when (or org-agenda-todo-ignore-with-date
            org-agenda-todo-ignore-scheduled
@@ -5690,10 +5702,10 @@ This function is invoked if `org-agenda-todo-ignore-deadlines',
              (setq txt "SEXP entry returned empty string"))
            (setq txt (org-agenda-format-item extra txt level category tags 'time))
            (org-add-props txt props 'org-marker marker
-             'org-category category 'date date 'todo-state todo-state
-             'org-category-position category-pos 'tags tags
-             'level level
-             'type "sexp" 'warntime warntime)
+                          'org-category category 'date date 'todo-state todo-state
+                          'org-category-position category-pos 'tags tags
+                          'level level
+                          'type "sexp" 'warntime warntime)
            (push txt ee)))))
     (nreverse ee)))
 
@@ -6244,6 +6256,7 @@ an hour specification like [h]h:mm."
                    category-pos (get-text-property (point) 'org-category-position))
              (if (and (eq org-agenda-skip-scheduled-if-deadline-is-shown
                           'repeated-after-deadline)
+                      (org-get-deadline-time (point))
                       (<= 0 (- d2 (time-to-days (org-get-deadline-time (point))))))
                  (throw :skip nil))
              (if (not (re-search-backward "^\\*+[ \t]+" nil t))
@@ -7370,7 +7383,7 @@ With two prefix arguments, remove the regexp filters."
                         (read-from-minibuffer
                          (if (equal strip '(4))
                              "Filter out entries matching regexp: "
-                             "Narrow to entries matching regexp: ")))))
+                           "Narrow to entries matching regexp: ")))))
        (push flt org-agenda-regexp-filter)
        (org-agenda-filter-apply org-agenda-regexp-filter 'regexp))
     (org-agenda-filter-show-all-re)
@@ -7645,7 +7658,7 @@ When NO-OPERATOR is non-nil, do not add the + operator to returned tags."
       (let* ((pos (org-get-at-bol 'org-hd-marker))
              (tophl (and pos (org-find-top-headline pos))))
         (if (and tophl (funcall (if negative 'identity 'not)
-                                 (string= hl tophl)))
+                               (string= hl tophl)))
             (org-agenda-filter-hide-line 'category)))
       (beginning-of-line 2)))
   (if (get-char-property (point) 'invisible)
@@ -7655,10 +7668,11 @@ When NO-OPERATOR is non-nil, do not add the + operator to returned tags."
 
 (defun org-agenda-filter-hide-line (type)
   "Hide lines with TYPE in the agenda buffer."
-  (let (ov)
-    (setq ov (make-overlay (max (point-min) (1- (point-at-bol)))
-                          (point-at-eol)))
+  (let* ((b (max (point-min) (1- (point-at-bol))))
+        (e (point-at-eol))
+        (ov (make-overlay b e)))
     (overlay-put ov 'invisible t)
+    (overlay-put ov 'intangible t)
     (overlay-put ov 'type type)
     (cond ((eq type 'tag) (push ov org-agenda-tag-filter-overlays))
          ((eq type 'category) (push ov org-agenda-cat-filter-overlays))
@@ -8482,7 +8496,8 @@ It also looks at the text of the entry itself."
                     (org-get-at-bol 'org-marker)))
         (buffer (and marker (marker-buffer marker)))
         (prefix (buffer-substring (point-at-bol) (point-at-eol)))
-        (lkall (org-offer-links-in-entry buffer marker arg prefix))
+        (lkall (and buffer (org-offer-links-in-entry
+                            buffer marker arg prefix)))
         (lk0 (car lkall))
         (lk (if (stringp lk0) (list lk0) lk0))
         (lkend (cdr lkall))
@@ -8789,8 +8804,12 @@ the same tree node, and the headline of the tree node in the Org-mode file."
          (org-back-to-heading)
          (move-marker org-last-heading-marker (point))))
       (beginning-of-line 1)
-      (save-excursion
+      (save-window-excursion
        (org-agenda-change-all-lines newhead hdmarker 'fixface just-one))
+      (when (org-bound-and-true-p org-clock-out-when-done)
+       (string-match (concat "^" (regexp-opt org-done-keywords-for-agenda))
+                     newhead)
+       (org-agenda-unmark-clocking-task))
       (org-move-to-column col))))
 
 (defun org-agenda-add-note (&optional arg)
@@ -8927,7 +8946,8 @@ Called with a universal prefix arg, show the priority instead of setting it."
     (unless org-enable-priority-commands
       (error "Priority commands are disabled"))
     (org-agenda-check-no-diary)
-    (let* ((marker (or (org-get-at-bol 'org-marker)
+    (let* ((col (current-column))
+          (marker (or (org-get-at-bol 'org-marker)
                       (org-agenda-error)))
           (hdmarker (org-get-at-bol 'org-hd-marker))
           (buffer (marker-buffer hdmarker))
@@ -8946,7 +8966,7 @@ Called with a universal prefix arg, show the priority instead of setting it."
          (end-of-line 1)
          (setq newhead (org-get-heading)))
        (org-agenda-change-all-lines newhead hdmarker)
-       (beginning-of-line 1)))))
+       (org-move-to-column col)))))
 
 ;; FIXME: should fix the tags property of the agenda line.
 (defun org-agenda-set-tags (&optional tag onoff)
@@ -9155,7 +9175,9 @@ Called with a universal prefix arg, show the priority instead of setting it."
       (goto-char (point-max))
       (while (not (bobp))
        (when (equal marker (org-get-at-bol 'org-marker))
-         (org-move-to-column (- (window-width) (length stamp)) t nil t)
+         (remove-text-properties (point-at-bol) (point-at-eol) '(display))
+         (org-move-to-column (- (window-width) (length stamp)) t)
+
          (org-agenda-fix-tags-filter-overlays-at (point))
           (if (featurep 'xemacs)
              ;; Use `duplicable' property to trigger undo recording
@@ -9166,7 +9188,7 @@ Called with a universal prefix arg, show the priority instead of setting it."
                  ex (list 'invisible t 'end-glyph gl 'duplicable t))
                 (insert-extent ex (1- (point)) (point-at-eol)))
             (add-text-properties
-             (1- (point)) (point-at-eol)
+            (1- (point)) (point-at-eol)
             (list 'display (org-add-props stamp nil
                              'face 'secondary-selection))))
          (beginning-of-line 1))
@@ -9917,31 +9939,43 @@ current HH:MM time."
 
 ;;; Dragging agenda lines forward/backward
 
-(defun org-agenda-drag-line-forward (arg)
-  "Drag an agenda line forward by ARG lines."
+(defun org-agenda-reapply-filters ()
+  "Re-apply all agenda filters."
+  (mapcar
+   (lambda(f) (when (car f) (org-agenda-filter-apply (car f) (cadr f))))
+   `((,org-agenda-tag-filter tag)
+     (,org-agenda-category-filter category)
+     (,org-agenda-regexp-filter regexp)
+     (,(get 'org-agenda-tag-filter :preset-filter) tag)
+     (,(get 'org-agenda-category-filter :preset-filter) category)
+     (,(get 'org-agenda-regexp-filter :preset-filter) regexp))))
+
+(defun org-agenda-drag-line-forward (arg &optional backward)
+  "Drag an agenda line forward by ARG lines.
+When the optional argument `backward' is non-nil, move backward."
   (interactive "p")
-  (let ((inhibit-read-only t) lst)
+  (let ((inhibit-read-only t) lst line)
     (if (or (not (get-text-property (point) 'txt))
            (save-excursion
              (dotimes (n arg)
-               (move-beginning-of-line 2)
+               (move-beginning-of-line (if backward 0 2))
                (push (not (get-text-property (point) 'txt)) lst))
              (delq nil lst)))
        (message "Cannot move line forward")
-      (org-drag-line-forward arg))))
+      (let ((end (save-excursion (move-beginning-of-line 2) (point))))
+       (move-beginning-of-line 1)
+       (setq line (buffer-substring (point) end))
+       (delete-region (point) end)
+       (move-beginning-of-line (funcall (if backward '1- '1+) arg))
+       (insert line)
+       (org-agenda-reapply-filters)
+       (org-agenda-mark-clocking-task)
+       (move-beginning-of-line 0)))))
 
 (defun org-agenda-drag-line-backward (arg)
   "Drag an agenda line backward by ARG lines."
   (interactive "p")
-  (let ((inhibit-read-only t) lst)
-    (if (or (not (get-text-property (point) 'txt))
-           (save-excursion
-             (dotimes (n arg)
-               (move-beginning-of-line 0)
-               (push (not (get-text-property (point) 'txt)) lst))
-             (delq nil lst)))
-       (message "Cannot move line backward")
-      (org-drag-line-backward arg))))
+  (org-agenda-drag-line-forward arg t))
 
 ;;; Flagging notes
 
index b4e69774c16d41c51a0b17cf0d4877583105ec30..b6557108845e318e2eea1f3e85eea720aa6592f0 100644 (file)
@@ -279,7 +279,7 @@ not be exported."
 
 (defcustom org-bibtex-no-export-tags nil
   "List of tag(s) that should not be converted to keywords.
-This variable is relevant only if `org-bibtex-export-tags-as-keywords' is t."
+This variable is relevant only if `org-bibtex-tags-are-keywords' is t."
   :group 'org-bibtex
   :version "24.1"
   :type '(repeat :tag "Tag" (string)))
@@ -371,7 +371,9 @@ This variable is relevant only if `org-bibtex-export-tags-as-keywords' is t."
            (bibtex-beginning-of-entry)
            (if (re-search-forward "keywords.*=.*{\\(.*\\)}" nil t)
                (progn (goto-char (match-end 1)) (insert ", "))
-             (bibtex-make-field "keywords" t t))
+             (search-forward ",\n" nil t)
+             (insert "  keywords={},\n")
+             (search-backward "}," nil t))
            (insert (mapconcat #'identity tags ", ")))
          (buffer-string))))))
 
@@ -534,7 +536,7 @@ With optional argument OPTIONAL, also prompt for optional fields."
 ;;; Bibtex <-> Org-mode headline translation functions
 (defun org-bibtex (&optional filename)
   "Export each headline in the current file to a bibtex entry.
-Headlines are exported using `org-bibtex-export-headline'."
+Headlines are exported using `org-bibtex-headline'."
   (interactive
    (list (read-file-name
          "Bibtex file: " nil nil nil
@@ -613,7 +615,8 @@ This uses `bibtex-parse-entry'."
        (strip-delim
         (lambda (str)       ; strip enclosing "..." and {...}
           (dolist (pair '((34 . 34) (123 . 125) (123 . 125)))
-            (when (and (= (aref str 0) (car pair))
+            (when (and (> (length str) 1)
+                       (= (aref str 0) (car pair))
                        (= (aref str (1- (length str))) (cdr pair)))
               (setf str (substring str 1 (1- (length str)))))) str)))
     (push (mapcar
index 8eaa313b28a758f0e3a4b05d6634a0e9b36ae73c..0433306a909be13c68d078acf02906d0f260e6c2 100644 (file)
@@ -741,7 +741,8 @@ captured item after finalizing."
              (pos (org-capture-get :initial-target-position))
              (ipt (org-capture-get :insertion-point))
              (size (org-capture-get :captured-entry-size)))
-         (when reg
+         (if (not reg)
+             (widen)
            (cond ((< ipt (car reg))
                   ;; insertion point is before the narrowed region
                   (narrow-to-region (+ size (car reg)) (+ size (cdr reg))))
index fa50f9dda9583b10f518e84e14750db503314a60..f2a37484cc09c0af9223ba021e4326cf897a308c 100644 (file)
@@ -1838,9 +1838,9 @@ Use \\[org-clock-remove-overlays] to remove the subtree times."
        (when org-remove-highlights-with-change
          (org-add-hook 'before-change-functions 'org-clock-remove-overlays
                        nil 'local))))
-      (message (concat "Total file time: "
-                      (org-minutes-to-clocksum-string org-clock-file-total-minutes)
-                      " (%d hours and %d minutes)") h m)))
+    (message (concat "Total file time: "
+                    (org-minutes-to-clocksum-string org-clock-file-total-minutes)
+                    " (%d hours and %d minutes)") h m)))
 
 (defvar org-clock-overlays nil)
 (make-variable-buffer-local 'org-clock-overlays)
@@ -1850,16 +1850,17 @@ Use \\[org-clock-remove-overlays] to remove the subtree times."
 If LEVEL is given, prefix time with a corresponding number of stars.
 This creates a new overlay and stores it in `org-clock-overlays', so that it
 will be easy to remove."
-  (let* ((c 60) (h (floor (/ time 60))) (m (- time (* 60 h)))
-        (l (if level (org-get-valid-level level 0) 0))
-        (off 0)
+  (let* ((l (if level (org-get-valid-level level 0) 0))
         ov tx)
-    (org-move-to-column c)
-    (unless (eolp) (skip-chars-backward "^ \t"))
-    (skip-chars-backward " \t")
-    (setq ov (make-overlay (point-at-bol) (point-at-eol))
-         tx (concat (buffer-substring (point-at-bol) (point))
-                    (make-string (+ off (max 0 (- c (current-column)))) ?.)
+    (beginning-of-line)
+    (when (looking-at org-complex-heading-regexp)
+      (goto-char (match-beginning 4)))
+    (setq ov (make-overlay (point) (point-at-eol))
+         tx (concat (buffer-substring-no-properties (point) (match-end 4))
+                    (make-string
+                     (max 0 (- (- 60 (current-column))
+                               (- (match-end 4) (match-beginning 4))
+                               (length (org-get-at-bol 'line-prefix)))) ?.)
                     (org-add-props (concat (make-string l ?*) " "
                                            (org-minutes-to-clocksum-string time)
                                            (make-string (- 16 l) ?\ ))
@@ -2705,9 +2706,13 @@ TIME:      The sum of all time spend in this tree, in minutes.  This time
                           (format "file:%s::%s"
                                   (buffer-file-name)
                                   (save-match-data
-                                    (org-make-org-heading-search-string
-                                     (match-string 2))))
-                          (match-string 2)))
+                                    (match-string 2)))
+                          (org-make-org-heading-search-string
+                           (replace-regexp-in-string
+                            org-bracket-link-regexp
+                            (lambda (m) (or (match-string 3 m)
+                                            (match-string 1 m)))
+                            (match-string 2)))))
                    tsp (when timestamp
                          (setq props (org-entry-properties (point)))
                          (or (cdr (assoc "SCHEDULED" props))
index 9dd0340a23382e5c60056cb728f325b6b166c6b8..07ee69f14c5a928d2c8013893a822dbdd2f65605 100644 (file)
@@ -174,7 +174,7 @@ This is the compiled version of the format.")
         (face (list color font 'org-column ref-face))
         (face1 (list color font 'org-agenda-column-dateline ref-face))
         (cphr (get-text-property (point-at-bol) 'org-complex-heading-regexp))
-        pom property ass width f string ov column val modval s2 title calc)
+        pom property ass width f fc string fm ov column val modval s2 title calc)
     ;; Check if the entry is in another buffer.
     (unless props
       (if (eq major-mode 'org-agenda-mode)
@@ -204,6 +204,8 @@ This is the compiled version of the format.")
                      (nth 2 column)
                      (length property))
            f (format "%%-%d.%ds | " width width)
+           fm (nth 4 column)
+           fc (nth 5 column)
            calc (nth 7 column)
            val (or (cdr ass) "")
            modval (cond ((and org-columns-modify-value-for-display-function
@@ -215,13 +217,14 @@ This is the compiled version of the format.")
                          (org-columns-cleanup-item
                           val org-columns-current-fmt-compiled
                           (or org-complex-heading-regexp cphr)))
+                        (fc (org-columns-number-to-string
+                             (org-columns-string-to-number val fm) fm fc))
                         ((and calc (functionp calc)
                               (not (string= val ""))
                               (not (get-text-property 0 'org-computed val)))
                          (org-columns-number-to-string
                           (funcall calc (org-columns-string-to-number
-                                         val (nth 4 column)))
-                          (nth 4 column)))))
+                                         val fm)) fm))))
       (setq s2 (org-columns-add-ellipses (or modval val) width))
       (setq string (format f s2))
       ;; Create the overlay
index fee0bd08cad77b7d710b66093991640779ee3280..70c41d53cd953033379646860f9bdb9e4a4c7548 100644 (file)
@@ -260,6 +260,12 @@ ignored in this case."
                  next (+ from (* n inc)))))
        (nreverse seq)))))
 
+;; `set-transient-map' is only in Emacs >= 24.4
+(defalias 'org-set-transient-map
+  (if (fboundp 'set-transient-map)
+      'set-transient-map
+    'set-temporary-overlay-map))
+
 ;; Region compatibility
 
 (defvar org-ignore-region nil
@@ -337,10 +343,25 @@ Works on both Emacs and XEmacs."
       (org-xemacs-without-invisibility (indent-line-to column))
     (indent-line-to column)))
 
-(defun org-move-to-column (column &optional force buffer ignore-invisible)
-  (let ((buffer-invisibility-spec ignore-invisible))
+(defun org-move-to-column (column &optional force buffer)
+  "Move to column COLUMN.
+Pass COLUMN and FORCE to `move-to-column'.
+Pass BUFFER to the XEmacs version of `move-to-column'."
+  (let* ((with-bracket-link
+         (save-excursion
+           (forward-line 0)
+           (looking-at (concat "^.*" org-bracket-link-regexp))))
+        (buffer-invisibility-spec
+         (cond
+          ((or (not (derived-mode-p 'org-mode))
+               (and with-bracket-link (org-invisible-p2)))
+           (remove '(org-link) buffer-invisibility-spec))
+          (with-bracket-link
+           (remove t buffer-invisibility-spec))
+          (t buffer-invisibility-spec))))
     (if (featurep 'xemacs)
-       (org-xemacs-without-invisibility (move-to-column column force buffer))
+       (org-xemacs-without-invisibility
+        (move-to-column column force buffer))
       (move-to-column column force))))
 
 (defun org-get-x-clipboard-compat (value)
index 77b2bc26ef990b737b8e98a1bdc3f6e295033437..b44466e53df59c23a5b700c9575594e93b90d139 100644 (file)
@@ -62,7 +62,7 @@
 ;; `table-cell', `target', `timestamp', `underline' and `verbatim'.
 ;;
 ;; Some elements also have special properties whose value can hold
-;; objects themselves (i.e. an item tag or a headline name).  Such
+;; objects themselves (e.g. an item tag or a headline name).  Such
 ;; values are called "secondary strings".  Any object belongs to
 ;; either an element or a secondary string.
 ;;
@@ -187,10 +187,10 @@ is not sufficient to know if point is at a paragraph ending.  See
   "List of recursive element types aka Greater Elements.")
 
 (defconst org-element-all-successors
-  '(export-snippet footnote-reference inline-babel-call inline-src-block
-                  latex-or-entity line-break link macro plain-link radio-target
-                  statistics-cookie sub/superscript table-cell target
-                  text-markup timestamp)
+  '(link export-snippet footnote-reference inline-babel-call
+        inline-src-block latex-or-entity line-break macro plain-link
+        radio-target statistics-cookie sub/superscript table-cell target
+        text-markup timestamp)
   "Complete list of successors.")
 
 (defconst org-element-object-successor-alist
@@ -236,7 +236,7 @@ application to open them.")
   '("CAPTION" "DATA" "HEADER" "HEADERS" "LABEL" "NAME" "PLOT" "RESNAME" "RESULT"
     "RESULTS" "SOURCE" "SRCNAME" "TBLNAME")
   "List of affiliated keywords as strings.
-By default, all keywords setting attributes (i.e. \"ATTR_LATEX\")
+By default, all keywords setting attributes (e.g., \"ATTR_LATEX\")
 are affiliated keywords and need not to be in this list.")
 
 (defconst org-element-keyword-translation-alist
@@ -256,7 +256,7 @@ returned as the value of the property.
 This list is checked after translations have been applied.  See
 `org-element-keyword-translation-alist'.
 
-By default, all keywords setting attributes (i.e. \"ATTR_LATEX\")
+By default, all keywords setting attributes (e.g., \"ATTR_LATEX\")
 allow multiple occurrences and need not to be in this list.")
 
 (defconst org-element-parsed-keywords '("CAPTION")
@@ -328,13 +328,13 @@ Don't modify it, set `org-element-affiliated-keywords' instead.")
       (paragraph ,@standard-set)
       ;; Remove any variable object from radio target as it would
       ;; prevent it from being properly recognized.
-      (radio-target latex-or-entity sub/superscript)
+      (radio-target latex-or-entity sub/superscript text-markup)
       (strike-through ,@standard-set)
       (subscript ,@standard-set)
       (superscript ,@standard-set)
       ;; Ignore inline babel call and inline src block as formulas are
       ;; possible.  Also ignore line breaks and statistics cookies.
-      (table-cell export-snippet footnote-reference latex-or-entity link macro
+      (table-cell link export-snippet footnote-reference latex-or-entity macro
                  radio-target sub/superscript target text-markup timestamp)
       (table-row table-cell)
       (underline ,@standard-set)
@@ -346,7 +346,8 @@ a list of successors that will be called within an element or
 object of such type.
 
 For example, in a `radio-target' object, one can only find
-entities, latex-fragments, subscript and superscript.
+entities, latex-fragments, subscript, superscript and text
+markup.
 
 This alist also applies to secondary string.  For example, an
 `headline' type element doesn't directly contain objects, but
@@ -739,7 +740,9 @@ containing `:raw-value', `:title', `:alt-title', `:begin',
 
 The plist also contains any property set in the property drawer,
 with its name in upper cases and colons added at the
-beginning (i.e. `:CUSTOM_ID').
+beginning (e.g., `:CUSTOM_ID').
+
+LIMIT is a buffer position bounding the search.
 
 When RAW-SECONDARY-P is non-nil, headline's title will not be
 parsed as a secondary string, but as a plain string instead.
@@ -797,7 +800,7 @@ Assume point is at beginning of the headline."
                            (t (setq plist (plist-put plist :closed time))))))
                  plist))))
           (begin (point))
-          (end (save-excursion (goto-char (org-end-of-subtree t t))))
+          (end (min (save-excursion (org-end-of-subtree t t)) limit))
           (pos-after-head (progn (forward-line) (point)))
           (contents-begin (save-excursion
                             (skip-chars-forward " \r\t\n" end)
@@ -838,10 +841,7 @@ Assume point is at beginning of the headline."
                          :todo-keyword todo
                          :todo-type todo-type
                          :post-blank (count-lines
-                                      (if (not contents-end) pos-after-head
-                                        (goto-char contents-end)
-                                        (forward-line)
-                                        (point))
+                                      (or contents-end pos-after-head)
                                       end)
                          :footnote-section-p footnote-section-p
                          :archivedp archivedp
@@ -922,7 +922,7 @@ containing `:title', `:begin', `:end', `:hiddenp',
 
 The plist also contains any property set in the property drawer,
 with its name in upper cases and colons added at the
-beginning (i.e. `:CUSTOM_ID').
+beginning (e.g., `:CUSTOM_ID').
 
 When optional argument RAW-SECONDARY-P is non-nil, inline-task's
 title will not be parsed as a secondary string, but as a plain
@@ -972,8 +972,9 @@ Assume point is at beginning of the inline task."
                  plist))))
           (task-end (save-excursion
                       (end-of-line)
-                      (and (re-search-forward "^\\*+ END" limit t)
-                           (match-beginning 0))))
+                      (and (re-search-forward org-outline-regexp-bol limit t)
+                           (org-looking-at-p "END[ \t]*$")
+                           (line-beginning-position))))
           (contents-begin (progn (forward-line)
                                  (and task-end (< (point) task-end) (point))))
           (hidden (and contents-begin (org-invisible-p2)))
@@ -1224,7 +1225,7 @@ CONTENTS is the contents of the element."
            (forward-line)
            (let ((origin (point)))
              (when (re-search-forward inlinetask-re limit t)
-               (if (looking-at "^\\*+ END[ \t]*$") (forward-line)
+               (if (org-looking-at-p "END[ \t]*$") (forward-line)
                  (goto-char origin)))))
           ;; At some text line.  Check if it ends any previous item.
           (t
@@ -2149,8 +2150,8 @@ Assume point is at the beginning of the paragraph."
                ;; A matching `org-element-paragraph-separate' is not
                ;; necessarily the end of the paragraph.  In
                ;; particular, lines starting with # or : as a first
-               ;; non-space character are ambiguous.  We have check
-               ;; if they are valid Org syntax (i.e. not an
+               ;; non-space character are ambiguous.  We have to
+               ;; check if they are valid Org syntax (e.g., not an
                ;; incomplete keyword).
                (beginning-of-line)
                (while (not
@@ -2588,8 +2589,8 @@ CONTENTS is verse block contents."
 ;;
 ;; Unlike to elements, interstices can be found between objects.
 ;; That's why, along with the parser, successor functions are provided
-;; for each object.  Some objects share the same successor (i.e. `code'
-;; and `verbatim' objects).
+;; for each object.  Some objects share the same successor (e.g.,
+;; `code' and `verbatim' objects).
 ;;
 ;; A successor must accept a single argument bounding the search.  It
 ;; will return either a cons cell whose CAR is the object's type, as
@@ -2599,7 +2600,7 @@ CONTENTS is verse block contents."
 ;; org-element-NAME-successor, where NAME is the name of the
 ;; successor, as defined in `org-element-all-successors'.
 ;;
-;; Some object types (i.e. `italic') are recursive.  Restrictions on
+;; Some object types (e.g., `italic') are recursive.  Restrictions on
 ;; object types they can contain will be specified in
 ;; `org-element-object-restrictions'.
 ;;
@@ -3094,7 +3095,9 @@ Assume point is at the beginning of the link."
        ((and org-target-link-regexp (looking-at org-target-link-regexp))
        (setq type "radio"
              link-end (match-end 0)
-             path (org-match-string-no-properties 0)))
+             path (org-match-string-no-properties 0)
+             contents-begin (match-beginning 0)
+             contents-end (match-end 0)))
        ;; Type 2: Standard link, i.e. [[http://orgmode.org][homepage]]
        ((looking-at org-bracket-link-regexp)
        (setq contents-begin (match-beginning 3)
@@ -3127,13 +3130,13 @@ Assume point is at the beginning of the link."
         ;; headline name or nothing.  PATH is the target or
         ;; headline's name.
         (t (setq type "fuzzy" path raw-link))))
-       ;; Type 3: Plain link, i.e. http://orgmode.org
+       ;; Type 3: Plain link, e.g., http://orgmode.org
        ((looking-at org-plain-link-re)
        (setq raw-link (org-match-string-no-properties 0)
              type (org-match-string-no-properties 1)
              link-end (match-end 0)
              path (org-match-string-no-properties 2)))
-       ;; Type 4: Angular link, i.e. <http://orgmode.org>
+       ;; Type 4: Angular link, e.g., <http://orgmode.org>
        ((looking-at org-angle-link-re)
        (setq raw-link (buffer-substring-no-properties
                        (match-beginning 1) (match-end 2))
@@ -3144,18 +3147,20 @@ Assume point is at the beginning of the link."
       ;; LINK-END variable.
       (setq post-blank (progn (goto-char link-end) (skip-chars-forward " \t"))
            end (point))
-      ;; Extract search option and opening application out of
-      ;; "file"-type links.
+      ;; Special "file" type link processing.
       (when (member type org-element-link-type-is-file)
-       ;; Application.
+       ;; Extract opening application and search option.
        (cond ((string-match "^file\\+\\(.*\\)$" type)
               (setq application (match-string 1 type)))
              ((not (string-match "^file" type))
               (setq application type)))
-       ;; Extract search option from PATH.
-       (when (string-match "::\\(.*\\)$" path)
+       (when (string-match "::\\(.*\\)\\'" path)
          (setq search-option (match-string 1 path)
                path (replace-match "" nil nil path)))
+       ;; Normalize URI.
+       (when (and (not (org-string-match-p "\\`//" path))
+                  (file-name-absolute-p path))
+         (setq path (concat "//" (expand-file-name path))))
        ;; Make sure TYPE always reports "file".
        (setq type "file"))
       (list 'link
@@ -3463,7 +3468,7 @@ CONTENTS is the contents of the object."
 Return a list whose CAR is `table-cell' and CDR is a plist
 containing `:begin', `:end', `:contents-begin', `:contents-end'
 and `:post-blank' keywords."
-  (looking-at "[ \t]*\\(.*?\\)[ \t]*|")
+  (looking-at "[ \t]*\\(.*?\\)[ \t]*\\(?:|\\|$\\)")
   (let* ((begin (match-beginning 0))
         (end (match-end 0))
         (contents-begin (match-beginning 1))
@@ -3485,7 +3490,7 @@ CONTENTS is the contents of the cell, or nil."
 
 Return value is a cons cell whose CAR is `table-cell' and CDR is
 beginning position."
-  (when (looking-at "[ \t]*.*?[ \t]*|") (cons 'table-cell (point))))
+  (when (looking-at "[ \t]*.*?[ \t]*\\(|\\|$\\)") (cons 'table-cell (point))))
 
 
 ;;;; Target
@@ -3809,8 +3814,8 @@ CONTENTS is nil."
 ;; point.
 ;;
 ;; `org-element--current-element' makes use of special modes.  They
-;; are activated for fixed element chaining (i.e. `plain-list' >
-;; `item') or fixed conditional element chaining (i.e. `headline' >
+;; are activated for fixed element chaining (e.g., `plain-list' >
+;; `item') or fixed conditional element chaining (e.g., `headline' >
 ;; `section').  Special modes are: `first-section', `item',
 ;; `node-property', `quote-section', `section' and `table-row'.
 
@@ -3954,7 +3959,7 @@ CDR a plist of keywords and values and move point to the
 beginning of the first line after them.
 
 As a special case, if element doesn't start at the beginning of
-the line (i.e. a paragraph starting an item), CAR is current
+the line (e.g., a paragraph starting an item), CAR is current
 position of point and CDR is nil."
   (if (not (bolp)) (list (point))
     (let ((case-fold-search t)
@@ -4489,8 +4494,8 @@ Return Org syntax as a string."
            (mapconcat
             (lambda (obj) (org-element-interpret-data obj parent))
             (org-element-contents data) ""))
-          ;; Plain text: remove `:parent' text property from output.
-          ((stringp data) (org-no-properties data))
+          ;; Plain text: return it.
+          ((stringp data) data)
           ;; Element/Object without contents.
           ((not (org-element-contents data))
            (funcall (intern (format "org-element-%s-interpreter" type))
@@ -4609,71 +4614,65 @@ indentation to compute maximal common indentation.
 Return the normalized element that is element with global
 indentation removed from its contents.  The function assumes that
 indentation is not done with TAB characters."
-  (let* (ind-list                      ; for byte-compiler
-        collect-inds                   ; for byte-compiler
-        (collect-inds
+  (let* ((min-ind most-positive-fixnum)
+        find-min-ind                   ; For byte-compiler.
+        (find-min-ind
          (function
-          ;; Return list of indentations within BLOB.  This is done by
-          ;; walking recursively BLOB and updating IND-LIST along the
-          ;; way.  FIRST-FLAG is non-nil when the first string hasn't
-          ;; been seen yet.  It is required as this string is the only
-          ;; one whose indentation doesn't happen after a newline
-          ;; character.
+          ;; Return minimal common indentation within BLOB.  This is
+          ;; done by walking recursively BLOB and updating MIN-IND
+          ;; along the way.  FIRST-FLAG is non-nil when the first
+          ;; string hasn't been seen yet.  It is required as this
+          ;; string is the only one whose indentation doesn't happen
+          ;; after a newline character.
           (lambda (blob first-flag)
-            (mapc
-             (lambda (object)
-               (when (and first-flag (stringp object))
-                 (setq first-flag nil)
-                 (string-match "\\`\\( *\\)" object)
-                 (let ((len (length (match-string 1 object))))
-                   ;; An indentation of zero means no string will be
-                   ;; modified.  Quit the process.
-                   (if (zerop len) (throw 'zero (setq ind-list nil))
-                     (push len ind-list))))
-               (cond
-                ((stringp object)
-                 (let ((start 0))
-                   ;; Avoid matching blank or empty lines.
-                   (while (and (string-match "\n\\( *\\)\\(.\\)" object start)
-                               (not (equal (match-string 2 object) " ")))
-                     (setq start (match-end 0))
-                     (push (length (match-string 1 object)) ind-list))))
-                ((memq (org-element-type object) org-element-recursive-objects)
-                 (funcall collect-inds object first-flag))))
-             (org-element-contents blob))))))
-    ;; Collect indentation list in ELEMENT.  Possibly remove first
-    ;; value if IGNORE-FIRST is non-nil.
-    (catch 'zero (funcall collect-inds element (not ignore-first)))
-    (if (not ind-list) element
+            (dolist (object (org-element-contents blob))
+              (when (and first-flag (stringp object))
+                (setq first-flag nil)
+                (string-match "\\`\\( *\\)" object)
+                (let ((len (length (match-string 1 object))))
+                  ;; An indentation of zero means no string will be
+                  ;; modified.  Quit the process.
+                  (if (zerop len) (throw 'zero (setq min-ind 0))
+                    (setq min-ind (min len min-ind)))))
+              (cond
+               ((stringp object)
+                (dolist (line (delq "" (cdr (org-split-string object " *\n"))))
+                  (setq min-ind (min (org-get-indentation line) min-ind))))
+               ((memq (org-element-type object) org-element-recursive-objects)
+                (funcall find-min-ind object first-flag))))))))
+    ;; Find minimal indentation in ELEMENT.
+    (catch 'zero (funcall find-min-ind element (not ignore-first)))
+    (if (or (zerop min-ind) (= min-ind most-positive-fixnum)) element
       ;; Build ELEMENT back, replacing each string with the same
       ;; string minus common indentation.
       (let* (build                     ; For byte compiler.
             (build
              (function
-              (lambda (blob mci first-flag)
+              (lambda (blob first-flag)
                 ;; Return BLOB with all its strings indentation
-                ;; shortened from MCI white spaces.  FIRST-FLAG is
-                ;; non-nil when the first string hasn't been seen
+                ;; shortened from MIN-IND white spaces.  FIRST-FLAG
+                ;; is non-nil when the first string hasn't been seen
                 ;; yet.
                 (setcdr (cdr blob)
                         (mapcar
-                         (lambda (object)
-                           (when (and first-flag (stringp object))
-                             (setq first-flag nil)
-                             (setq object
-                                   (replace-regexp-in-string
-                                    (format "\\` \\{%d\\}" mci) "" object)))
-                           (cond
-                            ((stringp object)
-                             (replace-regexp-in-string
-                              (format "\n \\{%d\\}" mci) "\n" object))
-                            ((memq (org-element-type object)
-                                   org-element-recursive-objects)
-                             (funcall build object mci first-flag))
-                            (t object)))
+                         #'(lambda (object)
+                             (when (and first-flag (stringp object))
+                               (setq first-flag nil)
+                               (setq object
+                                     (replace-regexp-in-string
+                                      (format "\\` \\{%d\\}" min-ind)
+                                      "" object)))
+                             (cond
+                              ((stringp object)
+                               (replace-regexp-in-string
+                                (format "\n \\{%d\\}" min-ind) "\n" object))
+                              ((memq (org-element-type object)
+                                     org-element-recursive-objects)
+                               (funcall build object first-flag))
+                              (t object)))
                          (org-element-contents blob)))
                 blob))))
-       (funcall build element (apply 'min ind-list) (not ignore-first))))))
+       (funcall build element (not ignore-first))))))
 
 
 \f
@@ -4873,8 +4872,8 @@ Providing it allows for quicker computation."
        ;; their title.
        ((memq type '(headline inlinetask))
         (goto-char (org-element-property :begin element))
-        (skip-chars-forward "* ")
-        (if (and (>= origin (point)) (< origin (line-end-position)))
+        (skip-chars-forward "*")
+        (if (and (> origin (point)) (< origin (line-end-position)))
             (narrow-to-region (point) (line-end-position))
           (throw 'objects-forbidden element)))
        ;; At a paragraph, a table-row or a verse block, objects are
@@ -4896,6 +4895,16 @@ Providing it allows for quicker computation."
           (if (and (>= origin (point)) (< origin (line-end-position)))
               (narrow-to-region (point) (line-end-position))
             (throw 'objects-forbidden element))))
+       ;; At a planning line, if point is at a timestamp, return it,
+       ;; otherwise, return element.
+       ((eq type 'planning)
+        (dolist (p '(:closed :deadline :scheduled))
+          (let ((timestamp (org-element-property p element)))
+            (when (and timestamp
+                       (<= (org-element-property :begin timestamp) origin)
+                       (> (org-element-property :end timestamp) origin))
+              (throw 'objects-forbidden timestamp))))
+        (throw 'objects-forbidden element))
        (t (throw 'objects-forbidden element)))
        (goto-char (point-min))
        (let ((restriction (org-element-restriction type))
index 3670f3651378feaa68884c6d703e13ff9c681fcd..ba1eed12bdbeed93e88ba72fb7607ab8b1e822f8 100644 (file)
@@ -598,7 +598,9 @@ Kind can be any of `latex', `html', `ascii', `latin1', or `utf8'."
          (princ (format "   %-8s \\%-16s %-22s %-13s\n"
                         utf8 name latex html))))))
   (with-current-buffer "*Org Entity Help*"
-    (org-mode))
+    (org-mode)
+    (when org-pretty-entities
+      (org-toggle-pretty-entities)))
   (select-window (get-buffer-window "*Org Entity Help*")))
 
 
index f5a4ae90378c3547cee45935c17464d23be7b2f8..f59d1c4791194531a993f067bd4d36bcb61bcece 100644 (file)
@@ -460,6 +460,7 @@ agenda view showing the flagged items."
                              ((stringp x) x)
                              ((eq (car x) :startgroup) "{")
                              ((eq (car x) :endgroup) "}")
+                             ((eq (car x) :grouptags) nil)
                              ((eq (car x) :newline) nil)
                              ((listp x) (car x))))
                      def-tags))
index b8d7c672be996423238c22ac79ad83d411ce1d5b..f870b2c714d1217ba043bd777192b2ba4a81fd97 100644 (file)
@@ -348,7 +348,7 @@ the display of windows containing the Org buffer and the code buffer."
          (condition-case e
              (funcall lang-f)
            (error
-            (error "Language mode `%s' fails with: %S" lang-f (nth 1 e)))))
+            (message "Language mode `%s' fails with: %S" lang-f (nth 1 e)))))
        (dolist (pair transmitted-variables)
          (org-set-local (car pair) (cadr pair)))
        ;; Remove protecting commas from visible part of buffer.
@@ -577,14 +577,6 @@ the language, a switch telling if the content should be in a single line."
        (pos (point))
        re1 re2 single beg end lang lfmt match-re1 ind entry)
     (catch 'exit
-      (when (org-at-table.el-p)
-       (re-search-backward "^[\t]*[^ \t|\\+]" nil t)
-       (setq beg (1+ (point-at-eol)))
-       (goto-char beg)
-       (or (re-search-forward "^[\t]*[^ \t|\\+]" nil t)
-           (progn (goto-char (point-max)) (newline)))
-       (setq end (1- (point-at-bol)))
-       (throw 'exit (list beg end 'table.el nil nil 0)))
       (while (setq entry (pop re-list))
        (setq re1 (car entry) re2 (nth 1 entry) lang (nth 2 entry)
              single (nth 3 entry))
@@ -615,7 +607,15 @@ the language, a switch telling if the content should be in a single line."
                        (throw 'exit
                               (list (match-end 0) end
                                     (org-edit-src-get-lang lang)
-                                    single lfmt ind))))))))))))
+                                    single lfmt ind)))))))))
+      (when (org-at-table.el-p)
+       (re-search-backward "^[\t]*[^ \t|\\+]" nil t)
+       (setq beg (1+ (point-at-eol)))
+       (goto-char beg)
+       (or (re-search-forward "^[\t]*[^ \t|\\+]" nil t)
+           (progn (goto-char (point-max)) (newline)))
+       (setq end (1- (point-at-bol)))
+       (throw 'exit (list beg end 'table.el nil nil 0))))))
 
 (defun org-edit-src-get-lang (lang)
   "Extract the src language."
@@ -737,8 +737,8 @@ with \",*\", \",#+\", \",,*\" and \",,#+\"."
       (unless (or single preserve-indentation (= total-nindent 0))
        (setq indent (make-string total-nindent ?\ ))
        (goto-char (point-min))
-       (while (re-search-forward "^" nil t)
-         (replace-match indent)))
+       (while (re-search-forward "\\(^\\).+" nil t)
+         (replace-match indent nil nil nil 1)))
       (if (org-bound-and-true-p org-edit-src-picture)
          (setq total-nindent (+ total-nindent 2)))
       (setq code (buffer-string))
@@ -753,14 +753,14 @@ with \",*\", \",#+\", \",,*\" and \",,#+\"."
       (kill-buffer buffer))
     (goto-char beg)
     (when allow-write-back-p
-      (let ((buffer-undo-list t))
-       (delete-region beg (max beg end))
-       (unless (string-match "\\`[ \t]*\\'" code)
-         (insert code))
-       ;; Make sure the overlay stays in place
+      (undo-boundary)
+      (delete-region beg (max beg end))
+      (unless (string-match "\\`[ \t]*\\'" code)
+       (insert code))
+       ;; Make sure the overlay stays in place
        (when (eq context 'save) (move-overlay ovl beg (point)))
-       (goto-char beg)
-       (if single (just-one-space))))
+      (goto-char beg)
+      (if single (just-one-space)))
     (if (memq t (mapcar (lambda (overlay)
                          (eq (overlay-get overlay 'invisible)
                              'org-hide-block))
index 261d62f96259d019d74773d111e8ee84f163149e..c9522341106540ff29bb066469b0eabe8673e96d 100644 (file)
@@ -1241,6 +1241,7 @@ is always the old value."
 (defun org-table-field-info (arg)
   "Show info about the current field, and highlight any reference at point."
   (interactive "P")
+  (unless (org-at-table-p) (user-error "Not at a table"))
   (org-table-get-specials)
   (save-excursion
     (let* ((pos (point))
@@ -2274,35 +2275,35 @@ KEY is \"@\" or \"$\".  REPLACE is an alist of numbers to replace.
 For all numbers larger than LIMIT, shift them by DELTA."
   (save-excursion
     (goto-char (org-table-end))
-    (let ((case-fold-search t)
-         (s-end (save-excursion (re-search-forward "^\\S-*$\\|\\'" nil t))))
-      (while (re-search-forward "[ \t]*#\\+tblfm:" s-end t)
-       (let ((msg "The formulas in #+TBLFM have been updated")
-             (re (concat key "\\([0-9]+\\)"))
-             (re2
-              (when remove
-                (if (or (equal key "$") (equal key "$LR"))
-                    (format "\\(@[0-9]+\\)?%s%d=.*?\\(::\\|$\\)"
-                            (regexp-quote key) remove)
-                  (format "@%d\\$[0-9]+=.*?\\(::\\|$\\)" remove))))
-             s n a)
-         (when remove
-           (while (re-search-forward re2 (point-at-eol) t)
-             (unless (save-match-data (org-in-regexp "remote([^)]+?)"))
-               (if (equal (char-before (match-beginning 0)) ?.)
-                   (user-error "Change makes TBLFM term %s invalid, use undo to recover"
-                               (match-string 0))
-                 (replace-match "")))))
-         (while (re-search-forward re (point-at-eol) t)
+    (while (let ((case-fold-search t)) (looking-at "[ \t]*#\\+tblfm:"))
+      (let ((msg "The formulas in #+TBLFM have been updated")
+           (re (concat key "\\([0-9]+\\)"))
+           (re2
+            (when remove
+              (if (or (equal key "$") (equal key "$LR"))
+                  (format "\\(@[0-9]+\\)?%s%d=.*?\\(::\\|$\\)"
+                          (regexp-quote key) remove)
+                (format "@%d\\$[0-9]+=.*?\\(::\\|$\\)" remove))))
+           s n a)
+       (when remove
+         (while (re-search-forward re2 (point-at-eol) t)
            (unless (save-match-data (org-in-regexp "remote([^)]+?)"))
-             (setq s (match-string 1) n (string-to-number s))
-             (cond
-              ((setq a (assoc s replace))
-               (replace-match (concat key (cdr a)) t t)
-               (message msg))
-              ((and limit (> n limit))
-               (replace-match (concat key (int-to-string (+ n delta))) t t)
-               (message msg))))))))))
+             (if (equal (char-before (match-beginning 0)) ?.)
+                 (user-error
+                  "Change makes TBLFM term %s invalid, use undo to recover"
+                  (match-string 0))
+               (replace-match "")))))
+       (while (re-search-forward re (point-at-eol) t)
+         (unless (save-match-data (org-in-regexp "remote([^)]+?)"))
+           (setq s (match-string 1) n (string-to-number s))
+           (cond
+            ((setq a (assoc s replace))
+             (replace-match (concat key (cdr a)) t t)
+             (message msg))
+            ((and limit (> n limit))
+             (replace-match (concat key (int-to-string (+ n delta))) t t)
+             (message msg))))))
+      (forward-line))))
 
 (defun org-table-get-specials ()
   "Get the column names and local parameters for this table."
index 55540276ea2eb938dfb79c80f0caaa9e686d3781..1a86ffa7488d7ad90ff5ac1fef09c02a7f654340 100644 (file)
@@ -156,12 +156,14 @@ With prefix arg STOP, stop it entirely."
     (org-timer-set-mode-line 'pause)
     (message "Timer paused at %s" (org-timer-value-string)))))
 
+(defvar org-timer-current-timer nil)
 (defun org-timer-stop ()
   "Stop the relative timer."
   (interactive)
   (run-hooks 'org-timer-stop-hook)
   (setq org-timer-start-time nil
-       org-timer-pause-time nil)
+       org-timer-pause-time nil
+       org-timer-current-timer nil)
   (org-timer-set-mode-line 'off)
   (message "Timer stopped"))
 
@@ -344,7 +346,6 @@ VALUE can be `on', `off', or `pause'."
          (concat " <" (substring (org-timer-value-string) 0 -1) ">"))
     (force-mode-line-update)))
 
-(defvar org-timer-current-timer nil)
 (defun org-timer-cancel-timer ()
   "Cancel the current timer."
   (interactive)
index d6317274bd3b9704ce7902d267d7608e1bedbc43..4909d45530a973d0e7c8288b56114aafb6e11f2a 100644 (file)
@@ -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.2.5c"))
+   (let ((org-release "8.2.6"))
      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 "release_8.2.5c"))
+   (let ((org-git-version "release_8.2.6-1"))
      org-git-version))
 \f
 (provide 'org-version)
index edbcc09cd10264e84525e3c33cfdd734d9ddb395..2a451ed5456975959c714718d51bea96cb0086c5 100644 (file)
@@ -813,10 +813,11 @@ Also apply the translations defined in `org-xemacs-key-equivalents'."
 
 (defcustom org-ellipsis nil
   "The ellipsis to use in the Org-mode outline.
-When nil, just use the standard three dots.  When a string, use that instead,
+When nil, just use the standard three dots.
+When a string, use that string instead.
 When a face, use the standard 3 dots, but with the specified face.
 The change affects only Org-mode (which will then use its own display table).
-Changing this requires executing `M-x org-mode' in a buffer to become
+Changing this requires executing `M-x org-mode RET' in a buffer to become
 effective."
   :group 'org-startup
   :type '(choice (const :tag "Default" nil)
@@ -3707,12 +3708,12 @@ This is a property list with the following properties:
              the same numbers for HTML export.
 :matchers    a list indicating which matchers should be used to
              find LaTeX fragments.  Valid members of this list are:
-             \"begin\"  find environments
-             \"$1\"     find single characters surrounded by $.$
-             \"$\"      find math expressions surrounded by $...$
-             \"$$\"     find math expressions surrounded by $$....$$
-             \"\\(\"     find math expressions surrounded by \\(...\\)
-             \"\\ [\"    find math expressions surrounded by \\ [...\\]"
+             \"begin\" find environments
+             \"$1\"    find single characters surrounded by $.$
+             \"$\"     find math expressions surrounded by $...$
+             \"$$\"    find math expressions surrounded by $$....$$
+             \"\\(\"    find math expressions surrounded by \\(...\\)
+             \"\\=\\[\"    find math expressions surrounded by \\=\\[...\\]"
   :group 'org-latex
   :type 'plist)
 
@@ -3873,10 +3874,18 @@ Org mode to function properly:
 Therefore you should not modify this variable unless you know
 what you are doing.  The one reason to change it anyway is that
 you might be loading some other package that conflicts with one
-of the default packages.  Each cell is of the format
-\( \"options\" \"package\" snippet-flag).  If SNIPPET-FLAG is t,
-the package also needs to be included when compiling LaTeX
-snippets into images for inclusion into non-LaTeX output."
+of the default packages.  Each element is either a cell or
+a string.
+
+A cell is of the format:
+
+  \( \"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
+non-LaTeX output.
+
+A string will be inserted as-is in the header of the document."
   :group 'org-latex
   :group 'org-export-latex
   :set 'org-set-packages-alist
@@ -3894,18 +3903,22 @@ snippets into images for inclusion into non-LaTeX output."
   "Alist of packages to be inserted in every LaTeX header.
 
 These will be inserted after `org-latex-default-packages-alist'.
-Each cell is of the format:
+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 t, indicates that this package is also needed
-when turning LaTeX snippets into images for inclusion into
+SNIPPET-FLAG, when non-nil, indicates that this package is also
+needed when turning LaTeX snippets into images for inclusion into
 non-LaTeX output.
 
+A string will be inserted as-is in the header of the document.
+
 Make sure that you only list packages here which:
 
-  - you want in every file
-  - do not conflict with the setup in `org-format-latex-header'.
+  - you want in every file;
+  - do not conflict with the setup in `org-format-latex-header';
   - do not conflict with the default packages in
     `org-latex-default-packages-alist'."
   :group 'org-latex
@@ -4119,8 +4132,8 @@ You need to reload Org or to restart Emacs after customizing this.")
   `(("*" bold)
     ("/" italic)
     ("_" underline)
-    ("=" org-code verbatim)
-    ("~" org-verbatim verbatim)
+    ("=" org-verbatim verbatim)
+    ("~" org-code verbatim)
     ("+" ,(if (featurep 'xemacs) 'org-table '(:strike-through t))))
   "Alist of characters and faces to emphasize text.
 Text starting and ending with a special character will be emphasized,
@@ -4381,14 +4394,6 @@ If yes, offer to stop it and to save the buffer with the changes."
   (add-hook 'org-mode-hook 'org-clock-load)
   (add-hook 'kill-emacs-hook 'org-clock-save))
 
-;; Define the variable already here, to make sure we have it.
-(defvar org-indent-mode nil
-  "Non-nil if Org-Indent mode is enabled.
-Use the command `org-indent-mode' to change this variable.")
-
-;; Autoload archiving code
-;; The stuff that is needed for cycling and tags has to be defined here.
-
 (defgroup org-archive nil
   "Options concerning archiving in Org-mode."
   :tag "Org Archive"
@@ -5160,11 +5165,11 @@ Support for group tags is controlled by the option
 
 (defun org-file-contents (file &optional noerror)
   "Return the contents of FILE, as a string."
-  (if (or (not file)
-         (not (file-readable-p file)))
-      (if noerror
-         (message "Cannot read file \"%s\"" file)
-       (error "Cannot read file \"%s\"" file))
+  (if (or (not file) (not (file-readable-p file)))
+      (if (not noerror)
+         (error "Cannot read file \"%s\"" file)
+       (message "Cannot read file \"%s\"" file)
+       "")
     (with-temp-buffer
       (insert-file-contents file)
       (buffer-string))))
@@ -5348,6 +5353,8 @@ The following commands are available:
   ;; Modify a few syntax entries
   (modify-syntax-entry ?@ "w")
   (modify-syntax-entry ?\" "\"")
+  (modify-syntax-entry ?\\ "_")
+  (modify-syntax-entry ?~ "_")
   (if org-startup-truncated (setq truncate-lines t))
   (when org-startup-indented (require 'org-indent) (org-indent-mode 1))
   (org-set-local 'font-lock-unfontify-region-function
@@ -5371,7 +5378,12 @@ The following commands are available:
   (org-setup-comments-handling)
   ;; Beginning/end of defun
   (org-set-local 'beginning-of-defun-function 'org-backward-element)
-  (org-set-local 'end-of-defun-function 'org-forward-element)
+  (org-set-local 'end-of-defun-function
+                (lambda ()
+                  (if (not (org-at-heading-p))
+                      (org-forward-element)
+                    (org-forward-element)
+                    (forward-char -1))))
   ;; Next error for sparse trees
   (org-set-local 'next-error-function 'org-occur-next-match)
   ;; Make sure dependence stuff works reliably, even for users who set it
@@ -5438,13 +5450,15 @@ The following commands are available:
      (unless org-inhibit-startup-visibility-stuff
        (org-set-startup-visibility))))
   ;; Try to set org-hide correctly
-  (set-face-foreground 'org-hide (org-find-invisible-foreground)))
+  (let ((foreground (org-find-invisible-foreground)))
+    (if foreground
+        (set-face-foreground 'org-hide foreground))))
 
 ;; Update `customize-package-emacs-version-alist'
 (add-to-list 'customize-package-emacs-version-alist
             '(Org ("6.21b" . "23.1")  ("6.33x" . "23.2")
                   ("7.8.11" . "24.1") ("7.9.4" . "24.3")
-                  ("8.0" . "24.4")))
+                  ("8.2.6" . "24.4")))
 
 (defvar org-mode-transpose-word-syntax-table
   (let ((st (make-syntax-table)))
@@ -5584,59 +5598,55 @@ stacked delimiters is N.  Escaping delimiters is not possible."
 (defun org-make-link-regexps ()
   "Update the link regular expressions.
 This should be called after the variable `org-link-types' has changed."
-  (setq org-link-types-re
-       (concat
-        "\\`\\(" (mapconcat 'regexp-quote org-link-types "\\|") "\\):")
-       org-link-re-with-space
-       (concat
-        "<?\\(" (mapconcat 'regexp-quote org-link-types "\\|") "\\):"
-        "\\([^" org-non-link-chars " ]"
-        "[^" org-non-link-chars "]*"
-        "[^" org-non-link-chars " ]\\)>?")
-       org-link-re-with-space2
-       (concat
-        "<?\\(" (mapconcat 'regexp-quote org-link-types "\\|") "\\):"
-        "\\([^" org-non-link-chars " ]"
-        "[^\t\n\r]*"
-        "[^" org-non-link-chars " ]\\)>?")
-       org-link-re-with-space3
-       (concat
-        "<?\\(" (mapconcat 'regexp-quote org-link-types "\\|") "\\):"
-        "\\([^" org-non-link-chars " ]"
-        "[^\t\n\r]*\\)")
-       org-angle-link-re
-       (concat
-        "<\\(" (mapconcat 'regexp-quote org-link-types "\\|") "\\):"
-        "\\([^" org-non-link-chars " ]"
-        "[^" org-non-link-chars "]*"
-        "\\)>")
-       org-plain-link-re
-       (concat
-        "\\<\\(" (mapconcat 'regexp-quote org-link-types "\\|") "\\):"
-        (org-re "\\([^ \t\n()<>]+\\(?:([[:word:]0-9_]+)\\|\\([^[:punct:] \t\n]\\|/\\)\\)\\)"))
-       ;;       "\\([^]\t\n\r<>() ]+[^]\t\n\r<>,.;() ]\\)")
-       org-bracket-link-regexp
-       "\\[\\[\\([^][]+\\)\\]\\(\\[\\([^][]+\\)\\]\\)?\\]"
-       org-bracket-link-analytic-regexp
-       (concat
-        "\\[\\["
-        "\\(\\(" (mapconcat 'regexp-quote org-link-types "\\|") "\\):\\)?"
-        "\\([^]]+\\)"
-        "\\]"
-        "\\(\\[" "\\([^]]+\\)" "\\]\\)?"
-        "\\]")
-       org-bracket-link-analytic-regexp++
-       (concat
-        "\\[\\["
-        "\\(\\(" (mapconcat 'regexp-quote (cons "coderef" org-link-types) "\\|") "\\):\\)?"
-        "\\([^]]+\\)"
-        "\\]"
-        "\\(\\[" "\\([^]]+\\)" "\\]\\)?"
-        "\\]")
-       org-any-link-re
-       (concat "\\(" org-bracket-link-regexp "\\)\\|\\("
-               org-angle-link-re "\\)\\|\\("
-               org-plain-link-re "\\)")))
+  (let ((types-re (regexp-opt org-link-types t)))
+    (setq org-link-types-re
+         (concat "\\`" types-re ":")
+         org-link-re-with-space
+         (concat "<?" types-re ":"
+                 "\\([^" org-non-link-chars " ]"
+                 "[^" org-non-link-chars "]*"
+                 "[^" org-non-link-chars " ]\\)>?")
+         org-link-re-with-space2
+         (concat "<?" types-re ":"
+                 "\\([^" org-non-link-chars " ]"
+                 "[^\t\n\r]*"
+                 "[^" org-non-link-chars " ]\\)>?")
+         org-link-re-with-space3
+         (concat "<?" types-re ":"
+                 "\\([^" org-non-link-chars " ]"
+                 "[^\t\n\r]*\\)")
+         org-angle-link-re
+         (concat "<" types-re ":"
+                 "\\([^" org-non-link-chars " ]"
+                 "[^" org-non-link-chars "]*"
+                 "\\)>")
+         org-plain-link-re
+         (concat
+          "\\<" types-re ":"
+          (org-re "\\([^ \t\n()<>]+\\(?:([[:word:]0-9_]+)\\|\\([^[:punct:] \t\n]\\|/\\)\\)\\)"))
+         ;;     "\\([^]\t\n\r<>() ]+[^]\t\n\r<>,.;() ]\\)")
+         org-bracket-link-regexp
+         "\\[\\[\\([^][]+\\)\\]\\(\\[\\([^][]+\\)\\]\\)?\\]"
+         org-bracket-link-analytic-regexp
+         (concat
+          "\\[\\["
+          "\\(" types-re ":\\)?"
+          "\\([^]]+\\)"
+          "\\]"
+          "\\(\\[" "\\([^]]+\\)" "\\]\\)?"
+          "\\]")
+         org-bracket-link-analytic-regexp++
+         (concat
+          "\\[\\["
+          "\\(" (regexp-opt (cons "coderef" org-link-types) t) ":\\)?"
+          "\\([^]]+\\)"
+          "\\]"
+          "\\(\\[" "\\([^]]+\\)" "\\]\\)?"
+          "\\]")
+         org-any-link-re
+         (concat "\\(" org-bracket-link-regexp "\\)\\|\\("
+                 org-angle-link-re "\\)\\|\\("
+                 org-plain-link-re "\\)"))))
 
 (org-make-link-regexps)
 
@@ -5675,24 +5685,30 @@ The time stamps may be either active or inactive.")
   "Run through the buffer and add overlays to emphasized strings."
   (let (rtn a)
     (while (and (not rtn) (re-search-forward org-emph-re limit t))
-      (if (not (= (char-after (match-beginning 3))
-                 (char-after (match-beginning 4))))
-         (progn
-           (setq rtn t)
-           (setq a (assoc (match-string 3) org-emphasis-alist))
-           (font-lock-prepend-text-property (match-beginning 2) (match-end 2)
-                                            'face
-                                            (nth 1 a))
-           (and (nth 2 a)
-                (org-remove-flyspell-overlays-in
-                 (match-beginning 0) (match-end 0)))
-           (add-text-properties (match-beginning 2) (match-end 2)
-                                '(font-lock-multiline t org-emphasis t))
-           (when org-hide-emphasis-markers
-             (add-text-properties (match-end 4) (match-beginning 5)
-                                  '(invisible org-link))
-             (add-text-properties (match-beginning 3) (match-end 3)
-                                  '(invisible org-link)))))
+      (let* ((border (char-after (match-beginning 3)))
+            (bre (regexp-quote (char-to-string border))))
+       (if (and (not (= border (char-after (match-beginning 4))))
+                (not (save-match-data
+                       (string-match (concat bre ".*" bre)
+                                     (replace-regexp-in-string
+                                      "\n" " "
+                                      (substring (match-string 2) 1 -1))))))
+           (progn
+             (setq rtn t)
+             (setq a (assoc (match-string 3) org-emphasis-alist))
+             (font-lock-prepend-text-property (match-beginning 2) (match-end 2)
+                                              'face
+                                              (nth 1 a))
+             (and (nth 2 a)
+                  (org-remove-flyspell-overlays-in
+                   (match-beginning 0) (match-end 0)))
+             (add-text-properties (match-beginning 2) (match-end 2)
+                                  '(font-lock-multiline t org-emphasis t))
+             (when org-hide-emphasis-markers
+               (add-text-properties (match-end 4) (match-beginning 5)
+                                    '(invisible org-link))
+               (add-text-properties (match-beginning 3) (match-end 3)
+                                    '(invisible org-link))))))
       (goto-char (1+ (match-beginning 0))))
     rtn))
 
@@ -6094,7 +6110,7 @@ The regular expression finds the targets also if there is a line break
 between words."
   (and targets
        (concat
-       "\\<\\("
+       "\\_<\\("
        (mapconcat
         (lambda (x)
           (setq x (regexp-quote x))
@@ -6103,7 +6119,7 @@ between words."
           x)
         targets
         "\\|")
-       "\\)\\>")))
+       "\\)\\_>")))
 
 (defun org-activate-tags (limit)
   (if (re-search-forward (org-re "^\\*+.*[ \t]\\(:[[:alnum:]_@#%:]+:\\)[ \r\n]") limit t)
@@ -6587,6 +6603,9 @@ in special contexts.
        (show-all)
        (org-unlogged-message "Entire buffer visible, including drawers"))
 
+       ;; Try cdlatex TAB completion
+       ((org-try-cdlatex-tab))
+
        ;; Table: enter it or move to the next field.
        ((org-at-table-p 'any)
        (if (org-at-table.el-p)
@@ -6623,8 +6642,6 @@ in special contexts.
             (or (bolp) (not (eq org-cycle-emulate-tab 'exc-hl-bol))))
        (org-inlinetask-toggle-visibility))
 
-       ((org-try-cdlatex-tab))
-
        ;; At an item/headline: delegate to `org-cycle-internal-local'.
        ((and (or (and org-cycle-include-plain-lists (org-at-item-p))
                 (save-excursion (beginning-of-line 1)
@@ -6897,6 +6914,7 @@ results."
   "Show all headlines in the buffer, like a table of contents.
 With numerical argument N, show content up to level N."
   (interactive "P")
+  (org-overview)
   (save-excursion
     ;; Visit all headings and show their offspring
     (and (integerp arg) (org-overview))
@@ -7528,27 +7546,37 @@ When NEXT is non-nil, check the next line instead."
 
 (defun org-insert-heading (&optional arg invisible-ok)
   "Insert a new heading or item with same depth at point.
-If point is in a plain list and ARG is nil, create a new list item.
-With one universal prefix argument, insert a heading even in lists.
-With two universal prefix arguments, insert the heading at the end
-of the parent subtree.
 
-If point is at the beginning of a headline, insert a sibling before
-the current headline.  If point is not at the beginning, split the line
-and create a new headline with the text in the current line after point
-\(see `org-M-RET-may-split-line' on how to modify this behavior).
+If point is at the beginning of a heading or a list item, insert
+a heading or a list item before it.
+
+If point is at the beginning of a normal line, turn this line
+into a heading.
+
+If point is in the middle of a headline or a list item, split the
+headline or the item and create a new headline/item with the text
+in the current line after point \(see `org-M-RET-may-split-line'
+on how to modify this behavior).
 
-If point is at the beginning of a normal line, turn this line into
-a heading.
+With one universal prefix argument: If point is within a list,
+insert a heading instead of a list item.  Otherwise, set the
+value of `org-insert-heading-respect-content' to `t' for the
+duration of the command.
 
-When INVISIBLE-OK is set, stop at invisible headlines when going back.
-This is important for non-interactive uses of the command."
+With two universal prefix arguments, insert the heading at the
+end of the grandparent subtree.  For example, if point is within
+a 2nd-level heading, then it will insert a 2nd-level heading at
+the end of the 1st-level parent heading.
+
+When INVISIBLE-OK is set, stop at invisible headlines when going
+back.  This is important for non-interactive uses of the
+command."
   (interactive "P")
   (if (org-called-interactively-p 'any) (org-reveal))
   (let ((itemp (org-in-item-p))
        (may-split (org-get-alist-option org-M-RET-may-split-line 'headline))
        (respect-content (or org-insert-heading-respect-content
-                            (equal arg '(16))))
+                            (equal arg '(4))))
        (initial-content "")
        (adjust-empty-lines t))
 
@@ -7571,6 +7599,10 @@ This is important for non-interactive uses of the command."
       (org-insert-item))
 
      (t
+      ;; Maybe move at the end of the subtree
+      (when (equal arg '(16))
+       (org-up-heading-safe)
+       (org-end-of-subtree t))
       ;; Insert a heading
       (save-restriction
        (widen)
@@ -7618,10 +7650,11 @@ This is important for non-interactive uses of the command."
               pos hide-previous previous-pos)
 
          ;; If we insert after content, move there and clean up whitespace
-         (when respect-content
+         (when (and respect-content (not (org-on-heading-p)))
            (org-end-of-subtree nil t)
            (skip-chars-backward " \r\n")
-           (and (looking-at "[ \t]+") (replace-match ""))
+           (and (not (looking-back "^\*+"))
+                (looking-at "[ \t]+") (replace-match ""))
            (unless (eobp) (forward-char 1))
            (when (looking-at "^\\*")
              (unless (bobp) (backward-char 1))
@@ -7765,8 +7798,8 @@ This is a list with the following elements:
 (defun org-insert-todo-heading (arg &optional force-heading)
   "Insert a new heading with the same level and TODO state as current heading.
 If the heading has no TODO state, or if the state is DONE, use the first
-state (TODO by default).  Also one prefix arg, force first state.  With two
-prefix args, force inserting at the end of the parent subtree."
+state (TODO by default).  Also with one prefix arg, force first state.  With
+two prefix args, force inserting at the end of the parent subtree."
   (interactive "P")
   (when (or force-heading (not (org-insert-item 'checkbox)))
     (org-insert-heading (or (and (equal arg '(16)) '(16))
@@ -7777,7 +7810,7 @@ prefix args, force inserting at the end of the parent subtree."
       (looking-at org-todo-line-regexp))
     (let*
         ((new-mark-x
-         (if (or arg
+         (if (or (equal arg '(4))
                  (not (match-beginning 2))
                  (member (match-string 2) org-done-keywords))
              (car org-todo-keywords-1)
@@ -7887,14 +7920,10 @@ The level is the number of stars at the beginning of the headline."
   "Return the outline depth of the last headline before the current line.
 Returns 0 for the first headline in the buffer, and nil if before the
 first headline."
-  (let ((current-level (org-current-level))
-       (prev-level (when (> (line-number-at-pos) 1)
-                     (save-excursion
-                       (beginning-of-line 0)
-                       (org-current-level)))))
-    (cond ((null current-level) nil) ; Before first headline
-         ((null prev-level) 0)      ; At first headline
-         (prev-level))))
+  (and (org-current-level)
+       (or (and (/= (line-beginning-position) (point-min))
+               (save-excursion (beginning-of-line 0) (org-current-level)))
+          0)))
 
 (defun org-reduced-level (l)
   "Compute the effective level of a heading.
@@ -7946,7 +7975,7 @@ in the region."
          (t (replace-match up-head nil t)))
     ;; Fixup tag positioning
     (unless (= level 1)
-      (and org-auto-align-tags (org-set-tags nil t))
+      (and org-auto-align-tags (org-set-tags nil 'ignore-column))
       (if org-adapt-indentation (org-fixup-indentation (- diff))))
     (run-hooks 'org-after-promote-entry-hook)))
 
@@ -7962,7 +7991,7 @@ in the region."
         (diff (abs (- level (length down-head) -1))))
     (replace-match down-head nil t)
     ;; Fixup tag positioning
-    (and org-auto-align-tags (org-set-tags nil t))
+    (and org-auto-align-tags (org-set-tags nil 'ignore-column))
     (if org-adapt-indentation (org-fixup-indentation diff))
     (run-hooks 'org-after-demote-entry-hook)))
 
@@ -8625,7 +8654,8 @@ links."
       (setq start (point)
            end (progn (org-end-of-subtree t t)
                       (or (bolp) (insert "\n"))
-                      (org-back-over-empty-lines)
+                      (when (>= (org-back-over-empty-lines) 1)
+                        (forward-line 1))
                       (point))
            what "children")
       (goto-char start)
@@ -8648,7 +8678,7 @@ links."
       (show-all)))
 
     (setq beg (point))
-    (if (>= beg end) (user-error "Nothing to sort"))
+    (when (>= beg end) (goto-char start) (user-error "Nothing to sort"))
 
     (looking-at "\\(\\*+\\)")
     (setq stars (match-string 1)
@@ -9063,7 +9093,7 @@ if `orgstruct-heading-prefix-regexp' is not empty."
                                              (key-description key))))))
                              thereis (key-binding key))))
                  (if (keymapp binding)
-                     (set-transient-map binding)
+                     (org-set-transient-map binding)
                    (let ((func (or binding
                                    (unless disable
                                      'orgstruct-error))))
@@ -9277,7 +9307,7 @@ property to set."
           (save-excursion
             (org-back-to-heading t)
             (put-text-property
-             (point-at-bol) (org-end-of-subtree t t) tprop p))))))))
+             (point-at-bol) (or (outline-next-heading) (point-max)) tprop p))))))))
 
 
 ;;;; Link Stuff
@@ -9422,7 +9452,7 @@ active region."
                       (funcall (intern
                                 (completing-read
                                  "Which function for creating the link? "
-                                 sfunsn t (car sfunsn)))))
+                                 sfunsn nil t (car sfunsn)))))
                  (funcall (caar sfuns)))
              (setq link (plist-get org-store-link-plist :link)
                    desc (or (plist-get org-store-link-plist
@@ -9529,8 +9559,9 @@ active region."
           ;; Store a link using the ID at point
           (setq link (condition-case nil
                          (prog1 (org-id-store-link)
-                           (setq desc (plist-get org-store-link-plist
-                                                 :description)))
+                           (setq desc (or (plist-get org-store-link-plist
+                                                     :description)
+                                          "")))
                        (error
                         ;; Probably before first headline, link only to file
                         (concat "file:"
@@ -9593,7 +9624,7 @@ active region."
        (setq link (or link cpltxt)
             desc (or desc cpltxt))
        (cond ((equal desc "NONE") (setq desc nil))
-            ((string-match org-bracket-link-analytic-regexp desc)
+            ((and desc (string-match org-bracket-link-analytic-regexp desc))
              (let ((d0 (match-string 3 desc))
                    (p0 (match-string 5 desc)))
                (setq desc
@@ -9612,7 +9643,8 @@ active region."
         (when custom-id
           (setq link (concat "file:" (abbreviate-file-name
                                       (buffer-file-name)) "::#" custom-id))
-          (push (list link desc) org-stored-links)))))))
+          (push (list link desc) org-stored-links))
+        (car org-stored-links))))))
 
 (defun org-store-link-props (&rest plist)
   "Store link properties, extract names and addresses."
@@ -10269,7 +10301,7 @@ See the docstring of `org-open-file' for details."
 This is saved in case the need arises to restore it.")
 
 (defvar org-open-link-marker (make-marker)
-  "Marker pointing to the location where `org-open-at-point; was called.")
+  "Marker pointing to the location where `org-open-at-point' was called.")
 
 ;;;###autoload
 (defun org-open-at-point-global ()
@@ -10349,7 +10381,8 @@ application the system uses for this file type."
       (let (type path link line search (pos (point)))
        (catch 'match
          (save-excursion
-           (skip-chars-forward "^]\n\r")
+           (or (org-in-regexp org-plain-link-re)
+               (skip-chars-forward "^]\n\r"))
            (when (org-in-regexp org-bracket-link-regexp 1)
              (setq link (org-extract-attributes
                          (org-link-unescape (org-match-string-no-properties 1))))
@@ -10387,9 +10420,10 @@ application the system uses for this file type."
                        ;; Check a plain link is not within a bracket link
                        (and match
                             (save-excursion
-                              (progn
-                                (goto-char (car match))
-                                (not (org-in-regexp org-bracket-link-regexp))))))
+                              (save-match-data
+                                (progn
+                                  (goto-char (car match))
+                                  (not (org-in-regexp org-bracket-link-regexp)))))))
                      (let ((line_ending (save-excursion (end-of-line) (point))))
                        ;; We are in a line before a plain or bracket link
                        (or (re-search-forward org-plain-link-re line_ending t)
@@ -11512,7 +11546,9 @@ prefix argument (`C-u C-u C-u C-c C-w')."
   (interactive "P")
   (if (member goto '(0 (64)))
       (org-refile-cache-clear)
-    (let* ((actionmsg (or msg "Refile"))
+    (let* ((actionmsg (cond (msg msg)
+                           ((equal goto 3) "Refile (and keep)")
+                           (t "Refile")))
           (cbuf (current-buffer))
           (regionp (org-region-active-p))
           (region-start (and regionp (region-beginning)))
@@ -11547,13 +11583,13 @@ prefix argument (`C-u C-u C-u C-c C-w')."
               (setq it (or rfloc
                            (let (heading-text)
                              (save-excursion
-                               (unless goto
+                               (unless (and goto (listp goto))
                                  (org-back-to-heading t)
                                  (setq heading-text
                                        (nth 4 (org-heading-components))))
 
                                (org-refile-get-location
-                                (cond (goto "Goto")
+                                (cond ((and goto (listp goto)) "Goto")
                                       (regionp (concat actionmsg " region to"))
                                       (t (concat actionmsg " subtree \""
                                                  heading-text "\" to")))
@@ -11639,7 +11675,7 @@ prefix argument (`C-u C-u C-u C-c C-w')."
                  (delete-region (point) (+ (point) (- region-end region-start)))
                (delete-region
                 (and (org-back-to-heading t) (point))
-                (min (buffer-size) (org-end-of-subtree t t) (point)))))
+                (min (1+ (buffer-size)) (org-end-of-subtree t t) (point)))))
            (when (featurep 'org-inlinetask)
              (org-inlinetask-remove-END-maybe))
            (setq org-markers-to-move nil)
@@ -11651,6 +11687,17 @@ prefix argument (`C-u C-u C-u C-c C-w')."
   (bookmark-jump "org-refile-last-stored")
   (message "This is the location of the last refile"))
 
+(defun org-refile--get-location (refloc tbl)
+  "When user refile to REFLOC, find the associated target in TBL.
+Also check `org-refile-target-table'."
+  (car (delq
+       nil
+       (mapcar
+        (lambda (r) (or (assoc r tbl)
+                        (assoc r org-refile-target-table)))
+        (list (replace-regexp-in-string "/$" "" refloc)
+              (replace-regexp-in-string "\\([^/]\\)$" "\\1/" refloc))))))
+
 (defun org-refile-get-location (&optional prompt default-buffer new-nodes
                                          no-exclude)
   "Prompt the user for a refile location, using PROMPT.
@@ -11704,8 +11751,7 @@ this is used for the GOTO interface."
     (setq old-hist org-refile-history)
     (setq answ (funcall cfunc prompt tbl nil (not new-nodes)
                        nil 'org-refile-history (or cdef (car org-refile-history))))
-    (setq pa (or (assoc answ tbl) (assoc (concat answ "/") tbl)))
-    (if pa
+    (if (setq pa (org-refile--get-location answ tbl))
        (progn
          (org-refile-check-position pa)
          (when (or (not org-refile-history)
@@ -11722,8 +11768,7 @@ this is used for the GOTO interface."
          (progn
            (setq parent (match-string 1 answ)
                  child (match-string 2 answ))
-           (setq parent-target (or (assoc parent tbl)
-                                   (assoc (concat parent "/") tbl)))
+           (setq parent-target (org-refile--get-location parent tbl))
            (when (and parent-target
                       (or (eq new-nodes t)
                           (and (eq new-nodes 'confirm)
@@ -11905,8 +11950,9 @@ blocks in the buffer."
 This means to empty the block, parse for parameters and then call
 the correct writing function."
   (interactive)
-  (save-window-excursion
-    (let* ((pos (point))
+  (save-excursion
+    (let* ((win (selected-window))
+          (pos (point))
           (line (org-current-line))
           (params (org-prepare-dblock))
           (name (plist-get params :name))
@@ -11919,6 +11965,7 @@ the correct writing function."
       (when (and indent (> indent 0))
        (setq indent (make-string indent ?\ ))
        (save-excursion
+         (select-window win)
          (org-beginning-of-dblock)
          (forward-line 1)
          (while (not (looking-at org-dblock-end-re))
@@ -13444,49 +13491,44 @@ a      Show deadlines and scheduled items after a date.
 d      Show deadlines due within `org-deadline-warning-days'.
 D      Show deadlines and scheduled items between a date range."
   (interactive "P")
-  (let (ans kwd value ts-type)
-    (setq type (or type org-sparse-tree-default-date-type))
-    (setq org-ts-type type)
-    (message "Sparse tree: [/]regexp [t]odo [T]odo-kwd [m]atch [p]roperty\n             [d]eadlines [b]efore-date [a]fter-date [D]ates range\n             [c]ycle through date types: %s"
-            (cond ((eq type 'all) "all timestamps")
-                  ((eq type 'scheduled) "only scheduled")
-                  ((eq type 'deadline) "only deadline")
-                  ((eq type 'active) "only active timestamps")
-                  ((eq type 'inactive) "only inactive timestamps")
-                  ((eq type 'scheduled-or-deadline) "scheduled/deadline")
-                  ((eq type 'closed) "with a closed time-stamp")
-                  (t "scheduled/deadline")))
-    (setq ans (read-char-exclusive))
-    (cond
-     ((equal ans ?c)
-      (org-sparse-tree
-       arg (cadr (member type '(scheduled-or-deadline
-                               all scheduled deadline active inactive closed)))))
-     ((equal ans ?d)
-      (call-interactively 'org-check-deadlines))
-     ((equal ans ?b)
-      (call-interactively 'org-check-before-date))
-     ((equal ans ?a)
-      (call-interactively 'org-check-after-date))
-     ((equal ans ?D)
-      (call-interactively 'org-check-dates-range))
-     ((equal ans ?t)
-      (call-interactively 'org-show-todo-tree))
-     ((equal ans ?T)
-      (org-show-todo-tree '(4)))
-     ((member ans '(?T ?m))
-      (call-interactively 'org-match-sparse-tree))
-     ((member ans '(?p ?P))
-      (setq kwd (org-icompleting-read "Property: "
-                                     (mapcar 'list (org-buffer-property-keys))))
-      (setq value (org-icompleting-read "Value: "
-                                       (mapcar 'list (org-property-values kwd))))
-      (unless (string-match "\\`{.*}\\'" value)
-       (setq value (concat "\"" value "\"")))
-      (org-match-sparse-tree arg (concat kwd "=" value)))
-     ((member ans '(?r ?R ?/))
-      (call-interactively 'org-occur))
-     (t (user-error "No such sparse tree command \"%c\"" ans)))))
+  (setq type (or type org-sparse-tree-default-date-type))
+  (setq org-ts-type type)
+  (message "Sparse tree: [/]regexp [t]odo [T]odo-kwd [m]atch [p]roperty
+             [d]eadlines [b]efore-date [a]fter-date [D]ates range
+             [c]ycle through date types: %s"
+          (case type
+            (all "all timestamps")
+            (scheduled "only scheduled")
+            (deadline "only deadline")
+            (active "only active timestamps")
+            (inactive "only inactive timestamps")
+            (scheduled-or-deadline "scheduled/deadline")
+            (closed "with a closed time-stamp")
+            (otherwise "scheduled/deadline")))
+  (let ((answer (read-char-exclusive)))
+    (case answer
+      (?c
+       (org-sparse-tree
+       arg
+       (cadr (memq type '(scheduled-or-deadline all scheduled deadline active
+                                                inactive closed)))))
+      (?d (call-interactively #'org-check-deadlines))
+      (?b (call-interactively #'org-check-before-date))
+      (?a (call-interactively #'org-check-after-date))
+      (?D (call-interactively #'org-check-dates-range))
+      (?t (call-interactively #'org-show-todo-tree))
+      (?T (org-show-todo-tree '(4)))
+      (?m (call-interactively #'org-match-sparse-tree))
+      ((?p ?P)
+       (let* ((kwd (org-icompleting-read
+                   "Property: " (mapcar #'list (org-buffer-property-keys))))
+             (value (org-icompleting-read
+                     "Value: " (mapcar #'list (org-property-values kwd)))))
+        (unless (string-match "\\`{.*}\\'" value)
+          (setq value (concat "\"" value "\"")))
+        (org-match-sparse-tree arg (concat kwd "=" value))))
+      ((?r ?R ?/) (call-interactively #'org-occur))
+      (otherwise (user-error "No such sparse tree command \"%c\"" answer)))))
 
 (defvar org-occur-highlights nil
   "List of overlays used for occur matches.")
@@ -14384,6 +14426,7 @@ If ONOFF is `on' or `off', don't toggle but set to this state."
 
 (defun org-align-tags-here (to-col)
   ;; Assumes that this is a headline
+  "Align tags on the current headline to TO-COL."
   (let ((pos (point)) (col (current-column)) ncol tags-l p)
     (beginning-of-line 1)
     (if        (and (looking-at (org-re ".*?\\([ \t]+\\)\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$"))
@@ -14402,7 +14445,7 @@ If ONOFF is `on' or `off', don't toggle but set to this state."
          (insert (make-string (- ncol (current-column)) ?\ ))
          (setq ncol (current-column))
          (when indent-tabs-mode (tabify p (point-at-eol)))
-         (org-move-to-column (min ncol col) t nil t))
+         (org-move-to-column (min ncol col)))
       (goto-char pos))))
 
 (defun org-set-tags-command (&optional arg just-align)
@@ -14460,15 +14503,16 @@ If DATA is nil or the empty string, any tags will be removed."
 (defvar org-indent-indentation-per-level)
 (defun org-set-tags (&optional arg just-align)
   "Set the tags for the current headline.
-With prefix ARG, realign all tags in headings in the current buffer."
+With prefix ARG, realign all tags in headings in the current buffer.
+When JUST-ALIGN is non-nil, only align tags."
   (interactive "P")
   (if (and (org-region-active-p) org-loop-over-headlines-in-active-region)
       (let ((cl (if (eq org-loop-over-headlines-in-active-region 'start-level)
                    'region-start-level 'region))
            org-loop-over-headlines-in-active-region)
        (org-map-entries
-        ;; We don't use ARG and JUST-ALIGN here these args are not
-        ;; useful when looping over headlines
+        ;; We don't use ARG and JUST-ALIGN here because these args
+        ;; are not useful when looping over headlines.
         `(org-set-tags)
         org-loop-over-headlines-in-active-region
         cl (if (outline-invisible-p) (org-end-of-subtree nil t))))
@@ -14546,7 +14590,7 @@ With prefix ARG, realign all tags in headings in the current buffer."
            (goto-char (match-beginning 0))
            (setq c0 (current-column)
                  ;; compute offset for the case of org-indent-mode active
-                 di (if org-indent-mode
+                 di (if (org-bound-and-true-p org-indent-mode)
                         (* (1- org-indent-indentation-per-level) (1- level))
                       0)
                  p0 (if (equal (char-before) ?*) (1+ (point)) (point))
@@ -14557,7 +14601,7 @@ With prefix ARG, realign all tags in headings in the current buffer."
          (and (not (featurep 'xemacs)) c0 indent-tabs-mode (tabify p0 (point)))
          tags)
         (t (error "Tags alignment failed")))
-       (org-move-to-column col nil nil t)
+       (org-move-to-column col)
        (unless just-align
          (run-hooks 'org-after-tags-change-hook))))))
 
@@ -14960,7 +15004,7 @@ a *different* entry, you cannot use these techniques."
        ((eq match nil) (setq matcher t))
        (t (setq matcher (if match (cdr (org-make-tags-matcher match)) t))))
 
-      (save-window-excursion
+      (save-excursion
        (save-restriction
          (cond ((eq scope 'tree)
                 (org-back-to-heading t)
@@ -15306,7 +15350,13 @@ when a \"nil\" value can supersede a non-nil value higher up the hierarchy."
          (cdr (assoc property (org-entry-properties nil 'special property)))
        (org-with-wide-buffer
         (let ((range (org-get-property-block)))
-          (when (and range (not (eq (car range) (cdr range))))
+          (when (and range (not (eq (car range) (cdr range)))
+                     (save-excursion
+                       (goto-char (car range))
+                       (re-search-forward
+                        (concat (org-re-property property) "\\|"
+                                (org-re-property (concat property "+")))
+                        (cdr range) t)))
             (let* ((props
                     (list (or (assoc property org-file-properties)
                               (assoc property org-global-properties)
@@ -15438,7 +15488,7 @@ However, if LITERAL-NIL is set, return the string value \"nil\" instead."
        (widen)
        (catch 'ex
          (while t
-           (when (setq tmp (org-entry-get nil property nil 'literal-nil))
+           (when (setq tmp (org-entry-get nil property nil literal-nil))
              (or (ignore-errors (org-back-to-heading t))
                  (goto-char (point-min)))
              (move-marker org-entry-property-inherited-from (point))
@@ -15795,13 +15845,16 @@ When optional argument DELETE-EMPTY-DRAWER is a string, it defines
 an empty drawer to delete."
   (interactive
    (let* ((completion-ignore-case t)
-         (prop (org-icompleting-read "Property: "
-                                     (org-entry-properties nil 'standard))))
+         (cat (org-entry-get (point) "CATEGORY"))
+         (props0 (org-entry-properties nil 'standard))
+         (props (if cat props0
+                  (delete `("CATEGORY" . ,(org-get-category)) props0)))
+         (prop (if (< 1 (length props))
+                   (org-icompleting-read "Property: " props nil t)
+                 (caar props))))
      (list prop)))
-  (message "Property %s %s" property
-          (if (org-entry-delete nil property delete-empty-drawer)
-              "deleted"
-            "was not present in the entry")))
+  (if (org-entry-delete nil property delete-empty-drawer)
+      (message "Property %s deleted" property)))
 
 (defun org-delete-property-globally (property)
   "Remove PROPERTY globally, from all entries."
@@ -18056,7 +18109,7 @@ When a buffer is unmodified, it is just killed.  When modified, it is saved
        file re pos)
     (setq org-tag-alist-for-agenda nil
          org-tag-groups-alist-for-agenda nil)
-    (save-window-excursion
+    (save-excursion
       (save-restriction
        (while (setq file (pop files))
          (catch 'nextfile
@@ -19422,7 +19475,7 @@ The detailed reaction depends on the user option `org-catch-invisible-edits'."
              (if invisible-before-point
                  (goto-char (previous-single-char-property-change
                              (point) 'invisible)))
-             (org-cycle))
+             (show-subtree))
            (cond
             ((eq org-catch-invisible-edits 'show)
              ;; That's it, we do the edit after showing
@@ -20230,13 +20283,15 @@ This command does many different things, depending on context:
          ;; When at a link, act according to the parent instead.
          (link (setq context (org-element-property :parent context))
                (setq type (org-element-type context)))
-         ;; Unsupported object types: check parent element instead.
+         ;; Unsupported object types: refer to the first supported
+         ;; element or object containing it.
          ((bold code entity export-snippet inline-babel-call inline-src-block
                 italic latex-fragment line-break macro strike-through subscript
                 superscript underline verbatim)
           (while (and (setq context (org-element-property :parent context))
                       (not (memq (setq type (org-element-type context))
-                                 '(paragraph verse-block)))))))
+                                 '(radio-target paragraph verse-block
+                                                table-cell)))))))
        ;; For convenience: at the first line of a paragraph on the
        ;; same line as an item, apply function on that item instead.
        (when (eq type 'paragraph)
@@ -20372,11 +20427,13 @@ This command does many different things, depending on context:
                "C-c C-c can do nothing useful at this location")))))))))
 
 (defun org-mode-restart ()
-  "Restart Org-mode, to scan again for special lines.
-Also updates the keyword regular expressions."
   (interactive)
-  (org-mode)
-  (message "Org-mode restarted"))
+  (let ((indent-status (org-bound-and-true-p org-indent-mode)))
+    (funcall major-mode)
+    (hack-local-variables)
+    (when (and indent-status (not (org-bound-and-true-p org-indent-mode)))
+      (org-indent-mode -1)))
+  (message "%s restarted" major-mode))
 
 (defun org-kill-note-or-show-branches ()
   "If this is a Note buffer, abort storing the note.  Else call `show-branches'."
index dc238adc7817263994d93dffa6dacfa3310458cc..6208cdbe0653756676553eae878e86493f453006 100644 (file)
@@ -530,8 +530,9 @@ INFO is a plist used as a communication channel."
                   (+ (- (org-list-get-ind beg-item struct)
                         (org-list-get-ind
                          (org-list-get-top-point struct) struct))
-                     (length (org-ascii--checkbox parent-item info))
-                     (length
+                     (string-width (or (org-ascii--checkbox parent-item info)
+                                       ""))
+                     (string-width
                       (or (org-list-get-tag beg-item struct)
                           (org-list-get-bullet beg-item struct)))))))))))))
 
@@ -589,7 +590,8 @@ possible.  It doesn't apply to `inlinetask' elements."
      (when tags
        (format
        (format " %%%ds"
-               (max (- text-width  (1+ (length first-part))) (length tags)))
+               (max (- text-width  (1+ (string-width first-part)))
+                    (string-width tags)))
        tags))
      ;; Maybe underline text, if ELEMENT type is `headline' and an
      ;; underline character has been defined.
@@ -600,7 +602,9 @@ possible.  It doesn't apply to `inlinetask' elements."
                              org-ascii-underline)))))
         (and under-char
              (concat "\n"
-                     (make-string (length first-part) under-char))))))))
+                     (make-string (/ (string-width first-part)
+                                     (char-width under-char))
+                                  under-char))))))))
 
 (defun org-ascii--has-caption-p (element info)
   "Non-nil when ELEMENT has a caption affiliated keyword.
@@ -647,7 +651,7 @@ which the table of contents generation has been initiated."
   (let ((title (org-ascii--translate "Table of Contents" info)))
     (concat
      title "\n"
-     (make-string (length title)
+     (make-string (string-width title)
                  (if (eq (plist-get info :ascii-charset) 'utf-8) ?─ ?_))
      "\n\n"
      (let ((text-width
@@ -674,7 +678,7 @@ generation.  INFO is a plist used as a communication channel."
   (let ((title (org-ascii--translate "List of Listings" info)))
     (concat
      title "\n"
-     (make-string (length title)
+     (make-string (string-width title)
                  (if (eq (plist-get info :ascii-charset) 'utf-8) ?─ ?_))
      "\n\n"
      (let ((text-width
@@ -688,9 +692,10 @@ generation.  INFO is a plist used as a communication channel."
          ;; Store initial text so its length can be computed.  This is
          ;; used to properly align caption right to it in case of
          ;; filling (like contents of a description list item).
-         (let ((initial-text
-                (format (org-ascii--translate "Listing %d:" info)
-                        (incf count))))
+         (let* ((initial-text
+                 (format (org-ascii--translate "Listing %d:" info)
+                         (incf count)))
+                (initial-width (string-width initial-text)))
            (concat
             initial-text " "
             (org-trim
@@ -700,8 +705,8 @@ generation.  INFO is a plist used as a communication channel."
                (let ((caption (or (org-export-get-caption src-block t)
                                   (org-export-get-caption src-block))))
                  (org-export-data caption info))
-               (- text-width (length initial-text)) info)
-              (length initial-text))))))
+               (- text-width initial-width) info)
+              initial-width)))))
        (org-export-collect-listings info) "\n")))))
 
 (defun org-ascii--list-tables (keyword info)
@@ -712,7 +717,7 @@ generation.  INFO is a plist used as a communication channel."
   (let ((title (org-ascii--translate "List of Tables" info)))
     (concat
      title "\n"
-     (make-string (length title)
+     (make-string (string-width title)
                  (if (eq (plist-get info :ascii-charset) 'utf-8) ?─ ?_))
      "\n\n"
      (let ((text-width
@@ -726,9 +731,10 @@ generation.  INFO is a plist used as a communication channel."
          ;; Store initial text so its length can be computed.  This is
          ;; used to properly align caption right to it in case of
          ;; filling (like contents of a description list item).
-         (let ((initial-text
-                (format (org-ascii--translate "Table %d:" info)
-                        (incf count))))
+         (let* ((initial-text
+                 (format (org-ascii--translate "Table %d:" info)
+                         (incf count)))
+                (initial-width (string-width initial-text)))
            (concat
             initial-text " "
             (org-trim
@@ -738,13 +744,12 @@ generation.  INFO is a plist used as a communication channel."
                (let ((caption (or (org-export-get-caption table t)
                                   (org-export-get-caption table))))
                  (org-export-data caption info))
-               (- text-width (length initial-text)) info)
-              (length initial-text))))))
+               (- text-width initial-width) info)
+              initial-width)))))
        (org-export-collect-tables info) "\n")))))
 
 (defun org-ascii--unique-links (element info)
   "Return a list of unique link references in ELEMENT.
-
 ELEMENT is either a headline element or a section element.  INFO
 is a plist used as a communication channel."
   (let* (seen
@@ -754,8 +759,14 @@ is a plist used as a communication channel."
           ;; Update SEEN links along the way.
           (lambda (link)
             (let ((footprint
+                   ;; Normalize description in footprints.
                    (cons (org-element-property :raw-link link)
-                         (org-element-contents link))))
+                         (let ((contents (org-element-contents link)))
+                           (and contents
+                                (replace-regexp-in-string
+                                 "[ \r\t\n]+" " "
+                                 (org-trim
+                                  (org-element-interpret-data contents))))))))
               ;; Ignore LINK if it hasn't been translated already.
               ;; It can happen if it is located in an affiliated
               ;; keyword that was ignored.
@@ -852,14 +863,16 @@ INFO is a plist used as a communication channel."
         ((and (org-string-nw-p date) (org-string-nw-p author))
          (concat
           author
-          (make-string (- text-width (length date) (length author)) ? )
+          (make-string (- text-width (string-width date) (string-width author))
+                       ?\s)
           date
           (when (org-string-nw-p email) (concat "\n" email))
           "\n\n\n"))
         ((and (org-string-nw-p date) (org-string-nw-p email))
          (concat
           email
-          (make-string (- text-width (length date) (length email)) ? )
+          (make-string (- text-width (string-width date) (string-width email))
+                       ?\s)
           date "\n\n\n"))
         ((org-string-nw-p date)
          (concat
@@ -879,7 +892,10 @@ INFO is a plist used as a communication channel."
             (formatted-title (org-ascii--fill-string title title-len info))
             (line
              (make-string
-              (min (+ (max title-len (length author) (length email)) 2)
+              (min (+ (max title-len
+                           (string-width (or author ""))
+                           (string-width (or email "")))
+                      2)
                    text-width) (if utf8p ?━ ?_))))
        (org-ascii--justify-string
         (concat line "\n"
@@ -918,7 +934,7 @@ holding export options."
            (concat
             title "\n"
             (make-string
-             (length title)
+             (string-width title)
              (if (eq (plist-get info :ascii-charset) 'utf-8) ?─ ?_))))
          "\n\n"
          (let ((text-width (- org-ascii-text-width org-ascii-global-margin)))
@@ -1195,7 +1211,7 @@ contextual information."
 ;;;; Inlinetask
 
 (defun org-ascii-format-inlinetask-default
-    (todo type priority name tags contents width inlinetask info)
+  (todo type priority name tags contents width inlinetask info)
   "Format an inline task element for ASCII export.
 See `org-ascii-format-inlinetask-function' for a description
 of the parameters."
@@ -1208,7 +1224,7 @@ of the parameters."
       (unless utf8p (concat (make-string width ? ) "\n"))
       ;; Add title.  Fill it if wider than inlinetask.
       (let ((title (org-ascii--build-title inlinetask info width)))
-       (if (<= (length title) width) title
+       (if (<= (string-width title) width) title
          (org-ascii--fill-string title width info)))
       "\n"
       ;; If CONTENTS is not empty, insert it along with
@@ -1301,7 +1317,7 @@ contextual information."
      ;; Contents: Pay attention to indentation.  Note: check-boxes are
      ;; already taken care of at the paragraph level so they don't
      ;; interfere with indentation.
-     (let ((contents (org-ascii--indent-string contents (length bullet))))
+     (let ((contents (org-ascii--indent-string contents (string-width bullet))))
        (if (eq (org-element-type (car (org-element-contents item))) 'paragraph)
           (org-trim contents)
         (concat "\n" contents))))))
@@ -1376,10 +1392,7 @@ INFO is a plist holding contextual information."
                (org-export-resolve-coderef ref info))))
      ;; Do not apply a special syntax on radio links.  Though, use
      ;; transcoded target's contents as output.
-     ((string= type "radio")
-      (let ((destination (org-export-resolve-radio-link link info)))
-       (when destination
-         (org-export-data (org-element-contents destination) info))))
+     ((string= type "radio") desc)
      ;; Do not apply a special syntax on fuzzy links pointing to
      ;; targets.
      ((string= type "fuzzy")
@@ -1652,7 +1665,7 @@ are ignored."
               (org-element-map table 'table-row
                 (lambda (row)
                   (setq max-width
-                        (max (length
+                        (max (string-width
                               (org-export-data
                                (org-element-contents
                                 (elt (org-element-contents row) col))
@@ -1672,7 +1685,8 @@ a communication channel."
   ;; each cell in the column.
   (let ((width (org-ascii--table-cell-width table-cell info)))
     ;; When contents are too large, truncate them.
-    (unless (or org-ascii-table-widen-columns (<= (length contents) width))
+    (unless (or org-ascii-table-widen-columns
+               (<= (string-width (or contents "")) width))
       (setq contents (concat (substring contents 0 (- width 2)) "=>")))
     ;; Align contents correctly within the cell.
     (let* ((indent-tabs-mode nil)
@@ -1681,7 +1695,9 @@ a communication channel."
              (org-ascii--justify-string
               contents width
               (org-export-table-cell-alignment table-cell info)))))
-      (setq contents (concat data (make-string (- width (length data)) ? ))))
+      (setq contents
+           (concat data
+                   (make-string (- width (string-width (or data ""))) ?\s))))
     ;; Return cell.
     (concat (format " %s " contents)
            (when (memq 'right (org-export-table-cell-borders table-cell info))
index 7fd70739b9ff32c429a4066c1e8115f7cf2f82a2..f3a79d7c86073c8f35bbd76ef5ec8b8bba517054 100644 (file)
 (unless (assoc "beamer" org-latex-classes)
   (add-to-list 'org-latex-classes
               '("beamer"
-                "\\documentclass[presentation]{beamer}
-\[DEFAULT-PACKAGES]
-\[PACKAGES]
-\[EXTRA]"
+                "\\documentclass[presentation]{beamer}"
                 ("\\section{%s}" . "\\section*{%s}")
                 ("\\subsection{%s}" . "\\subsection*{%s}")
                 ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))))
@@ -647,11 +644,11 @@ contextual information."
                  (and (eq (org-element-type first-element) 'paragraph)
                       (org-beamer--element-has-overlay-p first-element))))
        (output (org-export-with-backend 'latex item contents info)))
-    (if (not action) output
+    (if (or (not action) (not (string-match "\\\\item" output))) output
       ;; If the item starts with a paragraph and that paragraph starts
       ;; with an export snippet specifying an overlay, insert it after
       ;; \item command.
-      (replace-regexp-in-string "\\\\item" (concat "\\\\item" action) output))))
+      (replace-match (concat "\\\\item" action) nil nil output))))
 
 
 ;;;; Keyword
@@ -693,8 +690,9 @@ used as a communication channel."
        (when destination
          (format "\\hyperlink%s{%s}{%s}"
                  (or (org-beamer--element-has-overlay-p link) "")
-                 (org-export-solidify-link-text path)
-                 (org-export-data (org-element-contents destination) info)))))
+                 (org-export-solidify-link-text
+                  (org-element-property :value destination))
+                 contents))))
      ((and (member type '("custom-id" "fuzzy" "id"))
           (let ((destination (if (string= type "fuzzy")
                                  (org-export-resolve-fuzzy-link link info)
@@ -1094,6 +1092,7 @@ aid, but the tag does not have any semantic meaning."
                          envs)
                  '((:endgroup))
                  '(("BMCOL" . ?|))))
+        (org-use-fast-tag-selection t)
         (org-fast-tag-selection-single-key t))
     (org-set-tags)
     (let ((tags (or (ignore-errors (org-get-tags-string)) "")))
@@ -1168,7 +1167,9 @@ Return output file name."
   ;; working directory and then moved to publishing directory.
   (org-publish-attachment
    plist
-   (org-latex-compile (org-publish-org-to 'beamer filename ".tex" plist))
+   (org-latex-compile
+    (org-publish-org-to
+     'beamer filename ".tex" plist (file-name-directory filename)))
    pub-dir))
 
 
index d5e4b7876b7a432789d01ba4cb3a9f7522782ab8..88e572084c8841d2993558b390122bc7938e6a51 100644 (file)
     "progress" "section" "video")
   "New elements in html5.
 
-<hgroup> is not included because it's currently impossible to
-wrap special blocks around multiple headlines. For other blocks
-that should contain headlines, use the HTML_CONTAINER property on
-the headline itself.")
+For blocks that should contain headlines, use the HTML_CONTAINER
+property on the headline itself.")
 
 (defconst org-html-special-string-regexps
   '(("\\\\-" . "&#x00ad;")             ; shy
@@ -188,7 +186,7 @@ the headline itself.")
 @licstart  The following is the entire license notice for the
 JavaScript code in this tag.
 
-Copyright (C) 2012-2014 Free Software Foundation, Inc.
+Copyright (C) 2012-2013 Free Software Foundation, Inc.
 
 The JavaScript code in this tag is free software: you can
 redistribute it and/or modify it under the terms of the GNU
@@ -387,7 +385,7 @@ means to use the maximum value consistent with other options."
  * @licstart  The following is the entire license notice for the
  *  JavaScript code in %SCRIPT_PATH.
  *
- * Copyright (C) 2012-2014 Free Software Foundation, Inc.
+ * Copyright (C) 2012-2013 Free Software Foundation, Inc.
  *
  *
  * The JavaScript code in this tag is free software: you can
@@ -416,7 +414,7 @@ means to use the maximum value consistent with other options."
 @licstart  The following is the entire license notice for the
 JavaScript code in this tag.
 
-Copyright (C) 2012-2014 Free Software Foundation, Inc.
+Copyright (C) 2012-2013 Free Software Foundation, Inc.
 
 The JavaScript code in this tag is free software: you can
 redistribute it and/or modify it under the terms of the GNU
@@ -457,6 +455,7 @@ export back-end currently used."
              (not org-html-use-infojs)
              (and (eq org-html-use-infojs 'when-configured)
                   (or (not (plist-get exp-plist :infojs-opt))
+                      (string= "" (plist-get exp-plist :infojs-opt))
                       (string-match "\\<view:nil\\>"
                                     (plist-get exp-plist :infojs-opt)))))
     (let* ((template org-html-infojs-template)
@@ -2661,19 +2660,20 @@ INFO is a plist holding contextual information.  See
         (path
          (cond
           ((member type '("http" "https" "ftp" "mailto"))
-           (concat type ":" raw-path))
+           (org-link-escape
+            (org-link-unescape
+             (concat type ":" raw-path)) org-link-escape-chars-browser))
           ((string= type "file")
            ;; Treat links to ".org" files as ".html", if needed.
            (setq raw-path
                  (funcall link-org-files-as-html-maybe raw-path info))
            ;; If file path is absolute, prepend it with protocol
-           ;; component - "file://".
-           (cond ((file-name-absolute-p raw-path)
-                  (setq raw-path
-                        (concat "file://" (expand-file-name
-                                           raw-path))))
-                 ((and home use-abs-url)
-                  (setq raw-path (concat (file-name-as-directory home) raw-path))))
+           ;; component - "file:".
+           (cond
+            ((file-name-absolute-p raw-path)
+             (setq raw-path (concat "file:" raw-path)))
+            ((and home use-abs-url)
+             (setq raw-path (concat (file-name-as-directory home) raw-path))))
            ;; Add search option, if any.  A search option can be
            ;; relative to a custom-id or a headline title.  Any other
            ;; option is ignored.
@@ -2721,9 +2721,9 @@ INFO is a plist holding contextual information.  See
       (let ((destination (org-export-resolve-radio-link link info)))
        (when destination
          (format "<a href=\"#%s\"%s>%s</a>"
-                 (org-export-solidify-link-text path)
-                 attributes
-                 (org-export-data (org-element-contents destination) info)))))
+                 (org-export-solidify-link-text
+                  (org-element-property :value destination))
+                 attributes desc))))
      ;; Links pointing to a headline: Find destination and build
      ;; appropriate referencing command.
      ((member type '("custom-id" "fuzzy" "id"))
index 9fc1031d39105a9b8071b604413523472bcc9d8b..53cc54f00f77befc4e0132571b718379cd54902a 100644 (file)
@@ -589,7 +589,7 @@ The function must accept six parameters:
 The function should return the string to be exported.
 
 For example, the variable could be set to the following function
-in order to mimic default behavior:
+in order to mimic default behaviour:
 
 \(defun org-latex-format-inlinetask \(todo type priority name tags contents\)
 \"Format an inline task element for LaTeX export.\"
@@ -998,7 +998,9 @@ See `org-latex-text-markup-alist' for details."
      ;; and use "\\verb" command.
      ((eq 'verb fmt)
       (let ((separator (org-latex--find-verb-separator text)))
-       (concat "\\verb" separator text separator)))
+       (concat "\\verb" separator
+               (replace-regexp-in-string "\n" " " text)
+               separator)))
      ;; Handle the `protectedtexttt' special case: Protect some
      ;; special chars and use "\texttt{%s}" format string.
      ((eq 'protectedtexttt fmt)
@@ -1342,7 +1344,16 @@ holding contextual information."
               ((= (length sec) 4)
                (if numberedp (concat (car sec) "\n%s" (nth 1 sec))
                  (concat (nth 2 sec) "\n%s" (nth 3 sec)))))))
-          (text (org-export-data (org-element-property :title headline) info))
+          ;; Create a temporary export back-end that hard-codes
+          ;; "\underline" within "\section" and alike.
+          (section-back-end
+           (org-export-create-backend
+            :parent 'latex
+            :transcoders
+            '((underline . (lambda (o c i) (format "\\underline{%s}" c))))))
+          (text
+           (org-export-data-with-backend
+            (org-element-property :title headline) section-back-end info))
           (todo
            (and (plist-get info :with-todo-keywords)
                 (let ((todo (org-element-property :todo-keyword headline)))
@@ -1374,7 +1385,13 @@ holding contextual information."
                  (when (org-export-first-sibling-p headline info)
                    (format "\\begin{%s}\n" (if numberedp 'enumerate 'itemize)))
                  ;; Itemize headline
-                 "\\item " full-text "\n" headline-label pre-blanks contents)))
+                 "\\item"
+                 (and full-text (org-string-match-p "\\`[ \t]*\\[" full-text)
+                      "\\relax")
+                 " " full-text "\n"
+                 headline-label
+                 pre-blanks
+                 contents)))
            ;; If headline is not the last sibling simply return
            ;; LOW-LEVEL-BODY.  Otherwise, also close the list, before
            ;; any blank line.
@@ -1389,8 +1406,9 @@ holding contextual information."
        (let ((opt-title
               (funcall org-latex-format-headline-function
                        todo todo-type priority
-                       (org-export-data
-                        (org-export-get-alt-title headline info) info)
+                       (org-export-data-with-backend
+                        (org-export-get-alt-title headline info)
+                        section-back-end info)
                        (and (eq (plist-get info :with-tags) t) tags))))
          (if (and numberedp opt-title
                   (not (equal opt-title full-text))
@@ -1458,7 +1476,7 @@ contextual information."
       (let* ((org-lang (org-element-property :language inline-src-block))
             (mint-lang (or (cadr (assq (intern org-lang)
                                        org-latex-minted-langs))
-                           org-lang))
+                           (downcase org-lang)))
             (options (org-latex--make-option-string
                       org-latex-minted-options)))
        (concat (format "\\mint%s{%s}"
@@ -1564,7 +1582,25 @@ contextual information."
                (and tag (format "[{%s}] "
                                 (concat checkbox
                                         (org-export-data tag info)))))))
-    (concat counter "\\item" (or tag (concat " " checkbox))
+    (concat counter
+           "\\item"
+           (cond
+            (tag)
+            (checkbox (concat " " checkbox))
+            ;; Without a tag or a check-box, if CONTENTS starts with
+            ;; an opening square bracket, add "\relax" to "\item",
+            ;; unless the brackets comes from an initial export
+            ;; snippet (i.e. it is inserted willingly by the user).
+            ((and contents
+                  (org-string-match-p "\\`[ \t]*\\[" contents)
+                  (not (let ((e (car (org-element-contents item))))
+                         (and (eq (org-element-type e) 'paragraph)
+                              (let ((o (car (org-element-contents e))))
+                                (and (eq (org-element-type o) 'export-snippet)
+                                     (eq (org-export-snippet-backend o)
+                                         'latex)))))))
+             "\\relax ")
+            (t " "))
            (and contents (org-trim contents))
            ;; If there are footnotes references in tag, be sure to
            ;; add their definition at the end of the item.  This
@@ -1754,7 +1790,8 @@ DESC is the description part of the link, or the empty string.
 INFO is a plist holding contextual information.  See
 `org-export-data'."
   (let* ((type (org-element-property :type link))
-        (raw-path (org-element-property :path link))
+        (raw-path (replace-regexp-in-string
+                   "%" "\\%" (org-element-property :path link) nil t))
         ;; Ensure DESC really exists, or set it to nil.
         (desc (and (not (string= desc "")) desc))
         (imagep (org-export-inline-image-p
@@ -1762,9 +1799,8 @@ INFO is a plist holding contextual information.  See
         (path (cond
                ((member type '("http" "https" "ftp" "mailto"))
                 (concat type ":" raw-path))
-               ((string= type "file")
-                (if (not (file-name-absolute-p raw-path)) raw-path
-                  (concat "file://" (expand-file-name raw-path))))
+               ((and (string= type "file") (file-name-absolute-p raw-path))
+                (concat "file:" raw-path))
                (t raw-path)))
         protocol)
     (cond
@@ -1776,8 +1812,9 @@ INFO is a plist holding contextual information.  See
       (let ((destination (org-export-resolve-radio-link link info)))
        (when destination
          (format "\\hyperref[%s]{%s}"
-                 (org-export-solidify-link-text path)
-                 (org-export-data (org-element-contents destination) info)))))
+                 (org-export-solidify-link-text
+                  (org-element-property :value destination))
+                 desc))))
      ;; Links pointing to a headline: Find destination and build
      ;; appropriate referencing command.
      ((member type '("custom-id" "fuzzy" "id"))
@@ -1853,18 +1890,13 @@ contextual information."
         (latex-type (let ((env (plist-get attr :environment)))
                       (cond (env (format "%s" env))
                             ((eq type 'ordered) "enumerate")
-                            ((eq type 'unordered) "itemize")
-                            ((eq type 'descriptive) "description")))))
+                            ((eq type 'descriptive) "description")
+                            (t "itemize")))))
     (org-latex--wrap-label
      plain-list
      (format "\\begin{%s}%s\n%s\\end{%s}"
             latex-type
-            ;; Put optional arguments, if any inside square brackets
-            ;; when necessary.
-            (let ((options (format "%s" (or (plist-get attr :options) ""))))
-              (cond ((equal options "") "")
-                    ((string-match "\\`\\[.*\\]\\'" options) options)
-                    (t (format "[%s]" options))))
+            (or (plist-get attr :options) "")
             contents
             latex-type))))
 
@@ -2083,7 +2115,8 @@ contextual information."
                       ("firstnumber" ,(number-to-string (1+ num-start))))
                     org-latex-minted-options)))
                 ;; Language.
-                (or (cadr (assq (intern lang) org-latex-minted-langs)) lang)
+                (or (cadr (assq (intern lang) org-latex-minted-langs))
+                    (downcase lang))
                 ;; Source code.
                 (let* ((code-info (org-export-unravel-code src-block))
                        (max-width
@@ -2132,8 +2165,8 @@ contextual information."
               ((and float (not (assoc "float" org-latex-listings-options)))
                `(("float" ,org-latex-default-figure-position))))
              `(("language" ,lst-lang))
-             (when label `(("label" ,label)))
-             (when caption-str `(("caption" ,caption-str)))
+             (if label `(("label" ,label)) '(("label" " ")))
+             (if caption-str `(("caption" ,caption-str)) '(("caption" " ")))
              (cond ((assoc "numbers" org-latex-listings-options) nil)
                    ((not num-start) '(("numbers" "none")))
                    ((zerop num-start) '(("numbers" "left")))
@@ -2903,7 +2936,9 @@ Return output file name."
   ;; in working directory and then moved to publishing directory.
   (org-publish-attachment
    plist
-   (org-latex-compile (org-publish-org-to 'latex filename ".tex" plist))
+   (org-latex-compile
+    (org-publish-org-to
+     'latex filename ".tex" plist (file-name-directory filename)))
    pub-dir))
 
 
index f5653f1a2c23792722060dbc6f1d38775b896554..d58c119fc5d515c3bd5a949956229176b297ffb3 100644 (file)
@@ -638,21 +638,15 @@ CONTENTS is nil.  INFO is a plist holding contextual information."
 DESC is the description part of the link, or the empty string.
 INFO is a plist holding contextual information.  See
 `org-export-data'."
-
   (let* ((type (org-element-property :type link))
          (raw-path (org-element-property :path link))
          ;; Ensure DESC really exists, or set it to nil.
          (desc (and (not (string= desc "")) desc))
-
          (path (cond
                 ((member type '("http" "https" "ftp" "mailto"))
                  (concat type ":" raw-path))
-                ((string= type "file")
-                 (when (string-match "\\(.+\\)::.+" raw-path)
-                   (setq raw-path (match-string 1 raw-path)))
-                 (if (file-name-absolute-p raw-path)
-                     (concat "file://" (expand-file-name raw-path))
-                   (concat "file://" raw-path)))
+                ((and (string= type "file") (file-name-absolute-p raw-path))
+                 (concat "file:" raw-path))
                 (t raw-path)))
          protocol)
     (cond
index 50982add568ed9e2b965be52372789fa4c7bc253..1f841c865fa8041977c8654fffbd680bedbda934 100644 (file)
@@ -77,6 +77,7 @@ This variable can be set to either `atx' or `setext'."
                     (headline . org-md-headline)
                     (horizontal-rule . org-md-horizontal-rule)
                     (inline-src-block . org-md-verbatim)
+                    (inner-template . org-md-inner-template)
                     (italic . org-md-italic)
                     (item . org-md-item)
                     (line-break . org-md-line-break)
@@ -96,19 +97,26 @@ This variable can be set to either `atx' or `setext'."
 ;;; Filters
 
 (defun org-md-separate-elements (tree backend info)
-  "Make sure elements are separated by at least one blank line.
+  "Fix blank lines between elements.
 
 TREE is the parse tree being exported.  BACKEND is the export
 back-end used.  INFO is a plist used as a communication channel.
 
+Make sure there's no blank line before a plain list, unless it is
+located right after a paragraph.  Otherwise, add a blank line
+between elements.  Blank lines between items are preserved.
+
 Assume BACKEND is `md'."
-  (org-element-map tree org-element-all-elements
+  (org-element-map tree (remq 'item org-element-all-elements)
     (lambda (elem)
-      (unless (eq (org-element-type elem) 'org-data)
-       (org-element-put-property
-        elem :post-blank
-        (let ((post-blank (org-element-property :post-blank elem)))
-          (if (not post-blank) 1 (max 1 post-blank)))))))
+      (org-element-put-property
+       elem :post-blank
+       (if (and (eq (org-element-type (org-export-get-next-element elem info))
+                   'plain-list)
+               (not (and (eq (org-element-type elem) 'paragraph)
+                         (org-export-get-previous-element elem info))))
+          0
+        1))))
   ;; Return updated tree.
   tree)
 
@@ -149,7 +157,7 @@ channel."
   (replace-regexp-in-string
    "^" "    "
    (org-remove-indentation
-    (org-element-property :value example-block))))
+    (org-export-format-code-default example-block info))))
 
 
 ;;;; Headline
@@ -244,7 +252,8 @@ a communication channel."
              (off "[ ] "))
            (let ((tag (org-element-property :tag item)))
              (and tag (format "**%s:** "(org-export-data tag info))))
-           (org-trim (replace-regexp-in-string "^" "    " contents)))))
+           (and contents
+                (org-trim (replace-regexp-in-string "^" "    " contents))))))
 
 
 ;;;; Line Break
@@ -262,24 +271,18 @@ channel."
   "Transcode LINE-BREAK object into Markdown format.
 CONTENTS is the link's description.  INFO is a plist used as
 a communication channel."
-  (let ((--link-org-files-as-html-maybe
+  (let ((link-org-files-as-md
         (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 org-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)
+           ;; 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 ((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-html-maybe
-                                     destination info)))
+                (let ((path (funcall link-org-files-as-md destination)))
                   (if (not contents) (format "<%s>" path)
                     (format "[%s](%s)" contents path)))
               (concat
@@ -293,19 +296,18 @@ a communication channel."
          ((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
-                          (expand-file-name raw-path)))))
-            (format "![%s](%s)"
-                    (let ((caption (org-export-get-caption
-                                    (org-export-get-parent-element link))))
-                      (when caption (org-export-data caption info)))
-                    path)))
+                          (expand-file-name raw-path))))
+                (caption (org-export-data
+                          (org-export-get-caption
+                           (org-export-get-parent-element link)) info)))
+            (format "![img](%s)"
+                    (if (not (org-string-nw-p caption)) path
+                      (format "%s \"%s\"" path caption)))))
          ((string= type "coderef")
           (let ((ref (org-element-property :path link)))
             (format (org-export-get-coderef-format ref contents)
                     (org-export-resolve-coderef ref info))))
-         ((equal type "radio")
-          (let ((destination (org-export-resolve-radio-link link info)))
-            (org-export-data (org-element-contents destination) info)))
+         ((equal type "radio") contents)
          ((equal type "fuzzy")
           (let ((destination (org-export-resolve-fuzzy-link link info)))
             (if (org-string-nw-p contents) contents
@@ -315,20 +317,17 @@ a communication channel."
                     (if (atom number) (number-to-string number)
                       (mapconcat 'number-to-string number "."))))))))
          (t (let* ((raw-path (org-element-property :path link))
-                   (path (cond
-                          ((member type '("http" "https" "ftp"))
-                           (concat type ":" raw-path))
-                          ((equal type "file")
-                           ;; Treat links to ".org" files as ".html",
-                           ;; if needed.
-                           (setq raw-path
-                                 (funcall --link-org-files-as-html-maybe
-                                          raw-path info))
-                           ;; If file path is absolute, prepend it
-                           ;; with protocol component - "file://".
-                           (if (not (file-name-absolute-p raw-path)) raw-path
-                             (concat "file://" (expand-file-name raw-path))))
-                          (t raw-path))))
+                   (path
+                    (cond
+                     ((member type '("http" "https" "ftp"))
+                      (concat type ":" raw-path))
+                     ((string= type "file")
+                      (let ((path (funcall link-org-files-as-md raw-path)))
+                        (if (not (file-name-absolute-p path)) path
+                          ;; If file path is absolute, prepend it
+                          ;; with "file:" component.
+                          (concat "file:" path))))
+                     (t raw-path))))
               (if (not contents) (format "<%s>" path)
                 (format "[%s](%s)" contents path)))))))
 
@@ -403,6 +402,14 @@ a communication channel."
 
 ;;;; Template
 
+(defun org-md-inner-template (contents info)
+  "Return body of document after converting it to Markdown syntax.
+CONTENTS is the transcoded contents string.  INFO is a plist
+holding export options."
+  ;; Make sure CONTENTS is separated from table of contents and
+  ;; footnotes with at least a blank line.
+  (org-trim (org-html-inner-template (concat "\n" contents "\n") info)))
+
 (defun org-md-template (contents info)
   "Return complete document string after Markdown conversion.
 CONTENTS is the transcoded contents string.  INFO is a plist used
index 1e966fe108c437ba31e9862efee0ae85e51b2ad0..772017cdd0c2073d79fe339cc249b1d05ed44d00 100644 (file)
@@ -1502,7 +1502,7 @@ original parsed data.  INFO is a plist holding export options."
              (email (and (plist-get info :with-email) email)))
         (concat
          ;; Title.
-         (when title
+         (when (org-string-nw-p title)
            (concat
             (format "\n<text:p text:style-name=\"%s\">%s</text:p>"
                     "OrgTitle" (format "\n<text:title>%s</text:title>" title))
@@ -2713,10 +2713,8 @@ INFO is a plist holding contextual information.  See
         (path (cond
                ((member type '("http" "https" "ftp" "mailto"))
                 (concat type ":" raw-path))
-               ((string= type "file")
-                (if (file-name-absolute-p raw-path)
-                    (concat "file://" (expand-file-name raw-path))
-                  (concat "file://" raw-path)))
+               ((and (string= type "file") (file-name-absolute-p raw-path))
+                (concat "file:" raw-path))
                (t raw-path)))
         ;; Convert & to &amp; for correct XML representation
         (path (replace-regexp-in-string "&" "&amp;" path))
@@ -2735,11 +2733,11 @@ INFO is a plist holding contextual information.  See
      ((string= type "radio")
       (let ((destination (org-export-resolve-radio-link link info)))
        (when destination
-         (let ((desc (org-export-data (org-element-contents destination) info))
-               (href (org-export-solidify-link-text path)))
-           (format
-            "<text:bookmark-ref text:reference-format=\"text\" text:ref-name=\"OrgXref.%s\">%s</text:bookmark-ref>"
-            href desc)))))
+         (format
+          "<text:bookmark-ref text:reference-format=\"text\" text:ref-name=\"OrgXref.%s\">%s</text:bookmark-ref>"
+          (org-export-solidify-link-text
+           (org-element-property :value destination))
+          desc))))
      ;; Links pointing to a headline: Find destination and build
      ;; appropriate referencing command.
      ((member type '("custom-id" "fuzzy" "id"))
index 55cb6466e9c098d3f6da043f2f9ae30f1bbaa569..b38fca9705913568f66c6bb358d85b2cf512058b 100644 (file)
@@ -808,7 +808,8 @@ Default for SITEMAP-FILENAME is 'sitemap.org'."
        (org-mode)
        (let ((title
              (let ((property (plist-get (org-export-get-environment) :title)))
-               (if property (org-element-interpret-data property)
+               (if property
+                   (org-no-properties (org-element-interpret-data property))
                  (file-name-nondirectory (file-name-sans-extension file))))))
         (unless visiting (kill-buffer buffer))
         (org-publish-cache-set-file-property file :title title)
index ef881afe2c0ea1b6d5f9e2173b6cc0d67ca5b400..a961d7acdbc05282f3745cdde724dc29c6b86ceb 100644 (file)
@@ -1222,10 +1222,8 @@ INFO is a plist holding contextual information.  See
         (path (cond
                ((member type '("http" "https" "ftp"))
                 (concat type ":" raw-path))
-               ((string= type "file")
-                (if (file-name-absolute-p raw-path)
-                    (concat "file://" (expand-file-name raw-path))
-                  (concat "file://" raw-path)))
+               ((and (string= type "file") (file-name-absolute-p raw-path))
+                (concat "file:" raw-path))
                (t raw-path)))
         (email (if (string= type "mailto")
                    (let ((text (replace-regexp-in-string
index 0102523b5c746b64b3526747c5369da93ef1af50..faa2e0541b436a3b61077fa8f5f117c3723e0e88 100644 (file)
@@ -795,7 +795,8 @@ HTML code while every other back-end will ignore it."
   :type 'coding-system)
 
 (defcustom org-export-copy-to-kill-ring 'if-interactive
-  "Should we push exported content to the kill ring?"
+  "Non-nil means pushing export output to the kill ring.
+This variable is ignored during asynchronous export."
   :group 'org-export-general
   :version "24.3"
   :type '(choice
@@ -1613,10 +1614,11 @@ for export.  Return options as a plist."
      ;; Make sure point is at a heading.
      (if (org-at-heading-p) (org-up-heading-safe) (org-back-to-heading t))
      ;; Take care of EXPORT_TITLE. If it isn't defined, use headline's
-     ;; title as its fallback value.
+     ;; title (with no todo keyword, priority cookie or tag) as its
+     ;; fallback value.
      (when (setq prop (or (org-entry-get (point) "EXPORT_TITLE")
-                         (progn (looking-at org-todo-line-regexp)
-                                (org-match-string-no-properties 3))))
+                         (progn (looking-at org-complex-heading-regexp)
+                                (org-match-string-no-properties 4))))
        (setq plist
             (plist-put
              plist :title
@@ -3124,8 +3126,8 @@ locally for the subtree through node properties."
     ;; Populate OPTIONS and KEYWORDS.
     (dolist (entry (cond ((eq backend 'default) org-export-options-alist)
                         ((org-export-backend-p backend)
-                         (org-export-get-all-options backend))
-                        (t (org-export-get-all-options
+                         (org-export-backend-options backend))
+                        (t (org-export-backend-options
                             (org-export-get-backend backend)))))
       (let ((keyword (nth 1 entry))
             (option (nth 2 entry)))