emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r117013: Merge from emacs-24; up to r117008


From: Paul Eggert
Subject: [Emacs-diffs] trunk r117013: Merge from emacs-24; up to r117008
Date: Tue, 22 Apr 2014 21:33:12 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 117013 [merge]
revision-id: address@hidden
parent: address@hidden
parent: address@hidden
committer: Paul Eggert <address@hidden>
branch nick: trunk
timestamp: Tue 2014-04-22 14:32:51 -0700
message:
  Merge from emacs-24; up to r117008
modified:
  doc/emacs/ChangeLog            changelog-20091113204419-o5vbwnq5f7feedwu-6227
  doc/emacs/buffers.texi         
buffers.texi-20091113204419-o5vbwnq5f7feedwu-6234
  doc/emacs/cmdargs.texi         
cmdargs.texi-20091113204419-o5vbwnq5f7feedwu-6238
  doc/emacs/indent.texi          
indent.texi-20091113204419-o5vbwnq5f7feedwu-6257
  doc/lispref/ChangeLog          changelog-20091113204419-o5vbwnq5f7feedwu-6155
  doc/lispref/internals.texi     
internals.texi-20091113204419-o5vbwnq5f7feedwu-6188
  doc/lispref/text.texi          text.texi-20091113204419-o5vbwnq5f7feedwu-6215
  doc/misc/ChangeLog             changelog-20091113204419-o5vbwnq5f7feedwu-6331
  doc/misc/org.texi              org.texi-20091113204419-o5vbwnq5f7feedwu-6313
  etc/NEWS                       news-20100311060928-aoit31wvzf25yr1z-1
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/ChangeLog.16              changelog.16-20130618111706-x8cck4o4rjixg8cl-1
  lisp/dframe.el                 dframe.el-20091113204419-o5vbwnq5f7feedwu-3871
  lisp/dired.el                  dired.el-20091113204419-o5vbwnq5f7feedwu-482
  lisp/emacs-lisp/cl-macs.el     clmacs.el-20091113204419-o5vbwnq5f7feedwu-612
  lisp/net/tramp-sh.el           trampsh.el-20100913133439-a1faifh29eqoi4nh-1
  lisp/org/ChangeLog             changelog-20091113204419-o5vbwnq5f7feedwu-8688
  lisp/org/ob-core.el            obcore.el-20131112130502-8825zrk0dp6b9sq5-2
  lisp/org/ob-exp.el             obexp.el-20100719092623-qqnigi7w9j01gc4a-11
  lisp/org/ob-gnuplot.el         obgnuplot.el-20100719092623-qqnigi7w9j01gc4a-12
  lisp/org/ob-python.el          obpython.el-20100719092623-qqnigi7w9j01gc4a-22
  lisp/org/ob-ref.el             obref.el-20100719092623-qqnigi7w9j01gc4a-23
  lisp/org/ob-table.el           obtable.el-20100719092623-qqnigi7w9j01gc4a-30
  lisp/org/org-agenda.el         
orgagenda.el-20091113204419-o5vbwnq5f7feedwu-8640
  lisp/org/org-bibtex.el         
orgbibtex.el-20091113204419-o5vbwnq5f7feedwu-8643
  lisp/org/org-capture.el        orgcapture.el-20100719092701-uobpucojuvzm5vjg-1
  lisp/org/org-clock.el          
orgclock.el-20091113204419-o5vbwnq5f7feedwu-8644
  lisp/org/org-colview.el        
orgcolview.el-20091113204419-o5vbwnq5f7feedwu-8645
  lisp/org/org-compat.el         
orgcompat.el-20091113204419-o5vbwnq5f7feedwu-8646
  lisp/org/org-element.el        orgelement.el-20120930151243-xvvehup84hlirok6-1
  lisp/org/org-entities.el       
orgentities.el-20100415100824-g3jcwq7vv9wu6hqf-1
  lisp/org/org-mobile.el         
orgmobile.el-20091113204419-o5vbwnq5f7feedwu-11380
  lisp/org/org-src.el            orgsrc.el-20091113204419-o5vbwnq5f7feedwu-10913
  lisp/org/org-table.el          
orgtable.el-20091113204419-o5vbwnq5f7feedwu-8657
  lisp/org/org-timer.el          
orgtimer.el-20091113204419-o5vbwnq5f7feedwu-8801
  lisp/org/org-version.el        orgversion.el-20120930151248-fsivhdtofzv2elux-1
  lisp/org/org.el                org.el-20091113204419-o5vbwnq5f7feedwu-8617
  lisp/org/ox-ascii.el           oxascii.el-20131112130502-8825zrk0dp6b9sq5-7
  lisp/org/ox-beamer.el          oxbeamer.el-20131112130502-8825zrk0dp6b9sq5-8
  lisp/org/ox-html.el            oxhtml.el-20131112130502-8825zrk0dp6b9sq5-9
  lisp/org/ox-latex.el           oxlatex.el-20131112130502-8825zrk0dp6b9sq5-11
  lisp/org/ox-man.el             oxman.el-20131112130502-8825zrk0dp6b9sq5-12
  lisp/org/ox-md.el              oxmd.el-20131112130502-8825zrk0dp6b9sq5-13
  lisp/org/ox-odt.el             oxodt.el-20131112130502-8825zrk0dp6b9sq5-14
  lisp/org/ox-publish.el         oxpublish.el-20131112130502-8825zrk0dp6b9sq5-16
  lisp/org/ox-texinfo.el         oxtexinfo.el-20131112130502-8825zrk0dp6b9sq5-17
  lisp/org/ox.el                 ox.el-20131112130502-8825zrk0dp6b9sq5-18
  lisp/progmodes/prog-mode.el    progmode.el-20091230193750-bspzfk1gt8nm2mal-14
  lisp/speedbar.el               
speedbar.el-20091113204419-o5vbwnq5f7feedwu-1271
  nt/ChangeLog                   changelog-20091113204419-o5vbwnq5f7feedwu-1545
  nt/inc/ms-w32.h                msw32.h-20091113204419-o5vbwnq5f7feedwu-807
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/conf_post.h                conf_post.h-20120730211826-q0qbxxwh2emw52hd-1
  src/image.c                    image.c-20091113204419-o5vbwnq5f7feedwu-2969
  src/keyboard.c                 keyboard.c-20091113204419-o5vbwnq5f7feedwu-449
  src/search.c                   search.c-20091113204419-o5vbwnq5f7feedwu-473
  src/xgselect.c                 xgselect.c-20091121171556-bypaf8oo9ygoo13w-2
  test/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-8588
  test/automated/cl-lib.el       cllib.el-20130711160611-o23w1tyz0y13jq8e-1
  test/automated/tramp-tests.el  tramptests.el-20131105142319-d9zp3oprkpxj5v1e-1
=== modified file 'doc/emacs/ChangeLog'
--- a/doc/emacs/ChangeLog       2014-04-17 01:35:20 +0000
+++ b/doc/emacs/ChangeLog       2014-04-22 21:32:51 +0000
@@ -1,3 +1,13 @@
+2014-04-22  Eli Zaretskii  <address@hidden>
+
+       * buffers.texi (Uniquify): Clarify the default uniquification.
+
+       * indent.texi (Tab Stops): Improve wording.
+
+       * cmdargs.texi (General Variables): Improve docs of
+       EMACSLOADPATH.  Index all the environment variables.
+       (Misc Variables): Index all the environment variables.
+
 2014-04-17  Paul Eggert  <address@hidden>
 
        * Makefile.in (infoclean): Be consistent about reporting failures.
@@ -38,7 +48,7 @@
 2014-03-15  Dmitry Gutov  <address@hidden>
 
        * programs.texi (Matching): Update WRT to the new
-       `blink-matchin-paren' behavior.
+       `blink-matching-paren' behavior.
 
 2014-03-13  Paul Eggert  <address@hidden>
 

