emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs-26 613c9a5: Update Org to v9.1.9


From: pank
Subject: [Emacs-diffs] emacs-26 613c9a5: Update Org to v9.1.9
Date: Tue, 27 Mar 2018 17:38:26 -0400 (EDT)

branch: emacs-26
commit 613c9a5c1f3237fbdc3a3db2341c7c59353d2aa2
Author: Rasmus <address@hidden>
Commit: Rasmus <address@hidden>

    Update Org to v9.1.9
    
    Please note this is a bugfix release. See etc/ORG-NEWS for details.
---
 doc/misc/org.texi          |  86 +++++++--------
 etc/ORG-NEWS               |  62 +++++------
 etc/org/README             |   2 +-
 etc/refcards/orgcard.tex   |   2 +-
 lisp/org/ob-C.el           |   2 +-
 lisp/org/ob-J.el           |   2 +-
 lisp/org/ob-R.el           |   2 +-
 lisp/org/ob-asymptote.el   |   2 +-
 lisp/org/ob-awk.el         |   2 +-
 lisp/org/ob-calc.el        |   2 +-
 lisp/org/ob-clojure.el     |   2 +-
 lisp/org/ob-comint.el      |   2 +-
 lisp/org/ob-coq.el         |   2 +-
 lisp/org/ob-core.el        |  21 +++-
 lisp/org/ob-css.el         |   2 +-
 lisp/org/ob-ditaa.el       |   2 +-
 lisp/org/ob-dot.el         |   2 +-
 lisp/org/ob-ebnf.el        |   2 +-
 lisp/org/ob-emacs-lisp.el  |   2 +-
 lisp/org/ob-eval.el        |   2 +-
 lisp/org/ob-exp.el         |   2 +-
 lisp/org/ob-forth.el       |   2 +-
 lisp/org/ob-fortran.el     |   2 +-
 lisp/org/ob-gnuplot.el     |   2 +-
 lisp/org/ob-groovy.el      |   6 +-
 lisp/org/ob-haskell.el     |   2 +-
 lisp/org/ob-hledger.el     |   2 +-
 lisp/org/ob-io.el          |   2 +-
 lisp/org/ob-java.el        |   2 +-
 lisp/org/ob-js.el          |   2 +-
 lisp/org/ob-keys.el        |   2 +-
 lisp/org/ob-latex.el       |   2 +-
 lisp/org/ob-ledger.el      |   2 +-
 lisp/org/ob-lilypond.el    |   4 +-
 lisp/org/ob-lisp.el        |   2 +-
 lisp/org/ob-lob.el         |  74 +++++++------
 lisp/org/ob-lua.el         |   2 +-
 lisp/org/ob-makefile.el    |   2 +-
 lisp/org/ob-matlab.el      |   2 +-
 lisp/org/ob-maxima.el      |   2 +-
 lisp/org/ob-mscgen.el      |   2 +-
 lisp/org/ob-ocaml.el       |   2 +-
 lisp/org/ob-octave.el      |   2 +-
 lisp/org/ob-org.el         |   2 +-
 lisp/org/ob-perl.el        |   2 +-
 lisp/org/ob-picolisp.el    |   2 +-
 lisp/org/ob-plantuml.el    |   2 +-
 lisp/org/ob-processing.el  |   2 +-
 lisp/org/ob-python.el      |   2 +-
 lisp/org/ob-ref.el         |   2 +-
 lisp/org/ob-ruby.el        |   2 +-
 lisp/org/ob-sass.el        |   2 +-
 lisp/org/ob-scheme.el      |   2 +-
 lisp/org/ob-screen.el      |   2 +-
 lisp/org/ob-shell.el       |   2 +-
 lisp/org/ob-shen.el        |   2 +-
 lisp/org/ob-sql.el         |   2 +-
 lisp/org/ob-sqlite.el      |   2 +-
 lisp/org/ob-stan.el        |   4 +-
 lisp/org/ob-table.el       |   2 +-
 lisp/org/ob-tangle.el      |   2 +-
 lisp/org/ob-vala.el        |   2 +-
 lisp/org/ob.el             |   2 +-
 lisp/org/org-agenda.el     |  73 ++++++-------
 lisp/org/org-archive.el    |   2 +-
 lisp/org/org-bbdb.el       |   2 +-
 lisp/org/org-capture.el    |  43 ++++----
 lisp/org/org-clock.el      | 255 +++++++++++++++++++++------------------------
 lisp/org/org-colview.el    |   2 +-
 lisp/org/org-compat.el     |  39 +------
 lisp/org/org-datetree.el   |   2 +-
 lisp/org/org-docview.el    |   2 +-
 lisp/org/org-element.el    |   8 +-
 lisp/org/org-entities.el   |   2 +-
 lisp/org/org-eww.el        |   2 +-
 lisp/org/org-faces.el      |   2 +-
 lisp/org/org-feed.el       |  25 +++--
 lisp/org/org-footnote.el   |   2 +-
 lisp/org/org-gnus.el       |  12 ++-
 lisp/org/org-habit.el      |   2 +-
 lisp/org/org-id.el         |   2 +-
 lisp/org/org-indent.el     |   2 +-
 lisp/org/org-info.el       |   2 +-
 lisp/org/org-inlinetask.el |   2 +-
 lisp/org/org-list.el       |  32 +++---
 lisp/org/org-macro.el      |   4 +-
 lisp/org/org-macs.el       |   2 +-
 lisp/org/org-mhe.el        |   2 +-
 lisp/org/org-mobile.el     |   2 +-
 lisp/org/org-mouse.el      |   2 +-
 lisp/org/org-pcomplete.el  |   2 +-
 lisp/org/org-plot.el       |   2 +-
 lisp/org/org-protocol.el   |   6 +-
 lisp/org/org-rmail.el      |   2 +-
 lisp/org/org-src.el        |   2 +-
 lisp/org/org-table.el      |  23 ++--
 lisp/org/org-timer.el      |   2 +-
 lisp/org/org-version.el    |   4 +-
 lisp/org/org-w3m.el        |   2 +-
 lisp/org/org.el            | 223 +++++++++++++++++++++------------------
 lisp/org/ox-html.el        |  12 +--
 lisp/org/ox-icalendar.el   |   2 +-
 lisp/org/ox-latex.el       |   7 +-
 lisp/org/ox-odt.el         |   2 +-
 lisp/org/ox-publish.el     |  80 ++++++++------
 lisp/org/ox.el             |  41 +++++---
 106 files changed, 660 insertions(+), 648 deletions(-)

diff --git a/doc/misc/org.texi b/doc/misc/org.texi
index 216f43e..7583e2b 100644
--- a/doc/misc/org.texi
+++ b/doc/misc/org.texi
@@ -4,11 +4,11 @@
 @settitle The Org Manual
 @include docstyle.texi
 
address@hidden VERSION 9.1.6
address@hidden DATE 2018-01-03
address@hidden VERSION 9.1.9
address@hidden DATE 2018-03-22
 
 @c Version and Contact Info
