Please note this is a bugfix release. See etc/ORG-NEWS for details.
@settitle The Org Manual
@include docstyle.texi
-@set VERSION 9.1.6
-@set DATE 2018-01-03
+@set VERSION 9.1.9
+@set DATE 2018-03-22
@c Version and Contact Info
-@set MAINTAINERSITE @uref{http://orgmode.org,maintainers web page}
+@set MAINTAINERSITE @uref{https://orgmode.org,maintainers web page}
@set AUTHOR Carsten Dominik
@set MAINTAINER Carsten Dominik
@set MAINTAINEREMAIL @email{carsten at orgmode dot org}
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
-@uref{http://orgmode.org}.
+@uref{https://orgmode.org}.
@cindex print edition
An earlier version (7.3) of this manual is available as a
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:
@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
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
@findex org-agenda
@findex org-capture
@findex org-store-link
-@findex org-iswitchb
+@findex org-switchb
Org mode buffers need font-lock to be turned on: this is the default in
Emacs@footnote{If you don't use font-lock globally, turn it on in Org buffer
packages, please take the time to check the list (@pxref{Conflicts}).
The four Org commands @command{org-store-link}, @command{org-capture},
-@command{org-agenda}, and @command{org-iswitchb} should be accessible through
+@command{org-agenda}, 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.
(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
@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
@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
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
-
-@lisp
-(setq org-enable-table-editor nil)
-@end lisp
-
-@noindent Then the only table command that still works is
-@kbd{C-c C-c} to do a manual re-align.
-
@node Column width and alignment
@section Column width and alignment
@cindex narrow columns in tables
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
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
-@uref{http://orgmode.org/worg/org-tutorials/org-plot.html}.
+@uref{https://orgmode.org/worg/org-tutorials/org-plot.html}.
@subsubheading Plot Options
provided by Eric Schulte's @file{org-collector.el} which is a contributed
package@footnote{Contributed packages are not part of Emacs, but are
distributed with the main distribution of Org (visit
-@uref{http://orgmode.org}).}. It provides a general API to collect
+@uref{https://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.
@table @kbd
@orgkey{C-c c C}
+@vindex org-capture-templates
Customize the variable @code{org-capture-templates}.
@end table
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
-@url{http://orgmode.org/worg/} contents at @file{/home/user/worg}, you can
+@url{https://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")))
@noindent
If you are now browsing
-@url{http://orgmode.org/worg/org-contrib/org-protocol.html} and find a typo
+@url{https://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.
@orgcmd{C-',org-cycle-agenda-files}
@itemx C-,
Cycle through agenda file list, visiting one file after the other.
-@item M-x org-iswitchb @key{RET}
+@item M-x org-switchb @key{RET}
Command to use an @code{iswitchb}-like interface to switch to and between Org
buffers.
@end table
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
@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
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:
@example
path: @r{The path to the script. The default grabs the script from}
- @r{@url{http://orgmode.org/org-info.js}, but you might want to have}
+ @r{@url{https://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.}
@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
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
-@uref{http://orgmode.org/worg/library-of-babel.html,Worg}. For remote code
+@uref{https://orgmode.org/worg/library-of-babel.html,Worg}. For remote code
block evaluation syntax, @pxref{Evaluating code blocks}.
@kindex C-c C-v i
@end multitable
Additional documentation for some languages are at
-@uref{http://orgmode.org/worg/org-contrib/babel/languages.html}.
+@uref{https://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
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
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
-@uref{http://orgmode.org/worg/doc.html#hooks}.
+@uref{https://orgmode.org/worg/doc.html#hooks}.
@node Add-on packages
@section Add-on packages
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:
-@uref{http://orgmode.org/worg/org-contrib/}.
+@uref{https://orgmode.org/worg/org-contrib/}.
@node Adding hyperlink types
@section Adding hyperlink types
functions.
For complete documentation, see
-@url{http://orgmode.org/worg/dev/org-export-reference.html, the Org Export
+@url{https://orgmode.org/worg/dev/org-export-reference.html, the Org Export
Reference on Worg}.
@node Context-sensitive commands
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
@uref{http://dropbox.com,Dropbox.com} account@footnote{An alternative is to
use webdav server. MobileOrg documentation has details of webdav server
configuration. Additional help is at
-@uref{http://orgmode.org/worg/org-faq.html#mobileorg_webdav, FAQ entry}.}.
+@uref{https://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:
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.
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~
- ~: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~
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
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~
*** 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
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
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
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
~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
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
~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
**** 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:
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
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.
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
**** 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.
- [[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:
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~
~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:
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
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
**** 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
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
*** 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
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
**** 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)
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
Author: Jambunathan K <kjambunathan at gmail dot com>
Keywords: outlines, hypermedia, calendar, wp
-Homepage: http://orgmode.org
+Homepage: https://orgmode.org
Commentary:
% Reference Card for Org Mode
-\def\orgversionnumber{9.1.6}
+\def\orgversionnumber{9.1.9}
\def\versionyear{2018} % latest update
\input emacsver.tex
;; 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.
;; Author: Oleh Krehel
;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
;; This file is part of GNU Emacs.
;; 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.
;; Author: Eric Schulte
;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
;; This file is part of GNU Emacs.
;; Author: Eric Schulte
;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
;; This file is part of GNU Emacs.
;; Author: Eric Schulte
;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
;; This file is part of GNU Emacs.
;; 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.
;; Author: Eric Schulte
;; Keywords: literate programming, reproducible research, comint
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
;; This file is part of GNU Emacs.
;; Author: Eric Schulte
;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
;; This file is part of GNU Emacs.
;; 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.
(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.
;; Author: Eric Schulte
;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
;; This file is part of GNU Emacs.
;; Author: Eric Schulte
;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
;; This file is part of GNU Emacs.
;; Author: Eric Schulte
;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
;; This file is part of GNU Emacs.
;; 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.
;; Author: Eric Schulte
;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
;; This file is part of GNU Emacs.
;; Author: Eric Schulte
;; Keywords: literate programming, reproducible research, comint
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
;; This file is part of GNU Emacs.
;; 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.
;; Author: Eric Schulte
;; Keywords: literate programming, reproducible research, forth
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
;; This file is part of GNU Emacs.
;; 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.
;;
;; Author: Eric Schulte
;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
;; This file is part of GNU Emacs.
;; Author: Miro Bezjak
;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
;; This file is part of GNU Emacs.
(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
;; Author: Eric Schulte
;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
;; This file is part of GNU Emacs.
;; 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.
;; Author: Andrzej Lichnerowicz
;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
;; This file is part of GNU Emacs.
;; Author: Eric Schulte
;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
;; This file is part of GNU Emacs.
;; Author: Eric Schulte
;; Keywords: literate programming, reproducible research, js
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
;; This file is part of GNU Emacs.
;; Author: Eric Schulte
;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
;; This file is part of GNU Emacs.
;; Author: Eric Schulte
;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
;; This file is part of GNU Emacs.
;; 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.
;; 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.
;;; 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
;; Eric Schulte
;; David T. O'Toole <dto@gnu.org>
;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
;; This file is part of GNU Emacs.
;; 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.
(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
;; Authors: Dieter Schoen
;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
;; This file is part of GNU Emacs.
;; 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.
;; Author: Dan Davison
;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
;; This file is part of GNU Emacs.
;; 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.
;; Author: Juan Pechiar
;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
;; This file is part of GNU Emacs.
;; Author: Eric Schulte
;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
;; This file is part of GNU Emacs.
;; Author: Dan Davison
;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
;; This file is part of GNU Emacs.
;; Author: Eric Schulte
;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
;; This file is part of GNU Emacs.
;; 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.
;; 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.
;; Author: Zhang Weize
;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
;; This file is part of GNU Emacs.
;; 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.
;; 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.
;; 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.
;; Author: Eric Schulte
;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
;; This file is part of GNU Emacs.
;; Author: Eric Schulte
;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
;; This file is part of GNU Emacs.
;; 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.
;; Author: Benjamin Andresen
;; Keywords: literate programming, interactive shell
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
;; This file is part of GNU Emacs.
;; Author: Eric Schulte
;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
;; This file is part of GNU Emacs.
;; Author: Eric Schulte
;; Keywords: literate programming, reproducible research, shen
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
;; This file is part of GNU Emacs.
;; Author: Eric Schulte
;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
;; This file is part of GNU Emacs.
;; Author: Eric Schulte
;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
;; This file is part of GNU Emacs.
;; Author: Kyle Meyer
;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
;; This file is part of GNU Emacs.
;; 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/
;; Author: Eric Schulte
;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
;; This file is part of GNU Emacs.
;; Author: Eric Schulte
;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
;; This file is part of GNU Emacs.
;; Author: Christian Garbs <mitch@cgarbs.de>
;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
;;; License:
;; Authors: Eric Schulte
;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
;; This file is part of GNU Emacs.
;; 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.
;;
(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:
(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
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
;; 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))
(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"
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")))
(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)
;; 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.
;;
;; 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.
;;
;; 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.
;;
(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" ())
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\"))))
;; 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))
(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))
;; 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.
;;
: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)
(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.
(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 "")
(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
(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."
".*\\]--\\(\\[[^]]+\\]\\)") 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))
(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: "))
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
`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
(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)))
(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)))
(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)
;;;###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)
;; 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? "))
(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)
(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)
;; 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.
;;
;; 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.
;;
(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."
(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)))))
-
\f
;;; Obsolete aliases (remove them after the next major release).
;; 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.
;;
;; 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.
;;
;;; 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.
(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))
(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)
;; 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.
;;
;; Author: Marco Wahl <marcowahlsoft>a<gmailcom>
;; Keywords: link, eww
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
;; This file is part of GNU Emacs.
;; 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.
;;
;;
;; 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.
;;
(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)
;;
;; 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.
;;
;; 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.
;;
(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))
(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)))
;; 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.
;;
;;
;; 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.
;;
;;
;; 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.
;;
;; 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.
;;
;;
;; 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.
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Bastien Guerry <bzg@gnu.org>
;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
+;; Homepage: https://orgmode.org
;;
;; This file is part of GNU Emacs.
;;
(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)
(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.
(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"))
(= 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.
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)))
(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.
;; 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.
;;
;; 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.
;;
;;
;; 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.
;;
;;
;; 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
;; 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.
;;
;;
;; 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.
;;
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\"
(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))
;; 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.
;;
;; Bastien Guerry <bzg@gnu.org>
;; 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.
;;
;; 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.
;;
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."
(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."
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))
;; 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.
;;
(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))
\f
(provide 'org-version)
;; 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.
;;
;; 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.
;;
;; ---------------------------
;; See the corresponding sections in the manual at
;;
-;; http://orgmode.org/org.html#Installation
+;; https://orgmode.org/org.html#Installation
;;
;; Documentation
;; -------------
;; in the doc/ directory.
;;
;; A list of recent changes can be found at
-;; http://orgmode.org/Changes.html
+;; https://orgmode.org/Changes.html
;;
;;; Code:
(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.
: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\"
(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"
: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)
(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
(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
(`(,(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)
(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."
(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.
(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))
(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))))
(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))))
(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))
'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)))))))
(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))))))))
;; 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: "
(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
(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."
(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)
(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
(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\\'"))
(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))
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:
(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
"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))))
(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.
"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.
------------------------------------------------------------------------")
;;;###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)
;;;; 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")
: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.
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
;; 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.
(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)
;; 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.
;; 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.
(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.
(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
"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
;; 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
(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)))
;; 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:
(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\"."
(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.
"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.
(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
(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)))
(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.
;; 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)
- 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."