=== modified file 'doc/emacs/buffers.texi'
--- a/doc/emacs/buffers.texi    2014-01-27 02:03:26 +0000
+++ b/doc/emacs/buffers.texi    2014-04-21 14:50:19 +0000
@@ -611,8 +611,12 @@
 the buffers distinct names.  The default method
 (@code{uniquify-buffer-name-style} set to
 @code{post-forward-angle-brackets}) for making buffer names unique
-adds @samp{<dir1>}, @samp{<dir2>}, etc. to the end of the buffer
-names.
+adds @samp{<dir1>}, @samp{<dir2>}, etc.@: to the end of the buffer
+names, where @file{dir1} and @file{dir2} are the minimal parts of the
+leading directories needed to make the buffer name unique.  For
+example, if you have files @file{/foo/bar/mumble/name} and
address@hidden/baz/quux/mumble/name} visited, their buffers will be named
address@hidden<bar/mumble>} and @samp{name<quux/mumble>} correspondingly.
 
 @vindex uniquify-buffer-name-style
   There are several styles to make buffer names unique.  To select

=== modified file 'doc/emacs/cmdargs.texi'
--- a/doc/emacs/cmdargs.texi    2014-03-12 21:00:36 +0000
+++ b/doc/emacs/cmdargs.texi    2014-04-21 14:50:19 +0000
@@ -439,7 +439,7 @@
 some other programs.  Emacs does not require any of these environment
 variables to be set, but it uses their values if they are set.
 
address@hidden @env
address@hidden @env
 @item CDPATH
 Used by the @code{cd} command to search for the directory you specify,
 when you specify a relative directory name.
@@ -464,7 +464,9 @@
 @code{load-path} variable (@pxref{Lisp Libraries}).  An empty element
 stands for the default value of @code{load-path}; e.g., using
 @samp{EMACSLOADPATH="/tmp:"} adds @file{/tmp} to the front of
-the default @code{load-path}.
+the default @code{load-path}.  To specify an empty element in the
+middle of the list, use 2 colons in a row, as in
address@hidden"/tmp::/foo"}.
 @item EMACSPATH
 A colon-separated list of directories to search for executable files.
 If set, Emacs uses this in addition to @env{PATH} (see below) when
@@ -598,14 +600,14 @@
 @item VERSION_CONTROL
 Used to initialize the @code{version-control} variable (@pxref{Backup
 Names}).
address@hidden table
address@hidden vtable
 
 @node Misc Variables
 @appendixsubsec Miscellaneous Variables
 
 These variables are used only on particular configurations:
 
address@hidden @env
address@hidden @env
 @item COMSPEC
 On MS-DOS and MS-Windows, the name of the command interpreter to use
 when invoking batch files and commands internal to the shell.  On MS-DOS
@@ -657,7 +659,7 @@
 versions of Emacs to share the same environment variable settings, and
 it allows you to move the Emacs installation directory, without
 changing any environment or registry settings.
address@hidden table
address@hidden vtable
 
 @node MS-Windows Registry
 @appendixsubsec The MS-Windows System Registry

=== modified file 'doc/emacs/indent.texi'
--- a/doc/emacs/indent.texi     2014-03-12 06:48:20 +0000
+++ b/doc/emacs/indent.texi     2014-04-21 14:50:19 +0000
@@ -153,11 +153,11 @@
 are used as stopping points by @key{TAB} when inserting whitespace in
 Text mode and related modes (@pxref{Indentation}), and by commands
 like @kbd{M-i} (@pxref{Indentation Commands}).  The variable
address@hidden controls these positions.  The default value
-is @code{nil}, which means a tab stop every 8 columns.  The value
-can also be a list of column numbers (in increasing order) at which to
-place tab stops.  Emacs extends the list forever by repeating the
-difference between the last and next-to-last elements.
address@hidden controls these positions.  The default value is
address@hidden, which means a tab stop every 8 columns.  The value can
+also be a list of zero-based column numbers (in increasing order) at
+which to place tab stops.  Emacs extends the list forever by repeating
+the difference between the last and next-to-last elements.
 
 @findex edit-tab-stops
 @kindex C-c C-c @r{(Edit Tab Stops)}

=== modified file 'doc/lispref/ChangeLog'
--- a/doc/lispref/ChangeLog     2014-04-17 07:54:23 +0000
+++ b/doc/lispref/ChangeLog     2014-04-22 21:32:51 +0000
@@ -1,3 +1,9 @@
+2014-04-22  Eli Zaretskii  <address@hidden>
+
+       * text.texi (Registers): Document register-read-with-preview.
+
+       * internals.texi (Building Emacs): Improve indexing.
+
 2014-04-17  Daniel Colascione  <address@hidden>
 
        * frames.texi (Terminal Parameters): Document new

=== modified file 'doc/lispref/internals.texi'
--- a/doc/lispref/internals.texi        2014-03-21 19:04:57 +0000
+++ b/doc/lispref/internals.texi        2014-04-22 21:32:51 +0000
@@ -111,6 +111,8 @@
 time.)
 @end itemize
 
address@hidden change @code{load-path} at configure time
address@hidden @option{--enable-locallisppath} option to @command{configure}
   It is not advisable to put anything in @file{site-load.el} or
 @file{site-init.el} that would alter any of the features that users
 expect in an ordinary unmodified Emacs.  If you feel you must override

=== modified file 'doc/lispref/text.texi'
--- a/doc/lispref/text.texi     2014-03-25 02:47:39 +0000
+++ b/doc/lispref/text.texi     2014-04-21 14:50:19 +0000
@@ -4117,6 +4117,18 @@
 changed in the future.
 @end deffn
 
address@hidden register-read-with-preview prompt
address@hidden register preview
+This function reads and returns a register name, prompting with
address@hidden and possibly showing a preview of the existing registers
+and their contents.  The preview is shown in a temporary window, after
+the delay specified by the user option @code{register-preview-delay},
+if its value and @code{register-alist} are both address@hidden  The
+preview is also shown if the user requests help (e.g., by typing the
+help character).  We recommend that all interactive commands which
+read register names use this function.
address@hidden defun
+
 @node Transposition
 @section Transposition of Text
 

=== modified file 'doc/misc/ChangeLog'
--- a/doc/misc/ChangeLog        2014-04-22 03:18:15 +0000
+++ b/doc/misc/ChangeLog        2014-04-22 21:32:51 +0000
@@ -1,3 +1,31 @@
+2014-04-22  Bastien Guerry  <address@hidden>
+
+       * 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  <address@hidden>
+
+       * org.texi (Column attributes): Add a sentence to point out
+       the dependency on the format specifier.
+
+2014-04-22  Nicolas Goaziou  <address@hidden>
+
+       * 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-04-22  Stefan Monnier  <address@hidden>
 
        * cl.texi (Structures): Remove cl-struct-set-slot-value.
@@ -1614,7 +1642,7 @@
        * ede.texi (Top): Rename from top, all uses changed.
        * eshell.texi: Add missing argument to @sp.
        * forms.texi (Top): Reorder menu to match structure.
-       * htmlfontify.texi (Customisation): Add missing @item in
+       * htmlfontify.texi (Customization): Add missing @item in
        @enumerate.
        * org.texi (Advanced features): Add missing argument for @item.
        (Property searches): Use @backslashchar{} in macro argument.

=== modified file 'doc/misc/org.texi'
--- a/doc/misc/org.texi 2014-03-12 07:20:43 +0000
+++ b/doc/misc/org.texi 2014-04-22 14:07:45 +0000
@@ -2,7 +2,7 @@
 @c %**start of header
 @setfilename ../../info/org
 @settitle The Org Manual