address@hidden MAINTAINERSITE @uref{http://orgmode.org,maintainers web page}
address@hidden MAINTAINERSITE @uref{https://orgmode.org,maintainers web page}
 @set AUTHOR Carsten Dominik
 @set MAINTAINER Carsten Dominik
 @set MAINTAINEREMAIL @email{carsten at orgmode dot org}
@@ -856,7 +856,7 @@ platform.
 There is a website for Org which provides links to the newest
 version of Org, as well as additional information, frequently asked
 questions (FAQ), links to tutorials, etc.  This page is located at
address@hidden://orgmode.org}.
address@hidden://orgmode.org}.
 @cindex print edition
 
 An earlier version (7.3) of this manual is available as a
@@ -894,11 +894,11 @@ Otherwise autoload Org functions will mess up the 
installation.
 Then, to make sure your Org configuration is taken into account, initialize
 the package system with @code{(package-initialize)} in your Emacs init file
 before setting any Org option.  If you want to use Org's package repository,
-check out the @uref{http://orgmode.org/elpa.html, Org ELPA page}.
+check out the @uref{https://orgmode.org/elpa.html, Org ELPA page}.
 
 @subsubheading Downloading Org as an archive
 
-You can download Org latest release from @uref{http://orgmode.org/, Org's
+You can download Org latest release from @uref{https://orgmode.org/, Org's
 website}.  In this case, make sure you set the load-path correctly in your
 Emacs init file:
 
@@ -923,7 +923,7 @@ You can clone Org's repository and install Org like this:
 
 @example
 $ cd ~/src/
-$ git clone git://orgmode.org/org-mode.git
+$ git clone https://code.orgmode.org/bzg/org-mode.git
 $ make autoloads
 @end example
 
@@ -939,7 +939,7 @@ install Org with @code{make install}.  Please run 
@code{make help} to get
 the list of compilation/installation options.
 
 For more detailed explanations on Org's build system, please check the Org
-Build System page on @uref{http://orgmode.org/worg/dev/org-build-system.html,
+Build System page on @uref{https://orgmode.org/worg/dev/org-build-system.html,
 Worg}.
 
 @node Activation
@@ -952,7 +952,7 @@ Worg}.
 @findex org-agenda
 @findex org-capture
 @findex org-store-link
address@hidden org-iswitchb
address@hidden org-switchb
 
 Org mode buffers need font-lock to be turned on: this is the default in
 address@hidden you don't use font-lock globally, turn it on in Org buffer
@@ -962,7 +962,7 @@ There are compatibility issues between Org mode and some 
other Elisp
 packages, please take the time to check the list (@pxref{Conflicts}).
 
 The four Org commands @command{org-store-link}, @command{org-capture},
address@hidden, and @command{org-iswitchb} should be accessible through
address@hidden, and @command{org-switchb} should be accessible through
 global keys (i.e., anywhere in Emacs, not just in Org buffers).  Here are
 suggested bindings for these keys, please modify the keys to your own
 liking.
@@ -970,7 +970,7 @@ liking.
 (global-set-key "\C-cl" 'org-store-link)
 (global-set-key "\C-ca" 'org-agenda)
 (global-set-key "\C-cc" 'org-capture)
-(global-set-key "\C-cb" 'org-iswitchb)
+(global-set-key "\C-cb" 'org-switchb)
 @end lisp
 
 @cindex Org mode, turning on
@@ -1902,7 +1902,7 @@ marker in square brackets, inside text.  Markers always 
start with
 @example
 The Org homepage[fn:1] now looks a lot better than it used to.
 ...
-[fn:1] The link is: http://orgmode.org
+[fn:1] The link is: https://orgmode.org
 @end example
 
 Org mode extends the number-based syntax to @emph{named} footnotes and
@@ -2032,7 +2032,7 @@ prefix is set, but folding/unfolding will work correctly.
 @cindex Org syntax
 
 A reference document providing a formal description of Org's syntax is
-available as @uref{http://orgmode.org/worg/dev/org-syntax.html, a draft on
+available as @uref{https://orgmode.org/worg/dev/org-syntax.html, a draft on
 Worg}, written and maintained by Nicolas Goaziou.  It defines Org's core
 internal concepts such as @code{headlines}, @code{sections}, @code{affiliated
 keywords}, @code{(greater) elements} and @code{objects}.  Each part of an Org
@@ -2280,17 +2280,6 @@ format used by Orgtbl radio tables, see @ref{Translator 
functions}, for a
 detailed description.
 @end table
 
-If you don't like the automatic table editor because it gets in your
-way on lines which you would like to start with @samp{|}, you can turn
-it off with
-
address@hidden
-(setq org-enable-table-editor nil)
address@hidden lisp
-
address@hidden Then the only table command that still works is
address@hidden C-c} to do a manual re-align.
-
 @node Column width and alignment
 @section Column width and alignment
 @cindex narrow columns in tables
@@ -2950,7 +2939,7 @@ element of @code{R-LIST}.
 
 These three functions can be used to implement associative arrays, count
 matching cells, rank results, group data etc.  For practical examples
-see @uref{http://orgmode.org/worg/org-tutorials/org-lookups.html, this
+see @uref{https://orgmode.org/worg/org-tutorials/org-lookups.html, this
 tutorial on Worg}.
 
 @node Editing and debugging formulas
@@ -3284,7 +3273,7 @@ Further control over the labels, type, content, and 
appearance of plots can
 be exercised through the @code{#+PLOT:} lines preceding a table.  See below
 for a complete list of Org-plot options.  The @code{#+PLOT:} lines are
 optional.  For more information and examples see the Org-plot tutorial at
address@hidden://orgmode.org/worg/org-tutorials/org-plot.html}.
address@hidden://orgmode.org/worg/org-tutorials/org-plot.html}.
 
 @subsubheading Plot Options
 
@@ -5835,7 +5824,7 @@ An alternative way to capture and process property values 
into a table is
 provided by Eric Schulte's @file{org-collector.el} which is a contributed
 address@hidden packages are not part of Emacs, but are
 distributed with the main distribution of Org (visit
address@hidden://orgmode.org}).}.  It provides a general API to collect
address@hidden://orgmode.org}).}.  It provides a general API to collect
 properties from entries in a certain scope, and arbitrary Lisp expressions to
 process these values before inserting them into a table or a dynamic block.
 
@@ -7062,6 +7051,7 @@ through the customize interface.
 
 @table @kbd
 @orgkey{C-c c C}
address@hidden org-capture-templates
 Customize the variable @code{org-capture-templates}.
 @end table
 
@@ -7657,13 +7647,13 @@ The variable @code{org-protocol-project-alist} maps 
URLs to local file names,
 by stripping URL parameters from the end and replacing the @code{:base-url}
 with @code{:working-directory} and @code{:online-suffix} with
 @code{:working-suffix}.  For example, assuming you own a local copy of
address@hidden://orgmode.org/worg/} contents at @file{/home/user/worg}, you can
address@hidden://orgmode.org/worg/} contents at @file{/home/user/worg}, you can
 set @code{org-protocol-project-alist} to the following
 
 @lisp
 (setq org-protocol-project-alist
       '(("Worg"
-        :base-url "http://orgmode.org/worg/";
+        :base-url "https://orgmode.org/worg/";
         :working-directory "/home/user/worg/"
         :online-suffix ".html"
         :working-suffix ".org")))
@@ -7671,7 +7661,7 @@ set @code{org-protocol-project-alist} to the following
 
 @noindent
 If you are now browsing
address@hidden://orgmode.org/worg/org-contrib/org-protocol.html} and find a typo
address@hidden://orgmode.org/worg/org-contrib/org-protocol.html} and find a typo
 or have an idea about how to enhance the documentation, simply click the
 bookmark and start editing.
 
@@ -8024,7 +8014,7 @@ Remove current file from the list of agenda files.
 @orgcmd{C-',org-cycle-agenda-files}
 @itemx C-,
 Cycle through agenda file list, visiting one file after the other.
address@hidden M-x org-iswitchb @key{RET}
address@hidden M-x org-switchb @key{RET}
 Command to use an @code{iswitchb}-like interface to switch to and between Org
 buffers.
 @end table
@@ -9984,7 +9974,7 @@ To turn off fontification for marked up text, you can set
 available markup syntax, you can customize @code{org-emphasis-alist}.  To fine
 tune what characters are allowed before and after the markup characters, you
 can tweak @code{org-emphasis-regexp-components}.  Beware that changing one of
-the above variables will no take effect until you reload Org, for which you
+the above variables will not take effect until you reload Org, for which you
 may need to restart Emacs.
 
 @node Horizontal rules
@@ -11779,7 +11769,7 @@ to @code{<a>} or @code{<img>} tags.  This example shows 
changing the link's
 @cindex @code{#+ATTR_HTML}
 @example
 #+ATTR_HTML: :title The Org mode homepage :style color:red;
-[[http://orgmode.org]]
+[[https://orgmode.org]]
 @end example
 
 @node Tables in HTML export
@@ -12054,9 +12044,9 @@ program enhances large files in two different ways of 
viewing.  One is an
 navigation can be done with the @kbd{n} and @kbd{p} keys (and some other keys
 as well, press @kbd{?} for an overview of the available keys).  The second
 one has a @emph{folding} view, much like Org provides inside Emacs.  The
-script is available at @url{http://orgmode.org/org-info.js} and the
-documentation at @url{http://orgmode.org/worg/code/org-info-js/}.  The script
-is hosted on @url{http://orgmode.org}, but for reliability, prefer installing
+script is available at @url{https://orgmode.org/org-info.js} and the
+documentation at @url{https://orgmode.org/worg/code/org-info-js/}.  The script
+is hosted on @url{https://orgmode.org}, but for reliability, prefer installing
 it on your own web server.
 
 To use this program, just add this line to the Org file:
@@ -12073,7 +12063,7 @@ below:
 
 @example
 path:    @r{The path to the script.  The default grabs the script from}
-         @address@hidden://orgmode.org/org-info.js}, but you might want to 
have}
+         @address@hidden://orgmode.org/org-info.js}, but you might want to 
have}
          @r{a local copy and use a path like @samp{../scripts/org-info.js}.}
 view:    @r{Initial view when the website is first shown.  Possible values 
are:}
          info      @r{Info-like interface with one section per page.}
@@ -12993,10 +12983,10 @@ of these examples works:
 @subsubheading Embedding clickable images
 For clickable images, provide a link whose description is another link to an
 image file.  For example, to embed an image @file{org-mode-unicorn.png} which
-when clicked jumps to @uref{http://Orgmode.org} website, do the following
+when clicked jumps to @uref{https://orgmode.org} website, do the following
 
 @example
-[[http://orgmode.org][./org-mode-unicorn.png]]
+[[https://orgmode.org][./org-mode-unicorn.png]]
 @end example
 
 @subsubheading Sizing and scaling of embedded images
@@ -15512,7 +15502,7 @@ For more examples of header arguments for 
@code{#+CALL:} lines,
 The ``Library of Babel'' is a collection of code blocks.  Like a function
 library, these code blocks can be called from other Org files.  A collection
 of useful code blocks is available on
address@hidden://orgmode.org/worg/library-of-babel.html,Worg}.  For remote code
address@hidden://orgmode.org/worg/library-of-babel.html,Worg}.  For remote code
 block evaluation syntax, @pxref{Evaluating code blocks}.
 
 @kindex C-c C-v i
@@ -15554,7 +15544,7 @@ Org supports the following languages for the @samp{src} 
code blocks:
 @end multitable
 
 Additional documentation for some languages are at
address@hidden://orgmode.org/worg/org-contrib/babel/languages.html}.
address@hidden://orgmode.org/worg/org-contrib/babel/languages.html}.
 
 @vindex org-babel-load-languages
 By default, only @code{emacs-lisp} is enabled for evaluation.  To enable or
@@ -15642,7 +15632,7 @@ Org expand @code{:noweb} references by default.
 Each language can have separate default header arguments by customizing the
 variable @code{org-babel-default-header-args:<lang>}, where @code{<lang>} is
 the name of the language.  For details, see the language-specific online
-documentation at @uref{http://orgmode.org/worg/org-contrib/babel}.
+documentation at @uref{https://orgmode.org/worg/org-contrib/babel/}.
 
 @node Header arguments in Org mode properties
 @subsubheading Header arguments in Org mode properties
@@ -18225,7 +18215,7 @@ Org.
 Org has a large number of hook variables for adding functionality.  This
 appendix illustrates using a few.  A complete list of hooks with
 documentation is maintained by the Worg project at
address@hidden://orgmode.org/worg/doc.html#hooks}.
address@hidden://orgmode.org/worg/doc.html#hooks}.
 
 @node Add-on packages
 @section Add-on packages
@@ -18234,10 +18224,10 @@ documentation is maintained by the Worg project at
 Various authors wrote a large number of add-on packages for Org.
 
 These packages are not part of Emacs, but they are distributed as contributed
-packages with the separate release available at @uref{http://orgmode.org}.
+packages with the separate release available at @uref{https://orgmode.org}.
 See the @file{contrib/README} file in the source code directory for a list of
 contributed files.  Worg page with more information is at:
address@hidden://orgmode.org/worg/org-contrib/}.
address@hidden://orgmode.org/worg/org-contrib/}.
 
 @node Adding hyperlink types
 @section Adding hyperlink types
@@ -18358,7 +18348,7 @@ to an alist of export functions.  This alist replaces 
the parent back-end
 functions.
 
 For complete documentation, see
address@hidden://orgmode.org/worg/dev/org-export-reference.html, the Org Export
address@hidden://orgmode.org/worg/dev/org-export-reference.html, the Org Export
 Reference on Worg}.
 
 @node Context-sensitive commands
@@ -18869,7 +18859,7 @@ Disable tag inheritance for agendas:
 
 These options can be applied to selected agenda views.  For more details
 about generation of agenda views, see the docstrings for the relevant
-variables, and this @uref{http://orgmode.org/worg/agenda-optimization.html,
+variables, and this @uref{https://orgmode.org/worg/agenda-optimization.html,
 dedicated Worg page} for agenda optimization.
 
 @node Extracting agenda information
@@ -19213,7 +19203,7 @@ For a server to host files, consider options like
 @uref{http://dropbox.com,Dropbox.com} address@hidden alternative is to
 use webdav server.  MobileOrg documentation has details of webdav server
 configuration.  Additional help is at
address@hidden://orgmode.org/worg/org-faq.html#mobileorg_webdav, FAQ entry}.}.
address@hidden://orgmode.org/worg/org-faq.html#mobileorg_webdav, FAQ entry}.}.
 On first connection, MobileOrg creates a directory @file{MobileOrg/} on
 Dropbox.  Pass its location to Emacs through an init file variable as
 follows:
diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index b9f3b0c..013c7b1 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -1,7 +1,7 @@
 ORG NEWS -- history of user-visible changes.   -*- mode: org; coding: utf-8 -*-
 
-#+LINK: doc http://orgmode.org/worg/doc.html#%s
-#+LINK: git http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=%s
+#+LINK: doc https://orgmode.org/worg/doc.html#%s
+#+LINK: git https://code.orgmode.org/bzg/org-mode/commit/%s
 
 Copyright (C) 2012-2018 Free Software Foundation, Inc.
 See the end of the file for license conditions.
@@ -211,8 +211,8 @@ this ~:prologue "fpprintprec: 2; linel: 50;"~ for 
presenting Maxima
 results in a beamer presentation.
 **** PlantUML: add support for header arguments
 
-[[http://plantuml.com/][Plantuml]] source blocks now support the 
[[http://orgmode.org/manual/prologue.html#prologue][~:prologue~]], 
[[http://orgmode.org/manual/epilogue.html#epilogue][~:epilogue~]] and
-[[http://orgmode.org/manual/var.html#var][~:var~]] header arguments.
+[[http://plantuml.com/][Plantuml]] source blocks now support the 
[[https://orgmode.org/manual/prologue.html#prologue][~:prologue~]], 
[[https://orgmode.org/manual/epilogue.html#epilogue][~:epilogue~]] and
+[[https://orgmode.org/manual/var.html#var][~:var~]] header arguments.
 
 **** SQL: new engine added ~sqsh~
 
@@ -266,7 +266,7 @@ using ~:namespaces~:
 - ~:flags~ passes arguments to the compiler
 - ~:cmdline~ passes commandline arguments to the generated executable
 
-Support for [[http://orgmode.org/manual/var.html#var][~:var~]] does not exist 
yet, also there is no 
[[http://orgmode.org/manual/session.html#session][~:session~]]
+Support for [[https://orgmode.org/manual/var.html#var][~:var~]] does not exist 
yet, also there is no 
[[https://orgmode.org/manual/session.html#session][~:session~]]
 support because Vala is a compiled language.
 
 The Vala compiler binary can be changed via the ~defcustom~
@@ -436,9 +436,9 @@ Call ~org-agenda-set-restriction-lock~ from the agenda.
 
 The library-of-babel.org used to be accessible from the =doc/=
 directory, distributed with Org’s core.  It is now accessible
-from the Worg community-driven documentation 
[[http://orgmode.org/worg/library-of-babel.html][here]].
+from the Worg community-driven documentation 
[[https://orgmode.org/worg/library-of-babel.html][here]].
 
-If you want to contribute to it, please see 
[[http://orgmode.org/worg/org-contribute.html][how to contribute]].
+If you want to contribute to it, please see 
[[https://orgmode.org/worg/org-contribute.html][how to contribute]].
 
 *** Allow multiple columns view
 
@@ -798,7 +798,7 @@ Evaluating a Stan block can produce two different results.
    that does not end in ".stan".
 
 For more information and usage examples, visit
-http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-stan.html
+https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-stan.html
 
 **** Support for Oracle databases via ~sqlplus~
 
@@ -1966,7 +1966,7 @@ This allows to specify the names of automatic bookmarks.
 *** New option 
[[doc:org-agenda-ignore-drawer-properties][org-agenda-ignore-drawer-properties]]
 
 This allows more flexibility when optimizing the agenda generation.
-See http://orgmode.org/worg/agenda-optimization.html for details.
+See https://orgmode.org/worg/agenda-optimization.html for details.
 *** New option: [[doc:org-html-link-use-abs-url][org-html-link-use-abs-url]] 
to force using absolute URLs
 
 This is an export/publishing option, and should be used either within
@@ -2050,7 +2050,7 @@ instructions:
 When in doubt, run =M-x org-version RET= and see if you have a mixed-up
 installation.
 
-See http://orgmode.org/org.html#Installation for details.
+See https://orgmode.org/org.html#Installation for details.
 
 ** Incompatible changes
 
@@ -2063,7 +2063,7 @@ you will have to update them.
 
 Below is a list of changes for which you need to take action.
 
-See http://orgmode.org/worg/org-8.0.html for the most recent version of
+See https://orgmode.org/worg/org-8.0.html for the most recent version of
 this list and for detailed instructions on how to migrate.
 
 **** New export engine
@@ -2085,7 +2085,7 @@ corresponding files start with the =ox-= prefix.
 If you customized an export back-end (like HTML or LaTeX), you will need to
 rename some options so that your customization is not lost.  Typically, an
 option starting with =org-export-html-= is now named =org-html-=.  See the
-manual for details and check [[http://orgmode.org/worg/org-8.0.html][this Worg 
page]] for directions.
+manual for details and check [[https://orgmode.org/worg/org-8.0.html][this 
Worg page]] for directions.
 
 **** New syntax for #+ATTR_HTML/LaTeX/... options
 
@@ -2146,7 +2146,7 @@ manual for details and check 
[[http://orgmode.org/worg/org-8.0.html][this Worg p
      ~ox-taskjuggler.el~ by Nicolas Goaziou and others.
 
      Also, the Taskjuggler exporter now uses TJ3 by default.  John Hendy
-     wrote [[http://orgmode.org/worg/org-tutorials/org-taskjuggler3.html][a 
tutorial on Worg]] for the TJ3 export.
+     wrote [[https://orgmode.org/worg/org-tutorials/org-taskjuggler3.html][a 
tutorial on Worg]] for the TJ3 export.
 
 ** New packages in core
 
@@ -2192,7 +2192,7 @@ manual for details and check 
[[http://orgmode.org/worg/org-8.0.html][this Worg p
 
     Display bullets instead of stars for headlines.
 
-    Also see [[http://orgmode.org/worg/org-faq.html#sec-8-12][this updated 
FAQ]] on how to display another character than "*"
+    Also see [[https://orgmode.org/worg/org-faq.html#sec-8-12][this updated 
FAQ]] on how to display another character than "*"
     for starting headlines.
 
 *** ~org-favtable.el~ by Marc-Oliver Ihm
@@ -2200,7 +2200,7 @@ manual for details and check 
[[http://orgmode.org/worg/org-8.0.html][this Worg p
     ~org-favtable.el~ helps you to create and update a table of favorite
     locations in org, keeping the most frequently visited lines right at
     the top.  This table is called "favtable".  See the documentation on
-    [[http://orgmode.org/worg/org-contrib/org-favtable.html][Worg]].
+    [[https://orgmode.org/worg/org-contrib/org-favtable.html][Worg]].
 
 *** ~ox-confluence.el~ by Sébastien Delafond
 
@@ -2241,7 +2241,7 @@ manual for details and check 
[[http://orgmode.org/worg/org-8.0.html][this Worg p
 
 **** New export generic options
 
-If you use Org exporter, we advise you to re-read 
[[http://orgmode.org/org.html#Exporting][the manual section about
+If you use Org exporter, we advise you to re-read 
[[https://orgmode.org/org.html#Exporting][the manual section about
 it]].  It has been updated and includes new options.
 
 Among the new/updated export options, three are of particular importance:
@@ -2616,7 +2616,7 @@ of those tags.)
 You can use group tags for sparse tree in an Org buffer, for creating
 agenda views, and for filtering.
 
-See http://orgmode.org/org.html#Tag-groups for details.
+See https://orgmode.org/org.html#Tag-groups for details.
 
 *** Links
 
@@ -2624,7 +2624,7 @@ See http://orgmode.org/org.html#Tag-groups for details.
 
 Org knows how to store links from Org buffers, from info files and from
 other Emacs buffers.  Org can be taught how to store links from any buffer
-through new link protocols (see 
[[http://orgmode.org/org.html#Adding-hyperlink-types]["Adding hyperlink 
types"]] in the manual.)
+through new link protocols (see 
[[https://orgmode.org/org.html#Adding-hyperlink-types]["Adding hyperlink 
types"]] in the manual.)
 
 Sometimes you want Org to ignore added link protocols and store the link
 as if the protocol was not known.
@@ -2648,7 +2648,7 @@ with-description and without-description links when 
inserting them.
 
 When storing a link to a headline like
 
-: * See [[http://orgmode.org][Org website]]
+: * See [[https://orgmode.org][Org website]]
 
 [[doc:org-store-link][org-store-link]] used to convert the square brackets 
into curly brackets.
 It does not anymore, taking the link description or the link path, when
@@ -2664,7 +2664,7 @@ those other formulas.
 **** You now use "nan" for empty fields in Calc formulas
 
 If empty fields are of interest, it is recommended to reread the section
-[[http://orgmode.org/org.html#Formula-syntax-for-Calc][3.5.2 Formula syntax 
for Calc]] of the manual because the description for the
+[[https://orgmode.org/org.html#Formula-syntax-for-Calc][3.5.2 Formula syntax 
for Calc]] of the manual because the description for the
 mode strings has been clarified and new examples have been added towards
 the end.
 
@@ -2683,7 +2683,7 @@ There are now three lookup functions:
 - [[doc:org-loopup-last][org-loopup-last]]
 - [[doc:org-loopup-all][org-loopup-all]]
 
-See [[http://orgmode.org/org.html#Lookup-functions][the manual]] for details.
+See [[https://orgmode.org/org.html#Lookup-functions][the manual]] for details.
 *** Startup keywords
 
 These new startup keywords are now available:
@@ -2814,7 +2814,7 @@ instead of requiring each Babel library one by one.
 
 David (and others) translated the Org compact guide in spanish:
 
-You can read the [[http://orgmode.org/worg/orgguide/orgguide.es.pdf][PDF 
guide]].
+You can read the [[https://orgmode.org/worg/orgguide/orgguide.es.pdf][PDF 
guide]].
 
 *** ~poporg.el~ and ~outorg.el~
 
@@ -2825,7 +2825,7 @@ Org-mode available.  ~outorg.el~ comes together with 
~outshine.el~ and
 ~navi-mode.el~, two more libraries by Thorsten Jolitz with the goal to give
 source-code buffers the /look & feel/ of Org-mode buffers while greatly
 improving navigation and structure editing.  A detailed description can be
-found here: http://orgmode.org/worg/org-tutorials/org-outside-org.html
+found here: https://orgmode.org/worg/org-tutorials/org-outside-org.html
 
 Here are two screencasts demonstrating Thorsten's tools:
 
@@ -2894,7 +2894,7 @@ in most environments.
 You can now add the Org ELPA repository like this:
 
 #+BEGIN_SRC emacs-lisp
-(add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/";) t)
+(add-to-list 'package-archives '("org" . "https://orgmode.org/elpa/";) t)
 #+END_SRC
 
 It contains both the =org-*.tar= package (the core Org distribution, also
@@ -2902,7 +2902,7 @@ available through https://elpa.gnu.org) and the 
=org-plus*.tar= package (the
 extended Org distribution, with non-GNU packages from the =contrib/=
 directory.)
 
-See http://orgmode.org/elpa/
+See https://orgmode.org/elpa/
 
 ** Overview of the new keybindings
 
@@ -3085,7 +3085,7 @@ See http://orgmode.org/elpa/
 
 **** New =todo-unblocked= and =nottodo-unblocked= skip conditions
 
-     See the [[http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=f426da][git 
commit]] for more explanations.
+     See the 
[[https://orgmode.org/cgit.cgi/org-mode.git/commit/?id=f426da][git commit]] for 
more explanations.
 
 **** Allow category filtering in the agenda
 
@@ -3402,7 +3402,7 @@ See http://orgmode.org/elpa/
      Thanks to Carsten for implementing this.
 
 **** ODT: Add support for ODT export in org-bbdb.el
-**** ODT: Add support for indented tables (see 
[[http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=e9fd33][this commit]] for 
details)
+**** ODT: Add support for indented tables (see 
[[https://orgmode.org/cgit.cgi/org-mode.git/commit/?id=e9fd33][this commit]] 
for details)
 **** ODT: Improve the conversion from ODT to other formats
 **** ASCII: Swap the level-1/level-2 characters to underline the headlines
 **** Support for Chinese, simplified Chinese, Russian, Ukrainian and Japanese
@@ -3535,7 +3535,7 @@ that Calc formulas can operate on them.
 
 *** Emacs 21 support has been dropped
 
-    Do not use Org mode 7.xx with Emacs 21, use 
[[http://orgmode.org/org-6.36c.zip][version 6.36c]] instead.
+    Do not use Org mode 7.xx with Emacs 21, use 
[[https://orgmode.org/org-6.36c.zip][version 6.36c]] instead.
 
 *** XEmacs support requires the XEmacs development version
 
@@ -3685,7 +3685,7 @@ that Calc formulas can operate on them.
     This replaces the earlier system org-remember.  The manual only
     describes org-capture, but for people who prefer to continue to
     use org-remember, we keep a static copy of the former manual
-    section [[http://orgmode.org/org-remember.pdf][chapter about remember]].
+    section [[https://orgmode.org/org-remember.pdf][chapter about remember]].
 
     The new system has a technically cleaner implementation and more
     possibilities for capturing different types of data.  See
@@ -3749,7 +3749,7 @@ that Calc formulas can operate on them.
 **** org-taskjuggler.el (Christian Egli)
 
      Christian Egli's /org-taskjuggler.el/ module is now part of Org.
-     He also wrote a 
[[http://orgmode.org/worg/org-tutorials/org-taskjuggler.php][tutorial]] for it.
+     He also wrote a 
[[https://orgmode.org/worg/org-tutorials/org-taskjuggler.php][tutorial]] for it.
 
 **** org-ctags.el (Paul Sexton)
 
@@ -3969,7 +3969,7 @@ that Calc formulas can operate on them.
      Org-mode documents or subtrees can now be converted directly in
      to BEAMER presentation.  Turning a tree into a simple
      presentations is straight forward, and there is also quite some
-     support to make richer presentations as well.  See the 
[[http://orgmode.org/manual/Beamer-class-export.html#Beamer-class-export][BEAMER
+     support to make richer presentations as well.  See the 
[[https://orgmode.org/manual/Beamer-class-export.html#Beamer-class-export][BEAMER
      section]] in the manual for more details.
 
      Thanks to everyone who has contributed to the discussion about
diff --git a/etc/org/README b/etc/org/README
index 048f84c..7c175e3 100644
--- a/etc/org/README
+++ b/etc/org/README
@@ -21,7 +21,7 @@ along with GNU Emacs.  If not, see 
<https://www.gnu.org/licenses/>.
 
 Author: Jambunathan K <kjambunathan at gmail dot com>
 Keywords: outlines, hypermedia, calendar, wp
-Homepage: http://orgmode.org
+Homepage: https://orgmode.org
 
 Commentary:
 
diff --git a/etc/refcards/orgcard.tex b/etc/refcards/orgcard.tex
index 1affe54..91cc03f 100644
--- a/etc/refcards/orgcard.tex
+++ b/etc/refcards/orgcard.tex
@@ -1,5 +1,5 @@
 % Reference Card for Org Mode
-\def\orgversionnumber{9.1.6}
+\def\orgversionnumber{9.1.9}
 \def\versionyear{2018}          % latest update
 \input emacsver.tex
 
diff --git a/lisp/org/ob-C.el b/lisp/org/ob-C.el
index 092354e..ff5be34 100644
--- a/lisp/org/ob-C.el
+++ b/lisp/org/ob-C.el
@@ -5,7 +5,7 @@
 ;; Author: Eric Schulte
 ;;      Thierry Banel
 ;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 
 ;; This file is part of GNU Emacs.
 
diff --git a/lisp/org/ob-J.el b/lisp/org/ob-J.el
index 4aec293..8781221 100644
--- a/lisp/org/ob-J.el
+++ b/lisp/org/ob-J.el
@@ -4,7 +4,7 @@
 
 ;; Author: Oleh Krehel
 ;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 
 ;; This file is part of GNU Emacs.
 
diff --git a/lisp/org/ob-R.el b/lisp/org/ob-R.el
index 84bb89f..d7e936e 100644
--- a/lisp/org/ob-R.el
+++ b/lisp/org/ob-R.el
@@ -5,7 +5,7 @@
 ;; Author: Eric Schulte
 ;;     Dan Davison
 ;; Keywords: literate programming, reproducible research, R, statistics
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 
 ;; This file is part of GNU Emacs.
 
diff --git a/lisp/org/ob-asymptote.el b/lisp/org/ob-asymptote.el
index 211eab7..84e2364 100644
--- a/lisp/org/ob-asymptote.el
+++ b/lisp/org/ob-asymptote.el
@@ -4,7 +4,7 @@
 
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 
 ;; This file is part of GNU Emacs.
 
diff --git a/lisp/org/ob-awk.el b/lisp/org/ob-awk.el
index 474111f..1ee4552 100644
--- a/lisp/org/ob-awk.el
+++ b/lisp/org/ob-awk.el
@@ -4,7 +4,7 @@
 
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 
 ;; This file is part of GNU Emacs.
 
diff --git a/lisp/org/ob-calc.el b/lisp/org/ob-calc.el
index 4ed5dd4..387cba2 100644
--- a/lisp/org/ob-calc.el
+++ b/lisp/org/ob-calc.el
@@ -4,7 +4,7 @@
 
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 
 ;; This file is part of GNU Emacs.
 
diff --git a/lisp/org/ob-clojure.el b/lisp/org/ob-clojure.el
index 852fe08..890f60a 100644
--- a/lisp/org/ob-clojure.el
+++ b/lisp/org/ob-clojure.el
@@ -5,7 +5,7 @@
 ;; Author: Joel Boehland, Eric Schulte, Oleh Krehel, Frederick Giasson
 ;;
 ;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 
 ;; This file is part of GNU Emacs.
 
diff --git a/lisp/org/ob-comint.el b/lisp/org/ob-comint.el
index 3244975..e9c6f93 100644
--- a/lisp/org/ob-comint.el
+++ b/lisp/org/ob-comint.el
@@ -4,7 +4,7 @@
 
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research, comint
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 
 ;; This file is part of GNU Emacs.
 
diff --git a/lisp/org/ob-coq.el b/lisp/org/ob-coq.el
index a52044e..875c794 100644
--- a/lisp/org/ob-coq.el
+++ b/lisp/org/ob-coq.el
@@ -4,7 +4,7 @@
 
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 
 ;; This file is part of GNU Emacs.
 
diff --git a/lisp/org/ob-core.el b/lisp/org/ob-core.el
index 0e2e78a..5d5faaa 100644
--- a/lisp/org/ob-core.el
+++ b/lisp/org/ob-core.el
@@ -5,7 +5,7 @@
 ;; Authors: Eric Schulte
 ;;     Dan Davison
 ;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 
 ;; This file is part of GNU Emacs.
 
@@ -980,13 +980,24 @@ with a prefix argument then this is passed on to
 (defmacro org-babel-do-in-edit-buffer (&rest body)
   "Evaluate BODY in edit buffer if there is a code block at point.
 Return t if a code block was found at point, nil otherwise."
-  `(let ((org-src-window-setup 'switch-invisibly))
-     (when (and (org-babel-where-is-src-block-head)
+  (declare (debug (body)))
+  `(let* ((element (org-element-at-point))
+         ;; This function is not supposed to move point.  However,
+         ;; `org-edit-src-code' always moves point back into the
+         ;; source block.  It is problematic if the point was before
+         ;; the code, e.g., on block's opening line.  In this case,
+         ;; we want to restore this location after executing BODY.
+         (outside-position
+          (and (<= (line-beginning-position)
+                   (org-element-property :post-affiliated element))
+               (point-marker)))
+         (org-src-window-setup 'switch-invisibly))
+     (when (and (org-babel-where-is-src-block-head element)
                (org-edit-src-code))
        (unwind-protect (progn ,@body)
-        (org-edit-src-exit))
+        (org-edit-src-exit)
+        (when outside-position (goto-char outside-position)))
        t)))
-(def-edebug-spec org-babel-do-in-edit-buffer (body))
 
 (defun org-babel-do-key-sequence-in-edit-buffer (key)
   "Read key sequence and execute the command in edit buffer.
diff --git a/lisp/org/ob-css.el b/lisp/org/ob-css.el
index 8c0b8d7..8cabf2b 100644
--- a/lisp/org/ob-css.el
+++ b/lisp/org/ob-css.el
@@ -4,7 +4,7 @@
 
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 
 ;; This file is part of GNU Emacs.
 
diff --git a/lisp/org/ob-ditaa.el b/lisp/org/ob-ditaa.el
index 82cc89d..9507630 100644
--- a/lisp/org/ob-ditaa.el
+++ b/lisp/org/ob-ditaa.el
@@ -4,7 +4,7 @@
 
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 
 ;; This file is part of GNU Emacs.
 
diff --git a/lisp/org/ob-dot.el b/lisp/org/ob-dot.el
index e72dd3c..31e0a4f 100644
--- a/lisp/org/ob-dot.el
+++ b/lisp/org/ob-dot.el
@@ -4,7 +4,7 @@
 
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 
 ;; This file is part of GNU Emacs.
 
diff --git a/lisp/org/ob-ebnf.el b/lisp/org/ob-ebnf.el
index 4e96b21..8c7c541 100644
--- a/lisp/org/ob-ebnf.el
+++ b/lisp/org/ob-ebnf.el
@@ -4,7 +4,7 @@
 
 ;; Author: Michael Gauland
 ;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 ;; Version: 1.00
 
 ;; This file is part of GNU Emacs.
diff --git a/lisp/org/ob-emacs-lisp.el b/lisp/org/ob-emacs-lisp.el
index 2dc3506..8ea2ec1 100644
--- a/lisp/org/ob-emacs-lisp.el
+++ b/lisp/org/ob-emacs-lisp.el
@@ -4,7 +4,7 @@
 
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 
 ;; This file is part of GNU Emacs.
 
diff --git a/lisp/org/ob-eval.el b/lisp/org/ob-eval.el
index 44972f9..2bfaa08 100644
--- a/lisp/org/ob-eval.el
+++ b/lisp/org/ob-eval.el
@@ -4,7 +4,7 @@
 
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research, comint
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 
 ;; This file is part of GNU Emacs.
 
diff --git a/lisp/org/ob-exp.el b/lisp/org/ob-exp.el
index d2c32fa..264dc0e 100644
--- a/lisp/org/ob-exp.el
+++ b/lisp/org/ob-exp.el
@@ -5,7 +5,7 @@
 ;; Authors: Eric Schulte
 ;;     Dan Davison
 ;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 
 ;; This file is part of GNU Emacs.
 
diff --git a/lisp/org/ob-forth.el b/lisp/org/ob-forth.el
index ed14b18..efd5759 100644
--- a/lisp/org/ob-forth.el
+++ b/lisp/org/ob-forth.el
@@ -4,7 +4,7 @@
 
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research, forth
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 
 ;; This file is part of GNU Emacs.
 
diff --git a/lisp/org/ob-fortran.el b/lisp/org/ob-fortran.el
index dad7eda..49e960f 100644
--- a/lisp/org/ob-fortran.el
+++ b/lisp/org/ob-fortran.el
@@ -5,7 +5,7 @@
 ;; Authors: Sergey Litvinov
 ;;       Eric Schulte
 ;; Keywords: literate programming, reproducible research, fortran
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 
 ;; This file is part of GNU Emacs.
 ;;
diff --git a/lisp/org/ob-gnuplot.el b/lisp/org/ob-gnuplot.el
index 674627b..b2f4913 100644
--- a/lisp/org/ob-gnuplot.el
+++ b/lisp/org/ob-gnuplot.el
@@ -4,7 +4,7 @@
 
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 
 ;; This file is part of GNU Emacs.
 
diff --git a/lisp/org/ob-groovy.el b/lisp/org/ob-groovy.el
index 4e10ecd..565b097 100644
--- a/lisp/org/ob-groovy.el
+++ b/lisp/org/ob-groovy.el
@@ -4,7 +4,7 @@
 
 ;; Author: Miro Bezjak
 ;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 
 ;; This file is part of GNU Emacs.
 
@@ -84,12 +84,12 @@ in BODY as elisp."
   (when session (error "Sessions are not (yet) supported for Groovy"))
   (pcase result-type
     (`output
-     (let ((src-file (org-babel-temp-file "groovy-")))
+     (let ((src-file (org-babel-temp-file "groovy_")))
        (progn (with-temp-file src-file (insert body))
               (org-babel-eval
                (concat org-babel-groovy-command " " src-file) ""))))
     (`value
-     (let* ((src-file (org-babel-temp-file "groovy-"))
+     (let* ((src-file (org-babel-temp-file "groovy_"))
             (wrapper (format org-babel-groovy-wrapper-method body)))
        (with-temp-file src-file (insert wrapper))
        (let ((raw (org-babel-eval
diff --git a/lisp/org/ob-haskell.el b/lisp/org/ob-haskell.el
index b19ee6d..e607ee0 100644
--- a/lisp/org/ob-haskell.el
+++ b/lisp/org/ob-haskell.el
@@ -4,7 +4,7 @@
 
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 
 ;; This file is part of GNU Emacs.
 
diff --git a/lisp/org/ob-hledger.el b/lisp/org/ob-hledger.el
index 7158903..727fb1f 100644
--- a/lisp/org/ob-hledger.el
+++ b/lisp/org/ob-hledger.el
@@ -4,7 +4,7 @@
 
 ;; Author: Simon Michael
 ;; Keywords: literate programming, reproducible research, plain text accounting
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 
 ;; This file is part of GNU Emacs.
 
diff --git a/lisp/org/ob-io.el b/lisp/org/ob-io.el
index 7c7d9df..4f407cc 100644
--- a/lisp/org/ob-io.el
+++ b/lisp/org/ob-io.el
@@ -4,7 +4,7 @@
 
 ;; Author: Andrzej Lichnerowicz
 ;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 
 ;; This file is part of GNU Emacs.
 
diff --git a/lisp/org/ob-java.el b/lisp/org/ob-java.el
index 1f25753..d6301bf 100644
--- a/lisp/org/ob-java.el
+++ b/lisp/org/ob-java.el
@@ -4,7 +4,7 @@
 
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 
 ;; This file is part of GNU Emacs.
 
diff --git a/lisp/org/ob-js.el b/lisp/org/ob-js.el
index 5aa2ed7..38c8c39 100644
--- a/lisp/org/ob-js.el
+++ b/lisp/org/ob-js.el
@@ -4,7 +4,7 @@
 
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research, js
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 
 ;; This file is part of GNU Emacs.
 
diff --git a/lisp/org/ob-keys.el b/lisp/org/ob-keys.el
index 3d8e865..fc96df4 100644
--- a/lisp/org/ob-keys.el
+++ b/lisp/org/ob-keys.el
@@ -4,7 +4,7 @@
 
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 
 ;; This file is part of GNU Emacs.
 
diff --git a/lisp/org/ob-latex.el b/lisp/org/ob-latex.el
index 4654ba5..6a963e5 100644
--- a/lisp/org/ob-latex.el
+++ b/lisp/org/ob-latex.el
@@ -4,7 +4,7 @@
 
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 
 ;; This file is part of GNU Emacs.
 
diff --git a/lisp/org/ob-ledger.el b/lisp/org/ob-ledger.el
index 84f0599..2a13314 100644
--- a/lisp/org/ob-ledger.el
+++ b/lisp/org/ob-ledger.el
@@ -4,7 +4,7 @@
 
 ;; Author: Eric S Fraga
 ;; Keywords: literate programming, reproducible research, accounting
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 
 ;; This file is part of GNU Emacs.
 
diff --git a/lisp/org/ob-lilypond.el b/lisp/org/ob-lilypond.el
index b4c4b9a..3d3cc07 100644
--- a/lisp/org/ob-lilypond.el
+++ b/lisp/org/ob-lilypond.el
@@ -4,7 +4,7 @@
 
 ;; Author: Martyn Jago
 ;; Keywords: babel language, literate programming
-;; Homepage: 
http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-lilypond.html
+;; Homepage: 
https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-lilypond.html
 
 ;; This file is part of GNU Emacs.
 
@@ -24,7 +24,7 @@
 ;;; Commentary:
 
 ;; Installation, ob-lilypond documentation, and examples are available at
-;; http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-lilypond.html
+;; https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-lilypond.html
 ;;
 ;; Lilypond documentation can be found at
 ;; http://lilypond.org/manuals.html
diff --git a/lisp/org/ob-lisp.el b/lisp/org/ob-lisp.el
index d4a7c37..b846138 100644
--- a/lisp/org/ob-lisp.el
+++ b/lisp/org/ob-lisp.el
@@ -6,7 +6,7 @@
 ;;      Eric Schulte
 ;;      David T. O'Toole <address@hidden>
 ;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 
 ;; This file is part of GNU Emacs.
 
diff --git a/lisp/org/ob-lob.el b/lisp/org/ob-lob.el
index f103a81..6af6bf0 100644
--- a/lisp/org/ob-lob.el
+++ b/lisp/org/ob-lob.el
@@ -5,7 +5,7 @@
 ;; Authors: Eric Schulte
 ;;      Dan Davison
 ;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 
 ;; This file is part of GNU Emacs.
 
@@ -79,44 +79,54 @@ if so then run the appropriate source block from the 
Library."
       (org-babel-execute-src-block nil info)
       t)))
 
-(defun org-babel-lob--src-info (name)
-  "Return internal representation for Babel data named NAME.
-NAME is a string.  This function looks into the current document
+(defun org-babel-lob--src-info (ref)
+  "Return internal representation for Babel data referenced as REF.
+REF is a string.  This function looks into the current document
 for a Babel call or source block.  If none is found, it looks
-after NAME in the Library of Babel.  Eventually, if that also
-fails, it returns nil."
-  ;; During export, look into the pristine copy of the document being
-  ;; exported instead of the current one, which could miss some data.
-  (with-current-buffer (or org-babel-exp-reference-buffer (current-buffer))
-    (org-with-wide-buffer
-     (goto-char (point-min))
-     (catch :found
-       (let ((case-fold-search t)
-            (regexp (org-babel-named-data-regexp-for-name name)))
-        (while (re-search-forward regexp nil t)
-          (let ((element (org-element-at-point)))
-            (when (equal name (org-element-property :name element))
-              (throw :found
-                     (pcase (org-element-type element)
-                       (`src-block (org-babel-get-src-block-info t element))
-                       (`babel-call (org-babel-lob-get-info element))
-                       ;; Non-executable data found.  Since names are
-                       ;; supposed to be unique throughout a document,
-                       ;; bail out.
-                       (_ nil))))))
-        ;; No element named NAME in buffer.  Try Library of Babel.
-        (cdr (assoc-string name org-babel-library-of-babel)))))))
+after REF in the Library of Babel."
+  (let ((name ref)
+       (file nil))
+    ;; Extract the remote file, if specified in the reference.
+    (when (string-match "\\`\\(.+\\):\\(.+\\)\\'" ref)
+      (setq file (match-string 1 ref))
+      (setq name (match-string 2 ref)))
+    ;; During export, look into the pristine copy of the document
+    ;; being exported instead of the current one, which could miss
+    ;; some data.
+    (with-current-buffer (cond (file (find-file-noselect file t))
+                              (org-babel-exp-reference-buffer)
+                              (t (current-buffer)))
+      (org-with-point-at 1
+       (catch :found
+         (let ((case-fold-search t)
+               (regexp (org-babel-named-data-regexp-for-name name)))
+           (while (re-search-forward regexp nil t)
+             (let ((element (org-element-at-point)))
+               (when (equal name (org-element-property :name element))
+                 (throw :found
+                        (pcase (org-element-type element)
+                          (`src-block (org-babel-get-src-block-info t element))
+                          (`babel-call (org-babel-lob-get-info element))
+                          ;; Non-executable data found.  Since names
+                          ;; are supposed to be unique throughout
+                          ;; a document, bail out.
+                          (_ nil))))))
+           (cdr (assoc-string ref org-babel-library-of-babel))))))))
 
 ;;;###autoload
 (defun org-babel-lob-get-info (&optional datum)
   "Return internal representation for Library of Babel function call.
-Consider DATUM, when provided, or element at point.  Return nil
-when not on an appropriate location.  Otherwise return a list
-compatible with `org-babel-get-src-block-info', which see."
+
+Consider DATUM, when provided, or element at point otherwise.
+
+Return nil when not on an appropriate location.  Otherwise return
+a list compatible with `org-babel-get-src-block-info', which
+see."
   (let* ((context (or datum (org-element-context)))
-        (type (org-element-type context)))
+        (type (org-element-type context))
+        (reference (org-element-property :call context)))
     (when (memq type '(babel-call inline-babel-call))
-      (pcase (org-babel-lob--src-info (org-element-property :call context))
+      (pcase (org-babel-lob--src-info reference)
        (`(,language ,body ,header ,_ ,_ ,_ ,coderef)
         (let ((begin (org-element-property (if (eq type 'inline-babel-call)
                                                :begin
diff --git a/lisp/org/ob-lua.el b/lisp/org/ob-lua.el
index ff9aae0..6ae72c7 100644
--- a/lisp/org/ob-lua.el
+++ b/lisp/org/ob-lua.el
@@ -4,7 +4,7 @@
 
 ;; Authors: Dieter Schoen
 ;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 
 ;; This file is part of GNU Emacs.
 
diff --git a/lisp/org/ob-makefile.el b/lisp/org/ob-makefile.el
index 692ebb6..4687037 100644
--- a/lisp/org/ob-makefile.el
+++ b/lisp/org/ob-makefile.el
@@ -5,7 +5,7 @@
 ;; Author: Eric Schulte
 ;;        Thomas S. Dye
 ;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 
 ;; This file is part of GNU Emacs.
 
diff --git a/lisp/org/ob-matlab.el b/lisp/org/ob-matlab.el
index da2eadc..5baac77 100644
--- a/lisp/org/ob-matlab.el
+++ b/lisp/org/ob-matlab.el
@@ -4,7 +4,7 @@
 
 ;; Author: Dan Davison
 ;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 
 ;; This file is part of GNU Emacs.
 
diff --git a/lisp/org/ob-maxima.el b/lisp/org/ob-maxima.el
index fc24717..b42a4b8 100644
--- a/lisp/org/ob-maxima.el
+++ b/lisp/org/ob-maxima.el
@@ -5,7 +5,7 @@
 ;; Author: Eric S Fraga
 ;;     Eric Schulte
 ;; Keywords: literate programming, reproducible research, maxima
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 
 ;; This file is part of GNU Emacs.
 
diff --git a/lisp/org/ob-mscgen.el b/lisp/org/ob-mscgen.el
index 8f8c8c5..b2c2443 100644
--- a/lisp/org/ob-mscgen.el
+++ b/lisp/org/ob-mscgen.el
@@ -4,7 +4,7 @@
 
 ;; Author: Juan Pechiar
 ;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 
 ;; This file is part of GNU Emacs.
 
diff --git a/lisp/org/ob-ocaml.el b/lisp/org/ob-ocaml.el
index b8212b1..90926b5 100644
--- a/lisp/org/ob-ocaml.el
+++ b/lisp/org/ob-ocaml.el
@@ -4,7 +4,7 @@
 
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 
 ;; This file is part of GNU Emacs.
 
diff --git a/lisp/org/ob-octave.el b/lisp/org/ob-octave.el
index 7d72905..c7339cf 100644
--- a/lisp/org/ob-octave.el
+++ b/lisp/org/ob-octave.el
@@ -4,7 +4,7 @@
 
 ;; Author: Dan Davison
 ;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 
 ;; This file is part of GNU Emacs.
 
diff --git a/lisp/org/ob-org.el b/lisp/org/ob-org.el
index 310aaec..7a495fa 100644
--- a/lisp/org/ob-org.el
+++ b/lisp/org/ob-org.el
@@ -4,7 +4,7 @@
 
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 
 ;; This file is part of GNU Emacs.
 
diff --git a/lisp/org/ob-perl.el b/lisp/org/ob-perl.el
index 2b96bf9..85806fd 100644
--- a/lisp/org/ob-perl.el
+++ b/lisp/org/ob-perl.el
@@ -5,7 +5,7 @@
 ;; Authors: Dan Davison
 ;;      Eric Schulte
 ;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 
 ;; This file is part of GNU Emacs.
 
diff --git a/lisp/org/ob-picolisp.el b/lisp/org/ob-picolisp.el
index fd129b8..cc2c8a8 100644
--- a/lisp/org/ob-picolisp.el
+++ b/lisp/org/ob-picolisp.el
@@ -5,7 +5,7 @@
 ;; Authors: Thorsten Jolitz
 ;;      Eric Schulte
 ;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 
 ;; This file is part of GNU Emacs.
 
diff --git a/lisp/org/ob-plantuml.el b/lisp/org/ob-plantuml.el
index 53ba42e..9a9313e 100644
--- a/lisp/org/ob-plantuml.el
+++ b/lisp/org/ob-plantuml.el
@@ -4,7 +4,7 @@
 
 ;; Author: Zhang Weize
 ;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 
 ;; This file is part of GNU Emacs.
 
diff --git a/lisp/org/ob-processing.el b/lisp/org/ob-processing.el
index 83fcadd..1a88930 100644
--- a/lisp/org/ob-processing.el
+++ b/lisp/org/ob-processing.el
@@ -4,7 +4,7 @@
 
 ;; Author: Jarmo Hurri (adapted from ob-asymptote.el written by Eric Schulte)
 ;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 
 ;; This file is part of GNU Emacs.
 
diff --git a/lisp/org/ob-python.el b/lisp/org/ob-python.el
index 951e4d2..9f1234b 100644
--- a/lisp/org/ob-python.el
+++ b/lisp/org/ob-python.el
@@ -5,7 +5,7 @@
 ;; Authors: Eric Schulte
 ;;      Dan Davison
 ;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 
 ;; This file is part of GNU Emacs.
 
diff --git a/lisp/org/ob-ref.el b/lisp/org/ob-ref.el
index 872f7f9..3efa17f 100644
--- a/lisp/org/ob-ref.el
+++ b/lisp/org/ob-ref.el
@@ -5,7 +5,7 @@
 ;; Authors: Eric Schulte
 ;;      Dan Davison
 ;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 
 ;; This file is part of GNU Emacs.
 
diff --git a/lisp/org/ob-ruby.el b/lisp/org/ob-ruby.el
index 6daf52b..7686ac4 100644
--- a/lisp/org/ob-ruby.el
+++ b/lisp/org/ob-ruby.el
@@ -4,7 +4,7 @@
 
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 
 ;; This file is part of GNU Emacs.
 
diff --git a/lisp/org/ob-sass.el b/lisp/org/ob-sass.el
index 5b179a6..af55d76 100644
--- a/lisp/org/ob-sass.el
+++ b/lisp/org/ob-sass.el
@@ -4,7 +4,7 @@
 
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 
 ;; This file is part of GNU Emacs.
 
diff --git a/lisp/org/ob-scheme.el b/lisp/org/ob-scheme.el
index cc78b57..0efe5f3 100644
--- a/lisp/org/ob-scheme.el
+++ b/lisp/org/ob-scheme.el
@@ -5,7 +5,7 @@
 ;; Authors: Eric Schulte
 ;;         Michael Gauland
 ;; Keywords: literate programming, reproducible research, scheme
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 
 ;; This file is part of GNU Emacs.
 
diff --git a/lisp/org/ob-screen.el b/lisp/org/ob-screen.el
index 4fad849..fb7c8e2 100644
--- a/lisp/org/ob-screen.el
+++ b/lisp/org/ob-screen.el
@@ -4,7 +4,7 @@
 
 ;; Author: Benjamin Andresen
 ;; Keywords: literate programming, interactive shell
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 
 ;; This file is part of GNU Emacs.
 
diff --git a/lisp/org/ob-shell.el b/lisp/org/ob-shell.el
index c53dd65..362dfd5 100644
--- a/lisp/org/ob-shell.el
+++ b/lisp/org/ob-shell.el
@@ -4,7 +4,7 @@
 
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 
 ;; This file is part of GNU Emacs.
 
diff --git a/lisp/org/ob-shen.el b/lisp/org/ob-shen.el
index 9308e5b..d81e7d6 100644
--- a/lisp/org/ob-shen.el
+++ b/lisp/org/ob-shen.el
@@ -4,7 +4,7 @@
 
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research, shen
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 
 ;; This file is part of GNU Emacs.
 
diff --git a/lisp/org/ob-sql.el b/lisp/org/ob-sql.el
index 524e9b7..959ede3 100644
--- a/lisp/org/ob-sql.el
+++ b/lisp/org/ob-sql.el
@@ -4,7 +4,7 @@
 
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 
 ;; This file is part of GNU Emacs.
 
diff --git a/lisp/org/ob-sqlite.el b/lisp/org/ob-sqlite.el
index 4799896..42528a3 100644
--- a/lisp/org/ob-sqlite.el
+++ b/lisp/org/ob-sqlite.el
@@ -4,7 +4,7 @@
 
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 
 ;; This file is part of GNU Emacs.
 
diff --git a/lisp/org/ob-stan.el b/lisp/org/ob-stan.el
index 6fa9fe5..ffc2681 100644
--- a/lisp/org/ob-stan.el
+++ b/lisp/org/ob-stan.el
@@ -4,7 +4,7 @@
 
 ;; Author: Kyle Meyer
 ;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 
 ;; This file is part of GNU Emacs.
 
@@ -39,7 +39,7 @@
 ;;    that does not end in ".stan".
 ;;
 ;; For more information and usage examples, visit
-;; http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-stan.html
+;; https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-stan.html
 ;;
 ;; [1] http://mc-stan.org/
 
diff --git a/lisp/org/ob-table.el b/lisp/org/ob-table.el
index 9ee0bcc..f6a5c88 100644
--- a/lisp/org/ob-table.el
+++ b/lisp/org/ob-table.el
@@ -4,7 +4,7 @@
 
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 
 ;; This file is part of GNU Emacs.
 
diff --git a/lisp/org/ob-tangle.el b/lisp/org/ob-tangle.el
index 5fa59ac..48eddb7 100644
--- a/lisp/org/ob-tangle.el
+++ b/lisp/org/ob-tangle.el
@@ -4,7 +4,7 @@
 
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 
 ;; This file is part of GNU Emacs.
 
diff --git a/lisp/org/ob-vala.el b/lisp/org/ob-vala.el
index 02b3bab..96c37e3 100644
--- a/lisp/org/ob-vala.el
+++ b/lisp/org/ob-vala.el
@@ -4,7 +4,7 @@
 
 ;; Author: Christian Garbs <address@hidden>
 ;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 
 ;;; License:
 
diff --git a/lisp/org/ob.el b/lisp/org/ob.el
index a029da8..35f65ff 100644
--- a/lisp/org/ob.el
+++ b/lisp/org/ob.el
@@ -4,7 +4,7 @@
 
 ;; Authors: Eric Schulte
 ;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 
 ;; This file is part of GNU Emacs.
 
diff --git a/lisp/org/org-agenda.el b/lisp/org/org-agenda.el
index 9aaec33..5bbf5e3 100644
--- a/lisp/org/org-agenda.el
+++ b/lisp/org/org-agenda.el
@@ -4,7 +4,7 @@
 
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 ;;
 ;; This file is part of GNU Emacs.
 ;;
@@ -1644,9 +1644,10 @@ When nil, such items are sorted as 0 minutes effort."
     (tags  . " %i %-12:c")
     (search . " %i %-12:c"))
   "Format specifications for the prefix of items in the agenda views.
-An alist with five entries, each for the different agenda types.  The
-keys of the sublists are `agenda', `todo', `search' and `tags'.
-The values are format strings.
+
+An alist with one entry per agenda type.  The keys of the
+sublists are `agenda', `todo', `search' and `tags'.  The values
+are format strings.
 
 This format works similar to a printf format, with the following meaning:
 
@@ -2075,7 +2076,10 @@ works you probably want to add it to 
`org-agenda-custom-commands' for good."
 (defvar org-agenda-follow-mode nil)
 (defvar org-agenda-entry-text-mode nil)
 (defvar org-agenda-clockreport-mode nil)
-(defvar org-agenda-show-log nil)
+(defvar org-agenda-show-log nil
+  "When non-nil, show the log in the agenda.
+Do not set this directly; instead use
+`org-agenda-start-with-log-mode', which see.")
 (defvar org-agenda-redo-command nil)
 (defvar org-agenda-query-string nil)
 (defvar org-agenda-mode-hook nil
@@ -2207,9 +2211,9 @@ The following commands are available:
            nil t)
   (unless org-agenda-keep-modes
     (setq org-agenda-follow-mode org-agenda-start-with-follow-mode
-         org-agenda-entry-text-mode org-agenda-start-with-entry-text-mode))
-  (setq org-agenda-show-log org-agenda-start-with-log-mode)
-  (setq org-agenda-clockreport-mode org-agenda-start-with-clockreport-mode)
+         org-agenda-entry-text-mode org-agenda-start-with-entry-text-mode
+         org-agenda-show-log org-agenda-start-with-log-mode
+         org-agenda-clockreport-mode org-agenda-start-with-clockreport-mode))
   (add-to-invisibility-spec '(org-filtered))
   (add-to-invisibility-spec '(org-link))
   (easy-menu-change
@@ -6172,7 +6176,7 @@ scheduled items with an hour specification like [h]h:mm."
                 ;; Nullify delay when a repeater triggered already
                 ;; and the delay is of the form --Xd.
                 ((and (string-match-p "--[0-9]+[hdwmy]" s)
-                      (> current schedule))
+                      (> schedule (org-agenda--timestamp-to-absolute s)))
                  0)
                 (suppress-delay
                  (let ((org-scheduled-delay-days suppress-delay))
@@ -8177,7 +8181,6 @@ so that the date SD will be in that range."
   (interactive)
   (org-agenda-check-type t 'agenda)
   (setq org-agenda-clockreport-mode (not org-agenda-clockreport-mode))
-  (setq org-agenda-start-with-clockreport-mode org-agenda-clockreport-mode)
   (org-agenda-set-mode-name)
   (org-agenda-redo)
   (message "Clocktable mode is %s"
@@ -8201,7 +8204,6 @@ log items, nothing else."
              nil 'clockcheck))
         (special '(closed clock state))
         (t (not org-agenda-show-log))))
-  (setq org-agenda-start-with-log-mode org-agenda-show-log)
   (org-agenda-set-mode-name)
   (org-agenda-redo)
   (message "Log mode is %s" (if org-agenda-show-log "on" "off")))
@@ -9895,32 +9897,33 @@ The prefix arg is passed through to the command if 
possible."
                    (org-agenda-set-tags ,tag
                                         ,(if (eq action ?+) ''on ''off))))))
 
-       (?s
-        (let ((time
-               (and (not arg)
-                    (org-read-date nil nil nil "(Re)Schedule to"
-                                   org-overriding-default-time))))
+       ((and (or ?s ?d) c)
+        (let* ((schedule? (eq c ?s))
+               (prompt (if schedule? "(Re)Schedule to" "(Re)Set Deadline to"))
+               (time
+                (and (not arg)
+                     (let ((new (org-read-date
+                                 nil nil nil prompt 
org-overriding-default-time)))
+                       ;; A "double plus" answer applies to every
+                       ;; scheduled time.  Do not turn it into
+                       ;; a fixed date yet.
+                       (if (string-match-p "\\`[ \t]*\\+\\+"
+                                           org-read-date-final-answer)
+                           org-read-date-final-answer
+                         new)))))
           ;; Make sure to not prompt for a note when bulk
-          ;; rescheduling as Org cannot cope with simultaneous notes.
-          ;; Besides, it could be annoying depending on the number of
-          ;; items re-scheduled.
+          ;; rescheduling/resetting deadline as Org cannot cope with
+          ;; simultaneous notes.  Besides, it could be annoying
+          ;; depending on the number of marked items.
           (setq cmd
-                `(lambda ()
-                   (let ((org-log-reschedule (and org-log-reschedule 'time)))
-                     (org-agenda-schedule arg ,time))))))
-       (?d
-        (let ((time
-               (and (not arg)
-                    (org-read-date nil nil nil "(Re)Set Deadline to"
-                                   org-overriding-default-time))))
-          ;; Make sure to not prompt for a note when bulk
-          ;; rescheduling as Org cannot cope with simultaneous
-          ;; notes.  Besides, it could be annoying depending on the
-          ;; number of items re-scheduled.
-          (setq cmd
-                `(lambda ()
-                   (let ((org-log-redeadline (and org-log-redeadline 'time)))
-                     (org-agenda-deadline arg ,time))))))
+                (if schedule?
+                    `(lambda ()
+                       (let ((org-log-reschedule
+                              (and org-log-reschedule 'time)))
+                         (org-agenda-schedule arg ,time)))
+                  `(lambda ()
+                     (let ((org-log-redeadline (and org-log-redeadline 'time)))
+                       (org-agenda-deadline arg ,time)))))))
 
        (?S
         (unless (org-agenda-check-type nil 'agenda 'todo)
diff --git a/lisp/org/org-archive.el b/lisp/org/org-archive.el
index 755de7f..e020ec2 100644
--- a/lisp/org/org-archive.el
+++ b/lisp/org/org-archive.el
@@ -4,7 +4,7 @@
 
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 ;;
 ;; This file is part of GNU Emacs.
 ;;
diff --git a/lisp/org/org-bbdb.el b/lisp/org/org-bbdb.el
index 1d39efb..5d36379 100644
--- a/lisp/org/org-bbdb.el
+++ b/lisp/org/org-bbdb.el
@@ -5,7 +5,7 @@
 ;; Authors: Carsten Dominik <carsten at orgmode dot org>
 ;;       Thomas Baumann <thomas dot baumann at ch dot tum dot de>
 ;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 ;;
 ;; This file is part of GNU Emacs.
 ;;
diff --git a/lisp/org/org-capture.el b/lisp/org/org-capture.el
index cb1741f..3de386c 100644
--- a/lisp/org/org-capture.el
+++ b/lisp/org/org-capture.el
@@ -4,7 +4,7 @@
 
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 ;;
 ;; This file is part of GNU Emacs.
 ;;
@@ -51,8 +51,8 @@
 (require 'org)
 
 (declare-function org-at-encrypted-entry-p "org-crypt" ())
-(declare-function org-datetree-find-date-create "org-datetree"
-                 (date &optional keep-restriction))
+(declare-function org-clock-update-mode-line "org-clock" (&optional refresh))
+(declare-function org-datetree-find-date-create "org-datetree" (date &optional 
keep-restriction))
 (declare-function org-decrypt-entry "org-crypt" ())
 (declare-function org-encrypt-entry "org-crypt" ())
 (declare-function org-table-analyze "org-table" ())
@@ -541,8 +541,8 @@ not-in-buffer: command not displayed in matching buffers
 If you define several checks, the agenda command will be
 accessible if there is at least one valid check.
 
-You can also bind a key to another agenda custom command
-depending on contextual rules.
+You can also bind a key to another capture template depending on
+contextual rules.
 
     \\='((\"c\" \"d\" ((in-mode . \"message-mode\"))))
 
@@ -724,21 +724,24 @@ captured item after finalizing."
 
   ;; Did we start the clock in this capture buffer?
   (when (and org-capture-clock-was-started
-            org-clock-marker (marker-buffer org-clock-marker)
-            (equal (marker-buffer org-clock-marker) (buffer-base-buffer))
-            (> org-clock-marker (point-min))
+            org-clock-marker
+            (eq (marker-buffer org-clock-marker) (buffer-base-buffer))
+            (>= org-clock-marker (point-min))
             (< org-clock-marker (point-max)))
-    ;; Looks like the clock we started is still running.  Clock out.
-    (when (not org-capture-clock-keep) (let (org-log-note-clock-out) 
(org-clock-out)))
-    (when (and (not org-capture-clock-keep)
-              (org-capture-get :clock-resume 'local)
-              (markerp (org-capture-get :interrupted-clock 'local))
-              (buffer-live-p (marker-buffer
-                              (org-capture-get :interrupted-clock 'local))))
-      (let ((clock-in-task (org-capture-get :interrupted-clock 'local)))
-       (org-with-point-at clock-in-task
-         (org-clock-in)))
-      (message "Interrupted clock has been resumed")))
+    ;; Looks like the clock we started is still running.
+    (if org-capture-clock-keep
+       ;; User may have completed clocked heading from the template.
+       ;; Refresh clock mode line.
+       (org-clock-update-mode-line t)
+      ;; Clock out.  Possibly resume interrupted clock.
+      (let (org-log-note-clock-out) (org-clock-out))
+      (when (and (org-capture-get :clock-resume 'local)
+                (markerp (org-capture-get :interrupted-clock 'local))
+                (buffer-live-p (marker-buffer
+                                (org-capture-get :interrupted-clock 'local))))
+       (let ((clock-in-task (org-capture-get :interrupted-clock 'local)))
+         (org-with-point-at clock-in-task (org-clock-in)))
+       (message "Interrupted clock has been resumed"))))
 
   (let ((beg (point-min))
        (end (point-max))
@@ -1118,7 +1121,7 @@ may have been stored before."
       (setq level (org-get-valid-level
                   (if (org-at-heading-p) (org-outline-level) 1)
                   1))
-      (if reversed? (outline-next-heading) (org-end-of-subtree t)))
+      (if reversed? (outline-next-heading) (org-end-of-subtree t t)))
      ;; Insert as a top-level entry at the beginning of the file.
      (reversed?
       (goto-char (point-min))
diff --git a/lisp/org/org-clock.el b/lisp/org/org-clock.el
index 4c5fcc6..ff32e28 100644
--- a/lisp/org/org-clock.el
+++ b/lisp/org/org-clock.el
@@ -4,7 +4,7 @@
 
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 ;;
 ;; This file is part of GNU Emacs.
 ;;
@@ -430,7 +430,9 @@ This applies when using `org-clock-goto'."
   :type 'integer)
 
 (defcustom org-clock-display-default-range 'thisyear
-  "Default range when displaying clocks with `org-clock-display'."
+  "Default range when displaying clocks with `org-clock-display'.
+Valid values are: `today', `yesterday', `thisweek', `lastweek',
+`thismonth', `lastmonth', `thisyear', `lastyear' and `untilnow'."
   :group 'org-clock
   :type '(choice (const today)
                 (const yesterday)
@@ -441,7 +443,8 @@ This applies when using `org-clock-goto'."
                 (const thisyear)
                 (const lastyear)
                 (const untilnow)
-                (const :tag "Select range interactively" interactive)))
+                (const :tag "Select range interactively" interactive))
+  :safe #'symbolp)
 
 (defvar org-clock-in-prepare-hook nil
   "Hook run when preparing the clock.
@@ -465,38 +468,6 @@ to add an effort property.")
 (defvar org-clock-stored-resume-clock nil
   "Clock to resume, saved by `org-clock-load'")
 
-(defconst org-clock--oldest-date
-  (let* ((dichotomy
-         (lambda (min max pred)
-           (if (funcall pred min) min
-             (cl-incf min)
-             (while (> (- max min) 1)
-               (let ((mean (+ (ash min -1) (ash max -1) (logand min max 1))))
-                 (if (funcall pred mean) (setq max mean) (setq min mean)))))
-           max))
-        (high
-         (funcall dichotomy
-                  most-negative-fixnum
-                  0
-                  (lambda (m)
-                     ;; libc in macOS 10.6 hangs when decoding times
-                     ;; around year -2**31.  Limit `high' not to go
-                     ;; any earlier than that.
-                     (unless (and (eq system-type 'darwin)
-                                  (string-match-p
-                                   "10\\.6\\.[[:digit:]]"
-                                   (shell-command-to-string
-                                    "sw_vers -productVersion"))
-                                  (<= m -1034058203135))
-                       (ignore-errors (decode-time (list m 0)))))))
-        (low
-         (funcall dichotomy
-                  most-negative-fixnum
-                  0
-                  (lambda (m) (ignore-errors (decode-time (list high m)))))))
-    (list high low))
-  "Internal time for oldest date representable on the system.")
-
 ;;; The clock for measuring work time.
 
 (defvar org-mode-line-string "")
@@ -542,6 +513,15 @@ cannot be translated."
           (assoc-string language org-clock-clocktable-language-setup t))
       s))
 
+(defun org-clock--mode-line-heading ()
+  "Return currently clocked heading, formatted for mode line."
+  (cond ((functionp org-clock-heading-function)
+        (funcall org-clock-heading-function))
+       ((org-before-first-heading-p) "???")
+       (t (replace-regexp-in-string
+           org-bracket-link-analytic-regexp "\\5"
+           (org-no-properties (org-get-heading t t t t))))))
+
 (defun org-clock-menu ()
   (interactive)
   (popup-menu
@@ -690,19 +670,18 @@ If not, show simply the clocked time like 01:50."
     (if org-clock-effort
        (let* ((effort-in-minutes (org-duration-to-minutes org-clock-effort))
               (work-done-str
-               (propertize
-                (org-duration-from-minutes clocked-time)
-                'face (if (and org-clock-task-overrun (not 
org-clock-task-overrun-text))
-                          'org-mode-line-clock-overrun 'org-mode-line-clock)))
-              (effort-str (org-duration-from-minutes effort-in-minutes))
-              (clockstr (propertize
-                         (concat  " [%s/" effort-str
-                                  "] (" (replace-regexp-in-string "%" "%%" 
org-clock-heading) ")")
-                         'face 'org-mode-line-clock)))
-         (format clockstr work-done-str))
-      (propertize (concat " [" (org-duration-from-minutes clocked-time)
-                         "]" (format " (%s)" org-clock-heading))
-                 'face 'org-mode-line-clock))))
+               (propertize (org-duration-from-minutes clocked-time)
+                           'face
+                           (if (and org-clock-task-overrun
+                                    (not org-clock-task-overrun-text))
+                               'org-mode-line-clock-overrun
+                             'org-mode-line-clock)))
+              (effort-str (org-duration-from-minutes effort-in-minutes)))
+         (format (propertize " [%s/%s] (%s)" 'face 'org-mode-line-clock)
+                 work-done-str effort-str org-clock-heading))
+      (format (propertize " [%s] (%s)" 'face 'org-mode-line-clock)
+             (org-duration-from-minutes clocked-time)
+             org-clock-heading))))
 
 (defun org-clock-get-last-clock-out-time ()
   "Get the last clock-out time for the current subtree."
@@ -712,10 +691,13 @@ If not, show simply the clocked time like 01:50."
                                       ".*\\]--\\(\\[[^]]+\\]\\)") end t)
        (org-time-string-to-time (match-string 1))))))
 
-(defun org-clock-update-mode-line ()
+(defun org-clock-update-mode-line (&optional refresh)
+  "Update mode line with clock information.
+When optional argument is non-nil, refresh cached heading."
   (if org-clock-effort
       (org-clock-notify-once-if-expired)
     (setq org-clock-task-overrun nil))
+  (when refresh (setq org-clock-heading (org-clock--mode-line-heading)))
   (setq org-mode-line-string
        (propertize
         (let ((clock-string (org-clock-get-clock-string))
@@ -1232,7 +1214,8 @@ the default behavior."
       (when (equal select '(64))
        ;; Set start-time to `org-clock-out-time'
        (let ((org-clock-continuously t))
-         (org-clock-in nil org-clock-out-time)))
+         (org-clock-in nil org-clock-out-time)
+         (throw 'abort nil)))
 
       (when (equal select '(4))
        (setq selected-task (org-clock-select-task "Clock-in on task: "))
@@ -1298,15 +1281,7 @@ the default behavior."
                                              org-clock-in-switch-to-state
                                              "\\>"))))
                (org-todo org-clock-in-switch-to-state)))
-        (setq org-clock-heading
-              (cond ((and org-clock-heading-function
-                          (functionp org-clock-heading-function))
-                     (funcall org-clock-heading-function))
-                    ((nth 4 (org-heading-components))
-                     (replace-regexp-in-string
-                      "\\[\\[.*?\\]\\[\\(.*?\\)\\]\\]" "\\1"
-                      (match-string-no-properties 4)))
-                    (t "???")))
+        (setq org-clock-heading (org-clock--mode-line-heading))
         (org-clock-find-position org-clock-in-resume)
         (cond
          ((and org-clock-in-resume
@@ -1442,7 +1417,7 @@ in particular CLOCK_MODELINE_TOTAL and the corresponding 
variable
 `org-clock-mode-line-total' and then decides which time to use.
 
 The time is always returned as UTC."
-  (let ((cmt (or (org-entry-get nil "CLOCK_MODELINE_TOTAL")
+  (let ((cmt (or (org-entry-get nil "CLOCK_MODELINE_TOTAL" 'selective)
                 (symbol-name org-clock-mode-line-total)))
        (lr (org-entry-get nil "LAST_REPEAT")))
     (cond
@@ -1451,7 +1426,7 @@ The time is always returned as UTC."
       (current-time))
      ((equal cmt "today")
       (setq org--msg-extra "showing today's task time.")
-      (let* ((dt (org-decode-time nil t))
+      (let* ((dt (decode-time))
             (hour (nth 2 dt))
             (day (nth 3 dt)))
        (if (< hour org-extend-today-until) (setf (nth 3 dt) (1- day)))
@@ -1784,6 +1759,7 @@ With prefix arg SELECT, offer recently clocked tasks for 
selection."
 (defvar-local org-clock-file-total-minutes nil
   "Holds the file total time in minutes, after a call to `org-clock-sum'.")
 
+;;;###autoload
 (defun org-clock-sum-today (&optional headline-filter)
   "Sum the times for each subtree for today."
   (let ((range (org-clock-special-range 'today)))
@@ -1929,37 +1905,36 @@ Use `\\[org-clock-remove-overlays]' to remove the 
subtree times."
         (prop (cond ((not arg) :org-clock-minutes-default)
                     (todayp :org-clock-minutes-today)
                     (customp :org-clock-minutes-custom)
-                    (t :org-clock-minutes)))
-        time h m p)
+                    (t :org-clock-minutes))))
     (cond ((not arg) (org-clock-sum-custom
                      nil org-clock-display-default-range prop))
          (todayp (org-clock-sum-today))
          (customp (org-clock-sum-custom nil arg))
          (t (org-clock-sum)))
-    (unless (eq arg '(64))
+    (unless (equal arg '(64))
       (save-excursion
        (goto-char (point-min))
-       (while (or (and (equal (setq p (point)) (point-min))
-                       (get-text-property p prop))
-                  (setq p (next-single-property-change
-                           (point) prop)))
-         (goto-char p)
-         (when (setq time (get-text-property p prop))
-           (org-clock-put-overlay time)))
-       (setq h (/ org-clock-file-total-minutes 60)
-             m (- org-clock-file-total-minutes (* 60 h)))
+       (let ((p nil))
+         (while (or (and (equal (setq p (point)) (point-min))
+                         (get-text-property p prop))
+                    (setq p (next-single-property-change (point) prop)))
+           (goto-char p)
+           (let ((time (get-text-property p prop)))
+             (when time (org-clock-put-overlay time)))))
        ;; Arrange to remove the overlays upon next change.
        (when org-remove-highlights-with-change
          (add-hook 'before-change-functions 'org-clock-remove-overlays
-                       nil 'local))))
-    (message (concat (format "Total file time%s: "
-                            (cond (todayp " for today")
-                                  (customp " (custom)")
-                                  (t "")))
-                    (org-duration-from-minutes
-                     org-clock-file-total-minutes)
-                    " (%d hours and %d minutes)")
-            h m)))
+                   nil 'local))))
+    (let* ((h (/ org-clock-file-total-minutes 60))
+          (m (- org-clock-file-total-minutes (* 60 h))))
+      (message (concat (format "Total file time%s: "
+                              (cond (todayp " for today")
+                                    (customp " (custom)")
+                                    (t "")))
+                      (org-duration-from-minutes
+                       org-clock-file-total-minutes)
+                      " (%d hours and %d minutes)")
+              h m))))
 
 (defvar-local org-clock-overlays nil)
 
@@ -2051,27 +2026,32 @@ fontified, and then returned."
 
 ;;;###autoload
 (defun org-clock-report (&optional arg)
-  "Create a table containing a report about clocked time.
-If the cursor is inside an existing clocktable block, then the table
-will be updated.  If not, a new clocktable will be inserted.  The scope
-of the new clock will be subtree when called from within a subtree, and
-file elsewhere.
-
-When called with a prefix argument, move to the first clock table in the
-buffer and update it."
+  "Update or create a table containing a report about clocked time.
+
+If point is inside an existing clocktable block, update it.
+Otherwise, insert a new one.
+
+The new table inherits its properties from the variable
+`org-clock-clocktable-default-properties'.  The scope of the
+clocktable, when not specified in the previous variable, is
+`subtree' when the function is called from within a subtree, and
+`file' elsewhere.
+
+When called with a prefix argument, move to the first clock table
+in the buffer and update it."
   (interactive "P")
   (org-clock-remove-overlays)
   (when arg
     (org-find-dblock "clocktable")
     (org-show-entry))
-  (if (org-in-clocktable-p)
-      (goto-char (org-in-clocktable-p))
-    (let ((props (if (ignore-errors
-                      (save-excursion (org-back-to-heading)))
-                    (list :name "clocktable" :scope 'subtree)
-                  (list :name "clocktable"))))
-      (org-create-dblock
-       (org-combine-plists org-clock-clocktable-default-properties props))))
+  (pcase (org-in-clocktable-p)
+    (`nil
+     (org-create-dblock
+      (org-combine-plists
+       (list :scope (if (org-before-first-heading-p) 'file 'subtree))
+       org-clock-clocktable-default-properties
+       '(:name "clocktable"))))
+    (start (goto-char start)))
   (org-update-dblock))
 
 (defun org-day-of-week (day month year)
@@ -2258,7 +2238,9 @@ have priority."
     ;; Format start and end times according to AS-STRINGS.
     (let* ((start (pcase key
                    (`interactive (org-read-date nil t nil "Range start? "))
-                   (`untilnow org-clock--oldest-date)
+                    ;; In theory, all clocks started after the dawn of
+                    ;; humanity.
+                   (`untilnow (encode-time 0 0 0 0 0 -50000))
                    (_ (encode-time 0 m h d month y))))
           (end (pcase key
                  (`interactive (org-read-date nil t nil "Range end? "))
@@ -2692,16 +2674,15 @@ LEVEL is an integer.  Indent by two spaces per level 
above 1."
 
 (defun org-clocktable-steps (params)
   "Step through the range to make a number of clock tables."
-  (let* ((p1 (copy-sequence params))
-        (ts (plist-get p1 :tstart))
-        (te (plist-get p1 :tend))
-        (ws (plist-get p1 :wstart))
-        (ms (plist-get p1 :mstart))
-        (step0 (plist-get p1 :step))
-        (step (cdr (assoc step0 '((day . 86400) (week . 604800)))))
-        (stepskip0 (plist-get p1 :stepskip0))
-        (block (plist-get p1 :block))
-        cc step-time tsb)
+  (let* ((ts (plist-get params :tstart))
+        (te (plist-get params :tend))
+        (ws (plist-get params :wstart))
+        (ms (plist-get params :mstart))
+        (step0 (plist-get params :step))
+        (step (cdr (assq step0 '((day . 86400) (week . 604800)))))
+        (stepskip0 (plist-get params :stepskip0))
+        (block (plist-get params :block))
+        cc tsb)
     (when block
       (setq cc (org-clock-special-range block nil t ws ms)
            ts (car cc)
@@ -2724,37 +2705,37 @@ LEVEL is an integer.  Indent by two spaces per level 
above 1."
     (setq tsb
          (if (eq step0 'week)
              (let ((dow (nth 6 (decode-time (seconds-to-time ts)))))
-               (if (< dow ws) ts
+               (if (<= dow ws) ts
                  (- ts (* 86400 (- dow ws)))))
            ts))
-    (setq p1 (plist-put p1 :header ""))
-    (setq p1 (plist-put p1 :step nil))
-    (setq p1 (plist-put p1 :block nil))
     (while (< tsb te)
-      (or (bolp) (insert "\n"))
-      (setq p1 (plist-put p1 :tstart (format-time-string
-                                     (org-time-stamp-format nil t)
-                                     (seconds-to-time (max tsb ts)))))
-      (cl-incf tsb (let ((dow (nth 6 (decode-time (seconds-to-time tsb)))))
-                    (if (or (eq step0 'day)
-                            (= dow ws))
-                        step
-                      (* 86400 (- ws dow)))))
-      (setq p1 (plist-put p1 :tend (format-time-string
-                                   (org-time-stamp-format nil t)
-                                   (seconds-to-time (min te tsb)))))
-      (insert "\n" (if (eq step0 'day) "Daily report: "
-                    "Weekly report starting on: ")
-             (plist-get p1 :tstart) "\n")
-      (setq step-time (org-dblock-write:clocktable p1))
-      (re-search-forward "^[ \t]*#\\+END:")
-      (when (and (equal step-time 0) stepskip0)
-       ;; Remove the empty table
-       (delete-region (point-at-bol)
-                      (save-excursion
-                        (re-search-backward "^\\(Daily\\|Weekly\\) report"
-                                            nil t)
-                        (point))))
+      (unless (bolp) (insert "\n"))
+      (let ((start-time (seconds-to-time (max tsb ts))))
+       (cl-incf tsb (let ((dow (nth 6 (decode-time (seconds-to-time tsb)))))
+                      (if (or (eq step0 'day)
+                              (= dow ws))
+                          step
+                        (* 86400 (- ws dow)))))
+       (insert "\n"
+               (if (eq step0 'day) "Daily report: "
+                 "Weekly report starting on: ")
+               (format-time-string (org-time-stamp-format nil t) start-time)
+               "\n")
+       (let ((table-begin (line-beginning-position 0))
+             (step-time
+              (org-dblock-write:clocktable
+               (org-combine-plists
+                params
+                (list
+                 :header "" :step nil :block nil
+                 :tstart (format-time-string (org-time-stamp-format t t)
+                                             start-time)
+                 :tend (format-time-string (org-time-stamp-format t t)
+                                           (seconds-to-time (min te tsb))))))))
+         (re-search-forward "^[ \t]*#\\+END:")
+         (when (and stepskip0 (equal step-time 0))
+           ;; Remove the empty table
+           (delete-region (line-beginning-position) table-begin))))
       (end-of-line 0))))
 
 (defun org-clock-get-table-data (file params)
diff --git a/lisp/org/org-colview.el b/lisp/org/org-colview.el
index 0d5a982..cb5c091 100644
--- a/lisp/org/org-colview.el
+++ b/lisp/org/org-colview.el
@@ -4,7 +4,7 @@
 
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 ;;
 ;; This file is part of GNU Emacs.
 ;;
diff --git a/lisp/org/org-compat.el b/lisp/org/org-compat.el
index f32fcd1..1fd408d 100644
--- a/lisp/org/org-compat.el
+++ b/lisp/org/org-compat.el
@@ -4,7 +4,7 @@
 
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 ;;
 ;; This file is part of GNU Emacs.
 ;;
@@ -61,12 +61,6 @@
   (defalias 'format-message 'format)
   (defalias 'gui-get-selection 'x-get-selection))
 
-(defun org-decode-time (&optional time zone)
-  "Backward-compatible function for `decode-time'."
-  (if (< emacs-major-version 25)
-      (decode-time time)
-    (decode-time time zone)))
-
 (unless (fboundp 'directory-name-p)
   (defun directory-name-p (name)
     "Return non-nil if NAME ends with a directory separator character."
@@ -78,37 +72,6 @@
          (and (memq system-type '(windows-nt ms-dos))
               (= lastc ?\\))))))
 
-(unless (fboundp 'directory-files-recursively)
-  (defun directory-files-recursively (dir regexp &optional include-directories)
-    "Return list of all files under DIR that have file names matching REGEXP.
-This function works recursively.  Files are returned in \"depth first\"
-order, and files from each directory are sorted in alphabetical order.
-Each file name appears in the returned list in its absolute form.
-Optional argument INCLUDE-DIRECTORIES non-nil means also include in the
-output directories whose names match REGEXP."
-    (let ((result nil)
-         (files nil)
-         ;; When DIR is "/", remote file names like "/method:" could
-         ;; also be offered.  We shall suppress them.
-         (tramp-mode (and tramp-mode (file-remote-p (expand-file-name dir)))))
-      (dolist (file (sort (file-name-all-completions "" dir)
-                         'string<))
-       (unless (member file '("./" "../"))
-         (if (directory-name-p file)
-             (let* ((leaf (substring file 0 (1- (length file))))
-                    (full-file (expand-file-name leaf dir)))
-               ;; Don't follow symlinks to other directories.
-               (unless (file-symlink-p full-file)
-                 (setq result
-                       (nconc result (directory-files-recursively
-                                      full-file regexp include-directories))))
-               (when (and include-directories
-                          (string-match regexp leaf))
-                 (setq result (nconc result (list full-file)))))
-           (when (string-match regexp file)
-             (push (expand-file-name file dir) files)))))
-      (nconc result (nreverse files)))))
-
 
 ;;; Obsolete aliases (remove them after the next major release).
 
diff --git a/lisp/org/org-datetree.el b/lisp/org/org-datetree.el
index a8162fe..d00bad2 100644
--- a/lisp/org/org-datetree.el
+++ b/lisp/org/org-datetree.el
@@ -4,7 +4,7 @@
 
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 ;;
 ;; This file is part of GNU Emacs.
 ;;
diff --git a/lisp/org/org-docview.el b/lisp/org/org-docview.el
index 57069b3..a467212 100644
--- a/lisp/org/org-docview.el
+++ b/lisp/org/org-docview.el
@@ -4,7 +4,7 @@
 
 ;; Author: Jan Böcker <jan.boecker at jboecker dot de>
 ;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 ;;
 ;; This file is part of GNU Emacs.
 ;;
diff --git a/lisp/org/org-element.el b/lisp/org/org-element.el
index 9e5c400..d9c6522 100644
--- a/lisp/org/org-element.el
+++ b/lisp/org/org-element.el
@@ -22,7 +22,7 @@
 
 ;;; Commentary:
 ;;
-;; See <http://orgmode.org/worg/dev/org-syntax.html> for details about
+;; See <https://orgmode.org/worg/dev/org-syntax.html> for details about
 ;; Org syntax.
 ;;
 ;; Lisp-wise, a syntax object can be represented as a list.
@@ -3065,7 +3065,7 @@ Assume point is at the beginning of the link."
        (setq path (match-string-no-properties 1))
        (setq contents-begin (match-beginning 1))
        (setq contents-end (match-end 1)))
-       ;; Type 2: Standard link, i.e. [[http://orgmode.org][homepage]]
+       ;; Type 2: Standard link, i.e. [[https://orgmode.org][homepage]]
        ((looking-at org-bracket-link-regexp)
        (setq format 'bracket)
        (setq contents-begin (match-beginning 3))
@@ -3114,14 +3114,14 @@ Assume point is at the beginning of the link."
         (t
          (setq type "fuzzy")
          (setq path raw-link))))
-       ;; Type 3: Plain link, e.g., http://orgmode.org
+       ;; Type 3: Plain link, e.g., https://orgmode.org
        ((looking-at org-plain-link-re)
        (setq format 'plain)
        (setq raw-link (match-string-no-properties 0))
        (setq type (match-string-no-properties 1))
        (setq link-end (match-end 0))
        (setq path (match-string-no-properties 2)))
-       ;; Type 4: Angular link, e.g., <http://orgmode.org>.  Unlike to
+       ;; Type 4: Angular link, e.g., <https://orgmode.org>.  Unlike to
        ;; bracket links, follow RFC 3986 and remove any extra
        ;; whitespace in URI.
        ((looking-at org-angle-link-re)
diff --git a/lisp/org/org-entities.el b/lisp/org/org-entities.el
index 65c7d05..e291b52 100644
--- a/lisp/org/org-entities.el
+++ b/lisp/org/org-entities.el
@@ -5,7 +5,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>,
 ;;         Ulf Stegemann <ulf at zeitform dot de>
 ;; Keywords: outlines, calendar, wp
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 ;;
 ;; This file is part of GNU Emacs.
 ;;
diff --git a/lisp/org/org-eww.el b/lisp/org/org-eww.el
index 3d9dddc..1b6112a 100644
--- a/lisp/org/org-eww.el
+++ b/lisp/org/org-eww.el
@@ -4,7 +4,7 @@
 
 ;; Author: Marco Wahl <marcowahlsoft>a<gmailcom>
 ;; Keywords: link, eww
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 
 ;; This file is part of GNU Emacs.
 
diff --git a/lisp/org/org-faces.el b/lisp/org/org-faces.el
index 83871fb..750ada1 100644
--- a/lisp/org/org-faces.el
+++ b/lisp/org/org-faces.el
@@ -4,7 +4,7 @@
 
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 ;;
 ;; This file is part of GNU Emacs.
 ;;
diff --git a/lisp/org/org-feed.el b/lisp/org/org-feed.el
index c3491d5..fde19e6 100644
--- a/lisp/org/org-feed.el
+++ b/lisp/org/org-feed.el
@@ -4,7 +4,7 @@
 ;;
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 ;;
 ;; This file is part of GNU Emacs.
 ;;
@@ -276,14 +276,21 @@ have been saved."
 (defun org-feed-update-all ()
   "Get inbox items from all feeds in `org-feed-alist'."
   (interactive)
-  (let ((nfeeds (length org-feed-alist))
-       (nnew (apply '+  (mapcar 'org-feed-update org-feed-alist))))
-    (message "%s from %d %s"
-            (cond ((= nnew 0) "No new entries")
-                  ((= nnew 1) "1 new entry")
-                  (t (format "%d new entries" nnew)))
-            nfeeds
-            (if (= nfeeds 1) "feed" "feeds"))))
+  (let ((entries 0)
+       (errors 0)
+       (total-feeds (length org-feed-alist)))
+    (dolist (feed org-feed-alist)
+      (let ((items (ignore-errors (org-feed-update feed))))
+       (if items (cl-incf entries items)
+         (cl-incf errors))))
+    (message "%s from %d %s%s"
+            (pcase entries
+              (0 "No new entries")
+              (1 "1 new entry")
+              (_ (format "%d new entries" entries)))
+            total-feeds
+            (if (= total-feeds 1) "feed" "feeds")
+            (if (= 0 errors) "" (format " (unavailable feeds: %d)" errors)))))
 
 ;;;###autoload
 (defun org-feed-update (feed &optional retrieve-only)
diff --git a/lisp/org/org-footnote.el b/lisp/org/org-footnote.el
index 4d3f154..c6376ca 100644
--- a/lisp/org/org-footnote.el
+++ b/lisp/org/org-footnote.el
@@ -4,7 +4,7 @@
 ;;
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 ;;
 ;; This file is part of GNU Emacs.
 ;;
diff --git a/lisp/org/org-gnus.el b/lisp/org/org-gnus.el
index 0f2cdc2..a53b343 100644
--- a/lisp/org/org-gnus.el
+++ b/lisp/org/org-gnus.el
@@ -5,7 +5,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;;         Tassilo Horn <tassilo at member dot fsf dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 ;;
 ;; This file is part of GNU Emacs.
 ;;
@@ -42,6 +42,7 @@
 
 (declare-function gnus-activate-group "gnus-start" (group &optional scan 
dont-check method dont-sub-check))
 (declare-function gnus-find-method-for-group "gnus" (group &optional info))
+(declare-function gnus-article-show-summary "gnus-art" ())
 (declare-function gnus-group-group-name "gnus-group")
 (declare-function gnus-group-jump-to-group "gnus-group" (group &optional 
prompt))
 (declare-function gnus-group-read-group "gnus-group" (&optional all no-article 
group select-articles))
@@ -142,7 +143,14 @@ If `org-store-link' was called with a prefix arg the 
meaning of
                (save-excursion
                  (nnir-article-group (gnus-summary-article-number))))
               (_ gnus-newsgroup-name)))
-           (header (with-current-buffer gnus-summary-buffer
+           (header (if (eq major-mode 'gnus-article-mode)
+                       ;; When in an article, first move to summary
+                       ;; buffer, with point on the summary of the
+                       ;; current article before extracting headers.
+                       (save-window-excursion
+                         (save-excursion
+                           (gnus-article-show-summary)
+                           (gnus-summary-article-header)))
                      (gnus-summary-article-header)))
            (from (mail-header-from header))
            (message-id (org-unbracket-string "<" ">" (mail-header-id header)))
diff --git a/lisp/org/org-habit.el b/lisp/org/org-habit.el
index 09f1312..375714e 100644
--- a/lisp/org/org-habit.el
+++ b/lisp/org/org-habit.el
@@ -4,7 +4,7 @@
 
 ;; Author: John Wiegley <johnw at gnu dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 ;;
 ;; This file is part of GNU Emacs.
 ;;
diff --git a/lisp/org/org-id.el b/lisp/org/org-id.el
index a230947..26b203f 100644
--- a/lisp/org/org-id.el
+++ b/lisp/org/org-id.el
@@ -4,7 +4,7 @@
 ;;
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 ;;
 ;; This file is part of GNU Emacs.
 ;;
diff --git a/lisp/org/org-indent.el b/lisp/org/org-indent.el
index ef68c3c..84bac2a 100644
--- a/lisp/org/org-indent.el
+++ b/lisp/org/org-indent.el
@@ -4,7 +4,7 @@
 ;;
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 ;;
 ;; This file is part of GNU Emacs.
 ;;
diff --git a/lisp/org/org-info.el b/lisp/org/org-info.el
index db5d66c..6dde36c 100644
--- a/lisp/org/org-info.el
+++ b/lisp/org/org-info.el
@@ -4,7 +4,7 @@
 
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 ;;
 ;; This file is part of GNU Emacs.
 ;;
diff --git a/lisp/org/org-inlinetask.el b/lisp/org/org-inlinetask.el
index 1825b88..08fc268 100644
--- a/lisp/org/org-inlinetask.el
+++ b/lisp/org/org-inlinetask.el
@@ -4,7 +4,7 @@
 ;;
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 
 ;; This file is part of GNU Emacs.
 
diff --git a/lisp/org/org-list.el b/lisp/org/org-list.el
index ad0030f..1f51809 100644
--- a/lisp/org/org-list.el
+++ b/lisp/org/org-list.el
@@ -5,7 +5,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;;        Bastien Guerry <address@hidden>
 ;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 ;;
 ;; This file is part of GNU Emacs.
 ;;
@@ -121,6 +121,7 @@
 (declare-function org-element-set-element "org-element" (old new))
 (declare-function org-element-type "org-element" (element))
 (declare-function org-element-update-syntax "org-element" ())
+(declare-function org-end-of-meta-data "org" (&optional full))
 (declare-function org-entry-get "org"
                  (pom property &optional inherit literal-nil))
 (declare-function org-export-create-backend "ox" (&rest rest) t)
@@ -2356,27 +2357,23 @@ is an integer, 0 means `-', 1 means `+' etc.  If WHICH 
is
 
 (defun org-toggle-checkbox (&optional toggle-presence)
   "Toggle the checkbox in the current line.
-With prefix arg TOGGLE-PRESENCE, add or remove checkboxes.  With
-double prefix, set checkbox to [-].
+
+With prefix argument TOGGLE-PRESENCE, add or remove checkboxes.
+With a double prefix argument, set the checkbox to \"[-]\".
 
 When there is an active region, toggle status or presence of the
 first checkbox there, and make every item inside have the same
 status or presence, respectively.
 
-If the cursor is in a headline, apply this to all checkbox items
-in the text below the heading, taking as reference the first item
-in subtree, ignoring drawers."
+If point is on a headline, apply this to all checkbox items in
+the text below the heading, taking as reference the first item in
+subtree, ignoring planning line and any drawer following it."
   (interactive "P")
   (save-excursion
     (let* (singlep
           block-item
           lim-up
           lim-down
-          (keyword-re (concat "^[ \t]*\\<\\(" org-scheduled-string
-                              "\\|" org-deadline-string
-                              "\\|" org-closed-string
-                              "\\|" org-clock-string "\\)"
-                              " *[[<]\\([^]>]+\\)[]>]"))
           (orderedp (org-entry-get nil "ORDERED"))
           (_bounds
            ;; In a region, start at first item in region.
@@ -2389,15 +2386,10 @@ in subtree, ignoring drawers."
                  (error "No item in region"))
                (setq lim-down (copy-marker limit))))
             ((org-at-heading-p)
-             ;; On an heading, start at first item after drawers and
+             ;; On a heading, start at first item after drawers and
              ;; time-stamps (scheduled, etc.).
              (let ((limit (save-excursion (outline-next-heading) (point))))
-               (forward-line 1)
-               (while (or (looking-at org-drawer-regexp)
-                          (looking-at keyword-re))
-                 (if (looking-at keyword-re)
-                     (forward-line 1)
-                   (re-search-forward "^[ \t]*:END:" limit nil)))
+               (org-end-of-meta-data t)
                (if (org-list-search-forward (org-item-beginning-re) limit t)
                    (setq lim-up (point-at-bol))
                  (error "No item in subtree"))
@@ -2656,8 +2648,8 @@ Return t if successful."
                 (= top (point-at-bol))
                 (cdr (assq 'indent org-list-automatic-rules))
                 (if no-subtree
-                    (error
-                     "First item of list cannot move without its subtree")
+                    (user-error
+                     "At first item: use S-M-<left/right> to move the whole 
list")
                   t))))
       ;; Determine begin and end points of zone to indent.  If moving
       ;; more than one item, save them for subsequent moves.
diff --git a/lisp/org/org-macro.el b/lisp/org/org-macro.el
index 0fb0b8a..1033db2 100644
--- a/lisp/org/org-macro.el
+++ b/lisp/org/org-macro.el
@@ -130,7 +130,7 @@ Templates are stored in buffer-local variable
 function installs the following ones: \"property\",
 \"time\". and, if the buffer is associated to a file,
 \"input-file\" and \"modification-time\"."
-  (let* ((templates (org-macro--collect-macros))
+  (let* ((templates nil)
         (update-templates
          (lambda (cell)
            (let ((old-template (assoc (car cell) templates)))
@@ -164,7 +164,7 @@ function installs the following ones: \"property\",
     (org-macro--counter-initialize)
     (funcall update-templates
             (cons "n" "(eval (org-macro--counter-increment \"$1\" \"$2\"))"))
-    (setq org-macro-templates templates)))
+    (setq org-macro-templates (nconc (org-macro--collect-macros) templates))))
 
 (defun org-macro-expand (macro templates)
   "Return expanded MACRO, as a string.
diff --git a/lisp/org/org-macs.el b/lisp/org/org-macs.el
index 79d09e3..510ece1 100644
--- a/lisp/org/org-macs.el
+++ b/lisp/org/org-macs.el
@@ -4,7 +4,7 @@
 
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 ;;
 ;; This file is part of GNU Emacs.
 ;;
diff --git a/lisp/org/org-mhe.el b/lisp/org/org-mhe.el
index 32a6ff1..e74a9ee 100644
--- a/lisp/org/org-mhe.el
+++ b/lisp/org/org-mhe.el
@@ -4,7 +4,7 @@
 
 ;; Author: Thomas Baumann <thomas dot baumann at ch dot tum dot de>
 ;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 ;;
 ;; This file is part of GNU Emacs.
 ;;
diff --git a/lisp/org/org-mobile.el b/lisp/org/org-mobile.el
index 7191475..cbf169f 100644
--- a/lisp/org/org-mobile.el
+++ b/lisp/org/org-mobile.el
@@ -3,7 +3,7 @@
 ;;
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 ;;
 ;; This file is part of GNU Emacs.
 ;;
diff --git a/lisp/org/org-mouse.el b/lisp/org/org-mouse.el
index ba38c05..5a10b59 100644
--- a/lisp/org/org-mouse.el
+++ b/lisp/org/org-mouse.el
@@ -24,7 +24,7 @@
 ;;
 ;; Org-mouse provides mouse support for org-mode.
 ;;
-;; http://orgmode.org
+;; https://orgmode.org
 ;;
 ;; Org mouse implements the following features:
 ;; * following links with the left mouse button
diff --git a/lisp/org/org-pcomplete.el b/lisp/org/org-pcomplete.el
index a7cc09d..88a2e10 100644
--- a/lisp/org/org-pcomplete.el
+++ b/lisp/org/org-pcomplete.el
@@ -5,7 +5,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;;         John Wiegley <johnw at gnu dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 ;;
 ;; This file is part of GNU Emacs.
 ;;
diff --git a/lisp/org/org-plot.el b/lisp/org/org-plot.el
index 6c74f3e..ebd7af4 100644
--- a/lisp/org/org-plot.el
+++ b/lisp/org/org-plot.el
@@ -4,7 +4,7 @@
 ;;
 ;; Author: Eric Schulte <schulte dot eric at gmail dot com>
 ;; Keywords: tables, plotting
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 ;;
 ;; This file is part of GNU Emacs.
 ;;
diff --git a/lisp/org/org-protocol.el b/lisp/org/org-protocol.el
index 27c2bb2..33957ee 100644
--- a/lisp/org/org-protocol.el
+++ b/lisp/org/org-protocol.el
@@ -184,10 +184,10 @@ Possible properties are:
 Example:
 
    (setq org-protocol-project-alist
-       \\='((\"http://orgmode.org/worg/\";
+       \\='((\"https://orgmode.org/worg/\";
           :online-suffix \".php\"
           :working-suffix \".org\"
-          :base-url \"http://orgmode.org/worg/\";
+          :base-url \"https://orgmode.org/worg/\";
           :working-directory \"/home/user/org/Worg/\")
          (\"http://localhost/org-notes/\";
           :online-suffix \".html\"
@@ -688,7 +688,7 @@ the cdr of an element in `org-publish-project-alist', reuse
   (let ((working-dir (expand-file-name
                      (or (plist-get project-plist :base-directory)
                          default-directory)))
-        (base-url "http://orgmode.org/worg/";)
+        (base-url "https://orgmode.org/worg/";)
         (strip-suffix (or (plist-get project-plist :html-extension) ".html"))
         (working-suffix (if (plist-get project-plist :base-extension)
                             (concat "." (plist-get project-plist 
:base-extension))
diff --git a/lisp/org/org-rmail.el b/lisp/org/org-rmail.el
index be433f6..d50fd64 100644
--- a/lisp/org/org-rmail.el
+++ b/lisp/org/org-rmail.el
@@ -4,7 +4,7 @@
 
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 ;;
 ;; This file is part of GNU Emacs.
 ;;
diff --git a/lisp/org/org-src.el b/lisp/org/org-src.el
index 7c28acf..829354c 100644
--- a/lisp/org/org-src.el
+++ b/lisp/org/org-src.el
@@ -6,7 +6,7 @@
 ;;        Bastien Guerry <address@hidden>
 ;;         Dan Davison <davison at stats dot ox dot ac dot uk>
 ;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 ;;
 ;; This file is part of GNU Emacs.
 ;;
diff --git a/lisp/org/org-table.el b/lisp/org/org-table.el
index 4bb5c91..dcf7430 100644
--- a/lisp/org/org-table.el
+++ b/lisp/org/org-table.el
@@ -4,7 +4,7 @@
 
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 ;;
 ;; This file is part of GNU Emacs.
 ;;
@@ -135,7 +135,7 @@ the fixed string \"#+ORGTBL: SEND\", followed by 
instruction on how to
 convert the table into a data structure useful in the
 language of the buffer.  Check the manual for the section on
 \"Translator functions\", and more generally check out
-http://orgmode.org/manual/Tables-in-arbitrary-syntax.html#Tables-in-arbitrary-syntax
+the Info node `(org)Tables in arbitrary syntax'.
 
 All occurrences of %n in a template will be replaced with the name of the
 table, obtained by prompting the user."
@@ -387,16 +387,19 @@ portability of tables."
          (const :tag "Error on attempt to cross" error)))
 
 (defcustom org-table-formula-create-columns nil
-  "Non-nil means that evaluation of a field formula can add new
-columns if an out-of-bounds field is being set."
+  "Non-nil means evaluation of formula can add new columns.
+When non-nil, evaluating an out-of-bounds field can insert as
+many columns as needed.  When set to `warn', issue a warning when
+doing so.  When set to `prompt', ask user before creating a new
+column.  Otherwise, throw an error."
   :group 'org-table-calculation
   :version "26.1"
   :package-version '(Org . "8.3")
   :type '(choice
-         (const :tag "Setting an out-of-bounds field generates an error 
(default)" nil)
-         (const :tag "Setting an out-of-bounds field silently adds columns as 
needed" t)
-         (const :tag "Setting an out-of-bounds field adds columns as needed, 
but issues a warning message" warn)
-         (const :tag "When setting an out-of-bounds field, the user is 
prompted" prompt)))
+         (const :tag "Out-of-bounds field generates an error (default)" nil)
+         (const :tag "Out-of-bounds field silently adds columns as needed" t)
+         (const :tag "Out-of-bounds field adds columns, but issues a warning" 
warn)
+         (const :tag "Prompt user when setting an out-of-bounds field" 
prompt)))
 
 (defgroup org-table-import-export nil
   "Options concerning table import and export in Org mode."
@@ -3327,7 +3330,9 @@ existing formula for column %s"
                                  t))
                           (and (eq org-table-formula-create-columns 'prompt)
                                (yes-or-no-p
-                                "Out-of-bounds formula.  Add columns? ")))))))
+                                "Out-of-bounds formula.  Add columns? "))
+                          (user-error
+                           "Missing columns in the table.  Aborting"))))))
             (org-table-eval-formula nil formula t t t t))))
        ;; Clean up markers and internal text property.
        (remove-text-properties (point-min) (point-max) '(org-untouchable t))
diff --git a/lisp/org/org-timer.el b/lisp/org/org-timer.el
index 65e777b..d840944 100644
--- a/lisp/org/org-timer.el
+++ b/lisp/org/org-timer.el
@@ -4,7 +4,7 @@
 
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 ;;
 ;; This file is part of GNU Emacs.
 ;;
diff --git a/lisp/org/org-version.el b/lisp/org/org-version.el
index 8ec120e..132ad2b 100644
--- a/lisp/org/org-version.el
+++ b/lisp/org/org-version.el
@@ -5,13 +5,13 @@
 (defun org-release ()
   "The release version of Org.
 Inserted by installing Org mode or when a release is made."
-   (let ((org-release "9.1.6"))
+   (let ((org-release "9.1.9"))
      org-release))
 ;;;###autoload
 (defun org-git-version ()
   "The Git version of Org mode.
 Inserted by installing Org or when a release is made."
-   (let ((org-git-version "release_9.1.6-50-g96b33f"))
+   (let ((org-git-version "release_9.1.9-65-g5e4542"))
      org-git-version))
 
 (provide 'org-version)
diff --git a/lisp/org/org-w3m.el b/lisp/org/org-w3m.el
index 706619c..9690c8e 100644
--- a/lisp/org/org-w3m.el
+++ b/lisp/org/org-w3m.el
@@ -4,7 +4,7 @@
 
 ;; Author: Andy Stewart <lazycat dot manatee at gmail dot com>
 ;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 ;;
 ;; This file is part of GNU Emacs.
 ;;
diff --git a/lisp/org/org.el b/lisp/org/org.el
index a53553b..1373861 100644
--- a/lisp/org/org.el
+++ b/lisp/org/org.el
@@ -6,8 +6,8 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Maintainer: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
-;; Version: 9.1.6
+;; Homepage: https://orgmode.org
+;; Version: 9.1.9
 ;;
 ;; This file is part of GNU Emacs.
 ;;
@@ -49,7 +49,7 @@
 ;; ---------------------------
 ;; See the corresponding sections in the manual at
 ;;
-;;   http://orgmode.org/org.html#Installation
+;;   https://orgmode.org/org.html#Installation
 ;;
 ;; Documentation
 ;; -------------
@@ -60,7 +60,7 @@
 ;; in the doc/ directory.
 ;;
 ;; A list of recent changes can be found at
-;; http://orgmode.org/Changes.html
+;; https://orgmode.org/Changes.html
 ;;
 ;;; Code:
 
@@ -1866,7 +1866,7 @@ See the manual for examples."
 
 (defcustom org-descriptive-links t
   "Non-nil means Org will display descriptive links.
-E.g. [[http://orgmode.org][Org website]] will be displayed as
+E.g. [[https://orgmode.org][Org website]] will be displayed as
 \"Org Website\", hiding the link itself and just displaying its
 description.  When set to nil, Org will display the full links
 literally.
@@ -3758,7 +3758,7 @@ This variable is populated from #+PROPERTY lines.")
   :group 'org)
 
 (defvar-local org-category nil
-  "Variable used by org files to set a category for agenda display.
+  "Variable used by Org files to set a category for agenda display.
 Such files should use a file variable to set it, for example
 
 #   -*- mode: org; org-category: \"ELisp\"
@@ -4040,7 +4040,7 @@ Place-holders only used by `:image-converter':
 (defcustom org-preview-latex-image-directory "ltximg/"
   "Path to store latex preview images.
 A relative path here creates many directories relative to the
-processed org files paths.  An absolute path puts all preview
+processed Org files paths.  An absolute path puts all preview
 images at the same place."
   :group 'org-latex
   :version "26.1"
@@ -4238,9 +4238,9 @@ lines to the buffer:
   :type 'boolean)
 
 (defcustom org-hidden-keywords nil
-  "List of symbols corresponding to keywords to be hidden the org buffer.
-For example, a value \\='(title) for this list will make the document's title
-appear in the buffer without the initial #+TITLE: keyword."
+  "List of symbols corresponding to keywords to be hidden in the Org buffer.
+For example, a value \\='(title) for this list makes the document's title
+appear in the buffer without the initial \"#+TITLE:\" part."
   :group 'org-appearance
   :version "24.1"
   :type '(set (const :tag "#+AUTHOR" author)
@@ -4903,6 +4903,18 @@ Support for group tags is controlled by the option
   (message "Groups tags support has been turned %s"
           (if org-group-tags "on" "off")))
 
+(defun org-tag-add-to-alist (alist1 alist2)
+  "Append ALIST1 elements to ALIST2 if they are not there yet."
+  (cond
+   ((null alist2) alist1)
+   ((null alist1) alist2)
+   (t (let ((alist2-cars (mapcar (lambda (x) (car-safe x)) alist2))
+           to-add)
+       (dolist (i alist1)
+         (unless (member (car-safe i) alist2-cars)
+           (push i to-add)))
+       (append to-add alist2)))))
+
 (defun org-set-regexps-and-options (&optional tags-only)
   "Precompute regular expressions used in the current buffer.
 When optional argument TAGS-ONLY is non-nil, only compute tags
@@ -4931,10 +4943,11 @@ related expressions."
                  (mapcar #'org-add-prop-inherited
                          (cdr (assq 'filetags alist))))
       (setq org-current-tag-alist
-           (append org-tag-persistent-alist
-                   (let ((tags (cdr (assq 'tags alist))))
-                     (if tags (org-tag-string-to-alist tags)
-                       org-tag-alist))))
+           (org-tag-add-to-alist
+            org-tag-persistent-alist
+            (let ((tags (cdr (assq 'tags alist))))
+              (if tags (org-tag-string-to-alist tags)
+                org-tag-alist))))
       (setq org-tag-groups-alist
            (org-tag-alist-to-groups org-current-tag-alist))
       (unless tags-only
@@ -5249,7 +5262,7 @@ a string, summarizing TAGS, as a list of strings."
        (`(,(or :endgroup :endgrouptag))
         (when (eq group-status 'append)
           (push (nreverse current-group) groups))
-        (setq group-status nil))
+        (setq group-status nil current-group nil))
        (`(:grouptags) (setq group-status 'append))
        ((and `(,tag . ,_) (guard group-status))
         (if (eq group-status 'append) (push tag current-group)
@@ -6052,17 +6065,21 @@ by a #."
 
 (defun org-fontify-macros (limit)
   "Fontify macros."
-  (when (re-search-forward "\\({{{\\).+?\\(}}}\\)" limit t)
-    (add-text-properties
-     (match-beginning 0) (match-end 0)
-     '(font-lock-fontified t face org-macro))
-    (when org-hide-macro-markers
-      (add-text-properties (match-end 2) (match-beginning 2)
-                          '(invisible t))
-      (add-text-properties (match-beginning 1) (match-end 1)
-                          '(invisible t)))
-    (org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0))
-    t))
+  (when (re-search-forward "{{{\\([a-zA-Z][-a-zA-Z0-9_]*\\)" limit t)
+    (let ((begin (match-beginning 0))
+         (opening-end (match-beginning 1)))
+      (when (and (re-search-forward "\n[ \t]*\n\\|\\(}}}\\)" limit t)
+                (match-string 1))
+       (let ((end (match-end 1))
+             (closing-start (match-beginning 1)))
+         (add-text-properties
+          begin end
+          '(font-lock-multiline t font-lock-fontified t face org-macro))
+         (org-remove-flyspell-overlays-in begin end)
+         (when org-hide-macro-markers
+           (add-text-properties begin opening-end '(invisible t))
+           (add-text-properties closing-start end '(invisible t)))
+         t)))))
 
 (defun org-activate-footnote-links (limit)
   "Add text properties for footnotes."
@@ -8459,7 +8476,7 @@ This is a short-hand for marking the subtree and then 
cutting it."
   (org-copy-subtree n 'cut))
 
 (defun org-copy-subtree (&optional n cut force-store-markers nosubtrees)
-  "Copy the current subtree it in the clipboard.
+  "Copy the current subtree into the clipboard.
 With prefix arg N, copy this many sequential subtrees.
 This is a short-hand for marking the subtree and then copying it.
 If CUT is non-nil, actually cut the subtree.
@@ -8532,7 +8549,6 @@ When REMOVE is non-nil, remove the subtree from the 
clipboard."
   (org-with-limited-levels
    (let* ((visp (not (org-invisible-p)))
          (txt tree)
-         (^re_ "\\(\\*+\\)[  \t]*")
          (old-level (if (string-match org-outline-regexp-bol txt)
                         (- (match-end 0) (match-beginning 0) 1)
                       -1))
@@ -8549,7 +8565,7 @@ When REMOVE is non-nil, remove the subtree from the 
clipboard."
                            (condition-case nil
                                (progn
                                  (outline-previous-visible-heading 1)
-                                 (if (looking-at ^re_)
+                                 (if (looking-at org-outline-regexp-bol)
                                      (- (match-end 0) (match-beginning 0) 1)
                                    1))
                              (error 1))))
@@ -8558,7 +8574,7 @@ When REMOVE is non-nil, remove the subtree from the 
clipboard."
                            (progn
                              (or (looking-at org-outline-regexp)
                                  (outline-next-visible-heading 1))
-                             (if (looking-at ^re_)
+                             (if (looking-at org-outline-regexp-bol)
                                  (- (match-end 0) (match-beginning 0) 1)
                                1))
                          (error 1))))
@@ -9680,7 +9696,8 @@ active region."
                         (cdr (assoc-string
                               (completing-read
                                "Which function for creating the link? "
-                               (mapcar #'car results-alist) nil t name)
+                               (mapcar #'car results-alist)
+                               nil t (symbol-name name))
                               results-alist)))
                  t))))
        (setq link (plist-get org-store-link-plist :link))
@@ -14124,7 +14141,7 @@ headlines matching this string."
                      'org-todo-regexp org-todo-regexp
                      'org-complex-heading-regexp org-complex-heading-regexp
                      'help-echo
-                     (format "mouse-2 or RET jump to org file %s"
+                     (format "mouse-2 or RET jump to Org file %S"
                              (abbreviate-file-name
                               (or (buffer-file-name (buffer-base-buffer))
                                   (buffer-name (buffer-base-buffer)))))))
@@ -14320,10 +14337,12 @@ instead of the agenda files."
                  (mapcar
                   (lambda (file)
                     (set-buffer (find-file-noselect file))
-                    (mapcar (lambda (x)
-                              (and (stringp (car-safe x))
-                                   (list (car-safe x))))
-                            (or org-current-tag-alist (org-get-buffer-tags))))
+                    (org-tag-add-to-alist
+                     (org-get-buffer-tags)
+                     (mapcar (lambda (x)
+                               (and (stringp (car-safe x))
+                                    (list (car-safe x))))
+                             org-current-tag-alist)))
                   (if (car-safe files) files
                     (org-agenda-files))))))))
 
@@ -14350,9 +14369,9 @@ See also `org-scan-tags'."
     ;; Get a new match request, with completion against the global
     ;; tags table and the local tags in current buffer.
     (let ((org-last-tags-completion-table
-          (org-uniquify
-           (delq nil (append (org-get-buffer-tags)
-                             (org-global-tags-completion-table))))))
+          (org-tag-add-to-alist
+           (org-get-buffer-tags)
+           (org-global-tags-completion-table))))
       (setq match
            (completing-read
             "Match: "
@@ -14534,7 +14553,7 @@ When DOWNCASE is non-nil, expand downcased TAGS."
                 (tag (match-string 2 return-match))
                 (tag (if downcased (downcase tag) tag)))
            (unless (or (get-text-property 0 'grouptag (match-string 2 
return-match))
-                       (member tag work-already-expanded))
+                       (member tag tags-already-expanded))
              (setq tags-in-group (assoc tag taggroups))
              (push tag work-already-expanded)
              ;; Recursively expand each tag in the group, if the tag hasn't
@@ -14802,36 +14821,28 @@ Assume point is on a headline."
       (org-set-tags arg just-align))))
 
 (defun org-set-tags-to (data)
-  "Set the tags of the current entry to DATA, replacing the current tags.
-DATA may be a tags string like :aa:bb:cc:, or a list of tags.
-If DATA is nil or the empty string, any tags will be removed."
+  "Set the tags of the current entry to DATA, replacing current tags.
+DATA may be a tags string like \":aa:bb:cc:\", or a list of tags.
+If DATA is nil or the empty string, all tags are removed."
   (interactive "sTags: ")
-  (setq data
-       (cond
-        ((eq data nil) "")
-        ((equal data "") "")
-        ((stringp data)
-         (concat ":" (mapconcat 'identity (org-split-string data ":+") ":")
-                 ":"))
-        ((listp data)
-         (concat ":" (mapconcat 'identity data ":") ":"))))
-  (when data
-    (save-excursion
-      (org-back-to-heading t)
-      (when (let ((case-fold-search nil))
-             (looking-at org-complex-heading-regexp))
-       (if (match-end 5)
-           (progn
-             (goto-char (match-beginning 5))
-             (insert data)
-             (delete-region (point) (point-at-eol))
-             (org-set-tags nil 'align))
-         (goto-char (point-at-eol))
-         (insert " " data)
-         (org-set-tags nil 'align)))
-      (beginning-of-line 1)
-      (when (looking-at ".*?\\([ \t]+\\)$")
-       (delete-region (match-beginning 1) (match-end 1))))))
+  (let ((data
+        (pcase (if (stringp data) (org-trim data) data)
+          ((or `nil "") nil)
+          ((pred listp) (format ":%s:" (mapconcat #'identity data ":")))
+          ((pred stringp)
+           (format ":%s:"
+                   (mapconcat #'identity (org-split-string data ":+") ":")))
+          (_ (error "Invalid tag specification: %S" data)))))
+    (org-with-wide-buffer
+     (org-back-to-heading t)
+     (let ((case-fold-search nil)) (looking-at org-complex-heading-regexp))
+     (when (or (match-end 5) data)
+       (goto-char (or (match-beginning 5) (line-end-position)))
+       (skip-chars-backward " \t")
+       (delete-region (point) (line-end-position))
+       (when data
+        (insert " " data)
+        (org-set-tags nil 'align))))))
 
 (defun org-align-all-tags ()
   "Align the tags in all headings."
@@ -14874,27 +14885,16 @@ When JUST-ALIGN is non-nil, only align tags."
                (if just-align current
                  ;; Get a new set of tags from the user.
                  (save-excursion
-                   (let* ((seen)
-                          (table
+                   (let* ((table
                            (setq
                             org-last-tags-completion-table
-                            ;; Uniquify tags in alists, yet preserve
-                            ;; structure (i.e., keywords).
-                            (delq nil
-                                  (mapcar
-                                   (lambda (pair)
-                                     (let ((head (car pair)))
-                                       (cond ((symbolp head) pair)
-                                             ((member head seen) nil)
-                                             (t (push head seen)
-                                                pair))))
-                                   (append
-                                    (or org-current-tag-alist
-                                        (org-get-buffer-tags))
-                                    (and
-                                     
org-complete-tags-always-offer-all-agenda-tags
-                                     (org-global-tags-completion-table
-                                      (org-agenda-files))))))))
+                            (org-tag-add-to-alist
+                             (and
+                              org-complete-tags-always-offer-all-agenda-tags
+                              (org-global-tags-completion-table
+                               (org-agenda-files)))
+                             (or org-current-tag-alist
+                                 (org-get-buffer-tags)))))
                           (current-tags (org-split-string current ":"))
                           (inherited-tags
                            (nreverse (nthcdr (length current-tags)
@@ -14973,9 +14973,9 @@ This works in the agenda, and also in an Org buffer."
    (list (region-beginning) (region-end)
         (let ((org-last-tags-completion-table
                (if (derived-mode-p 'org-mode)
-                   (org-uniquify
-                    (delq nil (append (org-get-buffer-tags)
-                                      (org-global-tags-completion-table))))
+                   (org-tag-add-to-alist
+                    (org-get-buffer-tags)
+                    (org-global-tags-completion-table))
                  (org-global-tags-completion-table))))
           (completing-read
            "Tag: " 'org-tags-completion-function nil nil nil
@@ -16510,7 +16510,7 @@ a priority cookie and tags in the standard locations."
           (move-marker (make-marker) (match-beginning 0))))))))
 
 (defun org-find-exact-heading-in-directory (heading &optional dir)
-  "Find Org node headline HEADING in all .org files in directory DIR.
+  "Find Org node headline HEADING in all \".org\" files in directory DIR.
 When the target headline is found, return a marker to this location."
   (let ((files (directory-files (or dir default-directory)
                                t "\\`[^.#].*\\.org\\'"))
@@ -16633,10 +16633,18 @@ non-nil."
 
 (defun org-time-stamp-inactive (&optional arg)
   "Insert an inactive time stamp.
+
 An inactive time stamp is enclosed in square brackets instead of angle
 brackets.  It is inactive in the sense that it does not trigger agenda entries,
 does not link to the calendar and cannot be changed with the S-cursor keys.
-So these are more for recording a certain time/date."
+So these are more for recording a certain time/date.
+
+If the user specifies a time like HH:MM or if this command is called with
+at least one prefix argument, the time stamp contains the date and the time.
+Otherwise, only the date is included.
+
+When called with two universal prefix arguments, insert an active time stamp
+with the current time without prompting the user."
   (interactive "P")
   (org-time-stamp arg 'inactive))
 
@@ -18230,7 +18238,7 @@ Prompt for confirmation when there are unsaved changes.
 Be sure you know what you are doing before letting this function
 overwrite your changes.
 
-This function is useful in a setup where one tracks org files
+This function is useful in a setup where one tracks Org files
 with a version control system, to revert on one machine after pulling
 changes from another.  I believe the procedure must be like this:
 
@@ -18552,9 +18560,9 @@ When a buffer is unmodified, it is just killed.  When 
modified, it is saved
            (setq org-todo-keyword-alist-for-agenda
                  (append org-todo-keyword-alist-for-agenda org-todo-key-alist))
            (setq org-tag-alist-for-agenda
-                 (org-uniquify
-                  (append org-tag-alist-for-agenda
-                          org-current-tag-alist)))
+                 (org-tag-add-to-alist
+                  org-tag-alist-for-agenda
+                  org-current-tag-alist))
            ;; Merge current file's tag groups into global
            ;; `org-tag-groups-alist-for-agenda'.
            (when org-group-tags
@@ -20988,9 +20996,12 @@ Use `\\[org-edit-special]' to edit table.el tables"))
   "Abort storing current note, or call `outline-show-branches'."
   (interactive)
   (if (not org-finish-function)
-      (progn
-       (outline-hide-subtree)
-       (call-interactively 'outline-show-branches))
+      (save-excursion
+       (save-restriction
+         (org-narrow-to-subtree)
+         (org-flag-subtree t)
+         (call-interactively 'outline-show-branches)
+         (org-hide-archived-subtrees (point-min) (point-max))))
     (let ((org-note-abort t))
       (funcall org-finish-function))))
 
@@ -21104,7 +21115,13 @@ object (e.g., within a comment).  In these case, you 
need to use
             (delete-and-extract-region (point) (line-end-position))))
        (newline-and-indent)
        (save-excursion (insert trailing-data))))
-     (t (if indent (newline-and-indent) (newline))))))
+     (t
+      ;; Do not auto-fill when point is in an Org property drawer.
+      (let ((auto-fill-function (and (not (org-at-property-p))
+                                    auto-fill-function)))
+       (if indent
+           (newline-and-indent)
+         (newline)))))))
 
 (defun org-return-indent ()
   "Goto next table row or insert a newline and indent.
@@ -21573,7 +21590,7 @@ such private information before sending the email.")
      "Remember to cover the basics, that is, what you expected to happen and
 what in fact did happen.  You don't know how to make a good report?  See
 
-     http://orgmode.org/manual/Feedback.html#Feedback
+     https://orgmode.org/manual/Feedback.html#Feedback
 
 Your bug report will be posted to the Org mailing list.
 ------------------------------------------------------------------------")
@@ -21613,7 +21630,7 @@ Your bug report will be posted to the Org mailing list.
 
 ;;;###autoload
 (defun org-reload (&optional uncompiled)
-  "Reload all org lisp files.
+  "Reload all Org Lisp files.
 With prefix arg UNCOMPILED, load the uncompiled versions."
   (interactive "P")
   (require 'loadhist)
diff --git a/lisp/org/ox-html.el b/lisp/org/ox-html.el
index 83f6479..39f7d83 100644
--- a/lisp/org/ox-html.el
+++ b/lisp/org/ox-html.el
@@ -465,7 +465,7 @@ customize `org-html-head-include-default-style'.")
 ;;;; Handle infojs
 
 (defvar org-html-infojs-opts-table
-  '((path PATH "http://orgmode.org/org-info.js";)
+  '((path PATH "https://orgmode.org/org-info.js";)
     (view VIEW "info")
     (toc TOC :with-toc)
     (ftoc FIXED_TOC "0")
@@ -1324,7 +1324,7 @@ like that: \"%%\"."
   :type 'string)
 
 (defcustom org-html-creator-string
-  (format "<a href=\"https://www.gnu.org/software/emacs/\";>Emacs</a> %s (<a 
href=\"http://orgmode.org\";>Org</a> mode %s)"
+  (format "<a href=\"https://www.gnu.org/software/emacs/\";>Emacs</a> %s (<a 
href=\"https://orgmode.org\";>Org</a> mode %s)"
          emacs-version
          (if (fboundp 'org-version) (org-version) "unknown version"))
   "Information about the creator of the HTML document.
@@ -1452,13 +1452,13 @@ done, timestamp, timestamp-kwd, tag, target.
 For example, a valid value would be:
 
    <style type=\"text/css\">
-    <![CDATA[
-       p { font-weight: normal; color: gray; }
-       h1 { color: black; }
+    /*<![CDATA[*/
+      p { font-weight: normal; color: gray; }
+      h1 { color: black; }
       .title { text-align: center; }
       .todo, .timestamp-kwd { color: red; }
       .done { color: green; }
-    ]]>
+    /*]]>*/
    </style>
 
 If you want to refer to an external style, use something like
diff --git a/lisp/org/ox-icalendar.el b/lisp/org/ox-icalendar.el
index a87970e..7d7c850 100644
--- a/lisp/org/ox-icalendar.el
+++ b/lisp/org/ox-icalendar.el
@@ -5,7 +5,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;;      Nicolas Goaziou <n dot goaziou at gmail dot com>
 ;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 
 ;; This file is part of GNU Emacs.
 
diff --git a/lisp/org/ox-latex.el b/lisp/org/ox-latex.el
index c32aa29..5aaaf99 100644
--- a/lisp/org/ox-latex.el
+++ b/lisp/org/ox-latex.el
@@ -920,15 +920,14 @@ using customize, or with
   (add-to-list \\='org-latex-packages-alist \\='(\"newfloat\" \"minted\"))
 
 In addition, it is necessary to install pygments
-\(http://pygments.org), and to configure the variable
+\(URL `http://pygments.org>'), and to configure the variable
 `org-latex-pdf-process' so that the -shell-escape option is
 passed to pdflatex.
 
 The minted choice has possible repercussions on the preview of
 latex fragments (see `org-preview-latex-fragment').  If you run
 into previewing problems, please consult
-
-  http://orgmode.org/worg/org-tutorials/org-latex-preview.html";
+URL `https://orgmode.org/worg/org-tutorials/org-latex-preview.html'."
   :group 'org-export-latex
   :type '(choice
          (const :tag "Use listings" t)
@@ -1719,7 +1718,7 @@ holding export options."
      ;; Table of contents.
      (let ((depth (plist-get info :with-toc)))
        (when depth
-        (concat (when (wholenump depth)
+        (concat (when (integerp depth)
                   (format "\\setcounter{tocdepth}{%d}\n" depth))
                 (plist-get info :latex-toc-command))))
      ;; Document's body.
diff --git a/lisp/org/ox-odt.el b/lisp/org/ox-odt.el
index cdee568..a1145a9 100644
--- a/lisp/org/ox-odt.el
+++ b/lisp/org/ox-odt.el
@@ -4,7 +4,7 @@
 
 ;; Author: Jambunathan K <kjambunathan at gmail dot com>
 ;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
 
 ;; This file is part of GNU Emacs.
 
diff --git a/lisp/org/ox-publish.el b/lisp/org/ox-publish.el
index 5deb7c5..8901dba 100644
--- a/lisp/org/ox-publish.el
+++ b/lisp/org/ox-publish.el
@@ -405,11 +405,9 @@ definition."
 (defun org-publish--expand-file-name (file project)
   "Return full file name for FILE in PROJECT.
 When FILE is a relative file name, it is expanded according to
-project base directory.  Always return the true name of the file,
-ignoring symlinks."
-  (file-truename
-   (if (file-name-absolute-p file) file
-     (expand-file-name file (org-publish-property :base-directory project)))))
+project base directory."
+  (if (file-name-absolute-p file) file
+    (expand-file-name file (org-publish-property :base-directory project))))
 
 (defun org-publish-expand-projects (projects-alist)
   "Expand projects in PROJECTS-ALIST.
@@ -436,10 +434,32 @@ This splices all the components into the list."
         (match (if (eq extension 'any) ""
                  (format "^[^\\.].*\\.\\(%s\\)$" extension)))
         (base-files
-         (cl-remove-if #'file-directory-p
-                       (if (org-publish-property :recursive project)
-                           (directory-files-recursively base-dir match)
-                         (directory-files base-dir t match t)))))
+         (cond ((not (file-exists-p base-dir)) nil)
+               ((not (org-publish-property :recursive project))
+                (cl-remove-if #'file-directory-p
+                              (directory-files base-dir t match t)))
+               (t
+                ;; Find all files recursively.  Unlike to
+                ;; `directory-files-recursively', we follow symlinks
+                ;; to other directories.
+                (letrec ((files nil)
+                         (walk-tree
+                          (lambda (dir depth)
+                            (when (> depth 100)
+                              (error "Apparent cycle of symbolic links for %S"
+                                     base-dir))
+                            (dolist (f (file-name-all-completions "" dir))
+                              (pcase f
+                                ((or "./" "../") nil)
+                                ((pred directory-name-p)
+                                 (funcall walk-tree
+                                          (expand-file-name f dir)
+                                          (1+ depth)))
+                                ((pred (string-match match))
+                                 (push (expand-file-name f dir) files))
+                                (_ nil)))
+                            files)))
+                  (funcall walk-tree base-dir 0))))))
     (org-uniquify
      (append
       ;; Files from BASE-DIR.  Apply exclusion filter before adding
@@ -468,13 +488,13 @@ This splices all the components into the list."
   "Return a project that FILENAME belongs to.
 When UP is non-nil, return a meta-project (i.e., with a :components part)
 publishing FILENAME."
-  (let* ((filename (file-truename filename))
+  (let* ((filename (expand-file-name filename))
         (project
          (cl-some
           (lambda (p)
             ;; Ignore meta-projects.
             (unless (org-publish-property :components p)
-              (let ((base (file-truename
+              (let ((base (expand-file-name
                            (org-publish-property :base-directory p))))
                 (cond
                  ;; Check if FILENAME is explicitly included in one
@@ -499,9 +519,7 @@ publishing FILENAME."
                  ;; Check if FILENAME belong to project's base
                  ;; directory, or some of its sub-directories
                  ;; if :recursive in non-nil.
-                 ((org-publish-property :recursive p)
-                  (and (file-in-directory-p filename base) p))
-                 ((file-equal-p base (file-name-directory filename)) p)
+                 ((member filename (org-publish-get-base-files p)) p)
                  (t nil)))))
           org-publish-project-alist)))
     (cond
@@ -1260,25 +1278,21 @@ the file including them will be republished as well."
            (with-current-buffer buf
              (goto-char (point-min))
              (while (re-search-forward "^[ \t]*#\\+INCLUDE:" nil t)
-               (let* ((element (org-element-at-point))
-                      (included-file
-                       (and (eq (org-element-type element) 'keyword)
-                            (let ((value (org-element-property :value 
element)))
-                              (and value
-                                   (string-match
-                                    "\\`\\(\".+?\"\\|\\S-+\\)\\(?:\\s-+\\|$\\)"
-                                    value)
-                                   (let ((m (match-string 1 value)))
-                                     (org-unbracket-string
-                                      "\"" "\""
-                                      ;; Ignore search suffix.
-                                      (if (string-match "::.*?\"?\\'" m)
-                                          (substring m 0 (match-beginning 0))
-                                        m))))))))
-                 (when included-file
-                   (push (org-publish-cache-ctime-of-src
-                          (expand-file-name included-file))
-                         included-files-ctime)))))
+               (let ((element (org-element-at-point)))
+                 (when (eq 'keyword (org-element-type element))
+                   (let* ((value (org-element-property :value element))
+                          (filename
+                           (and (string-match "\\`\\(\".+?\"\\|\\S-+\\)" value)
+                                (let ((m (org-unbracket-string
+                                          "\"" "\"" (match-string 1 value))))
+                                  ;; Ignore search suffix.
+                                  (if (string-match "::.*?\\'" m)
+                                      (substring m 0 (match-beginning 0))
+                                    m)))))
+                     (when filename
+                       (push (org-publish-cache-ctime-of-src
+                              (expand-file-name filename))
+                             included-files-ctime)))))))
          (unless visiting (kill-buffer buf)))))
     (or (null pstamp)
        (let ((ctime (org-publish-cache-ctime-of-src filename)))
diff --git a/lisp/org/ox.el b/lisp/org/ox.el
index 7bdac4f..ea7d1dc 100644
--- a/lisp/org/ox.el
+++ b/lisp/org/ox.el
@@ -66,7 +66,7 @@
 ;; Eventually, a dispatcher (`org-export-dispatch') is provided in the
 ;; last one.
 ;;
-;; See <http://orgmode.org/worg/dev/org-export-reference.html> for
+;; See <https://orgmode.org/worg/dev/org-export-reference.html> for
 ;; more information.
 
 ;;; Code:
@@ -714,12 +714,15 @@ frequently in plain text."
 (defcustom org-export-with-toc t
   "Non-nil means create a table of contents in exported files.
 
-The TOC contains headlines with levels up
-to`org-export-headline-levels'.  When an integer, include levels
-up to N in the toc, this may then be different from
-`org-export-headline-levels', but it will not be allowed to be
-larger than the number of headline levels.  When nil, no table of
-contents is made.
+The table of contents contains headlines with levels up to
+`org-export-headline-levels'.
+
+When this variable is set to an integer N, include levels up to
+N in the table of contents.  Although it may then be different
+from `org-export-headline-levels', it is cannot be larger than
+the number of headline levels.
+
+When nil, no table of contents is created.
 
 This option can also be set with the OPTIONS keyword,
 e.g. \"toc:nil\" or \"toc:3\"."
@@ -728,8 +731,9 @@ e.g. \"toc:nil\" or \"toc:3\"."
          (const :tag "No Table of Contents" nil)
          (const :tag "Full Table of Contents" t)
          (integer :tag "TOC to level"))
-  :safe (lambda (x) (or (booleanp x)
-                       (integerp x))))
+  :safe (lambda (x)
+         (or (booleanp x)
+             (integerp x))))
 
 (defcustom org-export-with-tables t
   "Non-nil means export tables.
@@ -1777,7 +1781,8 @@ for a footnotes section."
   "List headlines and inlinetasks with a select tag in their tree.
 DATA is parsed data as returned by `org-element-parse-buffer'.
 INFO is a plist holding export options."
-  (let ((select (plist-get info :select-tags)))
+  (let ((select (cl-mapcan (lambda (tag) (org-tags-expand tag t))
+                          (plist-get info :select-tags))))
     (if (cl-some (lambda (tag) (member tag select)) (plist-get info :filetags))
        ;; If FILETAGS contains a select tag, every headline or
        ;; inlinetask is returned.
@@ -1811,11 +1816,13 @@ INFO is a plist holding export options."
        (funcall walk-data data nil)
        selected-trees))))
 
-(defun org-export--skip-p (datum options selected)
+(defun org-export--skip-p (datum options selected excluded)
   "Non-nil when element or object DATUM should be skipped during export.
 OPTIONS is the plist holding export options.  SELECTED, when
 non-nil, is a list of headlines or inlinetasks belonging to
-a tree with a select tag."
+a tree with a select tag.  EXCLUDED is a list of tags, as
+strings.  Any headline or inlinetask marked with one of those is
+not exported."
   (cl-case (org-element-type datum)
     ((comment comment-block)
      ;; Skip all comments and comment blocks.  Make to keep maximum
@@ -1854,8 +1861,7 @@ a tree with a select tag."
        (and (eq (org-element-type datum) 'inlinetask)
             (not (plist-get options :with-inlinetasks)))
        ;; Ignore subtrees with an exclude tag.
-       (cl-loop for k in (plist-get options :exclude-tags)
-                thereis (member k tags))
+       (cl-some (lambda (tag) (member tag excluded)) tags)
        ;; When a select tag is present in the buffer, ignore any tree
        ;; without it.
        (and selected (not (memq datum selected)))
@@ -2709,6 +2715,9 @@ from tree."
   (letrec ((ignore nil)
           ;; First find trees containing a select tag, if any.
           (selected (org-export--selected-trees data info))
+          ;; List tags that prevent export of headlines.
+          (excluded (cl-mapcan (lambda (tag) (org-tags-expand tag t))
+                               (plist-get info :exclude-tags)))
           (walk-data
            (lambda (data)
              ;; Prune non-exportable elements and objects from tree.
@@ -2717,7 +2726,7 @@ from tree."
              ;; accessed during export.
              (when data
                (let ((type (org-element-type data)))
-                 (if (org-export--skip-p data info selected)
+                 (if (org-export--skip-p data info selected excluded)
                      (if (memq type '(table-cell table-row)) (push data ignore)
                        (org-element-extract-element data))
                    (if (and (eq type 'headline)
@@ -4264,7 +4273,7 @@ A search cell follows the pattern (TYPE . SEARCH) where
     - target's or radio-target's name as a list of strings if
       TYPE is `target'.
 
-    - NAME affiliated keyword is TYPE is `other'.
+    - NAME affiliated keyword if TYPE is `other'.
 
 A search cell is the internal representation of a fuzzy link.  It
 ignores white spaces and statistics cookies, if applicable."



reply via email to

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