aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2014-04-22 14:32:51 -0700
committerPaul Eggert2014-04-22 14:32:51 -0700
commit42e910349d699ee3f8024371ca1e60e015fc6aa7 (patch)
treeba589f3f7c278671f0ae9c5c8f15c241ae8dd674
parent4f96579371290b201a973072a1c2f237755bb954 (diff)
parent34e856d5ac828753b7be20e2471f39fb613f7f40 (diff)
downloademacs-42e910349d699ee3f8024371ca1e60e015fc6aa7.tar.gz
emacs-42e910349d699ee3f8024371ca1e60e015fc6aa7.zip
Merge from emacs-24; up to 2014-04-22T20:19:17Z!eggert@cs.ucla.edu
-rw-r--r--doc/emacs/ChangeLog12
-rw-r--r--doc/emacs/buffers.texi8
-rw-r--r--doc/emacs/cmdargs.texi12
-rw-r--r--doc/emacs/indent.texi10
-rw-r--r--doc/lispref/ChangeLog6
-rw-r--r--doc/lispref/internals.texi2
-rw-r--r--doc/lispref/text.texi12
-rw-r--r--doc/misc/ChangeLog30
-rw-r--r--doc/misc/org.texi63
-rw-r--r--etc/NEWS13
-rw-r--r--lisp/ChangeLog37
-rw-r--r--lisp/ChangeLog.162
-rw-r--r--lisp/dframe.el9
-rw-r--r--lisp/dired.el8
-rw-r--r--lisp/emacs-lisp/cl-macs.el5
-rw-r--r--lisp/net/tramp-sh.el5
-rw-r--r--lisp/org/ChangeLog526
-rw-r--r--lisp/org/ob-core.el2
-rw-r--r--lisp/org/ob-exp.el69
-rw-r--r--lisp/org/ob-gnuplot.el13
-rw-r--r--lisp/org/ob-python.el2
-rw-r--r--lisp/org/ob-ref.el4
-rw-r--r--lisp/org/ob-table.el12
-rw-r--r--lisp/org/org-agenda.el154
-rw-r--r--lisp/org/org-bibtex.el11
-rw-r--r--lisp/org/org-capture.el3
-rw-r--r--lisp/org/org-clock.el35
-rw-r--r--lisp/org/org-colview.el9
-rw-r--r--lisp/org/org-compat.el27
-rw-r--r--lisp/org/org-element.el197
-rw-r--r--lisp/org/org-entities.el4
-rw-r--r--lisp/org/org-mobile.el1
-rw-r--r--lisp/org/org-src.el38
-rw-r--r--lisp/org/org-table.el57
-rw-r--r--lisp/org/org-timer.el5
-rw-r--r--lisp/org/org-version.el4
-rw-r--r--lisp/org/org.el515
-rw-r--r--lisp/org/ox-ascii.el82
-rw-r--r--lisp/org/ox-beamer.el19
-rw-r--r--lisp/org/ox-html.el36
-rw-r--r--lisp/org/ox-latex.el87
-rw-r--r--lisp/org/ox-man.el10
-rw-r--r--lisp/org/ox-md.el97
-rw-r--r--lisp/org/ox-odt.el18
-rw-r--r--lisp/org/ox-publish.el3
-rw-r--r--lisp/org/ox-texinfo.el6
-rw-r--r--lisp/org/ox.el14
-rw-r--r--lisp/progmodes/prog-mode.el2
-rw-r--r--lisp/speedbar.el6
-rw-r--r--nt/ChangeLog5
-rw-r--r--nt/inc/ms-w32.h3
-rw-r--r--src/ChangeLog22
-rw-r--r--src/conf_post.h2
-rw-r--r--src/image.c11
-rw-r--r--src/keyboard.c7
-rw-r--r--src/search.c164
-rw-r--r--src/xgselect.c25
-rw-r--r--test/ChangeLog13
-rw-r--r--test/automated/cl-lib.el3
-rw-r--r--test/automated/tramp-tests.el46
60 files changed, 1841 insertions, 762 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog
index fb17acc415a..70a9a0f1090 100644
--- a/doc/emacs/ChangeLog
+++ b/doc/emacs/ChangeLog
@@ -1,3 +1,13 @@
12014-04-22 Eli Zaretskii <eliz@gnu.org>
2
3 * buffers.texi (Uniquify): Clarify the default uniquification.
4
5 * indent.texi (Tab Stops): Improve wording.
6
7 * cmdargs.texi (General Variables): Improve docs of
8 EMACSLOADPATH. Index all the environment variables.
9 (Misc Variables): Index all the environment variables.
10
12014-04-17 Paul Eggert <eggert@cs.ucla.edu> 112014-04-17 Paul Eggert <eggert@cs.ucla.edu>
2 12
3 * Makefile.in (infoclean): Be consistent about reporting failures. 13 * Makefile.in (infoclean): Be consistent about reporting failures.
@@ -38,7 +48,7 @@
382014-03-15 Dmitry Gutov <dgutov@yandex.ru> 482014-03-15 Dmitry Gutov <dgutov@yandex.ru>
39 49
40 * programs.texi (Matching): Update WRT to the new 50 * programs.texi (Matching): Update WRT to the new
41 `blink-matchin-paren' behavior. 51 `blink-matching-paren' behavior.
42 52
432014-03-13 Paul Eggert <eggert@cs.ucla.edu> 532014-03-13 Paul Eggert <eggert@cs.ucla.edu>
44 54
diff --git a/doc/emacs/buffers.texi b/doc/emacs/buffers.texi
index c96b657b481..3f55cf7076e 100644
--- a/doc/emacs/buffers.texi
+++ b/doc/emacs/buffers.texi
@@ -611,8 +611,12 @@ convenient to switch between buffers.
611the buffers distinct names. The default method 611the buffers distinct names. The default method
612(@code{uniquify-buffer-name-style} set to 612(@code{uniquify-buffer-name-style} set to
613@code{post-forward-angle-brackets}) for making buffer names unique 613@code{post-forward-angle-brackets}) for making buffer names unique
614adds @samp{<dir1>}, @samp{<dir2>}, etc. to the end of the buffer 614adds @samp{<dir1>}, @samp{<dir2>}, etc.@: to the end of the buffer
615names. 615names, where @file{dir1} and @file{dir2} are the minimal parts of the
616leading directories needed to make the buffer name unique. For
617example, if you have files @file{/foo/bar/mumble/name} and
618@file{/baz/quux/mumble/name} visited, their buffers will be named
619@samp{name<bar/mumble>} and @samp{name<quux/mumble>} correspondingly.
616 620
617@vindex uniquify-buffer-name-style 621@vindex uniquify-buffer-name-style
618 There are several styles to make buffer names unique. To select 622 There are several styles to make buffer names unique. To select
diff --git a/doc/emacs/cmdargs.texi b/doc/emacs/cmdargs.texi
index 06e41a57681..ce7af79076e 100644
--- a/doc/emacs/cmdargs.texi
+++ b/doc/emacs/cmdargs.texi
@@ -439,7 +439,7 @@ special meanings in Emacs. Most of these variables are also used by
439some other programs. Emacs does not require any of these environment 439some other programs. Emacs does not require any of these environment
440variables to be set, but it uses their values if they are set. 440variables to be set, but it uses their values if they are set.
441 441
442@table @env 442@vtable @env
443@item CDPATH 443@item CDPATH
444Used by the @code{cd} command to search for the directory you specify, 444Used by the @code{cd} command to search for the directory you specify,
445when you specify a relative directory name. 445when you specify a relative directory name.
@@ -464,7 +464,9 @@ Emacs Lisp files. If set, it modifies the usual initial value of the
464@code{load-path} variable (@pxref{Lisp Libraries}). An empty element 464@code{load-path} variable (@pxref{Lisp Libraries}). An empty element
465stands for the default value of @code{load-path}; e.g., using 465stands for the default value of @code{load-path}; e.g., using
466@samp{EMACSLOADPATH="/tmp:"} adds @file{/tmp} to the front of 466@samp{EMACSLOADPATH="/tmp:"} adds @file{/tmp} to the front of
467the default @code{load-path}. 467the default @code{load-path}. To specify an empty element in the
468middle of the list, use 2 colons in a row, as in
469@samp{EMACSLOADPATH="/tmp::/foo"}.
468@item EMACSPATH 470@item EMACSPATH
469A colon-separated list of directories to search for executable files. 471A colon-separated list of directories to search for executable files.
470If set, Emacs uses this in addition to @env{PATH} (see below) when 472If set, Emacs uses this in addition to @env{PATH} (see below) when
@@ -598,14 +600,14 @@ defaults to @samp{root}.
598@item VERSION_CONTROL 600@item VERSION_CONTROL
599Used to initialize the @code{version-control} variable (@pxref{Backup 601Used to initialize the @code{version-control} variable (@pxref{Backup
600Names}). 602Names}).
601@end table 603@end vtable
602 604
603@node Misc Variables 605@node Misc Variables
604@appendixsubsec Miscellaneous Variables 606@appendixsubsec Miscellaneous Variables
605 607
606These variables are used only on particular configurations: 608These variables are used only on particular configurations:
607 609
608@table @env 610@vtable @env
609@item COMSPEC 611@item COMSPEC
610On MS-DOS and MS-Windows, the name of the command interpreter to use 612On MS-DOS and MS-Windows, the name of the command interpreter to use
611when invoking batch files and commands internal to the shell. On MS-DOS 613when invoking batch files and commands internal to the shell. On MS-DOS
@@ -657,7 +659,7 @@ rather than hard-coding an absolute path. This allows multiple
657versions of Emacs to share the same environment variable settings, and 659versions of Emacs to share the same environment variable settings, and
658it allows you to move the Emacs installation directory, without 660it allows you to move the Emacs installation directory, without
659changing any environment or registry settings. 661changing any environment or registry settings.
660@end table 662@end vtable
661 663
662@node MS-Windows Registry 664@node MS-Windows Registry
663@appendixsubsec The MS-Windows System Registry 665@appendixsubsec The MS-Windows System Registry
diff --git a/doc/emacs/indent.texi b/doc/emacs/indent.texi
index 4b44b9289b5..b254cfca43e 100644
--- a/doc/emacs/indent.texi
+++ b/doc/emacs/indent.texi
@@ -153,11 +153,11 @@ C-u -999 C-x @key{TAB}
153are used as stopping points by @key{TAB} when inserting whitespace in 153are used as stopping points by @key{TAB} when inserting whitespace in
154Text mode and related modes (@pxref{Indentation}), and by commands 154Text mode and related modes (@pxref{Indentation}), and by commands
155like @kbd{M-i} (@pxref{Indentation Commands}). The variable 155like @kbd{M-i} (@pxref{Indentation Commands}). The variable
156@code{tab-stop-list} controls these positions. The default value 156@code{tab-stop-list} controls these positions. The default value is
157is @code{nil}, which means a tab stop every 8 columns. The value 157@code{nil}, which means a tab stop every 8 columns. The value can
158can also be a list of column numbers (in increasing order) at which to 158also be a list of zero-based column numbers (in increasing order) at
159place tab stops. Emacs extends the list forever by repeating the 159which to place tab stops. Emacs extends the list forever by repeating
160difference between the last and next-to-last elements. 160the difference between the last and next-to-last elements.
161 161
162@findex edit-tab-stops 162@findex edit-tab-stops
163@kindex C-c C-c @r{(Edit Tab Stops)} 163@kindex C-c C-c @r{(Edit Tab Stops)}
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index 7c368c126cd..e9ea1f7459e 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,9 @@
12014-04-22 Eli Zaretskii <eliz@gnu.org>
2
3 * text.texi (Registers): Document register-read-with-preview.
4
5 * internals.texi (Building Emacs): Improve indexing.
6
12014-04-17 Daniel Colascione <dancol@dancol.org> 72014-04-17 Daniel Colascione <dancol@dancol.org>
2 8
3 * frames.texi (Terminal Parameters): Document new 9 * frames.texi (Terminal Parameters): Document new
diff --git a/doc/lispref/internals.texi b/doc/lispref/internals.texi
index d91b0349810..f85701f5396 100644
--- a/doc/lispref/internals.texi
+++ b/doc/lispref/internals.texi
@@ -111,6 +111,8 @@ drawback that the documentation strings take up space in Emacs all the
111time.) 111time.)
112@end itemize 112@end itemize
113 113
114@cindex change @code{load-path} at configure time
115@cindex @option{--enable-locallisppath} option to @command{configure}
114 It is not advisable to put anything in @file{site-load.el} or 116 It is not advisable to put anything in @file{site-load.el} or
115@file{site-init.el} that would alter any of the features that users 117@file{site-init.el} that would alter any of the features that users
116expect in an ordinary unmodified Emacs. If you feel you must override 118expect in an ordinary unmodified Emacs. If you feel you must override
diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi
index 7c5603fd645..3c70f5f96b0 100644
--- a/doc/lispref/text.texi
+++ b/doc/lispref/text.texi
@@ -4117,6 +4117,18 @@ a rectangle (a list), currently useless things happen. This may be
4117changed in the future. 4117changed in the future.
4118@end deffn 4118@end deffn
4119 4119
4120@defun register-read-with-preview prompt
4121@cindex register preview
4122This function reads and returns a register name, prompting with
4123@var{prompt} and possibly showing a preview of the existing registers
4124and their contents. The preview is shown in a temporary window, after
4125the delay specified by the user option @code{register-preview-delay},
4126if its value and @code{register-alist} are both non-@code{nil}. The
4127preview is also shown if the user requests help (e.g., by typing the
4128help character). We recommend that all interactive commands which
4129read register names use this function.
4130@end defun
4131
4120@node Transposition 4132@node Transposition
4121@section Transposition of Text 4133@section Transposition of Text
4122 4134
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog
index fb54cd30b12..4f336cdbce4 100644
--- a/doc/misc/ChangeLog
+++ b/doc/misc/ChangeLog
@@ -1,3 +1,31 @@
12014-04-22 Bastien Guerry <bzg@gnu.org>
2
3 * org.texi (Installation): Be more clear on why installing Org
4 through ELPA should be done without loading any Org file.
5
6 * org.texi (Emphasis and monospace): Document the use of
7 =verbatim= and ~code~ to be consistent with
8 `org-element-text-markup-successor'.
9
10 * org.texi (In-buffer settings, Radio tables): Tiny fixes.
11
12 * org.texi (Initial visibility):
13 * org.texi (Literal examples): Fix typos.
14
152014-04-22 Michael Brand <michael.ch.brand@gmail.com>
16
17 * org.texi (Column attributes): Add a sentence to point out
18 the dependency on the format specifier.
19
202014-04-22 Nicolas Goaziou <n.goaziou@gmail.com>
21
22 * org.texi (The Export Dispatcher): Reformulation.
23
24 * org.texi (@LaTeX{} specific attributes): Update manual.
25
26 * org.texi (Top, Exporting): Org has its own documentation and
27 should therefore be removed from "Other build-in back-ends".
28
12014-04-22 Stefan Monnier <monnier@iro.umontreal.ca> 292014-04-22 Stefan Monnier <monnier@iro.umontreal.ca>
2 30
3 * cl.texi (Structures): Remove cl-struct-set-slot-value. 31 * cl.texi (Structures): Remove cl-struct-set-slot-value.
@@ -1614,7 +1642,7 @@
1614 * ede.texi (Top): Rename from top, all uses changed. 1642 * ede.texi (Top): Rename from top, all uses changed.
1615 * eshell.texi: Add missing argument to @sp. 1643 * eshell.texi: Add missing argument to @sp.
1616 * forms.texi (Top): Reorder menu to match structure. 1644 * forms.texi (Top): Reorder menu to match structure.
1617 * htmlfontify.texi (Customisation): Add missing @item in 1645 * htmlfontify.texi (Customization): Add missing @item in
1618 @enumerate. 1646 @enumerate.
1619 * org.texi (Advanced features): Add missing argument for @item. 1647 * org.texi (Advanced features): Add missing argument for @item.
1620 (Property searches): Use @backslashchar{} in macro argument. 1648 (Property searches): Use @backslashchar{} in macro argument.
diff --git a/doc/misc/org.texi b/doc/misc/org.texi
index c6b8c90293f..48a6fe56cf6 100644
--- a/doc/misc/org.texi
+++ b/doc/misc/org.texi
@@ -2,7 +2,7 @@
2@c %**start of header 2@c %**start of header
3@setfilename ../../info/org 3@setfilename ../../info/org
4@settitle The Org Manual 4@settitle The Org Manual
5@set VERSION 8.2.5c 5@set VERSION 8.2.6
6 6
7@c Version and Contact Info 7@c Version and Contact Info
8@set MAINTAINERSITE @uref{http://orgmode.org,maintainers web page} 8@set MAINTAINERSITE @uref{http://orgmode.org,maintainers web page}
@@ -275,7 +275,7 @@ modify this GNU manual.''
275 275
276@dircategory Emacs editing modes 276@dircategory Emacs editing modes
277@direntry 277@direntry
278* Org Mode: (org). Outline-based notes management and organizer. 278* Org Mode: (org). Outline-based notes management and organizer
279@end direntry 279@end direntry
280 280
281@titlepage 281@titlepage
@@ -585,8 +585,8 @@ Exporting
585* OpenDocument Text export:: Exporting to OpenDocument Text 585* OpenDocument Text export:: Exporting to OpenDocument Text
586* Org export:: Exporting to Org 586* Org export:: Exporting to Org
587* iCalendar export:: Exporting to iCalendar 587* iCalendar export:: Exporting to iCalendar
588* Other built-in back-ends:: Exporting to @code{Texinfo}, a man page, or Org 588* Other built-in back-ends:: Exporting to @code{Texinfo} or a man page
589* Export in foreign buffers:: Author tables in lists in Org syntax 589* Export in foreign buffers:: Author tables and lists in Org syntax
590* Advanced configuration:: Fine-tuning the export output 590* Advanced configuration:: Fine-tuning the export output
591 591
592HTML export 592HTML export
@@ -877,7 +877,11 @@ We @b{strongly recommend} to stick to a single installation method.
877 877
878Recent Emacs distributions include a packaging system which lets you install 878Recent Emacs distributions include a packaging system which lets you install
879Elisp libraries. You can install Org with @kbd{M-x package-install RET org}. 879Elisp libraries. You can install Org with @kbd{M-x package-install RET org}.
880You need to do this in a session where no @code{.org} file has been visited. 880
881@noindent @b{Important}: you need to do this in a session where no @code{.org} file has
882been visited, i.e. where no Org built-in function have been loaded.
883Otherwise autoload Org functions will mess up the installation.
884
881Then, to make sure your Org configuration is taken into account, initialize 885Then, to make sure your Org configuration is taken into account, initialize
882the package system with @code{(package-initialize)} in your @file{.emacs} 886the package system with @code{(package-initialize)} in your @file{.emacs}
883before setting any Org option. If you want to use Org's package repository, 887before setting any Org option. If you want to use Org's package repository,
@@ -1339,7 +1343,7 @@ When Emacs first visits an Org file, the global state is set to OVERVIEW,
1339i.e., only the top level headlines are visible@footnote{When 1343i.e., only the top level headlines are visible@footnote{When
1340@code{org-agenda-inhibit-startup} is non-@code{nil}, Org will not honor the default 1344@code{org-agenda-inhibit-startup} is non-@code{nil}, Org will not honor the default
1341visibility state when first opening a file for the agenda (@pxref{Speeding up 1345visibility state when first opening a file for the agenda (@pxref{Speeding up
1342your agendas}).} This can be configured through the variable 1346your agendas}).}. This can be configured through the variable
1343@code{org-startup-folded}, or on a per-file basis by adding one of the 1347@code{org-startup-folded}, or on a per-file basis by adding one of the
1344following lines anywhere in the buffer: 1348following lines anywhere in the buffer:
1345 1349
@@ -5525,6 +5529,9 @@ of 5 to 20 days, representing what to expect if everything goes either
5525extremely well or extremely poorly. In contrast, @code{est+} estimates the 5529extremely well or extremely poorly. In contrast, @code{est+} estimates the
5526full job more realistically, at 10--15 days. 5530full job more realistically, at 10--15 days.
5527 5531
5532Numbers are right-aligned when a format specifier with an explicit width like
5533@code{%5d} or @code{%5.1f} is used.
5534
5528Here is an example for a complete columns definition, along with allowed 5535Here is an example for a complete columns definition, along with allowed
5529values. 5536values.
5530 5537
@@ -9729,8 +9736,8 @@ multiple footnotes side by side.
9729@vindex org-fontify-emphasized-text 9736@vindex org-fontify-emphasized-text
9730@vindex org-emphasis-regexp-components 9737@vindex org-emphasis-regexp-components
9731@vindex org-emphasis-alist 9738@vindex org-emphasis-alist
9732You can make words @b{*bold*}, @i{/italic/}, _underlined_, @code{=code=} 9739You can make words @b{*bold*}, @i{/italic/}, _underlined_, @code{=verbatim=}
9733and @code{~verbatim~}, and, if you must, @samp{+strike-through+}. Text 9740and @code{~code~}, and, if you must, @samp{+strike-through+}. Text
9734in the code and verbatim string is not processed for Org mode specific 9741in the code and verbatim string is not processed for Org mode specific
9735syntax, it is exported verbatim. 9742syntax, it is exported verbatim.
9736 9743
@@ -9888,7 +9895,7 @@ Here is an example:
9888@example 9895@example
9889#+BEGIN_SRC emacs-lisp -n -r 9896#+BEGIN_SRC emacs-lisp -n -r
9890(save-excursion (ref:sc) 9897(save-excursion (ref:sc)
9891 (goto-char (point-min)) (ref:jump) 9898 (goto-char (point-min))) (ref:jump)
9892#+END_SRC 9899#+END_SRC
9893In line [[(sc)]] we remember the current position. [[(jump)][Line (jump)]] 9900In line [[(sc)]] we remember the current position. [[(jump)][Line (jump)]]
9894jumps to point-min. 9901jumps to point-min.
@@ -10358,8 +10365,8 @@ in the iCalendar format.
10358* OpenDocument Text export:: Exporting to OpenDocument Text 10365* OpenDocument Text export:: Exporting to OpenDocument Text
10359* Org export:: Exporting to Org 10366* Org export:: Exporting to Org
10360* iCalendar export:: Exporting to iCalendar 10367* iCalendar export:: Exporting to iCalendar
10361* Other built-in back-ends:: Exporting to @code{Texinfo}, a man page, or Org 10368* Other built-in back-ends:: Exporting to @code{Texinfo} or a man page
10362* Export in foreign buffers:: Author tables in lists in Org syntax 10369* Export in foreign buffers:: Author tables and lists in Org syntax
10363* Advanced configuration:: Fine-tuning the export output 10370* Advanced configuration:: Fine-tuning the export output
10364@end menu 10371@end menu
10365 10372
@@ -10400,10 +10407,10 @@ export dispatcher with the following key combinations:
10400Toggle asynchronous export. Asynchronous export uses an external Emacs 10407Toggle asynchronous export. Asynchronous export uses an external Emacs
10401process that is configured with a specified initialization file. 10408process that is configured with a specified initialization file.
10402 10409
10403While exporting asynchronously, the output is not displayed. It is stored in 10410While exporting asynchronously, the output is not displayed, but stored in
10404a list called ``the export stack'', and can be viewed from there. The stack 10411a place called ``the export stack''. This stack can be displayed by calling
10405can be reached by calling the dispatcher with a double @kbd{C-u} prefix 10412the dispatcher with a double @kbd{C-u} prefix argument, or with @kbd{&} key
10406argument, or with @kbd{&} key from the dispatcher. 10413from the dispatcher menu.
10407 10414
10408@vindex org-export-in-background 10415@vindex org-export-in-background
10409To make this behavior the default, customize the variable 10416To make this behavior the default, customize the variable
@@ -11762,13 +11769,12 @@ the @LaTeX{} @code{\includegraphics} macro will be commented out.
11762@cindex plain lists, in @LaTeX{} export 11769@cindex plain lists, in @LaTeX{} export
11763 11770
11764Plain lists accept two optional attributes: @code{:environment} and 11771Plain lists accept two optional attributes: @code{:environment} and
11765@code{:options}. The first one allows the use of a non-standard 11772@code{:options}. The first one allows the use of a non-standard environment
11766environment (e.g., @samp{inparaenum}). The second one specifies 11773(e.g., @samp{inparaenum}). The second one specifies additional arguments for
11767optional arguments for that environment (square brackets may be 11774that environment.
11768omitted).
11769 11775
11770@example 11776@example
11771#+ATTR_LATEX: :environment compactitem :options $\circ$ 11777#+ATTR_LATEX: :environment compactitem :options [$\circ$]
11772- you need ``paralist'' package to reproduce this example. 11778- you need ``paralist'' package to reproduce this example.
11773@end example 11779@end example
11774 11780
@@ -13773,8 +13779,13 @@ can be used to map arbitrary language names to existing major modes.
13773@item org-src-window-setup 13779@item org-src-window-setup
13774Controls the way Emacs windows are rearranged when the edit buffer is created. 13780Controls the way Emacs windows are rearranged when the edit buffer is created.
13775@item org-src-preserve-indentation 13781@item org-src-preserve-indentation
13776This variable is especially useful for tangling languages such as 13782By default, the value is @code{nil}, which means that when code blocks are
13777Python, in which whitespace indentation in the output is critical. 13783evaluated during export or tangled, they are re-inserted into the code block,
13784which may replace sequences of spaces with tab characters. When non-nil,
13785whitespace in code blocks will be preserved during export or tangling,
13786exactly as it appears. This variable is especially useful for tangling
13787languages such as Python, in which whitespace indentation in the output is
13788critical.
13778@item org-src-ask-before-returning-to-edit-buffer 13789@item org-src-ask-before-returning-to-edit-buffer
13779By default, Org will ask before returning to an open edit buffer. Set this 13790By default, Org will ask before returning to an open edit buffer. Set this
13780variable to @code{nil} to switch without asking. 13791variable to @code{nil} to switch without asking.
@@ -15827,7 +15838,7 @@ The corresponding variable is @code{org-archive-location}.
15827This line sets the category for the agenda file. The category applies 15838This line sets the category for the agenda file. The category applies
15828for all subsequent lines until the next @samp{#+CATEGORY} line, or the 15839for all subsequent lines until the next @samp{#+CATEGORY} line, or the
15829end of the file. The first such line also applies to any entries before it. 15840end of the file. The first such line also applies to any entries before it.
15830@item #+COLUMNS: %25ITEM ..... 15841@item #+COLUMNS: %25ITEM ...
15831@cindex property, COLUMNS 15842@cindex property, COLUMNS
15832Set the default format for columns view. This format applies when 15843Set the default format for columns view. This format applies when
15833columns view is invoked in locations where no @code{COLUMNS} property 15844columns view is invoked in locations where no @code{COLUMNS} property
@@ -15842,11 +15853,11 @@ The global version of this variable is
15842@item #+FILETAGS: :tag1:tag2:tag3: 15853@item #+FILETAGS: :tag1:tag2:tag3:
15843Set tags that can be inherited by any entry in the file, including the 15854Set tags that can be inherited by any entry in the file, including the
15844top-level entries. 15855top-level entries.
15845@item #+DRAWERS: NAME1 ..... 15856@item #+DRAWERS: NAME1 ...
15846@vindex org-drawers 15857@vindex org-drawers
15847Set the file-local set of additional drawers. The corresponding global 15858Set the file-local set of additional drawers. The corresponding global
15848variable is @code{org-drawers}. 15859variable is @code{org-drawers}.
15849@item #+LINK: linkword replace 15860@item #+LINK: linkword replace
15850@vindex org-link-abbrev-alist 15861@vindex org-link-abbrev-alist
15851These lines (several are allowed) specify link abbreviations. 15862These lines (several are allowed) specify link abbreviations.
15852@xref{Link abbreviations}. The corresponding variable is 15863@xref{Link abbreviations}. The corresponding variable is
@@ -16862,7 +16873,7 @@ Orgtbl mode how to translate this table and where to install it. For
16862example: 16873example:
16863@cindex #+ORGTBL 16874@cindex #+ORGTBL
16864@example 16875@example
16865#+ORGTBL: SEND table_name translation_function arguments.... 16876#+ORGTBL: SEND table_name translation_function arguments...
16866@end example 16877@end example
16867 16878
16868@noindent 16879@noindent
diff --git a/etc/NEWS b/etc/NEWS
index 3f9c47b33f3..1af924b49d1 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -691,7 +691,9 @@ See also related options `desktop-restore-reuses-frames',
691 691
692+++ 692+++
693** New Dired minor mode `dired-hide-details-mode' toggles whether details, 693** New Dired minor mode `dired-hide-details-mode' toggles whether details,
694such as file ownership or permissions, are visible. 694such as file ownership or permissions, are visible in Dired buffers.
695See the new options `dired-hide-details-hide-symlink-targets' and
696`dired-hide-details-hide-information-lines' for customizing what to hide.
695 697
696--- 698---
697** You can enable ElDoc inside the `eval-expression' minibuffer with: 699** You can enable ElDoc inside the `eval-expression' minibuffer with:
@@ -1304,6 +1306,15 @@ in the presence of files with negative time stamps.
1304** The cars of the elements in `interpreter-mode-alist' are now 1306** The cars of the elements in `interpreter-mode-alist' are now
1305treated as regexps rather than literal strings. 1307treated as regexps rather than literal strings.
1306 1308
1309---
1310** Overlay priority does not have to be nil or a non-negative integer.
1311Overlay priority can be other kinds of Lisp objects. We didn't yet
1312decide whether other types of values are stable enough, and therefore
1313don't feel it's right to document them. For now, don't assume in your
1314code that the values of overlay priority can only be either nil or an
1315integer, always test them with an appropriate predicate to be one or
1316the other.
1317
1307 1318
1308* Lisp Changes in Emacs 24.4 1319* Lisp Changes in Emacs 24.4
1309 1320
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 4d73c602def..623d81f4715 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,40 @@
12014-04-22 Michael Heerdegen <michael_heerdegen@web.de>
2
3 * dired.el (dired-insert-set-properties): Do not consider
4 subdirectory headings and empty lines to be information that
5 `dired-hide-details-mode' should hide. (Bug#17228)
6
72014-04-22 Michael Albinus <michael.albinus@gmx.de>
8
9 * net/tramp-sh.el (tramp-sh-handle-file-name-all-completions):
10 Remove test messages.
11 (tramp-do-copy-or-rename-file-out-of-band): Do not quote `source'
12 and `target' twice.
13
142014-04-22 Stefan Monnier <monnier@iro.umontreal.ca>
15
16 * dframe.el (dframe-get-focus): Remove `hook' argument (bug#17311).
17 * speedbar.el (speedbar-get-focus): Run the "hook" afterwards instead.
18
19 * emacs-lisp/cl-macs.el (cl--loop-let): Avoid `nil' as var name.
20
212014-04-22 Michael Albinus <michael.albinus@gmx.de>
22
23 * net/tramp-sh.el (tramp-sh-handle-file-name-all-completions):
24 Set "IFS=" when using read builtin, in order to preserve spaces in
25 the file name. Add test messages for hunting a bug on hydra.
26 (tramp-get-ls-command): Undo using "-b" argument. It doesn't help.
27
282014-04-22 Stefan Monnier <monnier@iro.umontreal.ca>
29
30 * progmodes/prog-mode.el (prettify-symbols--compose-symbol):
31 Don't prettify a word within a symbol.
32
332014-04-22 Michael Albinus <michael.albinus@gmx.de>
34
35 * net/tramp-sh.el (tramp-get-ls-command): Use "-b" argument if
36 possible.
37
12014-04-22 Stefan Monnier <monnier@iro.umontreal.ca> 382014-04-22 Stefan Monnier <monnier@iro.umontreal.ca>
2 39
3 * emacs-lisp/lisp-mode.el (lisp--match-hidden-arg): New function. 40 * emacs-lisp/lisp-mode.el (lisp--match-hidden-arg): New function.
diff --git a/lisp/ChangeLog.16 b/lisp/ChangeLog.16
index d3b3dd3a576..534f91f61ce 100644
--- a/lisp/ChangeLog.16
+++ b/lisp/ChangeLog.16
@@ -902,7 +902,7 @@
902 (tmm-prompt): Use it to fix the menu order. 902 (tmm-prompt): Use it to fix the menu order.
903 (tmm-get-keybind): Use current-active-maps. 903 (tmm-get-keybind): Use current-active-maps.
904 904
9052013-02-12 Christopher Schmidt <christopher@ch.ristopher.com> 9052013-02-13 Christopher Schmidt <christopher@ch.ristopher.com>
906 906
907 Add dired-hide-details-mode. (Bug#6799) 907 Add dired-hide-details-mode. (Bug#6799)
908 908
diff --git a/lisp/dframe.el b/lisp/dframe.el
index 872b922d783..90edacbf416 100644
--- a/lisp/dframe.el
+++ b/lisp/dframe.el
@@ -606,13 +606,12 @@ Argument E is the event deleting the frame."
606 606
607;;; Utilities 607;;; Utilities
608;; 608;;
609(defun dframe-get-focus (frame-var activator &optional hook) 609(defun dframe-get-focus (frame-var activator)
610 "Change frame focus to or from a dedicated frame. 610 "Change frame focus to or from a dedicated frame.
611If the selected frame is not in the symbol FRAME-VAR, then FRAME-VAR 611If the selected frame is not in the symbol FRAME-VAR, then FRAME-VAR
612frame is selected. If the FRAME-VAR is active, then select the 612frame is selected. If the FRAME-VAR is active, then select the
613attached frame. If FRAME-VAR is nil, ACTIVATOR is called to 613attached frame. If FRAME-VAR is nil, ACTIVATOR is called to
614created it. HOOK is an optional hook to run when 614created it."
615selecting FRAME-VAR."
616 (interactive) 615 (interactive)
617 (if (eq (selected-frame) (symbol-value frame-var)) 616 (if (eq (selected-frame) (symbol-value frame-var))
618 (if (frame-live-p dframe-attached-frame) 617 (if (frame-live-p dframe-attached-frame)
@@ -623,9 +622,7 @@ selecting FRAME-VAR."
623 ;; go there 622 ;; go there
624 (select-frame (symbol-value frame-var)) 623 (select-frame (symbol-value frame-var))
625 ) 624 )
626 (other-frame 0) 625 (other-frame 0))
627 ;; If updates are off, then refresh the frame (they want it now...)
628 (run-hooks hook))
629 626
630 627
631(defun dframe-close-frame () 628(defun dframe-close-frame ()
diff --git a/lisp/dired.el b/lisp/dired.el
index 90ced128e8c..fd897b9f7b5 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -1250,9 +1250,11 @@ see `dired-use-ls-dired' for more details.")
1250 (while (< (point) end) 1250 (while (< (point) end)
1251 (ignore-errors 1251 (ignore-errors
1252 (if (not (dired-move-to-filename)) 1252 (if (not (dired-move-to-filename))
1253 (put-text-property (line-beginning-position) 1253 (unless (or (looking-at-p "^$")
1254 (1+ (line-end-position)) 1254 (looking-at-p dired-subdir-regexp))
1255 'invisible 'dired-hide-details-information) 1255 (put-text-property (line-beginning-position)
1256 (1+ (line-end-position))
1257 'invisible 'dired-hide-details-information))
1256 (put-text-property (+ (line-beginning-position) 1) (1- (point)) 1258 (put-text-property (+ (line-beginning-position) 1) (1- (point))
1257 'invisible 'dired-hide-details-detail) 1259 'invisible 'dired-hide-details-detail)
1258 (add-text-properties 1260 (add-text-properties
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
index fe064b81e31..c9f5f68a4d3 100644
--- a/lisp/emacs-lisp/cl-macs.el
+++ b/lisp/emacs-lisp/cl-macs.el
@@ -1548,12 +1548,13 @@ If BODY is `setq', then use SPECS for assignments rather than for bindings."
1548 (if (and (cl--unused-var-p temp) (null expr)) 1548 (if (and (cl--unused-var-p temp) (null expr))
1549 nil ;; Don't bother declaring/setting `temp' since it won't 1549 nil ;; Don't bother declaring/setting `temp' since it won't
1550 ;; be used when `expr' is nil, anyway. 1550 ;; be used when `expr' is nil, anyway.
1551 (when (cl--unused-var-p temp) 1551 (when (or (null temp) (cl--unused-var-p temp))
1552 ;; Prefer a fresh uninterned symbol over "_to", to avoid 1552 ;; Prefer a fresh uninterned symbol over "_to", to avoid
1553 ;; warnings that we set an unused variable. 1553 ;; warnings that we set an unused variable.
1554 (setq temp (make-symbol "--cl-var--")) 1554 (setq temp (make-symbol "--cl-var--"))
1555 ;; Make sure this temp variable is locally declared. 1555 ;; Make sure this temp variable is locally declared.
1556 (push (list (list temp)) cl--loop-bindings)) 1556 (when (eq body 'setq)
1557 (push (list (list temp)) cl--loop-bindings)))
1557 (push (list temp expr) new)) 1558 (push (list temp expr) new))
1558 (while (consp spec) 1559 (while (consp spec)
1559 (push (list (pop spec) 1560 (push (list (pop spec)
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 3b600e3d84e..9c86c8c48bd 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -1734,7 +1734,7 @@ be non-negative integers."
1734 ;; wildcard. This will return "too many" entries 1734 ;; wildcard. This will return "too many" entries
1735 ;; but that isn't harmful. 1735 ;; but that isn't harmful.
1736 " || %s -a 2>/dev/null)" 1736 " || %s -a 2>/dev/null)"
1737 " | while read f; do" 1737 " | while IFS= read f; do"
1738 " if %s -d \"$f\" 2>/dev/null;" 1738 " if %s -d \"$f\" 2>/dev/null;"
1739 " then \\echo \"$f/\"; else \\echo \"$f\"; fi; done" 1739 " then \\echo \"$f/\"; else \\echo \"$f\"; fi; done"
1740 " && \\echo ok) || \\echo fail") 1740 " && \\echo ok) || \\echo fail")
@@ -2361,8 +2361,7 @@ The method used must be an out-of-band method."
2361 (append 2361 (append
2362 copy-args 2362 copy-args
2363 (list 2363 (list
2364 (shell-quote-argument source) 2364 source target
2365 (shell-quote-argument target)
2366 "&&" "echo" "tramp_exit_status" "0" 2365 "&&" "echo" "tramp_exit_status" "0"
2367 "||" "echo" "tramp_exit_status" "1")))))) 2366 "||" "echo" "tramp_exit_status" "1"))))))
2368 (tramp-message 2367 (tramp-message
diff --git a/lisp/org/ChangeLog b/lisp/org/ChangeLog
index 0995f903957..c1e3c9998d0 100644
--- a/lisp/org/ChangeLog
+++ b/lisp/org/ChangeLog
@@ -1,3 +1,529 @@
12014-04-22 Aaron Ecay <aaronecay@gmail.com>
2
3 * org-src.el (org-edit-src-exit): Place an undo boundary before
4 writing changes back to parent buffer.
5
62014-04-22 Achim Gratz <Stromeko@Stromeko.DE>
7
8 * ob-gnuplot.el (org-babel-gnuplot-process-vars):
9 `org-babel-gnuplot-table-to-data´ expects a table, so we need to
10 construct one when Babel hands us a vector.
11
12 * ob-ref.el (org-babel-ref-parse): If
13 `org-babel-current-src-block-location' is a marker, it can be from
14 another buffer, use marker-position instead in this case.
15
162014-04-22 Arun Persaud <apersaud@lbl.gov> (tiny change)
17
18 * org-src.el (org-edit-src-exit): Don't add indentation on empty
19 lines.
20
212014-04-22 Bastien Guerry <bzg@gnu.org>
22
23 * org.el (org-insert-heading): Fix behavior when point is at the
24 beginning of a heading or a list item. Enhance docstring.
25
26 * ox-html.el (org-html-infojs-install-script): Don't install
27 infojs scripts when #+INFOJS_OPT: is empty.
28
29 * org.el (org-mode): Fix the use of `org-*-element' functions for
30 C-M-a and C-M-e but fix C-M-e.
31
32 * org-agenda.el (org-agenda-search-view): Fix tag.
33
34 * org.el (org-check-before-invisible-edit): Don't just cycle, show
35 the subtree, as cycling may leave the current heading folded.
36 (org-contextualize-validate-key): Fix wrong test.
37
38 * org-bibtex.el (org-bibtex-headline): Don't throw an error when
39 trying to add a keyword field to a BibTeX entry that is not known
40 by BibTeX or defined by the user.
41 (org-bibtex, org-bibtex-no-export-tags): Fix docstrings.
42
43 * ox-latex.el (org-latex-src-block): Fix wrong propagation of
44 labels and captions when using the listings environment.
45
46 * org.el (org-sort-entries): Fix the number of blank lines to
47 keep for the last entry to sort.
48
49 * org-clock.el (org-clock-put-overlay): Fix display when
50 `org-indent-mode' is on.
51
52 * org.el (org-sort-entries): Allow to sort by clocking time.
53
54 * org-agenda.el (org-agenda-finalize): Apply all filters
55 correctly.
56
57 * org.el (org-update-dblock): Use `save-excursion' instead of
58 `save-window-excursion' so that blocks can edit other windows and
59 change the window layout.
60
61 * org-agenda.el (org-agenda-mode): Disable `indent-tabs-mode'.
62 (org-agenda-dim-blocked-tasks): Make overlays intangible.
63 (org-agenda-show-new-time): Fix bug when deleting a timestamp
64 right after changing it.
65 (org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item)
66 (org-agenda-get-sexps, org-agenda-filter-by-regexp)
67 (org-agenda-filter-top-headline-apply): Fix indentation.
68
69 * org.el (org-cycle): Try `org-try-cdlatex-tab' before trying
70 to edit/move as in a table.
71
72 * org-agenda.el (org-agenda-show-new-time): Don't use
73 `move-beginning-of-line' as it is slower and not needed.
74
75 * org-compat.el (org-move-to-column): Temporarily set
76 `buffer-invisibility-spec' more accurately.
77
78 * ox-latex.el (org-latex-text-markup-alist): Use \ul{...} for
79 underlining instead of \uline{...} as requiring the hyperref
80 package makes \uline{...} unusable on headline.
81
82 * org.el (org-latex-default-packages-alist): Add the "soul"
83 package.
84
85 * org.el (org-refresh-properties): Don't add the property to
86 the whole subtree, only to the part between the beginning of
87 the headline and the end of the "content", before any other
88 headline. This fix a bug about properties displayed as
89 inherited in the agenda, where Org properties are checked
90 against text properties.
91
92 * ox-latex.el (org-latex--text-markup): Replace newlines by
93 whitespaces in \verb constructs.
94
95 * org-agenda.el (org-agenda-filter-hide-line): Hide from the
96 beginning of the line to the beginning of the next line.
97 (org-agenda-show-new-time): Use `move-beginning-of-line' and
98 `move-end-of-line'.
99 (org-agenda-drag-line-forward): Adapt to the new definition of
100 hidden filtered lines.
101
102 * org-compat.el (org-move-to-column): Always ignore invisible
103 text in agenda buffer, and when there is both a bracket link
104 and '(org-link) as a member of `buffer-invisibility-spec'.
105 Add a docstring.
106
107 * org.el (org-align-tags-here): Add docstring and remove useless
108 arguments when calling `org-move-to-column'.
109
110 * org-table.el (org-table-copy-down)
111 (org-table-find-dataline, org-table-move-row)
112 (org-table-insert-hline, org-table-kill-row):
113 * org-agenda.el (org-agenda-next-item)
114 (org-agenda-previous-item, org-agenda-todo)
115 (org-agenda-priority, org-agenda-show-new-time)
116 (org-agenda-clock-in, org-agenda-clock-out): Remove useless
117 arguments when calling `org-move-to-column'.
118
119 * org.el (org-refile): Fix calling with a numeric prefix argument
120 of 3 to refile and keep.
121
122 * org-clock.el (org-clock-get-table-data): When :link is `t' in
123 the clocktable parameters, bracket links in the clocktable should
124 only contain their description, other C-c C-o will try to open the
125 bracket link at point instead of the headline.
126
127 * org-agenda.el (org-agenda-todo): Always restore the window state
128 after `org-agenda-change-all-lines' has been called.
129 (org-agenda-open-link): Don't throw an error when trying to open a
130 link when the point is on a place that is not associated with a
131 buffer.
132
133 * ox-latex.el (org-latex-link): Escape `%' characters.
134
135 * org.el (org-entry-get-with-inheritance): Remove wrong quote.
136 (org-entry-get): Only try to combine file properties with local
137 properties when the property drawer contains such local property,
138 not when the property drawer exists.
139
140 * ox-latex.el (org-latex-link):
141 * ox-html.el (org-html-link):
142 * ox-beamer.el (org-beamer-link): Fix links to radio targets.
143
144 * ox-ascii.el (org-ascii-link): For links to a radio target, use
145 the link, not the target.
146
147 * org.el (org-do-emphasis-faces): Explicitly prevent nested
148 emphasis.
149 (org-insert-heading): Don't remove whitespaces following an empty
150 headline.
151
152 * org-timer.el (org-timer-stop): Set `org-timer-current-timer' to
153 nil.
154
155 * org.el (org-store-link): Ensure desc is not nil before matching
156 a regexp against it. Fall back on an empty string when no
157 description is available.
158
159 * org-agenda.el (org-agenda-list-stuck-projects): Bugfix: set
160 `org-agenda-buffer-name'.
161
162 * org-capture.el (org-capture-finalize): Ensure to widen the
163 buffer when the target buffer is not initially narrowed.
164
165 * org-compat.el (org-move-to-column): Fix bug about ignoring
166 bracket links visibility status in tables with S-RET.
167
168 * org-src.el (org-edit-src-find-region-and-lang): Check if we are
169 in a table.el table last.
170
171 * org.el (org-delete-property): Don't suggest to delete the
172 CATEGORY property when the category is not explicitely set in the
173 property drawer. Also enforce matching when completing.
174 (org-insert-heading): Fix regression: with two universal prefixes,
175 insert heading at the end of the subtree.
176 (org-insert-todo-heading): Bugfix: only enforce the first TODO
177 state when arg is '(4).
178
179 * org-agenda.el (org-agenda-skip-subtree-if): Fix docstring.
180
181 * org.el (org-contextualize-validate-key): Fix bug: perform the
182 check even when (buffer-file-name) returns `nil'.
183
184 * org-colview.el (org-columns-display-here): Let-bind `fm'.
185
186 * org.el (org-emphasis-alist): Use `org-verbatim' for =text=
187 and `org-code' for ~text~.
188 (org-open-link-marker): Fix typo in docstring.
189
190 * org-colview.el (org-columns-display-here): Fix the column
191 view for numbers with a format specifier (e.g. {+; %5.1f}).
192
193 * org-src.el (org-edit-src-code): Throw a warning instead of
194 an error when loading the mode fails, otherwise the user is
195 left with unusable buffers.
196
197 * org-table.el (org-table-copy-down)
198 (org-table-find-dataline, org-table-move-row)
199 (org-table-insert-hline, org-table-kill-row): Use
200 `org-move-to-column' with the IGNORE-INVISIBLE arg set to `t', so
201 that abbreviated rows don't interfer with setting the cursor back
202 at the correct position.
203
204 * org.el (org-agenda-prepare-buffers): Use `save-excursion'
205 instead of `save-window-excursion'.
206 (org-file-contents): Return an empty string instead of the
207 message.
208 (org-open-at-point): Fix bug when opening a plain link followed by
209 a bracket link.
210 (org-ctrl-c-ctrl-c): Fix behavior when hitting C-c C-c on LaTeX
211 formulas in tables.
212 (org-refile--get-location): New internal function using a wider
213 set of possible refile locations.
214 (org-refile-get-location): Use it.
215 (org-refile): Fix bug when refiling the last subtree of the
216 buffer: don't leave out the last character.
217 (org-sort-entries): Restore the point location when there is
218 nothing to sort.
219
220 * org-table.el (org-table-field-info): Throw a user error when not
221 at a table.
222
223 * org-agenda.el (org-agenda-drag-line-forward): Call
224 `org-agenda-mark-clocking-task' when done.
225 (org-agenda-mark-clocking-task): Small refactoring.
226
227 * org-compat.el (org-set-transient-map): Alias pointing at
228 `set-transient-map' if defined, at `set-temporary-overlay-map'
229 otherwise.
230
231 * org-agenda.el (org-agenda-next-item)
232 (org-agenda-previous-item, org-agenda-toggle-archive-tag)
233 (org-agenda-todo, org-agenda-priority, org-agenda-clock-in)
234 (org-agenda-clock-out): Put the cursor back on the correct
235 column, when possible.
236 (org-agenda-todo): When `org-clock-out-when-done' is `t', also
237 remove the current clock overlay.
238
239 * org.el (org-format-latex-options): Fix docstring.
240
241 * ox.el (org-export--get-subtree-options): When using the headline
242 as a title for a subtree export, only take the true heading, no
243 TODO keyword, no priority cookie, no tag.
244
245 * org.el (customize-package-emacs-version-alist): Fix Org version
246 for Emacs 24.4.
247
248 * org.el (org-demote): Ignore invisible text when aligning tags.
249 (org-set-tags): When JUST-ALIGN is 'ignore-column, ignore
250 invisible text when restoring the cursor to the correct column.
251
252 * ob-python.el (org-babel-python-var-to-python): Bugfix: Strip
253 properties before formatting the results.
254
255 * org-agenda.el (org-agenda-regexp-filter-preset): Fix typo in
256 docstring.
257 (org-agenda-reapply-filters): New function.
258 (org-agenda-drag-line-forward): Rewrite to fix a bug when used
259 in filtered agendas.
260 (org-agenda-drag-line-backward): Rewrite using
261 `org-agenda-drag-line-forward'.
262
263 * ob-table.el (org-sbe): Rename from `sbe'.
264
265 * org.el (org-store-link): When a link has been stored, always
266 returns it.
267
268 * ob-python.el (org-babel-python-var-to-python): Fix code typo.
269
270 * org-entities.el (org-entities-help): Prevent the display of
271 pretty entities, as this help buffer is meant to list literal
272 strings, not utf-8 representations.
273
2742014-04-22 Benjamin Drieu <bdrieu@april.org>
275
276 * org.el (org-store-link): Fix selection of the function to store
277 the link.
278
2792014-04-22 Ilya Shlyakhter <ilya_shl@alum.mit.edu>
280
281 * org.el (org-entry-get-with-inheritance): Temporarily let-bind
282 `org-file-properties', `org-global-properties' and
283 `org-global-properties-fixed' to nil before calling
284 `org-entry-get' on entries up the hierarchy from the queried
285 entry.
286
2872014-04-22 Justin Gordon <justin.gordon@gmail.com>
288
289 * ox-md (org-md-separate-elements): Fix blank line insertion
290 between elements.
291
292 * ox-md.el (org-md-inner-template): New function.
293
2942014-04-22 Leonard Randall <leonard.a.randall@gmail.com> (tiny change)
295
296 * org-bibtex.el (org-bibtex-headline): Fix insertion of keywords
297 of unknown BibTeX entries.
298
2992014-04-22 Markus Hauck <markus1189@gmail.com> (tiny change)
300
301 * org-agenda.el (org-agenda-get-scheduled): If
302 `org-agenda-skip-scheduled-if-deadline-is-shown' is set to
303 'repeated-after-deadline, still show tasks without any deadline
304
3052014-04-22 Michael Brand <michael.ch.brand@gmail.com>
306
307 * org-table.el (org-table-fix-formulas): Handle multiple #+TBLFM
308 lines with `forward-line'.
309
3102014-04-22 Michael Weylandt <michael.weylandt@gmail.com> (tiny change)
311
312 * ox-latex.el (org-latex-export-to-latex): Downcase the language
313 name when using minted highlighting for src block exports.
314
3152014-04-22 Nick Dokos <ndokos@gmail.com>
316
317 * org-mobile.el (org-mobile-create-index-file): delete :grouptags
318 entries from tags list when creating the org-mobile index file.
319
3202014-04-22 Nicolas Goaziou <n.goaziou@gmail.com>
321
322 * ox.el (org-export-copy-to-kill-ring): Comply to docstrings
323 standards.
324
325 * org.el (org-sparse-tree): Fix code typo. Small refactoring.
326
327 * ox-latex.el (org-latex-link):
328 * ox-html.el (org-html-link): Do not expand absolute file names
329 and do not try to fix hierarchy part, as it is already taken care of
330 at the parser level.
331
332 * ox-md.el (org-md-link): Ditto. Also fix absolute file names.
333
334 * ox-odt.el (org-odt-link):
335 * ox-man.el (org-man-link):
336 * ox-texinfo.el (org-texinfo-link):
337 * org-element.el (org-element-link-parser): Fix ill-defined "file"
338 type links. Expand absolute file names in the process.
339
340 * org.el (org-make-link-regexps): Use `regexp-opt' instead of
341 `mapconcat' and `regexp-quote'.
342
343 * ox-html.el (org-html-link):
344 * ox-latex.el (org-latex-link):
345 * ox-man.el (org-man-link):
346 * ox-odt.el (org-odt-link):
347 * ox-html.el (org-html-link):
348 * ox-latex.el (org-latex-link):
349 * ox-man.el (org-man-link):
350 * ox-odt.el (org-odt-link):
351 * ox-texinfo.el (org-texinfo-link): Append "//" after some link
352 types.
353
354 * ox-md.el (org-md-link):
355 * org.el (org-make-link-regexps): Allow optional double slashes
356 after type. Small refactoring.
357
358 * org-element.el (org-element-headline-parser): Tiny refactoring.
359
360 * org-element.el (org-element-headline-parser): Correctly parse
361 blank lines after a headline.
362
363 * org-element.el (org-element-table-cell-parser)
364 (org-element-table-cell-successor): Recognize cell even when last
365 vertical bar is missing.
366
367 * ox-md.el (org-md-example-block): handle switches and references
368 in source blocks.
369
370 * org.el (org-latex-packages-alist)
371 (org-latex-default-packages-alist): Update docstrings.
372
373 * ox-ascii.el (org-ascii--unique-links): Ignore white spaces when
374 uniquifying links in section.
375
376 * ox-odt.el (org-odt-template): Ignore blank titles.
377
378 * ox-publish.el (org-publish-find-title): Fix (invalid-read-syntax
379 "#").
380
381 * ox-ascii.el (org-ascii-link):
382 * ox-beamer.el (org-beamer-link):
383 * ox-html.el (org-html-link):
384 * ox-latex.el (org-latex-link):
385 * ox-md.el (org-md-link):
386 * ox-odt.el (org-odt-link): Update radio target export according
387 to recent changes.
388
389 * org-element.el (org-element-all-successors)
390 (org-element-object-restrictions): Prioritize `link' over other
391 successors in order to find radio links starting with another
392 syntax object (e.g., an entity). Also allow text markup within
393 radio targets.
394 (org-element-link-parser): Add contents to radio targets.
395
396 * org.el (org-make-target-link-regexp): Fix regexp so it can match
397 targets starting with an Org object (e.g., an entity).
398 (org-ctrl-c-ctrl-c): Fix function when applied on an object contained
399 within a radio target.
400
401 * org.el (org-mode): Change "\" and "~" characters syntax from
402 `punctuation' to `symbol' so they are on par with other characters
403 used in Org syntax (e.g., "/", "*"...).
404
405 * ox-beamer.el (org-beamer-publish-to-pdf):
406 * ox-latex.el (org-latex-publish-to-pdf): Ensure ".tex" file is
407 generated in the same directory as the ".org" file.
408
409 * ox-latex.el (org-latex-headline): Hard-code "\underline" in
410 sections because "\uline" ("ulem" package) returns an error and
411 "\ul" ("soul" package) doesn't support chinese characters.
412
413 * ox-ascii.el (org-ascii-link): Correctly handle case mismatch
414 between radio targets and radio links.
415
416 * org-element.el (org-element-link-parser): "radio" links have
417 their path downcased to avoid introducing case mismatch with their
418 relative radio target. With this change it is also necessary to
419 add contents to them, since `:path' property no longer matches
420 real value of the link.
421 (org-element-radio-target-parser): Downcase value as explained
422 above. Store the initial value in a new `:raw-value' property.
423
424 * org-element.el (org-element-context): Fix parsing of bold
425 objects at the beginning of a headline.
426
427 * org-element.el (org-element-context): Fix timestamps parsing.
428
429 * ox-beamer.el (org-beamer-item): Insert the export snippet right
430 after the first \item, not all of them.
431
432 * org-element.el (org-element--list-struct): Fix regexp.
433
434 * org-element.el (org-element-inlinetask-parser): Fix parsing when
435 regular and degenerate inlinetasks are mixed in the section.
436
437 * ox-md.el (org-md-link): Generate md links to other Org files
438 instead of html links. Do not confuse caption and alt-text.
439 Provide "img" as default alt-text.
440
441 * org-element.el (org-element-normalize-contents): Do not ignore
442 empty lines when an object follows.
443 (org-element-interpret-data): Do not remove properties by
444 side-effect when interpreting a string, as it also removes them
445 from the parse tree, making the string unusable without its
446 :parent property.
447
448 * ob-exp.el (org-babel-exp-process-buffer): Also check
449 `org-src-preserve-indentation' to know when to preserve indentation.
450 (org-babel-exp-code-template): Include switches in template.
451 (org-babel-exp-code): Provide %switches placeholder.
452
453 * ox-latex.el (org-latex-plain-list): Do not automatically
454 enclose value for :options attribute within square brackets.
455 Instead, append them verbatim next to the block name, as special
456 blocks do.
457
458 * ob-exp.el (org-babel-exp-code): Fix export of src blocks with
459 flags.
460 (org-babel-exp-process-buffer): Make processing more robust when
461 results are inserted before source block or when source block is
462 followed by multiple blank lines.
463
464 * ox.el (org-export-insert-default-template): Only insert
465 keywords and options relatives to the selected back-end. Ignore
466 those relatives to its parent in the case of a derived back-end.
467
468 * ox-beamer.el: Remove unnecessary package definitions in default
469 class.
470
471 * ox-latex.el (org-latex-headline, org-latex-item): Fix items
472 starting with a square bracket.
473
474 * org.el (org-mode-restart): Fix turning off `org-indent-mode'
475 when necessary.
476 (org-get-previous-line-level): Do not call `org-current-level'
477 twice unless necessary. Also, avoid using `line-number-at-pos'
478 when the information needed is to know if point is in the first
479 line of the visible part of the buffer.
480
481 * ob-core.el (org-babel-get-inline-src-block-matches): Do not
482 compute line number if all is needed is to know if we're on the
483 first one.
484
485 * ox-md.el (org-md-item): Do not return an error when exporting
486 an empty item.
487
488 * ox-beamer.el (org-beamer-select-environment): Function doesn't
489 work if fast tag selection is disabled, so make sure it is always
490 on, independently on user's configuration.
491
4922014-04-22 Nikolai Weibull <now@disu.se> (tiny change)
493
494 * org.el (org-mode): Add guard around set-face-foreground.
495
4962014-04-22 Rasmus <w530@pank.eu>
497
498 * ox-html.el (org-html-html5-elements): Drop reference to hgroup.
499
5002014-04-22 Rick Frankel <rick@rickster.com>
501
502 * ox-html.el (org-html-link): Unescape org-escaped links an
503 re-escape for html (browser).
504
5052014-04-22 Sacha Chua <sacha@sachachua.com>
506
507 * org.el (org-refresh-properties): Don't throw an error when
508 reaching the end of the buffer.
509
5102014-04-22 Stefan-W. Hahn <stefan.hahn@s-hahn.de> (tiny change)
511
512 * org-bibtex.el (org-bibtex-read): Check string length before
513 using aref.
514
5152014-04-22 Yasushi SHOJI <yashi@atmark-techno.com>
516
517 * ox-ascii.el (org-ascii--current-text-width): Convert `length'
518 to `string-width'.
519 (org-ascii--build-title, org-ascii--build-toc)
520 (org-ascii--list-listings, org-ascii--list-tables)
521 (org-ascii-template--document-title)
522 (org-ascii-inner-template, org-ascii-format-inlinetask-default)
523 (org-ascii-format-inlinetask-default, org-ascii-item
524 (org-ascii--table-cell-width, org-ascii-table-cell)
525 (org-ascii--current-text-width): Likewise.
526
12014-02-25 Glenn Morris <rgm@gnu.org> 5272014-02-25 Glenn Morris <rgm@gnu.org>
2 528
3 * org-version.el (org-odt-data-dir): 529 * org-version.el (org-odt-data-dir):
diff --git a/lisp/org/ob-core.el b/lisp/org/ob-core.el
index f06cdaf7972..e8943c66561 100644
--- a/lisp/org/ob-core.el
+++ b/lisp/org/ob-core.el
@@ -217,7 +217,7 @@ Returns non-nil if match-data set"
217 (let ((src-at-0-p (save-excursion 217 (let ((src-at-0-p (save-excursion
218 (beginning-of-line 1) 218 (beginning-of-line 1)
219 (string= "src" (thing-at-point 'word)))) 219 (string= "src" (thing-at-point 'word))))
220 (first-line-p (= 1 (line-number-at-pos))) 220 (first-line-p (= (line-beginning-position) (point-min)))
221 (orig (point))) 221 (orig (point)))
222 (let ((search-for (cond ((and src-at-0-p first-line-p "src_")) 222 (let ((search-for (cond ((and src-at-0-p first-line-p "src_"))
223 (first-line-p "[[:punct:] \t]src_") 223 (first-line-p "[[:punct:] \t]src_")
diff --git a/lisp/org/ob-exp.el b/lisp/org/ob-exp.el
index 74581421591..6d65496dbd4 100644
--- a/lisp/org/ob-exp.el
+++ b/lisp/org/ob-exp.el
@@ -169,8 +169,12 @@ this template."
169 (backward-char) 169 (backward-char)
170 (save-match-data (org-element-context)))) 170 (save-match-data (org-element-context))))
171 (type (org-element-type element)) 171 (type (org-element-type element))
172 (beg-el (org-element-property :begin element)) 172 (begin (copy-marker (org-element-property :begin element)))
173 (end-el (org-element-property :end element))) 173 (end (copy-marker
174 (save-excursion
175 (goto-char (org-element-property :end element))
176 (skip-chars-backward " \r\t\n")
177 (point)))))
174 (case type 178 (case type
175 (inline-src-block 179 (inline-src-block
176 (let* ((info (org-babel-parse-inline-src-block-match)) 180 (let* ((info (org-babel-parse-inline-src-block-match))
@@ -181,24 +185,21 @@ this template."
181 (org-babel-expand-noweb-references 185 (org-babel-expand-noweb-references
182 info (org-babel-exp-get-export-buffer)) 186 info (org-babel-exp-get-export-buffer))
183 (nth 1 info))) 187 (nth 1 info)))
184 (goto-char beg-el) 188 (goto-char begin)
185 (let ((replacement (org-babel-exp-do-export info 'inline))) 189 (let ((replacement (org-babel-exp-do-export info 'inline)))
186 (if (equal replacement "") 190 (if (equal replacement "")
187 ;; Replacement code is empty: remove inline src 191 ;; Replacement code is empty: remove inline src
188 ;; block, including extra white space that 192 ;; block, including extra white space that
189 ;; might have been created when inserting 193 ;; might have been created when inserting
190 ;; results. 194 ;; results.
191 (delete-region beg-el 195 (delete-region begin
192 (progn (goto-char end-el) 196 (progn (goto-char end)
193 (skip-chars-forward " \t") 197 (skip-chars-forward " \t")
194 (point))) 198 (point)))
195 ;; Otherwise: remove inline src block but 199 ;; Otherwise: remove inline src block but
196 ;; preserve following white spaces. Then insert 200 ;; preserve following white spaces. Then insert
197 ;; value. 201 ;; value.
198 (delete-region beg-el 202 (delete-region begin end)
199 (progn (goto-char end-el)
200 (skip-chars-backward " \t")
201 (point)))
202 (insert replacement))))) 203 (insert replacement)))))
203 ((babel-call inline-babel-call) 204 ((babel-call inline-babel-call)
204 (let* ((lob-info (org-babel-lob-get-info)) 205 (let* ((lob-info (org-babel-lob-get-info))
@@ -229,8 +230,8 @@ this template."
229 ;; results. 230 ;; results.
230 (if (equal rep "") 231 (if (equal rep "")
231 (delete-region 232 (delete-region
232 beg-el 233 begin
233 (progn (goto-char end-el) 234 (progn (goto-char end)
234 (if (not (eq type 'babel-call)) 235 (if (not (eq type 'babel-call))
235 (progn (skip-chars-forward " \t") (point)) 236 (progn (skip-chars-forward " \t") (point))
236 (skip-chars-forward " \r\t\n") 237 (skip-chars-forward " \r\t\n")
@@ -238,25 +239,17 @@ this template."
238 ;; Otherwise, preserve following white 239 ;; Otherwise, preserve following white
239 ;; spaces/newlines and then, insert replacement 240 ;; spaces/newlines and then, insert replacement
240 ;; string. 241 ;; string.
241 (goto-char beg-el) 242 (goto-char begin)
242 (delete-region beg-el 243 (delete-region begin end)
243 (progn (goto-char end-el)
244 (skip-chars-backward " \r\t\n")
245 (point)))
246 (insert rep)))) 244 (insert rep))))
247 (src-block 245 (src-block
248 (let* ((match-start (match-beginning 0)) 246 (let* ((match-start (copy-marker (match-beginning 0)))
249 ;; Make sure we don't remove any blank lines
250 ;; after the block when replacing it.
251 (block-end (save-excursion
252 (goto-char end-el)
253 (skip-chars-backward " \r\t\n")
254 (line-end-position)))
255 (ind (org-get-indentation)) 247 (ind (org-get-indentation))
256 (headers 248 (headers
257 (cons 249 (cons
258 (org-element-property :language element) 250 (org-element-property :language element)
259 (let ((params (org-element-property :parameters element))) 251 (let ((params (org-element-property :parameters
252 element)))
260 (and params (org-split-string params "[ \t]+")))))) 253 (and params (org-split-string params "[ \t]+"))))))
261 ;; Take care of matched block: compute replacement 254 ;; Take care of matched block: compute replacement
262 ;; string. In particular, a nil REPLACEMENT means 255 ;; string. In particular, a nil REPLACEMENT means
@@ -264,21 +257,31 @@ this template."
264 ;; string should remove the block. 257 ;; string should remove the block.
265 (let ((replacement (progn (goto-char match-start) 258 (let ((replacement (progn (goto-char match-start)
266 (org-babel-exp-src-block headers)))) 259 (org-babel-exp-src-block headers))))
267 (cond ((not replacement) (goto-char block-end)) 260 (cond ((not replacement) (goto-char end))
268 ((equal replacement "") 261 ((equal replacement "")
269 (delete-region beg-el end-el)) 262 (goto-char end)
263 (skip-chars-forward " \r\t\n")
264 (beginning-of-line)
265 (delete-region begin (point)))
270 (t 266 (t
271 (goto-char match-start) 267 (goto-char match-start)
272 (delete-region (point) block-end) 268 (delete-region (point)
269 (save-excursion (goto-char end)
270 (line-end-position)))
273 (insert replacement) 271 (insert replacement)
274 (if (org-element-property :preserve-indent element) 272 (if (or org-src-preserve-indentation
273 (org-element-property :preserve-indent
274 element))
275 ;; Indent only the code block markers. 275 ;; Indent only the code block markers.
276 (save-excursion (skip-chars-backward " \r\t\n") 276 (save-excursion (skip-chars-backward " \r\t\n")
277 (indent-line-to ind) 277 (indent-line-to ind)
278 (goto-char match-start) 278 (goto-char match-start)
279 (indent-line-to ind)) 279 (indent-line-to ind))
280 ;; Indent everything. 280 ;; Indent everything.
281 (indent-rigidly match-start (point) ind)))))))))))))) 281 (indent-rigidly match-start (point) ind)))))
282 (set-marker match-start nil))))
283 (set-marker begin nil)
284 (set-marker end nil)))))))
282 285
283(defun org-babel-in-example-or-verbatim () 286(defun org-babel-in-example-or-verbatim ()
284 "Return true if point is in example or verbatim code. 287 "Return true if point is in example or verbatim code.
@@ -308,7 +311,7 @@ The function respects the value of the :exports header argument."
308 (org-babel-exp-code info))))) 311 (org-babel-exp-code info)))))
309 312
310(defcustom org-babel-exp-code-template 313(defcustom org-babel-exp-code-template
311 "#+BEGIN_SRC %lang%flags\n%body\n#+END_SRC" 314 "#+BEGIN_SRC %lang%switches%flags\n%body\n#+END_SRC"
312 "Template used to export the body of code blocks. 315 "Template used to export the body of code blocks.
313This template may be customized to include additional information 316This template may be customized to include additional information
314such as the code block name, or the values of particular header 317such as the code block name, or the values of particular header
@@ -318,6 +321,7 @@ and the following %keys may be used.
318 lang ------ the language of the code block 321 lang ------ the language of the code block
319 name ------ the name of the code block 322 name ------ the name of the code block
320 body ------ the body of the code block 323 body ------ the body of the code block
324 switches -- the switches associated to the code block
321 flags ----- the flags passed to the code block 325 flags ----- the flags passed to the code block
322 326
323In addition to the keys mentioned above, every header argument 327In addition to the keys mentioned above, every header argument
@@ -340,11 +344,14 @@ replaced with its value."
340 org-babel-exp-code-template 344 org-babel-exp-code-template
341 `(("lang" . ,(nth 0 info)) 345 `(("lang" . ,(nth 0 info))
342 ("body" . ,(org-escape-code-in-string (nth 1 info))) 346 ("body" . ,(org-escape-code-in-string (nth 1 info)))
347 ("switches" . ,(let ((f (nth 3 info)))
348 (and (org-string-nw-p f) (concat " " f))))
349 ("flags" . ,(let ((f (assq :flags (nth 2 info))))
350 (and f (concat " " (cdr f)))))
343 ,@(mapcar (lambda (pair) 351 ,@(mapcar (lambda (pair)
344 (cons (substring (symbol-name (car pair)) 1) 352 (cons (substring (symbol-name (car pair)) 1)
345 (format "%S" (cdr pair)))) 353 (format "%S" (cdr pair))))
346 (nth 2 info)) 354 (nth 2 info))
347 ("flags" . ,(let ((f (nth 3 info))) (when f (concat " " f))))
348 ("name" . ,(or (nth 4 info) ""))))) 355 ("name" . ,(or (nth 4 info) "")))))
349 356
350(defun org-babel-exp-results (info type &optional silent hash) 357(defun org-babel-exp-results (info type &optional silent hash)
diff --git a/lisp/org/ob-gnuplot.el b/lisp/org/ob-gnuplot.el
index 8767e88e4c3..ffe5dcf59df 100644
--- a/lisp/org/ob-gnuplot.el
+++ b/lisp/org/ob-gnuplot.el
@@ -85,10 +85,15 @@ code."
85 (lambda (pair) 85 (lambda (pair)
86 (cons 86 (cons
87 (car pair) ;; variable name 87 (car pair) ;; variable name
88 (if (listp (cdr pair)) ;; variable value 88 (let* ((val (cdr pair)) ;; variable value
89 (org-babel-gnuplot-table-to-data 89 (lp (listp val)))
90 (cdr pair) (org-babel-temp-file "gnuplot-") params) 90 (if lp
91 (cdr pair)))) 91 (org-babel-gnuplot-table-to-data
92 (let* ((first (car val))
93 (tablep (or (listp first) (symbolp first))))
94 (if tablep val (mapcar 'list val)))
95 (org-babel-temp-file "gnuplot-") params)
96 val))))
92 (mapcar #'cdr (org-babel-get-header params :var))))) 97 (mapcar #'cdr (org-babel-get-header params :var)))))
93 98
94(defun org-babel-expand-body:gnuplot (body params) 99(defun org-babel-expand-body:gnuplot (body params)
diff --git a/lisp/org/ob-python.el b/lisp/org/ob-python.el
index 145768272a6..baa5764ac42 100644
--- a/lisp/org/ob-python.el
+++ b/lisp/org/ob-python.el
@@ -137,7 +137,7 @@ specifying a variable of the same value."
137 org-babel-python-hline-to 137 org-babel-python-hline-to
138 (format 138 (format
139 (if (and (stringp var) (string-match "[\n\r]" var)) "\"\"%S\"\"" "%S") 139 (if (and (stringp var) (string-match "[\n\r]" var)) "\"\"%S\"\"" "%S")
140 var)))) 140 (if (stringp var) (substring-no-properties var) var)))))
141 141
142(defun org-babel-python-table-or-string (results) 142(defun org-babel-python-table-or-string (results)
143 "Convert RESULTS into an appropriate elisp value. 143 "Convert RESULTS into an appropriate elisp value.
diff --git a/lisp/org/ob-ref.el b/lisp/org/ob-ref.el
index ece99c559a2..152af86a8ef 100644
--- a/lisp/org/ob-ref.el
+++ b/lisp/org/ob-ref.el
@@ -85,7 +85,9 @@ the variable."
85 (cons (intern var) 85 (cons (intern var)
86 (let ((out (save-excursion 86 (let ((out (save-excursion
87 (when org-babel-current-src-block-location 87 (when org-babel-current-src-block-location
88 (goto-char org-babel-current-src-block-location)) 88 (goto-char (if (markerp org-babel-current-src-block-location)
89 (marker-position org-babel-current-src-block-location)
90 org-babel-current-src-block-location)))
89 (org-babel-read ref)))) 91 (org-babel-read ref))))
90 (if (equal out ref) 92 (if (equal out ref)
91 (if (string-match "^\".*\"$" ref) 93 (if (string-match "^\".*\"$" ref)
diff --git a/lisp/org/ob-table.el b/lisp/org/ob-table.el
index f7c5526d438..831e3521f83 100644
--- a/lisp/org/ob-table.el
+++ b/lisp/org/ob-table.el
@@ -24,7 +24,7 @@
24;;; Commentary: 24;;; Commentary:
25 25
26;; Should allow calling functions from org-mode tables using the 26;; Should allow calling functions from org-mode tables using the
27;; function `sbe' as so... 27;; function `org-sbe' as so...
28 28
29;; #+begin_src emacs-lisp :results silent 29;; #+begin_src emacs-lisp :results silent
30;; (defun fibbd (n) (if (< n 2) 1 (+ (fibbd (- n 1)) (fibbd (- n 2))))) 30;; (defun fibbd (n) (if (< n 2) 1 (+ (fibbd (- n 1)) (fibbd (- n 2)))))
@@ -47,7 +47,7 @@
47;; | 7 | | 47;; | 7 | |
48;; | 8 | | 48;; | 8 | |
49;; | 9 | | 49;; | 9 | |
50;; #+TBLFM: $2='(sbe 'fibbd (n $1)) 50;; #+TBLFM: $2='(org-sbe 'fibbd (n $1))
51 51
52;;; Code: 52;;; Code:
53(require 'ob-core) 53(require 'ob-core)
@@ -60,14 +60,14 @@ character and replace it with ellipses."
60 (concat (substring string 0 (match-beginning 0)) 60 (concat (substring string 0 (match-beginning 0))
61 (if (match-string 1 string) "...")) string)) 61 (if (match-string 1 string) "...")) string))
62 62
63(defmacro sbe (source-block &rest variables) ;FIXME: Namespace prefix! 63(defmacro org-sbe (source-block &rest variables)
64 "Return the results of calling SOURCE-BLOCK with VARIABLES. 64 "Return the results of calling SOURCE-BLOCK with VARIABLES.
65Each element of VARIABLES should be a two 65Each element of VARIABLES should be a two
66element list, whose first element is the name of the variable and 66element list, whose first element is the name of the variable and
67second element is a string of its value. The following call to 67second element is a string of its value. The following call to
68`sbe' would be equivalent to the following source code block. 68`org-sbe' would be equivalent to the following source code block.
69 69
70 (sbe 'source-block (n $2) (m 3)) 70 (org-sbe 'source-block (n $2) (m 3))
71 71
72#+begin_src emacs-lisp :var results=source-block(n=val_at_col_2, m=3) :results silent 72#+begin_src emacs-lisp :var results=source-block(n=val_at_col_2, m=3) :results silent
73results 73results
@@ -84,7 +84,7 @@ the header argument which can then be passed before all variables
84as shown in the example below. 84as shown in the example below.
85 85
86| 1 | 2 | :file nothing.png | nothing.png | 86| 1 | 2 | :file nothing.png | nothing.png |
87#+TBLFM: @1$4='(sbe test-sbe $3 (x $1) (y $2))" 87#+TBLFM: @1$4='(org-sbe test-sbe $3 (x $1) (y $2))"
88 (declare (debug (form form))) 88 (declare (debug (form form)))
89 (let* ((header-args (if (stringp (car variables)) (car variables) "")) 89 (let* ((header-args (if (stringp (car variables)) (car variables) ""))
90 (variables (if (stringp (car variables)) (cdr variables) variables))) 90 (variables (if (stringp (car variables)) (cdr variables) variables)))
diff --git a/lisp/org/org-agenda.el b/lisp/org/org-agenda.el
index ccf08a2c97b..18fada15de8 100644
--- a/lisp/org/org-agenda.el
+++ b/lisp/org/org-agenda.el
@@ -649,8 +649,8 @@ of custom agenda commands."
649 :tag "Org Agenda Match View" 649 :tag "Org Agenda Match View"
650 :group 'org-agenda) 650 :group 'org-agenda)
651(defgroup org-agenda-search-view nil 651(defgroup org-agenda-search-view nil
652 "Options concerning the general tags/property/todo match agenda view." 652 "Options concerning the search agenda view."
653 :tag "Org Agenda Match View" 653 :tag "Org Agenda Search View"
654 :group 'org-agenda) 654 :group 'org-agenda)
655 655
656(defvar org-agenda-archives-mode nil 656(defvar org-agenda-archives-mode nil
@@ -2144,6 +2144,7 @@ The following commands are available:
2144 ;; Keep global-font-lock-mode from turning on font-lock-mode 2144 ;; Keep global-font-lock-mode from turning on font-lock-mode
2145 (org-set-local 'font-lock-global-modes (list 'not major-mode)) 2145 (org-set-local 'font-lock-global-modes (list 'not major-mode))
2146 (setq mode-name "Org-Agenda") 2146 (setq mode-name "Org-Agenda")
2147 (setq indent-tabs-mode nil)
2147 (use-local-map org-agenda-mode-map) 2148 (use-local-map org-agenda-mode-map)
2148 (easy-menu-add org-agenda-menu) 2149 (easy-menu-add org-agenda-menu)
2149 (if org-startup-truncated (setq truncate-lines t)) 2150 (if org-startup-truncated (setq truncate-lines t))
@@ -3579,7 +3580,7 @@ the global options and expect it to be applied to the entire view.")
3579 3580
3580(defvar org-agenda-regexp-filter-preset nil 3581(defvar org-agenda-regexp-filter-preset nil
3581 "A preset of the regexp filter used for secondary agenda filtering. 3582 "A preset of the regexp filter used for secondary agenda filtering.
3582This must be a list of strings, each string must be a single category 3583This must be a list of strings, each string must be a single regexp
3583preceded by \"+\" or \"-\". 3584preceded by \"+\" or \"-\".
3584This variable should not be set directly, but agenda custom commands can 3585This variable should not be set directly, but agenda custom commands can
3585bind it in the options section. The preset filter is a global property of 3586bind it in the options section. The preset filter is a global property of
@@ -3718,12 +3719,7 @@ generating a new one."
3718 (org-agenda-fontify-priorities)) 3719 (org-agenda-fontify-priorities))
3719 (when (and org-agenda-dim-blocked-tasks org-blocker-hook) 3720 (when (and org-agenda-dim-blocked-tasks org-blocker-hook)
3720 (org-agenda-dim-blocked-tasks)) 3721 (org-agenda-dim-blocked-tasks))
3721 ;; We need to widen when `org-agenda-finalize' is called from 3722 (org-agenda-mark-clocking-task)
3722 ;; `org-agenda-change-all-lines' (e.g. in `org-agenda-clock-in')
3723 (when org-clock-current-task
3724 (save-restriction
3725 (widen)
3726 (org-agenda-mark-clocking-task)))
3727 (when org-agenda-entry-text-mode 3723 (when org-agenda-entry-text-mode
3728 (org-agenda-entry-text-hide) 3724 (org-agenda-entry-text-hide)
3729 (org-agenda-entry-text-show)) 3725 (org-agenda-entry-text-show))
@@ -3750,30 +3746,44 @@ generating a new one."
3750 (delete-dups 3746 (delete-dups
3751 (mapcar 'downcase (org-get-tags-at)))))))))) 3747 (mapcar 'downcase (org-get-tags-at))))))))))
3752 (run-hooks 'org-agenda-finalize-hook) 3748 (run-hooks 'org-agenda-finalize-hook)
3753 (when (or org-agenda-tag-filter (get 'org-agenda-tag-filter :preset-filter)) 3749 (when org-agenda-tag-filter
3754 (org-agenda-filter-apply org-agenda-tag-filter 'tag)) 3750 (org-agenda-filter-apply org-agenda-tag-filter 'tag))
3755 (when (or org-agenda-category-filter (get 'org-agenda-category-filter :preset-filter)) 3751 (when (get 'org-agenda-tag-filter :preset-filter)
3752 (org-agenda-filter-apply
3753 (get 'org-agenda-tag-filter :preset-filter) 'tag))
3754 (when org-agenda-category-filter
3756 (org-agenda-filter-apply org-agenda-category-filter 'category)) 3755 (org-agenda-filter-apply org-agenda-category-filter 'category))
3757 (when (or org-agenda-regexp-filter (get 'org-agenda-regexp-filter :preset-filter)) 3756 (when (get 'org-agenda-category-filter :preset-filter)
3757 (org-agenda-filter-apply
3758 (get 'org-agenda-category-filter :preset-filter) 'category))
3759 (when org-agenda-regexp-filter
3758 (org-agenda-filter-apply org-agenda-regexp-filter 'regexp)) 3760 (org-agenda-filter-apply org-agenda-regexp-filter 'regexp))
3761 (when (get 'org-agenda-regexp-filter :preset-filter)
3762 (org-agenda-filter-apply
3763 (get 'org-agenda-regexp-filter :preset-filter) 'regexp))
3759 (org-add-hook 'kill-buffer-hook 'org-agenda-reset-markers 'append 'local))))) 3764 (org-add-hook 'kill-buffer-hook 'org-agenda-reset-markers 'append 'local)))))
3760 3765
3761(defun org-agenda-mark-clocking-task () 3766(defun org-agenda-mark-clocking-task ()
3762 "Mark the current clock entry in the agenda if it is present." 3767 "Mark the current clock entry in the agenda if it is present."
3763 (org-agenda-unmark-clocking-task) 3768 ;; We need to widen when `org-agenda-finalize' is called from
3764 (when (marker-buffer org-clock-hd-marker) 3769 ;; `org-agenda-change-all-lines' (e.g. in `org-agenda-clock-in')
3765 (save-excursion 3770 (when org-clock-current-task
3766 (goto-char (point-min)) 3771 (save-restriction
3767 (let (s ov) 3772 (widen)
3768 (while (setq s (next-single-property-change (point) 'org-hd-marker)) 3773 (org-agenda-unmark-clocking-task)
3769 (goto-char s) 3774 (when (marker-buffer org-clock-hd-marker)
3770 (when (equal (org-get-at-bol 'org-hd-marker) 3775 (save-excursion
3771 org-clock-hd-marker) 3776 (goto-char (point-min))
3772 (setq ov (make-overlay (point-at-bol) (1+ (point-at-eol)))) 3777 (let (s ov)
3773 (overlay-put ov 'type 'org-agenda-clocking) 3778 (while (setq s (next-single-property-change (point) 'org-hd-marker))
3774 (overlay-put ov 'face 'org-agenda-clocking) 3779 (goto-char s)
3775 (overlay-put ov 'help-echo 3780 (when (equal (org-get-at-bol 'org-hd-marker)
3776 "The clock is running in this item"))))))) 3781 org-clock-hd-marker)
3782 (setq ov (make-overlay (point-at-bol) (1+ (point-at-eol))))
3783 (overlay-put ov 'type 'org-agenda-clocking)
3784 (overlay-put ov 'face 'org-agenda-clocking)
3785 (overlay-put ov 'help-echo
3786 "The clock is running in this item")))))))))
3777 3787
3778(defun org-agenda-unmark-clocking-task () 3788(defun org-agenda-unmark-clocking-task ()
3779 "Unmark the current clocking task." 3789 "Unmark the current clocking task."
@@ -3851,11 +3861,12 @@ dimming them."
3851 e (point-at-eol) 3861 e (point-at-eol)
3852 ov (make-overlay b e)) 3862 ov (make-overlay b e))
3853 (if invis1 3863 (if invis1
3854 (overlay-put ov 'invisible t) 3864 (progn (overlay-put ov 'invisible t)
3865 (overlay-put ov 'intangible t))
3855 (overlay-put ov 'face 'org-agenda-dimmed-todo-face)) 3866 (overlay-put ov 'face 'org-agenda-dimmed-todo-face))
3856 (overlay-put ov 'org-type 'org-blocked-todo)))))) 3867 (overlay-put ov 'org-type 'org-blocked-todo))))))
3857 (when (org-called-interactively-p 'interactive) 3868 (when (org-called-interactively-p 'interactive)
3858 (message "Dim or hide blocked tasks...done"))) 3869 (message "Dim or hide blocked tasks...done")))
3859 3870
3860(defvar org-agenda-skip-function nil 3871(defvar org-agenda-skip-function nil
3861 "Function to be called at each match during agenda construction. 3872 "Function to be called at each match during agenda construction.
@@ -4917,7 +4928,7 @@ See `org-agenda-skip-if' for details."
4917 (org-agenda-skip-if nil conditions)) 4928 (org-agenda-skip-if nil conditions))
4918 4929
4919(defun org-agenda-skip-subtree-if (&rest conditions) 4930(defun org-agenda-skip-subtree-if (&rest conditions)
4920 "Skip entry if any of CONDITIONS is true. 4931 "Skip subtree if any of CONDITIONS is true.
4921See `org-agenda-skip-if' for details." 4932See `org-agenda-skip-if' for details."
4922 (org-agenda-skip-if t conditions)) 4933 (org-agenda-skip-if t conditions))
4923 4934
@@ -5086,6 +5097,7 @@ of what a project is and how to check if it stuck, customize the variable
5086 (mapconcat 'identity re-list "\\|") 5097 (mapconcat 'identity re-list "\\|")
5087 (error "No information how to identify unstuck projects"))) 5098 (error "No information how to identify unstuck projects")))
5088 (org-tags-view nil matcher) 5099 (org-tags-view nil matcher)
5100 (setq org-agenda-buffer-name (buffer-name))
5089 (with-current-buffer org-agenda-buffer-name 5101 (with-current-buffer org-agenda-buffer-name
5090 (setq org-agenda-redo-command 5102 (setq org-agenda-redo-command
5091 `(org-agenda-list-stuck-projects ,current-prefix-arg))))) 5103 `(org-agenda-list-stuck-projects ,current-prefix-arg)))))
@@ -5453,7 +5465,7 @@ This function is invoked if `org-agenda-todo-ignore-deadlines',
5453 5465
5454;;;###autoload 5466;;;###autoload
5455(defun org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item 5467(defun org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item
5456 (&optional end) 5468 (&optional end)
5457 "Do we have a reason to ignore this TODO entry because it has a time stamp?" 5469 "Do we have a reason to ignore this TODO entry because it has a time stamp?"
5458 (when (or org-agenda-todo-ignore-with-date 5470 (when (or org-agenda-todo-ignore-with-date
5459 org-agenda-todo-ignore-scheduled 5471 org-agenda-todo-ignore-scheduled
@@ -5690,10 +5702,10 @@ This function is invoked if `org-agenda-todo-ignore-deadlines',
5690 (setq txt "SEXP entry returned empty string")) 5702 (setq txt "SEXP entry returned empty string"))
5691 (setq txt (org-agenda-format-item extra txt level category tags 'time)) 5703 (setq txt (org-agenda-format-item extra txt level category tags 'time))
5692 (org-add-props txt props 'org-marker marker 5704 (org-add-props txt props 'org-marker marker
5693 'org-category category 'date date 'todo-state todo-state 5705 'org-category category 'date date 'todo-state todo-state
5694 'org-category-position category-pos 'tags tags 5706 'org-category-position category-pos 'tags tags
5695 'level level 5707 'level level
5696 'type "sexp" 'warntime warntime) 5708 'type "sexp" 'warntime warntime)
5697 (push txt ee))))) 5709 (push txt ee)))))
5698 (nreverse ee))) 5710 (nreverse ee)))
5699 5711
@@ -6244,6 +6256,7 @@ an hour specification like [h]h:mm."
6244 category-pos (get-text-property (point) 'org-category-position)) 6256 category-pos (get-text-property (point) 'org-category-position))
6245 (if (and (eq org-agenda-skip-scheduled-if-deadline-is-shown 6257 (if (and (eq org-agenda-skip-scheduled-if-deadline-is-shown
6246 'repeated-after-deadline) 6258 'repeated-after-deadline)
6259 (org-get-deadline-time (point))
6247 (<= 0 (- d2 (time-to-days (org-get-deadline-time (point)))))) 6260 (<= 0 (- d2 (time-to-days (org-get-deadline-time (point))))))
6248 (throw :skip nil)) 6261 (throw :skip nil))
6249 (if (not (re-search-backward "^\\*+[ \t]+" nil t)) 6262 (if (not (re-search-backward "^\\*+[ \t]+" nil t))
@@ -7370,7 +7383,7 @@ With two prefix arguments, remove the regexp filters."
7370 (read-from-minibuffer 7383 (read-from-minibuffer
7371 (if (equal strip '(4)) 7384 (if (equal strip '(4))
7372 "Filter out entries matching regexp: " 7385 "Filter out entries matching regexp: "
7373 "Narrow to entries matching regexp: "))))) 7386 "Narrow to entries matching regexp: ")))))
7374 (push flt org-agenda-regexp-filter) 7387 (push flt org-agenda-regexp-filter)
7375 (org-agenda-filter-apply org-agenda-regexp-filter 'regexp)) 7388 (org-agenda-filter-apply org-agenda-regexp-filter 'regexp))
7376 (org-agenda-filter-show-all-re) 7389 (org-agenda-filter-show-all-re)
@@ -7645,7 +7658,7 @@ When NO-OPERATOR is non-nil, do not add the + operator to returned tags."
7645 (let* ((pos (org-get-at-bol 'org-hd-marker)) 7658 (let* ((pos (org-get-at-bol 'org-hd-marker))
7646 (tophl (and pos (org-find-top-headline pos)))) 7659 (tophl (and pos (org-find-top-headline pos))))
7647 (if (and tophl (funcall (if negative 'identity 'not) 7660 (if (and tophl (funcall (if negative 'identity 'not)
7648 (string= hl tophl))) 7661 (string= hl tophl)))
7649 (org-agenda-filter-hide-line 'category))) 7662 (org-agenda-filter-hide-line 'category)))
7650 (beginning-of-line 2))) 7663 (beginning-of-line 2)))
7651 (if (get-char-property (point) 'invisible) 7664 (if (get-char-property (point) 'invisible)
@@ -7655,10 +7668,11 @@ When NO-OPERATOR is non-nil, do not add the + operator to returned tags."
7655 7668
7656(defun org-agenda-filter-hide-line (type) 7669(defun org-agenda-filter-hide-line (type)
7657 "Hide lines with TYPE in the agenda buffer." 7670 "Hide lines with TYPE in the agenda buffer."
7658 (let (ov) 7671 (let* ((b (max (point-min) (1- (point-at-bol))))
7659 (setq ov (make-overlay (max (point-min) (1- (point-at-bol))) 7672 (e (point-at-eol))
7660 (point-at-eol))) 7673 (ov (make-overlay b e)))
7661 (overlay-put ov 'invisible t) 7674 (overlay-put ov 'invisible t)
7675 (overlay-put ov 'intangible t)
7662 (overlay-put ov 'type type) 7676 (overlay-put ov 'type type)
7663 (cond ((eq type 'tag) (push ov org-agenda-tag-filter-overlays)) 7677 (cond ((eq type 'tag) (push ov org-agenda-tag-filter-overlays))
7664 ((eq type 'category) (push ov org-agenda-cat-filter-overlays)) 7678 ((eq type 'category) (push ov org-agenda-cat-filter-overlays))
@@ -8482,7 +8496,8 @@ It also looks at the text of the entry itself."
8482 (org-get-at-bol 'org-marker))) 8496 (org-get-at-bol 'org-marker)))
8483 (buffer (and marker (marker-buffer marker))) 8497 (buffer (and marker (marker-buffer marker)))
8484 (prefix (buffer-substring (point-at-bol) (point-at-eol))) 8498 (prefix (buffer-substring (point-at-bol) (point-at-eol)))
8485 (lkall (org-offer-links-in-entry buffer marker arg prefix)) 8499 (lkall (and buffer (org-offer-links-in-entry
8500 buffer marker arg prefix)))
8486 (lk0 (car lkall)) 8501 (lk0 (car lkall))
8487 (lk (if (stringp lk0) (list lk0) lk0)) 8502 (lk (if (stringp lk0) (list lk0) lk0))
8488 (lkend (cdr lkall)) 8503 (lkend (cdr lkall))
@@ -8789,8 +8804,12 @@ the same tree node, and the headline of the tree node in the Org-mode file."
8789 (org-back-to-heading) 8804 (org-back-to-heading)
8790 (move-marker org-last-heading-marker (point)))) 8805 (move-marker org-last-heading-marker (point))))
8791 (beginning-of-line 1) 8806 (beginning-of-line 1)
8792 (save-excursion 8807 (save-window-excursion
8793 (org-agenda-change-all-lines newhead hdmarker 'fixface just-one)) 8808 (org-agenda-change-all-lines newhead hdmarker 'fixface just-one))
8809 (when (org-bound-and-true-p org-clock-out-when-done)
8810 (string-match (concat "^" (regexp-opt org-done-keywords-for-agenda))
8811 newhead)
8812 (org-agenda-unmark-clocking-task))
8794 (org-move-to-column col)))) 8813 (org-move-to-column col))))
8795 8814
8796(defun org-agenda-add-note (&optional arg) 8815(defun org-agenda-add-note (&optional arg)
@@ -8927,7 +8946,8 @@ Called with a universal prefix arg, show the priority instead of setting it."
8927 (unless org-enable-priority-commands 8946 (unless org-enable-priority-commands
8928 (error "Priority commands are disabled")) 8947 (error "Priority commands are disabled"))
8929 (org-agenda-check-no-diary) 8948 (org-agenda-check-no-diary)
8930 (let* ((marker (or (org-get-at-bol 'org-marker) 8949 (let* ((col (current-column))
8950 (marker (or (org-get-at-bol 'org-marker)
8931 (org-agenda-error))) 8951 (org-agenda-error)))
8932 (hdmarker (org-get-at-bol 'org-hd-marker)) 8952 (hdmarker (org-get-at-bol 'org-hd-marker))
8933 (buffer (marker-buffer hdmarker)) 8953 (buffer (marker-buffer hdmarker))
@@ -8946,7 +8966,7 @@ Called with a universal prefix arg, show the priority instead of setting it."
8946 (end-of-line 1) 8966 (end-of-line 1)
8947 (setq newhead (org-get-heading))) 8967 (setq newhead (org-get-heading)))
8948 (org-agenda-change-all-lines newhead hdmarker) 8968 (org-agenda-change-all-lines newhead hdmarker)
8949 (beginning-of-line 1))))) 8969 (org-move-to-column col)))))
8950 8970
8951;; FIXME: should fix the tags property of the agenda line. 8971;; FIXME: should fix the tags property of the agenda line.
8952(defun org-agenda-set-tags (&optional tag onoff) 8972(defun org-agenda-set-tags (&optional tag onoff)
@@ -9155,7 +9175,9 @@ Called with a universal prefix arg, show the priority instead of setting it."
9155 (goto-char (point-max)) 9175 (goto-char (point-max))
9156 (while (not (bobp)) 9176 (while (not (bobp))
9157 (when (equal marker (org-get-at-bol 'org-marker)) 9177 (when (equal marker (org-get-at-bol 'org-marker))
9158 (org-move-to-column (- (window-width) (length stamp)) t nil t) 9178 (remove-text-properties (point-at-bol) (point-at-eol) '(display))
9179 (org-move-to-column (- (window-width) (length stamp)) t)
9180
9159 (org-agenda-fix-tags-filter-overlays-at (point)) 9181 (org-agenda-fix-tags-filter-overlays-at (point))
9160 (if (featurep 'xemacs) 9182 (if (featurep 'xemacs)
9161 ;; Use `duplicable' property to trigger undo recording 9183 ;; Use `duplicable' property to trigger undo recording
@@ -9166,7 +9188,7 @@ Called with a universal prefix arg, show the priority instead of setting it."
9166 ex (list 'invisible t 'end-glyph gl 'duplicable t)) 9188 ex (list 'invisible t 'end-glyph gl 'duplicable t))
9167 (insert-extent ex (1- (point)) (point-at-eol))) 9189 (insert-extent ex (1- (point)) (point-at-eol)))
9168 (add-text-properties 9190 (add-text-properties
9169 (1- (point)) (point-at-eol) 9191 (1- (point)) (point-at-eol)
9170 (list 'display (org-add-props stamp nil 9192 (list 'display (org-add-props stamp nil
9171 'face 'secondary-selection)))) 9193 'face 'secondary-selection))))
9172 (beginning-of-line 1)) 9194 (beginning-of-line 1))
@@ -9917,31 +9939,43 @@ current HH:MM time."
9917 9939
9918;;; Dragging agenda lines forward/backward 9940;;; Dragging agenda lines forward/backward
9919 9941
9920(defun org-agenda-drag-line-forward (arg) 9942(defun org-agenda-reapply-filters ()
9921 "Drag an agenda line forward by ARG lines." 9943 "Re-apply all agenda filters."
9944 (mapcar
9945 (lambda(f) (when (car f) (org-agenda-filter-apply (car f) (cadr f))))
9946 `((,org-agenda-tag-filter tag)
9947 (,org-agenda-category-filter category)
9948 (,org-agenda-regexp-filter regexp)
9949 (,(get 'org-agenda-tag-filter :preset-filter) tag)
9950 (,(get 'org-agenda-category-filter :preset-filter) category)
9951 (,(get 'org-agenda-regexp-filter :preset-filter) regexp))))
9952
9953(defun org-agenda-drag-line-forward (arg &optional backward)
9954 "Drag an agenda line forward by ARG lines.
9955When the optional argument `backward' is non-nil, move backward."
9922 (interactive "p") 9956 (interactive "p")
9923 (let ((inhibit-read-only t) lst) 9957 (let ((inhibit-read-only t) lst line)
9924 (if (or (not (get-text-property (point) 'txt)) 9958 (if (or (not (get-text-property (point) 'txt))
9925 (save-excursion 9959 (save-excursion
9926 (dotimes (n arg) 9960 (dotimes (n arg)
9927 (move-beginning-of-line 2) 9961 (move-beginning-of-line (if backward 0 2))
9928 (push (not (get-text-property (point) 'txt)) lst)) 9962 (push (not (get-text-property (point) 'txt)) lst))
9929 (delq nil lst))) 9963 (delq nil lst)))
9930 (message "Cannot move line forward") 9964 (message "Cannot move line forward")
9931 (org-drag-line-forward arg)))) 9965 (let ((end (save-excursion (move-beginning-of-line 2) (point))))
9966 (move-beginning-of-line 1)
9967 (setq line (buffer-substring (point) end))
9968 (delete-region (point) end)
9969 (move-beginning-of-line (funcall (if backward '1- '1+) arg))
9970 (insert line)
9971 (org-agenda-reapply-filters)
9972 (org-agenda-mark-clocking-task)
9973 (move-beginning-of-line 0)))))
9932 9974
9933(defun org-agenda-drag-line-backward (arg) 9975(defun org-agenda-drag-line-backward (arg)
9934 "Drag an agenda line backward by ARG lines." 9976 "Drag an agenda line backward by ARG lines."
9935 (interactive "p") 9977 (interactive "p")
9936 (let ((inhibit-read-only t) lst) 9978 (org-agenda-drag-line-forward arg t))
9937 (if (or (not (get-text-property (point) 'txt))
9938 (save-excursion
9939 (dotimes (n arg)
9940 (move-beginning-of-line 0)
9941 (push (not (get-text-property (point) 'txt)) lst))
9942 (delq nil lst)))
9943 (message "Cannot move line backward")
9944 (org-drag-line-backward arg))))
9945 9979
9946;;; Flagging notes 9980;;; Flagging notes
9947 9981
diff --git a/lisp/org/org-bibtex.el b/lisp/org/org-bibtex.el
index b4e69774c16..b6557108845 100644
--- a/lisp/org/org-bibtex.el
+++ b/lisp/org/org-bibtex.el
@@ -279,7 +279,7 @@ not be exported."
279 279
280(defcustom org-bibtex-no-export-tags nil 280(defcustom org-bibtex-no-export-tags nil
281 "List of tag(s) that should not be converted to keywords. 281 "List of tag(s) that should not be converted to keywords.
282This variable is relevant only if `org-bibtex-export-tags-as-keywords' is t." 282This variable is relevant only if `org-bibtex-tags-are-keywords' is t."
283 :group 'org-bibtex 283 :group 'org-bibtex
284 :version "24.1" 284 :version "24.1"
285 :type '(repeat :tag "Tag" (string))) 285 :type '(repeat :tag "Tag" (string)))
@@ -371,7 +371,9 @@ This variable is relevant only if `org-bibtex-export-tags-as-keywords' is t."
371 (bibtex-beginning-of-entry) 371 (bibtex-beginning-of-entry)
372 (if (re-search-forward "keywords.*=.*{\\(.*\\)}" nil t) 372 (if (re-search-forward "keywords.*=.*{\\(.*\\)}" nil t)
373 (progn (goto-char (match-end 1)) (insert ", ")) 373 (progn (goto-char (match-end 1)) (insert ", "))
374 (bibtex-make-field "keywords" t t)) 374 (search-forward ",\n" nil t)
375 (insert " keywords={},\n")
376 (search-backward "}," nil t))
375 (insert (mapconcat #'identity tags ", "))) 377 (insert (mapconcat #'identity tags ", ")))
376 (buffer-string)))))) 378 (buffer-string))))))
377 379
@@ -534,7 +536,7 @@ With optional argument OPTIONAL, also prompt for optional fields."
534;;; Bibtex <-> Org-mode headline translation functions 536;;; Bibtex <-> Org-mode headline translation functions
535(defun org-bibtex (&optional filename) 537(defun org-bibtex (&optional filename)
536 "Export each headline in the current file to a bibtex entry. 538 "Export each headline in the current file to a bibtex entry.
537Headlines are exported using `org-bibtex-export-headline'." 539Headlines are exported using `org-bibtex-headline'."
538 (interactive 540 (interactive
539 (list (read-file-name 541 (list (read-file-name
540 "Bibtex file: " nil nil nil 542 "Bibtex file: " nil nil nil
@@ -613,7 +615,8 @@ This uses `bibtex-parse-entry'."
613 (strip-delim 615 (strip-delim
614 (lambda (str) ; strip enclosing "..." and {...} 616 (lambda (str) ; strip enclosing "..." and {...}
615 (dolist (pair '((34 . 34) (123 . 125) (123 . 125))) 617 (dolist (pair '((34 . 34) (123 . 125) (123 . 125)))
616 (when (and (= (aref str 0) (car pair)) 618 (when (and (> (length str) 1)
619 (= (aref str 0) (car pair))
617 (= (aref str (1- (length str))) (cdr pair))) 620 (= (aref str (1- (length str))) (cdr pair)))
618 (setf str (substring str 1 (1- (length str)))))) str))) 621 (setf str (substring str 1 (1- (length str)))))) str)))
619 (push (mapcar 622 (push (mapcar
diff --git a/lisp/org/org-capture.el b/lisp/org/org-capture.el
index 8eaa313b28a..0433306a909 100644
--- a/lisp/org/org-capture.el
+++ b/lisp/org/org-capture.el
@@ -741,7 +741,8 @@ captured item after finalizing."
741 (pos (org-capture-get :initial-target-position)) 741 (pos (org-capture-get :initial-target-position))
742 (ipt (org-capture-get :insertion-point)) 742 (ipt (org-capture-get :insertion-point))
743 (size (org-capture-get :captured-entry-size))) 743 (size (org-capture-get :captured-entry-size)))
744 (when reg 744 (if (not reg)
745 (widen)
745 (cond ((< ipt (car reg)) 746 (cond ((< ipt (car reg))
746 ;; insertion point is before the narrowed region 747 ;; insertion point is before the narrowed region
747 (narrow-to-region (+ size (car reg)) (+ size (cdr reg)))) 748 (narrow-to-region (+ size (car reg)) (+ size (cdr reg))))
diff --git a/lisp/org/org-clock.el b/lisp/org/org-clock.el
index fa50f9dda95..f2a37484cc0 100644
--- a/lisp/org/org-clock.el
+++ b/lisp/org/org-clock.el
@@ -1838,9 +1838,9 @@ Use \\[org-clock-remove-overlays] to remove the subtree times."
1838 (when org-remove-highlights-with-change 1838 (when org-remove-highlights-with-change
1839 (org-add-hook 'before-change-functions 'org-clock-remove-overlays 1839 (org-add-hook 'before-change-functions 'org-clock-remove-overlays
1840 nil 'local)))) 1840 nil 'local))))
1841 (message (concat "Total file time: " 1841 (message (concat "Total file time: "
1842 (org-minutes-to-clocksum-string org-clock-file-total-minutes) 1842 (org-minutes-to-clocksum-string org-clock-file-total-minutes)
1843 " (%d hours and %d minutes)") h m))) 1843 " (%d hours and %d minutes)") h m)))
1844 1844
1845(defvar org-clock-overlays nil) 1845(defvar org-clock-overlays nil)
1846(make-variable-buffer-local 'org-clock-overlays) 1846(make-variable-buffer-local 'org-clock-overlays)
@@ -1850,16 +1850,17 @@ Use \\[org-clock-remove-overlays] to remove the subtree times."
1850If LEVEL is given, prefix time with a corresponding number of stars. 1850If LEVEL is given, prefix time with a corresponding number of stars.
1851This creates a new overlay and stores it in `org-clock-overlays', so that it 1851This creates a new overlay and stores it in `org-clock-overlays', so that it
1852will be easy to remove." 1852will be easy to remove."
1853 (let* ((c 60) (h (floor (/ time 60))) (m (- time (* 60 h))) 1853 (let* ((l (if level (org-get-valid-level level 0) 0))
1854 (l (if level (org-get-valid-level level 0) 0))
1855 (off 0)
1856 ov tx) 1854 ov tx)
1857 (org-move-to-column c) 1855 (beginning-of-line)
1858 (unless (eolp) (skip-chars-backward "^ \t")) 1856 (when (looking-at org-complex-heading-regexp)
1859 (skip-chars-backward " \t") 1857 (goto-char (match-beginning 4)))
1860 (setq ov (make-overlay (point-at-bol) (point-at-eol)) 1858 (setq ov (make-overlay (point) (point-at-eol))
1861 tx (concat (buffer-substring (point-at-bol) (point)) 1859 tx (concat (buffer-substring-no-properties (point) (match-end 4))
1862 (make-string (+ off (max 0 (- c (current-column)))) ?.) 1860 (make-string
1861 (max 0 (- (- 60 (current-column))
1862 (- (match-end 4) (match-beginning 4))
1863 (length (org-get-at-bol 'line-prefix)))) ?.)
1863 (org-add-props (concat (make-string l ?*) " " 1864 (org-add-props (concat (make-string l ?*) " "
1864 (org-minutes-to-clocksum-string time) 1865 (org-minutes-to-clocksum-string time)
1865 (make-string (- 16 l) ?\ )) 1866 (make-string (- 16 l) ?\ ))
@@ -2705,9 +2706,13 @@ TIME: The sum of all time spend in this tree, in minutes. This time
2705 (format "file:%s::%s" 2706 (format "file:%s::%s"
2706 (buffer-file-name) 2707 (buffer-file-name)
2707 (save-match-data 2708 (save-match-data
2708 (org-make-org-heading-search-string 2709 (match-string 2)))
2709 (match-string 2)))) 2710 (org-make-org-heading-search-string
2710 (match-string 2))) 2711 (replace-regexp-in-string
2712 org-bracket-link-regexp
2713 (lambda (m) (or (match-string 3 m)
2714 (match-string 1 m)))
2715 (match-string 2)))))
2711 tsp (when timestamp 2716 tsp (when timestamp
2712 (setq props (org-entry-properties (point))) 2717 (setq props (org-entry-properties (point)))
2713 (or (cdr (assoc "SCHEDULED" props)) 2718 (or (cdr (assoc "SCHEDULED" props))
diff --git a/lisp/org/org-colview.el b/lisp/org/org-colview.el
index 9dd0340a233..07ee69f14c5 100644
--- a/lisp/org/org-colview.el
+++ b/lisp/org/org-colview.el
@@ -174,7 +174,7 @@ This is the compiled version of the format.")
174 (face (list color font 'org-column ref-face)) 174 (face (list color font 'org-column ref-face))
175 (face1 (list color font 'org-agenda-column-dateline ref-face)) 175 (face1 (list color font 'org-agenda-column-dateline ref-face))
176 (cphr (get-text-property (point-at-bol) 'org-complex-heading-regexp)) 176 (cphr (get-text-property (point-at-bol) 'org-complex-heading-regexp))
177 pom property ass width f string ov column val modval s2 title calc) 177 pom property ass width f fc string fm ov column val modval s2 title calc)
178 ;; Check if the entry is in another buffer. 178 ;; Check if the entry is in another buffer.
179 (unless props 179 (unless props
180 (if (eq major-mode 'org-agenda-mode) 180 (if (eq major-mode 'org-agenda-mode)
@@ -204,6 +204,8 @@ This is the compiled version of the format.")
204 (nth 2 column) 204 (nth 2 column)
205 (length property)) 205 (length property))
206 f (format "%%-%d.%ds | " width width) 206 f (format "%%-%d.%ds | " width width)
207 fm (nth 4 column)
208 fc (nth 5 column)
207 calc (nth 7 column) 209 calc (nth 7 column)
208 val (or (cdr ass) "") 210 val (or (cdr ass) "")
209 modval (cond ((and org-columns-modify-value-for-display-function 211 modval (cond ((and org-columns-modify-value-for-display-function
@@ -215,13 +217,14 @@ This is the compiled version of the format.")
215 (org-columns-cleanup-item 217 (org-columns-cleanup-item
216 val org-columns-current-fmt-compiled 218 val org-columns-current-fmt-compiled
217 (or org-complex-heading-regexp cphr))) 219 (or org-complex-heading-regexp cphr)))
220 (fc (org-columns-number-to-string
221 (org-columns-string-to-number val fm) fm fc))
218 ((and calc (functionp calc) 222 ((and calc (functionp calc)
219 (not (string= val "")) 223 (not (string= val ""))
220 (not (get-text-property 0 'org-computed val))) 224 (not (get-text-property 0 'org-computed val)))
221 (org-columns-number-to-string 225 (org-columns-number-to-string
222 (funcall calc (org-columns-string-to-number 226 (funcall calc (org-columns-string-to-number
223 val (nth 4 column))) 227 val fm)) fm))))
224 (nth 4 column)))))
225 (setq s2 (org-columns-add-ellipses (or modval val) width)) 228 (setq s2 (org-columns-add-ellipses (or modval val) width))
226 (setq string (format f s2)) 229 (setq string (format f s2))
227 ;; Create the overlay 230 ;; Create the overlay
diff --git a/lisp/org/org-compat.el b/lisp/org/org-compat.el
index fee0bd08cad..70c41d53cd9 100644
--- a/lisp/org/org-compat.el
+++ b/lisp/org/org-compat.el
@@ -260,6 +260,12 @@ ignored in this case."
260 next (+ from (* n inc))))) 260 next (+ from (* n inc)))))
261 (nreverse seq))))) 261 (nreverse seq)))))
262 262
263;; `set-transient-map' is only in Emacs >= 24.4
264(defalias 'org-set-transient-map
265 (if (fboundp 'set-transient-map)
266 'set-transient-map
267 'set-temporary-overlay-map))
268
263;; Region compatibility 269;; Region compatibility
264 270
265(defvar org-ignore-region nil 271(defvar org-ignore-region nil
@@ -337,10 +343,25 @@ Works on both Emacs and XEmacs."
337 (org-xemacs-without-invisibility (indent-line-to column)) 343 (org-xemacs-without-invisibility (indent-line-to column))
338 (indent-line-to column))) 344 (indent-line-to column)))
339 345
340(defun org-move-to-column (column &optional force buffer ignore-invisible) 346(defun org-move-to-column (column &optional force buffer)
341 (let ((buffer-invisibility-spec ignore-invisible)) 347 "Move to column COLUMN.
348Pass COLUMN and FORCE to `move-to-column'.
349Pass BUFFER to the XEmacs version of `move-to-column'."
350 (let* ((with-bracket-link
351 (save-excursion
352 (forward-line 0)
353 (looking-at (concat "^.*" org-bracket-link-regexp))))
354 (buffer-invisibility-spec
355 (cond
356 ((or (not (derived-mode-p 'org-mode))
357 (and with-bracket-link (org-invisible-p2)))
358 (remove '(org-link) buffer-invisibility-spec))
359 (with-bracket-link
360 (remove t buffer-invisibility-spec))
361 (t buffer-invisibility-spec))))
342 (if (featurep 'xemacs) 362 (if (featurep 'xemacs)
343 (org-xemacs-without-invisibility (move-to-column column force buffer)) 363 (org-xemacs-without-invisibility
364 (move-to-column column force buffer))
344 (move-to-column column force)))) 365 (move-to-column column force))))
345 366
346(defun org-get-x-clipboard-compat (value) 367(defun org-get-x-clipboard-compat (value)
diff --git a/lisp/org/org-element.el b/lisp/org/org-element.el
index 77b2bc26ef9..b44466e53df 100644
--- a/lisp/org/org-element.el
+++ b/lisp/org/org-element.el
@@ -62,7 +62,7 @@
62;; `table-cell', `target', `timestamp', `underline' and `verbatim'. 62;; `table-cell', `target', `timestamp', `underline' and `verbatim'.
63;; 63;;
64;; Some elements also have special properties whose value can hold 64;; Some elements also have special properties whose value can hold
65;; objects themselves (i.e. an item tag or a headline name). Such 65;; objects themselves (e.g. an item tag or a headline name). Such
66;; values are called "secondary strings". Any object belongs to 66;; values are called "secondary strings". Any object belongs to
67;; either an element or a secondary string. 67;; either an element or a secondary string.
68;; 68;;
@@ -187,10 +187,10 @@ is not sufficient to know if point is at a paragraph ending. See
187 "List of recursive element types aka Greater Elements.") 187 "List of recursive element types aka Greater Elements.")
188 188
189(defconst org-element-all-successors 189(defconst org-element-all-successors
190 '(export-snippet footnote-reference inline-babel-call inline-src-block 190 '(link export-snippet footnote-reference inline-babel-call
191 latex-or-entity line-break link macro plain-link radio-target 191 inline-src-block latex-or-entity line-break macro plain-link
192 statistics-cookie sub/superscript table-cell target 192 radio-target statistics-cookie sub/superscript table-cell target
193 text-markup timestamp) 193 text-markup timestamp)
194 "Complete list of successors.") 194 "Complete list of successors.")
195 195
196(defconst org-element-object-successor-alist 196(defconst org-element-object-successor-alist
@@ -236,7 +236,7 @@ application to open them.")
236 '("CAPTION" "DATA" "HEADER" "HEADERS" "LABEL" "NAME" "PLOT" "RESNAME" "RESULT" 236 '("CAPTION" "DATA" "HEADER" "HEADERS" "LABEL" "NAME" "PLOT" "RESNAME" "RESULT"
237 "RESULTS" "SOURCE" "SRCNAME" "TBLNAME") 237 "RESULTS" "SOURCE" "SRCNAME" "TBLNAME")
238 "List of affiliated keywords as strings. 238 "List of affiliated keywords as strings.
239By default, all keywords setting attributes (i.e. \"ATTR_LATEX\") 239By default, all keywords setting attributes (e.g., \"ATTR_LATEX\")
240are affiliated keywords and need not to be in this list.") 240are affiliated keywords and need not to be in this list.")
241 241
242(defconst org-element-keyword-translation-alist 242(defconst org-element-keyword-translation-alist
@@ -256,7 +256,7 @@ returned as the value of the property.
256This list is checked after translations have been applied. See 256This list is checked after translations have been applied. See
257`org-element-keyword-translation-alist'. 257`org-element-keyword-translation-alist'.
258 258
259By default, all keywords setting attributes (i.e. \"ATTR_LATEX\") 259By default, all keywords setting attributes (e.g., \"ATTR_LATEX\")
260allow multiple occurrences and need not to be in this list.") 260allow multiple occurrences and need not to be in this list.")
261 261
262(defconst org-element-parsed-keywords '("CAPTION") 262(defconst org-element-parsed-keywords '("CAPTION")
@@ -328,13 +328,13 @@ Don't modify it, set `org-element-affiliated-keywords' instead.")
328 (paragraph ,@standard-set) 328 (paragraph ,@standard-set)
329 ;; Remove any variable object from radio target as it would 329 ;; Remove any variable object from radio target as it would
330 ;; prevent it from being properly recognized. 330 ;; prevent it from being properly recognized.
331 (radio-target latex-or-entity sub/superscript) 331 (radio-target latex-or-entity sub/superscript text-markup)
332 (strike-through ,@standard-set) 332 (strike-through ,@standard-set)
333 (subscript ,@standard-set) 333 (subscript ,@standard-set)
334 (superscript ,@standard-set) 334 (superscript ,@standard-set)
335 ;; Ignore inline babel call and inline src block as formulas are 335 ;; Ignore inline babel call and inline src block as formulas are
336 ;; possible. Also ignore line breaks and statistics cookies. 336 ;; possible. Also ignore line breaks and statistics cookies.
337 (table-cell export-snippet footnote-reference latex-or-entity link macro 337 (table-cell link export-snippet footnote-reference latex-or-entity macro
338 radio-target sub/superscript target text-markup timestamp) 338 radio-target sub/superscript target text-markup timestamp)
339 (table-row table-cell) 339 (table-row table-cell)
340 (underline ,@standard-set) 340 (underline ,@standard-set)
@@ -346,7 +346,8 @@ a list of successors that will be called within an element or
346object of such type. 346object of such type.
347 347
348For example, in a `radio-target' object, one can only find 348For example, in a `radio-target' object, one can only find
349entities, latex-fragments, subscript and superscript. 349entities, latex-fragments, subscript, superscript and text
350markup.
350 351
351This alist also applies to secondary string. For example, an 352This alist also applies to secondary string. For example, an
352`headline' type element doesn't directly contain objects, but 353`headline' type element doesn't directly contain objects, but
@@ -739,7 +740,9 @@ containing `:raw-value', `:title', `:alt-title', `:begin',
739 740
740The plist also contains any property set in the property drawer, 741The plist also contains any property set in the property drawer,
741with its name in upper cases and colons added at the 742with its name in upper cases and colons added at the
742beginning (i.e. `:CUSTOM_ID'). 743beginning (e.g., `:CUSTOM_ID').
744
745LIMIT is a buffer position bounding the search.
743 746
744When RAW-SECONDARY-P is non-nil, headline's title will not be 747When RAW-SECONDARY-P is non-nil, headline's title will not be
745parsed as a secondary string, but as a plain string instead. 748parsed as a secondary string, but as a plain string instead.
@@ -797,7 +800,7 @@ Assume point is at beginning of the headline."
797 (t (setq plist (plist-put plist :closed time)))))) 800 (t (setq plist (plist-put plist :closed time))))))
798 plist)))) 801 plist))))
799 (begin (point)) 802 (begin (point))
800 (end (save-excursion (goto-char (org-end-of-subtree t t)))) 803 (end (min (save-excursion (org-end-of-subtree t t)) limit))
801 (pos-after-head (progn (forward-line) (point))) 804 (pos-after-head (progn (forward-line) (point)))
802 (contents-begin (save-excursion 805 (contents-begin (save-excursion
803 (skip-chars-forward " \r\t\n" end) 806 (skip-chars-forward " \r\t\n" end)
@@ -838,10 +841,7 @@ Assume point is at beginning of the headline."
838 :todo-keyword todo 841 :todo-keyword todo
839 :todo-type todo-type 842 :todo-type todo-type
840 :post-blank (count-lines 843 :post-blank (count-lines
841 (if (not contents-end) pos-after-head 844 (or contents-end pos-after-head)
842 (goto-char contents-end)
843 (forward-line)
844 (point))
845 end) 845 end)
846 :footnote-section-p footnote-section-p 846 :footnote-section-p footnote-section-p
847 :archivedp archivedp 847 :archivedp archivedp
@@ -922,7 +922,7 @@ containing `:title', `:begin', `:end', `:hiddenp',
922 922
923The plist also contains any property set in the property drawer, 923The plist also contains any property set in the property drawer,
924with its name in upper cases and colons added at the 924with its name in upper cases and colons added at the
925beginning (i.e. `:CUSTOM_ID'). 925beginning (e.g., `:CUSTOM_ID').
926 926
927When optional argument RAW-SECONDARY-P is non-nil, inline-task's 927When optional argument RAW-SECONDARY-P is non-nil, inline-task's
928title will not be parsed as a secondary string, but as a plain 928title will not be parsed as a secondary string, but as a plain
@@ -972,8 +972,9 @@ Assume point is at beginning of the inline task."
972 plist)))) 972 plist))))
973 (task-end (save-excursion 973 (task-end (save-excursion
974 (end-of-line) 974 (end-of-line)
975 (and (re-search-forward "^\\*+ END" limit t) 975 (and (re-search-forward org-outline-regexp-bol limit t)
976 (match-beginning 0)))) 976 (org-looking-at-p "END[ \t]*$")
977 (line-beginning-position))))
977 (contents-begin (progn (forward-line) 978 (contents-begin (progn (forward-line)
978 (and task-end (< (point) task-end) (point)))) 979 (and task-end (< (point) task-end) (point))))
979 (hidden (and contents-begin (org-invisible-p2))) 980 (hidden (and contents-begin (org-invisible-p2)))
@@ -1224,7 +1225,7 @@ CONTENTS is the contents of the element."
1224 (forward-line) 1225 (forward-line)
1225 (let ((origin (point))) 1226 (let ((origin (point)))
1226 (when (re-search-forward inlinetask-re limit t) 1227 (when (re-search-forward inlinetask-re limit t)
1227 (if (looking-at "^\\*+ END[ \t]*$") (forward-line) 1228 (if (org-looking-at-p "END[ \t]*$") (forward-line)
1228 (goto-char origin))))) 1229 (goto-char origin)))))
1229 ;; At some text line. Check if it ends any previous item. 1230 ;; At some text line. Check if it ends any previous item.
1230 (t 1231 (t
@@ -2149,8 +2150,8 @@ Assume point is at the beginning of the paragraph."
2149 ;; A matching `org-element-paragraph-separate' is not 2150 ;; A matching `org-element-paragraph-separate' is not
2150 ;; necessarily the end of the paragraph. In 2151 ;; necessarily the end of the paragraph. In
2151 ;; particular, lines starting with # or : as a first 2152 ;; particular, lines starting with # or : as a first
2152 ;; non-space character are ambiguous. We have check 2153 ;; non-space character are ambiguous. We have to
2153 ;; if they are valid Org syntax (i.e. not an 2154 ;; check if they are valid Org syntax (e.g., not an
2154 ;; incomplete keyword). 2155 ;; incomplete keyword).
2155 (beginning-of-line) 2156 (beginning-of-line)
2156 (while (not 2157 (while (not
@@ -2588,8 +2589,8 @@ CONTENTS is verse block contents."
2588;; 2589;;
2589;; Unlike to elements, interstices can be found between objects. 2590;; Unlike to elements, interstices can be found between objects.
2590;; That's why, along with the parser, successor functions are provided 2591;; That's why, along with the parser, successor functions are provided
2591;; for each object. Some objects share the same successor (i.e. `code' 2592;; for each object. Some objects share the same successor (e.g.,
2592;; and `verbatim' objects). 2593;; `code' and `verbatim' objects).
2593;; 2594;;
2594;; A successor must accept a single argument bounding the search. It 2595;; A successor must accept a single argument bounding the search. It
2595;; will return either a cons cell whose CAR is the object's type, as 2596;; will return either a cons cell whose CAR is the object's type, as
@@ -2599,7 +2600,7 @@ CONTENTS is verse block contents."
2599;; org-element-NAME-successor, where NAME is the name of the 2600;; org-element-NAME-successor, where NAME is the name of the
2600;; successor, as defined in `org-element-all-successors'. 2601;; successor, as defined in `org-element-all-successors'.
2601;; 2602;;
2602;; Some object types (i.e. `italic') are recursive. Restrictions on 2603;; Some object types (e.g., `italic') are recursive. Restrictions on
2603;; object types they can contain will be specified in 2604;; object types they can contain will be specified in
2604;; `org-element-object-restrictions'. 2605;; `org-element-object-restrictions'.
2605;; 2606;;
@@ -3094,7 +3095,9 @@ Assume point is at the beginning of the link."
3094 ((and org-target-link-regexp (looking-at org-target-link-regexp)) 3095 ((and org-target-link-regexp (looking-at org-target-link-regexp))
3095 (setq type "radio" 3096 (setq type "radio"
3096 link-end (match-end 0) 3097 link-end (match-end 0)
3097 path (org-match-string-no-properties 0))) 3098 path (org-match-string-no-properties 0)
3099 contents-begin (match-beginning 0)
3100 contents-end (match-end 0)))
3098 ;; Type 2: Standard link, i.e. [[http://orgmode.org][homepage]] 3101 ;; Type 2: Standard link, i.e. [[http://orgmode.org][homepage]]
3099 ((looking-at org-bracket-link-regexp) 3102 ((looking-at org-bracket-link-regexp)
3100 (setq contents-begin (match-beginning 3) 3103 (setq contents-begin (match-beginning 3)
@@ -3127,13 +3130,13 @@ Assume point is at the beginning of the link."
3127 ;; headline name or nothing. PATH is the target or 3130 ;; headline name or nothing. PATH is the target or
3128 ;; headline's name. 3131 ;; headline's name.
3129 (t (setq type "fuzzy" path raw-link)))) 3132 (t (setq type "fuzzy" path raw-link))))
3130 ;; Type 3: Plain link, i.e. http://orgmode.org 3133 ;; Type 3: Plain link, e.g., http://orgmode.org
3131 ((looking-at org-plain-link-re) 3134 ((looking-at org-plain-link-re)
3132 (setq raw-link (org-match-string-no-properties 0) 3135 (setq raw-link (org-match-string-no-properties 0)
3133 type (org-match-string-no-properties 1) 3136 type (org-match-string-no-properties 1)
3134 link-end (match-end 0) 3137 link-end (match-end 0)
3135 path (org-match-string-no-properties 2))) 3138 path (org-match-string-no-properties 2)))
3136 ;; Type 4: Angular link, i.e. <http://orgmode.org> 3139 ;; Type 4: Angular link, e.g., <http://orgmode.org>
3137 ((looking-at org-angle-link-re) 3140 ((looking-at org-angle-link-re)
3138 (setq raw-link (buffer-substring-no-properties 3141 (setq raw-link (buffer-substring-no-properties
3139 (match-beginning 1) (match-end 2)) 3142 (match-beginning 1) (match-end 2))
@@ -3144,18 +3147,20 @@ Assume point is at the beginning of the link."
3144 ;; LINK-END variable. 3147 ;; LINK-END variable.
3145 (setq post-blank (progn (goto-char link-end) (skip-chars-forward " \t")) 3148 (setq post-blank (progn (goto-char link-end) (skip-chars-forward " \t"))
3146 end (point)) 3149 end (point))
3147 ;; Extract search option and opening application out of 3150 ;; Special "file" type link processing.
3148 ;; "file"-type links.
3149 (when (member type org-element-link-type-is-file) 3151 (when (member type org-element-link-type-is-file)
3150 ;; Application. 3152 ;; Extract opening application and search option.
3151 (cond ((string-match "^file\\+\\(.*\\)$" type) 3153 (cond ((string-match "^file\\+\\(.*\\)$" type)
3152 (setq application (match-string 1 type))) 3154 (setq application (match-string 1 type)))
3153 ((not (string-match "^file" type)) 3155 ((not (string-match "^file" type))
3154 (setq application type))) 3156 (setq application type)))
3155 ;; Extract search option from PATH. 3157 (when (string-match "::\\(.*\\)\\'" path)
3156 (when (string-match "::\\(.*\\)$" path)
3157 (setq search-option (match-string 1 path) 3158 (setq search-option (match-string 1 path)
3158 path (replace-match "" nil nil path))) 3159 path (replace-match "" nil nil path)))
3160 ;; Normalize URI.
3161 (when (and (not (org-string-match-p "\\`//" path))
3162 (file-name-absolute-p path))
3163 (setq path (concat "//" (expand-file-name path))))
3159 ;; Make sure TYPE always reports "file". 3164 ;; Make sure TYPE always reports "file".
3160 (setq type "file")) 3165 (setq type "file"))
3161 (list 'link 3166 (list 'link
@@ -3463,7 +3468,7 @@ CONTENTS is the contents of the object."
3463Return a list whose CAR is `table-cell' and CDR is a plist 3468Return a list whose CAR is `table-cell' and CDR is a plist
3464containing `:begin', `:end', `:contents-begin', `:contents-end' 3469containing `:begin', `:end', `:contents-begin', `:contents-end'
3465and `:post-blank' keywords." 3470and `:post-blank' keywords."
3466 (looking-at "[ \t]*\\(.*?\\)[ \t]*|") 3471 (looking-at "[ \t]*\\(.*?\\)[ \t]*\\(?:|\\|$\\)")
3467 (let* ((begin (match-beginning 0)) 3472 (let* ((begin (match-beginning 0))
3468 (end (match-end 0)) 3473 (end (match-end 0))
3469 (contents-begin (match-beginning 1)) 3474 (contents-begin (match-beginning 1))
@@ -3485,7 +3490,7 @@ CONTENTS is the contents of the cell, or nil."
3485 3490
3486Return value is a cons cell whose CAR is `table-cell' and CDR is 3491Return value is a cons cell whose CAR is `table-cell' and CDR is
3487beginning position." 3492beginning position."
3488 (when (looking-at "[ \t]*.*?[ \t]*|") (cons 'table-cell (point)))) 3493 (when (looking-at "[ \t]*.*?[ \t]*\\(|\\|$\\)") (cons 'table-cell (point))))
3489 3494
3490 3495
3491;;;; Target 3496;;;; Target
@@ -3809,8 +3814,8 @@ CONTENTS is nil."
3809;; point. 3814;; point.
3810;; 3815;;
3811;; `org-element--current-element' makes use of special modes. They 3816;; `org-element--current-element' makes use of special modes. They
3812;; are activated for fixed element chaining (i.e. `plain-list' > 3817;; are activated for fixed element chaining (e.g., `plain-list' >
3813;; `item') or fixed conditional element chaining (i.e. `headline' > 3818;; `item') or fixed conditional element chaining (e.g., `headline' >
3814;; `section'). Special modes are: `first-section', `item', 3819;; `section'). Special modes are: `first-section', `item',
3815;; `node-property', `quote-section', `section' and `table-row'. 3820;; `node-property', `quote-section', `section' and `table-row'.
3816 3821
@@ -3954,7 +3959,7 @@ CDR a plist of keywords and values and move point to the
3954beginning of the first line after them. 3959beginning of the first line after them.
3955 3960
3956As a special case, if element doesn't start at the beginning of 3961As a special case, if element doesn't start at the beginning of
3957the line (i.e. a paragraph starting an item), CAR is current 3962the line (e.g., a paragraph starting an item), CAR is current
3958position of point and CDR is nil." 3963position of point and CDR is nil."
3959 (if (not (bolp)) (list (point)) 3964 (if (not (bolp)) (list (point))
3960 (let ((case-fold-search t) 3965 (let ((case-fold-search t)
@@ -4489,8 +4494,8 @@ Return Org syntax as a string."
4489 (mapconcat 4494 (mapconcat
4490 (lambda (obj) (org-element-interpret-data obj parent)) 4495 (lambda (obj) (org-element-interpret-data obj parent))
4491 (org-element-contents data) "")) 4496 (org-element-contents data) ""))
4492 ;; Plain text: remove `:parent' text property from output. 4497 ;; Plain text: return it.
4493 ((stringp data) (org-no-properties data)) 4498 ((stringp data) data)
4494 ;; Element/Object without contents. 4499 ;; Element/Object without contents.
4495 ((not (org-element-contents data)) 4500 ((not (org-element-contents data))
4496 (funcall (intern (format "org-element-%s-interpreter" type)) 4501 (funcall (intern (format "org-element-%s-interpreter" type))
@@ -4609,71 +4614,65 @@ indentation to compute maximal common indentation.
4609Return the normalized element that is element with global 4614Return the normalized element that is element with global
4610indentation removed from its contents. The function assumes that 4615indentation removed from its contents. The function assumes that
4611indentation is not done with TAB characters." 4616indentation is not done with TAB characters."
4612 (let* (ind-list ; for byte-compiler 4617 (let* ((min-ind most-positive-fixnum)
4613 collect-inds ; for byte-compiler 4618 find-min-ind ; For byte-compiler.
4614 (collect-inds 4619 (find-min-ind
4615 (function 4620 (function
4616 ;; Return list of indentations within BLOB. This is done by 4621 ;; Return minimal common indentation within BLOB. This is
4617 ;; walking recursively BLOB and updating IND-LIST along the 4622 ;; done by walking recursively BLOB and updating MIN-IND
4618 ;; way. FIRST-FLAG is non-nil when the first string hasn't 4623 ;; along the way. FIRST-FLAG is non-nil when the first
4619 ;; been seen yet. It is required as this string is the only 4624 ;; string hasn't been seen yet. It is required as this
4620 ;; one whose indentation doesn't happen after a newline 4625 ;; string is the only one whose indentation doesn't happen
4621 ;; character. 4626 ;; after a newline character.
4622 (lambda (blob first-flag) 4627 (lambda (blob first-flag)
4623 (mapc 4628 (dolist (object (org-element-contents blob))
4624 (lambda (object) 4629 (when (and first-flag (stringp object))
4625 (when (and first-flag (stringp object)) 4630 (setq first-flag nil)
4626 (setq first-flag nil) 4631 (string-match "\\`\\( *\\)" object)
4627 (string-match "\\`\\( *\\)" object) 4632 (let ((len (length (match-string 1 object))))
4628 (let ((len (length (match-string 1 object)))) 4633 ;; An indentation of zero means no string will be
4629 ;; An indentation of zero means no string will be 4634 ;; modified. Quit the process.
4630 ;; modified. Quit the process. 4635 (if (zerop len) (throw 'zero (setq min-ind 0))
4631 (if (zerop len) (throw 'zero (setq ind-list nil)) 4636 (setq min-ind (min len min-ind)))))
4632 (push len ind-list)))) 4637 (cond
4633 (cond 4638 ((stringp object)
4634 ((stringp object) 4639 (dolist (line (delq "" (cdr (org-split-string object " *\n"))))
4635 (let ((start 0)) 4640 (setq min-ind (min (org-get-indentation line) min-ind))))
4636 ;; Avoid matching blank or empty lines. 4641 ((memq (org-element-type object) org-element-recursive-objects)
4637 (while (and (string-match "\n\\( *\\)\\(.\\)" object start) 4642 (funcall find-min-ind object first-flag))))))))
4638 (not (equal (match-string 2 object) " "))) 4643 ;; Find minimal indentation in ELEMENT.
4639 (setq start (match-end 0)) 4644 (catch 'zero (funcall find-min-ind element (not ignore-first)))
4640 (push (length (match-string 1 object)) ind-list)))) 4645 (if (or (zerop min-ind) (= min-ind most-positive-fixnum)) element
4641 ((memq (org-element-type object) org-element-recursive-objects)
4642 (funcall collect-inds object first-flag))))
4643 (org-element-contents blob))))))
4644 ;; Collect indentation list in ELEMENT. Possibly remove first
4645 ;; value if IGNORE-FIRST is non-nil.
4646 (catch 'zero (funcall collect-inds element (not ignore-first)))
4647 (if (not ind-list) element
4648 ;; Build ELEMENT back, replacing each string with the same 4646 ;; Build ELEMENT back, replacing each string with the same
4649 ;; string minus common indentation. 4647 ;; string minus common indentation.
4650 (let* (build ; For byte compiler. 4648 (let* (build ; For byte compiler.
4651 (build 4649 (build
4652 (function 4650 (function
4653 (lambda (blob mci first-flag) 4651 (lambda (blob first-flag)
4654 ;; Return BLOB with all its strings indentation 4652 ;; Return BLOB with all its strings indentation
4655 ;; shortened from MCI white spaces. FIRST-FLAG is 4653 ;; shortened from MIN-IND white spaces. FIRST-FLAG
4656 ;; non-nil when the first string hasn't been seen 4654 ;; is non-nil when the first string hasn't been seen
4657 ;; yet. 4655 ;; yet.
4658 (setcdr (cdr blob) 4656 (setcdr (cdr blob)
4659 (mapcar 4657 (mapcar
4660 (lambda (object) 4658 #'(lambda (object)
4661 (when (and first-flag (stringp object)) 4659 (when (and first-flag (stringp object))
4662 (setq first-flag nil) 4660 (setq first-flag nil)
4663 (setq object 4661 (setq object
4664 (replace-regexp-in-string 4662 (replace-regexp-in-string
4665 (format "\\` \\{%d\\}" mci) "" object))) 4663 (format "\\` \\{%d\\}" min-ind)
4666 (cond 4664 "" object)))
4667 ((stringp object) 4665 (cond
4668 (replace-regexp-in-string 4666 ((stringp object)
4669 (format "\n \\{%d\\}" mci) "\n" object)) 4667 (replace-regexp-in-string
4670 ((memq (org-element-type object) 4668 (format "\n \\{%d\\}" min-ind) "\n" object))
4671 org-element-recursive-objects) 4669 ((memq (org-element-type object)
4672 (funcall build object mci first-flag)) 4670 org-element-recursive-objects)
4673 (t object))) 4671 (funcall build object first-flag))
4672 (t object)))
4674 (org-element-contents blob))) 4673 (org-element-contents blob)))
4675 blob)))) 4674 blob))))
4676 (funcall build element (apply 'min ind-list) (not ignore-first)))))) 4675 (funcall build element (not ignore-first))))))
4677 4676
4678 4677
4679 4678
@@ -4873,8 +4872,8 @@ Providing it allows for quicker computation."
4873 ;; their title. 4872 ;; their title.
4874 ((memq type '(headline inlinetask)) 4873 ((memq type '(headline inlinetask))
4875 (goto-char (org-element-property :begin element)) 4874 (goto-char (org-element-property :begin element))
4876 (skip-chars-forward "* ") 4875 (skip-chars-forward "*")
4877 (if (and (>= origin (point)) (< origin (line-end-position))) 4876 (if (and (> origin (point)) (< origin (line-end-position)))
4878 (narrow-to-region (point) (line-end-position)) 4877 (narrow-to-region (point) (line-end-position))
4879 (throw 'objects-forbidden element))) 4878 (throw 'objects-forbidden element)))
4880 ;; At a paragraph, a table-row or a verse block, objects are 4879 ;; At a paragraph, a table-row or a verse block, objects are
@@ -4896,6 +4895,16 @@ Providing it allows for quicker computation."
4896 (if (and (>= origin (point)) (< origin (line-end-position))) 4895 (if (and (>= origin (point)) (< origin (line-end-position)))
4897 (narrow-to-region (point) (line-end-position)) 4896 (narrow-to-region (point) (line-end-position))
4898 (throw 'objects-forbidden element)))) 4897 (throw 'objects-forbidden element))))
4898 ;; At a planning line, if point is at a timestamp, return it,
4899 ;; otherwise, return element.
4900 ((eq type 'planning)
4901 (dolist (p '(:closed :deadline :scheduled))
4902 (let ((timestamp (org-element-property p element)))
4903 (when (and timestamp
4904 (<= (org-element-property :begin timestamp) origin)
4905 (> (org-element-property :end timestamp) origin))
4906 (throw 'objects-forbidden timestamp))))
4907 (throw 'objects-forbidden element))
4899 (t (throw 'objects-forbidden element))) 4908 (t (throw 'objects-forbidden element)))
4900 (goto-char (point-min)) 4909 (goto-char (point-min))
4901 (let ((restriction (org-element-restriction type)) 4910 (let ((restriction (org-element-restriction type))
diff --git a/lisp/org/org-entities.el b/lisp/org/org-entities.el
index 3670f365137..ba1eed12bdb 100644
--- a/lisp/org/org-entities.el
+++ b/lisp/org/org-entities.el
@@ -598,7 +598,9 @@ Kind can be any of `latex', `html', `ascii', `latin1', or `utf8'."
598 (princ (format " %-8s \\%-16s %-22s %-13s\n" 598 (princ (format " %-8s \\%-16s %-22s %-13s\n"
599 utf8 name latex html)))))) 599 utf8 name latex html))))))
600 (with-current-buffer "*Org Entity Help*" 600 (with-current-buffer "*Org Entity Help*"
601 (org-mode)) 601 (org-mode)
602 (when org-pretty-entities
603 (org-toggle-pretty-entities)))
602 (select-window (get-buffer-window "*Org Entity Help*"))) 604 (select-window (get-buffer-window "*Org Entity Help*")))
603 605
604 606
diff --git a/lisp/org/org-mobile.el b/lisp/org/org-mobile.el
index f5a4ae90378..f59d1c47911 100644
--- a/lisp/org/org-mobile.el
+++ b/lisp/org/org-mobile.el
@@ -460,6 +460,7 @@ agenda view showing the flagged items."
460 ((stringp x) x) 460 ((stringp x) x)
461 ((eq (car x) :startgroup) "{") 461 ((eq (car x) :startgroup) "{")
462 ((eq (car x) :endgroup) "}") 462 ((eq (car x) :endgroup) "}")
463 ((eq (car x) :grouptags) nil)
463 ((eq (car x) :newline) nil) 464 ((eq (car x) :newline) nil)
464 ((listp x) (car x)))) 465 ((listp x) (car x))))
465 def-tags)) 466 def-tags))
diff --git a/lisp/org/org-src.el b/lisp/org/org-src.el
index b8d7c672be9..f870b2c714d 100644
--- a/lisp/org/org-src.el
+++ b/lisp/org/org-src.el
@@ -348,7 +348,7 @@ the display of windows containing the Org buffer and the code buffer."
348 (condition-case e 348 (condition-case e
349 (funcall lang-f) 349 (funcall lang-f)
350 (error 350 (error
351 (error "Language mode `%s' fails with: %S" lang-f (nth 1 e))))) 351 (message "Language mode `%s' fails with: %S" lang-f (nth 1 e)))))
352 (dolist (pair transmitted-variables) 352 (dolist (pair transmitted-variables)
353 (org-set-local (car pair) (cadr pair))) 353 (org-set-local (car pair) (cadr pair)))
354 ;; Remove protecting commas from visible part of buffer. 354 ;; Remove protecting commas from visible part of buffer.
@@ -577,14 +577,6 @@ the language, a switch telling if the content should be in a single line."
577 (pos (point)) 577 (pos (point))
578 re1 re2 single beg end lang lfmt match-re1 ind entry) 578 re1 re2 single beg end lang lfmt match-re1 ind entry)
579 (catch 'exit 579 (catch 'exit
580 (when (org-at-table.el-p)
581 (re-search-backward "^[\t]*[^ \t|\\+]" nil t)
582 (setq beg (1+ (point-at-eol)))
583 (goto-char beg)
584 (or (re-search-forward "^[\t]*[^ \t|\\+]" nil t)
585 (progn (goto-char (point-max)) (newline)))
586 (setq end (1- (point-at-bol)))
587 (throw 'exit (list beg end 'table.el nil nil 0)))
588 (while (setq entry (pop re-list)) 580 (while (setq entry (pop re-list))
589 (setq re1 (car entry) re2 (nth 1 entry) lang (nth 2 entry) 581 (setq re1 (car entry) re2 (nth 1 entry) lang (nth 2 entry)
590 single (nth 3 entry)) 582 single (nth 3 entry))
@@ -615,7 +607,15 @@ the language, a switch telling if the content should be in a single line."
615 (throw 'exit 607 (throw 'exit
616 (list (match-end 0) end 608 (list (match-end 0) end
617 (org-edit-src-get-lang lang) 609 (org-edit-src-get-lang lang)
618 single lfmt ind)))))))))))) 610 single lfmt ind)))))))))
611 (when (org-at-table.el-p)
612 (re-search-backward "^[\t]*[^ \t|\\+]" nil t)
613 (setq beg (1+ (point-at-eol)))
614 (goto-char beg)
615 (or (re-search-forward "^[\t]*[^ \t|\\+]" nil t)
616 (progn (goto-char (point-max)) (newline)))
617 (setq end (1- (point-at-bol)))
618 (throw 'exit (list beg end 'table.el nil nil 0))))))
619 619
620(defun org-edit-src-get-lang (lang) 620(defun org-edit-src-get-lang (lang)
621 "Extract the src language." 621 "Extract the src language."
@@ -737,8 +737,8 @@ with \",*\", \",#+\", \",,*\" and \",,#+\"."
737 (unless (or single preserve-indentation (= total-nindent 0)) 737 (unless (or single preserve-indentation (= total-nindent 0))
738 (setq indent (make-string total-nindent ?\ )) 738 (setq indent (make-string total-nindent ?\ ))
739 (goto-char (point-min)) 739 (goto-char (point-min))
740 (while (re-search-forward "^" nil t) 740 (while (re-search-forward "\\(^\\).+" nil t)
741 (replace-match indent))) 741 (replace-match indent nil nil nil 1)))
742 (if (org-bound-and-true-p org-edit-src-picture) 742 (if (org-bound-and-true-p org-edit-src-picture)
743 (setq total-nindent (+ total-nindent 2))) 743 (setq total-nindent (+ total-nindent 2)))
744 (setq code (buffer-string)) 744 (setq code (buffer-string))
@@ -753,14 +753,14 @@ with \",*\", \",#+\", \",,*\" and \",,#+\"."
753 (kill-buffer buffer)) 753 (kill-buffer buffer))
754 (goto-char beg) 754 (goto-char beg)
755 (when allow-write-back-p 755 (when allow-write-back-p
756 (let ((buffer-undo-list t)) 756 (undo-boundary)
757 (delete-region beg (max beg end)) 757 (delete-region beg (max beg end))
758 (unless (string-match "\\`[ \t]*\\'" code) 758 (unless (string-match "\\`[ \t]*\\'" code)
759 (insert code)) 759 (insert code))
760 ;; Make sure the overlay stays in place 760 ;; Make sure the overlay stays in place
761 (when (eq context 'save) (move-overlay ovl beg (point))) 761 (when (eq context 'save) (move-overlay ovl beg (point)))
762 (goto-char beg) 762 (goto-char beg)
763 (if single (just-one-space)))) 763 (if single (just-one-space)))
764 (if (memq t (mapcar (lambda (overlay) 764 (if (memq t (mapcar (lambda (overlay)
765 (eq (overlay-get overlay 'invisible) 765 (eq (overlay-get overlay 'invisible)
766 'org-hide-block)) 766 'org-hide-block))
diff --git a/lisp/org/org-table.el b/lisp/org/org-table.el
index 261d62f9625..c9522341106 100644
--- a/lisp/org/org-table.el
+++ b/lisp/org/org-table.el
@@ -1241,6 +1241,7 @@ is always the old value."
1241(defun org-table-field-info (arg) 1241(defun org-table-field-info (arg)
1242 "Show info about the current field, and highlight any reference at point." 1242 "Show info about the current field, and highlight any reference at point."
1243 (interactive "P") 1243 (interactive "P")
1244 (unless (org-at-table-p) (user-error "Not at a table"))
1244 (org-table-get-specials) 1245 (org-table-get-specials)
1245 (save-excursion 1246 (save-excursion
1246 (let* ((pos (point)) 1247 (let* ((pos (point))
@@ -2274,35 +2275,35 @@ KEY is \"@\" or \"$\". REPLACE is an alist of numbers to replace.
2274For all numbers larger than LIMIT, shift them by DELTA." 2275For all numbers larger than LIMIT, shift them by DELTA."
2275 (save-excursion 2276 (save-excursion
2276 (goto-char (org-table-end)) 2277 (goto-char (org-table-end))
2277 (let ((case-fold-search t) 2278 (while (let ((case-fold-search t)) (looking-at "[ \t]*#\\+tblfm:"))
2278 (s-end (save-excursion (re-search-forward "^\\S-*$\\|\\'" nil t)))) 2279 (let ((msg "The formulas in #+TBLFM have been updated")
2279 (while (re-search-forward "[ \t]*#\\+tblfm:" s-end t) 2280 (re (concat key "\\([0-9]+\\)"))
2280 (let ((msg "The formulas in #+TBLFM have been updated") 2281 (re2
2281 (re (concat key "\\([0-9]+\\)")) 2282 (when remove
2282 (re2 2283 (if (or (equal key "$") (equal key "$LR"))
2283 (when remove 2284 (format "\\(@[0-9]+\\)?%s%d=.*?\\(::\\|$\\)"
2284 (if (or (equal key "$") (equal key "$LR")) 2285 (regexp-quote key) remove)
2285 (format "\\(@[0-9]+\\)?%s%d=.*?\\(::\\|$\\)" 2286 (format "@%d\\$[0-9]+=.*?\\(::\\|$\\)" remove))))
2286 (regexp-quote key) remove) 2287 s n a)
2287 (format "@%d\\$[0-9]+=.*?\\(::\\|$\\)" remove)))) 2288 (when remove
2288 s n a) 2289 (while (re-search-forward re2 (point-at-eol) t)
2289 (when remove
2290 (while (re-search-forward re2 (point-at-eol) t)
2291 (unless (save-match-data (org-in-regexp "remote([^)]+?)"))
2292 (if (equal (char-before (match-beginning 0)) ?.)
2293 (user-error "Change makes TBLFM term %s invalid, use undo to recover"
2294 (match-string 0))
2295 (replace-match "")))))
2296 (while (re-search-forward re (point-at-eol) t)
2297 (unless (save-match-data (org-in-regexp "remote([^)]+?)")) 2290 (unless (save-match-data (org-in-regexp "remote([^)]+?)"))
2298 (setq s (match-string 1) n (string-to-number s)) 2291 (if (equal (char-before (match-beginning 0)) ?.)
2299 (cond 2292 (user-error
2300 ((setq a (assoc s replace)) 2293 "Change makes TBLFM term %s invalid, use undo to recover"
2301 (replace-match (concat key (cdr a)) t t) 2294 (match-string 0))
2302 (message msg)) 2295 (replace-match "")))))
2303 ((and limit (> n limit)) 2296 (while (re-search-forward re (point-at-eol) t)
2304 (replace-match (concat key (int-to-string (+ n delta))) t t) 2297 (unless (save-match-data (org-in-regexp "remote([^)]+?)"))
2305 (message msg)))))))))) 2298 (setq s (match-string 1) n (string-to-number s))
2299 (cond
2300 ((setq a (assoc s replace))
2301 (replace-match (concat key (cdr a)) t t)
2302 (message msg))
2303 ((and limit (> n limit))
2304 (replace-match (concat key (int-to-string (+ n delta))) t t)
2305 (message msg))))))
2306 (forward-line))))
2306 2307
2307(defun org-table-get-specials () 2308(defun org-table-get-specials ()
2308 "Get the column names and local parameters for this table." 2309 "Get the column names and local parameters for this table."
diff --git a/lisp/org/org-timer.el b/lisp/org/org-timer.el
index 55540276ea2..1a86ffa7488 100644
--- a/lisp/org/org-timer.el
+++ b/lisp/org/org-timer.el
@@ -156,12 +156,14 @@ With prefix arg STOP, stop it entirely."
156 (org-timer-set-mode-line 'pause) 156 (org-timer-set-mode-line 'pause)
157 (message "Timer paused at %s" (org-timer-value-string))))) 157 (message "Timer paused at %s" (org-timer-value-string)))))
158 158
159(defvar org-timer-current-timer nil)
159(defun org-timer-stop () 160(defun org-timer-stop ()
160 "Stop the relative timer." 161 "Stop the relative timer."
161 (interactive) 162 (interactive)
162 (run-hooks 'org-timer-stop-hook) 163 (run-hooks 'org-timer-stop-hook)
163 (setq org-timer-start-time nil 164 (setq org-timer-start-time nil
164 org-timer-pause-time nil) 165 org-timer-pause-time nil
166 org-timer-current-timer nil)
165 (org-timer-set-mode-line 'off) 167 (org-timer-set-mode-line 'off)
166 (message "Timer stopped")) 168 (message "Timer stopped"))
167 169
@@ -344,7 +346,6 @@ VALUE can be `on', `off', or `pause'."
344 (concat " <" (substring (org-timer-value-string) 0 -1) ">")) 346 (concat " <" (substring (org-timer-value-string) 0 -1) ">"))
345 (force-mode-line-update))) 347 (force-mode-line-update)))
346 348
347(defvar org-timer-current-timer nil)
348(defun org-timer-cancel-timer () 349(defun org-timer-cancel-timer ()
349 "Cancel the current timer." 350 "Cancel the current timer."
350 (interactive) 351 (interactive)
diff --git a/lisp/org/org-version.el b/lisp/org/org-version.el
index d6317274bd3..4909d45530a 100644
--- a/lisp/org/org-version.el
+++ b/lisp/org/org-version.el
@@ -5,13 +5,13 @@
5(defun org-release () 5(defun org-release ()
6 "The release version of org-mode. 6 "The release version of org-mode.
7 Inserted by installing org-mode or when a release is made." 7 Inserted by installing org-mode or when a release is made."
8 (let ((org-release "8.2.5c")) 8 (let ((org-release "8.2.6"))
9 org-release)) 9 org-release))
10;;;###autoload 10;;;###autoload
11(defun org-git-version () 11(defun org-git-version ()
12 "The Git version of org-mode. 12 "The Git version of org-mode.
13 Inserted by installing org-mode or when a release is made." 13 Inserted by installing org-mode or when a release is made."
14 (let ((org-git-version "release_8.2.5c")) 14 (let ((org-git-version "release_8.2.6-1"))
15 org-git-version)) 15 org-git-version))
16 16
17(provide 'org-version) 17(provide 'org-version)
diff --git a/lisp/org/org.el b/lisp/org/org.el
index edbcc09cd10..2a451ed5456 100644
--- a/lisp/org/org.el
+++ b/lisp/org/org.el
@@ -813,10 +813,11 @@ Also apply the translations defined in `org-xemacs-key-equivalents'."
813 813
814(defcustom org-ellipsis nil 814(defcustom org-ellipsis nil
815 "The ellipsis to use in the Org-mode outline. 815 "The ellipsis to use in the Org-mode outline.
816When nil, just use the standard three dots. When a string, use that instead, 816When nil, just use the standard three dots.
817When a string, use that string instead.
817When a face, use the standard 3 dots, but with the specified face. 818When a face, use the standard 3 dots, but with the specified face.
818The change affects only Org-mode (which will then use its own display table). 819The change affects only Org-mode (which will then use its own display table).
819Changing this requires executing `M-x org-mode' in a buffer to become 820Changing this requires executing `M-x org-mode RET' in a buffer to become
820effective." 821effective."
821 :group 'org-startup 822 :group 'org-startup
822 :type '(choice (const :tag "Default" nil) 823 :type '(choice (const :tag "Default" nil)
@@ -3707,12 +3708,12 @@ This is a property list with the following properties:
3707 the same numbers for HTML export. 3708 the same numbers for HTML export.
3708:matchers a list indicating which matchers should be used to 3709:matchers a list indicating which matchers should be used to
3709 find LaTeX fragments. Valid members of this list are: 3710 find LaTeX fragments. Valid members of this list are:
3710 \"begin\" find environments 3711 \"begin\" find environments
3711 \"$1\" find single characters surrounded by $.$ 3712 \"$1\" find single characters surrounded by $.$
3712 \"$\" find math expressions surrounded by $...$ 3713 \"$\" find math expressions surrounded by $...$
3713 \"$$\" find math expressions surrounded by $$....$$ 3714 \"$$\" find math expressions surrounded by $$....$$
3714 \"\\(\" find math expressions surrounded by \\(...\\) 3715 \"\\(\" find math expressions surrounded by \\(...\\)
3715 \"\\ [\" find math expressions surrounded by \\ [...\\]" 3716 \"\\=\\[\" find math expressions surrounded by \\=\\[...\\]"
3716 :group 'org-latex 3717 :group 'org-latex
3717 :type 'plist) 3718 :type 'plist)
3718 3719
@@ -3873,10 +3874,18 @@ Org mode to function properly:
3873Therefore you should not modify this variable unless you know 3874Therefore you should not modify this variable unless you know
3874what you are doing. The one reason to change it anyway is that 3875what you are doing. The one reason to change it anyway is that
3875you might be loading some other package that conflicts with one 3876you might be loading some other package that conflicts with one
3876of the default packages. Each cell is of the format 3877of the default packages. Each element is either a cell or
3877\( \"options\" \"package\" snippet-flag). If SNIPPET-FLAG is t, 3878a string.
3878the package also needs to be included when compiling LaTeX 3879
3879snippets into images for inclusion into non-LaTeX output." 3880A cell is of the format:
3881
3882 \( \"options\" \"package\" SNIPPET-FLAG).
3883
3884If SNIPPET-FLAG is non-nil, the package also needs to be included
3885when compiling LaTeX snippets into images for inclusion into
3886non-LaTeX output.
3887
3888A string will be inserted as-is in the header of the document."
3880 :group 'org-latex 3889 :group 'org-latex
3881 :group 'org-export-latex 3890 :group 'org-export-latex
3882 :set 'org-set-packages-alist 3891 :set 'org-set-packages-alist
@@ -3894,18 +3903,22 @@ snippets into images for inclusion into non-LaTeX output."
3894 "Alist of packages to be inserted in every LaTeX header. 3903 "Alist of packages to be inserted in every LaTeX header.
3895 3904
3896These will be inserted after `org-latex-default-packages-alist'. 3905These will be inserted after `org-latex-default-packages-alist'.
3897Each cell is of the format: 3906Each element is either a cell or a string.
3907
3908A cell is of the format:
3898 3909
3899 \(\"options\" \"package\" snippet-flag) 3910 \(\"options\" \"package\" SNIPPET-FLAG)
3900 3911
3901SNIPPET-FLAG, when t, indicates that this package is also needed 3912SNIPPET-FLAG, when non-nil, indicates that this package is also
3902when turning LaTeX snippets into images for inclusion into 3913needed when turning LaTeX snippets into images for inclusion into
3903non-LaTeX output. 3914non-LaTeX output.
3904 3915
3916A string will be inserted as-is in the header of the document.
3917
3905Make sure that you only list packages here which: 3918Make sure that you only list packages here which:
3906 3919
3907 - you want in every file 3920 - you want in every file;
3908 - do not conflict with the setup in `org-format-latex-header'. 3921 - do not conflict with the setup in `org-format-latex-header';
3909 - do not conflict with the default packages in 3922 - do not conflict with the default packages in
3910 `org-latex-default-packages-alist'." 3923 `org-latex-default-packages-alist'."
3911 :group 'org-latex 3924 :group 'org-latex
@@ -4119,8 +4132,8 @@ You need to reload Org or to restart Emacs after customizing this.")
4119 `(("*" bold) 4132 `(("*" bold)
4120 ("/" italic) 4133 ("/" italic)
4121 ("_" underline) 4134 ("_" underline)
4122 ("=" org-code verbatim) 4135 ("=" org-verbatim verbatim)
4123 ("~" org-verbatim verbatim) 4136 ("~" org-code verbatim)
4124 ("+" ,(if (featurep 'xemacs) 'org-table '(:strike-through t)))) 4137 ("+" ,(if (featurep 'xemacs) 'org-table '(:strike-through t))))
4125 "Alist of characters and faces to emphasize text. 4138 "Alist of characters and faces to emphasize text.
4126Text starting and ending with a special character will be emphasized, 4139Text starting and ending with a special character will be emphasized,
@@ -4381,14 +4394,6 @@ If yes, offer to stop it and to save the buffer with the changes."
4381 (add-hook 'org-mode-hook 'org-clock-load) 4394 (add-hook 'org-mode-hook 'org-clock-load)
4382 (add-hook 'kill-emacs-hook 'org-clock-save)) 4395 (add-hook 'kill-emacs-hook 'org-clock-save))
4383 4396
4384;; Define the variable already here, to make sure we have it.
4385(defvar org-indent-mode nil
4386 "Non-nil if Org-Indent mode is enabled.
4387Use the command `org-indent-mode' to change this variable.")
4388
4389;; Autoload archiving code
4390;; The stuff that is needed for cycling and tags has to be defined here.
4391
4392(defgroup org-archive nil 4397(defgroup org-archive nil
4393 "Options concerning archiving in Org-mode." 4398 "Options concerning archiving in Org-mode."
4394 :tag "Org Archive" 4399 :tag "Org Archive"
@@ -5160,11 +5165,11 @@ Support for group tags is controlled by the option
5160 5165
5161(defun org-file-contents (file &optional noerror) 5166(defun org-file-contents (file &optional noerror)
5162 "Return the contents of FILE, as a string." 5167 "Return the contents of FILE, as a string."
5163 (if (or (not file) 5168 (if (or (not file) (not (file-readable-p file)))
5164 (not (file-readable-p file))) 5169 (if (not noerror)
5165 (if noerror 5170 (error "Cannot read file \"%s\"" file)
5166 (message "Cannot read file \"%s\"" file) 5171 (message "Cannot read file \"%s\"" file)
5167 (error "Cannot read file \"%s\"" file)) 5172 "")
5168 (with-temp-buffer 5173 (with-temp-buffer
5169 (insert-file-contents file) 5174 (insert-file-contents file)
5170 (buffer-string)))) 5175 (buffer-string))))
@@ -5348,6 +5353,8 @@ The following commands are available:
5348 ;; Modify a few syntax entries 5353 ;; Modify a few syntax entries
5349 (modify-syntax-entry ?@ "w") 5354 (modify-syntax-entry ?@ "w")
5350 (modify-syntax-entry ?\" "\"") 5355 (modify-syntax-entry ?\" "\"")
5356 (modify-syntax-entry ?\\ "_")
5357 (modify-syntax-entry ?~ "_")
5351 (if org-startup-truncated (setq truncate-lines t)) 5358 (if org-startup-truncated (setq truncate-lines t))
5352 (when org-startup-indented (require 'org-indent) (org-indent-mode 1)) 5359 (when org-startup-indented (require 'org-indent) (org-indent-mode 1))
5353 (org-set-local 'font-lock-unfontify-region-function 5360 (org-set-local 'font-lock-unfontify-region-function
@@ -5371,7 +5378,12 @@ The following commands are available:
5371 (org-setup-comments-handling) 5378 (org-setup-comments-handling)
5372 ;; Beginning/end of defun 5379 ;; Beginning/end of defun
5373 (org-set-local 'beginning-of-defun-function 'org-backward-element) 5380 (org-set-local 'beginning-of-defun-function 'org-backward-element)
5374 (org-set-local 'end-of-defun-function 'org-forward-element) 5381 (org-set-local 'end-of-defun-function
5382 (lambda ()
5383 (if (not (org-at-heading-p))
5384 (org-forward-element)
5385 (org-forward-element)
5386 (forward-char -1))))
5375 ;; Next error for sparse trees 5387 ;; Next error for sparse trees
5376 (org-set-local 'next-error-function 'org-occur-next-match) 5388 (org-set-local 'next-error-function 'org-occur-next-match)
5377 ;; Make sure dependence stuff works reliably, even for users who set it 5389 ;; Make sure dependence stuff works reliably, even for users who set it
@@ -5438,13 +5450,15 @@ The following commands are available:
5438 (unless org-inhibit-startup-visibility-stuff 5450 (unless org-inhibit-startup-visibility-stuff
5439 (org-set-startup-visibility)))) 5451 (org-set-startup-visibility))))
5440 ;; Try to set org-hide correctly 5452 ;; Try to set org-hide correctly
5441 (set-face-foreground 'org-hide (org-find-invisible-foreground))) 5453 (let ((foreground (org-find-invisible-foreground)))
5454 (if foreground
5455 (set-face-foreground 'org-hide foreground))))
5442 5456
5443;; Update `customize-package-emacs-version-alist' 5457;; Update `customize-package-emacs-version-alist'
5444(add-to-list 'customize-package-emacs-version-alist 5458(add-to-list 'customize-package-emacs-version-alist
5445 '(Org ("6.21b" . "23.1") ("6.33x" . "23.2") 5459 '(Org ("6.21b" . "23.1") ("6.33x" . "23.2")
5446 ("7.8.11" . "24.1") ("7.9.4" . "24.3") 5460 ("7.8.11" . "24.1") ("7.9.4" . "24.3")
5447 ("8.0" . "24.4"))) 5461 ("8.2.6" . "24.4")))
5448 5462
5449(defvar org-mode-transpose-word-syntax-table 5463(defvar org-mode-transpose-word-syntax-table
5450 (let ((st (make-syntax-table))) 5464 (let ((st (make-syntax-table)))
@@ -5584,59 +5598,55 @@ stacked delimiters is N. Escaping delimiters is not possible."
5584(defun org-make-link-regexps () 5598(defun org-make-link-regexps ()
5585 "Update the link regular expressions. 5599 "Update the link regular expressions.
5586This should be called after the variable `org-link-types' has changed." 5600This should be called after the variable `org-link-types' has changed."
5587 (setq org-link-types-re 5601 (let ((types-re (regexp-opt org-link-types t)))
5588 (concat 5602 (setq org-link-types-re
5589 "\\`\\(" (mapconcat 'regexp-quote org-link-types "\\|") "\\):") 5603 (concat "\\`" types-re ":")
5590 org-link-re-with-space 5604 org-link-re-with-space
5591 (concat 5605 (concat "<?" types-re ":"
5592 "<?\\(" (mapconcat 'regexp-quote org-link-types "\\|") "\\):" 5606 "\\([^" org-non-link-chars " ]"
5593 "\\([^" org-non-link-chars " ]" 5607 "[^" org-non-link-chars "]*"
5594 "[^" org-non-link-chars "]*" 5608 "[^" org-non-link-chars " ]\\)>?")
5595 "[^" org-non-link-chars " ]\\)>?") 5609 org-link-re-with-space2
5596 org-link-re-with-space2 5610 (concat "<?" types-re ":"
5597 (concat 5611 "\\([^" org-non-link-chars " ]"
5598 "<?\\(" (mapconcat 'regexp-quote org-link-types "\\|") "\\):" 5612 "[^\t\n\r]*"
5599 "\\([^" org-non-link-chars " ]" 5613 "[^" org-non-link-chars " ]\\)>?")
5600 "[^\t\n\r]*" 5614 org-link-re-with-space3
5601 "[^" org-non-link-chars " ]\\)>?") 5615 (concat "<?" types-re ":"
5602 org-link-re-with-space3 5616 "\\([^" org-non-link-chars " ]"
5603 (concat 5617 "[^\t\n\r]*\\)")
5604 "<?\\(" (mapconcat 'regexp-quote org-link-types "\\|") "\\):" 5618 org-angle-link-re
5605 "\\([^" org-non-link-chars " ]" 5619 (concat "<" types-re ":"
5606 "[^\t\n\r]*\\)") 5620 "\\([^" org-non-link-chars " ]"
5607 org-angle-link-re 5621 "[^" org-non-link-chars "]*"
5608 (concat 5622 "\\)>")
5609 "<\\(" (mapconcat 'regexp-quote org-link-types "\\|") "\\):" 5623 org-plain-link-re
5610 "\\([^" org-non-link-chars " ]" 5624 (concat
5611 "[^" org-non-link-chars "]*" 5625 "\\<" types-re ":"
5612 "\\)>") 5626 (org-re "\\([^ \t\n()<>]+\\(?:([[:word:]0-9_]+)\\|\\([^[:punct:] \t\n]\\|/\\)\\)\\)"))
5613 org-plain-link-re 5627 ;; "\\([^]\t\n\r<>() ]+[^]\t\n\r<>,.;() ]\\)")
5614 (concat 5628 org-bracket-link-regexp
5615 "\\<\\(" (mapconcat 'regexp-quote org-link-types "\\|") "\\):" 5629 "\\[\\[\\([^][]+\\)\\]\\(\\[\\([^][]+\\)\\]\\)?\\]"
5616 (org-re "\\([^ \t\n()<>]+\\(?:([[:word:]0-9_]+)\\|\\([^[:punct:] \t\n]\\|/\\)\\)\\)")) 5630 org-bracket-link-analytic-regexp
5617 ;; "\\([^]\t\n\r<>() ]+[^]\t\n\r<>,.;() ]\\)") 5631 (concat
5618 org-bracket-link-regexp 5632 "\\[\\["
5619 "\\[\\[\\([^][]+\\)\\]\\(\\[\\([^][]+\\)\\]\\)?\\]" 5633 "\\(" types-re ":\\)?"
5620 org-bracket-link-analytic-regexp 5634 "\\([^]]+\\)"
5621 (concat 5635 "\\]"
5622 "\\[\\[" 5636 "\\(\\[" "\\([^]]+\\)" "\\]\\)?"
5623 "\\(\\(" (mapconcat 'regexp-quote org-link-types "\\|") "\\):\\)?" 5637 "\\]")
5624 "\\([^]]+\\)" 5638 org-bracket-link-analytic-regexp++
5625 "\\]" 5639 (concat
5626 "\\(\\[" "\\([^]]+\\)" "\\]\\)?" 5640 "\\[\\["
5627 "\\]") 5641 "\\(" (regexp-opt (cons "coderef" org-link-types) t) ":\\)?"
5628 org-bracket-link-analytic-regexp++ 5642 "\\([^]]+\\)"
5629 (concat 5643 "\\]"
5630 "\\[\\[" 5644 "\\(\\[" "\\([^]]+\\)" "\\]\\)?"
5631 "\\(\\(" (mapconcat 'regexp-quote (cons "coderef" org-link-types) "\\|") "\\):\\)?" 5645 "\\]")
5632 "\\([^]]+\\)" 5646 org-any-link-re
5633 "\\]" 5647 (concat "\\(" org-bracket-link-regexp "\\)\\|\\("
5634 "\\(\\[" "\\([^]]+\\)" "\\]\\)?" 5648 org-angle-link-re "\\)\\|\\("
5635 "\\]") 5649 org-plain-link-re "\\)"))))
5636 org-any-link-re
5637 (concat "\\(" org-bracket-link-regexp "\\)\\|\\("
5638 org-angle-link-re "\\)\\|\\("
5639 org-plain-link-re "\\)")))
5640 5650
5641(org-make-link-regexps) 5651(org-make-link-regexps)
5642 5652
@@ -5675,24 +5685,30 @@ The time stamps may be either active or inactive.")
5675 "Run through the buffer and add overlays to emphasized strings." 5685 "Run through the buffer and add overlays to emphasized strings."
5676 (let (rtn a) 5686 (let (rtn a)
5677 (while (and (not rtn) (re-search-forward org-emph-re limit t)) 5687 (while (and (not rtn) (re-search-forward org-emph-re limit t))
5678 (if (not (= (char-after (match-beginning 3)) 5688 (let* ((border (char-after (match-beginning 3)))
5679 (char-after (match-beginning 4)))) 5689 (bre (regexp-quote (char-to-string border))))
5680 (progn 5690 (if (and (not (= border (char-after (match-beginning 4))))
5681 (setq rtn t) 5691 (not (save-match-data
5682 (setq a (assoc (match-string 3) org-emphasis-alist)) 5692 (string-match (concat bre ".*" bre)
5683 (font-lock-prepend-text-property (match-beginning 2) (match-end 2) 5693 (replace-regexp-in-string
5684 'face 5694 "\n" " "
5685 (nth 1 a)) 5695 (substring (match-string 2) 1 -1))))))
5686 (and (nth 2 a) 5696 (progn
5687 (org-remove-flyspell-overlays-in 5697 (setq rtn t)
5688 (match-beginning 0) (match-end 0))) 5698 (setq a (assoc (match-string 3) org-emphasis-alist))
5689 (add-text-properties (match-beginning 2) (match-end 2) 5699 (font-lock-prepend-text-property (match-beginning 2) (match-end 2)
5690 '(font-lock-multiline t org-emphasis t)) 5700 'face
5691 (when org-hide-emphasis-markers 5701 (nth 1 a))
5692 (add-text-properties (match-end 4) (match-beginning 5) 5702 (and (nth 2 a)
5693 '(invisible org-link)) 5703 (org-remove-flyspell-overlays-in
5694 (add-text-properties (match-beginning 3) (match-end 3) 5704 (match-beginning 0) (match-end 0)))
5695 '(invisible org-link))))) 5705 (add-text-properties (match-beginning 2) (match-end 2)
5706 '(font-lock-multiline t org-emphasis t))
5707 (when org-hide-emphasis-markers
5708 (add-text-properties (match-end 4) (match-beginning 5)
5709 '(invisible org-link))
5710 (add-text-properties (match-beginning 3) (match-end 3)
5711 '(invisible org-link))))))
5696 (goto-char (1+ (match-beginning 0)))) 5712 (goto-char (1+ (match-beginning 0))))
5697 rtn)) 5713 rtn))
5698 5714
@@ -6094,7 +6110,7 @@ The regular expression finds the targets also if there is a line break
6094between words." 6110between words."
6095 (and targets 6111 (and targets
6096 (concat 6112 (concat
6097 "\\<\\(" 6113 "\\_<\\("
6098 (mapconcat 6114 (mapconcat
6099 (lambda (x) 6115 (lambda (x)
6100 (setq x (regexp-quote x)) 6116 (setq x (regexp-quote x))
@@ -6103,7 +6119,7 @@ between words."
6103 x) 6119 x)
6104 targets 6120 targets
6105 "\\|") 6121 "\\|")
6106 "\\)\\>"))) 6122 "\\)\\_>")))
6107 6123
6108(defun org-activate-tags (limit) 6124(defun org-activate-tags (limit)
6109 (if (re-search-forward (org-re "^\\*+.*[ \t]\\(:[[:alnum:]_@#%:]+:\\)[ \r\n]") limit t) 6125 (if (re-search-forward (org-re "^\\*+.*[ \t]\\(:[[:alnum:]_@#%:]+:\\)[ \r\n]") limit t)
@@ -6587,6 +6603,9 @@ in special contexts.
6587 (show-all) 6603 (show-all)
6588 (org-unlogged-message "Entire buffer visible, including drawers")) 6604 (org-unlogged-message "Entire buffer visible, including drawers"))
6589 6605
6606 ;; Try cdlatex TAB completion
6607 ((org-try-cdlatex-tab))
6608
6590 ;; Table: enter it or move to the next field. 6609 ;; Table: enter it or move to the next field.
6591 ((org-at-table-p 'any) 6610 ((org-at-table-p 'any)
6592 (if (org-at-table.el-p) 6611 (if (org-at-table.el-p)
@@ -6623,8 +6642,6 @@ in special contexts.
6623 (or (bolp) (not (eq org-cycle-emulate-tab 'exc-hl-bol)))) 6642 (or (bolp) (not (eq org-cycle-emulate-tab 'exc-hl-bol))))
6624 (org-inlinetask-toggle-visibility)) 6643 (org-inlinetask-toggle-visibility))
6625 6644
6626 ((org-try-cdlatex-tab))
6627
6628 ;; At an item/headline: delegate to `org-cycle-internal-local'. 6645 ;; At an item/headline: delegate to `org-cycle-internal-local'.
6629 ((and (or (and org-cycle-include-plain-lists (org-at-item-p)) 6646 ((and (or (and org-cycle-include-plain-lists (org-at-item-p))
6630 (save-excursion (beginning-of-line 1) 6647 (save-excursion (beginning-of-line 1)
@@ -6897,6 +6914,7 @@ results."
6897 "Show all headlines in the buffer, like a table of contents. 6914 "Show all headlines in the buffer, like a table of contents.
6898With numerical argument N, show content up to level N." 6915With numerical argument N, show content up to level N."
6899 (interactive "P") 6916 (interactive "P")
6917 (org-overview)
6900 (save-excursion 6918 (save-excursion
6901 ;; Visit all headings and show their offspring 6919 ;; Visit all headings and show their offspring
6902 (and (integerp arg) (org-overview)) 6920 (and (integerp arg) (org-overview))
@@ -7528,27 +7546,37 @@ When NEXT is non-nil, check the next line instead."
7528 7546
7529(defun org-insert-heading (&optional arg invisible-ok) 7547(defun org-insert-heading (&optional arg invisible-ok)
7530 "Insert a new heading or item with same depth at point. 7548 "Insert a new heading or item with same depth at point.
7531If point is in a plain list and ARG is nil, create a new list item.
7532With one universal prefix argument, insert a heading even in lists.
7533With two universal prefix arguments, insert the heading at the end
7534of the parent subtree.
7535 7549
7536If point is at the beginning of a headline, insert a sibling before 7550If point is at the beginning of a heading or a list item, insert
7537the current headline. If point is not at the beginning, split the line 7551a heading or a list item before it.
7538and create a new headline with the text in the current line after point 7552
7539\(see `org-M-RET-may-split-line' on how to modify this behavior). 7553If point is at the beginning of a normal line, turn this line
7554into a heading.
7555
7556If point is in the middle of a headline or a list item, split the
7557headline or the item and create a new headline/item with the text
7558in the current line after point \(see `org-M-RET-may-split-line'
7559on how to modify this behavior).
7540 7560
7541If point is at the beginning of a normal line, turn this line into 7561With one universal prefix argument: If point is within a list,
7542a heading. 7562insert a heading instead of a list item. Otherwise, set the
7563value of `org-insert-heading-respect-content' to `t' for the
7564duration of the command.
7543 7565
7544When INVISIBLE-OK is set, stop at invisible headlines when going back. 7566With two universal prefix arguments, insert the heading at the
7545This is important for non-interactive uses of the command." 7567end of the grandparent subtree. For example, if point is within
7568a 2nd-level heading, then it will insert a 2nd-level heading at
7569the end of the 1st-level parent heading.
7570
7571When INVISIBLE-OK is set, stop at invisible headlines when going
7572back. This is important for non-interactive uses of the
7573command."
7546 (interactive "P") 7574 (interactive "P")
7547 (if (org-called-interactively-p 'any) (org-reveal)) 7575 (if (org-called-interactively-p 'any) (org-reveal))
7548 (let ((itemp (org-in-item-p)) 7576 (let ((itemp (org-in-item-p))
7549 (may-split (org-get-alist-option org-M-RET-may-split-line 'headline)) 7577 (may-split (org-get-alist-option org-M-RET-may-split-line 'headline))
7550 (respect-content (or org-insert-heading-respect-content 7578 (respect-content (or org-insert-heading-respect-content
7551 (equal arg '(16)))) 7579 (equal arg '(4))))
7552 (initial-content "") 7580 (initial-content "")
7553 (adjust-empty-lines t)) 7581 (adjust-empty-lines t))
7554 7582
@@ -7571,6 +7599,10 @@ This is important for non-interactive uses of the command."
7571 (org-insert-item)) 7599 (org-insert-item))
7572 7600
7573 (t 7601 (t
7602 ;; Maybe move at the end of the subtree
7603 (when (equal arg '(16))
7604 (org-up-heading-safe)
7605 (org-end-of-subtree t))
7574 ;; Insert a heading 7606 ;; Insert a heading
7575 (save-restriction 7607 (save-restriction
7576 (widen) 7608 (widen)
@@ -7618,10 +7650,11 @@ This is important for non-interactive uses of the command."
7618 pos hide-previous previous-pos) 7650 pos hide-previous previous-pos)
7619 7651
7620 ;; If we insert after content, move there and clean up whitespace 7652 ;; If we insert after content, move there and clean up whitespace
7621 (when respect-content 7653 (when (and respect-content (not (org-on-heading-p)))
7622 (org-end-of-subtree nil t) 7654 (org-end-of-subtree nil t)
7623 (skip-chars-backward " \r\n") 7655 (skip-chars-backward " \r\n")
7624 (and (looking-at "[ \t]+") (replace-match "")) 7656 (and (not (looking-back "^\*+"))
7657 (looking-at "[ \t]+") (replace-match ""))
7625 (unless (eobp) (forward-char 1)) 7658 (unless (eobp) (forward-char 1))
7626 (when (looking-at "^\\*") 7659 (when (looking-at "^\\*")
7627 (unless (bobp) (backward-char 1)) 7660 (unless (bobp) (backward-char 1))
@@ -7765,8 +7798,8 @@ This is a list with the following elements:
7765(defun org-insert-todo-heading (arg &optional force-heading) 7798(defun org-insert-todo-heading (arg &optional force-heading)
7766 "Insert a new heading with the same level and TODO state as current heading. 7799 "Insert a new heading with the same level and TODO state as current heading.
7767If the heading has no TODO state, or if the state is DONE, use the first 7800If the heading has no TODO state, or if the state is DONE, use the first
7768state (TODO by default). Also one prefix arg, force first state. With two 7801state (TODO by default). Also with one prefix arg, force first state. With
7769prefix args, force inserting at the end of the parent subtree." 7802two prefix args, force inserting at the end of the parent subtree."
7770 (interactive "P") 7803 (interactive "P")
7771 (when (or force-heading (not (org-insert-item 'checkbox))) 7804 (when (or force-heading (not (org-insert-item 'checkbox)))
7772 (org-insert-heading (or (and (equal arg '(16)) '(16)) 7805 (org-insert-heading (or (and (equal arg '(16)) '(16))
@@ -7777,7 +7810,7 @@ prefix args, force inserting at the end of the parent subtree."
7777 (looking-at org-todo-line-regexp)) 7810 (looking-at org-todo-line-regexp))
7778 (let* 7811 (let*
7779 ((new-mark-x 7812 ((new-mark-x
7780 (if (or arg 7813 (if (or (equal arg '(4))
7781 (not (match-beginning 2)) 7814 (not (match-beginning 2))
7782 (member (match-string 2) org-done-keywords)) 7815 (member (match-string 2) org-done-keywords))
7783 (car org-todo-keywords-1) 7816 (car org-todo-keywords-1)
@@ -7887,14 +7920,10 @@ The level is the number of stars at the beginning of the headline."
7887 "Return the outline depth of the last headline before the current line. 7920 "Return the outline depth of the last headline before the current line.
7888Returns 0 for the first headline in the buffer, and nil if before the 7921Returns 0 for the first headline in the buffer, and nil if before the
7889first headline." 7922first headline."
7890 (let ((current-level (org-current-level)) 7923 (and (org-current-level)
7891 (prev-level (when (> (line-number-at-pos) 1) 7924 (or (and (/= (line-beginning-position) (point-min))
7892 (save-excursion 7925 (save-excursion (beginning-of-line 0) (org-current-level)))
7893 (beginning-of-line 0) 7926 0)))
7894 (org-current-level)))))
7895 (cond ((null current-level) nil) ; Before first headline
7896 ((null prev-level) 0) ; At first headline
7897 (prev-level))))
7898 7927
7899(defun org-reduced-level (l) 7928(defun org-reduced-level (l)
7900 "Compute the effective level of a heading. 7929 "Compute the effective level of a heading.
@@ -7946,7 +7975,7 @@ in the region."
7946 (t (replace-match up-head nil t))) 7975 (t (replace-match up-head nil t)))
7947 ;; Fixup tag positioning 7976 ;; Fixup tag positioning
7948 (unless (= level 1) 7977 (unless (= level 1)
7949 (and org-auto-align-tags (org-set-tags nil t)) 7978 (and org-auto-align-tags (org-set-tags nil 'ignore-column))
7950 (if org-adapt-indentation (org-fixup-indentation (- diff)))) 7979 (if org-adapt-indentation (org-fixup-indentation (- diff))))
7951 (run-hooks 'org-after-promote-entry-hook))) 7980 (run-hooks 'org-after-promote-entry-hook)))
7952 7981
@@ -7962,7 +7991,7 @@ in the region."
7962 (diff (abs (- level (length down-head) -1)))) 7991 (diff (abs (- level (length down-head) -1))))
7963 (replace-match down-head nil t) 7992 (replace-match down-head nil t)
7964 ;; Fixup tag positioning 7993 ;; Fixup tag positioning
7965 (and org-auto-align-tags (org-set-tags nil t)) 7994 (and org-auto-align-tags (org-set-tags nil 'ignore-column))
7966 (if org-adapt-indentation (org-fixup-indentation diff)) 7995 (if org-adapt-indentation (org-fixup-indentation diff))
7967 (run-hooks 'org-after-demote-entry-hook))) 7996 (run-hooks 'org-after-demote-entry-hook)))
7968 7997
@@ -8625,7 +8654,8 @@ links."
8625 (setq start (point) 8654 (setq start (point)
8626 end (progn (org-end-of-subtree t t) 8655 end (progn (org-end-of-subtree t t)
8627 (or (bolp) (insert "\n")) 8656 (or (bolp) (insert "\n"))
8628 (org-back-over-empty-lines) 8657 (when (>= (org-back-over-empty-lines) 1)
8658 (forward-line 1))
8629 (point)) 8659 (point))
8630 what "children") 8660 what "children")
8631 (goto-char start) 8661 (goto-char start)
@@ -8648,7 +8678,7 @@ links."
8648 (show-all))) 8678 (show-all)))
8649 8679
8650 (setq beg (point)) 8680 (setq beg (point))
8651 (if (>= beg end) (user-error "Nothing to sort")) 8681 (when (>= beg end) (goto-char start) (user-error "Nothing to sort"))
8652 8682
8653 (looking-at "\\(\\*+\\)") 8683 (looking-at "\\(\\*+\\)")
8654 (setq stars (match-string 1) 8684 (setq stars (match-string 1)
@@ -9063,7 +9093,7 @@ if `orgstruct-heading-prefix-regexp' is not empty."
9063 (key-description key)))))) 9093 (key-description key))))))
9064 thereis (key-binding key)))) 9094 thereis (key-binding key))))
9065 (if (keymapp binding) 9095 (if (keymapp binding)
9066 (set-transient-map binding) 9096 (org-set-transient-map binding)
9067 (let ((func (or binding 9097 (let ((func (or binding
9068 (unless disable 9098 (unless disable
9069 'orgstruct-error)))) 9099 'orgstruct-error))))
@@ -9277,7 +9307,7 @@ property to set."
9277 (save-excursion 9307 (save-excursion
9278 (org-back-to-heading t) 9308 (org-back-to-heading t)
9279 (put-text-property 9309 (put-text-property
9280 (point-at-bol) (org-end-of-subtree t t) tprop p)))))))) 9310 (point-at-bol) (or (outline-next-heading) (point-max)) tprop p))))))))
9281 9311
9282 9312
9283;;;; Link Stuff 9313;;;; Link Stuff
@@ -9422,7 +9452,7 @@ active region."
9422 (funcall (intern 9452 (funcall (intern
9423 (completing-read 9453 (completing-read
9424 "Which function for creating the link? " 9454 "Which function for creating the link? "
9425 sfunsn t (car sfunsn))))) 9455 sfunsn nil t (car sfunsn)))))
9426 (funcall (caar sfuns))) 9456 (funcall (caar sfuns)))
9427 (setq link (plist-get org-store-link-plist :link) 9457 (setq link (plist-get org-store-link-plist :link)
9428 desc (or (plist-get org-store-link-plist 9458 desc (or (plist-get org-store-link-plist
@@ -9529,8 +9559,9 @@ active region."
9529 ;; Store a link using the ID at point 9559 ;; Store a link using the ID at point
9530 (setq link (condition-case nil 9560 (setq link (condition-case nil
9531 (prog1 (org-id-store-link) 9561 (prog1 (org-id-store-link)
9532 (setq desc (plist-get org-store-link-plist 9562 (setq desc (or (plist-get org-store-link-plist
9533 :description))) 9563 :description)
9564 "")))
9534 (error 9565 (error
9535 ;; Probably before first headline, link only to file 9566 ;; Probably before first headline, link only to file
9536 (concat "file:" 9567 (concat "file:"
@@ -9593,7 +9624,7 @@ active region."
9593 (setq link (or link cpltxt) 9624 (setq link (or link cpltxt)
9594 desc (or desc cpltxt)) 9625 desc (or desc cpltxt))
9595 (cond ((equal desc "NONE") (setq desc nil)) 9626 (cond ((equal desc "NONE") (setq desc nil))
9596 ((string-match org-bracket-link-analytic-regexp desc) 9627 ((and desc (string-match org-bracket-link-analytic-regexp desc))
9597 (let ((d0 (match-string 3 desc)) 9628 (let ((d0 (match-string 3 desc))
9598 (p0 (match-string 5 desc))) 9629 (p0 (match-string 5 desc)))
9599 (setq desc 9630 (setq desc
@@ -9612,7 +9643,8 @@ active region."
9612 (when custom-id 9643 (when custom-id
9613 (setq link (concat "file:" (abbreviate-file-name 9644 (setq link (concat "file:" (abbreviate-file-name
9614 (buffer-file-name)) "::#" custom-id)) 9645 (buffer-file-name)) "::#" custom-id))
9615 (push (list link desc) org-stored-links))))))) 9646 (push (list link desc) org-stored-links))
9647 (car org-stored-links))))))
9616 9648
9617(defun org-store-link-props (&rest plist) 9649(defun org-store-link-props (&rest plist)
9618 "Store link properties, extract names and addresses." 9650 "Store link properties, extract names and addresses."
@@ -10269,7 +10301,7 @@ See the docstring of `org-open-file' for details."
10269This is saved in case the need arises to restore it.") 10301This is saved in case the need arises to restore it.")
10270 10302
10271(defvar org-open-link-marker (make-marker) 10303(defvar org-open-link-marker (make-marker)
10272 "Marker pointing to the location where `org-open-at-point; was called.") 10304 "Marker pointing to the location where `org-open-at-point' was called.")
10273 10305
10274;;;###autoload 10306;;;###autoload
10275(defun org-open-at-point-global () 10307(defun org-open-at-point-global ()
@@ -10349,7 +10381,8 @@ application the system uses for this file type."
10349 (let (type path link line search (pos (point))) 10381 (let (type path link line search (pos (point)))
10350 (catch 'match 10382 (catch 'match
10351 (save-excursion 10383 (save-excursion
10352 (skip-chars-forward "^]\n\r") 10384 (or (org-in-regexp org-plain-link-re)
10385 (skip-chars-forward "^]\n\r"))
10353 (when (org-in-regexp org-bracket-link-regexp 1) 10386 (when (org-in-regexp org-bracket-link-regexp 1)
10354 (setq link (org-extract-attributes 10387 (setq link (org-extract-attributes
10355 (org-link-unescape (org-match-string-no-properties 1)))) 10388 (org-link-unescape (org-match-string-no-properties 1))))
@@ -10387,9 +10420,10 @@ application the system uses for this file type."
10387 ;; Check a plain link is not within a bracket link 10420 ;; Check a plain link is not within a bracket link
10388 (and match 10421 (and match
10389 (save-excursion 10422 (save-excursion
10390 (progn 10423 (save-match-data
10391 (goto-char (car match)) 10424 (progn
10392 (not (org-in-regexp org-bracket-link-regexp)))))) 10425 (goto-char (car match))
10426 (not (org-in-regexp org-bracket-link-regexp)))))))
10393 (let ((line_ending (save-excursion (end-of-line) (point)))) 10427 (let ((line_ending (save-excursion (end-of-line) (point))))
10394 ;; We are in a line before a plain or bracket link 10428 ;; We are in a line before a plain or bracket link
10395 (or (re-search-forward org-plain-link-re line_ending t) 10429 (or (re-search-forward org-plain-link-re line_ending t)
@@ -11512,7 +11546,9 @@ prefix argument (`C-u C-u C-u C-c C-w')."
11512 (interactive "P") 11546 (interactive "P")
11513 (if (member goto '(0 (64))) 11547 (if (member goto '(0 (64)))
11514 (org-refile-cache-clear) 11548 (org-refile-cache-clear)
11515 (let* ((actionmsg (or msg "Refile")) 11549 (let* ((actionmsg (cond (msg msg)
11550 ((equal goto 3) "Refile (and keep)")
11551 (t "Refile")))
11516 (cbuf (current-buffer)) 11552 (cbuf (current-buffer))
11517 (regionp (org-region-active-p)) 11553 (regionp (org-region-active-p))
11518 (region-start (and regionp (region-beginning))) 11554 (region-start (and regionp (region-beginning)))
@@ -11547,13 +11583,13 @@ prefix argument (`C-u C-u C-u C-c C-w')."
11547 (setq it (or rfloc 11583 (setq it (or rfloc
11548 (let (heading-text) 11584 (let (heading-text)
11549 (save-excursion 11585 (save-excursion
11550 (unless goto 11586 (unless (and goto (listp goto))
11551 (org-back-to-heading t) 11587 (org-back-to-heading t)
11552 (setq heading-text 11588 (setq heading-text
11553 (nth 4 (org-heading-components)))) 11589 (nth 4 (org-heading-components))))
11554 11590
11555 (org-refile-get-location 11591 (org-refile-get-location
11556 (cond (goto "Goto") 11592 (cond ((and goto (listp goto)) "Goto")
11557 (regionp (concat actionmsg " region to")) 11593 (regionp (concat actionmsg " region to"))
11558 (t (concat actionmsg " subtree \"" 11594 (t (concat actionmsg " subtree \""
11559 heading-text "\" to"))) 11595 heading-text "\" to")))
@@ -11639,7 +11675,7 @@ prefix argument (`C-u C-u C-u C-c C-w')."
11639 (delete-region (point) (+ (point) (- region-end region-start))) 11675 (delete-region (point) (+ (point) (- region-end region-start)))
11640 (delete-region 11676 (delete-region
11641 (and (org-back-to-heading t) (point)) 11677 (and (org-back-to-heading t) (point))
11642 (min (buffer-size) (org-end-of-subtree t t) (point))))) 11678 (min (1+ (buffer-size)) (org-end-of-subtree t t) (point)))))
11643 (when (featurep 'org-inlinetask) 11679 (when (featurep 'org-inlinetask)
11644 (org-inlinetask-remove-END-maybe)) 11680 (org-inlinetask-remove-END-maybe))
11645 (setq org-markers-to-move nil) 11681 (setq org-markers-to-move nil)
@@ -11651,6 +11687,17 @@ prefix argument (`C-u C-u C-u C-c C-w')."
11651 (bookmark-jump "org-refile-last-stored") 11687 (bookmark-jump "org-refile-last-stored")
11652 (message "This is the location of the last refile")) 11688 (message "This is the location of the last refile"))
11653 11689
11690(defun org-refile--get-location (refloc tbl)
11691 "When user refile to REFLOC, find the associated target in TBL.
11692Also check `org-refile-target-table'."
11693 (car (delq
11694 nil
11695 (mapcar
11696 (lambda (r) (or (assoc r tbl)
11697 (assoc r org-refile-target-table)))
11698 (list (replace-regexp-in-string "/$" "" refloc)
11699 (replace-regexp-in-string "\\([^/]\\)$" "\\1/" refloc))))))
11700
11654(defun org-refile-get-location (&optional prompt default-buffer new-nodes 11701(defun org-refile-get-location (&optional prompt default-buffer new-nodes
11655 no-exclude) 11702 no-exclude)
11656 "Prompt the user for a refile location, using PROMPT. 11703 "Prompt the user for a refile location, using PROMPT.
@@ -11704,8 +11751,7 @@ this is used for the GOTO interface."
11704 (setq old-hist org-refile-history) 11751 (setq old-hist org-refile-history)
11705 (setq answ (funcall cfunc prompt tbl nil (not new-nodes) 11752 (setq answ (funcall cfunc prompt tbl nil (not new-nodes)
11706 nil 'org-refile-history (or cdef (car org-refile-history)))) 11753 nil 'org-refile-history (or cdef (car org-refile-history))))
11707 (setq pa (or (assoc answ tbl) (assoc (concat answ "/") tbl))) 11754 (if (setq pa (org-refile--get-location answ tbl))
11708 (if pa
11709 (progn 11755 (progn
11710 (org-refile-check-position pa) 11756 (org-refile-check-position pa)
11711 (when (or (not org-refile-history) 11757 (when (or (not org-refile-history)
@@ -11722,8 +11768,7 @@ this is used for the GOTO interface."
11722 (progn 11768 (progn
11723 (setq parent (match-string 1 answ) 11769 (setq parent (match-string 1 answ)
11724 child (match-string 2 answ)) 11770 child (match-string 2 answ))
11725 (setq parent-target (or (assoc parent tbl) 11771 (setq parent-target (org-refile--get-location parent tbl))
11726 (assoc (concat parent "/") tbl)))
11727 (when (and parent-target 11772 (when (and parent-target
11728 (or (eq new-nodes t) 11773 (or (eq new-nodes t)
11729 (and (eq new-nodes 'confirm) 11774 (and (eq new-nodes 'confirm)
@@ -11905,8 +11950,9 @@ blocks in the buffer."
11905This means to empty the block, parse for parameters and then call 11950This means to empty the block, parse for parameters and then call
11906the correct writing function." 11951the correct writing function."
11907 (interactive) 11952 (interactive)
11908 (save-window-excursion 11953 (save-excursion
11909 (let* ((pos (point)) 11954 (let* ((win (selected-window))
11955 (pos (point))
11910 (line (org-current-line)) 11956 (line (org-current-line))
11911 (params (org-prepare-dblock)) 11957 (params (org-prepare-dblock))
11912 (name (plist-get params :name)) 11958 (name (plist-get params :name))
@@ -11919,6 +11965,7 @@ the correct writing function."
11919 (when (and indent (> indent 0)) 11965 (when (and indent (> indent 0))
11920 (setq indent (make-string indent ?\ )) 11966 (setq indent (make-string indent ?\ ))
11921 (save-excursion 11967 (save-excursion
11968 (select-window win)
11922 (org-beginning-of-dblock) 11969 (org-beginning-of-dblock)
11923 (forward-line 1) 11970 (forward-line 1)
11924 (while (not (looking-at org-dblock-end-re)) 11971 (while (not (looking-at org-dblock-end-re))
@@ -13444,49 +13491,44 @@ a Show deadlines and scheduled items after a date.
13444d Show deadlines due within `org-deadline-warning-days'. 13491d Show deadlines due within `org-deadline-warning-days'.
13445D Show deadlines and scheduled items between a date range." 13492D Show deadlines and scheduled items between a date range."
13446 (interactive "P") 13493 (interactive "P")
13447 (let (ans kwd value ts-type) 13494 (setq type (or type org-sparse-tree-default-date-type))
13448 (setq type (or type org-sparse-tree-default-date-type)) 13495 (setq org-ts-type type)
13449 (setq org-ts-type type) 13496 (message "Sparse tree: [/]regexp [t]odo [T]odo-kwd [m]atch [p]roperty
13450 (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" 13497 [d]eadlines [b]efore-date [a]fter-date [D]ates range
13451 (cond ((eq type 'all) "all timestamps") 13498 [c]ycle through date types: %s"
13452 ((eq type 'scheduled) "only scheduled") 13499 (case type
13453 ((eq type 'deadline) "only deadline") 13500 (all "all timestamps")
13454 ((eq type 'active) "only active timestamps") 13501 (scheduled "only scheduled")
13455 ((eq type 'inactive) "only inactive timestamps") 13502 (deadline "only deadline")
13456 ((eq type 'scheduled-or-deadline) "scheduled/deadline") 13503 (active "only active timestamps")
13457 ((eq type 'closed) "with a closed time-stamp") 13504 (inactive "only inactive timestamps")
13458 (t "scheduled/deadline"))) 13505 (scheduled-or-deadline "scheduled/deadline")
13459 (setq ans (read-char-exclusive)) 13506 (closed "with a closed time-stamp")
13460 (cond 13507 (otherwise "scheduled/deadline")))
13461 ((equal ans ?c) 13508 (let ((answer (read-char-exclusive)))
13462 (org-sparse-tree 13509 (case answer
13463 arg (cadr (member type '(scheduled-or-deadline 13510 (?c
13464 all scheduled deadline active inactive closed))))) 13511 (org-sparse-tree
13465 ((equal ans ?d) 13512 arg
13466 (call-interactively 'org-check-deadlines)) 13513 (cadr (memq type '(scheduled-or-deadline all scheduled deadline active
13467 ((equal ans ?b) 13514 inactive closed)))))
13468 (call-interactively 'org-check-before-date)) 13515 (?d (call-interactively #'org-check-deadlines))
13469 ((equal ans ?a) 13516 (?b (call-interactively #'org-check-before-date))
13470 (call-interactively 'org-check-after-date)) 13517 (?a (call-interactively #'org-check-after-date))
13471 ((equal ans ?D) 13518 (?D (call-interactively #'org-check-dates-range))
13472 (call-interactively 'org-check-dates-range)) 13519 (?t (call-interactively #'org-show-todo-tree))
13473 ((equal ans ?t) 13520 (?T (org-show-todo-tree '(4)))
13474 (call-interactively 'org-show-todo-tree)) 13521 (?m (call-interactively #'org-match-sparse-tree))
13475 ((equal ans ?T) 13522 ((?p ?P)
13476 (org-show-todo-tree '(4))) 13523 (let* ((kwd (org-icompleting-read
13477 ((member ans '(?T ?m)) 13524 "Property: " (mapcar #'list (org-buffer-property-keys))))
13478 (call-interactively 'org-match-sparse-tree)) 13525 (value (org-icompleting-read
13479 ((member ans '(?p ?P)) 13526 "Value: " (mapcar #'list (org-property-values kwd)))))
13480 (setq kwd (org-icompleting-read "Property: " 13527 (unless (string-match "\\`{.*}\\'" value)
13481 (mapcar 'list (org-buffer-property-keys)))) 13528 (setq value (concat "\"" value "\"")))
13482 (setq value (org-icompleting-read "Value: " 13529 (org-match-sparse-tree arg (concat kwd "=" value))))
13483 (mapcar 'list (org-property-values kwd)))) 13530 ((?r ?R ?/) (call-interactively #'org-occur))
13484 (unless (string-match "\\`{.*}\\'" value) 13531 (otherwise (user-error "No such sparse tree command \"%c\"" answer)))))
13485 (setq value (concat "\"" value "\"")))
13486 (org-match-sparse-tree arg (concat kwd "=" value)))
13487 ((member ans '(?r ?R ?/))
13488 (call-interactively 'org-occur))
13489 (t (user-error "No such sparse tree command \"%c\"" ans)))))
13490 13532
13491(defvar org-occur-highlights nil 13533(defvar org-occur-highlights nil
13492 "List of overlays used for occur matches.") 13534 "List of overlays used for occur matches.")
@@ -14384,6 +14426,7 @@ If ONOFF is `on' or `off', don't toggle but set to this state."
14384 14426
14385(defun org-align-tags-here (to-col) 14427(defun org-align-tags-here (to-col)
14386 ;; Assumes that this is a headline 14428 ;; Assumes that this is a headline
14429 "Align tags on the current headline to TO-COL."
14387 (let ((pos (point)) (col (current-column)) ncol tags-l p) 14430 (let ((pos (point)) (col (current-column)) ncol tags-l p)
14388 (beginning-of-line 1) 14431 (beginning-of-line 1)
14389 (if (and (looking-at (org-re ".*?\\([ \t]+\\)\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$")) 14432 (if (and (looking-at (org-re ".*?\\([ \t]+\\)\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$"))
@@ -14402,7 +14445,7 @@ If ONOFF is `on' or `off', don't toggle but set to this state."
14402 (insert (make-string (- ncol (current-column)) ?\ )) 14445 (insert (make-string (- ncol (current-column)) ?\ ))
14403 (setq ncol (current-column)) 14446 (setq ncol (current-column))
14404 (when indent-tabs-mode (tabify p (point-at-eol))) 14447 (when indent-tabs-mode (tabify p (point-at-eol)))
14405 (org-move-to-column (min ncol col) t nil t)) 14448 (org-move-to-column (min ncol col)))
14406 (goto-char pos)))) 14449 (goto-char pos))))
14407 14450
14408(defun org-set-tags-command (&optional arg just-align) 14451(defun org-set-tags-command (&optional arg just-align)
@@ -14460,15 +14503,16 @@ If DATA is nil or the empty string, any tags will be removed."
14460(defvar org-indent-indentation-per-level) 14503(defvar org-indent-indentation-per-level)
14461(defun org-set-tags (&optional arg just-align) 14504(defun org-set-tags (&optional arg just-align)
14462 "Set the tags for the current headline. 14505 "Set the tags for the current headline.
14463With prefix ARG, realign all tags in headings in the current buffer." 14506With prefix ARG, realign all tags in headings in the current buffer.
14507When JUST-ALIGN is non-nil, only align tags."
14464 (interactive "P") 14508 (interactive "P")
14465 (if (and (org-region-active-p) org-loop-over-headlines-in-active-region) 14509 (if (and (org-region-active-p) org-loop-over-headlines-in-active-region)
14466 (let ((cl (if (eq org-loop-over-headlines-in-active-region 'start-level) 14510 (let ((cl (if (eq org-loop-over-headlines-in-active-region 'start-level)
14467 'region-start-level 'region)) 14511 'region-start-level 'region))
14468 org-loop-over-headlines-in-active-region) 14512 org-loop-over-headlines-in-active-region)
14469 (org-map-entries 14513 (org-map-entries
14470 ;; We don't use ARG and JUST-ALIGN here these args are not 14514 ;; We don't use ARG and JUST-ALIGN here because these args
14471 ;; useful when looping over headlines 14515 ;; are not useful when looping over headlines.
14472 `(org-set-tags) 14516 `(org-set-tags)
14473 org-loop-over-headlines-in-active-region 14517 org-loop-over-headlines-in-active-region
14474 cl (if (outline-invisible-p) (org-end-of-subtree nil t)))) 14518 cl (if (outline-invisible-p) (org-end-of-subtree nil t))))
@@ -14546,7 +14590,7 @@ With prefix ARG, realign all tags in headings in the current buffer."
14546 (goto-char (match-beginning 0)) 14590 (goto-char (match-beginning 0))
14547 (setq c0 (current-column) 14591 (setq c0 (current-column)
14548 ;; compute offset for the case of org-indent-mode active 14592 ;; compute offset for the case of org-indent-mode active
14549 di (if org-indent-mode 14593 di (if (org-bound-and-true-p org-indent-mode)
14550 (* (1- org-indent-indentation-per-level) (1- level)) 14594 (* (1- org-indent-indentation-per-level) (1- level))
14551 0) 14595 0)
14552 p0 (if (equal (char-before) ?*) (1+ (point)) (point)) 14596 p0 (if (equal (char-before) ?*) (1+ (point)) (point))
@@ -14557,7 +14601,7 @@ With prefix ARG, realign all tags in headings in the current buffer."
14557 (and (not (featurep 'xemacs)) c0 indent-tabs-mode (tabify p0 (point))) 14601 (and (not (featurep 'xemacs)) c0 indent-tabs-mode (tabify p0 (point)))
14558 tags) 14602 tags)
14559 (t (error "Tags alignment failed"))) 14603 (t (error "Tags alignment failed")))
14560 (org-move-to-column col nil nil t) 14604 (org-move-to-column col)
14561 (unless just-align 14605 (unless just-align
14562 (run-hooks 'org-after-tags-change-hook)))))) 14606 (run-hooks 'org-after-tags-change-hook))))))
14563 14607
@@ -14960,7 +15004,7 @@ a *different* entry, you cannot use these techniques."
14960 ((eq match nil) (setq matcher t)) 15004 ((eq match nil) (setq matcher t))
14961 (t (setq matcher (if match (cdr (org-make-tags-matcher match)) t)))) 15005 (t (setq matcher (if match (cdr (org-make-tags-matcher match)) t))))
14962 15006
14963 (save-window-excursion 15007 (save-excursion
14964 (save-restriction 15008 (save-restriction
14965 (cond ((eq scope 'tree) 15009 (cond ((eq scope 'tree)
14966 (org-back-to-heading t) 15010 (org-back-to-heading t)
@@ -15306,7 +15350,13 @@ when a \"nil\" value can supersede a non-nil value higher up the hierarchy."
15306 (cdr (assoc property (org-entry-properties nil 'special property))) 15350 (cdr (assoc property (org-entry-properties nil 'special property)))
15307 (org-with-wide-buffer 15351 (org-with-wide-buffer
15308 (let ((range (org-get-property-block))) 15352 (let ((range (org-get-property-block)))
15309 (when (and range (not (eq (car range) (cdr range)))) 15353 (when (and range (not (eq (car range) (cdr range)))
15354 (save-excursion
15355 (goto-char (car range))
15356 (re-search-forward
15357 (concat (org-re-property property) "\\|"
15358 (org-re-property (concat property "+")))
15359 (cdr range) t)))
15310 (let* ((props 15360 (let* ((props
15311 (list (or (assoc property org-file-properties) 15361 (list (or (assoc property org-file-properties)
15312 (assoc property org-global-properties) 15362 (assoc property org-global-properties)
@@ -15438,7 +15488,7 @@ However, if LITERAL-NIL is set, return the string value \"nil\" instead."
15438 (widen) 15488 (widen)
15439 (catch 'ex 15489 (catch 'ex
15440 (while t 15490 (while t
15441 (when (setq tmp (org-entry-get nil property nil 'literal-nil)) 15491 (when (setq tmp (org-entry-get nil property nil literal-nil))
15442 (or (ignore-errors (org-back-to-heading t)) 15492 (or (ignore-errors (org-back-to-heading t))
15443 (goto-char (point-min))) 15493 (goto-char (point-min)))
15444 (move-marker org-entry-property-inherited-from (point)) 15494 (move-marker org-entry-property-inherited-from (point))
@@ -15795,13 +15845,16 @@ When optional argument DELETE-EMPTY-DRAWER is a string, it defines
15795an empty drawer to delete." 15845an empty drawer to delete."
15796 (interactive 15846 (interactive
15797 (let* ((completion-ignore-case t) 15847 (let* ((completion-ignore-case t)
15798 (prop (org-icompleting-read "Property: " 15848 (cat (org-entry-get (point) "CATEGORY"))
15799 (org-entry-properties nil 'standard)))) 15849 (props0 (org-entry-properties nil 'standard))
15850 (props (if cat props0
15851 (delete `("CATEGORY" . ,(org-get-category)) props0)))
15852 (prop (if (< 1 (length props))
15853 (org-icompleting-read "Property: " props nil t)
15854 (caar props))))
15800 (list prop))) 15855 (list prop)))
15801 (message "Property %s %s" property 15856 (if (org-entry-delete nil property delete-empty-drawer)
15802 (if (org-entry-delete nil property delete-empty-drawer) 15857 (message "Property %s deleted" property)))
15803 "deleted"
15804 "was not present in the entry")))
15805 15858
15806(defun org-delete-property-globally (property) 15859(defun org-delete-property-globally (property)
15807 "Remove PROPERTY globally, from all entries." 15860 "Remove PROPERTY globally, from all entries."
@@ -18056,7 +18109,7 @@ When a buffer is unmodified, it is just killed. When modified, it is saved
18056 file re pos) 18109 file re pos)
18057 (setq org-tag-alist-for-agenda nil 18110 (setq org-tag-alist-for-agenda nil
18058 org-tag-groups-alist-for-agenda nil) 18111 org-tag-groups-alist-for-agenda nil)
18059 (save-window-excursion 18112 (save-excursion
18060 (save-restriction 18113 (save-restriction
18061 (while (setq file (pop files)) 18114 (while (setq file (pop files))
18062 (catch 'nextfile 18115 (catch 'nextfile
@@ -19422,7 +19475,7 @@ The detailed reaction depends on the user option `org-catch-invisible-edits'."
19422 (if invisible-before-point 19475 (if invisible-before-point
19423 (goto-char (previous-single-char-property-change 19476 (goto-char (previous-single-char-property-change
19424 (point) 'invisible))) 19477 (point) 'invisible)))
19425 (org-cycle)) 19478 (show-subtree))
19426 (cond 19479 (cond
19427 ((eq org-catch-invisible-edits 'show) 19480 ((eq org-catch-invisible-edits 'show)
19428 ;; That's it, we do the edit after showing 19481 ;; That's it, we do the edit after showing
@@ -20230,13 +20283,15 @@ This command does many different things, depending on context:
20230 ;; When at a link, act according to the parent instead. 20283 ;; When at a link, act according to the parent instead.
20231 (link (setq context (org-element-property :parent context)) 20284 (link (setq context (org-element-property :parent context))
20232 (setq type (org-element-type context))) 20285 (setq type (org-element-type context)))
20233 ;; Unsupported object types: check parent element instead. 20286 ;; Unsupported object types: refer to the first supported
20287 ;; element or object containing it.
20234 ((bold code entity export-snippet inline-babel-call inline-src-block 20288 ((bold code entity export-snippet inline-babel-call inline-src-block
20235 italic latex-fragment line-break macro strike-through subscript 20289 italic latex-fragment line-break macro strike-through subscript
20236 superscript underline verbatim) 20290 superscript underline verbatim)
20237 (while (and (setq context (org-element-property :parent context)) 20291 (while (and (setq context (org-element-property :parent context))
20238 (not (memq (setq type (org-element-type context)) 20292 (not (memq (setq type (org-element-type context))
20239 '(paragraph verse-block))))))) 20293 '(radio-target paragraph verse-block
20294 table-cell)))))))
20240 ;; For convenience: at the first line of a paragraph on the 20295 ;; For convenience: at the first line of a paragraph on the
20241 ;; same line as an item, apply function on that item instead. 20296 ;; same line as an item, apply function on that item instead.
20242 (when (eq type 'paragraph) 20297 (when (eq type 'paragraph)
@@ -20372,11 +20427,13 @@ This command does many different things, depending on context:
20372 "C-c C-c can do nothing useful at this location"))))))))) 20427 "C-c C-c can do nothing useful at this location")))))))))
20373 20428
20374(defun org-mode-restart () 20429(defun org-mode-restart ()
20375 "Restart Org-mode, to scan again for special lines.
20376Also updates the keyword regular expressions."
20377 (interactive) 20430 (interactive)
20378 (org-mode) 20431 (let ((indent-status (org-bound-and-true-p org-indent-mode)))
20379 (message "Org-mode restarted")) 20432 (funcall major-mode)
20433 (hack-local-variables)
20434 (when (and indent-status (not (org-bound-and-true-p org-indent-mode)))
20435 (org-indent-mode -1)))
20436 (message "%s restarted" major-mode))
20380 20437
20381(defun org-kill-note-or-show-branches () 20438(defun org-kill-note-or-show-branches ()
20382 "If this is a Note buffer, abort storing the note. Else call `show-branches'." 20439 "If this is a Note buffer, abort storing the note. Else call `show-branches'."
diff --git a/lisp/org/ox-ascii.el b/lisp/org/ox-ascii.el
index dc238adc781..6208cdbe065 100644
--- a/lisp/org/ox-ascii.el
+++ b/lisp/org/ox-ascii.el
@@ -530,8 +530,9 @@ INFO is a plist used as a communication channel."
530 (+ (- (org-list-get-ind beg-item struct) 530 (+ (- (org-list-get-ind beg-item struct)
531 (org-list-get-ind 531 (org-list-get-ind
532 (org-list-get-top-point struct) struct)) 532 (org-list-get-top-point struct) struct))
533 (length (org-ascii--checkbox parent-item info)) 533 (string-width (or (org-ascii--checkbox parent-item info)
534 (length 534 ""))
535 (string-width
535 (or (org-list-get-tag beg-item struct) 536 (or (org-list-get-tag beg-item struct)
536 (org-list-get-bullet beg-item struct))))))))))))) 537 (org-list-get-bullet beg-item struct)))))))))))))
537 538
@@ -589,7 +590,8 @@ possible. It doesn't apply to `inlinetask' elements."
589 (when tags 590 (when tags
590 (format 591 (format
591 (format " %%%ds" 592 (format " %%%ds"
592 (max (- text-width (1+ (length first-part))) (length tags))) 593 (max (- text-width (1+ (string-width first-part)))
594 (string-width tags)))
593 tags)) 595 tags))
594 ;; Maybe underline text, if ELEMENT type is `headline' and an 596 ;; Maybe underline text, if ELEMENT type is `headline' and an
595 ;; underline character has been defined. 597 ;; underline character has been defined.
@@ -600,7 +602,9 @@ possible. It doesn't apply to `inlinetask' elements."
600 org-ascii-underline))))) 602 org-ascii-underline)))))
601 (and under-char 603 (and under-char
602 (concat "\n" 604 (concat "\n"
603 (make-string (length first-part) under-char)))))))) 605 (make-string (/ (string-width first-part)
606 (char-width under-char))
607 under-char))))))))
604 608
605(defun org-ascii--has-caption-p (element info) 609(defun org-ascii--has-caption-p (element info)
606 "Non-nil when ELEMENT has a caption affiliated keyword. 610 "Non-nil when ELEMENT has a caption affiliated keyword.
@@ -647,7 +651,7 @@ which the table of contents generation has been initiated."
647 (let ((title (org-ascii--translate "Table of Contents" info))) 651 (let ((title (org-ascii--translate "Table of Contents" info)))
648 (concat 652 (concat
649 title "\n" 653 title "\n"
650 (make-string (length title) 654 (make-string (string-width title)
651 (if (eq (plist-get info :ascii-charset) 'utf-8) ?─ ?_)) 655 (if (eq (plist-get info :ascii-charset) 'utf-8) ?─ ?_))
652 "\n\n" 656 "\n\n"
653 (let ((text-width 657 (let ((text-width
@@ -674,7 +678,7 @@ generation. INFO is a plist used as a communication channel."
674 (let ((title (org-ascii--translate "List of Listings" info))) 678 (let ((title (org-ascii--translate "List of Listings" info)))
675 (concat 679 (concat
676 title "\n" 680 title "\n"
677 (make-string (length title) 681 (make-string (string-width title)
678 (if (eq (plist-get info :ascii-charset) 'utf-8) ?─ ?_)) 682 (if (eq (plist-get info :ascii-charset) 'utf-8) ?─ ?_))
679 "\n\n" 683 "\n\n"
680 (let ((text-width 684 (let ((text-width
@@ -688,9 +692,10 @@ generation. INFO is a plist used as a communication channel."
688 ;; Store initial text so its length can be computed. This is 692 ;; Store initial text so its length can be computed. This is
689 ;; used to properly align caption right to it in case of 693 ;; used to properly align caption right to it in case of
690 ;; filling (like contents of a description list item). 694 ;; filling (like contents of a description list item).
691 (let ((initial-text 695 (let* ((initial-text
692 (format (org-ascii--translate "Listing %d:" info) 696 (format (org-ascii--translate "Listing %d:" info)
693 (incf count)))) 697 (incf count)))
698 (initial-width (string-width initial-text)))
694 (concat 699 (concat
695 initial-text " " 700 initial-text " "
696 (org-trim 701 (org-trim
@@ -700,8 +705,8 @@ generation. INFO is a plist used as a communication channel."
700 (let ((caption (or (org-export-get-caption src-block t) 705 (let ((caption (or (org-export-get-caption src-block t)
701 (org-export-get-caption src-block)))) 706 (org-export-get-caption src-block))))
702 (org-export-data caption info)) 707 (org-export-data caption info))
703 (- text-width (length initial-text)) info) 708 (- text-width initial-width) info)
704 (length initial-text)))))) 709 initial-width)))))
705 (org-export-collect-listings info) "\n"))))) 710 (org-export-collect-listings info) "\n")))))
706 711
707(defun org-ascii--list-tables (keyword info) 712(defun org-ascii--list-tables (keyword info)
@@ -712,7 +717,7 @@ generation. INFO is a plist used as a communication channel."
712 (let ((title (org-ascii--translate "List of Tables" info))) 717 (let ((title (org-ascii--translate "List of Tables" info)))
713 (concat 718 (concat
714 title "\n" 719 title "\n"
715 (make-string (length title) 720 (make-string (string-width title)
716 (if (eq (plist-get info :ascii-charset) 'utf-8) ?─ ?_)) 721 (if (eq (plist-get info :ascii-charset) 'utf-8) ?─ ?_))
717 "\n\n" 722 "\n\n"
718 (let ((text-width 723 (let ((text-width
@@ -726,9 +731,10 @@ generation. INFO is a plist used as a communication channel."
726 ;; Store initial text so its length can be computed. This is 731 ;; Store initial text so its length can be computed. This is
727 ;; used to properly align caption right to it in case of 732 ;; used to properly align caption right to it in case of
728 ;; filling (like contents of a description list item). 733 ;; filling (like contents of a description list item).
729 (let ((initial-text 734 (let* ((initial-text
730 (format (org-ascii--translate "Table %d:" info) 735 (format (org-ascii--translate "Table %d:" info)
731 (incf count)))) 736 (incf count)))
737 (initial-width (string-width initial-text)))
732 (concat 738 (concat
733 initial-text " " 739 initial-text " "
734 (org-trim 740 (org-trim
@@ -738,13 +744,12 @@ generation. INFO is a plist used as a communication channel."
738 (let ((caption (or (org-export-get-caption table t) 744 (let ((caption (or (org-export-get-caption table t)
739 (org-export-get-caption table)))) 745 (org-export-get-caption table))))
740 (org-export-data caption info)) 746 (org-export-data caption info))
741 (- text-width (length initial-text)) info) 747 (- text-width initial-width) info)
742 (length initial-text)))))) 748 initial-width)))))
743 (org-export-collect-tables info) "\n"))))) 749 (org-export-collect-tables info) "\n")))))
744 750
745(defun org-ascii--unique-links (element info) 751(defun org-ascii--unique-links (element info)
746 "Return a list of unique link references in ELEMENT. 752 "Return a list of unique link references in ELEMENT.
747
748ELEMENT is either a headline element or a section element. INFO 753ELEMENT is either a headline element or a section element. INFO
749is a plist used as a communication channel." 754is a plist used as a communication channel."
750 (let* (seen 755 (let* (seen
@@ -754,8 +759,14 @@ is a plist used as a communication channel."
754 ;; Update SEEN links along the way. 759 ;; Update SEEN links along the way.
755 (lambda (link) 760 (lambda (link)
756 (let ((footprint 761 (let ((footprint
762 ;; Normalize description in footprints.
757 (cons (org-element-property :raw-link link) 763 (cons (org-element-property :raw-link link)
758 (org-element-contents link)))) 764 (let ((contents (org-element-contents link)))
765 (and contents
766 (replace-regexp-in-string
767 "[ \r\t\n]+" " "
768 (org-trim
769 (org-element-interpret-data contents))))))))
759 ;; Ignore LINK if it hasn't been translated already. 770 ;; Ignore LINK if it hasn't been translated already.
760 ;; It can happen if it is located in an affiliated 771 ;; It can happen if it is located in an affiliated
761 ;; keyword that was ignored. 772 ;; keyword that was ignored.
@@ -852,14 +863,16 @@ INFO is a plist used as a communication channel."
852 ((and (org-string-nw-p date) (org-string-nw-p author)) 863 ((and (org-string-nw-p date) (org-string-nw-p author))
853 (concat 864 (concat
854 author 865 author
855 (make-string (- text-width (length date) (length author)) ? ) 866 (make-string (- text-width (string-width date) (string-width author))
867 ?\s)
856 date 868 date
857 (when (org-string-nw-p email) (concat "\n" email)) 869 (when (org-string-nw-p email) (concat "\n" email))
858 "\n\n\n")) 870 "\n\n\n"))
859 ((and (org-string-nw-p date) (org-string-nw-p email)) 871 ((and (org-string-nw-p date) (org-string-nw-p email))
860 (concat 872 (concat
861 email 873 email
862 (make-string (- text-width (length date) (length email)) ? ) 874 (make-string (- text-width (string-width date) (string-width email))
875 ?\s)
863 date "\n\n\n")) 876 date "\n\n\n"))
864 ((org-string-nw-p date) 877 ((org-string-nw-p date)
865 (concat 878 (concat
@@ -879,7 +892,10 @@ INFO is a plist used as a communication channel."
879 (formatted-title (org-ascii--fill-string title title-len info)) 892 (formatted-title (org-ascii--fill-string title title-len info))
880 (line 893 (line
881 (make-string 894 (make-string
882 (min (+ (max title-len (length author) (length email)) 2) 895 (min (+ (max title-len
896 (string-width (or author ""))
897 (string-width (or email "")))
898 2)
883 text-width) (if utf8p ?━ ?_)))) 899 text-width) (if utf8p ?━ ?_))))
884 (org-ascii--justify-string 900 (org-ascii--justify-string
885 (concat line "\n" 901 (concat line "\n"
@@ -918,7 +934,7 @@ holding export options."
918 (concat 934 (concat
919 title "\n" 935 title "\n"
920 (make-string 936 (make-string
921 (length title) 937 (string-width title)
922 (if (eq (plist-get info :ascii-charset) 'utf-8) ?─ ?_)))) 938 (if (eq (plist-get info :ascii-charset) 'utf-8) ?─ ?_))))
923 "\n\n" 939 "\n\n"
924 (let ((text-width (- org-ascii-text-width org-ascii-global-margin))) 940 (let ((text-width (- org-ascii-text-width org-ascii-global-margin)))
@@ -1195,7 +1211,7 @@ contextual information."
1195;;;; Inlinetask 1211;;;; Inlinetask
1196 1212
1197(defun org-ascii-format-inlinetask-default 1213(defun org-ascii-format-inlinetask-default
1198 (todo type priority name tags contents width inlinetask info) 1214 (todo type priority name tags contents width inlinetask info)
1199 "Format an inline task element for ASCII export. 1215 "Format an inline task element for ASCII export.
1200See `org-ascii-format-inlinetask-function' for a description 1216See `org-ascii-format-inlinetask-function' for a description
1201of the parameters." 1217of the parameters."
@@ -1208,7 +1224,7 @@ of the parameters."
1208 (unless utf8p (concat (make-string width ? ) "\n")) 1224 (unless utf8p (concat (make-string width ? ) "\n"))
1209 ;; Add title. Fill it if wider than inlinetask. 1225 ;; Add title. Fill it if wider than inlinetask.
1210 (let ((title (org-ascii--build-title inlinetask info width))) 1226 (let ((title (org-ascii--build-title inlinetask info width)))
1211 (if (<= (length title) width) title 1227 (if (<= (string-width title) width) title
1212 (org-ascii--fill-string title width info))) 1228 (org-ascii--fill-string title width info)))
1213 "\n" 1229 "\n"
1214 ;; If CONTENTS is not empty, insert it along with 1230 ;; If CONTENTS is not empty, insert it along with
@@ -1301,7 +1317,7 @@ contextual information."
1301 ;; Contents: Pay attention to indentation. Note: check-boxes are 1317 ;; Contents: Pay attention to indentation. Note: check-boxes are
1302 ;; already taken care of at the paragraph level so they don't 1318 ;; already taken care of at the paragraph level so they don't
1303 ;; interfere with indentation. 1319 ;; interfere with indentation.
1304 (let ((contents (org-ascii--indent-string contents (length bullet)))) 1320 (let ((contents (org-ascii--indent-string contents (string-width bullet))))
1305 (if (eq (org-element-type (car (org-element-contents item))) 'paragraph) 1321 (if (eq (org-element-type (car (org-element-contents item))) 'paragraph)
1306 (org-trim contents) 1322 (org-trim contents)
1307 (concat "\n" contents)))))) 1323 (concat "\n" contents))))))
@@ -1376,10 +1392,7 @@ INFO is a plist holding contextual information."
1376 (org-export-resolve-coderef ref info)))) 1392 (org-export-resolve-coderef ref info))))
1377 ;; Do not apply a special syntax on radio links. Though, use 1393 ;; Do not apply a special syntax on radio links. Though, use
1378 ;; transcoded target's contents as output. 1394 ;; transcoded target's contents as output.
1379 ((string= type "radio") 1395 ((string= type "radio") desc)
1380 (let ((destination (org-export-resolve-radio-link link info)))
1381 (when destination
1382 (org-export-data (org-element-contents destination) info))))
1383 ;; Do not apply a special syntax on fuzzy links pointing to 1396 ;; Do not apply a special syntax on fuzzy links pointing to
1384 ;; targets. 1397 ;; targets.
1385 ((string= type "fuzzy") 1398 ((string= type "fuzzy")
@@ -1652,7 +1665,7 @@ are ignored."
1652 (org-element-map table 'table-row 1665 (org-element-map table 'table-row
1653 (lambda (row) 1666 (lambda (row)
1654 (setq max-width 1667 (setq max-width
1655 (max (length 1668 (max (string-width
1656 (org-export-data 1669 (org-export-data
1657 (org-element-contents 1670 (org-element-contents
1658 (elt (org-element-contents row) col)) 1671 (elt (org-element-contents row) col))
@@ -1672,7 +1685,8 @@ a communication channel."
1672 ;; each cell in the column. 1685 ;; each cell in the column.
1673 (let ((width (org-ascii--table-cell-width table-cell info))) 1686 (let ((width (org-ascii--table-cell-width table-cell info)))
1674 ;; When contents are too large, truncate them. 1687 ;; When contents are too large, truncate them.
1675 (unless (or org-ascii-table-widen-columns (<= (length contents) width)) 1688 (unless (or org-ascii-table-widen-columns
1689 (<= (string-width (or contents "")) width))
1676 (setq contents (concat (substring contents 0 (- width 2)) "=>"))) 1690 (setq contents (concat (substring contents 0 (- width 2)) "=>")))
1677 ;; Align contents correctly within the cell. 1691 ;; Align contents correctly within the cell.
1678 (let* ((indent-tabs-mode nil) 1692 (let* ((indent-tabs-mode nil)
@@ -1681,7 +1695,9 @@ a communication channel."
1681 (org-ascii--justify-string 1695 (org-ascii--justify-string
1682 contents width 1696 contents width
1683 (org-export-table-cell-alignment table-cell info))))) 1697 (org-export-table-cell-alignment table-cell info)))))
1684 (setq contents (concat data (make-string (- width (length data)) ? )))) 1698 (setq contents
1699 (concat data
1700 (make-string (- width (string-width (or data ""))) ?\s))))
1685 ;; Return cell. 1701 ;; Return cell.
1686 (concat (format " %s " contents) 1702 (concat (format " %s " contents)
1687 (when (memq 'right (org-export-table-cell-borders table-cell info)) 1703 (when (memq 'right (org-export-table-cell-borders table-cell info))
diff --git a/lisp/org/ox-beamer.el b/lisp/org/ox-beamer.el
index 7fd70739b9f..f3a79d7c860 100644
--- a/lisp/org/ox-beamer.el
+++ b/lisp/org/ox-beamer.el
@@ -36,10 +36,7 @@
36(unless (assoc "beamer" org-latex-classes) 36(unless (assoc "beamer" org-latex-classes)
37 (add-to-list 'org-latex-classes 37 (add-to-list 'org-latex-classes
38 '("beamer" 38 '("beamer"
39 "\\documentclass[presentation]{beamer} 39 "\\documentclass[presentation]{beamer}"
40\[DEFAULT-PACKAGES]
41\[PACKAGES]
42\[EXTRA]"
43 ("\\section{%s}" . "\\section*{%s}") 40 ("\\section{%s}" . "\\section*{%s}")
44 ("\\subsection{%s}" . "\\subsection*{%s}") 41 ("\\subsection{%s}" . "\\subsection*{%s}")
45 ("\\subsubsection{%s}" . "\\subsubsection*{%s}")))) 42 ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))))
@@ -647,11 +644,11 @@ contextual information."
647 (and (eq (org-element-type first-element) 'paragraph) 644 (and (eq (org-element-type first-element) 'paragraph)
648 (org-beamer--element-has-overlay-p first-element)))) 645 (org-beamer--element-has-overlay-p first-element))))
649 (output (org-export-with-backend 'latex item contents info))) 646 (output (org-export-with-backend 'latex item contents info)))
650 (if (not action) output 647 (if (or (not action) (not (string-match "\\\\item" output))) output
651 ;; If the item starts with a paragraph and that paragraph starts 648 ;; If the item starts with a paragraph and that paragraph starts
652 ;; with an export snippet specifying an overlay, insert it after 649 ;; with an export snippet specifying an overlay, insert it after
653 ;; \item command. 650 ;; \item command.
654 (replace-regexp-in-string "\\\\item" (concat "\\\\item" action) output)))) 651 (replace-match (concat "\\\\item" action) nil nil output))))
655 652
656 653
657;;;; Keyword 654;;;; Keyword
@@ -693,8 +690,9 @@ used as a communication channel."
693 (when destination 690 (when destination
694 (format "\\hyperlink%s{%s}{%s}" 691 (format "\\hyperlink%s{%s}{%s}"
695 (or (org-beamer--element-has-overlay-p link) "") 692 (or (org-beamer--element-has-overlay-p link) "")
696 (org-export-solidify-link-text path) 693 (org-export-solidify-link-text
697 (org-export-data (org-element-contents destination) info))))) 694 (org-element-property :value destination))
695 contents))))
698 ((and (member type '("custom-id" "fuzzy" "id")) 696 ((and (member type '("custom-id" "fuzzy" "id"))
699 (let ((destination (if (string= type "fuzzy") 697 (let ((destination (if (string= type "fuzzy")
700 (org-export-resolve-fuzzy-link link info) 698 (org-export-resolve-fuzzy-link link info)
@@ -1094,6 +1092,7 @@ aid, but the tag does not have any semantic meaning."
1094 envs) 1092 envs)
1095 '((:endgroup)) 1093 '((:endgroup))
1096 '(("BMCOL" . ?|)))) 1094 '(("BMCOL" . ?|))))
1095 (org-use-fast-tag-selection t)
1097 (org-fast-tag-selection-single-key t)) 1096 (org-fast-tag-selection-single-key t))
1098 (org-set-tags) 1097 (org-set-tags)
1099 (let ((tags (or (ignore-errors (org-get-tags-string)) ""))) 1098 (let ((tags (or (ignore-errors (org-get-tags-string)) "")))
@@ -1168,7 +1167,9 @@ Return output file name."
1168 ;; working directory and then moved to publishing directory. 1167 ;; working directory and then moved to publishing directory.
1169 (org-publish-attachment 1168 (org-publish-attachment
1170 plist 1169 plist
1171 (org-latex-compile (org-publish-org-to 'beamer filename ".tex" plist)) 1170 (org-latex-compile
1171 (org-publish-org-to
1172 'beamer filename ".tex" plist (file-name-directory filename)))
1172 pub-dir)) 1173 pub-dir))
1173 1174
1174 1175
diff --git a/lisp/org/ox-html.el b/lisp/org/ox-html.el
index d5e4b7876b7..88e572084c8 100644
--- a/lisp/org/ox-html.el
+++ b/lisp/org/ox-html.el
@@ -170,10 +170,8 @@
170 "progress" "section" "video") 170 "progress" "section" "video")
171 "New elements in html5. 171 "New elements in html5.
172 172
173<hgroup> is not included because it's currently impossible to 173For blocks that should contain headlines, use the HTML_CONTAINER
174wrap special blocks around multiple headlines. For other blocks 174property on the headline itself.")
175that should contain headlines, use the HTML_CONTAINER property on
176the headline itself.")
177 175
178(defconst org-html-special-string-regexps 176(defconst org-html-special-string-regexps
179 '(("\\\\-" . "&#x00ad;") ; shy 177 '(("\\\\-" . "&#x00ad;") ; shy
@@ -188,7 +186,7 @@ the headline itself.")
188@licstart The following is the entire license notice for the 186@licstart The following is the entire license notice for the
189JavaScript code in this tag. 187JavaScript code in this tag.
190 188
191Copyright (C) 2012-2014 Free Software Foundation, Inc. 189Copyright (C) 2012-2013 Free Software Foundation, Inc.
192 190
193The JavaScript code in this tag is free software: you can 191The JavaScript code in this tag is free software: you can
194redistribute it and/or modify it under the terms of the GNU 192redistribute it and/or modify it under the terms of the GNU
@@ -387,7 +385,7 @@ means to use the maximum value consistent with other options."
387 * @licstart The following is the entire license notice for the 385 * @licstart The following is the entire license notice for the
388 * JavaScript code in %SCRIPT_PATH. 386 * JavaScript code in %SCRIPT_PATH.
389 * 387 *
390 * Copyright (C) 2012-2014 Free Software Foundation, Inc. 388 * Copyright (C) 2012-2013 Free Software Foundation, Inc.
391 * 389 *
392 * 390 *
393 * The JavaScript code in this tag is free software: you can 391 * The JavaScript code in this tag is free software: you can
@@ -416,7 +414,7 @@ means to use the maximum value consistent with other options."
416@licstart The following is the entire license notice for the 414@licstart The following is the entire license notice for the
417JavaScript code in this tag. 415JavaScript code in this tag.
418 416
419Copyright (C) 2012-2014 Free Software Foundation, Inc. 417Copyright (C) 2012-2013 Free Software Foundation, Inc.
420 418
421The JavaScript code in this tag is free software: you can 419The JavaScript code in this tag is free software: you can
422redistribute it and/or modify it under the terms of the GNU 420redistribute it and/or modify it under the terms of the GNU
@@ -457,6 +455,7 @@ export back-end currently used."
457 (not org-html-use-infojs) 455 (not org-html-use-infojs)
458 (and (eq org-html-use-infojs 'when-configured) 456 (and (eq org-html-use-infojs 'when-configured)
459 (or (not (plist-get exp-plist :infojs-opt)) 457 (or (not (plist-get exp-plist :infojs-opt))
458 (string= "" (plist-get exp-plist :infojs-opt))
460 (string-match "\\<view:nil\\>" 459 (string-match "\\<view:nil\\>"
461 (plist-get exp-plist :infojs-opt))))) 460 (plist-get exp-plist :infojs-opt)))))
462 (let* ((template org-html-infojs-template) 461 (let* ((template org-html-infojs-template)
@@ -2661,19 +2660,20 @@ INFO is a plist holding contextual information. See
2661 (path 2660 (path
2662 (cond 2661 (cond
2663 ((member type '("http" "https" "ftp" "mailto")) 2662 ((member type '("http" "https" "ftp" "mailto"))
2664 (concat type ":" raw-path)) 2663 (org-link-escape
2664 (org-link-unescape
2665 (concat type ":" raw-path)) org-link-escape-chars-browser))
2665 ((string= type "file") 2666 ((string= type "file")
2666 ;; Treat links to ".org" files as ".html", if needed. 2667 ;; Treat links to ".org" files as ".html", if needed.
2667 (setq raw-path 2668 (setq raw-path
2668 (funcall link-org-files-as-html-maybe raw-path info)) 2669 (funcall link-org-files-as-html-maybe raw-path info))
2669 ;; If file path is absolute, prepend it with protocol 2670 ;; If file path is absolute, prepend it with protocol
2670 ;; component - "file://". 2671 ;; component - "file:".
2671 (cond ((file-name-absolute-p raw-path) 2672 (cond
2672 (setq raw-path 2673 ((file-name-absolute-p raw-path)
2673 (concat "file://" (expand-file-name 2674 (setq raw-path (concat "file:" raw-path)))
2674 raw-path)))) 2675 ((and home use-abs-url)
2675 ((and home use-abs-url) 2676 (setq raw-path (concat (file-name-as-directory home) raw-path))))
2676 (setq raw-path (concat (file-name-as-directory home) raw-path))))
2677 ;; Add search option, if any. A search option can be 2677 ;; Add search option, if any. A search option can be
2678 ;; relative to a custom-id or a headline title. Any other 2678 ;; relative to a custom-id or a headline title. Any other
2679 ;; option is ignored. 2679 ;; option is ignored.
@@ -2721,9 +2721,9 @@ INFO is a plist holding contextual information. See
2721 (let ((destination (org-export-resolve-radio-link link info))) 2721 (let ((destination (org-export-resolve-radio-link link info)))
2722 (when destination 2722 (when destination
2723 (format "<a href=\"#%s\"%s>%s</a>" 2723 (format "<a href=\"#%s\"%s>%s</a>"
2724 (org-export-solidify-link-text path) 2724 (org-export-solidify-link-text
2725 attributes 2725 (org-element-property :value destination))
2726 (org-export-data (org-element-contents destination) info))))) 2726 attributes desc))))
2727 ;; Links pointing to a headline: Find destination and build 2727 ;; Links pointing to a headline: Find destination and build
2728 ;; appropriate referencing command. 2728 ;; appropriate referencing command.
2729 ((member type '("custom-id" "fuzzy" "id")) 2729 ((member type '("custom-id" "fuzzy" "id"))
diff --git a/lisp/org/ox-latex.el b/lisp/org/ox-latex.el
index 9fc1031d391..53cc54f00f7 100644
--- a/lisp/org/ox-latex.el
+++ b/lisp/org/ox-latex.el
@@ -589,7 +589,7 @@ The function must accept six parameters:
589The function should return the string to be exported. 589The function should return the string to be exported.
590 590
591For example, the variable could be set to the following function 591For example, the variable could be set to the following function
592in order to mimic default behavior: 592in order to mimic default behaviour:
593 593
594\(defun org-latex-format-inlinetask \(todo type priority name tags contents\) 594\(defun org-latex-format-inlinetask \(todo type priority name tags contents\)
595\"Format an inline task element for LaTeX export.\" 595\"Format an inline task element for LaTeX export.\"
@@ -998,7 +998,9 @@ See `org-latex-text-markup-alist' for details."
998 ;; and use "\\verb" command. 998 ;; and use "\\verb" command.
999 ((eq 'verb fmt) 999 ((eq 'verb fmt)
1000 (let ((separator (org-latex--find-verb-separator text))) 1000 (let ((separator (org-latex--find-verb-separator text)))
1001 (concat "\\verb" separator text separator))) 1001 (concat "\\verb" separator
1002 (replace-regexp-in-string "\n" " " text)
1003 separator)))
1002 ;; Handle the `protectedtexttt' special case: Protect some 1004 ;; Handle the `protectedtexttt' special case: Protect some
1003 ;; special chars and use "\texttt{%s}" format string. 1005 ;; special chars and use "\texttt{%s}" format string.
1004 ((eq 'protectedtexttt fmt) 1006 ((eq 'protectedtexttt fmt)
@@ -1342,7 +1344,16 @@ holding contextual information."
1342 ((= (length sec) 4) 1344 ((= (length sec) 4)
1343 (if numberedp (concat (car sec) "\n%s" (nth 1 sec)) 1345 (if numberedp (concat (car sec) "\n%s" (nth 1 sec))
1344 (concat (nth 2 sec) "\n%s" (nth 3 sec))))))) 1346 (concat (nth 2 sec) "\n%s" (nth 3 sec)))))))
1345 (text (org-export-data (org-element-property :title headline) info)) 1347 ;; Create a temporary export back-end that hard-codes
1348 ;; "\underline" within "\section" and alike.
1349 (section-back-end
1350 (org-export-create-backend
1351 :parent 'latex
1352 :transcoders
1353 '((underline . (lambda (o c i) (format "\\underline{%s}" c))))))
1354 (text
1355 (org-export-data-with-backend
1356 (org-element-property :title headline) section-back-end info))
1346 (todo 1357 (todo
1347 (and (plist-get info :with-todo-keywords) 1358 (and (plist-get info :with-todo-keywords)
1348 (let ((todo (org-element-property :todo-keyword headline))) 1359 (let ((todo (org-element-property :todo-keyword headline)))
@@ -1374,7 +1385,13 @@ holding contextual information."
1374 (when (org-export-first-sibling-p headline info) 1385 (when (org-export-first-sibling-p headline info)
1375 (format "\\begin{%s}\n" (if numberedp 'enumerate 'itemize))) 1386 (format "\\begin{%s}\n" (if numberedp 'enumerate 'itemize)))
1376 ;; Itemize headline 1387 ;; Itemize headline
1377 "\\item " full-text "\n" headline-label pre-blanks contents))) 1388 "\\item"
1389 (and full-text (org-string-match-p "\\`[ \t]*\\[" full-text)
1390 "\\relax")
1391 " " full-text "\n"
1392 headline-label
1393 pre-blanks
1394 contents)))
1378 ;; If headline is not the last sibling simply return 1395 ;; If headline is not the last sibling simply return
1379 ;; LOW-LEVEL-BODY. Otherwise, also close the list, before 1396 ;; LOW-LEVEL-BODY. Otherwise, also close the list, before
1380 ;; any blank line. 1397 ;; any blank line.
@@ -1389,8 +1406,9 @@ holding contextual information."
1389 (let ((opt-title 1406 (let ((opt-title
1390 (funcall org-latex-format-headline-function 1407 (funcall org-latex-format-headline-function
1391 todo todo-type priority 1408 todo todo-type priority
1392 (org-export-data 1409 (org-export-data-with-backend
1393 (org-export-get-alt-title headline info) info) 1410 (org-export-get-alt-title headline info)
1411 section-back-end info)
1394 (and (eq (plist-get info :with-tags) t) tags)))) 1412 (and (eq (plist-get info :with-tags) t) tags))))
1395 (if (and numberedp opt-title 1413 (if (and numberedp opt-title
1396 (not (equal opt-title full-text)) 1414 (not (equal opt-title full-text))
@@ -1458,7 +1476,7 @@ contextual information."
1458 (let* ((org-lang (org-element-property :language inline-src-block)) 1476 (let* ((org-lang (org-element-property :language inline-src-block))
1459 (mint-lang (or (cadr (assq (intern org-lang) 1477 (mint-lang (or (cadr (assq (intern org-lang)
1460 org-latex-minted-langs)) 1478 org-latex-minted-langs))
1461 org-lang)) 1479 (downcase org-lang)))
1462 (options (org-latex--make-option-string 1480 (options (org-latex--make-option-string
1463 org-latex-minted-options))) 1481 org-latex-minted-options)))
1464 (concat (format "\\mint%s{%s}" 1482 (concat (format "\\mint%s{%s}"
@@ -1564,7 +1582,25 @@ contextual information."
1564 (and tag (format "[{%s}] " 1582 (and tag (format "[{%s}] "
1565 (concat checkbox 1583 (concat checkbox
1566 (org-export-data tag info))))))) 1584 (org-export-data tag info)))))))
1567 (concat counter "\\item" (or tag (concat " " checkbox)) 1585 (concat counter
1586 "\\item"
1587 (cond
1588 (tag)
1589 (checkbox (concat " " checkbox))
1590 ;; Without a tag or a check-box, if CONTENTS starts with
1591 ;; an opening square bracket, add "\relax" to "\item",
1592 ;; unless the brackets comes from an initial export
1593 ;; snippet (i.e. it is inserted willingly by the user).
1594 ((and contents
1595 (org-string-match-p "\\`[ \t]*\\[" contents)
1596 (not (let ((e (car (org-element-contents item))))
1597 (and (eq (org-element-type e) 'paragraph)
1598 (let ((o (car (org-element-contents e))))
1599 (and (eq (org-element-type o) 'export-snippet)
1600 (eq (org-export-snippet-backend o)
1601 'latex)))))))
1602 "\\relax ")
1603 (t " "))
1568 (and contents (org-trim contents)) 1604 (and contents (org-trim contents))
1569 ;; If there are footnotes references in tag, be sure to 1605 ;; If there are footnotes references in tag, be sure to
1570 ;; add their definition at the end of the item. This 1606 ;; add their definition at the end of the item. This
@@ -1754,7 +1790,8 @@ DESC is the description part of the link, or the empty string.
1754INFO is a plist holding contextual information. See 1790INFO is a plist holding contextual information. See
1755`org-export-data'." 1791`org-export-data'."
1756 (let* ((type (org-element-property :type link)) 1792 (let* ((type (org-element-property :type link))
1757 (raw-path (org-element-property :path link)) 1793 (raw-path (replace-regexp-in-string
1794 "%" "\\%" (org-element-property :path link) nil t))
1758 ;; Ensure DESC really exists, or set it to nil. 1795 ;; Ensure DESC really exists, or set it to nil.
1759 (desc (and (not (string= desc "")) desc)) 1796 (desc (and (not (string= desc "")) desc))
1760 (imagep (org-export-inline-image-p 1797 (imagep (org-export-inline-image-p
@@ -1762,9 +1799,8 @@ INFO is a plist holding contextual information. See
1762 (path (cond 1799 (path (cond
1763 ((member type '("http" "https" "ftp" "mailto")) 1800 ((member type '("http" "https" "ftp" "mailto"))
1764 (concat type ":" raw-path)) 1801 (concat type ":" raw-path))
1765 ((string= type "file") 1802 ((and (string= type "file") (file-name-absolute-p raw-path))
1766 (if (not (file-name-absolute-p raw-path)) raw-path 1803 (concat "file:" raw-path))
1767 (concat "file://" (expand-file-name raw-path))))
1768 (t raw-path))) 1804 (t raw-path)))
1769 protocol) 1805 protocol)
1770 (cond 1806 (cond
@@ -1776,8 +1812,9 @@ INFO is a plist holding contextual information. See
1776 (let ((destination (org-export-resolve-radio-link link info))) 1812 (let ((destination (org-export-resolve-radio-link link info)))
1777 (when destination 1813 (when destination
1778 (format "\\hyperref[%s]{%s}" 1814 (format "\\hyperref[%s]{%s}"
1779 (org-export-solidify-link-text path) 1815 (org-export-solidify-link-text
1780 (org-export-data (org-element-contents destination) info))))) 1816 (org-element-property :value destination))
1817 desc))))
1781 ;; Links pointing to a headline: Find destination and build 1818 ;; Links pointing to a headline: Find destination and build
1782 ;; appropriate referencing command. 1819 ;; appropriate referencing command.
1783 ((member type '("custom-id" "fuzzy" "id")) 1820 ((member type '("custom-id" "fuzzy" "id"))
@@ -1853,18 +1890,13 @@ contextual information."
1853 (latex-type (let ((env (plist-get attr :environment))) 1890 (latex-type (let ((env (plist-get attr :environment)))
1854 (cond (env (format "%s" env)) 1891 (cond (env (format "%s" env))
1855 ((eq type 'ordered) "enumerate") 1892 ((eq type 'ordered) "enumerate")
1856 ((eq type 'unordered) "itemize") 1893 ((eq type 'descriptive) "description")
1857 ((eq type 'descriptive) "description"))))) 1894 (t "itemize")))))
1858 (org-latex--wrap-label 1895 (org-latex--wrap-label
1859 plain-list 1896 plain-list
1860 (format "\\begin{%s}%s\n%s\\end{%s}" 1897 (format "\\begin{%s}%s\n%s\\end{%s}"
1861 latex-type 1898 latex-type
1862 ;; Put optional arguments, if any inside square brackets 1899 (or (plist-get attr :options) "")
1863 ;; when necessary.
1864 (let ((options (format "%s" (or (plist-get attr :options) ""))))
1865 (cond ((equal options "") "")
1866 ((string-match "\\`\\[.*\\]\\'" options) options)
1867 (t (format "[%s]" options))))
1868 contents 1900 contents
1869 latex-type)))) 1901 latex-type))))
1870 1902
@@ -2083,7 +2115,8 @@ contextual information."
2083 ("firstnumber" ,(number-to-string (1+ num-start)))) 2115 ("firstnumber" ,(number-to-string (1+ num-start))))
2084 org-latex-minted-options))) 2116 org-latex-minted-options)))
2085 ;; Language. 2117 ;; Language.
2086 (or (cadr (assq (intern lang) org-latex-minted-langs)) lang) 2118 (or (cadr (assq (intern lang) org-latex-minted-langs))
2119 (downcase lang))
2087 ;; Source code. 2120 ;; Source code.
2088 (let* ((code-info (org-export-unravel-code src-block)) 2121 (let* ((code-info (org-export-unravel-code src-block))
2089 (max-width 2122 (max-width
@@ -2132,8 +2165,8 @@ contextual information."
2132 ((and float (not (assoc "float" org-latex-listings-options))) 2165 ((and float (not (assoc "float" org-latex-listings-options)))
2133 `(("float" ,org-latex-default-figure-position)))) 2166 `(("float" ,org-latex-default-figure-position))))
2134 `(("language" ,lst-lang)) 2167 `(("language" ,lst-lang))
2135 (when label `(("label" ,label))) 2168 (if label `(("label" ,label)) '(("label" " ")))
2136 (when caption-str `(("caption" ,caption-str))) 2169 (if caption-str `(("caption" ,caption-str)) '(("caption" " ")))
2137 (cond ((assoc "numbers" org-latex-listings-options) nil) 2170 (cond ((assoc "numbers" org-latex-listings-options) nil)
2138 ((not num-start) '(("numbers" "none"))) 2171 ((not num-start) '(("numbers" "none")))
2139 ((zerop num-start) '(("numbers" "left"))) 2172 ((zerop num-start) '(("numbers" "left")))
@@ -2903,7 +2936,9 @@ Return output file name."
2903 ;; in working directory and then moved to publishing directory. 2936 ;; in working directory and then moved to publishing directory.
2904 (org-publish-attachment 2937 (org-publish-attachment
2905 plist 2938 plist
2906 (org-latex-compile (org-publish-org-to 'latex filename ".tex" plist)) 2939 (org-latex-compile
2940 (org-publish-org-to
2941 'latex filename ".tex" plist (file-name-directory filename)))
2907 pub-dir)) 2942 pub-dir))
2908 2943
2909 2944
diff --git a/lisp/org/ox-man.el b/lisp/org/ox-man.el
index f5653f1a2c2..d58c119fc5d 100644
--- a/lisp/org/ox-man.el
+++ b/lisp/org/ox-man.el
@@ -638,21 +638,15 @@ CONTENTS is nil. INFO is a plist holding contextual information."
638DESC is the description part of the link, or the empty string. 638DESC is the description part of the link, or the empty string.
639INFO is a plist holding contextual information. See 639INFO is a plist holding contextual information. See
640`org-export-data'." 640`org-export-data'."
641
642 (let* ((type (org-element-property :type link)) 641 (let* ((type (org-element-property :type link))
643 (raw-path (org-element-property :path link)) 642 (raw-path (org-element-property :path link))
644 ;; Ensure DESC really exists, or set it to nil. 643 ;; Ensure DESC really exists, or set it to nil.
645 (desc (and (not (string= desc "")) desc)) 644 (desc (and (not (string= desc "")) desc))
646
647 (path (cond 645 (path (cond
648 ((member type '("http" "https" "ftp" "mailto")) 646 ((member type '("http" "https" "ftp" "mailto"))
649 (concat type ":" raw-path)) 647 (concat type ":" raw-path))
650 ((string= type "file") 648 ((and (string= type "file") (file-name-absolute-p raw-path))
651 (when (string-match "\\(.+\\)::.+" raw-path) 649 (concat "file:" raw-path))
652 (setq raw-path (match-string 1 raw-path)))
653 (if (file-name-absolute-p raw-path)
654 (concat "file://" (expand-file-name raw-path))
655 (concat "file://" raw-path)))
656 (t raw-path))) 650 (t raw-path)))
657 protocol) 651 protocol)
658 (cond 652 (cond
diff --git a/lisp/org/ox-md.el b/lisp/org/ox-md.el
index 50982add568..1f841c865fa 100644
--- a/lisp/org/ox-md.el
+++ b/lisp/org/ox-md.el
@@ -77,6 +77,7 @@ This variable can be set to either `atx' or `setext'."
77 (headline . org-md-headline) 77 (headline . org-md-headline)
78 (horizontal-rule . org-md-horizontal-rule) 78 (horizontal-rule . org-md-horizontal-rule)
79 (inline-src-block . org-md-verbatim) 79 (inline-src-block . org-md-verbatim)
80 (inner-template . org-md-inner-template)
80 (italic . org-md-italic) 81 (italic . org-md-italic)
81 (item . org-md-item) 82 (item . org-md-item)
82 (line-break . org-md-line-break) 83 (line-break . org-md-line-break)
@@ -96,19 +97,26 @@ This variable can be set to either `atx' or `setext'."
96;;; Filters 97;;; Filters
97 98
98(defun org-md-separate-elements (tree backend info) 99(defun org-md-separate-elements (tree backend info)
99 "Make sure elements are separated by at least one blank line. 100 "Fix blank lines between elements.
100 101
101TREE is the parse tree being exported. BACKEND is the export 102TREE is the parse tree being exported. BACKEND is the export
102back-end used. INFO is a plist used as a communication channel. 103back-end used. INFO is a plist used as a communication channel.
103 104
105Make sure there's no blank line before a plain list, unless it is
106located right after a paragraph. Otherwise, add a blank line
107between elements. Blank lines between items are preserved.
108
104Assume BACKEND is `md'." 109Assume BACKEND is `md'."
105 (org-element-map tree org-element-all-elements 110 (org-element-map tree (remq 'item org-element-all-elements)
106 (lambda (elem) 111 (lambda (elem)
107 (unless (eq (org-element-type elem) 'org-data) 112 (org-element-put-property
108 (org-element-put-property 113 elem :post-blank
109 elem :post-blank 114 (if (and (eq (org-element-type (org-export-get-next-element elem info))
110 (let ((post-blank (org-element-property :post-blank elem))) 115 'plain-list)
111 (if (not post-blank) 1 (max 1 post-blank))))))) 116 (not (and (eq (org-element-type elem) 'paragraph)
117 (org-export-get-previous-element elem info))))
118 0
119 1))))
112 ;; Return updated tree. 120 ;; Return updated tree.
113 tree) 121 tree)
114 122
@@ -149,7 +157,7 @@ channel."
149 (replace-regexp-in-string 157 (replace-regexp-in-string
150 "^" " " 158 "^" " "
151 (org-remove-indentation 159 (org-remove-indentation
152 (org-element-property :value example-block)))) 160 (org-export-format-code-default example-block info))))
153 161
154 162
155;;;; Headline 163;;;; Headline
@@ -244,7 +252,8 @@ a communication channel."
244 (off "[ ] ")) 252 (off "[ ] "))
245 (let ((tag (org-element-property :tag item))) 253 (let ((tag (org-element-property :tag item)))
246 (and tag (format "**%s:** "(org-export-data tag info)))) 254 (and tag (format "**%s:** "(org-export-data tag info))))
247 (org-trim (replace-regexp-in-string "^" " " contents))))) 255 (and contents
256 (org-trim (replace-regexp-in-string "^" " " contents))))))
248 257
249 258
250;;;; Line Break 259;;;; Line Break
@@ -262,24 +271,18 @@ channel."
262 "Transcode LINE-BREAK object into Markdown format. 271 "Transcode LINE-BREAK object into Markdown format.
263CONTENTS is the link's description. INFO is a plist used as 272CONTENTS is the link's description. INFO is a plist used as
264a communication channel." 273a communication channel."
265 (let ((--link-org-files-as-html-maybe 274 (let ((link-org-files-as-md
266 (function 275 (function
267 (lambda (raw-path info) 276 (lambda (raw-path)
268 ;; Treat links to `file.org' as links to `file.html', if 277 ;; Treat links to `file.org' as links to `file.md'.
269 ;; needed. See `org-html-link-org-files-as-html'. 278 (if (string= ".org" (downcase (file-name-extension raw-path ".")))
270 (cond 279 (concat (file-name-sans-extension raw-path) ".md")
271 ((and org-html-link-org-files-as-html 280 raw-path))))
272 (string= ".org"
273 (downcase (file-name-extension raw-path "."))))
274 (concat (file-name-sans-extension raw-path) "."
275 (plist-get info :html-extension)))
276 (t raw-path)))))
277 (type (org-element-property :type link))) 281 (type (org-element-property :type link)))
278 (cond ((member type '("custom-id" "id")) 282 (cond ((member type '("custom-id" "id"))
279 (let ((destination (org-export-resolve-id-link link info))) 283 (let ((destination (org-export-resolve-id-link link info)))
280 (if (stringp destination) ; External file. 284 (if (stringp destination) ; External file.
281 (let ((path (funcall --link-org-files-as-html-maybe 285 (let ((path (funcall link-org-files-as-md destination)))
282 destination info)))
283 (if (not contents) (format "<%s>" path) 286 (if (not contents) (format "<%s>" path)
284 (format "[%s](%s)" contents path))) 287 (format "[%s](%s)" contents path)))
285 (concat 288 (concat
@@ -293,19 +296,18 @@ a communication channel."
293 ((org-export-inline-image-p link org-html-inline-image-rules) 296 ((org-export-inline-image-p link org-html-inline-image-rules)
294 (let ((path (let ((raw-path (org-element-property :path link))) 297 (let ((path (let ((raw-path (org-element-property :path link)))
295 (if (not (file-name-absolute-p raw-path)) raw-path 298 (if (not (file-name-absolute-p raw-path)) raw-path
296 (expand-file-name raw-path))))) 299 (expand-file-name raw-path))))
297 (format "![%s](%s)" 300 (caption (org-export-data
298 (let ((caption (org-export-get-caption 301 (org-export-get-caption
299 (org-export-get-parent-element link)))) 302 (org-export-get-parent-element link)) info)))
300 (when caption (org-export-data caption info))) 303 (format "![img](%s)"
301 path))) 304 (if (not (org-string-nw-p caption)) path
305 (format "%s \"%s\"" path caption)))))
302 ((string= type "coderef") 306 ((string= type "coderef")
303 (let ((ref (org-element-property :path link))) 307 (let ((ref (org-element-property :path link)))
304 (format (org-export-get-coderef-format ref contents) 308 (format (org-export-get-coderef-format ref contents)
305 (org-export-resolve-coderef ref info)))) 309 (org-export-resolve-coderef ref info))))
306 ((equal type "radio") 310 ((equal type "radio") contents)
307 (let ((destination (org-export-resolve-radio-link link info)))
308 (org-export-data (org-element-contents destination) info)))
309 ((equal type "fuzzy") 311 ((equal type "fuzzy")
310 (let ((destination (org-export-resolve-fuzzy-link link info))) 312 (let ((destination (org-export-resolve-fuzzy-link link info)))
311 (if (org-string-nw-p contents) contents 313 (if (org-string-nw-p contents) contents
@@ -315,20 +317,17 @@ a communication channel."
315 (if (atom number) (number-to-string number) 317 (if (atom number) (number-to-string number)
316 (mapconcat 'number-to-string number ".")))))))) 318 (mapconcat 'number-to-string number "."))))))))
317 (t (let* ((raw-path (org-element-property :path link)) 319 (t (let* ((raw-path (org-element-property :path link))
318 (path (cond 320 (path
319 ((member type '("http" "https" "ftp")) 321 (cond
320 (concat type ":" raw-path)) 322 ((member type '("http" "https" "ftp"))
321 ((equal type "file") 323 (concat type ":" raw-path))
322 ;; Treat links to ".org" files as ".html", 324 ((string= type "file")
323 ;; if needed. 325 (let ((path (funcall link-org-files-as-md raw-path)))
324 (setq raw-path 326 (if (not (file-name-absolute-p path)) path
325 (funcall --link-org-files-as-html-maybe 327 ;; If file path is absolute, prepend it
326 raw-path info)) 328 ;; with "file:" component.
327 ;; If file path is absolute, prepend it 329 (concat "file:" path))))
328 ;; with protocol component - "file://". 330 (t raw-path))))
329 (if (not (file-name-absolute-p raw-path)) raw-path
330 (concat "file://" (expand-file-name raw-path))))
331 (t raw-path))))
332 (if (not contents) (format "<%s>" path) 331 (if (not contents) (format "<%s>" path)
333 (format "[%s](%s)" contents path))))))) 332 (format "[%s](%s)" contents path)))))))
334 333
@@ -403,6 +402,14 @@ a communication channel."
403 402
404;;;; Template 403;;;; Template
405 404
405(defun org-md-inner-template (contents info)
406 "Return body of document after converting it to Markdown syntax.
407CONTENTS is the transcoded contents string. INFO is a plist
408holding export options."
409 ;; Make sure CONTENTS is separated from table of contents and
410 ;; footnotes with at least a blank line.
411 (org-trim (org-html-inner-template (concat "\n" contents "\n") info)))
412
406(defun org-md-template (contents info) 413(defun org-md-template (contents info)
407 "Return complete document string after Markdown conversion. 414 "Return complete document string after Markdown conversion.
408CONTENTS is the transcoded contents string. INFO is a plist used 415CONTENTS is the transcoded contents string. INFO is a plist used
diff --git a/lisp/org/ox-odt.el b/lisp/org/ox-odt.el
index 1e966fe108c..772017cdd0c 100644
--- a/lisp/org/ox-odt.el
+++ b/lisp/org/ox-odt.el
@@ -1502,7 +1502,7 @@ original parsed data. INFO is a plist holding export options."
1502 (email (and (plist-get info :with-email) email))) 1502 (email (and (plist-get info :with-email) email)))
1503 (concat 1503 (concat
1504 ;; Title. 1504 ;; Title.
1505 (when title 1505 (when (org-string-nw-p title)
1506 (concat 1506 (concat
1507 (format "\n<text:p text:style-name=\"%s\">%s</text:p>" 1507 (format "\n<text:p text:style-name=\"%s\">%s</text:p>"
1508 "OrgTitle" (format "\n<text:title>%s</text:title>" title)) 1508 "OrgTitle" (format "\n<text:title>%s</text:title>" title))
@@ -2713,10 +2713,8 @@ INFO is a plist holding contextual information. See
2713 (path (cond 2713 (path (cond
2714 ((member type '("http" "https" "ftp" "mailto")) 2714 ((member type '("http" "https" "ftp" "mailto"))
2715 (concat type ":" raw-path)) 2715 (concat type ":" raw-path))
2716 ((string= type "file") 2716 ((and (string= type "file") (file-name-absolute-p raw-path))
2717 (if (file-name-absolute-p raw-path) 2717 (concat "file:" raw-path))
2718 (concat "file://" (expand-file-name raw-path))
2719 (concat "file://" raw-path)))
2720 (t raw-path))) 2718 (t raw-path)))
2721 ;; Convert & to &amp; for correct XML representation 2719 ;; Convert & to &amp; for correct XML representation
2722 (path (replace-regexp-in-string "&" "&amp;" path)) 2720 (path (replace-regexp-in-string "&" "&amp;" path))
@@ -2735,11 +2733,11 @@ INFO is a plist holding contextual information. See
2735 ((string= type "radio") 2733 ((string= type "radio")
2736 (let ((destination (org-export-resolve-radio-link link info))) 2734 (let ((destination (org-export-resolve-radio-link link info)))
2737 (when destination 2735 (when destination
2738 (let ((desc (org-export-data (org-element-contents destination) info)) 2736 (format
2739 (href (org-export-solidify-link-text path))) 2737 "<text:bookmark-ref text:reference-format=\"text\" text:ref-name=\"OrgXref.%s\">%s</text:bookmark-ref>"
2740 (format 2738 (org-export-solidify-link-text
2741 "<text:bookmark-ref text:reference-format=\"text\" text:ref-name=\"OrgXref.%s\">%s</text:bookmark-ref>" 2739 (org-element-property :value destination))
2742 href desc))))) 2740 desc))))
2743 ;; Links pointing to a headline: Find destination and build 2741 ;; Links pointing to a headline: Find destination and build
2744 ;; appropriate referencing command. 2742 ;; appropriate referencing command.
2745 ((member type '("custom-id" "fuzzy" "id")) 2743 ((member type '("custom-id" "fuzzy" "id"))
diff --git a/lisp/org/ox-publish.el b/lisp/org/ox-publish.el
index 55cb6466e9c..b38fca97059 100644
--- a/lisp/org/ox-publish.el
+++ b/lisp/org/ox-publish.el
@@ -808,7 +808,8 @@ Default for SITEMAP-FILENAME is 'sitemap.org'."
808 (org-mode) 808 (org-mode)
809 (let ((title 809 (let ((title
810 (let ((property (plist-get (org-export-get-environment) :title))) 810 (let ((property (plist-get (org-export-get-environment) :title)))
811 (if property (org-element-interpret-data property) 811 (if property
812 (org-no-properties (org-element-interpret-data property))
812 (file-name-nondirectory (file-name-sans-extension file)))))) 813 (file-name-nondirectory (file-name-sans-extension file))))))
813 (unless visiting (kill-buffer buffer)) 814 (unless visiting (kill-buffer buffer))
814 (org-publish-cache-set-file-property file :title title) 815 (org-publish-cache-set-file-property file :title title)
diff --git a/lisp/org/ox-texinfo.el b/lisp/org/ox-texinfo.el
index ef881afe2c0..a961d7acdbc 100644
--- a/lisp/org/ox-texinfo.el
+++ b/lisp/org/ox-texinfo.el
@@ -1222,10 +1222,8 @@ INFO is a plist holding contextual information. See
1222 (path (cond 1222 (path (cond
1223 ((member type '("http" "https" "ftp")) 1223 ((member type '("http" "https" "ftp"))
1224 (concat type ":" raw-path)) 1224 (concat type ":" raw-path))
1225 ((string= type "file") 1225 ((and (string= type "file") (file-name-absolute-p raw-path))
1226 (if (file-name-absolute-p raw-path) 1226 (concat "file:" raw-path))
1227 (concat "file://" (expand-file-name raw-path))
1228 (concat "file://" raw-path)))
1229 (t raw-path))) 1227 (t raw-path)))
1230 (email (if (string= type "mailto") 1228 (email (if (string= type "mailto")
1231 (let ((text (replace-regexp-in-string 1229 (let ((text (replace-regexp-in-string
diff --git a/lisp/org/ox.el b/lisp/org/ox.el
index 0102523b5c7..faa2e0541b4 100644
--- a/lisp/org/ox.el
+++ b/lisp/org/ox.el
@@ -795,7 +795,8 @@ HTML code while every other back-end will ignore it."
795 :type 'coding-system) 795 :type 'coding-system)
796 796
797(defcustom org-export-copy-to-kill-ring 'if-interactive 797(defcustom org-export-copy-to-kill-ring 'if-interactive
798 "Should we push exported content to the kill ring?" 798 "Non-nil means pushing export output to the kill ring.
799This variable is ignored during asynchronous export."
799 :group 'org-export-general 800 :group 'org-export-general
800 :version "24.3" 801 :version "24.3"
801 :type '(choice 802 :type '(choice
@@ -1613,10 +1614,11 @@ for export. Return options as a plist."
1613 ;; Make sure point is at a heading. 1614 ;; Make sure point is at a heading.
1614 (if (org-at-heading-p) (org-up-heading-safe) (org-back-to-heading t)) 1615 (if (org-at-heading-p) (org-up-heading-safe) (org-back-to-heading t))
1615 ;; Take care of EXPORT_TITLE. If it isn't defined, use headline's 1616 ;; Take care of EXPORT_TITLE. If it isn't defined, use headline's
1616 ;; title as its fallback value. 1617 ;; title (with no todo keyword, priority cookie or tag) as its
1618 ;; fallback value.
1617 (when (setq prop (or (org-entry-get (point) "EXPORT_TITLE") 1619 (when (setq prop (or (org-entry-get (point) "EXPORT_TITLE")
1618 (progn (looking-at org-todo-line-regexp) 1620 (progn (looking-at org-complex-heading-regexp)
1619 (org-match-string-no-properties 3)))) 1621 (org-match-string-no-properties 4))))
1620 (setq plist 1622 (setq plist
1621 (plist-put 1623 (plist-put
1622 plist :title 1624 plist :title
@@ -3124,8 +3126,8 @@ locally for the subtree through node properties."
3124 ;; Populate OPTIONS and KEYWORDS. 3126 ;; Populate OPTIONS and KEYWORDS.
3125 (dolist (entry (cond ((eq backend 'default) org-export-options-alist) 3127 (dolist (entry (cond ((eq backend 'default) org-export-options-alist)
3126 ((org-export-backend-p backend) 3128 ((org-export-backend-p backend)
3127 (org-export-get-all-options backend)) 3129 (org-export-backend-options backend))
3128 (t (org-export-get-all-options 3130 (t (org-export-backend-options
3129 (org-export-get-backend backend))))) 3131 (org-export-get-backend backend)))))
3130 (let ((keyword (nth 1 entry)) 3132 (let ((keyword (nth 1 entry))
3131 (option (nth 2 entry))) 3133 (option (nth 2 entry)))
diff --git a/lisp/progmodes/prog-mode.el b/lisp/progmodes/prog-mode.el
index 3b850f3305b..407466932d9 100644
--- a/lisp/progmodes/prog-mode.el
+++ b/lisp/progmodes/prog-mode.el
@@ -67,7 +67,7 @@ Regexp match data 0 points to the chars."
67 (let* ((start (match-beginning 0)) 67 (let* ((start (match-beginning 0))
68 (end (match-end 0)) 68 (end (match-end 0))
69 (syntaxes (if (eq (char-syntax (char-after start)) ?w) 69 (syntaxes (if (eq (char-syntax (char-after start)) ?w)
70 '(?w) '(?. ?\\))) 70 '(?w ?_) '(?. ?\\)))
71 match) 71 match)
72 (if (or (memq (char-syntax (or (char-before start) ?\s)) syntaxes) 72 (if (or (memq (char-syntax (or (char-before start) ?\s)) syntaxes)
73 (memq (char-syntax (or (char-after end) ?\s)) syntaxes) 73 (memq (char-syntax (or (char-after end) ?\s)) syntaxes)
diff --git a/lisp/speedbar.el b/lisp/speedbar.el
index 814cec86e69..55e86e7fef3 100644
--- a/lisp/speedbar.el
+++ b/lisp/speedbar.el
@@ -1064,9 +1064,9 @@ If the selected frame is not speedbar, then speedbar frame is
1064selected. If the speedbar frame is active, then select the attached frame." 1064selected. If the speedbar frame is active, then select the attached frame."
1065 (interactive) 1065 (interactive)
1066 (speedbar-reset-scanners) 1066 (speedbar-reset-scanners)
1067 (dframe-get-focus 'speedbar-frame 'speedbar-frame-mode 1067 (dframe-get-focus 'speedbar-frame 'speedbar-frame-mode)
1068 (lambda () (let ((speedbar-update-flag t)) 1068 (let ((speedbar-update-flag t))
1069 (speedbar-timer-fn))))) 1069 (speedbar-timer-fn)))
1070 1070
1071(defsubst speedbar-frame-width () 1071(defsubst speedbar-frame-width ()
1072 "Return the width of the speedbar frame in characters. 1072 "Return the width of the speedbar frame in characters.
diff --git a/nt/ChangeLog b/nt/ChangeLog
index 8a8dcb14abd..9e7773a7421 100644
--- a/nt/ChangeLog
+++ b/nt/ChangeLog
@@ -1,3 +1,8 @@
12014-04-22 Eli Zaretskii <eliz@gnu.org>
2
3 * inc/ms-w32.h (lseek): Define only if not already a macro.
4 Suggested by Fabrice Popineau <fabrice.popineau@gmail.com>.
5
12014-04-11 Ken Brown <kbrown@cornell.edu> 62014-04-11 Ken Brown <kbrown@cornell.edu>
2 7
3 * emacs.rc: Revert last change. 8 * emacs.rc: Revert last change.
diff --git a/nt/inc/ms-w32.h b/nt/inc/ms-w32.h
index dca3476b2b6..8f7c36ab1ee 100644
--- a/nt/inc/ms-w32.h
+++ b/nt/inc/ms-w32.h
@@ -276,7 +276,10 @@ typedef int pid_t;
276#endif 276#endif
277#define isatty _isatty 277#define isatty _isatty
278#define _longjmp longjmp 278#define _longjmp longjmp
279/* MinGW64 defines lseek to invoke lseek64. */
280#ifndef lseek
279#define lseek _lseek 281#define lseek _lseek
282#endif
280#define popen _popen 283#define popen _popen
281#define pclose _pclose 284#define pclose _pclose
282#define strdup _strdup 285#define strdup _strdup
diff --git a/src/ChangeLog b/src/ChangeLog
index bb2e2bad555..fdbf922173b 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,25 @@
12014-04-22 Paul Eggert <eggert@cs.ucla.edu>
2
3 Port to GCC 4.9.0 with --enable-gcc-warnings.
4 * image.c (struct my_jpeg_error_mgr) [lint]: Remove member fp.
5 All uses removed.
6 (jpeg_load_body) [lint]: Add a 'volatile' to pacify a buggy GCC in
7 a way that also works with GCC 4.9.0.
8
9 * search.c (Fnewline_cache_check): Remove unused locals.
10
112014-04-22 Eli Zaretskii <eliz@gnu.org>
12
13 * search.c (find_newline1): New subroutine.
14 (Fnewline_cache_check): New function.
15 (syms_of_search): Defsubr it.
16
172014-04-22 Jarek Czekalski <jarekczek@poczta.onet.pl>
18
19 Fix freezing with scroll bars of GTK3 Toolkit (bug#15801).
20 * keyboard.c (unblock_input): Add comment.
21 * xgselect.c (xg_select): Prevent Glib main loop recursion.
22
12014-04-22 Daniel Colascione <dancol@dancol.org> 232014-04-22 Daniel Colascione <dancol@dancol.org>
2 24
3 * lread.c (readevalloop_eager_expand_eval): New function 25 * lread.c (readevalloop_eager_expand_eval): New function
diff --git a/src/conf_post.h b/src/conf_post.h
index e9101ce1c57..2e78c2f5e25 100644
--- a/src/conf_post.h
+++ b/src/conf_post.h
@@ -119,7 +119,7 @@ You lose; /* Emacs for DOS must be compiled with DJGPP */
119#endif 119#endif
120 120
121/* We must intercept 'opendir' calls to stash away the directory name, 121/* We must intercept 'opendir' calls to stash away the directory name,
122 so we could reuse it in realinkat, see msdos.c. */ 122 so we could reuse it in readlinkat; see msdos.c. */
123#define opendir sys_opendir 123#define opendir sys_opendir
124 124
125/* The "portable" definition of _GL_INLINE on config.h does not work 125/* The "portable" definition of _GL_INLINE on config.h does not work
diff --git a/src/image.c b/src/image.c
index bfbdfbc86b2..d558540c6e7 100644
--- a/src/image.c
+++ b/src/image.c
@@ -6262,9 +6262,6 @@ struct my_jpeg_error_mgr
6262 MY_JPEG_INVALID_IMAGE_SIZE, 6262 MY_JPEG_INVALID_IMAGE_SIZE,
6263 MY_JPEG_CANNOT_CREATE_X 6263 MY_JPEG_CANNOT_CREATE_X
6264 } failure_code; 6264 } failure_code;
6265#ifdef lint
6266 FILE *fp;
6267#endif
6268}; 6265};
6269 6266
6270 6267
@@ -6479,7 +6476,8 @@ jpeg_load_body (struct frame *f, struct image *img,
6479{ 6476{
6480 Lisp_Object file, specified_file; 6477 Lisp_Object file, specified_file;
6481 Lisp_Object specified_data; 6478 Lisp_Object specified_data;
6482 FILE *fp = NULL; 6479 /* The 'volatile' silences a bogus diagnostic; see GCC bug 54561. */
6480 FILE * IF_LINT (volatile) fp = NULL;
6483 JSAMPARRAY buffer; 6481 JSAMPARRAY buffer;
6484 int row_stride, x, y; 6482 int row_stride, x, y;
6485 XImagePtr ximg = NULL; 6483 XImagePtr ximg = NULL;
@@ -6512,8 +6510,6 @@ jpeg_load_body (struct frame *f, struct image *img,
6512 return 0; 6510 return 0;
6513 } 6511 }
6514 6512
6515 IF_LINT (mgr->fp = fp);
6516
6517 /* Customize libjpeg's error handling to call my_error_exit when an 6513 /* Customize libjpeg's error handling to call my_error_exit when an
6518 error is detected. This function will perform a longjmp. */ 6514 error is detected. This function will perform a longjmp. */
6519 mgr->cinfo.err = fn_jpeg_std_error (&mgr->pub); 6515 mgr->cinfo.err = fn_jpeg_std_error (&mgr->pub);
@@ -6552,9 +6548,6 @@ jpeg_load_body (struct frame *f, struct image *img,
6552 return 0; 6548 return 0;
6553 } 6549 }
6554 6550
6555 /* Silence a bogus diagnostic; see GCC bug 54561. */
6556 IF_LINT (fp = mgr->fp);
6557
6558 /* Create the JPEG decompression object. Let it read from fp. 6551 /* Create the JPEG decompression object. Let it read from fp.
6559 Read the JPEG image header. */ 6552 Read the JPEG image header. */
6560 fn_jpeg_CreateDecompress (&mgr->cinfo, JPEG_LIB_VERSION, sizeof *&mgr->cinfo); 6553 fn_jpeg_CreateDecompress (&mgr->cinfo, JPEG_LIB_VERSION, sizeof *&mgr->cinfo);
diff --git a/src/keyboard.c b/src/keyboard.c
index 678cf5abcbd..705e9191c61 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -7117,7 +7117,12 @@ unblock_input_to (int level)
7117/* End critical section. 7117/* End critical section.
7118 7118
7119 If doing signal-driven input, and a signal came in when input was 7119 If doing signal-driven input, and a signal came in when input was
7120 blocked, reinvoke the signal handler now to deal with it. */ 7120 blocked, reinvoke the signal handler now to deal with it.
7121
7122 It will also process queued input, if it was not read before.
7123 When a longer code sequence does not use block/unblock input
7124 at all, the whole input gathered up to the next call to
7125 unblock_input will be processed inside that call. */
7121 7126
7122void 7127void
7123unblock_input (void) 7128unblock_input (void)
diff --git a/src/search.c b/src/search.c
index 9bec825abcd..ee449213ace 100644
--- a/src/search.c
+++ b/src/search.c
@@ -3098,6 +3098,169 @@ DEFUN ("regexp-quote", Fregexp_quote, Sregexp_quote, 1, 1, 0,
3098 out - temp, 3098 out - temp,
3099 STRING_MULTIBYTE (string)); 3099 STRING_MULTIBYTE (string));
3100} 3100}
3101
3102/* Like find_newline, but doesn't use the cache, and only searches forward. */
3103static ptrdiff_t
3104find_newline1 (ptrdiff_t start, ptrdiff_t start_byte, ptrdiff_t end,
3105 ptrdiff_t end_byte, ptrdiff_t count, ptrdiff_t *shortage,
3106 ptrdiff_t *bytepos, bool allow_quit)
3107{
3108 if (count > 0)
3109 {
3110 if (!end)
3111 end = ZV, end_byte = ZV_BYTE;
3112 }
3113 else
3114 {
3115 if (!end)
3116 end = BEGV, end_byte = BEGV_BYTE;
3117 }
3118 if (end_byte == -1)
3119 end_byte = CHAR_TO_BYTE (end);
3120
3121 if (shortage != 0)
3122 *shortage = 0;
3123
3124 immediate_quit = allow_quit;
3125
3126 if (count > 0)
3127 while (start != end)
3128 {
3129 /* Our innermost scanning loop is very simple; it doesn't know
3130 about gaps, buffer ends, or the newline cache. ceiling is
3131 the position of the last character before the next such
3132 obstacle --- the last character the dumb search loop should
3133 examine. */
3134 ptrdiff_t tem, ceiling_byte = end_byte - 1;
3135
3136 if (start_byte == -1)
3137 start_byte = CHAR_TO_BYTE (start);
3138
3139 /* The dumb loop can only scan text stored in contiguous
3140 bytes. BUFFER_CEILING_OF returns the last character
3141 position that is contiguous, so the ceiling is the
3142 position after that. */
3143 tem = BUFFER_CEILING_OF (start_byte);
3144 ceiling_byte = min (tem, ceiling_byte);
3145
3146 {
3147 /* The termination address of the dumb loop. */
3148 unsigned char *lim_addr = BYTE_POS_ADDR (ceiling_byte) + 1;
3149 ptrdiff_t lim_byte = ceiling_byte + 1;
3150
3151 /* Nonpositive offsets (relative to LIM_ADDR and LIM_BYTE)
3152 of the base, the cursor, and the next line. */
3153 ptrdiff_t base = start_byte - lim_byte;
3154 ptrdiff_t cursor, next;
3155
3156 for (cursor = base; cursor < 0; cursor = next)
3157 {
3158 /* The dumb loop. */
3159 unsigned char *nl = memchr (lim_addr + cursor, '\n', - cursor);
3160 next = nl ? nl - lim_addr : 0;
3161
3162 if (! nl)
3163 break;
3164 next++;
3165
3166 if (--count == 0)
3167 {
3168 immediate_quit = 0;
3169 if (bytepos)
3170 *bytepos = lim_byte + next;
3171 return BYTE_TO_CHAR (lim_byte + next);
3172 }
3173 }
3174
3175 start_byte = lim_byte;
3176 start = BYTE_TO_CHAR (start_byte);
3177 }
3178 }
3179
3180 immediate_quit = 0;
3181 if (shortage)
3182 *shortage = count;
3183 if (bytepos)
3184 {
3185 *bytepos = start_byte == -1 ? CHAR_TO_BYTE (start) : start_byte;
3186 eassert (*bytepos == CHAR_TO_BYTE (start));
3187 }
3188 return start;
3189}
3190
3191DEFUN ("newline-cache-check", Fnewline_cache_check, Snewline_cache_check,
3192 0, 1, 0,
3193 doc: /* Check the newline cache of BUFFER against buffer contents.
3194
3195BUFFER defaults to the current buffer.
3196
3197Value is an array of 2 sub-arrays of buffer positions for newlines,
3198the first based on the cache, the second based on actually scanning
3199the buffer. If the buffer doesn't have a cache, the value is nil. */)
3200 (Lisp_Object buffer)
3201{
3202 struct buffer *buf;
3203 ptrdiff_t shortage, nl_count_cache, nl_count_buf;
3204 Lisp_Object cache_newlines, buf_newlines, val;
3205 ptrdiff_t from, found, i;
3206
3207 if (NILP (buffer))
3208 buf = current_buffer;
3209 else
3210 {
3211 CHECK_BUFFER (buffer);
3212 buf = XBUFFER (buffer);
3213 }
3214 if (buf->base_buffer)
3215 buf = buf->base_buffer;
3216
3217 /* If the buffer doesn't have a newline cache, return nil. */
3218 if (NILP (BVAR (buf, cache_long_scans))
3219 || buf->newline_cache == NULL)
3220 return Qnil;
3221
3222 /* How many newlines are there according to the cache? */
3223 find_newline (BUF_BEG (buf), BUF_BEG_BYTE (buf),
3224 BUF_Z (buf), BUF_Z_BYTE (buf),
3225 TYPE_MAXIMUM (ptrdiff_t), &shortage, NULL, true);
3226 nl_count_cache = TYPE_MAXIMUM (ptrdiff_t) - shortage;
3227
3228 /* Create vector and populate it. */
3229 cache_newlines = make_uninit_vector (nl_count_cache);
3230 for (from = BUF_BEG( buf), found = from, i = 0;
3231 from < BUF_Z (buf);
3232 from = found, i++)
3233 {
3234 ptrdiff_t from_byte = CHAR_TO_BYTE (from);
3235
3236 found = find_newline (from, from_byte, 0, -1, 1, &shortage, NULL, true);
3237 if (shortage == 0)
3238 ASET (cache_newlines, i, make_number (found - 1));
3239 }
3240
3241 /* Now do the same, but without using the cache. */
3242 find_newline1 (BUF_BEG (buf), BUF_BEG_BYTE (buf),
3243 BUF_Z (buf), BUF_Z_BYTE (buf),
3244 TYPE_MAXIMUM (ptrdiff_t), &shortage, NULL, true);
3245 nl_count_buf = TYPE_MAXIMUM (ptrdiff_t) - shortage;
3246 buf_newlines = make_uninit_vector (nl_count_buf);
3247 for (from = BUF_BEG( buf), found = from, i = 0;
3248 from < BUF_Z (buf);
3249 from = found, i++)
3250 {
3251 ptrdiff_t from_byte = CHAR_TO_BYTE (from);
3252
3253 found = find_newline1 (from, from_byte, 0, -1, 1, &shortage, NULL, true);
3254 if (shortage == 0)
3255 ASET (buf_newlines, i, make_number (found - 1));
3256 }
3257
3258 /* Construct the value and return it. */
3259 val = make_uninit_vector (2);
3260 ASET (val, 0, cache_newlines);
3261 ASET (val, 1, buf_newlines);
3262 return val;
3263}
3101 3264
3102void 3265void
3103syms_of_search (void) 3266syms_of_search (void)
@@ -3170,4 +3333,5 @@ is to bind it with `let' around a small expression. */);
3170 defsubr (&Smatch_data); 3333 defsubr (&Smatch_data);
3171 defsubr (&Sset_match_data); 3334 defsubr (&Sset_match_data);
3172 defsubr (&Sregexp_quote); 3335 defsubr (&Sregexp_quote);
3336 defsubr (&Snewline_cache_check);
3173} 3337}
diff --git a/src/xgselect.c b/src/xgselect.c
index 5f71ff84014..bf889a90e97 100644
--- a/src/xgselect.c
+++ b/src/xgselect.c
@@ -28,6 +28,18 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
28#include <stdbool.h> 28#include <stdbool.h>
29#include <timespec.h> 29#include <timespec.h>
30#include "frame.h" 30#include "frame.h"
31#include "blockinput.h"
32
33/* `xg_select' is a `pselect' replacement. Why do we need a separate function?
34 1. Timeouts. Glib and Gtk rely on timer events. If we did pselect
35 with a greater timeout then the one scheduled by Glib, we would
36 not allow Glib to process its timer events. We want Glib to
37 work smoothly, so we need to reduce our timeout to match Glib.
38 2. Descriptors. Glib may listen to more file descriptors than we do.
39 So we add Glib descriptors to our pselect pool, but we don't change
40 the value returned by the function. The return value matches only
41 the descriptors passed as arguments, making it compatible with
42 plain pselect. */
31 43
32int 44int
33xg_select (int fds_lim, fd_set *rfds, fd_set *wfds, fd_set *efds, 45xg_select (int fds_lim, fd_set *rfds, fd_set *wfds, fd_set *efds,
@@ -47,12 +59,6 @@ xg_select (int fds_lim, fd_set *rfds, fd_set *wfds, fd_set *efds,
47 bool need_to_dispatch; 59 bool need_to_dispatch;
48 USE_SAFE_ALLOCA; 60 USE_SAFE_ALLOCA;
49 61
50 /* Do not try to optimize with an initial check with g_main_context_pending
51 and a call to pselect if it returns false. If Gdk has a timeout for 0.01
52 second, and Emacs has a timeout for 1 second, g_main_context_pending will
53 return false, but the timeout will be 1 second, thus missing the gdk
54 timeout with a lot. */
55
56 context = g_main_context_default (); 62 context = g_main_context_default ();
57 63
58 if (rfds) all_rfds = *rfds; 64 if (rfds) all_rfds = *rfds;
@@ -136,8 +142,13 @@ xg_select (int fds_lim, fd_set *rfds, fd_set *wfds, fd_set *efds,
136 if (need_to_dispatch) 142 if (need_to_dispatch)
137 { 143 {
138 int pselect_errno = errno; 144 int pselect_errno = errno;
145 /* Prevent g_main_dispatch recursion, that would occur without
146 block_input wrapper, because event handlers call
147 unblock_input. Event loop recursion was causing Bug#15801. */
148 block_input ();
139 while (g_main_context_pending (context)) 149 while (g_main_context_pending (context))
140 g_main_context_dispatch (context); 150 g_main_context_dispatch (context);
151 unblock_input ();
141 errno = pselect_errno; 152 errno = pselect_errno;
142 } 153 }
143 154
diff --git a/test/ChangeLog b/test/ChangeLog
index 1caf0b3eb85..7652e71f5c3 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,16 @@
12014-04-22 Michael Albinus <michael.albinus@gmx.de>
2
3 * automated/tramp-tests.el (tramp--test-check-files): Remove traces.
4 (tramp-test30-special-characters): Remove test for backslash.
5
62014-04-20 Michael Albinus <michael.albinus@gmx.de>
7
8 * automated/tramp-tests.el
9 (tramp-test19-directory-files-and-attributes)
10 (tramp-test22-file-times): Check for `file-attributes' equality
11 only if there is a usable timestamp.
12 (tramp--test-check-files): Do not use `copy-sequence'.
13
12014-04-22 Daniel Colascione <dancol@dancol.org> 142014-04-22 Daniel Colascione <dancol@dancol.org>
2 15
3 * automated/bytecomp-tests.el (test-byte-comp-compile-and-load): 16 * automated/bytecomp-tests.el (test-byte-comp-compile-and-load):
diff --git a/test/automated/cl-lib.el b/test/automated/cl-lib.el
index 48a4c5da251..6bbd9a5e81d 100644
--- a/test/automated/cl-lib.el
+++ b/test/automated/cl-lib.el
@@ -195,6 +195,9 @@
195 (should (eql (cl-mismatch "Aa" "aA") 0)) 195 (should (eql (cl-mismatch "Aa" "aA") 0))
196 (should (eql (cl-mismatch '(a b c) '(a b d)) 2))) 196 (should (eql (cl-mismatch '(a b c) '(a b d)) 2)))
197 197
198(ert-deftest cl-lib-test-loop ()
199 (should (eql (cl-loop with (a b c) = '(1 2 3) return (+ a b c)) 6)))
200
198(ert-deftest cl-lib-keyword-names-versus-values () 201(ert-deftest cl-lib-keyword-names-versus-values ()
199 (should (equal 202 (should (equal
200 (funcall (cl-function (lambda (&key a b) (list a b))) 203 (funcall (cl-function (lambda (&key a b) (list a b)))
diff --git a/test/automated/tramp-tests.el b/test/automated/tramp-tests.el
index 607718412fd..b6e757d3ae5 100644
--- a/test/automated/tramp-tests.el
+++ b/test/automated/tramp-tests.el
@@ -1012,14 +1012,22 @@ This tests also `file-readable-p' and `file-regular-p'."
1012 (write-region "boz" nil (expand-file-name "boz" tmp-name2)) 1012 (write-region "boz" nil (expand-file-name "boz" tmp-name2))
1013 (setq attr (directory-files-and-attributes tmp-name2)) 1013 (setq attr (directory-files-and-attributes tmp-name2))
1014 (should (consp attr)) 1014 (should (consp attr))
1015 ;; Dumb remote shells without perl(1) or stat(1) are not
1016 ;; able to return the date correctly. They say "don't know".
1015 (dolist (elt attr) 1017 (dolist (elt attr)
1016 (should 1018 (unless
1017 (equal (file-attributes (expand-file-name (car elt) tmp-name2)) 1019 (equal
1018 (cdr elt)))) 1020 (nth 5
1021 (file-attributes (expand-file-name (car elt) tmp-name2)))
1022 '(0 0))
1023 (should
1024 (equal (file-attributes (expand-file-name (car elt) tmp-name2))
1025 (cdr elt)))))
1019 (setq attr (directory-files-and-attributes tmp-name2 'full)) 1026 (setq attr (directory-files-and-attributes tmp-name2 'full))
1020 (dolist (elt attr) 1027 (dolist (elt attr)
1021 (should 1028 (unless (equal (nth 5 (file-attributes (car elt))) '(0 0))
1022 (equal (file-attributes (car elt)) (cdr elt)))) 1029 (should
1030 (equal (file-attributes (car elt)) (cdr elt)))))
1023 (setq attr (directory-files-and-attributes tmp-name2 nil "^b")) 1031 (setq attr (directory-files-and-attributes tmp-name2 nil "^b"))
1024 (should (equal (mapcar 'car attr) '("bar" "boz")))) 1032 (should (equal (mapcar 'car attr) '("bar" "boz"))))
1025 (ignore-errors (delete-directory tmp-name1 'recursive))))) 1033 (ignore-errors (delete-directory tmp-name1 'recursive)))))
@@ -1142,16 +1150,16 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
1142 ;; We skip the test, if the remote handler is not able to 1150 ;; We skip the test, if the remote handler is not able to
1143 ;; set the correct time. 1151 ;; set the correct time.
1144 (skip-unless (set-file-times tmp-name1 '(0 1))) 1152 (skip-unless (set-file-times tmp-name1 '(0 1)))
1145 ;; Dumb busyboxes are not able to return the date correctly. 1153 ;; Dumb remote shells without perl(1) or stat(1) are not
1146 ;; They say "don't know. 1154 ;; able to return the date correctly. They say "don't know".
1147 (skip-unless (not (equal (nth 5 (file-attributes tmp-name1)) '(0 0)))) 1155 (unless (equal (nth 5 (file-attributes tmp-name1)) '(0 0))
1148 (should (equal (nth 5 (file-attributes tmp-name1)) '(0 1))) 1156 (should (equal (nth 5 (file-attributes tmp-name1)) '(0 1)))
1149 (write-region "bla" nil tmp-name2) 1157 (write-region "bla" nil tmp-name2)
1150 (should (file-exists-p tmp-name2)) 1158 (should (file-exists-p tmp-name2))
1151 (should (file-newer-than-file-p tmp-name2 tmp-name1)) 1159 (should (file-newer-than-file-p tmp-name2 tmp-name1))
1152 ;; `tmp-name3' does not exist. 1160 ;; `tmp-name3' does not exist.
1153 (should (file-newer-than-file-p tmp-name2 tmp-name3)) 1161 (should (file-newer-than-file-p tmp-name2 tmp-name3))
1154 (should-not (file-newer-than-file-p tmp-name3 tmp-name1))) 1162 (should-not (file-newer-than-file-p tmp-name3 tmp-name1))))
1155 (ignore-errors 1163 (ignore-errors
1156 (delete-file tmp-name1) 1164 (delete-file tmp-name1)
1157 (delete-file tmp-name2))))) 1165 (delete-file tmp-name2)))))
@@ -1446,7 +1454,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
1446 (sort (copy-sequence files) 'string-lessp))) 1454 (sort (copy-sequence files) 'string-lessp)))
1447 (should (equal (directory-files 1455 (should (equal (directory-files
1448 tmp-name2 nil directory-files-no-dot-files-regexp) 1456 tmp-name2 nil directory-files-no-dot-files-regexp)
1449 (sort (copy-sequence files) 'string-lessp)))) 1457 (sort files 'string-lessp))))
1450 (ignore-errors (delete-directory tmp-name1 'recursive)) 1458 (ignore-errors (delete-directory tmp-name1 'recursive))
1451 (ignore-errors (delete-directory tmp-name2 'recursive))))) 1459 (ignore-errors (delete-directory tmp-name2 'recursive)))))
1452 1460
@@ -1455,9 +1463,10 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
1455 "Check special characters in file names." 1463 "Check special characters in file names."
1456 (skip-unless (tramp--test-enabled)) 1464 (skip-unless (tramp--test-enabled))
1457 1465
1458 ;; Newlines and slashes in file names are not supported. So we don't test. 1466 ;; Newlines, slashes and backslashes in file names are not supported.
1467 ;; So we don't test.
1459 (tramp--test-check-files 1468 (tramp--test-check-files
1460 " foo bar\tbaz " 1469 " foo\tbar baz\t"
1461 "$foo$bar$$baz$" 1470 "$foo$bar$$baz$"
1462 "-foo-bar-baz-" 1471 "-foo-bar-baz-"
1463 "%foo%bar%baz%" 1472 "%foo%bar%baz%"
@@ -1465,7 +1474,6 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
1465 "?foo?bar?baz?" 1474 "?foo?bar?baz?"
1466 "*foo*bar*baz*" 1475 "*foo*bar*baz*"
1467 "'foo\"bar'baz\"" 1476 "'foo\"bar'baz\""
1468 "\\foo\\bar\\baz\\"
1469 "#foo#bar#baz#" 1477 "#foo#bar#baz#"
1470 "!foo|bar!baz|" 1478 "!foo|bar!baz|"
1471 ":foo;bar:baz;" 1479 ":foo;bar:baz;"