address@hidden VERSION 8.2.5c
address@hidden VERSION 8.2.6
 
 @c Version and Contact Info
 @set MAINTAINERSITE @uref{http://orgmode.org,maintainers web page}
@@ -275,7 +275,7 @@
 
 @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 @@
 * 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 @@
 
 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.
+
address@hidden @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 @@
 i.e., only the top level headlines are address@hidden
 @code{org-agenda-inhibit-startup} is address@hidden, 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 @@
 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
address@hidden or @code{%5.1f} is used.
+
 Here is an example for a complete columns definition, along with allowed
 values.
 
@@ -9729,8 +9736,8 @@
 @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 @@
 @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 @@
 * 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 @@
 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 @@
 @cindex plain lists, in @LaTeX{} export
 
 Plain lists accept two optional attributes: @code{:environment} and
address@hidden: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).
address@hidden: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 @@
 @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 @@
 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.
address@hidden #+COLUMNS: %25ITEM .....
address@hidden #+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 @@
 @item #+FILETAGS: :tag1:tag2:tag3:
 Set tags that can be inherited by any entry in the file, including the
 top-level entries.
address@hidden #+DRAWERS: NAME1 .....
address@hidden #+DRAWERS: NAME1 ...
 @vindex org-drawers
 Set the file-local set of additional drawers.  The corresponding global
 variable is @code{org-drawers}.
address@hidden #+LINK:  linkword replace
address@hidden #+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 @@
 example:
 @cindex #+ORGTBL
 @example
-#+ORGTBL: SEND table_name translation_function arguments....
+#+ORGTBL: SEND table_name translation_function arguments...
 @end example
 
 @noindent

=== modified file 'etc/NEWS'
--- a/etc/NEWS  2014-04-22 16:22:13 +0000
+++ b/etc/NEWS  2014-04-22 21:32:51 +0000
@@ -691,7 +691,9 @@
 
 +++
 ** New Dired minor mode `dired-hide-details-mode' toggles whether details,
-such as file ownership or permissions, are visible.
+such as file ownership or permissions, are visible in Dired buffers.
+See the new options `dired-hide-details-hide-symlink-targets' and
+`dired-hide-details-hide-information-lines' for customizing what to hide.
 
 ---
 ** You can enable ElDoc inside the `eval-expression' minibuffer with:
@@ -1304,6 +1306,15 @@
 ** The cars of the elements in `interpreter-mode-alist' are now
 treated as regexps rather than literal strings.
 
+---
+** Overlay priority does not have to be nil or a non-negative integer.
+Overlay priority can be other kinds of Lisp objects.  We didn't yet
+decide whether other types of values are stable enough, and therefore
+don't feel it's right to document them.  For now, don't assume in your
+code that the values of overlay priority can only be either nil or an
+integer, always test them with an appropriate predicate to be one or
+the other.
+
 
 * Lisp Changes in Emacs 24.4
 

=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-04-22 17:45:43 +0000
+++ b/lisp/ChangeLog    2014-04-22 21:32:51 +0000
@@ -1,3 +1,40 @@
+2014-04-22  Michael Heerdegen  <address@hidden>
+
+       * dired.el (dired-insert-set-properties): Do not consider
+       subdirectory headings and empty lines to be information that
+       `dired-hide-details-mode' should hide.  (Bug#17228)
+
+2014-04-22  Michael Albinus  <address@hidden>
+
+       * net/tramp-sh.el (tramp-sh-handle-file-name-all-completions):
+       Remove test messages.
+       (tramp-do-copy-or-rename-file-out-of-band): Do not quote `source'
+       and `target' twice.
+
+2014-04-22  Stefan Monnier  <address@hidden>
+
+       * dframe.el (dframe-get-focus): Remove `hook' argument (bug#17311).
+       * speedbar.el (speedbar-get-focus): Run the "hook" afterwards instead.
+
+       * emacs-lisp/cl-macs.el (cl--loop-let): Avoid `nil' as var name.
+
+2014-04-22  Michael Albinus  <address@hidden>
+
+       * net/tramp-sh.el (tramp-sh-handle-file-name-all-completions):
+       Set "IFS=" when using read builtin, in order to preserve spaces in
+       the file name.  Add test messages for hunting a bug on hydra.
+       (tramp-get-ls-command): Undo using "-b" argument.  It doesn't help.
+
+2014-04-22  Stefan Monnier  <address@hidden>
+
+       * progmodes/prog-mode.el (prettify-symbols--compose-symbol):
+       Don't prettify a word within a symbol.
+
+2014-04-22  Michael Albinus  <address@hidden>
+
+       * net/tramp-sh.el (tramp-get-ls-command): Use "-b" argument if
+       possible.
+
 2014-04-22  Stefan Monnier  <address@hidden>
 
        * emacs-lisp/lisp-mode.el (lisp--match-hidden-arg): New function.

=== modified file 'lisp/ChangeLog.16'
--- a/lisp/ChangeLog.16 2014-01-11 03:55:50 +0000
+++ b/lisp/ChangeLog.16 2014-04-20 14:45:19 +0000
@@ -902,7 +902,7 @@
        (tmm-prompt): Use it to fix the menu order.
        (tmm-get-keybind): Use current-active-maps.
 
-2013-02-12  Christopher Schmidt  <address@hidden>
+2013-02-13  Christopher Schmidt  <address@hidden>
 
        Add dired-hide-details-mode.  (Bug#6799)
 

=== modified file 'lisp/dframe.el'
--- a/lisp/dframe.el    2014-02-28 13:19:06 +0000
+++ b/lisp/dframe.el    2014-04-21 21:43:17 +0000
@@ -606,13 +606,12 @@
 
 ;;; Utilities
 ;;
-(defun dframe-get-focus (frame-var activator &optional hook)
+(defun dframe-get-focus (frame-var activator)
   "Change frame focus to or from a dedicated frame.
 If the selected frame is not in the symbol FRAME-VAR, then FRAME-VAR
 frame is selected.  If the FRAME-VAR is active, then select the
 attached frame.  If FRAME-VAR is nil, ACTIVATOR is called to
-created it.  HOOK is an optional hook to run when
-selecting FRAME-VAR."
+created it."
   (interactive)
   (if (eq (selected-frame) (symbol-value frame-var))
       (if (frame-live-p dframe-attached-frame)
@@ -623,9 +622,7 @@
     ;; go there
     (select-frame (symbol-value frame-var))
     )
-  (other-frame 0)
-  ;; If updates are off, then refresh the frame (they want it now...)
-  (run-hooks hook))
+  (other-frame 0))
 
 
 (defun dframe-close-frame ()

=== modified file 'lisp/dired.el'
--- a/lisp/dired.el     2014-04-07 10:21:22 +0000
+++ b/lisp/dired.el     2014-04-22 21:32:51 +0000
@@ -1250,9 +1250,11 @@
     (while (< (point) end)
       (ignore-errors
        (if (not (dired-move-to-filename))
-           (put-text-property (line-beginning-position)
-                              (1+ (line-end-position))
-                              'invisible 'dired-hide-details-information)
+           (unless (or (looking-at-p "^$")
+                       (looking-at-p dired-subdir-regexp))
+             (put-text-property (line-beginning-position)
+                                (1+ (line-end-position))
+                                'invisible 'dired-hide-details-information))
          (put-text-property (+ (line-beginning-position) 1) (1- (point))
                             'invisible 'dired-hide-details-detail)
          (add-text-properties

=== modified file 'lisp/emacs-lisp/cl-macs.el'
--- a/lisp/emacs-lisp/cl-macs.el        2014-04-22 16:22:13 +0000
+++ b/lisp/emacs-lisp/cl-macs.el        2014-04-22 21:32:51 +0000
@@ -1548,12 +1548,13 @@
               (if (and (cl--unused-var-p temp) (null expr))
                   nil ;; Don't bother declaring/setting `temp' since it won't
                      ;; be used when `expr' is nil, anyway.
-                (when (cl--unused-var-p temp)
+               (when (or (null temp) (cl--unused-var-p temp))
                   ;; Prefer a fresh uninterned symbol over "_to", to avoid
                   ;; warnings that we set an unused variable.
                   (setq temp (make-symbol "--cl-var--"))
                   ;; Make sure this temp variable is locally declared.
-                  (push (list (list temp)) cl--loop-bindings))
+                  (when (eq body 'setq)
+                    (push (list (list temp)) cl--loop-bindings)))
                 (push (list temp expr) new))
               (while (consp spec)
                 (push (list (pop spec)

=== modified file 'lisp/net/tramp-sh.el'
--- a/lisp/net/tramp-sh.el      2014-04-13 10:31:48 +0000
+++ b/lisp/net/tramp-sh.el      2014-04-22 10:43:01 +0000
@@ -1734,7 +1734,7 @@
                        ;; wildcard.  This will return "too many" entries
                        ;; but that isn't harmful.
                        " || %s -a 2>/dev/null)"
-                       " | while read f; do"
+                       " | while IFS= read f; do"
                        " if %s -d \"$f\" 2>/dev/null;"
                        " then \\echo \"$f/\"; else \\echo \"$f\"; fi; done"
                        " && \\echo ok) || \\echo fail")
@@ -2361,8 +2361,7 @@
                                  (append
                                   copy-args
                                   (list
-                                   (shell-quote-argument source)
-                                   (shell-quote-argument target)
+                                   source target
                                    "&&" "echo" "tramp_exit_status" "0"
                                    "||" "echo" "tramp_exit_status" "1"))))))
                  (tramp-message

=== modified file 'lisp/org/ChangeLog'
--- a/lisp/org/ChangeLog        2014-03-18 01:13:00 +0000
+++ b/lisp/org/ChangeLog        2014-04-22 14:07:45 +0000
@@ -1,3 +1,529 @@
+2014-04-22  Aaron Ecay  <address@hidden>
+
+       * org-src.el (org-edit-src-exit): Place an undo boundary before
+       writing changes back to parent buffer.
+
+2014-04-22  Achim Gratz  <address@hidden>
+
+       * 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  <address@hidden>  (tiny change)
+
+       * org-src.el (org-edit-src-exit): Don't add indentation on empty
+       lines.
+
+2014-04-22  Bastien Guerry  <address@hidden>
+
+       * 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  <address@hidden>
+
+       * org.el (org-store-link): Fix selection of the function to store
+       the link.
+
+2014-04-22  Ilya Shlyakhter  <address@hidden>
+
+       * 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  <address@hidden>
+
+       * 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  <address@hidden>  (tiny change)
+
+       * org-bibtex.el (org-bibtex-headline): Fix insertion of keywords
+       of unknown BibTeX entries.
+
+2014-04-22  Markus Hauck  <address@hidden>  (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  <address@hidden>
+
+       * org-table.el (org-table-fix-formulas): Handle multiple #+TBLFM
+       lines with `forward-line'.
+
+2014-04-22  Michael Weylandt  <address@hidden>  (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  <address@hidden>
+
+       * 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  <address@hidden>
+
+       * 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  <address@hidden>  (tiny change)
+
+       * org.el (org-mode): Add guard around set-face-foreground.
+
+2014-04-22  Rasmus  <address@hidden>
+
+       * ox-html.el (org-html-html5-elements): Drop reference to hgroup.
+
+2014-04-22  Rick Frankel  <address@hidden>
+
+       * ox-html.el (org-html-link): Unescape org-escaped links an
+       re-escape for html (browser).
+
+2014-04-22  Sacha Chua  <address@hidden>
+
+       * org.el (org-refresh-properties): Don't throw an error when
+       reaching the end of the buffer.
+
+2014-04-22  Stefan-W. Hahn  <address@hidden>  (tiny change)
+
+       * org-bibtex.el (org-bibtex-read): Check string length before
+       using aref.
+
+2014-04-22  Yasushi SHOJI  <address@hidden>
+
+       * 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  <address@hidden>
 
        * org-version.el (org-odt-data-dir):

=== modified file 'lisp/org/ob-core.el'
--- a/lisp/org/ob-core.el       2014-01-01 07:43:34 +0000
+++ b/lisp/org/ob-core.el       2014-04-22 14:07:45 +0000
@@ -217,7 +217,7 @@
   (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_")

=== modified file 'lisp/org/ob-exp.el'
--- a/lisp/org/ob-exp.el        2014-01-07 13:22:53 +0000
+++ b/lisp/org/ob-exp.el        2014-04-22 14:07:45 +0000
@@ -169,8 +169,12 @@
                            (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 @@
                           (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 @@
                 ;; 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 @@
                   ;; 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 @@
                 ;; 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 @@
             (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 @@
  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 @@
    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)

=== modified file 'lisp/org/ob-gnuplot.el'
--- a/lisp/org/ob-gnuplot.el    2014-01-07 13:22:53 +0000
+++ b/lisp/org/ob-gnuplot.el    2014-04-22 14:07:45 +0000
@@ -85,10 +85,15 @@
      (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)

=== modified file 'lisp/org/ob-python.el'
--- a/lisp/org/ob-python.el     2014-01-01 07:43:34 +0000
+++ b/lisp/org/ob-python.el     2014-04-22 14:07:45 +0000
@@ -137,7 +137,7 @@
        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.

=== modified file 'lisp/org/ob-ref.el'
--- a/lisp/org/ob-ref.el        2014-01-01 07:43:34 +0000
+++ b/lisp/org/ob-ref.el        2014-04-22 14:07:45 +0000
@@ -85,7 +85,9 @@
       (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)

=== modified file 'lisp/org/ob-table.el'
--- a/lisp/org/ob-table.el      2014-01-01 07:43:34 +0000
+++ b/lisp/org/ob-table.el      2014-04-22 14:07:45 +0000
@@ -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 @@
       (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 @@
 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)))

=== modified file 'lisp/org/org-agenda.el'
--- a/lisp/org/org-agenda.el    2014-01-08 19:16:10 +0000
+++ b/lisp/org/org-agenda.el    2014-04-22 14:07:45 +0000
@@ -649,8 +649,8 @@
   :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 @@
   ;; 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 @@
 
 (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 @@
          (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 @@
                                             (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 @@
                  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 @@
   (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 @@
              (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 @@
 
 ;;;###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 @@
              (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 @@
                    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 @@
                         (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 @@
       (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 @@
 
 (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 @@
                     (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 @@
          (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 @@
     (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 @@
          (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 @@
       (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 @@
                  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 @@
 
 ;;; 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
 

=== modified file 'lisp/org/org-bibtex.el'
--- a/lisp/org/org-bibtex.el    2014-01-01 07:43:34 +0000
+++ b/lisp/org/org-bibtex.el    2014-04-22 14:07:45 +0000
@@ -279,7 +279,7 @@
 
 (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 @@
            (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 @@
 ;;; 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 @@
        (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

=== modified file 'lisp/org/org-capture.el'
--- a/lisp/org/org-capture.el   2014-01-01 07:43:34 +0000
+++ b/lisp/org/org-capture.el   2014-04-22 14:07:45 +0000
@@ -741,7 +741,8 @@
              (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))))

=== modified file 'lisp/org/org-clock.el'
--- a/lisp/org/org-clock.el     2014-01-06 06:25:30 +0000
+++ b/lisp/org/org-clock.el     2014-04-22 14:07:45 +0000
@@ -1838,9 +1838,9 @@
        (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 @@
 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 @@
                           (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))

=== modified file 'lisp/org/org-colview.el'
--- a/lisp/org/org-colview.el   2014-01-01 07:43:34 +0000
+++ b/lisp/org/org-colview.el   2014-04-22 14:07:45 +0000
@@ -174,7 +174,7 @@
         (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 @@
                      (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 @@
                          (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

=== modified file 'lisp/org/org-compat.el'
--- a/lisp/org/org-compat.el    2014-01-01 07:43:34 +0000
+++ b/lisp/org/org-compat.el    2014-04-22 14:07:45 +0000
@@ -260,6 +260,12 @@
                  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 @@
       (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)

=== modified file 'lisp/org/org-element.el'
--- a/lisp/org/org-element.el   2014-01-07 13:22:53 +0000
+++ b/lisp/org/org-element.el   2014-04-22 14:07:45 +0000
@@ -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 @@
   "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 @@
   '("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 @@
 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 @@
       (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 @@
 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 @@
 
 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 @@
                            (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 @@
                          :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 @@
 
 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 @@
                  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 @@
            (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 @@
                ;; 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 @@
 ;;
 ;; 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 @@
 ;; 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 @@
        ((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 @@
         ;; 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 @@
       ;; 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 @@
 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 @@
 
 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 @@
 ;; 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 @@
 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 @@
            (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 @@
 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))))))
 
 
 
@@ -4873,8 +4872,8 @@
        ;; 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 @@
           (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))

=== modified file 'lisp/org/org-entities.el'
--- a/lisp/org/org-entities.el  2014-01-16 06:24:06 +0000
+++ b/lisp/org/org-entities.el  2014-04-22 14:07:45 +0000
@@ -598,7 +598,9 @@
          (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*")))
 
 

=== modified file 'lisp/org/org-mobile.el'
--- a/lisp/org/org-mobile.el    2014-01-01 07:43:34 +0000
+++ b/lisp/org/org-mobile.el    2014-04-22 14:07:45 +0000
@@ -460,6 +460,7 @@
                              ((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))

=== modified file 'lisp/org/org-src.el'
--- a/lisp/org/org-src.el       2014-01-01 07:43:34 +0000
+++ b/lisp/org/org-src.el       2014-04-22 14:07:45 +0000
@@ -348,7 +348,7 @@
          (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 @@
        (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 @@
                        (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 @@
       (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 @@
       (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))

=== modified file 'lisp/org/org-table.el'
--- a/lisp/org/org-table.el     2014-01-07 13:22:53 +0000
+++ b/lisp/org/org-table.el     2014-04-22 14:07:45 +0000
@@ -1241,6 +1241,7 @@
 (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 @@
 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."

=== modified file 'lisp/org/org-timer.el'
--- a/lisp/org/org-timer.el     2014-01-01 07:43:34 +0000
+++ b/lisp/org/org-timer.el     2014-04-22 14:07:45 +0000
@@ -156,12 +156,14 @@
     (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 @@
          (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)

=== modified file 'lisp/org/org-version.el'
--- a/lisp/org/org-version.el   2014-02-25 18:10:52 +0000
+++ b/lisp/org/org-version.el   2014-04-22 14:07:45 +0000
@@ -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))
 
 (provide 'org-version)

=== modified file 'lisp/org/org.el'
--- a/lisp/org/org.el   2014-01-07 13:22:53 +0000
+++ b/lisp/org/org.el   2014-04-22 14:07:45 +0000
@@ -813,10 +813,11 @@
 
 (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 @@
              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 @@
 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 @@
   "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:
-
-    \(\"options\" \"package\" snippet-flag)
-
-SNIPPET-FLAG, when t, indicates that this package is also needed
-when turning LaTeX snippets into images for inclusion into
+Each element is either a cell or a string.
+
+A cell is of the format:
+
+    \(\"options\" \"package\" SNIPPET-FLAG)
+
+SNIPPET-FLAG, when non-nil, indicates that this package is also
+needed when turning LaTeX snippets into images for inclusion into
 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 @@
   `(("*" 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 @@
   (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 @@
 
 (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 @@
   ;; 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 @@
   (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 @@
      (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 @@
 (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 @@
   "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 @@
 between words."
   (and targets
        (concat
-       "\\<\\("
+       "\\_<\\("
        (mapconcat
         (lambda (x)
           (setq x (regexp-quote x))
@@ -6103,7 +6119,7 @@
           x)
         targets
         "\\|")
-       "\\)\\>")))
+       "\\)\\_>")))
 
 (defun org-activate-tags (limit)
   (if (re-search-forward (org-re "^\\*+.*[ 
\t]\\(:[[:alnum:address@hidden:]+:\\)[ \r\n]") limit t)
@@ -6587,6 +6603,9 @@
        (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 @@
             (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 @@
   "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 @@
 
 (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 normal line, turn this line into
-a heading.
-
-When INVISIBLE-OK is set, stop at invisible headlines when going back.
-This is important for non-interactive uses of the command."
+
+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).
+
+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.
+
+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 @@
       (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 @@
               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 @@
 (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 @@
       (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 @@
   "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 @@
          (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 @@
         (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 @@
       (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 @@
       (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 @@
                                              (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 @@
           (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 @@
                       (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 @@
           ;; 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 @@
        (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 @@
         (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 @@
 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 @@
       (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 @@
                        ;; 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 @@
   (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 @@
               (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 @@
                  (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 @@
   (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 @@
     (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 @@
          (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 @@
 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 @@
       (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 @@
 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 @@
 
 (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:address@hidden:]+:\\)[ \t]*$"))
@@ -14402,7 +14445,7 @@
          (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 @@
 (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 @@
            (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 @@
          (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 @@
        ((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 @@
          (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 @@
        (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 @@
 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 @@
        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 @@
              (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 @@
          ;; 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 @@
                "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'."

=== modified file 'lisp/org/ox-ascii.el'
--- a/lisp/org/ox-ascii.el      2014-01-01 07:43:34 +0000
+++ b/lisp/org/ox-ascii.el      2014-04-22 14:07:45 +0000
@@ -530,8 +530,9 @@
                   (+ (- (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 @@
      (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 @@
                              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 @@
   (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 @@
   (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 @@
          ;; 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 @@
                (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 @@
   (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 @@
          ;; 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 @@
                (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 @@
           ;; 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 @@
         ((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 @@
             (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 @@
            (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 @@
 ;;;; 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 @@
       (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 @@
      ;; 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 @@
                (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 @@
               (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 @@
   ;; 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 @@
              (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))

=== modified file 'lisp/org/ox-beamer.el'
--- a/lisp/org/ox-beamer.el     2014-01-01 07:43:34 +0000
+++ b/lisp/org/ox-beamer.el     2014-04-22 14:07:45 +0000
@@ -36,10 +36,7 @@
 (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 @@
                  (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 @@
        (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 @@
                          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 @@
   ;; 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))
 
 

=== modified file 'lisp/org/ox-html.el'
--- a/lisp/org/ox-html.el       2014-01-07 13:22:53 +0000
+++ b/lisp/org/ox-html.el       2014-04-22 14:07:45 +0000
@@ -170,10 +170,8 @@
     "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 @@
 @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 @@
  * @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 @@
 @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 @@
              (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 @@
         (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 @@
       (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"))

=== modified file 'lisp/org/ox-latex.el'
--- a/lisp/org/ox-latex.el      2014-01-05 02:56:08 +0000
+++ b/lisp/org/ox-latex.el      2014-04-22 14:07:45 +0000
@@ -589,7 +589,7 @@
 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 @@
      ;; 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 @@
               ((= (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 @@
                  (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 @@
        (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 @@
       (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 @@
                (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 @@
 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 @@
         (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 @@
       (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 @@
         (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 @@
                       ("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 @@
               ((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 @@
   ;; 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))
 
 

=== modified file 'lisp/org/ox-man.el'
--- a/lisp/org/ox-man.el        2014-01-01 07:43:34 +0000
+++ b/lisp/org/ox-man.el        2014-04-22 14:07:45 +0000
@@ -638,21 +638,15 @@
 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

=== modified file 'lisp/org/ox-md.el'
--- a/lisp/org/ox-md.el 2014-01-01 07:43:34 +0000
+++ b/lisp/org/ox-md.el 2014-04-22 14:07:45 +0000
@@ -77,6 +77,7 @@
                     (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 @@
 ;;; 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 @@
   (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 @@
              (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 @@
   "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 @@
          ((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 @@
                     (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 @@
 
 ;;;; 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

=== modified file 'lisp/org/ox-odt.el'
--- a/lisp/org/ox-odt.el        2014-01-07 13:22:53 +0000
+++ b/lisp/org/ox-odt.el        2014-04-22 14:07:45 +0000
@@ -1502,7 +1502,7 @@
              (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 @@
         (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 @@
      ((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"))

=== modified file 'lisp/org/ox-publish.el'
--- a/lisp/org/ox-publish.el    2014-01-07 13:22:53 +0000
+++ b/lisp/org/ox-publish.el    2014-04-22 14:07:45 +0000
@@ -808,7 +808,8 @@
        (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)

=== modified file 'lisp/org/ox-texinfo.el'
--- a/lisp/org/ox-texinfo.el    2014-01-07 13:22:53 +0000
+++ b/lisp/org/ox-texinfo.el    2014-04-22 14:07:45 +0000
@@ -1222,10 +1222,8 @@
         (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

=== modified file 'lisp/org/ox.el'
--- a/lisp/org/ox.el    2014-01-12 05:29:11 +0000
+++ b/lisp/org/ox.el    2014-04-22 14:07:45 +0000
@@ -795,7 +795,8 @@
   :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 @@
      ;; 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 @@
     ;; 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)))

=== modified file 'lisp/progmodes/prog-mode.el'
--- a/lisp/progmodes/prog-mode.el       2014-02-10 01:34:22 +0000
+++ b/lisp/progmodes/prog-mode.el       2014-04-21 20:31:22 +0000
@@ -67,7 +67,7 @@
   (let* ((start (match-beginning 0))
         (end (match-end 0))
         (syntaxes (if (eq (char-syntax (char-after start)) ?w)
-                      '(?w) '(?. ?\\)))
+                      '(?w ?_) '(?. ?\\)))
         match)
     (if (or (memq (char-syntax (or (char-before start) ?\s)) syntaxes)
            (memq (char-syntax (or (char-after end) ?\s)) syntaxes)

=== modified file 'lisp/speedbar.el'
--- a/lisp/speedbar.el  2014-03-29 01:53:35 +0000
+++ b/lisp/speedbar.el  2014-04-22 21:32:51 +0000
@@ -1064,9 +1064,9 @@
 selected.  If the speedbar frame is active, then select the attached frame."
   (interactive)
   (speedbar-reset-scanners)
-  (dframe-get-focus 'speedbar-frame 'speedbar-frame-mode
-                   (lambda () (let ((speedbar-update-flag t))
-                                (speedbar-timer-fn)))))
+  (dframe-get-focus 'speedbar-frame 'speedbar-frame-mode)
+  (let ((speedbar-update-flag t))
+    (speedbar-timer-fn)))
 
 (defsubst speedbar-frame-width ()
   "Return the width of the speedbar frame in characters.

=== modified file 'nt/ChangeLog'
--- a/nt/ChangeLog      2014-04-11 06:43:20 +0000
+++ b/nt/ChangeLog      2014-04-22 21:32:51 +0000
@@ -1,3 +1,8 @@
+2014-04-22  Eli Zaretskii  <address@hidden>
+
+       * inc/ms-w32.h (lseek): Define only if not already a macro.
+       Suggested by Fabrice Popineau <address@hidden>.
+
 2014-04-11  Ken Brown  <address@hidden>
 
        * emacs.rc: Revert last change.

=== modified file 'nt/inc/ms-w32.h'
--- a/nt/inc/ms-w32.h   2014-01-11 13:36:06 +0000
+++ b/nt/inc/ms-w32.h   2014-04-21 06:37:21 +0000
@@ -276,7 +276,10 @@
 #endif
 #define isatty    _isatty
 #define _longjmp  longjmp
+/* MinGW64 defines lseek to invoke lseek64.  */
+#ifndef lseek
 #define lseek     _lseek
+#endif
 #define popen     _popen
 #define pclose    _pclose
 #define strdup    _strdup

=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2014-04-22 07:04:34 +0000
+++ b/src/ChangeLog     2014-04-22 21:32:51 +0000
@@ -1,3 +1,25 @@
+2014-04-22  Paul Eggert  <address@hidden>
+
+       Port to GCC 4.9.0 with --enable-gcc-warnings.
+       * image.c (struct my_jpeg_error_mgr) [lint]: Remove member fp.
+       All uses removed.
+       (jpeg_load_body) [lint]: Add a 'volatile' to pacify a buggy GCC in
+       a way that also works with GCC 4.9.0.
+
+       * search.c (Fnewline_cache_check): Remove unused locals.
+
+2014-04-22  Eli Zaretskii  <address@hidden>
+
+       * search.c (find_newline1): New subroutine.
+       (Fnewline_cache_check): New function.
+       (syms_of_search): Defsubr it.
+
+2014-04-22  Jarek Czekalski  <address@hidden>
+
+       Fix freezing with scroll bars of GTK3 Toolkit (bug#15801).
+       * keyboard.c (unblock_input): Add comment.
+       * xgselect.c (xg_select): Prevent Glib main loop recursion.
+
 2014-04-22  Daniel Colascione  <address@hidden>
 
        * lread.c (readevalloop_eager_expand_eval): New function

=== modified file 'src/conf_post.h'
--- a/src/conf_post.h   2014-04-16 19:43:46 +0000
+++ b/src/conf_post.h   2014-04-22 21:32:51 +0000
@@ -119,7 +119,7 @@
 #endif
 
 /* We must intercept 'opendir' calls to stash away the directory name,
-   so we could reuse it in realinkat, see msdos.c.  */
+   so we could reuse it in readlinkat; see msdos.c.  */
 #define opendir sys_opendir
 
 /* The "portable" definition of _GL_INLINE on config.h does not work

=== modified file 'src/image.c'
--- a/src/image.c       2014-04-03 20:46:04 +0000
+++ b/src/image.c       2014-04-22 21:32:51 +0000
@@ -6262,9 +6262,6 @@
       MY_JPEG_INVALID_IMAGE_SIZE,
       MY_JPEG_CANNOT_CREATE_X
     } failure_code;
-#ifdef lint
-  FILE *fp;
-#endif
 };
 
 
@@ -6479,7 +6476,8 @@
 {
   Lisp_Object file, specified_file;
   Lisp_Object specified_data;
-  FILE *fp = NULL;
+  /* The 'volatile' silences a bogus diagnostic; see GCC bug 54561.  */
+  FILE * IF_LINT (volatile) fp = NULL;
   JSAMPARRAY buffer;
   int row_stride, x, y;
   XImagePtr ximg = NULL;
@@ -6512,8 +6510,6 @@
       return 0;
     }
 
-  IF_LINT (mgr->fp = fp);
-
   /* Customize libjpeg's error handling to call my_error_exit when an
      error is detected.  This function will perform a longjmp.  */
   mgr->cinfo.err = fn_jpeg_std_error (&mgr->pub);
@@ -6552,9 +6548,6 @@
       return 0;
     }
 
-  /* Silence a bogus diagnostic; see GCC bug 54561.  */
-  IF_LINT (fp = mgr->fp);
-
   /* Create the JPEG decompression object.  Let it read from fp.
         Read the JPEG image header.  */
   fn_jpeg_CreateDecompress (&mgr->cinfo, JPEG_LIB_VERSION, sizeof 
*&mgr->cinfo);

=== modified file 'src/keyboard.c'
--- a/src/keyboard.c    2014-04-16 19:43:46 +0000
+++ b/src/keyboard.c    2014-04-22 21:32:51 +0000
@@ -7117,7 +7117,12 @@
 /* End critical section.
 
    If doing signal-driven input, and a signal came in when input was
-   blocked, reinvoke the signal handler now to deal with it.  */
+   blocked, reinvoke the signal handler now to deal with it.
+
+   It will also process queued input, if it was not read before.
+   When a longer code sequence does not use block/unblock input
+   at all, the whole input gathered up to the next call to
+   unblock_input will be processed inside that call. */
 
 void
 unblock_input (void)

=== modified file 'src/search.c'
--- a/src/search.c      2014-03-31 07:13:58 +0000
+++ b/src/search.c      2014-04-22 21:32:51 +0000
@@ -3098,6 +3098,169 @@
                                out - temp,
                                STRING_MULTIBYTE (string));
 }
+
+/* Like find_newline, but doesn't use the cache, and only searches forward.  */
+static ptrdiff_t
+find_newline1 (ptrdiff_t start, ptrdiff_t start_byte, ptrdiff_t end,
+              ptrdiff_t end_byte, ptrdiff_t count, ptrdiff_t *shortage,
+              ptrdiff_t *bytepos, bool allow_quit)
+{
+  if (count > 0)
+    {
+      if (!end)
+       end = ZV, end_byte = ZV_BYTE;
+    }
+  else
+    {
+      if (!end)
+       end = BEGV, end_byte = BEGV_BYTE;
+    }
+  if (end_byte == -1)
+    end_byte = CHAR_TO_BYTE (end);
+
+  if (shortage != 0)
+    *shortage = 0;
+
+  immediate_quit = allow_quit;
+
+  if (count > 0)
+    while (start != end)
+      {
+        /* Our innermost scanning loop is very simple; it doesn't know
+           about gaps, buffer ends, or the newline cache.  ceiling is
+           the position of the last character before the next such
+           obstacle --- the last character the dumb search loop should
+           examine.  */
+       ptrdiff_t tem, ceiling_byte = end_byte - 1;
+
+       if (start_byte == -1)
+         start_byte = CHAR_TO_BYTE (start);
+
+        /* The dumb loop can only scan text stored in contiguous
+           bytes. BUFFER_CEILING_OF returns the last character
+           position that is contiguous, so the ceiling is the
+           position after that.  */
+       tem = BUFFER_CEILING_OF (start_byte);
+       ceiling_byte = min (tem, ceiling_byte);
+
+        {
+          /* The termination address of the dumb loop.  */
+         unsigned char *lim_addr = BYTE_POS_ADDR (ceiling_byte) + 1;
+         ptrdiff_t lim_byte = ceiling_byte + 1;
+
+         /* Nonpositive offsets (relative to LIM_ADDR and LIM_BYTE)
+            of the base, the cursor, and the next line.  */
+         ptrdiff_t base = start_byte - lim_byte;
+         ptrdiff_t cursor, next;
+
+         for (cursor = base; cursor < 0; cursor = next)
+           {
+              /* The dumb loop.  */
+             unsigned char *nl = memchr (lim_addr + cursor, '\n', - cursor);
+             next = nl ? nl - lim_addr : 0;
+
+              if (! nl)
+               break;
+             next++;
+
+             if (--count == 0)
+               {
+                 immediate_quit = 0;
+                 if (bytepos)
+                   *bytepos = lim_byte + next;
+                 return BYTE_TO_CHAR (lim_byte + next);
+               }
+            }
+
+         start_byte = lim_byte;
+         start = BYTE_TO_CHAR (start_byte);
+        }
+      }
+
+  immediate_quit = 0;
+  if (shortage)
+    *shortage = count;
+  if (bytepos)
+    {
+      *bytepos = start_byte == -1 ? CHAR_TO_BYTE (start) : start_byte;
+      eassert (*bytepos == CHAR_TO_BYTE (start));
+    }
+  return start;
+}
+
+DEFUN ("newline-cache-check", Fnewline_cache_check, Snewline_cache_check,
+       0, 1, 0,
+       doc: /* Check the newline cache of BUFFER against buffer contents.
+
+BUFFER defaults to the current buffer.
+
+Value is an array of 2 sub-arrays of buffer positions for newlines,
+the first based on the cache, the second based on actually scanning
+the buffer.  If the buffer doesn't have a cache, the value is nil.  */)
+  (Lisp_Object buffer)
+{
+  struct buffer *buf;
+  ptrdiff_t shortage, nl_count_cache, nl_count_buf;
+  Lisp_Object cache_newlines, buf_newlines, val;
+  ptrdiff_t from, found, i;
+
+  if (NILP (buffer))
+    buf = current_buffer;
+  else
+    {
+      CHECK_BUFFER (buffer);
+      buf = XBUFFER (buffer);
+    }
+  if (buf->base_buffer)
+    buf = buf->base_buffer;
+
+  /* If the buffer doesn't have a newline cache, return nil.  */
+  if (NILP (BVAR (buf, cache_long_scans))
+      || buf->newline_cache == NULL)
+    return Qnil;
+
+  /* How many newlines are there according to the cache?  */
+  find_newline (BUF_BEG (buf), BUF_BEG_BYTE (buf),
+               BUF_Z (buf), BUF_Z_BYTE (buf),
+               TYPE_MAXIMUM (ptrdiff_t), &shortage, NULL, true);
+  nl_count_cache = TYPE_MAXIMUM (ptrdiff_t) - shortage;
+
+  /* Create vector and populate it.  */
+  cache_newlines = make_uninit_vector (nl_count_cache);
+  for (from = BUF_BEG( buf), found = from, i = 0;
+       from < BUF_Z (buf);
+       from = found, i++)
+    {
+      ptrdiff_t from_byte = CHAR_TO_BYTE (from);
+
+      found = find_newline (from, from_byte, 0, -1, 1, &shortage, NULL, true);
+      if (shortage == 0)
+       ASET (cache_newlines, i, make_number (found - 1));
+    }
+
+  /* Now do the same, but without using the cache.  */
+  find_newline1 (BUF_BEG (buf), BUF_BEG_BYTE (buf),
+                BUF_Z (buf), BUF_Z_BYTE (buf),
+                TYPE_MAXIMUM (ptrdiff_t), &shortage, NULL, true);
+  nl_count_buf = TYPE_MAXIMUM (ptrdiff_t) - shortage;
+  buf_newlines = make_uninit_vector (nl_count_buf);
+  for (from = BUF_BEG( buf), found = from, i = 0;
+       from < BUF_Z (buf);
+       from = found, i++)
+    {
+      ptrdiff_t from_byte = CHAR_TO_BYTE (from);
+
+      found = find_newline1 (from, from_byte, 0, -1, 1, &shortage, NULL, true);
+      if (shortage == 0)
+       ASET (buf_newlines, i, make_number (found - 1));
+    }
+
+  /* Construct the value and return it.  */
+  val = make_uninit_vector (2);
+  ASET (val, 0, cache_newlines);
+  ASET (val, 1, buf_newlines);
+  return val;
+}
 
 void
 syms_of_search (void)
@@ -3170,4 +3333,5 @@
   defsubr (&Smatch_data);
   defsubr (&Sset_match_data);
   defsubr (&Sregexp_quote);
+  defsubr (&Snewline_cache_check);
 }

=== modified file 'src/xgselect.c'
--- a/src/xgselect.c    2014-04-16 19:43:46 +0000
+++ b/src/xgselect.c    2014-04-22 21:32:51 +0000
@@ -28,6 +28,18 @@
 #include <stdbool.h>
 #include <timespec.h>
 #include "frame.h"
+#include "blockinput.h"
+
+/* `xg_select' is a `pselect' replacement.  Why do we need a separate function?
+   1. Timeouts.  Glib and Gtk rely on timer events.  If we did pselect
+      with a greater timeout then the one scheduled by Glib, we would
+      not allow Glib to process its timer events.  We want Glib to
+      work smoothly, so we need to reduce our timeout to match Glib.
+   2. Descriptors.  Glib may listen to more file descriptors than we do.
+      So we add Glib descriptors to our pselect pool, but we don't change
+      the value returned by the function.  The return value  matches only
+      the descriptors passed as arguments, making it compatible with
+      plain pselect.  */
 
 int
 xg_select (int fds_lim, fd_set *rfds, fd_set *wfds, fd_set *efds,
@@ -47,12 +59,6 @@
   bool need_to_dispatch;
   USE_SAFE_ALLOCA;
 
-  /* Do not try to optimize with an initial check with g_main_context_pending
-     and a call to pselect if it returns false.  If Gdk has a timeout for 0.01
-     second, and Emacs has a timeout for 1 second, g_main_context_pending will
-     return false, but the timeout will be 1 second, thus missing the gdk
-     timeout with a lot.  */
-
   context = g_main_context_default ();
 
   if (rfds) all_rfds = *rfds;
@@ -136,8 +142,13 @@
   if (need_to_dispatch)
     {
       int pselect_errno = errno;
+      /* Prevent g_main_dispatch recursion, that would occur without
+         block_input wrapper, because event handlers call
+         unblock_input.  Event loop recursion was causing Bug#15801.  */
+      block_input ();
       while (g_main_context_pending (context))
-       g_main_context_dispatch (context);
+        g_main_context_dispatch (context);
+      unblock_input ();
       errno = pselect_errno;
     }
 

=== modified file 'test/ChangeLog'
--- a/test/ChangeLog    2014-04-22 07:04:34 +0000
+++ b/test/ChangeLog    2014-04-22 21:32:51 +0000
@@ -1,3 +1,16 @@
+2014-04-22  Michael Albinus  <address@hidden>
+
+       * automated/tramp-tests.el (tramp--test-check-files): Remove traces.
+       (tramp-test30-special-characters): Remove test for backslash.
+
+2014-04-20  Michael Albinus  <address@hidden>
+
+       * automated/tramp-tests.el
+       (tramp-test19-directory-files-and-attributes)
+       (tramp-test22-file-times): Check for `file-attributes' equality
+       only if there is a usable timestamp.
+       (tramp--test-check-files): Do not use `copy-sequence'.
+
 2014-04-22  Daniel Colascione  <address@hidden>
 
        * automated/bytecomp-tests.el (test-byte-comp-compile-and-load):

=== modified file 'test/automated/cl-lib.el'
--- a/test/automated/cl-lib.el  2014-04-22 06:45:41 +0000
+++ b/test/automated/cl-lib.el  2014-04-22 21:32:51 +0000
@@ -195,6 +195,9 @@
   (should (eql (cl-mismatch "Aa" "aA") 0))
   (should (eql (cl-mismatch '(a b c) '(a b d)) 2)))
 
+(ert-deftest cl-lib-test-loop ()
+  (should (eql (cl-loop with (a b c) = '(1 2 3) return (+ a b c)) 6)))
+
 (ert-deftest cl-lib-keyword-names-versus-values ()
   (should (equal
            (funcall (cl-function (lambda (&key a b) (list a b)))

=== modified file 'test/automated/tramp-tests.el'
--- a/test/automated/tramp-tests.el     2014-04-19 14:14:26 +0000
+++ b/test/automated/tramp-tests.el     2014-04-22 10:52:08 +0000
@@ -1012,14 +1012,22 @@
          (write-region "boz" nil (expand-file-name "boz" tmp-name2))
          (setq attr (directory-files-and-attributes tmp-name2))
          (should (consp attr))
+         ;; Dumb remote shells without perl(1) or stat(1) are not
+         ;; able to return the date correctly.  They say "don't know".
          (dolist (elt attr)
-           (should
-            (equal (file-attributes (expand-file-name (car elt) tmp-name2))
-                   (cdr elt))))
+           (unless
+               (equal
+                (nth 5
+                     (file-attributes (expand-file-name (car elt) tmp-name2)))
+                '(0 0))
+             (should
+              (equal (file-attributes (expand-file-name (car elt) tmp-name2))
+                     (cdr elt)))))
          (setq attr (directory-files-and-attributes tmp-name2 'full))
          (dolist (elt attr)
-           (should
-            (equal (file-attributes (car elt)) (cdr elt))))
+           (unless (equal (nth 5 (file-attributes (car elt))) '(0 0))
+             (should
+              (equal (file-attributes (car elt)) (cdr elt)))))
          (setq attr (directory-files-and-attributes tmp-name2 nil "^b"))
          (should (equal (mapcar 'car attr) '("bar" "boz"))))
       (ignore-errors (delete-directory tmp-name1 'recursive)))))
@@ -1142,16 +1150,16 @@
          ;; We skip the test, if the remote handler is not able to
          ;; set the correct time.
          (skip-unless (set-file-times tmp-name1 '(0 1)))
-         ;; Dumb busyboxes are not able to return the date correctly.
-         ;; They say "don't know.
-         (skip-unless (not (equal (nth 5 (file-attributes tmp-name1)) '(0 0))))
-         (should (equal (nth 5 (file-attributes tmp-name1)) '(0 1)))
-         (write-region "bla" nil tmp-name2)
-         (should (file-exists-p tmp-name2))
-         (should (file-newer-than-file-p tmp-name2 tmp-name1))
-         ;; `tmp-name3' does not exist.
-         (should (file-newer-than-file-p tmp-name2 tmp-name3))
-         (should-not (file-newer-than-file-p tmp-name3 tmp-name1)))
+         ;; Dumb remote shells without perl(1) or stat(1) are not
+         ;; able to return the date correctly.  They say "don't know".
+         (unless (equal (nth 5 (file-attributes tmp-name1)) '(0 0))
+           (should (equal (nth 5 (file-attributes tmp-name1)) '(0 1)))
+           (write-region "bla" nil tmp-name2)
+           (should (file-exists-p tmp-name2))
+           (should (file-newer-than-file-p tmp-name2 tmp-name1))
+           ;; `tmp-name3' does not exist.
+           (should (file-newer-than-file-p tmp-name2 tmp-name3))
+           (should-not (file-newer-than-file-p tmp-name3 tmp-name1))))
       (ignore-errors
        (delete-file tmp-name1)
        (delete-file tmp-name2)))))
@@ -1446,7 +1454,7 @@
                         (sort (copy-sequence files) 'string-lessp)))
          (should (equal (directory-files
                          tmp-name2 nil directory-files-no-dot-files-regexp)
-                        (sort (copy-sequence files) 'string-lessp))))
+                        (sort files 'string-lessp))))
       (ignore-errors (delete-directory tmp-name1 'recursive))
       (ignore-errors (delete-directory tmp-name2 'recursive)))))
 
@@ -1455,9 +1463,10 @@
   "Check special characters in file names."
   (skip-unless (tramp--test-enabled))
 
-  ;; Newlines and slashes in file names are not supported.  So we don't test.
+  ;; Newlines, slashes and backslashes in file names are not supported.
+  ;; So we don't test.
   (tramp--test-check-files
-   " foo bar\tbaz "
+   " foo\tbar baz\t"
    "$foo$bar$$baz$"
    "-foo-bar-baz-"
    "%foo%bar%baz%"
@@ -1465,7 +1474,6 @@
    "?foo?bar?baz?"
    "*foo*bar*baz*"
    "'foo\"bar'baz\""
-   "\\foo\\bar\\baz\\"
    "#foo#bar#baz#"
    "!foo|bar!baz|"
    ":foo;bar:baz;"


reply via email to

[Prev in Thread] Current Thread [Next in Thread]