From f8e23a1c26719eea972e5b84bbd233a03321f4be Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Fri, 4 Oct 2019 14:03:36 +0200 Subject: [PATCH] update orgmode --- elpa/org-20171030/org | 22445 --------------- elpa/org-20171030/org-autoloads.el | 768 - elpa/org-20171030/org-compat.el | 600 - elpa/org-20171030/org-macs.el | 430 - elpa/org-20171030/org-pkg.el | 3 - elpa/{org-20171030 => org-20190930}/COPYING | 0 .../README_ELPA | 4 +- elpa/{org-20171030 => org-20190930}/dir | 0 .../etc/ORG-NEWS | 507 +- .../etc/styles/OrgOdtContentTemplate.xml | 0 .../etc/styles/OrgOdtStyles.xml | 0 .../etc/styles/README | 4 +- elpa/{org-20171030 => org-20190930}/ob-C.el | 16 +- elpa/{org-20171030 => org-20190930}/ob-J.el | 8 +- elpa/{org-20171030 => org-20190930}/ob-R.el | 4 +- elpa/{org-20171030 => org-20190930}/ob-abc.el | 6 +- .../ob-asymptote.el | 6 +- elpa/{org-20171030 => org-20190930}/ob-awk.el | 8 +- .../{org-20171030 => org-20190930}/ob-calc.el | 8 +- .../ob-clojure.el | 64 +- .../ob-comint.el | 6 +- elpa/{org-20171030 => org-20190930}/ob-coq.el | 4 +- .../{org-20171030 => org-20190930}/ob-core.el | 476 +- elpa/{org-20171030 => org-20190930}/ob-css.el | 4 +- .../ob-ditaa.el | 4 +- elpa/{org-20171030 => org-20190930}/ob-dot.el | 6 +- .../{org-20171030 => org-20190930}/ob-ebnf.el | 8 +- .../ob-emacs-lisp.el | 14 +- .../{org-20171030 => org-20190930}/ob-eval.el | 6 +- elpa/{org-20171030 => org-20190930}/ob-exp.el | 28 +- .../ob-forth.el | 10 +- .../ob-fortran.el | 15 +- .../ob-gnuplot.el | 15 +- .../ob-groovy.el | 12 +- .../ob-haskell.el | 25 +- .../ob-hledger.el | 4 +- elpa/{org-20171030 => org-20190930}/ob-io.el | 8 +- .../{org-20171030 => org-20190930}/ob-java.el | 4 +- elpa/{org-20171030 => org-20190930}/ob-js.el | 124 +- .../{org-20171030 => org-20190930}/ob-keys.el | 4 +- .../ob-latex.el | 6 +- .../ob-ledger.el | 4 +- .../ob-lilypond.el | 57 +- .../{org-20171030 => org-20190930}/ob-lisp.el | 8 +- elpa/{org-20171030 => org-20190930}/ob-lob.el | 83 +- elpa/{org-20171030 => org-20190930}/ob-lua.el | 15 +- .../ob-makefile.el | 4 +- .../ob-matlab.el | 4 +- .../ob-maxima.el | 4 +- .../ob-mscgen.el | 4 +- .../ob-ocaml.el | 6 +- .../ob-octave.el | 22 +- elpa/{org-20171030 => org-20190930}/ob-org.el | 6 +- .../{org-20171030 => org-20190930}/ob-perl.el | 4 +- .../ob-picolisp.el | 16 +- .../ob-plantuml.el | 4 +- .../ob-processing.el | 6 +- .../ob-python.el | 65 +- elpa/{org-20171030 => org-20190930}/ob-ref.el | 31 +- .../{org-20171030 => org-20190930}/ob-ruby.el | 8 +- .../{org-20171030 => org-20190930}/ob-sass.el | 4 +- .../ob-scheme.el | 28 +- .../ob-screen.el | 4 +- elpa/{org-20171030 => org-20190930}/ob-sed.el | 6 +- .../ob-shell.el | 121 +- .../{org-20171030 => org-20190930}/ob-shen.el | 6 +- elpa/{org-20171030 => org-20190930}/ob-sql.el | 25 +- .../ob-sqlite.el | 4 +- .../{org-20171030 => org-20190930}/ob-stan.el | 15 +- .../ob-table.el | 7 +- .../ob-tangle.el | 21 +- .../{org-20171030 => org-20190930}/ob-vala.el | 7 +- elpa/{org-20171030 => org-20190930}/ob.el | 4 +- elpa/org-20190930/org | 22565 ++++++++++++++++ .../org-agenda.el | 1487 +- .../org-archive.el | 142 +- .../org-attach.el | 57 +- elpa/org-20190930/org-autoloads.el | 1483 + .../org-bbdb.el | 6 +- .../org-bibtex.el | 7 +- .../org-capture.el | 781 +- .../org-clock.el | 781 +- .../org-colview.el | 285 +- elpa/org-20190930/org-compat.el | 1011 + .../org-crypt.el | 2 +- .../org-ctags.el | 7 +- .../org-datetree.el | 13 +- .../org-docview.el | 12 +- .../org-duration.el | 16 +- .../org-element.el | 357 +- .../org-entities.el | 14 +- .../org-eshell.el | 6 +- .../{org-20171030 => org-20190930}/org-eww.el | 27 +- .../org-faces.el | 30 +- .../org-feed.el | 32 +- .../org-footnote.el | 617 +- .../org-gnus.el | 42 +- elpa/org-20190930/org-goto.el | 314 + .../org-habit.el | 10 +- elpa/{org-20171030 => org-20190930}/org-id.el | 36 +- .../org-indent.el | 104 +- .../org-info.el | 8 +- .../org-inlinetask.el | 101 +- .../org-install.el | 0 .../{org-20171030 => org-20190930}/org-irc.el | 31 +- .../org-lint.el | 42 +- .../org-list.el | 296 +- .../org-loaddefs.el | 441 +- .../org-macro.el | 278 +- elpa/org-20190930/org-macs.el | 1163 + .../{org-20171030 => org-20190930}/org-mhe.el | 6 +- .../org-mobile.el | 101 +- .../org-mouse.el | 28 +- .../org-pcomplete.el | 274 +- elpa/org-20190930/org-pkg.el | 5 + .../org-plot.el | 6 +- .../org-protocol.el | 119 +- .../org-rmail.el | 4 +- .../{org-20171030 => org-20190930}/org-src.el | 198 +- .../org-table.el | 1593 +- elpa/org-20190930/org-tempo.el | 188 + .../org-timer.el | 60 +- .../org-version.el | 6 +- .../{org-20171030 => org-20190930}/org-w3m.el | 43 +- elpa/{org-20171030 => org-20190930}/org.el | 7738 +++--- .../orgcard.pdf | Bin 118931 -> 118708 bytes .../ox-ascii.el | 243 +- .../ox-beamer.el | 79 +- .../{org-20171030 => org-20190930}/ox-html.el | 419 +- .../ox-icalendar.el | 6 +- .../ox-latex.el | 248 +- elpa/{org-20171030 => org-20190930}/ox-man.el | 8 +- elpa/{org-20171030 => org-20190930}/ox-md.el | 31 +- elpa/{org-20171030 => org-20190930}/ox-odt.el | 54 +- elpa/{org-20171030 => org-20190930}/ox-org.el | 15 +- .../ox-publish.el | 195 +- .../ox-texinfo.el | 340 +- elpa/{org-20171030 => org-20190930}/ox.el | 496 +- init.el | 4 +- 139 files changed, 37262 insertions(+), 34116 deletions(-) delete mode 100644 elpa/org-20171030/org delete mode 100644 elpa/org-20171030/org-autoloads.el delete mode 100644 elpa/org-20171030/org-compat.el delete mode 100644 elpa/org-20171030/org-macs.el delete mode 100644 elpa/org-20171030/org-pkg.el rename elpa/{org-20171030 => org-20190930}/COPYING (100%) rename elpa/{org-20171030 => org-20190930}/README_ELPA (92%) rename elpa/{org-20171030 => org-20190930}/dir (100%) rename elpa/{org-20171030 => org-20190930}/etc/ORG-NEWS (90%) rename elpa/{org-20171030 => org-20190930}/etc/styles/OrgOdtContentTemplate.xml (100%) rename elpa/{org-20171030 => org-20190930}/etc/styles/OrgOdtStyles.xml (100%) rename elpa/{org-20171030 => org-20190930}/etc/styles/README (93%) rename elpa/{org-20171030 => org-20190930}/ob-C.el (97%) rename elpa/{org-20171030 => org-20190930}/ob-J.el (96%) rename elpa/{org-20171030 => org-20190930}/ob-R.el (99%) rename elpa/{org-20171030 => org-20190930}/ob-abc.el (95%) rename elpa/{org-20171030 => org-20190930}/ob-asymptote.el (97%) rename elpa/{org-20171030 => org-20190930}/ob-awk.el (94%) rename elpa/{org-20171030 => org-20190930}/ob-calc.el (94%) rename elpa/{org-20171030 => org-20190930}/ob-clojure.el (80%) rename elpa/{org-20171030 => org-20190930}/ob-comint.el (97%) rename elpa/{org-20171030 => org-20190930}/ob-coq.el (96%) rename elpa/{org-20171030 => org-20190930}/ob-core.el (91%) rename elpa/{org-20171030 => org-20190930}/ob-css.el (93%) rename elpa/{org-20171030 => org-20190930}/ob-ditaa.el (97%) rename elpa/{org-20171030 => org-20190930}/ob-dot.el (93%) rename elpa/{org-20171030 => org-20190930}/ob-ebnf.el (93%) rename elpa/{org-20171030 => org-20190930}/ob-emacs-lisp.el (86%) rename elpa/{org-20171030 => org-20190930}/ob-eval.el (97%) rename elpa/{org-20171030 => org-20190930}/ob-exp.el (95%) rename elpa/{org-20171030 => org-20190930}/ob-forth.el (92%) rename elpa/{org-20171030 => org-20190930}/ob-fortran.el (94%) rename elpa/{org-20171030 => org-20190930}/ob-gnuplot.el (95%) rename elpa/{org-20171030 => org-20190930}/ob-groovy.el (92%) rename elpa/{org-20171030 => org-20190930}/ob-haskell.el (92%) rename elpa/{org-20171030 => org-20190930}/ob-hledger.el (96%) rename elpa/{org-20171030 => org-20190930}/ob-io.el (95%) rename elpa/{org-20171030 => org-20190930}/ob-java.el (97%) rename elpa/{org-20171030 => org-20190930}/ob-js.el (58%) rename elpa/{org-20171030 => org-20190930}/ob-keys.el (97%) rename elpa/{org-20171030 => org-20190930}/ob-latex.el (98%) rename elpa/{org-20171030 => org-20190930}/ob-ledger.el (96%) rename elpa/{org-20171030 => org-20190930}/ob-lilypond.el (92%) rename elpa/{org-20171030 => org-20190930}/ob-lisp.el (96%) rename elpa/{org-20171030 => org-20190930}/ob-lob.el (68%) rename elpa/{org-20171030 => org-20190930}/ob-lua.el (96%) rename elpa/{org-20171030 => org-20190930}/ob-makefile.el (94%) rename elpa/{org-20171030 => org-20190930}/ob-matlab.el (93%) rename elpa/{org-20171030 => org-20190930}/ob-maxima.el (98%) rename elpa/{org-20171030 => org-20190930}/ob-mscgen.el (96%) rename elpa/{org-20171030 => org-20190930}/ob-ocaml.el (97%) rename elpa/{org-20171030 => org-20190930}/ob-octave.el (95%) rename elpa/{org-20171030 => org-20190930}/ob-org.el (94%) rename elpa/{org-20171030 => org-20190930}/ob-perl.el (98%) rename elpa/{org-20171030 => org-20190930}/ob-picolisp.el (94%) rename elpa/{org-20171030 => org-20190930}/ob-plantuml.el (98%) rename elpa/{org-20171030 => org-20190930}/ob-processing.el (98%) rename elpa/{org-20171030 => org-20190930}/ob-python.el (88%) rename elpa/{org-20171030 => org-20190930}/ob-ref.el (91%) rename elpa/{org-20171030 => org-20190930}/ob-ruby.el (97%) rename elpa/{org-20171030 => org-20190930}/ob-sass.el (96%) rename elpa/{org-20171030 => org-20190930}/ob-scheme.el (92%) rename elpa/{org-20171030 => org-20190930}/ob-screen.el (98%) rename elpa/{org-20171030 => org-20190930}/ob-sed.el (96%) rename elpa/{org-20171030 => org-20190930}/ob-shell.el (75%) rename elpa/{org-20171030 => org-20190930}/ob-shen.el (94%) rename elpa/{org-20171030 => org-20190930}/ob-sql.el (94%) rename elpa/{org-20171030 => org-20190930}/ob-sqlite.el (98%) rename elpa/{org-20171030 => org-20190930}/ob-stan.el (87%) rename elpa/{org-20171030 => org-20190930}/ob-table.el (97%) rename elpa/{org-20171030 => org-20190930}/ob-tangle.el (98%) rename elpa/{org-20171030 => org-20190930}/ob-vala.el (96%) rename elpa/{org-20171030 => org-20190930}/ob.el (92%) create mode 100644 elpa/org-20190930/org rename elpa/{org-20171030 => org-20190930}/org-agenda.el (92%) rename elpa/{org-20171030 => org-20190930}/org-archive.el (87%) rename elpa/{org-20171030 => org-20190930}/org-attach.el (93%) create mode 100644 elpa/org-20190930/org-autoloads.el rename elpa/{org-20171030 => org-20190930}/org-bbdb.el (99%) rename elpa/{org-20171030 => org-20190930}/org-bibtex.el (99%) rename elpa/{org-20171030 => org-20190930}/org-capture.el (79%) rename elpa/{org-20171030 => org-20190930}/org-clock.el (85%) rename elpa/{org-20171030 => org-20190930}/org-colview.el (89%) create mode 100644 elpa/org-20190930/org-compat.el rename elpa/{org-20171030 => org-20190930}/org-crypt.el (99%) rename elpa/{org-20171030 => org-20190930}/org-ctags.el (98%) rename elpa/{org-20171030 => org-20190930}/org-datetree.el (96%) rename elpa/{org-20171030 => org-20190930}/org-docview.el (92%) rename elpa/{org-20171030 => org-20190930}/org-duration.el (96%) rename elpa/{org-20171030 => org-20190930}/org-element.el (96%) rename elpa/{org-20171030 => org-20190930}/org-entities.el (98%) rename elpa/{org-20171030 => org-20190930}/org-eshell.el (92%) rename elpa/{org-20171030 => org-20190930}/org-eww.el (88%) rename elpa/{org-20171030 => org-20190930}/org-faces.el (96%) rename elpa/{org-20171030 => org-20190930}/org-feed.el (97%) rename elpa/{org-20171030 => org-20190930}/org-footnote.el (68%) rename elpa/{org-20171030 => org-20190930}/org-gnus.el (84%) create mode 100644 elpa/org-20190930/org-goto.el rename elpa/{org-20171030 => org-20190930}/org-habit.el (98%) rename elpa/{org-20171030 => org-20190930}/org-id.el (96%) rename elpa/{org-20171030 => org-20190930}/org-indent.el (84%) rename elpa/{org-20171030 => org-20190930}/org-info.el (96%) rename elpa/{org-20171030 => org-20190930}/org-inlinetask.el (83%) rename elpa/{org-20171030 => org-20190930}/org-install.el (100%) rename elpa/{org-20171030 => org-20190930}/org-irc.el (93%) rename elpa/{org-20171030 => org-20190930}/org-lint.el (97%) rename elpa/{org-20171030 => org-20190930}/org-list.el (94%) rename elpa/{org-20171030 => org-20190930}/org-loaddefs.el (91%) rename elpa/{org-20171030 => org-20190930}/org-macro.el (57%) create mode 100644 elpa/org-20190930/org-macs.el rename elpa/{org-20171030 => org-20190930}/org-mhe.el (98%) rename elpa/{org-20171030 => org-20190930}/org-mobile.el (93%) rename elpa/{org-20171030 => org-20190930}/org-mouse.el (98%) rename elpa/{org-20171030 => org-20190930}/org-pcomplete.el (67%) create mode 100644 elpa/org-20190930/org-pkg.el rename elpa/{org-20171030 => org-20190930}/org-plot.el (98%) rename elpa/{org-20171030 => org-20190930}/org-protocol.el (91%) rename elpa/{org-20171030 => org-20190930}/org-rmail.el (97%) rename elpa/{org-20171030 => org-20190930}/org-src.el (89%) rename elpa/{org-20171030 => org-20190930}/org-table.el (83%) create mode 100644 elpa/org-20190930/org-tempo.el rename elpa/{org-20171030 => org-20190930}/org-timer.el (91%) rename elpa/{org-20171030 => org-20190930}/org-version.el (83%) rename elpa/{org-20171030 => org-20190930}/org-w3m.el (83%) rename elpa/{org-20171030 => org-20190930}/org.el (84%) rename elpa/{org-20171030 => org-20190930}/orgcard.pdf (60%) rename elpa/{org-20171030 => org-20190930}/ox-ascii.el (92%) rename elpa/{org-20171030 => org-20190930}/ox-beamer.el (96%) rename elpa/{org-20171030 => org-20190930}/ox-html.el (92%) rename elpa/{org-20171030 => org-20190930}/ox-icalendar.el (99%) rename elpa/{org-20171030 => org-20190930}/ox-latex.el (96%) rename elpa/{org-20171030 => org-20190930}/ox-man.el (99%) rename elpa/{org-20171030 => org-20190930}/ox-md.el (97%) rename elpa/{org-20171030 => org-20190930}/ox-odt.el (99%) rename elpa/{org-20171030 => org-20190930}/ox-org.el (97%) rename elpa/{org-20171030 => org-20190930}/ox-publish.el (91%) rename elpa/{org-20171030 => org-20190930}/ox-texinfo.el (88%) rename elpa/{org-20171030 => org-20190930}/ox.el (95%) diff --git a/elpa/org-20171030/org b/elpa/org-20171030/org deleted file mode 100644 index f9f02fbb..00000000 --- a/elpa/org-20171030/org +++ /dev/null @@ -1,22445 +0,0 @@ -This is org, produced by makeinfo version 4.13 from org.texi. - -This manual is for Org version 9.1.2 (release_9.1.2-25-g2567fe). - - Copyright (C) 2004-2017 Free Software Foundation, Inc. - - Permission is granted to copy, distribute and/or modify this - document under the terms of the GNU Free Documentation License, - Version 1.3 or any later version published by the Free Software - Foundation; with no Invariant Sections, with the Front-Cover Texts - being "A GNU Manual," and with the Back-Cover Texts as in (a) - below. A copy of the license is included in the section entitled - "GNU Free Documentation License." - - (a) The FSF's Back-Cover Text is: "You have the freedom to copy and - modify this GNU manual." - -INFO-DIR-SECTION Emacs editing modes -START-INFO-DIR-ENTRY -* Org Mode: (org). Outline-based notes management and organizer -END-INFO-DIR-ENTRY - - -File: org, Node: Top, Next: Introduction, Prev: (dir), Up: (dir) - -Org Mode Manual -*************** - -This manual is for Org version 9.1.2 (release_9.1.2-25-g2567fe). - - Copyright (C) 2004-2017 Free Software Foundation, Inc. - - Permission is granted to copy, distribute and/or modify this - document under the terms of the GNU Free Documentation License, - Version 1.3 or any later version published by the Free Software - Foundation; with no Invariant Sections, with the Front-Cover Texts - being "A GNU Manual," and with the Back-Cover Texts as in (a) - below. A copy of the license is included in the section entitled - "GNU Free Documentation License." - - (a) The FSF's Back-Cover Text is: "You have the freedom to copy and - modify this GNU manual." - -* Menu: - -* Introduction:: Getting started -* Document structure:: A tree works like your brain -* Tables:: Pure magic for quick formatting -* Hyperlinks:: Notes in context -* TODO items:: Every tree branch can be a TODO item -* Tags:: Tagging headlines and matching sets of tags -* Properties and columns:: Storing information about an entry -* Dates and times:: Making items useful for planning -* Capture - Refile - Archive:: The ins and outs for projects -* Agenda views:: Collecting information into views -* Markup:: Prepare text for rich export -* Exporting:: Sharing and publishing notes -* Publishing:: Create a web site of linked Org files -* Working with source code:: Export, evaluate, and tangle code blocks -* Miscellaneous:: All the rest which did not fit elsewhere -* Hacking:: How to hack your way around -* MobileOrg:: Viewing and capture on a mobile device -* History and acknowledgments:: How Org came into being -* GNU Free Documentation License:: The license for this documentation. -* Main Index:: An index of Org's concepts and features -* Key Index:: Key bindings and where they are described -* Command and Function Index:: Command names and some internal functions -* Variable Index:: Variables mentioned in the manual - - --- The Detailed Node Listing --- - -Introduction - -* Summary:: Brief summary of what Org does -* Installation:: Installing Org -* Activation:: How to activate Org for certain buffers -* Feedback:: Bug reports, ideas, patches etc. -* Conventions:: Typesetting conventions in the manual - -Document structure - -* Outlines:: Org is based on Outline mode -* Headlines:: How to typeset Org tree headlines -* Visibility cycling:: Show and hide, much simplified -* Motion:: Jumping to other headlines -* Structure editing:: Changing sequence and level of headlines -* Sparse trees:: Matches embedded in context -* Plain lists:: Additional structure within an entry -* Drawers:: Tucking stuff away -* Blocks:: Folding blocks -* Footnotes:: How footnotes are defined in Org's syntax -* Orgstruct mode:: Structure editing outside Org -* Org syntax:: Formal description of Org's syntax - -Visibility cycling - -* Global and local cycling:: Cycling through various visibility states -* Initial visibility:: Setting the initial visibility state -* Catching invisible edits:: Preventing mistakes when editing invisible parts - -Tables - -* Built-in table editor:: Simple tables -* Column width and alignment:: Overrule the automatic settings -* Column groups:: Grouping to trigger vertical lines -* Orgtbl mode:: The table editor as minor mode -* The spreadsheet:: The table editor has spreadsheet capabilities -* Org-Plot:: Plotting from org tables - -The spreadsheet - -* References:: How to refer to another field or range -* Formula syntax for Calc:: Using Calc to compute stuff -* Formula syntax for Lisp:: Writing formulas in Emacs Lisp -* Durations and time values:: How to compute durations and time values -* Field and range formulas:: Formula for specific (ranges of) fields -* Column formulas:: Formulas valid for an entire column -* Lookup functions:: Lookup functions for searching tables -* Editing and debugging formulas:: Fixing formulas -* Updating the table:: Recomputing all dependent fields -* Advanced features:: Field and column names, parameters and automatic recalc - -Hyperlinks - -* Link format:: How links in Org are formatted -* Internal links:: Links to other places in the current file -* External links:: URL-like links to the world -* Handling links:: Creating, inserting and following -* Using links outside Org:: Linking from my C source code? -* Link abbreviations:: Shortcuts for writing complex links -* Search options:: Linking to a specific location -* Custom searches:: When the default search is not enough - -Internal links - -* Radio targets:: Make targets trigger links in plain text - -TODO items - -* TODO basics:: Marking and displaying TODO entries -* TODO extensions:: Workflow and assignments -* Progress logging:: Dates and notes for progress -* Priorities:: Some things are more important than others -* Breaking down tasks:: Splitting a task into manageable pieces -* Checkboxes:: Tick-off lists - -Extended use of TODO keywords - -* Workflow states:: From TODO to DONE in steps -* TODO types:: I do this, Fred does the rest -* Multiple sets in one file:: Mixing it all, and still finding your way -* Fast access to TODO states:: Single letter selection of a state -* Per-file keywords:: Different files, different requirements -* Faces for TODO keywords:: Highlighting states -* TODO dependencies:: When one task needs to wait for others - -Progress logging - -* Closing items:: When was this entry marked DONE? -* Tracking TODO state changes:: When did the status change? -* Tracking your habits:: How consistent have you been? - -Tags - -* Tag inheritance:: Tags use the tree structure of the outline -* Setting tags:: How to assign tags to a headline -* Tag hierarchy:: Create a hierarchy of tags -* Tag searches:: Searching for combinations of tags - -Properties and columns - -* Property syntax:: How properties are spelled out -* Special properties:: Access to other Org mode features -* Property searches:: Matching property values -* Property inheritance:: Passing values down the tree -* Column view:: Tabular viewing and editing -* Property API:: Properties for Lisp programmers - -Column view - -* Defining columns:: The COLUMNS format property -* Using column view:: How to create and use column view -* Capturing column view:: A dynamic block for column view - -Defining columns - -* Scope of column definitions:: Where defined, where valid? -* Column attributes:: Appearance and content of a column - -Dates and times - -* Timestamps:: Assigning a time to a tree entry -* Creating timestamps:: Commands which insert timestamps -* Deadlines and scheduling:: Planning your work -* Clocking work time:: Tracking how long you spend on a task -* Effort estimates:: Planning work effort in advance -* Timers:: Notes with a running timer - -Creating timestamps - -* The date/time prompt:: How Org mode helps you entering date and time -* Custom time format:: Making dates look different - -Deadlines and scheduling - -* Inserting deadline/schedule:: Planning items -* Repeated tasks:: Items that show up again and again - -Clocking work time - -* Clocking commands:: Starting and stopping a clock -* The clock table:: Detailed reports -* Resolving idle time:: Resolving time when you've been idle - -Capture - Refile - Archive - -* Capture:: Capturing new stuff -* Attachments:: Add files to tasks -* RSS feeds:: Getting input from RSS feeds -* Protocols:: External (e.g., Browser) access to Emacs and Org -* Refile and copy:: Moving/copying a tree from one place to another -* Archiving:: What to do with finished projects - -Capture - -* Setting up capture:: Where notes will be stored -* Using capture:: Commands to invoke and terminate capture -* Capture templates:: Define the outline of different note types - -Capture templates - -* Template elements:: What is needed for a complete template entry -* Template expansion:: Filling in information about time and context -* Templates in contexts:: Only show a template in a specific context - -Protocols for external access - -* `store-link' protocol:: Store a link, push URL to kill-ring. -* `capture' protocol:: Fill a buffer with external information. -* `open-source' protocol:: Edit published contents. - -Archiving - -* Moving subtrees:: Moving a tree to an archive file -* Internal archiving:: Switch off a tree but keep it in the file - -Agenda views - -* Agenda files:: Files being searched for agenda information -* Agenda dispatcher:: Keyboard access to agenda views -* Built-in agenda views:: What is available out of the box? -* Presentation and sorting:: How agenda items are prepared for display -* Agenda commands:: Remote editing of Org trees -* Custom agenda views:: Defining special searches and views -* Exporting agenda views:: Writing a view to a file -* Agenda column view:: Using column view for collected entries - -The built-in agenda views - -* Weekly/daily agenda:: The calendar page with current tasks -* Global TODO list:: All unfinished action items -* Matching tags and properties:: Structured information with fine-tuned search -* Search view:: Find entries by searching for text -* Stuck projects:: Find projects you need to review - -Presentation and sorting - -* Categories:: Not all tasks are equal -* Time-of-day specifications:: How the agenda knows the time -* Sorting agenda items:: The order of things -* Filtering/limiting agenda items:: Dynamically narrow the agenda - -Custom agenda views - -* Storing searches:: Type once, use often -* Block agenda:: All the stuff you need in a single buffer -* Setting options:: Changing the rules - -Markup for rich export - -* Paragraphs:: The basic unit of text -* Emphasis and monospace:: Bold, italic, etc. -* Horizontal rules:: Make a line -* Images and tables:: Images, tables and caption mechanism -* Literal examples:: Source code examples with special formatting -* Special symbols:: Greek letters and other symbols -* Subscripts and superscripts:: Simple syntax for raising/lowering text -* Embedded LaTeX:: LaTeX can be freely used inside Org documents - -Embedded LaTeX - -* LaTeX fragments:: Complex formulas made easy -* Previewing LaTeX fragments:: What will this snippet look like? -* CDLaTeX mode:: Speed up entering of formulas - -Exporting - -* The export dispatcher:: The main interface -* Export settings:: Common export settings -* Table of contents:: The if and where of the table of contents -* Include files:: Include additional files into a document -* Macro replacement:: Use macros to create templates -* Comment lines:: What will not be exported -* ASCII/Latin-1/UTF-8 export:: Exporting to flat files with encoding -* Beamer export:: Exporting as a Beamer presentation -* HTML export:: Exporting to HTML -* LaTeX export:: Exporting to LaTeX, and processing to PDF -* Markdown export:: Exporting to Markdown -* OpenDocument Text export:: Exporting to OpenDocument Text -* Org export:: Exporting to Org -* Texinfo export:: Exporting to Texinfo -* iCalendar export:: Exporting to iCalendar -* Other built-in back-ends:: Exporting to a man page -* Advanced configuration:: Fine-tuning the export output -* Export in foreign buffers:: Author tables and lists in Org syntax - -Beamer export - -* Beamer export commands:: For creating Beamer documents. -* Beamer specific export settings:: For customizing Beamer export. -* Sectioning Frames and Blocks in Beamer:: For composing Beamer slides. -* Beamer specific syntax:: For using in Org documents. -* Editing support:: For using helper functions. -* A Beamer example:: A complete presentation. - -HTML export - -* HTML Export commands:: Invoking HTML export -* HTML Specific export settings:: Settings for HTML export -* HTML doctypes:: Exporting various (X)HTML flavors -* HTML preamble and postamble:: Inserting preamble and postamble -* Quoting HTML tags:: Using direct HTML in Org files -* Links in HTML export:: Interpreting and formatting links -* Tables in HTML export:: Formatting and modifying tables -* Images in HTML export:: Inserting figures with HTML output -* Math formatting in HTML export:: Handling math equations -* Text areas in HTML export:: Showing an alternate approach, an example -* CSS support:: Styling HTML output -* JavaScript support:: Folding scripting in the web browser - -LaTeX export - -* LaTeX export commands:: For producing LaTeX and PDF documents. -* LaTeX specific export settings:: Unique to this LaTeX back-end. -* LaTeX header and sectioning:: For file structure. -* Quoting LaTeX code:: Directly in the Org document. -* Tables in LaTeX export:: Attributes specific to tables. -* Images in LaTeX export:: Attributes specific to images. -* Plain lists in LaTeX export:: Attributes specific to lists. -* Source blocks in LaTeX export:: Attributes specific to source code blocks. -* Example blocks in LaTeX export:: Attributes specific to example blocks. -* Special blocks in LaTeX export:: Attributes specific to special blocks. -* Horizontal rules in LaTeX export:: Attributes specific to horizontal rules. - -OpenDocument Text export - -* Pre-requisites for ODT export:: Required packages. -* ODT export commands:: Invoking export. -* ODT specific export settings:: Configuration options. -* Extending ODT export:: Producing `.doc', `.pdf' files. -* Applying custom styles:: Styling the output. -* Links in ODT export:: Handling and formatting links. -* Tables in ODT export:: Org table conversions. -* Images in ODT export:: Inserting images. -* Math formatting in ODT export:: Formatting LaTeX fragments. -* Labels and captions in ODT export:: Rendering objects. -* Literal examples in ODT export:: For source code and example blocks. -* Advanced topics in ODT export:: For power users. - -Math formatting in ODT export - -* Working with LaTeX math snippets:: Embedding in LaTeX format. -* Working with MathML or OpenDocument formula files:: Embedding in native format. - -Advanced topics in ODT export - -* Configuring a document converter:: Registering a document converter. -* Working with OpenDocument style files:: Exploring internals. -* Creating one-off styles:: Customizing styles, highlighting. -* Customizing tables in ODT export:: Defining table templates. -* Validating OpenDocument XML:: Debugging corrupted OpenDocument files. - -Texinfo export - -* Texinfo export commands:: Invoking commands. -* Texinfo specific export settings:: Setting the environment. -* Texinfo file header:: Generating the header. -* Texinfo title and copyright page:: Creating preamble pages. -* Info directory file:: Installing a manual in Info file hierarchy. -* Headings and sectioning structure:: Building document structure. -* Indices:: Creating indices. -* Quoting Texinfo code:: Incorporating literal Texinfo code. -* Plain lists in Texinfo export:: List attributes. -* Tables in Texinfo export:: Table attributes. -* Images in Texinfo export:: Image attributes. -* Special blocks in Texinfo export:: Special block attributes. -* A Texinfo example:: Processing Org to Texinfo. - -Publishing - -* Configuration:: Defining projects -* Uploading files:: How to get files up on the server -* Sample configuration:: Example projects -* Triggering publication:: Publication commands - -Configuration - -* Project alist:: The central configuration variable -* Sources and destinations:: From here to there -* Selecting files:: What files are part of the project? -* Publishing action:: Setting the function doing the publishing -* Publishing options:: Tweaking HTML/LaTeX export -* Publishing links:: Which links keep working after publishing? -* Sitemap:: Generating a list of all pages -* Generating an index:: An index that reaches across pages - -Sample configuration - -* Simple example:: One-component publishing -* Complex example:: A multi-component publishing example - -Working with source code - -* Structure of code blocks:: Code block syntax described -* Editing source code:: Language major-mode editing -* Exporting code blocks:: Export contents and/or results -* Extracting source code:: Create pure source code files -* Evaluating code blocks:: Place results of evaluation in the Org mode buffer -* Library of Babel:: Use and contribute to a library of useful code blocks -* Languages:: List of supported code block languages -* Header arguments:: Configure code block functionality -* Results of evaluation:: How evaluation results are handled -* Noweb reference syntax:: Literate programming in Org mode -* Key bindings and useful functions:: Work quickly with code blocks -* Batch execution:: Call functions from the command line - -Header arguments - -* Using header arguments:: Different ways to set header arguments -* Specific header arguments:: List of header arguments - -Using header arguments - -* System-wide header arguments:: Set globally, language-specific -* Language-specific header arguments:: Set in the Org file's headers -* Header arguments in Org mode properties:: Set in the Org file -* Language-specific mode properties:: -* Code block specific header arguments:: The most commonly used method -* Arguments in function calls:: The most specific level, takes highest priority - -Specific header arguments - -* var:: Pass arguments to `src' code blocks -* results:: Specify results type; how to collect -* file:: Specify a path for output file -* file-desc:: Specify a description for file results -* file-ext:: Specify an extension for file output -* output-dir:: Specify a directory for output file -* dir:: Specify the default directory for code block execution -* exports:: Specify exporting code, results, both, none -* tangle:: Toggle tangling; or specify file name -* mkdirp:: Toggle for parent directory creation for target files during tangling -* comments:: Toggle insertion of comments in tangled code files -* padline:: Control insertion of padding lines in tangled code files -* no-expand:: Turn off variable assignment and noweb expansion during tangling -* session:: Preserve the state of code evaluation -* noweb:: Toggle expansion of noweb references -* noweb-ref:: Specify block's noweb reference resolution target -* noweb-sep:: String to separate noweb references -* cache:: Avoid re-evaluating unchanged code blocks -* sep:: Delimiter for writing tabular results outside Org -* hlines:: Handle horizontal lines in tables -* colnames:: Handle column names in tables -* rownames:: Handle row names in tables -* shebang:: Make tangled files executable -* tangle-mode:: Set permission of tangled files -* eval:: Limit evaluation of specific code blocks -* wrap:: Mark source block evaluation results -* post:: Post processing of results of code block evaluation -* prologue:: Text to prepend to body of code block -* epilogue:: Text to append to body of code block - -Miscellaneous - -* Completion:: M-TAB guesses completions -* Easy templates:: Quick insertion of structural elements -* Speed keys:: Electric commands at the beginning of a headline -* Code evaluation security:: Org mode files evaluate inline code -* Customization:: Adapting Org to changing tastes -* In-buffer settings:: Overview of the #+KEYWORDS -* The very busy C-c C-c key:: When in doubt, press C-c C-c -* Clean view:: Getting rid of leading stars in the outline -* TTY keys:: Using Org on a tty -* Interaction:: With other Emacs packages -* org-crypt:: Encrypting Org files - -Interaction with other packages - -* Cooperation:: Packages Org cooperates with -* Conflicts:: Packages that lead to conflicts - -Hacking - -* Hooks:: How to reach into Org's internals -* Add-on packages:: Available extensions -* Adding hyperlink types:: New custom link types -* Adding export back-ends:: How to write new export back-ends -* Context-sensitive commands:: How to add functionality to such commands -* Tables in arbitrary syntax:: Orgtbl for LaTeX and other programs -* Dynamic blocks:: Automatically filled blocks -* Special agenda views:: Customized views -* Speeding up your agendas:: Tips on how to speed up your agendas -* Extracting agenda information:: Post-processing of agenda information -* Using the property API:: Writing programs that use entry properties -* Using the mapping API:: Mapping over all or selected entries - -Tables and lists in arbitrary syntax - -* Radio tables:: Sending and receiving radio tables -* A LaTeX example:: Step by step, almost a tutorial -* Translator functions:: Copy and modify -* Radio lists:: Sending and receiving lists - -MobileOrg - -* Setting up the staging area:: For the mobile device -* Pushing to MobileOrg:: Uploading Org files and agendas -* Pulling from MobileOrg:: Integrating captured and flagged items - - -File: org, Node: Introduction, Next: Document structure, Prev: Top, Up: Top - -1 Introduction -************** - -* Menu: - -* Summary:: Brief summary of what Org does -* Installation:: Installing Org -* Activation:: How to activate Org for certain buffers -* Feedback:: Bug reports, ideas, patches etc. -* Conventions:: Typesetting conventions in the manual - - -File: org, Node: Summary, Next: Installation, Up: Introduction - -1.1 Summary -=========== - -Org is a mode for keeping notes, maintaining TODO lists, and project -planning with a fast and effective plain-text system. It also is an -authoring system with unique support for literate programming and -reproducible research. - - Org is implemented on top of Outline mode, which makes it possible -to keep the content of large files well structured. Visibility cycling -and structure editing help to work with the tree. Tables are easily -created with a built-in table editor. Plain text URL-like links -connect to websites, emails, Usenet messages, BBDB entries, and any -files related to the projects. - - Org develops organizational tasks around notes files that contain -lists or information about projects as plain text. Project planning -and task management makes use of metadata which is part of an outline -node. Based on this data, specific entries can be extracted in queries -and create dynamic agenda views that also integrate the Emacs calendar -and diary. Org can be used to implement many different project -planning schemes, such as David Allen's GTD system. - - Org files can serve as a single source authoring system with export -to many different formats such as HTML, LaTeX, Open Document, and -Markdown. New export backends can be derived from existing ones, or -defined from scratch. - - Org files can include source code blocks, which makes Org uniquely -suited for authoring technical documents with code examples. Org -source code blocks are fully functional; they can be evaluated in place -and their results can be captured in the file. This makes it possible -to create a single file reproducible research compendium. - - Org keeps simple things simple. When first fired up, it should feel -like a straightforward, easy to use outliner. Complexity is not -imposed, but a large amount of functionality is available when needed. -Org is a toolbox. Many users actually run only a (very personal) -fraction of Org's capabilities, and know that there is more whenever -they need it. - - All of this is achieved with strictly plain text files, the most -portable and future-proof file format. Org runs in Emacs. Emacs is -one of the most widely ported programs, so that Org mode is available -on every major platform. - - There is a website for Org which provides links to the newest -version of Org, as well as additional information, frequently asked -questions (FAQ), links to tutorials, etc. This page is located at -`http://orgmode.org'. - - An earlier version (7.3) of this manual is available as a paperback -book from Network Theory Ltd. -(http://www.network-theory.co.uk/org/manual/) - - -File: org, Node: Installation, Next: Activation, Prev: Summary, Up: Introduction - -1.2 Installation -================ - -Org is part of recent distributions of GNU Emacs, so you normally don't -need to install it. If, for one reason or another, you want to install -Org on top of this pre-packaged version, there are three ways to do it: - - * By using Emacs package system. - - * By downloading Org as an archive. - - * By using Org's git repository. - - We strongly recommend to stick to a single installation method. - -Using Emacs packaging system -............................ - -Recent Emacs distributions include a packaging system which lets you -install Elisp libraries. You can install Org with `M-x package-install -RET org'. - -Important: you need to do this in a session where no `.org' file has -been visited, i.e., where no Org built-in function have been loaded. -Otherwise autoload Org functions will mess up the installation. - - Then, to make sure your Org configuration is taken into account, -initialize the package system with `(package-initialize)' in your Emacs -init file before setting any Org option. If you want to use Org's -package repository, check out the Org ELPA page -(http://orgmode.org/elpa.html). - -Downloading Org as an archive -............................. - -You can download Org latest release from Org's website -(http://orgmode.org/). In this case, make sure you set the load-path -correctly in your Emacs init file: - - (add-to-list 'load-path "~/path/to/orgdir/lisp") - - The downloaded archive contains contributed libraries that are not -included in Emacs. If you want to use them, add the `contrib' -directory to your load-path: - - (add-to-list 'load-path "~/path/to/orgdir/contrib/lisp" t) - - Optionally, you can compile the files and/or install them in your -system. Run `make help' to list compilation and installation options. - -Using Org's git repository -.......................... - -You can clone Org's repository and install Org like this: - - $ cd ~/src/ - $ git clone git://orgmode.org/org-mode.git - $ make autoloads - - Note that in this case, `make autoloads' is mandatory: it defines -Org's version in `org-version.el' and Org's autoloads in -`org-loaddefs.el'. - - Remember to add the correct load-path as described in the method -above. - - You can also compile with `make', generate the documentation with -`make doc', create a local configuration with `make config' and install -Org with `make install'. Please run `make help' to get the list of -compilation/installation options. - - For more detailed explanations on Org's build system, please check -the Org Build System page on Worg -(http://orgmode.org/worg/dev/org-build-system.html). - - -File: org, Node: Activation, Next: Feedback, Prev: Installation, Up: Introduction - -1.3 Activation -============== - -Org mode buffers need font-lock to be turned on: this is the default in -Emacs(1). - - There are compatibility issues between Org mode and some other Elisp -packages, please take the time to check the list (*note Conflicts::). - - The four Org commands `org-store-link', `org-capture', `org-agenda', -and `org-iswitchb' 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) - - Files with the `.org' extension use Org mode by default. To turn on -Org mode in a file that does not have the extension `.org', make the -first line of a file look like this: - - MY PROJECTS -*- mode: org; -*- - -which will select Org mode for this buffer no matter what the file's -name is. See also the variable `org-insert-mode-line-in-empty-file'. - - Many commands in Org work on the region if the region is active. To -make use of this, you need to have `transient-mark-mode' turned on, -which is the default. If you do not like `transient-mark-mode', you -can create an active region by using the mouse to select a region, or -pressing `C-' twice before moving the cursor. - - ---------- Footnotes ---------- - - (1) If you don't use font-lock globally, turn it on in Org buffer -with `(add-hook 'org-mode-hook 'turn-on-font-lock)' - - -File: org, Node: Feedback, Next: Conventions, Prev: Activation, Up: Introduction - -1.4 Feedback -============ - -If you find problems with Org, or if you have questions, remarks, or -ideas about it, please mail to the Org mailing list -. You can subscribe to the list on this web -page (https://lists.gnu.org/mailman/listinfo/emacs-orgmode). If you -are not a member of the mailing list, your mail will be passed to the -list after a moderator has approved it(1). - - For bug reports, please first try to reproduce the bug with the -latest version of Org available--if you are running an outdated -version, it is quite possible that the bug has been fixed already. If -the bug persists, prepare a report and provide as much information as -possible, including the version information of Emacs (`M-x -emacs-version ') and Org (`M-x org-version RET'), as well as the -Org related setup in the Emacs init file. The easiest way to do this -is to use the command - M-x org-submit-bug-report RET - which will put all this information into an Emacs mail buffer so -that you only need to add your description. If you are not sending the -Email from within Emacs, please copy and paste the content into your -Email program. - - Sometimes you might face a problem due to an error in your Emacs or -Org mode setup. Before reporting a bug, it is very helpful to start -Emacs with minimal customizations and reproduce the problem. Doing so -often helps you determine if the problem is with your customization or -with Org mode itself. You can start a typical minimal session with a -command like the example below. - - $ emacs -Q -l /path/to/minimal-org.el - - However if you are using Org mode as distributed with Emacs, a -minimal setup is not necessary. In that case it is sufficient to start -Emacs as `emacs -Q'. The `minimal-org.el' setup file can have contents -as shown below. - - ;;; Minimal setup to load latest 'org-mode' - - ;; activate debugging - (setq debug-on-error t - debug-on-signal nil - debug-on-quit nil) - - ;; add latest org-mode to load path - (add-to-list 'load-path "/path/to/org-mode/lisp") - (add-to-list 'load-path "/path/to/org-mode/contrib/lisp" t) - - If an error occurs, a backtrace can be very useful (see below on how -to create one). Often a small example file helps, along with clear -information about: - - 1. What exactly did you do? - - 2. What did you expect to happen? - - 3. What happened instead? - Thank you for helping to improve this program. - -How to create a useful backtrace -................................ - -If working with Org produces an error with a message you don't -understand, you may have hit a bug. The best way to report this is by -providing, in addition to what was mentioned above, a _backtrace_. -This is information from the built-in debugger about where and how the -error occurred. Here is how to produce a useful backtrace: - - 1. Reload uncompiled versions of all Org mode Lisp files. The - backtrace contains much more information if it is produced with - uncompiled code. To do this, use - C-u M-x org-reload RET - or select `Org -> Refresh/Reload -> Reload Org uncompiled' from the - menu. - - 2. Go to the `Options' menu and select `Enter Debugger on Error'. - - 3. Do whatever you have to do to hit the error. Don't forget to - document the steps you take. - - 4. When you hit the error, a `*Backtrace*' buffer will appear on the - screen. Save this buffer to a file (for example using `C-x C-w') - and attach it to your bug report. - - ---------- Footnotes ---------- - - (1) Please consider subscribing to the mailing list, in order to -minimize the work the mailing list moderators have to do. - - -File: org, Node: Conventions, Prev: Feedback, Up: Introduction - -1.5 Typesetting conventions used in this manual -=============================================== - -TODO keywords, tags, properties, etc. -..................................... - -Org mainly uses three types of keywords: TODO keywords, tags and -property names. In this manual we use the following conventions: - -`TODO' -`WAITING' - TODO keywords are written with all capitals, even if they are - user-defined. - -`boss' -`ARCHIVE' - User-defined tags are written in lowercase; built-in tags with - special meaning are written with all capitals. - -`Release' -`PRIORITY' - User-defined properties are capitalized; built-in properties with - special meaning are written with all capitals. - - Moreover, Org uses option keywords (like `#+TITLE' to set the title) -and environment keywords (like `#+BEGIN_EXPORT html' to start a `HTML' -environment). They are written in uppercase in the manual to enhance -its readability, but you can use lowercase in your Org file. - -Key bindings and commands -......................... - -The manual suggests a few global key bindings, in particular `C-c a' for -`org-agenda' and `C-c c' for `org-capture'. These are only -suggestions, but the rest of the manual assumes that these key bindings -are in place in order to list commands by key access. - - Also, the manual lists both the keys and the corresponding commands -for accessing a functionality. Org mode often uses the same key for -different functions, depending on context. The command that is bound -to such keys has a generic name, like `org-metaright'. In the manual -we will, wherever possible, give the function that is internally called -by the generic command. For example, in the chapter on document -structure, `M-' will be listed to call `org-do-demote', while in -the chapter on tables, it will be listed to call -`org-table-move-column-right'. If you prefer, you can compile the -manual without the command names by unsetting the flag `cmdnames' in -`org.texi'. - - -File: org, Node: Document structure, Next: Tables, Prev: Introduction, Up: Top - -2 Document structure -******************** - -Org is based on Outline mode and provides flexible commands to edit the -structure of the document. - -* Menu: - -* Outlines:: Org is based on Outline mode -* Headlines:: How to typeset Org tree headlines -* Visibility cycling:: Show and hide, much simplified -* Motion:: Jumping to other headlines -* Structure editing:: Changing sequence and level of headlines -* Sparse trees:: Matches embedded in context -* Plain lists:: Additional structure within an entry -* Drawers:: Tucking stuff away -* Blocks:: Folding blocks -* Footnotes:: How footnotes are defined in Org's syntax -* Orgstruct mode:: Structure editing outside Org -* Org syntax:: Formal description of Org's syntax - - -File: org, Node: Outlines, Next: Headlines, Up: Document structure - -2.1 Outlines -============ - -Org is implemented on top of Outline mode. Outlines allow a document -to be organized in a hierarchical structure, which (at least for me) is -the best representation of notes and thoughts. An overview of this -structure is achieved by folding (hiding) large parts of the document -to show only the general document structure and the parts currently -being worked on. Org greatly simplifies the use of outlines by -compressing the entire show/hide functionality into a single command, -`org-cycle', which is bound to the key. - - -File: org, Node: Headlines, Next: Visibility cycling, Prev: Outlines, Up: Document structure - -2.2 Headlines -============= - -Headlines define the structure of an outline tree. The headlines in Org -start with one or more stars, on the left margin(1) (2). For example: - - * Top level headline - ** Second level - *** 3rd level - some text - *** 3rd level - more text - - * Another top level headline - -Note that a headline named after `org-footnote-section', which defaults -to `Footnotes', is considered as special. A subtree with this headline -will be silently ignored by exporting functions. - - Some people find the many stars too noisy and would prefer an -outline that has whitespace followed by a single star as headline -starters. *note Clean view::, describes a setup to realize this. - - An empty line after the end of a subtree is considered part of it and -will be hidden when the subtree is folded. However, if you leave at -least two empty lines, one empty line will remain visible after folding -the subtree, in order to structure the collapsed view. See the -variable `org-cycle-separator-lines' to modify this behavior. - - ---------- Footnotes ---------- - - (1) See the variables `org-special-ctrl-a/e', `org-special-ctrl-k', -and `org-ctrl-k-protect-subtree' to configure special behavior of `C-a', -`C-e', and `C-k' in headlines. - - (2) Clocking only works with headings indented less than 30 stars. - - -File: org, Node: Visibility cycling, Next: Motion, Prev: Headlines, Up: Document structure - -2.3 Visibility cycling -====================== - -* Menu: - -* Global and local cycling:: Cycling through various visibility states -* Initial visibility:: Setting the initial visibility state -* Catching invisible edits:: Preventing mistakes when editing invisible parts - - -File: org, Node: Global and local cycling, Next: Initial visibility, Up: Visibility cycling - -2.3.1 Global and local cycling ------------------------------- - -Outlines make it possible to hide parts of the text in the buffer. Org -uses just two commands, bound to and `S-' to change the -visibility in the buffer. - -`' (`org-cycle') - _Subtree cycling_: Rotate current subtree among the states - - ,-> FOLDED -> CHILDREN -> SUBTREE --. - '-----------------------------------' - - The cursor must be on a headline for this to work(1). - -`S-' (`org-global-cycle') -C-u - _Global cycling_: Rotate the entire buffer among the states - - ,-> OVERVIEW -> CONTENTS -> SHOW ALL --. - '--------------------------------------' - - When `S-' is called with a numeric prefix argument N, the - CONTENTS view up to headlines of level N will be shown. Note that - inside tables, `S-' jumps to the previous field. - - You can run global cycling using only if point is at the very - beginning of the buffer, but not on a headline, and - `org-cycle-global-at-bob' is set to a non-`nil' value. - -`C-u C-u ' (`org-set-startup-visibility') - Switch back to the startup visibility of the buffer (*note Initial - visibility::). - -`C-u C-u C-u ' (`outline-show-all') - Show all, including drawers. - -`C-c C-r' (`org-reveal') - Reveal context around point, showing the current entry, the - following heading and the hierarchy above. Useful for working - near a location that has been exposed by a sparse tree command - (*note Sparse trees::) or an agenda command (*note Agenda - commands::). With a prefix argument show, on each level, all - sibling headings. With a double prefix argument, also show the - entire subtree of the parent. - -`C-c C-k' (`outline-show-branches') - Expose all the headings of the subtree, CONTENT view for just one - subtree. - -`C-c ' (`outline-show-children') - Expose all direct children of the subtree. With a numeric prefix - argument N, expose all children down to level N. - -`C-c C-x b' (`org-tree-to-indirect-buffer') - Show the current subtree in an indirect buffer(2). With a numeric - prefix argument N, go up to level N and then take that tree. If N - is negative then go up that many levels. With a `C-u' prefix, do - not remove the previously used indirect buffer. - -`C-c C-x v' (`org-copy-visible') - Copy the visible text in the region into the kill ring. - - ---------- Footnotes ---------- - - (1) see, however, the option `org-cycle-emulate-tab'. - - (2) The indirect buffer (*note Indirect Buffers: (emacs)Indirect -Buffers.) will contain the entire buffer, but will be narrowed to the -current tree. Editing the indirect buffer will also change the -original buffer, but without affecting visibility in that buffer. - - -File: org, Node: Initial visibility, Next: Catching invisible edits, Prev: Global and local cycling, Up: Visibility cycling - -2.3.2 Initial visibility ------------------------- - -When Emacs first visits an Org file, the global state is set to -OVERVIEW, i.e., only the top level headlines are visible(1). This can -be configured through the variable `org-startup-folded', or on a -per-file basis by adding one of the following lines anywhere in the -buffer: - - #+STARTUP: overview - #+STARTUP: content - #+STARTUP: showall - #+STARTUP: showeverything - -Furthermore, any entries with a `VISIBILITY' property (*note Properties -and columns::) will get their visibility adapted accordingly. Allowed -values for this property are `folded', `children', `content', and `all'. - -`C-u C-u ' (`org-set-startup-visibility') - Switch back to the startup visibility of the buffer, i.e., - whatever is requested by startup options and `VISIBILITY' - properties in individual entries. - - ---------- Footnotes ---------- - - (1) When `org-agenda-inhibit-startup' is non-`nil', Org will not -honor the default visibility state when first opening a file for the -agenda (*note Speeding up your agendas::). - - -File: org, Node: Catching invisible edits, Prev: Initial visibility, Up: Visibility cycling - -2.3.3 Catching invisible edits ------------------------------- - -Sometimes you may inadvertently edit an invisible part of the buffer -and be confused on what has been edited and how to undo the mistake. -Setting `org-catch-invisible-edits' to non-`nil' will help prevent -this. See the docstring of this option on how Org should catch -invisible edits and process them. - - -File: org, Node: Motion, Next: Structure editing, Prev: Visibility cycling, Up: Document structure - -2.4 Motion -========== - -The following commands jump to other headlines in the buffer. - -`C-c C-n' (`org-next-visible-heading') - Next heading. - -`C-c C-p' (`org-previous-visible-heading') - Previous heading. - -`C-c C-f' (`org-forward-same-level') - Next heading same level. - -`C-c C-b' (`org-backward-same-level') - Previous heading same level. - -`C-c C-u' (`outline-up-heading') - Backward to higher level heading. - -`C-c C-j' (`org-goto') - Jump to a different place without changing the current outline - visibility. Shows the document structure in a temporary buffer, - where you can use the following keys to find your destination: - Cycle visibility. - / Next/previous visible headline. - Select this location. - / Do a Sparse-tree search - The following keys work if you turn off `org-goto-auto-isearch' - n / p Next/previous visible headline. - f / b Next/previous headline same level. - u One level up. - 0-9 Digit argument. - q Quit - See also the option `org-goto-interface'. - - -File: org, Node: Structure editing, Next: Sparse trees, Prev: Motion, Up: Document structure - -2.5 Structure editing -===================== - -`M-' (`org-meta-return') - Insert a new heading, item or row. - - If the command is used at the _beginning_ of a line, and if there - is a heading or a plain list item (*note Plain lists::) at point, - the new heading/item is created _before_ the current line. When - used at the beginning of a regular line of text, turn that line - into a heading. - - When this command is used in the middle of a line, the line is - split and the rest of the line becomes the new item or headline. - If you do not want the line to be split, customize - `org-M-RET-may-split-line'. - - Calling the command with a `C-u' prefix unconditionally inserts a - new heading at the end of the current subtree, thus preserving its - contents. With a double `C-u C-u' prefix, the new heading is - created at the end of the parent subtree instead. - -`C-' (`org-insert-heading-respect-content') - Insert a new heading at the end of the current subtree. - -`M-S-' (`org-insert-todo-heading') - Insert new TODO entry with same level as current heading. See - also the variable `org-treat-insert-todo-heading-as-state-change'. - -`C-S-' (`org-insert-todo-heading-respect-content') - Insert new TODO entry with same level as current heading. Like - `C-', the new headline will be inserted after the current - subtree. - -`' (`org-cycle') - In a new entry with no text yet, the first demotes the entry - to become a child of the previous one. The next makes it a - parent, and so on, all the way to top level. Yet another , - and you are back to the initial level. - -`M-' (`org-do-promote') - Promote current heading by one level. - -`M-' (`org-do-demote') - Demote current heading by one level. - -`M-S-' (`org-promote-subtree') - Promote the current subtree by one level. - -`M-S-' (`org-demote-subtree') - Demote the current subtree by one level. - -`M-' (`org-move-subtree-up') - Move subtree up (swap with previous subtree of same level). - -`M-' (`org-move-subtree-down') - Move subtree down (swap with next subtree of same level). - -`M-h' (`org-mark-element') - Mark the element at point. Hitting repeatedly will mark - subsequent elements of the one just marked. E.g., hitting - on a paragraph will mark it, hitting immediately again will - mark the next one. - -`C-c @' (`org-mark-subtree') - Mark the subtree at point. Hitting repeatedly will mark - subsequent subtrees of the same level than the marked subtree. - -`C-c C-x C-w' (`org-cut-subtree') - Kill subtree, i.e., remove it from buffer but save in kill ring. - With a numeric prefix argument N, kill N sequential subtrees. - -`C-c C-x M-w' (`org-copy-subtree') - Copy subtree to kill ring. With a numeric prefix argument N, copy - the N sequential subtrees. - -`C-c C-x C-y' (`org-paste-subtree') - Yank subtree from kill ring. This does modify the level of the - subtree to make sure the tree fits in nicely at the yank position. - The yank level can also be specified with a numeric prefix - argument, or by yanking after a headline marker like `****'. - -`C-y' (`org-yank') - Depending on the options `org-yank-adjusted-subtrees' and - `org-yank-folded-subtrees', Org's internal `yank' command will - paste subtrees folded and in a clever way, using the same command - as `C-c C-x C-y'. With the default settings, no level adjustment - will take place, but the yanked tree will be folded unless doing - so would swallow text previously visible. Any prefix argument to - this command will force a normal `yank' to be executed, with the - prefix passed along. A good way to force a normal yank is `C-u - C-y'. If you use `yank-pop' after a yank, it will yank previous - kill items plainly, without adjustment and folding. - -`C-c C-x c' (`org-clone-subtree-with-time-shift') - Clone a subtree by making a number of sibling copies of it. You - will be prompted for the number of copies to make, and you can - also specify if any timestamps in the entry should be shifted. - This can be useful, for example, to create a number of tasks - related to a series of lectures to prepare. For more details, see - the docstring of the command `org-clone-subtree-with-time-shift'. - -`C-c C-w' (`org-refile') - Refile entry or region to a different location. *Note Refile and - copy::. - -`C-c ^' (`org-sort') - Sort same-level entries. When there is an active region, all - entries in the region will be sorted. Otherwise the children of - the current headline are sorted. The command prompts for the - sorting method, which can be alphabetically, numerically, by time - (first timestamp with active preferred, creation time, scheduled - time, deadline time), by priority, by TODO keyword (in the - sequence the keywords have been defined in the setup) or by the - value of a property. Reverse sorting is possible as well. You - can also supply your own function to extract the sorting key. - With a `C-u' prefix, sorting will be case-sensitive. - -`C-x n s' (`org-narrow-to-subtree') - Narrow buffer to current subtree. - -`C-x n b' (`org-narrow-to-block') - Narrow buffer to current block. - -`C-x n w' (`widen') - Widen buffer to remove narrowing. - -`C-c *' (`org-toggle-heading') - Turn a normal line or plain list item into a headline (so that it - becomes a subheading at its location). Also turn a headline into - a normal line by removing the stars. If there is an active - region, turn all lines in the region into headlines. If the first - line in the region was an item, turn only the item lines into - headlines. Finally, if the first line is a headline, remove the - stars from all headlines in the region. - - When there is an active region (Transient Mark mode), promotion and -demotion work on all headlines in the region. To select a region of -headlines, it is best to place both point and mark at the beginning of a -line, mark at the beginning of the first headline, and point at the line -just after the last headline to change. Note that when the cursor is -inside a table (*note Tables::), the Meta-Cursor keys have different -functionality. - - -File: org, Node: Sparse trees, Next: Plain lists, Prev: Structure editing, Up: Document structure - -2.6 Sparse trees -================ - -An important feature of Org mode is the ability to construct _sparse -trees_ for selected information in an outline tree, so that the entire -document is folded as much as possible, but the selected information is -made visible along with the headline structure above it(1). Just try -it out and you will see immediately how it works. - - Org mode contains several commands for creating such trees, all these -commands can be accessed through a dispatcher: - -`C-c /' (`org-sparse-tree') - This prompts for an extra key to select a sparse-tree creating - command. - -`C-c / r' or `C-c / /' (`org-occur') - Prompts for a regexp and shows a sparse tree with all matches. If - the match is in a headline, the headline is made visible. If the - match is in the body of an entry, headline and body are made - visible. In order to provide minimal context, also the full - hierarchy of headlines above the match is shown, as well as the - headline following the match. Each match is also highlighted; the - highlights disappear when the buffer is changed by an editing - command(2), or by pressing `C-c C-c'. When called with a `C-u' - prefix argument, previous highlights are kept, so several calls to - this command can be stacked. - -`M-g n' or `M-g M-n' (`next-error') - Jump to the next sparse tree match in this buffer. - -`M-g p' or `M-g M-p' (`previous-error') - Jump to the previous sparse tree match in this buffer. - -For frequently used sparse trees of specific search strings, you can -use the option `org-agenda-custom-commands' to define fast keyboard -access to specific sparse trees. These commands will then be -accessible through the agenda dispatcher (*note Agenda dispatcher::). -For example: - - (setq org-agenda-custom-commands - '(("f" occur-tree "FIXME"))) - -will define the key `C-c a f' as a shortcut for creating a sparse tree -matching the string `FIXME'. - - The other sparse tree commands select headings based on TODO -keywords, tags, or properties and will be discussed later in this -manual. - - To print a sparse tree, you can use the Emacs command -`ps-print-buffer-with-faces' which does not print invisible parts of the -document. Or you can use `C-c C-e C-v' to export only the visible part -of the document and print the resulting file. - - ---------- Footnotes ---------- - - (1) See also the variable `org-show-context-detail' to decide how -much context is shown around each match. - - (2) This depends on the option `org-remove-highlights-with-change' - - -File: org, Node: Plain lists, Next: Drawers, Prev: Sparse trees, Up: Document structure - -2.7 Plain lists -=============== - -Within an entry of the outline tree, hand-formatted lists can provide -additional structure. They also provide a way to create lists of -checkboxes (*note Checkboxes::). Org supports editing such lists, and -every exporter (*note Exporting::) can parse and format them. - - Org knows ordered lists, unordered lists, and description lists. - * _Unordered_ list items start with `-', `+', or `*'(1) as bullets. - - * _Ordered_ list items start with a numeral followed by either a - period or a right parenthesis(2), such as `1.' or `1)'(3). If you - want a list to start with a different value (e.g., 20), start the - text of the item with `[@20]'(4). Those constructs can be used in - any item of the list in order to enforce a particular numbering. - - * _Description_ list items are unordered list items, and contain the - separator ` :: ' to distinguish the description _term_ from the - description. - - Items belonging to the same list must have the same indentation on -the first line. In particular, if an ordered list reaches number -`10.', then the 2-digit numbers must be written left-aligned with the -other numbers in the list. An item ends before the next line that is -less or equally indented than its bullet/number. - - A list ends whenever every item has ended, which means before any -line less or equally indented than items at top level. It also ends -before two blank lines. In that case, all items are closed. Here is -an example: - - ** Lord of the Rings - My favorite scenes are (in this order) - 1. The attack of the Rohirrim - 2. Eowyn's fight with the witch king - + this was already my favorite scene in the book - + I really like Miranda Otto. - 3. Peter Jackson being shot by Legolas - - on DVD only - He makes a really funny face when it happens. - But in the end, no individual scenes matter but the film as a whole. - Important actors in this film are: - - Elijah Wood :: He plays Frodo - - Sean Astin :: He plays Sam, Frodo's friend. I still remember - him very well from his role as Mikey Walsh in The Goonies. - - Org supports these lists by tuning filling and wrapping commands to -deal with them correctly, and by exporting them properly (*note -Exporting::). Since indentation is what governs the structure of these -lists, many structural constructs like `#+BEGIN_...' blocks can be -indented to signal that they belong to a particular item. - - If you find that using a different bullet for a sub-list (than that -used for the current list-level) improves readability, customize the -variable `org-list-demote-modify-bullet'. To get a greater difference -of indentation between items and their sub-items, customize -`org-list-indent-offset'. - - The following commands act on items when the cursor is in the first -line of an item (the line with the bullet or number). Some of them -imply the application of automatic rules to keep list structure intact. -If some of these actions get in your way, configure -`org-list-automatic-rules' to disable them individually. - -`' (`org-cycle') - Items can be folded just like headline levels. Normally this - works only if the cursor is on a plain list item. For more - details, see the variable `org-cycle-include-plain-lists'. If - this variable is set to `integrate', plain list items will be - treated like low-level headlines. The level of an item is then - given by the indentation of the bullet/number. Items are always - subordinate to real headlines, however; the hierarchies remain - completely separated. In a new item with no text yet, the first - demotes the item to become a child of the previous one. - Subsequent s move the item to meaningful levels in the list - and eventually get it back to its initial position. - -`M-' (`org-insert-heading') - Insert new item at current level. With a prefix argument, force a - new heading (*note Structure editing::). If this command is used - in the middle of an item, that item is _split_ in two, and the - second part becomes the new item(5). If this command is executed - _before item's body_, the new item is created _before_ the current - one. - -`M-S-' - Insert a new item with a checkbox (*note Checkboxes::). - -`S-up' -`S-down' - Jump to the previous/next item in the current list(6), but only if - `org-support-shift-select' is off. If not, you can still use - paragraph jumping commands like `C-' and `C-' to quite - similar effect. - -`M-up' -`M-down' - Move the item including subitems up/down(7) (swap with - previous/next item of same indentation). If the list is ordered, - renumbering is automatic. - -`M-left' -`M-right' - Decrease/increase the indentation of an item, leaving children - alone. - -`M-S-' -`M-S-' - Decrease/increase the indentation of the item, including subitems. - Initially, the item tree is selected based on current indentation. - When these commands are executed several times in direct - succession, the initially selected region is used, even if the new - indentation would imply a different hierarchy. To use the new - hierarchy, break the command chain with a cursor motion or so. - - As a special case, using this command on the very first item of a - list will move the whole list. This behavior can be disabled by - configuring `org-list-automatic-rules'. The global indentation of - a list has no influence on the text _after_ the list. - -`C-c C-c' - If there is a checkbox (*note Checkboxes::) in the item line, - toggle the state of the checkbox. In any case, verify bullets and - indentation consistency in the whole list. - -`C-c -' - Cycle the entire list level through the different - itemize/enumerate bullets (`-', `+', `*', `1.', `1)') or a subset - of them, depending on `org-plain-list-ordered-item-terminator', - the type of list, and its indentation. With a numeric prefix - argument N, select the Nth bullet from this list. If there is an - active region when calling this, all selected lines are converted - to list items. With a prefix argument, selected text is changed - into a single item. If the first line already was a list item, any - item marker will be removed from the list. Finally, even without - an active region, a normal line will be converted into a list item. - -`C-c *' - Turn a plain list item into a headline (so that it becomes a - subheading at its location). *Note Structure editing::, for a - detailed explanation. - -`C-c C-*' - Turn the whole plain list into a subtree of the current heading. - Checkboxes (*note Checkboxes::) will become TODO (resp. DONE) - keywords when unchecked (resp. checked). - -`S-left/right' - This command also cycles bullet styles when the cursor in on the - bullet or anywhere in an item line, details depending on - `org-support-shift-select'. - -`C-c ^' - Sort the plain list. You will be prompted for the sorting method: - numerically, alphabetically, by time, by checked status for check - lists, or by a custom function. - - ---------- Footnotes ---------- - - (1) When using `*' as a bullet, lines must be indented or they will -be seen as top-level headlines. Also, when you are hiding leading -stars to get a clean outline view, plain list items starting with a -star may be hard to distinguish from true headlines. In short: even -though `*' is supported, it may be better to not use it for plain list -items. - - (2) You can filter out any of them by configuring -`org-plain-list-ordered-item-terminator'. - - (3) You can also get `a.', `A.', `a)' and `A)' by configuring -`org-list-allow-alphabetical'. To minimize confusion with normal text, -those are limited to one character only. Beyond that limit, bullets -will automatically fallback to numbers. - - (4) If there's a checkbox in the item, the cookie must be put -_before_ the checkbox. If you have activated alphabetical lists, you -can also use counters like `[@b]'. - - (5) If you do not want the item to be split, customize the variable -`org-M-RET-may-split-line'. - - (6) If you want to cycle around items that way, you may customize -`org-list-use-circular-motion'. - - (7) See `org-list-use-circular-motion' for a cyclic behavior. - - -File: org, Node: Drawers, Next: Blocks, Prev: Plain lists, Up: Document structure - -2.8 Drawers -=========== - -Sometimes you want to keep information associated with an entry, but you -normally don't want to see it. For this, Org mode has _drawers_. They -can contain anything but a headline and another drawer. Drawers look -like this: - - ** This is a headline - Still outside the drawer - :DRAWERNAME: - This is inside the drawer. - :END: - After the drawer. - - You can interactively insert drawers at point by calling -`org-insert-drawer', which is bound to . With an active -region, this command will put the region inside the drawer. With a -prefix argument, this command calls `org-insert-property-drawer' and add -a property drawer right below the current headline. Completion over -drawer keywords is also possible using `M-'(1). - - Visibility cycling (*note Visibility cycling::) on the headline will -hide and show the entry, but keep the drawer collapsed to a single -line. In order to look inside the drawer, you need to move the cursor -to the drawer line and press there. Org mode uses the -`PROPERTIES' drawer for storing properties (*note Properties and -columns::), and you can also arrange for state change notes (*note -Tracking TODO state changes::) and clock times (*note Clocking work -time::) to be stored in a drawer `LOGBOOK'. If you want to store a -quick note in the LOGBOOK drawer, in a similar way to state changes, use - -`C-c C-z' - Add a time-stamped note to the LOGBOOK drawer. - - You can select the name of the drawers which should be exported with -`org-export-with-drawers'. In that case, drawer contents will appear in -export output. Property drawers are not affected by this variable: -configure `org-export-with-properties' instead. - - ---------- Footnotes ---------- - - (1) Many desktops intercept `M-' to switch windows. Use -`C-M-i' or ` ' instead for completion (*note Completion::). - - -File: org, Node: Blocks, Next: Footnotes, Prev: Drawers, Up: Document structure - -2.9 Blocks -========== - -Org mode uses begin...end blocks for various purposes from including -source code examples (*note Literal examples::) to capturing time -logging information (*note Clocking work time::). These blocks can be -folded and unfolded by pressing TAB in the begin line. You can also -get all blocks folded at startup by configuring the option -`org-hide-block-startup' or on a per-file basis by using - - #+STARTUP: hideblocks - #+STARTUP: nohideblocks - - -File: org, Node: Footnotes, Next: Orgstruct mode, Prev: Blocks, Up: Document structure - -2.10 Footnotes -============== - -Org mode supports the creation of footnotes. - - A footnote is started by a footnote marker in square brackets in -column 0, no indentation allowed. It ends at the next footnote -definition, headline, or after two consecutive empty lines. The -footnote reference is simply the marker in square brackets, inside -text. Markers always start with `fn:'. For example: - - The Org homepage[fn:1] now looks a lot better than it used to. - ... - [fn:1] The link is: http://orgmode.org - - Org mode extends the number-based syntax to _named_ footnotes and -optional inline definition. Here are the valid references: - -`[fn:name]' - A named footnote reference, where `name' is a unique label word, - or, for simplicity of automatic creation, a number. - -`[fn::This is the inline definition of this footnote]' - A LaTeX-like anonymous footnote where the definition is given - directly at the reference point. - -`[fn:name:a definition]' - An inline definition of a footnote, which also specifies a name - for the note. Since Org allows multiple references to the same - note, you can then use `[fn:name]' to create additional references. - - Footnote labels can be created automatically, or you can create -names yourself. This is handled by the variable -`org-footnote-auto-label' and its corresponding `#+STARTUP' keywords. -See the docstring of that variable for details. - -The following command handles footnotes: - -`C-c C-x f' - The footnote action command. - - When the cursor is on a footnote reference, jump to the - definition. When it is at a definition, jump to the (first) - reference. - - Otherwise, create a new footnote. Depending on the option - `org-footnote-define-inline'(1), the definition will be placed - right into the text as part of the reference, or separately into - the location determined by the option `org-footnote-section'. - - When this command is called with a prefix argument, a menu of - additional options is offered: - s Sort the footnote definitions by reference sequence. During editing, - Org makes no effort to sort footnote definitions into a particular - sequence. If you want them sorted, use this command, which will - also move entries according to `org-footnote-section'. Automatic - sorting after each insertion/deletion can be configured using the - option `org-footnote-auto-adjust'. - r Renumber the simple `fn:N' footnotes. Automatic renumbering - after each insertion/deletion can be configured using the option - `org-footnote-auto-adjust'. - S Short for first `r', then `s' action. - n Normalize the footnotes by collecting all definitions (including - inline definitions) into a special section, and then numbering them - in sequence. The references will then also be numbers. - d Delete the footnote at point, and all definitions of and references - to it. - Depending on the variable `org-footnote-auto-adjust'(2), - renumbering and sorting footnotes can be automatic after each - insertion or deletion. - -`C-c C-c' - If the cursor is on a footnote reference, jump to the definition. - If it is a the definition, jump back to the reference. When - called at a footnote location with a prefix argument, offer the - same menu as `C-c C-x f'. - -`C-c C-o or mouse-1/2' - Footnote labels are also links to the corresponding - definition/reference, and you can use the usual commands to follow - these links. - -`C-c '' - -`C-c '' - Edit the footnote definition corresponding to the reference at - point in a separate window. The window can be closed by pressing - `C-c ''. - - - ---------- Footnotes ---------- - - (1) The corresponding in-buffer setting is: `#+STARTUP: fninline' or -`#+STARTUP: nofninline' - - (2) the corresponding in-buffer options are `fnadjust' and -`nofnadjust'. - - -File: org, Node: Orgstruct mode, Next: Org syntax, Prev: Footnotes, Up: Document structure - -2.11 The Orgstruct minor mode -============================= - -If you like the intuitive way the Org mode structure editing and list -formatting works, you might want to use these commands in other modes -like Text mode or Mail mode as well. The minor mode `orgstruct-mode' -makes this possible. Toggle the mode with `M-x orgstruct-mode RET', or -turn it on by default, for example in Message mode, with one of: - - (add-hook 'message-mode-hook 'turn-on-orgstruct) - (add-hook 'message-mode-hook 'turn-on-orgstruct++) - - When this mode is active and the cursor is on a line that looks to -Org like a headline or the first line of a list item, most structure -editing commands will work, even if the same keys normally have -different functionality in the major mode you are using. If the cursor -is not in one of those special lines, Orgstruct mode lurks silently in -the shadows. - - When you use `orgstruct++-mode', Org will also export indentation and -autofill settings into that mode, and detect item context after the -first line of an item. - - You can also use Org structure editing to fold and unfold headlines -in _any_ file, provided you defined `orgstruct-heading-prefix-regexp': -the regular expression must match the local prefix to use before Org's -headlines. For example, if you set this variable to `";; "' in Emacs -Lisp files, you will be able to fold and unfold headlines in Emacs Lisp -commented lines. Some commands like `org-demote' are disabled when the -prefix is set, but folding/unfolding will work correctly. - - -File: org, Node: Org syntax, Prev: Orgstruct mode, Up: Document structure - -2.12 Org syntax -=============== - -A reference document providing a formal description of Org's syntax is -available as a draft on Worg -(http://orgmode.org/worg/dev/org-syntax.html), written and maintained -by Nicolas Goaziou. It defines Org's core internal concepts such as -`headlines', `sections', `affiliated keywords', `(greater) elements' -and `objects'. Each part of an Org file falls into one of the -categories above. - - To explore the abstract structure of an Org buffer, run this in a -buffer: - - M-: (org-element-parse-buffer) RET - - It will output a list containing the buffer's content represented as -an abstract structure. The export engine relies on the information -stored in this list. Most interactive commands (e.g., for structure -editing) also rely on the syntactic meaning of the surrounding context. - - You can check syntax in your documents using `org-lint' command. - - -File: org, Node: Tables, Next: Hyperlinks, Prev: Document structure, Up: Top - -3 Tables -******** - -Org comes with a fast and intuitive table editor. Spreadsheet-like -calculations are supported using the Emacs `calc' package (*note Calc: -(calc)Top.). - -* Menu: - -* Built-in table editor:: Simple tables -* Column width and alignment:: Overrule the automatic settings -* Column groups:: Grouping to trigger vertical lines -* Orgtbl mode:: The table editor as minor mode -* The spreadsheet:: The table editor has spreadsheet capabilities -* Org-Plot:: Plotting from org tables - - -File: org, Node: Built-in table editor, Next: Column width and alignment, Up: Tables - -3.1 The built-in table editor -============================= - -Org makes it easy to format tables in plain ASCII. Any line with `|' as -the first non-whitespace character is considered part of a table. `|' -is also the column separator(1). A table might look like this: - - | Name | Phone | Age | - |-------+-------+-----| - | Peter | 1234 | 17 | - | Anna | 4321 | 25 | - - A table is re-aligned automatically each time you press or - or `C-c C-c' inside the table. also moves to the next -field ( to the next row) and creates new table rows at the end of -the table or before horizontal lines. The indentation of the table is -set by the first line. Any line starting with `|-' is considered as a -horizontal separator line and will be expanded on the next re-align to -span the whole table width. So, to create the above table, you would -only type - - |Name|Phone|Age| - |- - -and then press to align the table and start filling in fields. -Even faster would be to type `|Name|Phone|Age' followed by `C-c '. - - When typing text into a field, Org treats , , and all -character keys in a special way, so that inserting and deleting avoids -shifting other fields. Also, when typing _immediately after the cursor -was moved into a new field with `', `S-' or `'_, the -field is automatically made blank. If this behavior is too -unpredictable for you, configure the option -`org-table-auto-blank-field'. - -Creation and conversion -....................... - -`C-c | (`org-table-create-or-convert-from-region')' - Convert the active region to a table. If every line contains at - least one TAB character, the function assumes that the material is - tab separated. If every line contains a comma, comma-separated - values (CSV) are assumed. If not, lines are split at whitespace - into fields. You can use a prefix argument to force a specific - separator: `C-u' forces CSV, `C-u C-u' forces TAB, `C-u C-u C-u' - will prompt for a regular expression to match the separator, and a - numeric argument N indicates that at least N consecutive spaces, - or alternatively a TAB will be the separator. - If there is no active region, this command creates an empty Org - table. But it is easier just to start typing, like - `|Name|Phone|Age |- '. - -Re-aligning and field motion -............................ - -`C-c C-c (`org-table-align')' - Re-align the table and don't move to another field. - -`C-c SPC (`org-table-blank-field')' - Blank the field at point. - -`TAB (`org-table-next-field')' - Re-align the table, move to the next field. Creates a new row if - necessary. - -`S- (`org-table-previous-field')' - Re-align, move to previous field. - -` (`org-table-next-row')' - Re-align the table and move down to next row. Creates a new row if - necessary. At the beginning or end of a line, still does - NEWLINE, so it can be used to split a table. - -`M-a (`org-table-beginning-of-field')' - Move to beginning of the current table field, or on to the - previous field. - -`M-e (`org-table-end-of-field')' - Move to end of the current table field, or on to the next field. - -Column and row editing -...................... - -`M- (`org-table-move-column-left')' -`M- (`org-table-move-column-right')' - Move the current column left/right. - -`M-S- (`org-table-delete-column')' - Kill the current column. - -`M-S- (`org-table-insert-column')' - Insert a new column to the left of the cursor position. - -`M- (`org-table-move-row-up')' -`M- (`org-table-move-row-down')' - Move the current row up/down. - -`M-S- (`org-table-kill-row')' - Kill the current row or horizontal line. - -`M-S- (`org-table-insert-row')' - Insert a new row above the current row. With a prefix argument, - the line is created below the current one. - -`C-c - (`org-table-insert-hline')' - Insert a horizontal line below current row. With a prefix - argument, the line is created above the current line. - -`C-c (`org-table-hline-and-move')' - Insert a horizontal line below current row, and move the cursor - into the row below that line. - -`C-c ^ (`org-table-sort-lines')' - Sort the table lines in the region. The position of point - indicates the column to be used for sorting, and the range of - lines is the range between the nearest horizontal separator lines, - or the entire table. If point is before the first column, you - will be prompted for the sorting column. If there is an active - region, the mark specifies the first line and the sorting column, - while point should be in the last line to be included into the - sorting. The command prompts for the sorting type - (alphabetically, numerically, or by time). You can sort in normal - or reverse order. You can also supply your own key extraction and - comparison functions. When called with a prefix argument, - alphabetic sorting will be case-sensitive. - -Regions -....... - -`C-c C-x M-w (`org-table-copy-region')' - Copy a rectangular region from a table to a special clipboard. - Point and mark determine edge fields of the rectangle. If there - is no active region, copy just the current field. The process - ignores horizontal separator lines. - -`C-c C-x C-w (`org-table-cut-region')' - Copy a rectangular region from a table to a special clipboard, and - blank all fields in the rectangle. So this is the "cut" operation. - -`C-c C-x C-y (`org-table-paste-rectangle')' - Paste a rectangular region into a table. The upper left corner - ends up in the current field. All involved fields will be - overwritten. If the rectangle does not fit into the present table, - the table is enlarged as needed. The process ignores horizontal - separator lines. - -`M- (`org-table-wrap-region')' - Split the current field at the cursor position and move the rest - to the line below. If there is an active region, and both point - and mark are in the same column, the text in the column is wrapped - to minimum width for the given number of lines. A numeric prefix - argument may be used to change the number of desired lines. If - there is no region, but you specify a prefix argument, the current - field is made blank, and the content is appended to the field - above. - -Calculations -............ - -`C-c + (`org-table-sum')' - Sum the numbers in the current column, or in the rectangle defined - by the active region. The result is shown in the echo area and can - be inserted with `C-y'. - -`S- (`org-table-copy-down')' - When current field is empty, copy from first non-empty field - above. When not empty, copy current field down to next row and - move cursor along with it. Depending on the option - `org-table-copy-increment', integer field values will be - incremented during copy. Integers that are too large will not be - incremented. Also, a `0' prefix argument temporarily disables the - increment. This key is also used by shift-selection and related - modes (*note Conflicts::). - -Miscellaneous -............. - -`C-c ` (`org-table-edit-field')' - Edit the current field in a separate window. This is useful for - fields that are not fully visible (*note Column width and - alignment::). When called with a `C-u' prefix, just make the full - field visible, so that it can be edited in place. When called - with two `C-u' prefixes, make the editor window follow the cursor - through the table and always show the current field. The follow - mode exits automatically when the cursor leaves the table, or when - you repeat this command with `C-u C-u C-c `'. - -`M-x org-table-import RET' - Import a file as a table. The table should be TAB or whitespace - separated. Use, for example, to import a spreadsheet table or data - from a database, because these programs generally can write - TAB-separated text files. This command works by inserting the - file into the buffer and then converting the region to a table. - Any prefix argument is passed on to the converter, which uses it - to determine the separator. - -`C-c | (`org-table-create-or-convert-from-region')' - Tables can also be imported by pasting tabular text into the Org - buffer, selecting the pasted text with `C-x C-x' and then using the - `C-c |' command (see above under Creation and conversion). - -`M-x org-table-export RET' - Export the table, by default as a TAB-separated file. Use for data - exchange with, for example, spreadsheet or database programs. The - format used to export the file can be configured in the option - `org-table-export-default-format'. You may also use properties - `TABLE_EXPORT_FILE' and `TABLE_EXPORT_FORMAT' to specify the file - name and the format for table export in a subtree. Org supports - quite general formats for exported tables. The exporter format is - the same as the format used by Orgtbl radio tables, see *note - Translator functions::, for a detailed description. - - If you don't like the automatic table editor because it gets in your -way on lines which you would like to start with `|', you can turn it -off with - - (setq org-enable-table-editor nil) - -Then the only table command that still works is `C-c C-c' to do a -manual re-align. - - ---------- Footnotes ---------- - - (1) To insert a vertical bar into a table field, use `\vert' or, -inside a word `abc\vert{}def'. - - -File: org, Node: Column width and alignment, Next: Column groups, Prev: Built-in table editor, Up: Tables - -3.2 Column width and alignment -============================== - -The width of columns is automatically determined by the table editor. -And also the alignment of a column is determined automatically from the -fraction of number-like versus non-number fields in the column. - - Sometimes a single field or a few fields need to carry more text, -leading to inconveniently wide columns. Or maybe you want to make a -table with several columns having a fixed width, regardless of content. -To set the width of a column, one field anywhere in the column may -contain just the string `' where `N' is an integer specifying the -width of the column in characters. The next re-align will then set the -width of this column to this value. - - |---+------------------------------| |---+--------| - | | | | | <6> | - | 1 | one | | 1 | one | - | 2 | two | ----\ | 2 | two | - | 3 | This is a long chunk of text | ----/ | 3 | This=> | - | 4 | four | | 4 | four | - |---+------------------------------| |---+--------| - -Fields that are wider become clipped and end in the string `=>'. Note -that the full text is still in the buffer but is hidden. To see the -full text, hold the mouse over the field--a tool-tip window will show -the full content. To edit such a field, use the command `C-c `' (that -is `C-c' followed by the grave accent). This will open a new window -with the full field. Edit it and finish with `C-c C-c'. - - When visiting a file containing a table with narrowed columns, the -necessary character hiding has not yet happened, and the table needs to -be aligned before it looks nice. Setting the option -`org-startup-align-all-tables' will realign all tables in a file upon -visiting, but also slow down startup. You can also set this option on -a per-file basis with: - - #+STARTUP: align - #+STARTUP: noalign - - If you would like to overrule the automatic alignment of number-rich -columns to the right and of string-rich columns to the left, you can -use `', `'(1) or `' in a similar fashion. You may also -combine alignment and field width like this: `'. - - Lines which only contain these formatting cookies will be removed -automatically when exporting the document. - - ---------- Footnotes ---------- - - (1) Centering does not work inside Emacs, but it does have an effect -when exporting to HTML. - - -File: org, Node: Column groups, Next: Orgtbl mode, Prev: Column width and alignment, Up: Tables - -3.3 Column groups -================= - -When Org exports tables, it does so by default without vertical lines -because that is visually more satisfying in general. Occasionally -however, vertical lines can be useful to structure a table into groups -of columns, much like horizontal lines can do for groups of rows. In -order to specify column groups, you can use a special row where the -first field contains only `/'. The further fields can either contain -`<' to indicate that this column should start a group, `>' to indicate -the end of a group, or `<>' (no space between `<' and `>') to make a -column a group of its own. Boundaries between column groups will upon -export be marked with vertical lines. Here is an example: - - | N | N^2 | N^3 | N^4 | ~sqrt(n)~ | ~sqrt[4](N)~ | - |---+-----+-----+-----+-----------+--------------| - | / | < | | > | < | > | - | 1 | 1 | 1 | 1 | 1 | 1 | - | 2 | 4 | 8 | 16 | 1.4142 | 1.1892 | - | 3 | 9 | 27 | 81 | 1.7321 | 1.3161 | - |---+-----+-----+-----+-----------+--------------| - #+TBLFM: $2=$1^2::$3=$1^3::$4=$1^4::$5=sqrt($1)::$6=sqrt(sqrt(($1))) - - It is also sufficient to just insert the column group starters after -every vertical line you would like to have: - - | N | N^2 | N^3 | N^4 | sqrt(n) | sqrt[4](N) | - |----+-----+-----+-----+---------+------------| - | / | < | | | < | | - - -File: org, Node: Orgtbl mode, Next: The spreadsheet, Prev: Column groups, Up: Tables - -3.4 The Orgtbl minor mode -========================= - -If you like the intuitive way the Org table editor works, you might -also want to use it in other modes like Text mode or Mail mode. The -minor mode Orgtbl mode makes this possible. You can always toggle the -mode with `M-x orgtbl-mode RET'. To turn it on by default, for example -in Message mode, use - - (add-hook 'message-mode-hook 'turn-on-orgtbl) - - Furthermore, with some special setup, it is possible to maintain -tables in arbitrary syntax with Orgtbl mode. For example, it is -possible to construct LaTeX tables with the underlying ease and power of -Orgtbl mode, including spreadsheet capabilities. For details, see -*note Tables in arbitrary syntax::. - - -File: org, Node: The spreadsheet, Next: Org-Plot, Prev: Orgtbl mode, Up: Tables - -3.5 The spreadsheet -=================== - -The table editor makes use of the Emacs `calc' package to implement -spreadsheet-like capabilities. It can also evaluate Emacs Lisp forms to -derive fields from other fields. While fully featured, Org's -implementation is not identical to other spreadsheets. For example, -Org knows the concept of a _column formula_ that will be applied to all -non-header fields in a column without having to copy the formula to -each relevant field. There is also a formula debugger, and a formula -editor with features for highlighting fields in the table corresponding -to the references at the point in the formula, moving these references -by arrow keys - -* Menu: - -* References:: How to refer to another field or range -* Formula syntax for Calc:: Using Calc to compute stuff -* Formula syntax for Lisp:: Writing formulas in Emacs Lisp -* Durations and time values:: How to compute durations and time values -* Field and range formulas:: Formula for specific (ranges of) fields -* Column formulas:: Formulas valid for an entire column -* Lookup functions:: Lookup functions for searching tables -* Editing and debugging formulas:: Fixing formulas -* Updating the table:: Recomputing all dependent fields -* Advanced features:: Field and column names, parameters and automatic recalc - - -File: org, Node: References, Next: Formula syntax for Calc, Up: The spreadsheet - -3.5.1 References ----------------- - -To compute fields in the table from other fields, formulas must -reference other fields or ranges. In Org, fields can be referenced by -name, by absolute coordinates, and by relative coordinates. To find -out what the coordinates of a field are, press `C-c ?' in that field, -or press `C-c }' to toggle the display of a grid. - -Field references -................ - -Formulas can reference the value of another field in two ways. Like in -any other spreadsheet, you may reference fields with a letter/number -combination like `B3', meaning the 2nd field in the 3rd row. However, -Org prefers(1) to use another, more general representation that looks -like this: - @ROW$COLUMN - - Column specifications can be absolute like `$1', `$2',...`$N', or -relative to the current column (i.e., the column of the field which is -being computed) like `$+1' or `$-2'. `$<' and `$>' are immutable -references to the first and last column, respectively, and you can use -`$>>>' to indicate the third column from the right. - - The row specification only counts data lines and ignores horizontal -separator lines (hlines). Like with columns, you can use absolute row -numbers `@1', `@2',...`@N', and row numbers relative to the current row -like `@+3' or `@-1'. `@<' and `@>' are immutable references the first -and last(2) row in the table, respectively. You may also specify the -row relative to one of the hlines: `@I' refers to the first hline, -`@II' to the second, etc. `@-I' refers to the first such line above -the current line, `@+I' to the first such line below the current line. -You can also write `@III+2' which is the second data line after the -third hline in the table. - - `@0' and `$0' refer to the current row and column, respectively, -i.e., to the row/column for the field being computed. Also, if you omit -either the column or the row part of the reference, the current -row/column is implied. - - Org's references with _unsigned_ numbers are fixed references in the -sense that if you use the same reference in the formula for two -different fields, the same field will be referenced each time. Org's -references with _signed_ numbers are floating references because the -same reference operator can reference different fields depending on the -field being calculated by the formula. - - Here are a few examples: - - @2$3 2nd row, 3rd column (same as `C2') - $5 column 5 in the current row (same as `E&') - @2 current column, row 2 - @-1$-3 the field one row up, three columns to the left - @-I$2 field just under hline above current row, column 2 - @>$5 field in the last row, in column 5 - -Range references -................ - -You may reference a rectangular range of fields by specifying two field -references connected by two dots `..'. If both fields are in the -current row, you may simply use `$2..$7', but if at least one field is -in a different row, you need to use the general `@row$column' format at -least for the first field (i.e the reference must start with `@' in -order to be interpreted correctly). Examples: - - $1..$3 first three fields in the current row - $P..$Q range, using column names (see under Advanced) - $<<<..$>> start in third column, continue to the last but one - @2$1..@4$3 6 fields between these two fields (same as `A2..C4') - @-1$-2..@-1 3 fields in the row above, starting from 2 columns on the left - @I..II between first and second hline, short for `@I..@II' - -Range references return a vector of values that can be fed into Calc -vector functions. Empty fields in ranges are normally suppressed, so -that the vector contains only the non-empty fields. For other options -with the mode switches `E', `N' and examples *note Formula syntax for -Calc::. - -Field coordinates in formulas -............................. - -One of the very first actions during evaluation of Calc formulas and -Lisp formulas is to substitute `@#' and `$#' in the formula with the -row or column number of the field where the current result will go to. -The traditional Lisp formula equivalents are `org-table-current-dline' -and `org-table-current-column'. Examples: - -`if(@# % 2, $#, string(""))' - Insert column number on odd rows, set field to empty on even rows. - -`$2 = '(identity remote(FOO, @@#$1))' - Copy text or values of each row of column 1 of the table named - `FOO' into column 2 of the current table. - -`@3 = 2 * remote(FOO, @1$$#)' - Insert the doubled value of each column of row 1 of the table named - `FOO' into row 3 of the current table. - -For the second/third example, the table named `FOO' must have at least -as many rows/columns as the current table. Note that this is -inefficient(3) for large number of rows/columns. - -Named references -................ - -`$name' is interpreted as the name of a column, parameter or constant. -Constants are defined globally through the option -`org-table-formula-constants', and locally (for the file) through a -line like - - #+CONSTANTS: c=299792458. pi=3.14 eps=2.4e-6 - -Also properties (*note Properties and columns::) can be used as -constants in table formulas: for a property `:Xyz:' use the name -`$PROP_Xyz', and the property will be searched in the current outline -entry and in the hierarchy above it. If you have the `constants.el' -package, it will also be used to resolve constants, including natural -constants like `$h' for Planck's constant, and units like `$km' for -kilometers(4). Column names and parameters can be specified in special -table lines. These are described below, see *note Advanced features::. -All names must start with a letter, and further consist of letters and -numbers. - -Remote references -................. - -You may also reference constants, fields and ranges from a different -table, either in the current file or even in a different file. The -syntax is - - remote(NAME-OR-ID,REF) - -where NAME can be the name of a table in the current file as set by a -`#+NAME: Name' line before the table. It can also be the ID of an -entry, even in a different file, and the reference then refers to the -first table in that entry. REF is an absolute field or range reference -as described above for example `@3$3' or `$somename', valid in the -referenced table. - - Indirection of NAME-OR-ID: When NAME-OR-ID has the format -`@ROW$COLUMN' it will be substituted with the name or ID found in this -field of the current table. For example `remote($1, @>$2)' => -`remote(year_2013, @>$1)'. The format `B3' is not supported because it -can not be distinguished from a plain table name or ID. - - ---------- Footnotes ---------- - - (1) Org will understand references typed by the user as `B4', but it -will not use this syntax when offering a formula for editing. You can -customize this behavior using the option -`org-table-use-standard-references'. - - (2) For backward compatibility you can also use special names like -`$LR5' and `$LR12' to refer in a stable way to the 5th and 12th field -in the last row of the table. However, this syntax is deprecated, it -should not be used for new documents. Use `@>$' instead. - - (3) The computation time scales as O(N^2) because the table named -`FOO' is parsed for each field to be read. - - (4) `constants.el' can supply the values of constants in two -different unit systems, `SI' and `cgs'. Which one is used depends on -the value of the variable `constants-unit-system'. You can use the -`#+STARTUP' options `constSI' and `constcgs' to set this value for the -current buffer. - - -File: org, Node: Formula syntax for Calc, Next: Formula syntax for Lisp, Prev: References, Up: The spreadsheet - -3.5.2 Formula syntax for Calc ------------------------------ - -A formula can be any algebraic expression understood by the Emacs `Calc' -package. Note that `calc' has the non-standard convention that `/' has -lower precedence than `*', so that `a/b*c' is interpreted as `a/(b*c)'. -Before evaluation by `calc-eval' (*note calc-eval: (calc)Calling Calc -from Your Programs.), variable substitution takes place according to the -rules described above. The range vectors can be directly fed into the -Calc vector functions like `vmean' and `vsum'. - - A formula can contain an optional mode string after a semicolon. -This string consists of flags to influence Calc and other modes during -execution. By default, Org uses the standard Calc modes (precision 12, -angular units degrees, fraction and symbolic modes off). The display -format, however, has been changed to `(float 8)' to keep tables -compact. The default settings can be configured using the option -`org-calc-default-modes'. - -List of modes: - -`p20' - Set the internal Calc calculation precision to 20 digits. - -`n3', `s3', `e2', `f4' - Normal, scientific, engineering or fixed format of the result of - Calc passed back to Org. Calc formatting is unlimited in - precision as long as the Calc calculation precision is greater. - -`D', `R' - Degree and radian angle modes of Calc. - -`F', `S' - Fraction and symbolic modes of Calc. - -`T', `t', `U' - Duration computations in Calc or Lisp, *note Durations and time - values::. - -`E' - If and how to consider empty fields. Without `E' empty fields in - range references are suppressed so that the Calc vector or Lisp - list contains only the non-empty fields. With `E' the empty - fields are kept. For empty fields in ranges or empty field - references the value `nan' (not a number) is used in Calc formulas - and the empty string is used for Lisp formulas. Add `N' to use 0 - instead for both formula types. For the value of a field the mode - `N' has higher precedence than `E'. - -`N' - Interpret all fields as numbers, use 0 for non-numbers. See the - next section to see how this is essential for computations with - Lisp formulas. In Calc formulas it is used only occasionally - because there number strings are already interpreted as numbers - without `N'. - -`L' - Literal, for Lisp formulas only. See the next section. - -Unless you use large integer numbers or high-precision-calculation and --display for floating point numbers you may alternatively provide a -`printf' format specifier to reformat the Calc result after it has been -passed back to Org instead of letting Calc already do the -formatting(1). A few examples: - - $1+$2 Sum of first and second field - $1+$2;%.2f Same, format result to two decimals - exp($2)+exp($1) Math functions can be used - $0;%.1f Reformat current cell to 1 decimal - ($3-32)*5/9 Degrees F -> C conversion - $c/$1/$cm Hz -> cm conversion, using `constants.el' - tan($1);Dp3s1 Compute in degrees, precision 3, display SCI 1 - sin($1);Dp3%.1e Same, but use printf specifier for display - taylor($3,x=7,2) Taylor series of $3, at x=7, second degree - - Calc also contains a complete set of logical operations, (*note -Logical Operations: (calc)Logical Operations.). For example - -`if($1 < 20, teen, string(""))' - "teen" if age $1 is less than 20, else the Org table result field - is set to empty with the empty string. - -`if("$1" == "nan" || "$2" == "nan", string(""), $1 + $2); E f-1' - Sum of the first two columns. When at least one of the input - fields is empty the Org table result field is set to empty. `E' - is required to not convert empty fields to 0. `f-1' is an - optional Calc format string similar to `%.1f' but leaves empty - results empty. - -`if(typeof(vmean($1..$7)) == 12, string(""), vmean($1..$7); E' - Mean value of a range unless there is any empty field. Every - field in the range that is empty is replaced by `nan' which lets - `vmean' result in `nan'. Then `typeof == 12' detects the `nan' - from `vmean' and the Org table result field is set to empty. Use - this when the sample set is expected to never have missing values. - -`if("$1..$7" == "[]", string(""), vmean($1..$7))' - Mean value of a range with empty fields skipped. Every field in - the range that is empty is skipped. When all fields in the range - are empty the mean value is not defined and the Org table result - field is set to empty. Use this when the sample set can have a - variable size. - -`vmean($1..$7); EN' - To complete the example before: Mean value of a range with empty - fields counting as samples with value 0. Use this only when - incomplete sample sets should be padded with 0 to the full size. - - You can add your own Calc functions defined in Emacs Lisp with -`defmath' and use them in formula syntax for Calc. - - ---------- Footnotes ---------- - - (1) The `printf' reformatting is limited in precision because the -value passed to it is converted into an `integer' or `double'. The -`integer' is limited in size by truncating the signed value to 32 bits. -The `double' is limited in precision to 64 bits overall which leaves -approximately 16 significant decimal digits. - - -File: org, Node: Formula syntax for Lisp, Next: Durations and time values, Prev: Formula syntax for Calc, Up: The spreadsheet - -3.5.3 Emacs Lisp forms as formulas ----------------------------------- - -It is also possible to write a formula in Emacs Lisp. This can be -useful for string manipulation and control structures, if Calc's -functionality is not enough. - - If a formula starts with an apostrophe followed by an opening -parenthesis, then it is evaluated as a Lisp form. The evaluation -should return either a string or a number. Just as with `calc' -formulas, you can specify modes and a printf format after a semicolon. - - With Emacs Lisp forms, you need to be conscious about the way field -references are interpolated into the form. By default, a reference -will be interpolated as a Lisp string (in double-quotes) containing the -field. If you provide the `N' mode switch, all referenced elements -will be numbers (non-number fields will be zero) and interpolated as -Lisp numbers, without quotes. If you provide the `L' flag, all fields -will be interpolated literally, without quotes. I.e., if you want a -reference to be interpreted as a string by the Lisp form, enclose the -reference operator itself in double-quotes, like `"$3"'. Ranges are -inserted as space-separated fields, so you can embed them in list or -vector syntax. - - Here are a few examples--note how the `N' mode is used when we do -computations in Lisp: - -`'(concat (substring $1 1 2) (substring $1 0 1) (substring $1 2))' - Swap the first two characters of the content of column 1. - -`'(+ $1 $2);N' - Add columns 1 and 2, equivalent to Calc's `$1+$2'. - -`'(apply '+ '($1..$4));N' - Compute the sum of columns 1 to 4, like Calc's `vsum($1..$4)'. - - -File: org, Node: Durations and time values, Next: Field and range formulas, Prev: Formula syntax for Lisp, Up: The spreadsheet - -3.5.4 Durations and time values -------------------------------- - -If you want to compute time values use the `T', `t', or `U' flag, -either in Calc formulas or Elisp formulas: - - | Task 1 | Task 2 | Total | - |---------+----------+----------| - | 2:12 | 1:47 | 03:59:00 | - | 2:12 | 1:47 | 03:59 | - | 3:02:20 | -2:07:00 | 0.92 | - #+TBLFM: @2$3=$1+$2;T::@3$3=$1+$2;U::@4$3=$1+$2;t - - Input duration values must be of the form `HH:MM[:SS]', where seconds -are optional. With the `T' flag, computed durations will be displayed -as `HH:MM:SS' (see the first formula above). With the `U' flag, -seconds will be omitted so that the result will be only `HH:MM' (see -second formula above). Zero-padding of the hours field will depend -upon the value of the variable `org-table-duration-hour-zero-padding'. - - With the `t' flag, computed durations will be displayed according to -the value of the option `org-table-duration-custom-format', which -defaults to `'hours' and will display the result as a fraction of hours -(see the third formula in the example above). - - Negative duration values can be manipulated as well, and integers -will be considered as seconds in addition and subtraction. - - -File: org, Node: Field and range formulas, Next: Column formulas, Prev: Durations and time values, Up: The spreadsheet - -3.5.5 Field and range formulas ------------------------------- - -To assign a formula to a particular field, type it directly into the -field, preceded by `:=', for example `:=vsum(@II..III)'. When you press - or or `C-c C-c' with the cursor still in the field, the -formula will be stored as the formula for this field, evaluated, and the -current field will be replaced with the result. - - Formulas are stored in a special line starting with `#+TBLFM:' -directly below the table. If you type the equation in the 4th field of -the 3rd data line in the table, the formula will look like -`@3$4=$1+$2'. When inserting/deleting/swapping columns and rows with -the appropriate commands, absolute references (but not relative ones) -in stored formulas are modified in order to still reference the same -field. To avoid this, in particular in range references, anchor ranges -at the table borders (using `@<', `@>', `$<', `$>'), or at hlines using -the `@I' notation. Automatic adaptation of field references does of -course not happen if you edit the table structure with normal editing -commands--then you must fix the equations yourself. - - Instead of typing an equation into the field, you may also use the -following command - -`C-u C-c = (`org-table-eval-formula')' - Install a new formula for the current field. The command prompts - for a formula with default taken from the `#+TBLFM:' line, applies - it to the current field, and stores it. - - The left-hand side of a formula can also be a special expression in -order to assign the formula to a number of different fields. There is -no keyboard shortcut to enter such range formulas. To add them, use -the formula editor (*note Editing and debugging formulas::) or edit the -`#+TBLFM:' line directly. - -`$2=' - Column formula, valid for the entire column. This is so common - that Org treats these formulas in a special way, see *note Column - formulas::. - -`@3=' - Row formula, applies to all fields in the specified row. `@>=' - means the last row. - -`@1$2..@4$3=' - Range formula, applies to all fields in the given rectangular - range. This can also be used to assign a formula to some but not - all fields in a row. - -`$name=' - Named field, see *note Advanced features::. - - -File: org, Node: Column formulas, Next: Lookup functions, Prev: Field and range formulas, Up: The spreadsheet - -3.5.6 Column formulas ---------------------- - -When you assign a formula to a simple column reference like `$3=', the -same formula will be used in all fields of that column, with the -following very convenient exceptions: (i) If the table contains -horizontal separator hlines with rows above and below, everything -before the first such hline is considered part of the table _header_ -and will not be modified by column formulas. Therefore a header is -mandatory when you use column formulas and want to add hlines to group -rows, like for example to separate a total row at the bottom from the -summand rows above. (ii) Fields that already get a value from a -field/range formula will be left alone by column formulas. These -conditions make column formulas very easy to use. - - To assign a formula to a column, type it directly into any field in -the column, preceded by an equal sign, like `=$1+$2'. When you press - or or `C-c C-c' with the cursor still in the field, the -formula will be stored as the formula for the current column, evaluated -and the current field replaced with the result. If the field contains -only `=', the previously stored formula for this column is used. For -each column, Org will only remember the most recently used formula. In -the `#+TBLFM:' line, column formulas will look like `$4=$1+$2'. The -left-hand side of a column formula cannot be the name of column, it -must be the numeric column reference or `$>'. - - Instead of typing an equation into the field, you may also use the -following command: - -`C-c = (`org-table-eval-formula')' - Install a new formula for the current column and replace current - field with the result of the formula. The command prompts for a - formula, with default taken from the `#+TBLFM' line, applies it to - the current field and stores it. With a numeric prefix - argument(e.g., `C-5 C-c =') the command will apply it to that many - consecutive fields in the current column. - - -File: org, Node: Lookup functions, Next: Editing and debugging formulas, Prev: Column formulas, Up: The spreadsheet - -3.5.7 Lookup functions ----------------------- - -Org has three predefined Emacs Lisp functions for lookups in tables. -`(org-lookup-first VAL S-LIST R-LIST &optional PREDICATE)' - Searches for the first element `S' in list `S-LIST' for which - (PREDICATE VAL S) - is `t'; returns the value from the corresponding position in list - `R-LIST'. The default `PREDICATE' is `equal'. Note that the - parameters `VAL' and `S' are passed to `PREDICATE' in the same - order as the corresponding parameters are in the call to - `org-lookup-first', where `VAL' precedes `S-LIST'. If `R-LIST' is - `nil', the matching element `S' of `S-LIST' is returned. - -`(org-lookup-last VAL S-LIST R-LIST &optional PREDICATE)' - Similar to `org-lookup-first' above, but searches for the last - element for which `PREDICATE' is `t'. - -`(org-lookup-all VAL S-LIST R-LIST &optional PREDICATE)' - Similar to `org-lookup-first', but searches for all elements for - which `PREDICATE' is `t', and returns all corresponding values. - This function can not be used by itself in a formula, because it - returns a list of values. However, powerful lookups can be built - when this function is combined with other Emacs Lisp functions. - - If the ranges used in these functions contain empty fields, the `E' -mode for the formula should usually be specified: otherwise empty -fields will not be included in `S-LIST' and/or `R-LIST' which can, for -example, result in an incorrect mapping from an element of `S-LIST' to -the corresponding element of `R-LIST'. - - These three functions can be used to implement associative arrays, -count matching cells, rank results, group data etc. For practical -examples see this tutorial on Worg -(http://orgmode.org/worg/org-tutorials/org-lookups.html). - - -File: org, Node: Editing and debugging formulas, Next: Updating the table, Prev: Lookup functions, Up: The spreadsheet - -3.5.8 Editing and debugging formulas ------------------------------------- - -You can edit individual formulas in the minibuffer or directly in the -field. Org can also prepare a special buffer with all active formulas -of a table. When offering a formula for editing, Org converts -references to the standard format (like `B3' or `D&') if possible. If -you prefer to only work with the internal format (like `@3$2' or `$4'), -configure the option `org-table-use-standard-references'. - -`C-c = or C-u C-c = (`org-table-eval-formula')' - Edit the formula associated with the current column/field in the - minibuffer. See *note Column formulas::, and *note Field and - range formulas::. - -`C-u C-u C-c = (`org-table-eval-formula')' - Re-insert the active formula (either a field formula, or a column - formula) into the current field, so that you can edit it directly - in the field. The advantage over editing in the minibuffer is - that you can use the command `C-c ?'. - -`C-c ? (`org-table-field-info')' - While editing a formula in a table field, highlight the field(s) - referenced by the reference at the cursor position in the formula. - -`C-c }' - Toggle the display of row and column numbers for a table, using - overlays (`org-table-toggle-coordinate-overlays'). These are - updated each time the table is aligned; you can force it with `C-c - C-c'. - -`C-c {' - Toggle the formula debugger on and off - (`org-table-toggle-formula-debugger'). See below. - -`C-c ' (`org-table-edit-formulas')' - Edit all formulas for the current table in a special buffer, where - the formulas will be displayed one per line. If the current field - has an active formula, the cursor in the formula editor will mark - it. While inside the special buffer, Org will automatically - highlight any field or range reference at the cursor position. - You may edit, remove and add formulas, and use the following - commands: - - `C-c C-c or C-x C-s (`org-table-fedit-finish')' - Exit the formula editor and store the modified formulas. - With `C-u' prefix, also apply the new formulas to the entire - table. - - `C-c C-q (`org-table-fedit-abort')' - Exit the formula editor without installing changes. - - `C-c C-r (`org-table-fedit-toggle-ref-type')' - Toggle all references in the formula editor between standard - (like `B3') and internal (like `@3$2'). - - ` (`org-table-fedit-lisp-indent')' - Pretty-print or indent Lisp formula at point. When in a line - containing a Lisp formula, format the formula according to - Emacs Lisp rules. Another collapses the formula back - again. In the open formula, re-indents just like in - Emacs Lisp mode. - - `M- (`lisp-complete-symbol')' - Complete Lisp symbols, just like in Emacs Lisp mode.(1) - - `S-///' - Shift the reference at point. For example, if the reference - is `B3' and you press `S-', it will become `C3'. This - also works for relative references and for hline references. - - `M-S- (`org-table-fedit-line-up')' - `M-S- (`org-table-fedit-line-down')' - Move the test line for column formulas in the Org buffer up - and down. - - `M- (`org-table-fedit-scroll-down')' - `M- (`org-table-fedit-scroll-up')' - Scroll the window displaying the table. - - `C-c }' - Turn the coordinate grid in the table on and off. - - Making a table field blank does not remove the formula associated -with the field, because that is stored in a different line (the -`#+TBLFM' line)--during the next recalculation the field will be filled -again. To remove a formula from a field, you have to give an empty -reply when prompted for the formula, or to edit the `#+TBLFM' line. - - You may edit the `#+TBLFM' directly and re-apply the changed -equations with `C-c C-c' in that line or with the normal recalculation -commands in the table. - -Using multiple #+TBLFM lines -............................ - -You may apply the formula temporarily. This is useful when you switch -the formula. Place multiple `#+TBLFM' lines right after the table, and -then press `C-c C-c' on the formula to apply. Here is an example: - - | x | y | - |---+---| - | 1 | | - | 2 | | - #+TBLFM: $2=$1*1 - #+TBLFM: $2=$1*2 - -Pressing `C-c C-c' in the line of `#+TBLFM: $2=$1*2' yields: - - | x | y | - |---+---| - | 1 | 2 | - | 2 | 4 | - #+TBLFM: $2=$1*1 - #+TBLFM: $2=$1*2 - -Note: If you recalculate this table (with `C-u C-c *', for example), you -will get the following result of applying only the first `#+TBLFM' line. - - | x | y | - |---+---| - | 1 | 1 | - | 2 | 2 | - #+TBLFM: $2=$1*1 - #+TBLFM: $2=$1*2 - -Debugging formulas -.................. - -When the evaluation of a formula leads to an error, the field content -becomes the string `#ERROR'. If you would like see what is going on -during variable substitution and calculation in order to find a bug, -turn on formula debugging in the `Tbl' menu and repeat the calculation, -for example by pressing `C-u C-u C-c = ' in a field. Detailed -information will be displayed. - - ---------- Footnotes ---------- - - (1) Many desktops intercept `M-' to switch windows. Use -`C-M-i' or ` ' instead for completion (*note Completion::). - - -File: org, Node: Updating the table, Next: Advanced features, Prev: Editing and debugging formulas, Up: The spreadsheet - -3.5.9 Updating the table ------------------------- - -Recalculation of a table is normally not automatic, but needs to be -triggered by a command. See *note Advanced features::, for a way to -make recalculation at least semi-automatic. - - In order to recalculate a line of a table or the entire table, use -the following commands: - -`C-c * (`org-table-recalculate')' - Recalculate the current row by first applying the stored column - formulas from left to right, and all field/range formulas in the - current row. - -`C-u C-c *' -`C-u C-c C-c' - Recompute the entire table, line by line. Any lines before the - first hline are left alone, assuming that these are part of the - table header. - -`C-u C-u C-c * or C-u C-u C-c C-c (`org-table-iterate')' - Iterate the table by recomputing it until no further changes occur. - This may be necessary if some computed fields use the value of - other fields that are computed later in the calculation sequence. - -`M-x org-table-recalculate-buffer-tables RET' - Recompute all tables in the current buffer. - -`M-x org-table-iterate-buffer-tables RET' - Iterate all tables in the current buffer, in order to converge - table-to-table dependencies. - - -File: org, Node: Advanced features, Prev: Updating the table, Up: The spreadsheet - -3.5.10 Advanced features ------------------------- - -If you want the recalculation of fields to happen automatically, or if -you want to be able to assign names(1) to fields and columns, you need -to reserve the first column of the table for special marking characters. - -`C-# (`org-table-rotate-recalc-marks')' - Rotate the calculation mark in first column through the states ` ', - `#', `*', `!', `$'. When there is an active region, change all - marks in the region. - - Here is an example of a table that collects exam results of students -and makes use of these features: - - |---+---------+--------+--------+--------+-------+------| - | | Student | Prob 1 | Prob 2 | Prob 3 | Total | Note | - |---+---------+--------+--------+--------+-------+------| - | ! | | P1 | P2 | P3 | Tot | | - | # | Maximum | 10 | 15 | 25 | 50 | 10.0 | - | ^ | | m1 | m2 | m3 | mt | | - |---+---------+--------+--------+--------+-------+------| - | # | Peter | 10 | 8 | 23 | 41 | 8.2 | - | # | Sam | 2 | 4 | 3 | 9 | 1.8 | - |---+---------+--------+--------+--------+-------+------| - | | Average | | | | 25.0 | | - | ^ | | | | | at | | - | $ | max=50 | | | | | | - |---+---------+--------+--------+--------+-------+------| - #+TBLFM: $6=vsum($P1..$P3)::$7=10*$Tot/$max;%.1f::$at=vmean(@-II..@-I);%.1f - -Important: please note that for these special tables, recalculating the -table with `C-u C-c *' will only affect rows that are marked `#' or -`*', and fields that have a formula assigned to the field itself. The -column formulas are not applied in rows with empty first field. - - The marking characters have the following meaning: - -`!' - The fields in this line define names for the columns, so that you - may refer to a column as `$Tot' instead of `$6'. - -`^' - This row defines names for the fields _above_ the row. With such - a definition, any formula in the table may use `$m1' to refer to - the value `10'. Also, if you assign a formula to a names field, it - will be stored as `$name=...'. - -`_' - Similar to `^', but defines names for the fields in the row - _below_. - -`$' - Fields in this row can define _parameters_ for formulas. For - example, if a field in a `$' row contains `max=50', then formulas - in this table can refer to the value 50 using `$max'. Parameters - work exactly like constants, only that they can be defined on a - per-table basis. - -`#' - Fields in this row are automatically recalculated when pressing - or or `S-' in this row. Also, this row is - selected for a global recalculation with `C-u C-c *'. Unmarked - lines will be left alone by this command. - -`*' - Selects this line for global recalculation with `C-u C-c *', but - not for automatic recalculation. Use this when automatic - recalculation slows down editing too much. - -` ' - Unmarked lines are exempt from recalculation with `C-u C-c *'. - All lines that should be recalculated should be marked with `#' or - `*'. - -`/' - Do not export this line. Useful for lines that contain the - narrowing `' markers or column group markers. - - Finally, just to whet your appetite for what can be done with the -fantastic `calc.el' package, here is a table that computes the Taylor -series of degree `n' at location `x' for a couple of functions. - - |---+-------------+---+-----+--------------------------------------| - | | Func | n | x | Result | - |---+-------------+---+-----+--------------------------------------| - | # | exp(x) | 1 | x | 1 + x | - | # | exp(x) | 2 | x | 1 + x + x^2 / 2 | - | # | exp(x) | 3 | x | 1 + x + x^2 / 2 + x^3 / 6 | - | # | x^2+sqrt(x) | 2 | x=0 | x*(0.5 / 0) + x^2 (2 - 0.25 / 0) / 2 | - | # | x^2+sqrt(x) | 2 | x=1 | 2 + 2.5 x - 2.5 + 0.875 (x - 1)^2 | - | * | tan(x) | 3 | x | 0.0175 x + 1.77e-6 x^3 | - |---+-------------+---+-----+--------------------------------------| - #+TBLFM: $5=taylor($2,$4,$3);n3 - - ---------- Footnotes ---------- - - (1) Such names must start by an alphabetic character and use only -alphanumeric/underscore characters. - - -File: org, Node: Org-Plot, Prev: The spreadsheet, Up: Tables - -3.6 Org-Plot -============ - -Org-Plot can produce graphs of information stored in org tables, either -graphically or in ASCII-art. - -Graphical plots using `Gnuplot' -------------------------------- - -Org-Plot produces 2D and 3D graphs using `Gnuplot' -`http://www.gnuplot.info/' and `gnuplot-mode' -`http://xafs.org/BruceRavel/GnuplotMode'. To see this in action, ensure -that you have both Gnuplot and Gnuplot mode installed on your system, -then call `C-c " g' or `M-x org-plot/gnuplot ' on the following -table. - - #+PLOT: title:"Citas" ind:1 deps:(3) type:2d with:histograms set:"yrange [0:]" - | Sede | Max cites | H-index | - |-----------+-----------+---------| - | Chile | 257.72 | 21.39 | - | Leeds | 165.77 | 19.68 | - | Sao Paolo | 71.00 | 11.50 | - | Stockholm | 134.19 | 14.33 | - | Morelia | 257.56 | 17.67 | - - Notice that Org Plot is smart enough to apply the table's headers as -labels. Further control over the labels, type, content, and appearance -of plots can be exercised through the `#+PLOT:' lines preceding a -table. See below for a complete list of Org-plot options. The -`#+PLOT:' lines are optional. For more information and examples see -the Org-plot tutorial at -`http://orgmode.org/worg/org-tutorials/org-plot.html'. - -Plot Options -............ - -`set' - Specify any `gnuplot' option to be set when graphing. - -`title' - Specify the title of the plot. - -`ind' - Specify which column of the table to use as the `x' axis. - -`deps' - Specify the columns to graph as a Lisp style list, surrounded by - parentheses and separated by spaces for example `dep:(3 4)' to - graph the third and fourth columns (defaults to graphing all other - columns aside from the `ind' column). - -`type' - Specify whether the plot will be `2d', `3d', or `grid'. - -`with' - Specify a `with' option to be inserted for every col being plotted - (e.g., `lines', `points', `boxes', `impulses', etc...). Defaults - to `lines'. - -`file' - If you want to plot to a file, specify - `"PATH/TO/DESIRED/OUTPUT-FILE"'. - -`labels' - List of labels to be used for the `deps' (defaults to the column - headers if they exist). - -`line' - Specify an entire line to be inserted in the Gnuplot script. - -`map' - When plotting `3d' or `grid' types, set this to `t' to graph a - flat mapping rather than a `3d' slope. - -`timefmt' - Specify format of Org mode timestamps as they will be parsed by - Gnuplot. Defaults to `%Y-%m-%d-%H:%M:%S'. - -`script' - If you want total control, you can specify a script file (place - the file name between double-quotes) which will be used to plot. - Before plotting, every instance of `$datafile' in the specified - script will be replaced with the path to the generated data file. - Note: even if you set this option, you may still want to specify - the plot type, as that can impact the content of the data file. - -ASCII bar plots ---------------- - -While the cursor is on a column, typing `C-c " a' or `M-x -orgtbl-ascii-plot ' create a new column containing an ASCII-art -bars plot. The plot is implemented through a regular column formula. -When the source column changes, the bar plot may be updated by -refreshing the table, for example typing `C-u C-c *'. - - | Sede | Max cites | | - |---------------+-----------+--------------| - | Chile | 257.72 | WWWWWWWWWWWW | - | Leeds | 165.77 | WWWWWWWh | - | Sao Paolo | 71.00 | WWW; | - | Stockholm | 134.19 | WWWWWW: | - | Morelia | 257.56 | WWWWWWWWWWWH | - | Rochefourchat | 0.00 | | - #+TBLFM: $3='(orgtbl-ascii-draw $2 0.0 257.72 12) - - The formula is an elisp call: - (orgtbl-ascii-draw COLUMN MIN MAX WIDTH) - -`COLUMN' - is a reference to the source column. - -`MIN MAX' - are the minimal and maximal values displayed. Sources values - outside this range are displayed as `too small' or `too large'. - -`WIDTH' - is the width in characters of the bar-plot. It defaults to `12'. - - - -File: org, Node: Hyperlinks, Next: TODO items, Prev: Tables, Up: Top - -4 Hyperlinks -************ - -Like HTML, Org provides links inside a file, external links to other -files, Usenet articles, emails, and much more. - -* Menu: - -* Link format:: How links in Org are formatted -* Internal links:: Links to other places in the current file -* External links:: URL-like links to the world -* Handling links:: Creating, inserting and following -* Using links outside Org:: Linking from my C source code? -* Link abbreviations:: Shortcuts for writing complex links -* Search options:: Linking to a specific location -* Custom searches:: When the default search is not enough - - -File: org, Node: Link format, Next: Internal links, Up: Hyperlinks - -4.1 Link format -=============== - -Org will recognize plain URL-like links and activate them as clickable -links. The general link format, however, looks like this: - - [[link][description]] or alternatively [[link]] - -Once a link in the buffer is complete (all brackets present), Org will -change the display so that `description' is displayed instead of -`[[link][description]]' and `link' is displayed instead of `[[link]]'. -Links will be highlighted in the face `org-link', which by default is -an underlined face. You can directly edit the visible part of a link. -Note that this can be either the `link' part (if there is no -description) or the `description' part. To edit also the invisible -`link' part, use `C-c C-l' with the cursor on the link. - - If you place the cursor at the beginning or just behind the end of -the displayed text and press , you will remove the -(invisible) bracket at that location. This makes the link incomplete -and the internals are again displayed as plain text. Inserting the -missing bracket hides the link internals again. To show the internal -structure of all links, use the menu entry `Org->Hyperlinks->Literal -links'. - - -File: org, Node: Internal links, Next: External links, Prev: Link format, Up: Hyperlinks - -4.2 Internal links -================== - -If the link does not look like a URL, it is considered to be internal -in the current file. The most important case is a link like -`[[#my-custom-id]]' which will link to the entry with the `CUSTOM_ID' -property `my-custom-id'. You are responsible yourself to make sure -these custom IDs are unique in a file. - - Links such as `[[My Target]]' or `[[My Target][Find my target]]' -lead to a text search in the current file. - - The link can be followed with `C-c C-o' when the cursor is on the -link, or with a mouse click (*note Handling links::). Links to custom -IDs will point to the corresponding headline. The preferred match for -a text link is a dedicated target: the same string in double angular -brackets, like `<>'. - - If no dedicated target exists, the link will then try to match the -exact name of an element within the buffer. Naming is done with the -`#+NAME' keyword, which has to be put in the line before the element it -refers to, as in the following example - - #+NAME: My Target - | a | table | - |----+------------| - | of | four cells | - - If none of the above succeeds, Org will search for a headline that -is exactly the link text but may also include a TODO keyword and -tags(1). - - During export, internal links will be used to mark objects and -assign them a number. Marked objects will then be referenced by links -pointing to them. In particular, links without a description will -appear as the number assigned to the marked object(2). In the -following excerpt from an Org buffer - - - one item - - <>another item - Here we refer to item [[target]]. - -The last sentence will appear as `Here we refer to item 2' when -exported. - - In non-Org files, the search will look for the words in the link -text. In the above example the search would be for `my target'. - - Following a link pushes a mark onto Org's own mark ring. You can -return to the previous position with `C-c &'. Using this command -several times in direct succession goes back to positions recorded -earlier. - -* Menu: - -* Radio targets:: Make targets trigger links in plain text - - ---------- Footnotes ---------- - - (1) To insert a link targeting a headline, in-buffer completion can -be used. Just type a star followed by a few optional letters into the -buffer and press `M-'. All headlines in the current buffer will -be offered as completions. - - (2) When targeting a `#+NAME' keyword, `#+CAPTION' keyword is -mandatory in order to get proper numbering (*note Images and tables::). - - -File: org, Node: Radio targets, Up: Internal links - -4.2.1 Radio targets -------------------- - -Org can automatically turn any occurrences of certain target names in -normal text into a link. So without explicitly creating a link, the -text connects to the target radioing its position. Radio targets are -enclosed by triple angular brackets. For example, a target `<<>>' causes each occurrence of `my target' in normal text to -become activated as a link. The Org file is scanned automatically for -radio targets only when the file is first loaded into Emacs. To update -the target list during editing, press `C-c C-c' with the cursor on or -at a target. - - -File: org, Node: External links, Next: Handling links, Prev: Internal links, Up: Hyperlinks - -4.3 External links -================== - -Org supports links to files, websites, Usenet and email messages, BBDB -database entries and links to both IRC conversations and their logs. -External links are URL-like locators. They start with a short -identifying string followed by a colon. There can be no space after -the colon. The following list shows examples for each link type. - - http://www.astro.uva.nl/~dominik on the web - doi:10.1000/182 DOI for an electronic resource - file:/home/dominik/images/jupiter.jpg file, absolute path - /home/dominik/images/jupiter.jpg same as above - file:papers/last.pdf file, relative path - ./papers/last.pdf same as above - file:/ssh:myself@some.where:papers/last.pdf file, path on remote machine - /ssh:myself@some.where:papers/last.pdf same as above - file:sometextfile::NNN file, jump to line number - file:projects.org another Org file - file:projects.org::some words text search in Org file(1) - file:projects.org::*task title heading search in Org file(2) - docview:papers/last.pdf::NNN open in doc-view mode at page - id:B7423F4D-2E8A-471B-8810-C40F074717E9 Link to heading by ID - news:comp.emacs Usenet link - mailto:adent@galaxy.net Mail link - mhe:folder MH-E folder link - mhe:folder#id MH-E message link - rmail:folder RMAIL folder link - rmail:folder#id RMAIL message link - gnus:group Gnus group link - gnus:group#id Gnus article link - bbdb:R.*Stallman BBDB link (with regexp) - irc:/irc.com/#emacs/bob IRC link - info:org#External links Info node or index link - shell:ls *.org A shell command - elisp:org-agenda Interactive Elisp command - elisp:(find-file-other-frame "Elisp.org") Elisp form to evaluate - - On top of these built-in link types, some are available through the -`contrib/' directory (*note Installation::). For example, these links -to VM or Wanderlust messages are available when you load the -corresponding libraries from the `contrib/' directory: - - vm:folder VM folder link - vm:folder#id VM message link - vm://myself@some.where.org/folder#id VM on remote machine - vm-imap:account:folder VM IMAP folder link - vm-imap:account:folder#id VM IMAP message link - wl:folder WANDERLUST folder link - wl:folder#id WANDERLUST message link - - For customizing Org to add new link types *note Adding hyperlink -types::. - - A link should be enclosed in double brackets and may contain a -descriptive text to be displayed instead of the URL (*note Link -format::), for example: - - [[https://www.gnu.org/software/emacs/][GNU Emacs]] - -If the description is a file name or URL that points to an image, HTML -export (*note HTML export::) will inline the image as a clickable -button. If there is no description at all and the link points to an -image, that image will be inlined into the exported HTML file. - - Org also finds external links in the normal text and activates them -as links. If spaces must be part of the link (for example in -`bbdb:Richard Stallman'), or if you need to remove ambiguities about -the end of the link, enclose them in square brackets. - - ---------- Footnotes ---------- - - (1) The actual behavior of the search will depend on the value of -the option `org-link-search-must-match-exact-headline'. If its value -is `nil', then a fuzzy text search will be done. If it is `t', then -only the exact headline will be matched, ignoring spaces and cookies. -If the value is `query-to-create', then an exact headline will be -searched; if it is not found, then the user will be queried to create -it. - - (2) Headline searches always match the exact headline, ignoring -spaces and cookies. If the headline is not found and the value of the -option `org-link-search-must-match-exact-headline' is `query-to-create', -then the user will be queried to create it. - - -File: org, Node: Handling links, Next: Using links outside Org, Prev: External links, Up: Hyperlinks - -4.4 Handling links -================== - -Org provides methods to create a link in the correct syntax, to insert -it into an Org file, and to follow the link. - -`C-c l (`org-store-link')' - Store a link to the current location. This is a _global_ command - (you must create the key binding yourself) which can be used in - any buffer to create a link. The link will be stored for later - insertion into an Org buffer (see below). What kind of link will - be created depends on the current buffer: - - Org mode buffers - For Org files, if there is a `<>' at the cursor, the link - points to the target. Otherwise it points to the current - headline, which will also be the description(1). - - If the headline has a `CUSTOM_ID' property, a link to this custom - ID will be stored. In addition or alternatively (depending on the - value of `org-id-link-to-org-use-id'), a globally unique `ID' - property will be created and/or used to construct a link(2). So - using this command in Org buffers will potentially create two - links: a human-readable from the custom ID, and one that is - globally unique and works even if the entry is moved from file to - file. Later, when inserting the link, you need to decide which - one to use. - - Email/News clients: VM, Rmail, Wanderlust, MH-E, Gnus - Pretty much all Emacs mail clients are supported. The link will - point to the current article, or, in some GNUS buffers, to the - group. The description is constructed from the author and the - subject. - - Web browsers: Eww, W3 and W3M - Here the link will be the current URL, with the page title as - description. - - Contacts: BBDB - Links created in a BBDB buffer will point to the current entry. - - Chat: IRC - For IRC links, if you set the option `org-irc-link-to-logs' to `t', - a `file:/' style link to the relevant point in the logs for the - current conversation is created. Otherwise an `irc:/' style link - to the user/channel/server under the point will be stored. - - Other files - For any other files, the link will point to the file, with a - search string (*note Search options::) pointing to the contents of - the current line. If there is an active region, the selected - words will form the basis of the search string. If the - automatically created link is not working correctly or accurately - enough, you can write custom functions to select the search string - and to do the search for particular file types--see *note Custom - searches::. The key binding `C-c l' is only a suggestion--see - *note Installation::. - - Agenda view - When the cursor is in an agenda view, the created link points to - the entry referenced by the current line. - -`C-c C-l (`org-insert-link')' - Insert a link(3). This prompts for a link to be inserted into the - buffer. You can just type a link, using text for an internal - link, or one of the link type prefixes mentioned in the examples - above. The link will be inserted into the buffer(4), along with a - descriptive text. If some text was selected when this command is - called, the selected text becomes the default description. - - Inserting stored links - All links stored during the current session are part of the - history for this prompt, so you can access them with and - (or `M-p/n'). - - Completion support - Completion with will help you to insert valid link prefixes - like `https:', including the prefixes defined through link - abbreviations (*note Link abbreviations::). If you press - after inserting only the PREFIX, Org will offer specific - completion support for some link types(5) For example, if you - type `file ', file name completion (alternative access: `C-u - C-c C-l', see below) will be offered, and after `bbdb ' you - can complete contact names. - -`C-u C-c C-l' - When `C-c C-l' is called with a `C-u' prefix argument, a link to a - file will be inserted and you may use file name completion to - select the name of the file. The path to the file is inserted - relative to the directory of the current Org file, if the linked - file is in the current directory or in a sub-directory of it, or - if the path is written relative to the current directory using - `../'. Otherwise an absolute path is used, if possible with `~/' - for your home directory. You can force an absolute path with two - `C-u' prefixes. - -`C-c C-l (with cursor on existing link)' - When the cursor is on an existing link, `C-c C-l' allows you to - edit the link and description parts of the link. - -`C-c C-o (`org-open-at-point')' - Open link at point. This will launch a web browser for URLs (using - `browse-url-at-point'), run VM/MH-E/Wanderlust/Rmail/Gnus/BBDB for - the corresponding links, and execute the command in a shell link. - When the cursor is on an internal link, this command runs the - corresponding search. When the cursor is on a TAG list in a - headline, it creates the corresponding TAGS view. If the cursor - is on a timestamp, it compiles the agenda for that date. - Furthermore, it will visit text and remote files in `file:' links - with Emacs and select a suitable application for local non-text - files. Classification of files is based on file extension only. - See option `org-file-apps'. If you want to override the default - application and visit the file with Emacs, use a `C-u' prefix. If - you want to avoid opening in Emacs, use a `C-u C-u' prefix. - If the cursor is on a headline, but not on a link, offer all links - in the headline and entry text. If you want to setup the frame - configuration for following links, customize - `org-link-frame-setup'. - -`' - When `org-return-follows-link' is set, `' will also follow - the link at point. - -`mouse-2' -`mouse-1' - On links, `mouse-1' and `mouse-2' will open the link just as `C-c - C-o' would. - -`mouse-3' - Like `mouse-2', but force file links to be opened with Emacs, and - internal links to be displayed in another window(6). - -`C-c C-x C-v (`org-toggle-inline-images')' - Toggle the inline display of linked images. Normally this will - only inline images that have no description part in the link, - i.e., images that will also be inlined during export. When called - with a prefix argument, also display images that do have a link - description. You can ask for inline images to be displayed at - startup by configuring the variable - `org-startup-with-inline-images'(7). - -`C-c % (`org-mark-ring-push')' - Push the current position onto the mark ring, to be able to return - easily. Commands following an internal link do this automatically. - -`C-c & (`org-mark-ring-goto')' - Jump back to a recorded position. A position is recorded by the - commands following internal links, and by `C-c %'. Using this - command several times in direct succession moves through a ring of - previously recorded positions. - -`C-c C-x C-n (`org-next-link')' -`C-c C-x C-p (`org-previous-link')' - Move forward/backward to the next link in the buffer. At the - limit of the buffer, the search fails once, and then wraps around. - The key bindings for this are really too long; you might want to - bind this also to `C-n' and `C-p' - (add-hook 'org-load-hook - (lambda () - (define-key org-mode-map "\C-n" 'org-next-link) - (define-key org-mode-map "\C-p" 'org-previous-link))) - - ---------- Footnotes ---------- - - (1) If the headline contains a timestamp, it will be removed from -the link and result in a wrong link--you should avoid putting timestamp -in the headline. - - (2) The library `org-id.el' must first be loaded, either through -`org-customize' by enabling `org-id' in `org-modules', or by adding -`(require 'org-id)' in your Emacs init file. - - (3) Note that you don't have to use this command to insert a link. -Links in Org are plain text, and you can type or paste them straight -into the buffer. By using this command, the links are automatically -enclosed in double brackets, and you will be asked for the optional -descriptive text. - - (4) After insertion of a stored link, the link will be removed from -the list of stored links. To keep it in the list later use, use a -triple `C-u' prefix argument to `C-c C-l', or configure the option -`org-keep-stored-link-after-insertion'. - - (5) This works if a completion function is defined in the -`:complete' property of a link in `org-link-parameters'. - - (6) See the option `org-display-internal-link-with-indirect-buffer' - - (7) with corresponding `#+STARTUP' keywords `inlineimages' and -`noinlineimages' - - -File: org, Node: Using links outside Org, Next: Link abbreviations, Prev: Handling links, Up: Hyperlinks - -4.5 Using links outside Org -=========================== - -You can insert and follow links that have Org syntax not only in Org, -but in any Emacs buffer. For this, you should create two global -commands, like this (please select suitable global keys yourself): - - (global-set-key "\C-c L" 'org-insert-link-global) - (global-set-key "\C-c o" 'org-open-at-point-global) - - -File: org, Node: Link abbreviations, Next: Search options, Prev: Using links outside Org, Up: Hyperlinks - -4.6 Link abbreviations -====================== - -Long URLs can be cumbersome to type, and often many similar links are -needed in a document. For this you can use link abbreviations. An -abbreviated link looks like this - - [[linkword:tag][description]] - -where the tag is optional. The linkword must be a word, starting with -a letter, followed by letters, numbers, `-', and `_'. Abbreviations -are resolved according to the information in the variable -`org-link-abbrev-alist' that relates the linkwords to replacement text. -Here is an example: - - (setq org-link-abbrev-alist - '(("bugzilla" . "http://10.1.2.9/bugzilla/show_bug.cgi?id=") - ("url-to-ja" . "http://translate.google.fr/translate?sl=en&tl=ja&u=%h") - ("google" . "http://www.google.com/search?q=") - ("gmap" . "http://maps.google.com/maps?q=%s") - ("omap" . "http://nominatim.openstreetmap.org/search?q=%s&polygon=1") - ("ads" . "http://adsabs.harvard.edu/cgi-bin/nph-abs_connect?author=%s&db_key=AST"))) - - If the replacement text contains the string `%s', it will be -replaced with the tag. Using `%h' instead of `%s' will url-encode the -tag (see the example above, where we need to encode the URL parameter.) -Using `%(my-function)' will pass the tag to a custom function, and -replace it by the resulting string. - - If the replacement text doesn't contain any specifier, the tag will -simply be appended in order to create the link. - - Instead of a string, you may also specify a function that will be -called with the tag as the only argument to create the link. - - With the above setting, you could link to a specific bug with -`[[bugzilla:129]]', search the web for `OrgMode' with -`[[google:OrgMode]]', show the map location of the Free Software -Foundation `[[gmap:51 Franklin Street, Boston]]' or of Carsten office -`[[omap:Science Park 904, Amsterdam, The Netherlands]]' and find out -what the Org author is doing besides Emacs hacking with -`[[ads:Dominik,C]]'. - - If you need special abbreviations just for a single Org buffer, you -can define them in the file with - - #+LINK: bugzilla http://10.1.2.9/bugzilla/show_bug.cgi?id= - #+LINK: google http://www.google.com/search?q=%s - -In-buffer completion (*note Completion::) can be used after `[' to -complete link abbreviations. You may also define a function that -implements special (e.g., completion) support for inserting such a link -with `C-c C-l'. Such a function should not accept any arguments, and -return the full link with prefix. You can add a completion function to -a link like this: - - (org-link-set-parameters ``type'' :complete #'some-function) - - -File: org, Node: Search options, Next: Custom searches, Prev: Link abbreviations, Up: Hyperlinks - -4.7 Search options in file links -================================ - -File links can contain additional information to make Emacs jump to a -particular location in the file when following a link. This can be a -line number or a search option after a double(1) colon. For example, -when the command `C-c l' creates a link (*note Handling links::) to a -file, it encodes the words in the current line as a search string that -can be used to find this line back later when following the link with -`C-c C-o'. - - Here is the syntax of the different ways to attach a search to a file -link, together with an explanation: - - [[file:~/code/main.c::255]] - [[file:~/xx.org::My Target]] - [[file:~/xx.org::*My Target]] - [[file:~/xx.org::#my-custom-id]] - [[file:~/xx.org::/regexp/]] - -`255' - Jump to line 255. - -`My Target' - Search for a link target `<>', or do a text search for - `my target', similar to the search in internal links, see *note - Internal links::. In HTML export (*note HTML export::), such a - file link will become an HTML reference to the corresponding named - anchor in the linked file. - -`*My Target' - In an Org file, restrict search to headlines. - -`#my-custom-id' - Link to a heading with a `CUSTOM_ID' property - -`/regexp/' - Do a regular expression search for `regexp'. This uses the Emacs - command `occur' to list all matches in a separate window. If the - target file is in Org mode, `org-occur' is used to create a sparse - tree with the matches. - - As a degenerate case, a file link with an empty file name can be used -to search the current file. For example, `[[file:::find me]]' does a -search for `find me' in the current file, just as `[[find me]]' would. - - ---------- Footnotes ---------- - - (1) For backward compatibility, line numbers can also follow a -single colon. - - -File: org, Node: Custom searches, Prev: Search options, Up: Hyperlinks - -4.8 Custom Searches -=================== - -The default mechanism for creating search strings and for doing the -actual search related to a file link may not work correctly in all -cases. For example, BibTeX database files have many entries like -`year="1993"' which would not result in good search strings, because -the only unique identification for a BibTeX entry is the citation key. - - If you come across such a problem, you can write custom functions to -set the right search string for a particular file type, and to do the -search for the string in the file. Using `add-hook', these functions -need to be added to the hook variables -`org-create-file-search-functions' and -`org-execute-file-search-functions'. See the docstring for these -variables for more information. Org actually uses this mechanism for -BibTeX database files, and you can use the corresponding code as an -implementation example. See the file `org-bibtex.el'. - - -File: org, Node: TODO items, Next: Tags, Prev: Hyperlinks, Up: Top - -5 TODO items -************ - -Org mode does not maintain TODO lists as separate documents(1). -Instead, TODO items are an integral part of the notes file, because -TODO items usually come up while taking notes! With Org mode, simply -mark any entry in a tree as being a TODO item. In this way, -information is not duplicated, and the entire context from which the -TODO item emerged is always present. - - Of course, this technique for managing TODO items scatters them -throughout your notes file. Org mode compensates for this by providing -methods to give you an overview of all the things that you have to do. - -* Menu: - -* TODO basics:: Marking and displaying TODO entries -* TODO extensions:: Workflow and assignments -* Progress logging:: Dates and notes for progress -* Priorities:: Some things are more important than others -* Breaking down tasks:: Splitting a task into manageable pieces -* Checkboxes:: Tick-off lists - - ---------- Footnotes ---------- - - (1) Of course, you can make a document that contains only long lists -of TODO items, but this is not required. - - -File: org, Node: TODO basics, Next: TODO extensions, Up: TODO items - -5.1 Basic TODO functionality -============================ - -Any headline becomes a TODO item when it starts with the word `TODO', -for example: - - *** TODO Write letter to Sam Fortune - -The most important commands to work with TODO entries are: - -`C-c C-t (`org-todo')' - Rotate the TODO state of the current item among - - ,-> (unmarked) -> TODO -> DONE --. - '--------------------------------' - - If TODO keywords have fast access keys (see *note Fast access to - TODO states::), you will be prompted for a TODO keyword through - the fast selection interface; this is the default behavior when - `org-use-fast-todo-selection' is non-`nil'. - - The same rotation can also be done "remotely" from agenda buffers - with the `t' command key (*note Agenda commands::). - -`C-u C-c C-t' - When TODO keywords have no selection keys, select a specific - keyword using completion; otherwise force cycling through TODO - states with no prompt. When `org-use-fast-todo-selection' is set - to `prefix', use the fast selection interface. - -`S- / S-' - Select the following/preceding TODO state, similar to cycling. - Useful mostly if more than two TODO states are possible (*note - TODO extensions::). See also *note Conflicts::, for a discussion - of the interaction with `shift-selection-mode'. See also the - variable `org-treat-S-cursor-todo-selection-as-state-change'. - -`C-c / t (`org-show-todo-tree')' - View TODO items in a _sparse tree_ (*note Sparse trees::). Folds - the entire buffer, but shows all TODO items (with not-DONE state) - and the headings hierarchy above them. With a prefix argument (or - by using `C-c / T'), search for a specific TODO. You will be - prompted for the keyword, and you can also give a list of keywords - like `KWD1|KWD2|...' to list entries that match any one of these - keywords. With a numeric prefix argument N, show the tree for the - Nth keyword in the option `org-todo-keywords'. With two prefix - arguments, find all TODO states, both un-done and done. - -`C-c a t (`org-todo-list')' - Show the global TODO list. Collects the TODO items (with not-DONE - states) from all agenda files (*note Agenda views::) into a single - buffer. The new buffer will be in `agenda-mode', which provides - commands to examine and manipulate the TODO entries from the new - buffer (*note Agenda commands::). *Note Global TODO list::, for - more information. - -`S-M- (`org-insert-todo-heading')' - Insert a new TODO entry below the current one. - -Changing a TODO state can also trigger tag changes. See the docstring -of the option `org-todo-state-tags-triggers' for details. - - -File: org, Node: TODO extensions, Next: Progress logging, Prev: TODO basics, Up: TODO items - -5.2 Extended use of TODO keywords -================================= - -By default, marked TODO entries have one of only two states: TODO and -DONE. Org mode allows you to classify TODO items in more complex ways -with _TODO keywords_ (stored in `org-todo-keywords'). With special -setup, the TODO keyword system can work differently in different files. - - Note that tags are another way to classify headlines in general and -TODO items in particular (*note Tags::). - -* Menu: - -* Workflow states:: From TODO to DONE in steps -* TODO types:: I do this, Fred does the rest -* Multiple sets in one file:: Mixing it all, and still finding your way -* Fast access to TODO states:: Single letter selection of a state -* Per-file keywords:: Different files, different requirements -* Faces for TODO keywords:: Highlighting states -* TODO dependencies:: When one task needs to wait for others - - -File: org, Node: Workflow states, Next: TODO types, Up: TODO extensions - -5.2.1 TODO keywords as workflow states --------------------------------------- - -You can use TODO keywords to indicate different _sequential_ states in -the process of working on an item, for example(1): - - (setq org-todo-keywords - '((sequence "TODO" "FEEDBACK" "VERIFY" "|" "DONE" "DELEGATED"))) - - The vertical bar separates the TODO keywords (states that _need -action_) from the DONE states (which need _no further action_). If you -don't provide the separator bar, the last state is used as the DONE -state. With this setup, the command `C-c C-t' will cycle an entry from -TODO to FEEDBACK, then to VERIFY, and finally to DONE and DELEGATED. -You may also use a numeric prefix argument to quickly select a specific -state. For example `C-3 C-c C-t' will change the state immediately to -VERIFY. Or you can use `S-' to go backward through the sequence. -If you define many keywords, you can use in-buffer completion (*note -Completion::) or even a special one-key selection scheme (*note Fast -access to TODO states::) to insert these words into the buffer. -Changing a TODO state can be logged with a timestamp, see *note -Tracking TODO state changes::, for more information. - - ---------- Footnotes ---------- - - (1) Changing this variable only becomes effective after restarting -Org mode in a buffer. - - -File: org, Node: TODO types, Next: Multiple sets in one file, Prev: Workflow states, Up: TODO extensions - -5.2.2 TODO keywords as types ----------------------------- - -The second possibility is to use TODO keywords to indicate different -_types_ of action items. For example, you might want to indicate that -items are for "work" or "home". Or, when you work with several people -on a single project, you might want to assign action items directly to -persons, by using their names as TODO keywords. This would be set up -like this: - - (setq org-todo-keywords '((type "Fred" "Sara" "Lucy" "|" "DONE"))) - - In this case, different keywords do not indicate a sequence, but -rather different types. So the normal work flow would be to assign a -task to a person, and later to mark it DONE. Org mode supports this -style by adapting the workings of the command `C-c C-t'(1). When used -several times in succession, it will still cycle through all names, in -order to first select the right type for a task. But when you return -to the item after some time and execute `C-c C-t' again, it will switch -from any name directly to DONE. Use prefix arguments or completion to -quickly select a specific name. You can also review the items of a -specific TODO type in a sparse tree by using a numeric prefix to `C-c / -t'. For example, to see all things Lucy has to do, you would use `C-3 -C-c / t'. To collect Lucy's items from all agenda files into a single -buffer, you would use the numeric prefix argument as well when creating -the global TODO list: `C-3 C-c a t'. - - ---------- Footnotes ---------- - - (1) This is also true for the `t' command in the agenda buffers. - - -File: org, Node: Multiple sets in one file, Next: Fast access to TODO states, Prev: TODO types, Up: TODO extensions - -5.2.3 Multiple keyword sets in one file ---------------------------------------- - -Sometimes you may want to use different sets of TODO keywords in -parallel. For example, you may want to have the basic `TODO'/`DONE', -but also a workflow for bug fixing, and a separate state indicating -that an item has been canceled (so it is not DONE, but also does not -require action). Your setup would then look like this: - - (setq org-todo-keywords - '((sequence "TODO" "|" "DONE") - (sequence "REPORT" "BUG" "KNOWNCAUSE" "|" "FIXED") - (sequence "|" "CANCELED"))) - - The keywords should all be different, this helps Org mode to keep -track of which subsequence should be used for a given entry. In this -setup, `C-c C-t' only operates within a subsequence, so it switches from -`DONE' to (nothing) to `TODO', and from `FIXED' to (nothing) to -`REPORT'. Therefore you need a mechanism to initially select the -correct sequence. Besides the obvious ways like typing a keyword or -using completion, you may also apply the following commands: - -`C-u C-u C-c C-t' -`C-S-' -`C-S-' - These keys jump from one TODO subset to the next. In the above - example, `C-u C-u C-c C-t' or `C-S-' would jump from `TODO' - or `DONE' to `REPORT', and any of the words in the second row to - `CANCELED'. Note that the `C-S-' key binding conflict with - `shift-selection-mode' (*note Conflicts::). - -`S-' -`S-' - `S-' and `S-' and walk through _all_ keywords from - all sets, so for example `S-' would switch from `DONE' to - `REPORT' in the example above. See also *note Conflicts::, for a - discussion of the interaction with `shift-selection-mode'. - - -File: org, Node: Fast access to TODO states, Next: Per-file keywords, Prev: Multiple sets in one file, Up: TODO extensions - -5.2.4 Fast access to TODO states --------------------------------- - -If you would like to quickly change an entry to an arbitrary TODO state -instead of cycling through the states, you can set up keys for -single-letter access to the states. This is done by adding the -selection character after each keyword, in parentheses(1). For example: - - (setq org-todo-keywords - '((sequence "TODO(t)" "|" "DONE(d)") - (sequence "REPORT(r)" "BUG(b)" "KNOWNCAUSE(k)" "|" "FIXED(f)") - (sequence "|" "CANCELED(c)"))) - - If you then press `C-c C-t' followed by the selection key, the entry -will be switched to this state. `SPC' can be used to remove any TODO -keyword from an entry.(2) - - ---------- Footnotes ---------- - - (1) All characters are allowed except `@^!', which have a special -meaning here. - - (2) Check also the option `org-fast-tag-selection-include-todo', it -allows you to change the TODO state through the tags interface (*note -Setting tags::), in case you like to mingle the two concepts. Note -that this means you need to come up with unique keys across both sets -of keywords. - - -File: org, Node: Per-file keywords, Next: Faces for TODO keywords, Prev: Fast access to TODO states, Up: TODO extensions - -5.2.5 Setting up keywords for individual files ----------------------------------------------- - -It can be very useful to use different aspects of the TODO mechanism in -different files. For file-local settings, you need to add special -lines to the file which set the keywords and interpretation for that -file only. For example, to set one of the two examples discussed -above, you need one of the following lines anywhere in the file: - - #+TODO: TODO FEEDBACK VERIFY | DONE CANCELED - (you may also write `#+SEQ_TODO' to be explicit about the -interpretation, but it means the same as `#+TODO'), or - #+TYP_TODO: Fred Sara Lucy Mike | DONE - - A setup for using several sets in parallel would be: - - #+TODO: TODO | DONE - #+TODO: REPORT BUG KNOWNCAUSE | FIXED - #+TODO: | CANCELED - -To make sure you are using the correct keyword, type `#+' into the -buffer and then use `M-' completion. - - Remember that the keywords after the vertical bar (or the last -keyword if no bar is there) must always mean that the item is DONE -(although you may use a different word). After changing one of these -lines, use `C-c C-c' with the cursor still in the line to make the -changes known to Org mode(1). - - ---------- Footnotes ---------- - - (1) Org mode parses these lines only when Org mode is activated -after visiting a file. `C-c C-c' with the cursor in a line starting -with `#+' is simply restarting Org mode for the current buffer. - - -File: org, Node: Faces for TODO keywords, Next: TODO dependencies, Prev: Per-file keywords, Up: TODO extensions - -5.2.6 Faces for TODO keywords ------------------------------ - -Org mode highlights TODO keywords with special faces: `org-todo' for -keywords indicating that an item still has to be acted upon, and -`org-done' for keywords indicating that an item is finished. If you -are using more than 2 different states, you might want to use special -faces for some of them. This can be done using the option -`org-todo-keyword-faces'. For example: - - (setq org-todo-keyword-faces - '(("TODO" . org-warning) ("STARTED" . "yellow") - ("CANCELED" . (:foreground "blue" :weight bold)))) - - While using a list with face properties as shown for CANCELED -_should_ work, this does not always seem to be the case. If necessary, -define a special face and use that. A string is interpreted as a -color. The option `org-faces-easy-properties' determines if that color -is interpreted as a foreground or a background color. - - -File: org, Node: TODO dependencies, Prev: Faces for TODO keywords, Up: TODO extensions - -5.2.7 TODO dependencies ------------------------ - -The structure of Org files (hierarchy and lists) makes it easy to -define TODO dependencies. Usually, a parent TODO task should not be -marked DONE until all subtasks (defined as children tasks) are marked -as DONE. And sometimes there is a logical sequence to a number of -(sub)tasks, so that one task cannot be acted upon before all siblings -above it are done. If you customize the option -`org-enforce-todo-dependencies', Org will block entries from changing -state to DONE while they have children that are not DONE. Furthermore, -if an entry has a property `ORDERED', each of its children will be -blocked until all earlier siblings are marked DONE. Here is an example: - - * TODO Blocked until (two) is done - ** DONE one - ** TODO two - - * Parent - :PROPERTIES: - :ORDERED: t - :END: - ** TODO a - ** TODO b, needs to wait for (a) - ** TODO c, needs to wait for (a) and (b) - - You can ensure an entry is never blocked by using the `NOBLOCKING' -property: - - * This entry is never blocked - :PROPERTIES: - :NOBLOCKING: t - :END: - -`C-c C-x o (`org-toggle-ordered-property')' - Toggle the `ORDERED' property of the current entry. A property is - used for this behavior because this should be local to the current - entry, not inherited like a tag. However, if you would like to - track the value of this property with a tag for better visibility, - customize the option `org-track-ordered-property-with-tag'. - -`C-u C-u C-u C-c C-t' - Change TODO state, circumventing any state blocking. - - If you set the option `org-agenda-dim-blocked-tasks', TODO entries -that cannot be closed because of such dependencies will be shown in a -dimmed font or even made invisible in agenda views (*note Agenda -views::). - - You can also block changes of TODO states by looking at checkboxes -(*note Checkboxes::). If you set the option -`org-enforce-todo-checkbox-dependencies', an entry that has unchecked -checkboxes will be blocked from switching to DONE. - - If you need more complex dependency structures, for example -dependencies between entries in different trees or files, check out the -contributed module `org-depend.el'. - - -File: org, Node: Progress logging, Next: Priorities, Prev: TODO extensions, Up: TODO items - -5.3 Progress logging -==================== - -Org mode can automatically record a timestamp and possibly a note when -you mark a TODO item as DONE, or even each time you change the state of -a TODO item. This system is highly configurable; settings can be on a -per-keyword basis and can be localized to a file or even a subtree. For -information on how to clock working time for a task, see *note Clocking -work time::. - -* Menu: - -* Closing items:: When was this entry marked DONE? -* Tracking TODO state changes:: When did the status change? -* Tracking your habits:: How consistent have you been? - - -File: org, Node: Closing items, Next: Tracking TODO state changes, Up: Progress logging - -5.3.1 Closing items -------------------- - -The most basic logging is to keep track of _when_ a certain TODO item -was finished. This is achieved with(1) - - (setq org-log-done 'time) - -Then each time you turn an entry from a TODO (not-done) state into any -of the DONE states, a line `CLOSED: [timestamp]' will be inserted just -after the headline. If you turn the entry back into a TODO item -through further state cycling, that line will be removed again. If you -turn the entry back to a non-TODO state (by pressing for -example), that line will also be removed, unless you set -`org-closed-keep-when-no-todo' to non-`nil'. If you want to record a -note along with the timestamp, use(2) - - (setq org-log-done 'note) - -You will then be prompted for a note, and that note will be stored below -the entry with a `Closing Note' heading. - - ---------- Footnotes ---------- - - (1) The corresponding in-buffer setting is: `#+STARTUP: logdone' - - (2) The corresponding in-buffer setting is: `#+STARTUP: lognotedone'. - - -File: org, Node: Tracking TODO state changes, Next: Tracking your habits, Prev: Closing items, Up: Progress logging - -5.3.2 Tracking TODO state changes ---------------------------------- - -When TODO keywords are used as workflow states (*note Workflow -states::), you might want to keep track of when a state change occurred -and maybe take a note about this change. You can either record just a -timestamp, or a time-stamped note for a change. These records will be -inserted after the headline as an itemized list, newest first(1). When -taking a lot of notes, you might want to get the notes out of the way -into a drawer (*note Drawers::). Customize `org-log-into-drawer' to -get this behavior--the recommended drawer for this is called -`LOGBOOK'(2). You can also overrule the setting of this variable for a -subtree by setting a `LOG_INTO_DRAWER' property. - - Since it is normally too much to record a note for every state, Org -mode expects configuration on a per-keyword basis for this. This is -achieved by adding special markers `!' (for a timestamp) or `@' (for a -note with timestamp) in parentheses after each keyword. For example, -with the setting - - (setq org-todo-keywords - '((sequence "TODO(t)" "WAIT(w@/!)" "|" "DONE(d!)" "CANCELED(c@)"))) - - To record a timestamp without a note for TODO keywords configured -with `@', just type `C-c C-c' to enter a blank note when prompted. - -You not only define global TODO keywords and fast access keys, but also -request that a time is recorded when the entry is set to DONE(3), and -that a note is recorded when switching to WAIT or CANCELED. The -setting for WAIT is even more special: the `!' after the slash means -that in addition to the note taken when entering the state, a timestamp -should be recorded when leaving the WAIT state, if and only if the -target state does not configure logging for entering it. So it has no -effect when switching from WAIT to DONE, because DONE is configured to -record a timestamp only. But when switching from WAIT back to TODO, -the `/!' in the WAIT setting now triggers a timestamp even though TODO -has no logging configured. - - You can use the exact same syntax for setting logging preferences -local to a buffer: - #+TODO: TODO(t) WAIT(w@/!) | DONE(d!) CANCELED(c@) - - In order to define logging settings that are local to a subtree or a -single item, define a LOGGING property in this entry. Any non-empty -LOGGING property resets all logging settings to `nil'. You may then -turn on logging for this specific tree using STARTUP keywords like -`lognotedone' or `logrepeat', as well as adding state specific settings -like `TODO(!)'. For example - - * TODO Log each state with only a time - :PROPERTIES: - :LOGGING: TODO(!) WAIT(!) DONE(!) CANCELED(!) - :END: - * TODO Only log when switching to WAIT, and when repeating - :PROPERTIES: - :LOGGING: WAIT(@) logrepeat - :END: - * TODO No logging at all - :PROPERTIES: - :LOGGING: nil - :END: - - ---------- Footnotes ---------- - - (1) See the option `org-log-states-order-reversed' - - (2) Note that the `LOGBOOK' drawer is unfolded when pressing -in the agenda to show an entry--use to keep it folded here - - (3) It is possible that Org mode will record two timestamps when you -are using both `org-log-done' and state change logging. However, it -will never prompt for two notes--if you have configured both, the state -change recording note will take precedence and cancel the `Closing -Note'. - - -File: org, Node: Tracking your habits, Prev: Tracking TODO state changes, Up: Progress logging - -5.3.3 Tracking your habits --------------------------- - -Org has the ability to track the consistency of a special category of -TODOs, called "habits". A habit has the following properties: - - 1. You have enabled the `habits' module by customizing `org-modules'. - - 2. The habit is a TODO item, with a TODO keyword representing an open - state. - - 3. The property `STYLE' is set to the value `habit'. - - 4. The TODO has a scheduled date, usually with a `.+' style repeat - interval. A `++' style may be appropriate for habits with time - constraints, e.g., must be done on weekends, or a `+' style for an - unusual habit that can have a backlog, e.g., weekly reports. - - 5. The TODO may also have minimum and maximum ranges specified by - using the syntax `.+2d/3d', which says that you want to do the - task at least every three days, but at most every two days. - - 6. You must also have state logging for the `DONE' state enabled - (*note Tracking TODO state changes::), in order for historical - data to be represented in the consistency graph. If it is not - enabled it is not an error, but the consistency graphs will be - largely meaningless. - - To give you an idea of what the above rules look like in action, -here's an actual habit with some history: - - ** TODO Shave - SCHEDULED: <2009-10-17 Sat .+2d/4d> - :PROPERTIES: - :STYLE: habit - :LAST_REPEAT: [2009-10-19 Mon 00:36] - :END: - - State "DONE" from "TODO" [2009-10-15 Thu] - - State "DONE" from "TODO" [2009-10-12 Mon] - - State "DONE" from "TODO" [2009-10-10 Sat] - - State "DONE" from "TODO" [2009-10-04 Sun] - - State "DONE" from "TODO" [2009-10-02 Fri] - - State "DONE" from "TODO" [2009-09-29 Tue] - - State "DONE" from "TODO" [2009-09-25 Fri] - - State "DONE" from "TODO" [2009-09-19 Sat] - - State "DONE" from "TODO" [2009-09-16 Wed] - - State "DONE" from "TODO" [2009-09-12 Sat] - - What this habit says is: I want to shave at most every 2 days (given -by the `SCHEDULED' date and repeat interval) and at least every 4 days. -If today is the 15th, then the habit first appears in the agenda on Oct -17, after the minimum of 2 days has elapsed, and will appear overdue on -Oct 19, after four days have elapsed. - - What's really useful about habits is that they are displayed along -with a consistency graph, to show how consistent you've been at getting -that task done in the past. This graph shows every day that the task -was done over the past three weeks, with colors for each day. The -colors used are: - -`Blue' - If the task wasn't to be done yet on that day. - -`Green' - If the task could have been done on that day. - -`Yellow' - If the task was going to be overdue the next day. - -`Red' - If the task was overdue on that day. - - In addition to coloring each day, the day is also marked with an -asterisk if the task was actually done that day, and an exclamation -mark to show where the current day falls in the graph. - - There are several configuration variables that can be used to change -the way habits are displayed in the agenda. - -`org-habit-graph-column' - The buffer column at which the consistency graph should be drawn. - This will overwrite any text in that column, so it is a good idea - to keep your habits' titles brief and to the point. - -`org-habit-preceding-days' - The amount of history, in days before today, to appear in - consistency graphs. - -`org-habit-following-days' - The number of days after today that will appear in consistency - graphs. - -`org-habit-show-habits-only-for-today' - If non-`nil', only show habits in today's agenda view. This is - set to true by default. - - Lastly, pressing `K' in the agenda buffer will cause habits to -temporarily be disabled and they won't appear at all. Press `K' again -to bring them back. They are also subject to tag filtering, if you -have habits which should only be done in certain contexts, for example. - - -File: org, Node: Priorities, Next: Breaking down tasks, Prev: Progress logging, Up: TODO items - -5.4 Priorities -============== - -If you use Org mode extensively, you may end up with enough TODO items -that it starts to make sense to prioritize them. Prioritizing can be -done by placing a _priority cookie_ into the headline of a TODO item, -like this - - *** TODO [#A] Write letter to Sam Fortune - -By default, Org mode supports three priorities: `A', `B', and `C'. `A' -is the highest priority. An entry without a cookie is treated just -like priority `B'. Priorities make a difference only for sorting in -the agenda (*note Weekly/daily agenda::); outside the agenda, they have -no inherent meaning to Org mode. The cookies can be highlighted with -special faces by customizing `org-priority-faces'. - - Priorities can be attached to any outline node; they do not need to -be TODO items. - -`C-c ,' - Set the priority of the current headline (`org-priority'). The - command prompts for a priority character `A', `B' or `C'. When - you press instead, the priority cookie is removed from the - headline. The priorities can also be changed "remotely" from the - agenda buffer with the `,' command (*note Agenda commands::). - -`S- (`org-priority-up')' -`S- (`org-priority-down')' - Increase/decrease priority of current headline(1). Note that - these keys are also used to modify timestamps (*note Creating - timestamps::). See also *note Conflicts::, for a discussion of - the interaction with `shift-selection-mode'. - - You can change the range of allowed priorities by setting the options -`org-highest-priority', `org-lowest-priority', and -`org-default-priority'. For an individual buffer, you may set these -values (highest, lowest, default) like this (please make sure that the -highest priority is earlier in the alphabet than the lowest priority): - - #+PRIORITIES: A C B - - ---------- Footnotes ---------- - - (1) See also the option `org-priority-start-cycle-with-default'. - - -File: org, Node: Breaking down tasks, Next: Checkboxes, Prev: Priorities, Up: TODO items - -5.5 Breaking tasks down into subtasks -===================================== - -It is often advisable to break down large tasks into smaller, manageable -subtasks. You can do this by creating an outline tree below a TODO -item, with detailed subtasks on the tree(1). To keep the overview over -the fraction of subtasks that are already completed, insert either -`[/]' or `[%]' anywhere in the headline. These cookies will be updated -each time the TODO status of a child changes, or when pressing `C-c -C-c' on the cookie. For example: - - * Organize Party [33%] - ** TODO Call people [1/2] - *** TODO Peter - *** DONE Sarah - ** TODO Buy food - ** DONE Talk to neighbor - - If a heading has both checkboxes and TODO children below it, the -meaning of the statistics cookie become ambiguous. Set the property -`COOKIE_DATA' to either `checkbox' or `todo' to resolve this issue. - - If you would like to have the statistics cookie count any TODO -entries in the subtree (not just direct children), configure -`org-hierarchical-todo-statistics'. To do this for a single subtree, -include the word `recursive' into the value of the `COOKIE_DATA' -property. - - * Parent capturing statistics [2/20] - :PROPERTIES: - :COOKIE_DATA: todo recursive - :END: - - If you would like a TODO entry to automatically change to DONE when -all children are done, you can use the following setup: - - (defun org-summary-todo (n-done n-not-done) - "Switch entry to DONE when all subentries are done, to TODO otherwise." - (let (org-log-done org-log-states) ; turn off logging - (org-todo (if (= n-not-done 0) "DONE" "TODO")))) - - (add-hook 'org-after-todo-statistics-hook 'org-summary-todo) - - Another possibility is the use of checkboxes to identify (a -hierarchy of) a large number of subtasks (*note Checkboxes::). - - ---------- Footnotes ---------- - - (1) To keep subtasks out of the global TODO list, see the -`org-agenda-todo-list-sublevels'. - - -File: org, Node: Checkboxes, Prev: Breaking down tasks, Up: TODO items - -5.6 Checkboxes -============== - -Every item in a plain list(1) (*note Plain lists::) can be made into a -checkbox by starting it with the string `[ ]'. This feature is similar -to TODO items (*note TODO items::), but is more lightweight. -Checkboxes are not included in the global TODO list, so they are often -great to split a task into a number of simple steps. Or you can use -them in a shopping list. To toggle a checkbox, use `C-c C-c', or use -the mouse (thanks to Piotr Zielinski's `org-mouse.el'). - - Here is an example of a checkbox list. - - * TODO Organize party [2/4] - - [-] call people [1/3] - - [ ] Peter - - [X] Sarah - - [ ] Sam - - [X] order food - - [ ] think about what music to play - - [X] talk to the neighbors - - Checkboxes work hierarchically, so if a checkbox item has children -that are checkboxes, toggling one of the children checkboxes will make -the parent checkbox reflect if none, some, or all of the children are -checked. - - The `[2/4]' and `[1/3]' in the first and second line are cookies -indicating how many checkboxes present in this entry have been checked -off, and the total number of checkboxes present. This can give you an -idea on how many checkboxes remain, even without opening a folded -entry. The cookies can be placed into a headline or into (the first -line of) a plain list item. Each cookie covers checkboxes of direct -children structurally below the headline/item on which the cookie -appears(2). You have to insert the cookie yourself by typing either -`[/]' or `[%]'. With `[/]' you get an `n out of m' result, as in the -examples above. With `[%]' you get information about the percentage of -checkboxes checked (in the above example, this would be `[50%]' and -`[33%]', respectively). In a headline, a cookie can count either -checkboxes below the heading or TODO states of children, and it will -display whatever was changed last. Set the property `COOKIE_DATA' to -either `checkbox' or `todo' to resolve this issue. - - If the current outline node has an `ORDERED' property, checkboxes -must be checked off in sequence, and an error will be thrown if you try -to check off a box while there are unchecked boxes above it. - -The following commands work with checkboxes: - -`C-c C-c (`org-toggle-checkbox')' - Toggle checkbox status or (with prefix arg) checkbox presence at - point. With a single prefix argument, add an empty checkbox or - remove the current one(3). With a double prefix argument, set it - to `[-]', which is considered to be an intermediate state. - -`C-c C-x C-b (`org-toggle-checkbox')' - Toggle checkbox status or (with prefix arg) checkbox presence at - point. With double prefix argument, set it to `[-]', which is - considered to be an intermediate state. - - If there is an active region, toggle the first checkbox in - the region and set all remaining boxes to the same status as - the first. With a prefix arg, add or remove the checkbox for - all items in the region. - - - If the cursor is in a headline, toggle the state of the first - checkbox in the region between this headline and the next--so - _not_ the entire subtree--and propagate this new state to all - other checkboxes in the same area. - - - If there is no active region, just toggle the checkbox at - point. - -`M-S- (`org-insert-todo-heading')' - Insert a new item with a checkbox. This works only if the cursor - is already in a plain list item (*note Plain lists::). - -`C-c C-x o (`org-toggle-ordered-property')' - Toggle the `ORDERED' property of the entry, to toggle if - checkboxes must be checked off in sequence. A property is used - for this behavior because this should be local to the current - entry, not inherited like a tag. However, if you would like to - track the value of this property with a tag for better visibility, - customize `org-track-ordered-property-with-tag'. - -`C-c # (`org-update-statistics-cookies')' - Update the statistics cookie in the current outline entry. When - called with a `C-u' prefix, update the entire file. Checkbox - statistic cookies are updated automatically if you toggle - checkboxes with `C-c C-c' and make new ones with `M-S-'. - TODO statistics cookies update when changing TODO states. If you - delete boxes/entries or add/change them by hand, use this command - to get things back into sync. - - ---------- Footnotes ---------- - - (1) With the exception of description lists. But you can allow it -by modifying `org-list-automatic-rules' accordingly. - - (2) Set the option `org-checkbox-hierarchical-statistics' if you -want such cookies to count all checkboxes below the cookie, not just -those belonging to direct children. - - (3) `C-u C-c C-c' before the _first_ bullet in a list with no -checkbox will add checkboxes to the rest of the list. - - -File: org, Node: Tags, Next: Properties and columns, Prev: TODO items, Up: Top - -6 Tags -****** - -An excellent way to implement labels and contexts for cross-correlating -information is to assign tags to headlines. Org mode has extensive -support for tags. - - Every headline can contain a list of tags; they occur at the end of -the headline. Tags are normal words containing letters, numbers, `_', -and `@'. Tags must be preceded and followed by a single colon, e.g., -`:work:'. Several tags can be specified, as in `:work:urgent:'. Tags -will by default be in bold face with the same color as the headline. -You may specify special faces for specific tags using the option -`org-tag-faces', in much the same way as you can for TODO keywords -(*note Faces for TODO keywords::). - -* Menu: - -* Tag inheritance:: Tags use the tree structure of the outline -* Setting tags:: How to assign tags to a headline -* Tag hierarchy:: Create a hierarchy of tags -* Tag searches:: Searching for combinations of tags - - -File: org, Node: Tag inheritance, Next: Setting tags, Up: Tags - -6.1 Tag inheritance -=================== - -Tags make use of the hierarchical structure of outline trees. If a -heading has a certain tag, all subheadings will inherit the tag as -well. For example, in the list - - * Meeting with the French group :work: - ** Summary by Frank :boss:notes: - *** TODO Prepare slides for him :action: - -the final heading will have the tags `:work:', `:boss:', `:notes:', and -`:action:' even though the final heading is not explicitly marked with -all those tags. You can also set tags that all entries in a file -should inherit just as if these tags were defined in a hypothetical -level zero that surrounds the entire file. Use a line like this(1): - - #+FILETAGS: :Peter:Boss:Secret: - -To limit tag inheritance to specific tags, use -`org-tags-exclude-from-inheritance'. To turn it off entirely, use -`org-use-tag-inheritance'. - - When a headline matches during a tags search while tag inheritance -is turned on, all the sublevels in the same tree will (for a simple -match form) match as well(2). The list of matches may then become very -long. If you only want to see the first tags match in a subtree, -configure `org-tags-match-list-sublevels' (not recommended). - - Tag inheritance is relevant when the agenda search tries to match a -tag, either in the `tags' or `tags-todo' agenda types. In other agenda -types, `org-use-tag-inheritance' has no effect. Still, you may want to -have your tags correctly set in the agenda, so that tag filtering works -fine, with inherited tags. Set `org-agenda-use-tag-inheritance' to -control this: the default value includes all agenda types, but setting -this to `nil' can really speed up agenda generation. - - ---------- Footnotes ---------- - - (1) As with all these in-buffer settings, pressing `C-c C-c' -activates any changes in the line. - - (2) This is only true if the search does not involve more complex -tests including properties (*note Property searches::). - - -File: org, Node: Setting tags, Next: Tag hierarchy, Prev: Tag inheritance, Up: Tags - -6.2 Setting tags -================ - -Tags can simply be typed into the buffer at the end of a headline. -After a colon, `M-' offers completion on tags. There is also a -special command for inserting tags: - -`C-c C-q (`org-set-tags-command')' - Enter new tags for the current headline. Org mode will either - offer completion or a special single-key interface for setting - tags, see below. After pressing , the tags will be inserted - and aligned to `org-tags-column'. When called with a `C-u' - prefix, all tags in the current buffer will be aligned to that - column, just to make things look nice. TAGS are automatically - realigned after promotion, demotion, and TODO state changes (*note - TODO basics::). - -`C-c C-c (`org-set-tags-command')' - When the cursor is in a headline, this does the same as `C-c C-q'. - - Org supports tag insertion based on a _list of tags_. By default -this list is constructed dynamically, containing all tags currently -used in the buffer. You may also globally specify a hard list of tags -with the variable `org-tag-alist'. Finally you can set the default -tags for a given file with lines like - - #+TAGS: @work @home @tennisclub - #+TAGS: laptop car pc sailboat - - If you have globally defined your preferred set of tags using the -variable `org-tag-alist', but would like to use a dynamic tag list in a -specific file, add an empty TAGS option line to that file: - - #+TAGS: - - If you have a preferred set of tags that you would like to use in -every file, in addition to those defined on a per-file basis by TAGS -option lines, then you may specify a list of tags with the variable -`org-tag-persistent-alist'. You may turn this off on a per-file basis -by adding a STARTUP option line to that file: - - #+STARTUP: noptag - - By default Org mode uses the standard minibuffer completion -facilities for entering tags. However, it also implements another, -quicker, tag selection method called _fast tag selection_. This allows -you to select and deselect tags with just a single key press. For this -to work well you should assign unique, case-sensitive, letters to most -of your commonly used tags. You can do this globally by configuring -the variable `org-tag-alist' in your Emacs init file. For example, you -may find the need to tag many items in different files with `:@home:'. -In this case you can set something like: - - (setq org-tag-alist '(("@work" . ?w) ("@home" . ?h) ("laptop" . ?l))) - -If the tag is only relevant to the file you are working on, then you -can instead set the TAGS option line as: - - #+TAGS: @work(w) @home(h) @tennisclub(t) laptop(l) pc(p) - -The tags interface will show the available tags in a splash window. If -you want to start a new line after a specific tag, insert `\n' into the -tag list - - #+TAGS: @work(w) @home(h) @tennisclub(t) \n laptop(l) pc(p) - -or write them in two lines: - - #+TAGS: @work(w) @home(h) @tennisclub(t) - #+TAGS: laptop(l) pc(p) - -You can also group together tags that are mutually exclusive by using -braces, as in: - - #+TAGS: { @work(w) @home(h) @tennisclub(t) } laptop(l) pc(p) - -you indicate that at most one of `@work', `@home', and `@tennisclub' -should be selected. Multiple such groups are allowed. - -Don't forget to press `C-c C-c' with the cursor in one of these lines -to activate any changes. - -To set these mutually exclusive groups in the variable `org-tag-alist', -you must use the dummy tags `:startgroup' and `:endgroup' instead of -the braces. Similarly, you can use `:newline' to indicate a line -break. The previous example would be set globally by the following -configuration: - - (setq org-tag-alist '((:startgroup . nil) - ("@work" . ?w) ("@home" . ?h) - ("@tennisclub" . ?t) - (:endgroup . nil) - ("laptop" . ?l) ("pc" . ?p))) - - If at least one tag has a selection key then pressing `C-c C-c' will -automatically present you with a special interface, listing inherited -tags, the tags of the current headline, and a list of all valid tags -with corresponding keys(1). - - Pressing keys assigned to tags will add or remove them from the list -of tags in the current line. Selecting a tag in a group of mutually -exclusive tags will turn off any other tags from that group. - - In this interface, you can also use the following special keys: - -`' - Enter a tag in the minibuffer, even if the tag is not in the - predefined list. You will be able to complete on all tags present - in the buffer. You can also add several tags: just separate them - with a comma. - -`' - Clear all tags for this line. - -`' - Accept the modified set. - -`C-g' - Abort without installing changes. - -`q' - If `q' is not assigned to a tag, it aborts like `C-g'. - -`!' - Turn off groups of mutually exclusive tags. Use this to (as an - exception) assign several tags from such a group. - -`C-c' - Toggle auto-exit after the next change (see below). If you are - using expert mode, the first `C-c' will display the selection - window. - -This method lets you assign tags to a headline with very few keys. With -the above setup, you could clear the current tags and set `@home', -`laptop' and `pc' tags with just the following keys: `C-c C-c h l -p '. Switching from `@home' to `@work' would be done with `C-c -C-c w ' or alternatively with `C-c C-c C-c w'. Adding the -non-predefined tag `Sarah' could be done with `C-c C-c S a r a h - '. - - If you find that most of the time you need only a single key press to -modify your list of tags, set `org-fast-tag-selection-single-key'. -Then you no longer have to press to exit fast tag selection--it -will immediately exit after the first change. If you then occasionally -need more keys, press `C-c' to turn off auto-exit for the current tag -selection process (in effect: start selection with `C-c C-c C-c' -instead of `C-c C-c'). If you set the variable to the value `expert', -the special window is not even shown for single-key tag selection, it -comes up only when you press an extra `C-c'. - - ---------- Footnotes ---------- - - (1) Keys will automatically be assigned to tags which have no -configured keys. - - -File: org, Node: Tag hierarchy, Next: Tag searches, Prev: Setting tags, Up: Tags - -6.3 Tag hierarchy -================= - -Tags can be defined in hierarchies. A tag can be defined as a _group -tag_ for a set of other tags. The group tag can be seen as the "broader -term" for its set of tags. Defining multiple _group tags_ and nesting -them creates a tag hierarchy. - - One use-case is to create a taxonomy of terms (tags) that can be -used to classify nodes in a document or set of documents. - - When you search for a group tag, it will return matches for all -members in the group and its subgroups. In an agenda view, filtering -by a group tag will display or hide headlines tagged with at least one -of the members of the group or any of its subgroups. This makes tag -searches and filters even more flexible. - - You can set group tags by using brackets and inserting a colon -between the group tag and its related tags--beware that all whitespaces -are mandatory so that Org can parse this line correctly: - - #+TAGS: [ GTD : Control Persp ] - - In this example, `GTD' is the _group tag_ and it is related to two -other tags: `Control', `Persp'. Defining `Control' and `Persp' as -group tags creates an hierarchy of tags: - - #+TAGS: [ Control : Context Task ] - #+TAGS: [ Persp : Vision Goal AOF Project ] - - That can conceptually be seen as a hierarchy of tags: - - - GTD - - Persp - - Vision - - Goal - - AOF - - Project - - Control - - Context - - Task - - You can use the `:startgrouptag', `:grouptags' and `:endgrouptag' -keyword directly when setting `org-tag-alist' directly: - - (setq org-tag-alist '((:startgrouptag) - ("GTD") - (:grouptags) - ("Control") - ("Persp") - (:endgrouptag) - (:startgrouptag) - ("Control") - (:grouptags) - ("Context") - ("Task") - (:endgrouptag))) - - The tags in a group can be mutually exclusive if using the same -group syntax as is used for grouping mutually exclusive tags together; -using curly brackets. - - #+TAGS: { Context : @Home @Work @Call } - - When setting `org-tag-alist' you can use `:startgroup' & `:endgroup' -instead of `:startgrouptag' & `:endgrouptag' to make the tags mutually -exclusive. - - Furthermore, the members of a _group tag_ can also be regular -expressions, creating the possibility of a more dynamic and rule-based -tag structure. The regular expressions in the group must be specified -within { }. Here is an expanded example: - - #+TAGS: [ Vision : {V@.+} ] - #+TAGS: [ Goal : {G@.+} ] - #+TAGS: [ AOF : {AOF@.+} ] - #+TAGS: [ Project : {P@.+} ] - - Searching for the tag `Project' will now list all tags also including -regular expression matches for `P@.+', and similarly for tag searches on -`Vision', `Goal' and `AOF'. For example, this would work well for a -project tagged with a common project-identifier, e.g. `P@2014_OrgTags'. - - If you want to ignore group tags temporarily, toggle group tags -support with `org-toggle-tags-groups', bound to `C-c C-x q'. If you -want to disable tag groups completely, set `org-group-tags' to `nil'. - - -File: org, Node: Tag searches, Prev: Tag hierarchy, Up: Tags - -6.4 Tag searches -================ - -Once a system of tags has been set up, it can be used to collect related -information into special lists. - -`C-c / m or C-c \ (`org-match-sparse-tree')' - Create a sparse tree with all headlines matching a - tags/property/TODO search. With a `C-u' prefix argument, ignore - headlines that are not a TODO line. *Note Matching tags and - properties::. - -`C-c a m (`org-tags-view')' - Create a global list of tag matches from all agenda files. *Note - Matching tags and properties::. - -`C-c a M (`org-tags-view')' - Create a global list of tag matches from all agenda files, but - check only TODO items and force checking subitems (see the option - `org-tags-match-list-sublevels'). - - These commands all prompt for a match string which allows basic -Boolean logic like `+boss+urgent-project1', to find entries with tags -`boss' and `urgent', but not `project1', or `Kathy|Sally' to find -entries tagged as `Kathy' or `Sally'. The full syntax of the search -string is rich and allows also matching against TODO keywords, entry -levels and properties. For a complete description with many examples, -see *note Matching tags and properties::. - - -File: org, Node: Properties and columns, Next: Dates and times, Prev: Tags, Up: Top - -7 Properties and columns -************************ - -A property is a key-value pair associated with an entry. Properties -can be set so they are associated with a single entry, with every entry -in a tree, or with every entry in an Org mode file. - - There are two main applications for properties in Org mode. First, -properties are like tags, but with a value. Imagine maintaining a file -where you document bugs and plan releases for a piece of software. -Instead of using tags like `:release_1:', `:release_2:', you can use a -property, say `:Release:', that in different subtrees has different -values, such as `1.0' or `2.0'. Second, you can use properties to -implement (very basic) database capabilities in an Org buffer. Imagine -keeping track of your music CDs, where properties could be things such -as the album, artist, date of release, number of tracks, and so on. - - Properties can be conveniently edited and viewed in column view -(*note Column view::). - -* Menu: - -* Property syntax:: How properties are spelled out -* Special properties:: Access to other Org mode features -* Property searches:: Matching property values -* Property inheritance:: Passing values down the tree -* Column view:: Tabular viewing and editing -* Property API:: Properties for Lisp programmers - - -File: org, Node: Property syntax, Next: Special properties, Up: Properties and columns - -7.1 Property syntax -=================== - -Properties are key-value pairs. When they are associated with a single -entry or with a tree they need to be inserted into a special drawer -(*note Drawers::) with the name `PROPERTIES', which has to be located -right below a headline, and its planning line (*note Deadlines and -scheduling::) when applicable. Each property is specified on a single -line, with the key (surrounded by colons) first, and the value after -it. Keys are case-insensitive. Here is an example: - - * CD collection - ** Classic - *** Goldberg Variations - :PROPERTIES: - :Title: Goldberg Variations - :Composer: J.S. Bach - :Artist: Glen Gould - :Publisher: Deutsche Grammophon - :NDisks: 1 - :END: - - Depending on the value of `org-use-property-inheritance', a property -set this way will either be associated with a single entry, or the -subtree defined by the entry, see *note Property inheritance::. - - You may define the allowed values for a particular property `:Xyz:' -by setting a property `:Xyz_ALL:'. This special property is -_inherited_, so if you set it in a level 1 entry, it will apply to the -entire tree. When allowed values are defined, setting the -corresponding property becomes easier and is less prone to typing -errors. For the example with the CD collection, we can predefine -publishers and the number of disks in a box like this: - - * CD collection - :PROPERTIES: - :NDisks_ALL: 1 2 3 4 - :Publisher_ALL: "Deutsche Grammophon" Philips EMI - :END: - - If you want to set properties that can be inherited by any entry in a -file, use a line like - #+PROPERTY: NDisks_ALL 1 2 3 4 - - Contrary to properties set from a special drawer, you have to -refresh the buffer with `C-c C-c' to activate this change. - - If you want to add to the value of an existing property, append a -`+' to the property name. The following results in the property `var' -having the value "foo=1 bar=2". - #+PROPERTY: var foo=1 - #+PROPERTY: var+ bar=2 - - It is also possible to add to the values of inherited properties. -The following results in the `genres' property having the value "Classic -Baroque" under the `Goldberg Variations' subtree. - * CD collection - ** Classic - :PROPERTIES: - :GENRES: Classic - :END: - *** Goldberg Variations - :PROPERTIES: - :Title: Goldberg Variations - :Composer: J.S. Bach - :Artist: Glen Gould - :Publisher: Deutsche Grammophon - :NDisks: 1 - :GENRES+: Baroque - :END: - Note that a property can only have one entry per Drawer. - - Property values set with the global variable `org-global-properties' -can be inherited by all entries in all Org files. - -The following commands help to work with properties: - -`M- (`pcomplete')' - After an initial colon in a line, complete property keys. All - keys used in the current file will be offered as possible - completions. - -`C-c C-x p (`org-set-property')' - Set a property. This prompts for a property name and a value. If - necessary, the property drawer is created as well. - -`C-u M-x org-insert-drawer RET' - Insert a property drawer into the current entry. The drawer will - be inserted early in the entry, but after the lines with planning - information like deadlines. - -`C-c C-c (`org-property-action')' - With the cursor in a property drawer, this executes property - commands. - -`C-c C-c s (`org-set-property')' - Set a property in the current entry. Both the property and the - value can be inserted using completion. - -`S- (`org-property-next-allowed-value')' -`S- (`org-property-previous-allowed-value')' - Switch property at point to the next/previous allowed value. - -`C-c C-c d (`org-delete-property')' - Remove a property from the current entry. - -`C-c C-c D (`org-delete-property-globally')' - Globally remove a property, from all entries in the current file. - -`C-c C-c c (`org-compute-property-at-point')' - Compute the property at point, using the operator and scope from - the nearest column format definition. - - -File: org, Node: Special properties, Next: Property searches, Prev: Property syntax, Up: Properties and columns - -7.2 Special properties -====================== - -Special properties provide an alternative access method to Org mode -features, like the TODO state or the priority of an entry, discussed in -the previous chapters. This interface exists so that you can include -these states in a column view (*note Column view::), or to use them in -queries. The following property names are special and should not be -used as keys in the properties drawer: - - ALLTAGS All tags, including inherited ones. - BLOCKED "t" if task is currently blocked by children or siblings. - CLOCKSUM The sum of CLOCK intervals in the subtree. `org-clock-sum' - must be run first to compute the values in the current buffer. - CLOCKSUM_T The sum of CLOCK intervals in the subtree for today. - `org-clock-sum-today' must be run first to compute the - values in the current buffer. - CLOSED When was this entry closed? - DEADLINE The deadline time string, without the angular brackets. - FILE The filename the entry is located in. - ITEM The headline of the entry. - PRIORITY The priority of the entry, a string with a single letter. - SCHEDULED The scheduling timestamp, without the angular brackets. - TAGS The tags defined directly in the headline. - TIMESTAMP The first keyword-less timestamp in the entry. - TIMESTAMP_IA The first inactive timestamp in the entry. - TODO The TODO keyword of the entry. - - -File: org, Node: Property searches, Next: Property inheritance, Prev: Special properties, Up: Properties and columns - -7.3 Property searches -===================== - -To create sparse trees and special lists with selection based on -properties, the same commands are used as for tag searches (*note Tag -searches::). - -`C-c / m or C-c \ (`org-match-sparse-tree')' - Create a sparse tree with all matching entries. With a `C-u' - prefix argument, ignore headlines that are not a TODO line. - -`C-c a m (`org-tags-view')' - Create a global list of tag/property matches from all agenda - files. *Note Matching tags and properties::. - -`C-c a M (`org-tags-view')' - Create a global list of tag matches from all agenda files, but - check only TODO items and force checking of subitems (see the - option `org-tags-match-list-sublevels'). - - The syntax for the search string is described in *note Matching tags -and properties::. - - There is also a special command for creating sparse trees based on a -single property: - -`C-c / p' - Create a sparse tree based on the value of a property. This first - prompts for the name of a property, and then for a value. A - sparse tree is created with all entries that define this property - with the given value. If you enclose the value in curly braces, - it is interpreted as a regular expression and matched against the - property values. - - -File: org, Node: Property inheritance, Next: Column view, Prev: Property searches, Up: Properties and columns - -7.4 Property Inheritance -======================== - -The outline structure of Org mode documents lends itself to an -inheritance model of properties: if the parent in a tree has a certain -property, the children can inherit this property. Org mode does not -turn this on by default, because it can slow down property searches -significantly and is often not needed. However, if you find inheritance -useful, you can turn it on by setting the variable -`org-use-property-inheritance'. It may be set to `t' to make all -properties inherited from the parent, to a list of properties that -should be inherited, or to a regular expression that matches inherited -properties. If a property has the value `nil', this is interpreted as -an explicit undefine of the property, so that inheritance search will -stop at this value and return `nil'. - - Org mode has a few properties for which inheritance is hard-coded, at -least for the special applications for which they are used: - -`COLUMNS' - The `:COLUMNS:' property defines the format of column view (*note - Column view::). It is inherited in the sense that the level where - a `:COLUMNS:' property is defined is used as the starting point - for a column view table, independently of the location in the - subtree from where columns view is turned on. - -`CATEGORY' - For agenda view, a category set through a `:CATEGORY:' property - applies to the entire subtree. - -`ARCHIVE' - For archiving, the `:ARCHIVE:' property may define the archive - location for the entire subtree (*note Moving subtrees::). - -`LOGGING' - The LOGGING property may define logging settings for an entry or a - subtree (*note Tracking TODO state changes::). - - -File: org, Node: Column view, Next: Property API, Prev: Property inheritance, Up: Properties and columns - -7.5 Column view -=============== - -A great way to view and edit properties in an outline tree is _column -view_. In column view, each outline node is turned into a table row. -Columns in this table provide access to properties of the entries. Org -mode implements columns by overlaying a tabular structure over the -headline of each item. While the headlines have been turned into a -table row, you can still change the visibility of the outline tree. -For example, you get a compact table by switching to CONTENTS view -(`S- S-', or simply `c' while column view is active), but you -can still open, read, and edit the entry below each headline. Or, you -can switch to column view after executing a sparse tree command and in -this way get a table only for the selected items. Column view also -works in agenda buffers (*note Agenda views::) where queries have -collected selected items, possibly from a number of files. - -* Menu: - -* Defining columns:: The COLUMNS format property -* Using column view:: How to create and use column view -* Capturing column view:: A dynamic block for column view - - -File: org, Node: Defining columns, Next: Using column view, Up: Column view - -7.5.1 Defining columns ----------------------- - -Setting up a column view first requires defining the columns. This is -done by defining a column format line. - -* Menu: - -* Scope of column definitions:: Where defined, where valid? -* Column attributes:: Appearance and content of a column - - -File: org, Node: Scope of column definitions, Next: Column attributes, Up: Defining columns - -7.5.1.1 Scope of column definitions -................................... - -To define a column format for an entire file, use a line like - - #+COLUMNS: %25ITEM %TAGS %PRIORITY %TODO - - To specify a format that only applies to a specific tree, add a -`:COLUMNS:' property to the top node of that tree, for example: - - ** Top node for columns view - :PROPERTIES: - :COLUMNS: %25ITEM %TAGS %PRIORITY %TODO - :END: - - If a `:COLUMNS:' property is present in an entry, it defines columns -for the entry itself, and for the entire subtree below it. Since the -column definition is part of the hierarchical structure of the document, -you can define columns on level 1 that are general enough for all -sublevels, and more specific columns further down, when you edit a -deeper part of the tree. - - -File: org, Node: Column attributes, Prev: Scope of column definitions, Up: Defining columns - -7.5.1.2 Column attributes -......................... - -A column definition sets the attributes of a column. The general -definition looks like this: - - %[WIDTH]PROPERTY[(TITLE)][{SUMMARY-TYPE}] - -Except for the percent sign and the property name, all items are -optional. The individual parts have the following meaning: - - WIDTH An integer specifying the width of the column in characters. - If omitted, the width will be determined automatically. - PROPERTY The property that should be edited in this column. - Special properties representing meta data are allowed here - as well (*note Special properties::) - TITLE The header text for the column. If omitted, the property - name is used. - {SUMMARY-TYPE} The summary type. If specified, the column values for - parent nodes are computed from the children(1). - Supported summary types are: - {+} Sum numbers in this column. - {+;%.1f} Like `+', but format result with `%.1f'. - {$} Currency, short for `+;%.2f'. - {min} Smallest number in column. - {max} Largest number. - {mean} Arithmetic mean of numbers. - {X} Checkbox status, `[X]' if all children are `[X]'. - {X/} Checkbox status, `[n/m]'. - {X%} Checkbox status, `[n%]'. - {:} Sum times, HH:MM, plain numbers are - hours(2). - {:min} Smallest time value in column. - {:max} Largest time value. - {:mean} Arithmetic mean of time values. - {@min} Minimum age(3) (in - days/hours/mins/seconds). - {@max} Maximum age (in days/hours/mins/seconds). - {@mean} Arithmetic mean of ages (in days/hours/mins/seconds). - {est+} Add `low-high' estimates. - - The `est+' summary type requires further explanation. It is used for -combining estimates, expressed as `low-high' ranges or plain numbers. -For example, instead of estimating a particular task will take 5 days, -you might estimate it as 5-6 days if you're fairly confident you know -how much work is required, or 1-10 days if you don't really know what -needs to be done. Both ranges average at 5.5 days, but the first -represents a more predictable delivery. - - When combining a set of such estimates, simply adding the lows and -highs produces an unrealistically wide result. Instead, `est+' adds the -statistical mean and variance of the sub-tasks, generating a final -estimate from the sum. For example, suppose you had ten tasks, each of -which was estimated at 0.5 to 2 days of work. Straight addition -produces an estimate of 5 to 20 days, representing what to expect if -everything goes either extremely well or extremely poorly. In -contrast, `est+' estimates the full job more realistically, at 10-15 -days. - - Numbers are right-aligned when a format specifier with an explicit -width like `%5d' or `%5.1f' is used. - - You can also define custom summary types by setting -`org-columns-summary-types', which see. - - Here is an example for a complete columns definition, along with -allowed values. - - :COLUMNS: %25ITEM %9Approved(Approved?){X} %Owner %11Status \(4) - %10Time_Estimate{:} %CLOCKSUM %CLOCKSUM_T - :Owner_ALL: Tammy Mark Karl Lisa Don - :Status_ALL: "In progress" "Not started yet" "Finished" "" - :Approved_ALL: "[ ]" "[X]" - -The first column, `%25ITEM', means the first 25 characters of the item -itself, i.e., of the headline. You probably always should start the -column definition with the `ITEM' specifier. The other specifiers -create columns `Owner' with a list of names as allowed values, for -`Status' with four different possible values, and for a checkbox field -`Approved'. When no width is given after the `%' character, the column -will be exactly as wide as it needs to be in order to fully display all -values. The `Approved' column does have a modified title (`Approved?', -with a question mark). Summaries will be created for the -`Time_Estimate' column by adding time duration expressions like HH:MM, -and for the `Approved' column, by providing an `[X]' status if all -children have been checked. The `CLOCKSUM' and `CLOCKSUM_T' columns -are special, they lists the sums of CLOCK intervals in the subtree, -either for all clocks or just for today. - - ---------- Footnotes ---------- - - (1) If more than one summary type apply to the -property, the parent values are computed according to -the first of them. - - (2) A time can also be a duration, using effort -modifiers defined in `org-effort-durations', e.g., `3d -1h'. If any value in the column is as such, the -summary will also be an effort duration. - - (3) An age is defined as a duration since a given -time-stamp (*note Timestamps::). It can also be -expressed as days, hours, minutes and seconds, -identified by `d', `h', `m' and `s' suffixes, all -mandatory, e.g., `0d 13h 0m 10s'. - - (4) Please note that the COLUMNS definition must be on a single -line--it is wrapped here only because of formatting constraints. - - -File: org, Node: Using column view, Next: Capturing column view, Prev: Defining columns, Up: Column view - -7.5.2 Using column view ------------------------ - -Turning column view on and off -.............................. - -`C-c C-x C-c (`org-columns')' - Turn on column view. If the cursor is before the first headline - in the file, or the function called with the universal prefix - argument, column view is turned on for the entire file, using the - `#+COLUMNS' definition. If the cursor is somewhere inside the - outline, this command searches the hierarchy, up from point, for a - `:COLUMNS:' property that defines a format. When one is found, - the column view table is established for the tree starting at the - entry that contains the `:COLUMNS:' property. If no such property - is found, the format is taken from the `#+COLUMNS' line or from the - variable `org-columns-default-format', and column view is - established for the current entry and its subtree. - -`r (`org-columns-redo')' - Recreate the column view, to include recent changes made in the - buffer. - -`g (`org-columns-redo')' - Same as `r'. - -`q (`org-columns-quit')' - Exit column view. - -Editing values -.............. - -` ' - Move through the column view from field to field. - -`S-/' - Switch to the next/previous allowed value of the field. For this, - you have to have specified allowed values for a property. - -`1..9,0' - Directly select the Nth allowed value, `0' selects the 10th value. - -`n (`org-columns-next-allowed-value')' -`p (`org-columns-previous-allowed-value')' - Same as `S-/' - -`e (`org-columns-edit-value')' - Edit the property at point. For the special properties, this will - invoke the same interface that you normally use to change that - property. For example, when editing a TAGS property, the tag - completion or fast selection interface will pop up. - -`C-c C-c (`org-columns-set-tags-or-toggle')' - When there is a checkbox at point, toggle it. - -`v (`org-columns-show-value')' - View the full value of this property. This is useful if the width - of the column is smaller than that of the value. - -`a (`org-columns-edit-allowed')' - Edit the list of allowed values for this property. If the list is - found in the hierarchy, the modified value is stored there. If no - list is found, the new value is stored in the first entry that is - part of the current column view. - -Modifying the table structure -............................. - -`< (`org-columns-narrow')' -`> (`org-columns-widen')' - Make the column narrower/wider by one character. - -`S-M- (`org-columns-new')' - Insert a new column, to the left of the current column. - -`S-M- (`org-columns-delete')' - Delete the current column. - - -File: org, Node: Capturing column view, Prev: Using column view, Up: Column view - -7.5.3 Capturing column view ---------------------------- - -Since column view is just an overlay over a buffer, it cannot be -exported or printed directly. If you want to capture a column view, use -a `columnview' dynamic block (*note Dynamic blocks::). The frame of -this block looks like this: - - * The column view - #+BEGIN: columnview :hlines 1 :id "label" - - #+END: - -This dynamic block has the following parameters: - -`:id' - This is the most important parameter. Column view is a feature - that is often localized to a certain (sub)tree, and the capture - block might be at a different location in the file. To identify - the tree whose view to capture, you can use 4 values: - local use the tree in which the capture block is located - global make a global view, including all headings in the file - "file:PATH-TO-FILE" - run column view at the top of this file - "ID" call column view in the tree that has an `:ID:' - property with the value label. You can use - `M-x org-id-copy RET' to create a globally unique ID for - the current entry and copy it to the kill-ring. - -`:hlines' - When `t', insert an hline after every line. When a number N, - insert an hline before each headline with level `<= N'. - -`:vlines' - When set to `t', force column groups to get vertical lines. - -`:maxlevel' - When set to a number, don't capture entries below this level. - -`:skip-empty-rows' - When set to `t', skip rows where the only non-empty specifier of - the column view is `ITEM'. - -`:indent' - When non-`nil', indent each `ITEM' field according to its level. - - -The following commands insert or update the dynamic block: - -`C-c C-x i (`org-insert-columns-dblock')' - Insert a dynamic block capturing a column view. You will be - prompted for the scope or ID of the view. - -`C-c C-c or C-c C-x C-u (`org-dblock-update')' - Update dynamic block at point. The cursor needs to be in the - `#+BEGIN' line of the dynamic block. - -`C-u C-c C-x C-u (`org-update-all-dblocks')' - Update all dynamic blocks (*note Dynamic blocks::). This is - useful if you have several clock table blocks, column-capturing - blocks or other dynamic blocks in a buffer. - - You can add formulas to the column view table and you may add -plotting instructions in front of the table--these will survive an -update of the block. If there is a `#+TBLFM:' after the table, the -table will actually be recalculated automatically after an update. - - An alternative way to capture and process property values into a -table is provided by Eric Schulte's `org-collector.el' which is a -contributed package(1). 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. - - ---------- Footnotes ---------- - - (1) Contributed packages are not part of Emacs, but are distributed -with the main distribution of Org (visit `http://orgmode.org'). - - -File: org, Node: Property API, Prev: Column view, Up: Properties and columns - -7.6 The Property API -==================== - -There is a full API for accessing and changing properties. This API can -be used by Emacs Lisp programs to work with properties and to implement -features based on them. For more information see *note Using the -property API::. - - -File: org, Node: Dates and times, Next: Capture - Refile - Archive, Prev: Properties and columns, Up: Top - -8 Dates and times -***************** - -To assist project planning, TODO items can be labeled with a date and/or -a time. The specially formatted string carrying the date and time -information is called a _timestamp_ in Org mode. This may be a little -confusing because timestamp is often used to indicate when something -was created or last changed. However, in Org mode this term is used in -a much wider sense. - -* Menu: - -* Timestamps:: Assigning a time to a tree entry -* Creating timestamps:: Commands which insert timestamps -* Deadlines and scheduling:: Planning your work -* Clocking work time:: Tracking how long you spend on a task -* Effort estimates:: Planning work effort in advance -* Timers:: Notes with a running timer - - -File: org, Node: Timestamps, Next: Creating timestamps, Up: Dates and times - -8.1 Timestamps, deadlines, and scheduling -========================================= - -A timestamp is a specification of a date (possibly with a time or a -range of times) in a special format, either `<2003-09-16 Tue>'(1) or -`<2003-09-16 Tue 09:39>' or `<2003-09-16 Tue 12:00-12:30>'(2). A -timestamp can appear anywhere in the headline or body of an Org tree -entry. Its presence causes entries to be shown on specific dates in the -agenda (*note Weekly/daily agenda::). We distinguish: - -PLAIN TIMESTAMP; EVENT; APPOINTMENT - A simple timestamp just assigns a date/time to an item. This is - just like writing down an appointment or event in a paper agenda. - In the agenda display, the headline of an entry associated with a - plain timestamp will be shown exactly on that date. - - * Meet Peter at the movies - <2006-11-01 Wed 19:15> - * Discussion on climate change - <2006-11-02 Thu 20:00-22:00> - -TIMESTAMP WITH REPEATER INTERVAL - A timestamp may contain a _repeater interval_, indicating that it - applies not only on the given date, but again and again after a - certain interval of N days (d), weeks (w), months (m), or years - (y). The following will show up in the agenda every Wednesday: - - * Pick up Sam at school - <2007-05-16 Wed 12:30 +1w> - -DIARY-STYLE SEXP ENTRIES - For more complex date specifications, Org mode supports using the - special sexp diary entries implemented in the Emacs calendar/diary - package(3). For example with optional time - - * 22:00-23:00 The nerd meeting on every 2nd Thursday of the month - <%%(diary-float t 4 2)> - -TIME/DATE RANGE - Two timestamps connected by `--' denote a range. The headline - will be shown on the first and last day of the range, and on any - dates that are displayed and fall in the range. Here is an - example: - - ** Meeting in Amsterdam - <2004-08-23 Mon>--<2004-08-26 Thu> - -INACTIVE TIMESTAMP - Just like a plain timestamp, but with square brackets instead of - angular ones. These timestamps are inactive in the sense that - they do _not_ trigger an entry to show up in the agenda. - - * Gillian comes late for the fifth time - [2006-11-01 Wed] - - - ---------- Footnotes ---------- - - (1) In this simplest form, the day name is optional when you type -the date yourself. However, any dates inserted or modified by Org will -add that day name, for reading convenience. - - (2) This is inspired by the standard ISO 8601 date/time format. To -use an alternative format, see *note Custom time format::. - - (3) When working with the standard diary sexp functions, you need to -be very careful with the order of the arguments. That order depends -evilly on the variable `calendar-date-style' (or, for older Emacs -versions, `european-calendar-style'). For example, to specify a date -December 1, 2005, the call might look like `(diary-date 12 1 2005)' or -`(diary-date 1 12 2005)' or `(diary-date 2005 12 1)', depending on the -settings. This has been the source of much confusion. Org mode users -can resort to special versions of these functions like `org-date' or -`org-anniversary'. These work just like the corresponding `diary-' -functions, but with stable ISO order of arguments (year, month, day) -wherever applicable, independent of the value of `calendar-date-style'. - - -File: org, Node: Creating timestamps, Next: Deadlines and scheduling, Prev: Timestamps, Up: Dates and times - -8.2 Creating timestamps -======================= - -For Org mode to recognize timestamps, they need to be in the specific -format. All commands listed below produce timestamps in the correct -format. - -`C-c . (`org-time-stamp')' - Prompt for a date and insert a corresponding timestamp. When the - cursor is at an existing timestamp in the buffer, the command is - used to modify this timestamp instead of inserting a new one. - When this command is used twice in succession, a time range is - inserted. - -`C-c ! (`org-time-stamp-inactive')' - Like `C-c .', but insert an inactive timestamp that will not cause - an agenda entry. - -`C-u C-c .' -`C-u C-c !' - Like `C-c .' and `C-c !', but use the alternative format which - contains date and time. The default time can be rounded to - multiples of 5 minutes, see the option - `org-time-stamp-rounding-minutes'. - -`C-c C-c' - Normalize timestamp, insert/fix day name if missing or wrong. - -`C-c < (`org-date-from-calendar')' - Insert a timestamp corresponding to the cursor date in the - Calendar. - -`C-c > (`org-goto-calendar')' - Access the Emacs calendar for the current date. If there is a - timestamp in the current line, go to the corresponding date - instead. - -`C-c C-o (`org-open-at-point')' - Access the agenda for the date given by the timestamp or -range at - point (*note Weekly/daily agenda::). - -`S- (`org-timestamp-down-day')' -`S- (`org-timestamp-up-day')' - Change date at cursor by one day. These key bindings conflict with - shift-selection and related modes (*note Conflicts::). - -`S- (`org-timestamp-up')' -`S- (`org-timestamp-down-down')' - Change the item under the cursor in a timestamp. The cursor can - be on a year, month, day, hour or minute. When the timestamp - contains a time range like `15:30-16:30', modifying the first time - will also shift the second, shifting the time block with constant - length. To change the length, modify the second time. Note that - if the cursor is in a headline and not at a timestamp, these same - keys modify the priority of an item. (*note Priorities::). The - key bindings also conflict with shift-selection and related modes - (*note Conflicts::). - -`C-c C-y (`org-evaluate-time-range')' - Evaluate a time range by computing the difference between start - and end. With a prefix argument, insert result after the time - range (in a table: into the following column). - -* Menu: - -* The date/time prompt:: How Org mode helps you entering date and time -* Custom time format:: Making dates look different - - -File: org, Node: The date/time prompt, Next: Custom time format, Up: Creating timestamps - -8.2.1 The date/time prompt --------------------------- - -When Org mode prompts for a date/time, the default is shown in default -date/time format, and the prompt therefore seems to ask for a specific -format. But it will in fact accept date/time information in a variety -of formats. Generally, the information should start at the beginning -of the string. Org mode will find whatever information is in there and -derive anything you have not specified from the _default date and -time_. The default is usually the current date and time, but when -modifying an existing timestamp, or when entering the second stamp of a -range, it is taken from the stamp in the buffer. When filling in -information, Org mode assumes that most of the time you will want to -enter a date in the future: if you omit the month/year and the given -day/month is before today, it will assume that you mean a future -date(1). If the date has been automatically shifted into the future, -the time prompt will show this with `(=>F).' - - For example, let's assume that today is June 13, 2006. Here is how -various inputs will be interpreted, the items filled in by Org mode are -in bold. - - 3-2-5 => 2003-02-05 - 2/5/3 => 2003-02-05 - 14 => 2006-06-14 - 12 => 2006-07-12 - 2/5 => 2007-02-05 - Fri => nearest Friday after the default date - sep 15 => 2006-09-15 - feb 15 => 2007-02-15 - sep 12 9 => 2009-09-12 - 12:45 => 2006-06-13 12:45 - 22 sept 0:34 => 2006-09-22 00:34 - w4 => ISO week four of the current year 2006 - 2012 w4 fri => Friday of ISO week 4 in 2012 - 2012-w04-5 => Same as above - - Furthermore you can specify a relative date by giving, as the _first_ -thing in the input: a plus/minus sign, a number and a letter ([hdwmy]) -to indicate change in hours, days, weeks, months, or years. With a -single plus or minus, the date is always relative to today. With a -double plus or minus, it is relative to the default date. If instead -of a single letter, you use the abbreviation of day name, the date will -be the Nth such day, e.g.: - - +0 => today - . => today - +4d => four days from today - +4 => same as above - +2w => two weeks from today - ++5 => five days from default date - +2tue => second Tuesday from now - -wed => last Wednesday - - The function understands English month and weekday abbreviations. If -you want to use unabbreviated names and/or other languages, configure -the variables `parse-time-months' and `parse-time-weekdays'. - - Not all dates can be represented in a given Emacs implementation. -By default Org mode forces dates into the compatibility range 1970-2037 -which works on all Emacs implementations. If you want to use dates -outside of this range, read the docstring of the variable -`org-read-date-force-compatible-dates'. - - You can specify a time range by giving start and end times or by -giving a start time and a duration (in HH:MM format). Use one or two -dash(es) as the separator in the former case and use '+' as the -separator in the latter case, e.g.: - - 11am-1:15pm => 11:00-13:15 - 11am--1:15pm => same as above - 11am+2:15 => same as above - - Parallel to the minibuffer prompt, a calendar is popped up(2). When -you exit the date prompt, either by clicking on a date in the calendar, -or by pressing , the date selected in the calendar will be -combined with the information entered at the prompt. You can control -the calendar fully from the minibuffer: - - Choose date at cursor in calendar. - mouse-1 Select date by clicking on it. - S-/ One day forward/backward. - S-/ One week forward/backward. - M-S-/ One month forward/backward. - > / < Scroll calendar forward/backward by one month. - M-v / C-v Scroll calendar forward/backward by 3 months. - M-S-/ Scroll calendar forward/backward by one year. - - The actions of the date/time prompt may seem complex, but I assure -you they will grow on you, and you will start getting annoyed by pretty -much any other way of entering a date/time out there. To help you -understand what is going on, the current interpretation of your input -will be displayed live in the minibuffer(3). - - ---------- Footnotes ---------- - - (1) See the variable `org-read-date-prefer-future'. You may set -that variable to the symbol `time' to even make a time before now shift -the date to tomorrow. - - (2) If you don't need/want the calendar, configure the variable -`org-popup-calendar-for-date-prompt'. - - (3) If you find this distracting, turn the display off with -`org-read-date-display-live'. - - -File: org, Node: Custom time format, Prev: The date/time prompt, Up: Creating timestamps - -8.2.2 Custom time format ------------------------- - -Org mode uses the standard ISO notation for dates and times as it is -defined in ISO 8601. If you cannot get used to this and require another -representation of date and time to keep you happy, you can get it by -customizing the options `org-display-custom-times' and -`org-time-stamp-custom-formats'. - -`C-c C-x C-t (`org-toggle-time-stamp-overlays')' - Toggle the display of custom formats for dates and times. - -Org mode needs the default format for scanning, so the custom date/time -format does not _replace_ the default format--instead it is put _over_ -the default format using text properties. This has the following -consequences: - * You cannot place the cursor onto a timestamp anymore, only before - or after. - - * The `S-/' keys can no longer be used to adjust each - component of a timestamp. If the cursor is at the beginning of - the stamp, `S-/' will change the stamp by one day, just - like `S-/'. At the end of the stamp, the time will - be changed by one minute. - - * If the timestamp contains a range of clock times or a repeater, - these will not be overlaid, but remain in the buffer as they were. - - * When you delete a timestamp character-by-character, it will only - disappear from the buffer after _all_ (invisible) characters - belonging to the ISO timestamp have been removed. - - * If the custom timestamp format is longer than the default and you - are using dates in tables, table alignment will be messed up. If - the custom format is shorter, things do work as expected. - - -File: org, Node: Deadlines and scheduling, Next: Clocking work time, Prev: Creating timestamps, Up: Dates and times - -8.3 Deadlines and scheduling -============================ - -A timestamp may be preceded by special keywords to facilitate planning. -Both the timestamp and the keyword have to be positioned immediately -after the task they refer to. - -DEADLINE - Meaning: the task (most likely a TODO item, though not - necessarily) is supposed to be finished on that date. - - On the deadline date, the task will be listed in the agenda. In - addition, the agenda for _today_ will carry a warning about the - approaching or missed deadline, starting - `org-deadline-warning-days' before the due date, and continuing - until the entry is marked DONE. An example: - - *** TODO write article about the Earth for the Guide - DEADLINE: <2004-02-29 Sun> - The editor in charge is [[bbdb:Ford Prefect]] - - You can specify a different lead time for warnings for a specific - deadline using the following syntax. Here is an example with a - warning period of 5 days `DEADLINE: <2004-02-29 Sun -5d>'. This - warning is deactivated if the task gets scheduled and you set - `org-agenda-skip-deadline-prewarning-if-scheduled' to `t'. - -SCHEDULED - Meaning: you are planning to start working on that task on the - given date. - - The headline will be listed under the given date(1). In addition, - a reminder that the scheduled date has passed will be present in - the compilation for _today_, until the entry is marked DONE, i.e., - the task will automatically be forwarded until completed. - - *** TODO Call Trillian for a date on New Years Eve. - SCHEDULED: <2004-12-25 Sat> - - If you want to _delay_ the display of this task in the agenda, use - `SCHEDULED: <2004-12-25 Sat -2d>': the task is still scheduled on - the 25th but will appear two days later. In case the task - contains a repeater, the delay is considered to affect all - occurrences; if you want the delay to only affect the first - scheduled occurrence of the task, use `--2d' instead. See - `org-scheduled-delay-days' and - `org-agenda-skip-scheduled-delay-if-deadline' for details on how to - control this globally or per agenda. - - Important: Scheduling an item in Org mode should not be understood - in the same way that we understand scheduling a meeting. Setting - a date for a meeting is just a simple appointment, you should mark - this entry with a simple plain timestamp, to get this item shown - on the date where it applies. This is a frequent misunderstanding - by Org users. In Org mode, scheduling means setting a date when - you want to start working on an action item. - - You may use timestamps with repeaters in scheduling and deadline -entries. Org mode will issue early and late warnings based on the -assumption that the timestamp represents the nearest instance of the -repeater. However, the use of diary sexp entries like `<%%(diary-float -t 42)>' in scheduling and deadline timestamps is limited. Org mode -does not know enough about the internals of each sexp function to issue -early and late warnings. However, it will show the item on each day -where the sexp entry matches. - -* Menu: - -* Inserting deadline/schedule:: Planning items -* Repeated tasks:: Items that show up again and again - - ---------- Footnotes ---------- - - (1) It will still be listed on that date after it has been marked -DONE. If you don't like this, set the variable -`org-agenda-skip-scheduled-if-done'. - - -File: org, Node: Inserting deadline/schedule, Next: Repeated tasks, Up: Deadlines and scheduling - -8.3.1 Inserting deadlines or schedules --------------------------------------- - -The following commands allow you to quickly insert a deadline or to -schedule an item: - -`C-c C-d (`org-deadline')' - Insert `DEADLINE' keyword along with a stamp. Any CLOSED - timestamp will be removed. When called with a prefix arg, an - existing deadline will be removed from the entry. Depending on - the variable `org-log-redeadline'(1), a note will be taken when - changing an existing deadline. - -`C-c C-s (`org-schedule')' - Insert `SCHEDULED' keyword along with a stamp. Any CLOSED - timestamp will be removed. When called with a prefix argument, - remove the scheduling date from the entry. Depending on the - variable `org-log-reschedule'(2), a note will be taken when - changing an existing scheduling time. - -`C-c / d (`org-check-deadlines')' - Create a sparse tree with all deadlines that are either past-due, - or which will become due within `org-deadline-warning-days'. With - `C-u' prefix, show all deadlines in the file. With a numeric - prefix, check that many days. For example, `C-1 C-c / d' shows - all deadlines due tomorrow. - -`C-c / b (`org-check-before-date')' - Sparse tree for deadlines and scheduled items before a given date. - -`C-c / a (`org-check-after-date')' - Sparse tree for deadlines and scheduled items after a given date. - - Note that `org-schedule' and `org-deadline' supports setting the -date by indicating a relative time: e.g., +1d will set the date to the -next day after today, and -1w will set the date to the previous week -before any current timestamp. - - ---------- Footnotes ---------- - - (1) with corresponding `#+STARTUP' keywords `logredeadline', -`lognoteredeadline', and `nologredeadline' - - (2) with corresponding `#+STARTUP' keywords `logreschedule', -`lognotereschedule', and `nologreschedule' - - -File: org, Node: Repeated tasks, Prev: Inserting deadline/schedule, Up: Deadlines and scheduling - -8.3.2 Repeated tasks --------------------- - -Some tasks need to be repeated again and again. Org mode helps to -organize such tasks using a so-called repeater in a DEADLINE, SCHEDULED, -or plain timestamp. In the following example - ** TODO Pay the rent - DEADLINE: <2005-10-01 Sat +1m> - the `+1m' is a repeater; the intended interpretation is that the task -has a deadline on <2005-10-01> and repeats itself every (one) month -starting from that time. You can use yearly, monthly, weekly, daily -and hourly repeat cookies by using the `y/w/m/d/h' letters. If you -need both a repeater and a special warning period in a deadline entry, -the repeater should come first and the warning period last: `DEADLINE: -<2005-10-01 Sat +1m -3d>'. - - Deadlines and scheduled items produce entries in the agenda when -they are over-due, so it is important to be able to mark such an entry -as completed once you have done so. When you mark a DEADLINE or a -SCHEDULE with the TODO keyword DONE, it will no longer produce entries -in the agenda. The problem with this is, however, that then also the -_next_ instance of the repeated entry will not be active. Org mode -deals with this in the following way: When you try to mark such an -entry DONE (using `C-c C-t'), it will shift the base date of the -repeating timestamp by the repeater interval, and immediately set the -entry state back to TODO(1). In the example above, setting the state -to DONE would actually switch the date like this: - - ** TODO Pay the rent - DEADLINE: <2005-11-01 Tue +1m> - - To mark a task with a repeater as `DONE', use `C-- 1 C-c C-t' (i.e., -`org-todo' with a numeric prefix argument of -1.) - - A timestamp(2) will be added under the deadline, to keep a record -that you actually acted on the previous instance of this deadline. - - As a consequence of shifting the base date, this entry will no -longer be visible in the agenda when checking past dates, but all -future instances will be visible. - - With the `+1m' cookie, the date shift will always be exactly one -month. So if you have not paid the rent for three months, marking this -entry DONE will still keep it as an overdue deadline. Depending on the -task, this may not be the best way to handle it. For example, if you -forgot to call your father for 3 weeks, it does not make sense to call -him 3 times in a single day to make up for it. Finally, there are tasks -like changing batteries which should always repeat a certain time after -the last time you did it. For these tasks, Org mode has special -repeaters `++' and `.+'. For example: - - ** TODO Call Father - DEADLINE: <2008-02-10 Sun ++1w> - Marking this DONE will shift the date by at least one week, - but also by as many weeks as it takes to get this date into - the future. However, it stays on a Sunday, even if you called - and marked it done on Saturday. - ** TODO Empty kitchen trash - DEADLINE: <2008-02-08 Fri 20:00 ++1d> - Marking this DONE will shift the date by at least one day, and - also by as many days as it takes to get the timestamp into the - future. Since there is a time in the timestamp, the next - deadline in the future will be on today's date if you - complete the task before 20:00. - ** TODO Check the batteries in the smoke detectors - DEADLINE: <2005-11-01 Tue .+1m> - Marking this DONE will shift the date to one month after - today. - - You may have both scheduling and deadline information for a specific -task. If the repeater is set for the scheduling information only, you -probably want the repeater to be ignored after the deadline. If so, -set the variable `org-agenda-skip-scheduled-if-deadline-is-shown' to -`repeated-after-deadline'. However, any scheduling information without -a repeater is no longer relevant once the task is done, and thus, -removed upon repeating the task. If you want both scheduling and -deadline information to repeat after the same interval, set the same -repeater for both timestamps. - - An alternative to using a repeater is to create a number of copies -of a task subtree, with dates shifted in each copy. The command `C-c -C-x c' was created for this purpose, it is described in *note Structure -editing::. - - ---------- Footnotes ---------- - - (1) In fact, the target state is taken from, in this sequence, the -`REPEAT_TO_STATE' property or the variable `org-todo-repeat-to-state'. -If neither of these is specified, the target state defaults to the -first state of the TODO state sequence. - - (2) You can change this using the option `org-log-repeat', or the -`#+STARTUP' options `logrepeat', `lognoterepeat', and `nologrepeat'. -With `lognoterepeat', you will also be prompted for a note. - - -File: org, Node: Clocking work time, Next: Effort estimates, Prev: Deadlines and scheduling, Up: Dates and times - -8.4 Clocking work time -====================== - -Org mode allows you to clock the time you spend on specific tasks in a -project. When you start working on an item, you can start the clock. -When you stop working on that task, or when you mark the task done, the -clock is stopped and the corresponding time interval is recorded. It -also computes the total time spent on each subtree(1) of a project. -And it remembers a history or tasks recently clocked, so that you can -jump quickly between a number of tasks absorbing your time. - - To save the clock history across Emacs sessions, use - (setq org-clock-persist 'history) - (org-clock-persistence-insinuate) - When you clock into a new task after resuming Emacs, the incomplete -clock(2) will be found (*note Resolving idle time::) and you will be -prompted about what to do with it. - -* Menu: - -* Clocking commands:: Starting and stopping a clock -* The clock table:: Detailed reports -* Resolving idle time:: Resolving time when you've been idle - - ---------- Footnotes ---------- - - (1) Clocking only works if all headings are indented with less than -30 stars. This is a hardcoded limitation of `lmax' in `org-clock-sum'. - - (2) To resume the clock under the assumption that you have worked on -this task while outside Emacs, use `(setq org-clock-persist t)'. - - -File: org, Node: Clocking commands, Next: The clock table, Up: Clocking work time - -8.4.1 Clocking commands ------------------------ - -`C-c C-x C-i (`org-clock-in')' - Start the clock on the current item (clock-in). This inserts the - CLOCK keyword together with a timestamp. If this is not the first - clocking of this item, the multiple CLOCK lines will be wrapped - into a `:LOGBOOK:' drawer (see also the variable - `org-clock-into-drawer'). You can also overrule the setting of - this variable for a subtree by setting a `CLOCK_INTO_DRAWER' or - `LOG_INTO_DRAWER' property. When called with a `C-u' prefix - argument, select the task from a list of recently clocked tasks. - With two `C-u C-u' prefixes, clock into the task at point and mark - it as the default task; the default task will then always be - available with letter `d' when selecting a clocking task. With - three `C-u C-u C-u' prefixes, force continuous clocking by - starting the clock when the last clock stopped. - While the clock is running, the current clocking time is shown in - the mode line, along with the title of the task. The clock time - shown will be all time ever clocked for this task and its - children. If the task has an effort estimate (*note Effort - estimates::), the mode line displays the current clocking time - against it(1) If the task is a repeating one (*note Repeated - tasks::), only the time since the last reset of the task (2) will - be shown. More control over what time is shown can be exercised - with the `CLOCK_MODELINE_TOTAL' property. It may have the values - `current' to show only the current clocking instance, `today' to - show all time clocked on this task today (see also the variable - `org-extend-today-until'), `all' to include all time, or `auto' - which is the default(3). - Clicking with `mouse-1' onto the mode line entry will pop up a - menu with clocking options. - -`C-c C-x C-o (`org-clock-out')' - Stop the clock (clock-out). This inserts another timestamp at the - same location where the clock was last started. It also directly - computes the resulting time and inserts it after the time range as - `=> HH:MM'. See the variable `org-log-note-clock-out' for the - possibility to record an additional note together with the - clock-out timestamp(4). - -`C-c C-x C-x (`org-clock-in-last')' - Reclock the last clocked task. With one `C-u' prefix argument, - select the task from the clock history. With two `C-u' prefixes, - force continuous clocking by starting the clock when the last clock - stopped. - -`C-c C-x C-e (`org-clock-modify-effort-estimate')' - Update the effort estimate for the current clock task. - -`C-c C-c or C-c C-y (`org-evaluate-time-range')' - Recompute the time interval after changing one of the timestamps. - This is only necessary if you edit the timestamps directly. If - you change them with `S-' keys, the update is automatic. - -`C-S- (`org-clock-timestamps-up/down')' - On `CLOCK' log lines, increase/decrease both timestamps so that the - clock duration keeps the same. - -`S-M- (`org-timestamp-up/down')' - On `CLOCK' log lines, increase/decrease the timestamp at point and - the one of the previous (or the next clock) timestamp by the same - duration. For example, if you hit `S-M-' to increase a - clocked-out timestamp by five minutes, then the clocked-in - timestamp of the next clock will be increased by five minutes. - -`C-c C-t (`org-todo')' - Changing the TODO state of an item to DONE automatically stops the - clock if it is running in this same item. - -`C-c C-x C-q (`org-clock-cancel')' - Cancel the current clock. This is useful if a clock was started by - mistake, or if you ended up working on something else. - -`C-c C-x C-j (`org-clock-goto')' - Jump to the headline of the currently clocked in task. With a - `C-u' prefix arg, select the target task from a list of recently - clocked tasks. - -`C-c C-x C-d (`org-clock-display')' - Display time summaries for each subtree in the current buffer. - This puts overlays at the end of each headline, showing the total - time recorded under that heading, including the time of any - subheadings. You can use visibility cycling to study the tree, - but the overlays disappear when you change the buffer (see - variable `org-remove-highlights-with-change') or press `C-c C-c'. - - The `l' key may be used the agenda (*note Weekly/daily agenda::) to -show which tasks have been worked on or closed during a day. - - *Important:* note that both `org-clock-out' and `org-clock-in-last' -can have a global key binding and will not modify the window -disposition. - - ---------- Footnotes ---------- - - (1) To add an effort estimate "on the fly", hook a function doing -this to `org-clock-in-prepare-hook'. - - (2) as recorded by the `LAST_REPEAT' property - - (3) See also the variable `org-clock-modeline-total'. - - (4) The corresponding in-buffer setting is: `#+STARTUP: -lognoteclock-out' - - -File: org, Node: The clock table, Next: Resolving idle time, Prev: Clocking commands, Up: Clocking work time - -8.4.2 The clock table ---------------------- - -Org mode can produce quite complex reports based on the time clocking -information. Such a report is called a _clock table_, because it is -formatted as one or several Org tables. - -`C-c C-x C-r (`org-clock-report')' - Insert a dynamic block (*note Dynamic blocks::) containing a clock - report as an Org mode table into the current file. When the - cursor is at an existing clock table, just update it. When called - with a prefix argument, jump to the first clock report in the - current document and update it. The clock table always includes - also trees with `:ARCHIVE:' tag. - -`C-c C-c or C-c C-x C-u (`org-dblock-update')' - Update dynamic block at point. The cursor needs to be in the - `#+BEGIN' line of the dynamic block. - -`C-u C-c C-x C-u' - Update all dynamic blocks (*note Dynamic blocks::). This is - useful if you have several clock table blocks in a buffer. - -`S-' -`S- (`org-clocktable-try-shift')' - Shift the current `:block' interval and update the table. The - cursor needs to be in the `#+BEGIN: clocktable' line for this - command. If `:block' is `today', it will be shifted to `today-1' - etc. - - Here is an example of the frame for a clock table as it is inserted -into the buffer with the `C-c C-x C-r' command: - - #+BEGIN: clocktable :maxlevel 2 :emphasize nil :scope file - #+END: clocktable - The `BEGIN' line specifies a number of options to define the scope, -structure, and formatting of the report. Defaults for all these -options can be configured in the variable `org-clocktable-defaults'. - -First there are options that determine which clock entries are to be -selected: - :maxlevel Maximum level depth to which times are listed in the table. - Clocks at deeper levels will be summed into the upper level. - :scope The scope to consider. This can be any of the following: - nil the current buffer or narrowed region - file the full current buffer - subtree the subtree where the clocktable is located - treeN the surrounding level N tree, for example `tree3' - tree the surrounding level 1 tree - agenda all agenda files - ("file"..) scan these files - function the list of files returned by a function of no argument - file-with-archives current file and its archives - agenda-with-archives all agenda files, including archives - :block The time block to consider. This block is specified either - absolutely, or relative to the current time and may be any of - these formats: - 2007-12-31 New year eve 2007 - 2007-12 December 2007 - 2007-W50 ISO-week 50 in 2007 - 2007-Q2 2nd quarter in 2007 - 2007 the year 2007 - today, yesterday, today-N a relative day - thisweek, lastweek, thisweek-N a relative week - thismonth, lastmonth, thismonth-N a relative month - thisyear, lastyear, thisyear-N a relative year - untilnow - Use `S-/' keys to shift the time interval. - :tstart A time string specifying when to start considering times. - Relative times like `"<-2w>"' can also be used. See - *note Matching tags and properties:: for relative time syntax. - :tend A time string specifying when to stop considering times. - Relative times like `""' can also be used. See - *note Matching tags and properties:: for relative time syntax. - :wstart The starting day of the week. The default is 1 for monday. - :mstart The starting day of the month. The default 1 is for the first - day of the month. - :step `week' or `day', to split the table into chunks. - To use this, `:block' or `:tstart', `:tend' are needed. - :stepskip0 Do not show steps that have zero time. - :fileskip0 Do not show table sections from files which did not contribute. - :tags A tags match to select entries that should contribute. See - *note Matching tags and properties:: for the match syntax. - - Then there are options which determine the formatting of the table. -These options are interpreted by the function -`org-clocktable-write-default', but you can specify your own function -using the `:formatter' parameter. - :emphasize When `t', emphasize level one and level two items. - :lang Language(1) to use for descriptive cells like "Task". - :link Link the item headlines in the table to their origins. - :narrow An integer to limit the width of the headline column in - the org table. If you write it like `50!', then the - headline will also be shortened in export. - :indent Indent each headline field according to its level. - :tcolumns Number of columns to be used for times. If this is smaller - than `:maxlevel', lower levels will be lumped into one column. - :level Should a level number column be included? - :sort A cons cell like containing the column to sort and a sorting type. - E.g., `:sort (1 . ?a)' sorts the first column alphabetically. - :compact Abbreviation for `:level nil :indent t :narrow 40! :tcolumns 1' - All are overwritten except if there is an explicit `:narrow' - :timestamp A timestamp for the entry, when available. Look for SCHEDULED, - DEADLINE, TIMESTAMP and TIMESTAMP_IA, in this order. - :properties List of properties that should be shown in the table. Each - property will get its own column. - :inherit-props When this flag is `t', the values for `:properties' will be inherited. - :formula Content of a `#+TBLFM' line to be added and evaluated. - As a special case, `:formula %' adds a column with % time. - If you do not specify a formula here, any existing formula - below the clock table will survive updates and be evaluated. - :formatter A function to format clock data and insert it into the buffer. - To get a clock summary of the current level 1 tree, for the current -day, you could write - #+BEGIN: clocktable :maxlevel 2 :block today :scope tree1 :link t - #+END: clocktable - and to use a specific time range you could write(2) - #+BEGIN: clocktable :tstart "<2006-08-10 Thu 10:00>" - :tend "<2006-08-10 Thu 12:00>" - #+END: clocktable - A range starting a week ago and ending right now could be written as - #+BEGIN: clocktable :tstart "<-1w>" :tend "" - #+END: clocktable - A summary of the current subtree with % times would be - #+BEGIN: clocktable :scope subtree :link t :formula % - #+END: clocktable - A horizontally compact representation of everything clocked during -last week would be - #+BEGIN: clocktable :scope agenda :block lastweek :compact t - #+END: clocktable - - ---------- Footnotes ---------- - - (1) Language terms can be set through the variable -`org-clock-clocktable-language-setup'. - - (2) Note that all parameters must be specified in a single line--the -line is broken here only to fit it into the manual. - - -File: org, Node: Resolving idle time, Prev: The clock table, Up: Clocking work time - -8.4.3 Resolving idle time and continuous clocking -------------------------------------------------- - -Resolving idle time -................... - -If you clock in on a work item, and then walk away from your -computer--perhaps to take a phone call--you often need to "resolve" the -time you were away by either subtracting it from the current clock, or -applying it to another one. - - By customizing the variable `org-clock-idle-time' to some integer, -such as 10 or 15, Emacs can alert you when you get back to your -computer after being idle for that many minutes(1), and ask what you -want to do with the idle time. There will be a question waiting for -you when you get back, indicating how much idle time has passed -(constantly updated with the current amount), as well as a set of -choices to correct the discrepancy: - -`k' - To keep some or all of the minutes and stay clocked in, press `k'. - Org will ask how many of the minutes to keep. Press to keep - them all, effectively changing nothing, or enter a number to keep - that many minutes. - -`K' - If you use the shift key and press `K', it will keep however many - minutes you request and then immediately clock out of that task. - If you keep all of the minutes, this is the same as just clocking - out of the current task. - -`s' - To keep none of the minutes, use `s' to subtract all the away time - from the clock, and then check back in from the moment you - returned. - -`S' - To keep none of the minutes and just clock out at the start of the - away time, use the shift key and press `S'. Remember that using - shift will always leave you clocked out, no matter which option - you choose. - -`C' - To cancel the clock altogether, use `C'. Note that if instead of - canceling you subtract the away time, and the resulting clock - amount is less than a minute, the clock will still be canceled - rather than clutter up the log with an empty entry. - - What if you subtracted those away minutes from the current clock, -and now want to apply them to a new clock? Simply clock in to any task -immediately after the subtraction. Org will notice that you have -subtracted time "on the books", so to speak, and will ask if you want -to apply those minutes to the next task you clock in on. - - There is one other instance when this clock resolution magic occurs. -Say you were clocked in and hacking away, and suddenly your cat chased -a mouse who scared a hamster that crashed into your UPS's power button! -You suddenly lose all your buffers, but thanks to auto-save you still -have your recent Org mode changes, including your last clock in. - - If you restart Emacs and clock into any task, Org will notice that -you have a dangling clock which was never clocked out from your last -session. Using that clock's starting time as the beginning of the -unaccounted-for period, Org will ask how you want to resolve that time. -The logic and behavior is identical to dealing with away time due to -idleness; it is just happening due to a recovery event rather than a -set amount of idle time. - - You can also check all the files visited by your Org agenda for -dangling clocks at any time using `M-x org-resolve-clocks RET' (or `C-c -C-x C-z'). - -Continuous clocking -................... - -You may want to start clocking from the time when you clocked out the -previous task. To enable this systematically, set -`org-clock-continuously' to `t'. Each time you clock in, Org retrieves -the clock-out time of the last clocked entry for this session, and -start the new clock from there. - - If you only want this from time to time, use three universal prefix -arguments with `org-clock-in' and two `C-u C-u' with -`org-clock-in-last'. - - ---------- Footnotes ---------- - - (1) On computers using Mac OS X, idleness is based on actual user -idleness, not just Emacs' idle time. For X11, you can install a -utility program `x11idle.c', available in the `contrib/scripts' -directory of the Org git distribution, or install the `xprintidle' -package and set it to the variable `org-clock-x11idle-program-name' if -you are running Debian, to get the same general treatment of idleness. -On other systems, idle time refers to Emacs idle time only. - - -File: org, Node: Effort estimates, Next: Timers, Prev: Clocking work time, Up: Dates and times - -8.5 Effort estimates -==================== - -If you want to plan your work in a very detailed way, or if you need to -produce offers with quotations of the estimated work effort, you may -want to assign effort estimates to entries. If you are also clocking -your work, you may later want to compare the planned effort with the -actual working time, a great way to improve planning estimates. Effort -estimates are stored in a special property `EFFORT'. You can set the -effort for an entry with the following commands: - -`C-c C-x e (`org-set-effort')' - Set the effort estimate for the current entry. With a numeric - prefix argument, set it to the Nth allowed value (see below). - This command is also accessible from the agenda with the `e' key. - -`C-c C-x C-e (`org-clock-modify-effort-estimate')' - Modify the effort estimate of the item currently being clocked. - - Clearly the best way to work with effort estimates is through column -view (*note Column view::). You should start by setting up discrete -values for effort estimates, and a `COLUMNS' format that displays these -values together with clock sums (if you want to clock your time). For -a specific buffer you can use - - #+PROPERTY: Effort_ALL 0 0:10 0:30 1:00 2:00 3:00 4:00 5:00 6:00 7:00 - #+COLUMNS: %40ITEM(Task) %17Effort(Estimated Effort){:} %CLOCKSUM - -or, even better, you can set up these values globally by customizing the -variables `org-global-properties' and `org-columns-default-format'. In -particular if you want to use this setup also in the agenda, a global -setup may be advised. - - The way to assign estimates to individual items is then to switch to -column mode, and to use `S-' and `S-' to change the value. -The values you enter will immediately be summed up in the hierarchy. -In the column next to it, any clocked time will be displayed. - - If you switch to column view in the daily/weekly agenda, the effort -column will summarize the estimated work effort for each day(1), and -you can use this to find space in your schedule. To get an overview of -the entire part of the day that is committed, you can set the option -`org-agenda-columns-add-appointments-to-effort-sum'. The appointments -on a day that take place over a specified time interval will then also -be added to the load estimate of the day. - - Effort estimates can be used in secondary agenda filtering that is -triggered with the `/' key in the agenda (*note Agenda commands::). If -you have these estimates defined consistently, two or three key presses -will narrow down the list to stuff that fits into an available time -slot. - - ---------- Footnotes ---------- - - (1) Please note the pitfalls of summing hierarchical data in a flat -list (*note Agenda column view::). - - -File: org, Node: Timers, Prev: Effort estimates, Up: Dates and times - -8.6 Taking notes with a timer -============================= - -Org provides two types of timers. There is a relative timer that -counts up, which can be useful when taking notes during, for example, a -meeting or a video viewing. There is also a countdown timer. - - The relative and countdown are started with separate commands. - -`C-c C-x 0 (`org-timer-start')' - Start or reset the relative timer. By default, the timer is set - to 0. When called with a `C-u' prefix, prompt the user for a - starting offset. If there is a timer string at point, this is - taken as the default, providing a convenient way to restart taking - notes after a break in the process. When called with a double - prefix argument `C-u C-u', change all timer strings in the active - region by a certain amount. This can be used to fix timer strings - if the timer was not started at exactly the right moment. - -`C-c C-x ; (`org-timer-set-timer')' - Start a countdown timer. The user is prompted for a duration. - `org-timer-default-timer' sets the default countdown value. Giving - a numeric prefix argument overrides this default value. This - command is available as `;' in agenda buffers. - - Once started, relative and countdown timers are controlled with the -same commands. - -`C-c C-x . (`org-timer')' - Insert the value of the current relative or countdown timer into - the buffer. If no timer is running, the relative timer will be - started. When called with a prefix argument, the relative timer - is restarted. - -`C-c C-x - (`org-timer-item')' - Insert a description list item with the value of the current - relative or countdown timer. With a prefix argument, first reset - the relative timer to 0. - -`M- (`org-insert-heading')' - Once the timer list is started, you can also use `M-' to - insert new timer items. - -`C-c C-x , (`org-timer-pause-or-continue')' - Pause the timer, or continue it if it is already paused. - -`C-c C-x _ (`org-timer-stop')' - Stop the timer. After this, you can only start a new timer, not - continue the old one. This command also removes the timer from - the mode line. - - -File: org, Node: Capture - Refile - Archive, Next: Agenda views, Prev: Dates and times, Up: Top - -9 Capture - Refile - Archive -**************************** - -An important part of any organization system is the ability to quickly -capture new ideas and tasks, and to associate reference material with -them. Org does this using a process called capture. It also can store -files related to a task (attachments) in a special directory. Once in -the system, tasks and projects need to be moved around. Moving -completed project trees to an archive file keeps the system compact and -fast. - -* Menu: - -* Capture:: Capturing new stuff -* Attachments:: Add files to tasks -* RSS feeds:: Getting input from RSS feeds -* Protocols:: External (e.g., Browser) access to Emacs and Org -* Refile and copy:: Moving/copying a tree from one place to another -* Archiving:: What to do with finished projects - - -File: org, Node: Capture, Next: Attachments, Up: Capture - Refile - Archive - -9.1 Capture -=========== - -Capture lets you quickly store notes with little interruption of your -work flow. Org's method for capturing new items is heavily inspired by -John Wiegley excellent `remember.el' package. Up to version 6.36, Org -used a special setup for `remember.el', then replaced it with -`org-remember.el'. As of version 8.0, `org-remember.el' has been -completely replaced by `org-capture.el'. - - If your configuration depends on `org-remember.el', you need to -update it and use the setup described below. To convert your -`org-remember-templates', run the command - M-x org-capture-import-remember-templates RET - and then customize the new variable with `M-x customize-variable -org-capture-templates', check the result, and save the customization. - -* Menu: - -* Setting up capture:: Where notes will be stored -* Using capture:: Commands to invoke and terminate capture -* Capture templates:: Define the outline of different note types - - -File: org, Node: Setting up capture, Next: Using capture, Up: Capture - -9.1.1 Setting up capture ------------------------- - -The following customization sets a default target file for notes, and -defines a global key(1) for capturing new material. - - (setq org-default-notes-file (concat org-directory "/notes.org")) - (define-key global-map "\C-cc" 'org-capture) - - ---------- Footnotes ---------- - - (1) Please select your own key, `C-c c' is only a suggestion. - - -File: org, Node: Using capture, Next: Capture templates, Prev: Setting up capture, Up: Capture - -9.1.2 Using capture -------------------- - -`C-c c (`org-capture')' - Call the command `org-capture'. Note that this key binding is - global and not active by default: you need to install it. If you - have templates defined *note Capture templates::, it will offer - these templates for selection or use a new Org outline node as the - default template. It will insert the template into the target - file and switch to an indirect buffer narrowed to this new node. - You may then insert the information you want. - -`C-c C-c (`org-capture-finalize')' - Once you have finished entering information into the capture - buffer, `C-c C-c' will return you to the window configuration - before the capture process, so that you can resume your work - without further distraction. When called with a prefix arg, - finalize and then jump to the captured item. - -`C-c C-w (`org-capture-refile')' - Finalize the capture process by refiling (*note Refile and copy::) - the note to a different place. Please realize that this is a - normal refiling command that will be executed--so the cursor - position at the moment you run this command is important. If you - have inserted a tree with a parent and children, first move the - cursor back to the parent. Any prefix argument given to this - command will be passed on to the `org-refile' command. - -`C-c C-k (`org-capture-kill')' - Abort the capture process and return to the previous state. - - - You can also call `org-capture' in a special way from the agenda, -using the `k c' key combination. With this access, any timestamps -inserted by the selected capture template will default to the cursor -date in the agenda, rather than to the current date. - - To find the locations of the last stored capture, use `org-capture' -with prefix commands: - -`C-u C-c c' - Visit the target location of a capture template. You get to - select the template in the usual way. - -`C-u C-u C-c c' - Visit the last stored capture item in its buffer. - - You can also jump to the bookmark `org-capture-last-stored', which -will automatically be created unless you set `org-capture-bookmark' to -`nil'. - - To insert the capture at point in an Org buffer, call `org-capture' -with a `C-0' prefix argument. - - -File: org, Node: Capture templates, Prev: Using capture, Up: Capture - -9.1.3 Capture templates ------------------------ - -You can use templates for different types of capture items, and for -different target locations. The easiest way to create such templates is -through the customize interface. - -`C-c c C' - Customize the variable `org-capture-templates'. - - Before we give the formal description of template definitions, let's -look at an example. Say you would like to use one template to create -general TODO entries, and you want to put these entries under the -heading `Tasks' in your file `~/org/gtd.org'. Also, a date tree in the -file `journal.org' should capture journal entries. A possible -configuration would look like: - - (setq org-capture-templates - '(("t" "Todo" entry (file+headline "~/org/gtd.org" "Tasks") - "* TODO %?\n %i\n %a") - ("j" "Journal" entry (file+olp+datetree "~/org/journal.org") - "* %?\nEntered on %U\n %i\n %a"))) - -If you then press `C-c c t', Org will prepare the template for you like -this: - * TODO - [[file:LINK TO WHERE YOU INITIATED CAPTURE]] - -During expansion of the template, `%a' has been replaced by a link to -the location from where you called the capture command. This can be -extremely useful for deriving tasks from emails, for example. You fill -in the task definition, press `C-c C-c' and Org returns you to the same -place where you started the capture process. - - To define special keys to capture to a particular template without -going through the interactive template selection, you can create your -key binding like this: - - (define-key global-map "\C-cx" - (lambda () (interactive) (org-capture nil "x"))) - -* Menu: - -* Template elements:: What is needed for a complete template entry -* Template expansion:: Filling in information about time and context -* Templates in contexts:: Only show a template in a specific context - - -File: org, Node: Template elements, Next: Template expansion, Up: Capture templates - -9.1.3.1 Template elements -......................... - -Now lets look at the elements of a template definition. Each entry in -`org-capture-templates' is a list with the following items: - -KEYS - The keys that will select the template, as a string, characters - only, for example `"a"' for a template to be selected with a - single key, or `"bt"' for selection with two keys. When using - several keys, keys using the same prefix key must be sequential in - the list and preceded by a 2-element entry explaining the prefix - key, for example - ("b" "Templates for marking stuff to buy") - If you do not define a template for the `C' key, this key will be - used to open the customize buffer for this complex variable. - -DESCRIPTION - A short string describing the template, which will be shown during - selection. - -TYPE - The type of entry, a symbol. Valid values are: - - `entry' - An Org mode node, with a headline. Will be filed as the - child of the target entry or as a top-level entry. The - target file should be an Org mode file. - - `item' - A plain list item, placed in the first plain list at the - target location. Again the target file should be an Org file. - - `checkitem' - A checkbox item. This only differs from the plain list item - by the default template. - - `table-line' - a new line in the first table at the target location. Where - exactly the line will be inserted depends on the properties - `:prepend' and `:table-line-pos' (see below). - - `plain' - Text to be inserted as it is. - -TARGET - Specification of where the captured item should be placed. In Org - mode files, targets usually define a node. Entries will become - children of this node. Other types will be added to the table or - list in the body of this node. Most target specifications contain - a file name. If that file name is the empty string, it defaults - to `org-default-notes-file'. A file can also be given as a - variable or as a function called with no argument. When an - absolute path is not specified for a target, it is taken as - relative to `org-directory'. - - Valid values are: - - `(file "path/to/file")' - Text will be placed at the beginning or end of that file. - - `(id "id of existing org entry")' - Filing as child of this entry, or in the body of the entry. - - `(file+headline "path/to/file" "node headline")' - Fast configuration if the target heading is unique in the - file. - - `(file+olp "path/to/file" "Level 1 heading" "Level 2" ...)' - For non-unique headings, the full path is safer. - - `(file+regexp "path/to/file" "regexp to find location")' - Use a regular expression to position the cursor. - - `(file+olp+datetree "path/to/file" [ "Level 1 heading" ....])' - This target(1) will create a heading in a date tree(2) for - today's date. If the optional outline path is given, the - tree will be built under the node it is pointing to, instead - of at top level. Check out the `:time-prompt' and - `:tree-type' properties below for additional options. - - `(file+function "path/to/file" function-finding-location)' - A function to find the right location in the file. - - `(clock)' - File to the entry that is currently being clocked. - - `(function function-finding-location)' - Most general way: write your own function which both visits - the file and moves point to the right location. - -TEMPLATE - The template for creating the capture item. If you leave this - empty, an appropriate default template will be used. Otherwise - this is a string with escape codes, which will be replaced - depending on time and context of the capture call. The string - with escapes may be loaded from a template file, using the special - syntax `(file "path/to/template")'. See below for more details. - -PROPERTIES - The rest of the entry is a property list of additional options. - Recognized properties are: - - `:prepend' - Normally new captured information will be appended at the - target location (last child, last table line, last list - item...). Setting this property will change that. - - `:immediate-finish' - When set, do not offer to edit the information, just file it - away immediately. This makes sense if the template only needs - information that can be added automatically. - - `:empty-lines' - Set this to the number of lines to insert before and after - the new item. Default 0, only common other value is 1. - - `:clock-in' - Start the clock in this item. - - `:clock-keep' - Keep the clock running when filing the captured entry. - - `:clock-resume' - If starting the capture interrupted a clock, restart that - clock when finished with the capture. Note that - `:clock-keep' has precedence over `:clock-resume'. When - setting both to `t', the current clock will run and the - previous one will not be resumed. - - `:time-prompt' - Prompt for a date/time to be used for date/week trees and - when filling the template. Without this property, capture - uses the current date and time. Even if this property has - not been set, you can force the same behavior by calling - `org-capture' with a `C-1' prefix argument. - - `:tree-type' - When `week', make a week tree instead of the month tree, i.e. - place the headings for each day under a heading with the - current iso week. - - `:unnarrowed' - Do not narrow the target buffer, simply show the full buffer. - Default is to narrow it so that you only see the new material. - - `:table-line-pos' - Specification of the location in the table where the new line - should be inserted. It can be a string, a variable holding a - string or a function returning a string. The string should - look like `"II-3"' meaning that the new line should become - the third line before the second horizontal separator line. - - `:kill-buffer' - If the target file was not yet visited when capture was - invoked, kill the buffer again after capture is completed. - - ---------- Footnotes ---------- - - (1) Org used to offer four different targets for date/week tree -capture. Now, Org automatically translates these to use -`file+olp+datetree', applying the `:time-prompt' and `:tree-type' -properties. Please rewrite your date/week-tree targets using -`file+olp+datetree' since the older targets are now deprecated. - - (2) A date tree is an outline structure with years on the highest -level, months or ISO-weeks as sublevels and then dates on the lowest -level. Tags are allowed in the tree structure. - - -File: org, Node: Template expansion, Next: Templates in contexts, Prev: Template elements, Up: Capture templates - -9.1.3.2 Template expansion -.......................... - -In the template itself, special `%'-escapes(1) allow dynamic insertion -of content. The templates are expanded in the order given here: - - %[FILE] Insert the contents of the file given by FILE. - %(SEXP) Evaluate Elisp SEXP and replace with the result. - For convenience, %:keyword (see below) placeholders - within the expression will be expanded prior to this. - The sexp must return a string. - %<...> The result of format-time-string on the ... format specification. - %t Timestamp, date only. - %T Timestamp, with date and time. - %u, %U Like the above, but inactive timestamps. - %i Initial content, the region when capture is called while the - region is active. - The entire text will be indented like `%i' itself. - %a Annotation, normally the link created with `org-store-link'. - %A Like `%a', but prompt for the description part. - %l Like %a, but only insert the literal link. - %c Current kill ring head. - %x Content of the X clipboard. - %k Title of the currently clocked task. - %K Link to the currently clocked task. - %n User name (taken from `user-full-name'). - %f File visited by current buffer when org-capture was called. - %F Full path of the file or directory visited by current buffer. - %:keyword Specific information for certain link types, see below. - %^g Prompt for tags, with completion on tags in target file. - %^G Prompt for tags, with completion all tags in all agenda files. - %^t Like `%t', but prompt for date. Similarly `%^T', `%^u', `%^U'. - You may define a prompt like `%^{Birthday}t'. - %^C Interactive selection of which kill or clip to use. - %^L Like `%^C', but insert as link. - %^{PROP}p Prompt the user for a value for property PROP. - %^{PROMPT} prompt the user for a string and replace this sequence with it. - You may specify a default value and a completion table with - %^{prompt|default|completion2|completion3...}. - The arrow keys access a prompt-specific history. - %\1 ... %\N Insert the text entered at the Nth %^{PROMPT}, where `N' is - a number, starting from 1.(2) - %? After completing the template, position cursor here. - -For specific link types, the following keywords will be defined(3): - - Link type | Available keywords - ---------------------------------+---------------------------------------------- - bbdb | %:name %:company - irc | %:server %:port %:nick - vm, vm-imap, wl, mh, mew, rmail, | %:type %:subject %:message-id - gnus, notmuch | %:from %:fromname %:fromaddress - | %:to %:toname %:toaddress - | %:date (message date header field) - | %:date-timestamp (date as active timestamp) - | %:date-timestamp-inactive (date as inactive timestamp) - | %:fromto (either "to NAME" or "from NAME")(4) - gnus | %:group, for messages also all email fields - eww, w3, w3m | %:url - info | %:file %:node - calendar | %:date - org-protocol | %:link %:description %:annotation - -To place the cursor after template expansion use: - - %? After completing the template, position cursor here. - - ---------- Footnotes ---------- - - (1) If you need one of these sequences literally, escape the `%' -with a backslash. - - (2) As required in Emacs Lisp, it is necessary to -escape any backslash character in a string with another -backslash. So, in order to use `%\1' placeholder, you -need to write `%\\1' in the template. - - (3) If you define your own link types (*note Adding hyperlink -types::), any property you store with `org-store-link-props' can be -accessed in capture templates in a similar way. - - (4) This will always be the other, not the user. See the variable -`org-from-is-user-regexp'. - - -File: org, Node: Templates in contexts, Prev: Template expansion, Up: Capture templates - -9.1.3.3 Templates in contexts -............................. - -To control whether a capture template should be accessible from a -specific context, you can customize `org-capture-templates-contexts'. -Let's say for example that you have a capture template `"p"' for -storing Gnus emails containing patches. Then you would configure this -option like this: - - (setq org-capture-templates-contexts - '(("p" (in-mode . "message-mode")))) - - You can also tell that the command key `"p"' should refer to another -template. In that case, add this command key like this: - - (setq org-capture-templates-contexts - '(("p" "q" (in-mode . "message-mode")))) - - See the docstring of the variable for more information. - - -File: org, Node: Attachments, Next: RSS feeds, Prev: Capture, Up: Capture - Refile - Archive - -9.2 Attachments -=============== - -It is often useful to associate reference material with an outline -node/task. Small chunks of plain text can simply be stored in the -subtree of a project. Hyperlinks (*note Hyperlinks::) can establish -associations with files that live elsewhere on your computer or in the -cloud, like emails or source code files belonging to a project. -Another method is attachments, which are files located in a directory -belonging to an outline node. Org uses directories named by the unique -ID of each entry. These directories are located in the `data' -directory which lives in the same directory where your Org file -lives(1). If you initialize this directory with `git init', Org will -automatically commit changes when it sees them. The attachment system -has been contributed to Org by John Wiegley. - - In cases where it seems better to do so, you can also attach a -directory of your choice to an entry. You can also make children -inherit the attachment directory from a parent, so that an entire -subtree uses the same attached directory. - -The following commands deal with attachments: - -`C-c C-a (`org-attach')' - The dispatcher for commands related to the attachment system. - After these keys, a list of commands is displayed and you must - press an additional key to select a command: - - `a (`org-attach-attach')' - Select a file and move it into the task's attachment - directory. The file will be copied, moved, or linked, - depending on `org-attach-method'. Note that hard links are - not supported on all systems. - - `c/m/l' - Attach a file using the copy/move/link method. Note that - hard links are not supported on all systems. - - `u (`org-attach-url')' - Attach a file from URL - - `n (`org-attach-new')' - Create a new attachment as an Emacs buffer. - - `z (`org-attach-sync')' - Synchronize the current task with its attachment directory, - in case you added attachments yourself. - - `o (`org-attach-open')' - Open current task's attachment. If there is more than one, - prompt for a file name first. Opening will follow the rules - set by `org-file-apps'. For more details, see the - information on following hyperlinks (*note Handling links::). - - `O (`org-attach-open-in-emacs')' - Also open the attachment, but force opening the file in Emacs. - - `f (`org-attach-reveal')' - Open the current task's attachment directory. - - `F (`org-attach-reveal-in-emacs')' - Also open the directory, but force using `dired' in Emacs. - - `d (`org-attach-delete-one')' - Select and delete a single attachment. - - `D (`org-attach-delete-all')' - Delete all of a task's attachments. A safer way is to open - the directory in `dired' and delete from there. - - `s (`org-attach-set-directory')' - Set a specific directory as the entry's attachment directory. - This works by putting the directory path into the - `ATTACH_DIR' property. - - `i (`org-attach-set-inherit')' - Set the `ATTACH_DIR_INHERIT' property, so that children will - use the same directory for attachments as the parent does. - - ---------- Footnotes ---------- - - (1) If you move entries or Org files from one directory to another, -you may want to configure `org-attach-directory' to contain an absolute -path. - - -File: org, Node: RSS feeds, Next: Protocols, Prev: Attachments, Up: Capture - Refile - Archive - -9.3 RSS feeds -============= - -Org can add and change entries based on information found in RSS feeds -and Atom feeds. You could use this to make a task out of each new -podcast in a podcast feed. Or you could use a phone-based -note-creating service on the web to import tasks into Org. To access -feeds, configure the variable `org-feed-alist'. The docstring of this -variable has detailed information. Here is just an example: - - (setq org-feed-alist - '(("Slashdot" - "http://rss.slashdot.org/Slashdot/slashdot" - "~/txt/org/feeds.org" "Slashdot Entries"))) - -will configure that new items from the feed provided by -`rss.slashdot.org' will result in new entries in the file -`~/org/feeds.org' under the heading `Slashdot Entries', whenever the -following command is used: - -`C-c C-x g (`org-feed-update-all')' - -`C-c C-x g' - Collect items from the feeds configured in `org-feed-alist' and - act upon them. - -`C-c C-x G (`org-feed-goto-inbox')' - Prompt for a feed name and go to the inbox configured for this - feed. - - Under the same headline, Org will create a drawer `FEEDSTATUS' in -which it will store information about the status of items in the feed, -to avoid adding the same item several times. - - For more information, including how to read atom feeds, see -`org-feed.el' and the docstring of `org-feed-alist'. - - -File: org, Node: Protocols, Next: Refile and copy, Prev: RSS feeds, Up: Capture - Refile - Archive - -9.4 Protocols for external access -================================= - -Org protocol is a mean to trigger custom actions in Emacs from external -applications. Any application that supports calling external programs -with an URL as argument may be used with this functionality. For -example, you can configure bookmarks in your web browser to send a link -to the current page to Org and create a note from it using capture -(*note Capture::). You can also create a bookmark that tells Emacs to -open the local source file of a remote website you are browsing. - - In order to use Org protocol from an application, you need to -register `org-protocol://' as a valid scheme-handler. External calls -are passed to Emacs through the `emacsclient' command, so you also need -to ensure an Emacs server is running. More precisely, when the -application calls - - emacsclient org-protocol://PROTOCOL?key1=val1&key2=val2 - -Emacs calls the handler associated to `PROTOCOL' with argument `(:key1 -val1 :key2 val2)'. - - Org protocol comes with three predefined protocols, detailed in the -following sections. Configure `org-protocol-protocol-alist' to define -your own. - -* Menu: - -* `store-link' protocol:: Store a link, push URL to kill-ring. -* `capture' protocol:: Fill a buffer with external information. -* `open-source' protocol:: Edit published contents. - - -File: org, Node: `store-link' protocol, Next: `capture' protocol, Up: Protocols - -9.4.1 `store-link' protocol ---------------------------- - -Using `store-link' handler, you can copy links, insertable through `M-x -org-insert-link' or yanking thereafter. More precisely, the command - - emacsclient org-protocol://store-link?url=URL&title=TITLE - -stores the following link: - - [[URL][TITLE]] - - In addition, `URL' is pushed on the kill-ring for yanking. You need -to encode `URL' and `TITLE' if they contain slashes, and probably quote -those for the shell. - - To use this feature from a browser, add a bookmark with an arbitrary -name, e.g., `Org: store-link' and enter this as _Location_: - - javascript:location.href='org-protocol://store-link?url='+ - encodeURIComponent(location.href); - - -File: org, Node: `capture' protocol, Next: `open-source' protocol, Prev: `store-link' protocol, Up: Protocols - -9.4.2 `capture' protocol ------------------------- - -Activating `capture' handler pops up a `Capture' buffer and fills the -capture template associated to the `X' key with them. - - emacsclient org-protocol://capture?template=X?url=URL?title=TITLE?body=BODY - - To use this feature, add a bookmark with an arbitrary name, e.g. -`Org: capture' and enter this as `Location': - - javascript:location.href='org-protocol://template=x'+ - '&url='+encodeURIComponent(window.location.href)+ - '&title='+encodeURIComponent(document.title)+ - '&body='+encodeURIComponent(window.getSelection()); - - The result depends on the capture template used, which is set in the -bookmark itself, as in the example above, or in -`org-protocol-default-template-key'. - - The following template placeholders are available: - - %:link The URL - %:description The webpage title - %:annotation Equivalent to [[%:link][%:description]] - %i The selected text - - -File: org, Node: `open-source' protocol, Prev: `capture' protocol, Up: Protocols - -9.4.3 `open-source' protocol ----------------------------- - -The `open-source' handler is designed to help with editing local sources -when reading a document. To that effect, you can use a bookmark with -the following location: - - javascript:location.href='org-protocol://open-source?&url='+ - encodeURIComponent(location.href) - - The variable `org-protocol-project-alist' maps URLs to local file -names, by stripping URL parameters from the end and replacing the -`:base-url' with `:working-directory' and `:online-suffix' with -`:working-suffix'. For example, assuming you own a local copy of -`http://orgmode.org/worg/' contents at `/home/user/worg', you can set -`org-protocol-project-alist' to the following - - (setq org-protocol-project-alist - '(("Worg" - :base-url "http://orgmode.org/worg/" - :working-directory "/home/user/worg/" - :online-suffix ".html" - :working-suffix ".org"))) - -If you are now browsing -`http://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. - - However, such mapping may not yield the desired results. Suppose you -maintain an online store located at `http://example.com/'. The local -sources reside in `/home/user/example/'. It is common practice to serve -all products in such a store through one file and rewrite URLs that do -not match an existing file on the server. That way, a request to -`http://example.com/print/posters.html' might be rewritten on the server -to something like -`http://example.com/shop/products.php/posters.html.php'. The -`open-source' handler probably cannot find a file named -`/home/user/example/print/posters.html.php' and fails. - - Such an entry in `org-protocol-project-alist' may hold an additional -property `:rewrites'. This property is a list of cons cells, each of -which maps a regular expression to a path relative to the -`:working-directory'. - - Now map the URL to the path `/home/user/example/products.php' by -adding `:rewrites' rules like this: - - (setq org-protocol-project-alist - '(("example.com" - :base-url "http://example.com/" - :working-directory "/home/user/example/" - :online-suffix ".php" - :working-suffix ".php" - :rewrites (("example.com/print/" . "products.php") - ("example.com/$" . "index.php"))))) - -Since `example.com/$' is used as a regular expression, it maps -`http://example.com/', `https://example.com', `http://www.example.com/' -and similar to `/home/user/example/index.php'. - - The `:rewrites' rules are searched as a last resort if and only if no -existing file name is matched. - - Two functions can help you filling `org-protocol-project-alist' with -valid contents: `org-protocol-create' and -`org-protocol-create-for-org'. The latter is of use if you're editing -an Org file that is part of a publishing project. - - -File: org, Node: Refile and copy, Next: Archiving, Prev: Protocols, Up: Capture - Refile - Archive - -9.5 Refile and copy -=================== - -When reviewing the captured data, you may want to refile or to copy -some of the entries into a different list, for example into a project. -Cutting, finding the right location, and then pasting the note is -cumbersome. To simplify this process, you can use the following -special command: - -`C-c M-w (`org-copy')' - Copying works like refiling, except that the original note is not - deleted. - -`C-c C-w (`org-refile')' - Refile the entry or region at point. This command offers possible - locations for refiling the entry and lets you select one with - completion. The item (or all items in the region) is filed below - the target heading as a subitem. Depending on - `org-reverse-note-order', it will be either the first or last - subitem. - By default, all level 1 headlines in the current buffer are - considered to be targets, but you can have more complex - definitions across a number of files. See the variable - `org-refile-targets' for details. If you would like to select a - location via a file-path-like completion along the outline path, - see the variables `org-refile-use-outline-path' and - `org-outline-path-complete-in-steps'. If you would like to be - able to create new nodes as new parents for refiling on the fly, - check the variable `org-refile-allow-creating-parent-nodes'. When - the variable `org-log-refile'(1) is set, a timestamp or a note - will be recorded when an entry has been refiled. - -`C-u C-c C-w' - Use the refile interface to jump to a heading. - -`C-u C-u C-c C-w (`org-refile-goto-last-stored')' - Jump to the location where `org-refile' last moved a tree to. - -`C-2 C-c C-w' - Refile as the child of the item currently being clocked. - -`C-3 C-c C-w' - Refile and keep the entry in place. Also see `org-refile-keep' to - make this the default behavior, and beware that this may result in - duplicated `ID' properties. - -`C-0 C-c C-w or C-u C-u C-u C-c C-w (`org-refile-cache-clear')' - Clear the target cache. Caching of refile targets can be turned - on by setting `org-refile-use-cache'. To make the command see new - possible targets, you have to clear the cache with this command. - - ---------- Footnotes ---------- - - (1) with corresponding `#+STARTUP' keywords `logrefile', -`lognoterefile', and `nologrefile' - - -File: org, Node: Archiving, Prev: Refile and copy, Up: Capture - Refile - Archive - -9.6 Archiving -============= - -When a project represented by a (sub)tree is finished, you may want to -move the tree out of the way and to stop it from contributing to the -agenda. Archiving is important to keep your working files compact and -global searches like the construction of agenda views fast. - -`C-c C-x C-a (`org-archive-subtree-default')' - Archive the current entry using the command specified in the - variable `org-archive-default-command'. - -* Menu: - -* Moving subtrees:: Moving a tree to an archive file -* Internal archiving:: Switch off a tree but keep it in the file - - -File: org, Node: Moving subtrees, Next: Internal archiving, Up: Archiving - -9.6.1 Moving a tree to the archive file ---------------------------------------- - -The most common archiving action is to move a project tree to another -file, the archive file. - -`C-c C-x C-s or short C-c $ (`org-archive-subtree')' - Archive the subtree starting at the cursor position to the location - given by `org-archive-location'. - -`C-u C-c C-x C-s' - Check if any direct children of the current headline could be - moved to the archive. To do this, each subtree is checked for - open TODO entries. If none are found, the command offers to move - it to the archive location. If the cursor is _not_ on a headline - when this command is invoked, the level 1 trees will be checked. - -`C-u C-u C-c C-x C-s' - As above, but check subtree for timestamps instead of TODO - entries. The command will offer to archive the subtree if it - _does_ contain a timestamp, and that timestamp is in the past. - - The default archive location is a file in the same directory as the -current file, with the name derived by appending `_archive' to the -current file name. You can also choose what heading to file archived -items under, with the possibility to add them to a datetree in a file. -For information and examples on how to specify the file and the heading, -see the documentation string of the variable `org-archive-location'. - - There is also an in-buffer option for setting this variable, for -example: - - #+ARCHIVE: %s_done:: - -If you would like to have a special ARCHIVE location for a single entry -or a (sub)tree, give the entry an `:ARCHIVE:' property with the -location as the value (*note Properties and columns::). - - When a subtree is moved, it receives a number of special properties -that record context information like the file from where the entry -came, its outline path the archiving time etc. Configure the variable -`org-archive-save-context-info' to adjust the amount of information -added. - - -File: org, Node: Internal archiving, Prev: Moving subtrees, Up: Archiving - -9.6.2 Internal archiving ------------------------- - -If you want to just switch off--for agenda views--certain subtrees -without moving them to a different file, you can use the archive tag. - - A headline that is marked with the `:ARCHIVE:' tag (*note Tags::) -stays at its location in the outline tree, but behaves in the following -way: - - It does not open when you attempt to do so with a visibility - cycling command (*note Visibility cycling::). You can force - cycling archived subtrees with `C-', or by setting the option - `org-cycle-open-archived-trees'. Also normal outline commands like - `show-all' will open archived subtrees. - - - During sparse tree construction (*note Sparse trees::), matches in - archived subtrees are not exposed, unless you configure the option - `org-sparse-tree-open-archived-trees'. - - - During agenda view construction (*note Agenda views::), the - content of archived trees is ignored unless you configure the - option `org-agenda-skip-archived-trees', in which case these trees - will always be included. In the agenda you can press `v a' to get - archives temporarily included. - - - Archived trees are not exported (*note Exporting::), only the - headline is. Configure the details using the variable - `org-export-with-archived-trees'. - - - Archived trees are excluded from column view unless the variable - `org-columns-skip-archived-trees' is configured to `nil'. - - The following commands help manage the ARCHIVE tag: - -`C-c C-x a (`org-toggle-archive-tag')' - Toggle the ARCHIVE tag for the current headline. When the tag is - set, the headline changes to a shadowed face, and the subtree - below it is hidden. - -`C-u C-c C-x a' - Check if any direct children of the current headline should be - archived. To do this, each subtree is checked for open TODO - entries. If none are found, the command offers to set the ARCHIVE - tag for the child. If the cursor is _not_ on a headline when this - command is invoked, the level 1 trees will be checked. - -`C-TAB (`org-force-cycle-archived')' - Cycle a tree even if it is tagged with ARCHIVE. - -`C-c C-x A (`org-archive-to-archive-sibling')' - Move the current entry to the _Archive Sibling_. This is a - sibling of the entry with the heading `Archive' and the tag - `ARCHIVE'. The entry becomes a child of that sibling and in this - way retains a lot of its original context, including inherited - tags and approximate position in the outline. - - -File: org, Node: Agenda views, Next: Markup, Prev: Capture - Refile - Archive, Up: Top - -10 Agenda views -*************** - -Due to the way Org works, TODO items, time-stamped items, and tagged -headlines can be scattered throughout a file or even a number of files. -To get an overview of open action items, or of events that are -important for a particular date, this information must be collected, -sorted and displayed in an organized way. - - Org can select items based on various criteria and display them in a -separate buffer. Six different view types are provided: - - * an _agenda_ that is like a calendar and shows information for - specific dates, - - * a _TODO list_ that covers all unfinished action items, - - * a _match view_, showings headlines based on the tags, properties, - and TODO state associated with them, - - * a _text search view_ that shows all entries from multiple files - that contain specified keywords, - - * a _stuck projects view_ showing projects that currently don't move - along, and - - * _custom views_ that are special searches and combinations of - different views. - -The extracted information is displayed in a special _agenda buffer_. -This buffer is read-only, but provides commands to visit the -corresponding locations in the original Org files, and even to edit -these files remotely. - - By default, the report ignores commented (*note Comment lines::) and -archived (*note Internal archiving::) entries. You can override this -by setting `org-agenda-skip-comment-trees' and -`org-agenda-skip-archived-trees' to `nil'. - - Two variables control how the agenda buffer is displayed and whether -the window configuration is restored when the agenda exits: -`org-agenda-window-setup' and `org-agenda-restore-windows-after-quit'. - -* Menu: - -* Agenda files:: Files being searched for agenda information -* Agenda dispatcher:: Keyboard access to agenda views -* Built-in agenda views:: What is available out of the box? -* Presentation and sorting:: How agenda items are prepared for display -* Agenda commands:: Remote editing of Org trees -* Custom agenda views:: Defining special searches and views -* Exporting agenda views:: Writing a view to a file -* Agenda column view:: Using column view for collected entries - - -File: org, Node: Agenda files, Next: Agenda dispatcher, Up: Agenda views - -10.1 Agenda files -================= - -The information to be shown is normally collected from all _agenda -files_, the files listed in the variable `org-agenda-files'(1). If a -directory is part of this list, all files with the extension `.org' in -this directory will be part of the list. - - Thus, even if you only work with a single Org file, that file should -be put into the list(2). You can customize `org-agenda-files', but the -easiest way to maintain it is through the following commands - -`C-c [ (`org-agenda-file-to-front')' - Add current file to the list of agenda files. The file is added to - the front of the list. If it was already in the list, it is moved - to the front. With a prefix argument, file is added/moved to the - end. - -`C-c ] (`org-remove-file')' - Remove current file from the list of agenda files. - -`C-' (`org-cycle-agenda-files')' -`C-,' - Cycle through agenda file list, visiting one file after the other. - -`M-x org-iswitchb RET' - Command to use an `iswitchb'-like interface to switch to and - between Org buffers. - -The Org menu contains the current list of files and can be used to -visit any of them. - - If you would like to focus the agenda temporarily on a file not in -this list, or on just one file in the list, or even on only a subtree -in a file, then this can be done in different ways. For a single -agenda command, you may press `<' once or several times in the -dispatcher (*note Agenda dispatcher::). To restrict the agenda scope -for an extended period, use the following commands: - -`C-c C-x < (`org-agenda-set-restriction-lock')' - Permanently restrict the agenda to the current subtree. When with - a prefix argument, or with the cursor before the first headline in - a file, the agenda scope is set to the entire file. This - restriction remains in effect until removed with `C-c C-x >', or - by typing either `<' or `>' in the agenda dispatcher. If there is - a window displaying an agenda view, the new restriction takes - effect immediately. - -`C-c C-x > (`org-agenda-remove-restriction-lock')' - Remove the permanent restriction created by `C-c C-x <'. - -When working with `speedbar.el', you can use the following commands in -the Speedbar frame: - -`< in the speedbar frame (`org-speedbar-set-agenda-restriction')' - Permanently restrict the agenda to the item--either an Org file or - a subtree in such a file--at the cursor in the Speedbar frame. If - there is a window displaying an agenda view, the new restriction - takes effect immediately. - -`> in the speedbar frame (`org-agenda-remove-restriction-lock')' - Lift the restriction. - - ---------- Footnotes ---------- - - (1) If the value of that variable is not a list, but a single file -name, then the list of agenda files will be maintained in that external -file. - - (2) When using the dispatcher, pressing `<' before selecting a -command will actually limit the command to the current file, and ignore -`org-agenda-files' until the next dispatcher command. - - -File: org, Node: Agenda dispatcher, Next: Built-in agenda views, Prev: Agenda files, Up: Agenda views - -10.2 The agenda dispatcher -========================== - -The views are created through a dispatcher, which should be bound to a -global key--for example `C-c a' (*note Activation::). In the following -we will assume that `C-c a' is indeed how the dispatcher is accessed -and list keyboard access to commands accordingly. After pressing `C-c -a', an additional letter is required to execute a command. The -dispatcher offers the following default commands: - -`a' - Create the calendar-like agenda (*note Weekly/daily agenda::). - -`t / T' - Create a list of all TODO items (*note Global TODO list::). - -`m / M' - Create a list of headlines matching a TAGS expression (*note - Matching tags and properties::). - -`s' - Create a list of entries selected by a boolean expression of - keywords and/or regular expressions that must or must not occur in - the entry. - -`/' - Search for a regular expression in all agenda files and - additionally in the files listed in - `org-agenda-text-search-extra-files'. This uses the Emacs command - `multi-occur'. A prefix argument can be used to specify the - number of context lines for each match, default is 1. - -`# / !' - Create a list of stuck projects (*note Stuck projects::). - -`<' - Restrict an agenda command to the current buffer(1). After - pressing `<', you still need to press the character selecting the - command. - -`< <' - If there is an active region, restrict the following agenda - command to the region. Otherwise, restrict it to the current - subtree(2). After pressing `< <', you still need to press the - character selecting the command. - -`*' - Toggle sticky agenda views. By default, Org maintains only a - single agenda buffer and rebuilds it each time you change the - view, to make sure everything is always up to date. If you often - switch between agenda views and the build time bothers you, you - can turn on sticky agenda buffers or make this the default by - customizing the variable `org-agenda-sticky'. With sticky - agendas, the agenda dispatcher will not recreate agenda views from - scratch, it will only switch to the selected one, and you need to - update the agenda by hand with `r' or `g' when needed. You can - toggle sticky agenda view any time with `org-toggle-sticky-agenda'. - - You can also define custom commands that will be accessible through -the dispatcher, just like the default commands. This includes the -possibility to create extended agenda buffers that contain several -blocks together, for example the weekly agenda, the global TODO list and -a number of special tags matches. *Note Custom agenda views::. - - ---------- Footnotes ---------- - - (1) For backward compatibility, you can also press `1' to restrict -to the current buffer. - - (2) For backward compatibility, you can also press `0' to restrict -to the current region/subtree. - - -File: org, Node: Built-in agenda views, Next: Presentation and sorting, Prev: Agenda dispatcher, Up: Agenda views - -10.3 The built-in agenda views -============================== - -In this section we describe the built-in views. - -* Menu: - -* Weekly/daily agenda:: The calendar page with current tasks -* Global TODO list:: All unfinished action items -* Matching tags and properties:: Structured information with fine-tuned search -* Search view:: Find entries by searching for text -* Stuck projects:: Find projects you need to review - - -File: org, Node: Weekly/daily agenda, Next: Global TODO list, Up: Built-in agenda views - -10.3.1 The weekly/daily agenda ------------------------------- - -The purpose of the weekly/daily _agenda_ is to act like a page of a -paper agenda, showing all the tasks for the current week or day. - -`C-c a a (`org-agenda-list')' - Compile an agenda for the current week from a list of Org files. - The agenda shows the entries for each day. With a numeric - prefix(1) (like `C-u 2 1 C-c a a') you may set the number of days - to be displayed. - - The default number of days displayed in the agenda is set by the -variable `org-agenda-span' (or the obsolete `org-agenda-ndays'). This -variable can be set to any number of days you want to see by default in -the agenda, or to a span name, such as `day', `week', `month' or -`year'. For weekly agendas, the default is to start on the previous -monday (see `org-agenda-start-on-weekday'). You can also set the start -date using a date shift: `(setq org-agenda-start-day "+10d")' will -start the agenda ten days from today in the future. - - Remote editing from the agenda buffer means, for example, that you -can change the dates of deadlines and appointments from the agenda -buffer. The commands available in the Agenda buffer are listed in -*note Agenda commands::. - -Calendar/Diary integration -.......................... - -Emacs contains the calendar and diary by Edward M. Reingold. The -calendar displays a three-month calendar with holidays from different -countries and cultures. The diary allows you to keep track of -anniversaries, lunar phases, sunrise/set, recurrent appointments -(weekly, monthly) and more. In this way, it is quite complementary to -Org. It can be very useful to combine output from Org with the diary. - - In order to include entries from the Emacs diary into Org mode's -agenda, you only need to customize the variable - - (setq org-agenda-include-diary t) - -After that, everything will happen automatically. All diary entries -including holidays, anniversaries, etc., will be included in the agenda -buffer created by Org mode. , , and can be used from -the agenda buffer to jump to the diary file in order to edit existing -diary entries. The `i' command to insert new entries for the current -date works in the agenda buffer, as well as the commands `S', `M', and -`C' to display Sunrise/Sunset times, show lunar phases and to convert -to other calendars, respectively. `c' can be used to switch back and -forth between calendar and agenda. - - If you are using the diary only for sexp entries and holidays, it is -faster to not use the above setting, but instead to copy or even move -the entries into an Org file. Org mode evaluates diary-style sexp -entries, and does it faster because there is no overhead for first -creating the diary display. Note that the sexp entries must start at -the left margin, no whitespace is allowed before them. For example, -the following segment of an Org file will be processed and entries will -be made in the agenda: - - * Holidays - :PROPERTIES: - :CATEGORY: Holiday - :END: - %%(org-calendar-holiday) ; special function for holiday names - - * Birthdays - :PROPERTIES: - :CATEGORY: Ann - :END: - %%(org-anniversary 1956 5 14)(2) Arthur Dent is %d years old - %%(org-anniversary 1869 10 2) Mahatma Gandhi would be %d years old - -Anniversaries from BBDB -....................... - -If you are using the Big Brothers Database to store your contacts, you -will very likely prefer to store anniversaries in BBDB rather than in a -separate Org or diary file. Org supports this and will show BBDB -anniversaries as part of the agenda. All you need to do is to add the -following to one of your agenda files: - - * Anniversaries - :PROPERTIES: - :CATEGORY: Anniv - :END: - %%(org-bbdb-anniversaries) - - You can then go ahead and define anniversaries for a BBDB record. -Basically, you need to press `C-o anniversary ' with the cursor in -a BBDB record and then add the date in the format `YYYY-MM-DD' or -`MM-DD', followed by a space and the class of the anniversary -(`birthday' or `wedding', or a format string). If you omit the class, -it will default to `birthday'. Here are a few examples, the header for -the file `org-bbdb.el' contains more detailed information. - - 1973-06-22 - 06-22 - 1955-08-02 wedding - 2008-04-14 %s released version 6.01 of org mode, %d years ago - - After a change to BBDB, or for the first agenda display during an -Emacs session, the agenda display will suffer a short delay as Org -updates its hash with anniversaries. However, from then on things will -be very fast--much faster in fact than a long list of -`%%(diary-anniversary)' entries in an Org or Diary file. - - If you would like to see upcoming anniversaries with a bit of -forewarning, you can use the following instead: - - * Anniversaries - :PROPERTIES: - :CATEGORY: Anniv - :END: - %%(org-bbdb-anniversaries-future 3) - - That will give you three days' warning: on the anniversary date -itself and the two days prior. The argument is optional: if omitted, -it defaults to 7. - -Appointment reminders -..................... - -Org can interact with Emacs appointments notification facility. To add -the appointments of your agenda files, use the command -`org-agenda-to-appt'. This command lets you filter through the list of -your appointments and add only those belonging to a specific category -or matching a regular expression. It also reads a `APPT_WARNTIME' -property which will then override the value of -`appt-message-warning-time' for this appointment. See the docstring -for details. - - ---------- Footnotes ---------- - - (1) For backward compatibility, the universal prefix `C-u' causes -all TODO entries to be listed before the agenda. This feature is -deprecated, use the dedicated TODO list, or a block agenda instead -(*note Block agenda::). - - (2) `org-anniversary' is just like `diary-anniversary', but the -argument order is always according to ISO and therefore independent of -the value of `calendar-date-style'. - - -File: org, Node: Global TODO list, Next: Matching tags and properties, Prev: Weekly/daily agenda, Up: Built-in agenda views - -10.3.2 The global TODO list ---------------------------- - -The global TODO list contains all unfinished TODO items formatted and -collected into a single place. - -`C-c a t (`org-todo-list')' - Show the global TODO list. This collects the TODO items from all - agenda files (*note Agenda views::) into a single buffer. By - default, this lists items with a state the is not a DONE state. - The buffer is in `agenda-mode', so there are commands to examine - and manipulate the TODO entries directly from that buffer (*note - Agenda commands::). - -`C-c a T (`org-todo-list')' - Like the above, but allows selection of a specific TODO keyword. - You can also do this by specifying a prefix argument to `C-c a t'. - You are prompted for a keyword, and you may also specify several - keywords by separating them with `|' as the boolean OR operator. - With a numeric prefix, the Nth keyword in `org-todo-keywords' is - selected. The `r' key in the agenda buffer regenerates it, and - you can give a prefix argument to this command to change the - selected TODO keyword, for example `3 r'. If you often need a - search for a specific keyword, define a custom command for it - (*note Agenda dispatcher::). - Matching specific TODO keywords can also be done as part of a tags - search (*note Tag searches::). - - Remote editing of TODO items means that you can change the state of a -TODO entry with a single key press. The commands available in the TODO -list are described in *note Agenda commands::. - - Normally the global TODO list simply shows all headlines with TODO -keywords. This list can become very long. There are two ways to keep -it more compact: - - Some people view a TODO item that has been _scheduled_ for - execution or have a _deadline_ (*note Timestamps::) as no longer - _open_. Configure the variables - `org-agenda-todo-ignore-scheduled', - `org-agenda-todo-ignore-deadlines', - `org-agenda-todo-ignore-timestamp' and/or - `org-agenda-todo-ignore-with-date' to exclude such items from the - global TODO list. - - - TODO items may have sublevels to break up the task into subtasks. - In such cases it may be enough to list only the highest level TODO - headline and omit the sublevels from the global list. Configure - the variable `org-agenda-todo-list-sublevels' to get this behavior. - - -File: org, Node: Matching tags and properties, Next: Search view, Prev: Global TODO list, Up: Built-in agenda views - -10.3.3 Matching tags and properties ------------------------------------ - -If headlines in the agenda files are marked with _tags_ (*note Tags::), -or have properties (*note Properties and columns::), you can select -headlines based on this metadata and collect them into an agenda -buffer. The match syntax described here also applies when creating -sparse trees with `C-c / m'. - -`C-c a m (`org-tags-view')' - Produce a list of all headlines that match a given set of tags. - The command prompts for a selection criterion, which is a boolean - logic expression with tags, like `+work+urgent-withboss' or - `work|home' (*note Tags::). If you often need a specific search, - define a custom command for it (*note Agenda dispatcher::). - -`C-c a M (`org-tags-view')' - Like `C-c a m', but only select headlines that are also TODO items - in a not-DONE state and force checking subitems (see variable - `org-tags-match-list-sublevels'). To exclude scheduled/deadline - items, see the variable - `org-agenda-tags-todo-honor-ignore-options'. Matching specific - TODO keywords together with a tags match is also possible, see - *note Tag searches::. - - The commands available in the tags list are described in *note -Agenda commands::. - -Match syntax -............ - -A search string can use Boolean operators `&' for `AND' and `|' for -`OR'. `&' binds more strongly than `|'. Parentheses are not -implemented. Each element in the search is either a tag, a regular -expression matching tags, or an expression like `PROPERTY OPERATOR -VALUE' with a comparison operator, accessing a property value. Each -element may be preceded by `-', to select against it, and `+' is -syntactic sugar for positive selection. The `AND' operator `&' is -optional when `+' or `-' is present. Here are some examples, using -only tags. - -`work' - Select headlines tagged `:work:'. - -`work&boss' - Select headlines tagged `:work:' and `:boss:'. - -`+work-boss' - Select headlines tagged `:work:', but discard those also tagged - `:boss:'. - -`work|laptop' - Selects lines tagged `:work:' or `:laptop:'. - -`work|laptop+night' - Like before, but require the `:laptop:' lines to be tagged also - `:night:'. - - Instead of a tag, you may also specify a regular expression enclosed -in curly braces. For example, `work+{^boss.*}' matches headlines that -contain the tag `:work:' and any tag starting with `boss'. - - Group tags (*note Tag hierarchy::) are expanded as regular -expressions. E.g., if `:work:' is a group tag for the group -`:work:lab:conf:', then searching for `work' will search for -`{\(?:work\|lab\|conf\)}' and searching for `-work' will search for all -headlines but those with one of the tags in the group (i.e., -`-{\(?:work\|lab\|conf\)}'). - - You may also test for properties (*note Properties and columns::) at -the same time as matching tags. The properties may be real properties, -or special properties that represent other metadata (*note Special -properties::). For example, the "property" `TODO' represents the TODO -keyword of the entry and the "property" `PRIORITY' represents the -PRIORITY keyword of the entry. - - In addition to the properties mentioned above, `LEVEL' represents the -level of an entry. So a search `+LEVEL=3+boss-TODO="DONE"' lists all -level three headlines that have the tag `boss' and are _not_ marked -with the TODO keyword DONE. In buffers with `org-odd-levels-only' set, -`LEVEL' does not count the number of stars, but `LEVEL=2' will -correspond to 3 stars etc. - - Here are more examples: - -`work+TODO="WAITING"' - Select `:work:'-tagged TODO lines with the specific TODO keyword - `WAITING'. - -`work+TODO="WAITING"|home+TODO="WAITING"' - Waiting tasks both at work and at home. - - When matching properties, a number of different operators can be -used to test the value of a property. Here is a complex example: - - +work-boss+PRIORITY="A"+Coffee="unlimited"+Effort<2 \ - +With={Sarah\|Denny}+SCHEDULED>="<2008-10-11>" - -The type of comparison will depend on how the comparison value is -written: - - If the comparison value is a plain number, a numerical comparison - is done, and the allowed operators are `<', `=', `>', `<=', `>=', - and `<>'. - - - If the comparison value is enclosed in double-quotes, a string - comparison is done, and the same operators are allowed. - - - If the comparison value is enclosed in double-quotes _and_ angular - brackets (like `DEADLINE<="<2008-12-24 18:30>"'), both values are - assumed to be date/time specifications in the standard Org way, - and the comparison will be done accordingly. Special values that - will be recognized are `""' for now (including time), and - `""', and `""' for these days at 00:00 hours, - i.e., without a time specification. Also strings like `"<+5d>"' - or `"<-2m>"' with units `d', `w', `m', and `y' for day, week, - month, and year, respectively, can be used. - - - If the comparison value is enclosed in curly braces, a regexp - match is performed, with `=' meaning that the regexp matches the - property value, and `<>' meaning that it does not match. - - So the search string in the example finds entries tagged `:work:' but -not `:boss:', which also have a priority value `A', a `:Coffee:' -property with the value `unlimited', an `Effort' property that is -numerically smaller than 2, a `:With:' property that is matched by the -regular expression `Sarah\|Denny', and that are scheduled on or after -October 11, 2008. - - You can configure Org mode to use property inheritance during a -search, but beware that this can slow down searches considerably. See -*note Property inheritance::, for details. - - For backward compatibility, and also for typing speed, there is also -a different way to test TODO states in a search. For this, terminate -the tags/property part of the search string (which may include several -terms connected with `|') with a `/' and then specify a Boolean -expression just for TODO keywords. The syntax is then similar to that -for tags, but should be applied with care: for example, a positive -selection on several TODO keywords cannot meaningfully be combined with -boolean AND. However, _negative selection_ combined with AND can be -meaningful. To make sure that only lines are checked that actually -have any TODO keyword (resulting in a speed-up), use `C-c a M', or -equivalently start the TODO part after the slash with `!'. Using `C-c -a M' or `/!' will not match TODO keywords in a DONE state. Examples: - -`work/WAITING' - Same as `work+TODO="WAITING"' - -`work/!-WAITING-NEXT' - Select `:work:'-tagged TODO lines that are neither `WAITING' nor - `NEXT' - -`work/!+WAITING|+NEXT' - Select `:work:'-tagged TODO lines that are either `WAITING' or - `NEXT'. - - -File: org, Node: Search view, Next: Stuck projects, Prev: Matching tags and properties, Up: Built-in agenda views - -10.3.4 Search view ------------------- - -This agenda view is a general text search facility for Org mode entries. -It is particularly useful to find notes. - -`C-c a s (`org-search-view')' - This is a special search that lets you select entries by matching - a substring or specific words using a boolean logic. - For example, the search string `computer equipment' will find entries -that contain `computer equipment' as a substring. If the two words are -separated by more space or a line break, the search will still match. -Search view can also search for specific keywords in the entry, using -Boolean logic. The search string `+computer +wifi -ethernet --{8\.11[bg]}' will search for note entries that contain the keywords -`computer' and `wifi', but not the keyword `ethernet', and which are -also not matched by the regular expression `8\.11[bg]', meaning to -exclude both 8.11b and 8.11g. The first `+' is necessary to turn on -word search, other `+' characters are optional. For more details, see -the docstring of the command `org-search-view'. - - Note that in addition to the agenda files, this command will also -search the files listed in `org-agenda-text-search-extra-files'. - - -File: org, Node: Stuck projects, Prev: Search view, Up: Built-in agenda views - -10.3.5 Stuck projects ---------------------- - -If you are following a system like David Allen's GTD to organize your -work, one of the "duties" you have is a regular review to make sure -that all projects move along. A _stuck_ project is a project that has -no defined next actions, so it will never show up in the TODO lists Org -mode produces. During the review, you need to identify such projects -and define next actions for them. - -`C-c a # (`org-agenda-list-stuck-projects')' - List projects that are stuck. - -`C-c a !' - Customize the variable `org-stuck-projects' to define what a stuck - project is and how to find it. - - You almost certainly will have to configure this view before it will -work for you. The built-in default assumes that all your projects are -level-2 headlines, and that a project is not stuck if it has at least -one entry marked with a TODO keyword TODO or NEXT or NEXTACTION. - - Let's assume that you, in your own way of using Org mode, identify -projects with a tag PROJECT, and that you use a TODO keyword MAYBE to -indicate a project that should not be considered yet. Let's further -assume that the TODO keyword DONE marks finished projects, and that NEXT -and TODO indicate next actions. The tag @SHOP indicates shopping and -is a next action even without the NEXT tag. Finally, if the project -contains the special word IGNORE anywhere, it should not be listed -either. In this case you would start by identifying eligible projects -with a tags/todo match(1) `+PROJECT/-MAYBE-DONE', and then check for -TODO, NEXT, @SHOP, and IGNORE in the subtree to identify projects that -are not stuck. The correct customization for this is - - (setq org-stuck-projects - '("+PROJECT/-MAYBE-DONE" ("NEXT" "TODO") ("@SHOP") - "\\")) - - Note that if a project is identified as non-stuck, the subtree of -this entry will still be searched for stuck projects. - - ---------- Footnotes ---------- - - (1) *Note Tag searches::. - - -File: org, Node: Presentation and sorting, Next: Agenda commands, Prev: Built-in agenda views, Up: Agenda views - -10.4 Presentation and sorting -============================= - -Before displaying items in an agenda view, Org mode visually prepares -the items and sorts them. Each item occupies a single line. The line -starts with a _prefix_ that contains the _category_ (*note Categories::) -of the item and other important information. You can customize in which -column tags will be displayed through `org-agenda-tags-column'. You can -also customize the prefix using the option `org-agenda-prefix-format'. -This prefix is followed by a cleaned-up version of the outline headline -associated with the item. - -* Menu: - -* Categories:: Not all tasks are equal -* Time-of-day specifications:: How the agenda knows the time -* Sorting agenda items:: The order of things -* Filtering/limiting agenda items:: Dynamically narrow the agenda - - -File: org, Node: Categories, Next: Time-of-day specifications, Up: Presentation and sorting - -10.4.1 Categories ------------------ - -The category is a broad label assigned to each agenda item. By -default, the category is simply derived from the file name, but you can -also specify it with a special line in the buffer, like this: - - #+CATEGORY: Thesis - -If you would like to have a special CATEGORY for a single entry or a -(sub)tree, give the entry a `:CATEGORY:' property with the special -category you want to apply as the value. - -The display in the agenda buffer looks best if the category is not -longer than 10 characters. - -You can set up icons for category by customizing the -`org-agenda-category-icon-alist' variable. - - -File: org, Node: Time-of-day specifications, Next: Sorting agenda items, Prev: Categories, Up: Presentation and sorting - -10.4.2 Time-of-day specifications ---------------------------------- - -Org mode checks each agenda item for a time-of-day specification. The -time can be part of the timestamp that triggered inclusion into the -agenda, for example as in `<2005-05-10 Tue 19:00>'. Time ranges can be -specified with two timestamps, like -`<2005-05-10 Tue 20:30>--<2005-05-10 Tue 22:15>'. - - In the headline of the entry itself, a time(range) may also appear as -plain text (like `12:45' or a `8:30-1pm'). If the agenda integrates -the Emacs diary (*note Weekly/daily agenda::), time specifications in -diary entries are recognized as well. - - For agenda display, Org mode extracts the time and displays it in a -standard 24 hour format as part of the prefix. The example times in -the previous paragraphs would end up in the agenda like this: - - 8:30-13:00 Arthur Dent lies in front of the bulldozer - 12:45...... Ford Prefect arrives and takes Arthur to the pub - 19:00...... The Vogon reads his poem - 20:30-22:15 Marvin escorts the Hitchhikers to the bridge - - If the agenda is in single-day mode, or for the display of today, the -timed entries are embedded in a time grid, like - - 8:00...... ------------------ - 8:30-13:00 Arthur Dent lies in front of the bulldozer - 10:00...... ------------------ - 12:00...... ------------------ - 12:45...... Ford Prefect arrives and takes Arthur to the pub - 14:00...... ------------------ - 16:00...... ------------------ - 18:00...... ------------------ - 19:00...... The Vogon reads his poem - 20:00...... ------------------ - 20:30-22:15 Marvin escorts the Hitchhikers to the bridge - - The time grid can be turned on and off with the variable -`org-agenda-use-time-grid', and can be configured with -`org-agenda-time-grid'. - - -File: org, Node: Sorting agenda items, Next: Filtering/limiting agenda items, Prev: Time-of-day specifications, Up: Presentation and sorting - -10.4.3 Sorting agenda items ---------------------------- - -Before being inserted into a view, the items are sorted. How this is -done depends on the type of view. - * For the daily/weekly agenda, the items for each day are sorted. - The default order is to first collect all items containing an - explicit time-of-day specification. These entries will be shown - at the beginning of the list, as a _schedule_ for the day. After - that, items remain grouped in categories, in the sequence given by - `org-agenda-files'. Within each category, items are sorted by - priority (*note Priorities::), which is composed of the base - priority (2000 for priority `A', 1000 for `B', and 0 for `C'), - plus additional increments for overdue scheduled or deadline items. - - * For the TODO list, items remain in the order of categories, but - within each category, sorting takes place according to priority - (*note Priorities::). The priority used for sorting derives from - the priority cookie, with additions depending on how close an item - is to its due or scheduled date. - - * For tags matches, items are not sorted at all, but just appear in - the sequence in which they are found in the agenda files. - - Sorting can be customized using the variable -`org-agenda-sorting-strategy', and may also include criteria based on -the estimated effort of an entry (*note Effort estimates::). - - -File: org, Node: Filtering/limiting agenda items, Prev: Sorting agenda items, Up: Presentation and sorting - -10.4.4 Filtering/limiting agenda items --------------------------------------- - -Agenda built-in or customized commands are statically defined. Agenda -filters and limits provide two ways of dynamically narrowing down the -list of agenda entries: _filters_ and _limits_. Filters only act on the -display of the items, while limits take effect before the list of agenda -entries is built. Filters are more often used interactively, while -limits are mostly useful when defined as local variables within custom -agenda commands. - -Filtering in the agenda -....................... - -`/ (`org-agenda-filter-by-tag')' - Filter the agenda view with respect to a tag and/or effort - estimates. The difference between this and a custom agenda - command is that filtering is very fast, so that you can switch - quickly between different filters without having to recreate the - agenda.(1) - - You will be prompted for a tag selection letter; will mean - any tag at all. Pressing at that prompt will offer use - completion to select a tag (including any tags that do not have a - selection character). The command then hides all entries that do - not contain or inherit this tag. When called with prefix arg, - remove the entries that _do_ have the tag. A second `/' at the - prompt will turn off the filter and unhide any hidden entries. - Pressing `+' or `-' switches between filtering and excluding the - next tag. - - Org also supports automatic, context-aware tag filtering. If the - variable `org-agenda-auto-exclude-function' is set to a - user-defined function, that function can decide which tags should - be excluded from the agenda automatically. Once this is set, the - `/' command then accepts `RET' as a sub-option key and runs the - auto exclusion logic. For example, let's say you use a `Net' tag - to identify tasks which need network access, an `Errand' tag for - errands in town, and a `Call' tag for making phone calls. You - could auto-exclude these tags based on the availability of the - Internet, and outside of business hours, with something like this: - - (defun org-my-auto-exclude-function (tag) - (and (cond - ((string= tag "Net") - (/= 0 (call-process "/sbin/ping" nil nil nil - "-c1" "-q" "-t1" "mail.gnu.org"))) - ((or (string= tag "Errand") (string= tag "Call")) - (let ((hour (nth 2 (decode-time)))) - (or (< hour 8) (> hour 21))))) - (concat "-" tag))) - - (setq org-agenda-auto-exclude-function 'org-my-auto-exclude-function) - -`[ ] { }' - - in search view - add new search words (`[' and `]') or new regular expressions - (`{' and `}') to the query string. The opening bracket/brace - will add a positive search term prefixed by `+', indicating - that this search term must occur/match in the entry. The - closing bracket/brace will add a negative search term which - must not occur/match in the entry for it to be selected. - -`< (`org-agenda-filter-by-category')' - Filter the current agenda view with respect to the category of the - item at point. Pressing `<' another time will remove this filter. - When called with a prefix argument exclude the category of the - item at point from the agenda. - - You can add a filter preset in custom agenda commands through the - option `org-agenda-category-filter-preset'. *Note Setting - options::. - -`^ (`org-agenda-filter-by-top-headline')' - Filter the current agenda view and only display the siblings and - the parent headline of the one at point. - -`= (`org-agenda-filter-by-regexp')' - Filter the agenda view by a regular expression: only show agenda - entries matching the regular expression the user entered. When - called with a prefix argument, it will filter _out_ entries - matching the regexp. With two universal prefix arguments, it will - remove all the regexp filters, which can be accumulated. - - You can add a filter preset in custom agenda commands through the - option `org-agenda-regexp-filter-preset'. *Note Setting options::. - -`_ (`org-agenda-filter-by-effort')' - Filter the agenda view with respect to effort estimates. You - first need to set up allowed efforts globally, for example - (setq org-global-properties - '(("Effort_ALL". "0 0:10 0:30 1:00 2:00 3:00 4:00"))) - You can then filter for an effort by first typing an operator, one - of `<', `>', and `=', and then the one-digit index of an effort - estimate in your array of allowed values, where `0' means the 10th - value. The filter will then restrict to entries with effort - smaller-or-equal, equal, or larger-or-equal than the selected - value. For application of the operator, entries without a defined - effort will be treated according to the value of - `org-sort-agenda-noeffort-is-high'. - - When called with a prefix argument, it will remove entries - matching the condition. With two universal prefix arguments, it - will clear effort filters, which can be accumulated. - - You can add a filter preset in custom agenda commands through the - option `org-agenda-effort-filter-preset'. *Note Setting options::. - -`| (`org-agenda-filter-remove-all')' - Remove all filters in the current agenda view. - -Setting limits for the agenda -............................. - -Here is a list of options that you can set, either globally, or locally -in your custom agenda views (*note Custom agenda views::). - -`org-agenda-max-entries' - Limit the number of entries. - -`org-agenda-max-effort' - Limit the duration of accumulated efforts (as minutes). - -`org-agenda-max-todos' - Limit the number of entries with TODO keywords. - -`org-agenda-max-tags' - Limit the number of tagged entries. - - When set to a positive integer, each option will exclude entries -from other categories: for example, `(setq org-agenda-max-effort 100)' -will limit the agenda to 100 minutes of effort and exclude any entry -that has no effort property. If you want to include entries with no -effort property, use a negative value for `org-agenda-max-effort'. - - One useful setup is to use `org-agenda-max-entries' locally in a -custom command. For example, this custom command will display the next -five entries with a `NEXT' TODO keyword. - - (setq org-agenda-custom-commands - '(("n" todo "NEXT" - ((org-agenda-max-entries 5))))) - - Once you mark one of these five entry as `DONE', rebuilding the -agenda will again the next five entries again, including the first -entry that was excluded so far. - - You can also dynamically set temporary limits, which will be lost -when rebuilding the agenda: - -`~ (`org-agenda-limit-interactively')' - This prompts for the type of limit to apply and its value. - - ---------- Footnotes ---------- - - (1) Custom commands can preset a filter by binding the variable -`org-agenda-tag-filter-preset' as an option. This filter will then be -applied to the view and persist as a basic filter through refreshes and -more secondary filtering. The filter is a global property of the -entire agenda view--in a block agenda, you should only set this in the -global options section, not in the section of an individual block. - - -File: org, Node: Agenda commands, Next: Custom agenda views, Prev: Presentation and sorting, Up: Agenda views - -10.5 Commands in the agenda buffer -================================== - -Entries in the agenda buffer are linked back to the Org file or diary -file where they originate. You are not allowed to edit the agenda -buffer itself, but commands are provided to show and jump to the -original entry location, and to edit the Org files "remotely" from the -agenda buffer. In this way, all information is stored only once, -removing the risk that your agenda and note files may diverge. - - Some commands can be executed with mouse clicks on agenda lines. For -the other commands, the cursor needs to be in the desired line. - -Motion -...... - -`n (`org-agenda-next-line')' - Next line (same as and `C-n'). - -`p (`org-agenda-previous-line')' - Previous line (same as and `C-p'). - -`N (`org-agenda-next-item')' - Next item: same as next line, but only consider items. - -`P (`org-agenda-previous-item')' - Previous item: same as previous line, but only consider items. - -View/Go to Org file -................... - -` or mouse-3 (`org-agenda-show-and-scroll-up')' - Display the original location of the item in another window. With - prefix arg, make sure that drawers stay folded. - -`L (`org-agenda-recenter')' - Display original location and recenter that window. - -` or mouse-2 (`org-agenda-goto')' - Go to the original location of the item in another window. - -` (`org-agenda-switch-to')' - Go to the original location of the item and delete other windows. - -`F (`org-agenda-follow-mode')' - Toggle Follow mode. In Follow mode, as you move the cursor through - the agenda buffer, the other window always shows the corresponding - location in the Org file. The initial setting for this mode in new - agenda buffers can be set with the variable - `org-agenda-start-with-follow-mode'. - -`C-c C-x b (`org-agenda-tree-to-indirect-buffer')' - Display the entire subtree of the current item in an indirect - buffer. With a numeric prefix argument N, go up to level N and - then take that tree. If N is negative, go up that many levels. - With a `C-u' prefix, do not remove the previously used indirect - buffer. - -`C-c C-o (`org-agenda-open-link')' - Follow a link in the entry. This will offer a selection of any - links in the text belonging to the referenced Org node. If there - is only one link, it will be followed without a selection prompt. - -Change display -.............. - -`A' - Interactively select another agenda view and append it to the - current view. - -`o' - Delete other windows. - -`v d or short d (`org-agenda-day-view')' -`v w or short w (`org-agenda-week-view')' -`v t (`org-agenda-fortnight-view')' -`v m (`org-agenda-month-view')' -`v y (`org-agenda-year-view')' -`v SPC (`org-agenda-reset-view')' - Switch to day/week/month/year view. When switching to day or week - view, this setting becomes the default for subsequent agenda - refreshes. Since month and year views are slow to create, they do - not become the default. A numeric prefix argument may be used to - jump directly to a specific day of the year, ISO week, month, or - year, respectively. For example, `32 d' jumps to February 1st, `9 - w' to ISO week number 9. When setting day, week, or month view, a - year may be encoded in the prefix argument as well. For example, - `200712 w' will jump to week 12 in 2007. If such a year - specification has only one or two digits, it will be mapped to the - interval 1938-2037. `v ' will reset to what is set in - `org-agenda-span'. - -`f (`org-agenda-later')' - Go forward in time to display the following - `org-agenda-current-span' days. For example, if the display - covers a week, switch to the following week. With prefix arg, go - forward that many times `org-agenda-current-span' days. - -`b (`org-agenda-earlier')' - Go backward in time to display earlier dates. - -`. (`org-agenda-goto-today')' - Go to today. - -`j (`org-agenda-goto-date')' - Prompt for a date and go there. - -`J (`org-agenda-clock-goto')' - Go to the currently clocked-in task in the agenda buffer. - -`D (`org-agenda-toggle-diary')' - Toggle the inclusion of diary entries. See *note Weekly/daily - agenda::. - -`v l or short l (`org-agenda-log-mode')' - Toggle Logbook mode. In Logbook mode, entries that were marked - DONE while logging was on (variable `org-log-done') are shown in - the agenda, as are entries that have been clocked on that day. - You can configure the entry types that should be included in log - mode using the variable `org-agenda-log-mode-items'. When called - with a `C-u' prefix, show all possible logbook entries, including - state changes. When called with two prefix arguments `C-u C-u', - show only logging information, nothing else. `v L' is equivalent - to `C-u v l'. - -`v [ or short [ (`org-agenda-manipulate-query-add')' - Include inactive timestamps into the current view. Only for - weekly/daily agenda. - -`v a (`org-agenda-archives-mode')' -`v A (`org-agenda-archives-mode 'files')' - Toggle Archives mode. In Archives mode, trees that are marked - `ARCHIVED' are also scanned when producing the agenda. When you - use the capital `A', even all archive files are included. To exit - archives mode, press `v a' again. - -`v R or short R (`org-agenda-clockreport-mode')' - Toggle Clockreport mode. In Clockreport mode, the daily/weekly - agenda will always show a table with the clocked times for the - time span and file scope covered by the current agenda view. The - initial setting for this mode in new agenda buffers can be set - with the variable `org-agenda-start-with-clockreport-mode'. By - using a prefix argument when toggling this mode (i.e., `C-u R'), - the clock table will not show contributions from entries that are - hidden by agenda filtering(1). See also the variable - `org-clock-report-include-clocking-task'. - -`v c' - Show overlapping clock entries, clocking gaps, and other clocking - problems in the current agenda range. You can then visit clocking - lines and fix them manually. See the variable - `org-agenda-clock-consistency-checks' for information on how to - customize the definition of what constituted a clocking problem. - To return to normal agenda display, press `l' to exit Logbook mode. - -`v E or short E (`org-agenda-entry-text-mode')' - Toggle entry text mode. In entry text mode, a number of lines - from the Org outline node referenced by an agenda line will be - displayed below the line. The maximum number of lines is given by - the variable `org-agenda-entry-text-maxlines'. Calling this - command with a numeric prefix argument will temporarily modify - that number to the prefix value. - -`G (`org-agenda-toggle-time-grid')' - Toggle the time grid on and off. See also the variables - `org-agenda-use-time-grid' and `org-agenda-time-grid'. - -`r (`org-agenda-redo')' - Recreate the agenda buffer, for example to reflect the changes - after modification of the timestamps of items with `S-' and - `S-'. When the buffer is the global TODO list, a prefix - argument is interpreted to create a selective list for a specific - TODO keyword. - -`g (`org-agenda-redo')' - Same as `r'. - -`C-x C-s or short s (`org-save-all-org-buffers')' - Save all Org buffers in the current Emacs session, and also the - locations of IDs. - -`C-c C-x C-c (`org-agenda-columns')' - Invoke column view (*note Column view::) in the agenda buffer. - The column view format is taken from the entry at point, or (if - there is no entry at point), from the first entry in the agenda - view. So whatever the format for that entry would be in the - original buffer (taken from a property, from a `#+COLUMNS' line, - or from the default variable `org-columns-default-format'), will - be used in the agenda. - -`C-c C-x > (`org-agenda-remove-restriction-lock')' - Remove the restriction lock on the agenda, if it is currently - restricted to a file or subtree (*note Agenda files::). - -Secondary filtering and query editing -..................................... - - For a detailed description of these commands, *note - Filtering/limiting agenda items::. - -`/ (`org-agenda-filter-by-tag')' - Filter the agenda view with respect to a tag and/or effort - estimates. - -`< (`org-agenda-filter-by-category')' - Filter the current agenda view with respect to the category of the - item at point. - -`^ (`org-agenda-filter-by-top-headline')' - Filter the current agenda view and only display the siblings and - the parent headline of the one at point. - -`= (`org-agenda-filter-by-regexp')' - Filter the agenda view by a regular expression. - -`_ (`org-agenda-filter-by-effort')' - Filter the agenda view with respect to effort estimates. - -`| (`org-agenda-filter-remove-all')' - Remove all filters in the current agenda view. - -Remote editing -.............. - -`0--9' - Digit argument. - -`C-_ (`org-agenda-undo')' - Undo a change due to a remote editing command. The change is - undone both in the agenda buffer and in the remote buffer. - -`t (`org-agenda-todo')' - Change the TODO state of the item, both in the agenda and in the - original org file. - -`C-S- (`org-agenda-todo-nextset')' - -`C-S- (`org-agenda-todo-previousset')' - Switch to the next/previous set of TODO keywords. - -`C-k (`org-agenda-kill')' - Delete the current agenda item along with the entire subtree - belonging to it in the original Org file. If the text to be - deleted remotely is longer than one line, the kill needs to be - confirmed by the user. See variable `org-agenda-confirm-kill'. - -`C-c C-w (`org-agenda-refile')' - Refile the entry at point. - -`C-c C-x C-a or short a (`org-agenda-archive-default-with-confirmation')' - Archive the subtree corresponding to the entry at point using the - default archiving command set in `org-archive-default-command'. - When using the `a' key, confirmation will be required. - -`C-c C-x a (`org-agenda-toggle-archive-tag')' - Toggle the ARCHIVE tag for the current headline. - -`C-c C-x A (`org-agenda-archive-to-archive-sibling')' - Move the subtree corresponding to the current entry to its _archive - sibling_. - -`C-c C-x C-s or short $ (`org-agenda-archive')' - Archive the subtree corresponding to the current headline. This - means the entry will be moved to the configured archive location, - most likely a different file. - -`T (`org-agenda-show-tags')' - Show all tags associated with the current item. This is useful if - you have turned off `org-agenda-show-inherited-tags', but still - want to see all tags of a headline occasionally. - -`: (`org-agenda-set-tags')' - Set tags for the current headline. If there is an active region - in the agenda, change a tag for all headings in the region. - -`,' - Set the priority for the current item (`org-agenda-priority'). - Org mode prompts for the priority character. If you reply with - , the priority cookie is removed from the entry. - -`P (`org-agenda-show-priority')' - Display weighted priority of current item. - -`+ or S- (`org-agenda-priority-up')' - Increase the priority of the current item. The priority is - changed in the original buffer, but the agenda is not resorted. - Use the `r' key for this. - -`- or S- (`org-agenda-priority-down')' - Decrease the priority of the current item. - -`z or C-c C-z (`org-agenda-add-note')' - Add a note to the entry. This note will be recorded, and then - filed to the same location where state change notes are put. - Depending on `org-log-into-drawer', this may be inside a drawer. - -`C-c C-a (`org-attach')' - Dispatcher for all command related to attachments. - -`C-c C-s (`org-agenda-schedule')' - Schedule this item. With prefix arg remove the scheduling - timestamp - -`C-c C-d (`org-agenda-deadline')' - Set a deadline for this item. With prefix arg remove the deadline. - -`S- (`org-agenda-do-date-later')' - Change the timestamp associated with the current line by one day - into the future. If the date is in the past, the first call to - this command will move it to today. - With a numeric prefix argument, change it by that many days. For - example, `3 6 5 S-' will change it by a year. With a `C-u' - prefix, change the time by one hour. If you immediately repeat - the command, it will continue to change hours even without the - prefix arg. With a double `C-u C-u' prefix, do the same for - changing minutes. - The stamp is changed in the original Org file, but the change is - not directly reflected in the agenda buffer. Use `r' or `g' to - update the buffer. - -`S- (`org-agenda-do-date-earlier')' - Change the timestamp associated with the current line by one day - into the past. - -`> (`org-agenda-date-prompt')' - Change the timestamp associated with the current line. The key - `>' has been chosen, because it is the same as `S-.' on my - keyboard. - -`I (`org-agenda-clock-in')' - Start the clock on the current item. If a clock is running - already, it is stopped first. - -`O (`org-agenda-clock-out')' - Stop the previously started clock. - -`X (`org-agenda-clock-cancel')' - Cancel the currently running clock. - -`J (`org-agenda-clock-goto')' - Jump to the running clock in another window. - -`k (`org-agenda-capture')' - Like `org-capture', but use the date at point as the default date - for the capture template. See `org-capture-use-agenda-date' to - make this the default behavior of `org-capture'. - -Dragging agenda lines forward/backward -...................................... - -`M- (`org-agenda-drag-line-backward')' - Drag the line at point backward one line(2). With a numeric - prefix argument, drag backward by that many lines. - -`M- (`org-agenda-drag-line-forward')' - Drag the line at point forward one line. With a numeric prefix - argument, drag forward by that many lines. - -Bulk remote editing selected entries -.................................... - -`m (`org-agenda-bulk-mark')' - Mark the entry at point for bulk action. With numeric prefix - argument, mark that many successive entries. - -`* (`org-agenda-bulk-mark-all')' - Mark all visible agenda entries for bulk action. - -`u (`org-agenda-bulk-unmark')' - Unmark entry at point for bulk action. - -`U (`org-agenda-bulk-remove-all-marks')' - Unmark all marked entries for bulk action. - -`M-m (`org-agenda-bulk-toggle')' - Toggle mark of the entry at point for bulk action. - -`M-* (`org-agenda-bulk-toggle-all')' - Toggle marks of all visible entries for bulk action. - -`% (`org-agenda-bulk-mark-regexp')' - Mark entries matching a regular expression for bulk action. - -`B (`org-agenda-bulk-action')' - Bulk action: act on all marked entries in the agenda. This will - prompt for another key to select the action to be applied. The - prefix arg to `B' will be passed through to the `s' and `d' - commands, to bulk-remove these special timestamps. By default, - marks are removed after the bulk. If you want them to persist, - set `org-agenda-persistent-marks' to `t' or hit `p' at the prompt. - - `*' - Toggle persistent marks. - - `$' - Archive all selected entries. - - `A' - Archive entries by moving them to their respective archive - siblings. - - `t' - Change TODO state. This prompts for a single TODO keyword - and changes the state of all selected entries, bypassing - blocking and suppressing logging notes (but not timestamps). - - `+' - Add a tag to all selected entries. - - `-' - Remove a tag from all selected entries. - - `s' - Schedule all items to a new date. To shift existing schedule - dates by a fixed number of days, use something starting with - double plus at the prompt, for example `++8d' or `++2w'. - - `d' - Set deadline to a specific date. - - `r' - Prompt for a single refile target and move all entries. The - entries will no longer be in the agenda; refresh (`g') to - bring them back. - - `S' - Reschedule randomly into the coming N days. N will be - prompted for. With prefix arg (`C-u B S'), scatter only - across weekdays. - - `f' - Apply a function(3) to marked entries. For example, the - function below sets the CATEGORY property of the entries to - web. - - (defun set-category () - (interactive "P") - (let* ((marker (or (org-get-at-bol 'org-hd-marker) - (org-agenda-error))) - (buffer (marker-buffer marker))) - (with-current-buffer buffer - (save-excursion - (save-restriction - (widen) - (goto-char marker) - (org-back-to-heading t) - (org-set-property "CATEGORY" "web")))))) - -Calendar commands -................. - -`c (`org-agenda-goto-calendar')' - Open the Emacs calendar and move to the date at the agenda cursor. - -`c (`org-calendar-goto-agenda')' - When in the calendar, compute and show the Org mode agenda for the - date at the cursor. - -`i (`org-agenda-diary-entry')' - Insert a new entry into the diary, using the date at the cursor - and (for block entries) the date at the mark. This will add to - the Emacs diary file(4), in a way similar to the `i' command in - the calendar. The diary file will pop up in another window, where - you can add the entry. - - If you configure `org-agenda-diary-file' to point to an Org mode - file, Org will create entries (in Org mode syntax) in that file - instead. Most entries will be stored in a date-based outline tree - that will later make it easy to archive appointments from previous - months/years. The tree will be built under an entry with a - `DATE_TREE' property, or else with years as top-level entries. - Emacs will prompt you for the entry text--if you specify it, the - entry will be created in `org-agenda-diary-file' without further - interaction. If you directly press at the prompt without - typing text, the target file will be shown in another window for - you to finish the entry there. See also the `k r' command. - -`M (`org-agenda-phases-of-moon')' - Show the phases of the moon for the three months around current - date. - -`S (`org-agenda-sunrise-sunset')' - Show sunrise and sunset times. The geographical location must be - set with calendar variables, see the documentation for the Emacs - calendar. - -`C (`org-agenda-convert-date')' - Convert the date at cursor into many other cultural and historic - calendars. - -`H (`org-agenda-holidays')' - Show holidays for three months around the cursor date. - -`M-x org-icalendar-combine-agenda-files RET' - Export a single iCalendar file containing entries from all agenda - files. This is a globally available command, and also available - in the agenda menu. - -Exporting to a file -................... - -`C-x C-w (`org-agenda-write')' - Write the agenda view to a file. Depending on the extension of - the selected file name, the view will be exported as HTML (`.html' - or `.htm'), Postscript (`.ps'), PDF (`.pdf'), Org (`.org') and - plain text (any other extension). When exporting to Org, only the - body of original headlines are exported, not subtrees or inherited - tags. When called with a `C-u' prefix argument, immediately open - the newly created file. Use the variable - `org-agenda-exporter-settings' to set options for `ps-print' and - for `htmlize' to be used during export. - -Quit and Exit -............. - -`q (`org-agenda-quit')' - Quit agenda, remove the agenda buffer. - -`x (`org-agenda-exit')' - Exit agenda, remove the agenda buffer and all buffers loaded by - Emacs for the compilation of the agenda. Buffers created by the - user to visit Org files will not be removed. - - ---------- Footnotes ---------- - - (1) Only tags filtering will be respected here, effort filtering is -ignored. - - (2) Moving agenda lines does not persist after an agenda refresh and -does not modify the contributing `.org' files - - (3) You can also create persistent custom functions through -`org-agenda-bulk-custom-functions'. - - (4) This file is parsed for the agenda when -`org-agenda-include-diary' is set. - - -File: org, Node: Custom agenda views, Next: Exporting agenda views, Prev: Agenda commands, Up: Agenda views - -10.6 Custom agenda views -======================== - -Custom agenda commands serve two purposes: to store and quickly access -frequently used TODO and tags searches, and to create special composite -agenda buffers. Custom agenda commands will be accessible through the -dispatcher (*note Agenda dispatcher::), just like the default commands. - -* Menu: - -* Storing searches:: Type once, use often -* Block agenda:: All the stuff you need in a single buffer -* Setting options:: Changing the rules - - -File: org, Node: Storing searches, Next: Block agenda, Up: Custom agenda views - -10.6.1 Storing searches ------------------------ - -The first application of custom searches is the definition of keyboard -shortcuts for frequently used searches, either creating an agenda -buffer, or a sparse tree (the latter covering of course only the current -buffer). - - Custom commands are configured in the variable -`org-agenda-custom-commands'. You can customize this variable, for -example by pressing `C-c a C'. You can also directly set it with Emacs -Lisp in the Emacs init file. The following example contains all valid -agenda views: - - (setq org-agenda-custom-commands - '(("x" agenda) - ("y" agenda*) - ("w" todo "WAITING") - ("W" todo-tree "WAITING") - ("u" tags "+boss-urgent") - ("v" tags-todo "+boss-urgent") - ("U" tags-tree "+boss-urgent") - ("f" occur-tree "\\") - ("h" . "HOME+Name tags searches") ; description for "h" prefix - ("hl" tags "+home+Lisa") - ("hp" tags "+home+Peter") - ("hk" tags "+home+Kim"))) - -The initial string in each entry defines the keys you have to press -after the dispatcher command `C-c a' in order to access the command. -Usually this will be just a single character, but if you have many -similar commands, you can also define two-letter combinations where the -first character is the same in several combinations and serves as a -prefix key(1). The second parameter is the search type, followed by -the string or regular expression to be used for the matching. The -example above will therefore define: - -`C-c a x' - as a global search for agenda entries planned(2) this week/day. - -`C-c a y' - as a global search for agenda entries planned this week/day, but - only those with an hour specification like `[h]h:mm'--think of - them as appointments. - -`C-c a w' - as a global search for TODO entries with `WAITING' as the TODO - keyword - -`C-c a W' - as the same search, but only in the current buffer and displaying - the results as a sparse tree - -`C-c a u' - as a global tags search for headlines marked `:boss:' but not - `:urgent:' - -`C-c a v' - as the same search as `C-c a u', but limiting the search to - headlines that are also TODO items - -`C-c a U' - as the same search as `C-c a u', but only in the current buffer and - displaying the result as a sparse tree - -`C-c a f' - to create a sparse tree (again: current buffer only) with all - entries containing the word `FIXME' - -`C-c a h' - as a prefix command for a HOME tags search where you have to press - an additional key (`l', `p' or `k') to select a name (Lisa, Peter, - or Kim) as additional tag to match. - - Note that the `*-tree' agenda views need to be called from an Org -buffer as they operate on the current buffer only. - - ---------- Footnotes ---------- - - (1) You can provide a description for a prefix key by inserting a -cons cell with the prefix and the description. - - (2) _Planned_ means here that these entries have some planning -information attached to them, like a time-stamp, a scheduled or a -deadline string. See `org-agenda-entry-types' on how to set what -planning information will be taken into account. - - -File: org, Node: Block agenda, Next: Setting options, Prev: Storing searches, Up: Custom agenda views - -10.6.2 Block agenda -------------------- - -Another possibility is the construction of agenda views that comprise -the results of _several_ commands, each of which creates a block in the -agenda buffer. The available commands include `agenda' for the daily -or weekly agenda (as created with `C-c a a'), `alltodo' for the global -TODO list (as constructed with `C-c a t'), and the matching commands -discussed above: `todo', `tags', and `tags-todo'. Here are two -examples: - - (setq org-agenda-custom-commands - '(("h" "Agenda and Home-related tasks" - ((agenda "") - (tags-todo "home") - (tags "garden"))) - ("o" "Agenda and Office-related tasks" - ((agenda "") - (tags-todo "work") - (tags "office"))))) - -This will define `C-c a h' to create a multi-block view for stuff you -need to attend to at home. The resulting agenda buffer will contain -your agenda for the current week, all TODO items that carry the tag -`home', and also all lines tagged with `garden'. Finally the command -`C-c a o' provides a similar view for office tasks. - - -File: org, Node: Setting options, Prev: Block agenda, Up: Custom agenda views - -10.6.3 Setting options for custom commands ------------------------------------------- - -Org mode contains a number of variables regulating agenda construction -and display. The global variables define the behavior for all agenda -commands, including the custom commands. However, if you want to change -some settings just for a single custom view, you can do so. Setting -options requires inserting a list of variable names and values at the -right spot in `org-agenda-custom-commands'. For example: - - (setq org-agenda-custom-commands - '(("w" todo "WAITING" - ((org-agenda-sorting-strategy '(priority-down)) - (org-agenda-prefix-format " Mixed: "))) - ("U" tags-tree "+boss-urgent" - ((org-show-context-detail 'minimal))) - ("N" search "" - ((org-agenda-files '("~org/notes.org")) - (org-agenda-text-search-extra-files nil))))) - -Now the `C-c a w' command will sort the collected entries only by -priority, and the prefix format is modified to just say ` Mixed: ' -instead of giving the category of the entry. The sparse tags tree of -`C-c a U' will now turn out ultra-compact, because neither the headline -hierarchy above the match, nor the headline following the match will be -shown. The command `C-c a N' will do a text search limited to only a -single file. - - For command sets creating a block agenda, -`org-agenda-custom-commands' has two separate spots for setting -options. You can add options that should be valid for just a single -command in the set, and options that should be valid for all commands in -the set. The former are just added to the command entry; the latter -must come after the list of command entries. Going back to the block -agenda example (*note Block agenda::), let's change the sorting strategy -for the `C-c a h' commands to `priority-down', but let's sort the -results for GARDEN tags query in the opposite order, `priority-up'. -This would look like this: - - (setq org-agenda-custom-commands - '(("h" "Agenda and Home-related tasks" - ((agenda) - (tags-todo "home") - (tags "garden" - ((org-agenda-sorting-strategy '(priority-up))))) - ((org-agenda-sorting-strategy '(priority-down)))) - ("o" "Agenda and Office-related tasks" - ((agenda) - (tags-todo "work") - (tags "office"))))) - - As you see, the values and parentheses setting is a little complex. -When in doubt, use the customize interface to set this variable--it -fully supports its structure. Just one caveat: when setting options in -this interface, the _values_ are just Lisp expressions. So if the -value is a string, you need to add the double-quotes around the value -yourself. - - To control whether an agenda command should be accessible from a -specific context, you can customize -`org-agenda-custom-commands-contexts'. Let's say for example that you -have an agenda command `"o"' displaying a view that you only need when -reading emails. Then you would configure this option like this: - - (setq org-agenda-custom-commands-contexts - '(("o" (in-mode . "message-mode")))) - - You can also tell that the command key `"o"' should refer to another -command key `"r"'. In that case, add this command key like this: - - (setq org-agenda-custom-commands-contexts - '(("o" "r" (in-mode . "message-mode")))) - - See the docstring of the variable for more information. - - -File: org, Node: Exporting agenda views, Next: Agenda column view, Prev: Custom agenda views, Up: Agenda views - -10.7 Exporting agenda views -=========================== - -If you are away from your computer, it can be very useful to have a -printed version of some agenda views to carry around. Org mode can -export custom agenda views as plain text, HTML(1), Postscript, PDF(2), -and iCalendar files. If you want to do this only occasionally, use the -command - -`C-x C-w (`org-agenda-write')' - Write the agenda view to a file. Depending on the extension of - the selected file name, the view will be exported as HTML - (extension `.html' or `.htm'), Postscript (extension `.ps'), - iCalendar (extension `.ics'), or plain text (any other extension). - Use the variable `org-agenda-exporter-settings' to set options for - `ps-print' and for `htmlize' to be used during export, for example - - (setq org-agenda-exporter-settings - '((ps-number-of-columns 2) - (ps-landscape-mode t) - (org-agenda-add-entry-text-maxlines 5) - (htmlize-output-type 'css))) - - If you need to export certain agenda views frequently, you can -associate any custom agenda command with a list of output file names -(3). Here is an example that first defines custom commands for the -agenda and the global TODO list, together with a number of files to -which to export them. Then we define two block agenda commands and -specify file names for them as well. File names can be relative to the -current working directory, or absolute. - - (setq org-agenda-custom-commands - '(("X" agenda "" nil ("agenda.html" "agenda.ps")) - ("Y" alltodo "" nil ("todo.html" "todo.txt" "todo.ps")) - ("h" "Agenda and Home-related tasks" - ((agenda "") - (tags-todo "home") - (tags "garden")) - nil - ("~/views/home.html")) - ("o" "Agenda and Office-related tasks" - ((agenda) - (tags-todo "work") - (tags "office")) - nil - ("~/views/office.ps" "~/calendars/office.ics")))) - - The extension of the file name determines the type of export. If it -is `.html', Org mode will try to use the `htmlize.el' package to -convert the buffer to HTML and save it to this file name. If the -extension is `.ps', `ps-print-buffer-with-faces' is used to produce -Postscript output. If the extension is `.ics', iCalendar export is run -export over all files that were used to construct the agenda, and limit -the export to entries listed in the agenda. Any other extension -produces a plain ASCII file. - - The export files are _not_ created when you use one of those -commands interactively because this might use too much overhead. -Instead, there is a special command to produce _all_ specified files in -one step: - -`C-c a e (`org-store-agenda-views')' - Export all agenda views that have export file names associated with - them. - - You can use the options section of the custom agenda commands to also -set options for the export commands. For example: - - (setq org-agenda-custom-commands - '(("X" agenda "" - ((ps-number-of-columns 2) - (ps-landscape-mode t) - (org-agenda-prefix-format " [ ] ") - (org-agenda-with-colors nil) - (org-agenda-remove-tags t)) - ("theagenda.ps")))) - -This command sets two options for the Postscript exporter, to make it -print in two columns in landscape format--the resulting page can be cut -in two and then used in a paper agenda. The remaining settings modify -the agenda prefix to omit category and scheduling information, and -instead include a checkbox to check off items. We also remove the tags -to make the lines compact, and we don't want to use colors for the -black-and-white printer. Settings specified in -`org-agenda-exporter-settings' will also apply, but the settings in -`org-agenda-custom-commands' take precedence. - -From the command line you may also use - emacs -eval (org-batch-store-agenda-views) -kill - or, if you need to modify some parameters(4) - emacs -eval '(org-batch-store-agenda-views \ - org-agenda-span (quote month) \ - org-agenda-start-day "2007-11-01" \ - org-agenda-include-diary nil \ - org-agenda-files (quote ("~/org/project.org")))' \ - -kill - which will create the agenda views restricted to the file -`~/org/project.org', without diary entries and with a 30-day extent. - - You can also extract agenda information in a way that allows further -processing by other programs. See *note Extracting agenda -information::, for more information. - - ---------- Footnotes ---------- - - (1) You need to install `htmlize.el' from Hrvoje Niksic's -repository. (https://github.com/hniksic/emacs-htmlize) - - (2) To create PDF output, the ghostscript `ps2pdf' utility must be -installed on the system. Selecting a PDF file will also create the -postscript file. - - (3) If you want to store standard views like the weekly agenda or -the global TODO list as well, you need to define custom commands for -them in order to be able to specify file names. - - (4) Quoting depends on the system you use, please check the FAQ for -examples. - - -File: org, Node: Agenda column view, Prev: Exporting agenda views, Up: Agenda views - -10.8 Using column view in the agenda -==================================== - -Column view (*note Column view::) is normally used to view and edit -properties embedded in the hierarchical structure of an Org file. It -can be quite useful to use column view also from the agenda, where -entries are collected by certain criteria. - -`C-c C-x C-c (`org-agenda-columns')' - Turn on column view in the agenda. - - To understand how to use this properly, it is important to realize -that the entries in the agenda are no longer in their proper outline -environment. This causes the following issues: - - 1. Org needs to make a decision which `COLUMNS' format to use. Since - the entries in the agenda are collected from different files, and - different files may have different `COLUMNS' formats, this is a - non-trivial problem. Org first checks if the variable - `org-agenda-overriding-columns-format' is currently set, and if - so, takes the format from there. Otherwise it takes the format - associated with the first item in the agenda, or, if that item - does not have a specific format--defined in a property, or in its - file--it uses `org-columns-default-format'. - - 2. If any of the columns has a summary type defined (*note Column - attributes::), turning on column view in the agenda will visit all - relevant agenda files and make sure that the computations of this - property are up to date. This is also true for the special - `CLOCKSUM' property. Org will then sum the values displayed in - the agenda. In the daily/weekly agenda, the sums will cover a - single day; in all other views they cover the entire block. It is - vital to realize that the agenda may show the same entry - _twice_--for example as scheduled and as a deadline--and it may - show two entries from the same hierarchy--for example a _parent_ - and its _child_. In these cases, the summation in the agenda will - lead to incorrect results because some values will count double. - - 3. When the column view in the agenda shows the `CLOCKSUM', that is - always the entire clocked time for this item. So even in the - daily/weekly agenda, the clocksum listed in column view may - originate from times outside the current view. This has the - advantage that you can compare these values with a column listing - the planned total effort for a task--one of the major applications - for column view in the agenda. If you want information about - clocked time in the displayed period use clock table mode (press - `R' in the agenda). - - 4. When the column view in the agenda shows the `CLOCKSUM_T', that is - always today's clocked time for this item. So even in the weekly - agenda, the clocksum listed in column view only originates from - today. This lets you compare the time you spent on a task for - today, with the time already spent --via `CLOCKSUM'--and with the - planned total effort for it. - - -File: org, Node: Markup, Next: Exporting, Prev: Agenda views, Up: Top - -11 Markup for rich export -************************* - -When exporting Org mode documents, the exporter tries to reflect the -structure of the document as accurately as possible in the back-end. -Since export targets like HTML and LaTeX allow much richer formatting, -Org mode has rules on how to prepare text for rich export. This -section summarizes the markup rules used in an Org mode buffer. - -* Menu: - -* Paragraphs:: The basic unit of text -* Emphasis and monospace:: Bold, italic, etc. -* Horizontal rules:: Make a line -* Images and tables:: Images, tables and caption mechanism -* Literal examples:: Source code examples with special formatting -* Special symbols:: Greek letters and other symbols -* Subscripts and superscripts:: Simple syntax for raising/lowering text -* Embedded LaTeX:: LaTeX can be freely used inside Org documents - - -File: org, Node: Paragraphs, Next: Emphasis and monospace, Up: Markup - -11.1 Paragraphs, line breaks, and quoting -========================================= - -Paragraphs are separated by at least one empty line. If you need to -enforce a line break within a paragraph, use `\\' at the end of a line. - - To preserve the line breaks, indentation and blank lines in a -region, but otherwise use normal formatting, you can use this -construct, which can also be used to format poetry. - - #+BEGIN_VERSE - Great clouds overhead - Tiny black birds rise and fall - Snow covers Emacs - - -- AlexSchroeder - #+END_VERSE - - When quoting a passage from another document, it is customary to -format this as a paragraph that is indented on both the left and the -right margin. You can include quotations in Org mode documents like -this: - - #+BEGIN_QUOTE - Everything should be made as simple as possible, - but not any simpler -- Albert Einstein - #+END_QUOTE - - If you would like to center some text, do it like this: - #+BEGIN_CENTER - Everything should be made as simple as possible, \\ - but not any simpler - #+END_CENTER - - -File: org, Node: Emphasis and monospace, Next: Horizontal rules, Prev: Paragraphs, Up: Markup - -11.2 Emphasis and monospace -=========================== - -You can make words *bold*, /italic/, _underlined_, `=verbatim=' and -`~code~', and, if you must, `+strike-through+'. Text in the code and -verbatim string is not processed for Org mode specific syntax, it is -exported verbatim. - - To turn off fontification for marked up text, you can set -`org-fontify-emphasized-text' to `nil'. To narrow down the list of -available markup syntax, you can customize `org-emphasis-alist'. To -fine tune what characters are allowed before and after the markup -characters, you can tweak `org-emphasis-regexp-components'. Beware -that changing one of the above variables will no take effect until you -reload Org, for which you may need to restart Emacs. - - -File: org, Node: Horizontal rules, Next: Images and tables, Prev: Emphasis and monospace, Up: Markup - -11.3 Horizontal rules -===================== - -A line consisting of only dashes, and at least 5 of them, will be -exported as a horizontal line. - - -File: org, Node: Images and tables, Next: Literal examples, Prev: Horizontal rules, Up: Markup - -11.4 Images and Tables -====================== - -Both the native Org mode tables (*note Tables::) and tables formatted -with the `table.el' package will be exported properly. For Org mode -tables, the lines before the first horizontal separator line will -become table header lines. You can use the following lines somewhere -before the table to assign a caption and a label for cross references, -and in the text you can refer to the object with `[[tab:basic-data]]' -(*note Internal links::): - - #+CAPTION: This is the caption for the next table (or link) - #+NAME: tab:basic-data - | ... | ...| - |-----|----| - - Optionally, the caption can take the form: - #+CAPTION[Caption for list of tables]: Caption for table. - - Some back-ends allow you to directly include images into the exported -document. Org does this, if a link to an image files does not have a -description part, for example `[[./img/a.jpg]]'. If you wish to define -a caption for the image and maybe a label for internal cross -references, make sure that the link is on a line by itself and precede -it with `#+CAPTION' and `#+NAME' as follows: - - #+CAPTION: This is the caption for the next figure link (or table) - #+NAME: fig:SED-HR4049 - [[./img/a.jpg]] - -Such images can be displayed within the buffer. *Note the discussion -of image links: Handling links. - - Even though images and tables are prominent examples of captioned -structures, the same caption mechanism can apply to many others (e.g., -LaTeX equations, source code blocks). Depending on the export -back-end, those may or may not be handled. - - -File: org, Node: Literal examples, Next: Special symbols, Prev: Images and tables, Up: Markup - -11.5 Literal examples -===================== - -You can include literal examples that should not be subjected to -markup. Such examples will be typeset in monospace, so this is well -suited for source code and similar examples. - - #+BEGIN_EXAMPLE - Some example from a text file. - #+END_EXAMPLE - - Note that such blocks may be indented in order to align nicely with -indented text and in particular with plain list structure (*note Plain -lists::). For simplicity when using small examples, you can also start -the example lines with a colon followed by a space. There may also be -additional whitespace before the colon: - - Here is an example - : Some example from a text file. - - If the example is source code from a programming language, or any -other text that can be marked up by font-lock in Emacs, you can ask for -the example to look like the fontified Emacs buffer(1). This is done -with the `src' block, where you also need to specify the name of the -major mode that should be used to fontify the example(2), see *note -Easy templates:: for shortcuts to easily insert code blocks. - - #+BEGIN_SRC emacs-lisp - (defun org-xor (a b) - "Exclusive or." - (if a (not b) b)) - #+END_SRC - - Both in `example' and in `src' snippets, you can add a `-n' switch -to the end of the `BEGIN' line, to get the lines of the example -numbered. The `-n' takes an optional numeric argument specifying the -starting line number of the block. If you use a `+n' switch, the -numbering from the previous numbered snippet will be continued in the -current one. The `+n' can also take a numeric argument. The value of -the argument will be added to the last line of the previous block to -determine the starting line number. - - #+BEGIN_SRC emacs-lisp -n 20 - ;; this will export with line number 20 - (message "This is line 21") - #+END_SRC - #+BEGIN_SRC emacs-lisp +n 10 - ;; This will be listed as line 31 - (message "This is line 32") - #+END_SRC - - In literal examples, Org will interpret strings like `(ref:name)' as -labels, and use them as targets for special hyperlinks like `[[(name)]]' -(i.e., the reference name enclosed in single parenthesis). In HTML, -hovering the mouse over such a link will remote-highlight the -corresponding code line, which is kind of cool. - - You can also add a `-r' switch which removes the labels from the -source code(3). With the `-n' switch, links to these references will -be labeled by the line numbers from the code listing, otherwise links -will use the labels with no parentheses. Here is an example: - - #+BEGIN_SRC emacs-lisp -n -r - (save-excursion (ref:sc) - (goto-char (point-min))) (ref:jump) - #+END_SRC - In line [[(sc)]] we remember the current position. [[(jump)][Line (jump)]] - jumps to point-min. - - Finally, you can use `-i' to preserve the indentation of a specific -code block (*note Editing source code::). - - If the syntax for the label format conflicts with the language -syntax, use a `-l' switch to change the format, for example -`#+BEGIN_SRC pascal -n -r -l "((%s))"'. See also the variable -`org-coderef-label-format'. - - HTML export also allows examples to be published as text areas -(*note Text areas in HTML export::). - - Because the `#+BEGIN_...' and `#+END_...' patterns need to be added -so often, shortcuts are provided using the Easy templates facility -(*note Easy templates::). - -`C-c '' - Edit the source code example at point in its native mode. This - works by switching to a temporary buffer with the source code. - You need to exit by pressing `C-c '' again(4). The edited version - will then replace the old version in the Org buffer. Fixed-width - regions (where each line starts with a colon followed by a space) - will be edited using `artist-mode'(5) to allow creating ASCII - drawings easily. Using this command in an empty line will create - a new fixed-width region. - -`C-c l' - Calling `org-store-link' while editing a source code example in a - temporary buffer created with `C-c '' will prompt for a label. - Make sure that it is unique in the current buffer, and insert it - with the proper formatting like `(ref:label)' at the end of the - current line. Then the label is stored as a link `(label)', for - retrieval with `C-c C-l'. - - ---------- Footnotes ---------- - - (1) This works automatically for the HTML back-end (it requires -version 1.34 of the `htmlize.el' package, which you need to install). -Fontified code chunks in LaTeX can be achieved using either the -listings -(https://www.ctan.org/tex-archive/macros/latex/contrib/listings/?lang=en) -or the minted (https://github.com/gpoore/minted) package. If you use -minted or listing, you must load the packages manually, for example by -adding the desired package to `org-latex-packages-alist'. Refer to -`org-latex-listings' for details. - - (2) Code in `src' blocks may also be evaluated either interactively -or on export. *Note Working with source code::, for more information -on evaluating code blocks. - - (3) Adding `-k' to `-n -r' will keep the labels in the source code -while using line numbers for the links, which might be useful to -explain those in an Org mode example code. - - (4) Upon exit, lines starting with `*', `,*', `#+' and `,#+' will -get a comma prepended, to keep them from being interpreted by Org as -outline nodes or special syntax. These commas will be stripped for -editing with `C-c '', and also for export. - - (5) You may select a different-mode with the variable -`org-edit-fixed-width-region-mode'. - - -File: org, Node: Special symbols, Next: Subscripts and superscripts, Prev: Literal examples, Up: Markup - -11.6 Special symbols -==================== - -You can use LaTeX-like syntax to insert special symbols--named -entities--like `\alpha' to indicate the Greek letter, or `\to' to -indicate an arrow. Completion for these symbols is available, just type -`\' and maybe a few letters, and press `M-' to see possible -completions. If you need such a symbol inside a word, terminate it with -a pair of curly brackets. For example - - Pro tip: Given a circle \Gamma of diameter d, the length of its circumference - is \pi{}d. - - A large number of entities is provided, with names taken from both -HTML and LaTeX; you can comfortably browse the complete list from a -dedicated buffer using the command `org-entities-help'. It is also -possible to provide your own special symbols in the variable -`org-entities-user'. - - During export, these symbols are transformed into the native format -of the exporter back-end. Strings like `\alpha' are exported as -`α' in the HTML output, and as `\(\alpha\)' in the LaTeX output. -Similarly, `\nbsp' becomes ` ' in HTML and `~' in LaTeX. - - Entities may also be used as a may to escape markup in an Org -document, e.g., `\under{}not underlined\under' exports as `_not -underlined_'. - - If you would like to see entities displayed as UTF-8 characters, use -the following command(1): - -`C-c C-x \' - Toggle display of entities as UTF-8 characters. This does not - change the buffer content which remains plain ASCII, but it - overlays the UTF-8 character for display purposes only. - - In addition to regular entities defined above, Org exports in a -special way(2) the following commonly used character combinations: `\-' -is treated as a shy hyphen, `--' and `---' are converted into dashes, -and `...' becomes a compact set of dots. - - ---------- Footnotes ---------- - - (1) You can turn this on by default by setting the variable -`org-pretty-entities', or on a per-file base with the `#+STARTUP' -option `entitiespretty'. - - (2) This behaviour can be disabled with `-' export setting (*note -Export settings::). - - -File: org, Node: Subscripts and superscripts, Next: Embedded LaTeX, Prev: Special symbols, Up: Markup - -11.7 Subscripts and superscripts -================================ - -`^' and `_' are used to indicate super- and subscripts. To increase -the readability of ASCII text, it is not necessary--but OK--to surround -multi-character sub- and superscripts with curly braces. Those are, -however, mandatory, when more than one word is involved. For example - - The radius of the sun is R_sun = 6.96 x 10^8 m. On the other hand, the - radius of Alpha Centauri is R_{Alpha Centauri} = 1.28 x R_{sun}. - - If you write a text where the underscore is often used in a different -context, Org's convention to always interpret these as subscripts can -get in your way. Configure the variable `org-use-sub-superscripts' to -change this convention. For example, when setting this variable to -`{}', `a_b' will not be interpreted as a subscript, but `a_{b}' will. - -`C-c C-x \' - In addition to showing entities as UTF-8 characters, this command - will also format sub- and superscripts in a WYSIWYM way. - - -File: org, Node: Embedded LaTeX, Prev: Subscripts and superscripts, Up: Markup - -11.8 Embedded LaTeX -=================== - -Plain ASCII is normally sufficient for almost all note taking. -Exceptions include scientific notes, which often require mathematical -symbols and the occasional formula. LaTeX(1) is widely used to -typeset scientific documents. Org mode supports embedding LaTeX code -into its files, because many academics are used to writing and reading -LaTeX source code, and because it can be readily processed to produce -pretty output for a number of export back-ends. - -* Menu: - -* LaTeX fragments:: Complex formulas made easy -* Previewing LaTeX fragments:: What will this snippet look like? -* CDLaTeX mode:: Speed up entering of formulas - - ---------- Footnotes ---------- - - (1) LaTeX is a macro system based on Donald E. Knuth's TeX system. -Many of the features described here as "LaTeX" are really from TeX, but -for simplicity I am blurring this distinction. - - -File: org, Node: LaTeX fragments, Next: Previewing LaTeX fragments, Up: Embedded LaTeX - -11.8.1 LaTeX fragments ----------------------- - -Org mode can contain LaTeX math fragments, and it supports ways to -process these for several export back-ends. When exporting to LaTeX, -the code is left as it is. When exporting to HTML, Org can use either -MathJax (http://www.mathjax.org) (*note Math formatting in HTML -export::) or transcode the math into images (see *note Previewing LaTeX -fragments::). - - LaTeX fragments don't need any special marking at all. The following -snippets will be identified as LaTeX source code: - * Environments of any kind(1). The only requirement is that the - `\begin' statement appears on a new line, at the beginning of the - line or after whitespaces only. - - * Text within the usual LaTeX math delimiters. To avoid conflicts - with currency specifications, single `$' characters are only - recognized as math delimiters if the enclosed text contains at - most two line breaks, is directly attached to the `$' characters - with no whitespace in between, and if the closing `$' is followed - by whitespace or punctuation (parentheses and quotes are - considered to be punctuation in this context). For the other - delimiters, there is no such restriction, so when in doubt, use - `\(...\)' as inline math delimiters. - -For example: - - \begin{equation} - x=\sqrt{b} - \end{equation} - - If $a^2=b$ and \( b=2 \), then the solution must be - either $$ a=+\sqrt{2} $$ or \[ a=-\sqrt{2} \]. - - LaTeX processing can be configured with the variable -`org-export-with-latex'. The default setting is `t' which means -MathJax for HTML, and no processing for ASCII and LaTeX back-ends. You -can also set this variable on a per-file basis using one of these lines: - - #+OPTIONS: tex:t Do the right thing automatically (MathJax) - #+OPTIONS: tex:nil Do not process LaTeX fragments at all - #+OPTIONS: tex:verbatim Verbatim export, for jsMath or so - - ---------- Footnotes ---------- - - (1) When MathJax is used, only the environments recognized by -MathJax will be processed. When `dvipng' program, `dvisvgm' program or -`imagemagick' suite is used to create images, any LaTeX environment -will be handled. - - -File: org, Node: Previewing LaTeX fragments, Next: CDLaTeX mode, Prev: LaTeX fragments, Up: Embedded LaTeX - -11.8.2 Previewing LaTeX fragments ---------------------------------- - -If you have a working LaTeX installation and `dvipng', `dvisvgm' or -`convert' installed(1), LaTeX fragments can be processed to produce -images of the typeset expressions to be used for inclusion while -exporting to HTML (see *note LaTeX fragments::), or for inline -previewing within Org mode. - - You can customize the variables `org-format-latex-options' and -`org-format-latex-header' to influence some aspects of the preview. In -particular, the `:scale' (and for HTML export, `:html-scale') property -of the former can be used to adjust the size of the preview images. - -`C-c C-x C-l' - Produce a preview image of the LaTeX fragment at point and overlay - it over the source code. If there is no fragment at point, - process all fragments in the current entry (between two - headlines). When called with a prefix argument, process the - entire subtree. When called with two prefix arguments, or when - the cursor is before the first headline, process the entire buffer. - -`C-c C-c' - Remove the overlay preview images. - - You can turn on the previewing of all LaTeX fragments in a file with - - #+STARTUP: latexpreview - - To disable it, simply use - - #+STARTUP: nolatexpreview - - ---------- Footnotes ---------- - - (1) These are respectively available at -`http://sourceforge.net/projects/dvipng/', `http://dvisvgm.bplaced.net/' -and from the `imagemagick' suite. Choose the converter by setting the -variable `org-preview-latex-default-process' accordingly. - - -File: org, Node: CDLaTeX mode, Prev: Previewing LaTeX fragments, Up: Embedded LaTeX - -11.8.3 Using CDLaTeX to enter math ----------------------------------- - -CDLaTeX mode is a minor mode that is normally used in combination with a -major LaTeX mode like AUCTeX in order to speed-up insertion of -environments and math templates. Inside Org mode, you can make use of -some of the features of CDLaTeX mode. You need to install `cdlatex.el' -and `texmathp.el' (the latter comes also with AUCTeX) from -`https://staff.fnwi.uva.nl/c.dominik/Tools/cdlatex'. Don't use CDLaTeX -mode itself under Org mode, but use the light version -`org-cdlatex-mode' that comes as part of Org mode. Turn it on for the -current buffer with `M-x org-cdlatex-mode RET', or for all Org files -with - - (add-hook 'org-mode-hook 'turn-on-org-cdlatex) - - When this mode is enabled, the following features are present (for -more details see the documentation of CDLaTeX mode): - * Environment templates can be inserted with `C-c {'. - - * The key will do template expansion if the cursor is inside a - LaTeX fragment(1). For example, will expand `fr' to - `\frac{}{}' and position the cursor correctly inside the first - brace. Another will get you into the second brace. Even - outside fragments, will expand environment abbreviations at - the beginning of a line. For example, if you write `equ' at the - beginning of a line and press , this abbreviation will be - expanded to an `equation' environment. To get a list of all - abbreviations, type `M-x cdlatex-command-help RET'. - - * Pressing `_' and `^' inside a LaTeX fragment will insert these - characters together with a pair of braces. If you use to - move out of the braces, and if the braces surround only a single - character or macro, they are removed again (depending on the - variable `cdlatex-simplify-sub-super-scripts'). - - * Pressing the grave accent ``' followed by a character inserts math - macros, also outside LaTeX fragments. If you wait more than 1.5 - seconds after the grave accent, a help window will pop up. - - * Pressing the apostrophe `'' followed by another character modifies - the symbol before point with an accent or a font. If you wait - more than 1.5 seconds after the apostrophe, a help window will pop - up. Character modification will work only inside LaTeX fragments; - outside the quote is normal. - - ---------- Footnotes ---------- - - (1) Org mode has a method to test if the cursor is inside such a -fragment, see the documentation of the function -`org-inside-LaTeX-fragment-p'. - - -File: org, Node: Exporting, Next: Publishing, Prev: Markup, Up: Top - -12 Exporting -************ - -Sometimes, you may want to pretty print your notes, publish them on the -web or even share them with people not using Org. In these cases, the -Org export facilities can be used to convert your documents to a -variety of other formats, while retaining as much structure (*note -Document structure::) and markup (*note Markup::) as possible. - - Libraries responsible for such translation are called back-ends. -Org ships with the following ones - - * ascii (ASCII format) - - * beamer (LaTeX Beamer format) - - * html (HTML format) - - * icalendar (iCalendar format) - - * latex (LaTeX format) - - * md (Markdown format) - - * odt (OpenDocument Text format) - - * org (Org format) - - * texinfo (Texinfo format) - - * man (Man page format) - -Org also uses additional libraries located in `contrib/' directory -(*note Installation::). Users can install additional export libraries -for additional formats from the Emacs packaging system. For easy -discovery, these packages have a common naming scheme: `ox-NAME', where -NAME is one of the formats. For example, `ox-koma-letter' for -`koma-letter' back-end. - - Org loads back-ends for the following formats by default: `ascii', -`html', `icalendar', `latex' and `odt'. - - Org can load additional back-ends either of two ways: through the -`org-export-backends' variable configuration; or, by requiring the -library in the Emacs init file like this: - - (require 'ox-md) - -* Menu: - -* The export dispatcher:: The main interface -* Export settings:: Common export settings -* Table of contents:: The if and where of the table of contents -* Include files:: Include additional files into a document -* Macro replacement:: Use macros to create templates -* Comment lines:: What will not be exported -* ASCII/Latin-1/UTF-8 export:: Exporting to flat files with encoding -* Beamer export:: Exporting as a Beamer presentation -* HTML export:: Exporting to HTML -* LaTeX export:: Exporting to LaTeX, and processing to PDF -* Markdown export:: Exporting to Markdown -* OpenDocument Text export:: Exporting to OpenDocument Text -* Org export:: Exporting to Org -* Texinfo export:: Exporting to Texinfo -* iCalendar export:: Exporting to iCalendar -* Other built-in back-ends:: Exporting to a man page -* Advanced configuration:: Fine-tuning the export output -* Export in foreign buffers:: Author tables and lists in Org syntax - - -File: org, Node: The export dispatcher, Next: Export settings, Up: Exporting - -12.1 The export dispatcher -========================== - -The export dispatcher is the main interface for Org's exports. A -hierarchical menu presents the currently configured export formats. -Options are shown as easy toggle switches on the same screen. - - Org also has a minimal prompt interface for the export dispatcher. -When the variable `org-export-dispatch-use-expert-ui' is set to a -non-`nil' value, Org prompts in the minibuffer. To switch back to the -hierarchical menu, press . - -`C-c C-e' (`org-export-dispatch') - Invokes the export dispatcher interface. The options show default - settings. The `C-u' prefix argument preserves options from the - previous export, including any sub-tree selections. - - - Org exports the entire buffer by default. If the Org buffer has an -active region, then Org exports just that region. - - These are the export options, the key combinations that toggle them -(*note Export settings::): - -`C-a' - Toggles asynchronous export. Asynchronous export uses an external - Emacs process with a specially configured initialization file to - complete the exporting process in the background thereby releasing - the current interface. This is particularly useful when exporting - long documents. - - Output from an asynchronous export is saved on the "the export - stack". To view this stack, call the export dispatcher with a - double `C-u' prefix argument. If already in the export dispatcher - menu, `&' displays the stack. - - To make the background export process the default, customize the - variable, `org-export-in-background'. - -`C-b' - Toggle body-only export. Useful for excluding headers and footers - in the export. Affects only those back-end formats that have such - sections--like `...' in HTML. - -`C-s' - Toggle sub-tree export. When turned on, Org exports only the - sub-tree starting from the cursor position at the time the export - dispatcher was invoked. Org uses the top heading of this sub-tree - as the document's title. If the cursor is not on a heading, Org - uses the nearest enclosing header. If the cursor is in the - document preamble, Org signals an error and aborts export. - - To make the sub-tree export the default, customize the variable, - `org-export-initial-scope'. - -`C-v' - Toggle visible-only export. Useful for exporting only visible - parts of an Org document by adjusting outline visibility settings. - - -File: org, Node: Export settings, Next: Table of contents, Prev: The export dispatcher, Up: Exporting - -12.2 Export settings -==================== - -Export options can be set: globally with variables; for an individual -file by making variables buffer-local with in-buffer settings (*note -In-buffer settings::), by setting individual keywords, or by specifying -them in a compact form with the `#+OPTIONS' keyword; or for a tree by -setting properties (*note Properties and columns::). Options set at a -specific level override options set at a more general level. - - In-buffer settings may appear anywhere in the file, either directly -or indirectly through a file included using `#+SETUPFILE: filename or -URL' syntax. Option keyword sets tailored to a particular back-end can -be inserted from the export dispatcher (*note The export dispatcher::) -using the `Insert template' command by pressing <#>. To insert keywords -individually, a good way to make sure the keyword is correct is to type -`#+' and then to use `M-'(1) for completion. - - The export keywords available for every back-end, and their -equivalent global variables, include: - -`AUTHOR' - The document author (`user-full-name'). - -`CREATOR' - Entity responsible for output generation - (`org-export-creator-string'). - -`DATE' - A date or a time-stamp(2). - -`EMAIL' - The email address (`user-mail-address'). - -`LANGUAGE' - Language to use for translating certain strings - (`org-export-default-language'). With `#+LANGUAGE: fr', for - example, Org translates _Table of contents_ to the French _Table - des matières_. - -`SELECT_TAGS' - The default value is `:export:'. When a tree is tagged with - `:export:' (`org-export-select-tags'), Org selects that tree and - its sub-trees for export. Org excludes trees with `:noexport:' - tags, see below. When selectively exporting files with `:export:' - tags set, Org does not export any text that appears before the - first headline. - -`EXCLUDE_TAGS' - The default value is `:noexport:'. When a tree is tagged with - `:noexport:' (`org-export-exclude-tags'), Org excludes that tree - and its sub-trees from export. Entries tagged with `:noexport:' - will be unconditionally excluded from the export, even if they - have an `:export:' tag. Even if a sub-tree is not exported, Org - will execute any code blocks contained in them. - -`TITLE' - Org displays this title. For long titles, use multiple `#+TITLE' - lines. - -`EXPORT_FILE_NAME' - The name of the output file to be generated. Otherwise, Org - generates the file name based on the buffer name and the extension - based on the back-end format. - - The `#+OPTIONS' keyword is a compact form. To configure multiple -options, use several `#+OPTIONS' lines. `#+OPTIONS' recognizes the -following arguments. - -`':' - Toggle smart quotes (`org-export-with-smart-quotes'). Depending - on the language used, when activated, Org treats pairs of double - quotes as primary quotes, pairs of single quotes as secondary - quotes, and single quote marks as apostrophes. - -`*:' - Toggle emphasized text (`org-export-with-emphasize'). - -`-:' - Toggle conversion of special strings - (`org-export-with-special-strings'). - -`::' - Toggle fixed-width sections (`org-export-with-fixed-width'). - -`<:' - Toggle inclusion of time/date active/inactive stamps - (`org-export-with-timestamps'). - -`\n:' - Toggles whether to preserve line breaks - (`org-export-preserve-breaks'). - -`^:' - Toggle TeX-like syntax for sub- and superscripts. If you write - "^:{}", `a_{b}' will be interpreted, but the simple `a_b' will be - left as it is (`org-export-with-sub-superscripts'). - -`arch:' - Configure how archived trees are exported. When set to - `headline', the export process skips the contents and processes - only the headlines (`org-export-with-archived-trees'). - -`author:' - Toggle inclusion of author name into exported file - (`org-export-with-author'). - -`broken-links:' - Toggles if Org should continue exporting upon finding a broken - internal link. When set to `mark', Org clearly marks the problem - link in the output (`org-export-with-broken-links'). - -`c:' - Toggle inclusion of CLOCK keywords (`org-export-with-clocks'). - -`creator:' - Toggle inclusion of creator information in the exported file - (`org-export-with-creator'). - -`d:' - Toggles inclusion of drawers, or list of drawers to include, or - list of drawers to exclude (`org-export-with-drawers'). - -`date:' - Toggle inclusion of a date into exported file - (`org-export-with-date'). - -`e:' - Toggle inclusion of entities (`org-export-with-entities'). - -`email:' - Toggle inclusion of the author's e-mail into exported file - (`org-export-with-email'). - -`f:' - Toggle the inclusion of footnotes (`org-export-with-footnotes'). - -`H:' - Set the number of headline levels for export - (`org-export-headline-levels'). Below that level, headlines are - treated differently. In most back-ends, they become list items. - -`inline:' - Toggle inclusion of inlinetasks (`org-export-with-inlinetasks'). - -`num:' - Toggle section-numbers (`org-export-with-section-numbers'). When - set to number `n', Org numbers only those headlines at level `n' - or above. Set `UNNUMBERED' property to non-`nil' to disable - numbering of heading and subheadings entirely. - -`p:' - Toggle export of planning information (`org-export-with-planning'). - "Planning information" comes from lines located right after the - headline and contain any combination of these cookies: - `SCHEDULED:', `DEADLINE:', or `CLOSED:'. - -`pri:' - Toggle inclusion of priority cookies (`org-export-with-priority'). - -`prop:' - Toggle inclusion of property drawers, or list the properties to - include (`org-export-with-properties'). - -`stat:' - Toggle inclusion of statistics cookies - (`org-export-with-statistics-cookies'). - -`tags:' - Toggle inclusion of tags, may also be `not-in-toc' - (`org-export-with-tags'). - -`tasks:' - Toggle inclusion of tasks (TODO items); or `nil' to remove all - tasks; or `todo' to remove DONE tasks; or list the keywords to keep - (`org-export-with-tasks'). - -`tex:' - `nil' does not export; `t' exports; `verbatim' keeps everything in - verbatim (`org-export-with-latex'). - -`timestamp:' - Toggle inclusion of the creation time in the exported file - (`org-export-time-stamp-file'). - -`title:' - Toggle inclusion of title (`org-export-with-title'). - -`toc:' - Toggle inclusion of the table of contents, or set the level limit - (`org-export-with-toc'). - -`todo:' - Toggle inclusion of TODO keywords into exported text - (`org-export-with-todo-keywords'). - -`|:' - Toggle inclusion of tables (`org-export-with-tables'). - - - When exporting sub-trees, special node properties in them can -override the above keywords. They are special because they have an -`EXPORT_' prefix. For example, `DATE' and `EXPORT_FILE_NAME' keywords -become, respectively, `EXPORT_DATE' and `EXPORT_FILE_NAME'. Except for -`SETUPFILE', all other keywords listed above have an `EXPORT_' -equivalent. - - If `org-export-allow-bind-keywords' is non-`nil', Emacs variables -can become buffer-local during export by using the BIND keyword. Its -syntax is `#+BIND: variable value'. This is particularly useful for -in-buffer settings that cannot be changed using keywords. - - ---------- Footnotes ---------- - - (1) Many desktops intercept `M-TAB' to switch windows. Use `C-M-i' -or ` ' instead. - - (2) The variable `org-export-date-timestamp-format' defines how this -time-stamp will be exported. - - -File: org, Node: Table of contents, Next: Include files, Prev: Export settings, Up: Exporting - -12.3 Table of contents -====================== - -Org normally inserts the table of contents directly before the first -headline of the file. Org sets the TOC depth the same as the headline -levels in the file. Use a lower number for lower TOC depth. To turn -off TOC entirely, use `nil'. This is configured in the -`org-export-with-toc' variable or as keywords in an Org file as: - - #+OPTIONS: toc:2 only include two levels in TOC - #+OPTIONS: toc:nil no default TOC at all - - To move the table of contents to a different location, first turn -off the default with `org-export-with-toc' variable or with `#+OPTIONS: -toc:nil'. Then insert `#+TOC: headlines N' at the desired location(s). - - #+OPTIONS: toc:nil no default TOC - ... - #+TOC: headlines 2 insert TOC here, with two headline levels - - To adjust the TOC depth for a specific section of the Org document, -append an additional `local' parameter. This parameter becomes a -relative depth for the current level. - - Note that for this feature to work properly in LaTeX export, the Org -file requires the inclusion of the `titletoc' package. Because of -compatibility issues, `titletoc' has to be loaded _before_ `hyperref'. -Customize the `org-latex-default-packages-alist' variable. - - * Section #+TOC: headlines 1 local insert local TOC, with direct children - only - - Use the `TOC' keyword to generate list of tables (resp. all listings) -with captions. - - #+TOC: listings build a list of listings - #+TOC: tables build a list of tables - - Normally Org uses the headline for its entry in the table of -contents. But with `ALT_TITLE' property, a different entry can be -specified for the table of contents. - - -File: org, Node: Include files, Next: Macro replacement, Prev: Table of contents, Up: Exporting - -12.4 Include files -================== - -Include other files during export. For example, to include your -`.emacs' file, you could use: - - #+INCLUDE: "~/.emacs" src emacs-lisp - -The first parameter is the file name to include. The optional second -parameter specifies the block type: `example', `export' or `src'. The -optional third parameter specifies the source code language to use for -formatting the contents. This is relevant to both `export' and `src' -block types. - - If an include file is specified as having a markup language, Org -neither checks for valid syntax nor changes the contents in any way. -For `example' and `src' blocks, Org code-escapes the contents before -inclusion. - - If an include file is not specified as having any markup language, -Org assumes it be in Org format and proceeds as usual with a few -exceptions. Org makes the footnote labels (*note Footnotes::) in the -included file local to that file. The contents of the included file -will belong to the same structure--headline, item--containing the -`INCLUDE' keyword. In particular, headlines within the file will -become children of the current section. That behavior can be changed -by providing an additional keyword parameter, `:minlevel'. It shifts -the headlines in the included file to become the lowest level. For -example, this syntax makes the included file a sibling of the current -top-level headline: - - #+INCLUDE: "~/my-book/chapter2.org" :minlevel 1 - - Inclusion of only portions of files are specified using ranges -parameter with `:lines' keyword. The line at the upper end of the -range will not be included. The start and/or the end of the range may -be omitted to use the obvious defaults. - - #+INCLUDE: "~/.emacs" :lines "5-10" Include lines 5 to 10, 10 excluded - #+INCLUDE: "~/.emacs" :lines "-10" Include lines 1 to 10, 10 excluded - #+INCLUDE: "~/.emacs" :lines "10-" Include lines from 10 to EOF - - Inclusions may specify a file-link to extract an object matched by -`org-link-search'(1) (*note Search options::). - - To extract only the contents of the matched object, set -`:only-contents' property to non-`nil'. This will omit any planning -lines or property drawers. The ranges for `:lines' keyword are -relative to the requested element. Some examples: - - #+INCLUDE: "./paper.org::#theory" :only-contents t - Include the body of the heading with the custom id `theory' - #+INCLUDE: "./paper.org::mytable" Include named element. - #+INCLUDE: "./paper.org::*conclusion" :lines 1-20 - Include the first 20 lines of the headline named `conclusion'. - -`C-c '' - Visit the include file at point. - - ---------- Footnotes ---------- - - (1) Note that `org-link-search-must-match-exact-headline' is locally -bound to non-`nil'. Therefore, `org-link-search' only matches -headlines and named elements. - - -File: org, Node: Macro replacement, Next: Comment lines, Prev: Include files, Up: Exporting - -12.5 Macro replacement -====================== - -Macros replace text snippets during export. Macros are defined -globally in `org-export-global-macros', or document-wise with the -following syntax: - - #+MACRO: name replacement text $1, $2 are arguments - -which can be referenced using `{{{name(arg1, arg2)}}}'(1). - - Org recognizes macro references in following Org markup areas: -paragraphs, headlines, verse blocks, tables cells and lists. Org also -recognizes macro references in keywords, such as `#+CAPTION', `#+TITLE', -`#+AUTHOR', `#+DATE', and for some back-end specific export options. - - Org comes with following pre-defined macros: - -`{{{title}}}' -`{{{author}}}' -`{{{email}}}' - Org replaces these macro references with available information at - the time of export. - -`{{{date}}}' -`{{{date(FORMAT)}}}' - This macro refers to the `#+DATE' keyword. FORMAT is an optional - argument to the `{{{date}}}' macro that will be used only if - `#+DATE' is a single timestamp. FORMAT should be a format string - understood by `format-time-string'. - -`{{{time(FORMAT)}}}' -`{{{modification-time(FORMAT, VC)}}}' - These macros refer to the document's date and time of export and - date and time of modification. FORMAT is a string understood by - `format-time-string'. If the second argument to the - `modification-time' macro is non-`nil', Org uses `vc.el' to - retrieve the document's modification time from the version control - system. Otherwise Org reads the file attributes. - -`{{{input-file}}}' - This macro refers to the filename of the exported file. - -`{{{property(PROPERTY-NAME)}}}' -`{{{property(PROPERTY-NAME,SEARCH-OPTION)}}}' - This macro returns the value of property PROPERTY-NAME in the - current entry. If SEARCH-OPTION (*note Search options::) refers - to a remote entry, that will be used instead. - -`{{{n}}}' -`{{{n(NAME)}}}' -`{{{n(NAME,ACTION)}}}' - This macro implements custom counters by returning the number of - times the macro has been expanded so far while exporting the - buffer. You can create more than one counter using different NAME - values. If ACTION is `-', previous value of the counter is held, - i.e. the specified counter is not incremented. If the value is a - number, the specified counter is set to that value. If it is any - other non-empty string, the specified counter is reset to 1. You - may leave NAME empty to reset the default counter. - - The surrounding brackets can be made invisible by setting -`org-hide-macro-markers' non-`nil'. - - Org expands macros at the very beginning of the export process. - - ---------- Footnotes ---------- - - (1) Since commas separate the arguments, commas within arguments -have to be escaped with the backslash character. So only those -backslash characters before a comma need escaping with another -backslash character. - - -File: org, Node: Comment lines, Next: ASCII/Latin-1/UTF-8 export, Prev: Macro replacement, Up: Exporting - -12.6 Comment lines -================== - -Lines starting with zero or more whitespace characters followed by one -`#' and a whitespace are treated as comments and, as such, are not -exported. - - Likewise, regions surrounded by `#+BEGIN_COMMENT' ... -`#+END_COMMENT' are not exported. - - Finally, a `COMMENT' keyword at the beginning of an entry, but after -any other keyword or priority cookie, comments out the entire subtree. -In this case, the subtree is not exported and no code block within it -is executed either(1). The command below helps changing the comment -status of a headline. - -`C-c ;' - Toggle the `COMMENT' keyword at the beginning of an entry. - - ---------- Footnotes ---------- - - (1) For a less drastic behavior, consider using a select tag (*note -Export settings::) instead. - - -File: org, Node: ASCII/Latin-1/UTF-8 export, Next: Beamer export, Prev: Comment lines, Up: Exporting - -12.7 ASCII/Latin-1/UTF-8 export -=============================== - -ASCII export produces an output file containing only plain ASCII -characters. This is the most simplest and direct text output. It does -not contain any Org markup either. Latin-1 and UTF-8 export use -additional characters and symbols available in these encoding -standards. All three of these export formats offer the most basic of -text output for maximum portability. - - On export, Org fills and justifies text according to the text width -set in `org-ascii-text-width'. - - Org exports links using a footnote-like style where the descriptive -part is in the text and the link is in a note before the next heading. -See the variable `org-ascii-links-to-notes' for details. - -ASCII export commands ---------------------- - -`C-c C-e t a/l/u (`org-ascii-export-to-ascii')' - Export as an ASCII file with a `.txt' extension. For `myfile.org', - Org exports to `myfile.txt', overwriting without warning. For - `myfile.txt', Org exports to `myfile.txt.txt' in order to prevent - data loss. - -`C-c C-e t A/L/U (`org-ascii-export-as-ascii')' - Export to a temporary buffer. Does not create a file. - -ASCII specific export settings ------------------------------- - -The ASCII export back-end has one extra keyword for customizing ASCII -output. Setting this keyword works similar to the general options -(*note Export settings::). - -`SUBTITLE' - The document subtitle. For long subtitles, use multiple - `#+SUBTITLE' lines in the Org file. Org prints them on one - continuous line, wrapping into multiple lines if necessary. - -Header and sectioning structure -------------------------------- - -Org converts the first three outline levels into headlines for ASCII -export. The remaining levels are turned into lists. To change this -cut-off point where levels become lists, *note Export settings::. - -Quoting ASCII text ------------------- - -To insert text within the Org file by the ASCII back-end, use one the -following constructs, inline, keyword, or export block: - - Inline text @@ascii:and additional text@@ within a paragraph. - - #+ASCII: Some text - - #+BEGIN_EXPORT ascii - Org exports text in this block only when using ASCII back-end. - #+END_EXPORT - -ASCII specific attributes -------------------------- - -ASCII back-end recognizes only one attribute, `:width', which specifies -the width of an horizontal rule in number of characters. The keyword -and syntax for specifying widths is: - - #+ATTR_ASCII: :width 10 - ----- - -ASCII special blocks --------------------- - -Besides `#+BEGIN_CENTER' blocks (*note Paragraphs::), ASCII back-end has -these two left and right justification blocks: - - #+BEGIN_JUSTIFYLEFT - It's just a jump to the left... - #+END_JUSTIFYLEFT - - #+BEGIN_JUSTIFYRIGHT - ...and then a step to the right. - #+END_JUSTIFYRIGHT - - -File: org, Node: Beamer export, Next: HTML export, Prev: ASCII/Latin-1/UTF-8 export, Up: Exporting - -12.8 Beamer export -================== - -Org uses _Beamer_ export to convert an Org file tree structure into a -high-quality interactive slides for presentations. _Beamer_ is a LaTeX -document class for creating presentations in PDF, HTML, and other -popular display formats. - -* Menu: - -* Beamer export commands:: For creating Beamer documents. -* Beamer specific export settings:: For customizing Beamer export. -* Sectioning Frames and Blocks in Beamer:: For composing Beamer slides. -* Beamer specific syntax:: For using in Org documents. -* Editing support:: For using helper functions. -* A Beamer example:: A complete presentation. - - -File: org, Node: Beamer export commands, Next: Beamer specific export settings, Up: Beamer export - -12.8.1 Beamer export commands ------------------------------ - -`C-c C-e l b (`org-beamer-export-to-latex')' - Export as LaTeX file with a `.tex' extension. For `myfile.org', - Org exports to `myfile.tex', overwriting without warning. - -`C-c C-e l B (`org-beamer-export-as-latex')' - Export to a temporary buffer. Does not create a file. - -`C-c C-e l P (`org-beamer-export-to-pdf')' - Export as LaTeX file and then convert it to PDF format. - -`C-c C-e l O' - Export as LaTeX file, convert it to PDF format, and then open the - PDF file. - - -File: org, Node: Beamer specific export settings, Next: Sectioning Frames and Blocks in Beamer, Prev: Beamer export commands, Up: Beamer export - -12.8.2 Beamer specific export settings --------------------------------------- - -Beamer export back-end has several additional keywords for customizing -Beamer output. These keywords work similar to the general options -settings (*note Export settings::). - -`BEAMER_THEME' - The Beamer layout theme (`org-beamer-theme'). Use square brackets - for options. For example: - #+BEAMER_THEME: Rochester [height=20pt] - -`BEAMER_FONT_THEME' - The Beamer font theme. - -`BEAMER_INNER_THEME' - The Beamer inner theme. - -`BEAMER_OUTER_THEME' - The Beamer outer theme. - -`BEAMER_HEADER' - Arbitrary lines inserted in the preamble, just before the - `hyperref' settings. - -`DESCRIPTION' - The document description. For long descriptions, use multiple - `#+DESCRIPTION' keywords. By default, `hyperref' inserts - `#+DESCRIPTION' as metadata. Use `org-latex-hyperref-template' to - configure document metadata. Use `org-latex-title-command' to - configure typesetting of description as part of front matter. - -`KEYWORDS' - The keywords for defining the contents of the document. Use - multiple `#+KEYWORDS' lines if necessary. By default, `hyperref' - inserts `#+KEYWORDS' as metadata. Use - `org-latex-hyperref-template' to configure document metadata. Use - `org-latex-title-command' to configure typesetting of keywords as - part of front matter. - -`SUBTITLE' - Document's subtitle. For typesetting, use - `org-beamer-subtitle-format' string. Use - `org-latex-hyperref-template' to configure document metadata. Use - `org-latex-title-command' to configure typesetting of subtitle as - part of front matter. - - -File: org, Node: Sectioning Frames and Blocks in Beamer, Next: Beamer specific syntax, Prev: Beamer specific export settings, Up: Beamer export - -12.8.3 Sectioning, Frames and Blocks in Beamer ----------------------------------------------- - -Org transforms heading levels into Beamer's sectioning elements, frames -and blocks. Any Org tree with a not-too-deep-level nesting should in -principle be exportable as a Beamer presentation. - - - Org headlines become Beamer frames when the heading level in Org - is equal to `org-beamer-frame-level' or `H' value in an `OPTIONS' - line (*note Export settings::). - - Org overrides headlines to frames conversion for the current tree - of an Org file if it encounters the `BEAMER_ENV' property set to - `frame' or `fullframe'. Org ignores whatever - `org-beamer-frame-level' happens to be for that headline level in - the Org tree. In Beamer terminology, a `fullframe' is a frame - without its title. - - - Org exports a Beamer frame's objects as `block' environments. Org - can enforce wrapping in special block types when `BEAMER_ENV' - property is set(1). For valid values see - `org-beamer-environments-default'. To add more values, see - `org-beamer-environments-extra'. - - - If `BEAMER_ENV' is set to `appendix', Org exports the entry as an - appendix. When set to `note', Org exports the entry as a note - within the frame or between frames, depending on the entry's - heading level. When set to `noteNH', Org exports the entry as a - note without its title. When set to `againframe', Org exports the - entry with `\againframe' command, which makes setting the - `BEAMER_REF' property mandatory because `\againframe' needs frame - to resume. - - When `ignoreheading' is set, Org export ignores the entry's - headline but not its content. This is useful for inserting - content between frames. It is also useful for properly closing a - `column' environment. - - When `BEAMER_ACT' is set for a headline, Org export translates that -headline as an overlay or action specification. When enclosed in square -brackets, Org export makes the overlay specification a default. Use -`BEAMER_OPT' to set any options applicable to the current Beamer frame -or block. The Beamer export back-end wraps with appropriate angular or -square brackets. It also adds the `fragile' option for any code that -may require a verbatim block. - - To create a column on the Beamer slide, use the `BEAMER_COL' property -for its headline in the Org file. Set the value of `BEAMER_COL' to a -decimal number representing the fraction of the total text width. -Beamer export uses this value to set the column's width and fills the -column with the contents of the Org entry. If the Org entry has no -specific environment defined, Beamer export ignores the heading. If -the Org entry has a defined environment, Beamer export uses the heading -as title. Behind the scenes, Beamer export automatically handles LaTeX -column separations for contiguous headlines. To manually adjust them -for any unique configurations needs, use the `BEAMER_ENV' property. - - ---------- Footnotes ---------- - - (1) If `BEAMER_ENV' is set, Org export adds `:B_environment:' tag to -make it visible. The tag serves as a visual aid and has no semantic -relevance. - - -File: org, Node: Beamer specific syntax, Next: Editing support, Prev: Sectioning Frames and Blocks in Beamer, Up: Beamer export - -12.8.4 Beamer specific syntax ------------------------------ - -Since Org's Beamer export back-end is an extension of the LaTeX -back-end, it recognizes other LaTeX specific syntax--for example, -`#+LATEX:' or `#+ATTR_LATEX:'. *Note LaTeX export::, for details. - - Beamer export wraps the table of contents generated with `toc:t' -`OPTION' keyword in a `frame' environment. Beamer export does not wrap -the table of contents generated with `TOC' keyword (*note Table of -contents::). Use square brackets for specifying options. - - #+TOC: headlines [currentsection] - - Insert Beamer-specific code using the following constructs: - - #+BEAMER: \pause - - #+BEGIN_EXPORT beamer - Only Beamer export back-end will export this line. - #+END_BEAMER - - Text @@beamer:some code@@ within a paragraph. - - Inline constructs, such as the last one above, are useful for adding -overlay specifications to objects with `bold', `item', `link', -`radio-target' and `target' types. Enclose the value in angular -brackets and place the specification at the beginning the object as -shown in this example: - - A *@@beamer:<2->@@useful* feature - - Beamer export recognizes the `ATTR_BEAMER' keyword with the following -attributes from Beamer configurations: `:environment' for changing local -Beamer environment, `:overlay' for specifying Beamer overlays in angular -or square brackets, and `:options' for inserting optional arguments. - - #+ATTR_BEAMER: :environment nonindentlist - - item 1, not indented - - item 2, not indented - - item 3, not indented - - #+ATTR_BEAMER: :overlay <+-> - - item 1 - - item 2 - - #+ATTR_BEAMER: :options [Lagrange] - Let $G$ be a finite group, and let $H$ be - a subgroup of $G$. Then the order of $H$ divides the order of $G$. - - -File: org, Node: Editing support, Next: A Beamer example, Prev: Beamer specific syntax, Up: Beamer export - -12.8.5 Editing support ----------------------- - -The `org-beamer-mode' is a special minor mode for faster editing of -Beamer documents. - - #+STARTUP: beamer - -`C-c C-b (`org-beamer-select-environment')' - The `org-beamer-mode' provides this key for quicker selections in - Beamer normal environments, and for selecting the `BEAMER_COL' - property. - - -File: org, Node: A Beamer example, Prev: Editing support, Up: Beamer export - -12.8.6 A Beamer example ------------------------ - -Here is an example of an Org document ready for Beamer export. - - #+TITLE: Example Presentation - #+AUTHOR: Carsten Dominik - #+OPTIONS: H:2 toc:t num:t - #+LATEX_CLASS: beamer - #+LATEX_CLASS_OPTIONS: [presentation] - #+BEAMER_THEME: Madrid - #+COLUMNS: %45ITEM %10BEAMER_ENV(Env) %10BEAMER_ACT(Act) %4BEAMER_COL(Col) %8BEAMER_OPT(Opt) - - * This is the first structural section - - ** Frame 1 - *** Thanks to Eric Fraga :B_block: - :PROPERTIES: - :BEAMER_COL: 0.48 - :BEAMER_ENV: block - :END: - for the first viable Beamer setup in Org - *** Thanks to everyone else :B_block: - :PROPERTIES: - :BEAMER_COL: 0.48 - :BEAMER_ACT: <2-> - :BEAMER_ENV: block - :END: - for contributing to the discussion - **** This will be formatted as a beamer note :B_note: - :PROPERTIES: - :BEAMER_env: note - :END: - ** Frame 2 (where we will not use columns) - *** Request - Please test this stuff! - - -File: org, Node: HTML export, Next: LaTeX export, Prev: Beamer export, Up: Exporting - -12.9 HTML export -================ - -Org mode contains an HTML exporter with extensive HTML formatting -compatible with XHTML 1.0 strict standard. - -* Menu: - -* HTML Export commands:: Invoking HTML export -* HTML Specific export settings:: Settings for HTML export -* HTML doctypes:: Exporting various (X)HTML flavors -* HTML preamble and postamble:: Inserting preamble and postamble -* Quoting HTML tags:: Using direct HTML in Org files -* Links in HTML export:: Interpreting and formatting links -* Tables in HTML export:: Formatting and modifying tables -* Images in HTML export:: Inserting figures with HTML output -* Math formatting in HTML export:: Handling math equations -* Text areas in HTML export:: Showing an alternate approach, an example -* CSS support:: Styling HTML output -* JavaScript support:: Folding scripting in the web browser - - -File: org, Node: HTML Export commands, Next: HTML Specific export settings, Up: HTML export - -12.9.1 HTML export commands ---------------------------- - -`C-c C-e h h (`org-html-export-to-html')' - Export as HTML file with a `.html' extension. For `myfile.org', - Org exports to `myfile.html', overwriting without warning. `C-c - C-e h o' Exports to HTML and opens it in a web browser. - -`C-c C-e h H (`org-html-export-as-html')' - Exports to a temporary buffer. Does not create a file. - - -File: org, Node: HTML Specific export settings, Next: HTML doctypes, Prev: HTML Export commands, Up: HTML export - -12.9.2 HTML Specific export settings ------------------------------------- - -HTML export has a number of keywords, similar to the general options -settings described in *note Export settings::. - -`DESCRIPTION' - This is the document's description, which the HTML exporter - inserts it as a HTML meta tag in the HTML file. For long - descriptions, use multiple `#+DESCRIPTION' lines. The exporter - takes care of wrapping the lines properly. - -`HTML_DOCTYPE' - Specify the document type, for example: HTML5 (`org-html-doctype'). - -`HTML_CONTAINER' - Specify the HTML container, such as `div', for wrapping sections - and elements (`org-html-container-element'). - -`HTML_LINK_HOME' - The URL for home link (`org-html-link-home'). - -`HTML_LINK_UP' - The URL for the up link of exported HTML pages - (`org-html-link-up'). - -`HTML_MATHJAX' - Options for MathJax (`org-html-mathjax-options'). MathJax is used - to typeset LaTeX math in HTML documents. *Note Math formatting in - HTML export::, for an example. - -`HTML_HEAD' - Arbitrary lines for appending to the HTML document's head - (`org-html-head'). - -`HTML_HEAD_EXTRA' - More arbitrary lines for appending to the HTML document's head - (`org-html-head-extra'). - -`KEYWORDS' - Keywords to describe the document's content. HTML exporter - inserts these keywords as HTML meta tags. For long keywords, use - multiple `#+KEYWORDS' lines. - -`LATEX_HEADER' - Arbitrary lines for appending to the preamble; HTML exporter - appends when transcoding LaTeX fragments to images (*note Math - formatting in HTML export::). - -`SUBTITLE' - The document's subtitle. HTML exporter formats subtitle if - document type is `HTML5' and the CSS has a `subtitle' class. - - Some of these keywords are explained in more detail in the following -sections of the manual. - - -File: org, Node: HTML doctypes, Next: HTML preamble and postamble, Prev: HTML Specific export settings, Up: HTML export - -12.9.3 HTML doctypes --------------------- - -Org can export to various (X)HTML flavors. - - Set the `org-html-doctype' variable for different (X)HTML variants. -Depending on the variant, the HTML exporter adjusts the syntax of HTML -conversion accordingly. Org includes the following ready-made variants: - - * "html4-strict" - - * "html4-transitional" - - * "html4-frameset" - - * "xhtml-strict" - - * "xhtml-transitional" - - * "xhtml-frameset" - - * "xhtml-11" - - * "html5" - - * "xhtml5" - -See the variable `org-html-doctype-alist' for details. The default is -"xhtml-strict". - - Org's HTML exporter does not by default enable new block elements -introduced with the HTML5 standard. To enable them, set -`org-html-html5-fancy' to non-`nil'. Or use an `OPTIONS' line in the -file to set `html5-fancy'. HTML5 documents can now have arbitrary -`#+BEGIN' and `#+END' blocks. For example: - - #+BEGIN_aside - Lorem ipsum - #+END_aside - - Will export to: - - - - While this: - - #+ATTR_HTML: :controls controls :width 350 - #+BEGIN_video - #+HTML: - #+HTML: - Your browser does not support the video tag. - #+END_video - - Exports to: - - - - When special blocks do not have a corresponding HTML5 element, the -HTML exporter reverts to standard translation (see -`org-html-html5-elements'). For example, `#+BEGIN_lederhosen' exports -to `
'. - - Special blocks cannot have headlines. For the HTML exporter to wrap -the headline and its contents in `
' or `
' tags, set -the `HTML_CONTAINER' property for the headline. - - -File: org, Node: HTML preamble and postamble, Next: Quoting HTML tags, Prev: HTML doctypes, Up: HTML export - -12.9.4 HTML preamble and postamble ----------------------------------- - -The HTML exporter has delineations for preamble and postamble. The -default value for `org-html-preamble' is `t', which makes the HTML -exporter insert the preamble. See the variable -`org-html-preamble-format' for the format string. - - Set `org-html-preamble' to a string to override the default format -string. If the string is a function, the HTML exporter expects the -function to return a string upon execution. The HTML exporter inserts -this string in the preamble. The HTML exporter will not insert a -preamble if `org-html-preamble' is set `nil'. - - The default value for `org-html-postamble' is `auto', which makes -the HTML exporter build a postamble from looking up author's name, email -address, creator's name, and date. Set `org-html-postamble' to `t' to -insert the postamble in the format specified in the -`org-html-postamble-format' variable. The HTML exporter will not insert -a postamble if `org-html-postamble' is set to `nil'. - - -File: org, Node: Quoting HTML tags, Next: Links in HTML export, Prev: HTML preamble and postamble, Up: HTML export - -12.9.5 Quoting HTML tags ------------------------- - -The HTML export back-end transforms `<' and `>' to `<' and `>'. -To include raw HTML code in the Org file so the HTML export back-end -can insert that HTML code in the output, use this inline syntax: -`@@html:'. For example: `@@html:@@bold text@@html:@@'. For -larger raw HTML code blocks, use these HTML export code blocks: - - #+HTML: Literal HTML code for export - -or - - #+BEGIN_EXPORT html - All lines between these markers are exported literally - #+END_EXPORT - - -File: org, Node: Links in HTML export, Next: Tables in HTML export, Prev: Quoting HTML tags, Up: HTML export - -12.9.6 Links in HTML export ---------------------------- - -The HTML export back-end transforms Org's internal links (*note -Internal links::) to equivalent HTML links in the output. The back-end -similarly handles Org's automatic links created by radio targets (*note -Radio targets::) similarly. For Org links to external files, the -back-end transforms the links to _relative_ paths. - - For Org links to other `.org' files, the back-end automatically -changes the file extension to `.html' and makes file paths relative. -If the `.org' files have an equivalent `.html' version at the same -location, then the converted links should work without any further -manual intervention. However, to disable this automatic path -translation, set `org-html-link-org-files-as-html' to `nil'. When -disabled, the HTML export back-end substitutes the `id:'-based links in -the HTML output. For more about linking files when publishing to a -directory, *note Publishing links::. - - Org files can also have special directives to the HTML export -back-end. For example, by using `#+ATTR_HTML' lines to specify new -format attributes to `' or `' tags. This example shows -changing the link's `title' and `style': - - #+ATTR_HTML: :title The Org mode homepage :style color:red; - [[http://orgmode.org]] - - -File: org, Node: Tables in HTML export, Next: Images in HTML export, Prev: Links in HTML export, Up: HTML export - -12.9.7 Tables in HTML export ----------------------------- - -The HTML export back-end uses `org-html-table-default-attributes' when -exporting Org tables to HTML. By default, the exporter does not draw -frames and cell borders. To change for this for a table, use the -following lines before the table in the Org file: - - #+CAPTION: This is a table with lines around and between cells - #+ATTR_HTML: :border 2 :rules all :frame border - - The HTML export back-end preserves column groupings in Org tables -(*note Column groups::) when exporting to HTML. - - Additional options for customizing tables for HTML export. - -`org-html-table-align-individual-fields' - Non-`nil' attaches style attributes for alignment to each table - field. - -`org-html-table-caption-above' - Non-`nil' places caption string at the beginning of the table. - -`org-html-table-data-tags' - Opening and ending tags for table data fields. - -`org-html-table-default-attributes' - Default attributes and values for table tags. - -`org-html-table-header-tags' - Opening and ending tags for table's header fields. - -`org-html-table-row-tags' - Opening and ending tags for table rows. - -`org-html-table-use-header-tags-for-first-column' - Non-`nil' formats column one in tables with header tags. - - -File: org, Node: Images in HTML export, Next: Math formatting in HTML export, Prev: Tables in HTML export, Up: HTML export - -12.9.8 Images in HTML export ----------------------------- - -The HTML export back-end has features to convert Org image links to HTML -inline images and HTML clickable image links. - - When the link in the Org file has no description, the HTML export -back-end by default in-lines that image. For example: -`[[file:myimg.jpg]]' is in-lined, while `[[file:myimg.jpg][the image]]' -links to the text, `the image'. - - For more details, see the variable `org-html-inline-images'. - - On the other hand, if the description part of the Org link is itself -another link, such as `file:' or `http:' URL pointing to an image, the -HTML export back-end in-lines this image and links to the main image. -This Org syntax enables the back-end to link low-resolution thumbnail -to the high-resolution version of the image, as shown in this example: - - [[file:highres.jpg][file:thumb.jpg]] - - To change attributes of in-lined images, use `#+ATTR_HTML' lines in -the Org file. This example shows realignment to right, and adds `alt' -and `title' attributes in support of text viewers and modern web -accessibility standards. - - #+CAPTION: A black cat stalking a spider - #+ATTR_HTML: :alt cat/spider image :title Action! :align right - [[./img/a.jpg]] - -The HTML export back-end copies the `http' links from the Org file as -is. - - -File: org, Node: Math formatting in HTML export, Next: Text areas in HTML export, Prev: Images in HTML export, Up: HTML export - -12.9.9 Math formatting in HTML export -------------------------------------- - -LaTeX math snippets (*note LaTeX fragments::) can be displayed in two -different ways on HTML pages. The default is to use MathJax -(http://www.mathjax.org) which should work out of the box with Org(1). -Some MathJax display options can be configured via -`org-html-mathjax-options', or in the buffer. For example, with the -following settings, - #+HTML_MATHJAX: align: left indent: 5em tagside: left font: Neo-Euler - equation labels will be displayed on the left margin and equations -will be five ems from the left margin. - -See the docstring of `org-html-mathjax-options' for all supported -variables. The MathJax template can be configure via -`org-html-mathjax-template'. - - If you prefer, you can also request that LaTeX fragments are -processed into small images that will be inserted into the browser -page. Before the availability of MathJax, this was the default method -for Org files. This method requires that the `dvipng' program, -`dvisvgm' or `imagemagick' suite is available on your system. You can -still get this processing with - - #+OPTIONS: tex:dvipng - - #+OPTIONS: tex:dvisvgm - - or: - - #+OPTIONS: tex:imagemagick - - ---------- Footnotes ---------- - - (1) By default Org loads MathJax from cdnjs.com (https://cdnjs.com) -as recommended by MathJax (http://www.mathjax.org). - - -File: org, Node: Text areas in HTML export, Next: CSS support, Prev: Math formatting in HTML export, Up: HTML export - -12.9.10 Text areas in HTML export ---------------------------------- - -Before Org mode's Babel, one popular approach to publishing code in -HTML was by using `:textarea'. The advantage of this approach was that -copying and pasting was built into browsers with simple JavaScript -commands. Even editing before pasting was made simple. - - The HTML export back-end can create such text areas. It requires an -`#+ATTR_HTML:' line as shown in the example below with the `:textarea' -option. This must be followed by either an `example' or a `src' code -block. Other Org block types will not honor the `:textarea' option. - - By default, the HTML export back-end creates a text area 80 -characters wide and height just enough to fit the content. Override -these defaults with `:width' and `:height' options on the -`#+ATTR_HTML:' line. - - #+ATTR_HTML: :textarea t :width 40 - #+BEGIN_EXAMPLE - (defun org-xor (a b) - "Exclusive or." - (if a (not b) b)) - #+END_EXAMPLE - - -File: org, Node: CSS support, Next: JavaScript support, Prev: Text areas in HTML export, Up: HTML export - -12.9.11 CSS support -------------------- - -You can modify the CSS style definitions for the exported file. The -HTML exporter assigns the following special CSS classes(1) to -appropriate parts of the document--your style specifications may change -these, in addition to any of the standard classes like for headlines, -tables, etc. - p.author author information, including email - p.date publishing date - p.creator creator info, about org mode version - .title document title - .subtitle document subtitle - .todo TODO keywords, all not-done states - .done the DONE keywords, all states that count as done - .WAITING each TODO keyword also uses a class named after itself - .timestamp timestamp - .timestamp-kwd keyword associated with a timestamp, like SCHEDULED - .timestamp-wrapper span around keyword plus timestamp - .tag tag in a headline - ._HOME each tag uses itself as a class, "@" replaced by "_" - .target target for links - .linenr the line number in a code example - .code-highlighted for highlighting referenced code lines - div.outline-N div for outline level N (headline plus text)) - div.outline-text-N extra div for text at outline level N - .section-number-N section number in headlines, different for each level - .figure-number label like "Figure 1:" - .table-number label like "Table 1:" - .listing-number label like "Listing 1:" - div.figure how to format an in-lined image - pre.src formatted source code - pre.example normal example - p.verse verse paragraph - div.footnotes footnote section headline - p.footnote footnote definition paragraph, containing a footnote - .footref a footnote reference number (always a ) - .footnum footnote number in footnote definition (always ) - .org-svg default class for a linked `.svg' image - - The HTML export back-end includes a compact default style in each -exported HTML file. To override the default style with another style, -use these keywords in the Org file. They will replace the global -defaults the HTML exporter uses. - - #+HTML_HEAD: - #+HTML_HEAD_EXTRA: - - To just turn off the default style, customize -`org-html-head-include-default-style' variable, or use this option line -in the Org file. - - #+OPTIONS: html-style:nil - -For longer style definitions, either use several `#+HTML_HEAD' and -`#+HTML_HEAD_EXTRA' lines, or use `' blocks around -them. Both of these approaches can avoid referring to an external file. - - In order to add styles to a sub-tree, use the -`:HTML_CONTAINER_CLASS:' property to assign a class to the tree. In -order to specify CSS styles for a particular headline, you can use the -id specified in a `:CUSTOM_ID:' property. - - Never change the `org-html-style-default' constant. Instead use -other simpler ways of customizing as described above. - - ---------- Footnotes ---------- - - (1) If the classes on TODO keywords and tags lead to conflicts, use -the variables `org-html-todo-kwd-class-prefix' and -`org-html-tag-class-prefix' to make them unique. - - -File: org, Node: JavaScript support, Prev: CSS support, Up: HTML export - -12.9.12 JavaScript supported display of web pages -------------------------------------------------- - -Sebastian Rose has written a JavaScript program especially designed to -enhance the web viewing experience of HTML files created with Org. This -program enhances large files in two different ways of viewing. One is -an _Info_-like mode where each section is displayed separately and -navigation can be done with the `n' and `p' keys (and some other keys -as well, press `?' for an overview of the available keys). The second -one has a _folding_ view, much like Org provides inside Emacs. The -script is available at `http://orgmode.org/org-info.js' and the -documentation at `http://orgmode.org/worg/code/org-info-js/'. The -script is hosted on `http://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: - - #+INFOJS_OPT: view:info toc:nil - -The HTML header now has the code needed to automatically invoke the -script. For setting options, use the syntax from the above line for -options described below: - - path: The path to the script. The default grabs the script from - `http://orgmode.org/org-info.js', but you might want to have - a local copy and use a path like `../scripts/org-info.js'. - view: Initial view when the website is first shown. Possible values are: - info Info-like interface with one section per page. - overview Folding interface, initially showing only top-level. - content Folding interface, starting with all headlines visible. - showall Folding interface, all headlines and text visible. - sdepth: Maximum headline level that will still become an independent - section for info and folding modes. The default is taken from - `org-export-headline-levels' (= the `H' switch in `#+OPTIONS'). - If this is smaller than in `org-export-headline-levels', each - info/folding section can still contain child headlines. - toc: Should the table of contents _initially_ be visible? - Even when `nil', you can always get to the "toc" with `i'. - tdepth: The depth of the table of contents. The defaults are taken from - the variables `org-export-headline-levels' and `org-export-with-toc'. - ftoc: Does the CSS of the page specify a fixed position for the "toc"? - If yes, the toc will never be displayed as a section. - ltoc: Should there be short contents (children) in each section? - Make this `above' if the section should be above initial text. - mouse: Headings are highlighted when the mouse is over them. Should be - `underline' (default) or a background color like `#cccccc'. - buttons: Should view-toggle buttons be everywhere? When `nil' (the - default), only one such button will be present. - You can choose default values for these options by customizing the -variable `org-html-infojs-options'. If you want the script to always -apply to your pages, configure the variable `org-html-use-infojs'. - - -File: org, Node: LaTeX export, Next: Markdown export, Prev: HTML export, Up: Exporting - -12.10 LaTeX export -================== - -The LaTeX export back-end can handle complex documents, incorporate -standard or custom LaTeX document classes, generate documents using -alternate LaTeX engines, and produce fully linked PDF files with -indexes, bibliographies, and tables of contents, destined for -interactive online viewing or high-quality print publication. - - While the details are covered in-depth in this section, here are -some quick references to variables for the impatient: for engines, see -`org-latex-compiler'; for build sequences, see `org-latex-pdf-process'; -for packages, see `org-latex-default-packages-alist' and -`org-latex-packages-alist'. - - An important note about the LaTeX export back-end: it is sensitive to -blank lines in the Org document. That's because LaTeX itself depends on -blank lines to tell apart syntactical elements, such as paragraphs. - -* Menu: - -* LaTeX export commands:: For producing LaTeX and PDF documents. -* LaTeX specific export settings:: Unique to this LaTeX back-end. -* LaTeX header and sectioning:: For file structure. -* Quoting LaTeX code:: Directly in the Org document. -* Tables in LaTeX export:: Attributes specific to tables. -* Images in LaTeX export:: Attributes specific to images. -* Plain lists in LaTeX export:: Attributes specific to lists. -* Source blocks in LaTeX export:: Attributes specific to source code blocks. -* Example blocks in LaTeX export:: Attributes specific to example blocks. -* Special blocks in LaTeX export:: Attributes specific to special blocks. -* Horizontal rules in LaTeX export:: Attributes specific to horizontal rules. - - -File: org, Node: LaTeX export commands, Next: LaTeX specific export settings, Up: LaTeX export - -12.10.1 LaTeX export commands ------------------------------ - -`C-c C-e l l (`org-latex-export-to-latex')' - Export as LaTeX file with a `.tex' extension. For `myfile.org', - Org exports to `myfile.tex', overwriting without warning. `C-c C-e - l l' Exports to LaTeX file. - -`C-c C-e l L (`org-latex-export-as-latex')' - Export to a temporary buffer. Do not create a file. - -`C-c C-e l p (`org-latex-export-to-pdf')' - Export as LaTeX file and convert it to PDF file. - -`C-c C-e l o' - Export as LaTeX file and convert it to PDF, then open the PDF - using the default viewer. - - The LaTeX export back-end can use any of these LaTeX engines: -`pdflatex', `xelatex', and `lualatex'. These engines compile LaTeX -files with different compilers, packages, and output options. The -LaTeX export back-end finds the compiler version to use from -`org-latex-compiler' variable or the `#+LATEX_COMPILER' keyword in the -Org file. See the docstring for the `org-latex-default-packages-alist' -for loading packages with certain compilers. Also see -`org-latex-bibtex-compiler' to set the bibliography compiler(1). - - ---------- Footnotes ---------- - - (1) This does not allow setting different bibliography compilers for -different files. However, "smart" LaTeX compilation systems, such as -`latexmk', can select the correct bibliography compiler. - - -File: org, Node: LaTeX specific export settings, Next: LaTeX header and sectioning, Prev: LaTeX export commands, Up: LaTeX export - -12.10.2 LaTeX specific export settings --------------------------------------- - -The LaTeX export back-end has several additional keywords for -customizing LaTeX output. Setting these keywords works similar to the -general options (*note Export settings::). - -`DESCRIPTION' - The document's description. The description along with author - name, keywords, and related file metadata are inserted in the - output file by the `hyperref' package. See - `org-latex-hyperref-template' for customizing metadata items. See - `org-latex-title-command' for typesetting description into the - document's front matter. Use multiple `#+DESCRIPTION' lines for - long descriptions. - -`LATEX_CLASS' - This is LaTeX document class, such as `article', `report', `book', - and so on, which contain predefined preamble and headline level - mapping that the LaTeX export back-end needs. The back-end reads - the default class name from the `org-latex-default-class' - variable. Org has `article' as the default class. A valid - default class must be an element of `org-latex-classes'. - -`LATEX_CLASS_OPTIONS' - Options the LaTeX export back-end uses when calling the LaTeX - document class. - -`LATEX_COMPILER' - The compiler, such as `pdflatex', `xelatex', `lualatex', for - producing the PDF (`org-latex-compiler'). - -`LATEX_HEADER' - Arbitrary lines to add to the document's preamble, before the - `hyperref' settings. See `org-latex-classes' for adjusting the - structure and order of the LaTeX headers. - -`LATEX_HEADER_EXTRA' - Arbitrary lines to add to the document's preamble, before the - `hyperref' settings. See `org-latex-classes' for adjusting the - structure and order of the LaTeX headers. - -`KEYWORDS' - The keywords for the document. The description along with author - name, keywords, and related file metadata are inserted in the - output file by the `hyperref' package. See - `org-latex-hyperref-template' for customizing metadata items. See - `org-latex-title-command' for typesetting description into the - document's front matter. Use multiple `#+KEYWORDS' lines if - necessary. - -`SUBTITLE' - The document's subtitle. It is typeset as per - `org-latex-subtitle-format'. If `org-latex-subtitle-separate' is - non-`nil', it is typed as part of the `\title'-macro. See - `org-latex-hyperref-template' for customizing metadata items. See - `org-latex-title-command' for typesetting description into the - document's front matter. - - The following sections have further details. - - -File: org, Node: LaTeX header and sectioning, Next: Quoting LaTeX code, Prev: LaTeX specific export settings, Up: LaTeX export - -12.10.3 LaTeX header and sectioning structure ---------------------------------------------- - -The LaTeX export back-end converts the first three of Org's outline -levels into LaTeX headlines. The remaining Org levels are exported as -`itemize' or `enumerate' lists. To change this globally for the -cut-off point between levels and lists, (*note Export settings::). - - By default, the LaTeX export back-end uses the `article' class. - - To change the default class globally, edit `org-latex-default-class'. -To change the default class locally in an Org file, add option lines -`#+LATEX_CLASS: myclass'. To change the default class for just a part -of the Org file, set a sub-tree property, `EXPORT_LATEX_CLASS'. The -class name entered here must be valid member of `org-latex-classes'. -This variable defines a header template for each class into which the -exporter splices the values of `org-latex-default-packages-alist' and -`org-latex-packages-alist'. Use the same three variables to define -custom sectioning or custom classes. - - The LaTeX export back-end sends the `LATEX_CLASS_OPTIONS' keyword and -`EXPORT_LATEX_CLASS_OPTIONS' property as options to the LaTeX -`\documentclass' macro. The options and the syntax for specifying them, -including enclosing them in square brackets, follow LaTeX conventions. - - #+LATEX_CLASS_OPTIONS: [a4paper,11pt,twoside,twocolumn] - - The LaTeX export back-end appends values from `LATEX_HEADER' and -`LATEX_HEADER_EXTRA' keywords to the LaTeX header. The docstring for -`org-latex-classes' explains in more detail. Also note that LaTeX -export back-end does not append `LATEX_HEADER_EXTRA' to the header when -previewing LaTeX snippets (*note Previewing LaTeX fragments::). - - A sample Org file with the above headers: - - #+LATEX_CLASS: article - #+LATEX_CLASS_OPTIONS: [a4paper] - #+LATEX_HEADER: \usepackage{xyz} - - * Headline 1 - some text - * Headline 2 - some more text - - -File: org, Node: Quoting LaTeX code, Next: Tables in LaTeX export, Prev: LaTeX header and sectioning, Up: LaTeX export - -12.10.4 Quoting LaTeX code --------------------------- - -The LaTeX export back-end can insert any arbitrary LaTeX code, *note -Embedded LaTeX::. There are three ways to embed such code in the Org -file and they all use different quoting syntax. - - Inserting in-line quoted with symbols: - Code embedded in-line @@latex:any arbitrary LaTeX code@@ in a paragraph. - - Inserting as one or more keyword lines in the Org file: - #+LATEX: any arbitrary LaTeX code - - Inserting as an export block in the Org file, where the back-end -exports any code between begin and end markers: - #+BEGIN_EXPORT latex - any arbitrary LaTeX code - #+END_EXPORT - - -File: org, Node: Tables in LaTeX export, Next: Images in LaTeX export, Prev: Quoting LaTeX code, Up: LaTeX export - -12.10.5 Tables in LaTeX export ------------------------------- - -The LaTeX export back-end can pass several LaTeX attributes for table -contents and layout. Besides specifying label and caption (*note -Images and tables::), the other valid LaTeX attributes include: - -`:mode' - The LaTeX export back-end wraps the table differently depending on - the mode for accurate rendering of math symbols. Mode is either - `table', `math', `inline-math' or `verbatim'. For `math' or - `inline-math' mode, LaTeX export back-end wraps the table in a math - environment, but every cell in it is exported as-is. The LaTeX - export back-end determines the default mode from - `org-latex-default-table-mode'. For , The LaTeX export back-end - merges contiguous tables in the same mode into a single - environment. - -`:environment' - Set the default LaTeX table environment for the LaTeX export - back-end to use when exporting Org tables. Common LaTeX table - environments are provided by these packages: `tabularx', - `longtable', `array', `tabu', and `bmatrix'. For packages, such - as `tabularx' and `tabu', or any newer replacements, include them - in the `org-latex-packages-alist' variable so the LaTeX export - back-end can insert the appropriate load package headers in the - converted LaTeX file. Look in the docstring for the - `org-latex-packages-alist' variable for configuring these packages - for LaTeX snippet previews, if any. - -`:caption' - Use `#+CAPTION' keyword to set a simple caption for a table (*note - Images and tables::). For custom captions, use `:caption' - attribute, which accepts raw LaTeX code. `:caption' value - overrides `#+CAPTION' value. - -`:float' -`:placement' - The table environments by default are not floats in LaTeX. To - make them floating objects use `:float' with one of the following - options: `sideways', `multicolumn', `t', and `nil'. Note that - `sidewaystable' has been deprecated since Org 8.3. LaTeX floats - can also have additional layout `:placement' attributes. These - are the usual `[h t b p ! H]' permissions specified in square - brackets. Note that for `:float sideways' tables, the LaTeX - export back-end ignores `:placement' attributes. - -`:align' -`:font' -`:width' - The LaTeX export back-end uses these attributes for regular tables - to set their alignments, fonts, and widths. - -`:spread' - When `:spread' is non-`nil', the LaTeX export back-end spreads or - shrinks the table by the `:width' for `tabu' and `longtabu' - environments. `:spread' has no effect if `:width' is not set. - -`:booktabs' -`:center' -`:rmlines' - All three commands are toggles. `:booktabs' brings in modern - typesetting enhancements to regular tables. The `booktabs' - package has to be loaded through `org-latex-packages-alist'. - `:center' is for centering the table. `:rmlines' removes all but - the very first horizontal line made of ASCII characters from - "table.el" tables only. - -`:math-prefix' -`:math-suffix' -`:math-arguments' - The LaTeX export back-end inserts `:math-prefix' string value in a - math environment before the table. The LaTeX export back-end - inserts `:math-suffix' string value in a math environment after - the table. The LaTeX export back-end inserts `:math-arguments' - string value between the macro name and the table's contents. - `:math-arguments' comes in use for matrix macros that require more - than one argument, such as `qbordermatrix'. - - LaTeX table attributes help formatting tables for a wide range of -situations, such as matrix product or spanning multiple pages: - - #+ATTR_LATEX: :environment longtable :align l|lp{3cm}r|l - | ..... | ..... | - | ..... | ..... | - - #+ATTR_LATEX: :mode math :environment bmatrix :math-suffix \times - | a | b | - | c | d | - #+ATTR_LATEX: :mode math :environment bmatrix - | 1 | 2 | - | 3 | 4 | - - Set the caption with the LaTeX command -`\bicaption{HeadingA}{HeadingB}': - - #+ATTR_LATEX: :caption \bicaption{HeadingA}{HeadingB} - | ..... | ..... | - | ..... | ..... | - - -File: org, Node: Images in LaTeX export, Next: Plain lists in LaTeX export, Prev: Tables in LaTeX export, Up: LaTeX export - -12.10.6 Images in LaTeX export ------------------------------- - -The LaTeX export back-end processes image links in Org files that do not -have descriptions, such as these links `[[file:img.jpg]]' or -`[[./img.jpg]]', as direct image insertions in the final PDF output. In -the PDF, they are no longer links but actual images embedded on the -page. The LaTeX export back-end uses `\includegraphics' macro to -insert the image. But for TikZ(1) images, the back-end uses an -`\input' macro wrapped within a `tikzpicture' environment. - - For specifying image `:width', `:height', and other `:options', use -this syntax: - - #+ATTR_LATEX: :width 5cm :options angle=90 - [[./img/sed-hr4049.pdf]] - - For custom commands for captions, use the `:caption' attribute. It -will override the default `#+CAPTION' value: - - #+ATTR_LATEX: :caption \bicaption{HeadingA}{HeadingB} - [[./img/sed-hr4049.pdf]] - - When captions follow the method as described in *note Images and -tables::, the LaTeX export back-end wraps the picture in a floating -`figure' environment. To float an image without specifying a caption, -set the `:float' attribute to one of the following: - - `t': for a standard `figure' environment; used by default whenever - an image has a caption. - - - `multicolumn': to span the image across multiple columns of a - page; the back-end wraps the image in a `figure*' environment. - - - `wrap': for text to flow around the image on the right; the figure - occupies the left half of the page. - - - `sideways': for a new page with the image sideways, rotated ninety - degrees, in a `sidewaysfigure' environment; overrides `:placement' - setting. - - - `nil': to avoid a `:float' even if using a caption. - Use the `placement' attribute to modify a floating environment's -placement. - - #+ATTR_LATEX: :float wrap :width 0.38\textwidth :placement - {r}{0.4\textwidth} [[./img/hst.png]] - - The LaTeX export back-end centers all images by default. Setting -`:center' attribute to `nil' disables centering. To disable centering -globally, set `org-latex-images-centered' to `t'. - - Set the `:comment-include' attribute to non-`nil' value for the -LaTeX export back-end to comment out the `\includegraphics' macro. - - ---------- Footnotes ---------- - - (1) `http://sourceforge.net/projects/pgf/' - - -File: org, Node: Plain lists in LaTeX export, Next: Source blocks in LaTeX export, Prev: Images in LaTeX export, Up: LaTeX export - -12.10.7 Plain lists in LaTeX export ------------------------------------ - -The LaTeX export back-end accepts the `:environment' and `:options' -attributes for plain lists. Both attributes work together for -customizing lists, as shown in the examples: - - #+LATEX_HEADER: \usepackage[inline]{enumitem} - Some ways to say "Hello": - #+ATTR_LATEX: :environment itemize* - #+ATTR_LATEX: :options [label={}, itemjoin={,}, itemjoin*={, and}] - - Hola - - Bonjour - - Guten Tag. - - Since LaTeX supports only four levels of nesting for lists, use an -external package, such as `enumitem' in LaTeX, for levels deeper than -four: - - #+LATEX_HEADER: \usepackage{enumitem} - #+LATEX_HEADER: \renewlist{itemize}{itemize}{9} - #+LATEX_HEADER: \setlist[itemize]{label=$\circ$} - - One - - Two - - Three - - Four - - Five - - -File: org, Node: Source blocks in LaTeX export, Next: Example blocks in LaTeX export, Prev: Plain lists in LaTeX export, Up: LaTeX export - -12.10.8 Source blocks in LaTeX export -------------------------------------- - -The LaTeX export back-end can make source code blocks into floating -objects through the attributes `:float' and `:options'. For `:float': - - - `t': makes a source block float; by default floats any source - block with a caption. - - - `multicolumn': spans the source block across multiple columns of a - page. - - - `nil': avoids a `:float' even if using a caption; useful for - source code blocks that may not fit on a page. - - #+ATTR_LATEX: :float nil - #+BEGIN_SRC emacs-lisp - Lisp code that may not fit in a single page. - #+END_SRC - - The LaTeX export back-end passes string values in `:options' to -LaTeX packages for customization of that specific source block. In the -example below, the `:options' are set for Minted. Minted is a source -code highlighting LaTeXpackage with many configurable options. - - #+ATTR_LATEX: :options commentstyle=\bfseries - #+BEGIN_SRC emacs-lisp - (defun Fib (n) - (if (< n 2) n (+ (Fib (- n 1)) (Fib (- n 2))))) - #+END_SRC - - To apply similar configuration options for all source blocks in a -file, use the `org-latex-listings-options' and -`org-latex-minted-options' variables. - - -File: org, Node: Example blocks in LaTeX export, Next: Special blocks in LaTeX export, Prev: Source blocks in LaTeX export, Up: LaTeX export - -12.10.9 Example blocks in LaTeX export --------------------------------------- - -The LaTeX export back-end wraps the contents of example blocks in a -`verbatim' environment. To change this behavior to use another -environment globally, specify an appropriate export filter (*note -Advanced configuration::). To change this behavior to use another -environment for each block, use the `:environment' parameter to specify -a custom environment. - - #+ATTR_LATEX: :environment myverbatim - #+BEGIN_EXAMPLE - This sentence is false. - #+END_EXAMPLE - - -File: org, Node: Special blocks in LaTeX export, Next: Horizontal rules in LaTeX export, Prev: Example blocks in LaTeX export, Up: LaTeX export - -12.10.10 Special blocks in LaTeX export ---------------------------------------- - -For other special blocks in the Org file, the LaTeX export back-end -makes a special environment of the same name. The back-end also takes -`:options', if any, and appends as-is to that environment's opening -string. For example: - - #+BEGIN_abstract - We demonstrate how to solve the Syracuse problem. - #+END_abstract - - #+ATTR_LATEX: :options [Proof of important theorem] - #+BEGIN_proof - ... - Therefore, any even number greater than 2 is the sum of two primes. - #+END_proof - -exports to - - \begin{abstract} - We demonstrate how to solve the Syracuse problem. - \end{abstract} - - \begin{proof}[Proof of important theorem] - ... - Therefore, any even number greater than 2 is the sum of two primes. - \end{proof} - - If you need to insert a specific caption command, use `:caption' -attribute. It will override standard `#+CAPTION' value, if any. For -example: - - #+ATTR_LATEX: :caption \MyCaption{HeadingA} - #+BEGIN_proof - ... - #+END_proof - - -File: org, Node: Horizontal rules in LaTeX export, Prev: Special blocks in LaTeX export, Up: LaTeX export - -12.10.11 Horizontal rules in LaTeX export ------------------------------------------ - -The LaTeX export back-end converts horizontal rules by the specified -`:width' and `:thickness' attributes. For example: - - #+ATTR_LATEX: :width .6\textwidth :thickness 0.8pt - ----- - - -File: org, Node: Markdown export, Next: OpenDocument Text export, Prev: LaTeX export, Up: Exporting - -12.11 Markdown export -===================== - -The Markdown export back-end, `md', converts an Org file to a Markdown -format, as defined at `http://daringfireball.net/projects/markdown/'. - - Since `md' is built on top of the HTML back-end, any Org constructs -not supported by Markdown, such as tables, the underlying `html' -back-end (*note HTML export::) converts them. - -Markdown export commands ------------------------- - -`C-c C-e m m (`org-md-export-to-markdown')' - Export to a text file with Markdown syntax. For `myfile.org', Org - exports to `myfile.md', overwritten without warning. - -`C-c C-e m M (`org-md-export-as-markdown')' - Export to a temporary buffer. Does not create a file. - -`C-c C-e m o' - Export as a text file with Markdown syntax, then open it. - -Header and sectioning structure -------------------------------- - -Based on `org-md-headline-style', markdown export can generate headlines -of both `atx' and `setext' types. `atx' limits headline levels to two. -`setext' limits headline levels to six. Beyond these limits, the -export back-end converts headlines to lists. To set a limit to a level -before the absolute limit (*note Export settings::). - - -File: org, Node: OpenDocument Text export, Next: Org export, Prev: Markdown export, Up: Exporting - -12.12 OpenDocument Text export -============================== - -The ODT export back-end handles creating of OpenDocument Text (ODT) -format files. The format complies with `OpenDocument-v1.2 -specification'(1) and is compatible with LibreOffice 3.4. - -* Menu: - -* Pre-requisites for ODT export:: Required packages. -* ODT export commands:: Invoking export. -* ODT specific export settings:: Configuration options. -* Extending ODT export:: Producing `.doc', `.pdf' files. -* Applying custom styles:: Styling the output. -* Links in ODT export:: Handling and formatting links. -* Tables in ODT export:: Org table conversions. -* Images in ODT export:: Inserting images. -* Math formatting in ODT export:: Formatting LaTeX fragments. -* Labels and captions in ODT export:: Rendering objects. -* Literal examples in ODT export:: For source code and example blocks. -* Advanced topics in ODT export:: For power users. - - ---------- Footnotes ---------- - - (1) Open Document Format for Office Applications (OpenDocument) -Version 1.2 -(http://docs.oasis-open.org/office/v1.2/OpenDocument-v1.2.html) - - -File: org, Node: Pre-requisites for ODT export, Next: ODT export commands, Up: OpenDocument Text export - -12.12.1 Pre-requisites for ODT export -------------------------------------- - -The ODT export back-end relies on the `zip' program to create the final -compressed ODT output. Check if `zip' is locally available and -executable. Without `zip', export cannot finish. - - -File: org, Node: ODT export commands, Next: ODT specific export settings, Prev: Pre-requisites for ODT export, Up: OpenDocument Text export - -12.12.2 ODT export commands ---------------------------- - -`C-c C-e o o (`org-odt-export-to-odt')' - Export as OpenDocument Text file. - - If `org-odt-preferred-output-format' is specified, the ODT export - back-end automatically converts the exported file to that format. - *Note Automatically exporting to other formats: - x-export-to-other-formats. - - For `myfile.org', Org exports to `myfile.odt', overwriting without - warning. The ODT export back-end exports a region only if a - region was active. Note for exporting active regions, the - `transient-mark-mode' has to be turned on. - - If the selected region is a single tree, the ODT export back-end - makes the tree head the document title. Incidentally, `C-c @' - selects the current sub-tree. If the tree head entry has, or - inherits, an `EXPORT_FILE_NAME' property, the ODT export back-end - uses that for file name. - - `C-c C-e o O' Export to an OpenDocument Text file format and open - it. - - When `org-odt-preferred-output-format' is specified, open the - converted file instead. *Note Automatically exporting to other - formats: x-export-to-other-formats. - - -File: org, Node: ODT specific export settings, Next: Extending ODT export, Prev: ODT export commands, Up: OpenDocument Text export - -12.12.3 ODT specific export settings ------------------------------------- - -The ODT export back-end has several additional keywords for customizing -ODT output. Setting these keywords works similar to the general options -(*note Export settings::). - -`DESCRIPTION' - This is the document's description, which the ODT export back-end - inserts as document metadata. For long descriptions, use multiple - `#+DESCRIPTION' lines. - -`KEYWORDS' - The keywords for the document. The ODT export back-end inserts the - description along with author name, keywords, and related file - metadata as metadata in the output file. Use multiple - `#+KEYWORDS' lines if necessary. - -`ODT_STYLES_FILE' - The ODT export back-end uses the `org-odt-styles-file' by default. - See *note Applying custom styles:: for details. - -`SUBTITLE' - The document subtitle. - - -File: org, Node: Extending ODT export, Next: Applying custom styles, Prev: ODT specific export settings, Up: OpenDocument Text export - -12.12.4 Extending ODT export ----------------------------- - -The ODT export back-end can produce documents in other formats besides -ODT using a specialized ODT converter process. Its common interface -works with popular converters to produce formats such as `doc', or -convert a document from one format, say `csv', to another format, say -`xls'. - - Customize `org-odt-convert-process' variable to point to `unoconv', -which is the ODT's preferred converter. Working installations of -LibreOffice would already have `unoconv' installed. Alternatively, -other converters may be substituted here. *Note Configuring a document -converter::. - -Automatically exporting to other formats -........................................ - -If ODT format is just an intermediate step to get to other formats, -such as `doc', `docx', `rtf', or `pdf', etc., then extend the ODT -export back-end to directly produce that format. Specify the final -format in the `org-odt-preferred-output-format' variable. This is one -way to extend (*note Exporting to ODT: x-export-to-odt.). - -Converting between document formats -................................... - -The Org export back-end is made to be inter-operable with a wide range -of text document format converters. Newer generation converters, such -as LibreOffice and Pandoc, can handle hundreds of formats at once. Org -provides a consistent interaction with whatever converter is installed. -Here are some generic commands: - -`M-x org-odt-convert RET' - Convert an existing document from one format to another. With a - prefix argument, opens the newly produced file. - - -File: org, Node: Applying custom styles, Next: Links in ODT export, Prev: Extending ODT export, Up: OpenDocument Text export - -12.12.5 Applying custom styles ------------------------------- - -The ODT export back-end comes with many OpenDocument styles (*note -Working with OpenDocument style files::). To expand or further -customize these built-in style sheets, either edit the style sheets -directly or generate them using an application such as LibreOffice. -The example here shows creating a style using LibreOffice. - -Applying custom styles: the easy way -.................................... - - 1. Create a sample `example.org' file with settings as shown below, - and export it to ODT format. - - #+OPTIONS: H:10 num:t - - 2. Open the above `example.odt' using LibreOffice. Use the `Stylist' - to locate the target styles, which typically have the `Org' prefix. - Open one, modify, and save as either OpenDocument Text (`.odt') or - OpenDocument Template (`.ott') file. - - 3. Customize the variable `org-odt-styles-file' and point it to the - newly created file. For additional configuration options *note - Overriding factory styles: x-overriding-factory-styles. - - To apply and ODT style to a particular file, use the - `#+ODT_STYLES_FILE' option as shown in the example below: - - #+ODT_STYLES_FILE: "/path/to/example.ott" - - or - - #+ODT_STYLES_FILE: ("/path/to/file.ott" ("styles.xml" "image/hdr.png")) - - -Using third-party styles and templates -...................................... - -The ODT export back-end relies on many templates and style names. Using -third-party styles and templates can lead to mismatches. Templates -derived from built in ODT templates and styles seem to have fewer -problems. - - -File: org, Node: Links in ODT export, Next: Tables in ODT export, Prev: Applying custom styles, Up: OpenDocument Text export - -12.12.6 Links in ODT export ---------------------------- - -ODT export back-end creates native cross-references for internal links -and Internet-style links for all other link types. - - A link with no description and pointing to a -regular--un-itemized--outline heading is replaced with a -cross-reference and section number of the heading. - - A `\ref{label}'-style reference to an image, table etc. is replaced -with a cross-reference and sequence number of the labeled entity. -*Note Labels and captions in ODT export::. - - -File: org, Node: Tables in ODT export, Next: Images in ODT export, Prev: Links in ODT export, Up: OpenDocument Text export - -12.12.7 Tables in ODT export ----------------------------- - -The ODT export back-end handles native Org mode tables (*note Tables::) -and simple `table.el' tables. Complex `table.el' tables having column -or row spans are not supported. Such tables are stripped from the -exported document. - - By default, the ODT export back-end exports a table with top and -bottom frames and with ruled lines separating row and column groups -(*note Column groups::). All tables are typeset to occupy the same -width. The ODT export back-end honors any table alignments and -relative widths for columns (*note Column width and alignment::). - - Note that the ODT export back-end interprets column widths as -weighted ratios, the default weight being 1. - - Specifying `:rel-width' property on an `#+ATTR_ODT' line controls -the width of the table. For example: - - #+ATTR_ODT: :rel-width 50 - | Area/Month | Jan | Feb | Mar | Sum | - |---------------+-------+-------+-------+-------| - | / | < | | | < | - | | | | | | - | North America | 1 | 21 | 926 | 948 | - | Middle East | 6 | 75 | 844 | 925 | - | Asia Pacific | 9 | 27 | 790 | 826 | - |---------------+-------+-------+-------+-------| - | Sum | 16 | 123 | 2560 | 2699 | - - On export, the above table takes 50% of text width area. The -exporter sizes the columns in the ratio: 13:5:5:5:6. The first column -is left-aligned and rest of the columns, right-aligned. Vertical rules -separate the header and the last column. Horizontal rules separate the -header and the last row. - - For even more customization, create custom table styles and -associate them with a table using the `#+ATTR_ODT' line. *Note -Customizing tables in ODT export::. - - -File: org, Node: Images in ODT export, Next: Math formatting in ODT export, Prev: Tables in ODT export, Up: OpenDocument Text export - -12.12.8 Images in ODT export ----------------------------- - -Embedding images -................ - -The ODT export back-end processes image links in Org files that do not -have descriptions, such as these links `[[file:img.jpg]]' or -`[[./img.jpg]]', as direct image insertions in the final output. Either -of these examples works: - - [[file:img.png]] - - [[./img.png]] - -Embedding clickable images -.......................... - -For clickable images, provide a link whose description is another link -to an image file. For example, to embed a image `org-mode-unicorn.png' -which when clicked jumps to `http://Orgmode.org' website, do the -following - - [[http://orgmode.org][./org-mode-unicorn.png]] - -Sizing and scaling of embedded images -..................................... - -Control the size and scale of the embedded images with the `#+ATTR_ODT' -attribute. - - The ODT export back-end starts with establishing the size of the -image in the final document. The dimensions of this size is measured -in centimeters. The back-end then queries the image file for its -dimensions measured in pixels. For this measurement, the back-end -relies on ImageMagick's `identify' program or Emacs `create-image' and -`image-size' API. ImageMagick is the preferred choice for large file -sizes or frequent batch operations. The back-end then converts the -pixel dimensions using `org-odt-pixels-per-inch' into the familiar 72 -dpi or 96 dpi. The default value for this is in -`display-pixels-per-inch', which can be tweaked for better results -based on the capabilities of the output device. Here are some common -image scaling operations: - -Explicitly size the image - To embed `img.png' as a 10 cm x 10 cm image, do the following: - - #+ATTR_ODT: :width 10 :height 10 - [[./img.png]] - -Scale the image - To embed `img.png' at half its size, do the following: - - #+ATTR_ODT: :scale 0.5 - [[./img.png]] - -Scale the image to a specific width - To embed `img.png' with a width of 10 cm while retaining the - original height:width ratio, do the following: - - #+ATTR_ODT: :width 10 - [[./img.png]] - -Scale the image to a specific height - To embed `img.png' with a height of 10 cm while retaining the - original height:width ratio, do the following - - #+ATTR_ODT: :height 10 - [[./img.png]] - -Anchoring of images -................... - -The ODT export back-end can anchor images to `"as-char"', -`"paragraph"', or `"page"'. Set the preferred anchor using the -`:anchor' property of the `#+ATTR_ODT' line. - - To create an image that is anchored to a page: - #+ATTR_ODT: :anchor "page" - [[./img.png]] - - -File: org, Node: Math formatting in ODT export, Next: Labels and captions in ODT export, Prev: Images in ODT export, Up: OpenDocument Text export - -12.12.9 Math formatting in ODT export -------------------------------------- - -The ODT export back-end has special support built-in for handling math. - -* Menu: - -* Working with LaTeX math snippets:: Embedding in LaTeX format. -* Working with MathML or OpenDocument formula files:: Embedding in native format. - - -File: org, Node: Working with LaTeX math snippets, Next: Working with MathML or OpenDocument formula files, Up: Math formatting in ODT export - -Working with LaTeX math snippets -................................ - -LaTeX math snippets (*note LaTeX fragments::) can be embedded in an ODT -document in one of the following ways: - - 1. MathML - - Add this line to the Org file. This option is activated on a - per-file basis. - - #+OPTIONS: LaTeX:t - - With this option, LaTeX fragments are first converted into MathML - fragments using an external LaTeX-to-MathML converter program. The - resulting MathML fragments are then embedded as an OpenDocument - Formula in the exported document. - - To specify the LaTeX-to-MathML converter, customize the variables - `org-latex-to-mathml-convert-command' and - `org-latex-to-mathml-jar-file'. - - To use MathToWeb(1) as the preferred converter, configure the - above variables as - - (setq org-latex-to-mathml-convert-command - "java -jar %j -unicode -force -df %o %I" - org-latex-to-mathml-jar-file - "/path/to/mathtoweb.jar") - To use LaTeXML(2) use - (setq org-latex-to-mathml-convert-command - "latexmlmath \"%i\" --presentationmathml=%o") - - To quickly verify the reliability of the LaTeX-to-MathML - converter, use the following commands: - - `M-x org-odt-export-as-odf RET' - Convert a LaTeX math snippet to an OpenDocument formula - (`.odf') file. - - `M-x org-odt-export-as-odf-and-open RET' - Convert a LaTeX math snippet to an OpenDocument formula - (`.odf') file and open the formula file with the - system-registered application. - - 2. PNG images - - Add this line to the Org file. This option is activated on a - per-file basis. - - #+OPTIONS: tex:dvipng - - #+OPTIONS: tex:dvisvgm - - or: - - #+OPTIONS: tex:imagemagick - - Under this option, LaTeX fragments are processed into PNG or SVG - images and the resulting images are embedded in the exported - document. This method requires `dvipng' program, `dvisvgm' or - `imagemagick' programs. - - ---------- Footnotes ---------- - - (1) See MathToWeb -(http://www.mathtoweb.com/cgi-bin/mathtoweb_home.pl). - - (2) See `http://dlmf.nist.gov/LaTeXML/'. - - -File: org, Node: Working with MathML or OpenDocument formula files, Prev: Working with LaTeX math snippets, Up: Math formatting in ODT export - -Working with MathML or OpenDocument formula files -................................................. - -When embedding LaTeX math snippets in ODT documents is not reliable, -there is one more option to try. Embed an equation by linking to its -MathML (`.mml') source or its OpenDocument formula (`.odf') file as -shown below: - - [[./equation.mml]] - - or - - [[./equation.odf]] - - -File: org, Node: Labels and captions in ODT export, Next: Literal examples in ODT export, Prev: Math formatting in ODT export, Up: OpenDocument Text export - -12.12.10 Labels and captions in ODT export ------------------------------------------- - -ODT format handles labeling and captioning of objects based on their -types. Inline images, tables, LaTeX fragments, and Math formulas are -numbered and captioned separately. Each object also gets a unique -sequence number based on its order of first appearance in the Org file. -Each category has its own sequence. A caption is just a label applied -to these objects. - - #+CAPTION: Bell curve - #+LABEL: fig:SED-HR4049 - [[./img/a.png]] - - When rendered, it may show as follows in the exported document: - - Figure 2: Bell curve - - To modify the category component of the caption, customize the option -`org-odt-category-map-alist'. For example, to tag embedded images with -the string `Illustration' instead of the default string `Figure', use -the following setting: - - (setq org-odt-category-map-alist - '(("__Figure__" "Illustration" "value" "Figure" org-odt--enumerable-image-p))) - - With the above modification, the previous example changes to: - - Illustration 2: Bell curve - - -File: org, Node: Literal examples in ODT export, Next: Advanced topics in ODT export, Prev: Labels and captions in ODT export, Up: OpenDocument Text export - -12.12.11 Literal examples in ODT export ---------------------------------------- - -The ODT export back-end supports literal examples (*note Literal -examples::) with full fontification. Internally, the ODT export -back-end relies on `htmlfontify.el' to generate the style definitions -needed for fancy listings. The auto-generated styles get `OrgSrc' -prefix and inherit colors from the faces used by Emacs `font-lock' -library for that source language. - - For custom fontification styles, customize the -`org-odt-create-custom-styles-for-srcblocks' option. - - To turn off fontification of literal examples, customize the -`org-odt-fontify-srcblocks' option. - - -File: org, Node: Advanced topics in ODT export, Prev: Literal examples in ODT export, Up: OpenDocument Text export - -12.12.12 Advanced topics in ODT export --------------------------------------- - -The ODT export back-end has extensive features useful for power users -and frequent uses of ODT formats. - -* Menu: - -* Configuring a document converter:: Registering a document converter. -* Working with OpenDocument style files:: Exploring internals. -* Creating one-off styles:: Customizing styles, highlighting. -* Customizing tables in ODT export:: Defining table templates. -* Validating OpenDocument XML:: Debugging corrupted OpenDocument files. - - -File: org, Node: Configuring a document converter, Next: Working with OpenDocument style files, Up: Advanced topics in ODT export - -Configuring a document converter -................................ - -The ODT export back-end works with popular converters with little or no -extra configuration. *Note Extending ODT export::. The following is -for unsupported converters or tweaking existing defaults. - - 1. Register the converter - - Add the name of the converter to the `org-odt-convert-processes' - variable. Note that it also requires how the converter is invoked - on the command line. See the variable's docstring for details. - - 2. Configure its capabilities - - Specify which formats the converter can handle by customizing the - variable `org-odt-convert-capabilities'. Use the entry for the - default values in this variable for configuring the new converter. - Also see its docstring for details. - - 3. Choose the converter - - Select the newly added converter as the preferred one by - customizing the option `org-odt-convert-process'. - - -File: org, Node: Working with OpenDocument style files, Next: Creating one-off styles, Prev: Configuring a document converter, Up: Advanced topics in ODT export - -Working with OpenDocument style files -..................................... - -This section explores the internals of the ODT exporter; the means by -which it produces styled documents; the use of automatic and custom -OpenDocument styles. - -a) Factory styles -................. - -The ODT exporter relies on two files for generating its output. These -files are bundled with the distribution under the directory pointed to -by the variable `org-odt-styles-dir'. The two files are: - - * `OrgOdtStyles.xml' - - This file contributes to the `styles.xml' file of the final `ODT' - document. This file gets modified for the following purposes: - 1. To control outline numbering based on user settings. - - 2. To add styles generated by `htmlfontify.el' for fontification - of code blocks. - - * `OrgOdtContentTemplate.xml' - - This file contributes to the `content.xml' file of the final `ODT' - document. The contents of the Org outline are inserted between the - `'...`' elements of this file. - - Apart from serving as a template file for the final `content.xml', - the file serves the following purposes: - 1. It contains automatic styles for formatting of tables which - are referenced by the exporter. - - 2. It contains `'...`' - elements that control numbering of tables, images, equations, - and similar entities. - -b) Overriding factory styles -............................ - -The following two variables control the location from where the ODT -exporter picks up the custom styles and content template files. -Customize these variables to override the factory styles used by the -exporter. - - * `org-odt-styles-file' - - The ODT export back-end uses the file pointed to by this variable, - such as `styles.xml', for the final output. It can take one of - the following values: - - 1. A `styles.xml' file - - Use this file instead of the default `styles.xml' - - 2. A `.odt' or `.ott' file - - Use the `styles.xml' contained in the specified OpenDocument - Text or Template file - - 3. A `.odt' or `.ott' file and a subset of files contained - within them - - Use the `styles.xml' contained in the specified OpenDocument - Text or Template file. Additionally extract the specified - member files and embed those within the final `ODT' document. - - Use this option if the `styles.xml' file references - additional files like header and footer images. - - 4. `nil' - - Use the default `styles.xml' - - * `org-odt-content-template-file' - - Use this variable to specify the blank `content.xml' that will be - used in the final output. - - -File: org, Node: Creating one-off styles, Next: Customizing tables in ODT export, Prev: Working with OpenDocument style files, Up: Advanced topics in ODT export - -Creating one-off styles -....................... - -The ODT export back-end can read embedded raw OpenDocument XML from the -Org file. Such direct formatting are useful for one-off instances. - - 1. Embedding ODT tags as part of regular text - - Enclose OpenDocument syntax in `@@odt:...@@' for inline markup. - For example, to highlight a region of text do the following: - - @@odt:This is highlighted - text@@. But this is regular text. - - *Hint:* To see the above example in action, edit the `styles.xml' - (*note Factory styles: x-orgodtstyles-xml.) and add a custom - `Highlight' style as shown below: - - - - - - 2. Embedding a one-line OpenDocument XML - - The ODT export back-end can read one-liner options with `#+ODT:' - in the Org file. For example, to force a page break: - - #+ODT: - - *Hint:* To see the above example in action, edit your `styles.xml' - (*note Factory styles: x-orgodtstyles-xml.) and add a custom - `PageBreak' style as shown below. - - - - - - 3. Embedding a block of OpenDocument XML - - The ODT export back-end can also read ODT export blocks for - OpenDocument XML. Such blocks use the `#+BEGIN_EXPORT - odt'...`#+END_EXPORT' constructs. - - For example, to create a one-off paragraph that uses bold text, do - the following: - - #+BEGIN_EXPORT odt - - This paragraph is specially formatted and uses bold text. - - #+END_EXPORT - - - -File: org, Node: Customizing tables in ODT export, Next: Validating OpenDocument XML, Prev: Creating one-off styles, Up: Advanced topics in ODT export - -Customizing tables in ODT export -................................ - -Override the default table format by specifying a custom table style -with the `#+ATTR_ODT' line. For a discussion on default formatting of -tables *note Tables in ODT export::. - - This feature closely mimics the way table templates are defined in -the OpenDocument-v1.2 specification.(1) - - For quick preview of this feature, install the settings below and -export the table that follows: - - (setq org-odt-table-styles - (append org-odt-table-styles - '(("TableWithHeaderRowAndColumn" "Custom" - ((use-first-row-styles . t) - (use-first-column-styles . t))) - ("TableWithFirstRowandLastRow" "Custom" - ((use-first-row-styles . t) - (use-last-row-styles . t)))))) - - #+ATTR_ODT: :style TableWithHeaderRowAndColumn - | Name | Phone | Age | - | Peter | 1234 | 17 | - | Anna | 4321 | 25 | - - The example above used `Custom' template and installed two table -styles `TableWithHeaderRowAndColumn' and `TableWithFirstRowandLastRow'. -*Important:* The OpenDocument styles needed for producing the above -template were pre-defined. They are available in the section marked -`Custom Table Template' in `OrgOdtContentTemplate.xml' (*note Factory -styles: x-orgodtcontenttemplate-xml. For adding new templates, define -new styles here. - - To use this feature proceed as follows: - - 1. Create a table template(2) - - A table template is set of `table-cell' and `paragraph' styles for - each of the following table cell categories: - - - Body - - - First column - - - Last column - - - First row - - - Last row - - - Even row - - - Odd row - - - Even column - - - Odd Column - - The names for the above styles must be chosen based on the name of - the table template using a well-defined convention. - - The naming convention is better illustrated with an example. For - a table template with the name `Custom', the needed style names - are listed in the following table. - - Table cell type `table-cell' style `paragraph' style - ------------------------------------------------------------------------------- - - Body `CustomTableCell' `CustomTableParagraph' - First column `CustomFirstColumnTableCell'`CustomFirstColumnTableParagraph' - Last column `CustomLastColumnTableCell' `CustomLastColumnTableParagraph' - First row `CustomFirstRowTableCell' `CustomFirstRowTableParagraph' - Last row `CustomLastRowTableCell' `CustomLastRowTableParagraph' - Even row `CustomEvenRowTableCell' `CustomEvenRowTableParagraph' - Odd row `CustomOddRowTableCell' `CustomOddRowTableParagraph' - Even column `CustomEvenColumnTableCell' `CustomEvenColumnTableParagraph' - Odd column `CustomOddColumnTableCell' `CustomOddColumnTableParagraph' - - To create a table template with the name `Custom', define the above - styles in the - `'...`' element - of the content template file (*note Factory styles: - x-orgodtcontenttemplate-xml.). - - 2. Define a table style(3) - - To define a table style, create an entry for the style in the - variable `org-odt-table-styles' and specify the following: - - - the name of the table template created in step (1) - - - the set of cell styles in that template that are to be - activated - - For example, the entry below defines two different table styles - `TableWithHeaderRowAndColumn' and `TableWithFirstRowandLastRow' - based on the same template `Custom'. The styles achieve their - intended effect by selectively activating the individual cell - styles in that template. - - (setq org-odt-table-styles - (append org-odt-table-styles - '(("TableWithHeaderRowAndColumn" "Custom" - ((use-first-row-styles . t) - (use-first-column-styles . t))) - ("TableWithFirstRowandLastRow" "Custom" - ((use-first-row-styles . t) - (use-last-row-styles . t)))))) - - 3. Associate a table with the table style - - To do this, specify the table style created in step (2) as part of - the `ATTR_ODT' line as shown below. - - #+ATTR_ODT: :style "TableWithHeaderRowAndColumn" - | Name | Phone | Age | - | Peter | 1234 | 17 | - | Anna | 4321 | 25 | - - ---------- Footnotes ---------- - - (1) OpenDocument-v1.2 Specification -(http://docs.oasis-open.org/office/v1.2/OpenDocument-v1.2.html) - - (2) See the `' element of the -OpenDocument-v1.2 specification - - (3) See the attributes `table:template-name', -`table:use-first-row-styles', `table:use-last-row-styles', -`table:use-first-column-styles', `table:use-last-column-styles', -`table:use-banding-rows-styles', and `table:use-banding-column-styles' -of the `' element in the OpenDocument-v1.2 specification - - -File: org, Node: Validating OpenDocument XML, Prev: Customizing tables in ODT export, Up: Advanced topics in ODT export - -Validating OpenDocument XML -........................... - -Sometimes ODT format files may not open due to `.odt' file corruption. -To verify if the `.odt' file is corrupt, validate it against the -OpenDocument RELAX NG Compact Syntax--RNC--schema. But first the -`.odt' files have to be decompressed using `zip'. Note that `.odt' -files are `zip' archives: *note (emacs)File Archives::. The contents -of `.odt' files are in `.xml'. For general help with validation--and -schema-sensitive editing--of XML files: *note (nxml-mode)Introduction::. - - Customize `org-odt-schema-dir' to point to a directory with -OpenDocument `.rnc' files and the needed schema-locating rules. The -ODT export back-end takes care of updating the -`rng-schema-locating-files'. - - -File: org, Node: Org export, Next: Texinfo export, Prev: OpenDocument Text export, Up: Exporting - -12.13 Org export -================ - -`org' export back-end creates a normalized version of the Org document -in current buffer. The exporter evaluates Babel code (*note Evaluating -code blocks::) and removes content specific to other back-ends. - -Org export commands -------------------- - -`C-c C-e O o (`org-org-export-to-org')' - Export as an Org file with a `.org' extension. For `myfile.org', - Org exports to `myfile.org.org', overwriting without warning. - -`C-c C-e O O (`org-org-export-as-org')' - Export to a temporary buffer. Does not create a file. - -`C-c C-e O v' - Export to an Org file, then open it. - - -File: org, Node: Texinfo export, Next: iCalendar export, Prev: Org export, Up: Exporting - -12.14 Texinfo export -==================== - -The `texinfo' export back-end generates documents with Texinfo code that -can compile to Info format. - -* Menu: - -* Texinfo export commands:: Invoking commands. -* Texinfo specific export settings:: Setting the environment. -* Texinfo file header:: Generating the header. -* Texinfo title and copyright page:: Creating preamble pages. -* Info directory file:: Installing a manual in Info file hierarchy. -* Headings and sectioning structure:: Building document structure. -* Indices:: Creating indices. -* Quoting Texinfo code:: Incorporating literal Texinfo code. -* Plain lists in Texinfo export:: List attributes. -* Tables in Texinfo export:: Table attributes. -* Images in Texinfo export:: Image attributes. -* Special blocks in Texinfo export:: Special block attributes. -* A Texinfo example:: Processing Org to Texinfo. - - -File: org, Node: Texinfo export commands, Next: Texinfo specific export settings, Up: Texinfo export - -12.14.1 Texinfo export commands -------------------------------- - -`C-c C-e i t (`org-texinfo-export-to-texinfo')' - Export as a Texinfo file with `.texi' extension. For `myfile.org', - Org exports to `myfile.texi', overwriting without warning. - -`C-c C-e i i (`org-texinfo-export-to-info')' - Export to Texinfo format first and then process it to make an Info - file. To generate other formats, such as DocBook, customize the - `org-texinfo-info-process' variable. - - -File: org, Node: Texinfo specific export settings, Next: Texinfo file header, Prev: Texinfo export commands, Up: Texinfo export - -12.14.2 Texinfo specific export settings ----------------------------------------- - -The Texinfo export back-end has several additional keywords for -customizing Texinfo output. Setting these keywords works similar to -the general options (*note Export settings::). - -`SUBTITLE' - The document subtitle. - -`SUBAUTHOR' - The document subauthor. - -`TEXINFO_FILENAME' - The Texinfo filename. - -`TEXINFO_CLASS' - The default document class (`org-texinfo-default-class'), which - must be a member of `org-texinfo-classes'. - -`TEXINFO_HEADER' - Arbitrary lines inserted at the end of the header. - -`TEXINFO_POST_HEADER' - Arbitrary lines inserted after the end of the header. - -`TEXINFO_DIR_CATEGORY' - The directory category of the document. - -`TEXINFO_DIR_TITLE' - The directory title of the document. - -`TEXINFO_DIR_DESC' - The directory description of the document. - -`TEXINFO_PRINTED_TITLE' - The printed title of the document. - - -File: org, Node: Texinfo file header, Next: Texinfo title and copyright page, Prev: Texinfo specific export settings, Up: Texinfo export - -12.14.3 Texinfo file header ---------------------------- - -After creating the header for a Texinfo file, the Texinfo back-end -automatically generates a name and destination path for the Info file. -To override this default with a more sensible path and name, specify the -`#+TEXINFO_FILENAME' keyword. - - Along with the output's file name, the Texinfo header also contains -language details (*note Export settings::) and encoding system as set -in the `org-texinfo-coding-system' variable. Insert `#+TEXINFO_HEADER' -keywords for each additional command in the header, for example: -@code{@synindex}. - - Instead of repeatedly installing the same set of commands, define a -class in `org-texinfo-classes' once, and then activate it in the -document by setting the `#+TEXINFO_CLASS' keyword to that class. - - -File: org, Node: Texinfo title and copyright page, Next: Info directory file, Prev: Texinfo file header, Up: Texinfo export - -12.14.4 Texinfo title and copyright page ----------------------------------------- - -The default template for hard copy output has a title page with -`#+TITLE' and `#+AUTHOR' (*note Export settings::). To replace the -regular `#+TITLE' with something different for the printed version, use -the `#+TEXINFO_PRINTED_TITLE' and `#+SUBTITLE' keywords. Both expect -raw Texinfo code for setting their values. - - If one `#+AUTHOR' is not sufficient, add multiple `#+SUBAUTHOR' -keywords. They have to be set in raw Texinfo code. - - #+AUTHOR: Jane Smith - #+SUBAUTHOR: John Doe - #+TEXINFO_PRINTED_TITLE: This Long Title@inlinefmt{tex,@*} Is Broken in @TeX{} - - Copying material is defined in a dedicated headline with a non-`nil' -`:COPYING:' property. The back-end inserts the contents within a -`@copying' command at the beginning of the document. The heading -itself does not appear in the structure of the document. - - Copyright information is printed on the back of the title page. - - * Legalese - :PROPERTIES: - :COPYING: t - :END: - - This is a short example of a complete Texinfo file, version 1.0. - - Copyright \copy 2016 Free Software Foundation, Inc. - - -File: org, Node: Info directory file, Next: Headings and sectioning structure, Prev: Texinfo title and copyright page, Up: Texinfo export - -12.14.5 Info directory file ---------------------------- - -The end result of the Texinfo export process is the creation of an Info -file. This Info file's metadata has variables for category, title, and -description: `#+TEXINFO_DIR_CATEGORY', `#+TEXINFO_DIR_TITLE', and -`#+TEXINFO_DIR_DESC' that establish where in the Info hierarchy the file -fits. - - Here is an example that writes to the Info directory file: - - #+TEXINFO_DIR_CATEGORY: Emacs - #+TEXINFO_DIR_TITLE: Org Mode: (org) - #+TEXINFO_DIR_DESC: Outline-based notes management and organizer - - -File: org, Node: Headings and sectioning structure, Next: Indices, Prev: Info directory file, Up: Texinfo export - -12.14.6 Headings and sectioning structure ------------------------------------------ - -The Texinfo export back-end uses a pre-defined scheme to convert Org -headlines to an equivalent Texinfo structuring commands. A scheme like -this maps top-level headlines to numbered chapters tagged as `@chapter' -and lower-level headlines to unnumbered chapters tagged as -`@unnumbered'. To override such mappings to introduce `@part' or other -Texinfo structuring commands, define a new class in -`org-texinfo-classes'. Activate the new class with the -`#+TEXINFO_CLASS' keyword. When no new class is defined and activated, -the Texinfo export back-end defaults to the `org-texinfo-default-class'. - - If an Org headline's level has no associated Texinfo structuring -command, or is below a certain threshold (*note Export settings::), -then the Texinfo export back-end makes it into a list item. - - The Texinfo export back-end makes any headline with a non-`nil' -`:APPENDIX:' property into an appendix. This happens independent of the -Org headline level or the `#+TEXINFO_CLASS'. - - The Texinfo export back-end creates a menu entry after the Org -headline for each regular sectioning structure. To override this with -a shorter menu entry, use the `:ALT_TITLE:' property (*note Table of -contents::). Texinfo menu entries also have an option for a longer -`:DESCRIPTION:' property. Here's an example that uses both to override -the default menu entry: - - * Controlling Screen Display - :PROPERTIES: - :ALT_TITLE: Display - :DESCRIPTION: Controlling Screen Display - :END: - - The text before the first headline belongs to the `Top' node, i.e., -the node in which a reader enters an Info manual. As such, it is -expected not to appear in printed output generated from the `.texi' -file. *note (texinfo)The Top Node::, for more information. - - -File: org, Node: Indices, Next: Quoting Texinfo code, Prev: Headings and sectioning structure, Up: Texinfo export - -12.14.7 Indices ---------------- - -The Texinfo export back-end recognizes these indexing keywords if used -in the Org file: `#+CINDEX', `#+FINDEX', `#+KINDEX', `#+PINDEX', -`#+TINDEX', and `#+VINDEX'. Write their value as verbatim Texinfo -code; in particular, `{', `}' and `@' characters need to be escaped -with `@' if they not belong to a Texinfo command. - - #+CINDEX: Defining indexing entries - - For the back-end to generate an index entry for a headline, set the -`:INDEX:' property to `cp' or `vr'. These abbreviations come from -Texinfo that stand for concept index and variable index. The Texinfo -manual has abbreviations for all other kinds of indexes. The back-end -exports the headline as an unnumbered chapter or section command, and -then inserts the index after its contents. - - * Concept Index - :PROPERTIES: - :INDEX: cp - :END: - - -File: org, Node: Quoting Texinfo code, Next: Plain lists in Texinfo export, Prev: Indices, Up: Texinfo export - -12.14.8 Quoting Texinfo code ----------------------------- - -Use any of the following three methods to insert or escape raw Texinfo -code: - - Richard @@texinfo:@sc{@@Stallman@@texinfo:}@@ commence' GNU. - - #+TEXINFO: @need800 - This paragraph is preceded by... - - #+BEGIN_EXPORT texinfo - @auindex Johnson, Mark - @auindex Lakoff, George - #+END_EXPORT - - -File: org, Node: Plain lists in Texinfo export, Next: Tables in Texinfo export, Prev: Quoting Texinfo code, Up: Texinfo export - -12.14.9 Plain lists in Texinfo export -------------------------------------- - -The Texinfo export back-end by default converts description lists in -the Org file using the default command `@table', which results in a -table with two columns. To change this behavior, specify `:table-type' -with `ftable' or `vtable' attributes. For more information, *note -(texinfo)Two-column Tables::. - - The Texinfo export back-end by default also applies a text highlight -based on the defaults stored in `org-texinfo-table-default-markup'. To -override the default highlight command, specify another one with the -`:indic' attribute. - - Org syntax is limited to one entry per list item. Nevertheless, the -Texinfo export back-end can split that entry according to any text -provided through the `:sep' attribute. Each part then becomes a new -entry in the first column of the table. - - The following example illustrates all the attributes above: - - #+ATTR_TEXINFO: :table-type vtable :sep , :indic asis - - foo, bar :: This is the common text for variables foo and bar. - -becomes - - @vtable @asis - @item foo - @itemx bar - This is the common text for variables foo and bar. - @end table - - -File: org, Node: Tables in Texinfo export, Next: Images in Texinfo export, Prev: Plain lists in Texinfo export, Up: Texinfo export - -12.14.10 Tables in Texinfo export ---------------------------------- - -When exporting tables, the Texinfo export back-end uses the widest cell -width in each column. To override this and instead specify as -fractions of line length, use the `:columns' attribute. See example -below. - - #+ATTR_TEXINFO: :columns .5 .5 - | a cell | another cell | - - -File: org, Node: Images in Texinfo export, Next: Special blocks in Texinfo export, Prev: Tables in Texinfo export, Up: Texinfo export - -12.14.11 Images in Texinfo export ---------------------------------- - -Insert a file link to the image in the Org file, and the Texinfo export -back-end inserts the image. These links must have the usual supported -image extensions and no descriptions. To scale the image, use `:width' -and `:height' attributes. For alternate text, use `:alt' and specify -the text using Texinfo code, as shown in the example: - - #+ATTR_TEXINFO: :width 1in :alt Alternate @i{text} - [[ridt.pdf]] - - -File: org, Node: Special blocks in Texinfo export, Next: A Texinfo example, Prev: Images in Texinfo export, Up: Texinfo export - -12.14.12 Special blocks ------------------------ - -The Texinfo export back-end converts special blocks to commands with -the same name. It also adds any `:options' attributes to the end of -the command, as shown in this example: - - #+ATTR_TEXINFO: :options org-org-export-to-org ... - #+begin_defun - A somewhat obsessive function. - #+end_defun - -becomes - - @defun org-org-export-to-org ... - A somewhat obsessive function. - @end defun - - -File: org, Node: A Texinfo example, Prev: Special blocks in Texinfo export, Up: Texinfo export - -12.14.13 A Texinfo example --------------------------- - -Here is a more detailed example Org file. See *note GNU Sample Texts: -(texinfo)GNU Sample Texts. for an equivalent example using Texinfo code. - - #+TITLE: GNU Sample {{{version}}} - #+SUBTITLE: for version {{{version}}}, {{{updated}}} - #+AUTHOR: A.U. Thor - #+EMAIL: bug-sample@gnu.org - - #+OPTIONS: ':t toc:t author:t email:t - #+LANGUAGE: en - - #+MACRO: version 2.0 - #+MACRO: updated last updated 4 March 2014 - - #+TEXINFO_FILENAME: sample.info - #+TEXINFO_HEADER: @syncodeindex pg cp - - #+TEXINFO_DIR_CATEGORY: Texinfo documentation system - #+TEXINFO_DIR_TITLE: sample: (sample) - #+TEXINFO_DIR_DESC: Invoking sample - - #+TEXINFO_PRINTED_TITLE: GNU Sample - - This manual is for GNU Sample (version {{{version}}}, - {{{updated}}}). - - * Copying - :PROPERTIES: - :COPYING: t - :END: - - This manual is for GNU Sample (version {{{version}}}, - {{{updated}}}), which is an example in the Texinfo documentation. - - Copyright \copy 2016 Free Software Foundation, Inc. - - #+BEGIN_QUOTE - Permission is granted to copy, distribute and/or modify this - document under the terms of the GNU Free Documentation License, - Version 1.3 or any later version published by the Free Software - Foundation; with no Invariant Sections, with no Front-Cover Texts, - and with no Back-Cover Texts. A copy of the license is included in - the section entitled "GNU Free Documentation License". - #+END_QUOTE - - * Invoking sample - - #+PINDEX: sample - #+CINDEX: invoking @command{sample} - - This is a sample manual. There is no sample program to invoke, but - if there were, you could see its basic usage and command line - options here. - - * GNU Free Documentation License - :PROPERTIES: - :APPENDIX: t - :END: - - #+TEXINFO: @include fdl.texi - - * Index - :PROPERTIES: - :INDEX: cp - :END: - - -File: org, Node: iCalendar export, Next: Other built-in back-ends, Prev: Texinfo export, Up: Exporting - -12.15 iCalendar export -====================== - -A large part of Org mode's inter-operability success is its ability to -easily export to or import from external applications. The iCalendar -export back-end takes calendar data from Org files and exports to the -standard iCalendar format. - - The iCalendar export back-end can also incorporate TODO entries -based on the configuration of the `org-icalendar-include-todo' -variable. The back-end exports plain timestamps as VEVENT, TODO items -as VTODO, and also create events from deadlines that are in non-TODO -items. The back-end uses the deadlines and scheduling dates in Org -TODO items for setting the start and due dates for the iCalendar TODO -entry. Consult the `org-icalendar-use-deadline' and -`org-icalendar-use-scheduled' variables for more details. - - For tags on the headline, the iCalendar export back-end makes them -into iCalendar categories. To tweak the inheritance of tags and TODO -states, configure the variable `org-icalendar-categories'. To assign -clock alarms based on time, configure the `org-icalendar-alarm-time' -variable. - - The iCalendar format standard requires globally unique -identifier--UID--for each entry. The iCalendar export back-end creates -UIDs during export. To save a copy of the UID in the Org file set the -variable `org-icalendar-store-UID'. The back-end looks for the `:ID:' -property of the entry for re-using the same UID for subsequent exports. - - Since a single Org entry can result in multiple iCalendar entries--as -timestamp, deadline, scheduled item, or TODO item--Org adds prefixes to -the UID, depending on which part of the Org entry triggered the -creation of the iCalendar entry. Prefixing ensures UIDs remains -unique, yet enable synchronization programs trace the connections. - -`C-c C-e c f (`org-icalendar-export-to-ics')' - Create iCalendar entries from the current Org buffer and store - them in the same directory, using a file extension `.ics'. - -`C-c C-e c a (`org-icalendar-export-agenda-files')' - Create iCalendar entries from Org files in `org-agenda-files' and - store in a separate iCalendar file for each Org file. - -`C-c C-e c c (`org-icalendar-combine-agenda-files')' - Create a combined iCalendar file from Org files in - `org-agenda-files' and write it to - `org-icalendar-combined-agenda-file' file name. - - The iCalendar export back-end includes SUMMARY, DESCRIPTION, -LOCATION and TIMEZONE properties from the Org entries when exporting. -To force the back-end to inherit the LOCATION and TIMEZONE properties, -configure the `org-use-property-inheritance' variable. - - When Org entries do not have SUMMARY, DESCRIPTION and LOCATION -properties, the iCalendar export back-end derives the summary from the -headline, and derives the description from the body of the Org item. -The `org-icalendar-include-body' variable limits the maximum number of -characters of the content are turned into its description. - - The TIMEZONE property can be used to specify a per-entry time zone, -and will be applied to any entry with timestamp information. Time -zones should be specified as per the IANA time zone database format, -e.g. "Asia/Almaty". Alternately, the property value can be "UTC", to -force UTC time for this entry only. - - Exporting to iCalendar format depends in large part on the -capabilities of the destination application. Some are more lenient -than others. Consult the Org mode FAQ for advice on specific -applications. - - -File: org, Node: Other built-in back-ends, Next: Advanced configuration, Prev: iCalendar export, Up: Exporting - -12.16 Other built-in back-ends -============================== - -Other export back-ends included with Org are: - - * `ox-man.el': export to a man page. - - To activate such back-ends, either customize `org-export-backends' or -load directly with `(require 'ox-man)'. On successful load, the -back-end adds new keys in the export dispatcher (*note The export -dispatcher::). - - Follow the comment section of such files, for example, `ox-man.el', -for usage and configuration details. - - -File: org, Node: Advanced configuration, Next: Export in foreign buffers, Prev: Other built-in back-ends, Up: Exporting - -12.17 Advanced configuration -============================ - -Hooks ------ - -The export process executes two hooks before the actual exporting -begins. The first hook, `org-export-before-processing-hook', runs -before any expansions of macros, Babel code, and include keywords in -the buffer. The second hook, `org-export-before-parsing-hook', runs -before the buffer is parsed. Both hooks are specified as functions, -see example below. Their main use is for heavy duty structural -modifications of the Org content. For example, removing every headline -in the buffer during export: - - (defun my-headline-removal (backend) - "Remove all headlines in the current buffer. - BACKEND is the export back-end being used, as a symbol." - (org-map-entries - (lambda () (delete-region (point) (progn (forward-line) (point)))))) - - (add-hook 'org-export-before-parsing-hook 'my-headline-removal) - - Note that the hook function must have a mandatory argument that is a -symbol for the back-end. - -Filters -------- - -The Org export process relies on filters to process specific parts of -conversion process. Filters are just lists of functions to be applied -to certain parts for a given back-end. The output from the first -function in the filter is passed on to the next function in the filter. -The final output is the output from the final function in the filter. - - The Org export process has many filter sets applicable to different -types of objects, plain text, parse trees, export options, and final -output formats. The filters are named after the element type or object -type: `org-export-filter-TYPE-functions', where `TYPE' is the type -targeted by the filter. Valid types are: - -body bold babel-call -center-block clock code -diary-sexp drawer dynamic-block -entity example-block export-block -export-snippet final-output fixed-width -footnote-definition footnote-reference headline -horizontal-rule inline-babel-call inline-src-block -inlinetask italic item -keyword latex-environment latex-fragment -line-break link node-property -options paragraph parse-tree -plain-list plain-text planning -property-drawer quote-block radio-target -section special-block src-block -statistics-cookie strike-through subscript -superscript table table-cell -table-row target timestamp -underline verbatim verse-block - - Here is an example filter that replaces non-breaking spaces `~' in -the Org buffer with `_' for the LaTeX back-end. - - (defun my-latex-filter-nobreaks (text backend info) - "Ensure \"_\" are properly handled in LaTeX export." - (when (org-export-derived-backend-p backend 'latex) - (replace-regexp-in-string "_" "~" text))) - - (add-to-list 'org-export-filter-plain-text-functions - 'my-latex-filter-nobreaks) - - A filter requires three arguments: the code to be transformed, the -name of the back-end, and some optional information about the export -process. The third argument can be safely ignored. Note the use of -`org-export-derived-backend-p' predicate that tests for `latex' -back-end or any other back-end, such as `beamer', derived from `latex'. - -Defining filters for individual files -------------------------------------- - -The Org export can filter not just for back-ends, but also for specific -files through the `#+BIND' keyword. Here is an example with two -filters; one removes brackets from time stamps, and the other removes -strike-through text. The filter functions are defined in a `src' code -block in the same Org file, which is a handy location for debugging. - - #+BIND: org-export-filter-timestamp-functions (tmp-f-timestamp) - #+BIND: org-export-filter-strike-through-functions (tmp-f-strike-through) - #+begin_src emacs-lisp :exports results :results none - (defun tmp-f-timestamp (s backend info) - (replace-regexp-in-string "&[lg]t;\\|[][]" "" s)) - (defun tmp-f-strike-through (s backend info) "") - #+end_src - -Extending an existing back-end ------------------------------- - -Some parts of the conversion process can be extended for certain -elements so as to introduce a new or revised translation. That is how -the HTML export back-end was extended to handle Markdown format. The -extensions work seamlessly so any aspect of filtering not done by the -extended back-end is handled by the original back-end. Of all the -export customization in Org, extending is very powerful as it operates -at the parser level. - - For this example, make the `ascii' back-end display the language -used in a source code block. Also make it display only when some -attribute is non-`nil', like the following: - - #+ATTR_ASCII: :language t - - Then extend `ascii' back-end with a custom `my-ascii' back-end. - - (defun my-ascii-src-block (src-block contents info) - "Transcode a SRC-BLOCK element from Org to ASCII. - CONTENTS is nil. INFO is a plist used as a communication - channel." - (if (not (org-export-read-attribute :attr_ascii src-block :language)) - (org-export-with-backend 'ascii src-block contents info) - (concat - (format ",--[ %s ]--\n%s`----" - (org-element-property :language src-block) - (replace-regexp-in-string - "^" "| " - (org-element-normalize-string - (org-export-format-code-default src-block info))))))) - - (org-export-define-derived-backend 'my-ascii 'ascii - :translate-alist '((src-block . my-ascii-src-block))) - - The `my-ascii-src-block' function looks at the attribute above the -current element. If not true, hands over to `ascii' back-end. If true, -which it is in this example, it creates a box around the code and -leaves room for the inserting a string for language. The last form -creates the new back-end that springs to action only when translating -`src-block' type elements. - - To use the newly defined back-end, call the following from an Org -buffer: - - (org-export-to-buffer 'my-ascii "*Org MY-ASCII Export*") - - Further steps to consider would be an interactive function, -self-installing an item in the export dispatcher menu, and other -user-friendly improvements. - - -File: org, Node: Export in foreign buffers, Prev: Advanced configuration, Up: Exporting - -12.18 Export in foreign buffers -=============================== - -The export back-ends in Org often include commands to convert selected -regions. A convenient feature of this in-place conversion is that the -exported output replaces the original source. Here are such functions: - -`org-html-convert-region-to-html' - Convert the selected region into HTML. - -`org-latex-convert-region-to-latex' - Convert the selected region into LaTeX. - -`org-texinfo-convert-region-to-texinfo' - Convert the selected region into `Texinfo'. - -`org-md-convert-region-to-md' - Convert the selected region into `MarkDown'. - - In-place conversions are particularly handy for quick conversion of -tables and lists in foreign buffers. For example, turn on the minor -mode `M-x orgstruct-mode' in an HTML buffer, then use the convenient -Org keyboard commands to create a list, select it, and covert it to -HTML with `M-x org-html-convert-region-to-html RET'. - - -File: org, Node: Publishing, Next: Working with source code, Prev: Exporting, Up: Top - -13 Publishing -************* - -Org includes a publishing management system that allows you to configure -automatic HTML conversion of _projects_ composed of interlinked org -files. You can also configure Org to automatically upload your -exported HTML pages and related attachments, such as images and source -code files, to a web server. - - You can also use Org to convert files into PDF, or even combine HTML -and PDF conversion so that files are available in both formats on the -server. - - Publishing has been contributed to Org by David O'Toole. - -* Menu: - -* Configuration:: Defining projects -* Uploading files:: How to get files up on the server -* Sample configuration:: Example projects -* Triggering publication:: Publication commands - - -File: org, Node: Configuration, Next: Uploading files, Up: Publishing - -13.1 Configuration -================== - -Publishing needs significant configuration to specify files, destination -and many other properties of a project. - -* Menu: - -* Project alist:: The central configuration variable -* Sources and destinations:: From here to there -* Selecting files:: What files are part of the project? -* Publishing action:: Setting the function doing the publishing -* Publishing options:: Tweaking HTML/LaTeX export -* Publishing links:: Which links keep working after publishing? -* Sitemap:: Generating a list of all pages -* Generating an index:: An index that reaches across pages - - -File: org, Node: Project alist, Next: Sources and destinations, Up: Configuration - -13.1.1 The variable `org-publish-project-alist' ------------------------------------------------ - -Publishing is configured almost entirely through setting the value of -one variable, called `org-publish-project-alist'. Each element of the -list configures one project, and may be in one of the two following -forms: - - ("project-name" :property value :property value ...) - i.e., a well-formed property list with alternating keys and values - or - ("project-name" :components ("project-name" "project-name" ...)) - - In both cases, projects are configured by specifying property -values. A project defines the set of files that will be published, as -well as the publishing configuration to use when publishing those -files. When a project takes the second form listed above, the -individual members of the `:components' property are taken to be -sub-projects, which group together files requiring different publishing -options. When you publish such a "meta-project", all the components -will also be published, in the sequence given. - - -File: org, Node: Sources and destinations, Next: Selecting files, Prev: Project alist, Up: Configuration - -13.1.2 Sources and destinations for files ------------------------------------------ - -Most properties are optional, but some should always be set. In -particular, Org needs to know where to look for source files, and where -to put published files. - -`:base-directory' Directory containing publishing source files -`:publishing-directory'Directory where output files will be published. - You can directly publish to a web server using a - file name syntax appropriate for the Emacs - `tramp' package. Or you can publish to a local - directory and use external tools to upload your - website (*note Uploading files::). -`:preparation-function'Function or list of functions to be called before - starting the publishing process, for example, to - run `make' for updating files to be published. - Each preparation function is called with a single - argument, the project property list. -`:completion-function' Function or list of functions called after - finishing the publishing process, for example, to - change permissions of the resulting files. Each - completion function is called with a single - argument, the project property list. - - -File: org, Node: Selecting files, Next: Publishing action, Prev: Sources and destinations, Up: Configuration - -13.1.3 Selecting files ----------------------- - -By default, all files with extension `.org' in the base directory are -considered part of the project. This can be modified by setting the -properties -`:base-extension' Extension (without the dot!) of source files. This - actually is a regular expression. Set this to the - symbol `any' if you want to get all files in - `:base-directory', even without extension. -`:exclude' Regular expression to match file names that should - not be published, even though they have been selected - on the basis of their extension. -`:include' List of files to be included regardless of - `:base-extension' and `:exclude'. -`:recursive' non-`nil' means, check base-directory recursively for - files to publish. - - -File: org, Node: Publishing action, Next: Publishing options, Prev: Selecting files, Up: Configuration - -13.1.4 Publishing action ------------------------- - -Publishing means that a file is copied to the destination directory and -possibly transformed in the process. The default transformation is to -export Org files as HTML files, and this is done by the function -`org-html-publish-to-html', which calls the HTML exporter (*note HTML -export::). But you also can publish your content as PDF files using -`org-latex-publish-to-pdf' or as `ascii', `Texinfo', etc., using the -corresponding functions. - - If you want to publish the Org file as an `.org' file but with the -archived, commented and tag-excluded trees removed, use the function -`org-org-publish-to-org'. This will produce `file.org' and put it in -the publishing directory. If you want a htmlized version of this file, -set the parameter `:htmlized-source' to `t', it will produce -`file.org.html' in the publishing directory(1). - - Other files like images only need to be copied to the publishing -destination. For this you can use `org-publish-attachment'. For -non-org files, you always need to specify the publishing function: - -`:publishing-function' Function executing the publication of a file. - This may also be a list of functions, which will - all be called in turn. -`:htmlized-source' non-`nil' means, publish htmlized source. - - The function must accept three arguments: a property list containing -at least a `:publishing-directory' property, the name of the file to be -published and the path to the publishing directory of the output file. -It should take the specified file, make the necessary transformation -(if any) and place the result into the destination folder. - - ---------- Footnotes ---------- - - (1) If the publishing directory is the same than the source -directory, `file.org' will be exported as `file.org.org', so probably -don't want to do this. - - -File: org, Node: Publishing options, Next: Publishing links, Prev: Publishing action, Up: Configuration - -13.1.5 Options for the exporters --------------------------------- - -The property list can be used to set export options during the -publishing process. In most cases, these properties correspond to user -variables in Org. While some properties are available for all export -back-ends, most of them are back-end specific. The following sections -list properties along with the variable they belong to. See the -documentation string of these options for details. - - When a property is given a value in `org-publish-project-alist', its -setting overrides the value of the corresponding user variable (if any) -during publishing. Options set within a file (*note Export settings::), -however, override everything. - -Generic properties -.................. - -`:archived-trees' `org-export-with-archived-trees' -`:exclude-tags' `org-export-exclude-tags' -`:headline-levels' `org-export-headline-levels' -`:language' `org-export-default-language' -`:preserve-breaks' `org-export-preserve-breaks' -`:section-numbers' `org-export-with-section-numbers' -`:select-tags' `org-export-select-tags' -`:with-author' `org-export-with-author' -`:with-broken-links' `org-export-with-broken-links' -`:with-clocks' `org-export-with-clocks' -`:with-creator' `org-export-with-creator' -`:with-date' `org-export-with-date' -`:with-drawers' `org-export-with-drawers' -`:with-email' `org-export-with-email' -`:with-emphasize' `org-export-with-emphasize' -`:with-fixed-width' `org-export-with-fixed-width' -`:with-footnotes' `org-export-with-footnotes' -`:with-latex' `org-export-with-latex' -`:with-planning' `org-export-with-planning' -`:with-priority' `org-export-with-priority' -`:with-properties' `org-export-with-properties' -`:with-special-strings' `org-export-with-special-strings' -`:with-sub-superscript' `org-export-with-sub-superscripts' -`:with-tables' `org-export-with-tables' -`:with-tags' `org-export-with-tags' -`:with-tasks' `org-export-with-tasks' -`:with-timestamps' `org-export-with-timestamps' -`:with-title' `org-export-with-title' -`:with-toc' `org-export-with-toc' -`:with-todo-keywords' `org-export-with-todo-keywords' - -ASCII specific properties -......................... - -`:ascii-bullets' `org-ascii-bullets' -`:ascii-caption-above' `org-ascii-caption-above' -`:ascii-charset' `org-ascii-charset' -`:ascii-global-margin' `org-ascii-global-margin' -`:ascii-format-drawer-function' `org-ascii-format-drawer-function' -`:ascii-format-inlinetask-function' `org-ascii-format-inlinetask-function' -`:ascii-headline-spacing' `org-ascii-headline-spacing' -`:ascii-indented-line-width' `org-ascii-indented-line-width' -`:ascii-inlinetask-width' `org-ascii-inlinetask-width' -`:ascii-inner-margin' `org-ascii-inner-margin' -`:ascii-links-to-notes' `org-ascii-links-to-notes' -`:ascii-list-margin' `org-ascii-list-margin' -`:ascii-paragraph-spacing' `org-ascii-paragraph-spacing' -`:ascii-quote-margin' `org-ascii-quote-margin' -`:ascii-table-keep-all-vertical-lines' `org-ascii-table-keep-all-vertical-lines' -`:ascii-table-use-ascii-art' `org-ascii-table-use-ascii-art' -`:ascii-table-widen-columns' `org-ascii-table-widen-columns' -`:ascii-text-width' `org-ascii-text-width' -`:ascii-underline' `org-ascii-underline' -`:ascii-verbatim-format' `org-ascii-verbatim-format' - -Beamer specific properties -.......................... - -`:beamer-theme' `org-beamer-theme' -`:beamer-column-view-format' `org-beamer-column-view-format' -`:beamer-environments-extra' `org-beamer-environments-extra' -`:beamer-frame-default-options' `org-beamer-frame-default-options' -`:beamer-outline-frame-options' `org-beamer-outline-frame-options' -`:beamer-outline-frame-title' `org-beamer-outline-frame-title' -`:beamer-subtitle-format' `org-beamer-subtitle-format' - -HTML specific properties -........................ - -`:html-allow-name-attribute-in-anchors' `org-html-allow-name-attribute-in-anchors' -`:html-checkbox-type' `org-html-checkbox-type' -`:html-container' `org-html-container-element' -`:html-divs' `org-html-divs' -`:html-doctype' `org-html-doctype' -`:html-extension' `org-html-extension' -`:html-footnote-format' `org-html-footnote-format' -`:html-footnote-separator' `org-html-footnote-separator' -`:html-footnotes-section' `org-html-footnotes-section' -`:html-format-drawer-function' `org-html-format-drawer-function' -`:html-format-headline-function' `org-html-format-headline-function' -`:html-format-inlinetask-function' `org-html-format-inlinetask-function' -`:html-head-extra' `org-html-head-extra' -`:html-head-include-default-style' `org-html-head-include-default-style' -`:html-head-include-scripts' `org-html-head-include-scripts' -`:html-head' `org-html-head' -`:html-home/up-format' `org-html-home/up-format' -`:html-html5-fancy' `org-html-html5-fancy' -`:html-indent' `org-html-indent' -`:html-infojs-options' `org-html-infojs-options' -`:html-infojs-template' `org-html-infojs-template' -`:html-inline-image-rules' `org-html-inline-image-rules' -`:html-inline-images' `org-html-inline-images' -`:html-link-home' `org-html-link-home' -`:html-link-org-files-as-html' `org-html-link-org-files-as-html' -`:html-link-up' `org-html-link-up' -`:html-link-use-abs-url' `org-html-link-use-abs-url' -`:html-mathjax-options' `org-html-mathjax-options' -`:html-mathjax-template' `org-html-mathjax-template' -`:html-metadata-timestamp-format' `org-html-metadata-timestamp-format' -`:html-postamble-format' `org-html-postamble-format' -`:html-postamble' `org-html-postamble' -`:html-preamble-format' `org-html-preamble-format' -`:html-preamble' `org-html-preamble' -`:html-table-align-individual-fields' `org-html-table-align-individual-fields' -`:html-table-attributes' `org-html-table-default-attributes' -`:html-table-caption-above' `org-html-table-caption-above' -`:html-table-data-tags' `org-html-table-data-tags' -`:html-table-header-tags' `org-html-table-header-tags' -`:html-table-row-tags' `org-html-table-row-tags' -`:html-table-use-header-tags-for-first-column' `org-html-table-use-header-tags-for-first-column' -`:html-tag-class-prefix' `org-html-tag-class-prefix' -`:html-text-markup-alist' `org-html-text-markup-alist' -`:html-todo-kwd-class-prefix' `org-html-todo-kwd-class-prefix' -`:html-toplevel-hlevel' `org-html-toplevel-hlevel' -`:html-use-infojs' `org-html-use-infojs' -`:html-validation-link' `org-html-validation-link' -`:html-viewport' `org-html-viewport' -`:html-xml-declaration' `org-html-xml-declaration' - -LaTeX specific properties -......................... - -`:latex-active-timestamp-format' `org-latex-active-timestamp-format' -`:latex-caption-above' `org-latex-caption-above' -`:latex-classes' `org-latex-classes' -`:latex-class' `org-latex-default-class' -`:latex-compiler' `org-latex-compiler' -`:latex-default-figure-position' `org-latex-default-figure-position' -`:latex-default-table-environment' `org-latex-default-table-environment' -`:latex-default-table-mode' `org-latex-default-table-mode' -`:latex-diary-timestamp-format' `org-latex-diary-timestamp-format' -`:latex-footnote-defined-format' `org-latex-footnote-defined-format' -`:latex-footnote-separator' `org-latex-footnote-separator' -`:latex-format-drawer-function' `org-latex-format-drawer-function' -`:latex-format-headline-function' `org-latex-format-headline-function' -`:latex-format-inlinetask-function' `org-latex-format-inlinetask-function' -`:latex-hyperref-template' `org-latex-hyperref-template' -`:latex-image-default-height' `org-latex-image-default-height' -`:latex-image-default-option' `org-latex-image-default-option' -`:latex-image-default-width' `org-latex-image-default-width' -`:latex-images-centered' `org-latex-images-centered' -`:latex-inactive-timestamp-format' `org-latex-inactive-timestamp-format' -`:latex-inline-image-rules' `org-latex-inline-image-rules' -`:latex-link-with-unknown-path-format' `org-latex-link-with-unknown-path-format' -`:latex-listings-langs' `org-latex-listings-langs' -`:latex-listings-options' `org-latex-listings-options' -`:latex-listings' `org-latex-listings' -`:latex-minted-langs' `org-latex-minted-langs' -`:latex-minted-options' `org-latex-minted-options' -`:latex-prefer-user-labels' `org-latex-prefer-user-labels' -`:latex-subtitle-format' `org-latex-subtitle-format' -`:latex-subtitle-separate' `org-latex-subtitle-separate' -`:latex-table-scientific-notation' `org-latex-table-scientific-notation' -`:latex-tables-booktabs' `org-latex-tables-booktabs' -`:latex-tables-centered' `org-latex-tables-centered' -`:latex-text-markup-alist' `org-latex-text-markup-alist' -`:latex-title-command' `org-latex-title-command' -`:latex-toc-command' `org-latex-toc-command' - -Markdown specific properties -............................ - -`:md-footnote-format' `org-md-footnote-format' -`:md-footnotes-section' `org-md-footnotes-section' -`:md-headline-style' `org-md-headline-style' - -ODT specific properties -....................... - -`:odt-content-template-file' `org-odt-content-template-file' -`:odt-display-outline-level' `org-odt-display-outline-level' -`:odt-fontify-srcblocks' `org-odt-fontify-srcblocks' -`:odt-format-drawer-function' `org-odt-format-drawer-function' -`:odt-format-headline-function' `org-odt-format-headline-function' -`:odt-format-inlinetask-function' `org-odt-format-inlinetask-function' -`:odt-inline-formula-rules' `org-odt-inline-formula-rules' -`:odt-inline-image-rules' `org-odt-inline-image-rules' -`:odt-pixels-per-inch' `org-odt-pixels-per-inch' -`:odt-styles-file' `org-odt-styles-file' -`:odt-table-styles' `org-odt-table-styles' -`:odt-use-date-fields' `org-odt-use-date-fields' - -Texinfo specific properties -........................... - -`:texinfo-active-timestamp-format' `org-texinfo-active-timestamp-format' -`:texinfo-classes' `org-texinfo-classes' -`:texinfo-class' `org-texinfo-default-class' -`:texinfo-table-default-markup' `org-texinfo-table-default-markup' -`:texinfo-diary-timestamp-format' `org-texinfo-diary-timestamp-format' -`:texinfo-filename' `org-texinfo-filename' -`:texinfo-format-drawer-function' `org-texinfo-format-drawer-function' -`:texinfo-format-headline-function' `org-texinfo-format-headline-function' -`:texinfo-format-inlinetask-function' `org-texinfo-format-inlinetask-function' -`:texinfo-inactive-timestamp-format' `org-texinfo-inactive-timestamp-format' -`:texinfo-link-with-unknown-path-format' `org-texinfo-link-with-unknown-path-format' -`:texinfo-node-description-column' `org-texinfo-node-description-column' -`:texinfo-table-scientific-notation' `org-texinfo-table-scientific-notation' -`:texinfo-tables-verbatim' `org-texinfo-tables-verbatim' -`:texinfo-text-markup-alist' `org-texinfo-text-markup-alist' - - -File: org, Node: Publishing links, Next: Sitemap, Prev: Publishing options, Up: Configuration - -13.1.6 Links between published files ------------------------------------- - -To create a link from one Org file to another, you would use something -like `[[file:foo.org][The foo]]' or simply `file:foo.org' (*note -External links::). When published, this link becomes a link to -`foo.html'. You can thus interlink the pages of your "org web" project -and the links will work as expected when you publish them to HTML. If -you also publish the Org source file and want to link to it, use an -`http:' link instead of a `file:' link, because `file:' links are -converted to link to the corresponding `html' file. - - You may also link to related files, such as images. Provided you -are careful with relative file names, and provided you have also -configured Org to upload the related files, these links will work too. -See *note Complex example::, for an example of this usage. - - Eventually, links between published documents can contain some -search options (*note Search options::), which will be resolved to the -appropriate location in the linked file. For example, once published -to HTML, the following links all point to a dedicated anchor in -`foo.html'. - - [[file:foo.org::*heading]] - [[file:foo.org::#custom-id]] - [[file:foo.org::target]] - - -File: org, Node: Sitemap, Next: Generating an index, Prev: Publishing links, Up: Configuration - -13.1.7 Generating a sitemap ---------------------------- - -The following properties may be used to control publishing of a map of -files for a given project. - -`:auto-sitemap' When non-`nil', publish a sitemap during - `org-publish-current-project' or - `org-publish-all'. -`:sitemap-filename' Filename for output of sitemap. Defaults to - `sitemap.org' (which becomes `sitemap.html'). -`:sitemap-title' Title of sitemap page. Defaults to name of - file. -`:sitemap-format-entry' With this option one can tell how a site-map - entry is formatted in the site-map. It is a - function called with three arguments: the file - or directory name relative to base directory - of the project, the site-map style and the - current project. It is expected to return a - string. Default value turns file names into - links and use document titles as descriptions. - For specific formatting needs, one can use - `org-publish-find-date', - `org-publish-find-title' and - `org-publish-find-property', to retrieve - additional information about published - documents. -`:sitemap-function' Plug-in function to use for generation of the - sitemap. It is called with two arguments: the - title of the site-map and a representation of - the files and directories involved in the - project as a radio list (*note Radio lists::). - The latter can further be transformed using - `org-list-to-generic', `org-list-to-subtree' - and alike. Default value generates a plain - list of links to all files in the project. -`:sitemap-sort-folders' Where folders should appear in the sitemap. - Set this to `first' (default) or `last' to - display folders first or last, respectively. - When set to `ignore', folders are ignored - altogether. Any other value will mix files - and folders. This variable has no effect when - site-map style is `tree'. -`:sitemap-sort-files' How the files are sorted in the site map. Set - this to `alphabetically' (default), - `chronologically' or `anti-chronologically'. - `chronologically' sorts the files with older - date first while `anti-chronologically' sorts - the files with newer date first. - `alphabetically' sorts the files - alphabetically. The date of a file is - retrieved with `org-publish-find-date'. -`:sitemap-ignore-case' Should sorting be case-sensitive? Default - `nil'. -`:sitemap-date-format' Format string for the `format-time-string' - function that tells how a sitemap entry's date - is to be formatted. This property bypasses - `org-publish-sitemap-date-format' which - defaults to `%Y-%m-%d'. - - -File: org, Node: Generating an index, Prev: Sitemap, Up: Configuration - -13.1.8 Generating an index --------------------------- - -Org mode can generate an index across the files of a publishing project. - -`:makeindex' When non-`nil', generate in index in the file - `theindex.org' and publish it as `theindex.html'. - - The file will be created when first publishing a project with the -`:makeindex' set. The file only contains a statement `#+INCLUDE: -"theindex.inc"'. You can then build around this include statement by -adding a title, style information, etc. - - Index entries are specified with `#+INDEX' keyword. An entry that -contains an exclamation mark will create a sub item. - - * Curriculum Vitae - #+INDEX: CV - #+INDEX: Application!CV - - -File: org, Node: Uploading files, Next: Sample configuration, Prev: Configuration, Up: Publishing - -13.2 Uploading files -==================== - -For those people already utilizing third party sync tools such as -`rsync' or `unison', it might be preferable not to use the built in -remote publishing facilities of Org mode which rely heavily on Tramp. -Tramp, while very useful and powerful, tends not to be so efficient for -multiple file transfer and has been known to cause problems under heavy -usage. - - Specialized synchronization utilities offer several advantages. In -addition to timestamp comparison, they also do content and -permissions/attribute checks. For this reason you might prefer to -publish your web to a local directory (possibly even in place with your -Org files) and then use `unison' or `rsync' to do the synchronization -with the remote host. - - Since Unison (for example) can be configured as to which files to -transfer to a certain remote destination, it can greatly simplify the -project publishing definition. Simply keep all files in the correct -location, process your Org files with `org-publish' and let the -synchronization tool do the rest. You do not need, in this scenario, -to include attachments such as `jpg', `css' or `gif' files in the -project definition since the 3rd party tool syncs them. - - Publishing to a local directory is also much faster than to a remote -one, so that you can afford more easily to republish entire projects. -If you set `org-publish-use-timestamps-flag' to `nil', you gain the main -benefit of re-including any changed external files such as source -example files you might include with `#+INCLUDE:'. The timestamp -mechanism in Org is not smart enough to detect if included files have -been modified. - - -File: org, Node: Sample configuration, Next: Triggering publication, Prev: Uploading files, Up: Publishing - -13.3 Sample configuration -========================= - -Below we provide two example configurations. The first one is a simple -project publishing only a set of Org files. The second example is more -complex, with a multi-component project. - -* Menu: - -* Simple example:: One-component publishing -* Complex example:: A multi-component publishing example - - -File: org, Node: Simple example, Next: Complex example, Up: Sample configuration - -13.3.1 Example: simple publishing configuration ------------------------------------------------ - -This example publishes a set of Org files to the `public_html' -directory on the local machine. - - (setq org-publish-project-alist - '(("org" - :base-directory "~/org/" - :publishing-directory "~/public_html" - :publishing-function org-html-publish-to-html - :section-numbers nil - :with-toc nil - :html-head ""))) - - -File: org, Node: Complex example, Prev: Simple example, Up: Sample configuration - -13.3.2 Example: complex publishing configuration ------------------------------------------------- - -This more complicated example publishes an entire website, including -Org files converted to HTML, image files, Emacs Lisp source code, and -style sheets. The publishing directory is remote and private files are -excluded. - - To ensure that links are preserved, care should be taken to replicate -your directory structure on the web server, and to use relative file -paths. For example, if your Org files are kept in `~/org' and your -publishable images in `~/images', you would link to an image with - file:../images/myimage.png - On the web server, the relative path to the image should be the -same. You can accomplish this by setting up an "images" folder in the -right place on the web server, and publishing images to it. - - (setq org-publish-project-alist - '(("orgfiles" - :base-directory "~/org/" - :base-extension "org" - :publishing-directory "/ssh:user@host:~/html/notebook/" - :publishing-function org-html-publish-to-html - :exclude "PrivatePage.org" ;; regexp - :headline-levels 3 - :section-numbers nil - :with-toc nil - :html-head "" - :html-preamble t) - - ("images" - :base-directory "~/images/" - :base-extension "jpg\\|gif\\|png" - :publishing-directory "/ssh:user@host:~/html/images/" - :publishing-function org-publish-attachment) - - ("other" - :base-directory "~/other/" - :base-extension "css\\|el" - :publishing-directory "/ssh:user@host:~/html/other/" - :publishing-function org-publish-attachment) - ("website" :components ("orgfiles" "images" "other")))) - - -File: org, Node: Triggering publication, Prev: Sample configuration, Up: Publishing - -13.4 Triggering publication -=========================== - -Once properly configured, Org can publish with the following commands: - -`C-c C-e P x (`org-publish')' - Prompt for a specific project and publish all files that belong to - it. - -`C-c C-e P p (`org-publish-current-project')' - Publish the project containing the current file. - -`C-c C-e P f (`org-publish-current-file')' - Publish only the current file. - -`C-c C-e P a (`org-publish-all')' - Publish every project. - - Org uses timestamps to track when a file has changed. The above -functions normally only publish changed files. You can override this -and force publishing of all files by giving a prefix argument to any of -the commands above, or by customizing the variable -`org-publish-use-timestamps-flag'. This may be necessary in particular -if files include other files via `#+SETUPFILE:' or `#+INCLUDE:'. - - -File: org, Node: Working with source code, Next: Miscellaneous, Prev: Publishing, Up: Top - -14 Working with source code -*************************** - -Source code here refers to any code typed in Org mode documents. Org -can manage source code in any Org file once such code is tagged with -begin and end markers. Working with source code begins with tagging -source code blocks. Tagged `src' code blocks are not restricted to the -preamble or the end of an Org document; they can go anywhere--with a -few exceptions, such as not inside comments and fixed width areas. -Here's a sample `src' code block in emacs-lisp: - - #+BEGIN_SRC emacs-lisp - (defun org-xor (a b) - "Exclusive or." - (if a (not b) b)) - #+END_SRC - - Org can take the code in the block between the `#+BEGIN_SRC' and -`#+END_SRC' tags, and format, compile, execute, and show the results. -Org can simplify many housekeeping tasks essential to modern code -maintenance. That's why these blocks in Org mode literature are -sometimes referred to as `live code' blocks (as compared to the static -text and documentation around it). Users can control how `live' they -want each block by tweaking the headers for compiling, execution, -extraction. - - Org's `src' code block type is one of many block types, such as -quote, export, verse, latex, example, and verbatim. This section -pertains to `src' code blocks between `#+BEGIN_SRC' and `#+END_SRC' - - For editing `src' code blocks, Org provides native Emacs major-modes. -That leverages the latest Emacs features for that source code language -mode. - - For exporting, Org can then extract `src' code blocks into compilable -source files (in a conversion process known as "tangling" in literate -programming terminology). - - For publishing, Org's back-ends can handle the `src' code blocks and -the text for output to a variety of formats with native syntax -highlighting. - - For executing the source code in the `src' code blocks, Org provides -facilities that glue the tasks of compiling, collecting the results of -the execution, and inserting them back to the Org file. Besides text -output, results may include links to other data types that Emacs can -handle: audio, video, and graphics. - - An important feature of Org's execution of the `src' code blocks is -passing variables, functions, and results between `src' blocks. Such -interoperability uses a common syntax even if these `src' blocks are in -different source code languages. The integration extends to linking the -debugger's error messages to the line in the `src' code block in the Org -file. That should partly explain why this functionality by the original -contributors, Eric Schulte and Dan Davison, was called `Org Babel'. - - In literate programming, the main appeal is code and documentation -co-existing in one file. Org mode takes this several steps further. -First by enabling execution, and then by inserting results of that -execution back into the Org file. Along the way, Org provides -extensive formatting features, including handling tables. Org handles -multiple source code languages in one file, and provides a common -syntax for passing variables, functions, and results between `src' code -blocks. - - Org mode fulfills the promise of easy verification and maintenance of -publishing reproducible research by keeping all these in the same file: -text, data, code, configuration settings of the execution environment, -the results of the execution, and associated narratives, claims, -references, and internal and external links. - - Details of Org's facilities for working with source code are shown -next. - -* Menu: - -* Structure of code blocks:: Code block syntax described -* Editing source code:: Language major-mode editing -* Exporting code blocks:: Export contents and/or results -* Extracting source code:: Create pure source code files -* Evaluating code blocks:: Place results of evaluation in the Org mode buffer -* Library of Babel:: Use and contribute to a library of useful code blocks -* Languages:: List of supported code block languages -* Header arguments:: Configure code block functionality -* Results of evaluation:: How evaluation results are handled -* Noweb reference syntax:: Literate programming in Org mode -* Key bindings and useful functions:: Work quickly with code blocks -* Batch execution:: Call functions from the command line - - -File: org, Node: Structure of code blocks, Next: Editing source code, Up: Working with source code - -14.1 Structure of code blocks -============================= - -Org offers two ways to structure source code in Org documents: in a -`src' block, and directly inline. Both specifications are shown below. - - A `src' block conforms to this structure: - - #+NAME: - #+BEGIN_SRC
- - #+END_SRC - - Org mode's templates system (*note Easy templates::) speeds up -creating `src' code blocks with just three keystrokes. Do not be -put-off by having to remember the source block syntax. Org also works -with other completion systems in Emacs, some of which predate Org and -have custom domain-specific languages for defining templates. Regular -use of templates reduces errors, increases accuracy, and maintains -consistency. - - An inline code block conforms to this structure: - - src_{} - - or - - src_[
]{} - -`#+NAME: ' - Optional. Names the `src' block so it can be called, like a - function, from other `src' blocks or inline blocks to evaluate or - to capture the results. Code from other blocks, other files, and - from table formulas (*note The spreadsheet::) can use the name to - reference a `src' block. This naming serves the same purpose as - naming Org tables. Org mode requires unique names. For duplicate - names, Org mode's behavior is undefined. - -`#+BEGIN_SRC' - -`#+END_SRC' - Mandatory. They mark the start and end of a block that Org - requires. The `#+BEGIN_SRC' line takes additional arguments, as - described next. - -`' - Mandatory for live code blocks. It is the identifier of the - source code language in the block. *Note Languages::, for - identifiers of supported languages. - -`' - Optional. Switches provide finer control of the code execution, - export, and format (see the discussion of switches in *note - Literal examples::) - -`
' - Optional. Heading arguments control many aspects of evaluation, - export and tangling of code blocks (*note Header arguments::). - Using Org's properties feature, header arguments can be - selectively applied to the entire buffer or specific sub-trees of - the Org document. - -`source code, header arguments' - -`' - Source code in the dialect of the specified language identifier. - - -File: org, Node: Editing source code, Next: Exporting code blocks, Prev: Structure of code blocks, Up: Working with source code - -14.2 Editing source code -======================== - -`C-c '' for editing the current code block. It opens a new major-mode -edit buffer containing the body of the `src' code block, ready for any -edits. `C-c '' again to close the buffer and return to the Org buffer. - - saves the buffer and updates the contents of the Org -buffer. - - Set `org-edit-src-auto-save-idle-delay' to save the base buffer after -a certain idle delay time. - - Set `org-edit-src-turn-on-auto-save' to auto-save this buffer into a -separate file using `auto-save-mode'. - - `C-c '' to close the major-mode buffer and return back to the Org -buffer. - - While editing the source code in the major-mode, the `org-src-mode' -minor mode remains active. It provides these customization variables as -described below. For even more variables, look in the customization -group `org-edit-structure'. - -`org-src-lang-modes' - If an Emacs major-mode named `-mode' exists, where `' - is the language identifier from code block's header line, then the - edit buffer uses that major-mode. Use this variable to - arbitrarily map language identifiers to major modes. - -`org-src-window-setup' - For specifying Emacs window arrangement when the new edit buffer - is created. - -`org-src-preserve-indentation' - Default is `nil'. Source code is indented. This indentation - applies during export or tangling, and depending on the context, - may alter leading spaces and tabs. When non-`nil', source code is - aligned with the leftmost column. No lines are modified during - export or tangling, which is very useful for white-space sensitive - languages, such as Python. - -`org-src-ask-before-returning-to-edit-buffer' - When `nil', Org returns to the edit buffer without further - prompts. The default prompts for a confirmation. - - Set `org-src-fontify-natively' to non-`nil' to turn on native code -fontification in the _Org_ buffer. Fontification of `src' code blocks -can give visual separation of text and code on the display page. To -further customize the appearance of `org-block' for specific languages, -customize `org-src-block-faces'. The following example shades the -background of regular blocks, and colors source blocks only for Python -and Emacs-Lisp languages. - (require 'color) - (set-face-attribute 'org-block nil :background - (color-darken-name - (face-attribute 'default :background) 3)) - - (setq org-src-block-faces '(("emacs-lisp" (:background "#EEE2FF")) - ("python" (:background "#E5FFB8")))) - - -File: org, Node: Exporting code blocks, Next: Extracting source code, Prev: Editing source code, Up: Working with source code - -14.3 Exporting code blocks -========================== - -Org can flexibly export just the _code_ from the code blocks, just the -_results_ of evaluation of the code block, _both_ the code and the -results of the code block evaluation, or _none_. Org defaults to -exporting _code_ for most languages. For some languages, such as -`ditaa', Org defaults to _results_. To export just the body of code -blocks, *note Literal examples::. To selectively export sub-trees of -an Org document, *note Exporting::. - - The `:exports' header arguments control exporting code blocks only -and not inline code: - -Header arguments: -................. - -`:exports code' - This is the default for most languages where the body of the code - block is exported. See *note Literal examples:: for more. - -`:exports results' - On export, Org includes only the results and not the code block. - After each evaluation, Org inserts the results after the end of - code block in the Org buffer. By default, Org replaces any - previous results. Org can also append results. - -`:exports both' - Org exports both the code block and the results. - -`:exports none' - Org does not export the code block nor the results. - - To stop Org from evaluating code blocks to speed exports, use the -header argument `:eval never-export' (*note eval::). To stop Org from -evaluating code blocks for greater security, set the -`org-export-use-babel' variable to `nil', but understand that header -arguments will have no effect. - - Turning off evaluation comes in handy when batch processing. For -example, markup languages for wikis, which have a high risk of -untrusted code. Stopping code block evaluation also stops evaluation -of all header arguments of the code block. This may not be desirable -in some circumstances. So during export, to allow evaluation of just -the header arguments but not any code evaluation in the source block, -set `:eval never-export' (*note eval::). - - Org never evaluates code blocks in commented sub-trees when exporting -(*note Comment lines::). On the other hand, Org does evaluate code -blocks in sub-trees excluded from export (*note Export settings::). - - -File: org, Node: Extracting source code, Next: Evaluating code blocks, Prev: Exporting code blocks, Up: Working with source code - -14.4 Extracting source code -=========================== - -Extracting source code from code blocks is a basic task in literate -programming. Org has features to make this easy. In literate -programming parlance, documents on creation are _woven_ with code and -documentation, and on export, the code is _tangled_ for execution by a -computer. Org facilitates weaving and tangling for producing, -maintaining, sharing, and exporting literate programming documents. -Org provides extensive customization options for extracting source code. - - When Org tangles `src' code blocks, it expands, merges, and -transforms them. Then Org recomposes them into one or more separate -files, as configured through the options. During this _tangling_ -process, Org expands variables in the source code, and resolves any -Noweb style references (*note Noweb reference syntax::). - -Header arguments -................ - -`:tangle no' - By default, Org does not tangle the `src' code block on export. - -`:tangle yes' - Org extracts the contents of the code block for the tangled - output. By default, the output file name is the same as the Org - file but with a file extension derived from the language - identifier of the `src' code block. - -`:tangle filename' - Override the default file name with this one for the tangled - output. - -Functions -......... - -`org-babel-tangle' - Tangle the current file. Bound to `C-c C-v t'. - - With prefix argument only tangle the current `src' code block. - -`org-babel-tangle-file' - Choose a file to tangle. Bound to `C-c C-v f'. - -Hooks -..... - -`org-babel-post-tangle-hook' - This hook runs from within code tangled by `org-babel-tangle', - making it suitable for post-processing, compilation, and - evaluation of code in the tangled files. - -Jumping between code and Org -............................ - -Debuggers normally link errors and messages back to the source code. -But for tangled files, we want to link back to the Org file, not to the -tangled source file. To make this extra jump, Org uses -`org-babel-tangle-jump-to-org' function with two additional source code -block header arguments: One, set `padline' (*note padline::) to true -(the default setting). Two, set `comments' (*note comments::) to -`link', which makes Org insert links to the Org file. - - -File: org, Node: Evaluating code blocks, Next: Library of Babel, Prev: Extracting source code, Up: Working with source code - -14.5 Evaluating code blocks -=========================== - -A note about security: With code evaluation comes the risk of harm. Org -safeguards by prompting for user's permission before executing any code -in the source block. To customize this safeguard (or disable it) see -*note Code evaluation security::. - - Org captures the results of the `src' code block evaluation and -inserts them in the Org file, right after the `src' code block. The -insertion point is after a newline and the `#+RESULTS' label. Org -creates the `#+RESULTS' label if one is not already there. - - By default, Org enables only `emacs-lisp' `src' code blocks for -execution. See *note Languages:: for identifiers to enable other -languages. - - Org provides many ways to execute `src' code blocks. `C-c C-c' or -`C-c C-v e' with the point on a `src' code block(1) calls the -`org-babel-execute-src-block' function, which executes the code in the -block, collects the results, and inserts them in the buffer. - - By calling a named code block(2) from an Org mode buffer or a table. -Org can call the named `src' code blocks from the current Org mode -buffer or from the "Library of Babel" (*note Library of Babel::). -Whether inline syntax or the `#+CALL:' syntax is used, the result is -wrapped based on the variable `org-babel-inline-result-wrap', which by -default is set to `"=%s="' to produce verbatim text suitable for markup. - - The syntax for `#+CALL:' is - - #+CALL: () - #+CALL: []() - - The syntax for inline named code block is - - ... call_() ... - ... call_[]()[] ... - -`' - This is the name of the code block to be evaluated (*note - Structure of code blocks::). - -`' - Org passes arguments to the code block using standard function - call syntax. For example, a `#+CALL:' line that passes `4' to a - code block named `double', which declares the header argument - `:var n=2', would be written as `#+CALL: double(n=4)'. Note how - this function call syntax is different from the header argument - syntax. - -`' - Org passes inside header arguments to the named `src' code block - using the header argument syntax. Inside header arguments apply - to code block evaluation. For example, `[:results output]' - collects results printed to `STDOUT' during code execution of that - block. Note how this header argument syntax is different from the - function call syntax. - -`' - End header arguments affect the results returned by the code - block. For example, `:results html' wraps the results in a - `BEGIN_EXPORT html' block before inserting the results in the Org - buffer. - - For more examples of header arguments for `#+CALL:' lines, *note - Arguments in function calls::. - - ---------- Footnotes ---------- - - (1) The option `org-babel-no-eval-on-ctrl-c-ctrl-c' can be used to -remove code evaluation from the `C-c C-c' key binding. - - (2) Actually, the constructs call_() and src_{} are not -evaluated when they appear in a keyword line (i.e. lines starting with -`#+KEYWORD:', *note In-buffer settings::). - - -File: org, Node: Library of Babel, Next: Languages, Prev: Evaluating code blocks, Up: Working with source code - -14.6 Library of Babel -===================== - -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 Worg -(http://orgmode.org/worg/library-of-babel.html). For remote code block -evaluation syntax, *note Evaluating code blocks::. - - For any user to add code to the library, first save the code in -regular `src' code blocks of an Org file, and then load the Org file -with `org-babel-lob-ingest', which is bound to `C-c C-v i'. - - -File: org, Node: Languages, Next: Header arguments, Prev: Library of Babel, Up: Working with source code - -14.7 Languages -============== - -Org supports the following languages for the `src' code blocks: - -Language Identifier Language Identifier ----------------------------------------------------------------------------- -Asymptote asymptote Awk awk -C C C++ C++ -Clojure clojure CSS css -D d ditaa ditaa -Graphviz dot Emacs Calc calc -Emacs Lisp emacs-lisp Fortran fortran -gnuplot gnuplot Haskell haskell -Java java Javascript js -LaTeX latex Ledger ledger -Lisp lisp Lilypond lilypond -Lua lua MATLAB matlab -Mscgen mscgen Objective Caml ocaml -Octave octave Org mode org -Oz oz Perl perl -Plantuml plantuml Processing.js processing -Python python R R -Ruby ruby Sass sass -Scheme scheme GNU Screen screen -Sed sed shell sh -SQL sql SQLite sqlite -Vala vala - - Additional documentation for some languages are at -`http://orgmode.org/worg/org-contrib/babel/languages.html'. - - By default, only `emacs-lisp' is enabled for evaluation. To enable -or disable other languages, customize the `org-babel-load-languages' -variable either through the Emacs customization interface, or by adding -code to the init file as shown next: - - In this example, evaluation is disabled for `emacs-lisp', and enabled -for `R'. - - (org-babel-do-load-languages - 'org-babel-load-languages - '((emacs-lisp . nil) - (R . t))) - - Note that this is not the only way to enable a language. Org also -enables languages when loaded with `require' statement. For example, -the following enables execution of `clojure' code blocks: - - (require 'ob-clojure) - - -File: org, Node: Header arguments, Next: Results of evaluation, Prev: Languages, Up: Working with source code - -14.8 Header arguments -===================== - -Details of configuring header arguments are shown here. - -* Menu: - -* Using header arguments:: Different ways to set header arguments -* Specific header arguments:: List of header arguments - - -File: org, Node: Using header arguments, Next: Specific header arguments, Up: Header arguments - -14.8.1 Using header arguments ------------------------------ - -Since header arguments can be set in several ways, Org prioritizes them -in case of overlaps or conflicts by giving local settings a higher -priority. Header values in function calls, for example, override -header values from global defaults. - -* Menu: - -* System-wide header arguments:: Set globally, language-specific -* Language-specific header arguments:: Set in the Org file's headers -* Header arguments in Org mode properties:: Set in the Org file -* Language-specific mode properties:: -* Code block specific header arguments:: The most commonly used method -* Arguments in function calls:: The most specific level, takes highest priority - - -File: org, Node: System-wide header arguments, Next: Language-specific header arguments, Up: Using header arguments - -System-wide header arguments -............................ - -System-wide values of header arguments can be specified by adapting the -`org-babel-default-header-args' variable: - - :session => "none" - :results => "replace" - :exports => "code" - :cache => "no" - :noweb => "no" - - This example sets `:noweb' header arguments to `yes', which makes -Org expand `:noweb' references by default. - - (setq org-babel-default-header-args - (cons '(:noweb . "yes") - (assq-delete-all :noweb org-babel-default-header-args))) - - -File: org, Node: Language-specific header arguments, Next: Header arguments in Org mode properties, Prev: System-wide header arguments, Up: Using header arguments - -Language-specific header arguments -.................................. - -Each language can have separate default header arguments by customizing -the variable `org-babel-default-header-args:', where `' is -the name of the language. For details, see the language-specific online -documentation at `http://orgmode.org/worg/org-contrib/babel'. - - -File: org, Node: Header arguments in Org mode properties, Next: Language-specific mode properties, Prev: Language-specific header arguments, Up: Using header arguments - -Header arguments in Org mode properties -....................................... - -For header arguments applicable to the buffer, use `#+PROPERTY:' lines -anywhere in the Org mode file (*note Property syntax::). - - The following example sets only for `R' code blocks to `session', -making all the `R' code blocks execute in the same session. Setting -`results' to `silent' ignores the results of executions for all blocks, -not just `R' code blocks; no results inserted for any block. - - #+PROPERTY: header-args:R :session *R* - #+PROPERTY: header-args :results silent - - Header arguments set through Org's property drawers (*note Property -syntax::) apply at the sub-tree level on down. Since these property -drawers can appear anywhere in the file hierarchy, Org uses outermost -call or source block to resolve the values. Org ignores -`org-use-property-inheritance' setting. - - In this example, `:cache' defaults to `yes' for all code blocks in -the sub-tree starting with `sample header'. - - * sample header - :PROPERTIES: - :header-args: :cache yes - :END: - - Properties defined through `org-set-property' function, bound to -`C-c C-x p', apply to all active languages. They override properties -set in `org-babel-default-header-args'. - - -File: org, Node: Language-specific mode properties, Next: Code block specific header arguments, Prev: Header arguments in Org mode properties, Up: Using header arguments - -Language-specific mode properties -................................. - -Language-specific header arguments are also read from properties -`header-args:' where `' is the language identifier. For -example, - - * Heading - :PROPERTIES: - :header-args:clojure: :session *clojure-1* - :header-args:R: :session *R* - :END: - ** Subheading - :PROPERTIES: - :header-args:clojure: :session *clojure-2* - :END: - - would force separate sessions for clojure blocks in Heading and -Subheading, but use the same session for all `R' blocks. Blocks in -Subheading inherit settings from Heading. - - -File: org, Node: Code block specific header arguments, Next: Arguments in function calls, Prev: Language-specific mode properties, Up: Using header arguments - -Code block specific header arguments -.................................... - -Header arguments are most commonly set at the `src' code block level, on -the `#+BEGIN_SRC' line. Arguments set at this level take precedence -over those set in the `org-babel-default-header-args' variable, and also -those set as header properties. - - In the following example, setting `results' to `silent' makes it -ignore results of the code execution. Setting `:exports' to `code' -exports only the body of the `src' code block to HTML or LaTeX.: - - #+NAME: factorial - #+BEGIN_SRC haskell :results silent :exports code :var n=0 - fac 0 = 1 - fac n = n * fac (n-1) - #+END_SRC - - The same header arguments in an inline `src' code block: - - src_haskell[:exports both]{fac 5} - - Code block header arguments can span multiple lines using -`#+HEADER:' on each line. Note that Org currently accepts the plural -spelling of `#+HEADER:' only as a convenience for -backward-compatibility. It may be removed at some point. - - Multi-line header arguments on an unnamed `src' code block: - - #+HEADER: :var data1=1 - #+BEGIN_SRC emacs-lisp :var data2=2 - (message "data1:%S, data2:%S" data1 data2) - #+END_SRC - - #+RESULTS: - : data1:1, data2:2 - - Multi-line header arguments on a named `src' code block: - - #+NAME: named-block - #+HEADER: :var data=2 - #+BEGIN_SRC emacs-lisp - (message "data:%S" data) - #+END_SRC - - #+RESULTS: named-block - : data:2 - - -File: org, Node: Arguments in function calls, Prev: Code block specific header arguments, Up: Using header arguments - -Arguments in function calls -........................... - -Header arguments in function calls are the most specific and override -all other settings in case of an overlap. They get the highest -priority. Two `#+CALL:' examples are shown below. For the complete -syntax of `#+CALL:' lines, see *note Evaluating code blocks::. - - In this example, `:exports results' header argument is applied to the -evaluation of the `#+CALL:' line. - - #+CALL: factorial(n=5) :exports results - - In this example, `:session special' header argument is applied to the -evaluation of `factorial' code block. - - #+CALL: factorial[:session special](n=5) - - -File: org, Node: Specific header arguments, Prev: Using header arguments, Up: Header arguments - -14.8.2 Specific header arguments --------------------------------- - -Org comes with many header arguments common to all languages. New -header arguments are added for specific languages as they become -available for use in `src' code blocks. A header argument is specified -with an initial colon followed by the argument's name in lowercase. -Common header arguments are: - -* Menu: - -* var:: Pass arguments to `src' code blocks -* results:: Specify results type; how to collect -* file:: Specify a path for output file -* file-desc:: Specify a description for file results -* file-ext:: Specify an extension for file output -* output-dir:: Specify a directory for output file -* dir:: Specify the default directory for code block execution -* exports:: Specify exporting code, results, both, none -* tangle:: Toggle tangling; or specify file name -* mkdirp:: Toggle for parent directory creation for target files during tangling -* comments:: Toggle insertion of comments in tangled code files -* padline:: Control insertion of padding lines in tangled code files -* no-expand:: Turn off variable assignment and noweb expansion during tangling -* session:: Preserve the state of code evaluation -* noweb:: Toggle expansion of noweb references -* noweb-ref:: Specify block's noweb reference resolution target -* noweb-sep:: String to separate noweb references -* cache:: Avoid re-evaluating unchanged code blocks -* sep:: Delimiter for writing tabular results outside Org -* hlines:: Handle horizontal lines in tables -* colnames:: Handle column names in tables -* rownames:: Handle row names in tables -* shebang:: Make tangled files executable -* tangle-mode:: Set permission of tangled files -* eval:: Limit evaluation of specific code blocks -* wrap:: Mark source block evaluation results -* post:: Post processing of results of code block evaluation -* prologue:: Text to prepend to body of code block -* epilogue:: Text to append to body of code block - - For language-specific header arguments, see *note Languages::. - - -File: org, Node: var, Next: results, Up: Specific header arguments - -14.8.2.1 `:var' -............... - -Use `:var' for passing arguments to `src' code blocks. The specifics -of variables in `src' code blocks vary by the source language and are -covered in the language-specific documentation. The syntax for `:var', -however, is the same for all languages. This includes declaring a -variable, and assigning a default value. - - Arguments can take values as literals, or as references, or even as -Emacs Lisp code (*note Emacs Lisp evaluation of variables: var.). -References are names from the Org file from the lines `#+NAME:' or -`#+RESULTS:'. References can also refer to tables, lists, -`#+BEGIN_EXAMPLE' blocks, other types of `src' code blocks, or the -results of execution of `src' code blocks. - - For better performance, Org can cache results of evaluations. But -caching comes with severe limitations (*note cache::). - - Argument values are indexed like arrays (*note Indexable variable -values: var.). - - The following syntax is used to pass arguments to `src' code blocks -using the `:var' header argument. - - :var name=assign - - The `assign' is a literal value, such as a string `"string"', a -number `9', a reference to a table, a list, a literal example, another -code block (with or without arguments), or the results from evaluating -a code block. - - Here are examples of passing values by reference: - -"table" - an Org mode table named with either a `#+NAME:' line - - #+NAME: example-table - | 1 | - | 2 | - | 3 | - | 4 | - - #+NAME: table-length - #+BEGIN_SRC emacs-lisp :var table=example-table - (length table) - #+END_SRC - - #+RESULTS: table-length - : 4 - -"list" - a simple list named with a `#+NAME:' line. Note that only the top - level list items are passed along. Nested list items are ignored. - - #+NAME: example-list - - simple - - not - - nested - - list - - #+BEGIN_SRC emacs-lisp :var x=example-list - (print x) - #+END_SRC - - #+RESULTS: - | simple | list | - -"code block without arguments" - a code block name (from the example above), as assigned by - `#+NAME:', optionally followed by parentheses - - #+BEGIN_SRC emacs-lisp :var length=table-length() - (* 2 length) - #+END_SRC - - #+RESULTS: - : 8 - -"code block with arguments" - a `src' code block name, as assigned by `#+NAME:', followed by - parentheses and optional arguments passed within the parentheses - following the `src' code block name using standard function call - syntax - - #+NAME: double - #+BEGIN_SRC emacs-lisp :var input=8 - (* 2 input) - #+END_SRC - - #+RESULTS: double - : 16 - - #+NAME: squared - #+BEGIN_SRC emacs-lisp :var input=double(input=2) - (* input input) - #+END_SRC - - #+RESULTS: squared - : 4 - -"literal example" - a literal example block named with a `#+NAME:' line - - #+NAME: literal-example - #+BEGIN_EXAMPLE - A literal example - on two lines - #+END_EXAMPLE - - #+NAME: read-literal-example - #+BEGIN_SRC emacs-lisp :var x=literal-example - (concatenate 'string x " for you.") - #+END_SRC - - #+RESULTS: read-literal-example - : A literal example - : on two lines for you. - - -Indexable variable values -......................... - -Indexing variable values enables referencing portions of a variable. -Indexes are 0 based with negative values counting backwards from the -end. If an index is separated by `,'s then each subsequent section -will index as the next dimension. Note that this indexing occurs -_before_ other table-related header arguments are applied, such as -`:hlines', `:colnames' and `:rownames'. The following example assigns -the last cell of the first row the table `example-table' to the variable -`data': - - #+NAME: example-table - | 1 | a | - | 2 | b | - | 3 | c | - | 4 | d | - - #+BEGIN_SRC emacs-lisp :var data=example-table[0,-1] - data - #+END_SRC - - #+RESULTS: - : a - - Ranges of variable values can be referenced using two integers -separated by a `:', in which case the entire inclusive range is -referenced. For example the following assigns the middle three rows of -`example-table' to `data'. - - #+NAME: example-table - | 1 | a | - | 2 | b | - | 3 | c | - | 4 | d | - | 5 | 3 | - - #+BEGIN_SRC emacs-lisp :var data=example-table[1:3] - data - #+END_SRC - - #+RESULTS: - | 2 | b | - | 3 | c | - | 4 | d | - - To pick the entire range, use an empty index, or the single character -`*'. `0:-1' does the same thing. Example below shows how to reference -the first column only. - - #+NAME: example-table - | 1 | a | - | 2 | b | - | 3 | c | - | 4 | d | - - #+BEGIN_SRC emacs-lisp :var data=example-table[,0] - data - #+END_SRC - - #+RESULTS: - | 1 | 2 | 3 | 4 | - - Index referencing can be used for tables and code blocks. Index -referencing can handle any number of dimensions. Commas delimit -multiple dimensions, as shown below. - - #+NAME: 3D - #+BEGIN_SRC emacs-lisp - '(((1 2 3) (4 5 6) (7 8 9)) - ((10 11 12) (13 14 15) (16 17 18)) - ((19 20 21) (22 23 24) (25 26 27))) - #+END_SRC - - #+BEGIN_SRC emacs-lisp :var data=3D[1,,1] - data - #+END_SRC - - #+RESULTS: - | 11 | 14 | 17 | - -Emacs Lisp evaluation of variables -.................................. - -Emacs lisp code can set the values for variables. To differentiate a -value from lisp code, Org interprets any value starting with `(', `[', -`'' or ``' as Emacs Lisp code. The result of evaluating that code is -then assigned to the value of that variable. The following example -shows how to reliably query and pass file name of the Org mode buffer -to a code block using headers. We need reliability here because the -file's name could change once the code in the block starts executing. - - #+BEGIN_SRC sh :var filename=(buffer-file-name) :exports both - wc -w $filename - #+END_SRC - - Note that values read from tables and lists will not be mistakenly -evaluated as Emacs Lisp code, as illustrated in the following example. - - #+NAME: table - | (a b c) | - - #+HEADER: :var data=table[0,0] - #+BEGIN_SRC perl - $data - #+END_SRC - - #+RESULTS: - : (a b c) - - -File: org, Node: results, Next: file, Prev: var, Up: Specific header arguments - -14.8.2.2 `:results' -................... - -There are four classes of `:results' header arguments. Each `src' code -block can take only one option per class. - - * collection for how the results should be collected from the `src' - code block - - * type for which type of result the code block will return; affects - how Org processes and inserts results in the Org buffer - - * format for the result; affects how Org processes and inserts - results in the Org buffer - - * handling for processing results after evaluation of the `src' code - block - -Collection -.......... - -Collection options specify the results. Choose one of the options; -they are mutually exclusive. - - * `value' Default. Functional mode. Result is the value returned - by the last statement in the `src' code block. Languages like - Python may require an explicit `return' statement in the `src' - code block. Usage example: `:results value'. - - * `output' Scripting mode. Result is collected from STDOUT during - execution of the code in the `src' code block. Usage example: - `:results output'. - -Type -.... - -Type tells what result types to expect from the execution of the code -block. Choose one of the options; they are mutually exclusive. The -default behavior is to automatically determine the result type. - - * `table', `vector' Interpret the results as an Org table. If the - result is a single value, create a table with one row and one - column. Usage example: `:results value table'. - - * `list' Interpret the results as an Org list. If the result is a - single value, create a list of one element. - - * `scalar', `verbatim' Interpret literally and insert as quoted - text. Do not create a table. Usage example: `:results value - verbatim'. - - * `file' Interpret as path to a file. Inserts a link to the file. - Usage example: `:results value file'. - -Format -...... - -Format pertains to the type of the result returned by the `src' code -block. Choose one of the options; they are mutually exclusive. The -default follows from the type specified above. - - * `raw' Interpreted as raw Org mode. Inserted directly into the - buffer. Aligned if it is a table. Usage example: `:results value - raw'. - - * `org' Results enclosed in a `BEGIN_SRC org' block. For - comma-escape, either `TAB' in the block, or export the file. - Usage example: `:results value org'. - - * `html' Results enclosed in a `BEGIN_EXPORT html' block. Usage - example: `:results value html'. - - * `latex' Results enclosed in a `BEGIN_EXPORT latex' block. Usage - example: `:results value latex'. - - * `code' Result enclosed in a `src' code block. Useful for parsing. - Usage example: `:results value code'. - - * `pp' Result converted to pretty-print source code. Enclosed in a - `src' code block. Languages supported: Emacs Lisp, Python, and - Ruby. Usage example: `:results value pp'. - - * `drawer' Result wrapped in a RESULTS drawer. Useful for - containing `raw' or `org' results for later scripting and - automated processing. Usage example: `:results value drawer'. - -Handling -........ - -Handling options after collecting the results. - - * `silent' Do not insert results in the Org mode buffer, but echo - them in the minibuffer. Usage example: `:results output silent'. - - * `replace' Default. Insert results in the Org buffer. Remove - previous results. Usage example: `:results output replace'. - - * `append' Append results to the Org buffer. Latest results are at - the bottom. Does not remove previous results. Usage example: - `:results output append'. - - * `prepend' Prepend results to the Org buffer. Latest results are - at the top. Does not remove previous results. Usage example: - `:results output prepend'. - - -File: org, Node: file, Next: file-desc, Prev: results, Up: Specific header arguments - -14.8.2.3 `:file' -................ - -An external `:file' that saves the results of execution of the code -block. The `:file' is either a file name or two strings, where the -first is the file name and the second is the description. A link to -the file is inserted. It uses an Org mode style `[[file:]]' link -(*note Link format::). Some languages, such as `R', `dot', `ditaa', and -`gnuplot', automatically wrap the source code in additional boilerplate -code. Such code wrapping helps recreate the output, especially graphics -output, by executing just the `:file' contents. - - -File: org, Node: file-desc, Next: file-ext, Prev: file, Up: Specific header arguments - -14.8.2.4 `:file-desc' -..................... - -A description of the results file. Org uses this description for the -link (see *note Link format::) it inserts in the Org file. If the -`:file-desc' has no value, Org will use file name for both the "link" -and the "description" portion of the Org mode link. - - -File: org, Node: file-ext, Next: output-dir, Prev: file-desc, Up: Specific header arguments - -14.8.2.5 `:file-ext' -.................... - -File name extension for the output file. Org generates the file's -complete name, and extension by combining `:file-ext', `#+NAME:' of the -source block, and the *note output-dir:: header argument. To override -this auto generated file name, use the `:file' header argument. - - -File: org, Node: output-dir, Next: dir, Prev: file-ext, Up: Specific header arguments - -14.8.2.6 `:output-dir' -...................... - -Specifies the `:output-dir' for the results file. Org accepts an -absolute path (beginning with `/') or a relative directory (without -`/'). The value can be combined with `#+NAME:' of the source block and -*note file:: or *note file-ext:: header arguments. - - -File: org, Node: dir, Next: exports, Prev: output-dir, Up: Specific header arguments - -14.8.2.7 `:dir' and remote execution -.................................... - -While the `:file' header argument can be used to specify the path to the -output file, `:dir' specifies the default directory during `src' code -block execution. If it is absent, then the directory associated with -the current buffer is used. In other words, supplying `:dir path' -temporarily has the same effect as changing the current directory with -`M-x cd path RET', and then not supplying `:dir'. Under the surface, -`:dir' simply sets the value of the Emacs variable `default-directory'. - - When using `:dir', relative paths (for example, `:file myfile.jpg' -or `:file results/myfile.jpg') become relative to the default directory. - - For example, to save the plot file in the `Work' folder of the home -directory (notice tilde is expanded): - - #+BEGIN_SRC R :file myplot.png :dir ~/Work - matplot(matrix(rnorm(100), 10), type="l") - #+END_SRC - -Remote execution -................ - -To evaluate the `src' code block on a remote machine, supply a remote s -directory name using `Tramp' syntax. For example: - - #+BEGIN_SRC R :file plot.png :dir /scp:dand@yakuba.princeton.edu: - plot(1:10, main=system("hostname", intern=TRUE)) - #+END_SRC - - Org first captures the text results as usual for insertion in the -Org file. Then Org also inserts a link to the remote file, thanks to -Emacs `Tramp'. Org constructs the remote path to the file name from -`:dir' and `default-directory', as illustrated here: - - [[file:/scp:dand@yakuba.princeton.edu:/home/dand/plot.png][plot.png]] - -Some more warnings -.................. - - * When `:dir' is used with `:session', Org sets the starting - directory for a new session. But Org will not alter the directory - of an already existing session. - - * Do not use `:dir' with `:exports results' or with `:exports both' - to avoid Org inserting incorrect links to remote files. That is - because Org does not expand `default directory' to avoid some - underlying portability issues. - - -File: org, Node: exports, Next: tangle, Prev: dir, Up: Specific header arguments - -14.8.2.8 `:exports' -................... - -The `:exports' header argument is to specify if that part of the Org -file is exported to, say, HTML or LaTeX formats. Note that `:exports' -affects only `src' code blocks and not inline code. - - * `code' The default. The body of code is included into the - exported file. Example: `:exports code'. - - * `results' The results of evaluation of the code is included in the - exported file. Example: `:exports results'. - - * `both' Both the code and results of evaluation are included in the - exported file. Example: `:exports both'. - - * `none' Neither the code nor the results of evaluation is included - in the exported file. Whether the code is evaluated at all - depends on other options. Example: `:exports none'. - - -File: org, Node: tangle, Next: mkdirp, Prev: exports, Up: Specific header arguments - -14.8.2.9 `:tangle' -.................. - -The `:tangle' header argument specifies if the `src' code block is -exported to source file(s). - - * `tangle' Export the `src' code block to source file. The file - name for the source file is derived from the name of the Org file, - and the file extension is derived from the source code language - identifier. Example: `:tangle yes'. - - * `no' The default. Do not extract the code a source code file. - Example: `:tangle no'. - - * other Export the `src' code block to source file whose file name - is derived from any string passed to the `:tangle' header - argument. Org derives the file name as being relative to the - directory of the Org file's location. Example: `:tangle path'. - - -File: org, Node: mkdirp, Next: comments, Prev: tangle, Up: Specific header arguments - -14.8.2.10 `:mkdirp' -................... - -The `:mkdirp' header argument creates parent directories for tangled -files if the directory does not exist. `yes' enables directory creation -and `no' inhibits directory creation. - - -File: org, Node: comments, Next: padline, Prev: mkdirp, Up: Specific header arguments - -14.8.2.11 `:comments' -..................... - -Controls inserting comments into tangled files. These are above and -beyond whatever comments may already exist in the `src' code block. - - * `no' The default. Do not insert any extra comments during - tangling. - - * `link' Wrap the `src' code block in comments. Include links - pointing back to the place in the Org file from where the code was - tangled. - - * `yes' Kept for backward compatibility; same as "link". - - * `org' Nearest headline text from Org file is inserted as comment. - The exact text that is inserted is picked from the leading context - of the source block. - - * `both' Includes both "link" and "org" comment options. - - * `noweb' Includes "link" comment option, expands noweb references, - and wraps them in link comments inside the body of the `src' code - block. - - -File: org, Node: padline, Next: no-expand, Prev: comments, Up: Specific header arguments - -14.8.2.12 `:padline' -.................... - -Control insertion of newlines to pad `src' code blocks in the tangled -file. - * `yes' Default. Insert a newline before and after each `src' code - block in the tangled file. - - * `no' Do not insert newlines to pad the tangled `src' code blocks. - - -File: org, Node: no-expand, Next: session, Prev: padline, Up: Specific header arguments - -14.8.2.13 `:no-expand' -...................... - -By default Org expands `src' code blocks during tangling. The -`:no-expand' header argument turns off such expansions. Note that one -side-effect of expansion by `org-babel-expand-src-block' also assigns -values to `:var' (*note var::) variables. Expansions also replace Noweb -references with their targets (*note Noweb reference syntax::). Some of -these expansions may cause premature assignment, hence this option. -This option makes a difference only for tangling. It has no effect -when exporting since `src' code blocks for execution have to be -expanded anyway. - - -File: org, Node: session, Next: noweb, Prev: no-expand, Up: Specific header arguments - -14.8.2.14 `:session' -.................... - -The `:session' header argument is for running multiple source code -blocks under one session. Org runs `src' code blocks with the same -session name in the same interpreter process. - - * `none' Default. Each `src' code block gets a new interpreter - process to execute. The process terminates once the block is - evaluated. - - * `other' Any string besides `none' turns that string into the name - of that session. For example, `:session mysession' names it - `mysession'. If `:session' has no argument, then the session name - is derived from the source language identifier. Subsequent blocks - with the same source code language use the same session. - Depending on the language, state variables, code from other - blocks, and the overall interpreted environment may be shared. - Some interpreted languages support concurrent sessions when - subsequent source code language blocks change session names. - - -File: org, Node: noweb, Next: noweb-ref, Prev: session, Up: Specific header arguments - -14.8.2.15 `:noweb' -.................. - -The `:noweb' header argument controls expansion of Noweb syntax -references (*note Noweb reference syntax::). Expansions occur when -source code blocks are evaluated, tangled, or exported. - - * `no' Default. No expansion of Noweb syntax references in the body - of the code when evaluating, tangling, or exporting. - - * `yes' Expansion of Noweb syntax references in the body of the - `src' code block when evaluating, tangling, or exporting. - - * `tangle' Expansion of Noweb syntax references in the body of the - `src' code block when tangling. No expansion when evaluating or - exporting. - - * `no-export' Expansion of Noweb syntax references in the body of - the `src' code block when evaluating or tangling. No expansion - when exporting. - - * `strip-export' Expansion of Noweb syntax references in the body of - the `src' code block when expanding prior to evaluating or - tangling. Removes Noweb syntax references when exporting. - - * `eval' Expansion of Noweb syntax references in the body of the - `src' code block only before evaluating. - -Noweb prefix lines -.................. - -Noweb insertions now honor prefix characters that appear before the -Noweb syntax reference. - - This behavior is illustrated in the following example. Because the -`<>' noweb reference appears behind the SQL comment syntax, -each line of the expanded noweb reference will be commented. - - With: - - #+NAME: example - #+BEGIN_SRC text - this is the - multi-line body of example - #+END_SRC - - this `src' code block: - - #+BEGIN_SRC sql :noweb yes - -- <> - #+END_SRC - - expands to: - - -- this is the - -- multi-line body of example - - Since this change will not affect noweb replacement text without -newlines in them, inline noweb references are acceptable. - - This feature can also be used for management of indentation in -exported code snippets. - - With: - - #+NAME: if-true - #+BEGIN_SRC python :exports none - print('Do things when True') - #+END_SRC - - #+NAME: if-false - #+BEGIN_SRC python :exports none - print('Do things when False') - #+END_SRC - - this `src' code block: - - #+BEGIN_SRC python :noweb yes :results output - if True: - <> - else: - <> - #+END_SRC - - expands to: - - if True: - print('Do things when True') - else: - print('Do things when False') - - and evaluates to: - - Do things when True - - -File: org, Node: noweb-ref, Next: noweb-sep, Prev: noweb, Up: Specific header arguments - -14.8.2.16 `:noweb-ref' -...................... - -When expanding Noweb style references, Org concatenates `src' code -blocks by matching the reference name to either the code block name or -the `:noweb-ref' header argument. - - For simple concatenation, set this `:noweb-ref' header argument at -the sub-tree or file level. In the example Org file shown next, the -body of the source code in each block is extracted for concatenation to -a pure code file when tangled. - - #+BEGIN_SRC sh :tangle yes :noweb yes :shebang #!/bin/sh - <> - #+END_SRC - * the mount point of the fullest disk - :PROPERTIES: - :header-args: :noweb-ref fullest-disk - :END: - - ** query all mounted disks - #+BEGIN_SRC sh - df \ - #+END_SRC - - ** strip the header row - #+BEGIN_SRC sh - |sed '1d' \ - #+END_SRC - - ** output mount point of fullest disk - #+BEGIN_SRC sh - |awk '{if (u < +$5) {u = +$5; m = $6}} END {print m}' - #+END_SRC - - -File: org, Node: noweb-sep, Next: cache, Prev: noweb-ref, Up: Specific header arguments - -14.8.2.17 `:noweb-sep' -...................... - -By default a newline separates each noweb reference concatenation. To -change this newline separator, edit the `:noweb-sep' (*note -noweb-sep::) header argument. - - -File: org, Node: cache, Next: sep, Prev: noweb-sep, Up: Specific header arguments - -14.8.2.18 `:cache' -.................. - -The `:cache' header argument is for caching results of evaluating code -blocks. Caching results can avoid re-evaluating `src' code blocks that -have not changed since the previous run. To benefit from the cache and -avoid redundant evaluations, the source block must have a result -already present in the buffer, and neither the header arguments -(including the value of `:var' references) nor the text of the block -itself has changed since the result was last computed. This feature -greatly helps avoid long-running calculations. For some edge cases, -however, the cached results may not be reliable. - - The caching feature is best for when `src' blocks are pure functions, -that is functions that return the same value for the same input -arguments (*note var::), and that do not have side effects, and do not -rely on external variables other than the input arguments. Functions -that depend on a timer, file system objects, and random number -generators are clearly unsuitable for caching. - - A note of warning: when `:cache' is used for a `:session', caching -may cause unexpected results. - - When the caching mechanism tests for any source code changes, it -will not expand Noweb style references (*note Noweb reference -syntax::). For reasons why, see -`http://thread.gmane.org/gmane.emacs.orgmode/79046'. - - The `:cache' header argument can have one of two values: `yes' or -`no'. - - * `no' Default. No caching of results; `src' code block evaluated - every time. - - * `yes' Whether to run the code or return the cached results is - determined by comparing the SHA1 hash value of the combined `src' - code block and arguments passed to it. This hash value is packed - on the `#+RESULTS:' line from previous evaluation. When hash - values match, Org does not evaluate the `src' code block. When - hash values mismatch, Org evaluates the `src' code block, inserts - the results, recalculates the hash value, and updates `#+RESULTS:' - line. - - In this example, both functions are cached. But `caller' runs only -if the result from `random' has changed since the last run. - - #+NAME: random - #+BEGIN_SRC R :cache yes - runif(1) - #+END_SRC - - #+RESULTS[a2a72cd647ad44515fab62e144796432793d68e1]: random - 0.4659510825295 - - #+NAME: caller - #+BEGIN_SRC emacs-lisp :var x=random :cache yes - x - #+END_SRC - - #+RESULTS[bec9c8724e397d5df3b696502df3ed7892fc4f5f]: caller - 0.254227238707244 - - -File: org, Node: sep, Next: hlines, Prev: cache, Up: Specific header arguments - -14.8.2.19 `:sep' -................ - -The `:sep' header argument is the delimiter for saving results as tables -to files (*note file::) external to Org mode. Org defaults to tab -delimited output. The function, `org-open-at-point', which is bound to -`C-c C-o', also uses `:sep' for opening tabular results. - - -File: org, Node: hlines, Next: colnames, Prev: sep, Up: Specific header arguments - -14.8.2.20 `:hlines' -................... - -In-between each table row or below the table headings, sometimes -results have horizontal lines, which are also known as hlines. The -`:hlines' argument with the value `yes' accepts such lines. The -default is `no'. - - * `no' Strips horizontal lines from the input table. For most code, - this is desirable, or else those `hline' symbols raise unbound - variable errors. - - The default is `:hlines no'. The example shows hlines removed - from the input table. - - #+NAME: many-cols - | a | b | c | - |---+---+---| - | d | e | f | - |---+---+---| - | g | h | i | - - #+NAME: echo-table - #+BEGIN_SRC python :var tab=many-cols - return tab - #+END_SRC - - #+RESULTS: echo-table - | a | b | c | - | d | e | f | - | g | h | i | - - * `yes' For `:hlines yes', the example shows hlines unchanged. - - #+NAME: many-cols - | a | b | c | - |---+---+---| - | d | e | f | - |---+---+---| - | g | h | i | - - #+NAME: echo-table - #+BEGIN_SRC python :var tab=many-cols :hlines yes - return tab - #+END_SRC - - #+RESULTS: echo-table - | a | b | c | - |---+---+---| - | d | e | f | - |---+---+---| - | g | h | i | - - -File: org, Node: colnames, Next: rownames, Prev: hlines, Up: Specific header arguments - -14.8.2.21 `:colnames' -..................... - -The `:colnames' header argument accepts `yes', `no', or `nil' values. -The default value is `nil', which is unassigned. But this header -argument behaves differently depending on the source code language. - - * `nil' If an input table has column names (because the second row - is an hline), then Org removes the column names, processes the - table, puts back the column names, and then writes the table to - the results block. - - #+NAME: less-cols - | a | - |---| - | b | - | c | - - #+NAME: echo-table-again - #+BEGIN_SRC python :var tab=less-cols - return [[val + '*' for val in row] for row in tab] - #+END_SRC - - #+RESULTS: echo-table-again - | a | - |----| - | b* | - | c* | - - Note that column names have to accounted for when using variable - indexing (*note Indexable variable values: var.) because column - names are not removed for indexing. - - * `no' Do not pre-process column names. - - * `yes' For an input table that has no hlines, process it like the - `nil' value. That is, Org removes the column names, processes the - table, puts back the column names, and then writes the table to - the results block. - - -File: org, Node: rownames, Next: shebang, Prev: colnames, Up: Specific header arguments - -14.8.2.22 `:rownames' -..................... - -The `:rownames' header argument can take on values `yes' or `no' -values. The default is `no'. Note that `emacs-lisp' code blocks -ignore `:rownames' header argument because of the ease of -table-handling in Emacs. - - * `no' Org will not pre-process row names. - - * `yes' If an input table has row names, then Org removes the row - names, processes the table, puts back the row names, and then - writes the table to the results block. - - #+NAME: with-rownames - | one | 1 | 2 | 3 | 4 | 5 | - | two | 6 | 7 | 8 | 9 | 10 | - - #+NAME: echo-table-once-again - #+BEGIN_SRC python :var tab=with-rownames :rownames yes - return [[val + 10 for val in row] for row in tab] - #+END_SRC - - #+RESULTS: echo-table-once-again - | one | 11 | 12 | 13 | 14 | 15 | - | two | 16 | 17 | 18 | 19 | 20 | - - Note that row names have to accounted for when using variable - indexing (*note Indexable variable values: var.) because row names - are not removed for indexing. - - - -File: org, Node: shebang, Next: tangle-mode, Prev: rownames, Up: Specific header arguments - -14.8.2.23 `:shebang' -.................... - -This header argument can turn results into executable script files. By -setting the `:shebang' header argument to a string value (for example, -`:shebang "#!/bin/bash"'), Org inserts that string as the first line of -the tangled file that the `src' code block is extracted to. Org then -turns on the tangled file's executable permission. - - -File: org, Node: tangle-mode, Next: eval, Prev: shebang, Up: Specific header arguments - -14.8.2.24 `:tangle-mode' -........................ - -The `tangle-mode' header argument specifies what permissions to set for -tangled files by `set-file-modes'. For example, to make read-only -tangled file, use `:tangle-mode (identity #o444)'. To make it -executable, use `:tangle-mode (identity #o755)'. - - On `src' code blocks with `shebang' (*note shebang::) header -argument, Org will automatically set the tangled file to executable -permissions. But this can be overridden with custom permissions using -`tangle-mode' header argument. - - When multiple `src' code blocks tangle to a single file with -different and conflicting `tangle-mode' header arguments, Org's -behavior is undefined. - - -File: org, Node: eval, Next: wrap, Prev: tangle-mode, Up: Specific header arguments - -14.8.2.25 `:eval' -................. - -The `:eval' header argument can limit evaluation of specific code -blocks. It is useful for protection against evaluating untrusted `src' -code blocks by prompting for a confirmation. This protection is -independent of the `org-confirm-babel-evaluate' setting. - -`never or no' - Org will never evaluate this `src' code block. - -`query' - Org prompts the user for permission to evaluate this `src' code - block. - -`never-export or no-export' - Org will not evaluate this `src' code block when exporting, yet - the user can evaluate this source block interactively. - -`query-export' - Org prompts the user for permission to export this `src' code - block. - - If `:eval' header argument is not set for a source block, then Org -determines whether to evaluate from the `org-confirm-babel-evaluate' -variable (*note Code evaluation security::). - - -File: org, Node: wrap, Next: post, Prev: eval, Up: Specific header arguments - -14.8.2.26 `:wrap' -................. - -The `:wrap' header argument marks the results block by appending strings -to `#+BEGIN_' and `#+END_'. If no string is specified, Org wraps the -results in a `#+BEGIN/END_RESULTS' block. - - -File: org, Node: post, Next: prologue, Prev: wrap, Up: Specific header arguments - -14.8.2.27 `:post' -................. - -The `:post' header argument is for post-processing results from `src' -block evaluation. When `:post' has any value, Org binds the results to -`*this*' variable for easy passing to *note var:: header argument -specifications. That makes results available to other `src' code -blocks, or for even direct Emacs Lisp code execution. - - The following two examples illustrate `:post' header argument in -action. The first one shows how to attach `#+ATTR_LATEX:' line using -`:post'. - - #+name: attr_wrap - #+begin_src sh :var data="" :var width="\\textwidth" :results output - echo "#+ATTR_LATEX: :width $width" - echo "$data" - #+end_src - - #+header: :file /tmp/it.png - #+begin_src dot :post attr_wrap(width="5cm", data=*this*) :results drawer - digraph{ - a -> b; - b -> c; - c -> a; - } - #+end_src - - #+RESULTS: - :RESULTS: - #+ATTR_LATEX :width 5cm - [[file:/tmp/it.png]] - :END: - - The second example shows use of `:colnames' in `:post' to pass data -between `src' code blocks. - - #+name: round-tbl - #+begin_src emacs-lisp :var tbl="" fmt="%.3f" - (mapcar (lambda (row) - (mapcar (lambda (cell) - (if (numberp cell) - (format fmt cell) - cell)) - row)) - tbl) - #+end_src - - #+begin_src R :colnames yes :post round-tbl[:colnames yes](*this*) - set.seed(42) - data.frame(foo=rnorm(1)) - #+end_src - - #+RESULTS: - | foo | - |-------| - | 1.371 | - - -File: org, Node: prologue, Next: epilogue, Prev: post, Up: Specific header arguments - -14.8.2.28 `:prologue' -..................... - -The `prologue' header argument is for appending to the top of the code -block for execution. For example, a clear or reset code at the start -of new execution of a `src' code block. A `reset' for `gnuplot': -`:prologue "reset"'. See also *note epilogue::. - - (add-to-list 'org-babel-default-header-args:gnuplot - '((:prologue . "reset"))) - - -File: org, Node: epilogue, Prev: prologue, Up: Specific header arguments - -14.8.2.29 `:epilogue' -..................... - -The value of the `epilogue' header argument is for appending to the end -of the code block for execution. See also *note prologue::. - - -File: org, Node: Results of evaluation, Next: Noweb reference syntax, Prev: Header arguments, Up: Working with source code - -14.9 Results of evaluation -========================== - -How Org handles results of a code block execution depends on many header -arguments working together. Here is only a summary of these. For an -enumeration of all the header arguments that affect results, see *note -results::. - - The primary determinant is the execution context. Is it in a -`:session' or not? Orthogonal to that is if the expected result is a -`:results value' or `:results output', which is a concatenation of -output from start to finish of the `src' code block's evaluation. - - Non-session Session -`:results value' value of last value of last expression - expression -`:results output' contents of STDOUT concatenation of interpreter - output - - For `:session' and non-session, the `:results value' turns the -results into an Org mode table format. Single values are wrapped in a -one dimensional vector. Rows and columns of a table are wrapped in a -two-dimensional vector. - -14.9.1 Non-session ------------------- - -14.9.1.1 `:results value' -......................... - -Default. Org gets the value by wrapping the code in a function -definition in the language of the `src' block. That is why when using -`:results value', code should execute like a function and return a -value. For languages like Python, an explicit `return' statement is -mandatory when using `:results value'. - - This is one of four evaluation contexts where Org automatically -wraps the code in a function definition. - -14.9.1.2 `:results output' -.......................... - -For `:results output', the code is passed to an external process running -the interpreter. Org returns the contents of the standard output -stream as as text results. - -14.9.2 Session --------------- - -14.9.2.1 `:results value' -......................... - -For `:results value' from a `:session', Org passes the code to an -interpreter running as an interactive Emacs inferior process. So only -languages that provide interactive evaluation can have session support. -Not all languages provide this support, such as `C' and `ditaa'. Even -those that do support, such as `Python' and `Haskell', they impose -limitations on allowable language constructs that can run -interactively. Org inherits those limitations for those `src' code -blocks running in a `:session'. - - Org gets the value from the source code interpreter's last statement -output. Org has to use language-specific methods to obtain the value. -For example, from the variable `_' in `Python' and `Ruby', and the -value of `.Last.value' in `R'). - -14.9.2.2 `:results output' -.......................... - -For `:results output', Org passes the code to the interpreter running as -an interactive Emacs inferior process. Org concatenates whatever text -output emitted by the interpreter to return the collection as a result. -Note that this collection is not the same as collected from `STDOUT' of -a non-interactive interpreter running as an external process. Compare -for example these two blocks: - - #+BEGIN_SRC python :results output - print "hello" - 2 - print "bye" - #+END_SRC - - #+RESULTS: - : hello - : bye - - In the above non-session mode, the "2" is not printed; so does not -appear in results. - - #+BEGIN_SRC python :results output :session - print "hello" - 2 - print "bye" - #+END_SRC - - #+RESULTS: - : hello - : 2 - : bye - - In the above `:session' mode, the interactive interpreter receives -and prints "2". Results show that. - - -File: org, Node: Noweb reference syntax, Next: Key bindings and useful functions, Prev: Results of evaluation, Up: Working with source code - -14.10 Noweb reference syntax -============================ - -Org supports named blocks in Noweb style syntax. For Noweb literate -programming details, see `http://www.cs.tufts.edu/~nr/noweb/'). - - <> - - For the header argument `:noweb yes', Org expands Noweb style -references in the `src' code block before evaluation. - - For the header argument `:noweb no', Org does not expand Noweb style -references in the `src' code block before evaluation. - - The default is `:noweb no'. Org defaults to `:noweb no' so as not -to cause errors in languages where Noweb syntax is ambiguous. Change -Org's default to `:noweb yes' for languages where there is no risk of -confusion. - - Org offers a more flexible way to resolve Noweb style references -(*note noweb-ref::). - - Org can include the _results_ of a code block rather than its body. -To that effect, append parentheses, possibly including arguments, to -the code block name, as show below. - - <> - - Note that when using the above approach to a code block's results, -the code block name set by `#+NAME' keyword is required; the reference -set by `:noweb-ref' will not work. - - Here is an example that demonstrates how the exported content -changes when Noweb style references are used with parentheses versus -without. - - With: - - #+NAME: some-code - #+BEGIN_SRC python :var num=0 :results output :exports none - print(num*10) - #+END_SRC - - this code block: - - #+BEGIN_SRC text :noweb yes - <> - #+END_SRC - - expands to: - - print(num*10) - - Below, a similar Noweb style reference is used, but with -parentheses, while setting a variable `num' to 10: - - #+BEGIN_SRC text :noweb yes - <> - #+END_SRC - - Note that now the expansion contains the _results_ of the code block -`some-code', not the code block itself: - - 100 - - For faster tangling of large Org mode files, set -`org-babel-use-quick-and-dirty-noweb-expansion' variable to `t'. The -speedup comes at the expense of not correctly resolving inherited values -of the `:noweb-ref' header argument. - - -File: org, Node: Key bindings and useful functions, Next: Batch execution, Prev: Noweb reference syntax, Up: Working with source code - -14.11 Key bindings and useful functions -======================================= - -Many common Org mode key sequences are re-bound depending on the -context. - - Active key bindings in code blocks: - -`C-c C-c' `org-babel-execute-src-block' -`C-c C-o' `org-babel-open-src-block-result' -`M-' `org-babel-load-in-session' -`M-' `org-babel-switch-to-session' - - Active key bindings in Org mode buffer: - -`C-c C-v p' or `C-c C-v C-p' `org-babel-previous-src-block' -`C-c C-v n' or `C-c C-v C-n' `org-babel-next-src-block' -`C-c C-v e' or `C-c C-v C-e' `org-babel-execute-maybe' -`C-c C-v o' or `C-c C-v C-o' `org-babel-open-src-block-result' -`C-c C-v v' or `C-c C-v C-v' `org-babel-expand-src-block' -`C-c C-v u' or `C-c C-v C-u' `org-babel-goto-src-block-head' -`C-c C-v g' or `C-c C-v C-g' `org-babel-goto-named-src-block' -`C-c C-v r' or `C-c C-v C-r' `org-babel-goto-named-result' -`C-c C-v b' or `C-c C-v C-b' `org-babel-execute-buffer' -`C-c C-v s' or `C-c C-v C-s' `org-babel-execute-subtree' -`C-c C-v d' or `C-c C-v C-d' `org-babel-demarcate-block' -`C-c C-v t' or `C-c C-v C-t' `org-babel-tangle' -`C-c C-v f' or `C-c C-v C-f' `org-babel-tangle-file' -`C-c C-v c' or `C-c C-v C-c' `org-babel-check-src-block' -`C-c C-v j' or `C-c C-v C-j' `org-babel-insert-header-arg' -`C-c C-v l' or `C-c C-v C-l' `org-babel-load-in-session' -`C-c C-v i' or `C-c C-v C-i' `org-babel-lob-ingest' -`C-c C-v I' or `C-c C-v C-I' `org-babel-view-src-block-info' -`C-c C-v z' or `C-c C-v C-z' `org-babel-switch-to-session-with-code' -`C-c C-v a' or `C-c C-v C-a' `org-babel-sha1-hash' -`C-c C-v h' or `C-c C-v C-h' `org-babel-describe-bindings' -`C-c C-v x' or `C-c C-v C-x' `org-babel-do-key-sequence-in-edit-buffer' - - -File: org, Node: Batch execution, Prev: Key bindings and useful functions, Up: Working with source code - -14.12 Batch execution -===================== - -Org mode features, including working with source code facilities can be -invoked from the command line. This enables building shell scripts for -batch processing, running automated system tasks, and expanding Org -mode's usefulness. - - The sample script shows batch processing of multiple files using -`org-babel-tangle'. - - #!/bin/sh - # tangle files with org-mode - # - emacs -Q --batch --eval " - (progn - (require 'ob-tangle) - (dolist (file command-line-args-left) - (with-current-buffer (find-file-noselect file) - (org-babel-tangle)))) - " "$@" - - -File: org, Node: Miscellaneous, Next: Hacking, Prev: Working with source code, Up: Top - -15 Miscellaneous -**************** - -* Menu: - -* Completion:: M-TAB guesses completions -* Easy templates:: Quick insertion of structural elements -* Speed keys:: Electric commands at the beginning of a headline -* Code evaluation security:: Org mode files evaluate inline code -* Customization:: Adapting Org to changing tastes -* In-buffer settings:: Overview of the #+KEYWORDS -* The very busy C-c C-c key:: When in doubt, press C-c C-c -* Clean view:: Getting rid of leading stars in the outline -* TTY keys:: Using Org on a tty -* Interaction:: With other Emacs packages -* org-crypt:: Encrypting Org files - - -File: org, Node: Completion, Next: Easy templates, Up: Miscellaneous - -15.1 Completion -=============== - -Org has in-buffer completions. Unlike minibuffer completions, which are -useful for quick command interactions, Org's in-buffer completions are -more suitable for content creation in Org documents. Type one or more -letters and invoke the hot key to complete the text in-place. -Depending on the context and the keys, Org will offer different types -of completions. No minibuffer is involved. Such mode-specific hot -keys have become an integral part of Emacs and Org provides several -shortcuts. - -`M-' - Complete word at point - * At the beginning of a headline, complete TODO keywords. - - * After `\', complete TeX symbols supported by the exporter. - - * After `*', complete headlines in the current buffer so that - they can be used in search links like `[[*find this - headline]]'. - - * After `:' in a headline, complete tags. The list of tags is - taken from the variable `org-tag-alist' (possibly set through - the `#+TAGS' in-buffer option, *note Setting tags::), or it - is created dynamically from all tags used in the current - buffer. - - * After `:' and not in a headline, complete property keys. The - list of keys is constructed dynamically from all keys used in - the current buffer. - - * After `[', complete link abbreviations (*note Link - abbreviations::). - - * After `#+', complete the special keywords like `TYP_TODO' or - file-specific `OPTIONS'. After option keyword is complete, - pressing `M-' again will insert example settings for - that option. - - * After `#+STARTUP: ', complete startup keywords. - - * When the point is anywhere else, complete dictionary words - using Ispell. - If your desktop intercepts the combo `M-' to switch windows, - use `C-M-i' or ` ' as an alternative or customize your - environment. - - -File: org, Node: Easy templates, Next: Speed keys, Prev: Completion, Up: Miscellaneous - -15.2 Easy templates -=================== - -With just a few keystrokes, Org's easy templates inserts empty pairs of -structural elements, such as `#+BEGIN_SRC' and `#+END_SRC'. Easy -templates use an expansion mechanism, which is native to Org, in a -process similar to `yasnippet' and other Emacs template expansion -packages. - - `<' `s' `' expands to a `src' code block. - - `<' `l' `' expands to: - - #+BEGIN_EXPORT latex - - #+END_EXPORT - - Org comes with these pre-defined easy templates: - -`s' `#+BEGIN_SRC ... #+END_SRC' -`e' `#+BEGIN_EXAMPLE ... #+END_EXAMPLE' -`q' `#+BEGIN_QUOTE ... #+END_QUOTE' -`v' `#+BEGIN_VERSE ... #+END_VERSE' -`c' `#+BEGIN_CENTER ... #+END_CENTER' -`C' `#+BEGIN_COMMENT ... #+END_COMMENT' -`l' `#+BEGIN_EXPORT latex ... #+END_EXPORT' -`L' `#+LATEX:' -`h' `#+BEGIN_EXPORT html ... #+END_EXPORT' -`H' `#+HTML:' -`a' `#+BEGIN_EXPORT ascii ... #+END_EXPORT' -`A' `#+ASCII:' -`i' `#+INDEX:' line -`I' `#+INCLUDE:' line - - More templates can added by customizing the variable -`org-structure-template-alist', whose docstring has additional details. - - -File: org, Node: Speed keys, Next: Code evaluation security, Prev: Easy templates, Up: Miscellaneous - -15.3 Speed keys -=============== - -Single keystrokes can execute custom commands in an Org file when the -cursor is on a headline. Without the extra burden of a meta or -modifier key, Speed Keys can speed navigation or execute custom -commands. Besides faster navigation, Speed Keys may come in handy on -small mobile devices that do not have full keyboards. Speed Keys may -also work on TTY devices known for their problems when entering Emacs -keychords. - - By default, Org has Speed Keys disabled. To activate Speed Keys, -set the variable `org-use-speed-commands' to a non-`nil' value. To -trigger a Speed Key, the cursor must be at the beginning of an Org -headline, before any of the stars. - - Org comes with a pre-defined list of Speed Keys. To add or modify -Speed Keys, customize the variable, `org-speed-commands-user'. For more -details, see the variable's docstring. With Speed Keys activated, `M-x -org-speed-command-help', or `?' when cursor is at the beginning of an -Org headline, shows currently active Speed Keys, including the -user-defined ones. - - -File: org, Node: Code evaluation security, Next: Customization, Prev: Speed keys, Up: Miscellaneous - -15.4 Code evaluation and security issues -======================================== - -Unlike plain text, running code comes with risk. Each `src' code block, -in terms of risk, is equivalent to an executable file. Org therefore -puts a few confirmation prompts by default. This is to alert the -casual user from accidentally running untrusted code. - - For users who do not run code blocks or write code regularly, Org's -default settings should suffice. However, some users may want to tweak -the prompts for fewer interruptions. To weigh the risks of automatic -execution of code blocks, here are some details about code evaluation. - - Org evaluates code in the following circumstances: - -Source code blocks - Org evaluates `src' code blocks in an Org file during export. Org - also evaluates a `src' code block with the `C-c C-c' key chord. - Users exporting or running code blocks must load files only from - trusted sources. Be wary of customizing variables that remove or - alter default security measures. - - -- User Option: org-confirm-babel-evaluate - When `t', Org prompts the user for confirmation before - executing each code block. When `nil', Org executes code - blocks without prompting the user for confirmation. When - this option is set to a custom function, Org invokes the - function with these two arguments: the source code language - and the body of the code block. The custom function must - return either a `t' or `nil', which determines if the user is - prompted. Each source code language can be handled - separately through this function argument. - - For example, this function enables execution of `ditaa' code - +blocks without prompting: - - (defun my-org-confirm-babel-evaluate (lang body) - (not (string= lang "ditaa"))) ; don't ask for ditaa - (setq org-confirm-babel-evaluate 'my-org-confirm-babel-evaluate) - -Following `shell' and `elisp' links - Org has two link types that can also directly evaluate code (*note - External links::). Because such code is not visible, these links - have a potential risk. Org therefore prompts the user when it - encounters such links. The customization variables are: - - -- User Option: org-confirm-shell-link-function - Function that prompts the user before executing a shell link. - - -- User Option: org-confirm-elisp-link-function - Function that prompts the user before executing an Emacs Lisp - link. - -Formulas in tables - Org executes formulas in tables (*note The spreadsheet::) either - through the _calc_ or the _Emacs Lisp_ interpreters. - - -File: org, Node: Customization, Next: In-buffer settings, Prev: Code evaluation security, Up: Miscellaneous - -15.5 Customization -================== - -Org has more than 500 variables for customization. They can be accessed -through the usual `M-x org-customize RET' command. Or through the Org -menu, `Org->Customization->Browse Org Group'. Org also has per-file -settings for some variables (*note In-buffer settings::). - - -File: org, Node: In-buffer settings, Next: The very busy C-c C-c key, Prev: Customization, Up: Miscellaneous - -15.6 Summary of in-buffer settings -================================== - -In-buffer settings start with `#+', followed by a keyword, a colon, and -then a word for each setting. Org accepts multiple settings on the same -line. Org also accepts multiple lines for a keyword. This manual -describes these settings throughout. A summary follows here. - - `C-c C-c' activates any changes to the in-buffer settings. Closing -and reopening the Org file in Emacs also activates the changes. - -`#+ARCHIVE: %s_done::' - Sets the archive location of the agenda file. This location - applies to the lines until the next `#+ARCHIVE' line, if any, in - the Org file. The first archive location in the Org file also - applies to any entries before it. The corresponding variable is - `org-archive-location'. - -`#+CATEGORY:' - Sets the category of the agenda file, which applies to the entire - document. - -`#+COLUMNS: %25ITEM ...' - Sets the default format for columns view. Org uses this format - for column views where there is no `COLUMNS' property. - -`#+CONSTANTS: name1=value1 ...' - Set file-local values for constants that table formulas can use. - This line sets the local variable - `org-table-formula-constants-local'. The global version of this - variable is `org-table-formula-constants'. - -`#+FILETAGS: :tag1:tag2:tag3:' - Set tags that all entries in the file will inherit from here, - including the top-level entries. - -`#+LINK: linkword replace' - Each line specifies one abbreviation for one link. Use multiple - `#+LINK:' lines for more, *note Link abbreviations::. The - corresponding variable is `org-link-abbrev-alist'. - -`#+PRIORITIES: highest lowest default' - This line sets the limits and the default for the priorities. All - three must be either letters A-Z or numbers 0-9. The highest - priority must have a lower ASCII number than the lowest priority. - -`#+PROPERTY: Property_Name Value' - This line sets a default inheritance value for entries in the - current buffer, most useful for specifying the allowed values of a - property. - -`#+SETUPFILE: file or URL' - The setup file or a URL pointing to such file is for additional - in-buffer settings. Org loads this file and parses it for any - settings in it only when Org opens the main file. If URL is - specified, the contents are downloaded and stored in a temporary - file cache. `C-c C-c' on the settings line will parse and load - the file, and also reset the temporary file cache. Org also - parses and loads the document during normal exporting process. Org - parses the contents of this document as if it was included in the - buffer. It can be another Org file. To visit the file (not a - URL), `C-c '' while the cursor is on the line with the file name. - -`#+STARTUP:' - Startup options Org uses when first visiting a file. - - The first set of options deals with the initial visibility of the - outline tree. The corresponding variable for global default - settings is `org-startup-folded' with a default value of `t', - which is the same as `overview'. - - overview top-level headlines only - content all headlines - showall no folding of any entries - showeverything show even drawer contents - - Dynamic virtual indentation is controlled by the variable - `org-startup-indented' - indent start with `org-indent-mode' turned on - noindent start with `org-indent-mode' turned off - - Aligns tables consistently upon visiting a file; useful for - restoring narrowed table columns. The corresponding variable is - `org-startup-align-all-tables' with `nil' as default value. - - align align all tables - noalign don't align tables on startup - - Whether Org should automatically display inline images. The - corresponding variable is `org-startup-with-inline-images', with a - default value `nil' to avoid delays when visiting a file. - inlineimages show inline images - noinlineimages don't show inline images on startup - - Whether Org should automatically convert LaTeX fragments to - images. The variable `org-startup-with-latex-preview', which - controls this setting, is set to `nil' by default to avoid startup - delays. - latexpreview preview LaTeX fragments - nolatexpreview don't preview LaTeX fragments - - Logging the closing and reopening of TODO items and clock - intervals can be configured using these options (see variables - `org-log-done', `org-log-note-clock-out' and `org-log-repeat') - logdone record a timestamp when an item is marked DONE - lognotedone record timestamp and a note when DONE - nologdone don't record when items are marked DONE - logrepeat record a time when reinstating a repeating item - lognoterepeat record a note when reinstating a repeating item - nologrepeat do not record when reinstating repeating item - lognoteclock-out record a note when clocking out - nolognoteclock-out don't record a note when clocking out - logreschedule record a timestamp when scheduling time changes - lognotereschedule record a note when scheduling time changes - nologreschedule do not record when a scheduling date changes - logredeadline record a timestamp when deadline changes - lognoteredeadline record a note when deadline changes - nologredeadline do not record when a deadline date changes - logrefile record a timestamp when refiling - lognoterefile record a note when refiling - nologrefile do not record when refiling - logdrawer store log into drawer - nologdrawer store log outside of drawer - logstatesreversed reverse the order of states notes - nologstatesreversed do not reverse the order of states notes - - These options hide leading stars in outline headings, and indent - outlines. The corresponding variables are - `org-hide-leading-stars' and `org-odd-levels-only', both with a - default setting of `nil' (meaning `showstars' and `oddeven'). - hidestars hide all stars on the headline except one. - showstars show all stars on the headline - indent virtual indents according to the outline level - noindent no virtual indents - odd show odd outline levels only (1,3,...) - oddeven show all outline levels - - To turn on custom format overlays over timestamps (variables - `org-put-time-stamp-overlays' and - `org-time-stamp-overlay-formats'), use - customtime overlay custom time format - - The following options influence the table spreadsheet (variable - `constants-unit-system'). - constcgs `constants.el' should use the c-g-s unit system - constSI `constants.el' should use the SI unit system - - For footnote settings, use the following keywords. The - corresponding variables are `org-footnote-define-inline', - `org-footnote-auto-label', and `org-footnote-auto-adjust'. - fninline define footnotes inline - fnnoinline define footnotes in separate section - fnlocal define footnotes near first reference, but not inline - fnprompt prompt for footnote labels - fnauto create `[fn:1]'-like labels automatically (default) - fnconfirm offer automatic label for editing or confirmation - fnplain create `[1]'-like labels automatically - fnadjust automatically renumber and sort footnotes - nofnadjust do not renumber and sort automatically - - To hide blocks on startup, use these keywords. The corresponding - variable is `org-hide-block-startup'. - hideblocks Hide all begin/end blocks on startup - nohideblocks Do not hide blocks on startup - - The display of entities as UTF-8 characters is governed by the - variable `org-pretty-entities' and the keywords - entitiespretty Show entities as UTF-8 characters where possible - entitiesplain Leave entities plain - -`#+TAGS: TAG1(c1) TAG2(c2)' - These lines specify valid tags for this file. Org accepts - multiple tags lines. Tags could correspond to the _fast tag - selection_ keys. The corresponding variable is `org-tag-alist'. - -`#+TBLFM:' - This line is for formulas for the table directly above. A table - can have multiple `#+TBLFM:' lines. On table recalculation, Org - applies only the first `#+TBLFM:' line. For details see *note - Using multiple #+TBLFM lines:: in *note Editing and debugging - formulas::. - -`#+TITLE:, #+AUTHOR:, #+EMAIL:, #+LANGUAGE:, #+DATE:,' -`#+OPTIONS:, #+BIND:,' -`#+SELECT_TAGS:, #+EXCLUDE_TAGS:' - These lines provide settings for exporting files. For more - details see *note Export settings::. - -`#+TODO: #+SEQ_TODO: #+TYP_TODO:' - These lines set the TODO keywords and their significance to the - current file. The corresponding variable is `org-todo-keywords'. - - -File: org, Node: The very busy C-c C-c key, Next: Clean view, Prev: In-buffer settings, Up: Miscellaneous - -15.7 The very busy C-c C-c key -============================== - -The `C-c C-c' key in Org serves many purposes depending on the context. -It is probably the most over-worked, multi-purpose key combination in -Org. Its uses are well-documented through out this manual, but here is -a consolidated list for easy reference. - - - If any highlights shown in the buffer from the creation of a - sparse tree, or from clock display, remove such highlights. - - - If the cursor is in one of the special `#+KEYWORD' lines, scan the - buffer for these lines and update the information. Also reset the - Org file cache used to temporary store the contents of URLs used - as values for keywords like `#+SETUPFILE'. - - - If the cursor is inside a table, realign the table. The table - realigns even if automatic table editor is turned off. - - - If the cursor is on a `#+TBLFM' line, re-apply the formulas to the - entire table. - - - If the current buffer is a capture buffer, close the note and file - it. With a prefix argument, also jump to the target location - after saving the note. - - - If the cursor is on a `<<>>', update radio targets and - corresponding links in this buffer. - - - If the cursor is on a property line or at the start or end of a - property drawer, offer property commands. - - - If the cursor is at a footnote reference, go to the corresponding - definition, and _vice versa_. - - - If the cursor is on a statistics cookie, update it. - - - If the cursor is in a plain list item with a checkbox, toggle the - status of the checkbox. - - - If the cursor is on a numbered item in a plain list, renumber the - ordered list. - - - If the cursor is on the `#+BEGIN' line of a dynamic block, the - block is updated. - - - If the cursor is at a timestamp, fix the day name in the timestamp. - - -File: org, Node: Clean view, Next: TTY keys, Prev: The very busy C-c C-c key, Up: Miscellaneous - -15.8 A cleaner outline view -=========================== - -Org's default outline with stars and no indents can become too -cluttered for short documents. For _book-like_ long documents, the -effect is not as noticeable. Org provides an alternate stars and -indentation scheme, as shown on the right in the following table. It -uses only one star and indents text to line with the heading: - - * Top level headline | * Top level headline - ** Second level | * Second level - *** 3rd level | * 3rd level - some text | some text - *** 3rd level | * 3rd level - more text | more text - * Another top level headline | * Another top level headline - -To turn this mode on, use the minor mode, `org-indent-mode'. Text lines -that are not headlines are prefixed with spaces to vertically align -with the headline text(1). - - To make more horizontal space, the headlines are shifted by two -stars. This can be configured by the -`org-indent-indentation-per-level' variable. Only one star on each -headline is visible, the rest are masked with the same font color as -the background. This font face can be configured with the `org-hide' -variable. - - Note that turning on `org-indent-mode' sets `org-hide-leading-stars' -to `t' and `org-adapt-indentation' to `nil'; `2.' below shows how this -works. - - To globally turn on `org-indent-mode' for all files, customize the -variable `org-startup-indented'. - - To turn on indenting for individual files, use `#+STARTUP' option as -follows: - - #+STARTUP: indent - - Indent on startup makes Org use hard spaces to align text with -headings as shown in examples below. - - 1. _Indentation of text below headlines_ - Indent text to align with the headline. - - *** 3rd level - more text, now indented - - Org adapts indentations with paragraph filling, line wrapping, and - structure editing(2). - - 2. _Hiding leading stars_ - Org can make leading stars invisible. For global preference, - configure the variable `org-hide-leading-stars'. For per-file - preference, use these file `#+STARTUP' options: - - #+STARTUP: hidestars - #+STARTUP: showstars - - With stars hidden, the tree is shown as: - - * Top level headline - * Second level - * 3rd level - ... - - Because Org makes the font color same as the background color to - hide to stars, sometimes `org-hide' face may need tweaking to get - the effect right. For some black and white combinations, `grey90' - on a white background might mask the stars better. - - 3. Using stars for only odd levels, 1, 3, 5, ..., can also clean up - the clutter. This removes two stars from each level(3). For Org - to properly handle this cleaner structure during edits and - exports, configure the variable `org-odd-levels-only'. To set - this per-file, use either one of the following lines: - - #+STARTUP: odd - #+STARTUP: oddeven - - To switch between single and double stars layouts, use `M-x - org-convert-to-odd-levels RET' and `M-x - org-convert-to-oddeven-levels'. - - ---------- Footnotes ---------- - - (1) The `org-indent-mode' also sets the `wrap-prefix' correctly for -indenting and wrapping long lines of headlines or text. This minor -mode handles `visual-line-mode' and directly applied settings through -`word-wrap'. - - (2) Also see the variable `org-adapt-indentation'. - - (3) Because `LEVEL=2' has 3 stars, `LEVEL=3' has 4 stars, and so on - - -File: org, Node: TTY keys, Next: Interaction, Prev: Clean view, Up: Miscellaneous - -15.9 Using Org on a tty -======================= - -Org provides alternative key bindings for TTY and modern mobile devices -that cannot handle cursor keys and complex modifier key chords. Some -of these workarounds may be more cumbersome than necessary. Users -should look into customizing these further based on their usage needs. -For example, the normal `S-' for editing timestamp might be -better with `C-c .' chord. - -Default Alternative 1 Speed Alternative 2 - key -`S-' `C-u ' `C' -`M-' `C-c C-x l' `l' ` ' -`M-S-'`C-c C-x L' `L' -`M-' `C-c C-x r' `r' ` - ' -`M-S-'`C-c C-x R' `R' -`M-' `C-c C-x u' ` ' ` ' -`M-S-' `C-c C-x U' `U' -`M-' `C-c C-x d' ` ' ` ' -`M-S-'`C-c C-x D' `D' -`S-' `C-c C-x c' ` ' -`M-' `C-c C-x m' ` ' ` ' -`M-S-' `C-c C-x M' ` ' -`S-' `C-c ' ` ' -`S-' `C-c ' ` ' -`S-' `C-c ' ` ' -`S-' `C-c ' ` ' -`C-S-'`C-c C-x ` ' - ' -`C-S-'`C-c C-x ` ' - ' - - -File: org, Node: Interaction, Next: org-crypt, Prev: TTY keys, Up: Miscellaneous - -15.10 Interaction with other packages -===================================== - -Org's compatibility and the level of interaction with other Emacs -packages are documented here. - -* Menu: - -* Cooperation:: Packages Org cooperates with -* Conflicts:: Packages that lead to conflicts - - -File: org, Node: Cooperation, Next: Conflicts, Up: Interaction - -15.10.1 Packages that Org cooperates with ------------------------------------------ - -`calc.el' by Dave Gillespie - Org uses the Calc package for tables to implement spreadsheet - functionality (*note The spreadsheet::). Org also uses Calc for - embedded calculations. *Note Embedded Mode: (calc)Embedded Mode. - -`constants.el' by Carsten Dominik - Org can use names for constants in formulas in tables. Org can - also use calculation suffixes for units, such as `M' for `Mega'. - For a standard collection of such constants, install the - `constants' package. Install version 2.0 of this package, - available at `https://staff.fnwi.uva.nl/c.dominik/Tools/'. Org - checks if the function `constants-get' has been autoloaded. - Installation instructions are in the file, `constants.el'. - -`cdlatex.el' by Carsten Dominik - Org mode can use CDLaTeX package to efficiently enter LaTeX - fragments into Org files (*note CDLaTeX mode::). - -`imenu.el' by Ake Stenhoff and Lars Lindberg - Imenu creates dynamic menus based on an index of items in a file. - Org mode supports Imenu menus. Enable it with a mode hook as - follows: - (add-hook 'org-mode-hook - (lambda () (imenu-add-to-menubar "Imenu"))) - By default the Imenu index is two levels deep. Change the index - depth using thes variable, `org-imenu-depth'. - -`speedbar.el' by Eric M. Ludlam - Speedbar package creates a special Emacs frame for displaying - files and index items in files. Org mode supports Speedbar; users - can drill into Org files directly from the Speedbar. The `<' in - the Speedbar frame tweaks the agenda commands to that file or to a - subtree. - -`table.el' by Takaaki Ota - Complex ASCII tables with automatic line wrapping, column- and - row-spanning, and alignment can be created using the Emacs table - package by Takaaki Ota. Org mode recognizes such tables and - export them properly. `C-c '' to edit these tables in a special - buffer, much like Org's `src' code blocks. Because of - interference with other Org mode functionality, Takaaki Ota tables - cannot be edited directly in the Org buffer. - `C-c ' (`org-edit-special')' - Edit a `table.el' table. Works when the cursor is in a - table.el table. - - `C-c ~ (`org-table-create-with-table.el')' - Insert a `table.el' table. If there is already a table at - point, this command converts it between the `table.el' format - and the Org mode format. See the documentation string of the - command `org-convert-table' for details. - - -File: org, Node: Conflicts, Prev: Cooperation, Up: Interaction - -15.10.2 Packages that conflict with Org mode --------------------------------------------- - - In Emacs, `shift-selection-mode' combines cursor motions with - shift key to enlarge regions. Emacs sets this mode by default. - This conflicts with Org's use of `S-' commands to change - timestamps, TODO keywords, priorities, and item bullet types, etc. - Since `S-' commands outside of specific contexts don't do - anything, Org offers the variable `org-support-shift-select' for - customization. Org mode accommodates shift selection by (i) - making it available outside of the special contexts where special - commands apply, and (ii) extending an existing active region even - if the cursor moves across a special context. - -`CUA.el' by Kim. F. Storm - Org key bindings conflict with `S-' keys used by CUA mode. - For Org to relinquish these bindings to CUA mode, configure the - variable `org-replace-disputed-keys'. When set, Org moves the - following key bindings in Org files, and in the agenda buffer (but - not during date selection). - - S-UP => M-p S-DOWN => M-n - S-LEFT => M-- S-RIGHT => M-+ - C-S-LEFT => M-S-- C-S-RIGHT => M-S-+ - - Yes, these are unfortunately more difficult to remember. To - define a different replacement keys, look at the variable - `org-disputed-keys'. - -`ecomplete.el' by Lars Magne Ingebrigtsen - Ecomplete provides "electric" address completion in address header - lines in message buffers. Sadly Orgtbl mode cuts ecompletes power - supply: No completion happens when Orgtbl mode is enabled in - message buffers while entering text in address header lines. If - one wants to use ecomplete one should _not_ follow the advice to - automagically turn on Orgtbl mode in message buffers (see *note - Orgtbl mode::), but instead--after filling in the message - headers--turn on Orgtbl mode manually when needed in the messages - body. - -`filladapt.el' by Kyle Jones - Org mode tries to do the right thing when filling paragraphs, list - items and other elements. Many users reported problems using both - `filladapt.el' and Org mode, so a safe thing to do is to disable - filladapt like this: - - (add-hook 'org-mode-hook 'turn-off-filladapt-mode) - -`yasnippet.el' - The way Org mode binds the key (binding to `[tab]' instead of - `"\t"') overrules YASnippet's access to this key. The following - code fixed this problem: - - (add-hook 'org-mode-hook - (lambda () - (setq-local yas/trigger-key [tab]) - (define-key yas/keymap [tab] 'yas/next-field-or-maybe-expand))) - - The latest version of yasnippet doesn't play well with Org mode. - If the above code does not fix the conflict, first define the - following function: - - (defun yas/org-very-safe-expand () - (let ((yas/fallback-behavior 'return-nil)) (yas/expand))) - - Then tell Org mode to use that function: - - (add-hook 'org-mode-hook - (lambda () - (make-variable-buffer-local 'yas/trigger-key) - (setq yas/trigger-key [tab]) - (add-to-list 'org-tab-first-hook 'yas/org-very-safe-expand) - (define-key yas/keymap [tab] 'yas/next-field))) - -`windmove.el' by Hovav Shacham - This package also uses the `S-' keys, so everything written - in the paragraph above about CUA mode also applies here. If you - want make the windmove function active in locations where Org mode - does not have special functionality on `S-', add this to - your configuration: - - ;; Make windmove work in org-mode: - (add-hook 'org-shiftup-final-hook 'windmove-up) - (add-hook 'org-shiftleft-final-hook 'windmove-left) - (add-hook 'org-shiftdown-final-hook 'windmove-down) - (add-hook 'org-shiftright-final-hook 'windmove-right) - -`viper.el' by Michael Kifer - Viper uses `C-c /' and therefore makes this key not access the - corresponding Org mode command `org-sparse-tree'. You need to find - another key for this command, or override the key in - `viper-vi-global-user-map' with - - (define-key viper-vi-global-user-map "C-c /" 'org-sparse-tree) - - - -File: org, Node: org-crypt, Prev: Interaction, Up: Miscellaneous - -15.11 org-crypt.el -================== - -Org crypt encrypts the text of an Org entry, but not the headline, or -properties. Org crypt uses the Emacs EasyPG library to encrypt and -decrypt. - - Any text below a headline that has a `:crypt:' tag will be -automatically be encrypted when the file is saved. To use a different -tag, customize the `org-crypt-tag-matcher' variable. - - Suggested Org crypt settings in Emacs init file: - - (require 'org-crypt) - (org-crypt-use-before-save-magic) - (setq org-tags-exclude-from-inheritance (quote ("crypt"))) - - (setq org-crypt-key nil) - ;; GPG key to use for encryption - ;; Either the Key ID or set to nil to use symmetric encryption. - - (setq auto-save-default nil) - ;; Auto-saving does not cooperate with org-crypt.el: so you need - ;; to turn it off if you plan to use org-crypt.el quite often. - ;; Otherwise, you'll get an (annoying) message each time you - ;; start Org. - - ;; To turn it off only locally, you can insert this: - ;; - ;; # -*- buffer-auto-save-file-name: nil; -*- - - Excluding the crypt tag from inheritance prevents encrypting -previously encrypted text. - - -File: org, Node: Hacking, Next: MobileOrg, Prev: Miscellaneous, Up: Top - -Appendix A Hacking -****************** - -This appendix covers some areas where users can extend the -functionality of Org. - -* Menu: - -* Hooks:: How to reach into Org's internals -* Add-on packages:: Available extensions -* Adding hyperlink types:: New custom link types -* Adding export back-ends:: How to write new export back-ends -* Context-sensitive commands:: How to add functionality to such commands -* Tables in arbitrary syntax:: Orgtbl for LaTeX and other programs -* Dynamic blocks:: Automatically filled blocks -* Special agenda views:: Customized views -* Speeding up your agendas:: Tips on how to speed up your agendas -* Extracting agenda information:: Post-processing of agenda information -* Using the property API:: Writing programs that use entry properties -* Using the mapping API:: Mapping over all or selected entries - - -File: org, Node: Hooks, Next: Add-on packages, Up: Hacking - -A.1 Hooks -========= - -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 -`http://orgmode.org/worg/doc.html#hooks'. - - -File: org, Node: Add-on packages, Next: Adding hyperlink types, Prev: Hooks, Up: Hacking - -A.2 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 -`http://orgmode.org'. See the `contrib/README' file in the source code -directory for a list of contributed files. Worg page with more -information is at: `http://orgmode.org/worg/org-contrib/'. - - -File: org, Node: Adding hyperlink types, Next: Adding export back-ends, Prev: Add-on packages, Up: Hacking - -A.3 Adding hyperlink types -========================== - -Org has many built-in hyperlink types (*note Hyperlinks::), and an -interface for adding new link types. The example file, `org-man.el', -shows the process of adding Org links to Unix man pages, which look -like this: `[[man:printf][The printf manpage]]': - - ;;; org-man.el - Support for links to manpages in Org - - (require 'org) - - (org-add-link-type "man" 'org-man-open) - (add-hook 'org-store-link-functions 'org-man-store-link) - - (defcustom org-man-command 'man - "The Emacs command to be used to display a man page." - :group 'org-link - :type '(choice (const man) (const woman))) - - (defun org-man-open (path) - "Visit the manpage on PATH. - PATH should be a topic that can be thrown at the man command." - (funcall org-man-command path)) - - (defun org-man-store-link () - "Store a link to a manpage." - (when (memq major-mode '(Man-mode woman-mode)) - ;; This is a man page, we do make this link - (let* ((page (org-man-get-page-name)) - (link (concat "man:" page)) - (description (format "Manpage for %s" page))) - (org-store-link-props - :type "man" - :link link - :description description)))) - - (defun org-man-get-page-name () - "Extract the page name from the buffer name." - ;; This works for both `Man-mode' and `woman-mode'. - (if (string-match " \\(\\S-+\\)\\*" (buffer-name)) - (match-string 1 (buffer-name)) - (error "Cannot create link to this man page"))) - - (provide 'org-man) - - ;;; org-man.el ends here - -To activate links to man pages in Org, enter this in the init file: - - (require 'org-man) - -A review of `org-man.el': - 1. First, `(require 'org)' ensures `org.el' is loaded. - - 2. The `org-add-link-type' defines a new link type with `man' prefix. - The call contains the function to call that follows the link type. - - 3. The next line adds a function to `org-store-link-functions' that - records a useful link with the command `C-c l' in a buffer - displaying a man page. - - The rest of the file defines necessary variables and functions. -First is the customization variable `org-man-command'. It has two -options, `man' and `woman'. Next is a function whose argument is the -link path, which for man pages is the topic of the man command. To -follow the link, the function calls the `org-man-command' to display -the man page. - - `C-c l' constructs and stores the link. - - `C-c l' calls the function `org-man-store-link', which first checks -if the `major-mode' is appropriate. If check fails, the function -returns `nil'. Otherwise the function makes a link string by combining -the `man:' prefix with the man topic. The function then calls -`org-store-link-props' with `:type' and `:link' properties. A -`:description' property is an optional string that is displayed when the -function inserts the link in the Org buffer. - - `C-c C-l' inserts the stored link. - - To define new link types, define a function that implements -completion support with `C-c C-l'. This function should not accept any -arguments but return the appropriate prefix and complete link string. - - -File: org, Node: Adding export back-ends, Next: Context-sensitive commands, Prev: Adding hyperlink types, Up: Hacking - -A.4 Adding export back-ends -=========================== - -Org's export engine makes it easy for writing new back-ends. The -framework on which the engine was built makes it easy to derive new -back-ends from existing ones. - - The two main entry points to the export engine are: -`org-export-define-backend' and `org-export-define-derived-backend'. -To grok these functions, see `ox-latex.el' for an example of defining a -new back-end from scratch, and `ox-beamer.el' for an example of -deriving from an existing engine. - - For creating a new back-end from scratch, first set its name as a -symbol in an alist consisting of elements and export functions. To -make the back-end visible to the export dispatcher, set `:menu-entry' -keyword. For export options specific to this back-end, set the -`:options-alist'. - - For creating a new back-end from an existing one, set -`:translate-alist' to an alist of export functions. This alist -replaces the parent back-end functions. - - For complete documentation, see the Org Export Reference on Worg -(http://orgmode.org/worg/dev/org-export-reference.html). - - -File: org, Node: Context-sensitive commands, Next: Tables in arbitrary syntax, Prev: Adding export back-ends, Up: Hacking - -A.5 Context-sensitive commands -============================== - -Org has facilities for building context sensitive commands. Authors of -Org add-ons can tap into this functionality. - - Some Org commands change depending on the context. The most -important example of this behavior is the `C-c C-c' (*note The very -busy C-c C-c key::). Other examples are `M-cursor' and `M-S-cursor'. - - These context sensitive commands work by providing a function that -detects special context for that add-on and executes functionality -appropriate for that context. - - -File: org, Node: Tables in arbitrary syntax, Next: Dynamic blocks, Prev: Context-sensitive commands, Up: Hacking - -A.6 Tables and lists in arbitrary syntax -======================================== - -Because of Org's success in handling tables with Orgtbl, a frequently -asked feature is to Org's usability functions to other table formats -native to other modem's, such as LaTeX. This would be hard to do in a -general way without complicated customization nightmares. Moreover, -that would take Org away from its simplicity roots that Orgtbl has -proven. There is, however, an alternate approach to accomplishing the -same. - - This approach involves implementing a custom _translate_ function -that operates on a native Org _source table_ to produce a table in -another format. This strategy would keep the excellently working -Orgtbl simple and isolate complications, if any, confined to the -translate function. To add more alien table formats, we just add more -translate functions. Also the burden of developing custom translate -functions for new table formats will be in the hands of those who know -those formats best. - - For an example of how this strategy works, see Orgstruct mode. In -that mode, Bastien added the ability to use Org's facilities to edit -and re-structure lists. He did by turning `orgstruct-mode' on, and -then exporting the list locally to another format, such as HTML, LaTeX -or Texinfo. - -* Menu: - -* Radio tables:: Sending and receiving radio tables -* A LaTeX example:: Step by step, almost a tutorial -* Translator functions:: Copy and modify -* Radio lists:: Sending and receiving lists - - -File: org, Node: Radio tables, Next: A LaTeX example, Up: Tables in arbitrary syntax - -A.6.1 Radio tables ------------------- - -Radio tables are target locations for translated tables that are not -near their source. Org finds the target location and inserts the -translated table. - - The key to finding the target location are the magic words `BEGIN/END -RECEIVE ORGTBL'. They have to appear as comments in the current mode. -If the mode is C, then: - - /* BEGIN RECEIVE ORGTBL table_name */ - /* END RECEIVE ORGTBL table_name */ - -At the location of source, Org needs a special line to direct Orgtbl to -translate and to find the target for inserting the translated table. -For example: - #+ORGTBL: SEND table_name translation_function arguments... - -`table_name' is the table's reference name, which is also used in the -receiver lines, and the `translation_function' is the Lisp function that -translates. This line, in addition, may also contain alternating key -and value arguments at the end. The translation function gets these -values as a property list. A few standard parameters are already -recognized and acted upon before the translation function is called: - -`:skip N' - Skip the first N lines of the table. Hlines do count; include - them if they are to be skipped. - -`:skipcols (n1 n2 ...)' - List of columns to be skipped. First Org automatically discards - columns with calculation marks and then sends the table to the - translator function, which then skips columns as specified in - `skipcols'. - -To keep the source table intact in the buffer without being disturbed -when the source file is compiled or otherwise being worked on, use one -of these strategies: - - * Place the table in a block comment. For example, in C mode you - could wrap the table between `/*' and `*/' lines. - - * Put the table after an `END' statement. For example `\bye' in TeX - and `\end{document}' in LaTeX. - - * Comment and uncomment each line of the table during edits. The - `M-x orgtbl-toggle-comment RET' command makes toggling easy. - - -File: org, Node: A LaTeX example, Next: Translator functions, Prev: Radio tables, Up: Tables in arbitrary syntax - -A.6.2 A LaTeX example of radio tables -------------------------------------- - -To wrap a source table in LaTeX, use the `comment' environment provided -by `comment.sty'. To activate it, put `\usepackage{comment}' in the -document header. Orgtbl mode inserts a radio table skeleton(1) with -the command `M-x orgtbl-insert-radio-table RET', which prompts for a -table name. For example, if `salesfigures' is the name, the template -inserts: - - % BEGIN RECEIVE ORGTBL salesfigures - % END RECEIVE ORGTBL salesfigures - \begin{comment} - #+ORGTBL: SEND salesfigures orgtbl-to-latex - | | | - \end{comment} - -The line `#+ORGTBL: SEND' tells Orgtbl mode to use the function -`orgtbl-to-latex' to convert the table to LaTeX format, then insert the -table at the target (receive) location named `salesfigures'. Now the -table is ready for data entry. It can even use spreadsheet features(2): - - % BEGIN RECEIVE ORGTBL salesfigures - % END RECEIVE ORGTBL salesfigures - \begin{comment} - #+ORGTBL: SEND salesfigures orgtbl-to-latex - | Month | Days | Nr sold | per day | - |-------+------+---------+---------| - | Jan | 23 | 55 | 2.4 | - | Feb | 21 | 16 | 0.8 | - | March | 22 | 278 | 12.6 | - #+TBLFM: $4=$3/$2;%.1f - % $ (optional extra dollar to keep font-lock happy, see footnote) - \end{comment} - -After editing, `C-c C-c' inserts translated table at the target -location, between the two marker lines. - - For hand-made custom tables, note that the translator needs to skip -the first two lines of the source table. Also the command has to -_splice_ out the target table without the header and footer. - - \begin{tabular}{lrrr} - Month & \multicolumn{1}{c}{Days} & Nr.\ sold & per day\\ - % BEGIN RECEIVE ORGTBL salesfigures - % END RECEIVE ORGTBL salesfigures - \end{tabular} - % - \begin{comment} - #+ORGTBL: SEND salesfigures orgtbl-to-latex :splice t :skip 2 - | Month | Days | Nr sold | per day | - |-------+------+---------+---------| - | Jan | 23 | 55 | 2.4 | - | Feb | 21 | 16 | 0.8 | - | March | 22 | 278 | 12.6 | - #+TBLFM: $4=$3/$2;%.1f - \end{comment} - - The LaTeX translator function `orgtbl-to-latex' is already part of -Orgtbl mode and uses `tabular' environment by default to typeset the -table and mark the horizontal lines with `\hline'. For additional -parameters to control output, *note Translator functions::: - -`:splice nil/t' - When non-`nil', returns only table body lines; not wrapped in - tabular environment. Default is `nil'. - -`:fmt fmt' - Format to warp each field. It should contain `%s' for the original - field value. For example, to wrap each field value in dollar - symbol, you could use `:fmt "$%s$"'. Format can also wrap a - property list with column numbers and formats, for example `:fmt - (2 "$%s$" 4 "%s\\%%")'. In place of a string, a function of one - argument can be used; the function must return a formatted string. - -`:efmt efmt' - Format numbers as exponentials. The spec should have `%s' twice - for inserting mantissa and exponent, for example - `"%s\\times10^{%s}"'. This may also be a property list with - column numbers and formats, for example `:efmt (2 - "$%s\\times10^{%s}$" 4 "$%s\\cdot10^{%s}$")'. After `efmt' has - been applied to a value, `fmt' will also be applied. Functions - with two arguments can be supplied instead of strings. By default, - no special formatting is applied. - - ---------- Footnotes ---------- - - (1) By default this works only for LaTeX, HTML, and Texinfo. -Configure the variable `orgtbl-radio-table-templates' to install -templates for other export formats. - - (2) If the `#+TBLFM' line contains an odd number of dollar -characters, this may cause problems with font-lock in LaTeX mode. As -shown in the example you can fix this by adding an extra line inside the -`comment' environment that is used to balance the dollar expressions. -If you are using AUCTeX with the font-latex library, a much better -solution is to add the `comment' environment to the variable -`LaTeX-verbatim-environments'. - - -File: org, Node: Translator functions, Next: Radio lists, Prev: A LaTeX example, Up: Tables in arbitrary syntax - -A.6.3 Translator functions --------------------------- - -Orgtbl mode has built-in translator functions: `orgtbl-to-csv' -(comma-separated values), `orgtbl-to-tsv' (TAB-separated values), -`orgtbl-to-latex', `orgtbl-to-html', `orgtbl-to-texinfo', -`orgtbl-to-unicode' and `orgtbl-to-orgtbl'. They use the generic -translator, `orgtbl-to-generic', which delegates translations to various -export back-ends. - - Properties passed to the function through the `ORGTBL SEND' line take -precedence over properties defined inside the function. For example, -this overrides the default LaTeX line endings, `\\', with `\\[2mm]': - - #+ORGTBL: SEND test orgtbl-to-latex :lend " \\\\[2mm]" - - For a new language translator, define a converter function. It can -be a generic function, such as shown in this example. It marks a -beginning and ending of a table with `!BTBL!' and `!ETBL!'; a beginning -and ending of lines with `!BL!' and `!EL!'; and uses a TAB for a field -separator: - - (defun orgtbl-to-language (table params) - "Convert the orgtbl-mode TABLE to language." - (orgtbl-to-generic - table - (org-combine-plists - '(:tstart "!BTBL!" :tend "!ETBL!" :lstart "!BL!" :lend "!EL!" :sep "\t") - params))) - -The documentation for the `orgtbl-to-generic' function shows a complete -list of parameters, each of which can be passed through to -`orgtbl-to-latex', `orgtbl-to-texinfo', and any other function using -that generic function. - - For complicated translations the generic translator function could be -replaced by a custom translator function. Such a custom function must -take two arguments and return a single string containing the formatted -table. The first argument is the table whose lines are a list of -fields or the symbol `hline'. The second argument is the property list -consisting of parameters specified in the `#+ORGTBL: SEND' line. -Please share your translator functions by posting them to the Org users -mailing list, . - - -File: org, Node: Radio lists, Prev: Translator functions, Up: Tables in arbitrary syntax - -A.6.4 Radio lists ------------------ - -Call the `org-list-insert-radio-list' function to insert a radio list -template in HTML, LaTeX, and Texinfo mode documents. Sending and -receiving radio lists works is the same as for radio tables (*note -Radio tables::) except for these differences: - - - Orgstruct mode must be active. - - - Use `ORGLST' keyword instead of `ORGTBL'. - - - `C-c C-c' works only on the first list item. - - Built-in translators functions are: `org-list-to-latex', -`org-list-to-html' and `org-list-to-texinfo'. They use the -`org-list-to-generic' translator function. See its documentation for -parameters for accurate customizations of lists. Here is a LaTeX -example: - - % BEGIN RECEIVE ORGLST to-buy - % END RECEIVE ORGLST to-buy - \begin{comment} - #+ORGLST: SEND to-buy org-list-to-latex - - a new house - - a new computer - + a new keyboard - + a new mouse - - a new life - \end{comment} - - `C-c C-c' on `a new house' inserts the translated LaTeX list -in-between the BEGIN and END marker lines. - - -File: org, Node: Dynamic blocks, Next: Special agenda views, Prev: Tables in arbitrary syntax, Up: Hacking - -A.7 Dynamic blocks -================== - -Org supports _dynamic blocks_ in Org documents. They are inserted with -begin and end markers like any other `src' code block, but the contents -are updated automatically by a user function. For example, `C-c C-x -C-r' inserts a dynamic table that updates the work time (*note Clocking -work time::). - - Dynamic blocks can have names and function parameters. The syntax -is similar to `src' code block specifications: - - #+BEGIN: myblock :parameter1 value1 :parameter2 value2 ... - - #+END: - - These command update dynamic blocks: - -`C-c C-x C-u (`org-dblock-update')' - Update dynamic block at point. - -`C-u C-c C-x C-u' - Update all dynamic blocks in the current file. - - Before updating a dynamic block, Org removes content between the -BEGIN and END markers. Org then reads the parameters on the BEGIN line -for passing to the writer function. If the function expects to access -the removed content, then Org expects an extra parameter, `:content', -on the BEGIN line. - - To syntax for calling a writer function with a named block, `myblock' -is: `org-dblock-write:myblock'. Parameters come from the BEGIN line. - - The following is an example of a dynamic block and a block writer -function that updates the time when the function was last run: - - #+BEGIN: block-update-time :format "on %m/%d/%Y at %H:%M" - - #+END: - -The dynamic block's writer function: - - (defun org-dblock-write:block-update-time (params) - (let ((fmt (or (plist-get params :format) "%d. %m. %Y"))) - (insert "Last block update at: " - (format-time-string fmt)))) - - To keep dynamic blocks up-to-date in an Org file, use the function, -`org-update-all-dblocks' in hook, such as `before-save-hook'. The -`org-update-all-dblocks' function does not run if the file is not in -Org mode. - - Dynamic blocks, like any other block, can be narrowed with -`org-narrow-to-block'. - - -File: org, Node: Special agenda views, Next: Speeding up your agendas, Prev: Dynamic blocks, Up: Hacking - -A.8 Special agenda views -======================== - -Org provides a special hook to further limit items in agenda views: -`agenda', `agenda*'(1), `todo', `alltodo', `tags', `tags-todo', -`tags-tree'. Specify a custom function that tests inclusion of every -matched item in the view. This function can also skip as much as is -needed. - - For a global condition applicable to agenda views, use the -`org-agenda-skip-function-global' variable. Org uses a global condition -with `org-agenda-skip-function' for custom searching. - - This example defines a function for a custom view showing TODO items -with WAITING status. Manually this is a multi step search process, but -with a custom view, this can be automated as follows: - - The custom function searches the subtree for the WAITING tag and -returns `nil' on match. Otherwise it gives the location from where the -search continues. - - (defun my-skip-unless-waiting () - "Skip trees that are not waiting" - (let ((subtree-end (save-excursion (org-end-of-subtree t)))) - (if (re-search-forward ":waiting:" subtree-end t) - nil ; tag found, do not skip - subtree-end))) ; tag not found, continue after end of subtree - - To use this custom function in a custom agenda command: - - (org-add-agenda-custom-command - '("b" todo "PROJECT" - ((org-agenda-skip-function 'my-skip-unless-waiting) - (org-agenda-overriding-header "Projects waiting for something: ")))) - - Note that this also binds `org-agenda-overriding-header' to a more -meaningful string suitable for the agenda view. - - Search for entries with a limit set on levels for the custom search. -This is a general approach to creating custom searches in Org. To -include all levels, use `LEVEL>0'(2). Then to selectively pick the -matched entries, use `org-agenda-skip-function', which also accepts Lisp -forms, such as `org-agenda-skip-entry-if' and -`org-agenda-skip-subtree-if'. For example: - -`(org-agenda-skip-entry-if 'scheduled)' - Skip current entry if it has been scheduled. - -`(org-agenda-skip-entry-if 'notscheduled)' - Skip current entry if it has not been scheduled. - -`(org-agenda-skip-entry-if 'deadline)' - Skip current entry if it has a deadline. - -`(org-agenda-skip-entry-if 'scheduled 'deadline)' - Skip current entry if it has a deadline, or if it is scheduled. - -`(org-agenda-skip-entry-if 'todo '("TODO" "WAITING"))' - Skip current entry if the TODO keyword is TODO or WAITING. - -`(org-agenda-skip-entry-if 'todo 'done)' - Skip current entry if the TODO keyword marks a DONE state. - -`(org-agenda-skip-entry-if 'timestamp)' - Skip current entry if it has any timestamp, may also be deadline - or scheduled. - -`(org-agenda-skip-entry-if 'regexp "regular expression")' - Skip current entry if the regular expression matches in the entry. - -`(org-agenda-skip-entry-if 'notregexp "regular expression")' - Skip current entry unless the regular expression matches. - -`(org-agenda-skip-subtree-if 'regexp "regular expression")' - Same as above, but check and skip the entire subtree. - - The following is an example of a search for `WAITING' without the -special function: - - (org-add-agenda-custom-command - '("b" todo "PROJECT" - ((org-agenda-skip-function '(org-agenda-skip-subtree-if - 'regexp ":waiting:")) - (org-agenda-overriding-header "Projects waiting for something: ")))) - - ---------- Footnotes ---------- - - (1) The `agenda*' view is the same as `agenda' except that it only -considers _appointments_, i.e., scheduled and deadline items that have -a time specification `[h]h:mm' in their time-stamps. - - (2) Note that, for `org-odd-levels-only', a level number corresponds -to order in the hierarchy, not to the number of stars. - - -File: org, Node: Speeding up your agendas, Next: Extracting agenda information, Prev: Special agenda views, Up: Hacking - -A.9 Speeding up your agendas -============================ - -Some agenda commands slow down when the Org files grow in size or -number. Here are tips to speed up: - - 1. Reduce the number of Org agenda files to avoid slowdowns due to - hard drive accesses. - - 2. Reduce the number of `DONE' and archived headlines so agenda - operations that skip over these can finish faster. - - 3. Do not dim blocked tasks: - (setq org-agenda-dim-blocked-tasks nil) - - 4. Stop preparing agenda buffers on startup: - (setq org-agenda-inhibit-startup nil) - - 5. Disable tag inheritance for agendas: - (setq org-agenda-use-tag-inheritance nil) - - 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 dedicated Worg page -(http://orgmode.org/worg/agenda-optimization.html) for agenda -optimization. - - -File: org, Node: Extracting agenda information, Next: Using the property API, Prev: Speeding up your agendas, Up: Hacking - -A.10 Extracting agenda information -================================== - -Org provides commands to access agendas through Emacs batch mode. -Through this command-line interface, agendas are automated for further -processing or printing. - - `org-batch-agenda' creates an agenda view in ASCII and outputs to -STDOUT. This command takes one string parameter. When string -length=1, Org uses it as a key to `org-agenda-custom-commands'. These -are the same ones available through `C-c a'. - - This example command line directly prints the TODO list to the -printer: - - emacs -batch -l ~/.emacs -eval '(org-batch-agenda "t")' | lpr - - When the string parameter length is two or more characters, Org -matches it with tags/TODO strings. For example, this example command -line prints items tagged with `shop', but excludes items tagged with -`NewYork': - - emacs -batch -l ~/.emacs \ - -eval '(org-batch-agenda "+shop-NewYork")' | lpr - -An example showing on-the-fly parameter modifications: - - emacs -batch -l ~/.emacs \ - -eval '(org-batch-agenda "a" \ - org-agenda-span (quote month) \ - org-agenda-include-diary nil \ - org-agenda-files (quote ("~/org/project.org")))' \ - | lpr - -which will produce an agenda for the next 30 days from just the -`~/org/projects.org' file. - - For structured processing of agenda output, use -`org-batch-agenda-csv' with the following fields: - - category The category of the item - head The headline, without TODO keyword, TAGS and PRIORITY - type The type of the agenda entry, can be - todo selected in TODO match - tagsmatch selected in tags match - diary imported from diary - deadline a deadline - scheduled scheduled - timestamp appointment, selected by timestamp - closed entry was closed on date - upcoming-deadline warning about nearing deadline - past-scheduled forwarded scheduled item - block entry has date block including date - todo The TODO keyword, if any - tags All tags including inherited ones, separated by colons - date The relevant date, like 2007-2-14 - time The time, like 15:00-16:50 - extra String with extra planning info - priority-l The priority letter if any was given - priority-n The computed numerical priority - -If the selection of the agenda item was based on a timestamp, including -those items with `DEADLINE' and `SCHEDULED' keywords, then Org includes -date and time in the output. - - If the selection of the agenda item was based on a timestamp (or -deadline/scheduled), then Org includes date and time in the output. - - Here is an example of a post-processing script in Perl. It takes -the CSV output from Emacs and prints with a checkbox: - - #!/usr/bin/perl - - # define the Emacs command to run - $cmd = "emacs -batch -l ~/.emacs -eval '(org-batch-agenda-csv \"t\")'"; - - # run it and capture the output - $agenda = qx{$cmd 2>/dev/null}; - - # loop over all lines - foreach $line (split(/\n/,$agenda)) { - # get the individual values - ($category,$head,$type,$todo,$tags,$date,$time,$extra, - $priority_l,$priority_n) = split(/,/,$line); - # process and print - print "[ ] $head\n"; - } - - -File: org, Node: Using the property API, Next: Using the mapping API, Prev: Extracting agenda information, Up: Hacking - -A.11 Using the property API -=========================== - -Functions for working with properties. - - -- Function: org-entry-properties &optional pom which - Get all properties of the entry at point-or-marker POM. - This includes the TODO keyword, the tags, time strings for - deadline, scheduled, and clocking, and any additional properties - defined in the entry. The return value is an alist. Keys may - occur multiple times if the property key was used several times. - POM may also be `nil', in which case the current entry is used. - If WHICH is `nil' or `all', get all properties. If WHICH is - `special' or `standard', only get that subclass. - - -- Function: org-entry-get pom property &optional inherit - Get value of `PROPERTY' for entry at point-or-marker `POM'. By - default, this only looks at properties defined locally in the - entry. If `INHERIT' is non-`nil' and the entry does not have the - property, then also check higher levels of the hierarchy. If - `INHERIT' is the symbol `selective', use inheritance if and only - if the setting of `org-use-property-inheritance' selects - `PROPERTY' for inheritance. - - -- Function: org-entry-delete pom property - Delete the property `PROPERTY' from entry at point-or-marker POM. - - -- Function: org-entry-put pom property value - Set `PROPERTY' to `VALUE' for entry at point-or-marker POM. - - -- Function: org-buffer-property-keys &optional include-specials - Get all property keys in the current buffer. - - -- Function: org-insert-property-drawer - Insert a property drawer for the current entry. - - -- Function: org-entry-put-multivalued-property pom property &rest - values - Set `PROPERTY' at point-or-marker `POM' to `VALUES'. `VALUES' - should be a list of strings. They will be concatenated, with - spaces as separators. - - -- Function: org-entry-get-multivalued-property pom property - Treat the value of the property `PROPERTY' as a - whitespace-separated list of values and return the values as a - list of strings. - - -- Function: org-entry-add-to-multivalued-property pom property value - Treat the value of the property `PROPERTY' as a - whitespace-separated list of values and make sure that `VALUE' is - in this list. - - -- Function: org-entry-remove-from-multivalued-property pom property - value - Treat the value of the property `PROPERTY' as a - whitespace-separated list of values and make sure that `VALUE' is - _not_ in this list. - - -- Function: org-entry-member-in-multivalued-property pom property - value - Treat the value of the property `PROPERTY' as a - whitespace-separated list of values and check if `VALUE' is in - this list. - - -- User Option: org-property-allowed-value-functions - Hook for functions supplying allowed values for a specific - property. The functions must take a single argument, the name of - the property, and return a flat list of allowed values. If `:ETC' - is one of the values, use the values as completion help, but allow - also other values to be entered. The functions must return `nil' - if they are not responsible for this property. - - -File: org, Node: Using the mapping API, Prev: Using the property API, Up: Hacking - -A.12 Using the mapping API -========================== - -Org has sophisticated mapping capabilities for finding entries. Org -uses this functionality internally for generating agenda views. Org -also exposes an API for executing arbitrary functions for each selected -entry. The API's main entry point is: - - -- Function: org-map-entries func &optional match scope &rest skip - Call `FUNC' at each headline selected by `MATCH' in `SCOPE'. - - `FUNC' is a function or a Lisp form. With the cursor positioned - at the beginning of the headline, call the function without - arguments. Org returns an alist of return values of calls to the - function. - - To avoid preserving point, Org wraps the call to `FUNC' in - save-excursion form. After evaluation, Org moves the cursor to - the end of the line that was just processed. Search continues - from that point forward. This may not always work as expected - under some conditions, such as if the current sub-tree was removed - by a previous archiving operation. In such rare circumstances, - Org skips the next entry entirely when it should not. To stop Org - from such skips, make `FUNC' set the variable - `org-map-continue-from' to a specific buffer position. - - `MATCH' is a tags/property/TODO match. Org iterates only matched - headlines. Org iterates over all headlines when `MATCH' is `nil' - or `t'. - - `SCOPE' determines the scope of this command. It can be any of: - - nil the current buffer, respecting the restriction if any - tree the subtree started with the entry at point - region The entries within the active region, if any - file the current buffer, without restriction - file-with-archives - the current buffer, and any archives associated with it - agenda all agenda files - agenda-with-archives - all agenda files with any archive files associated with them - (file1 file2 ...) - if this is a list, all files in the list will be scanned - The remaining args are treated as settings for the scanner's - skipping facilities. Valid args are: - - archive skip trees with the archive tag - comment skip trees with the COMMENT keyword - function or Lisp form - will be used as value for `org-agenda-skip-function', - so whenever the function returns t, FUNC - will not be called for that entry and search will - continue from the point where the function leaves it - - The mapping routine can call any arbitrary function, even functions -that change meta data or query the property API (*note Using the -property API::). Here are some handy functions: - - -- Function: org-todo &optional arg - Change the TODO state of the entry. See the docstring of the - functions for the many possible values for the argument `ARG'. - - -- Function: org-priority &optional action - Change the priority of the entry. See the docstring of this - function for the possible values for `ACTION'. - - -- Function: org-toggle-tag tag &optional onoff - Toggle the tag `TAG' in the current entry. Setting `ONOFF' to - either `on' or `off' will not toggle tag, but ensure that it is - either on or off. - - -- Function: org-promote - Promote the current entry. - - -- Function: org-demote - Demote the current entry. - - This example turns all entries tagged with `TOMORROW' into TODO -entries with keyword `UPCOMING'. Org ignores entries in comment trees -and archive trees. - - (org-map-entries - '(org-todo "UPCOMING") - "+TOMORROW" 'file 'archive 'comment) - - The following example counts the number of entries with TODO keyword -`WAITING', in all agenda files. - - (length (org-map-entries t "/+WAITING" 'agenda)) - - -File: org, Node: MobileOrg, Next: History and acknowledgments, Prev: Hacking, Up: Top - -Appendix B MobileOrg -******************** - -MobileOrg is a companion mobile app that runs on iOS and Android -devices. MobileOrg enables offline-views and capture support for an -Org mode system that is rooted on a "real" computer. MobileOrg can -record changes to existing entries. - - The iOS implementation (https://github.com/MobileOrg/) for the -_iPhone/iPod Touch/iPad_ series of devices, was started by Richard -Moreland and is now in the hands Sean Escriva. Android users should -check out MobileOrg Android -(http://wiki.github.com/matburt/mobileorg-android/) by Matt Jones. -Though the two implementations are not identical, they offer similar -features. - - This appendix describes Org's support for agenda view formats -compatible with MobileOrg. It also describes synchronizing changes, -such as to notes, between MobileOrg and the computer. - - To change tags and TODO states in MobileOrg, first customize the -variables `org-todo-keywords' and `org-tag-alist'. These should cover -all the important tags and TODO keywords, even if Org files use only -some of them. Though MobileOrg has in-buffer settings, it understands -TODO states _sets_ (*note Per-file keywords::) and _mutually exclusive_ -tags (*note Setting tags::) only for those set in these variables. - -* Menu: - -* Setting up the staging area:: For the mobile device -* Pushing to MobileOrg:: Uploading Org files and agendas -* Pulling from MobileOrg:: Integrating captured and flagged items - - -File: org, Node: Setting up the staging area, Next: Pushing to MobileOrg, Up: MobileOrg - -B.1 Setting up the staging area -=============================== - -MobileOrg needs access to a file directory on a server to interact with -Emacs. With a public server, consider encrypting the files. MobileOrg -version 1.5 supports encryption for the iPhone. Org also requires -`openssl' installed on the local computer. To turn on encryption, set -the same password in MobileOrg and in Emacs. Set the password in the -variable `org-mobile-use-encryption'(1). Note that even after -MobileOrg encrypts the file contents, the file names will remain -visible on the file systems of the local computer, the server, and the -mobile device. - - For a server to host files, consider options like Dropbox.com -(http://dropbox.com) account(2). On first connection, MobileOrg -creates a directory `MobileOrg/' on Dropbox. Pass its location to -Emacs through an init file variable as follows: - - (setq org-mobile-directory "~/Dropbox/MobileOrg") - - Org copies files to the above directory for MobileOrg. Org also -uses the same directory for sharing notes between Org and MobileOrg. - - ---------- Footnotes ---------- - - (1) If Emacs is configured for safe storing of passwords, then -configure the variable, `org-mobile-encryption-password'; please read -the docstring of that variable. - - (2) An alternative is to use webdav server. MobileOrg documentation -has details of webdav server configuration. Additional help is at FAQ -entry (http://orgmode.org/worg/org-faq.html#mobileorg_webdav). - - -File: org, Node: Pushing to MobileOrg, Next: Pulling from MobileOrg, Prev: Setting up the staging area, Up: MobileOrg - -B.2 Pushing to MobileOrg -======================== - -Org pushes files listed in `org-mobile-files' to -`org-mobile-directory'. Files include agenda files (as listed in -`org-agenda-files'). Customize `org-mobile-files' to add other files. -File names will be staged with paths relative to `org-directory', so -all files should be inside this directory(1). - - Push creates a special Org file `agendas.org' with custom agenda -views defined by the user(2). - - Org writes the file `index.org', containing links to other files. -MobileOrg reads this file first from the server to determine what other -files to download for agendas. For faster downloads, MobileOrg will -read only those files whose checksums(3) have changed. - - ---------- Footnotes ---------- - - (1) Symbolic links in `org-directory' should have the same name as -their targets. - - (2) While creating the agendas, Org mode will force ID properties on -all referenced entries, so that these entries can be uniquely -identified if MobileOrg flags them for further action. To avoid -setting properties configure the variable -`org-mobile-force-id-on-agenda-items' to `nil'. Org mode will then -rely on outline paths, assuming they are unique. - - (3) Checksums are stored automatically in the file `checksums.dat'. - - -File: org, Node: Pulling from MobileOrg, Prev: Pushing to MobileOrg, Up: MobileOrg - -B.3 Pulling from MobileOrg -========================== - -When MobileOrg synchronizes with the server, it pulls the Org files for -viewing. It then appends to the file `mobileorg.org' on the server the -captured entries, pointers to flagged and changed entries. Org -integrates its data in an inbox file format. - - 1. Org moves all entries found in `mobileorg.org'(1) and appends them - to the file pointed to by the variable - `org-mobile-inbox-for-pull'. Each captured entry and each editing - event is a top-level entry in the inbox file. - - 2. After moving the entries, Org attempts changes to MobileOrg. Some - changes are applied directly and without user interaction. - Examples include changes to tags, TODO state, headline and body - text. Entries for further action are tagged as `:FLAGGED:'. Org - marks entries with problems with an error message in the inbox. - They have to be resolved manually. - - 3. Org generates an agenda view for flagged entries for user - intervention to clean up. For notes stored in flagged entries, - MobileOrg displays them in the echo area when the cursor is on the - corresponding agenda item. - - `?' - Pressing `?' displays the entire flagged note in another - window. Org also pushes it to the kill ring. To store - flagged note as a normal note, use `? z C-y C-c C-c'. - Pressing `?' twice does these things: first it removes the - `:FLAGGED:' tag; second, it removes the flagged note from the - property drawer; third, it signals that manual editing of the - flagged entry is now finished. - - `C-c a ?' returns to the agenda view to finish processing flagged -entries. Note that these entries may not be the most recent since -MobileOrg searches files that were last pulled. To get an updated -agenda view with changes since the last pull, pull again. - - ---------- Footnotes ---------- - - (1) `mobileorg.org' will be empty after this operation. - - -File: org, Node: History and acknowledgments, Next: GNU Free Documentation License, Prev: MobileOrg, Up: Top - -Appendix C History and acknowledgments -************************************** - -C.1 From Carsten -================ - -Org was born in 2003, out of frustration over the user interface of the -Emacs Outline mode. I was trying to organize my notes and projects, -and using Emacs seemed to be the natural way to go. However, having to -remember eleven different commands with two or three keys per command, -only to hide and show parts of the outline tree, that seemed entirely -unacceptable. Also, when using outlines to take notes, I constantly -wanted to restructure the tree, organizing it paralleling my thoughts -and plans. _Visibility cycling_ and _structure editing_ were -originally implemented in the package `outline-magic.el', but quickly -moved to the more general `org.el'. As this environment became -comfortable for project planning, the next step was adding _TODO -entries_, basic _timestamps_, and _table support_. These areas -highlighted the two main goals that Org still has today: to be a new, -outline-based, plain text mode with innovative and intuitive editing -features, and to incorporate project planning functionality directly -into a notes file. - - Since the first release, literally thousands of emails to me or to - have provided a constant stream of bug reports, -feedback, new ideas, and sometimes patches and add-on code. Many -thanks to everyone who has helped to improve this package. I am trying -to keep here a list of the people who had significant influence in -shaping one or more aspects of Org. The list may not be complete, if I -have forgotten someone, please accept my apologies and let me know. - - Before I get to this list, a few special mentions are in order: - -Bastien Guerry - Bastien has written a large number of extensions to Org (most of - them integrated into the core by now), including the LaTeX - exporter and the plain list parser. His support during the early - days was central to the success of this project. Bastien also - invented Worg, helped establishing the Web presence of Org, and - sponsored hosting costs for the orgmode.org website. Bastien - stepped in as maintainer of Org between 2011 and 2013, at a time - when I desperately needed a break. - -Eric Schulte and Dan Davison - Eric and Dan are jointly responsible for the Org-babel system, - which turns Org into a multi-language environment for evaluating - code and doing literate programming and reproducible research. - This has become one of Org's killer features that define what Org - is today. - -John Wiegley - John has contributed a number of great ideas and patches directly - to Org, including the attachment system (`org-attach.el'), - integration with Apple Mail (`org-mac-message.el'), hierarchical - dependencies of TODO items, habit tracking (`org-habits.el'), and - encryption (`org-crypt.el'). Also, the capture system is really - an extended copy of his great `remember.el'. - -Sebastian Rose - Without Sebastian, the HTML/XHTML publishing of Org would be the - pitiful work of an ignorant amateur. Sebastian has pushed this - part of Org onto a much higher level. He also wrote - `org-info.js', a Java script for displaying web pages derived from - Org using an Info-like or a folding interface with single-key - navigation. - -See below for the full list of contributions! Again, please let me -know what I am missing here! - -C.2 From Bastien -================ - -I (Bastien) have been maintaining Org between 2011 and 2013. This -appendix would not be complete without adding a few more -acknowledgments and thanks. - - I am first grateful to Carsten for his trust while handing me over -the maintainership of Org. His unremitting support is what really -helped me getting more confident over time, with both the community and -the code. - - When I took over maintainership, I knew I would have to make Org more -collaborative than ever, as I would have to rely on people that are more -knowledgeable than I am on many parts of the code. Here is a list of -the persons I could rely on, they should really be considered -co-maintainers, either of the code or the community: - -Eric Schulte - Eric is maintaining the Babel parts of Org. His reactivity here - kept me away from worrying about possible bugs here and let me - focus on other parts. - -Nicolas Goaziou - Nicolas is maintaining the consistency of the deepest parts of - Org. His work on `org-element.el' and `ox.el' has been - outstanding, and it opened the doors for many new ideas and - features. He rewrote many of the old exporters to use the new - export engine, and helped with documenting this major change. - More importantly (if that's possible), he has been more than - reliable during all the work done for Org 8.0, and always very - reactive on the mailing list. - -Achim Gratz - Achim rewrote the building process of Org, turning some _ad hoc_ - tools into a flexible and conceptually clean process. He - patiently coped with the many hiccups that such a change can - create for users. - -Nick Dokos - The Org mode mailing list would not be such a nice place without - Nick, who patiently helped users so many times. It is impossible - to overestimate such a great help, and the list would not be so - active without him. - - I received support from so many users that it is clearly impossible -to be fair when shortlisting a few of them, but Org's history would not -be complete if the ones above were not mentioned in this manual. - -C.3 List of contributions -========================= - - * Russel Adams came up with the idea for drawers. - - * Suvayu Ali has steadily helped on the mailing list, providing - useful feedback on many features and several patches. - - * Luis Anaya wrote `ox-man.el'. - - * Thomas Baumann wrote `org-bbdb.el' and `org-mhe.el'. - - * Michael Brand helped by reporting many bugs and testing many - features. He also implemented the distinction between empty - fields and 0-value fields in Org's spreadsheets. - - * Christophe Bataillon created the great unicorn logo that we use on - the Org mode website. - - * Alex Bochannek provided a patch for rounding timestamps. - - * Jan Böcker wrote `org-docview.el'. - - * Brad Bozarth showed how to pull RSS feed data into Org mode files. - - * Tom Breton wrote `org-choose.el'. - - * Charles Cave's suggestion sparked the implementation of templates - for Remember, which are now templates for capture. - - * Pavel Chalmoviansky influenced the agenda treatment of items with - specified time. - - * Gregory Chernov patched support for Lisp forms into table - calculations and improved XEmacs compatibility, in particular by - porting `nouline.el' to XEmacs. - - * Sacha Chua suggested copying some linking code from Planner, and - helped make Org popular through her blog. - - * Toby S. Cubitt contributed to the code for clock formats. - - * Baoqiu Cui contributed the first DocBook exporter. In Org 8.0, we - go a different route: you can now export to Texinfo and export the - `.texi' file to DocBook using `makeinfo'. - - * Eddward DeVilla proposed and tested checkbox statistics. He also - came up with the idea of properties, and that there should be an - API for them. - - * Nick Dokos tracked down several nasty bugs. - - * Kees Dullemond used to edit projects lists directly in HTML and so - inspired some of the early development, including HTML export. He - also asked for a way to narrow wide table columns. - - * Jason Dunsmore has been maintaining the Org-Mode server at - Rackspace for several years now. He also sponsored the hosting - costs until Rackspace started to host us for free. - - * Thomas S. Dye contributed documentation on Worg and helped - integrating the Org-Babel documentation into the manual. - - * Christian Egli converted the documentation into Texinfo format, - inspired the agenda, patched CSS formatting into the HTML - exporter, and wrote `org-taskjuggler.el', which has been rewritten - by Nicolas Goaziou as `ox-taskjuggler.el' for Org 8.0. - - * David Emery provided a patch for custom CSS support in exported - HTML agendas. - - * Sean Escriva took over MobileOrg development on the iPhone - platform. - - * Nic Ferrier contributed mailcap and XOXO support. - - * Miguel A. Figueroa-Villanueva implemented hierarchical checkboxes. - - * John Foerch figured out how to make incremental search show context - around a match in a hidden outline tree. - - * Raimar Finken wrote `org-git-line.el'. - - * Mikael Fornius works as a mailing list moderator. - - * Austin Frank works as a mailing list moderator. - - * Eric Fraga drove the development of BEAMER export with ideas and - testing. - - * Barry Gidden did proofreading the manual in preparation for the - book publication through Network Theory Ltd. - - * Niels Giesen had the idea to automatically archive DONE trees. - - * Nicolas Goaziou rewrote much of the plain list code. He also wrote - `org-element.el' and `org-export.el', which was a huge step forward - in implementing a clean framework for Org exporters. - - * Kai Grossjohann pointed out key-binding conflicts with other - packages. - - * Brian Gough of Network Theory Ltd publishes the Org mode manual as - a book. - - * Bernt Hansen has driven much of the support for auto-repeating - tasks, task state change logging, and the clocktable. His clear - explanations have been critical when we started to adopt the Git - version control system. - - * Manuel Hermenegildo has contributed various ideas, small fixes and - patches. - - * Phil Jackson wrote `org-irc.el'. - - * Scott Jaderholm proposed footnotes, control over whitespace between - folded entries, and column view for properties. - - * Matt Jones wrote MobileOrg Android. - - * Tokuya Kameshima wrote `org-wl.el' and `org-mew.el'. - - * Jonathan Leech-Pepin wrote `ox-texinfo.el'. - - * Shidai Liu ("Leo") asked for embedded LaTeX and tested it. He also - provided frequent feedback and some patches. - - * Matt Lundin has proposed last-row references for table formulas - and named invisible anchors. He has also worked a lot on the FAQ. - - * David Maus wrote `org-atom.el', maintains the issues file for Org, - and is a prolific contributor on the mailing list with competent - replies, small fixes and patches. - - * Jason F. McBrayer suggested agenda export to CSV format. - - * Max Mikhanosha came up with the idea of refiling and sticky - agendas. - - * Dmitri Minaev sent a patch to set priority limits on a per-file - basis. - - * Stefan Monnier provided a patch to keep the Emacs-Lisp compiler - happy. - - * Richard Moreland wrote MobileOrg for the iPhone. - - * Rick Moynihan proposed allowing multiple TODO sequences in a file - and being able to quickly restrict the agenda to a subtree. - - * Todd Neal provided patches for links to Info files and Elisp forms. - - * Greg Newman refreshed the unicorn logo into its current form. - - * Tim O'Callaghan suggested in-file links, search options for general - file links, and TAGS. - - * Osamu Okano wrote `orgcard2ref.pl', a Perl program to create a text - version of the reference card. - - * Takeshi Okano translated the manual and David O'Toole's tutorial - into Japanese. - - * Oliver Oppitz suggested multi-state TODO items. - - * Scott Otterson sparked the introduction of descriptive text for - links, among other things. - - * Pete Phillips helped during the development of the TAGS feature, - and provided frequent feedback. - - * Francesco Pizzolante provided patches that helped speeding up the - agenda generation. - - * Martin Pohlack provided the code snippet to bundle character - insertion into bundles of 20 for undo. - - * Rackspace.com is hosting our website for free. Thank you - Rackspace! - - * T.V. Raman reported bugs and suggested improvements. - - * Matthias Rempe (Oelde) provided ideas, Windows support, and quality - control. - - * Paul Rivier provided the basic implementation of named footnotes. - He also acted as mailing list moderator for some time. - - * Kevin Rogers contributed code to access VM files on remote hosts. - - * Frank Ruell solved the mystery of the `keymapp nil' bug, a - conflict with `allout.el'. - - * Jason Riedy generalized the send-receive mechanism for Orgtbl - tables with extensive patches. - - * Philip Rooke created the Org reference card, provided lots of - feedback, developed and applied standards to the Org documentation. - - * Christian Schlauer proposed angular brackets around links, among - other things. - - * Christopher Schmidt reworked `orgstruct-mode' so that users can - enjoy folding in non-org buffers by using Org headlines in - comments. - - * Paul Sexton wrote `org-ctags.el'. - - * Linking to VM/BBDB/Gnus was first inspired by Tom Shannon's - `organizer-mode.el'. - - * Ilya Shlyakhter proposed the Archive Sibling, line numbering in - literal examples, and remote highlighting for referenced code - lines. - - * Stathis Sideris wrote the `ditaa.jar' ASCII to PNG converter that - is now packaged into Org's `contrib' directory. - - * Daniel Sinder came up with the idea of internal archiving by - locking subtrees. - - * Dale Smith proposed link abbreviations. - - * James TD Smith has contributed a large number of patches for useful - tweaks and features. - - * Adam Spiers asked for global linking commands, inspired the link - extension system, added support for mairix, and proposed the - mapping API. - - * Ulf Stegemann created the table to translate special symbols to - HTML, LaTeX, UTF-8, Latin-1 and ASCII. - - * Andy Stewart contributed code to `org-w3m.el', to copy HTML content - with links transformation to Org syntax. - - * David O'Toole wrote `org-publish.el' and drafted the manual - chapter about publishing. - - * Jambunathan K contributed the ODT exporter and rewrote the HTML - exporter. - - * Sebastien Vauban reported many issues with LaTeX and BEAMER export - and enabled source code highlighting in Gnus. - - * Stefan Vollmar organized a video-recorded talk at the - Max-Planck-Institute for Neurology. He also inspired the creation - of a concept index for HTML export. - - * Jürgen Vollmer contributed code generating the table of contents - in HTML output. - - * Samuel Wales has provided important feedback and bug reports. - - * Chris Wallace provided a patch implementing the `QUOTE' keyword. - - * David Wainberg suggested archiving, and improvements to the linking - system. - - * Carsten Wimmer suggested some changes and helped fix a bug in - linking to Gnus. - - * Roland Winkler requested additional key bindings to make Org work - on a tty. - - * Piotr Zielinski wrote `org-mouse.el', proposed agenda blocks and - contributed various ideas and code snippets. - - * Marco Wahl wrote `org-eww.el'. - - -File: org, Node: GNU Free Documentation License, Next: Main Index, Prev: History and acknowledgments, Up: Top - -Appendix D GNU Free Documentation License -***************************************** - - Version 1.3, 3 November 2008 - - Copyright (C) 2000, 2001, 2002, 2007, 2008, 2013, 2014 Free Software Foundation, Inc. - `http://fsf.org/' - - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - 0. PREAMBLE - - The purpose of this License is to make a manual, textbook, or other - functional and useful document "free" in the sense of freedom: to - assure everyone the effective freedom to copy and redistribute it, - with or without modifying it, either commercially or - noncommercially. Secondarily, this License preserves for the - author and publisher a way to get credit for their work, while not - being considered responsible for modifications made by others. - - This License is a kind of "copyleft", which means that derivative - works of the document must themselves be free in the same sense. - It complements the GNU General Public License, which is a copyleft - license designed for free software. - - We have designed this License in order to use it for manuals for - free software, because free software needs free documentation: a - free program should come with manuals providing the same freedoms - that the software does. But this License is not limited to - software manuals; it can be used for any textual work, regardless - of subject matter or whether it is published as a printed book. - We recommend this License principally for works whose purpose is - instruction or reference. - - 1. APPLICABILITY AND DEFINITIONS - - This License applies to any manual or other work, in any medium, - that contains a notice placed by the copyright holder saying it - can be distributed under the terms of this License. Such a notice - grants a world-wide, royalty-free license, unlimited in duration, - to use that work under the conditions stated herein. The - "Document", below, refers to any such manual or work. Any member - of the public is a licensee, and is addressed as "you". You - accept the license if you copy, modify or distribute the work in a - way requiring permission under copyright law. - - A "Modified Version" of the Document means any work containing the - Document or a portion of it, either copied verbatim, or with - modifications and/or translated into another language. - - A "Secondary Section" is a named appendix or a front-matter section - of the Document that deals exclusively with the relationship of the - publishers or authors of the Document to the Document's overall - subject (or to related matters) and contains nothing that could - fall directly within that overall subject. (Thus, if the Document - is in part a textbook of mathematics, a Secondary Section may not - explain any mathematics.) The relationship could be a matter of - historical connection with the subject or with related matters, or - of legal, commercial, philosophical, ethical or political position - regarding them. - - The "Invariant Sections" are certain Secondary Sections whose - titles are designated, as being those of Invariant Sections, in - the notice that says that the Document is released under this - License. If a section does not fit the above definition of - Secondary then it is not allowed to be designated as Invariant. - The Document may contain zero Invariant Sections. If the Document - does not identify any Invariant Sections then there are none. - - The "Cover Texts" are certain short passages of text that are - listed, as Front-Cover Texts or Back-Cover Texts, in the notice - that says that the Document is released under this License. A - Front-Cover Text may be at most 5 words, and a Back-Cover Text may - be at most 25 words. - - A "Transparent" copy of the Document means a machine-readable copy, - represented in a format whose specification is available to the - general public, that is suitable for revising the document - straightforwardly with generic text editors or (for images - composed of pixels) generic paint programs or (for drawings) some - widely available drawing editor, and that is suitable for input to - text formatters or for automatic translation to a variety of - formats suitable for input to text formatters. A copy made in an - otherwise Transparent file format whose markup, or absence of - markup, has been arranged to thwart or discourage subsequent - modification by readers is not Transparent. An image format is - not Transparent if used for any substantial amount of text. A - copy that is not "Transparent" is called "Opaque". - - Examples of suitable formats for Transparent copies include plain - ASCII without markup, Texinfo input format, LaTeX input format, - SGML or XML using a publicly available DTD, and - standard-conforming simple HTML, PostScript or PDF designed for - human modification. Examples of transparent image formats include - PNG, XCF and JPG. Opaque formats include proprietary formats that - can be read and edited only by proprietary word processors, SGML or - XML for which the DTD and/or processing tools are not generally - available, and the machine-generated HTML, PostScript or PDF - produced by some word processors for output purposes only. - - The "Title Page" means, for a printed book, the title page itself, - plus such following pages as are needed to hold, legibly, the - material this License requires to appear in the title page. For - works in formats which do not have any title page as such, "Title - Page" means the text near the most prominent appearance of the - work's title, preceding the beginning of the body of the text. - - The "publisher" means any person or entity that distributes copies - of the Document to the public. - - A section "Entitled XYZ" means a named subunit of the Document - whose title either is precisely XYZ or contains XYZ in parentheses - following text that translates XYZ in another language. (Here XYZ - stands for a specific section name mentioned below, such as - "Acknowledgements", "Dedications", "Endorsements", or "History".) - To "Preserve the Title" of such a section when you modify the - Document means that it remains a section "Entitled XYZ" according - to this definition. - - The Document may include Warranty Disclaimers next to the notice - which states that this License applies to the Document. These - Warranty Disclaimers are considered to be included by reference in - this License, but only as regards disclaiming warranties: any other - implication that these Warranty Disclaimers may have is void and - has no effect on the meaning of this License. - - 2. VERBATIM COPYING - - You may copy and distribute the Document in any medium, either - commercially or noncommercially, provided that this License, the - copyright notices, and the license notice saying this License - applies to the Document are reproduced in all copies, and that you - add no other conditions whatsoever to those of this License. You - may not use technical measures to obstruct or control the reading - or further copying of the copies you make or distribute. However, - you may accept compensation in exchange for copies. If you - distribute a large enough number of copies you must also follow - the conditions in section 3. - - You may also lend copies, under the same conditions stated above, - and you may publicly display copies. - - 3. COPYING IN QUANTITY - - If you publish printed copies (or copies in media that commonly - have printed covers) of the Document, numbering more than 100, and - the Document's license notice requires Cover Texts, you must - enclose the copies in covers that carry, clearly and legibly, all - these Cover Texts: Front-Cover Texts on the front cover, and - Back-Cover Texts on the back cover. Both covers must also clearly - and legibly identify you as the publisher of these copies. The - front cover must present the full title with all words of the - title equally prominent and visible. You may add other material - on the covers in addition. Copying with changes limited to the - covers, as long as they preserve the title of the Document and - satisfy these conditions, can be treated as verbatim copying in - other respects. - - If the required texts for either cover are too voluminous to fit - legibly, you should put the first ones listed (as many as fit - reasonably) on the actual cover, and continue the rest onto - adjacent pages. - - If you publish or distribute Opaque copies of the Document - numbering more than 100, you must either include a - machine-readable Transparent copy along with each Opaque copy, or - state in or with each Opaque copy a computer-network location from - which the general network-using public has access to download - using public-standard network protocols a complete Transparent - copy of the Document, free of added material. If you use the - latter option, you must take reasonably prudent steps, when you - begin distribution of Opaque copies in quantity, to ensure that - this Transparent copy will remain thus accessible at the stated - location until at least one year after the last time you - distribute an Opaque copy (directly or through your agents or - retailers) of that edition to the public. - - It is requested, but not required, that you contact the authors of - the Document well before redistributing any large number of - copies, to give them a chance to provide you with an updated - version of the Document. - - 4. MODIFICATIONS - - You may copy and distribute a Modified Version of the Document - under the conditions of sections 2 and 3 above, provided that you - release the Modified Version under precisely this License, with - the Modified Version filling the role of the Document, thus - licensing distribution and modification of the Modified Version to - whoever possesses a copy of it. In addition, you must do these - things in the Modified Version: - - A. Use in the Title Page (and on the covers, if any) a title - distinct from that of the Document, and from those of - previous versions (which should, if there were any, be listed - in the History section of the Document). You may use the - same title as a previous version if the original publisher of - that version gives permission. - - B. List on the Title Page, as authors, one or more persons or - entities responsible for authorship of the modifications in - the Modified Version, together with at least five of the - principal authors of the Document (all of its principal - authors, if it has fewer than five), unless they release you - from this requirement. - - C. State on the Title page the name of the publisher of the - Modified Version, as the publisher. - - D. Preserve all the copyright notices of the Document. - - E. Add an appropriate copyright notice for your modifications - adjacent to the other copyright notices. - - F. Include, immediately after the copyright notices, a license - notice giving the public permission to use the Modified - Version under the terms of this License, in the form shown in - the Addendum below. - - G. Preserve in that license notice the full lists of Invariant - Sections and required Cover Texts given in the Document's - license notice. - - H. Include an unaltered copy of this License. - - I. Preserve the section Entitled "History", Preserve its Title, - and add to it an item stating at least the title, year, new - authors, and publisher of the Modified Version as given on - the Title Page. If there is no section Entitled "History" in - the Document, create one stating the title, year, authors, - and publisher of the Document as given on its Title Page, - then add an item describing the Modified Version as stated in - the previous sentence. - - J. Preserve the network location, if any, given in the Document - for public access to a Transparent copy of the Document, and - likewise the network locations given in the Document for - previous versions it was based on. These may be placed in - the "History" section. You may omit a network location for a - work that was published at least four years before the - Document itself, or if the original publisher of the version - it refers to gives permission. - - K. For any section Entitled "Acknowledgements" or "Dedications", - Preserve the Title of the section, and preserve in the - section all the substance and tone of each of the contributor - acknowledgements and/or dedications given therein. - - L. Preserve all the Invariant Sections of the Document, - unaltered in their text and in their titles. Section numbers - or the equivalent are not considered part of the section - titles. - - M. Delete any section Entitled "Endorsements". Such a section - may not be included in the Modified Version. - - N. Do not retitle any existing section to be Entitled - "Endorsements" or to conflict in title with any Invariant - Section. - - O. Preserve any Warranty Disclaimers. - - If the Modified Version includes new front-matter sections or - appendices that qualify as Secondary Sections and contain no - material copied from the Document, you may at your option - designate some or all of these sections as invariant. To do this, - add their titles to the list of Invariant Sections in the Modified - Version's license notice. These titles must be distinct from any - other section titles. - - You may add a section Entitled "Endorsements", provided it contains - nothing but endorsements of your Modified Version by various - parties--for example, statements of peer review or that the text - has been approved by an organization as the authoritative - definition of a standard. - - You may add a passage of up to five words as a Front-Cover Text, - and a passage of up to 25 words as a Back-Cover Text, to the end - of the list of Cover Texts in the Modified Version. Only one - passage of Front-Cover Text and one of Back-Cover Text may be - added by (or through arrangements made by) any one entity. If the - Document already includes a cover text for the same cover, - previously added by you or by arrangement made by the same entity - you are acting on behalf of, you may not add another; but you may - replace the old one, on explicit permission from the previous - publisher that added the old one. - - The author(s) and publisher(s) of the Document do not by this - License give permission to use their names for publicity for or to - assert or imply endorsement of any Modified Version. - - 5. COMBINING DOCUMENTS - - You may combine the Document with other documents released under - this License, under the terms defined in section 4 above for - modified versions, provided that you include in the combination - all of the Invariant Sections of all of the original documents, - unmodified, and list them all as Invariant Sections of your - combined work in its license notice, and that you preserve all - their Warranty Disclaimers. - - The combined work need only contain one copy of this License, and - multiple identical Invariant Sections may be replaced with a single - copy. If there are multiple Invariant Sections with the same name - but different contents, make the title of each such section unique - by adding at the end of it, in parentheses, the name of the - original author or publisher of that section if known, or else a - unique number. Make the same adjustment to the section titles in - the list of Invariant Sections in the license notice of the - combined work. - - In the combination, you must combine any sections Entitled - "History" in the various original documents, forming one section - Entitled "History"; likewise combine any sections Entitled - "Acknowledgements", and any sections Entitled "Dedications". You - must delete all sections Entitled "Endorsements." - - 6. COLLECTIONS OF DOCUMENTS - - You may make a collection consisting of the Document and other - documents released under this License, and replace the individual - copies of this License in the various documents with a single copy - that is included in the collection, provided that you follow the - rules of this License for verbatim copying of each of the - documents in all other respects. - - You may extract a single document from such a collection, and - distribute it individually under this License, provided you insert - a copy of this License into the extracted document, and follow - this License in all other respects regarding verbatim copying of - that document. - - 7. AGGREGATION WITH INDEPENDENT WORKS - - A compilation of the Document or its derivatives with other - separate and independent documents or works, in or on a volume of - a storage or distribution medium, is called an "aggregate" if the - copyright resulting from the compilation is not used to limit the - legal rights of the compilation's users beyond what the individual - works permit. When the Document is included in an aggregate, this - License does not apply to the other works in the aggregate which - are not themselves derivative works of the Document. - - If the Cover Text requirement of section 3 is applicable to these - copies of the Document, then if the Document is less than one half - of the entire aggregate, the Document's Cover Texts may be placed - on covers that bracket the Document within the aggregate, or the - electronic equivalent of covers if the Document is in electronic - form. Otherwise they must appear on printed covers that bracket - the whole aggregate. - - 8. TRANSLATION - - Translation is considered a kind of modification, so you may - distribute translations of the Document under the terms of section - 4. Replacing Invariant Sections with translations requires special - permission from their copyright holders, but you may include - translations of some or all Invariant Sections in addition to the - original versions of these Invariant Sections. You may include a - translation of this License, and all the license notices in the - Document, and any Warranty Disclaimers, provided that you also - include the original English version of this License and the - original versions of those notices and disclaimers. In case of a - disagreement between the translation and the original version of - this License or a notice or disclaimer, the original version will - prevail. - - If a section in the Document is Entitled "Acknowledgements", - "Dedications", or "History", the requirement (section 4) to - Preserve its Title (section 1) will typically require changing the - actual title. - - 9. TERMINATION - - You may not copy, modify, sublicense, or distribute the Document - except as expressly provided under this License. Any attempt - otherwise to copy, modify, sublicense, or distribute it is void, - and will automatically terminate your rights under this License. - - However, if you cease all violation of this License, then your - license from a particular copyright holder is reinstated (a) - provisionally, unless and until the copyright holder explicitly - and finally terminates your license, and (b) permanently, if the - copyright holder fails to notify you of the violation by some - reasonable means prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is - reinstated permanently if the copyright holder notifies you of the - violation by some reasonable means, this is the first time you have - received notice of violation of this License (for any work) from - that copyright holder, and you cure the violation prior to 30 days - after your receipt of the notice. - - Termination of your rights under this section does not terminate - the licenses of parties who have received copies or rights from - you under this License. If your rights have been terminated and - not permanently reinstated, receipt of a copy of some or all of - the same material does not give you any rights to use it. - - 10. FUTURE REVISIONS OF THIS LICENSE - - The Free Software Foundation may publish new, revised versions of - the GNU Free Documentation License from time to time. Such new - versions will be similar in spirit to the present version, but may - differ in detail to address new problems or concerns. See - `http://www.gnu.org/copyleft/'. - - Each version of the License is given a distinguishing version - number. If the Document specifies that a particular numbered - version of this License "or any later version" applies to it, you - have the option of following the terms and conditions either of - that specified version or of any later version that has been - published (not as a draft) by the Free Software Foundation. If - the Document does not specify a version number of this License, - you may choose any version ever published (not as a draft) by the - Free Software Foundation. If the Document specifies that a proxy - can decide which future versions of this License can be used, that - proxy's public statement of acceptance of a version permanently - authorizes you to choose that version for the Document. - - 11. RELICENSING - - "Massive Multiauthor Collaboration Site" (or "MMC Site") means any - World Wide Web server that publishes copyrightable works and also - provides prominent facilities for anybody to edit those works. A - public wiki that anybody can edit is an example of such a server. - A "Massive Multiauthor Collaboration" (or "MMC") contained in the - site means any set of copyrightable works thus published on the MMC - site. - - "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0 - license published by Creative Commons Corporation, a not-for-profit - corporation with a principal place of business in San Francisco, - California, as well as future copyleft versions of that license - published by that same organization. - - "Incorporate" means to publish or republish a Document, in whole or - in part, as part of another Document. - - An MMC is "eligible for relicensing" if it is licensed under this - License, and if all works that were first published under this - License somewhere other than this MMC, and subsequently - incorporated in whole or in part into the MMC, (1) had no cover - texts or invariant sections, and (2) were thus incorporated prior - to November 1, 2008. - - The operator of an MMC Site may republish an MMC contained in the - site under CC-BY-SA on the same site at any time before August 1, - 2009, provided the MMC is eligible for relicensing. - - -ADDENDUM: How to use this License for your documents -==================================================== - -To use this License in a document you have written, include a copy of -the License in the document and put the following copyright and license -notices just after the title page: - - Copyright (C) YEAR YOUR NAME. - Permission is granted to copy, distribute and/or modify this document - under the terms of the GNU Free Documentation License, Version 1.3 - or any later version published by the Free Software Foundation; - with no Invariant Sections, no Front-Cover Texts, and no Back-Cover - Texts. A copy of the license is included in the section entitled ``GNU - Free Documentation License''. - - If you have Invariant Sections, Front-Cover Texts and Back-Cover -Texts, replace the "with...Texts." line with this: - - with the Invariant Sections being LIST THEIR TITLES, with - the Front-Cover Texts being LIST, and with the Back-Cover Texts - being LIST. - - If you have Invariant Sections without Cover Texts, or some other -combination of the three, merge those two alternatives to suit the -situation. - - If your document contains nontrivial examples of program code, we -recommend releasing these examples in parallel under your choice of -free software license, such as the GNU General Public License, to -permit their use in free software. - - -File: org, Node: Main Index, Next: Key Index, Prev: GNU Free Documentation License, Up: Top - -Concept index -************* - -[index] -* Menu: - -* #+ARCHIVE: Moving subtrees. (line 35) -* #+ASCII: ASCII/Latin-1/UTF-8 export. - (line 57) -* #+ATTR_ASCII: ASCII/Latin-1/UTF-8 export. - (line 68) -* #+ATTR_BEAMER: Beamer specific syntax. - (line 35) -* #+ATTR_HTML <1>: Images in HTML export. - (line 29) -* #+ATTR_HTML <2>: Tables in HTML export. - (line 11) -* #+ATTR_HTML: Links in HTML export. - (line 27) -* #+ATTR_LATEX, in example blocks: Example blocks in LaTeX export. - (line 6) -* #+ATTR_LATEX, in horizontal rules: Horizontal rules in LaTeX export. - (line 6) -* #+ATTR_LATEX, in images: Images in LaTeX export. - (line 6) -* #+ATTR_LATEX, in plain lists: Plain lists in LaTeX export. - (line 6) -* #+ATTR_LATEX, in source blocks: Source blocks in LaTeX export. - (line 6) -* #+ATTR_LATEX, in special blocks: Special blocks in LaTeX export. - (line 6) -* #+ATTR_LATEX, in tables: Tables in LaTeX export. - (line 6) -* #+ATTR_ODT <1>: Customizing tables in ODT export. - (line 6) -* #+ATTR_ODT <2>: Images in ODT export. - (line 31) -* #+ATTR_ODT: Tables in ODT export. - (line 20) -* #+ATTR_TEXINFO, in images: Images in Texinfo export. - (line 6) -* #+ATTR_TEXINFO, in plain lists: Plain lists in Texinfo export. - (line 6) -* #+ATTR_TEXINFO, in special blocks: Special blocks in Texinfo export. - (line 6) -* #+ATTR_TEXINFO, in tables: Tables in Texinfo export. - (line 6) -* #+AUTHOR: Export settings. (line 25) -* #+BEAMER: Beamer specific syntax. - (line 19) -* #+BEAMER_FONT_THEME: Beamer specific export settings. - (line 16) -* #+BEAMER_HEADER: Beamer specific export settings. - (line 25) -* #+BEAMER_INNER_THEME: Beamer specific export settings. - (line 19) -* #+BEAMER_OUTER_THEME: Beamer specific export settings. - (line 22) -* #+BEAMER_THEME: Beamer specific export settings. - (line 11) -* #+BEGIN, clocktable: The clock table. (line 36) -* #+BEGIN, columnview: Capturing column view. - (line 11) -* #+BEGIN:dynamic block: Dynamic blocks. (line 15) -* #+BEGIN_CENTER: Paragraphs. (line 31) -* #+BEGIN_COMMENT: Comment lines. (line 10) -* #+BEGIN_EXAMPLE: Literal examples. (line 8) -* #+BEGIN_EXPORT ascii: ASCII/Latin-1/UTF-8 export. - (line 57) -* #+BEGIN_EXPORT beamer: Beamer specific syntax. - (line 19) -* #+BEGIN_EXPORT html: Quoting HTML tags. (line 12) -* #+BEGIN_EXPORT latex: Quoting LaTeX code. (line 17) -* #+BEGIN_EXPORT texinfo: Quoting Texinfo code. - (line 9) -* #+BEGIN_JUSTIFYLEFT: ASCII/Latin-1/UTF-8 export. - (line 78) -* #+BEGIN_JUSTIFYRIGHT: ASCII/Latin-1/UTF-8 export. - (line 78) -* #+BEGIN_QUOTE: Paragraphs. (line 26) -* #+BEGIN_SRC <1>: Structure of code blocks. - (line 6) -* #+BEGIN_SRC: Literal examples. (line 28) -* #+BEGIN_VERSE: Paragraphs. (line 13) -* #+BIND: Export settings. (line 210) -* #+CALL: Evaluating code blocks. - (line 25) -* #+CAPTION <1>: Images in HTML export. - (line 29) -* #+CAPTION <2>: Tables in HTML export. - (line 11) -* #+CAPTION: Images and tables. (line 6) -* #+CATEGORY: Categories. (line 6) -* #+CINDEX: Indices. (line 6) -* #+COLUMNS: Scope of column definitions. - (line 8) -* #+CONSTANTS: References. (line 110) -* #+CREATOR: Export settings. (line 28) -* #+DATE: Export settings. (line 32) -* #+DESCRIPTION (Beamer): Beamer specific export settings. - (line 29) -* #+DESCRIPTION (HTML): HTML Specific export settings. - (line 10) -* #+DESCRIPTION (LaTeX): LaTeX specific export settings. - (line 11) -* #+DESCRIPTION (ODT): ODT specific export settings. - (line 11) -* #+EMAIL: Export settings. (line 35) -* #+EXCLUDE_TAGS: Export settings. (line 52) -* #+EXPORT_FILE_NAME: Export settings. (line 64) -* #+FILETAGS: Tag inheritance. (line 20) -* #+FINDEX: Indices. (line 6) -* #+HEADER:: Code block specific header arguments. - (line 30) -* #+HTML: Quoting HTML tags. (line 12) -* #+HTML_CONTAINER: HTML Specific export settings. - (line 19) -* #+HTML_DOCTYPE: HTML Specific export settings. - (line 16) -* #+HTML_HEAD <1>: CSS support. (line 48) -* #+HTML_HEAD: HTML Specific export settings. - (line 35) -* #+HTML_HEAD_EXTRA <1>: CSS support. (line 48) -* #+HTML_HEAD_EXTRA: HTML Specific export settings. - (line 39) -* #+HTML_INCLUDE_STYLE: CSS support. (line 43) -* #+HTML_LINK_HOME: HTML Specific export settings. - (line 23) -* #+HTML_LINK_UP: HTML Specific export settings. - (line 26) -* #+HTML_MATHJAX: HTML Specific export settings. - (line 30) -* #+INCLUDE: Include files. (line 7) -* #+INDEX: Generating an index. (line 16) -* #+INFOJS_OPT: JavaScript support. (line 20) -* #+KEYWORDS (Beamer): Beamer specific export settings. - (line 36) -* #+KEYWORDS (HTML): HTML Specific export settings. - (line 43) -* #+KEYWORDS (LaTeX): LaTeX specific export settings. - (line 46) -* #+KEYWORDS (ODT): ODT specific export settings. - (line 16) -* #+KINDEX: Indices. (line 6) -* #+LANGUAGE: Export settings. (line 38) -* #+LATEX: Quoting LaTeX code. (line 13) -* #+LATEX_CLASS <1>: LaTeX header and sectioning. - (line 23) -* #+LATEX_CLASS: LaTeX specific export settings. - (line 20) -* #+LATEX_CLASS_OPTIONS <1>: LaTeX header and sectioning. - (line 23) -* #+LATEX_CLASS_OPTIONS: LaTeX specific export settings. - (line 28) -* #+LATEX_COMPILER: LaTeX specific export settings. - (line 32) -* #+LATEX_HEADER <1>: LaTeX header and sectioning. - (line 30) -* #+LATEX_HEADER: LaTeX specific export settings. - (line 36) -* #+LATEX_HEADER (HTML): HTML Specific export settings. - (line 48) -* #+LATEX_HEADER_EXTRA <1>: LaTeX header and sectioning. - (line 30) -* #+LATEX_HEADER_EXTRA: LaTeX specific export settings. - (line 41) -* #+LINK: Link abbreviations. (line 49) -* #+MACRO: Macro replacement. (line 6) -* #+NAME <1>: Structure of code blocks. - (line 6) -* #+NAME <2>: Images and tables. (line 6) -* #+NAME: Internal links. (line 21) -* #+NAME, for table: References. (line 131) -* #+ODT_STYLES_FILE: Applying custom styles. - (line 25) -* #+OPTIONS: Export settings. (line 6) -* #+ORGLST: Radio lists. (line 11) -* #+ORGTBL: Radio tables. (line 19) -* #+ORGTBL, SEND: A LaTeX example. (line 13) -* #+PINDEX: Indices. (line 6) -* #+PLOT: Org-Plot. (line 6) -* #+PRIORITIES: Priorities. (line 43) -* #+PROPERTY: Property syntax. (line 44) -* #+RESULTS: Evaluating code blocks. - (line 6) -* #+SELECT_TAGS: Export settings. (line 44) -* #+SEQ_TODO: Per-file keywords. (line 6) -* #+SETUPFILE <1>: In-buffer settings. (line 52) -* #+SETUPFILE: Export settings. (line 13) -* #+STARTUP: In-buffer settings. (line 67) -* #+SUBAUTHOR <1>: Texinfo title and copyright page. - (line 12) -* #+SUBAUTHOR: Texinfo specific export settings. - (line 14) -* #+SUBTITLE (ASCII): ASCII/Latin-1/UTF-8 export. - (line 40) -* #+SUBTITLE (Beamer): Beamer specific export settings. - (line 44) -* #+SUBTITLE (HTML): HTML Specific export settings. - (line 53) -* #+SUBTITLE (LaTeX): LaTeX specific export settings. - (line 55) -* #+SUBTITLE (Texinfo): Texinfo specific export settings. - (line 11) -* #+TAGS: Setting tags. (line 29) -* #+TBLFM <1>: In-buffer settings. (line 176) -* #+TBLFM <2>: Editing and debugging formulas. - (line 99) -* #+TBLFM: Field and range formulas. - (line 12) -* #+TBLFM line, multiple: Editing and debugging formulas. - (line 99) -* #+TBLFM, switching: Editing and debugging formulas. - (line 99) -* #+TEXINFO: Quoting Texinfo code. - (line 9) -* #+TEXINFO_CLASS <1>: Headings and sectioning structure. - (line 6) -* #+TEXINFO_CLASS <2>: Texinfo file header. (line 11) -* #+TEXINFO_CLASS: Texinfo specific export settings. - (line 20) -* #+TEXINFO_DIR_CATEGORY <1>: Info directory file. (line 6) -* #+TEXINFO_DIR_CATEGORY: Texinfo specific export settings. - (line 30) -* #+TEXINFO_DIR_DESC <1>: Info directory file. (line 6) -* #+TEXINFO_DIR_DESC: Texinfo specific export settings. - (line 36) -* #+TEXINFO_DIR_TITLE <1>: Info directory file. (line 6) -* #+TEXINFO_DIR_TITLE: Texinfo specific export settings. - (line 33) -* #+TEXINFO_FILENAME <1>: Texinfo file header. (line 6) -* #+TEXINFO_FILENAME: Texinfo specific export settings. - (line 17) -* #+TEXINFO_HEADER <1>: Texinfo file header. (line 11) -* #+TEXINFO_HEADER: Texinfo specific export settings. - (line 24) -* #+TEXINFO_POST_HEADER: Texinfo specific export settings. - (line 27) -* #+TEXINFO_PRINTED_TITLE <1>: Texinfo title and copyright page. - (line 6) -* #+TEXINFO_PRINTED_TITLE: Texinfo specific export settings. - (line 39) -* #+TINDEX: Indices. (line 6) -* #+TITLE: Export settings. (line 60) -* #+TOC: Table of contents. (line 6) -* #+TODO: Per-file keywords. (line 6) -* #+TYP_TODO: Per-file keywords. (line 6) -* #+VINDEX: Indices. (line 6) -* %:annotation template expansion in capture: capture protocol. - (line 23) -* %:description template expansion in capture: capture protocol. - (line 23) -* %:link template expansion in capture: capture protocol. (line 23) -* :base-url property in open-source protocol: open-source protocol. - (line 13) -* :cache, src header argument <1>: cache. (line 6) -* :cache, src header argument: System-wide header arguments. - (line 9) -* :colnames, src header argument: colnames. (line 6) -* :comments, src header argument: comments. (line 6) -* :dir, src header argument: dir. (line 6) -* :epilogue, src header argument: epilogue. (line 6) -* :eval, src header argument: eval. (line 6) -* :exports, src header argument <1>: exports. (line 6) -* :exports, src header argument <2>: System-wide header arguments. - (line 9) -* :exports, src header argument: Exporting code blocks. - (line 20) -* :file, src header argument: file. (line 6) -* :file-ext, src header argument: file-ext. (line 6) -* :hlines, src header argument: hlines. (line 6) -* :indic attribute, in Texinfo export: Plain lists in Texinfo export. - (line 12) -* :mkdirp, src header argument: mkdirp. (line 6) -* :no-expand, src header argument: no-expand. (line 6) -* :noweb, src header argument <1>: noweb. (line 6) -* :noweb, src header argument: System-wide header arguments. - (line 9) -* :noweb-ref, src header argument: noweb-ref. (line 6) -* :noweb-sep, src header argument: noweb-sep. (line 6) -* :online-suffix property in open-source protocol: open-source protocol. - (line 13) -* :output-dir, src header argument: output-dir. (line 6) -* :padline, src header argument: padline. (line 6) -* :post, src header argument: post. (line 6) -* :prologue, src header argument: prologue. (line 6) -* :results, src header argument <1>: Results of evaluation. - (line 33) -* :results, src header argument <2>: results. (line 6) -* :results, src header argument: System-wide header arguments. - (line 9) -* :rewrites property in open-source protocol: open-source protocol. - (line 43) -* :rownames, src header argument: rownames. (line 6) -* :sep attribute, in Texinfo export: Plain lists in Texinfo export. - (line 17) -* :sep, src header argument: sep. (line 6) -* :session, src header argument <1>: session. (line 6) -* :session, src header argument: System-wide header arguments. - (line 9) -* :shebang, src header argument: shebang. (line 6) -* :table-type attribute, in Texinfo export: Plain lists in Texinfo export. - (line 6) -* :tangle, src header argument <1>: tangle. (line 6) -* :tangle, src header argument: Extracting source code. - (line 23) -* :tangle-mode, src header argument: tangle-mode. (line 6) -* :var, src header argument: var. (line 6) -* :working-directory property in open-source protocol: open-source protocol. - (line 13) -* :working-suffix property in open-source protocol: open-source protocol. - (line 13) -* :wrap, src header argument: wrap. (line 6) -* abbreviation, links: Link abbreviations. (line 6) -* abstract, in LaTeX export: Special blocks in LaTeX export. - (line 6) -* acknowledgments: History and acknowledgments. - (line 6) -* action, for publishing: Publishing action. (line 6) -* activation: Activation. (line 6) -* active region <1>: ODT export commands. (line 6) -* active region <2>: Built-in table editor. - (line 162) -* active region: Structure editing. (line 139) -* add-on packages: Add-on packages. (line 6) -* add-ons, context-sensitive commands: Context-sensitive commands. - (line 6) -* agenda: Weekly/daily agenda. (line 6) -* agenda dispatcher: Agenda dispatcher. (line 6) -* agenda files: Agenda files. (line 6) -* agenda files, removing buffers: Agenda commands. (line 519) -* agenda views: Agenda views. (line 6) -* agenda views, custom: Custom agenda views. (line 6) -* agenda views, exporting <1>: Exporting agenda views. - (line 6) -* agenda views, exporting: Agenda commands. (line 505) -* agenda views, main example: Storing searches. (line 9) -* agenda views, optimization: Speeding up your agendas. - (line 6) -* agenda views, user-defined: Special agenda views. - (line 6) -* agenda*, as an agenda views: Storing searches. (line 9) -* agenda, as an agenda views: Storing searches. (line 9) -* agenda, column view: Agenda column view. (line 6) -* agenda, pipe: Extracting agenda information. - (line 6) -* agenda, sticky: Agenda dispatcher. (line 50) -* agenda, with block views: Block agenda. (line 6) -* align, STARTUP keyword: In-buffer settings. (line 88) -* alignment in tables: Column width and alignment. - (line 6) -* anniversaries, from BBDB: Weekly/daily agenda. (line 79) -* API, for mapping: Using the mapping API. - (line 6) -* API, for properties <1>: Using the property API. - (line 6) -* API, for properties: Property API. (line 6) -* appointment <1>: Weekly/daily agenda. (line 126) -* appointment: Timestamps. (line 14) -* appointment reminders: Weekly/daily agenda. (line 126) -* appt.el: Weekly/daily agenda. (line 126) -* archive locations: Moving subtrees. (line 25) -* archive tag: Internal archiving. (line 6) -* archived entries, in agenda views: Agenda views. (line 37) -* Archives mode: Agenda commands. (line 134) -* archiving: Archiving. (line 6) -* ASCII export: ASCII/Latin-1/UTF-8 export. - (line 6) -* Atom feeds: RSS feeds. (line 6) -* attachments: Attachments. (line 6) -* author: Feedback. (line 6) -* author, macro: Macro replacement. (line 24) -* autoload: Activation. (line 6) -* babel, languages: Languages. (line 6) -* babel, library of: Library of Babel. (line 6) -* backtrace of an error: Feedback. (line 66) -* BBDB links: External links. (line 6) -* BBDB, anniversaries: Weekly/daily agenda. (line 79) -* Beamer export: Beamer export. (line 6) -* begin block, end block: Structure of code blocks. - (line 46) -* block agenda: Block agenda. (line 6) -* blocking, of checkboxes: Checkboxes. (line 46) -* blocks, folding: Blocks. (line 6) -* bold text, markup rules: Emphasis and monospace. - (line 6) -* Boolean logic, for tag/property searches: Matching tags and properties. - (line 34) -* bug reports: Feedback. (line 6) -* C-c C-c, overview: The very busy C-c C-c key. - (line 6) -* calc package: The spreadsheet. (line 6) -* calc.el: Cooperation. (line 6) -* calculations, in tables <1>: The spreadsheet. (line 6) -* calculations, in tables: Built-in table editor. - (line 162) -* calendar commands, from agenda: Agenda commands. (line 454) -* calendar integration: Weekly/daily agenda. (line 32) -* calendar, for selecting date: The date/time prompt. - (line 76) -* capture <1>: Capture. (line 6) -* capture: Capture - Refile - Archive. - (line 6) -* capture protocol: capture protocol. (line 6) -* capture, %:annotation placeholder: capture protocol. (line 23) -* capture, %:description placeholder: capture protocol. (line 23) -* capture, %:link placeholder: capture protocol. (line 23) -* capturing, from agenda: Agenda commands. (line 348) -* category: Categories. (line 6) -* category filtering, in agenda: Filtering/limiting agenda items. - (line 17) -* category, require for tags/property match: Matching tags and properties. - (line 72) -* CDLaTeX: CDLaTeX mode. (line 6) -* cdlatex.el: Cooperation. (line 21) -* center blocks: Paragraphs. (line 31) -* center image (LaTeX export): Images in LaTeX export. - (line 50) -* checkbox blocking: Checkboxes. (line 46) -* checkbox statistics: Checkboxes. (line 30) -* checkboxes: Checkboxes. (line 6) -* checkboxes and TODO dependencies: TODO dependencies. (line 52) -* children, subtree visibility state: Global and local cycling. - (line 10) -* clean outline view: Clean view. (line 6) -* clocking time: Clocking work time. (line 6) -* clocktable, dynamic block: The clock table. (line 6) -* code block, batch execution: Batch execution. (line 6) -* code block, editing: Editing source code. (line 6) -* code block, evaluating: Evaluating code blocks. - (line 6) -* code block, exporting: Exporting code blocks. - (line 6) -* code block, extracting source code: Extracting source code. - (line 6) -* code block, header arguments: Header arguments. (line 6) -* code block, key bindings: Key bindings and useful functions. - (line 6) -* code block, languages: Languages. (line 6) -* code block, library: Library of Babel. (line 6) -* code block, noweb reference: Noweb reference syntax. - (line 6) -* code block, results of evaluation: Results of evaluation. - (line 6) -* code block, structure: Structure of code blocks. - (line 6) -* code line references, markup rules: Literal examples. (line 6) -* code text, markup rules: Emphasis and monospace. - (line 6) -* column formula: Column formulas. (line 6) -* column view, for properties: Defining columns. (line 6) -* column view, in agenda: Agenda column view. (line 6) -* column, of field coordinates: References. (line 86) -* commands, in agenda buffer: Agenda commands. (line 6) -* comment lines: Comment lines. (line 6) -* comment trees: Comment lines. (line 13) -* commented entries, in agenda views: Agenda views. (line 37) -* completion, of dictionary words: Completion. (line 6) -* completion, of file names: Handling links. (line 89) -* completion, of link abbreviations: Completion. (line 6) -* completion, of links: Handling links. (line 66) -* completion, of option keywords <1>: Completion. (line 6) -* completion, of option keywords: Per-file keywords. (line 23) -* completion, of property keys: Completion. (line 6) -* completion, of tags <1>: Completion. (line 6) -* completion, of tags: Setting tags. (line 11) -* completion, of TeX symbols: Completion. (line 6) -* completion, of TODO keywords <1>: Completion. (line 6) -* completion, of TODO keywords: Workflow states. (line 15) -* concept index, in Texinfo export: Indices. (line 6) -* constants, in calculations: References. (line 110) -* constants.el: Cooperation. (line 12) -* constcgs, STARTUP keyword: In-buffer settings. (line 146) -* constSI, STARTUP keyword: In-buffer settings. (line 146) -* content, STARTUP keyword <1>: In-buffer settings. (line 74) -* content, STARTUP keyword: Initial visibility. (line 6) -* contents, global visibility state: Global and local cycling. - (line 18) -* context-sensitive commands, hooks: Context-sensitive commands. - (line 6) -* continuous clocking: Resolving idle time. (line 78) -* convert: Configuring a document converter. - (line 6) -* converter: Configuring a document converter. - (line 6) -* coordinates, of field: References. (line 86) -* copying notes: Refile and copy. (line 6) -* copying, of subtrees: Structure editing. (line 6) -* countdown timer: Timers. (line 6) -* counter, macro: Macro replacement. (line 55) -* creating timestamps: Creating timestamps. (line 6) -* CSS, for HTML export: CSS support. (line 6) -* CUA.el: Conflicts. (line 18) -* custom agenda views: Custom agenda views. (line 6) -* custom date/time format: Custom time format. (line 6) -* custom search strings: Custom searches. (line 6) -* customization: Customization. (line 6) -* customtime, STARTUP keyword: In-buffer settings. (line 142) -* cutting, of subtrees: Structure editing. (line 6) -* cycling, in plain lists: Plain lists. (line 69) -* cycling, of agenda files: Agenda files. (line 22) -* cycling, of TODO states: TODO basics. (line 14) -* cycling, visibility: Visibility cycling. (line 6) -* daily agenda: Weekly/daily agenda. (line 6) -* dash, special symbol: Special symbols. (line 39) -* data type index, in Texinfo export: Indices. (line 6) -* date format, custom: Custom time format. (line 6) -* date range: Timestamps. (line 42) -* date stamp: Dates and times. (line 6) -* date stamps: Timestamps. (line 6) -* date tree: Using capture. (line 9) -* date, macro: Macro replacement. (line 29) -* date, reading in minibuffer: The date/time prompt. - (line 6) -* dates: Dates and times. (line 6) -* Davison, Dan: Working with source code. - (line 6) -* DEADLINE keyword: Deadlines and scheduling. - (line 11) -* deadlines: Timestamps. (line 6) -* debugging, of table formulas: Editing and debugging formulas. - (line 132) -* defining new protocols: Protocols. (line 25) -* demotion, of subtrees: Structure editing. (line 6) -* dependencies, of TODO states: TODO dependencies. (line 6) -* diary entries, creating from agenda: Agenda commands. (line 459) -* diary integration: Weekly/daily agenda. (line 32) -* dictionary word completion: Completion. (line 6) -* dir file, in Texinfo export: Info directory file. (line 6) -* directories, for publishing: Sources and destinations. - (line 6) -* dispatching agenda commands: Agenda dispatcher. (line 6) -* display changing, in agenda: Agenda commands. (line 69) -* doc, docx, rtf: Configuring a document converter. - (line 6) -* document structure: Document structure. (line 6) -* document title: Export settings. (line 60) -* Dominik, Carsten: Cooperation. (line 12) -* DONE, final TODO keyword: Per-file keywords. (line 26) -* dragging, agenda lines: Agenda commands. (line 353) -* drawer, for properties: Property syntax. (line 6) -* drawer, for state change recording: Tracking TODO state changes. - (line 6) -* drawers: Drawers. (line 6) -* Duration, computing: Durations and time values. - (line 6) -* dvipng <1>: Working with LaTeX math snippets. - (line 48) -* dvipng: Math formatting in HTML export. - (line 6) -* dvisvgm <1>: Working with LaTeX math snippets. - (line 48) -* dvisvgm: Math formatting in HTML export. - (line 6) -* dynamic blocks: Dynamic blocks. (line 6) -* dynamic indentation: Clean view. (line 6) -* ecomplete.el: Conflicts. (line 33) -* editing tables: Tables. (line 6) -* editing, of table formulas: Editing and debugging formulas. - (line 6) -* edits, catching invisible: Catching invisible edits. - (line 6) -* effort estimates: Effort estimates. (line 6) -* effort filtering, in agenda: Filtering/limiting agenda items. - (line 17) -* Elisp links: External links. (line 6) -* ellipsis, special symbol: Special symbols. (line 39) -* ELPA: Activation. (line 6) -* email, macro: Macro replacement. (line 24) -* embedding images in ODT: Images in ODT export. - (line 6) -* entitiesplain, STARTUP keyword: In-buffer settings. (line 169) -* entitiespretty, STARTUP keyword <1>: In-buffer settings. (line 169) -* entitiespretty, STARTUP keyword: Special symbols. (line 34) -* escaping characters: Special symbols. (line 27) -* evaluate time range: Creating timestamps. (line 62) -* even, STARTUP keyword: In-buffer settings. (line 132) -* example blocks, in LaTeX export: Example blocks in LaTeX export. - (line 6) -* export back-end: Exporting. (line 12) -* export back-ends, built-in: Other built-in back-ends. - (line 6) -* Export, dispatcher: The export dispatcher. - (line 6) -* export, OpenDocument: OpenDocument Text export. - (line 6) -* Export, settings: Export settings. (line 6) -* Export, writing back-ends: Adding export back-ends. - (line 6) -* exporting: Exporting. (line 6) -* exporting agenda views <1>: Exporting agenda views. - (line 13) -* exporting agenda views: Agenda commands. (line 505) -* exporting, not: Comment lines. (line 6) -* extended TODO keywords: TODO extensions. (line 6) -* external archiving: Moving subtrees. (line 6) -* external links: External links. (line 6) -* external links, in HTML export: Links in HTML export. - (line 6) -* faces, for TODO keywords: Faces for TODO keywords. - (line 6) -* FAQ: Summary. (line 49) -* feedback: Feedback. (line 6) -* field coordinates: References. (line 86) -* field formula: Field and range formulas. - (line 6) -* field references: References. (line 15) -* file links: External links. (line 6) -* file links, searching: Search options. (line 6) -* file name completion: Handling links. (line 89) -* files for agenda: Agenda files. (line 6) -* files, adding to agenda list: Agenda files. (line 15) -* files, selecting for publishing: Selecting files. (line 6) -* filladapt.el: Conflicts. (line 44) -* filtering, by tag, category, top headline and effort, in agenda: Filtering/limiting agenda items. - (line 17) -* Filters, exporting: Advanced configuration. - (line 32) -* fnadjust, STARTUP keyword: In-buffer settings. (line 152) -* fnauto, STARTUP keyword: In-buffer settings. (line 152) -* fnconfirm, STARTUP keyword: In-buffer settings. (line 152) -* fninline, STARTUP keyword: In-buffer settings. (line 152) -* fnlocal, STARTUP keyword: In-buffer settings. (line 152) -* fnplain, STARTUP keyword: In-buffer settings. (line 152) -* fnprompt, STARTUP keyword: In-buffer settings. (line 152) -* folded, subtree visibility state: Global and local cycling. - (line 10) -* folding, sparse trees: Sparse trees. (line 6) -* following links: Handling links. (line 101) -* footnotes: Footnotes. (line 6) -* format specifier: Formula syntax for Calc. - (line 14) -* format, of links: Link format. (line 6) -* formatting source code, markup rules: Literal examples. (line 23) -* formula debugging: Editing and debugging formulas. - (line 132) -* formula editing: Editing and debugging formulas. - (line 6) -* formula syntax, Calc: Formula syntax for Calc. - (line 6) -* formula, for individual table field: Field and range formulas. - (line 6) -* formula, for range of fields: Field and range formulas. - (line 6) -* formula, for table column: Column formulas. (line 6) -* formula, in tables: Built-in table editor. - (line 162) -* function index, in Texinfo export: Indices. (line 6) -* Gillespie, Dave: Cooperation. (line 6) -* global cycling: Global and local cycling. - (line 18) -* global key bindings: Activation. (line 6) -* global TODO list: Global TODO list. (line 6) -* global visibility states: Global and local cycling. - (line 18) -* Gnus links: External links. (line 6) -* graph, in tables: Org-Plot. (line 6) -* group tags: Tag hierarchy. (line 6) -* group tags, as regular expressions: Matching tags and properties. - (line 65) -* grouping columns in tables: Column groups. (line 6) -* habits: Tracking your habits. - (line 6) -* hacking: Hacking. (line 6) -* handle rewritten URL in open-source protocol: open-source protocol. - (line 32) -* header, for LaTeX files: LaTeX header and sectioning. - (line 6) -* headline navigation: Motion. (line 6) -* headline tagging: Tags. (line 6) -* headline, promotion and demotion: Structure editing. (line 6) -* headlines: Headlines. (line 6) -* hide text: Visibility cycling. (line 6) -* hideblocks, STARTUP keyword <1>: In-buffer settings. (line 164) -* hideblocks, STARTUP keyword: Blocks. (line 13) -* hidestars, STARTUP keyword: In-buffer settings. (line 132) -* hiding leading stars: Clean view. (line 6) -* history: History and acknowledgments. - (line 6) -* hooks: Hooks. (line 6) -* horizontal rules, in ASCII export: ASCII/Latin-1/UTF-8 export. - (line 68) -* horizontal rules, in LaTeX export: Horizontal rules in LaTeX export. - (line 6) -* horizontal rules, markup rules: Horizontal rules. (line 6) -* HTML entities: Special symbols. (line 6) -* HTML export: HTML export. (line 6) -* HTML export, CSS: CSS support. (line 6) -* HTML, and Orgtbl mode: Translator functions. - (line 6) -* HTML5, export new elements: HTML doctypes. (line 33) -* hyperlinks: Hyperlinks. (line 6) -* hyperlinks, adding new types: Adding hyperlink types. - (line 6) -* iCalendar export: iCalendar export. (line 6) -* identify, ImageMagick: Images in ODT export. - (line 34) -* idle, resolve, dangling: Resolving idle time. (line 9) -* image, centering (LaTeX export): Images in LaTeX export. - (line 50) -* imagemagick <1>: Working with LaTeX math snippets. - (line 48) -* imagemagick: Math formatting in HTML export. - (line 6) -* images, embedding in ODT: Images in ODT export. - (line 6) -* images, inline in HTML: Images in HTML export. - (line 6) -* images, inline in LaTeX: Images in LaTeX export. - (line 6) -* images, inlining: Handling links. (line 136) -* imenu.el: Cooperation. (line 25) -* in-buffer settings: In-buffer settings. (line 6) -* inactive timestamp: Timestamps. (line 51) -* include files, during export: Include files. (line 6) -* indent, STARTUP keyword: In-buffer settings. (line 79) -* indentation, in source blocks <1>: Editing source code. (line 38) -* indentation, in source blocks: Literal examples. (line 72) -* index, in a publishing project: Generating an index. (line 6) -* Info directory file, in Texinfo export: Info directory file. - (line 6) -* Info links: External links. (line 6) -* inheritance, of properties: Property inheritance. - (line 6) -* inheritance, of tags: Tag inheritance. (line 6) -* inline, in LaTeX export: Quoting LaTeX code. (line 10) -* inlined images, markup rules: Images and tables. (line 22) -* inlineimages, STARTUP keyword <1>: In-buffer settings. (line 93) -* inlineimages, STARTUP keyword: Handling links. (line 136) -* inlining images: Handling links. (line 136) -* inlining images in HTML: Images in HTML export. - (line 6) -* inlining images in LaTeX: Images in LaTeX export. - (line 6) -* input file, macro: Macro replacement. (line 44) -* inserting links: Handling links. (line 66) -* insertion, of templates: Easy templates. (line 6) -* install-info parameters, in Texinfo export: Info directory file. - (line 6) -* installation: Installation. (line 6) -* Installing Org protocol: Protocols. (line 14) -* internal links: Internal links. (line 6) -* internal links, in HTML export: Links in HTML export. - (line 6) -* introduction: Introduction. (line 6) -* iPhone: MobileOrg. (line 6) -* IRC links: External links. (line 6) -* italic text, markup rules: Emphasis and monospace. - (line 6) -* jumping, to headlines: Motion. (line 6) -* key bindings, global: Activation. (line 6) -* keystroke index, in Texinfo export: Indices. (line 6) -* keyword options: Per-file keywords. (line 6) -* LaTeX class: LaTeX header and sectioning. - (line 6) -* LaTeX entities: Special symbols. (line 6) -* LaTeX export: LaTeX export. (line 6) -* LaTeX fragments: LaTeX fragments. (line 6) -* LaTeX fragments, preview: Previewing LaTeX fragments. - (line 6) -* LaTeX header: LaTeX header and sectioning. - (line 6) -* LaTeX interpretation: Embedded LaTeX. (line 6) -* LaTeX sectioning structure: LaTeX header and sectioning. - (line 6) -* LaTeX, and Orgtbl mode: A LaTeX example. (line 6) -* latexpreview, STARTUP keyword: In-buffer settings. (line 100) -* Latin-1 export: ASCII/Latin-1/UTF-8 export. - (line 6) -* level, require for tags/property match: Matching tags and properties. - (line 72) -* LibreOffice <1>: Extending ODT export. - (line 12) -* LibreOffice: OpenDocument Text export. - (line 6) -* limits, in agenda: Filtering/limiting agenda items. - (line 118) -* link abbreviations: Link abbreviations. (line 6) -* link abbreviations, completion of: Completion. (line 6) -* link completion: Handling links. (line 66) -* link format: Link format. (line 6) -* links, external: External links. (line 6) -* links, finding next/previous: Handling links. (line 156) -* links, handling: Handling links. (line 6) -* links, in HTML export: Links in HTML export. - (line 6) -* links, in ODT export: Links in ODT export. (line 6) -* links, internal: Internal links. (line 6) -* links, publishing: Publishing links. (line 6) -* links, radio targets: Radio targets. (line 6) -* links, returning to: Handling links. (line 149) -* linter: Org syntax. (line 24) -* Lisp forms, as table formulas: Formula syntax for Lisp. - (line 6) -* list of listings: Table of contents. (line 6) -* list of tables: Table of contents. (line 6) -* lists, in other modes: Tables in arbitrary syntax. - (line 6) -* lists, ordered: Plain lists. (line 6) -* lists, plain: Plain lists. (line 6) -* literal examples, markup rules: Literal examples. (line 6) -* logdone, STARTUP keyword: In-buffer settings. (line 106) -* logdrawer, STARTUP keyword: In-buffer settings. (line 106) -* logging, of progress: Progress logging. (line 6) -* lognoteclock-out, STARTUP keyword: In-buffer settings. (line 106) -* lognotedone, STARTUP keyword: In-buffer settings. (line 106) -* lognoteredeadline, STARTUP keyword: In-buffer settings. (line 106) -* lognoterefile, STARTUP keyword: In-buffer settings. (line 106) -* lognoterepeat, STARTUP keyword: In-buffer settings. (line 106) -* lognotereschedule, STARTUP keyword: In-buffer settings. (line 106) -* logredeadline, STARTUP keyword: In-buffer settings. (line 106) -* logrefile, STARTUP keyword: In-buffer settings. (line 106) -* logrepeat, STARTUP keyword: In-buffer settings. (line 106) -* logreschedule, STARTUP keyword: In-buffer settings. (line 106) -* logstatesreversed, STARTUP keyword: In-buffer settings. (line 106) -* lookup functions in tables: Lookup functions. (line 6) -* Ludlam, Eric M.: Cooperation. (line 34) -* macro replacement, during export: Macro replacement. (line 6) -* maintainer: Feedback. (line 6) -* mapping entries, API: Using the mapping API. - (line 6) -* mark ring: Handling links. (line 145) -* Markdown export: Markdown export. (line 6) -* marking characters, tables: Advanced features. (line 39) -* match view: Matching tags and properties. - (line 6) -* matching, of properties: Matching tags and properties. - (line 6) -* matching, of tags: Matching tags and properties. - (line 6) -* matching, tags: Tags. (line 6) -* math symbols: Special symbols. (line 6) -* MathJax: Math formatting in HTML export. - (line 6) -* MathML: Working with LaTeX math snippets. - (line 9) -* MH-E links: External links. (line 6) -* minor mode for structure editing: Orgstruct mode. (line 6) -* minor mode for tables: Orgtbl mode. (line 6) -* MobileOrg: MobileOrg. (line 6) -* mode, for calc: Formula syntax for Calc. - (line 14) -* modification time, macro: Macro replacement. (line 36) -* motion commands in agenda: Agenda commands. (line 19) -* motion, between headlines: Motion. (line 6) -* Multiple entries in two-column tables, in Texinfo export: Plain lists in Texinfo export. - (line 17) -* n, macro: Macro replacement. (line 55) -* name, of column or field: References. (line 110) -* named references: References. (line 110) -* names as TODO keywords: TODO types. (line 6) -* narrow columns in tables: Column width and alignment. - (line 6) -* noalign, STARTUP keyword: In-buffer settings. (line 88) -* nofnadjust, STARTUP keyword: In-buffer settings. (line 152) -* nofninline, STARTUP keyword: In-buffer settings. (line 152) -* nohideblocks, STARTUP keyword <1>: In-buffer settings. (line 164) -* nohideblocks, STARTUP keyword: Blocks. (line 13) -* noindent, STARTUP keyword: In-buffer settings. (line 79) -* noinlineimages, STARTUP keyword <1>: In-buffer settings. (line 93) -* noinlineimages, STARTUP keyword: Handling links. (line 136) -* nolatexpreview, STARTUP keyword: In-buffer settings. (line 100) -* nologdone, STARTUP keyword: In-buffer settings. (line 106) -* nologdrawer, STARTUP keyword: In-buffer settings. (line 106) -* nolognoteclock-out, STARTUP keyword: In-buffer settings. (line 106) -* nologredeadline, STARTUP keyword: In-buffer settings. (line 106) -* nologrefile, STARTUP keyword: In-buffer settings. (line 106) -* nologrepeat, STARTUP keyword: In-buffer settings. (line 106) -* nologreschedule, STARTUP keyword: In-buffer settings. (line 106) -* nologstatesreversed, STARTUP keyword: In-buffer settings. (line 106) -* occur, command: Sparse trees. (line 6) -* occur-tree: Storing searches. (line 9) -* odd, STARTUP keyword: In-buffer settings. (line 132) -* odd-levels-only outlines: Clean view. (line 6) -* ODT: OpenDocument Text export. - (line 6) -* ODT_STYLES_FILE: ODT specific export settings. - (line 22) -* open-source protocol: open-source protocol. - (line 6) -* OpenDocument: OpenDocument Text export. - (line 6) -* option keyword completion: Completion. (line 6) -* options, for custom agenda views: Setting options. (line 6) -* options, for customization: Customization. (line 6) -* options, for publishing: Publishing options. (line 6) -* ordered lists: Plain lists. (line 6) -* Org entities: Special symbols. (line 6) -* Org export: Org export. (line 6) -* Org mode, turning on: Activation. (line 21) -* Org protocol, set-up: Protocols. (line 14) -* Org syntax: Org syntax. (line 6) -* org-agenda, command: Weekly/daily agenda. (line 9) -* org-capture-last-stored: Using capture. (line 50) -* org-crypt.el: org-crypt. (line 6) -* org-decrypt-entry: org-crypt. (line 6) -* org-hide-block-startup: In-buffer settings. (line 163) -* org-insert-drawer <1>: Property syntax. (line 90) -* org-insert-drawer: Drawers. (line 6) -* org-list-insert-radio-list: Radio lists. (line 6) -* org-pretty-entities: In-buffer settings. (line 168) -* org-publish-project-alist: Project alist. (line 6) -* Orgstruct mode: Orgstruct mode. (line 6) -* Orgtbl mode <1>: Tables in arbitrary syntax. - (line 6) -* Orgtbl mode: Orgtbl mode. (line 6) -* Ota, Takaaki: Cooperation. (line 41) -* Outline mode: Outlines. (line 6) -* outline tree: Headlines. (line 6) -* outlines: Outlines. (line 6) -* overview, global visibility state: Global and local cycling. - (line 18) -* overview, STARTUP keyword <1>: In-buffer settings. (line 74) -* overview, STARTUP keyword: Initial visibility. (line 6) -* packages, interaction with other: Interaction. (line 6) -* paragraphs, markup rules: Paragraphs. (line 6) -* pasting, of subtrees: Structure editing. (line 6) -* PDF export: LaTeX export. (line 6) -* per-file keywords: Per-file keywords. (line 6) -* plain lists: Plain lists. (line 6) -* plain lists, in LaTeX export: Plain lists in LaTeX export. - (line 6) -* plain text external links: External links. (line 68) -* plot tables using Gnuplot: Org-Plot. (line 6) -* presentation, of agenda items: Presentation and sorting. - (line 6) -* print edition: Summary. (line 52) -* printing sparse trees: Sparse trees. (line 53) -* priorities: Priorities. (line 6) -* priorities, of agenda items: Sorting agenda items. - (line 6) -* program index, in Texinfo export: Indices. (line 6) -* progress logging: Progress logging. (line 6) -* projects, for publishing: Project alist. (line 6) -* promotion, of subtrees: Structure editing. (line 6) -* proof, in LaTeX export: Special blocks in LaTeX export. - (line 6) -* properties: Properties and columns. - (line 6) -* properties, API <1>: Using the property API. - (line 6) -* properties, API: Property API. (line 6) -* properties, column view: Defining columns. (line 6) -* properties, inheritance: Property inheritance. - (line 6) -* properties, searching: Property searches. (line 6) -* properties, special: Special properties. (line 6) -* property EXPORT_FILE_NAME: ODT export commands. (line 7) -* property syntax: Property syntax. (line 6) -* property, +: Property syntax. (line 52) -* property, _ALL: Property syntax. (line 44) -* property, ALT_TITLE: Table of contents. (line 41) -* property, APPENDIX: Headings and sectioning structure. - (line 20) -* property, ARCHIVE <1>: Moving subtrees. (line 37) -* property, ARCHIVE: Property inheritance. - (line 34) -* property, ATTACH_DIR: Attachments. (line 74) -* property, ATTACH_DIR_INHERIT: Attachments. (line 79) -* property, BEAMER_ACT: Sectioning Frames and Blocks in Beamer. - (line 41) -* property, BEAMER_COL: Sectioning Frames and Blocks in Beamer. - (line 49) -* property, BEAMER_ENV: Sectioning Frames and Blocks in Beamer. - (line 14) -* property, BEAMER_OPT: Sectioning Frames and Blocks in Beamer. - (line 41) -* property, BEAMER_REF: Sectioning Frames and Blocks in Beamer. - (line 27) -* property, CATEGORY <1>: Categories. (line 12) -* property, CATEGORY: Property inheritance. - (line 30) -* property, COLUMNS <1>: In-buffer settings. (line 26) -* property, COLUMNS: Property inheritance. - (line 22) -* property, COOKIE_DATA <1>: Checkboxes. (line 30) -* property, COOKIE_DATA: Breaking down tasks. (line 21) -* property, COPYING: Texinfo title and copyright page. - (line 19) -* property, CUSTOM_ID <1>: Handling links. (line 21) -* property, CUSTOM_ID: Internal links. (line 6) -* property, DESCRIPTION <1>: iCalendar export. (line 51) -* property, DESCRIPTION: Headings and sectioning structure. - (line 24) -* property, Effort: Effort estimates. (line 6) -* property, EXPORT_LATEX_CLASS: LaTeX header and sectioning. - (line 23) -* property, EXPORT_LATEX_CLASS_OPTIONS: LaTeX header and sectioning. - (line 23) -* property, ID <1>: iCalendar export. (line 26) -* property, ID <2>: Capturing column view. - (line 22) -* property, ID: Handling links. (line 21) -* property, INDEX: Indices. (line 14) -* property, LOCATION: iCalendar export. (line 51) -* property, LOG_INTO_DRAWER <1>: Clocking commands. (line 7) -* property, LOG_INTO_DRAWER: Tracking TODO state changes. - (line 6) -* property, LOGGING <1>: Property inheritance. - (line 38) -* property, LOGGING: Tracking TODO state changes. - (line 45) -* property, macro: Macro replacement. (line 48) -* property, ORDERED <1>: Checkboxes. (line 46) -* property, ORDERED: TODO dependencies. (line 6) -* property, special, ALLTAGS: Special properties. (line 13) -* property, special, BLOCKED: Special properties. (line 13) -* property, special, CLOCKSUM <1>: Agenda column view. (line 28) -* property, special, CLOCKSUM: Special properties. (line 13) -* property, special, CLOCKSUM_T <1>: Agenda column view. (line 51) -* property, special, CLOCKSUM_T: Special properties. (line 13) -* property, special, CLOSED: Special properties. (line 13) -* property, special, DEADLINE: Special properties. (line 13) -* property, special, FILE: Special properties. (line 13) -* property, special, ITEM: Special properties. (line 13) -* property, special, PRIORITY: Special properties. (line 13) -* property, special, SCHEDULED: Special properties. (line 13) -* property, special, TAGS: Special properties. (line 13) -* property, special, TIMESTAMP: Special properties. (line 13) -* property, special, TIMESTAMP_IA: Special properties. (line 13) -* property, special, TODO: Special properties. (line 13) -* property, SUMMARY: iCalendar export. (line 51) -* property, TIMEZONE: iCalendar export. (line 51) -* property, UNNUMBERED: Export settings. (line 149) -* property, VISIBILITY: Initial visibility. (line 17) -* property: CLOCK_MODELINE_TOTAL: Clocking commands. (line 20) -* property: LAST_REPEAT: Clocking commands. (line 20) -* protocol, capture: capture protocol. (line 6) -* protocol, new protocol: Protocols. (line 25) -* protocol, open-source: open-source protocol. - (line 6) -* protocol, open-source rewritten URL: open-source protocol. - (line 32) -* protocol, open-source, :base-url property: open-source protocol. - (line 13) -* protocol, open-source, :online-suffix property: open-source protocol. - (line 13) -* protocol, open-source, :rewrites property: open-source protocol. - (line 43) -* protocol, open-source, :working-directory property: open-source protocol. - (line 13) -* protocol, open-source, :working-suffix property: open-source protocol. - (line 13) -* protocol, open-source, set-up mapping: open-source protocol. - (line 67) -* protocol, store-link: store-link protocol. (line 6) -* protocols, for external access: Protocols. (line 6) -* publishing: Publishing. (line 6) -* query editing, in agenda: Filtering/limiting agenda items. - (line 17) -* quote blocks: Paragraphs. (line 26) -* radio lists: Radio lists. (line 6) -* radio tables: Radio tables. (line 6) -* radio targets: Radio targets. (line 6) -* range formula: Field and range formulas. - (line 6) -* range references: References. (line 63) -* ranges, time: Timestamps. (line 6) -* recomputing table fields: Updating the table. (line 6) -* references: References. (line 6) -* references, named: References. (line 110) -* references, remote: References. (line 131) -* references, to a different table: References. (line 131) -* references, to fields: References. (line 15) -* references, to ranges: References. (line 63) -* refiling notes: Refile and copy. (line 6) -* region, active <1>: ODT export commands. (line 6) -* region, active <2>: Built-in table editor. - (line 162) -* region, active: Structure editing. (line 139) -* regular expressions, with tags search: Matching tags and properties. - (line 61) -* relative timer: Timers. (line 6) -* reminders: Weekly/daily agenda. (line 126) -* remote editing, bulk, from agenda: Agenda commands. (line 364) -* remote editing, from agenda: Agenda commands. (line 227) -* remote editing, undo: Agenda commands. (line 228) -* remote references: References. (line 131) -* repeated tasks: Repeated tasks. (line 6) -* report, of clocked time: The clock table. (line 6) -* resolve idle time: Resolving idle time. (line 9) -* revealing context: Global and local cycling. - (line 38) -* RMAIL links: External links. (line 6) -* Rose, Sebastian: JavaScript support. (line 6) -* row, of field coordinates: References. (line 86) -* RSS feeds: RSS feeds. (line 6) -* rsync: Uploading files. (line 6) -* SCHEDULED keyword: Deadlines and scheduling. - (line 31) -* scheduling: Timestamps. (line 6) -* Schulte, Eric: Working with source code. - (line 6) -* Scripts, for agenda processing: Extracting agenda information. - (line 6) -* search option in file links: Search options. (line 6) -* search strings, custom: Custom searches. (line 6) -* search view: Search view. (line 6) -* searching for tags: Tag searches. (line 6) -* searching, for text: Search view. (line 6) -* searching, of properties: Property searches. (line 6) -* sectioning structure, for LaTeX export: LaTeX header and sectioning. - (line 6) -* set startup visibility, command: Global and local cycling. - (line 33) -* set-up mappings in open-source protocol: open-source protocol. - (line 67) -* setting tags: Setting tags. (line 6) -* SHELL links: External links. (line 6) -* shift-selection-mode <1>: Conflicts. (line 6) -* shift-selection-mode: Plain lists. (line 94) -* show all, command: Global and local cycling. - (line 35) -* show all, global visibility state: Global and local cycling. - (line 18) -* show branches, command: Global and local cycling. - (line 47) -* show children, command: Global and local cycling. - (line 51) -* show hidden text: Visibility cycling. (line 6) -* showall, STARTUP keyword <1>: In-buffer settings. (line 74) -* showall, STARTUP keyword: Initial visibility. (line 6) -* showeverything, STARTUP keyword <1>: In-buffer settings. (line 74) -* showeverything, STARTUP keyword: Initial visibility. (line 6) -* showstars, STARTUP keyword: In-buffer settings. (line 132) -* shy hyphen, special symbol: Special symbols. (line 39) -* sitemap, of published pages: Sitemap. (line 6) -* sorting, of agenda items: Sorting agenda items. - (line 6) -* sorting, of plain list: Plain lists. (line 154) -* sorting, of subtrees: Structure editing. (line 6) -* source blocks, in LaTeX export: Source blocks in LaTeX export. - (line 6) -* source code, batch execution: Batch execution. (line 6) -* source code, block header arguments: Header arguments. (line 6) -* source code, block structure: Structure of code blocks. - (line 6) -* source code, editing: Editing source code. (line 6) -* source code, evaluating: Evaluating code blocks. - (line 6) -* source code, exporting: Exporting code blocks. - (line 6) -* source code, extracting: Extracting source code. - (line 6) -* source code, inline: Structure of code blocks. - (line 24) -* source code, language: Structure of code blocks. - (line 51) -* source code, languages: Languages. (line 6) -* source code, library: Library of Babel. (line 6) -* source code, noweb reference: Noweb reference syntax. - (line 6) -* source code, results of evaluation: Results of evaluation. - (line 6) -* source code, switches: Structure of code blocks. - (line 56) -* source code, working with: Working with source code. - (line 6) -* sparse tree, for deadlines: Inserting deadline/schedule. - (line 24) -* sparse tree, for TODO: TODO basics. (line 41) -* sparse tree, tag based: Tags. (line 6) -* sparse trees: Sparse trees. (line 6) -* special blocks, in ASCII export: ASCII/Latin-1/UTF-8 export. - (line 78) -* special blocks, in LaTeX export: Special blocks in LaTeX export. - (line 6) -* special keywords: In-buffer settings. (line 6) -* special symbols: Special symbols. (line 6) -* special symbols, in-buffer display: Special symbols. (line 31) -* speed keys: Speed keys. (line 6) -* speedbar.el: Cooperation. (line 34) -* spreadsheet capabilities: The spreadsheet. (line 6) -* square brackets, around links: External links. (line 68) -* statistics, for checkboxes: Checkboxes. (line 30) -* statistics, for TODO items: Breaking down tasks. (line 6) -* store-link protocol: store-link protocol. (line 6) -* storing links: Handling links. (line 10) -* Storm, Kim. F.: Conflicts. (line 18) -* strike-through text, markup rules: Emphasis and monospace. - (line 6) -* structure editing: Structure editing. (line 6) -* structure of document: Document structure. (line 6) -* styles, custom <1>: Working with OpenDocument style files. - (line 6) -* styles, custom: Applying custom styles. - (line 6) -* sublevels, inclusion into tags match: Tag inheritance. (line 6) -* sublevels, inclusion into TODO list: Global TODO list. (line 35) -* subscript: Subscripts and superscripts. - (line 6) -* SUBTITLE (ODT): ODT specific export settings. - (line 26) -* subtree cycling: Global and local cycling. - (line 10) -* subtree visibility states: Global and local cycling. - (line 10) -* subtree, cut and paste: Structure editing. (line 6) -* subtree, subtree visibility state: Global and local cycling. - (line 10) -* subtrees, cut and paste: Structure editing. (line 6) -* summary: Summary. (line 6) -* superscript: Subscripts and superscripts. - (line 6) -* syntax checker: Org syntax. (line 24) -* syntax, noweb: Noweb reference syntax. - (line 6) -* syntax, of formulas: Formula syntax for Calc. - (line 6) -* table editor, built-in: Built-in table editor. - (line 6) -* table editor, table.el: Cooperation. (line 41) -* table lookup functions: Lookup functions. (line 6) -* table of contents: Table of contents. (line 6) -* table.el: Cooperation. (line 38) -* tables: Tables. (line 6) -* tables, in HTML: Tables in HTML export. - (line 6) -* tables, in LaTeX export: Tables in LaTeX export. - (line 6) -* tables, in ODT export <1>: Customizing tables in ODT export. - (line 6) -* tables, in ODT export: Tables in ODT export. - (line 6) -* tables, in other modes: Tables in arbitrary syntax. - (line 6) -* tables, markup rules: Images and tables. (line 6) -* tag completion: Completion. (line 6) -* tag filtering, in agenda: Filtering/limiting agenda items. - (line 17) -* tag hierarchy: Tag hierarchy. (line 6) -* tag inheritance: Tag inheritance. (line 6) -* tag searches: Tag searches. (line 6) -* tags: Tags. (line 6) -* tags view: Matching tags and properties. - (line 6) -* tags, as an agenda view: Storing searches. (line 9) -* tags, groups: Tag hierarchy. (line 6) -* tags, setting: Setting tags. (line 6) -* tags-todo: Storing searches. (line 9) -* tags-tree: Storing searches. (line 9) -* tangling: Extracting source code. - (line 6) -* targets, for links: Internal links. (line 6) -* targets, radio: Radio targets. (line 6) -* tasks, breaking down: Breaking down tasks. (line 6) -* tasks, repeated: Repeated tasks. (line 6) -* template insertion: Easy templates. (line 6) -* template, custom <1>: Working with OpenDocument style files. - (line 6) -* template, custom: Applying custom styles. - (line 6) -* templates, for Capture: Capture templates. (line 6) -* TeX interpretation: Embedded LaTeX. (line 6) -* TeX symbol completion: Completion. (line 6) -* Texinfo export: Texinfo export. (line 6) -* Texinfo export, data type index: Indices. (line 6) -* Texinfo export, dir file: Info directory file. (line 6) -* Texinfo export, index, concept: Indices. (line 6) -* Texinfo export, index, function: Indices. (line 6) -* Texinfo export, Info directory file: Info directory file. (line 6) -* Texinfo export, install-info parameters: Info directory file. - (line 6) -* Texinfo export, keystroke index: Indices. (line 6) -* Texinfo export, program index: Indices. (line 6) -* Texinfo export, Top node: Headings and sectioning structure. - (line 37) -* Texinfo export, variable index: Indices. (line 6) -* text areas, in HTML: Text areas in HTML export. - (line 6) -* text search: Search view. (line 6) -* thanks: History and acknowledgments. - (line 6) -* The Top node, in Texinfo export: Headings and sectioning structure. - (line 37) -* time clocking: Clocking work time. (line 6) -* time format, custom: Custom time format. (line 6) -* time grid: Time-of-day specifications. - (line 26) -* Time, computing: Durations and time values. - (line 6) -* time, macro: Macro replacement. (line 36) -* time, reading in minibuffer: The date/time prompt. - (line 6) -* time-of-day specification: Time-of-day specifications. - (line 6) -* timerange: Timestamps. (line 42) -* times: Dates and times. (line 6) -* timestamp <1>: Timestamps. (line 14) -* timestamp: Dates and times. (line 6) -* timestamp, inactive: Timestamps. (line 51) -* timestamp, with repeater interval: Timestamps. (line 25) -* timestamps: Timestamps. (line 6) -* timestamps, creating: Creating timestamps. (line 6) -* title, macro: Macro replacement. (line 24) -* TODO dependencies: TODO dependencies. (line 6) -* TODO dependencies, NOBLOCKING: TODO dependencies. (line 6) -* TODO items: TODO items. (line 6) -* TODO keyword matching: Global TODO list. (line 18) -* TODO keyword matching, with tags search: Matching tags and properties. - (line 72) -* TODO keyword sets: Multiple sets in one file. - (line 6) -* TODO keywords completion: Completion. (line 6) -* TODO list, global: Global TODO list. (line 6) -* TODO types: TODO types. (line 6) -* TODO workflow: Workflow states. (line 6) -* todo, as an agenda view: Storing searches. (line 9) -* todo-tree: Storing searches. (line 9) -* top headline filtering, in agenda: Filtering/limiting agenda items. - (line 17) -* transient mark mode <1>: Built-in table editor. - (line 162) -* transient mark mode: Structure editing. (line 139) -* transient-mark-mode: ODT export commands. (line 6) -* translator function: Translator functions. - (line 6) -* trees, sparse: Sparse trees. (line 6) -* trees, visibility: Visibility cycling. (line 6) -* tty key bindings: TTY keys. (line 6) -* Two-column tables, in Texinfo export: Plain lists in Texinfo export. - (line 6) -* types as TODO keywords: TODO types. (line 6) -* underlined text, markup rules: Emphasis and monospace. - (line 6) -* undoing remote-editing events: Agenda commands. (line 228) -* unison: Uploading files. (line 6) -* unoconv: Extending ODT export. - (line 12) -* updating, table: Updating the table. (line 6) -* URL links: External links. (line 6) -* USENET links: External links. (line 6) -* UTF-8 export: ASCII/Latin-1/UTF-8 export. - (line 6) -* variable index, in Texinfo export: Indices. (line 6) -* variables, for customization: Customization. (line 6) -* vectors, in table calculations: Formula syntax for Calc. - (line 11) -* verbatim blocks, in LaTeX export: Example blocks in LaTeX export. - (line 6) -* verbatim text, markup rules: Emphasis and monospace. - (line 6) -* verse blocks: Paragraphs. (line 13) -* viper.el: Conflicts. (line 91) -* visibility cycling: Visibility cycling. (line 6) -* visibility cycling, drawers: Drawers. (line 6) -* visibility, initialize: Initial visibility. (line 6) -* visible text, printing: Sparse trees. (line 53) -* VM links: External links. (line 41) -* WANDERLUST links: External links. (line 41) -* weekly agenda: Weekly/daily agenda. (line 6) -* windmove.el: Conflicts. (line 78) -* workflow states as TODO keywords: Workflow states. (line 6) -* yasnippet.el: Conflicts. (line 52) -* zip: Pre-requisites for ODT export. - (line 6) - - -File: org, Node: Key Index, Next: Command and Function Index, Prev: Main Index, Up: Top - -Key index -********* - -[index] -* Menu: - -* $: Agenda commands. (line 262) -* %: Agenda commands. (line 381) -* ': CDLaTeX mode. (line 43) -* *: Agenda commands. (line 366) -* +: Agenda commands. (line 284) -* ,: Agenda commands. (line 276) -* -: Agenda commands. (line 289) -* .: Agenda commands. (line 102) -* / <1>: Agenda commands. (line 203) -* /: Filtering/limiting agenda items. - (line 17) -* :: Agenda commands. (line 272) -* ;: Timers. (line 6) -* < <1>: Agenda commands. (line 207) -* < <2>: Filtering/limiting agenda items. - (line 67) -* < <3>: Agenda files. (line 57) -* < <4>: The date/time prompt. - (line 82) -* <: Using column view. (line 71) -* <1>: Agenda commands. (line 42) -* <2>: The date/time prompt. - (line 82) -* <3>: Setting tags. (line 117) -* <4>: Handling links. (line 122) -* : Built-in table editor. - (line 69) -* <1>: Agenda commands. (line 34) -* : Setting tags. (line 114) -* <1>: CDLaTeX mode. (line 23) -* <2>: Agenda commands. (line 39) -* <3>: Setting tags. (line 108) -* <4>: Editing and debugging formulas. - (line 57) -* <5>: Plain lists. (line 68) -* <6>: Structure editing. (line 35) -* : Global and local cycling. - (line 10) -* = <1>: Agenda commands. (line 215) -* =: Filtering/limiting agenda items. - (line 81) -* > <1>: Agenda commands. (line 325) -* > <2>: Agenda files. (line 61) -* > <3>: The date/time prompt. - (line 82) -* >: Using column view. (line 71) -* ?: Pulling from MobileOrg. - (line 28) -* [ <1>: Agenda commands. (line 126) -* [: Filtering/limiting agenda items. - (line 57) -* ]: Filtering/limiting agenda items. - (line 57) -* ^ <1>: CDLaTeX mode. (line 33) -* ^ <2>: Agenda commands. (line 211) -* ^: Filtering/limiting agenda items. - (line 77) -* _ <1>: CDLaTeX mode. (line 33) -* _ <2>: Agenda commands. (line 218) -* _: Filtering/limiting agenda items. - (line 91) -* `: CDLaTeX mode. (line 39) -* a: Agenda commands. (line 250) -* A: Agenda commands. (line 69) -* a: Using column view. (line 60) -* B: Agenda commands. (line 384) -* b: Agenda commands. (line 99) -* C: Agenda commands. (line 487) -* c: Agenda commands. (line 454) -* C-#: Advanced features. (line 10) -* C-': Agenda files. (line 22) -* C-,: Agenda files. (line 22) -* C-0 C-c C-w: Refile and copy. (line 47) -* C-: Structure editing. (line 23) -* C-_: Agenda commands. (line 228) -* C-c !: Creating timestamps. (line 15) -* C-c #: Checkboxes. (line 85) -* C-c $: Moving subtrees. (line 9) -* C-c %: Handling links. (line 142) -* C-c &: Handling links. (line 146) -* C-c ' <1>: Cooperation. (line 48) -* C-c ' <2>: Editing source code. (line 6) -* C-c ' <3>: Include files. (line 59) -* C-c ' <4>: Literal examples. (line 87) -* C-c ' <5>: Editing and debugging formulas. - (line 36) -* C-c ': Footnotes. (line 85) -* C-c * <1>: Updating the table. (line 13) -* C-c * <2>: Plain lists. (line 139) -* C-c *: Structure editing. (line 128) -* C-c +: Built-in table editor. - (line 162) -* C-c ,: Priorities. (line 24) -* C-c - <1>: Built-in table editor. - (line 105) -* C-c -: Plain lists. (line 127) -* C-c .: Creating timestamps. (line 10) -* C-c / <1>: Conflicts. (line 91) -* C-c /: Sparse trees. (line 15) -* C-c / /: Sparse trees. (line 17) -* C-c / a: Inserting deadline/schedule. - (line 31) -* C-c / b: Inserting deadline/schedule. - (line 28) -* C-c / d: Inserting deadline/schedule. - (line 21) -* C-c / m <1>: Property searches. (line 10) -* C-c / m: Tag searches. (line 9) -* C-c / p: Property searches. (line 29) -* C-c / r: Sparse trees. (line 17) -* C-c / t: TODO basics. (line 38) -* C-c ;: Comment lines. (line 19) -* C-c <: Creating timestamps. (line 29) -* C-c : Built-in table editor. - (line 109) -* C-c : Global and local cycling. - (line 51) -* C-c = <1>: Editing and debugging formulas. - (line 13) -* C-c =: Column formulas. (line 32) -* C-c >: Creating timestamps. (line 33) -* C-c ?: Editing and debugging formulas. - (line 22) -* C-c @: Structure editing. (line 65) -* C-c [: Agenda files. (line 15) -* C-c \ <1>: Property searches. (line 10) -* C-c \: Tag searches. (line 9) -* C-c ]: Agenda files. (line 19) -* C-c ^ <1>: Built-in table editor. - (line 113) -* C-c ^ <2>: Plain lists. (line 154) -* C-c ^: Structure editing. (line 107) -* C-c `: Built-in table editor. - (line 180) -* C-c a: Conventions. (line 35) -* C-c a !: Stuck projects. (line 14) -* C-c a #: Stuck projects. (line 13) -* C-c a ?: Pulling from MobileOrg. - (line 37) -* C-c a a: Weekly/daily agenda. (line 9) -* C-c a C: Storing searches. (line 9) -* C-c a e: Exporting agenda views. - (line 64) -* C-c a M: Matching tags and properties. - (line 17) -* C-c a m: Matching tags and properties. - (line 12) -* C-c a M: Property searches. (line 16) -* C-c a m: Property searches. (line 12) -* C-c a M: Tag searches. (line 17) -* C-c a m: Tag searches. (line 13) -* C-c a s: Search view. (line 9) -* C-c a T: Global TODO list. (line 15) -* C-c a t <1>: Global TODO list. (line 9) -* C-c a t: TODO basics. (line 49) -* C-c c <1>: Using capture. (line 6) -* C-c c: Conventions. (line 35) -* C-c c C: Capture templates. (line 10) -* C-c C-*: Plain lists. (line 144) -* C-c C-a <1>: Agenda commands. (line 297) -* C-c C-a: Attachments. (line 26) -* C-c C-a a: Attachments. (line 31) -* C-c C-a c: Attachments. (line 37) -* C-c C-a D: Attachments. (line 69) -* C-c C-a d: Attachments. (line 66) -* C-c C-a F: Attachments. (line 63) -* C-c C-a f: Attachments. (line 60) -* C-c C-a i: Attachments. (line 78) -* C-c C-a l: Attachments. (line 37) -* C-c C-a m: Attachments. (line 37) -* C-c C-a n: Attachments. (line 44) -* C-c C-a O: Attachments. (line 57) -* C-c C-a o: Attachments. (line 51) -* C-c C-a s: Attachments. (line 73) -* C-c C-a u: Attachments. (line 41) -* C-c C-a z: Attachments. (line 47) -* C-c C-b <1>: Editing support. (line 11) -* C-c C-b: Motion. (line 15) -* C-c C-c <1>: Cooperation. (line 41) -* C-c C-c <2>: The very busy C-c C-c key. - (line 6) -* C-c C-c <3>: Key bindings and useful functions. - (line 11) -* C-c C-c <4>: Evaluating code blocks. - (line 20) -* C-c C-c <5>: Previewing LaTeX fragments. - (line 23) -* C-c C-c <6>: Using capture. (line 15) -* C-c C-c <7>: The clock table. (line 16) -* C-c C-c <8>: Clocking commands. (line 51) -* C-c C-c <9>: Creating timestamps. (line 26) -* C-c C-c <10>: Capturing column view. - (line 54) -* C-c C-c <11>: Using column view. (line 53) -* C-c C-c <12>: Property syntax. (line 92) -* C-c C-c <13>: Setting tags. (line 20) -* C-c C-c <14>: Checkboxes. (line 52) -* C-c C-c <15>: Editing and debugging formulas. - (line 47) -* C-c C-c <16>: Built-in table editor. - (line 58) -* C-c C-c <17>: Footnotes. (line 74) -* C-c C-c: Plain lists. (line 122) -* C-c C-c c: Property syntax. (line 110) -* C-c C-c D: Property syntax. (line 107) -* C-c C-c d: Property syntax. (line 104) -* C-c C-c s: Property syntax. (line 96) -* C-c C-d <1>: Agenda commands. (line 304) -* C-c C-d: Inserting deadline/schedule. - (line 9) -* C-c C-e: The export dispatcher. - (line 15) -* C-c C-e c a: iCalendar export. (line 40) -* C-c C-e c c: iCalendar export. (line 44) -* C-c C-e c f: iCalendar export. (line 38) -* C-c C-e C-v: Sparse trees. (line 53) -* C-c C-e h H: HTML Export commands. - (line 11) -* C-c C-e h h: HTML Export commands. - (line 6) -* C-c C-e i i: Texinfo export commands. - (line 8) -* C-c C-e i t: Texinfo export commands. - (line 6) -* C-c C-e l B: Beamer export commands. - (line 8) -* C-c C-e l b: Beamer export commands. - (line 6) -* C-c C-e l L: LaTeX export commands. - (line 11) -* C-c C-e l l: LaTeX export commands. - (line 6) -* C-c C-e l p: LaTeX export commands. - (line 12) -* C-c C-e l P: Beamer export commands. - (line 11) -* C-c C-e m M: Markdown export. (line 18) -* C-c C-e m m: Markdown export. (line 16) -* C-c C-e O O: Org export. (line 17) -* C-c C-e O o: Org export. (line 13) -* C-c C-e o o: ODT export commands. (line 6) -* C-c C-e P a: Triggering publication. - (line 16) -* C-c C-e P f: Triggering publication. - (line 13) -* C-c C-e P p: Triggering publication. - (line 10) -* C-c C-e P x: Triggering publication. - (line 8) -* C-c C-e t A/L/U: ASCII/Latin-1/UTF-8 export. - (line 27) -* C-c C-e t a/l/u: ASCII/Latin-1/UTF-8 export. - (line 23) -* C-c C-f: Motion. (line 12) -* C-c C-j: Motion. (line 21) -* C-c C-k <1>: Using capture. (line 31) -* C-c C-k: Global and local cycling. - (line 47) -* C-c C-l: Handling links. (line 65) -* C-c C-n: Motion. (line 8) -* C-c C-o <1>: Key bindings and useful functions. - (line 11) -* C-c C-o <2>: Agenda commands. (line 61) -* C-c C-o <3>: Creating timestamps. (line 38) -* C-c C-o <4>: Handling links. (line 101) -* C-c C-o: Footnotes. (line 78) -* C-c C-p: Motion. (line 9) -* C-c C-q <1>: Setting tags. (line 10) -* C-c C-q: Editing and debugging formulas. - (line 50) -* C-c C-r <1>: Editing and debugging formulas. - (line 53) -* C-c C-r: Global and local cycling. - (line 38) -* C-c C-s <1>: Agenda commands. (line 300) -* C-c C-s: Inserting deadline/schedule. - (line 16) -* C-c C-t <1>: Clocking commands. (line 67) -* C-c C-t: TODO basics. (line 13) -* C-c C-u: Motion. (line 18) -* C-c C-v a: Key bindings and useful functions. - (line 36) -* C-c C-v b: Key bindings and useful functions. - (line 25) -* C-c C-v c: Key bindings and useful functions. - (line 30) -* C-c C-v C-a: Key bindings and useful functions. - (line 36) -* C-c C-v C-b: Key bindings and useful functions. - (line 25) -* C-c C-v C-c: Key bindings and useful functions. - (line 30) -* C-c C-v C-d: Key bindings and useful functions. - (line 27) -* C-c C-v C-e: Key bindings and useful functions. - (line 19) -* C-c C-v C-f: Key bindings and useful functions. - (line 29) -* C-c C-v C-g: Key bindings and useful functions. - (line 23) -* C-c C-v C-h: Key bindings and useful functions. - (line 37) -* C-c C-v C-I: Key bindings and useful functions. - (line 34) -* C-c C-v C-i: Key bindings and useful functions. - (line 33) -* C-c C-v C-j: Key bindings and useful functions. - (line 31) -* C-c C-v C-l: Key bindings and useful functions. - (line 32) -* C-c C-v C-n: Key bindings and useful functions. - (line 18) -* C-c C-v C-o: Key bindings and useful functions. - (line 20) -* C-c C-v C-p: Key bindings and useful functions. - (line 18) -* C-c C-v C-r: Key bindings and useful functions. - (line 24) -* C-c C-v C-s: Key bindings and useful functions. - (line 26) -* C-c C-v C-t: Key bindings and useful functions. - (line 28) -* C-c C-v C-u: Key bindings and useful functions. - (line 22) -* C-c C-v C-v: Key bindings and useful functions. - (line 21) -* C-c C-v C-x: Key bindings and useful functions. - (line 38) -* C-c C-v C-z: Key bindings and useful functions. - (line 35) -* C-c C-v d: Key bindings and useful functions. - (line 27) -* C-c C-v e: Key bindings and useful functions. - (line 19) -* C-c C-v f: Key bindings and useful functions. - (line 29) -* C-c C-v g: Key bindings and useful functions. - (line 23) -* C-c C-v h: Key bindings and useful functions. - (line 37) -* C-c C-v I: Key bindings and useful functions. - (line 34) -* C-c C-v i <1>: Key bindings and useful functions. - (line 33) -* C-c C-v i: Library of Babel. (line 12) -* C-c C-v j: Key bindings and useful functions. - (line 31) -* C-c C-v l: Key bindings and useful functions. - (line 32) -* C-c C-v n: Key bindings and useful functions. - (line 18) -* C-c C-v o: Key bindings and useful functions. - (line 20) -* C-c C-v p: Key bindings and useful functions. - (line 18) -* C-c C-v r: Key bindings and useful functions. - (line 24) -* C-c C-v s: Key bindings and useful functions. - (line 26) -* C-c C-v t <1>: Key bindings and useful functions. - (line 28) -* C-c C-v t: Extracting source code. - (line 36) -* C-c C-v u: Key bindings and useful functions. - (line 22) -* C-c C-v v: Key bindings and useful functions. - (line 21) -* C-c C-v x: Key bindings and useful functions. - (line 38) -* C-c C-v z: Key bindings and useful functions. - (line 35) -* C-c C-w <1>: Agenda commands. (line 247) -* C-c C-w <2>: Refile and copy. (line 14) -* C-c C-w <3>: Using capture. (line 22) -* C-c C-w: Structure editing. (line 103) -* C-c C-x ,: Timers. (line 44) -* C-c C-x -: Timers. (line 35) -* C-c C-x .: Timers. (line 31) -* C-c C-x 0: Timers. (line 12) -* C-c C-x ;: Timers. (line 20) -* C-c C-x <: Agenda files. (line 42) -* C-c C-x > <1>: Agenda commands. (line 193) -* C-c C-x >: Agenda files. (line 49) -* C-c C-x \ <1>: Subscripts and superscripts. - (line 20) -* C-c C-x \: Special symbols. (line 34) -* C-c C-x _: Timers. (line 47) -* C-c C-x A: Agenda commands. (line 258) -* C-c C-x a: Agenda commands. (line 255) -* C-c C-x A: Internal archiving. (line 50) -* C-c C-x a: Internal archiving. (line 37) -* C-c C-x b <1>: Agenda commands. (line 52) -* C-c C-x b: Global and local cycling. - (line 55) -* C-c C-x c: Structure editing. (line 95) -* C-c C-x C-a <1>: Agenda commands. (line 250) -* C-c C-x C-a: Archiving. (line 11) -* C-c C-x C-b: Checkboxes. (line 56) -* C-c C-x C-c <1>: Agenda column view. (line 11) -* C-c C-x C-c <2>: Agenda commands. (line 182) -* C-c C-x C-c: Using column view. (line 9) -* C-c C-x C-d: Clocking commands. (line 80) -* C-c C-x C-e <1>: Effort estimates. (line 17) -* C-c C-x C-e: Clocking commands. (line 48) -* C-c C-x C-i: Clocking commands. (line 6) -* C-c C-x C-j: Clocking commands. (line 75) -* C-c C-x C-l: Previewing LaTeX fragments. - (line 17) -* C-c C-x C-n: Handling links. (line 152) -* C-c C-x C-o: Clocking commands. (line 34) -* C-c C-x C-p: Handling links. (line 152) -* C-c C-x C-q: Clocking commands. (line 71) -* C-c C-x C-r: The clock table. (line 10) -* C-c C-x C-s <1>: Agenda commands. (line 262) -* C-c C-x C-s: Moving subtrees. (line 9) -* C-c C-x C-t: Custom time format. (line 12) -* C-c C-x C-u <1>: Dynamic blocks. (line 21) -* C-c C-x C-u <2>: The clock table. (line 16) -* C-c C-x C-u: Capturing column view. - (line 54) -* C-c C-x C-v: Handling links. (line 133) -* C-c C-x C-w <1>: Built-in table editor. - (line 136) -* C-c C-x C-w: Structure editing. (line 69) -* C-c C-x C-x: Clocking commands. (line 42) -* C-c C-x C-y <1>: Built-in table editor. - (line 140) -* C-c C-x C-y: Structure editing. (line 77) -* C-c C-x d: Drawers. (line 6) -* C-c C-x e: Effort estimates. (line 14) -* C-c C-x f: Footnotes. (line 41) -* C-c C-x G: RSS feeds. (line 27) -* C-c C-x g: RSS feeds. (line 23) -* C-c C-x i: Capturing column view. - (line 52) -* C-c C-x M-w <1>: Built-in table editor. - (line 132) -* C-c C-x M-w: Structure editing. (line 73) -* C-c C-x o <1>: Checkboxes. (line 77) -* C-c C-x o: TODO dependencies. (line 37) -* C-c C-x p <1>: Header arguments in Org mode properties. - (line 31) -* C-c C-x p: Property syntax. (line 83) -* C-c C-x q: Tag hierarchy. (line 86) -* C-c C-x v: Global and local cycling. - (line 61) -* C-c C-y <1>: Clocking commands. (line 51) -* C-c C-y: Creating timestamps. (line 59) -* C-c C-z <1>: Agenda commands. (line 292) -* C-c C-z: Drawers. (line 35) -* C-c l <1>: Literal examples. (line 95) -* C-c l: Handling links. (line 9) -* C-c M-w: Refile and copy. (line 12) -* C-c SPC: Built-in table editor. - (line 59) -* C-c { <1>: CDLaTeX mode. (line 21) -* C-c {: Editing and debugging formulas. - (line 32) -* C-c |: Built-in table editor. - (line 41) -* C-c }: Editing and debugging formulas. - (line 26) -* C-c ~: Cooperation. (line 50) -* C-k: Agenda commands. (line 241) -* C-M-i: Completion. (line 47) -* C-S- <1>: Agenda commands. (line 239) -* C-S-: Multiple sets in one file. - (line 25) -* C-S-: Structure editing. (line 30) -* C-S- <1>: Agenda commands. (line 236) -* C-S-: Multiple sets in one file. - (line 25) -* C-S-: Clocking commands. (line 56) -* C-TAB: Internal archiving. (line 47) -* C-u C-c !: Creating timestamps. (line 19) -* C-u C-c *: Updating the table. (line 16) -* C-u C-c .: Creating timestamps. (line 19) -* C-u C-c = <1>: Editing and debugging formulas. - (line 13) -* C-u C-c =: Field and range formulas. - (line 27) -* C-u C-c c: Using capture. (line 43) -* C-u C-c C-c: Updating the table. (line 19) -* C-u C-c C-l: Handling links. (line 86) -* C-u C-c C-t: TODO basics. (line 27) -* C-u C-c C-w: Refile and copy. (line 33) -* C-u C-c C-x a: Internal archiving. (line 40) -* C-u C-c C-x C-s: Moving subtrees. (line 11) -* C-u C-c C-x C-u <1>: Dynamic blocks. (line 22) -* C-u C-c C-x C-u <2>: The clock table. (line 20) -* C-u C-c C-x C-u: Capturing column view. - (line 58) -* C-u C-u <1>: Initial visibility. (line 21) -* C-u C-u : Global and local cycling. - (line 33) -* C-u C-u C-c *: Updating the table. (line 22) -* C-u C-u C-c =: Editing and debugging formulas. - (line 16) -* C-u C-u C-c c: Using capture. (line 45) -* C-u C-u C-c C-c: Updating the table. (line 22) -* C-u C-u C-c C-t: Multiple sets in one file. - (line 25) -* C-u C-u C-c C-w: Refile and copy. (line 36) -* C-u C-u C-c C-x C-s: Moving subtrees. (line 18) -* C-u C-u C-u : Global and local cycling. - (line 35) -* C-u C-u C-u C-c C-t: TODO dependencies. (line 42) -* C-v: The date/time prompt. - (line 82) -* C-x C-s <1>: Agenda commands. (line 178) -* C-x C-s: Editing and debugging formulas. - (line 47) -* C-x C-w <1>: Exporting agenda views. - (line 12) -* C-x C-w: Agenda commands. (line 504) -* C-x n b: Structure editing. (line 122) -* C-x n s: Structure editing. (line 119) -* C-x n w: Structure editing. (line 125) -* C-y: Structure editing. (line 83) -* D: Agenda commands. (line 111) -* d: Agenda commands. (line 74) -* E: Agenda commands. (line 156) -* e: Using column view. (line 47) -* f: Agenda commands. (line 93) -* F: Agenda commands. (line 45) -* g: Agenda commands. (line 175) -* G: Agenda commands. (line 164) -* g: Using column view. (line 24) -* H: Agenda commands. (line 491) -* i: Agenda commands. (line 459) -* I: Agenda commands. (line 330) -* J: Agenda commands. (line 108) -* j: Agenda commands. (line 105) -* k: Agenda commands. (line 343) -* l: Agenda commands. (line 115) -* L: Agenda commands. (line 36) -* M: Agenda commands. (line 478) -* m: Agenda commands. (line 364) -* M-*: Agenda commands. (line 378) -* M- <1>: Agenda commands. (line 357) -* M- <2>: Editing and debugging formulas. - (line 77) -* M- <3>: Built-in table editor. - (line 94) -* M- <4>: Plain lists. (line 97) -* M-: Structure editing. (line 56) -* M- <1>: Built-in table editor. - (line 86) -* M- <2>: Plain lists. (line 103) -* M-: Structure editing. (line 41) -* M- <1>: Timers. (line 40) -* M- <2>: Built-in table editor. - (line 147) -* M- <3>: Plain lists. (line 79) -* M-: Structure editing. (line 6) -* M- <1>: Built-in table editor. - (line 86) -* M- <2>: Plain lists. (line 103) -* M-: Structure editing. (line 44) -* M- <1>: Completion. (line 15) -* M- <2>: Property syntax. (line 80) -* M- <3>: Setting tags. (line 6) -* M- <4>: Per-file keywords. (line 23) -* M-: Editing and debugging formulas. - (line 64) -* M- <1>: Agenda commands. (line 353) -* M- <2>: Editing and debugging formulas. - (line 77) -* M- <3>: Built-in table editor. - (line 94) -* M- <4>: Plain lists. (line 97) -* M-: Structure editing. (line 53) -* M-a: Built-in table editor. - (line 74) -* M-down: Key bindings and useful functions. - (line 13) -* M-e: Built-in table editor. - (line 78) -* M-g M-n: Sparse trees. (line 29) -* M-g M-p: Sparse trees. (line 32) -* M-g n: Sparse trees. (line 29) -* M-g p: Sparse trees. (line 32) -* M-h: Structure editing. (line 59) -* M-m: Agenda commands. (line 375) -* M-S- <1>: The date/time prompt. - (line 82) -* M-S- <2>: Editing and debugging formulas. - (line 72) -* M-S-: Built-in table editor. - (line 101) -* M-S- <1>: The date/time prompt. - (line 82) -* M-S- <2>: Built-in table editor. - (line 88) -* M-S- <3>: Plain lists. (line 108) -* M-S-: Structure editing. (line 47) -* M-S- <1>: Checkboxes. (line 74) -* M-S- <2>: Plain lists. (line 89) -* M-S-: Structure editing. (line 26) -* M-S- <1>: The date/time prompt. - (line 82) -* M-S- <2>: Built-in table editor. - (line 91) -* M-S- <3>: Plain lists. (line 108) -* M-S-: Structure editing. (line 50) -* M-S- <1>: The date/time prompt. - (line 82) -* M-S- <2>: Editing and debugging formulas. - (line 72) -* M-S-: Built-in table editor. - (line 98) -* M-up: Key bindings and useful functions. - (line 12) -* M-v: The date/time prompt. - (line 82) -* M-x org-iswitchb: Agenda files. (line 26) -* mouse-1 <1>: The date/time prompt. - (line 82) -* mouse-1 <2>: Handling links. (line 124) -* mouse-1: Footnotes. (line 78) -* mouse-2 <1>: Agenda commands. (line 39) -* mouse-2 <2>: Handling links. (line 124) -* mouse-2: Footnotes. (line 78) -* mouse-3 <1>: Agenda commands. (line 34) -* mouse-3: Handling links. (line 129) -* N: Agenda commands. (line 23) -* n <1>: Agenda commands. (line 19) -* n: Using column view. (line 43) -* O: Agenda commands. (line 334) -* o: Agenda commands. (line 71) -* P: Agenda commands. (line 26) -* p <1>: Agenda commands. (line 20) -* p: Using column view. (line 43) -* q <1>: Agenda commands. (line 518) -* q: Using column view. (line 27) -* r: Agenda commands. (line 168) -* R: Agenda commands. (line 137) -* r <1>: Global TODO list. (line 23) -* r: Using column view. (line 20) -* S: Agenda commands. (line 482) -* s: Agenda commands. (line 178) -* S- <1>: Agenda commands. (line 289) -* S- <2>: The date/time prompt. - (line 82) -* S- <3>: Creating timestamps. (line 47) -* S- <4>: Priorities. (line 28) -* S- <5>: Editing and debugging formulas. - (line 67) -* S-: Plain lists. (line 90) -* S- <1>: Agenda commands. (line 321) -* S- <2>: The clock table. (line 24) -* S- <3>: The date/time prompt. - (line 82) -* S- <4>: Creating timestamps. (line 42) -* S- <5>: Using column view. (line 36) -* S- <6>: Property syntax. (line 100) -* S- <7>: Multiple sets in one file. - (line 32) -* S- <8>: TODO basics. (line 33) -* S- <9>: Editing and debugging formulas. - (line 67) -* S-: Plain lists. (line 149) -* S-: Built-in table editor. - (line 165) -* S- <1>: Agenda commands. (line 307) -* S- <2>: The clock table. (line 24) -* S- <3>: The date/time prompt. - (line 82) -* S- <4>: Creating timestamps. (line 42) -* S- <5>: Using column view. (line 36) -* S- <6>: Property syntax. (line 100) -* S- <7>: Multiple sets in one file. - (line 32) -* S- <8>: TODO basics. (line 33) -* S- <9>: Editing and debugging formulas. - (line 67) -* S-: Plain lists. (line 149) -* S- <1>: Built-in table editor. - (line 66) -* S-: Global and local cycling. - (line 18) -* S- <1>: Agenda commands. (line 284) -* S- <2>: The date/time prompt. - (line 82) -* S- <3>: Creating timestamps. (line 47) -* S- <4>: Priorities. (line 28) -* S-: Editing and debugging formulas. - (line 67) -* S-M-: Using column view. (line 76) -* S-M-: TODO basics. (line 57) -* S-M-: Using column view. (line 73) -* S-M-: Clocking commands. (line 60) -* T: Agenda commands. (line 267) -* t: Agenda commands. (line 232) -* TAB: Built-in table editor. - (line 62) -* U: Agenda commands. (line 372) -* u: Agenda commands. (line 369) -* v: Using column view. (line 56) -* v [: Agenda commands. (line 126) -* v A: Agenda commands. (line 133) -* v a: Agenda commands. (line 130) -* v c: Agenda commands. (line 148) -* v d: Agenda commands. (line 74) -* v E: Agenda commands. (line 156) -* v L: Agenda commands. (line 118) -* v l: Agenda commands. (line 115) -* v m: Agenda commands. (line 79) -* v R: Agenda commands. (line 137) -* v SPC: Agenda commands. (line 81) -* v t: Agenda commands. (line 78) -* v w: Agenda commands. (line 77) -* v y: Agenda commands. (line 80) -* w: Agenda commands. (line 77) -* x: Agenda commands. (line 519) -* X: Agenda commands. (line 337) -* z: Agenda commands. (line 292) -* {: Filtering/limiting agenda items. - (line 57) -* | <1>: Agenda commands. (line 221) -* |: Filtering/limiting agenda items. - (line 112) -* }: Filtering/limiting agenda items. - (line 57) -* ~: Filtering/limiting agenda items. - (line 154) - - -File: org, Node: Command and Function Index, Next: Variable Index, Prev: Key Index, Up: Top - -Command and function index -************************** - -[index] -* Menu: - -* lisp-complete-symbol: Editing and debugging formulas. - (line 64) -* next-error: Sparse trees. (line 29) -* org-agenda <1>: Conventions. (line 35) -* org-agenda: Activation. (line 6) -* org-agenda-add-note: Agenda commands. (line 292) -* org-agenda-archive: Agenda commands. (line 262) -* org-agenda-archive-default-with-confirmation: Agenda commands. - (line 250) -* org-agenda-archive-to-archive-sibling: Agenda commands. (line 258) -* org-agenda-archives-mode: Agenda commands. (line 130) -* org-agenda-archives-mode 'files: Agenda commands. (line 133) -* org-agenda-bulk-action: Agenda commands. (line 384) -* org-agenda-bulk-mark: Agenda commands. (line 364) -* org-agenda-bulk-mark-all: Agenda commands. (line 366) -* org-agenda-bulk-mark-regexp: Agenda commands. (line 381) -* org-agenda-bulk-remove-all-marks: Agenda commands. (line 372) -* org-agenda-bulk-toggle: Agenda commands. (line 375) -* org-agenda-bulk-toggle-all: Agenda commands. (line 378) -* org-agenda-bulk-unmark: Agenda commands. (line 369) -* org-agenda-capture: Agenda commands. (line 343) -* org-agenda-clock-cancel: Agenda commands. (line 337) -* org-agenda-clock-goto: Agenda commands. (line 108) -* org-agenda-clock-in: Agenda commands. (line 330) -* org-agenda-clock-out: Agenda commands. (line 334) -* org-agenda-clockreport-mode: Agenda commands. (line 137) -* org-agenda-columns <1>: Agenda column view. (line 11) -* org-agenda-columns: Agenda commands. (line 182) -* org-agenda-convert-date: Agenda commands. (line 487) -* org-agenda-date-prompt: Agenda commands. (line 325) -* org-agenda-day-view: Agenda commands. (line 74) -* org-agenda-deadline: Agenda commands. (line 304) -* org-agenda-diary-entry: Agenda commands. (line 459) -* org-agenda-do-date-earlier: Agenda commands. (line 321) -* org-agenda-do-date-later: Agenda commands. (line 307) -* org-agenda-drag-line-backward: Agenda commands. (line 353) -* org-agenda-drag-line-forward: Agenda commands. (line 357) -* org-agenda-earlier: Agenda commands. (line 99) -* org-agenda-entry-text-mode: Agenda commands. (line 156) -* org-agenda-exit: Agenda commands. (line 519) -* org-agenda-file-to-front: Agenda files. (line 15) -* org-agenda-filter-by-category <1>: Agenda commands. (line 207) -* org-agenda-filter-by-category: Filtering/limiting agenda items. - (line 67) -* org-agenda-filter-by-effort <1>: Agenda commands. (line 218) -* org-agenda-filter-by-effort: Filtering/limiting agenda items. - (line 91) -* org-agenda-filter-by-regexp <1>: Agenda commands. (line 215) -* org-agenda-filter-by-regexp: Filtering/limiting agenda items. - (line 81) -* org-agenda-filter-by-tag <1>: Agenda commands. (line 203) -* org-agenda-filter-by-tag: Filtering/limiting agenda items. - (line 17) -* org-agenda-filter-by-top-headline <1>: Agenda commands. (line 211) -* org-agenda-filter-by-top-headline: Filtering/limiting agenda items. - (line 77) -* org-agenda-filter-remove-all <1>: Agenda commands. (line 221) -* org-agenda-filter-remove-all: Filtering/limiting agenda items. - (line 112) -* org-agenda-follow-mode: Agenda commands. (line 45) -* org-agenda-fortnight-view: Agenda commands. (line 78) -* org-agenda-goto: Agenda commands. (line 39) -* org-agenda-goto-calendar: Agenda commands. (line 454) -* org-agenda-goto-date: Agenda commands. (line 105) -* org-agenda-goto-today: Agenda commands. (line 102) -* org-agenda-holidays: Agenda commands. (line 491) -* org-agenda-kill: Agenda commands. (line 241) -* org-agenda-later: Agenda commands. (line 93) -* org-agenda-limit-interactively: Filtering/limiting agenda items. - (line 154) -* org-agenda-list: Weekly/daily agenda. (line 9) -* org-agenda-list-stuck-projects: Stuck projects. (line 13) -* org-agenda-log-mode: Agenda commands. (line 115) -* org-agenda-manipulate-query-add: Agenda commands. (line 126) -* org-agenda-month-view: Agenda commands. (line 79) -* org-agenda-next-item: Agenda commands. (line 23) -* org-agenda-next-line: Agenda commands. (line 19) -* org-agenda-open-link: Agenda commands. (line 61) -* org-agenda-phases-of-moon: Agenda commands. (line 478) -* org-agenda-previous-item: Agenda commands. (line 26) -* org-agenda-previous-line: Agenda commands. (line 20) -* org-agenda-priority-down: Agenda commands. (line 289) -* org-agenda-priority-up: Agenda commands. (line 284) -* org-agenda-quit: Agenda commands. (line 518) -* org-agenda-recenter: Agenda commands. (line 36) -* org-agenda-redo: Agenda commands. (line 168) -* org-agenda-refile: Agenda commands. (line 247) -* org-agenda-remove-restriction-lock <1>: Agenda commands. (line 193) -* org-agenda-remove-restriction-lock: Agenda files. (line 49) -* org-agenda-reset-view: Agenda commands. (line 81) -* org-agenda-schedule: Agenda commands. (line 300) -* org-agenda-set-restriction-lock: Agenda files. (line 42) -* org-agenda-set-tags: Agenda commands. (line 272) -* org-agenda-show-and-scroll-up: Agenda commands. (line 34) -* org-agenda-show-priority: Agenda commands. (line 281) -* org-agenda-show-tags: Agenda commands. (line 267) -* org-agenda-sunrise-sunset: Agenda commands. (line 482) -* org-agenda-switch-to: Agenda commands. (line 42) -* org-agenda-todo: Agenda commands. (line 232) -* org-agenda-todo-nextset: Agenda commands. (line 236) -* org-agenda-todo-previousset: Agenda commands. (line 239) -* org-agenda-toggle-archive-tag: Agenda commands. (line 255) -* org-agenda-toggle-diary: Agenda commands. (line 111) -* org-agenda-toggle-time-grid: Agenda commands. (line 164) -* org-agenda-tree-to-indirect-buffer: Agenda commands. (line 52) -* org-agenda-undo: Agenda commands. (line 228) -* org-agenda-week-view: Agenda commands. (line 77) -* org-agenda-write <1>: Exporting agenda views. - (line 12) -* org-agenda-write: Agenda commands. (line 504) -* org-agenda-year-view: Agenda commands. (line 80) -* org-archive-subtree: Moving subtrees. (line 9) -* org-archive-subtree-default: Archiving. (line 11) -* org-archive-to-archive-sibling: Internal archiving. (line 50) -* org-ascii-export-as-ascii: ASCII/Latin-1/UTF-8 export. - (line 27) -* org-ascii-export-to-ascii: ASCII/Latin-1/UTF-8 export. - (line 23) -* org-attach <1>: Agenda commands. (line 297) -* org-attach: Attachments. (line 26) -* org-attach-attach: Attachments. (line 31) -* org-attach-delete-all: Attachments. (line 69) -* org-attach-delete-one: Attachments. (line 66) -* org-attach-new: Attachments. (line 44) -* org-attach-open: Attachments. (line 51) -* org-attach-open-in-emacs: Attachments. (line 57) -* org-attach-reveal: Attachments. (line 60) -* org-attach-reveal-in-emacs: Attachments. (line 63) -* org-attach-set-directory: Attachments. (line 73) -* org-attach-set-inherit: Attachments. (line 78) -* org-attach-sync: Attachments. (line 47) -* org-attach-url: Attachments. (line 41) -* org-backward-same-level: Motion. (line 15) -* org-beamer-export-as-latex: Beamer export commands. - (line 8) -* org-beamer-export-to-latex: Beamer export commands. - (line 6) -* org-beamer-export-to-pdf: Beamer export commands. - (line 11) -* org-beamer-select-environment: Editing support. (line 11) -* org-buffer-property-keys: Using the property API. - (line 34) -* org-calendar-goto-agenda: Agenda commands. (line 455) -* org-capture <1>: Using capture. (line 6) -* org-capture <2>: Conventions. (line 35) -* org-capture: Activation. (line 6) -* org-capture-finalize: Using capture. (line 15) -* org-capture-kill: Using capture. (line 31) -* org-capture-refile: Using capture. (line 22) -* org-check-after-date: Inserting deadline/schedule. - (line 31) -* org-check-before-date: Inserting deadline/schedule. - (line 28) -* org-check-deadlines: Inserting deadline/schedule. - (line 21) -* org-clock-cancel: Clocking commands. (line 71) -* org-clock-display: Clocking commands. (line 80) -* org-clock-goto: Clocking commands. (line 75) -* org-clock-in: Clocking commands. (line 6) -* org-clock-in-last: Clocking commands. (line 42) -* org-clock-modify-effort-estimate <1>: Effort estimates. (line 17) -* org-clock-modify-effort-estimate: Clocking commands. (line 48) -* org-clock-out: Clocking commands. (line 34) -* org-clock-report: The clock table. (line 10) -* org-clock-timestamps-up/down: Clocking commands. (line 56) -* org-clocktable-try-shift: The clock table. (line 24) -* org-clone-subtree-with-time-shift: Structure editing. (line 95) -* org-columns: Using column view. (line 9) -* org-columns-delete: Using column view. (line 76) -* org-columns-edit-allowed: Using column view. (line 60) -* org-columns-edit-value: Using column view. (line 47) -* org-columns-narrow: Using column view. (line 71) -* org-columns-new: Using column view. (line 73) -* org-columns-next-allowed-value: Using column view. (line 43) -* org-columns-previous-allowed-value: Using column view. (line 43) -* org-columns-quit: Using column view. (line 27) -* org-columns-redo: Using column view. (line 20) -* org-columns-set-tags-or-toggle: Using column view. (line 53) -* org-columns-show-value: Using column view. (line 56) -* org-columns-widen: Using column view. (line 71) -* org-compute-property-at-point: Property syntax. (line 110) -* org-copy: Refile and copy. (line 12) -* org-copy-subtree: Structure editing. (line 73) -* org-copy-visible: Global and local cycling. - (line 61) -* org-cut-subtree: Structure editing. (line 69) -* org-cycle <1>: Plain lists. (line 68) -* org-cycle <2>: Structure editing. (line 35) -* org-cycle: Global and local cycling. - (line 10) -* org-cycle-agenda-files: Agenda files. (line 22) -* org-date-from-calendar: Creating timestamps. (line 29) -* org-dblock-update <1>: Dynamic blocks. (line 21) -* org-dblock-update <2>: The clock table. (line 16) -* org-dblock-update: Capturing column view. - (line 54) -* org-deadline: Inserting deadline/schedule. - (line 9) -* org-delete-property: Property syntax. (line 104) -* org-delete-property-globally: Property syntax. (line 107) -* org-demote: Using the mapping API. - (line 78) -* org-demote-subtree: Structure editing. (line 50) -* org-do-demote: Structure editing. (line 44) -* org-do-promote: Structure editing. (line 41) -* org-edit-special: Cooperation. (line 48) -* org-entities-help: Special symbols. (line 16) -* org-entry-add-to-multivalued-property: Using the property API. - (line 51) -* org-entry-delete: Using the property API. - (line 28) -* org-entry-get: Using the property API. - (line 19) -* org-entry-get-multivalued-property: Using the property API. - (line 46) -* org-entry-member-in-multivalued-property: Using the property API. - (line 63) -* org-entry-properties: Using the property API. - (line 9) -* org-entry-put: Using the property API. - (line 31) -* org-entry-put-multivalued-property: Using the property API. - (line 41) -* org-entry-remove-from-multivalued-property: Using the property API. - (line 57) -* org-evaluate-time-range <1>: Clocking commands. (line 51) -* org-evaluate-time-range: Creating timestamps. (line 59) -* org-export-dispatch: The export dispatcher. - (line 15) -* org-feed-goto-inbox: RSS feeds. (line 27) -* org-feed-update-all: RSS feeds. (line 23) -* org-force-cycle-archived: Internal archiving. (line 47) -* org-forward-same-level: Motion. (line 12) -* org-global-cycle: Global and local cycling. - (line 18) -* org-goto: Motion. (line 21) -* org-goto-calendar: Creating timestamps. (line 33) -* org-html-export-as-html: HTML Export commands. - (line 11) -* org-html-export-to-html: HTML Export commands. - (line 6) -* org-icalendar-combine-agenda-files: iCalendar export. (line 44) -* org-icalendar-export-agenda-files: iCalendar export. (line 40) -* org-icalendar-export-to-ics: iCalendar export. (line 38) -* org-insert-columns-dblock: Capturing column view. - (line 52) -* org-insert-heading <1>: Timers. (line 40) -* org-insert-heading: Plain lists. (line 79) -* org-insert-heading-respect-content: Structure editing. (line 23) -* org-insert-link: Handling links. (line 65) -* org-insert-property-drawer: Using the property API. - (line 18) -* org-insert-todo-heading <1>: Checkboxes. (line 74) -* org-insert-todo-heading <2>: TODO basics. (line 57) -* org-insert-todo-heading: Structure editing. (line 26) -* org-insert-todo-heading-respect-content: Structure editing. (line 30) -* org-iswitchb: Activation. (line 6) -* org-latex-export-as-latex: LaTeX export commands. - (line 11) -* org-latex-export-to-latex: LaTeX export commands. - (line 6) -* org-latex-export-to-pdf: LaTeX export commands. - (line 12) -* org-lookup-all: Lookup functions. (line 22) -* org-lookup-first: Lookup functions. (line 8) -* org-lookup-last: Lookup functions. (line 18) -* org-map-entries: Using the mapping API. - (line 12) -* org-mark-element: Structure editing. (line 59) -* org-mark-ring-goto: Handling links. (line 146) -* org-mark-ring-push: Handling links. (line 142) -* org-mark-subtree: Structure editing. (line 65) -* org-match-sparse-tree <1>: Property searches. (line 10) -* org-match-sparse-tree: Tag searches. (line 9) -* org-md-export-as-markdown: Markdown export. (line 18) -* org-md-export-to-markdown: Markdown export. (line 16) -* org-meta-return: Structure editing. (line 6) -* org-move-subtree-down: Structure editing. (line 56) -* org-move-subtree-up: Structure editing. (line 53) -* org-narrow-to-block: Structure editing. (line 122) -* org-narrow-to-subtree: Structure editing. (line 119) -* org-next-link: Handling links. (line 152) -* org-next-visible-heading: Motion. (line 8) -* org-occur: Sparse trees. (line 17) -* org-odt-export-to-odt: ODT export commands. (line 6) -* org-open-at-point <1>: Creating timestamps. (line 38) -* org-open-at-point: Handling links. (line 101) -* org-org-export-as-org: Org export. (line 17) -* org-org-export-to-org: Org export. (line 13) -* org-paste-subtree: Structure editing. (line 77) -* org-previous-link: Handling links. (line 152) -* org-previous-visible-heading: Motion. (line 9) -* org-priority <1>: Using the mapping API. - (line 66) -* org-priority: Priorities. (line 24) -* org-priority-down: Priorities. (line 28) -* org-priority-up: Priorities. (line 28) -* org-promote: Using the mapping API. - (line 75) -* org-promote-subtree: Structure editing. (line 47) -* org-property-action: Property syntax. (line 92) -* org-property-next-allowed-value: Property syntax. (line 100) -* org-property-previous-allowed-value: Property syntax. (line 100) -* org-protocol-create: open-source protocol. - (line 67) -* org-protocol-create-for-org: open-source protocol. - (line 67) -* org-publish: Triggering publication. - (line 8) -* org-publish-all: Triggering publication. - (line 16) -* org-publish-current-file: Triggering publication. - (line 13) -* org-publish-current-project: Triggering publication. - (line 10) -* org-refile <1>: Refile and copy. (line 14) -* org-refile: Structure editing. (line 103) -* org-refile-cache-clear: Refile and copy. (line 47) -* org-refile-goto-last-stored: Refile and copy. (line 36) -* org-remove-file: Agenda files. (line 19) -* org-reveal: Global and local cycling. - (line 38) -* org-save-all-org-buffers: Agenda commands. (line 178) -* org-schedule: Inserting deadline/schedule. - (line 16) -* org-search-view: Search view. (line 9) -* org-set-effort: Effort estimates. (line 14) -* org-set-property: Property syntax. (line 83) -* org-set-startup-visibility <1>: Initial visibility. (line 21) -* org-set-startup-visibility: Global and local cycling. - (line 33) -* org-set-tags-command: Setting tags. (line 10) -* org-show-todo-tree: TODO basics. (line 38) -* org-sort: Structure editing. (line 107) -* org-sparse-tree: Sparse trees. (line 15) -* org-speed-command-help: Speed keys. (line 19) -* org-speedbar-set-agenda-restriction: Agenda files. (line 57) -* org-store-agenda-views: Exporting agenda views. - (line 64) -* org-store-link <1>: Handling links. (line 9) -* org-store-link: Activation. (line 6) -* org-table-align: Built-in table editor. - (line 58) -* org-table-beginning-of-field: Built-in table editor. - (line 74) -* org-table-blank-field: Built-in table editor. - (line 59) -* org-table-copy-down: Built-in table editor. - (line 165) -* org-table-copy-region: Built-in table editor. - (line 132) -* org-table-create-or-convert-from-region: Built-in table editor. - (line 41) -* org-table-create-with-table.el: Cooperation. (line 50) -* org-table-cut-region: Built-in table editor. - (line 136) -* org-table-delete-column: Built-in table editor. - (line 88) -* org-table-edit-field: Built-in table editor. - (line 180) -* org-table-edit-formulas: Editing and debugging formulas. - (line 36) -* org-table-end-of-field: Built-in table editor. - (line 78) -* org-table-eval-formula <1>: Editing and debugging formulas. - (line 13) -* org-table-eval-formula <2>: Column formulas. (line 32) -* org-table-eval-formula: Field and range formulas. - (line 27) -* org-table-export: Built-in table editor. - (line 205) -* org-table-fedit-abort: Editing and debugging formulas. - (line 50) -* org-table-fedit-finish: Editing and debugging formulas. - (line 47) -* org-table-fedit-line-down: Editing and debugging formulas. - (line 72) -* org-table-fedit-line-up: Editing and debugging formulas. - (line 72) -* org-table-fedit-lisp-indent: Editing and debugging formulas. - (line 57) -* org-table-fedit-ref-down: Editing and debugging formulas. - (line 67) -* org-table-fedit-ref-left: Editing and debugging formulas. - (line 67) -* org-table-fedit-ref-right: Editing and debugging formulas. - (line 67) -* org-table-fedit-ref-up: Editing and debugging formulas. - (line 67) -* org-table-fedit-scroll-down: Editing and debugging formulas. - (line 77) -* org-table-fedit-scroll-up: Editing and debugging formulas. - (line 77) -* org-table-fedit-toggle-ref-type: Editing and debugging formulas. - (line 53) -* org-table-field-info: Editing and debugging formulas. - (line 22) -* org-table-hline-and-move: Built-in table editor. - (line 109) -* org-table-insert-column: Built-in table editor. - (line 91) -* org-table-insert-hline: Built-in table editor. - (line 105) -* org-table-insert-row: Built-in table editor. - (line 101) -* org-table-iterate: Updating the table. (line 22) -* org-table-iterate-buffer-tables: Updating the table. (line 33) -* org-table-kill-row: Built-in table editor. - (line 98) -* org-table-move-column-left: Built-in table editor. - (line 86) -* org-table-move-column-right: Built-in table editor. - (line 86) -* org-table-move-row-down: Built-in table editor. - (line 94) -* org-table-move-row-up: Built-in table editor. - (line 94) -* org-table-next-field: Built-in table editor. - (line 62) -* org-table-next-row: Built-in table editor. - (line 69) -* org-table-paste-rectangle: Built-in table editor. - (line 140) -* org-table-previous-field: Built-in table editor. - (line 66) -* org-table-recalculate: Updating the table. (line 13) -* org-table-recalculate-buffer-tables: Updating the table. (line 30) -* org-table-rotate-recalc-marks: Advanced features. (line 10) -* org-table-sort-lines: Built-in table editor. - (line 113) -* org-table-sum: Built-in table editor. - (line 162) -* org-table-toggle-coordinate-overlays: Editing and debugging formulas. - (line 26) -* org-table-toggle-formula-debugger: Editing and debugging formulas. - (line 32) -* org-table-wrap-region: Built-in table editor. - (line 147) -* org-tags-view <1>: Matching tags and properties. - (line 12) -* org-tags-view <2>: Property searches. (line 12) -* org-tags-view: Tag searches. (line 13) -* org-texinfo-export-to-info: Texinfo export commands. - (line 8) -* org-texinfo-export-to-texinfo: Texinfo export commands. - (line 6) -* org-time-stamp: Creating timestamps. (line 10) -* org-time-stamp-inactive: Creating timestamps. (line 15) -* org-timer: Timers. (line 31) -* org-timer-item: Timers. (line 35) -* org-timer-pause-or-continue: Timers. (line 44) -* org-timer-set-timer: Timers. (line 20) -* org-timer-start: Timers. (line 12) -* org-timer-stop: Timers. (line 47) -* org-timestamp-down-day: Creating timestamps. (line 42) -* org-timestamp-down-down: Creating timestamps. (line 47) -* org-timestamp-up: Creating timestamps. (line 47) -* org-timestamp-up-day: Creating timestamps. (line 42) -* org-timestamp-up/down: Clocking commands. (line 60) -* org-todo <1>: Using the mapping API. - (line 62) -* org-todo <2>: Clocking commands. (line 67) -* org-todo: TODO basics. (line 13) -* org-todo-list <1>: Global TODO list. (line 9) -* org-todo-list: TODO basics. (line 49) -* org-toggle-archive-tag: Internal archiving. (line 37) -* org-toggle-checkbox: Checkboxes. (line 52) -* org-toggle-heading: Structure editing. (line 128) -* org-toggle-inline-images: Handling links. (line 133) -* org-toggle-ordered-property <1>: Checkboxes. (line 77) -* org-toggle-ordered-property: TODO dependencies. (line 37) -* org-toggle-tag: Using the mapping API. - (line 70) -* org-toggle-time-stamp-overlays: Custom time format. (line 12) -* org-tree-to-indirect-buffer: Global and local cycling. - (line 55) -* org-update-all-dblocks: Capturing column view. - (line 58) -* org-update-statistics-cookies: Checkboxes. (line 85) -* org-yank: Structure editing. (line 83) -* outline-show-all: Global and local cycling. - (line 35) -* outline-show-branches: Global and local cycling. - (line 47) -* outline-show-children: Global and local cycling. - (line 51) -* outline-up-heading: Motion. (line 18) -* pcomplete: Property syntax. (line 80) -* previous-error: Sparse trees. (line 32) -* widen: Structure editing. (line 125) - - -File: org, Node: Variable Index, Prev: Command and Function Index, Up: Top - -Variable index -************** - -This is not a complete index of variables and faces, only the ones that -are mentioned in the manual. For a complete list, use `M-x -org-customize '. - -[index] -* Menu: - -* cdlatex-simplify-sub-super-scripts: CDLaTeX mode. (line 33) -* constants-unit-system <1>: In-buffer settings. (line 145) -* constants-unit-system: References. (line 117) -* htmlize-output-type: Exporting agenda views. - (line 20) -* LaTeX-verbatim-environments: A LaTeX example. (line 20) -* org-adapt-indentation: Clean view. (line 52) -* org-agenda-add-entry-text-maxlines: Exporting agenda views. - (line 20) -* org-agenda-bulk-custom-functions: Agenda commands. (line 364) -* org-agenda-category-filter-preset: Filtering/limiting agenda items. - (line 68) -* org-agenda-clock-consistency-checks: Agenda commands. (line 151) -* org-agenda-columns-add-appointments-to-effort-sum: Effort estimates. - (line 41) -* org-agenda-confirm-kill: Agenda commands. (line 244) -* org-agenda-custom-commands <1>: Extracting agenda information. - (line 6) -* org-agenda-custom-commands <2>: Setting options. (line 6) -* org-agenda-custom-commands <3>: Storing searches. (line 9) -* org-agenda-custom-commands: Sparse trees. (line 37) -* org-agenda-custom-commands-contexts: Setting options. (line 61) -* org-agenda-diary-file: Agenda commands. (line 462) -* org-agenda-dim-blocked-tasks <1>: Speeding up your agendas. - (line 15) -* org-agenda-dim-blocked-tasks: TODO dependencies. (line 47) -* org-agenda-effort-filter-preset: Filtering/limiting agenda items. - (line 92) -* org-agenda-entry-text-maxlines: Agenda commands. (line 159) -* org-agenda-exporter-settings <1>: Exporting agenda views. - (line 13) -* org-agenda-exporter-settings: Agenda commands. (line 505) -* org-agenda-files <1>: iCalendar export. (line 43) -* org-agenda-files <2>: Sorting agenda items. - (line 8) -* org-agenda-files: Agenda files. (line 6) -* org-agenda-inhibit-startup <1>: Speeding up your agendas. - (line 18) -* org-agenda-inhibit-startup: Initial visibility. (line 6) -* org-agenda-log-mode-items: Agenda commands. (line 118) -* org-agenda-max-effort: Filtering/limiting agenda items. - (line 118) -* org-agenda-max-entries: Filtering/limiting agenda items. - (line 118) -* org-agenda-max-tags: Filtering/limiting agenda items. - (line 118) -* org-agenda-max-todos: Filtering/limiting agenda items. - (line 118) -* org-agenda-ndays: Weekly/daily agenda. (line 15) -* org-agenda-overriding-header: Special agenda views. - (line 38) -* org-agenda-prefix-format: Presentation and sorting. - (line 6) -* org-agenda-regexp-filter-preset: Filtering/limiting agenda items. - (line 82) -* org-agenda-restore-windows-after-quit: Agenda views. (line 42) -* org-agenda-show-inherited-tags <1>: Speeding up your agendas. - (line 21) -* org-agenda-show-inherited-tags: Agenda commands. (line 270) -* org-agenda-skip-archived-trees <1>: Agenda views. (line 37) -* org-agenda-skip-archived-trees: Internal archiving. (line 22) -* org-agenda-skip-comment-trees: Agenda views. (line 37) -* org-agenda-skip-deadline-prewarning-if-scheduled: Deadlines and scheduling. - (line 14) -* org-agenda-skip-function <1>: Using the mapping API. - (line 49) -* org-agenda-skip-function: Special agenda views. - (line 6) -* org-agenda-skip-function-global: Special agenda views. - (line 6) -* org-agenda-skip-scheduled-delay-if-deadline: Deadlines and scheduling. - (line 42) -* org-agenda-skip-scheduled-if-deadline-is-shown: Repeated tasks. - (line 72) -* org-agenda-skip-scheduled-if-done: Deadlines and scheduling. - (line 34) -* org-agenda-sorting-strategy: Sorting agenda items. - (line 27) -* org-agenda-span <1>: Agenda commands. (line 82) -* org-agenda-span: Weekly/daily agenda. (line 15) -* org-agenda-start-day: Weekly/daily agenda. (line 15) -* org-agenda-start-on-weekday: Weekly/daily agenda. (line 15) -* org-agenda-start-with-clockreport-mode: Agenda commands. (line 140) -* org-agenda-start-with-entry-text-mode: Agenda commands. (line 159) -* org-agenda-start-with-follow-mode: Agenda commands. (line 48) -* org-agenda-sticky: Agenda dispatcher. (line 50) -* org-agenda-tag-filter-preset: Filtering/limiting agenda items. - (line 18) -* org-agenda-tags-column: Presentation and sorting. - (line 6) -* org-agenda-tags-todo-honor-ignore-options: Matching tags and properties. - (line 20) -* org-agenda-text-search-extra-files <1>: Search view. (line 24) -* org-agenda-text-search-extra-files: Agenda dispatcher. (line 29) -* org-agenda-time-grid <1>: Agenda commands. (line 167) -* org-agenda-time-grid: Time-of-day specifications. - (line 41) -* org-agenda-todo-ignore-deadlines: Global TODO list. (line 38) -* org-agenda-todo-ignore-scheduled: Global TODO list. (line 38) -* org-agenda-todo-ignore-timestamp: Global TODO list. (line 38) -* org-agenda-todo-ignore-with-date: Global TODO list. (line 38) -* org-agenda-todo-list-sublevels <1>: Global TODO list. (line 47) -* org-agenda-todo-list-sublevels: Breaking down tasks. (line 6) -* org-agenda-use-tag-inheritance <1>: Speeding up your agendas. - (line 21) -* org-agenda-use-tag-inheritance: Tag inheritance. (line 32) -* org-agenda-use-time-grid <1>: Agenda commands. (line 167) -* org-agenda-use-time-grid: Time-of-day specifications. - (line 41) -* org-agenda-window-setup: Agenda views. (line 42) -* org-archive-default-command <1>: Agenda commands. (line 253) -* org-archive-default-command: Archiving. (line 12) -* org-archive-location <1>: In-buffer settings. (line 14) -* org-archive-location: Moving subtrees. (line 10) -* org-archive-save-context-info: Moving subtrees. (line 41) -* org-ascii-links-to-notes: ASCII/Latin-1/UTF-8 export. - (line 16) -* org-ascii-text-width: ASCII/Latin-1/UTF-8 export. - (line 13) -* org-attach-directory: Attachments. (line 6) -* org-attach-method: Attachments. (line 32) -* org-babel-default-header-args <1>: Header arguments in Org mode properties. - (line 31) -* org-babel-default-header-args: System-wide header arguments. - (line 6) -* org-babel-load-languages: Languages. (line 35) -* org-beamer-environments-default: Sectioning Frames and Blocks in Beamer. - (line 21) -* org-beamer-environments-extra: Sectioning Frames and Blocks in Beamer. - (line 21) -* org-beamer-frame-level: Sectioning Frames and Blocks in Beamer. - (line 10) -* org-beamer-subtitle-format: Beamer specific export settings. - (line 44) -* org-beamer-theme: Beamer specific export settings. - (line 11) -* org-calc-default-modes: Formula syntax for Calc. - (line 14) -* org-capture-bookmark: Using capture. (line 50) -* org-capture-templates-contexts: Templates in contexts. - (line 6) -* org-capture-use-agenda-date: Agenda commands. (line 348) -* org-catch-invisible-edits: Catching invisible edits. - (line 6) -* org-checkbox-hierarchical-statistics: Checkboxes. (line 30) -* org-clock-continuously <1>: Resolving idle time. (line 78) -* org-clock-continuously: Clocking commands. (line 7) -* org-clock-idle-time: Resolving idle time. (line 14) -* org-clock-into-drawer: Clocking commands. (line 7) -* org-clock-modeline-total: Clocking commands. (line 20) -* org-clock-report-include-clocking-task: Agenda commands. (line 140) -* org-clock-x11idle-program-name: Resolving idle time. (line 9) -* org-clocktable-defaults: The clock table. (line 38) -* org-closed-keep-when-no-todo: Closing items. (line 11) -* org-coderef-label-format: Literal examples. (line 75) -* org-columns-default-format <1>: Agenda column view. (line 18) -* org-columns-default-format <2>: Agenda commands. (line 185) -* org-columns-default-format <3>: Effort estimates. (line 31) -* org-columns-default-format: Using column view. (line 10) -* org-columns-skip-archived-trees: Internal archiving. (line 32) -* org-columns-summary-types: Column attributes. (line 65) -* org-confirm-babel-evaluate: Code evaluation security. - (line 26) -* org-confirm-elisp-link-function: Code evaluation security. - (line 53) -* org-confirm-shell-link-function: Code evaluation security. - (line 50) -* org-create-file-search-functions: Custom searches. (line 12) -* org-ctrl-c-ctrl-c-hook: Context-sensitive commands. - (line 6) -* org-ctrl-k-protect-subtree: Headlines. (line 6) -* org-cycle-emulate-tab: Global and local cycling. - (line 16) -* org-cycle-global-at-bob: Global and local cycling. - (line 29) -* org-cycle-include-plain-lists: Plain lists. (line 69) -* org-cycle-open-archived-trees: Internal archiving. (line 12) -* org-cycle-separator-lines: Headlines. (line 26) -* org-deadline-warning-days <1>: Inserting deadline/schedule. - (line 24) -* org-deadline-warning-days: Deadlines and scheduling. - (line 14) -* org-default-notes-file <1>: Template elements. (line 49) -* org-default-notes-file: Setting up capture. (line 9) -* org-default-priority <1>: In-buffer settings. (line 45) -* org-default-priority: Priorities. (line 37) -* org-display-custom-times: Custom time format. (line 6) -* org-display-internal-link-with-indirect-buffer: Handling links. - (line 132) -* org-disputed-keys: Conflicts. (line 28) -* org-done (face): Faces for TODO keywords. - (line 6) -* org-edit-footnote-reference: Footnotes. (line 85) -* org-edit-src-auto-save-idle-delay: Editing source code. (line 6) -* org-edit-src-turn-on-auto-save: Editing source code. (line 6) -* org-emphasis-alist: Emphasis and monospace. - (line 6) -* org-emphasis-regexp-components: Emphasis and monospace. - (line 6) -* org-enforce-todo-dependencies: TODO dependencies. (line 6) -* org-entities-user: Special symbols. (line 16) -* org-execute-file-search-functions: Custom searches. (line 12) -* org-export-allow-bind-keywords: Export settings. (line 210) -* org-export-async-init-file: The export dispatcher. - (line 28) -* org-export-backends <1>: Other built-in back-ends. - (line 6) -* org-export-backends: Exporting. (line 42) -* org-export-before-parsing-hook: Advanced configuration. - (line 9) -* org-export-before-processing-hook: Advanced configuration. - (line 9) -* org-export-creator-string <1>: HTML preamble and postamble. - (line 6) -* org-export-creator-string: Export settings. (line 28) -* org-export-date-timestamp-format: Export settings. (line 32) -* org-export-default-language: Export settings. (line 38) -* org-export-dispatch-use-expert-ui: The export dispatcher. - (line 6) -* org-export-exclude-tags: Export settings. (line 52) -* org-export-global-macros: Macro replacement. (line 6) -* org-export-headline-levels: Export settings. (line 141) -* org-export-in-background: The export dispatcher. - (line 39) -* org-export-initial-scope: The export dispatcher. - (line 48) -* org-export-preserve-breaks: Export settings. (line 93) -* org-export-select-tags: Export settings. (line 44) -* org-export-time-stamp-file <1>: HTML preamble and postamble. - (line 6) -* org-export-time-stamp-file: Export settings. (line 185) -* org-export-use-babel: Exporting code blocks. - (line 36) -* org-export-with-archived-trees <1>: Export settings. (line 102) -* org-export-with-archived-trees: Internal archiving. (line 28) -* org-export-with-author: Export settings. (line 107) -* org-export-with-broken-links: Export settings. (line 111) -* org-export-with-clocks: Export settings. (line 116) -* org-export-with-creator: Export settings. (line 119) -* org-export-with-date: Export settings. (line 127) -* org-export-with-drawers <1>: Export settings. (line 123) -* org-export-with-drawers: Drawers. (line 38) -* org-export-with-email: Export settings. (line 134) -* org-export-with-entities: Export settings. (line 131) -* org-export-with-fixed-width: Export settings. (line 86) -* org-export-with-footnotes: Export settings. (line 138) -* org-export-with-inlinetasks: Export settings. (line 146) -* org-export-with-latex <1>: Export settings. (line 181) -* org-export-with-latex: LaTeX fragments. (line 38) -* org-export-with-planning: Export settings. (line 155) -* org-export-with-priority: Export settings. (line 161) -* org-export-with-properties <1>: Export settings. (line 164) -* org-export-with-properties: Drawers. (line 38) -* org-export-with-section-numbers: Export settings. (line 149) -* org-export-with-smart-quotes: Export settings. (line 73) -* org-export-with-special-strings: Export settings. (line 82) -* org-export-with-statistics-cookies: Export settings. (line 168) -* org-export-with-sub-superscripts: Export settings. (line 97) -* org-export-with-tables: Export settings. (line 200) -* org-export-with-tags: Export settings. (line 172) -* org-export-with-tasks: Export settings. (line 176) -* org-export-with-timestamps: Export settings. (line 89) -* org-export-with-title: Export settings. (line 189) -* org-export-with-toc <1>: Table of contents. (line 6) -* org-export-with-toc: Export settings. (line 192) -* org-export-with-todo-keywords: Export settings. (line 196) -* org-fast-tag-selection-include-todo: Fast access to TODO states. - (line 16) -* org-fast-tag-selection-single-key: Setting tags. (line 143) -* org-file-apps <1>: Attachments. (line 52) -* org-file-apps: Handling links. (line 104) -* org-fontify-emphasized-text: Emphasis and monospace. - (line 6) -* org-footnote-auto-adjust <1>: In-buffer settings. (line 150) -* org-footnote-auto-adjust: Footnotes. (line 48) -* org-footnote-auto-label <1>: In-buffer settings. (line 150) -* org-footnote-auto-label: Footnotes. (line 34) -* org-footnote-define-inline <1>: In-buffer settings. (line 150) -* org-footnote-define-inline: Footnotes. (line 48) -* org-footnote-section <1>: Footnotes. (line 48) -* org-footnote-section: Headlines. (line 18) -* org-format-latex-header <1>: Previewing LaTeX fragments. - (line 12) -* org-format-latex-header: LaTeX fragments. (line 6) -* org-format-latex-options: Previewing LaTeX fragments. - (line 12) -* org-from-is-user-regexp: Template expansion. (line 49) -* org-global-properties <1>: Effort estimates. (line 31) -* org-global-properties: Property syntax. (line 75) -* org-goto-auto-isearch: Motion. (line 26) -* org-goto-interface: Motion. (line 37) -* org-group-tags: Tag hierarchy. (line 86) -* org-hide (face): Clean view. (line 70) -* org-hide-block-startup: Blocks. (line 6) -* org-hide-leading-stars <1>: Clean view. (line 55) -* org-hide-leading-stars: In-buffer settings. (line 129) -* org-hierarchical-todo-statistics: Breaking down tasks. (line 25) -* org-highest-priority <1>: In-buffer settings. (line 45) -* org-highest-priority: Priorities. (line 37) -* org-html-container-element: HTML Specific export settings. - (line 19) -* org-html-doctype <1>: HTML doctypes. (line 8) -* org-html-doctype: HTML Specific export settings. - (line 16) -* org-html-doctype-alist: HTML doctypes. (line 8) -* org-html-head <1>: CSS support. (line 43) -* org-html-head: HTML Specific export settings. - (line 35) -* org-html-head-extra <1>: CSS support. (line 43) -* org-html-head-extra: HTML Specific export settings. - (line 39) -* org-html-head-include-default-style: CSS support. (line 43) -* org-html-html5-elements: HTML doctypes. (line 66) -* org-html-html5-fancy: HTML doctypes. (line 33) -* org-html-infojs-options: JavaScript support. (line 51) -* org-html-inline-images: Images in HTML export. - (line 6) -* org-html-link-home: HTML Specific export settings. - (line 23) -* org-html-link-org-files-as-html: Links in HTML export. - (line 6) -* org-html-link-up: HTML Specific export settings. - (line 26) -* org-html-mathjax-options: HTML Specific export settings. - (line 30) -* org-html-postamble: HTML preamble and postamble. - (line 6) -* org-html-postamble-format: HTML preamble and postamble. - (line 6) -* org-html-preamble: HTML preamble and postamble. - (line 6) -* org-html-preamble-format: HTML preamble and postamble. - (line 6) -* org-html-style-default: CSS support. (line 43) -* org-html-table-align-individual-fields: Tables in HTML export. - (line 19) -* org-html-table-caption-above: Tables in HTML export. - (line 23) -* org-html-table-data-tags: Tables in HTML export. - (line 26) -* org-html-table-default-attributes: Tables in HTML export. - (line 6) -* org-html-table-header-tags: Tables in HTML export. - (line 32) -* org-html-table-row-tags: Tables in HTML export. - (line 35) -* org-html-table-use-header-tags-for-first-column: Tables in HTML export. - (line 38) -* org-html-tag-class-prefix: CSS support. (line 6) -* org-html-todo-kwd-class-prefix: CSS support. (line 6) -* org-html-use-infojs: JavaScript support. (line 51) -* org-html-validation-link: HTML preamble and postamble. - (line 6) -* org-icalendar-alarm-time: iCalendar export. (line 6) -* org-icalendar-categories: iCalendar export. (line 6) -* org-icalendar-combined-agenda-file: iCalendar export. (line 47) -* org-icalendar-include-body: iCalendar export. (line 51) -* org-icalendar-include-todo: iCalendar export. (line 6) -* org-icalendar-store-UID: iCalendar export. (line 26) -* org-icalendar-use-deadline: iCalendar export. (line 6) -* org-icalendar-use-scheduled: iCalendar export. (line 6) -* org-id-link-to-org-use-id: Handling links. (line 21) -* org-imenu-depth: Cooperation. (line 30) -* org-insert-mode-line-in-empty-file: Activation. (line 27) -* org-irc-link-to-logs: Handling links. (line 45) -* org-keep-stored-link-after-insertion: Handling links. (line 66) -* org-latex-bibtex-compiler: LaTeX export commands. - (line 21) -* org-latex-classes <1>: LaTeX header and sectioning. - (line 13) -* org-latex-classes: LaTeX specific export settings. - (line 20) -* org-latex-compiler <1>: LaTeX specific export settings. - (line 32) -* org-latex-compiler: LaTeX export commands. - (line 21) -* org-latex-default-class <1>: LaTeX header and sectioning. - (line 13) -* org-latex-default-class: LaTeX specific export settings. - (line 20) -* org-latex-default-packages-alist <1>: LaTeX header and sectioning. - (line 13) -* org-latex-default-packages-alist: LaTeX export commands. - (line 21) -* org-latex-default-table-environment: Tables in LaTeX export. - (line 22) -* org-latex-default-table-mode: Tables in LaTeX export. - (line 11) -* org-latex-images-centered: Images in LaTeX export. - (line 50) -* org-latex-listings: Literal examples. (line 23) -* org-latex-listings-options: Source blocks in LaTeX export. - (line 23) -* org-latex-minted-options: Source blocks in LaTeX export. - (line 23) -* org-latex-packages-alist: LaTeX header and sectioning. - (line 13) -* org-latex-subtitle-format: LaTeX specific export settings. - (line 55) -* org-latex-subtitle-separate: LaTeX specific export settings. - (line 55) -* org-latex-tables-booktabs: Tables in LaTeX export. - (line 64) -* org-latex-tables-centered: Tables in LaTeX export. - (line 64) -* org-latex-to-mathml-convert-command: Working with LaTeX math snippets. - (line 21) -* org-latex-to-mathml-jar-file: Working with LaTeX math snippets. - (line 21) -* org-link-abbrev-alist <1>: In-buffer settings. (line 40) -* org-link-abbrev-alist: Link abbreviations. (line 12) -* org-link-frame-setup: Handling links. (line 104) -* org-link-parameters: Handling links. (line 66) -* org-list-allow-alphabetical: Plain lists. (line 14) -* org-list-automatic-rules <1>: Checkboxes. (line 6) -* org-list-automatic-rules: Plain lists. (line 62) -* org-list-demote-modify-bullet: Plain lists. (line 56) -* org-list-indent-offset: Plain lists. (line 56) -* org-list-use-circular-motion: Plain lists. (line 94) -* org-log-done <1>: In-buffer settings. (line 104) -* org-log-done <2>: Agenda commands. (line 118) -* org-log-done: Tracking TODO state changes. - (line 29) -* org-log-into-drawer <1>: Agenda commands. (line 295) -* org-log-into-drawer: Tracking TODO state changes. - (line 6) -* org-log-note-clock-out <1>: In-buffer settings. (line 104) -* org-log-note-clock-out: Clocking commands. (line 37) -* org-log-refile: Refile and copy. (line 17) -* org-log-repeat <1>: In-buffer settings. (line 104) -* org-log-repeat: Repeated tasks. (line 37) -* org-log-states-order-reversed: Tracking TODO state changes. - (line 6) -* org-lowest-priority <1>: In-buffer settings. (line 45) -* org-lowest-priority: Priorities. (line 37) -* org-M-RET-may-split-line <1>: Plain lists. (line 82) -* org-M-RET-may-split-line: Structure editing. (line 7) -* org-md-headline-style: Markdown export. (line 29) -* org-odd-levels-only <1>: Special agenda views. - (line 41) -* org-odd-levels-only <2>: Clean view. (line 75) -* org-odd-levels-only <3>: In-buffer settings. (line 129) -* org-odd-levels-only: Matching tags and properties. - (line 72) -* org-odt-category-map-alist: Labels and captions in ODT export. - (line 21) -* org-odt-convert: Extending ODT export. - (line 36) -* org-odt-convert-capabilities: Configuring a document converter. - (line 18) -* org-odt-convert-process: Configuring a document converter. - (line 25) -* org-odt-convert-processes: Configuring a document converter. - (line 12) -* org-odt-create-custom-styles-for-srcblocks: Literal examples in ODT export. - (line 16) -* org-odt-fontify-srcblocks: Literal examples in ODT export. - (line 13) -* org-odt-pixels-per-inch: Images in ODT export. - (line 34) -* org-odt-preferred-output-format <1>: Extending ODT export. - (line 21) -* org-odt-preferred-output-format: ODT export commands. (line 9) -* org-odt-schema-dir: Validating OpenDocument XML. - (line 14) -* org-odt-styles-file <1>: Applying custom styles. - (line 25) -* org-odt-styles-file: ODT specific export settings. - (line 22) -* org-odt-table-styles: Customizing tables in ODT export. - (line 13) -* org-outline-path-complete-in-steps: Refile and copy. (line 17) -* org-overriding-columns-format: Agenda column view. (line 18) -* org-plain-list-ordered-item-terminator: Plain lists. (line 14) -* org-popup-calendar-for-date-prompt: The date/time prompt. - (line 76) -* org-preview-latex-default-process: Previewing LaTeX fragments. - (line 6) -* org-priority-faces: Priorities. (line 13) -* org-priority-start-cycle-with-default: Priorities. (line 32) -* org-property-allowed-value-functions: Using the property API. - (line 68) -* org-protocol-default-template-key: capture protocol. (line 19) -* org-protocol-project-alist: open-source protocol. - (line 13) -* org-publish-project-alist <1>: Publishing options. (line 13) -* org-publish-project-alist: Project alist. (line 6) -* org-publish-use-timestamps-flag: Triggering publication. - (line 21) -* org-put-time-stamp-overlays: In-buffer settings. (line 140) -* org-read-date-display-live: The date/time prompt. - (line 91) -* org-read-date-force-compatible-dates: The date/time prompt. - (line 61) -* org-read-date-prefer-future: The date/time prompt. - (line 6) -* org-refile-allow-creating-parent-nodes: Refile and copy. (line 17) -* org-refile-keep: Refile and copy. (line 17) -* org-refile-targets: Refile and copy. (line 17) -* org-refile-use-cache: Refile and copy. (line 17) -* org-refile-use-outline-path: Refile and copy. (line 17) -* org-remove-highlights-with-change <1>: Clocking commands. (line 83) -* org-remove-highlights-with-change: Sparse trees. (line 20) -* org-replace-disputed-keys: Conflicts. (line 18) -* org-return-follows-link: Handling links. (line 123) -* org-reverse-note-order: Refile and copy. (line 17) -* org-scheduled-delay-days: Deadlines and scheduling. - (line 42) -* org-show-context-detail: Sparse trees. (line 6) -* org-sort-agenda-noeffort-is-high: Filtering/limiting agenda items. - (line 92) -* org-sparse-tree-open-archived-trees: Internal archiving. (line 18) -* org-special-ctrl-a/e: Headlines. (line 6) -* org-special-ctrl-k: Headlines. (line 6) -* org-speed-commands-user: Speed keys. (line 19) -* org-startup-align-all-tables <1>: In-buffer settings. (line 84) -* org-startup-align-all-tables: Column width and alignment. - (line 33) -* org-startup-folded <1>: Speeding up your agendas. - (line 18) -* org-startup-folded <2>: In-buffer settings. (line 74) -* org-startup-folded: Initial visibility. (line 6) -* org-startup-indented: In-buffer settings. (line 79) -* org-startup-with-inline-images <1>: In-buffer settings. (line 91) -* org-startup-with-inline-images: Handling links. (line 136) -* org-startup-with-latex-preview <1>: In-buffer settings. (line 97) -* org-startup-with-latex-preview: Previewing LaTeX fragments. - (line 28) -* org-store-link-functions: Adding hyperlink types. - (line 61) -* org-stuck-projects: Stuck projects. (line 17) -* org-support-shift-select <1>: Conflicts. (line 6) -* org-support-shift-select: Plain lists. (line 94) -* org-table-auto-blank-field: Built-in table editor. - (line 30) -* org-table-copy-increment: Built-in table editor. - (line 168) -* org-table-duration-custom-format: Durations and time values. - (line 6) -* org-table-export-default-format: Built-in table editor. - (line 205) -* org-table-formula: In-buffer settings. (line 30) -* org-table-formula-constants <1>: Cooperation. (line 12) -* org-table-formula-constants <2>: In-buffer settings. (line 30) -* org-table-formula-constants: References. (line 110) -* org-table-use-standard-references <1>: Editing and debugging formulas. - (line 6) -* org-table-use-standard-references: References. (line 17) -* org-tag-alist <1>: In-buffer settings. (line 174) -* org-tag-alist: Setting tags. (line 23) -* org-tag-faces: Tags. (line 10) -* org-tag-persistent-alist: Setting tags. (line 38) -* org-tags-column: Setting tags. (line 11) -* org-tags-exclude-from-inheritance: Tag inheritance. (line 22) -* org-tags-match-list-sublevels <1>: Matching tags and properties. - (line 20) -* org-tags-match-list-sublevels <2>: Property searches. (line 19) -* org-tags-match-list-sublevels <3>: Tag searches. (line 20) -* org-tags-match-list-sublevels: Tag inheritance. (line 26) -* org-texinfo-classes <1>: Headings and sectioning structure. - (line 6) -* org-texinfo-classes: Texinfo file header. (line 11) -* org-texinfo-coding-system: Texinfo file header. (line 11) -* org-texinfo-default-class <1>: Headings and sectioning structure. - (line 6) -* org-texinfo-default-class: Texinfo specific export settings. - (line 20) -* org-texinfo-info-process: Texinfo export commands. - (line 6) -* org-texinfo-table-default-markup: Plain lists in Texinfo export. - (line 12) -* org-time-stamp-custom-formats: Custom time format. (line 6) -* org-time-stamp-overlay-formats: In-buffer settings. (line 140) -* org-time-stamp-rounding-minutes: Creating timestamps. (line 23) -* org-todo (face): Faces for TODO keywords. - (line 6) -* org-todo-keyword-faces: Faces for TODO keywords. - (line 6) -* org-todo-keywords <1>: In-buffer settings. (line 192) -* org-todo-keywords <2>: Global TODO list. (line 18) -* org-todo-keywords <3>: TODO extensions. (line 6) -* org-todo-keywords: TODO basics. (line 41) -* org-todo-repeat-to-state: Repeated tasks. (line 19) -* org-todo-state-tags-triggers: TODO basics. (line 62) -* org-track-ordered-property-with-tag <1>: Checkboxes. (line 80) -* org-track-ordered-property-with-tag: TODO dependencies. (line 38) -* org-treat-insert-todo-heading-as-state-change: Structure editing. - (line 29) -* org-treat-S-cursor-todo-selection-as-state-change: TODO basics. - (line 34) -* org-use-fast-todo-selection: TODO basics. (line 14) -* org-use-property-inheritance <1>: Using the property API. - (line 18) -* org-use-property-inheritance <2>: Header arguments in Org mode properties. - (line 17) -* org-use-property-inheritance <3>: iCalendar export. (line 51) -* org-use-property-inheritance: Property inheritance. - (line 6) -* org-use-speed-commands: Speed keys. (line 14) -* org-use-sub-superscripts: Subscripts and superscripts. - (line 14) -* org-use-tag-inheritance: Tag inheritance. (line 22) -* org-yank-adjusted-subtrees: Structure editing. (line 86) -* org-yank-folded-subtrees: Structure editing. (line 86) -* orgstruct-heading-prefix-regexp: Orgstruct mode. (line 26) -* parse-time-months: The date/time prompt. - (line 57) -* parse-time-weekdays: The date/time prompt. - (line 57) -* ps-landscape-mode: Exporting agenda views. - (line 20) -* ps-number-of-columns: Exporting agenda views. - (line 20) -* user-full-name: Export settings. (line 25) -* user-mail-address: Export settings. (line 35) - - - -Tag Table: -Node: Top893 -Node: Introduction24392 -Node: Summary24833 -Node: Installation27530 -Node: Activation30226 -Ref: Activation-Footnote-131746 -Node: Feedback31868 -Ref: Feedback-Footnote-135485 -Node: Conventions35612 -Node: Document structure37649 -Node: Outlines38640 -Node: Headlines39269 -Ref: Headlines-Footnote-140471 -Ref: Headlines-Footnote-240647 -Node: Visibility cycling40718 -Node: Global and local cycling41097 -Ref: Global and local cycling-Footnote-143724 -Ref: Global and local cycling-Footnote-243782 -Node: Initial visibility44051 -Ref: Initial visibility-Footnote-145086 -Node: Catching invisible edits45267 -Node: Motion45732 -Node: Structure editing47059 -Node: Sparse trees53657 -Ref: Sparse trees-Footnote-156167 -Ref: Sparse trees-Footnote-256278 -Node: Plain lists56349 -Ref: Plain lists-Footnote-163761 -Ref: Plain lists-Footnote-264115 -Ref: Plain lists-Footnote-364211 -Ref: Plain lists-Footnote-464458 -Ref: Plain lists-Footnote-564629 -Ref: Plain lists-Footnote-664729 -Ref: Plain lists-Footnote-764831 -Node: Drawers64897 -Ref: Drawers-Footnote-166761 -Node: Blocks66897 -Node: Footnotes67456 -Ref: Footnotes-Footnote-171400 -Ref: Footnotes-Footnote-271497 -Node: Orgstruct mode71574 -Node: Org syntax73204 -Node: Tables74177 -Node: Built-in table editor74818 -Ref: Built-in table editor-Footnote-184539 -Node: Column width and alignment84639 -Ref: Column width and alignment-Footnote-187200 -Node: Column groups87297 -Node: Orgtbl mode88868 -Node: The spreadsheet89677 -Node: References91137 -Ref: References-Footnote-197855 -Ref: References-Footnote-298077 -Ref: References-Footnote-398346 -Ref: References-Footnote-498459 -Node: Formula syntax for Calc98749 -Ref: Formula syntax for Calc-Footnote-1103901 -Node: Formula syntax for Lisp104225 -Node: Durations and time values105960 -Node: Field and range formulas107336 -Node: Column formulas109733 -Node: Lookup functions111821 -Node: Editing and debugging formulas113744 -Ref: Using multiple #+TBLFM lines118005 -Ref: Editing and debugging formulas-Footnote-1119254 -Node: Updating the table119390 -Node: Advanced features120746 -Ref: Advanced features-Footnote-1125227 -Node: Org-Plot125333 -Node: Hyperlinks129527 -Node: Link format130284 -Node: Internal links131543 -Ref: Internal links-Footnote-1133838 -Ref: Internal links-Footnote-2134078 -Node: Radio targets134216 -Node: External links134883 -Ref: External links-Footnote-1138919 -Ref: External links-Footnote-2139338 -Node: Handling links139594 -Ref: Handling links-Footnote-1147449 -Ref: Handling links-Footnote-2147608 -Ref: Handling links-Footnote-3147790 -Ref: Handling links-Footnote-4148085 -Ref: Handling links-Footnote-5148331 -Ref: Handling links-Footnote-6148450 -Ref: Handling links-Footnote-7148522 -Node: Using links outside Org148606 -Node: Link abbreviations149091 -Node: Search options151860 -Ref: Search options-Footnote-1153742 -Node: Custom searches153823 -Node: TODO items154833 -Ref: TODO items-Footnote-1155941 -Node: TODO basics156055 -Node: TODO extensions158879 -Node: Workflow states159909 -Ref: Workflow states-Footnote-1161210 -Node: TODO types161303 -Ref: TODO types-Footnote-1162901 -Node: Multiple sets in one file162970 -Node: Fast access to TODO states164824 -Ref: Fast access to TODO states-Footnote-1165697 -Ref: Fast access to TODO states-Footnote-2165781 -Node: Per-file keywords166074 -Ref: Per-file keywords-Footnote-1167445 -Node: Faces for TODO keywords167646 -Node: TODO dependencies168687 -Node: Progress logging171022 -Node: Closing items171734 -Ref: Closing items-Footnote-1172711 -Ref: Closing items-Footnote-2172780 -Node: Tracking TODO state changes172854 -Ref: Tracking TODO state changes-Footnote-1175890 -Ref: Tracking TODO state changes-Footnote-2175945 -Ref: Tracking TODO state changes-Footnote-3176085 -Node: Tracking your habits176373 -Node: Priorities180607 -Ref: Priorities-Footnote-1182579 -Node: Breaking down tasks182648 -Ref: Breaking down tasks-Footnote-1184627 -Node: Checkboxes184723 -Ref: Checkboxes-Footnote-1189350 -Ref: Checkboxes-Footnote-2189474 -Ref: Checkboxes-Footnote-3189648 -Node: Tags189768 -Node: Tag inheritance190824 -Ref: Tag inheritance-Footnote-1192639 -Ref: Tag inheritance-Footnote-2192739 -Node: Setting tags192865 -Ref: Setting tags-Footnote-1199176 -Node: Tag hierarchy199259 -Node: Tag searches202627 -Node: Properties and columns203909 -Node: Property syntax205345 -Node: Special properties209686 -Node: Property searches211331 -Node: Property inheritance212766 -Node: Column view214582 -Node: Defining columns215817 -Node: Scope of column definitions216195 -Node: Column attributes217100 -Ref: Column attributes-Footnote-1221894 -Ref: Column attributes-Footnote-2222050 -Ref: Column attributes-Footnote-3222263 -Ref: Column attributes-Footnote-4222546 -Node: Using column view222679 -Node: Capturing column view225604 -Ref: Capturing column view-Footnote-1228681 -Node: Property API228817 -Node: Dates and times229171 -Node: Timestamps230078 -Ref: Timestamps-Footnote-1232478 -Ref: Timestamps-Footnote-2232664 -Ref: Timestamps-Footnote-3232795 -Node: Creating timestamps233564 -Node: The date/time prompt236388 -Ref: The date/time prompt-Footnote-1240970 -Ref: The date/time prompt-Footnote-2241133 -Ref: The date/time prompt-Footnote-3241239 -Node: Custom time format241333 -Node: Deadlines and scheduling243055 -Ref: Deadlines and scheduling-Footnote-1246536 -Node: Inserting deadline/schedule246691 -Ref: Inserting deadline/schedule-Footnote-1248491 -Ref: Inserting deadline/schedule-Footnote-2248599 -Node: Repeated tasks248707 -Ref: Repeated tasks-Footnote-1253110 -Ref: Repeated tasks-Footnote-2253359 -Node: Clocking work time253558 -Ref: Clocking work time-Footnote-1254743 -Ref: Clocking work time-Footnote-2254887 -Node: Clocking commands255025 -Ref: Clocking commands-Footnote-1259930 -Ref: Clocking commands-Footnote-2260037 -Ref: Clocking commands-Footnote-3260087 -Ref: Clocking commands-Footnote-4260145 -Node: The clock table260223 -Ref: The clock table-Footnote-1267758 -Ref: The clock table-Footnote-2267852 -Node: Resolving idle time267977 -Ref: Resolving idle time-Footnote-1271824 -Node: Effort estimates272292 -Ref: Effort estimates-Footnote-1275045 -Node: Timers275152 -Node: Capture - Refile - Archive277444 -Node: Capture278434 -Node: Setting up capture279502 -Ref: Setting up capture-Footnote-1279911 -Node: Using capture279977 -Node: Capture templates282385 -Node: Template elements284350 -Ref: Template elements-Footnote-1290927 -Ref: Template elements-Footnote-2291244 -Node: Template expansion291431 -Ref: Template expansion-Footnote-1295499 -Ref: Template expansion-Footnote-2295586 -Ref: Template expansion-Footnote-3295849 -Ref: Template expansion-Footnote-4296031 -Node: Templates in contexts296129 -Node: Attachments296951 -Ref: Attachments-Footnote-1300398 -Node: RSS feeds300548 -Node: Protocols302025 -Node: `store-link' protocol303476 -Node: `capture' protocol304284 -Node: `open-source' protocol305396 -Node: Refile and copy308451 -Ref: Refile and copy-Footnote-1310873 -Node: Archiving310969 -Node: Moving subtrees311669 -Node: Internal archiving313693 -Node: Agenda views316325 -Node: Agenda files318653 -Ref: Agenda files-Footnote-1321456 -Ref: Agenda files-Footnote-2321605 -Node: Agenda dispatcher321798 -Ref: Agenda dispatcher-Footnote-1324629 -Ref: Agenda dispatcher-Footnote-2324723 -Node: Built-in agenda views324825 -Node: Weekly/daily agenda325409 -Ref: Weekly/daily agenda-Footnote-1331144 -Ref: Weekly/daily agenda-Footnote-2331371 -Node: Global TODO list331546 -Node: Matching tags and properties334074 -Node: Search view341026 -Node: Stuck projects342339 -Ref: Stuck projects-Footnote-1344399 -Node: Presentation and sorting344429 -Node: Categories345386 -Node: Time-of-day specifications346115 -Node: Sorting agenda items348084 -Node: Filtering/limiting agenda items349653 -Ref: Filtering/limiting agenda items-Footnote-1356801 -Node: Agenda commands357216 -Ref: Agenda commands-Footnote-1378207 -Ref: Agenda commands-Footnote-2378288 -Ref: Agenda commands-Footnote-3378407 -Ref: Agenda commands-Footnote-4378507 -Node: Custom agenda views378590 -Node: Storing searches379231 -Ref: Storing searches-Footnote-1382183 -Ref: Storing searches-Footnote-2382300 -Node: Block agenda382548 -Node: Setting options383786 -Node: Exporting agenda views387375 -Ref: Exporting agenda views-Footnote-1392283 -Ref: Exporting agenda views-Footnote-2392400 -Ref: Exporting agenda views-Footnote-3392556 -Ref: Exporting agenda views-Footnote-4392743 -Node: Agenda column view392825 -Node: Markup395897 -Node: Paragraphs396884 -Node: Emphasis and monospace398050 -Node: Horizontal rules398892 -Node: Images and tables399143 -Node: Literal examples400850 -Ref: Literal examples-Footnote-1405359 -Ref: Literal examples-Footnote-2405887 -Ref: Literal examples-Footnote-3406056 -Ref: Literal examples-Footnote-4406235 -Ref: Literal examples-Footnote-5406485 -Node: Special symbols406579 -Ref: Special symbols-Footnote-1408509 -Ref: Special symbols-Footnote-2408664 -Node: Subscripts and superscripts408754 -Node: Embedded LaTeX409858 -Ref: Embedded LaTeX-Footnote-1410672 -Node: LaTeX fragments410862 -Ref: LaTeX fragments-Footnote-1412942 -Node: Previewing LaTeX fragments413165 -Ref: Previewing LaTeX fragments-Footnote-1414594 -Node: CDLaTeX mode414840 -Ref: CDLaTeX mode-Footnote-1417340 -Node: Exporting417488 -Node: The export dispatcher420108 -Node: Export settings422678 -Ref: Export settings-Footnote-1430214 -Ref: Export settings-Footnote-2430312 -Node: Table of contents430414 -Node: Include files432258 -Ref: Include files-Footnote-1435047 -Node: Macro replacement435213 -Ref: Macro replacement-Footnote-1437979 -Node: Comment lines438196 -Ref: Comment lines-Footnote-1439002 -Node: ASCII/Latin-1/UTF-8 export439102 -Node: Beamer export442078 -Node: Beamer export commands442848 -Node: Beamer specific export settings443520 -Node: Sectioning Frames and Blocks in Beamer445345 -Ref: Sectioning Frames and Blocks in Beamer-Footnote-1448528 -Node: Beamer specific syntax448681 -Node: Editing support450599 -Node: A Beamer example451073 -Node: HTML export452340 -Node: HTML Export commands453347 -Node: HTML Specific export settings453858 -Node: HTML doctypes455841 -Node: HTML preamble and postamble457892 -Node: Quoting HTML tags459026 -Node: Links in HTML export459688 -Node: Tables in HTML export461097 -Node: Images in HTML export462500 -Node: Math formatting in HTML export463945 -Ref: Math formatting in HTML export-Footnote-1465336 -Node: Text areas in HTML export465460 -Node: CSS support466575 -Ref: CSS support-Footnote-1470004 -Node: JavaScript support470176 -Node: LaTeX export473426 -Node: LaTeX export commands475144 -Ref: LaTeX export commands-Footnote-1476415 -Node: LaTeX specific export settings476615 -Node: LaTeX header and sectioning479343 -Node: Quoting LaTeX code481418 -Node: Tables in LaTeX export482202 -Node: Images in LaTeX export486495 -Ref: Images in LaTeX export-Footnote-1488900 -Node: Plain lists in LaTeX export488947 -Node: Source blocks in LaTeX export489952 -Node: Example blocks in LaTeX export491338 -Node: Special blocks in LaTeX export492038 -Node: Horizontal rules in LaTeX export493274 -Node: Markdown export493661 -Node: OpenDocument Text export494959 -Ref: OpenDocument Text export-Footnote-1496048 -Node: Pre-requisites for ODT export496192 -Node: ODT export commands496566 -Ref: x-export-to-odt496770 -Node: ODT specific export settings497899 -Node: Extending ODT export498906 -Ref: x-export-to-other-formats499765 -Ref: x-convert-to-other-formats500170 -Node: Applying custom styles500639 -Node: Links in ODT export502400 -Node: Tables in ODT export503050 -Node: Images in ODT export505020 -Node: Math formatting in ODT export507814 -Node: Working with LaTeX math snippets508275 -Ref: Working with LaTeX math snippets-Footnote-1510511 -Ref: Working with LaTeX math snippets-Footnote-2510587 -Node: Working with MathML or OpenDocument formula files510632 -Node: Labels and captions in ODT export511159 -Node: Literal examples in ODT export512419 -Node: Advanced topics in ODT export513237 -Node: Configuring a document converter513891 -Ref: x-odt-converter-capabilities514569 -Node: Working with OpenDocument style files514968 -Ref: x-factory-styles515373 -Ref: x-orgodtstyles-xml515611 -Ref: x-orgodtcontenttemplate-xml515938 -Ref: x-overriding-factory-styles516587 -Ref: x-org-odt-styles-file516858 -Ref: x-org-odt-content-template-file517766 -Node: Creating one-off styles517907 -Node: Customizing tables in ODT export520055 -Ref: Customizing tables in ODT export-Footnote-1524908 -Ref: Customizing tables in ODT export-Footnote-2525012 -Ref: Customizing tables in ODT export-Footnote-3525100 -Node: Validating OpenDocument XML525415 -Node: Org export526291 -Node: Texinfo export527024 -Node: Texinfo export commands528040 -Node: Texinfo specific export settings528638 -Node: Texinfo file header529721 -Node: Texinfo title and copyright page530663 -Node: Info directory file531985 -Node: Headings and sectioning structure532688 -Node: Indices534654 -Node: Quoting Texinfo code535638 -Node: Plain lists in Texinfo export536127 -Node: Tables in Texinfo export537454 -Node: Images in Texinfo export537941 -Node: Special blocks in Texinfo export538566 -Node: A Texinfo example539156 -Node: iCalendar export541280 -Node: Other built-in back-ends544873 -Node: Advanced configuration545471 -Node: Export in foreign buffers552209 -Node: Publishing553246 -Node: Configuration554114 -Node: Project alist554877 -Node: Sources and destinations556018 -Node: Selecting files557541 -Node: Publishing action558542 -Ref: Publishing action-Footnote-1560371 -Node: Publishing options560528 -Node: Publishing links573682 -Node: Sitemap575034 -Node: Generating an index578762 -Node: Uploading files579544 -Node: Sample configuration581308 -Node: Simple example581797 -Node: Complex example582504 -Node: Triggering publication584555 -Node: Working with source code585551 -Node: Structure of code blocks590001 -Node: Editing source code592488 -Node: Exporting code blocks595247 -Node: Extracting source code597542 -Node: Evaluating code blocks599984 -Ref: Evaluating code blocks-Footnote-1603105 -Ref: Evaluating code blocks-Footnote-2603231 -Node: Library of Babel603417 -Node: Languages604093 -Node: Header arguments606548 -Node: Using header arguments606905 -Node: System-wide header arguments607711 -Node: Language-specific header arguments608406 -Node: Header arguments in Org mode properties608926 -Node: Language-specific mode properties610369 -Node: Code block specific header arguments611189 -Node: Arguments in function calls612840 -Node: Specific header arguments613600 -Node: var616282 -Node: results622864 -Node: file626763 -Node: file-desc627428 -Node: file-ext627826 -Node: output-dir628243 -Node: dir628641 -Node: exports630763 -Node: tangle631635 -Node: mkdirp632480 -Node: comments632794 -Node: padline633750 -Node: no-expand634141 -Node: session634851 -Node: noweb635928 -Node: noweb-ref638540 -Node: noweb-sep639644 -Node: cache639948 -Node: sep642544 -Node: hlines642935 -Node: colnames644417 -Node: rownames645821 -Node: shebang647010 -Node: tangle-mode647488 -Node: eval648272 -Node: wrap649256 -Node: post649563 -Node: prologue651298 -Node: epilogue651794 -Node: Results of evaluation652052 -Node: Noweb reference syntax655773 -Node: Key bindings and useful functions658044 -Node: Batch execution660083 -Node: Miscellaneous660855 -Node: Completion661694 -Node: Easy templates663737 -Node: Speed keys664957 -Node: Code evaluation security666126 -Node: Customization668930 -Node: In-buffer settings669356 -Node: The very busy C-c C-c key678789 -Node: Clean view680754 -Ref: Clean view-Footnote-1684153 -Ref: Clean view-Footnote-2684376 -Ref: Clean view-Footnote-3684431 -Node: TTY keys684503 -Node: Interaction685928 -Node: Cooperation686325 -Node: Conflicts689044 -Node: org-crypt693553 -Node: Hacking694805 -Node: Hooks695791 -Node: Add-on packages696109 -Node: Adding hyperlink types696637 -Node: Adding export back-ends699998 -Node: Context-sensitive commands701218 -Node: Tables in arbitrary syntax701899 -Node: Radio tables703562 -Node: A LaTeX example705635 -Ref: A LaTeX example-Footnote-1709348 -Ref: A LaTeX example-Footnote-2709514 -Node: Translator functions709949 -Node: Radio lists712056 -Node: Dynamic blocks713206 -Node: Special agenda views715252 -Ref: x-agenda-skip-entry-regexp718077 -Ref: Special agenda views-Footnote-1718842 -Ref: Special agenda views-Footnote-2719037 -Node: Speeding up your agendas719165 -Node: Extracting agenda information720209 -Node: Using the property API724033 -Node: Using the mapping API727358 -Node: MobileOrg731325 -Node: Setting up the staging area732885 -Ref: Setting up the staging area-Footnote-1734087 -Ref: Setting up the staging area-Footnote-2734256 -Node: Pushing to MobileOrg734463 -Ref: Pushing to MobileOrg-Footnote-1735342 -Ref: Pushing to MobileOrg-Footnote-2735428 -Ref: Pushing to MobileOrg-Footnote-3735787 -Node: Pulling from MobileOrg735859 -Ref: Pulling from MobileOrg-Footnote-1737879 -Node: History and acknowledgments737939 -Node: GNU Free Documentation License753124 -Node: Main Index778314 -Node: Key Index875744 -Node: Command and Function Index928332 -Node: Variable Index963628 - -End Tag Table - - -Local Variables: -coding: utf-8 -End: diff --git a/elpa/org-20171030/org-autoloads.el b/elpa/org-20171030/org-autoloads.el deleted file mode 100644 index 8c6869e6..00000000 --- a/elpa/org-20171030/org-autoloads.el +++ /dev/null @@ -1,768 +0,0 @@ -;;; org-autoloads.el --- automatically extracted autoloads -;; -;;; Code: -(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) - -;;;### (autoloads nil "org" "org.el" (23034 3568 429651 392000)) -;;; Generated autoloads from org.el - -(autoload 'org-babel-do-load-languages "org" "\ -Load the languages defined in `org-babel-load-languages'. - -\(fn SYM VALUE)" nil nil) - -(autoload 'org-babel-load-file "org" "\ -Load Emacs Lisp source code blocks in the Org FILE. -This function exports the source code using `org-babel-tangle' -and then loads the resulting file using `load-file'. With prefix -arg (noninteractively: 2nd arg) COMPILE the tangled Emacs Lisp -file to byte-code before it is loaded. - -\(fn FILE &optional COMPILE)" t nil) - -(autoload 'org-version "org" "\ -Show the Org version. -Interactively, or when MESSAGE is non-nil, show it in echo area. -With prefix argument, or when HERE is non-nil, insert it at point. -In non-interactive uses, a reduced version string is output unless -FULL is given. - -\(fn &optional HERE FULL MESSAGE)" t nil) - -(autoload 'turn-on-orgtbl "org" "\ -Unconditionally turn on `orgtbl-mode'. - -\(fn)" nil nil) - -(autoload 'org-clock-persistence-insinuate "org" "\ -Set up hooks for clock persistence. - -\(fn)" nil nil) - -(autoload 'org-mode "org" "\ -Outline-based notes management and organizer, alias -\"Carsten's outline-mode for keeping track of everything.\" - -Org mode develops organizational tasks around a NOTES file which -contains information about projects as plain text. Org mode is -implemented on top of Outline mode, which is ideal to keep the content -of large files well structured. It supports ToDo items, deadlines and -time stamps, which magically appear in the diary listing of the Emacs -calendar. Tables are easily created with a built-in table editor. -Plain text URL-like links connect to websites, emails (VM), Usenet -messages (Gnus), BBDB entries, and any files related to the project. -For printing and sharing of notes, an Org file (or a part of it) -can be exported as a structured ASCII or HTML file. - -The following commands are available: - -\\{org-mode-map} - -\(fn)" t nil) - -(autoload 'org-cycle "org" "\ -TAB-action and visibility cycling for Org mode. - -This is the command invoked in Org mode by the `TAB' key. Its main -purpose is outline visibility cycling, but it also invokes other actions -in special contexts. - -When this function is called with a `\\[universal-argument]' prefix, rotate the entire -buffer through 3 states (global cycling) - 1. OVERVIEW: Show only top-level headlines. - 2. CONTENTS: Show all headlines of all levels, but no body text. - 3. SHOW ALL: Show everything. - -With a `\\[universal-argument] \\[universal-argument]' prefix argument, switch to the startup visibility, -determined by the variable `org-startup-folded', and by any VISIBILITY -properties in the buffer. - -With a `\\[universal-argument] \\[universal-argument] \\[universal-argument]' prefix argument, show the entire buffer, including -any drawers. - -When inside a table, re-align the table and move to the next field. - -When point is at the beginning of a headline, rotate the subtree started -by this line through 3 different states (local cycling) - 1. FOLDED: Only the main headline is shown. - 2. CHILDREN: The main headline and the direct children are shown. - From this state, you can move to one of the children - and zoom in further. - 3. SUBTREE: Show the entire subtree, including body text. -If there is no subtree, switch directly from CHILDREN to FOLDED. - -When point is at the beginning of an empty headline and the variable -`org-cycle-level-after-item/entry-creation' is set, cycle the level -of the headline by demoting and promoting it to likely levels. This -speeds up creation document structure by pressing `TAB' once or several -times right after creating a new headline. - -When there is a numeric prefix, go up to a heading with level ARG, do -a `show-subtree' and return to the previous cursor position. If ARG -is negative, go up that many levels. - -When point is not at the beginning of a headline, execute the global -binding for `TAB', which is re-indenting the line. See the option -`org-cycle-emulate-tab' for details. - -As a special case, if point is at the beginning of the buffer and there is -no headline in line 1, this function will act as if called with prefix arg -\(`\\[universal-argument] TAB', same as `S-TAB') also when called without prefix arg, but only -if the variable `org-cycle-global-at-bob' is t. - -\(fn &optional ARG)" t nil) - -(autoload 'org-global-cycle "org" "\ -Cycle the global visibility. For details see `org-cycle'. -With `\\[universal-argument]' prefix ARG, switch to startup visibility. -With a numeric prefix, show all headlines up to that level. - -\(fn &optional ARG)" t nil) -(put 'orgstruct-heading-prefix-regexp 'safe-local-variable 'stringp) - -(autoload 'orgstruct-mode "org" "\ -Toggle the minor mode `orgstruct-mode'. -This mode is for using Org mode structure commands in other -modes. The following keys behave as if Org mode were active, if -the cursor is on a headline, or on a plain list item (both as -defined by Org mode). - -\(fn &optional ARG)" t nil) - -(autoload 'turn-on-orgstruct "org" "\ -Unconditionally turn on `orgstruct-mode'. - -\(fn)" nil nil) - -(autoload 'turn-on-orgstruct++ "org" "\ -Unconditionally turn on `orgstruct++-mode'. - -\(fn)" nil nil) - -(autoload 'org-run-like-in-org-mode "org" "\ -Run a command, pretending that the current buffer is in Org mode. -This will temporarily bind local variables that are typically bound in -Org mode to the values they have in Org mode, and then interactively -call CMD. - -\(fn CMD)" nil nil) - -(autoload 'org-store-link "org" "\ -Store an org-link to the current location. -\\ -This link is added to `org-stored-links' and can later be inserted -into an Org buffer with `org-insert-link' (`\\[org-insert-link]'). - -For some link types, a `\\[universal-argument]' prefix ARG is interpreted. A single -`\\[universal-argument]' negates `org-context-in-file-links' for file links or -`org-gnus-prefer-web-links' for links to Usenet articles. - -A `\\[universal-argument] \\[universal-argument]' prefix ARG forces skipping storing functions that are not -part of Org core. - -A `\\[universal-argument] \\[universal-argument] \\[universal-argument]' prefix ARG forces storing a link for each line in the -active region. - -\(fn ARG)" t nil) - -(autoload 'org-insert-link-global "org" "\ -Insert a link like Org mode does. -This command can be called in any mode to insert a link in Org syntax. - -\(fn)" t nil) - -(autoload 'org-open-at-point-global "org" "\ -Follow a link or time-stamp like Org mode does. -This command can be called in any mode to follow an external link -or a time-stamp that has Org mode syntax. Its behavior is -undefined when called on internal links (e.g., fuzzy links). -Raise an error when there is nothing to follow. - -\(fn)" t nil) - -(autoload 'org-open-link-from-string "org" "\ -Open a link in the string S, as if it was in Org mode. - -\(fn S &optional ARG REFERENCE-BUFFER)" t nil) - -(autoload 'org-switchb "org" "\ -Switch between Org buffers. - -With `\\[universal-argument]' prefix, restrict available buffers to files. - -With `\\[universal-argument] \\[universal-argument]' prefix, restrict available buffers to agenda files. - -\(fn &optional ARG)" t nil) - -(autoload 'org-cycle-agenda-files "org" "\ -Cycle through the files in `org-agenda-files'. -If the current buffer visits an agenda file, find the next one in the list. -If the current buffer does not, find the first agenda file. - -\(fn)" t nil) - -(autoload 'org-submit-bug-report "org" "\ -Submit a bug report on Org via mail. - -Don't hesitate to report any problems or inaccurate documentation. - -If you don't have setup sending mail from (X)Emacs, please copy the -output buffer into your mail program, as it gives us important -information about your Org version and configuration. - -\(fn)" t nil) - -(autoload 'org-reload "org" "\ -Reload all org lisp files. -With prefix arg UNCOMPILED, load the uncompiled versions. - -\(fn &optional UNCOMPILED)" t nil) - -(autoload 'org-customize "org" "\ -Call the customize function with org as argument. - -\(fn)" t nil) - -;;;*** - -;;;### (autoloads nil "org-agenda" "org-agenda.el" (23034 3568 362329 -;;;;;; 578000)) -;;; Generated autoloads from org-agenda.el - -(autoload 'org-toggle-sticky-agenda "org-agenda" "\ -Toggle `org-agenda-sticky'. - -\(fn &optional ARG)" t nil) - -(autoload 'org-agenda "org-agenda" "\ -Dispatch agenda commands to collect entries to the agenda buffer. -Prompts for a command to execute. Any prefix arg will be passed -on to the selected command. The default selections are: - -a Call `org-agenda-list' to display the agenda for current day or week. -t Call `org-todo-list' to display the global todo list. -T Call `org-todo-list' to display the global todo list, select only - entries with a specific TODO keyword (the user gets a prompt). -m Call `org-tags-view' to display headlines with tags matching - a condition (the user is prompted for the condition). -M Like `m', but select only TODO entries, no ordinary headlines. -e Export views to associated files. -s Search entries for keywords. -S Search entries for keywords, only with TODO keywords. -/ Multi occur across all agenda files and also files listed - in `org-agenda-text-search-extra-files'. -< Restrict agenda commands to buffer, subtree, or region. - Press several times to get the desired effect. -> Remove a previous restriction. -# List \"stuck\" projects. -! Configure what \"stuck\" means. -C Configure custom agenda commands. - -More commands can be added by configuring the variable -`org-agenda-custom-commands'. In particular, specific tags and TODO keyword -searches can be pre-defined in this way. - -If the current buffer is in Org mode and visiting a file, you can also -first press `<' once to indicate that the agenda should be temporarily -\(until the next use of `\\[org-agenda]') restricted to the current file. -Pressing `<' twice means to restrict to the current subtree or region -\(if active). - -\(fn &optional ARG ORG-KEYS RESTRICTION)" t nil) - -(autoload 'org-batch-agenda "org-agenda" "\ -Run an agenda command in batch mode and send the result to STDOUT. -If CMD-KEY is a string of length 1, it is used as a key in -`org-agenda-custom-commands' and triggers this command. If it is a -longer string it is used as a tags/todo match string. -Parameters are alternating variable names and values that will be bound -before running the agenda command. - -\(fn CMD-KEY &rest PARAMETERS)" nil t) - -(autoload 'org-batch-agenda-csv "org-agenda" "\ -Run an agenda command in batch mode and send the result to STDOUT. -If CMD-KEY is a string of length 1, it is used as a key in -`org-agenda-custom-commands' and triggers this command. If it is a -longer string it is used as a tags/todo match string. -Parameters are alternating variable names and values that will be bound -before running the agenda command. - -The output gives a line for each selected agenda item. Each -item is a list of comma-separated values, like this: - -category,head,type,todo,tags,date,time,extra,priority-l,priority-n - -category The category of the item -head The headline, without TODO kwd, TAGS and PRIORITY -type The type of the agenda entry, can be - todo selected in TODO match - tagsmatch selected in tags match - diary imported from diary - deadline a deadline on given date - scheduled scheduled on given date - timestamp entry has timestamp on given date - closed entry was closed on given date - upcoming-deadline warning about deadline - past-scheduled forwarded scheduled item - block entry has date block including g. date -todo The todo keyword, if any -tags All tags including inherited ones, separated by colons -date The relevant date, like 2007-2-14 -time The time, like 15:00-16:50 -extra Sting with extra planning info -priority-l The priority letter if any was given -priority-n The computed numerical priority -agenda-day The day in the agenda where this is listed - -\(fn CMD-KEY &rest PARAMETERS)" nil t) - -(autoload 'org-store-agenda-views "org-agenda" "\ -Store agenda views. - -\(fn &rest PARAMETERS)" t nil) - -(autoload 'org-batch-store-agenda-views "org-agenda" "\ -Run all custom agenda commands that have a file argument. - -\(fn &rest PARAMETERS)" nil t) - -(autoload 'org-agenda-list "org-agenda" "\ -Produce a daily/weekly view from all files in variable `org-agenda-files'. -The view will be for the current day or week, but from the overview buffer -you will be able to go to other days/weeks. - -With a numeric prefix argument in an interactive call, the agenda will -span ARG days. Lisp programs should instead specify SPAN to change -the number of days. SPAN defaults to `org-agenda-span'. - -START-DAY defaults to TODAY, or to the most recent match for the weekday -given in `org-agenda-start-on-weekday'. - -When WITH-HOUR is non-nil, only include scheduled and deadline -items if they have an hour specification like [h]h:mm. - -\(fn &optional ARG START-DAY SPAN WITH-HOUR)" t nil) - -(autoload 'org-search-view "org-agenda" "\ -Show all entries that contain a phrase or words or regular expressions. - -With optional prefix argument TODO-ONLY, only consider entries that are -TODO entries. The argument STRING can be used to pass a default search -string into this function. If EDIT-AT is non-nil, it means that the -user should get a chance to edit this string, with cursor at position -EDIT-AT. - -The search string can be viewed either as a phrase that should be found as -is, or it can be broken into a number of snippets, each of which must match -in a Boolean way to select an entry. The default depends on the variable -`org-agenda-search-view-always-boolean'. -Even if this is turned off (the default) you can always switch to -Boolean search dynamically by preceding the first word with \"+\" or \"-\". - -The default is a direct search of the whole phrase, where each space in -the search string can expand to an arbitrary amount of whitespace, -including newlines. - -If using a Boolean search, the search string is split on whitespace and -each snippet is searched separately, with logical AND to select an entry. -Words prefixed with a minus must *not* occur in the entry. Words without -a prefix or prefixed with a plus must occur in the entry. Matching is -case-insensitive. Words are enclosed by word delimiters (i.e. they must -match whole words, not parts of a word) if -`org-agenda-search-view-force-full-words' is set (default is nil). - -Boolean search snippets enclosed by curly braces are interpreted as -regular expressions that must or (when preceded with \"-\") must not -match in the entry. Snippets enclosed into double quotes will be taken -as a whole, to include whitespace. - -- If the search string starts with an asterisk, search only in headlines. -- If (possibly after the leading star) the search string starts with an - exclamation mark, this also means to look at TODO entries only, an effect - that can also be achieved with a prefix argument. -- If (possibly after star and exclamation mark) the search string starts - with a colon, this will mean that the (non-regexp) snippets of the - Boolean search must match as full words. - -This command searches the agenda files, and in addition the files -listed in `org-agenda-text-search-extra-files' unless a restriction lock -is active. - -\(fn &optional TODO-ONLY STRING EDIT-AT)" t nil) - -(autoload 'org-todo-list "org-agenda" "\ -Show all (not done) TODO entries from all agenda file in a single list. -The prefix arg can be used to select a specific TODO keyword and limit -the list to these. When using `\\[universal-argument]', you will be prompted -for a keyword. A numeric prefix directly selects the Nth keyword in -`org-todo-keywords-1'. - -\(fn &optional ARG)" t nil) - -(autoload 'org-tags-view "org-agenda" "\ -Show all headlines for all `org-agenda-files' matching a TAGS criterion. -The prefix arg TODO-ONLY limits the search to TODO entries. - -\(fn &optional TODO-ONLY MATCH)" t nil) - -(autoload 'org-agenda-list-stuck-projects "org-agenda" "\ -Create agenda view for projects that are stuck. -Stuck projects are project that have no next actions. For the definitions -of what a project is and how to check if it stuck, customize the variable -`org-stuck-projects'. - -\(fn &rest IGNORE)" t nil) - -(autoload 'org-diary "org-agenda" "\ -Return diary information from org files. -This function can be used in a \"sexp\" diary entry in the Emacs calendar. -It accesses org files and extracts information from those files to be -listed in the diary. The function accepts arguments specifying what -items should be listed. For a list of arguments allowed here, see the -variable `org-agenda-entry-types'. - -The call in the diary file should look like this: - - &%%(org-diary) ~/path/to/some/orgfile.org - -Use a separate line for each org file to check. Or, if you omit the file name, -all files listed in `org-agenda-files' will be checked automatically: - - &%%(org-diary) - -If you don't give any arguments (as in the example above), the default value -of `org-agenda-entry-types' is used: (:deadline :scheduled :timestamp :sexp). -So the example above may also be written as - - &%%(org-diary :deadline :timestamp :sexp :scheduled) - -The function expects the lisp variables `entry' and `date' to be provided -by the caller, because this is how the calendar works. Don't use this -function from a program - use `org-agenda-get-day-entries' instead. - -\(fn &rest ARGS)" nil nil) - -(autoload 'org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item "org-agenda" "\ -Do we have a reason to ignore this TODO entry because it has a time stamp? - -\(fn &optional END)" nil nil) - -(autoload 'org-agenda-set-restriction-lock "org-agenda" "\ -Set restriction lock for agenda, to current subtree or file. -Restriction will be the file if TYPE is `file', or if type is the -universal prefix \\='(4), or if the cursor is before the first headline -in the file. Otherwise, restriction will be to the current subtree. - -\(fn &optional TYPE)" t nil) - -(autoload 'org-calendar-goto-agenda "org-agenda" "\ -Compute the Org agenda for the calendar date displayed at the cursor. -This is a command that has to be installed in `calendar-mode-map'. - -\(fn)" t nil) - -(autoload 'org-agenda-to-appt "org-agenda" "\ -Activate appointments found in `org-agenda-files'. - -With a `\\[universal-argument]' prefix, refresh the list of appointments. - -If FILTER is t, interactively prompt the user for a regular -expression, and filter out entries that don't match it. - -If FILTER is a string, use this string as a regular expression -for filtering entries out. - -If FILTER is a function, filter out entries against which -calling the function returns nil. This function takes one -argument: an entry from `org-agenda-get-day-entries'. - -FILTER can also be an alist with the car of each cell being -either `headline' or `category'. For example: - - \\='((headline \"IMPORTANT\") - (category \"Work\")) - -will only add headlines containing IMPORTANT or headlines -belonging to the \"Work\" category. - -ARGS are symbols indicating what kind of entries to consider. -By default `org-agenda-to-appt' will use :deadline*, :scheduled* -\(i.e., deadlines and scheduled items with a hh:mm specification) -and :timestamp entries. See the docstring of `org-diary' for -details and examples. - -If an entry has a APPT_WARNTIME property, its value will be used -to override `appt-message-warning-time'. - -\(fn &optional REFRESH FILTER &rest ARGS)" t nil) - -;;;*** - -;;;### (autoloads nil "org-capture" "org-capture.el" (23034 3568 -;;;;;; 407376 811000)) -;;; Generated autoloads from org-capture.el - -(autoload 'org-capture-string "org-capture" "\ -Capture STRING with the template selected by KEYS. - -\(fn STRING &optional KEYS)" t nil) - -(autoload 'org-capture "org-capture" "\ -Capture something. -\\ -This will let you select a template from `org-capture-templates', and -then file the newly captured information. The text is immediately -inserted at the target location, and an indirect buffer is shown where -you can edit it. Pressing `\\[org-capture-finalize]' brings you back to the previous -state of Emacs, so that you can continue your work. - -When called interactively with a `\\[universal-argument]' prefix argument GOTO, don't -capture anything, just go to the file/headline where the selected -template stores its notes. - -With a `\\[universal-argument] \\[universal-argument]' prefix argument, go to the last note stored. - -When called with a `C-0' (zero) prefix, insert a template at point. - -When called with a `C-1' (one) prefix, force prompting for a date when -a datetree entry is made. - -ELisp programs can set KEYS to a string associated with a template -in `org-capture-templates'. In this case, interactive selection -will be bypassed. - -If `org-capture-use-agenda-date' is non-nil, capturing from the -agenda will use the date at point as the default date. Then, a -`C-1' prefix will tell the capture process to use the HH:MM time -of the day at point (if any) or the current HH:MM time. - -\(fn &optional GOTO KEYS)" t nil) - -(autoload 'org-capture-import-remember-templates "org-capture" "\ -Set `org-capture-templates' to be similar to `org-remember-templates'. - -\(fn)" t nil) - -;;;*** - -;;;### (autoloads nil "org-colview" "org-colview.el" (23034 3568 -;;;;;; 344776 363000)) -;;; Generated autoloads from org-colview.el - -(autoload 'org-columns-remove-overlays "org-colview" "\ -Remove all currently active column overlays. - -\(fn)" t nil) - -(autoload 'org-columns-get-format-and-top-level "org-colview" "\ - - -\(fn)" nil nil) - -(autoload 'org-columns "org-colview" "\ -Turn on column view on an Org mode file. - -Column view applies to the whole buffer if point is before the -first headline. Otherwise, it applies to the first ancestor -setting \"COLUMNS\" property. If there is none, it defaults to -the current headline. With a `\\[universal-argument]' prefix argument, turn on column -view for the whole buffer unconditionally. - -When COLUMNS-FMT-STRING is non-nil, use it as the column format. - -\(fn &optional GLOBAL COLUMNS-FMT-STRING)" t nil) - -(autoload 'org-columns-compute "org-colview" "\ -Summarize the values of PROPERTY hierarchically. -Also update existing values for PROPERTY according to the first -column specification. - -\(fn PROPERTY)" t nil) - -(autoload 'org-dblock-write:columnview "org-colview" "\ -Write the column view table. -PARAMS is a property list of parameters: - -:id the :ID: property of the entry where the columns view - should be built. When the symbol `local', call locally. - When `global' call column view with the cursor at the beginning - of the buffer (usually this means that the whole buffer switches - to column view). When \"file:path/to/file.org\", invoke column - view at the start of that file. Otherwise, the ID is located - using `org-id-find'. -:hlines When t, insert a hline before each item. When a number, insert - a hline before each level <= that number. -:indent When non-nil, indent each ITEM field according to its level. -:vlines When t, make each column a colgroup to enforce vertical lines. -:maxlevel When set to a number, don't capture headlines below this level. -:skip-empty-rows - When t, skip rows where all specifiers other than ITEM are empty. -:width apply widths specified in columns format using specifiers. -:format When non-nil, specify the column view format to use. - -\(fn PARAMS)" nil nil) - -(autoload 'org-columns-insert-dblock "org-colview" "\ -Create a dynamic block capturing a column view table. - -\(fn)" t nil) - -(autoload 'org-agenda-columns "org-colview" "\ -Turn on or update column view in the agenda. - -\(fn)" t nil) - -;;;*** - -;;;### (autoloads nil "org-compat" "org-compat.el" (23034 3568 311601 -;;;;;; 524000)) -;;; Generated autoloads from org-compat.el - -(autoload 'org-check-version "org-compat" "\ -Try very hard to provide sensible version strings. - -\(fn)" nil t) - -;;;*** - -;;;### (autoloads nil "org-duration" "org-duration.el" (23034 3568 -;;;;;; 332919 718000)) -;;; Generated autoloads from org-duration.el - -(autoload 'org-duration-set-regexps "org-duration" "\ -Set duration related regexps. - -\(fn)" t nil) - -(autoload 'org-duration-p "org-duration" "\ -Non-nil when string S is a time duration. - -\(fn S)" nil nil) - -(autoload 'org-duration-to-minutes "org-duration" "\ -Return number of minutes of DURATION string. - -When optional argument CANONICAL is non-nil, ignore -`org-duration-units' and use standard time units value. - -A bare number is translated into minutes. The empty string is -translated into 0.0. - -Return value as a float. Raise an error if duration format is -not recognized. - -\(fn DURATION &optional CANONICAL)" nil nil) - -(autoload 'org-duration-from-minutes "org-duration" "\ -Return duration string for a given number of MINUTES. - -Format duration according to `org-duration-format' or FMT, when -non-nil. - -When optional argument CANONICAL is non-nil, ignore -`org-duration-units' and use standard time units value. - -Raise an error if expected format is unknown. - -\(fn MINUTES &optional FMT CANONICAL)" nil nil) - -(autoload 'org-duration-h:mm-only-p "org-duration" "\ -Non-nil when every duration in TIMES has \"H:MM\" or \"H:MM:SS\" format. - -TIMES is a list of duration strings. - -Return nil if any duration is expressed with units, as defined in -`org-duration-units'. Otherwise, if any duration is expressed -with \"H:MM:SS\" format, return `h:mm:ss'. Otherwise, return -`h:mm'. - -\(fn TIMES)" nil nil) - -;;;*** - -;;;### (autoloads nil "org-lint" "org-lint.el" (23034 3568 364170 -;;;;;; 687000)) -;;; Generated autoloads from org-lint.el - -(autoload 'org-lint "org-lint" "\ -Check current Org buffer for syntax mistakes. - -By default, run all checkers. With a `\\[universal-argument]' prefix ARG, select one -category of checkers only. With a `\\[universal-argument] \\[universal-argument]' prefix, run one precise -checker by its name. - -ARG can also be a list of checker names, as symbols, to run. - -\(fn &optional ARG)" t nil) - -;;;*** - -;;;### (autoloads nil "org-macs" "org-macs.el" (23034 3568 373564 -;;;;;; 644000)) -;;; Generated autoloads from org-macs.el - -(autoload 'org-load-noerror-mustsuffix "org-macs" "\ -Load FILE with optional arguments NOERROR and MUSTSUFFIX. - -\(fn FILE)" nil t) - -;;;*** - -;;;### (autoloads nil "org-version" "org-version.el" (23034 3568 -;;;;;; 413272 367000)) -;;; Generated autoloads from org-version.el - -(autoload 'org-release "org-version" "\ -The release version of Org. -Inserted by installing Org mode or when a release is made. - -\(fn)" nil nil) - -(autoload 'org-git-version "org-version" "\ -The Git version of org-mode. -Inserted by installing Org or when a release is made. - -\(fn)" nil nil) - -(defvar org-odt-data-dir "/usr/share/emacs/etc/org" "\ -The location of ODT styles.") - -;;;*** - -;;;### (autoloads nil nil ("ob-C.el" "ob-J.el" "ob-R.el" "ob-abc.el" -;;;;;; "ob-asymptote.el" "ob-awk.el" "ob-calc.el" "ob-clojure.el" -;;;;;; "ob-comint.el" "ob-coq.el" "ob-core.el" "ob-css.el" "ob-ditaa.el" -;;;;;; "ob-dot.el" "ob-ebnf.el" "ob-emacs-lisp.el" "ob-eval.el" -;;;;;; "ob-exp.el" "ob-forth.el" "ob-fortran.el" "ob-gnuplot.el" -;;;;;; "ob-groovy.el" "ob-haskell.el" "ob-hledger.el" "ob-io.el" -;;;;;; "ob-java.el" "ob-js.el" "ob-keys.el" "ob-latex.el" "ob-ledger.el" -;;;;;; "ob-lilypond.el" "ob-lisp.el" "ob-lob.el" "ob-lua.el" "ob-makefile.el" -;;;;;; "ob-matlab.el" "ob-maxima.el" "ob-mscgen.el" "ob-ocaml.el" -;;;;;; "ob-octave.el" "ob-org.el" "ob-perl.el" "ob-picolisp.el" -;;;;;; "ob-plantuml.el" "ob-processing.el" "ob-python.el" "ob-ref.el" -;;;;;; "ob-ruby.el" "ob-sass.el" "ob-scheme.el" "ob-screen.el" "ob-sed.el" -;;;;;; "ob-shell.el" "ob-shen.el" "ob-sql.el" "ob-sqlite.el" "ob-stan.el" -;;;;;; "ob-table.el" "ob-tangle.el" "ob-vala.el" "ob.el" "org-archive.el" -;;;;;; "org-attach.el" "org-bbdb.el" "org-bibtex.el" "org-clock.el" -;;;;;; "org-crypt.el" "org-ctags.el" "org-datetree.el" "org-docview.el" -;;;;;; "org-element.el" "org-entities.el" "org-eshell.el" "org-eww.el" -;;;;;; "org-faces.el" "org-feed.el" "org-footnote.el" "org-gnus.el" -;;;;;; "org-habit.el" "org-id.el" "org-indent.el" "org-info.el" -;;;;;; "org-inlinetask.el" "org-install.el" "org-irc.el" "org-list.el" -;;;;;; "org-loaddefs.el" "org-macro.el" "org-mhe.el" "org-mobile.el" -;;;;;; "org-mouse.el" "org-pcomplete.el" "org-pkg.el" "org-plot.el" -;;;;;; "org-protocol.el" "org-rmail.el" "org-src.el" "org-table.el" -;;;;;; "org-timer.el" "org-w3m.el" "ox-ascii.el" "ox-beamer.el" -;;;;;; "ox-html.el" "ox-icalendar.el" "ox-latex.el" "ox-man.el" -;;;;;; "ox-md.el" "ox-odt.el" "ox-org.el" "ox-publish.el" "ox-texinfo.el" -;;;;;; "ox.el") (23034 3568 463288 38000)) - -;;;*** - -;; Local Variables: -;; version-control: never -;; no-byte-compile: t -;; no-update-autoloads: t -;; End: -;;; org-autoloads.el ends here diff --git a/elpa/org-20171030/org-compat.el b/elpa/org-20171030/org-compat.el deleted file mode 100644 index c963f06b..00000000 --- a/elpa/org-20171030/org-compat.el +++ /dev/null @@ -1,600 +0,0 @@ -;;; org-compat.el --- Compatibility Code for Older Emacsen -*- lexical-binding: t; -*- - -;; Copyright (C) 2004-2017 Free Software Foundation, Inc. - -;; Author: Carsten Dominik -;; Keywords: outlines, hypermedia, calendar, wp -;; Homepage: http://orgmode.org -;; -;; This file is part of GNU Emacs. -;; -;; GNU Emacs is free software: you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; GNU Emacs is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs. If not, see . -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;;; Commentary: - -;; This file contains code needed for compatibility with older -;; versions of GNU Emacs. - -;;; Code: - -(require 'cl-lib) -(require 'org-macs) - -(declare-function org-at-table.el-p "org" (&optional table-type)) -(declare-function org-element-at-point "org-element" ()) -(declare-function org-element-type "org-element" (element)) -(declare-function org-end-of-subtree "org" (&optional invisible-ok to-heading)) -(declare-function org-link-set-parameters "org" (type &rest rest)) -(declare-function org-table-end (&optional table-type)) -(declare-function outline-next-heading "outline" ()) -(declare-function table--at-cell-p "table" (position &optional object at-column)) - -(defvar org-table-any-border-regexp) -(defvar org-table-dataline-regexp) -(defvar org-table-tab-recognizes-table.el) -(defvar org-table1-hline-regexp) - -;;; Emacs < 25.1 compatibility - -(when (< emacs-major-version 25) - (defalias 'outline-hide-entry 'hide-entry) - (defalias 'outline-hide-sublevels 'hide-sublevels) - (defalias 'outline-hide-subtree 'hide-subtree) - (defalias 'outline-show-all 'show-all) - (defalias 'outline-show-branches 'show-branches) - (defalias 'outline-show-children 'show-children) - (defalias 'outline-show-entry 'show-entry) - (defalias 'outline-show-subtree 'show-subtree) - (defalias 'xref-find-definitions 'find-tag) - (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." - (let ((len (length name)) - (lastc ?.)) - (if (> len 0) - (setq lastc (aref name (1- len)))) - (or (= lastc ?/) - (and (memq system-type '(windows-nt ms-dos)) - (= lastc ?\\)))))) - -(unless (fboundp 'directory-files-recursively) - (defun directory-files-recursively (dir regexp &optional include-directories) - "Return list of all files under DIR that have file names matching REGEXP. -This function works recursively. Files are returned in \"depth first\" -order, and files from each directory are sorted in alphabetical order. -Each file name appears in the returned list in its absolute form. -Optional argument INCLUDE-DIRECTORIES non-nil means also include in the -output directories whose names match REGEXP." - (let ((result nil) - (files nil) - ;; When DIR is "/", remote file names like "/method:" could - ;; also be offered. We shall suppress them. - (tramp-mode (and tramp-mode (file-remote-p (expand-file-name dir))))) - (dolist (file (sort (file-name-all-completions "" dir) - 'string<)) - (unless (member file '("./" "../")) - (if (directory-name-p file) - (let* ((leaf (substring file 0 (1- (length file)))) - (full-file (expand-file-name leaf dir))) - ;; Don't follow symlinks to other directories. - (unless (file-symlink-p full-file) - (setq result - (nconc result (directory-files-recursively - full-file regexp include-directories)))) - (when (and include-directories - (string-match regexp leaf)) - (setq result (nconc result (list full-file))))) - (when (string-match regexp file) - (push (expand-file-name file dir) files))))) - (nconc result (nreverse files))))) - - -;;; Obsolete aliases (remove them after the next major release). - -;;;; XEmacs compatibility, now removed. -(define-obsolete-function-alias 'org-activate-mark 'activate-mark) -(define-obsolete-function-alias 'org-add-hook 'add-hook "Org 9.0") -(define-obsolete-function-alias 'org-bound-and-true-p 'bound-and-true-p "Org 9.0") -(define-obsolete-function-alias 'org-decompose-region 'decompose-region "Org 9.0") -(define-obsolete-function-alias 'org-defvaralias 'defvaralias "Org 9.0") -(define-obsolete-function-alias 'org-detach-overlay 'delete-overlay "Org 9.0") -(define-obsolete-function-alias 'org-file-equal-p 'file-equal-p "Org 9.0") -(define-obsolete-function-alias 'org-float-time 'float-time "Org 9.0") -(define-obsolete-function-alias 'org-indent-line-to 'indent-line-to "Org 9.0") -(define-obsolete-function-alias 'org-indent-to-column 'indent-to-column "Org 9.0") -(define-obsolete-function-alias 'org-looking-at-p 'looking-at-p "Org 9.0") -(define-obsolete-function-alias 'org-looking-back 'looking-back "Org 9.0") -(define-obsolete-function-alias 'org-match-string-no-properties 'match-string-no-properties "Org 9.0") -(define-obsolete-function-alias 'org-propertize 'propertize "Org 9.0") -(define-obsolete-function-alias 'org-select-frame-set-input-focus 'select-frame-set-input-focus "Org 9.0") - -(defmacro org-re (s) - "Replace posix classes in regular expression S." - (declare (debug (form)) - (obsolete "you can safely remove it." "Org 9.0")) - s) - -;;;; Functions from cl-lib that Org used to have its own implementation of. -(define-obsolete-function-alias 'org-count 'cl-count "Org 9.0") -(define-obsolete-function-alias 'org-every 'cl-every "Org 9.0") -(define-obsolete-function-alias 'org-find-if 'cl-find-if "Org 9.0") -(define-obsolete-function-alias 'org-reduce 'cl-reduce "Org 9.0") -(define-obsolete-function-alias 'org-remove-if 'cl-remove-if "Org 9.0") -(define-obsolete-function-alias 'org-remove-if-not 'cl-remove-if-not "Org 9.0") -(define-obsolete-function-alias 'org-some 'cl-some "Org 9.0") -(define-obsolete-function-alias 'org-floor* 'cl-floor "Org 9.0") - -(defun org-sublist (list start end) - "Return a section of LIST, from START to END. -Counting starts at 1." - (cl-subseq list (1- start) end)) -(make-obsolete 'org-sublist - "use cl-subseq (note the 0-based counting)." - "Org 9.0") - - -;;;; Functions available since Emacs 24.3 -(define-obsolete-function-alias 'org-buffer-narrowed-p 'buffer-narrowed-p "Org 9.0") -(define-obsolete-function-alias 'org-called-interactively-p 'called-interactively-p "Org 9.0") -(define-obsolete-function-alias 'org-char-to-string 'char-to-string "Org 9.0") -(define-obsolete-function-alias 'org-delete-directory 'delete-directory "Org 9.0") -(define-obsolete-function-alias 'org-format-seconds 'format-seconds "Org 9.0") -(define-obsolete-function-alias 'org-link-escape-browser 'url-encode-url "Org 9.0") -(define-obsolete-function-alias 'org-no-warnings 'with-no-warnings "Org 9.0") -(define-obsolete-function-alias 'org-number-sequence 'number-sequence "Org 9.0") -(define-obsolete-function-alias 'org-pop-to-buffer-same-window 'pop-to-buffer-same-window "Org 9.0") -(define-obsolete-function-alias 'org-string-match-p 'string-match-p "Org 9.0") - -;;;; Functions and variables from previous releases now obsolete. -(define-obsolete-function-alias 'org-element-remove-indentation - 'org-remove-indentation "Org 9.0") -(define-obsolete-variable-alias 'org-latex-create-formula-image-program - 'org-preview-latex-default-process "Org 9.0") -(define-obsolete-variable-alias 'org-latex-preview-ltxpng-directory - 'org-preview-latex-image-directory "Org 9.0") -(define-obsolete-function-alias 'org-table-p 'org-at-table-p "Org 9.0") -(define-obsolete-function-alias 'org-on-heading-p 'org-at-heading-p "Org 9.0") -(define-obsolete-function-alias 'org-at-regexp-p 'org-in-regexp "Org 8.3") -(define-obsolete-function-alias 'org-image-file-name-regexp - 'image-file-name-regexp "Org 9.0") -(define-obsolete-function-alias 'org-completing-read-no-i - 'completing-read "Org 9.0") -(define-obsolete-function-alias 'org-icompleting-read - 'completing-read "Org 9.0") -(define-obsolete-function-alias 'org-iread-file-name 'read-file-name "Org 9.0") -(define-obsolete-function-alias 'org-days-to-time - 'org-time-stamp-to-now "Org 8.2") -(define-obsolete-variable-alias 'org-agenda-ignore-drawer-properties - 'org-agenda-ignore-properties "Org 9.0") -(define-obsolete-function-alias 'org-preview-latex-fragment - 'org-toggle-latex-fragment "Org 8.3") -(define-obsolete-function-alias 'org-export-get-genealogy - 'org-element-lineage "Org 9.0") -(define-obsolete-variable-alias 'org-latex-with-hyperref - 'org-latex-hyperref-template "Org 9.0") -(define-obsolete-variable-alias 'hfy-optimisations 'hfy-optimizations "Org 9.0") -(define-obsolete-variable-alias 'org-export-htmlized-org-css-url - 'org-org-htmlized-css-url "Org 8.2") -(define-obsolete-function-alias 'org-list-parse-list 'org-list-to-lisp "Org 9.0") -(define-obsolete-function-alias 'org-agenda-todayp - 'org-agenda-today-p "Org 9.0") -(define-obsolete-function-alias 'org-babel-examplize-region - 'org-babel-examplify-region "Org 9.0") -(define-obsolete-variable-alias 'org-babel-capitalize-example-region-markers - 'org-babel-uppercase-example-markers "Org 9.1") - -(define-obsolete-function-alias 'org-babel-trim 'org-trim "Org 9.0") -(define-obsolete-variable-alias 'org-html-style 'org-html-head "24.4") -(define-obsolete-function-alias 'org-insert-columns-dblock - 'org-columns-insert-dblock "Org 9.0") -(define-obsolete-variable-alias 'org-export-babel-evaluate - 'org-export-use-babel "Org 9.1") -(define-obsolete-function-alias 'org-activate-bracket-links - 'org-activate-links "Org 9.0") -(define-obsolete-function-alias 'org-activate-plain-links 'ignore "Org 9.0") -(define-obsolete-function-alias 'org-activate-angle-links 'ignore "Org 9.0") - -(defun org-in-fixed-width-region-p () - "Non-nil if point in a fixed-width region." - (save-match-data - (eq 'fixed-width (org-element-type (org-element-at-point))))) -(make-obsolete 'org-in-fixed-width-region-p - "use `org-element' library" - "Org 9.0") - -(defun org-compatible-face (inherits specs) - "Make a compatible face specification. -If INHERITS is an existing face and if the Emacs version supports -it, just inherit the face. If INHERITS is not given and SPECS -is, use SPECS to define the face." - (declare (indent 1)) - (if (facep inherits) - (list (list t :inherit inherits)) - specs)) -(make-obsolete 'org-compatible-face "you can remove it." "Org 9.0") - -(defun org-add-link-type (type &optional follow export) - "Add a new TYPE link. -FOLLOW and EXPORT are two functions. - -FOLLOW should take the link path as the single argument and do whatever -is necessary to follow the link, for example find a file or display -a mail message. - -EXPORT should format the link path for export to one of the export formats. -It should be a function accepting three arguments: - - path the path of the link, the text after the prefix (like \"http:\") - desc the description of the link, if any - format the export format, a symbol like `html' or `latex' or `ascii'. - -The function may use the FORMAT information to return different values -depending on the format. The return value will be put literally into -the exported file. If the return value is nil, this means Org should -do what it normally does with links which do not have EXPORT defined. - -Org mode has a built-in default for exporting links. If you are happy with -this default, there is no need to define an export function for the link -type. For a simple example of an export function, see `org-bbdb.el'. - -If TYPE already exists, update it with the arguments. -See `org-link-parameters' for documentation on the other parameters." - (org-link-set-parameters type :follow follow :export export) - (message "Created %s link." type)) - -(make-obsolete 'org-add-link-type "use `org-link-set-parameters' instead." "Org 9.0") - -(defun org-table-recognize-table.el () - "If there is a table.el table nearby, recognize it and move into it." - (when (and org-table-tab-recognizes-table.el (org-at-table.el-p)) - (beginning-of-line) - (unless (or (looking-at org-table-dataline-regexp) - (not (looking-at org-table1-hline-regexp))) - (forward-line) - (when (looking-at org-table-any-border-regexp) - (forward-line -2))) - (if (re-search-forward "|" (org-table-end t) t) - (progn - (require 'table) - (if (table--at-cell-p (point)) t - (message "recognizing table.el table...") - (table-recognize-table) - (message "recognizing table.el table...done"))) - (error "This should not happen")))) - -;; Not used by Org core since commit 6d1e3082, Feb 2010. -(make-obsolete 'org-table-recognize-table.el - "please notify the org mailing list if you use this function." - "Org 9.0") - -(defun org-remove-angle-brackets (s) - (org-unbracket-string "<" ">" s)) -(make-obsolete 'org-remove-angle-brackets 'org-unbracket-string "Org 9.0") - -(defun org-remove-double-quotes (s) - (org-unbracket-string "\"" "\"" s)) -(make-obsolete 'org-remove-double-quotes 'org-unbracket-string "Org 9.0") - -(defcustom org-publish-sitemap-file-entry-format "%t" - "Format string for site-map file entry. -You could use brackets to delimit on what part the link will be. - -%t is the title. -%a is the author. -%d is the date formatted using `org-publish-sitemap-date-format'." - :group 'org-export-publish - :type 'string) -(make-obsolete-variable - 'org-publish-sitemap-file-entry-format - "set `:sitemap-format-entry' in `org-publish-project-alist' instead." - "Org 9.1") - -(defvar org-agenda-skip-regexp) -(defun org-agenda-skip-entry-when-regexp-matches () - "Check if the current entry contains match for `org-agenda-skip-regexp'. -If yes, it returns the end position of this entry, causing agenda commands -to skip the entry but continuing the search in the subtree. This is a -function that can be put into `org-agenda-skip-function' for the duration -of a command." - (declare (obsolete "use `org-agenda-skip-if' instead." "Org 9.1")) - (let ((end (save-excursion (org-end-of-subtree t))) - skip) - (save-excursion - (setq skip (re-search-forward org-agenda-skip-regexp end t))) - (and skip end))) - -(defun org-agenda-skip-subtree-when-regexp-matches () - "Check if the current subtree contains match for `org-agenda-skip-regexp'. -If yes, it returns the end position of this tree, causing agenda commands -to skip this subtree. This is a function that can be put into -`org-agenda-skip-function' for the duration of a command." - (declare (obsolete "use `org-agenda-skip-if' instead." "Org 9.1")) - (let ((end (save-excursion (org-end-of-subtree t))) - skip) - (save-excursion - (setq skip (re-search-forward org-agenda-skip-regexp end t))) - (and skip end))) - -(defun org-agenda-skip-entry-when-regexp-matches-in-subtree () - "Check if the current subtree contains match for `org-agenda-skip-regexp'. -If yes, it returns the end position of the current entry (NOT the tree), -causing agenda commands to skip the entry but continuing the search in -the subtree. This is a function that can be put into -`org-agenda-skip-function' for the duration of a command. An important -use of this function is for the stuck project list." - (declare (obsolete "use `org-agenda-skip-if' instead." "Org 9.1")) - (let ((end (save-excursion (org-end-of-subtree t))) - (entry-end (save-excursion (outline-next-heading) (1- (point)))) - skip) - (save-excursion - (setq skip (re-search-forward org-agenda-skip-regexp end t))) - (and skip entry-end))) - -(define-obsolete-function-alias 'org-minutes-to-clocksum-string - 'org-duration-from-minutes "Org 9.1") - -(define-obsolete-function-alias 'org-hh:mm-string-to-minutes - 'org-duration-to-minutes "Org 9.1") - -(define-obsolete-function-alias 'org-duration-string-to-minutes - 'org-duration-to-minutes "Org 9.1") - -(make-obsolete-variable 'org-time-clocksum-format - "set `org-duration-format' instead." "Org 9.1") - -(make-obsolete-variable 'org-time-clocksum-use-fractional - "set `org-duration-format' instead." "Org 9.1") - -(make-obsolete-variable 'org-time-clocksum-fractional-format - "set `org-duration-format' instead." "Org 9.1") - -(make-obsolete-variable 'org-time-clocksum-use-effort-durations - "set `org-duration-units' instead." "Org 9.1") - -(define-obsolete-function-alias 'org-babel-number-p - 'org-babel--string-to-number "Org 9.0") - -(define-obsolete-variable-alias 'org-usenet-links-prefer-google - 'org-gnus-prefer-web-links "Org 9.1") - -(define-obsolete-variable-alias 'org-texinfo-def-table-markup - 'org-texinfo-table-default-markup "Org 9.1") - -;;; The function was made obsolete by commit 65399674d5 of 2013-02-22. -;;; This make-obsolete call was added 2016-09-01. -(make-obsolete 'org-capture-import-remember-templates - "use the `org-capture-templates' variable instead." - "Org 9.0") - - -;;;; Obsolete link types - -(eval-after-load 'org - '(progn - (org-link-set-parameters "file+emacs") ;since Org 9.0 - (org-link-set-parameters "file+sys"))) ;since Org 9.0 - - - -;;; Miscellaneous functions - -(defun org-version-check (version feature level) - (let* ((v1 (mapcar 'string-to-number (split-string version "[.]"))) - (v2 (mapcar 'string-to-number (split-string emacs-version "[.]"))) - (rmaj (or (nth 0 v1) 99)) - (rmin (or (nth 1 v1) 99)) - (rbld (or (nth 2 v1) 99)) - (maj (or (nth 0 v2) 0)) - (min (or (nth 1 v2) 0)) - (bld (or (nth 2 v2) 0))) - (if (or (< maj rmaj) - (and (= maj rmaj) - (< min rmin)) - (and (= maj rmaj) - (= min rmin) - (< bld rbld))) - (if (eq level :predicate) - ;; just return if we have the version - nil - (let ((msg (format "Emacs %s or greater is recommended for %s" - version feature))) - (display-warning 'org msg level) - t)) - t))) - -(defun org-get-x-clipboard (value) - "Get the value of the X or Windows clipboard." - (cond ((and (eq window-system 'x) - (fboundp 'gui-get-selection)) ;Silence byte-compiler. - (org-no-properties - (ignore-errors - (or (gui-get-selection value 'UTF8_STRING) - (gui-get-selection value 'COMPOUND_TEXT) - (gui-get-selection value 'STRING) - (gui-get-selection value 'TEXT))))) - ((and (eq window-system 'w32) (fboundp 'w32-get-clipboard-data)) - (w32-get-clipboard-data)))) - -(defun org-add-props (string plist &rest props) - "Add text properties to entire string, from beginning to end. -PLIST may be a list of properties, PROPS are individual properties and values -that will be added to PLIST. Returns the string that was modified." - (add-text-properties - 0 (length string) (if props (append plist props) plist) string) - string) -(put 'org-add-props 'lisp-indent-function 2) - -(defun org-fit-window-to-buffer (&optional window max-height min-height - shrink-only) - "Fit WINDOW to the buffer, but only if it is not a side-by-side window. -WINDOW defaults to the selected window. MAX-HEIGHT and MIN-HEIGHT are -passed through to `fit-window-to-buffer'. If SHRINK-ONLY is set, call -`shrink-window-if-larger-than-buffer' instead, the height limit is -ignored in this case." - (cond ((if (fboundp 'window-full-width-p) - (not (window-full-width-p window)) - ;; do nothing if another window would suffer - (> (frame-width) (window-width window)))) - ((and (fboundp 'fit-window-to-buffer) (not shrink-only)) - (fit-window-to-buffer window max-height min-height)) - ((fboundp 'shrink-window-if-larger-than-buffer) - (shrink-window-if-larger-than-buffer window))) - (or window (selected-window))) - -;; `set-transient-map' is only in Emacs >= 24.4 -(defalias 'org-set-transient-map - (if (fboundp 'set-transient-map) - 'set-transient-map - 'set-temporary-overlay-map)) - -;;; Region compatibility - -(defvar org-ignore-region nil - "Non-nil means temporarily disable the active region.") - -(defun org-region-active-p () - "Non-nil when the region active. -Unlike to `use-region-p', this function also checks -`org-ignore-region'." - (and (not org-ignore-region) (use-region-p))) - -(defun org-cursor-to-region-beginning () - (when (and (org-region-active-p) - (> (point) (region-beginning))) - (exchange-point-and-mark))) - -;;; Invisibility compatibility - -(defun org-remove-from-invisibility-spec (arg) - "Remove elements from `buffer-invisibility-spec'." - (if (fboundp 'remove-from-invisibility-spec) - (remove-from-invisibility-spec arg) - (if (consp buffer-invisibility-spec) - (setq buffer-invisibility-spec - (delete arg buffer-invisibility-spec))))) - -(defun org-in-invisibility-spec-p (arg) - "Is ARG a member of `buffer-invisibility-spec'?" - (if (consp buffer-invisibility-spec) - (member arg buffer-invisibility-spec))) - -(defun org-move-to-column (column &optional force _buffer) - "Move to column COLUMN. -Pass COLUMN and FORCE to `move-to-column'." - (let ((buffer-invisibility-spec - (if (listp buffer-invisibility-spec) - (remove '(org-filtered) buffer-invisibility-spec) - buffer-invisibility-spec))) - (move-to-column column force))) - -(defmacro org-find-library-dir (library) - `(file-name-directory (or (locate-library ,library) ""))) - -(defun org-count-lines (s) - "How many lines in string S?" - (let ((start 0) (n 1)) - (while (string-match "\n" s start) - (setq start (match-end 0) n (1+ n))) - (if (and (> (length s) 0) (= (aref s (1- (length s))) ?\n)) - (setq n (1- n))) - n)) - -(defun org-kill-new (string &rest args) - (remove-text-properties 0 (length string) '(line-prefix t wrap-prefix t) - string) - (apply 'kill-new string args)) - -;; `font-lock-ensure' is only available from 24.4.50 on -(defalias 'org-font-lock-ensure - (if (fboundp 'font-lock-ensure) - #'font-lock-ensure - (lambda (&optional _beg _end) - (with-no-warnings (font-lock-fontify-buffer))))) - -;; `file-local-name' was added in Emacs 26.1. -(defalias 'org-babel-local-file-name - (if (fboundp 'file-local-name) - 'file-local-name - (lambda (file) - "Return the local name component of FILE." - (or (file-remote-p file 'localname) file)))) - -(defmacro org-no-popups (&rest body) - "Suppress popup windows. -Let-bind some variables to nil around BODY to achieve the desired -effect, which variables to use depends on the Emacs version." - (if (org-version-check "24.2.50" "" :predicate) - `(let (pop-up-frames display-buffer-alist) - ,@body) - `(let (pop-up-frames special-display-buffer-names special-display-regexps special-display-function) - ,@body))) - -;;;###autoload -(defmacro org-check-version () - "Try very hard to provide sensible version strings." - (let* ((org-dir (org-find-library-dir "org")) - (org-version.el (concat org-dir "org-version.el")) - (org-fixup.el (concat org-dir "../mk/org-fixup.el"))) - (if (require 'org-version org-version.el 'noerror) - '(progn - (autoload 'org-release "org-version.el") - (autoload 'org-git-version "org-version.el")) - (if (require 'org-fixup org-fixup.el 'noerror) - '(org-fixup) - ;; provide fallback definitions and complain - (warn "Could not define org version correctly. Check installation!") - '(progn - (defun org-release () "N/A") - (defun org-git-version () "N/A !!check installation!!")))))) - -(defmacro org-with-silent-modifications (&rest body) - (if (fboundp 'with-silent-modifications) - `(with-silent-modifications ,@body) - `(org-unmodified ,@body))) -(def-edebug-spec org-with-silent-modifications (body)) - -;; Functions for Emacs < 24.4 compatibility -(defun org-define-error (name message) - "Define NAME as a new error signal. -MESSAGE is a string that will be output to the echo area if such -an error is signaled without being caught by a `condition-case'. -Implements `define-error' for older emacsen." - (if (fboundp 'define-error) (define-error name message) - (put name 'error-conditions - (copy-sequence (cons name (get 'error 'error-conditions)))))) - -(unless (fboundp 'string-suffix-p) - ;; From Emacs subr.el. - (defun string-suffix-p (suffix string &optional ignore-case) - "Return non-nil if SUFFIX is a suffix of STRING. -If IGNORE-CASE is non-nil, the comparison is done without paying -attention to case differences." - (let ((start-pos (- (length string) (length suffix)))) - (and (>= start-pos 0) - (eq t (compare-strings suffix nil nil - string start-pos nil ignore-case)))))) - -(provide 'org-compat) - -;;; org-compat.el ends here diff --git a/elpa/org-20171030/org-macs.el b/elpa/org-20171030/org-macs.el deleted file mode 100644 index 1118214c..00000000 --- a/elpa/org-20171030/org-macs.el +++ /dev/null @@ -1,430 +0,0 @@ -;;; org-macs.el --- Top-level Definitions for Org -*- lexical-binding: t; -*- - -;; Copyright (C) 2004-2017 Free Software Foundation, Inc. - -;; Author: Carsten Dominik -;; Keywords: outlines, hypermedia, calendar, wp -;; Homepage: http://orgmode.org -;; -;; This file is part of GNU Emacs. -;; -;; GNU Emacs is free software: you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; GNU Emacs is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs. If not, see . -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;;; Commentary: - -;; This file contains macro definitions, defsubst definitions, other -;; stuff needed for compilation and top-level forms in Org mode, as -;; well lots of small functions that are not Org mode specific but -;; simply generally useful stuff. - -;;; Code: - -(defmacro org-with-gensyms (symbols &rest body) - (declare (debug (sexp body)) (indent 1)) - `(let ,(mapcar (lambda (s) - `(,s (make-symbol (concat "--" (symbol-name ',s))))) - symbols) - ,@body)) - -(defun org-string-nw-p (s) - "Return S if S is a string containing a non-blank character. -Otherwise, return nil." - (and (stringp s) - (string-match-p "[^ \r\t\n]" s) - s)) - -(defun org-split-string (string &optional separators) - "Splits STRING into substrings at SEPARATORS. - -SEPARATORS is a regular expression. When nil, it defaults to -\"[ \f\t\n\r\v]+\". - -Unlike to `split-string', matching SEPARATORS at the beginning -and end of string are ignored." - (let ((separators (or separators "[ \f\t\n\r\v]+"))) - (when (string-match (concat "\\`" separators) string) - (setq string (replace-match "" nil nil string))) - (when (string-match (concat separators "\\'") string) - (setq string (replace-match "" nil nil string))) - (split-string string separators))) - -(defun org-string-display (string) - "Return STRING as it is displayed in the current buffer. -This function takes into consideration `invisible' and `display' -text properties." - (let* ((build-from-parts - (lambda (s property filter) - ;; Build a new string out of string S. On every group of - ;; contiguous characters with the same PROPERTY value, - ;; call FILTER on the properties list at the beginning of - ;; the group. If it returns a string, replace the - ;; characters in the group with it. Otherwise, preserve - ;; those characters. - (let ((len (length s)) - (new "") - (i 0) - (cursor 0)) - (while (setq i (text-property-not-all i len property nil s)) - (let ((end (next-single-property-change i property s len)) - (value (funcall filter (text-properties-at i s)))) - (when value - (setq new (concat new (substring s cursor i) value)) - (setq cursor end)) - (setq i end))) - (concat new (substring s cursor))))) - (prune-invisible - (lambda (s) - (funcall build-from-parts s 'invisible - (lambda (props) - ;; If `invisible' property in PROPS means text - ;; is to be invisible, return the empty string. - ;; Otherwise return nil so that the part is - ;; skipped. - (and (or (eq t buffer-invisibility-spec) - (assoc-string (plist-get props 'invisible) - buffer-invisibility-spec)) - ""))))) - (replace-display - (lambda (s) - (funcall build-from-parts s 'display - (lambda (props) - ;; If there is any string specification in - ;; `display' property return it. Also attach - ;; other text properties on the part to that - ;; string (face...). - (let* ((display (plist-get props 'display)) - (value (if (stringp display) display - (cl-some #'stringp display)))) - (when value - (apply - #'propertize - ;; Displayed string could contain - ;; invisible parts, but no nested display. - (funcall prune-invisible value) - (plist-put props - 'display - (and (not (stringp display)) - (cl-remove-if #'stringp - display))))))))))) - ;; `display' property overrides `invisible' one. So we first - ;; replace characters with `display' property. Then we remove - ;; invisible characters. - (funcall prune-invisible (funcall replace-display string)))) - -(defun org-string-width (string) - "Return width of STRING when displayed in the current buffer. -Unlike to `string-width', this function takes into consideration -`invisible' and `display' text properties." - (string-width (org-string-display string))) - -(defun org-not-nil (v) - "If V not nil, and also not the string \"nil\", then return V. -Otherwise return nil." - (and v (not (equal v "nil")) v)) - -(defmacro org-preserve-lc (&rest body) - (declare (debug (body))) - (org-with-gensyms (line col) - `(let ((,line (org-current-line)) - (,col (current-column))) - (unwind-protect - (progn ,@body) - (org-goto-line ,line) - (org-move-to-column ,col))))) - -;; Use `org-with-silent-modifications' to ignore cosmetic changes and -;; `org-unmodified' to ignore real text modifications -(defmacro org-unmodified (&rest body) - "Run BODY while preserving the buffer's `buffer-modified-p' state." - (declare (debug (body))) - (org-with-gensyms (was-modified) - `(let ((,was-modified (buffer-modified-p))) - (unwind-protect - (let ((buffer-undo-list t) - (inhibit-modification-hooks t)) - ,@body) - (set-buffer-modified-p ,was-modified))))) - -(defmacro org-without-partial-completion (&rest body) - (declare (debug (body))) - `(if (and (boundp 'partial-completion-mode) - partial-completion-mode - (fboundp 'partial-completion-mode)) - (unwind-protect - (progn - (partial-completion-mode -1) - ,@body) - (partial-completion-mode 1)) - ,@body)) - -(defmacro org-with-point-at (pom &rest body) - "Move to buffer and point of point-or-marker POM for the duration of BODY." - (declare (debug (form body)) (indent 1)) - (org-with-gensyms (mpom) - `(let ((,mpom ,pom)) - (save-excursion - (if (markerp ,mpom) (set-buffer (marker-buffer ,mpom))) - (org-with-wide-buffer - (goto-char (or ,mpom (point))) - ,@body))))) - -(defmacro org-with-remote-undo (buffer &rest body) - "Execute BODY while recording undo information in two buffers." - (declare (debug (form body)) (indent 1)) - (org-with-gensyms (cline cmd buf1 buf2 undo1 undo2 c1 c2) - `(let ((,cline (org-current-line)) - (,cmd this-command) - (,buf1 (current-buffer)) - (,buf2 ,buffer) - (,undo1 buffer-undo-list) - (,undo2 (with-current-buffer ,buffer buffer-undo-list)) - ,c1 ,c2) - ,@body - (when org-agenda-allow-remote-undo - (setq ,c1 (org-verify-change-for-undo - ,undo1 (with-current-buffer ,buf1 buffer-undo-list)) - ,c2 (org-verify-change-for-undo - ,undo2 (with-current-buffer ,buf2 buffer-undo-list))) - (when (or ,c1 ,c2) - ;; make sure there are undo boundaries - (and ,c1 (with-current-buffer ,buf1 (undo-boundary))) - (and ,c2 (with-current-buffer ,buf2 (undo-boundary))) - ;; remember which buffer to undo - (push (list ,cmd ,cline ,buf1 ,c1 ,buf2 ,c2) - org-agenda-undo-list)))))) - -(defmacro org-no-read-only (&rest body) - "Inhibit read-only for BODY." - (declare (debug (body))) - `(let ((inhibit-read-only t)) ,@body)) - -(defconst org-rm-props '(invisible t face t keymap t intangible t mouse-face t - rear-nonsticky t mouse-map t fontified t - org-emphasis t) - "Properties to remove when a string without properties is wanted.") - -(defsubst org-no-properties (s &optional restricted) - "Remove all text properties from string S. -When RESTRICTED is non-nil, only remove the properties listed -in `org-rm-props'." - (if restricted (remove-text-properties 0 (length s) org-rm-props s) - (set-text-properties 0 (length s) nil s)) - s) - -(defsubst org-get-alist-option (option key) - (cond ((eq key t) t) - ((eq option t) t) - ((assoc key option) (cdr (assoc key option))) - (t (let ((r (cdr (assq 'default option)))) - (if (listp r) (delq nil r) r))))) - -(defsubst org-check-external-command (cmd &optional use no-error) - "Check if external program CMD for USE exists, error if not. -When the program does exist, return its path. -When it does not exist and NO-ERROR is set, return nil. -Otherwise, throw an error. The optional argument USE can describe what this -program is needed for, so that the error message can be more informative." - (or (executable-find cmd) - (if no-error - nil - (error "Can't find `%s'%s" cmd - (if use (format " (%s)" use) ""))))) - -(defsubst org-last (list) - "Return the last element of LIST." - (car (last list))) - -(defun org-let (list &rest body) - (eval (cons 'let (cons list body)))) -(put 'org-let 'lisp-indent-function 1) - -(defun org-let2 (list1 list2 &rest body) - (eval (cons 'let (cons list1 (list (cons 'let (cons list2 body))))))) -(put 'org-let2 'lisp-indent-function 2) - -(defsubst org-call-with-arg (command arg) - "Call COMMAND interactively, but pretend prefix arg was ARG." - (let ((current-prefix-arg arg)) (call-interactively command))) - -(defsubst org-current-line (&optional pos) - (save-excursion - (and pos (goto-char pos)) - ;; works also in narrowed buffer, because we start at 1, not point-min - (+ (if (bolp) 1 0) (count-lines 1 (point))))) - -(defsubst org-goto-line (N) - (save-restriction - (widen) - (goto-char (point-min)) - (forward-line (1- N)))) - -(defsubst org-current-line-string (&optional to-here) - (buffer-substring (point-at-bol) (if to-here (point) (point-at-eol)))) - -(defsubst org-pos-in-match-range (pos n) - (and (match-beginning n) - (<= (match-beginning n) pos) - (>= (match-end n) pos))) - -(defun org-match-line (regexp) - "Match REGEXP at the beginning of the current line." - (save-excursion - (beginning-of-line) - (looking-at regexp))) - -(defun org-plist-delete (plist property) - "Delete PROPERTY from PLIST. -This is in contrast to merely setting it to 0." - (let (p) - (while plist - (if (not (eq property (car plist))) - (setq p (plist-put p (car plist) (nth 1 plist)))) - (setq plist (cddr plist))) - p)) - -(defmacro org-save-outline-visibility (use-markers &rest body) - "Save and restore outline visibility around BODY. -If USE-MARKERS is non-nil, use markers for the positions. -This means that the buffer may change while running BODY, -but it also means that the buffer should stay alive -during the operation, because otherwise all these markers will -point nowhere." - (declare (debug (form body)) (indent 1)) - (org-with-gensyms (data) - `(let ((,data (org-outline-overlay-data ,use-markers))) - (unwind-protect - (prog1 (progn ,@body) - (org-set-outline-overlay-data ,data)) - (when ,use-markers - (dolist (c ,data) - (when (markerp (car c)) (move-marker (car c) nil)) - (when (markerp (cdr c)) (move-marker (cdr c) nil)))))))) - -(defmacro org-with-wide-buffer (&rest body) - "Execute body while temporarily widening the buffer." - (declare (debug (body))) - `(save-excursion - (save-restriction - (widen) - ,@body))) - -(defmacro org-with-limited-levels (&rest body) - "Execute BODY with limited number of outline levels." - (declare (debug (body))) - `(progn - (defvar org-called-with-limited-levels) - (defvar org-outline-regexp) - (defvar outline-regexp) - (defvar org-outline-regexp-bol) - (let* ((org-called-with-limited-levels t) - (org-outline-regexp (org-get-limited-outline-regexp)) - (outline-regexp org-outline-regexp) - (org-outline-regexp-bol (concat "^" org-outline-regexp))) - ,@body))) - -(defvar org-outline-regexp) ; defined in org.el -(defvar org-odd-levels-only) ; defined in org.el -(defvar org-inlinetask-min-level) ; defined in org-inlinetask.el -(defun org-get-limited-outline-regexp () - "Return outline-regexp with limited number of levels. -The number of levels is controlled by `org-inlinetask-min-level'" - (cond ((not (derived-mode-p 'org-mode)) - outline-regexp) - ((not (featurep 'org-inlinetask)) - org-outline-regexp) - (t - (let* ((limit-level (1- org-inlinetask-min-level)) - (nstars (if org-odd-levels-only - (1- (* limit-level 2)) - limit-level))) - (format "\\*\\{1,%d\\} " nstars))))) - -(defmacro org-eval-in-environment (environment form) - (declare (debug (form form)) (indent 1)) - `(eval (list 'let ,environment ',form))) - -(defun org-make-parameter-alist (flat) - "Return alist based on FLAT. -FLAT is a list with alternating symbol names and values. The -returned alist is a list of lists with the symbol name in car and -the value in cdr." - (when flat - (cons (list (car flat) (cadr flat)) - (org-make-parameter-alist (cddr flat))))) - -;;;###autoload -(defmacro org-load-noerror-mustsuffix (file) - "Load FILE with optional arguments NOERROR and MUSTSUFFIX." - `(load ,file 'noerror nil nil 'mustsuffix)) - -(defun org-unbracket-string (pre post string) - "Remove PRE/POST from the beginning/end of STRING. -Both PRE and POST must be pre-/suffixes of STRING, or neither is -removed." - (if (and (string-prefix-p pre string) - (string-suffix-p post string)) - (substring string (length pre) (- (length post))) - string)) - -(defun org-read-function (prompt &optional allow-empty?) - "Prompt for a function. -If ALLOW-EMPTY? is non-nil, return nil rather than raising an -error when the user input is empty." - (let ((func (completing-read prompt obarray #'fboundp t))) - (cond ((not (string= func "")) - (intern func)) - (allow-empty? nil) - (t (user-error "Empty input is not valid"))))) - -(defconst org-unique-local-variables - '(org-element--cache - org-element--cache-objects - org-element--cache-sync-keys - org-element--cache-sync-requests - org-element--cache-sync-timer) - "List of local variables that cannot be transferred to another buffer.") - -(defun org-get-local-variables () - "Return a list of all local variables in an Org mode buffer." - (delq nil - (mapcar - (lambda (x) - (let* ((binding (if (symbolp x) (list x) (list (car x) (cdr x)))) - (name (car binding))) - (and (not (get name 'org-state)) - (not (memq name org-unique-local-variables)) - (string-match-p - "\\`\\(org-\\|orgtbl-\\|outline-\\|comment-\\|paragraph-\\|\ -auto-fill\\|normal-auto-fill\\|fill-paragraph\\|indent-\\)" - (symbol-name name)) - binding))) - (with-temp-buffer - (org-mode) - (buffer-local-variables))))) - -(defun org-clone-local-variables (from-buffer &optional regexp) - "Clone local variables from FROM-BUFFER. -Optional argument REGEXP selects variables to clone." - (dolist (pair (buffer-local-variables from-buffer)) - (pcase pair - (`(,name . ,value) ;ignore unbound variables - (when (and (not (memq name org-unique-local-variables)) - (or (null regexp) (string-match-p regexp (symbol-name name)))) - (ignore-errors (set (make-local-variable name) value))))))) - - -(provide 'org-macs) - -;;; org-macs.el ends here diff --git a/elpa/org-20171030/org-pkg.el b/elpa/org-20171030/org-pkg.el deleted file mode 100644 index a0787c2d..00000000 --- a/elpa/org-20171030/org-pkg.el +++ /dev/null @@ -1,3 +0,0 @@ -(define-package "org" - "20171030" "Outline-based notes management and organizer" ( )) -;; no-byte-compile: t diff --git a/elpa/org-20171030/COPYING b/elpa/org-20190930/COPYING similarity index 100% rename from elpa/org-20171030/COPYING rename to elpa/org-20190930/COPYING diff --git a/elpa/org-20171030/README_ELPA b/elpa/org-20190930/README_ELPA similarity index 92% rename from elpa/org-20171030/README_ELPA rename to elpa/org-20190930/README_ELPA index be893243..7640a449 100644 --- a/elpa/org-20171030/README_ELPA +++ b/elpa/org-20190930/README_ELPA @@ -1,10 +1,10 @@ This is the Emacs Org project, an Emacs library for organizing your life. The homepage of Org is at: - http://orgmode.org + https://orgmode.org Installations instructions are at: - http://orgmode.org/org.html#Installation + https://orgmode.org/org.html#Installation This distribution contains an ELPA packaged version of Org. "ELPA" stands for the "Emacs Lisp Package Archive". diff --git a/elpa/org-20171030/dir b/elpa/org-20190930/dir similarity index 100% rename from elpa/org-20171030/dir rename to elpa/org-20190930/dir diff --git a/elpa/org-20171030/etc/ORG-NEWS b/elpa/org-20190930/etc/ORG-NEWS similarity index 90% rename from elpa/org-20171030/etc/ORG-NEWS rename to elpa/org-20190930/etc/ORG-NEWS index d6f550d2..5ce1e791 100644 --- a/elpa/org-20171030/etc/ORG-NEWS +++ b/elpa/org-20190930/etc/ORG-NEWS @@ -1,13 +1,426 @@ 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 +#+STARTUP: overview -Copyright (C) 2012-2017 Free Software Foundation, Inc. +#+LINK: doc https://orgmode.org/worg/doc.html#%s +#+LINK: git https://code.orgmode.org/bzg/org-mode/commit/%s + +Copyright (C) 2012-2019 Free Software Foundation, Inc. See the end of the file for license conditions. Please send Org bug reports to mailto:emacs-orgmode@gnu.org. +* Version 9.2 +** Incompatible changes +*** Removal of OrgStruct mode mode and radio lists + +OrgStruct minor mode and radio lists mechanism (~org-list-send-list~ +and ~org-list-radio-lists-templates~) are removed from the code base. + +Note that only radio /lists/ have been removed, not radio tables. + +If you want to manipulate lists like in Org in other modes, we suggest +to use orgalist.el, which you can install from GNU ELPA. + +If you want to use Org folding outside of Org buffers, you can have a +look at the outshine package in the MELPA repository. + +*** Change in the structure template expansion + +Org 9.2 comes with a new template expansion mechanism, combining +~org-insert-structure-template~ bound to ~C-c C-,~. + +If you customized the ~org-structure-template-alist~ option manually, +you probably need to udpate it, see the docstring for accepted values. + +If you prefer using previous patterns, e.g. => + ,#+END_SRC +#+END_SRC + +should become + +#+BEGIN_SRC org + ,#+NAME: foo + ,#+BEGIN_SRC emacs-lisp :noweb-ref bar + 1 + ,#+END_SRC + + ,#+BEGIN_SRC emacs-lisp :noweb-ref bar + 2 + ,#+END_SRC + + ,#+BEGIN_SRC emacs-lisp :noweb yes + <> + ,#+END_SRC +#+END_SRC + +*** Default/accepted values of ~org-calendar-to-agenda-key~ + +The default value and accepted value of ~org-calendar-to-agenda-key~ +changed. This is an excerpt of the new docstring: + +: When set to ‘default’, bind the function to ‘c’, but only if it is +: available in the Calendar keymap. This is the default choice because +: ‘c’ can then be used to switch back and forth between agenda and calendar. +: +: When nil, ‘org-calendar-goto-agenda’ is not bound to any key. + +Check the full docstring for more. + +*** Change the signature of the ~org-set-effort~ function + +Here is the new docstring: + +: (org-set-effort &optional INCREMENT VALUE) +: +: Set the effort property of the current entry. +: If INCREMENT is non-nil, set the property to the next allowed +: value. Otherwise, if optional argument VALUE is provided, use +: it. Eventually, prompt for the new value if none of the previous +: variables is set. + +*** Placeholders in =(eval ...)= macros are always strings + +Within =(eval ...)= macros, =$1=-like placeholders are always replaced +with a string. As a consequence, they must not be enclosed within +quotes. As an illustration, consider the following, now valid, +examples: + +#+begin_example + ,#+macro: join (eval (concat $1 $2)) + ,#+macro: sum (eval (+ (string-to-number $1) (string-to-number $2))) + + {{{join(a,b)}}} => ab + {{{sum(1,2)}}} => 3 +#+end_example + +However, there is no change in non-eval macros: + +#+begin_example + ,#+macro: disp argument: $1 + + {{{disp(text)}}} => argument: text +#+end_example + +*** =align= STARTUP value no longer narrow table columns + +Columns narrowing (or shrinking) is now dynamic. See [[*Dynamically +narrow table columns]] for details. In particular, it is decoupled from +aligning. + +If you need to automatically shrink columns upon opening an Org +document, use =shrink= value instead, or in addition to align: + +#+BEGIN_EXAMPLE +,#+STARTUP: align shrink +#+END_EXAMPLE + +*** ~org-get-tags~ meaning change + +Function ~org-get-tags~ used to return local tags to the current +headline. It now returns all the inherited tags in addition to the +local tags. In order to get the old behaviour back, you can use: + +: (org-get-tags nil t) + +*** Alphabetic sorting in tables and lists + +When sorting alphabetically, ~org-table-sort-lines~ and ~org-sort-list~ +now sort according to the locale’s collation rules instead of by +code-point. + +*** Change the name of the :tags clocktable option to :match + +The =:match= (renamed from =:tags=) option allows to limit clock entries +to those matching a todo-tags matcher. + +The old =:tags= option can be set to =t= to display a headline's tags in a +dedicated column. + +This is consistent with the naming of =org-dblock-write:columnview= +options, where =:match= is also used as a headlines filter. + +** New features +*** Add ~:results link~ support for Babel + +With this output format, create a link to the file specified in +~:file~ header argument, without actually writing any result to it: + +#+begin_example +,#+begin_src shell :dir "data/tmp" :results link :file "crackzor_1.0.c.gz" +wget -c "http://ben.akrin.com/crackzor/crackzor_1.0.c.gz" +,#+end_src + +,#+results: +[[file:data/tmp/crackzor_1.0.c.gz]] +#+end_example + +*** Add ~:session~ support of ob-js for js-comint +#+begin_src js :session "*Javascript REPL*" +console.log("stardiviner") +#+end_src +*** Add ~:session~ support of ob-js for Indium +#+begin_src js :session "*JS REPL*" +console.log("stardiviner") +#+end_src +*** Add ~:session~ support of ob-js for skewer-mode +#+begin_src js :session "*skewer-repl*" +console.log("stardiviner") +#+end_src +*** Add support for links to LaTeX equations in HTML export +Use MathJax links when enabled (by ~org-html-with-latex~), otherwise +add a label to the rendered equation. +*** Org Tempo may used for snippet expansion of structure template. +See manual and the commentary section in ~org-tempo.el~ for details. +*** Exclude unnumbered headlines from table of contents +Set their =UNNUMBERED= property to the special =notoc= value. See +manual for details. +*** ~org-archive~ functions update status cookies + +Archiving headers through ~org-archive-subtree~ and +~org-archive-to-archive-sibling~ such as the ones listed below: + +#+BEGIN_SRC org + ,* Top [1/2] + ,** DONE Completed + ,** TODO Working +#+END_SRC + +Will update the status cookie in the top level header. + +*** Disable =org-agenda-overriding-header= by setting to empty string + +The ~org-agenda-overriding-header~ inserted into agenda views can now +be disabled by setting it to an empty string. + +*** Dynamically narrow table columns + +With ~C-c TAB~, it is now possible to narrow a column to the width +specified by a width cookie in the column, or to 1 character if there +is no such cookie. The same keybinding expands a narrowed column to +its previous state. + +Editing the column automatically expands the whole column to its full +size. + +*** =org-columns-summary-types= entries can take an optional COLLECT function + +You can use this to make collection of a property from an entry +conditional on another entry. E.g. given this configuration: + +#+BEGIN_SRC emacs-lisp + (defun custom/org-collect-confirmed (property) + "Return `PROPERTY' for `CONFIRMED' entries" + (let ((prop (org-entry-get nil property)) + (confirmed (org-entry-get nil "CONFIRMED"))) + (if (and prop (string= "[X]" confirmed)) + prop + "0"))) + + (setq org-columns-summary-types + '(("X+" org-columns--summary-sum + custom/org-collect-confirmed))) +#+END_SRC + +You can have a file =bananas.org= containing: + +#+BEGIN_SRC org + ,#+columns: %ITEM %CONFIRMED %Bananas{+} %Bananas(Confirmed Bananas){X+} + + ,* All shipments + ,** Shipment 1 + :PROPERTIES: + :CONFIRMED: [X] + :Bananas: 4 + :END: + + ,** Shipment 2 + :PROPERTIES: + :CONFIRMED: [ ] + :BANANAS: 7 + :END: +#+END_SRC + +... and when going to the top of that file and entering column view +you should expect to see something like: + +| ITEM | CONFIRMED | Bananas | Confirmed Bananas | +|---------------+-----------+---------+-------------------| +| All shipments | | 11 | 4 | +| Shipment 1 | [X] | 4 | 4 | +| Shipment 2 | [ ] | 7 | 7 | + +#+BEGIN_EXAMPLE + ,#+STARTUP: shrink +#+END_EXAMPLE +*** Allow to filter by tags/property when capturing colview + +You can now use =:match= to filter entries using a todo/tags/properties +matcher. + +*** Add support for Oracle's database alias in Babel blocks +=ob-sql= library already support running SQL blocks against an Oracle +database using ~sqlplus~. Now it's possible to use alias names +defined in =TNSNAMES= file instead of specifying full connection +parameters. See example bellow. + +#+BEGIN_SRC org + you can use the previous full connection parameters + ,#+BEGIN_SRC sql :engine oracle :dbuser me :dbpassword my_insecure_password :database my_db_name :dbhost my_db_host :dbport 1521 + select sysdate from dual; + ,#+END_SRC + + or the alias defined in your TNSNAMES file + ,#+BEGIN_SRC sql :engine oracle :dbuser me :dbpassword my_insecure_password :database my_tns_alias + select sysdate from dual; + ,#+END_SRC +#+END_SRC + +*** ~org-agenda-set-restriction-lock~ toggle agenda restriction at point + +You can set an agenda restriction lock with =C-x C-x <= or with =<= at the +beginning of a headline when using Org speed commands. Now, if there +is already a restriction at point, hitting =<= again (or =C-x C-x <=) will +remove it. + +** New commands and functions + +*** ~org-insert-structure-template~ + +This function can be used to wrap existing text of Org elements in +a #+BEGIN_FOO/#+END_FOO block. Bound to C-c C-x w by default. + +*** ~org-export-excluded-from-toc-p~ + +See docstring for details. + +*** ~org-timestamp-to-time~ +*** ~org-timestamp-from-string~ +*** ~org-timestamp-from-time~ +*** ~org-attach-dired-to-subtree~ + +See docstring for details. + +*** ~org-toggle-narrow-to-subtree~ + +Toggle the narrowing state of the buffer: when in a narrowed state, +widen, otherwise call ~org-narrow-to-subtree~ to narrow. + +This is attached to the "s" speed command, so that hitting "s" twice +will go back to the widen state. + +*** ~org-browse-news~ + +Browse https://orgmode.org/Changes.html to let users read informations +about the last major release. + +There is a new menu entry for this in the "Documentation" menu item. + +*** ~org-info-find-node~ + +From an Org file or an agenda switch to a suitable info page depending +on the context. + +The function is bound to =C-c C-x I=. + +** Removed commands and functions +*** ~org-outline-overlay-data~ +Use ~org-save-outline-visibility~ instead. +*** ~org-set-outline-overlay-data~ +Use ~org-save-outline-visibility~ instead. +*** ~org-get-string-indentation~ +It was not used throughout the code base. +*** ~org-fix-indentation~ +It was not used throughout code base. +*** ~org-context-p~ +Use ~org-element-at-point~ instead. +*** ~org-preserve-lc~ +It is no longer used in the code base. +*** ~org-try-structure-completion~ +Org Tempo may be used as a replacement. See details above. +** Removed options + +*** org-babel-use-quick-and-dirty-noweb-expansion + +See [[*Change to Noweb expansion][Change to Noweb expansion]] for explanations. + +** Miscellaneous + +*** New default value for ~org-texinfo-table-scientific-notation~ + +It is now nil, which means numbers in scientific notation are not +handled specially by default. + +*** New default value for ~org-latex-table-scientific-notation~ + +It is now nil, which means numbers in scientific notation are not +handled specially by default. + +*** New face: ~org-upcoming-distant-deadline~ + +It is meant to be used as the face for distant deadlines, see +~org-agenda-deadline-faces~ + +*** ~org-paste-subtree~ no longer breaks sections + +Unless point is at the beginning of a headline, ~org-paste-subtree~ +now pastes the tree before the next visible headline. If you need to +break the section, use ~org-yank~ instead. + +*** ~org-table-insert-column~ inserts a column to the right + +It used to insert it on the left. With this change, +~org-table-insert-column~ and ~org-table-delete-column~ are +reciprocal. + +*** ~org-publish-resolve-external-link~ accepts a new optional argument. +*** ~org-irc.el~ now supports exporting =irc:= links properly + +Previously, irc links were exported by ~ox-md~ and ~ox-html~ as normal +file links, which lead to them being broken in web browsers. Now both +of these exporters will properly export to =irc:= links, which will +open properly in irc clients from web browsers. + +*** ~org-comment-dwim~ (bound to =M-;=) now comments headings, if point is on a heading +*** Add support for open source block in window below + +Set option ~org-src-window-setup~ to ~split-window-below~. + +*** Alphabetic sorting in headings and tags now uses the locale’s sorting rules + +When sorting alphabetically, ~org-sort-entries~ and +~org-tags-sort-function~ now sort according to the locale’s collation +rules instead of by code-point. +*** New speed command "k" to kill (cut) the subtree at point * Version 9.1 ** Incompatible changes @@ -137,7 +550,6 @@ See docstring for details. =org-agenda-tags-column= can now be set to =auto=, which will automatically align tags to the right edge of the window. This is now the default setting. - *** New value for ~org-publish-sitemap-sort-folders~ The new ~ignore~ value effectively allows toggling inclusion of @@ -148,7 +560,7 @@ directories in published site-maps. **** Scheme: support for tables **** Scheme: new variable: ~org-babel-scheme-null-to~ -This new custom option allows to use a empty list or null symbol to +This new custom option allows you to use an empty list or null symbol to format the table output, initially assigned to ~hlines~. **** Scheme: new header ~:prologue~ @@ -204,15 +616,15 @@ value of the code will be displayed in the results section. **** Maxima: new headers ~:prologue~ and ~:epilogue~ Babel options ~:prologue~ and ~:epilogue~ have been implemented for -Maxima src blocks which prepend and append, respectively, the given +Maxima source blocks which prepend and append, respectively, the given code strings. This can be useful for specifying formatting settings which would add clutter to exported code. For instance, you can use this ~:prologue "fpprintprec: 2; linel: 50;"~ for presenting Maxima results in a beamer presentation. **** PlantUML: add support for header arguments -[[http://plantuml.com/][Plantuml]] source blocks now support the [[http://orgmode.org/manual/prologue.html#prologue][~:prologue~]], [[http://orgmode.org/manual/epilogue.html#epilogue][~:epilogue~]] and -[[http://orgmode.org/manual/var.html#var][~:var~]] header arguments. +[[http://plantuml.com/][Plantuml]] source blocks now support the [[https://orgmode.org/manual/prologue.html#prologue][~:prologue~]], [[https://orgmode.org/manual/epilogue.html#epilogue][~:epilogue~]] and +[[https://orgmode.org/manual/var.html#var][~:var~]] header arguments. **** SQL: new engine added ~sqsh~ @@ -266,7 +678,7 @@ using ~:namespaces~: - ~:flags~ passes arguments to the compiler - ~:cmdline~ passes commandline arguments to the generated executable -Support for [[http://orgmode.org/manual/var.html#var][~:var~]] does not exist yet, also there is no [[http://orgmode.org/manual/session.html#session][~:session~]] +Support for [[https://orgmode.org/manual/var.html#var][~:var~]] does not exist yet, also there is no [[https://orgmode.org/manual/session.html#session][~:session~]] support because Vala is a compiled language. The Vala compiler binary can be changed via the ~defcustom~ @@ -436,9 +848,9 @@ Call ~org-agenda-set-restriction-lock~ from the agenda. The library-of-babel.org used to be accessible from the =doc/= directory, distributed with Org’s core. It is now accessible -from the Worg community-driven documentation [[http://orgmode.org/worg/library-of-babel.html][here]]. +from the Worg community-driven documentation [[https://orgmode.org/worg/library-of-babel.html][here]]. -If you want to contribute to it, please see [[http://orgmode.org/worg/org-contribute.html][how to contribute]]. +If you want to contribute to it, please see [[https://orgmode.org/worg/org-contribute.html][how to contribute]]. *** Allow multiple columns view @@ -486,15 +898,12 @@ is now obsolete. Now ~=...=~ markup uses ~@samp{}~ instead of ~@verb{}~. You can use ~@verb{}~ again by customizing the variable. *** Texinfo exports example blocks as ~@example~ -*** Texinfo exports inline src blocks as ~@code{}~ +*** Texinfo exports inline source blocks as ~@code{}~ *** Texinfo default table markup is ~@asis~ It used to be ~@samp~ but ~@asis~ is neutral and, therefore, more suitable as a default value. *** Texinfo default process includes ~--no-split~ option *** New entities : ~\dollar~ and ~\USD~ -*** ~org-parse-time-string~ accepts a new optional argument -=ZONE= specifies the current time zone. -*** ~org-time-string-to-seconds~ now accepts an optional =ZONE= argument *** Support for date style URLs in =org-protocol://open-source= URLs like =https://cool-blog.com/2017/05/20/cool-post/= are covered by rewrite rules. @@ -801,7 +1210,7 @@ Evaluating a Stan block can produce two different results. that does not end in ".stan". For more information and usage examples, visit -http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-stan.html +https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-stan.html **** Support for Oracle databases via ~sqlplus~ @@ -1306,9 +1715,9 @@ docstring for more information. ** New features -*** Default lexical evaluation of emacs-lisp src blocks +*** Default lexical evaluation of emacs-lisp source blocks -Emacs-lisp src blocks in babel are now evaluated using lexical +Emacs-lisp source blocks in Babel are now evaluated using lexical scoping. There is a new header to control this behavior. The default results in an eval with lexical scoping. @@ -1361,7 +1770,7 @@ don't have to be distinct on a heading. Grouptags had to previously be defined with { }. This syntax is already used for exclusive tags and Grouptags need their own, -non-exclusive syntax. This behaviour is achieved with [ ]. Note: { } +non-exclusive syntax. This behavior is achieved with [ ]. Note: { } can still be used also for Grouptags but then only one of the given tags can be used on the headline at the same time. Example: @@ -1425,9 +1834,9 @@ Check the documentation for more details. Thanks to Jarmo Hurri for this feature. -*** New behaviour for ~org-toggle-latex-fragment~ +*** New behavior for ~org-toggle-latex-fragment~ -The new behaviour is the following: +The new behavior is the following: - With a double prefix argument or with a single prefix argument when point is before the first headline, toggle overlays in the whole @@ -1626,10 +2035,10 @@ leading spaces within table cells. Org uses the MathJax CDN by default. See the manual and the docstring of ~org-html-mathjax-options~ for details. -*** New behaviour in `org-export-options-alist' +*** New behavior in `org-export-options-alist' When defining a back-end, it is now possible to specify to give -`parse' behaviour on a keyword. It is equivalent to call +`parse' behavior on a keyword. It is equivalent to call `org-element-parse-secondary-string' on the value. However, parsed =KEYWORD= is automatically associated to an @@ -1748,7 +2157,7 @@ everywhere in the buffer, possibly corrupting URLs. *** Removed option =org-babel-sh-command= This undocumented option defaulted to the value of =shell-file-name= at -the time of loading =ob-shell=. The new behaviour is to use the value +the time of loading =ob-shell=. The new behavior is to use the value of =shell-file-name= directly when the shell langage is =shell=. To chose a different shell, either customize =shell-file-name= or bind this variable locally. @@ -1969,7 +2378,7 @@ This allows to specify the names of automatic bookmarks. *** New option [[doc:org-agenda-ignore-drawer-properties][org-agenda-ignore-drawer-properties]] This allows more flexibility when optimizing the agenda generation. -See http://orgmode.org/worg/agenda-optimization.html for details. +See https://orgmode.org/worg/agenda-optimization.html for details. *** New option: [[doc:org-html-link-use-abs-url][org-html-link-use-abs-url]] to force using absolute URLs This is an export/publishing option, and should be used either within @@ -1992,7 +2401,7 @@ This enables SVG generation from latex code blocks. *** New option: [[doc:org-habit-show-done-always-green][org-habit-show-done-always-green]] -See [[https://lists.gnu.org/archive/html/emacs-orgmode/2013-05/msg00214.html][this message]] from Max Mikhanosha. +See [[https://lists.gnu.org/r/emacs-orgmode/2013-05/msg00214.html][this message]] from Max Mikhanosha. *** New option: [[doc:org-babel-inline-result-wrap][org-babel-inline-result-wrap]] @@ -2053,7 +2462,7 @@ instructions: When in doubt, run =M-x org-version RET= and see if you have a mixed-up installation. -See http://orgmode.org/org.html#Installation for details. +See https://orgmode.org/org.html#Installation for details. ** Incompatible changes @@ -2066,7 +2475,7 @@ you will have to update them. Below is a list of changes for which you need to take action. -See http://orgmode.org/worg/org-8.0.html for the most recent version of +See https://orgmode.org/worg/org-8.0.html for the most recent version of this list and for detailed instructions on how to migrate. **** New export engine @@ -2088,7 +2497,7 @@ corresponding files start with the =ox-= prefix. If you customized an export back-end (like HTML or LaTeX), you will need to rename some options so that your customization is not lost. Typically, an option starting with =org-export-html-= is now named =org-html-=. See the -manual for details and check [[http://orgmode.org/worg/org-8.0.html][this Worg page]] for directions. +manual for details and check [[https://orgmode.org/worg/org-8.0.html][this Worg page]] for directions. **** New syntax for #+ATTR_HTML/LaTeX/... options @@ -2149,7 +2558,7 @@ manual for details and check [[http://orgmode.org/worg/org-8.0.html][this Worg p ~ox-taskjuggler.el~ by Nicolas Goaziou and others. Also, the Taskjuggler exporter now uses TJ3 by default. John Hendy - wrote [[http://orgmode.org/worg/org-tutorials/org-taskjuggler3.html][a tutorial on Worg]] for the TJ3 export. + wrote [[https://orgmode.org/worg/org-tutorials/org-taskjuggler3.html][a tutorial on Worg]] for the TJ3 export. ** New packages in core @@ -2195,7 +2604,7 @@ manual for details and check [[http://orgmode.org/worg/org-8.0.html][this Worg p Display bullets instead of stars for headlines. - Also see [[http://orgmode.org/worg/org-faq.html#sec-8-12][this updated FAQ]] on how to display another character than "*" + Also see [[https://orgmode.org/worg/org-faq.html#sec-8-12][this updated FAQ]] on how to display another character than "*" for starting headlines. *** ~org-favtable.el~ by Marc-Oliver Ihm @@ -2203,7 +2612,7 @@ manual for details and check [[http://orgmode.org/worg/org-8.0.html][this Worg p ~org-favtable.el~ helps you to create and update a table of favorite locations in org, keeping the most frequently visited lines right at the top. This table is called "favtable". See the documentation on - [[http://orgmode.org/worg/org-contrib/org-favtable.html][Worg]]. + [[https://orgmode.org/worg/org-contrib/org-favtable.html][Worg]]. *** ~ox-confluence.el~ by Sébastien Delafond @@ -2244,7 +2653,7 @@ manual for details and check [[http://orgmode.org/worg/org-8.0.html][this Worg p **** New export generic options -If you use Org exporter, we advise you to re-read [[http://orgmode.org/org.html#Exporting][the manual section about +If you use Org exporter, we advise you to re-read [[https://orgmode.org/org.html#Exporting][the manual section about it]]. It has been updated and includes new options. Among the new/updated export options, three are of particular importance: @@ -2619,7 +3028,7 @@ of those tags.) You can use group tags for sparse tree in an Org buffer, for creating agenda views, and for filtering. -See http://orgmode.org/org.html#Tag-groups for details. +See https://orgmode.org/org.html#Tag-groups for details. *** Links @@ -2627,7 +3036,7 @@ See http://orgmode.org/org.html#Tag-groups for details. Org knows how to store links from Org buffers, from info files and from other Emacs buffers. Org can be taught how to store links from any buffer -through new link protocols (see [[http://orgmode.org/org.html#Adding-hyperlink-types]["Adding hyperlink types"]] in the manual.) +through new link protocols (see [[https://orgmode.org/org.html#Adding-hyperlink-types]["Adding hyperlink types"]] in the manual.) Sometimes you want Org to ignore added link protocols and store the link as if the protocol was not known. @@ -2651,7 +3060,7 @@ with-description and without-description links when inserting them. When storing a link to a headline like -: * See [[http://orgmode.org][Org website]] +: * See [[https://orgmode.org][Org website]] [[doc:org-store-link][org-store-link]] used to convert the square brackets into curly brackets. It does not anymore, taking the link description or the link path, when @@ -2667,7 +3076,7 @@ those other formulas. **** You now use "nan" for empty fields in Calc formulas If empty fields are of interest, it is recommended to reread the section -[[http://orgmode.org/org.html#Formula-syntax-for-Calc][3.5.2 Formula syntax for Calc]] of the manual because the description for the +[[https://orgmode.org/org.html#Formula-syntax-for-Calc][3.5.2 Formula syntax for Calc]] of the manual because the description for the mode strings has been clarified and new examples have been added towards the end. @@ -2686,7 +3095,7 @@ There are now three lookup functions: - [[doc:org-loopup-last][org-loopup-last]] - [[doc:org-loopup-all][org-loopup-all]] -See [[http://orgmode.org/org.html#Lookup-functions][the manual]] for details. +See [[https://orgmode.org/org.html#Lookup-functions][the manual]] for details. *** Startup keywords These new startup keywords are now available: @@ -2817,7 +3226,7 @@ instead of requiring each Babel library one by one. David (and others) translated the Org compact guide in spanish: -You can read the [[http://orgmode.org/worg/orgguide/orgguide.es.pdf][PDF guide]]. +You can read the [[https://orgmode.org/worg/orgguide/orgguide.es.pdf][PDF guide]]. *** ~poporg.el~ and ~outorg.el~ @@ -2828,7 +3237,7 @@ Org-mode available. ~outorg.el~ comes together with ~outshine.el~ and ~navi-mode.el~, two more libraries by Thorsten Jolitz with the goal to give source-code buffers the /look & feel/ of Org-mode buffers while greatly improving navigation and structure editing. A detailed description can be -found here: http://orgmode.org/worg/org-tutorials/org-outside-org.html +found here: https://orgmode.org/worg/org-tutorials/org-outside-org.html Here are two screencasts demonstrating Thorsten's tools: @@ -2897,7 +3306,7 @@ in most environments. You can now add the Org ELPA repository like this: #+BEGIN_SRC emacs-lisp -(add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/") t) +(add-to-list 'package-archives '("org" . "https://orgmode.org/elpa/") t) #+END_SRC It contains both the =org-*.tar= package (the core Org distribution, also @@ -2905,7 +3314,7 @@ available through https://elpa.gnu.org) and the =org-plus*.tar= package (the extended Org distribution, with non-GNU packages from the =contrib/= directory.) -See http://orgmode.org/elpa/ +See https://orgmode.org/elpa/ ** Overview of the new keybindings @@ -2921,7 +3330,7 @@ See http://orgmode.org/elpa/ | =C-c C-x E= | =E= | [[doc::org-inc-effort][org-inc-effort]] | | | =#= | [[doc::org-toggle-comment][org-toggle-comment]] | | | =:= | [[doc::org-columns][org-columns]] | - | | =W= | Set =APPT_WARNTIME= | + | | =W= | Set =APPT_WARNTIME= | | =k= | | [[doc::org-agenda-capture][org-agenda-capture]] | | C-c , | , | [[doc::org-priority][org-priority]] | @@ -3088,7 +3497,7 @@ See http://orgmode.org/elpa/ **** New =todo-unblocked= and =nottodo-unblocked= skip conditions - See the [[http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=f426da][git commit]] for more explanations. + See the [[https://orgmode.org/cgit.cgi/org-mode.git/commit/?id=f426da][git commit]] for more explanations. **** Allow category filtering in the agenda @@ -3405,7 +3814,7 @@ See http://orgmode.org/elpa/ Thanks to Carsten for implementing this. **** ODT: Add support for ODT export in org-bbdb.el -**** ODT: Add support for indented tables (see [[http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=e9fd33][this commit]] for details) +**** ODT: Add support for indented tables (see [[https://orgmode.org/cgit.cgi/org-mode.git/commit/?id=e9fd33][this commit]] for details) **** ODT: Improve the conversion from ODT to other formats **** ASCII: Swap the level-1/level-2 characters to underline the headlines **** Support for Chinese, simplified Chinese, Russian, Ukrainian and Japanese @@ -3538,7 +3947,7 @@ that Calc formulas can operate on them. *** Emacs 21 support has been dropped - Do not use Org mode 7.xx with Emacs 21, use [[http://orgmode.org/org-6.36c.zip][version 6.36c]] instead. + Do not use Org mode 7.xx with Emacs 21, use [[https://orgmode.org/org-6.36c.zip][version 6.36c]] instead. *** XEmacs support requires the XEmacs development version @@ -3688,7 +4097,7 @@ that Calc formulas can operate on them. This replaces the earlier system org-remember. The manual only describes org-capture, but for people who prefer to continue to use org-remember, we keep a static copy of the former manual - section [[http://orgmode.org/org-remember.pdf][chapter about remember]]. + section [[https://orgmode.org/org-remember.pdf][chapter about remember]]. The new system has a technically cleaner implementation and more possibilities for capturing different types of data. See @@ -3752,7 +4161,7 @@ that Calc formulas can operate on them. **** org-taskjuggler.el (Christian Egli) Christian Egli's /org-taskjuggler.el/ module is now part of Org. - He also wrote a [[http://orgmode.org/worg/org-tutorials/org-taskjuggler.php][tutorial]] for it. + He also wrote a [[https://orgmode.org/worg/org-tutorials/org-taskjuggler.php][tutorial]] for it. **** org-ctags.el (Paul Sexton) @@ -3972,7 +4381,7 @@ that Calc formulas can operate on them. Org-mode documents or subtrees can now be converted directly in to BEAMER presentation. Turning a tree into a simple presentations is straight forward, and there is also quite some - support to make richer presentations as well. See the [[http://orgmode.org/manual/Beamer-class-export.html#Beamer-class-export][BEAMER + support to make richer presentations as well. See the [[https://orgmode.org/manual/Beamer-class-export.html#Beamer-class-export][BEAMER section]] in the manual for more details. Thanks to everyone who has contributed to the discussion about diff --git a/elpa/org-20171030/etc/styles/OrgOdtContentTemplate.xml b/elpa/org-20190930/etc/styles/OrgOdtContentTemplate.xml similarity index 100% rename from elpa/org-20171030/etc/styles/OrgOdtContentTemplate.xml rename to elpa/org-20190930/etc/styles/OrgOdtContentTemplate.xml diff --git a/elpa/org-20171030/etc/styles/OrgOdtStyles.xml b/elpa/org-20190930/etc/styles/OrgOdtStyles.xml similarity index 100% rename from elpa/org-20171030/etc/styles/OrgOdtStyles.xml rename to elpa/org-20190930/etc/styles/OrgOdtStyles.xml diff --git a/elpa/org-20171030/etc/styles/README b/elpa/org-20190930/etc/styles/README similarity index 93% rename from elpa/org-20171030/etc/styles/README rename to elpa/org-20190930/etc/styles/README index 9d11c07b..496ccb05 100644 --- a/elpa/org-20171030/etc/styles/README +++ b/elpa/org-20190930/etc/styles/README @@ -1,7 +1,7 @@ The files OrgOdtContentTemplate.xml and OrgOdtStyles.xml have the following copyright information: -Copyright (C) 2010-2017 Free Software Foundation, Inc. +Copyright (C) 2010-2019 Free Software Foundation, Inc. These files are part of GNU Emacs. @@ -21,7 +21,7 @@ along with GNU Emacs. If not, see . Author: Jambunathan K Keywords: outlines, hypermedia, calendar, wp -Homepage: http://orgmode.org +Homepage: https://orgmode.org Commentary: diff --git a/elpa/org-20171030/ob-C.el b/elpa/org-20190930/ob-C.el similarity index 97% rename from elpa/org-20171030/ob-C.el rename to elpa/org-20190930/ob-C.el index 78528a88..8cab9672 100644 --- a/elpa/org-20171030/ob-C.el +++ b/elpa/org-20190930/ob-C.el @@ -1,11 +1,11 @@ ;;; ob-C.el --- Babel Functions for C and Similar Languages -*- lexical-binding: t; -*- -;; Copyright (C) 2010-2017 Free Software Foundation, Inc. +;; Copyright (C) 2010-2019 Free Software Foundation, Inc. ;; 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. @@ -34,11 +34,9 @@ (require 'cc-mode) (require 'ob) - +(require 'org-macs) (declare-function org-entry-get "org" (pom property &optional inherit literal-nil)) -(declare-function org-remove-indentation "org" (code &optional n)) -(declare-function org-trim "org" (s &optional keep-lead)) (defvar org-babel-tangle-lang-exts) (add-to-list 'org-babel-tangle-lang-exts '("C++" . "cpp")) @@ -299,12 +297,12 @@ its header arguments." (defun org-babel-prep-session:C (_session _params) "This function does nothing as C is a compiled language with no -support for sessions" +support for sessions." (error "C is a compiled language -- no support for sessions")) (defun org-babel-load-session:C (_session _body _params) "This function does nothing as C is a compiled language with no -support for sessions" +support for sessions." (error "C is a compiled language -- no support for sessions")) ;; helper functions @@ -375,8 +373,8 @@ FORMAT can be either a format string or a function which is called with VAL." (pcase (org-babel-C-val-to-base-type v) (`stringp (setq type 'stringp)) (`floatp - (if (or (not type) (eq type 'integerp)) - (setq type 'floatp))) + (when (or (not type) (eq type 'integerp)) + (setq type 'floatp))) (`integerp (unless type (setq type 'integerp))))) val) diff --git a/elpa/org-20171030/ob-J.el b/elpa/org-20190930/ob-J.el similarity index 96% rename from elpa/org-20171030/ob-J.el rename to elpa/org-20190930/ob-J.el index eaccac81..b48562d2 100644 --- a/elpa/org-20171030/ob-J.el +++ b/elpa/org-20190930/ob-J.el @@ -1,10 +1,10 @@ ;;; ob-J.el --- Babel Functions for J -*- lexical-binding: t; -*- -;; Copyright (C) 2011-2017 Free Software Foundation, Inc. +;; Copyright (C) 2011-2019 Free Software Foundation, Inc. ;; Author: Oleh Krehel ;; Keywords: literate programming, reproducible research -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; This file is part of GNU Emacs. @@ -31,8 +31,8 @@ ;;; Code: (require 'ob) +(require 'org-macs) -(declare-function org-trim "org" (s &optional keep-lead)) (declare-function j-console-ensure-session "ext:j-console" ()) (defcustom org-babel-J-command "jconsole" @@ -72,7 +72,7 @@ PROCESSED-PARAMS isn't used yet." (defun org-babel-execute:J (body params) "Execute a block of J code BODY. PARAMS are given by org-babel. -This function is called by `org-babel-execute-src-block'" +This function is called by `org-babel-execute-src-block'." (message "executing J source code block") (let* ((processed-params (org-babel-process-params params)) (sessionp (cdr (assq :session params))) diff --git a/elpa/org-20171030/ob-R.el b/elpa/org-20190930/ob-R.el similarity index 99% rename from elpa/org-20171030/ob-R.el rename to elpa/org-20190930/ob-R.el index 6781fb30..9e738a8a 100644 --- a/elpa/org-20171030/ob-R.el +++ b/elpa/org-20190930/ob-R.el @@ -1,11 +1,11 @@ ;;; ob-R.el --- Babel Functions for R -*- lexical-binding: t; -*- -;; Copyright (C) 2009-2017 Free Software Foundation, Inc. +;; Copyright (C) 2009-2019 Free Software Foundation, Inc. ;; Author: Eric Schulte ;; Dan Davison ;; Keywords: literate programming, reproducible research, R, statistics -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; This file is part of GNU Emacs. diff --git a/elpa/org-20171030/ob-abc.el b/elpa/org-20190930/ob-abc.el similarity index 95% rename from elpa/org-20171030/ob-abc.el rename to elpa/org-20190930/ob-abc.el index 693c5d8f..43ee1d99 100644 --- a/elpa/org-20171030/ob-abc.el +++ b/elpa/org-20190930/ob-abc.el @@ -1,6 +1,6 @@ ;;; ob-abc.el --- Org Babel Functions for ABC -*- lexical-binding: t; -*- -;; Copyright (C) 2013-2017 Free Software Foundation, Inc. +;; Copyright (C) 2013-2019 Free Software Foundation, Inc. ;; Author: William Waites ;; Keywords: literate programming, music @@ -47,7 +47,7 @@ (value (cdr pair))) (setq body (replace-regexp-in-string - (concat "\$" (regexp-quote name)) + (concat "\\$" (regexp-quote name)) (if (stringp value) value (format "%S" value)) body)))) vars) @@ -59,7 +59,7 @@ (message "executing Abc source code block") (let* ((cmdline (cdr (assq :cmdline params))) (out-file (let ((file (cdr (assq :file params)))) - (if file (replace-regexp-in-string "\.pdf$" ".ps" file) + (if file (replace-regexp-in-string "\\.pdf$" ".ps" file) (error "abc code block requires :file header argument")))) (in-file (org-babel-temp-file "abc-")) (render (concat "abcm2ps" " " cmdline diff --git a/elpa/org-20171030/ob-asymptote.el b/elpa/org-20190930/ob-asymptote.el similarity index 97% rename from elpa/org-20171030/ob-asymptote.el rename to elpa/org-20190930/ob-asymptote.el index 819273ae..3fc0cebd 100644 --- a/elpa/org-20171030/ob-asymptote.el +++ b/elpa/org-20190930/ob-asymptote.el @@ -1,10 +1,10 @@ ;;; ob-asymptote.el --- Babel Functions for Asymptote -*- lexical-binding: t; -*- -;; Copyright (C) 2009-2017 Free Software Foundation, Inc. +;; Copyright (C) 2009-2019 Free Software Foundation, Inc. ;; Author: Eric Schulte ;; Keywords: literate programming, reproducible research -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; This file is part of GNU Emacs. @@ -77,7 +77,7 @@ This function is called by `org-babel-execute-src-block'." (defun org-babel-prep-session:asymptote (_session _params) "Return an error if the :session header argument is set. -Asymptote does not support sessions" +Asymptote does not support sessions." (error "Asymptote does not support sessions")) (defun org-babel-variable-assignments:asymptote (params) diff --git a/elpa/org-20171030/ob-awk.el b/elpa/org-20190930/ob-awk.el similarity index 94% rename from elpa/org-20171030/ob-awk.el rename to elpa/org-20190930/ob-awk.el index e2eec9bf..0d5f47d5 100644 --- a/elpa/org-20171030/ob-awk.el +++ b/elpa/org-20190930/ob-awk.el @@ -1,10 +1,10 @@ ;;; ob-awk.el --- Babel Functions for Awk -*- lexical-binding: t; -*- -;; Copyright (C) 2011-2017 Free Software Foundation, Inc. +;; Copyright (C) 2011-2019 Free Software Foundation, Inc. ;; Author: Eric Schulte ;; Keywords: literate programming, reproducible research -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; This file is part of GNU Emacs. @@ -48,8 +48,8 @@ body) (defun org-babel-execute:awk (body params) - "Execute a block of Awk code with org-babel. This function is -called by `org-babel-execute-src-block'" + "Execute a block of Awk code with org-babel. +This function is called by `org-babel-execute-src-block'." (message "executing Awk source code block") (let* ((result-params (cdr (assq :result-params params))) (cmd-line (cdr (assq :cmd-line params))) diff --git a/elpa/org-20171030/ob-calc.el b/elpa/org-20190930/ob-calc.el similarity index 94% rename from elpa/org-20171030/ob-calc.el rename to elpa/org-20190930/ob-calc.el index 76d36cf7..d888f988 100644 --- a/elpa/org-20171030/ob-calc.el +++ b/elpa/org-20190930/ob-calc.el @@ -1,10 +1,10 @@ ;;; ob-calc.el --- Babel Functions for Calc -*- lexical-binding: t; -*- -;; Copyright (C) 2010-2017 Free Software Foundation, Inc. +;; Copyright (C) 2010-2019 Free Software Foundation, Inc. ;; Author: Eric Schulte ;; Keywords: literate programming, reproducible research -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; This file is part of GNU Emacs. @@ -27,6 +27,7 @@ ;;; Code: (require 'ob) +(require 'org-macs) (require 'calc) (require 'calc-trail) (require 'calc-store) @@ -34,10 +35,9 @@ (declare-function calc-store-into "calc-store" (&optional var)) (declare-function calc-recall "calc-store" (&optional var)) (declare-function math-evaluate-expr "calc-ext" (x)) -(declare-function org-trim "org" (s &optional keep-lead)) (defvar org-babel-default-header-args:calc nil - "Default arguments for evaluating an calc source block.") + "Default arguments for evaluating a calc source block.") (defun org-babel-expand-body:calc (body _params) "Expand BODY according to PARAMS, return the expanded body." body) diff --git a/elpa/org-20171030/ob-clojure.el b/elpa/org-20190930/ob-clojure.el similarity index 80% rename from elpa/org-20171030/ob-clojure.el rename to elpa/org-20190930/ob-clojure.el index b49bfe58..6407a674 100644 --- a/elpa/org-20171030/ob-clojure.el +++ b/elpa/org-20190930/ob-clojure.el @@ -1,11 +1,11 @@ ;;; ob-clojure.el --- Babel Functions for Clojure -*- lexical-binding: t; -*- -;; Copyright (C) 2009-2017 Free Software Foundation, Inc. +;; Copyright (C) 2009-2019 Free Software Foundation, Inc. ;; 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. @@ -41,20 +41,19 @@ ;;; Code: (require 'cl-lib) (require 'ob) +(require 'org-macs) (declare-function cider-current-connection "ext:cider-client" (&optional type)) (declare-function cider-current-ns "ext:cider-client" ()) (declare-function nrepl--merge "ext:nrepl-client" (dict1 dict2)) (declare-function nrepl-dict-get "ext:nrepl-client" (dict key)) (declare-function nrepl-dict-put "ext:nrepl-client" (dict key value)) -(declare-function nrepl-request:eval "ext:nrepl-client" - (input callback connection &optional session ns line column additional-params)) -(declare-function nrepl-sync-request:eval "ext:nrepl-client" - (input connection session &optional ns)) -(declare-function org-trim "org" (s &optional keep-lead)) +(declare-function nrepl-request:eval "ext:nrepl-client" (input callback connection &optional ns line column additional-params tooling)) +(declare-function nrepl-sync-request:eval "ext:nrepl-client" (input connection &optional ns tooling)) (declare-function slime-eval "ext:slime" (sexp &optional package)) (defvar nrepl-sync-request-timeout) +(defvar cider-buffer-ns) (defvar org-babel-tangle-lang-exts) (add-to-list 'org-babel-tangle-lang-exts '("clojure" . "clj")) @@ -80,19 +79,40 @@ If the value is nil, timeout is disabled." (const :tag "cider" cider) (const :tag "SLIME" slime))) +(defcustom org-babel-clojure-default-ns "user" + "Default Clojure namespace for source block when finding ns failed." + :type 'string + :group 'org-babel) + +(defun org-babel-clojure-cider-current-ns () + "Like `cider-current-ns' except `cider-find-ns'." + (or cider-buffer-ns + (let ((repl-buf (cider-current-connection))) + (and repl-buf (buffer-local-value 'cider-buffer-ns repl-buf))) + org-babel-clojure-default-ns)) + (defun org-babel-expand-body:clojure (body params) "Expand BODY according to PARAMS, return the expanded body." (let* ((vars (org-babel--get-vars params)) + (ns (or (cdr (assq :ns params)) + (org-babel-clojure-cider-current-ns))) (result-params (cdr (assq :result-params params))) - (print-level nil) (print-length nil) - (body (org-trim - (if (null vars) (org-trim body) - (concat "(let [" - (mapconcat - (lambda (var) - (format "%S (quote %S)" (car var) (cdr var))) - vars "\n ") - "]\n" body ")"))))) + (print-level nil) + (print-length nil) + (body + (org-trim + (format "(ns %s)\n%s" + ;; Source block specified namespace :ns. + ns + ;; Variables binding. + (if (null vars) (org-trim body) + (format "(let [%s]\n%s)" + (mapconcat + (lambda (var) + (format "%S (quote %S)" (car var) (cdr var))) + vars + "\n ") + body)))))) (if (or (member "code" result-params) (member "pp" result-params)) (format "(clojure.pprint/pprint (do %s))" body) @@ -102,9 +122,9 @@ If the value is nil, timeout is disabled." "Execute a block of Clojure code with Babel. The underlying process performed by the code block can be output using the :show-process parameter." - (let ((expanded (org-babel-expand-body:clojure body params)) - (response (list 'dict)) - result) + (let* ((expanded (org-babel-expand-body:clojure body params)) + (response (list 'dict)) + result) (cl-case org-babel-clojure-backend (cider (require 'cider) @@ -117,8 +137,7 @@ using the :show-process parameter." (let ((nrepl-sync-request-timeout org-babel-clojure-sync-nrepl-timeout)) (nrepl-sync-request:eval expanded - (cider-current-connection) - (cider-current-ns)))) + (cider-current-connection)))) (setq result (concat (nrepl-dict-get response @@ -152,8 +171,7 @@ using the :show-process parameter." (nrepl--merge response resp) ;; Update the status of the nREPL output session. (setq status (nrepl-dict-get response "status"))) - (cider-current-connection) - (cider-current-ns)) + (cider-current-connection)) ;; Wait until the nREPL code finished to be processed. (while (not (member "done" status)) diff --git a/elpa/org-20171030/ob-comint.el b/elpa/org-20190930/ob-comint.el similarity index 97% rename from elpa/org-20171030/ob-comint.el rename to elpa/org-20190930/ob-comint.el index 2a1d2743..aa0d341d 100644 --- a/elpa/org-20171030/ob-comint.el +++ b/elpa/org-20190930/ob-comint.el @@ -1,10 +1,10 @@ ;;; ob-comint.el --- Babel Functions for Interaction with Comint Buffers -*- lexical-binding: t; -*- -;; Copyright (C) 2009-2017 Free Software Foundation, Inc. +;; Copyright (C) 2009-2019 Free Software Foundation, Inc. ;; Author: Eric Schulte ;; Keywords: literate programming, reproducible research, comint -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; This file is part of GNU Emacs. @@ -36,7 +36,7 @@ (defun org-babel-comint-buffer-livep (buffer) "Check if BUFFER is a comint buffer with a live process." - (let ((buffer (if buffer (get-buffer buffer)))) + (let ((buffer (when buffer (get-buffer buffer)))) (and buffer (buffer-live-p buffer) (get-buffer-process buffer) buffer))) (defmacro org-babel-comint-in-buffer (buffer &rest body) diff --git a/elpa/org-20171030/ob-coq.el b/elpa/org-20190930/ob-coq.el similarity index 96% rename from elpa/org-20171030/ob-coq.el rename to elpa/org-20190930/ob-coq.el index 76bfc5ad..26682c18 100644 --- a/elpa/org-20171030/ob-coq.el +++ b/elpa/org-20190930/ob-coq.el @@ -1,10 +1,10 @@ ;;; ob-coq.el --- Babel Functions for Coq -*- lexical-binding: t; -*- -;; Copyright (C) 2010-2017 Free Software Foundation, Inc. +;; Copyright (C) 2010-2019 Free Software Foundation, Inc. ;; Author: Eric Schulte ;; Keywords: literate programming, reproducible research -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; This file is part of GNU Emacs. diff --git a/elpa/org-20171030/ob-core.el b/elpa/org-20190930/ob-core.el similarity index 91% rename from elpa/org-20171030/ob-core.el rename to elpa/org-20190930/ob-core.el index c7c03845..6f4101f6 100644 --- a/elpa/org-20171030/ob-core.el +++ b/elpa/org-20190930/ob-core.el @@ -1,11 +1,11 @@ ;;; ob-core.el --- Working with Code Blocks -*- lexical-binding: t; -*- -;; Copyright (C) 2009-2017 Free Software Foundation, Inc. +;; Copyright (C) 2009-2019 Free Software Foundation, Inc. ;; 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. @@ -35,6 +35,7 @@ (defvar org-babel-library-of-babel) (defvar org-edit-src-content-indentation) +(defvar org-link-file-path-type) (defvar org-src-lang-modes) (defvar org-src-preserve-indentation) @@ -47,10 +48,8 @@ (declare-function org-babel-ref-resolve "ob-ref" (ref)) (declare-function org-babel-ref-split-args "ob-ref" (arg-string)) (declare-function org-babel-tangle-comment-links "ob-tangle" (&optional info)) -(declare-function org-completing-read "org" (&rest args)) (declare-function org-current-level "org" ()) (declare-function org-cycle "org" (&optional arg)) -(declare-function org-do-remove-indentation "org" (&optional n)) (declare-function org-edit-src-code "org-src" (&optional code edit-buffer-name)) (declare-function org-edit-src-exit "org-src" ()) (declare-function org-element-at-point "org-element" ()) @@ -60,9 +59,6 @@ (declare-function org-element-type "org-element" (element)) (declare-function org-entry-get "org" (pom property &optional inherit literal-nil)) (declare-function org-escape-code-in-region "org-src" (beg end)) -(declare-function org-get-indentation "org" (&optional line)) -(declare-function org-get-indentation "org" (&optional line)) -(declare-function org-in-regexp "org" (regexp &optional nlines visually)) (declare-function org-indent-line "org" ()) (declare-function org-list-get-list-end "org-list" (item struct prevs)) (declare-function org-list-prevs-alist "org-list" (struct)) @@ -74,26 +70,18 @@ (declare-function org-mark-ring-push "org" (&optional pos buffer)) (declare-function org-narrow-to-subtree "org" ()) (declare-function org-next-block "org" (arg &optional backward block-regexp)) -(declare-function org-number-sequence "org-compat" (from &optional to inc)) (declare-function org-open-at-point "org" (&optional in-emacs reference-buffer)) -(declare-function org-outline-overlay-data "org" (&optional use-markers)) (declare-function org-previous-block "org" (arg &optional block-regexp)) -(declare-function org-remove-indentation "org" (code &optional n)) -(declare-function org-reverse-string "org" (string)) -(declare-function org-set-outline-overlay-data "org" (data)) (declare-function org-show-context "org" (&optional key)) -(declare-function org-src-coderef-format "org-src" (element)) +(declare-function org-src-coderef-format "org-src" (&optional element)) (declare-function org-src-coderef-regexp "org-src" (fmt &optional label)) (declare-function org-table-align "org-table" ()) (declare-function org-table-end "org-table" (&optional table-type)) (declare-function org-table-import "org-table" (file arg)) (declare-function org-table-to-lisp "org-table" (&optional txt)) -(declare-function org-trim "org" (s &optional keep-lead)) (declare-function org-unescape-code-in-string "org-src" (s)) -(declare-function org-uniquify "org" (list)) (declare-function orgtbl-to-generic "org-table" (table params)) (declare-function orgtbl-to-orgtbl "org-table" (table params)) -(declare-function outline-show-all "outline" ()) (declare-function tramp-compat-make-temp-file "tramp-compat" (filename &optional dir-flag)) (defgroup org-babel nil @@ -187,9 +175,14 @@ This string must include a \"%s\" which will be replaced by the results." :safe #'booleanp) (defun org-babel-noweb-wrap (&optional regexp) - (concat org-babel-noweb-wrap-start - (or regexp "\\([^ \t\n].+?[^ \t]\\|[^ \t\n]\\)") - org-babel-noweb-wrap-end)) + "Return regexp matching a Noweb reference. + +Match any reference, or only those matching REGEXP, if non-nil. + +When matching, reference is stored in match group 1." + (concat (regexp-quote org-babel-noweb-wrap-start) + (or regexp "\\([^ \t\n]\\(?:.*?[^ \t\n]\\)?\\)") + (regexp-quote org-babel-noweb-wrap-end))) (defvar org-babel-src-name-regexp "^[ \t]*#\\+name:[ \t]*" @@ -364,7 +357,7 @@ a window into the `org-babel-get-src-block-info' function." ;;;###autoload (defun org-babel-expand-src-block-maybe () "Conditionally expand a source block. -Detect if this is context for a org-babel src-block and if so +Detect if this is context for an org-babel src-block and if so then run `org-babel-expand-src-block'." (interactive) (org-babel-when-in-src-block @@ -373,7 +366,7 @@ then run `org-babel-expand-src-block'." ;;;###autoload (defun org-babel-load-in-session-maybe () "Conditionally load a source block in a session. -Detect if this is context for a org-babel src-block and if so +Detect if this is context for an org-babel src-block and if so then run `org-babel-load-in-session'." (interactive) (org-babel-when-in-src-block @@ -384,7 +377,7 @@ then run `org-babel-load-in-session'." ;;;###autoload (defun org-babel-pop-to-session-maybe () "Conditionally pop to a session. -Detect if this is context for a org-babel src-block and if so +Detect if this is context for an org-babel src-block and if so then run `org-babel-switch-to-session'." (interactive) (org-babel-when-in-src-block @@ -417,7 +410,7 @@ then run `org-babel-switch-to-session'." (post . :any) (prologue . :any) (results . ((file list vector table scalar verbatim) - (raw html latex org code pp drawer) + (raw html latex org code pp drawer link graphics) (replace silent none append prepend) (output value))) (rownames . ((no yes))) @@ -533,7 +526,7 @@ to raise errors for all languages.") "Hook for functions to be called after `org-babel-execute-src-block'") (defun org-babel-named-src-block-regexp-for-name (&optional name) - "This generates a regexp used to match a src block named NAME. + "This generates a regexp used to match a source block named NAME. If NAME is nil, match any name. Matched name is then put in match group 9. Other match groups are defined in `org-babel-src-block-regexp'." @@ -567,7 +560,7 @@ Remove final newline character and spurious indentation." ;;; functions (defvar org-babel-current-src-block-location nil - "Marker pointing to the src block currently being executed. + "Marker pointing to the source block currently being executed. This may also point to a call line or an inline code block. If multiple blocks are being executed (e.g., in chained execution through use of the :var header argument) this marker points to @@ -578,9 +571,10 @@ the outer-most code block.") (defun org-babel-get-src-block-info (&optional light datum) "Extract information from a source block or inline source block. -Optional argument LIGHT does not resolve remote variable -references; a process which could likely result in the execution -of other code blocks. +When optional argument LIGHT is non-nil, Babel does not resolve +remote variable references; a process which could likely result +in the execution of other code blocks, and do not evaluate Lisp +values in parameters. By default, consider the block at point. However, when optional argument DATUM is provided, extract information from that parsed @@ -611,8 +605,9 @@ a list with the following pattern: ;; properties applicable to its location within ;; the document. (org-with-point-at (org-element-property :begin datum) - (org-babel-params-from-properties lang)) - (mapcar #'org-babel-parse-header-arguments + (org-babel-params-from-properties lang light)) + (mapcar (lambda (h) + (org-babel-parse-header-arguments h light)) (cons (org-element-property :parameters datum) (org-element-property :header datum))))) (or (org-element-property :switches datum) "") @@ -655,7 +650,7 @@ block." (let* ((params (nth 2 info)) (cache (let ((c (cdr (assq :cache params)))) (and (not arg) c (string= "yes" c)))) - (new-hash (and cache (org-babel-sha1-hash info))) + (new-hash (and cache (org-babel-sha1-hash info :eval))) (old-hash (and cache (org-babel-current-result-hash))) (current-cache (and new-hash (equal new-hash old-hash)))) (cond @@ -707,10 +702,16 @@ block." (let ((file (cdr (assq :file params)))) ;; If non-empty result and :file then write to :file. (when file - (when result + ;; If `:results' are special types like `link' or + ;; `graphics', don't write result to `:file'. Only + ;; insert a link to `:file'. + (when (and result + (not (or (member "link" result-params) + (member "graphics" result-params)))) (with-temp-file file (insert (org-babel-format-result - result (cdr (assq :sep params)))))) + result + (cdr (assq :sep params)))))) (setq result file)) ;; Possibly perform post process provided its ;; appropriate. Dynamically bind "*this*" to the @@ -981,13 +982,24 @@ with a prefix argument then this is passed on to (defmacro org-babel-do-in-edit-buffer (&rest body) "Evaluate BODY in edit buffer if there is a code block at point. Return t if a code block was found at point, nil otherwise." - `(let ((org-src-window-setup 'switch-invisibly)) - (when (and (org-babel-where-is-src-block-head) + (declare (debug (body))) + `(let* ((element (org-element-at-point)) + ;; This function is not supposed to move point. However, + ;; `org-edit-src-code' always moves point back into the + ;; source block. It is problematic if the point was before + ;; the code, e.g., on block's opening line. In this case, + ;; we want to restore this location after executing BODY. + (outside-position + (and (<= (line-beginning-position) + (org-element-property :post-affiliated element)) + (point-marker))) + (org-src-window-setup 'switch-invisibly)) + (when (and (org-babel-where-is-src-block-head element) (org-edit-src-code)) (unwind-protect (progn ,@body) - (org-edit-src-exit)) + (org-edit-src-exit) + (when outside-position (goto-char outside-position))) t))) -(def-edebug-spec org-babel-do-in-edit-buffer (body)) (defun org-babel-do-key-sequence-in-edit-buffer (key) "Read key sequence and execute the command in edit buffer. @@ -1011,30 +1023,32 @@ evaluation mechanisms." ;;;###autoload (defun org-babel-open-src-block-result (&optional re-run) - "If `point' is on a src block then open the results of the -source code block, otherwise return nil. With optional prefix -argument RE-RUN the source-code block is evaluated even if -results already exist." + "Open results of source block at point. + +If `point' is on a source block then open the results of the source +code block, otherwise return nil. With optional prefix argument +RE-RUN the source-code block is evaluated even if results already +exist." (interactive "P") - (let ((info (org-babel-get-src-block-info 'light))) - (when info - (save-excursion - ;; go to the results, if there aren't any then run the block - (goto-char (or (and (not re-run) (org-babel-where-is-src-block-result)) - (progn (org-babel-execute-src-block) - (org-babel-where-is-src-block-result)))) - (end-of-line 1) - (while (looking-at "[\n\r\t\f ]") (forward-char 1)) - ;; open the results - (if (looking-at org-bracket-link-regexp) - ;; file results - (org-open-at-point) - (let ((r (org-babel-format-result - (org-babel-read-result) (cdr (assq :sep (nth 2 info)))))) - (pop-to-buffer (get-buffer-create "*Org-Babel Results*")) - (delete-region (point-min) (point-max)) - (insert r))) - t)))) + (pcase (org-babel-get-src-block-info 'light) + (`(,_ ,_ ,arguments ,_ ,_ ,start ,_) + (save-excursion + ;; Go to the results, if there aren't any then run the block. + (goto-char start) + (goto-char (or (and (not re-run) (org-babel-where-is-src-block-result)) + (progn (org-babel-execute-src-block) + (org-babel-where-is-src-block-result)))) + (end-of-line) + (skip-chars-forward " \r\t\n") + ;; Open the results. + (if (looking-at org-bracket-link-regexp) (org-open-at-point) + (let ((r (org-babel-format-result (org-babel-read-result) + (cdr (assq :sep arguments))))) + (pop-to-buffer (get-buffer-create "*Org Babel Results*")) + (erase-buffer) + (insert r))) + t)) + (_ nil))) ;;;###autoload (defmacro org-babel-map-src-blocks (file &rest body) @@ -1214,11 +1228,14 @@ the current subtree." (widen)))) ;;;###autoload -(defun org-babel-sha1-hash (&optional info) - "Generate an sha1 hash based on the value of info." +(defun org-babel-sha1-hash (&optional info context) + "Generate a sha1 hash based on the value of INFO. +CONTEXT specifies the context of evaluation. It can be `:eval', +`:export', `:tangle'. A nil value means `:eval'." (interactive) (let ((print-level nil) - (info (or info (org-babel-get-src-block-info)))) + (info (or info (org-babel-get-src-block-info))) + (context (or context :eval))) (setf (nth 2 info) (sort (copy-sequence (nth 2 info)) (lambda (a b) (string< (car a) (car b))))) @@ -1246,8 +1263,9 @@ the current subtree." ;; expanded body (lang (nth 0 info)) (params (nth 2 info)) - (body (if (org-babel-noweb-p params :eval) - (org-babel-expand-noweb-references info) (nth 1 info))) + (body (if (org-babel-noweb-p params context) + (org-babel-expand-noweb-references info) + (nth 1 info))) (expand-cmd (intern (concat "org-babel-expand-body:" lang))) (assignments-cmd (intern (concat "org-babel-variable-assignments:" lang))) @@ -1416,24 +1434,27 @@ portions of results lines." (lambda () (add-hook 'change-major-mode-hook 'org-babel-show-result-all 'append 'local))) -(defvar org-file-properties) -(defun org-babel-params-from-properties (&optional lang) - "Retrieve parameters specified as properties. -Return a list of association lists of source block params +(defun org-babel-params-from-properties (&optional lang no-eval) + "Retrieve source block parameters specified as properties. + +LANG is the language of the source block, as a string. When +optional argument NO-EVAL is non-nil, do not evaluate Lisp values +in parameters. + +Return a list of association lists of source block parameters specified in the properties of the current outline entry." (save-match-data (list - ;; header arguments specified with the header-args property at + ;; Header arguments specified with the header-args property at ;; point of call. (org-babel-parse-header-arguments - (org-entry-get org-babel-current-src-block-location - "header-args" - 'inherit)) - (and lang ; language-specific header arguments at point of call + (org-entry-get (point) "header-args" 'inherit) + no-eval) + ;; Language-specific header arguments at point of call. + (and lang (org-babel-parse-header-arguments - (org-entry-get org-babel-current-src-block-location - (concat "header-args:" lang) - 'inherit)))))) + (org-entry-get (point) (concat "header-args:" lang) 'inherit) + no-eval))))) (defun org-babel-balanced-split (string alts) "Split STRING on instances of ALTS. @@ -1521,9 +1542,11 @@ balanced instances of \"[ \t]:\", set ALTS to ((32 9) . 58)." (cons el acc)))) list :initial-value nil)))) -(defun org-babel-parse-header-arguments (arg-string) - "Parse a string of header arguments returning an alist." - (when (> (length arg-string) 0) +(defun org-babel-parse-header-arguments (string &optional no-eval) + "Parse header arguments in STRING. +When optional argument NO-EVAL is non-nil, do not evaluate Lisp +in parameters. Return an alist." + (when (org-string-nw-p string) (org-babel-parse-multiple-vars (delq nil (mapcar @@ -1532,10 +1555,12 @@ balanced instances of \"[ \t]:\", set ALTS to ((32 9) . 58)." "\\([^ \f\t\n\r\v]+\\)[ \f\t\n\r\v]+\\([^ \f\t\n\r\v]+.*\\)" arg) (cons (intern (match-string 1 arg)) - (org-babel-read (org-babel-chomp (match-string 2 arg)))) + (org-babel-read (org-babel-chomp (match-string 2 arg)) + no-eval)) (cons (intern (org-babel-chomp arg)) nil))) - (let ((raw (org-babel-balanced-split arg-string '((32 9) . 58)))) - (cons (car raw) (mapcar (lambda (r) (concat ":" r)) (cdr raw))))))))) + (let ((raw (org-babel-balanced-split string '((32 9) . 58)))) + (cons (car raw) + (mapcar (lambda (r) (concat ":" r)) (cdr raw))))))))) (defun org-babel-parse-multiple-vars (header-arguments) "Expand multiple variable assignments behind a single :var keyword. @@ -1765,15 +1790,17 @@ to `org-babel-named-src-block-regexp'." (defun org-babel-src-block-names (&optional file) "Returns the names of source blocks in FILE or the current buffer." - (when file (find-file file)) - (save-excursion - (goto-char (point-min)) - (let* ((re (org-babel-named-src-block-regexp-for-name)) - (names (and (looking-at re) - (list (match-string-no-properties 9))))) - (while (ignore-errors (org-next-block 1 nil re)) - (push (match-string-no-properties 9) names)) - names))) + (with-current-buffer (if file (find-file-noselect file) (current-buffer)) + (org-with-point-at 1 + (let ((regexp "^[ \t]*#\\+begin_src ") + (case-fold-search t) + (names nil)) + (while (re-search-forward regexp nil t) + (let ((element (org-element-at-point))) + (when (eq 'src-block (org-element-type element)) + (let ((name (org-element-property :name element))) + (when name (push name names)))))) + names)))) ;;;###autoload (defun org-babel-goto-named-result (name) @@ -1833,7 +1860,7 @@ With optional prefix argument ARG, jump backward ARG many source blocks." ;;;###autoload (defun org-babel-mark-block () - "Mark current src block." + "Mark current source block." (interactive) (let ((head (org-babel-where-is-src-block-head))) (when head @@ -1864,7 +1891,7 @@ region is not active then the point is demarcated." (save-excursion (goto-char place) (let ((lang (nth 0 info)) - (indent (make-string (org-get-indentation) ?\s))) + (indent (make-string (current-indentation) ?\s))) (when (string-match "^[[:space:]]*$" (buffer-substring (point-at-bol) (point-at-eol))) @@ -2194,10 +2221,10 @@ code ---- the results are extracted in the syntax of the source optional LANG argument. list ---- the results are rendered as a list. This option not - allowed for inline src blocks. + allowed for inline source blocks. table --- the results are rendered as a table. This option not - allowed for inline src blocks. + allowed for inline source blocks. INFO may provide the values of these header arguments (in the `header-arguments-alist' see the docstring for @@ -2261,7 +2288,7 @@ INFO may provide the values of these header arguments (in the (goto-char (org-element-property :end inline)) (skip-chars-backward " \t")) (unless inline - (setq indent (org-get-indentation)) + (setq indent (current-indentation)) (forward-line 1)) (setq beg (point)) (cond @@ -2298,10 +2325,9 @@ INFO may provide the values of these header arguments (in the (lambda (r) ;; Non-nil when result R can be turned into ;; a table. - (and (listp r) - (null (cdr (last r))) + (and (proper-list-p r) (cl-every - (lambda (e) (or (atom e) (null (cdr (last e))))) + (lambda (e) (or (atom e) (proper-list-p e))) result))))) ;; insert results based on type (cond @@ -2351,24 +2377,24 @@ INFO may provide the values of these header arguments (in the ;; possibly wrap result (cond ((assq :wrap (nth 2 info)) - (let ((name (or (cdr (assq :wrap (nth 2 info))) "RESULTS"))) - (funcall wrap (concat "#+BEGIN_" name) - (concat "#+END_" (car (split-string name))) + (let ((name (or (cdr (assq :wrap (nth 2 info))) "results"))) + (funcall wrap (concat "#+begin_" name) + (concat "#+end_" (car (split-string name))) nil nil (concat "{{{results(@@" name ":") "@@)}}}"))) ((member "html" result-params) - (funcall wrap "#+BEGIN_EXPORT html" "#+END_EXPORT" nil nil + (funcall wrap "#+begin_export html" "#+end_export" nil nil "{{{results(@@html:" "@@)}}}")) ((member "latex" result-params) - (funcall wrap "#+BEGIN_EXPORT latex" "#+END_EXPORT" nil nil + (funcall wrap "#+begin_export latex" "#+end_export" nil nil "{{{results(@@latex:" "@@)}}}")) ((member "org" result-params) (goto-char beg) (when (org-at-table-p) (org-cycle)) - (funcall wrap "#+BEGIN_SRC org" "#+END_SRC" nil nil + (funcall wrap "#+begin_src org" "#+end_src" nil nil "{{{results(src_org{" "})}}}")) ((member "code" result-params) (let ((lang (or lang "none"))) - (funcall wrap (format "#+BEGIN_SRC %s%s" lang results-switches) - "#+END_SRC" nil nil + (funcall wrap (format "#+begin_src %s%s" lang results-switches) + "#+end_src" nil nil (format "{{{results(src_%s[%s]{" lang results-switches) "})}}}"))) ((member "raw" result-params) @@ -2377,7 +2403,7 @@ INFO may provide the values of these header arguments (in the ;; Stay backward compatible with <7.9.2 (member "wrap" result-params)) (goto-char beg) (when (org-at-table-p) (org-cycle)) - (funcall wrap ":RESULTS:" ":END:" 'no-escape nil + (funcall wrap ":results:" ":end:" 'no-escape nil "{{{results(" ")}}}")) ((and inline (member "file" result-params)) (funcall wrap nil nil nil nil "{{{results(" ")}}}")) @@ -2416,8 +2442,11 @@ INFO may provide the values of these header arguments (in the (goto-char location) (when (looking-at (concat org-babel-result-regexp ".*$")) (delete-region - (if keep-keyword (1+ (match-end 0)) (1- (match-beginning 0))) - (progn (forward-line 1) (org-babel-result-end)))))))) + (if keep-keyword (line-beginning-position 2) + (save-excursion + (skip-chars-backward " \r\t\n") + (line-beginning-position 2))) + (progn (forward-line) (org-babel-result-end)))))))) (defun org-babel-remove-inline-result (&optional datum) "Remove the result of the current inline-src-block or babel call. @@ -2454,39 +2483,41 @@ in the buffer." (defun org-babel-result-end () "Return the point at the end of the current set of results." - (save-excursion - (cond - ((org-at-table-p) (progn (goto-char (org-table-end)) (point))) - ((org-at-item-p) (let* ((struct (org-list-struct)) - (prvs (org-list-prevs-alist struct))) - (org-list-get-list-end (point-at-bol) struct prvs))) - ((let ((case-fold-search t)) (looking-at "^\\([ \t]*\\):results:")) - (progn (re-search-forward (concat "^" (match-string 1) ":END:")) - (forward-char 1) (point))) - (t - (let ((case-fold-search t)) - (if (looking-at (concat "[ \t]*#\\+begin_\\([^ \t\n\r]+\\)")) - (progn (re-search-forward (concat "[ \t]*#\\+end_" (match-string 1)) - nil t) - (forward-char 1)) - (while (looking-at "[ \t]*\\(: \\|:$\\|\\[\\[\\)") - (forward-line 1)))) - (point))))) + (cond ((looking-at-p "^[ \t]*$") (point)) ;no result + ((looking-at-p (format "^[ \t]*%s[ \t]*$" org-bracket-link-regexp)) + (line-beginning-position 2)) + (t + (let ((element (org-element-at-point))) + (if (memq (org-element-type element) + ;; Possible results types. + '(drawer example-block export-block fixed-width item + plain-list src-block table)) + (save-excursion + (goto-char (min (point-max) ;for narrowed buffers + (org-element-property :end element))) + (skip-chars-backward " \r\t\n") + (line-beginning-position 2)) + (point)))))) (defun org-babel-result-to-file (result &optional description) - "Convert RESULT into an `org-mode' link with optional DESCRIPTION. + "Convert RESULT into an Org link with optional DESCRIPTION. If the `default-directory' is different from the containing file's directory then expand relative links." (when (stringp result) - (format "[[file:%s]%s]" - (if (and default-directory - buffer-file-name - (not (string= (expand-file-name default-directory) - (expand-file-name - (file-name-directory buffer-file-name))))) - (expand-file-name result default-directory) - result) - (if description (concat "[" description "]") "")))) + (let ((same-directory? + (and buffer-file-name + (not (string= (expand-file-name default-directory) + (expand-file-name + (file-name-directory buffer-file-name))))))) + (format "[[file:%s]%s]" + (if (and default-directory buffer-file-name same-directory?) + (if (eq org-link-file-path-type 'adaptive) + (file-relative-name + (expand-file-name result default-directory) + (file-name-directory (buffer-file-name))) + (expand-file-name result default-directory)) + result) + (if description (concat "[" description "]") ""))))) (defun org-babel-examplify-region (beg end &optional results-switches inline) "Comment out region using the inline `==' or `: ' org example quote." @@ -2524,7 +2555,7 @@ file's directory then expand relative links." (unless (eq (org-element-type element) 'src-block) (error "Not in a source block")) (goto-char (org-babel-where-is-src-block-head element)) - (let* ((ind (org-get-indentation)) + (let* ((ind (current-indentation)) (body-start (line-beginning-position 2)) (body (org-element-normalize-string (if (or org-src-preserve-indentation @@ -2651,12 +2682,6 @@ parameters when merging lists." ;; Return merged params. params)) -(defvar org-babel-use-quick-and-dirty-noweb-expansion nil - "Set to true to use regular expressions to expand noweb references. -This results in much faster noweb reference expansion but does -not properly allow code blocks to inherit the \":noweb-ref\" -header argument from buffer or subtree wide properties.") - (defun org-babel-noweb-p (params context) "Check if PARAMS require expansion in CONTEXT. CONTEXT may be one of :tangle, :export or :eval." @@ -2703,16 +2728,8 @@ block but are passed literally to the \"example-block\"." (body (nth 1 info)) (ob-nww-start org-babel-noweb-wrap-start) (ob-nww-end org-babel-noweb-wrap-end) - (comment (string= "noweb" (cdr (assq :comments (nth 2 info))))) - (rx-prefix (concat "\\(" org-babel-src-name-regexp "\\|" - ":noweb-ref[ \t]+" "\\)")) (new-body "") (nb-add (lambda (text) (setq new-body (concat new-body text)))) - (c-wrap (lambda (text) - (with-temp-buffer - (funcall (intern (concat lang "-mode"))) - (comment-region (point) (progn (insert text) (point))) - (org-trim (buffer-string))))) index source-name evaluate prefix) (with-temp-buffer (setq-local org-babel-noweb-wrap-start ob-nww-start) @@ -2744,58 +2761,74 @@ block but are passed literally to the \"example-block\"." (let ((raw (org-babel-ref-resolve source-name))) (if (stringp raw) raw (format "%S" raw))) (or - ;; Retrieve from the library of babel. - (nth 2 (assoc (intern source-name) - org-babel-library-of-babel)) + ;; Retrieve from the Library of Babel. + (nth 2 (assoc-string source-name org-babel-library-of-babel)) ;; Return the contents of headlines literally. (save-excursion (when (org-babel-ref-goto-headline-id source-name) - (org-babel-ref-headline-body))) + (org-babel-ref-headline-body))) ;; Find the expansion of reference in this buffer. - (let ((rx (concat rx-prefix source-name "[ \t\n]")) - expansion) - (save-excursion - (goto-char (point-min)) - (if org-babel-use-quick-and-dirty-noweb-expansion - (while (re-search-forward rx nil t) - (let* ((i (org-babel-get-src-block-info 'light)) - (body (org-babel-expand-noweb-references i)) - (sep (or (cdr (assq :noweb-sep (nth 2 i))) - "\n")) - (full (if comment - (let ((cs (org-babel-tangle-comment-links i))) - (concat (funcall c-wrap (car cs)) "\n" - body "\n" - (funcall c-wrap (cadr cs)))) - body))) - (setq expansion (cons sep (cons full expansion))))) - (org-babel-map-src-blocks nil - (let ((i (org-babel-get-src-block-info 'light))) - (when (equal (or (cdr (assq :noweb-ref (nth 2 i))) - (nth 4 i)) - source-name) - (let* ((body (org-babel-expand-noweb-references i)) - (sep (or (cdr (assq :noweb-sep (nth 2 i))) - "\n")) - (full (if comment - (let ((cs (org-babel-tangle-comment-links i))) - (concat (funcall c-wrap (car cs)) "\n" - body "\n" - (funcall c-wrap (cadr cs)))) - body))) - (setq expansion - (cons sep (cons full expansion))))))))) - (and expansion - (mapconcat #'identity (nreverse (cdr expansion)) ""))) + (save-excursion + (goto-char (point-min)) + (let* ((name-regexp + (org-babel-named-src-block-regexp-for-name + source-name)) + (comment + (string= "noweb" + (cdr (assq :comments (nth 2 info))))) + (c-wrap + (lambda (s) + ;; Comment, according to LANG mode, + ;; string S. Return new string. + (with-temp-buffer + (funcall (intern (concat lang "-mode"))) + (comment-region (point) + (progn (insert s) (point))) + (org-trim (buffer-string))))) + (expand-body + (lambda (i) + ;; Expand body of code blocked + ;; represented by block info I. + (let ((b (if (org-babel-noweb-p (nth 2 i) :eval) + (org-babel-expand-noweb-references i) + (nth 1 i)))) + (if (not comment) b + (let ((cs (org-babel-tangle-comment-links i))) + (concat (funcall c-wrap (car cs)) "\n" + b "\n" + (funcall c-wrap (cadr cs))))))))) + (if (re-search-forward name-regexp nil t) + ;; Found a source block named SOURCE-NAME. + ;; Assume it is unique; do not look after + ;; `:noweb-ref' header argument. + (funcall expand-body + (org-babel-get-src-block-info 'light)) + ;; Though luck. We go into the long process + ;; of checking each source block and expand + ;; those with a matching Noweb reference. + (let ((expansion nil)) + (org-babel-map-src-blocks nil + (let* ((info (org-babel-get-src-block-info 'light)) + (parameters (nth 2 info))) + (when (equal source-name + (cdr (assq :noweb-ref parameters))) + (push (funcall expand-body info) expansion) + (push (or (cdr (assq :noweb-sep parameters)) + "\n") + expansion)))) + (when expansion + (mapconcat #'identity + (nreverse (cdr expansion)) + "")))))) ;; Possibly raise an error if named block doesn't exist. (if (or org-babel-noweb-error-all-langs (member lang org-babel-noweb-error-langs)) - (error "%s" (concat - (org-babel-noweb-wrap source-name) - "could not be resolved (see " - "`org-babel-noweb-error-langs')")) + (error "%s could not be resolved (see \ +`org-babel-noweb-error-langs')" + (org-babel-noweb-wrap source-name)) ""))) - "[\n\r]") (concat "\n" prefix)))))) + "[\n\r]") + (concat "\n" prefix)))))) (funcall nb-add (buffer-substring index (point-max)))) new-body)) @@ -2917,29 +2950,29 @@ Otherwise return nil." (defun org-babel-import-elisp-from-file (file-name &optional separator) "Read the results located at FILE-NAME into an elisp table. If the table is trivial, then return it as a scalar." - (let (result) - (save-window-excursion - (with-temp-buffer - (condition-case err - (progn - (org-table-import file-name separator) - (delete-file file-name) - (setq result (mapcar (lambda (row) - (mapcar #'org-babel-string-read row)) - (org-table-to-lisp)))) - (error (message "Error reading results: %s" err) nil))) - (if (null (cdr result)) ;; if result is trivial vector, then scalarize it - (if (consp (car result)) - (if (null (cdr (car result))) - (caar result) - result) - (car result)) - result)))) + (save-window-excursion + (let ((result + (with-temp-buffer + (condition-case err + (progn + (org-table-import file-name separator) + (delete-file file-name) + (delq nil + (mapcar (lambda (row) + (and (not (eq row 'hline)) + (mapcar #'org-babel-string-read row))) + (org-table-to-lisp)))) + (error (message "Error reading results: %s" err) nil))))) + (pcase result + (`((,scalar)) scalar) + (`((,_ ,_ . ,_)) result) + (`(,scalar) scalar) + (_ result))))) (defun org-babel-string-read (cell) "Strip nested \"s from around strings." (org-babel-read (or (and (stringp cell) - (string-match "\\\"\\(.+\\)\\\"" cell) + (string-match "\"\\(.+\\)\"" cell) (match-string 1 cell)) cell) t)) @@ -2959,7 +2992,7 @@ If NAME specifies a remote location, the remote portion of the name is removed, since in that case the process will be executing remotely. The file name is then processed by `expand-file-name'. Unless second argument NO-QUOTE-P is non-nil, the file name is -additionally processed by `shell-quote-argument'" +additionally processed by `shell-quote-argument'." (let ((f (org-babel-local-file-name (expand-file-name name)))) (if no-quote-p f (shell-quote-argument f)))) @@ -3120,7 +3153,8 @@ after the babel API for OLD-type source blocks is fully defined. Callers of this function will probably want to add an entry to `org-src-lang-modes' as well." (dolist (fn '("execute" "expand-body" "prep-session" - "variable-assignments" "load-session")) + "variable-assignments" "load-session" + "edit-prep")) (let ((sym (intern-soft (concat "org-babel-" fn ":" old)))) (when (and sym (fboundp sym)) (defalias (intern (concat "org-babel-" fn ":" new)) sym)))) @@ -3131,10 +3165,6 @@ Callers of this function will probably want to add an entry to (when (and sym (boundp sym)) (defvaralias (intern (concat "org-babel-" var ":" new)) sym))))) -(defun org-babel-strip-quotes (string) - "Strip \\\"s from around a string, if applicable." - (org-unbracket-string "\"" "\"" string)) - (provide 'ob-core) ;; Local variables: diff --git a/elpa/org-20171030/ob-css.el b/elpa/org-20190930/ob-css.el similarity index 93% rename from elpa/org-20171030/ob-css.el rename to elpa/org-20190930/ob-css.el index b3982db3..ce663b26 100644 --- a/elpa/org-20171030/ob-css.el +++ b/elpa/org-20190930/ob-css.el @@ -1,10 +1,10 @@ ;;; ob-css.el --- Babel Functions for CSS -*- lexical-binding: t; -*- -;; Copyright (C) 2009-2017 Free Software Foundation, Inc. +;; Copyright (C) 2009-2019 Free Software Foundation, Inc. ;; Author: Eric Schulte ;; Keywords: literate programming, reproducible research -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; This file is part of GNU Emacs. diff --git a/elpa/org-20171030/ob-ditaa.el b/elpa/org-20190930/ob-ditaa.el similarity index 97% rename from elpa/org-20171030/ob-ditaa.el rename to elpa/org-20190930/ob-ditaa.el index 2a7c7556..c8a5e018 100644 --- a/elpa/org-20171030/ob-ditaa.el +++ b/elpa/org-20190930/ob-ditaa.el @@ -1,10 +1,10 @@ ;;; ob-ditaa.el --- Babel Functions for ditaa -*- lexical-binding: t; -*- -;; Copyright (C) 2009-2017 Free Software Foundation, Inc. +;; Copyright (C) 2009-2019 Free Software Foundation, Inc. ;; Author: Eric Schulte ;; Keywords: literate programming, reproducible research -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; This file is part of GNU Emacs. diff --git a/elpa/org-20171030/ob-dot.el b/elpa/org-20190930/ob-dot.el similarity index 93% rename from elpa/org-20171030/ob-dot.el rename to elpa/org-20190930/ob-dot.el index 8c8e2fbd..73a16738 100644 --- a/elpa/org-20171030/ob-dot.el +++ b/elpa/org-20190930/ob-dot.el @@ -1,10 +1,10 @@ ;;; ob-dot.el --- Babel Functions for dot -*- lexical-binding: t; -*- -;; Copyright (C) 2009-2017 Free Software Foundation, Inc. +;; Copyright (C) 2009-2019 Free Software Foundation, Inc. ;; Author: Eric Schulte ;; Keywords: literate programming, reproducible research -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; This file is part of GNU Emacs. @@ -69,6 +69,8 @@ This function is called by `org-babel-execute-src-block'." (cmdline (or (cdr (assq :cmdline params)) (format "-T%s" (file-name-extension out-file)))) (cmd (or (cdr (assq :cmd params)) "dot")) + (coding-system-for-read 'utf-8) ;use utf-8 with sub-processes + (coding-system-for-write 'utf-8) (in-file (org-babel-temp-file "dot-"))) (with-temp-file in-file (insert (org-babel-expand-body:dot body params))) diff --git a/elpa/org-20171030/ob-ebnf.el b/elpa/org-20190930/ob-ebnf.el similarity index 93% rename from elpa/org-20171030/ob-ebnf.el rename to elpa/org-20190930/ob-ebnf.el index 6bb9b81b..c2292285 100644 --- a/elpa/org-20171030/ob-ebnf.el +++ b/elpa/org-20190930/ob-ebnf.el @@ -1,10 +1,10 @@ ;;; ob-ebnf.el --- Babel Functions for EBNF -*- lexical-binding: t; -*- -;; Copyright (C) 2013-2017 Free Software Foundation, Inc. +;; Copyright (C) 2013-2019 Free Software Foundation, Inc. ;; 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. @@ -49,8 +49,8 @@ ;; Use ebnf-eps-buffer to produce an encapsulated postscript file. ;; (defun org-babel-execute:ebnf (body params) - "Execute a block of Ebnf code with org-babel. This function is -called by `org-babel-execute-src-block'" + "Execute a block of Ebnf code with org-babel. +This function is called by `org-babel-execute-src-block'." (save-excursion (let* ((dest-file (cdr (assq :file params))) (dest-dir (file-name-directory dest-file)) diff --git a/elpa/org-20171030/ob-emacs-lisp.el b/elpa/org-20190930/ob-emacs-lisp.el similarity index 86% rename from elpa/org-20171030/ob-emacs-lisp.el rename to elpa/org-20190930/ob-emacs-lisp.el index 4736d895..cd86f4a2 100644 --- a/elpa/org-20171030/ob-emacs-lisp.el +++ b/elpa/org-20190930/ob-emacs-lisp.el @@ -1,10 +1,10 @@ ;;; ob-emacs-lisp.el --- Babel Functions for Emacs-lisp Code -*- lexical-binding: t; -*- -;; Copyright (C) 2009-2017 Free Software Foundation, Inc. +;; Copyright (C) 2009-2019 Free Software Foundation, Inc. ;; Author: Eric Schulte ;; Keywords: literate programming, reproducible research -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; This file is part of GNU Emacs. @@ -26,7 +26,13 @@ ;; Org-Babel support for evaluating emacs-lisp code ;;; Code: -(require 'ob) + +(require 'ob-core) + +(declare-function org-babel--get-vars "ob" (params)) +(declare-function org-babel-result-cond "ob" (result-params scalar-form &rest table-forms)) +(declare-function org-babel-reassemble-table "ob" (table colnames rownames)) +(declare-function org-babel-pick-name "ob" (names selector)) (defconst org-babel-header-args:emacs-lisp '((lexical . :any)) "Emacs-lisp specific header arguments.") @@ -34,7 +40,7 @@ (defvar org-babel-default-header-args:emacs-lisp '((:lexical . "no")) "Default arguments for evaluating an emacs-lisp source block. -A value of \"yes\" or t causes src blocks to be eval'd using +A value of \"yes\" or t causes source blocks to be eval'd using lexical scoping. It can also be an alist mapping symbols to their value. It is used as the optional LEXICAL argument to `eval', which see.") diff --git a/elpa/org-20171030/ob-eval.el b/elpa/org-20190930/ob-eval.el similarity index 97% rename from elpa/org-20171030/ob-eval.el rename to elpa/org-20190930/ob-eval.el index 4ce91c78..8d5b7ed2 100644 --- a/elpa/org-20171030/ob-eval.el +++ b/elpa/org-20190930/ob-eval.el @@ -1,10 +1,10 @@ ;;; ob-eval.el --- Babel Functions for External Code Evaluation -*- lexical-binding: t; -*- -;; Copyright (C) 2009-2017 Free Software Foundation, Inc. +;; Copyright (C) 2009-2019 Free Software Foundation, Inc. ;; Author: Eric Schulte ;; Keywords: literate programming, reproducible research, comint -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; This file is part of GNU Emacs. @@ -120,7 +120,7 @@ function in various versions of Emacs. (delete-file input-file)) (when (and error-file (file-exists-p error-file)) - (when (< 0 (nth 7 (file-attributes error-file))) + (when (< 0 (file-attribute-size (file-attributes error-file))) (with-current-buffer (get-buffer-create error-buffer) (let ((pos-from-end (- (point-max) (point)))) (or (bobp) diff --git a/elpa/org-20171030/ob-exp.el b/elpa/org-20190930/ob-exp.el similarity index 95% rename from elpa/org-20171030/ob-exp.el rename to elpa/org-20190930/ob-exp.el index 9606d3e4..177104b0 100644 --- a/elpa/org-20171030/ob-exp.el +++ b/elpa/org-20190930/ob-exp.el @@ -1,11 +1,11 @@ ;;; ob-exp.el --- Exportation of Babel Source Blocks -*- lexical-binding: t; -*- -;; Copyright (C) 2009-2017 Free Software Foundation, Inc. +;; Copyright (C) 2009-2019 Free Software Foundation, Inc. ;; 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. @@ -33,7 +33,6 @@ (declare-function org-escape-code-in-string "org-src" (s)) (declare-function org-export-copy-buffer "ox" ()) (declare-function org-fill-template "org" (template alist)) -(declare-function org-get-indentation "org" (&optional line)) (declare-function org-in-commented-heading-p "org" (&optional no-inheritance)) (defvar org-src-preserve-indentation) @@ -58,9 +57,13 @@ returned is the value of the last form in BODY. Assume that point is at the beginning of the Babel block." (declare (indent 1) (debug body)) `(let ((source (get-text-property (point) 'org-reference))) - (with-current-buffer org-babel-exp-reference-buffer + ;; Source blocks created during export process (e.g., by other + ;; source blocks) are not referenced. In this case, do not move + ;; point at all. + (with-current-buffer (if source org-babel-exp-reference-buffer + (current-buffer)) (org-with-wide-buffer - (goto-char source) + (when source (goto-char source)) ,@body)))) (defun org-babel-exp-src-block () @@ -81,7 +84,7 @@ none ---- do not display either code or results upon export Assume point is at block opening line." (interactive) (save-excursion - (let* ((info (org-babel-get-src-block-info 'light)) + (let* ((info (org-babel-get-src-block-info)) (lang (nth 0 info)) (raw-params (nth 2 info)) hash) @@ -104,7 +107,7 @@ Assume point is at block opening line." (symbol-value lang-headers)) (append (org-babel-params-from-properties lang) (list raw-params))))))) - (setf hash (org-babel-sha1-hash info))) + (setf hash (org-babel-sha1-hash info :export))) (org-babel-exp-do-export info 'block hash))))) (defcustom org-babel-exp-call-line-template @@ -206,9 +209,9 @@ this template." (progn (goto-char end) (skip-chars-forward " \t") (point))) - ;; Otherwise: remove inline src block but - ;; preserve following white spaces. Then - ;; insert value. + ;; Otherwise: remove inline source block + ;; but preserve following white spaces. + ;; Then insert value. (delete-region begin end) (insert replacement))))) ((or `babel-call `inline-babel-call) @@ -240,7 +243,7 @@ this template." (insert rep)))) (`src-block (let ((match-start (copy-marker (match-beginning 0))) - (ind (org-get-indentation))) + (ind (current-indentation))) ;; Take care of matched block: compute ;; replacement string. In particular, a nil ;; REPLACEMENT means the block is left as-is @@ -278,7 +281,8 @@ this template." (set-marker begin nil) (set-marker end nil))))) (kill-buffer org-babel-exp-reference-buffer) - (remove-text-properties (point-min) (point-max) '(org-reference))))))) + (remove-text-properties (point-min) (point-max) + '(org-reference nil))))))) (defun org-babel-exp-do-export (info type &optional hash) "Return a string with the exported content of a code block. diff --git a/elpa/org-20171030/ob-forth.el b/elpa/org-20190930/ob-forth.el similarity index 92% rename from elpa/org-20171030/ob-forth.el rename to elpa/org-20190930/ob-forth.el index bb8d9af4..5d4fe304 100644 --- a/elpa/org-20171030/ob-forth.el +++ b/elpa/org-20190930/ob-forth.el @@ -1,10 +1,10 @@ ;;; ob-forth.el --- Babel Functions for Forth -*- lexical-binding: t; -*- -;; Copyright (C) 2014-2017 Free Software Foundation, Inc. +;; Copyright (C) 2014-2019 Free Software Foundation, Inc. ;; Author: Eric Schulte ;; Keywords: literate programming, reproducible research, forth -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; This file is part of GNU Emacs. @@ -33,16 +33,16 @@ ;;; Code: (require 'ob) +(require 'org-macs) (declare-function forth-proc "ext:gforth" ()) -(declare-function org-trim "org" (s &optional keep-lead)) (defvar org-babel-default-header-args:forth '((:session . "yes")) "Default header arguments for forth code blocks.") (defun org-babel-execute:forth (body params) "Execute a block of Forth code with org-babel. -This function is called by `org-babel-execute-src-block'" +This function is called by `org-babel-execute-src-block'." (if (string= "none" (cdr (assq :session params))) (error "Non-session evaluation not supported for Forth code blocks") (let ((all-results (org-babel-forth-session-execute body params))) @@ -53,7 +53,7 @@ This function is called by `org-babel-execute-src-block'" (defun org-babel-forth-session-execute (body params) (require 'forth-mode) (let ((proc (forth-proc)) - (rx " \\(\n:\\|compiled\n\\\|ok\n\\)") + (rx " \\(\n:\\|compiled\n\\|ok\n\\)") (result-start)) (with-current-buffer (process-buffer (forth-proc)) (mapcar (lambda (line) diff --git a/elpa/org-20171030/ob-fortran.el b/elpa/org-20190930/ob-fortran.el similarity index 94% rename from elpa/org-20171030/ob-fortran.el rename to elpa/org-20190930/ob-fortran.el index 50b12fc2..1431eb40 100644 --- a/elpa/org-20171030/ob-fortran.el +++ b/elpa/org-20190930/ob-fortran.el @@ -1,11 +1,11 @@ ;;; ob-fortran.el --- Babel Functions for Fortran -*- lexical-binding: t; -*- -;; Copyright (C) 2011-2017 Free Software Foundation, Inc. +;; Copyright (C) 2011-2019 Free Software Foundation, Inc. ;; 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. ;; @@ -28,13 +28,12 @@ ;;; Code: (require 'ob) +(require 'org-macs) (require 'cc-mode) (require 'cl-lib) (declare-function org-entry-get "org" (pom property &optional inherit literal-nil)) -(declare-function org-remove-indentation "org" (code &optional n)) -(declare-function org-trim "org" (s &optional keep-lead)) (defvar org-babel-tangle-lang-exts) (add-to-list 'org-babel-tangle-lang-exts '("fortran" . "F90")) @@ -46,7 +45,7 @@ executable.") (defun org-babel-execute:fortran (body params) - "This function should only be called by `org-babel-execute:fortran'" + "This function should only be called by `org-babel-execute:fortran'." (let* ((tmp-src-file (org-babel-temp-file "fortran-src-" ".F90")) (tmp-bin-file (org-babel-temp-file "fortran-bin-" org-babel-exeext)) (cmdline (cdr (assq :cmdline params))) @@ -109,18 +108,18 @@ its header arguments." "Wrap body in a \"program ... end program\" block if none exists." (if (string-match "^[ \t]*program[ \t]*.*" (capitalize body)) (let ((vars (org-babel--get-vars params))) - (if vars (error "Cannot use :vars if `program' statement is present")) + (when vars (error "Cannot use :vars if `program' statement is present")) body) (format "program main\n%s\nend program main\n" body))) (defun org-babel-prep-session:fortran (_session _params) "This function does nothing as fortran is a compiled language with no -support for sessions" +support for sessions." (error "Fortran is a compiled languages -- no support for sessions")) (defun org-babel-load-session:fortran (_session _body _params) "This function does nothing as fortran is a compiled language with no -support for sessions" +support for sessions." (error "Fortran is a compiled languages -- no support for sessions")) ;; helper functions diff --git a/elpa/org-20171030/ob-gnuplot.el b/elpa/org-20190930/ob-gnuplot.el similarity index 95% rename from elpa/org-20171030/ob-gnuplot.el rename to elpa/org-20190930/ob-gnuplot.el index 76338627..cc4c3cb2 100644 --- a/elpa/org-20171030/ob-gnuplot.el +++ b/elpa/org-20190930/ob-gnuplot.el @@ -1,10 +1,10 @@ ;;; ob-gnuplot.el --- Babel Functions for Gnuplot -*- lexical-binding: t; -*- -;; Copyright (C) 2009-2017 Free Software Foundation, Inc. +;; Copyright (C) 2009-2019 Free Software Foundation, Inc. ;; Author: Eric Schulte ;; Keywords: literate programming, reproducible research -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; This file is part of GNU Emacs. @@ -39,9 +39,9 @@ ;;; Code: (require 'ob) +(require 'org-macs) -(declare-function org-time-string-to-time "org" (s &optional zone)) -(declare-function org-combine-plists "org" (&rest plists)) +(declare-function org-time-string-to-time "org" (s)) (declare-function orgtbl-to-generic "org-table" (table params)) (declare-function gnuplot-mode "ext:gnuplot-mode" ()) (declare-function gnuplot-send-string-to-gnuplot "ext:gnuplot-mode" (str txt)) @@ -116,6 +116,8 @@ code." (timefmt (cdr (assq :timefmt params))) (time-ind (or (cdr (assq :timeind params)) (when timefmt 1))) + (directory (and (buffer-file-name) + (file-name-directory (buffer-file-name)))) (add-to-body (lambda (text) (setq body (concat text "\n" body))))) ;; append header argument settings to body (when title (funcall add-to-body (format "set title '%s'" title))) @@ -161,7 +163,10 @@ code." (format "\\$%s" (car pair)) (cdr pair) body))) vars) (when prologue (funcall add-to-body prologue)) - (when epilogue (setq body (concat body "\n" epilogue)))) + (when epilogue (setq body (concat body "\n" epilogue))) + ;; Setting the directory needs to be done first so that + ;; subsequent 'output' directive goes to the right place. + (when directory (funcall add-to-body (format "cd '%s'" directory)))) body)) (defun org-babel-execute:gnuplot (body params) diff --git a/elpa/org-20171030/ob-groovy.el b/elpa/org-20190930/ob-groovy.el similarity index 92% rename from elpa/org-20171030/ob-groovy.el rename to elpa/org-20190930/ob-groovy.el index 1e602dd0..a22e21df 100644 --- a/elpa/org-20171030/ob-groovy.el +++ b/elpa/org-20190930/ob-groovy.el @@ -1,10 +1,10 @@ ;;; ob-groovy.el --- Babel Functions for Groovy -*- lexical-binding: t; -*- -;; Copyright (C) 2013-2017 Free Software Foundation, Inc. +;; Copyright (C) 2013-2019 Free Software Foundation, Inc. ;; Author: Miro Bezjak ;; Keywords: literate programming, reproducible research -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; This file is part of GNU Emacs. @@ -45,8 +45,8 @@ parameters may be used, like groovy -v" :type 'string) (defun org-babel-execute:groovy (body params) - "Execute a block of Groovy code with org-babel. This function is -called by `org-babel-execute-src-block'" + "Execute a block of Groovy code with org-babel. +This function is called by `org-babel-execute-src-block'." (message "executing Groovy source code block") (let* ((processed-params (org-babel-process-params params)) (session (org-babel-groovy-initiate-session (nth 0 processed-params))) @@ -84,12 +84,12 @@ in BODY as elisp." (when session (error "Sessions are not (yet) supported for Groovy")) (pcase result-type (`output - (let ((src-file (org-babel-temp-file "groovy-"))) + (let ((src-file (org-babel-temp-file "groovy_"))) (progn (with-temp-file src-file (insert body)) (org-babel-eval (concat org-babel-groovy-command " " src-file) "")))) (`value - (let* ((src-file (org-babel-temp-file "groovy-")) + (let* ((src-file (org-babel-temp-file "groovy_")) (wrapper (format org-babel-groovy-wrapper-method body))) (with-temp-file src-file (insert wrapper)) (let ((raw (org-babel-eval diff --git a/elpa/org-20171030/ob-haskell.el b/elpa/org-20190930/ob-haskell.el similarity index 92% rename from elpa/org-20171030/ob-haskell.el rename to elpa/org-20190930/ob-haskell.el index cc78bec3..a683b110 100644 --- a/elpa/org-20171030/ob-haskell.el +++ b/elpa/org-20190930/ob-haskell.el @@ -1,10 +1,10 @@ ;;; ob-haskell.el --- Babel Functions for Haskell -*- lexical-binding: t; -*- -;; Copyright (C) 2009-2017 Free Software Foundation, Inc. +;; Copyright (C) 2009-2019 Free Software Foundation, Inc. ;; Author: Eric Schulte ;; Keywords: literate programming, reproducible research -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; This file is part of GNU Emacs. @@ -40,10 +40,9 @@ ;;; Code: (require 'ob) +(require 'org-macs) (require 'comint) -(declare-function org-remove-indentation "org" (code &optional n)) -(declare-function org-trim "org" (s &optional keep-lead)) (declare-function haskell-mode "ext:haskell-mode" ()) (declare-function run-haskell "ext:inf-haskell" (&optional arg)) (declare-function inferior-haskell-load-file @@ -59,24 +58,32 @@ (defvar org-babel-haskell-eoe "\"org-babel-haskell-eoe\"") +(defvar haskell-prompt-regexp) + (defun org-babel-execute:haskell (body params) "Execute a block of Haskell code." + (require 'inf-haskell) + (add-hook 'inferior-haskell-hook + (lambda () + (setq-local comint-prompt-regexp + (concat haskell-prompt-regexp "\\|^λ?> ")))) (let* ((session (cdr (assq :session params))) (result-type (cdr (assq :result-type params))) (full-body (org-babel-expand-body:generic body params (org-babel-variable-assignments:haskell params))) (session (org-babel-haskell-initiate-session session params)) + (comint-preoutput-filter-functions + (cons 'ansi-color-filter-apply comint-preoutput-filter-functions)) (raw (org-babel-comint-with-output (session org-babel-haskell-eoe t full-body) (insert (org-trim full-body)) (comint-send-input nil t) (insert org-babel-haskell-eoe) (comint-send-input nil t))) - (results (mapcar - #'org-babel-strip-quotes - (cdr (member org-babel-haskell-eoe - (reverse (mapcar #'org-trim raw))))))) + (results (mapcar #'org-strip-quotes + (cdr (member org-babel-haskell-eoe + (reverse (mapcar #'org-trim raw))))))) (org-babel-reassemble-table (let ((result (pcase result-type @@ -151,7 +158,7 @@ constructs (header arguments, no-web syntax etc...) are ignored." (interactive "P") (let* ((contents (buffer-string)) (haskell-regexp - (concat "^\\([ \t]*\\)#\\+begin_src[ \t]haskell*\\(.*\\)?[\r\n]" + (concat "^\\([ \t]*\\)#\\+begin_src[ \t]haskell*\\(.*\\)[\r\n]" "\\([^\000]*?\\)[\r\n][ \t]*#\\+end_src.*")) (base-name (file-name-sans-extension (buffer-file-name))) (tmp-file (org-babel-temp-file "haskell-")) diff --git a/elpa/org-20171030/ob-hledger.el b/elpa/org-20190930/ob-hledger.el similarity index 96% rename from elpa/org-20171030/ob-hledger.el rename to elpa/org-20190930/ob-hledger.el index 57ab8af4..4fb1f694 100644 --- a/elpa/org-20171030/ob-hledger.el +++ b/elpa/org-20190930/ob-hledger.el @@ -1,10 +1,10 @@ ;; ob-hledger.el --- Babel Functions for hledger -*- lexical-binding: t; -*- -;; Copyright (C) 2010-2017 Free Software Foundation, Inc. +;; Copyright (C) 2010-2019 Free Software Foundation, Inc. ;; Author: Simon Michael ;; Keywords: literate programming, reproducible research, plain text accounting -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; This file is part of GNU Emacs. diff --git a/elpa/org-20171030/ob-io.el b/elpa/org-20190930/ob-io.el similarity index 95% rename from elpa/org-20171030/ob-io.el rename to elpa/org-20190930/ob-io.el index 35b92ef6..9817c641 100644 --- a/elpa/org-20171030/ob-io.el +++ b/elpa/org-20190930/ob-io.el @@ -1,10 +1,10 @@ ;;; ob-io.el --- Babel Functions for Io -*- lexical-binding: t; -*- -;; Copyright (C) 2012-2017 Free Software Foundation, Inc. +;; Copyright (C) 2012-2019 Free Software Foundation, Inc. ;; Author: Andrzej Lichnerowicz ;; Keywords: literate programming, reproducible research -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; This file is part of GNU Emacs. @@ -41,8 +41,8 @@ "Name of the command to use for executing Io code.") (defun org-babel-execute:io (body params) - "Execute a block of Io code with org-babel. This function is -called by `org-babel-execute-src-block'" + "Execute a block of Io code with org-babel. +This function is called by `org-babel-execute-src-block'." (message "executing Io source code block") (let* ((processed-params (org-babel-process-params params)) (session (org-babel-io-initiate-session (nth 0 processed-params))) diff --git a/elpa/org-20171030/ob-java.el b/elpa/org-20190930/ob-java.el similarity index 97% rename from elpa/org-20171030/ob-java.el rename to elpa/org-20190930/ob-java.el index 608e2e88..b055f85e 100644 --- a/elpa/org-20171030/ob-java.el +++ b/elpa/org-20190930/ob-java.el @@ -1,10 +1,10 @@ ;;; ob-java.el --- Babel Functions for Java -*- lexical-binding: t; -*- -;; Copyright (C) 2011-2017 Free Software Foundation, Inc. +;; Copyright (C) 2011-2019 Free Software Foundation, Inc. ;; Author: Eric Schulte ;; Keywords: literate programming, reproducible research -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; This file is part of GNU Emacs. diff --git a/elpa/org-20171030/ob-js.el b/elpa/org-20190930/ob-js.el similarity index 58% rename from elpa/org-20171030/ob-js.el rename to elpa/org-20190930/ob-js.el index e344b7a5..dd53ef69 100644 --- a/elpa/org-20171030/ob-js.el +++ b/elpa/org-20190930/ob-js.el @@ -1,10 +1,10 @@ ;;; ob-js.el --- Babel Functions for Javascript -*- lexical-binding: t; -*- -;; Copyright (C) 2010-2017 Free Software Foundation, Inc. +;; Copyright (C) 2010-2019 Free Software Foundation, Inc. ;; Author: Eric Schulte ;; Keywords: literate programming, reproducible research, js -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; This file is part of GNU Emacs. @@ -41,6 +41,11 @@ (require 'ob) (declare-function run-mozilla "ext:moz" (arg)) +(declare-function httpd-start "ext:simple-httpd" ()) +(declare-function run-skewer "ext:skewer-mode" ()) +(declare-function skewer-repl "ext:skewer-repl" ()) +(declare-function indium-run-node "ext:indium-nodejs" (command)) +(declare-function indium-eval "ext:indium-interaction" (string &optional callback)) (defvar org-babel-default-header-args:js '() "Default header arguments for js code blocks.") @@ -52,7 +57,12 @@ "Name of command used to evaluate js blocks." :group 'org-babel :version "24.1" - :type 'string) + :type '(choice (const "node") + (const "mozrepl") + (const "skewer-mode") + (const "indium") + (const "js-comint")) + :safe #'stringp) (defvar org-babel-js-function-wrapper "require('sys').print(require('sys').inspect(function(){\n%s\n}()));" @@ -60,24 +70,15 @@ (defun org-babel-execute:js (body params) "Execute a block of Javascript code with org-babel. -This function is called by `org-babel-execute-src-block'" +This function is called by `org-babel-execute-src-block'." (let* ((org-babel-js-cmd (or (cdr (assq :cmd params)) org-babel-js-cmd)) + (session (cdr (assq :session params))) (result-type (cdr (assq :result-type params))) (full-body (org-babel-expand-body:generic body params (org-babel-variable-assignments:js params))) - (result (if (not (string= (cdr (assq :session params)) "none")) - ;; session evaluation - (let ((session (org-babel-prep-session:js - (cdr (assq :session params)) params))) - (nth 1 - (org-babel-comint-with-output - (session (format "%S" org-babel-js-eoe) t body) - (mapc - (lambda (line) - (insert (org-babel-chomp line)) - (comint-send-input nil t)) - (list body (format "%S" org-babel-js-eoe)))))) - ;; external evaluation + (result (cond + ;; no session specified, external evaluation + ((string= session "none") (let ((script-file (org-babel-temp-file "js-script-"))) (with-temp-file script-file (insert @@ -87,7 +88,24 @@ This function is called by `org-babel-execute-src-block'" full-body))) (org-babel-eval (format "%s %s" org-babel-js-cmd - (org-babel-process-file-name script-file)) ""))))) + (org-babel-process-file-name script-file)) ""))) + ;; Indium Node REPL. Separate case because Indium + ;; REPL is not inherited from Comint mode. + ((string= session "*JS REPL*") + (require 'indium-repl) + (unless (get-buffer session) + (indium-run-node org-babel-js-cmd)) + (indium-eval full-body)) + ;; session evaluation + (t + (let ((session (org-babel-prep-session:js + (cdr (assq :session params)) params))) + (nth 1 + (org-babel-comint-with-output + (session (format "%S" org-babel-js-eoe) t body) + (dolist (code (list body (format "%S" org-babel-js-eoe))) + (insert (org-babel-chomp code)) + (comint-send-input nil t))))))))) (org-babel-result-cond (cdr (assq :result-params params)) result (org-babel-js-read result)))) @@ -123,11 +141,13 @@ specifying a variable of the same value." (var-lines (org-babel-variable-assignments:js params))) (when session (org-babel-comint-in-buffer session - (sit-for .5) (goto-char (point-max)) - (mapc (lambda (var) - (insert var) (comint-send-input nil t) - (org-babel-comint-wait-for-output session) - (sit-for .1) (goto-char (point-max))) var-lines))) + (goto-char (point-max)) + (dolist (var var-lines) + (insert var) + (comint-send-input nil t) + (org-babel-comint-wait-for-output session) + (sit-for .1) + (goto-char (point-max))))) session)) (defun org-babel-variable-assignments:js (params) @@ -137,25 +157,47 @@ specifying a variable of the same value." (car pair) (org-babel-js-var-to-js (cdr pair)))) (org-babel--get-vars params))) -(defun org-babel-js-initiate-session (&optional session) - "If there is not a current inferior-process-buffer in SESSION +(defun org-babel-js-initiate-session (&optional session _params) + "If there is not a current inferior-process-buffer in `SESSION' then create. Return the initialized session." - (unless (string= session "none") - (cond - ((string= "mozrepl" org-babel-js-cmd) - (require 'moz) - (let ((session-buffer (save-window-excursion - (run-mozilla nil) - (rename-buffer session) - (current-buffer)))) - (if (org-babel-comint-buffer-livep session-buffer) - (progn (sit-for .25) session-buffer) - (sit-for .5) - (org-babel-js-initiate-session session)))) - ((string= "node" org-babel-js-cmd ) - (error "Session evaluation with node.js is not supported")) - (t - (error "Sessions are only supported with mozrepl add \":cmd mozrepl\""))))) + (cond + ((string= session "none") + (warn "Session evaluation of ob-js is not supported")) + ((string= "*skewer-repl*" session) + (require 'skewer-repl) + (let ((session-buffer (get-buffer "*skewer-repl*"))) + (if (and session-buffer + (org-babel-comint-buffer-livep (get-buffer session-buffer)) + (comint-check-proc session-buffer)) + session-buffer + ;; start skewer REPL. + (httpd-start) + (run-skewer) + (skewer-repl) + session-buffer))) + ((string= "*Javascript REPL*" session) + (require 'js-comint) + (let ((session-buffer "*Javascript REPL*")) + (if (and (org-babel-comint-buffer-livep (get-buffer session-buffer)) + (comint-check-proc session-buffer)) + session-buffer + (call-interactively 'run-js) + (sit-for .5) + session-buffer))) + ((string= "mozrepl" org-babel-js-cmd) + (require 'moz) + (let ((session-buffer (save-window-excursion + (run-mozilla nil) + (rename-buffer session) + (current-buffer)))) + (if (org-babel-comint-buffer-livep session-buffer) + (progn (sit-for .25) session-buffer) + (sit-for .5) + (org-babel-js-initiate-session session)))) + ((string= "node" org-babel-js-cmd ) + (error "Session evaluation with node.js is not supported")) + (t + (error "Sessions are only supported with mozrepl add \":cmd mozrepl\"")))) (provide 'ob-js) diff --git a/elpa/org-20171030/ob-keys.el b/elpa/org-20190930/ob-keys.el similarity index 97% rename from elpa/org-20171030/ob-keys.el rename to elpa/org-20190930/ob-keys.el index 170c0063..627648d2 100644 --- a/elpa/org-20171030/ob-keys.el +++ b/elpa/org-20190930/ob-keys.el @@ -1,10 +1,10 @@ ;;; ob-keys.el --- Key Bindings for Babel -*- lexical-binding: t; -*- -;; Copyright (C) 2009-2017 Free Software Foundation, Inc. +;; Copyright (C) 2009-2019 Free Software Foundation, Inc. ;; Author: Eric Schulte ;; Keywords: literate programming, reproducible research -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; This file is part of GNU Emacs. diff --git a/elpa/org-20171030/ob-latex.el b/elpa/org-20190930/ob-latex.el similarity index 98% rename from elpa/org-20171030/ob-latex.el rename to elpa/org-20190930/ob-latex.el index 6964fde5..adf83d46 100644 --- a/elpa/org-20171030/ob-latex.el +++ b/elpa/org-20190930/ob-latex.el @@ -1,10 +1,10 @@ ;;; ob-latex.el --- Babel Functions for LaTeX -*- lexical-binding: t; -*- -;; Copyright (C) 2009-2017 Free Software Foundation, Inc. +;; Copyright (C) 2009-2019 Free Software Foundation, Inc. ;; Author: Eric Schulte ;; Keywords: literate programming, reproducible research -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; This file is part of GNU Emacs. @@ -31,12 +31,12 @@ ;;; Code: (require 'ob) +(require 'org-macs) (declare-function org-create-formula-image "org" (string tofile options buffer &optional type)) (declare-function org-latex-compile "ox-latex" (texfile &optional snippet)) (declare-function org-latex-guess-inputenc "ox-latex" (header)) (declare-function org-splice-latex-header "org" (tpl def-pkg pkg snippets-p &optional extra)) -(declare-function org-trim "org" (s &optional keep-lead)) (defvar org-babel-tangle-lang-exts) (add-to-list 'org-babel-tangle-lang-exts '("latex" . "tex")) diff --git a/elpa/org-20171030/ob-ledger.el b/elpa/org-20190930/ob-ledger.el similarity index 96% rename from elpa/org-20171030/ob-ledger.el rename to elpa/org-20190930/ob-ledger.el index 4f10ebe0..56599298 100644 --- a/elpa/org-20171030/ob-ledger.el +++ b/elpa/org-20190930/ob-ledger.el @@ -1,10 +1,10 @@ ;;; ob-ledger.el --- Babel Functions for Ledger -*- lexical-binding: t; -*- -;; Copyright (C) 2010-2017 Free Software Foundation, Inc. +;; Copyright (C) 2010-2019 Free Software Foundation, Inc. ;; Author: Eric S Fraga ;; Keywords: literate programming, reproducible research, accounting -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; This file is part of GNU Emacs. diff --git a/elpa/org-20171030/ob-lilypond.el b/elpa/org-20190930/ob-lilypond.el similarity index 92% rename from elpa/org-20171030/ob-lilypond.el rename to elpa/org-20190930/ob-lilypond.el index 0cc85685..4538ed5c 100644 --- a/elpa/org-20171030/ob-lilypond.el +++ b/elpa/org-20190930/ob-lilypond.el @@ -1,10 +1,10 @@ ;;; ob-lilypond.el --- Babel Functions for Lilypond -*- lexical-binding: t; -*- -;; Copyright (C) 2010-2017 Free Software Foundation, Inc. +;; Copyright (C) 2010-2019 Free Software Foundation, Inc. ;; Author: Martyn Jago ;; Keywords: babel language, literate programming -;; Homepage: http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-lilypond.html +;; Homepage: https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-lilypond.html ;; This file is part of GNU Emacs. @@ -24,7 +24,7 @@ ;;; Commentary: ;; Installation, ob-lilypond documentation, and examples are available at -;; http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-lilypond.html +;; https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-lilypond.html ;; ;; Lilypond documentation can be found at ;; http://lilypond.org/manuals.html @@ -33,7 +33,9 @@ ;;; Code: (require 'ob) -(require 'outline) + +(declare-function org-show-all "org" (&optional types)) + (defalias 'lilypond-mode 'LilyPond-mode) (add-to-list 'org-babel-tangle-lang-exts '("LilyPond" . "ly")) @@ -41,20 +43,20 @@ (defvar org-babel-default-header-args:lilypond '() "Default header arguments for lilypond code blocks. NOTE: The arguments are determined at lilypond compile time. -See (org-babel-lilypond-set-header-args)") +See `org-babel-lilypond-set-header-args'.") (defvar org-babel-lilypond-compile-post-tangle t "Following the org-babel-tangle (C-c C-v t) command, org-babel-lilypond-compile-post-tangle determines whether ob-lilypond should automatically attempt to compile the resultant tangled file. If the value is nil, no automated compilation takes place. -Default value is t") +Default value is t.") (defvar org-babel-lilypond-display-pdf-post-tangle t "Following a successful LilyPond compilation org-babel-lilypond-display-pdf-post-tangle determines whether to automate the drawing / redrawing of the resultant pdf. If the value is nil, -the pdf is not automatically redrawn. Default value is t") +the pdf is not automatically redrawn. Default value is t.") (defvar org-babel-lilypond-play-midi-post-tangle t "Following a successful LilyPond compilation @@ -150,7 +152,7 @@ Depending on whether we are in arrange mode either: (defun org-babel-lilypond-tangle () "ob-lilypond specific tangle, attempts to invoke =ly-execute-tangled-ly= if tangle is successful. Also passes -specific arguments to =org-babel-tangle=" +specific arguments to =org-babel-tangle=." (interactive) (if (org-babel-tangle nil "yes" "lilypond") (org-babel-lilypond-execute-tangled-ly) nil)) @@ -187,7 +189,7 @@ specific arguments to =org-babel-tangle=" (defun org-babel-lilypond-execute-tangled-ly () "Compile result of block tangle with lilypond. -If error in compilation, attempt to mark the error in lilypond org file" +If error in compilation, attempt to mark the error in lilypond org file." (when org-babel-lilypond-compile-post-tangle (let ((org-babel-lilypond-tangled-file (org-babel-lilypond-switch-extension (buffer-file-name) ".lilypond")) @@ -210,8 +212,8 @@ If error in compilation, attempt to mark the error in lilypond org file" (org-babel-lilypond-attempt-to-play-midi org-babel-lilypond-temp-file))))) (defun org-babel-lilypond-compile-lilyfile (file-name &optional test) - "Compile lilypond file and check for compile errors -FILE-NAME is full path to lilypond (.ly) file" + "Compile lilypond file and check for compile errors. +FILE-NAME is full path to lilypond (.ly) file." (message "Compiling LilyPond...") (let ((arg-1 org-babel-lilypond-ly-command) ;program (arg-2 nil) ;infile @@ -237,7 +239,7 @@ This is performed by parsing the *lilypond* buffer containing the output message from the compilation. FILE-NAME is full path to lilypond file. If TEST is t just return nil if no error found, and pass -nil as file-name since it is unused in this context" +nil as file-name since it is unused in this context." (let ((is-error (search-forward "error:" nil t))) (if test is-error @@ -246,7 +248,7 @@ nil as file-name since it is unused in this context" (defun org-babel-lilypond-process-compile-error (file-name) "Process the compilation error that has occurred. -FILE-NAME is full path to lilypond file" +FILE-NAME is full path to lilypond file." (let ((line-num (org-babel-lilypond-parse-line-num))) (let ((error-lines (org-babel-lilypond-parse-error-line file-name line-num))) (org-babel-lilypond-mark-error-line file-name error-lines) @@ -255,7 +257,7 @@ FILE-NAME is full path to lilypond file" (defun org-babel-lilypond-mark-error-line (file-name line) "Mark the erroneous lines in the lilypond org buffer. FILE-NAME is full path to lilypond file. -LINE is the erroneous line" +LINE is the erroneous line." (switch-to-buffer-other-window (concat (file-name-nondirectory (org-babel-lilypond-switch-extension file-name ".org")))) @@ -264,7 +266,7 @@ LINE is the erroneous line" (setq case-fold-search nil) (if (search-forward line nil t) (progn - (outline-show-all) + (org-show-all) (set-mark (point)) (goto-char (- (point) (length line)))) (goto-char temp)))) @@ -286,9 +288,9 @@ LINE is the erroneous line" (and (numberp num) num))))) (defun org-babel-lilypond-parse-error-line (file-name lineNo) - "Extract the erroneous line from the tangled .ly file + "Extract the erroneous line from the tangled .ly file. FILE-NAME is full path to lilypond file. -LINENO is the number of the erroneous line" +LINENO is the number of the erroneous line." (with-temp-buffer (insert-file-contents (org-babel-lilypond-switch-extension file-name ".ly") nil nil nil t) @@ -300,9 +302,9 @@ LINENO is the number of the erroneous line" nil))) (defun org-babel-lilypond-attempt-to-open-pdf (file-name &optional test) - "Attempt to display the generated pdf file -FILE-NAME is full path to lilypond file -If TEST is non-nil, the shell command is returned and is not run" + "Attempt to display the generated pdf file. +FILE-NAME is full path to lilypond file. +If TEST is non-nil, the shell command is returned and is not run." (when org-babel-lilypond-display-pdf-post-tangle (let ((pdf-file (org-babel-lilypond-switch-extension file-name ".pdf"))) (if (file-exists-p pdf-file) @@ -318,9 +320,9 @@ If TEST is non-nil, the shell command is returned and is not run" (message "No pdf file generated so can't display!"))))) (defun org-babel-lilypond-attempt-to-play-midi (file-name &optional test) - "Attempt to play the generated MIDI file -FILE-NAME is full path to lilypond file -If TEST is non-nil, the shell command is returned and is not run" + "Attempt to play the generated MIDI file. +FILE-NAME is full path to lilypond file. +If TEST is non-nil, the shell command is returned and is not run." (when org-babel-lilypond-play-midi-post-tangle (let ((midi-file (org-babel-lilypond-switch-extension file-name ".midi"))) (if (file-exists-p midi-file) @@ -383,14 +385,13 @@ If TEST is non-nil, the shell command is returned and is not run" (if org-babel-lilypond-arrange-mode "ENABLED." "DISABLED.")))) (defun org-babel-lilypond-switch-extension (file-name ext) - "Utility command to swap current FILE-NAME extension with EXT" + "Utility command to swap current FILE-NAME extension with EXT." (concat (file-name-sans-extension file-name) ext)) (defun org-babel-lilypond-get-header-args (mode) - "Default arguments to use when evaluating a lilypond -source block. These depend upon whether we are in arrange -mode i.e. ARRANGE-MODE is t" + "Default arguments to use when evaluating a lilypond source block. +These depend upon whether we are in Arrange mode i.e. MODE is t." (cond (mode '((:tangle . "yes") (:noweb . "yes") @@ -403,7 +404,7 @@ mode i.e. ARRANGE-MODE is t" (defun org-babel-lilypond-set-header-args (mode) "Set org-babel-default-header-args:lilypond -dependent on ORG-BABEL-LILYPOND-ARRANGE-MODE" +dependent on ORG-BABEL-LILYPOND-ARRANGE-MODE." (setq org-babel-default-header-args:lilypond (org-babel-lilypond-get-header-args mode))) diff --git a/elpa/org-20171030/ob-lisp.el b/elpa/org-20190930/ob-lisp.el similarity index 96% rename from elpa/org-20171030/ob-lisp.el rename to elpa/org-20190930/ob-lisp.el index d98098e1..e717fc34 100644 --- a/elpa/org-20171030/ob-lisp.el +++ b/elpa/org-20190930/ob-lisp.el @@ -1,12 +1,12 @@ ;;; ob-lisp.el --- Babel Functions for Common Lisp -*- lexical-binding: t; -*- -;; Copyright (C) 2009-2017 Free Software Foundation, Inc. +;; Copyright (C) 2009-2019 Free Software Foundation, Inc. ;; Authors: Joel Boehland ;; Eric Schulte ;; David T. O'Toole ;; Keywords: literate programming, reproducible research -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; This file is part of GNU Emacs. @@ -37,10 +37,10 @@ ;;; Code: (require 'ob) +(require 'org-macs) (declare-function sly-eval "ext:sly" (sexp &optional package)) (declare-function slime-eval "ext:slime" (sexp &optional package)) -(declare-function org-trim "org" (s &optional keep-lead)) (defvar org-babel-tangle-lang-exts) (add-to-list 'org-babel-tangle-lang-exts '("lisp" . "lisp")) @@ -54,7 +54,7 @@ Valid values include `slime-eval' and `sly-eval'." :group 'org-babel :version "26.1" :package-version '(Org . "9.0") - :type 'function) + :type 'symbol) (defcustom org-babel-lisp-dir-fmt "(let ((*default-pathname-defaults* #P%S\n)) %%s\n)" diff --git a/elpa/org-20171030/ob-lob.el b/elpa/org-20190930/ob-lob.el similarity index 68% rename from elpa/org-20171030/ob-lob.el rename to elpa/org-20190930/ob-lob.el index 13f728f3..a6194c4b 100644 --- a/elpa/org-20171030/ob-lob.el +++ b/elpa/org-20190930/ob-lob.el @@ -1,11 +1,11 @@ ;;; ob-lob.el --- Functions Supporting the Library of Babel -*- lexical-binding: t; -*- -;; Copyright (C) 2009-2017 Free Software Foundation, Inc. +;; Copyright (C) 2009-2019 Free Software Foundation, Inc. ;; 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. @@ -62,7 +62,7 @@ should not be inherited from a source block.") (cons (cons source info) (assq-delete-all source org-babel-library-of-babel)))) (cl-incf lob-ingest-count)))) - (message "%d src block%s added to Library of Babel" + (message "%d source block%s added to Library of Babel" lob-ingest-count (if (> lob-ingest-count 1) "s" "")) lob-ingest-count)) @@ -79,44 +79,54 @@ if so then run the appropriate source block from the Library." (org-babel-execute-src-block nil info) t))) -(defun org-babel-lob--src-info (name) - "Return internal representation for Babel data named NAME. -NAME is a string. This function looks into the current document +(defun org-babel-lob--src-info (ref) + "Return internal representation for Babel data referenced as REF. +REF is a string. This function looks into the current document for a Babel call or source block. If none is found, it looks -after NAME in the Library of Babel. Eventually, if that also -fails, it returns nil." - ;; During export, look into the pristine copy of the document being - ;; exported instead of the current one, which could miss some data. - (with-current-buffer (or org-babel-exp-reference-buffer (current-buffer)) - (org-with-wide-buffer - (goto-char (point-min)) - (catch :found - (let ((case-fold-search t) - (regexp (org-babel-named-data-regexp-for-name name))) - (while (re-search-forward regexp nil t) - (let ((element (org-element-at-point))) - (when (equal name (org-element-property :name element)) - (throw :found - (pcase (org-element-type element) - (`src-block (org-babel-get-src-block-info t element)) - (`babel-call (org-babel-lob-get-info element)) - ;; Non-executable data found. Since names are - ;; supposed to be unique throughout a document, - ;; bail out. - (_ nil)))))) - ;; No element named NAME in buffer. Try Library of Babel. - (cdr (assoc-string name org-babel-library-of-babel))))))) +after REF in the Library of Babel." + (let ((name ref) + (file nil)) + ;; Extract the remote file, if specified in the reference. + (when (string-match "\\`\\(.+\\):\\(.+\\)\\'" ref) + (setq file (match-string 1 ref)) + (setq name (match-string 2 ref))) + ;; During export, look into the pristine copy of the document + ;; being exported instead of the current one, which could miss + ;; some data. + (with-current-buffer (cond (file (find-file-noselect file t)) + (org-babel-exp-reference-buffer) + (t (current-buffer))) + (org-with-point-at 1 + (catch :found + (let ((case-fold-search t) + (regexp (org-babel-named-data-regexp-for-name name))) + (while (re-search-forward regexp nil t) + (let ((element (org-element-at-point))) + (when (equal name (org-element-property :name element)) + (throw :found + (pcase (org-element-type element) + (`src-block (org-babel-get-src-block-info t element)) + (`babel-call (org-babel-lob-get-info element)) + ;; Non-executable data found. Since names + ;; are supposed to be unique throughout + ;; a document, bail out. + (_ nil)))))) + (cdr (assoc-string ref org-babel-library-of-babel)))))))) ;;;###autoload (defun org-babel-lob-get-info (&optional datum) "Return internal representation for Library of Babel function call. -Consider DATUM, when provided, or element at point. Return nil -when not on an appropriate location. Otherwise return a list -compatible with `org-babel-get-src-block-info', which see." + +Consider DATUM, when provided, or element at point otherwise. + +Return nil when not on an appropriate location. Otherwise return +a list compatible with `org-babel-get-src-block-info', which +see." (let* ((context (or datum (org-element-context))) - (type (org-element-type context))) + (type (org-element-type context)) + (reference (org-element-property :call context))) (when (memq type '(babel-call inline-babel-call)) - (pcase (org-babel-lob--src-info (org-element-property :call context)) + (pcase (org-babel-lob--src-info reference) (`(,language ,body ,header ,_ ,_ ,_ ,coderef) (let ((begin (org-element-property (if (eq type 'inline-babel-call) :begin @@ -128,9 +138,8 @@ compatible with `org-babel-get-src-block-info', which see." header org-babel-default-lob-header-args (append - (org-with-wide-buffer - (goto-char begin) - (org-babel-params-from-properties language)) + (org-with-point-at begin + (org-babel-params-from-properties language)) (list (org-babel-parse-header-arguments (org-element-property :inside-header context)) diff --git a/elpa/org-20171030/ob-lua.el b/elpa/org-20190930/ob-lua.el similarity index 96% rename from elpa/org-20171030/ob-lua.el rename to elpa/org-20190930/ob-lua.el index fc9d9f2f..9a665057 100644 --- a/elpa/org-20171030/ob-lua.el +++ b/elpa/org-20190930/ob-lua.el @@ -1,10 +1,10 @@ ;;; ob-lua.el --- Org Babel functions for Lua evaluation -*- lexical-binding: t; -*- -;; Copyright (C) 2014, 2016-2017 Free Software Foundation, Inc. +;; Copyright (C) 2014, 2016-2019 Free Software Foundation, Inc. ;; Authors: Dieter Schoen ;; Keywords: literate programming, reproducible research -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; This file is part of GNU Emacs. @@ -34,10 +34,9 @@ ;;; Code: (require 'ob) +(require 'org-macs) (require 'cl-lib) -(declare-function org-remove-indentation "org" (code &optional n)) -(declare-function org-trim "org" (s &optional keep-lead)) (declare-function lua-shell "ext:lua-mode" (&optional argprompt)) (declare-function lua-toggle-shells "ext:lua-mode" (arg)) (declare-function run-lua "ext:lua" (cmd &optional dedicated show)) @@ -101,7 +100,7 @@ This function is called by `org-babel-execute-src-block'." (defun org-babel-prep-session:lua (session params) "Prepare SESSION according to the header arguments in PARAMS. -VARS contains resolved variable references" +VARS contains resolved variable references." (let* ((session (org-babel-lua-initiate-session session)) (var-lines (org-babel-variable-assignments:lua params))) @@ -149,7 +148,7 @@ specifying a variable of the same value." (if (eq var 'hline) org-babel-lua-hline-to (format - (if (and (stringp var) (string-match "[\n\r]" var)) "\"\"%S\"\"" "%S") + (if (and (stringp var) (string-match "[\n\r]" var)) "[=[%s]=]" "%S") (if (stringp var) (substring-no-properties var) var))))) (defun org-babel-lua-table-or-string (results) @@ -291,13 +290,13 @@ last statement in BODY, as elisp." (let ((raw (pcase result-type (`output (org-babel-eval org-babel-lua-command - (concat (if preamble (concat preamble "\n")) + (concat preamble (and preamble "\n") body))) (`value (let ((tmp-file (org-babel-temp-file "lua-"))) (org-babel-eval org-babel-lua-command (concat - (if preamble (concat preamble "\n") "") + preamble (and preamble "\n") (format (if (member "pp" result-params) org-babel-lua-pp-wrapper-method diff --git a/elpa/org-20171030/ob-makefile.el b/elpa/org-20190930/ob-makefile.el similarity index 94% rename from elpa/org-20171030/ob-makefile.el rename to elpa/org-20190930/ob-makefile.el index 14190ac1..938d17bd 100644 --- a/elpa/org-20171030/ob-makefile.el +++ b/elpa/org-20190930/ob-makefile.el @@ -1,11 +1,11 @@ ;;; ob-makefile.el --- Babel Functions for Makefile -*- lexical-binding: t; -*- -;; Copyright (C) 2009-2017 Free Software Foundation, Inc. +;; Copyright (C) 2009-2019 Free Software Foundation, Inc. ;; Author: Eric Schulte ;; Thomas S. Dye ;; Keywords: literate programming, reproducible research -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; This file is part of GNU Emacs. diff --git a/elpa/org-20171030/ob-matlab.el b/elpa/org-20190930/ob-matlab.el similarity index 93% rename from elpa/org-20171030/ob-matlab.el rename to elpa/org-20190930/ob-matlab.el index e30ce8da..4ad188ad 100644 --- a/elpa/org-20171030/ob-matlab.el +++ b/elpa/org-20190930/ob-matlab.el @@ -1,10 +1,10 @@ ;;; ob-matlab.el --- Babel support for Matlab -*- lexical-binding: t; -*- -;; Copyright (C) 2010-2017 Free Software Foundation, Inc. +;; Copyright (C) 2010-2019 Free Software Foundation, Inc. ;; Author: Dan Davison ;; Keywords: literate programming, reproducible research -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; This file is part of GNU Emacs. diff --git a/elpa/org-20171030/ob-maxima.el b/elpa/org-20190930/ob-maxima.el similarity index 98% rename from elpa/org-20171030/ob-maxima.el rename to elpa/org-20190930/ob-maxima.el index 224b3605..c8f3a61f 100644 --- a/elpa/org-20171030/ob-maxima.el +++ b/elpa/org-20190930/ob-maxima.el @@ -1,11 +1,11 @@ ;;; ob-maxima.el --- Babel Functions for Maxima -*- lexical-binding: t; -*- -;; Copyright (C) 2009-2017 Free Software Foundation, Inc. +;; Copyright (C) 2009-2019 Free Software Foundation, Inc. ;; Author: Eric S Fraga ;; Eric Schulte ;; Keywords: literate programming, reproducible research, maxima -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; This file is part of GNU Emacs. diff --git a/elpa/org-20171030/ob-mscgen.el b/elpa/org-20190930/ob-mscgen.el similarity index 96% rename from elpa/org-20171030/ob-mscgen.el rename to elpa/org-20190930/ob-mscgen.el index 784e0a94..86fcc284 100644 --- a/elpa/org-20171030/ob-mscgen.el +++ b/elpa/org-20190930/ob-mscgen.el @@ -1,10 +1,10 @@ ;;; ob-msc.el --- Babel Functions for Mscgen -*- lexical-binding: t; -*- -;; Copyright (C) 2010-2017 Free Software Foundation, Inc. +;; Copyright (C) 2010-2019 Free Software Foundation, Inc. ;; Author: Juan Pechiar ;; Keywords: literate programming, reproducible research -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; This file is part of GNU Emacs. diff --git a/elpa/org-20171030/ob-ocaml.el b/elpa/org-20190930/ob-ocaml.el similarity index 97% rename from elpa/org-20171030/ob-ocaml.el rename to elpa/org-20190930/ob-ocaml.el index fd0ddf8a..0c0ffe44 100644 --- a/elpa/org-20171030/ob-ocaml.el +++ b/elpa/org-20190930/ob-ocaml.el @@ -1,10 +1,10 @@ ;;; ob-ocaml.el --- Babel Functions for Ocaml -*- lexical-binding: t; -*- -;; Copyright (C) 2009-2017 Free Software Foundation, Inc. +;; Copyright (C) 2009-2019 Free Software Foundation, Inc. ;; Author: Eric Schulte ;; Keywords: literate programming, reproducible research -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; This file is part of GNU Emacs. @@ -37,11 +37,11 @@ ;;; Code: (require 'ob) (require 'comint) +(require 'org-macs) (declare-function tuareg-run-caml "ext:tuareg" ()) (declare-function tuareg-run-ocaml "ext:tuareg" ()) (declare-function tuareg-interactive-send-input "ext:tuareg" ()) -(declare-function org-trim "org" (s &optional keep-lead)) (defvar org-babel-tangle-lang-exts) (add-to-list 'org-babel-tangle-lang-exts '("ocaml" . "ml")) diff --git a/elpa/org-20171030/ob-octave.el b/elpa/org-20190930/ob-octave.el similarity index 95% rename from elpa/org-20171030/ob-octave.el rename to elpa/org-20190930/ob-octave.el index 0f516062..d334fa51 100644 --- a/elpa/org-20171030/ob-octave.el +++ b/elpa/org-20190930/ob-octave.el @@ -1,10 +1,10 @@ ;;; ob-octave.el --- Babel Functions for Octave and Matlab -*- lexical-binding: t; -*- -;; Copyright (C) 2010-2017 Free Software Foundation, Inc. +;; Copyright (C) 2010-2019 Free Software Foundation, Inc. ;; Author: Dan Davison ;; Keywords: literate programming, reproducible research -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; This file is part of GNU Emacs. @@ -30,10 +30,10 @@ ;;; Code: (require 'ob) +(require 'org-macs) (declare-function matlab-shell "ext:matlab-mode") (declare-function matlab-shell-run-region "ext:matlab-mode") -(declare-function org-trim "org" (s &optional keep-lead)) (defvar org-babel-default-header-args:matlab '()) (defvar org-babel-default-header-args:octave '()) @@ -237,13 +237,11 @@ value of the last statement in BODY, as elisp." (`output (setq results (if matlabp - (cdr (reverse (delq "" (mapcar - #'org-babel-strip-quotes - (mapcar #'org-trim raw))))) + (cdr (reverse (delq "" (mapcar #'org-strip-quotes + (mapcar #'org-trim raw))))) (cdr (member org-babel-octave-eoe-output - (reverse (mapcar - #'org-babel-strip-quotes - (mapcar #'org-trim raw))))))) + (reverse (mapcar #'org-strip-quotes + (mapcar #'org-trim raw))))))) (mapconcat #'identity (reverse results) "\n"))))) (defun org-babel-octave-import-elisp-from-file (file-name) @@ -254,9 +252,9 @@ This removes initial blank and comment lines and then calls (with-temp-file temp-file (insert-file-contents file-name) (re-search-forward "^[ \t]*[^# \t]" nil t) - (if (< (setq beg (point-min)) - (setq end (point-at-bol))) - (delete-region beg end))) + (when (< (setq beg (point-min)) + (setq end (point-at-bol))) + (delete-region beg end))) (org-babel-import-elisp-from-file temp-file '(16)))) (provide 'ob-octave) diff --git a/elpa/org-20171030/ob-org.el b/elpa/org-20190930/ob-org.el similarity index 94% rename from elpa/org-20171030/ob-org.el rename to elpa/org-20190930/ob-org.el index 232c2d01..def25096 100644 --- a/elpa/org-20171030/ob-org.el +++ b/elpa/org-20190930/ob-org.el @@ -1,10 +1,10 @@ ;;; ob-org.el --- Babel Functions for Org Code Blocks -*- lexical-binding: t; -*- -;; Copyright (C) 2010-2017 Free Software Foundation, Inc. +;; Copyright (C) 2010-2019 Free Software Foundation, Inc. ;; Author: Eric Schulte ;; Keywords: literate programming, reproducible research -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; This file is part of GNU Emacs. @@ -34,7 +34,7 @@ (defvar org-babel-default-header-args:org '((:results . "raw silent") (:exports . "code")) - "Default arguments for evaluating a org source block.") + "Default arguments for evaluating an org source block.") (defvar org-babel-org-default-header "#+TITLE: default empty header\n" diff --git a/elpa/org-20171030/ob-perl.el b/elpa/org-20190930/ob-perl.el similarity index 98% rename from elpa/org-20171030/ob-perl.el rename to elpa/org-20190930/ob-perl.el index 2f462cf4..810271f5 100644 --- a/elpa/org-20171030/ob-perl.el +++ b/elpa/org-20190930/ob-perl.el @@ -1,11 +1,11 @@ ;;; ob-perl.el --- Babel Functions for Perl -*- lexical-binding: t; -*- -;; Copyright (C) 2009-2017 Free Software Foundation, Inc. +;; Copyright (C) 2009-2019 Free Software Foundation, Inc. ;; Authors: Dan Davison ;; Eric Schulte ;; Keywords: literate programming, reproducible research -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; This file is part of GNU Emacs. diff --git a/elpa/org-20171030/ob-picolisp.el b/elpa/org-20190930/ob-picolisp.el similarity index 94% rename from elpa/org-20171030/ob-picolisp.el rename to elpa/org-20190930/ob-picolisp.el index a1dbe6de..4f702529 100644 --- a/elpa/org-20171030/ob-picolisp.el +++ b/elpa/org-20190930/ob-picolisp.el @@ -1,11 +1,11 @@ ;;; ob-picolisp.el --- Babel Functions for Picolisp -*- lexical-binding: t; -*- -;; Copyright (C) 2010-2017 Free Software Foundation, Inc. +;; Copyright (C) 2010-2019 Free Software Foundation, Inc. ;; 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. @@ -35,13 +35,13 @@ ;; (http://picolisp.com/5000/-2.html). PicoLisp is included in some ;; GNU/Linux Distributions, and can be downloaded here: ;; http://software-lab.de/down.html. It ships with a picolisp-mode and -;; a inferior-picolisp-mode for Emacs (to be found in the /lib/el/ +;; an inferior-picolisp-mode for Emacs (to be found in the /lib/el/ ;; directory). ;; Although it might seem more natural to use Emacs Lisp for most -;; Lisp-based programming tasks inside Org-Mode, an Emacs library -;; written in Emacs Lisp, PicoLisp has at least two outstanding -;; features that make it a valuable addition to Org-Babel: +;; Lisp-based programming tasks inside Org, an Emacs library written +;; in Emacs Lisp, PicoLisp has at least two outstanding features that +;; make it a valuable addition to Org Babel: ;; PicoLisp _is_ an object-oriented database with a Prolog-based query ;; language implemented in PicoLisp (Pilog). Database objects are @@ -94,8 +94,8 @@ body))) (defun org-babel-execute:picolisp (body params) - "Execute a block of Picolisp code with org-babel. This function is - called by `org-babel-execute-src-block'" + "Execute a block of Picolisp code with org-babel. +This function is called by `org-babel-execute-src-block'." (message "executing Picolisp source code block") (let* ( ;; Name of the session or "none". diff --git a/elpa/org-20171030/ob-plantuml.el b/elpa/org-20190930/ob-plantuml.el similarity index 98% rename from elpa/org-20171030/ob-plantuml.el rename to elpa/org-20190930/ob-plantuml.el index 8093100e..91229a29 100644 --- a/elpa/org-20171030/ob-plantuml.el +++ b/elpa/org-20190930/ob-plantuml.el @@ -1,10 +1,10 @@ ;;; ob-plantuml.el --- Babel Functions for Plantuml -*- lexical-binding: t; -*- -;; Copyright (C) 2010-2017 Free Software Foundation, Inc. +;; Copyright (C) 2010-2019 Free Software Foundation, Inc. ;; Author: Zhang Weize ;; Keywords: literate programming, reproducible research -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; This file is part of GNU Emacs. diff --git a/elpa/org-20171030/ob-processing.el b/elpa/org-20190930/ob-processing.el similarity index 98% rename from elpa/org-20171030/ob-processing.el rename to elpa/org-20190930/ob-processing.el index 4e09abc9..7bb9fa1b 100644 --- a/elpa/org-20171030/ob-processing.el +++ b/elpa/org-20190930/ob-processing.el @@ -1,10 +1,10 @@ ;;; ob-processing.el --- Babel functions for processing -*- lexical-binding: t; -*- -;; Copyright (C) 2015-2017 Free Software Foundation, Inc. +;; Copyright (C) 2015-2019 Free Software Foundation, Inc. ;; 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. @@ -135,7 +135,7 @@ This function is called by `org-babel-execute-src-block'." (defun org-babel-prep-session:processing (_session _params) "Return an error if the :session header argument is set. -Processing does not support sessions" +Processing does not support sessions." (error "Processing does not support sessions")) (defun org-babel-variable-assignments:processing (params) diff --git a/elpa/org-20171030/ob-python.el b/elpa/org-20190930/ob-python.el similarity index 88% rename from elpa/org-20171030/ob-python.el rename to elpa/org-20190930/ob-python.el index 60ec5fa4..c36bf2dc 100644 --- a/elpa/org-20171030/ob-python.el +++ b/elpa/org-20190930/ob-python.el @@ -1,11 +1,11 @@ ;;; ob-python.el --- Babel Functions for Python -*- lexical-binding: t; -*- -;; Copyright (C) 2009-2017 Free Software Foundation, Inc. +;; Copyright (C) 2009-2019 Free Software Foundation, Inc. ;; 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. @@ -28,9 +28,8 @@ ;;; Code: (require 'ob) +(require 'org-macs) -(declare-function org-remove-indentation "org" ) -(declare-function org-trim "org" (s &optional keep-lead)) (declare-function py-shell "ext:python-mode" (&optional argprompt)) (declare-function py-toggle-shells "ext:python-mode" (arg)) (declare-function run-python "ext:python" (&optional cmd dedicated show)) @@ -98,7 +97,7 @@ This function is called by `org-babel-execute-src-block'." (defun org-babel-prep-session:python (session params) "Prepare SESSION according to the header arguments in PARAMS. -VARS contains resolved variable references" +VARS contains resolved variable references." (let* ((session (org-babel-python-initiate-session session)) (var-lines (org-babel-variable-assignments:python params))) @@ -239,6 +238,15 @@ def main(): open('%s', 'w').write( pprint.pformat(main()) )") +(defconst org-babel-python--exec-tmpfile + (concat + "__org_babel_python_fname = '%s'; " + "__org_babel_python_fh = open(__org_babel_python_fname); " + "exec(compile(" + "__org_babel_python_fh.read(), __org_babel_python_fname, 'exec'" + ")); " + "__org_babel_python_fh.close()")) + (defun org-babel-python-evaluate (session body &optional result-type result-params preamble) "Evaluate BODY as Python code." @@ -257,13 +265,13 @@ last statement in BODY, as elisp." (let ((raw (pcase result-type (`output (org-babel-eval org-babel-python-command - (concat (if preamble (concat preamble "\n")) + (concat preamble (and preamble "\n") body))) (`value (let ((tmp-file (org-babel-temp-file "python-"))) (org-babel-eval org-babel-python-command (concat - (if preamble (concat preamble "\n") "") + preamble (and preamble "\n") (format (if (member "pp" result-params) org-babel-python-pp-wrapper-method @@ -299,23 +307,42 @@ last statement in BODY, as elisp." (list (format "open('%s', 'w').write(str(_))" (org-babel-process-file-name tmp-file 'noquote))))))) + (last-indent 0) (input-body (lambda (body) - (mapc (lambda (line) (insert line) (funcall send-wait)) - (split-string body "[\r\n]")) + (dolist (line (split-string body "[\r\n]")) + ;; Insert a blank line to end an indent + ;; block. + (let ((curr-indent (string-match "\\S-" line))) + (if curr-indent + (progn + (when (< curr-indent last-indent) + (insert "") + (funcall send-wait)) + (setq last-indent curr-indent)) + (setq last-indent 0))) + (insert line) + (funcall send-wait)) (funcall send-wait))) (results (pcase result-type (`output - (mapconcat - #'org-trim - (butlast - (org-babel-comint-with-output - (session org-babel-python-eoe-indicator t body) - (funcall input-body body) - (funcall send-wait) (funcall send-wait) - (insert org-babel-python-eoe-indicator) - (funcall send-wait)) - 2) "\n")) + (let ((body (if (string-match-p ".\n+." body) ; Multiline + (let ((tmp-src-file (org-babel-temp-file + "python-"))) + (with-temp-file tmp-src-file (insert body)) + (format org-babel-python--exec-tmpfile + tmp-src-file)) + body))) + (mapconcat + #'org-trim + (butlast + (org-babel-comint-with-output + (session org-babel-python-eoe-indicator t body) + (funcall input-body body) + (funcall send-wait) (funcall send-wait) + (insert org-babel-python-eoe-indicator) + (funcall send-wait)) + 2) "\n"))) (`value (let ((tmp-file (org-babel-temp-file "python-"))) (org-babel-comint-with-output diff --git a/elpa/org-20171030/ob-ref.el b/elpa/org-20190930/ob-ref.el similarity index 91% rename from elpa/org-20171030/ob-ref.el rename to elpa/org-20190930/ob-ref.el index 323cdc7e..8c066f71 100644 --- a/elpa/org-20171030/ob-ref.el +++ b/elpa/org-20190930/ob-ref.el @@ -1,11 +1,11 @@ ;;; ob-ref.el --- Babel Functions for Referencing External Data -*- lexical-binding: t; -*- -;; Copyright (C) 2009-2017 Free Software Foundation, Inc. +;; Copyright (C) 2009-2019 Free Software Foundation, Inc. ;; 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. @@ -37,8 +37,8 @@ ;; - resource-id :: the id or name of the resource -;; So an example of a simple src block referencing table data in the -;; same file would be +;; So an example of a simple source block referencing table data in +;; the same file would be ;; #+NAME: sandbox ;; | 1 | 2 | 3 | @@ -50,6 +50,7 @@ ;;; Code: (require 'ob-core) +(require 'org-macs) (require 'cl-lib) (declare-function org-babel-lob-get-info "ob-lob" (&optional datum)) @@ -63,26 +64,22 @@ (declare-function org-in-commented-heading-p "org" (&optional no-inheritance)) (declare-function org-narrow-to-subtree "org" ()) (declare-function org-show-context "org" (&optional key)) -(declare-function org-trim "org" (s &optional keep-lead)) - -(defvar org-babel-ref-split-regexp - "[ \f\t\n\r\v]*\\(.+?\\)[ \f\t\n\r\v]*=[ \f\t\n\r\v]*\\(.+\\)[ \f\t\n\r\v]*") (defvar org-babel-update-intermediate nil "Update the in-buffer results of code blocks executed to resolve references.") (defun org-babel-ref-parse (assignment) "Parse a variable ASSIGNMENT in a header argument. + If the right hand side of the assignment has a literal value -return that value, otherwise interpret as a reference to an -external resource and find its value using -`org-babel-ref-resolve'. Return a list with two elements. The -first element of the list will be the name of the variable, and -the second will be an emacs-lisp representation of the value of -the variable." - (when (string-match org-babel-ref-split-regexp assignment) - (let ((var (match-string 1 assignment)) - (ref (match-string 2 assignment))) +return that value, otherwise interpret it as a reference to an +external resource and find its value using `org-babel-ref-resolve'. + +Return a list with two elements: the name of the variable, and an +Emacs Lisp representation of the value of the variable." + (when (string-match "\\(.+?\\)=" assignment) + (let ((var (org-trim (match-string 1 assignment))) + (ref (org-trim (substring assignment (match-end 0))))) (cons (intern var) (let ((out (save-excursion (when org-babel-current-src-block-location diff --git a/elpa/org-20171030/ob-ruby.el b/elpa/org-20190930/ob-ruby.el similarity index 97% rename from elpa/org-20171030/ob-ruby.el rename to elpa/org-20190930/ob-ruby.el index d9525ea3..be76727a 100644 --- a/elpa/org-20171030/ob-ruby.el +++ b/elpa/org-20190930/ob-ruby.el @@ -1,10 +1,10 @@ ;;; ob-ruby.el --- Babel Functions for Ruby -*- lexical-binding: t; -*- -;; Copyright (C) 2009-2017 Free Software Foundation, Inc. +;; Copyright (C) 2009-2019 Free Software Foundation, Inc. ;; Author: Eric Schulte ;; Keywords: literate programming, reproducible research -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; This file is part of GNU Emacs. @@ -37,8 +37,8 @@ ;;; Code: (require 'ob) +(require 'org-macs) -(declare-function org-trim "org" (s &optional keep-lead)) (declare-function run-ruby "ext:inf-ruby" (&optional command name)) (declare-function xmp "ext:rcodetools" (&optional option)) @@ -215,7 +215,7 @@ return the value of the last statement in BODY, as elisp." (let ((eoe-string (format "puts \"%s\"" org-babel-ruby-eoe-indicator))) ;; Force the session to be ready before the actual session ;; code is run. There is some problem in comint that will - ;; sometimes show the prompt after the the input has already + ;; sometimes show the prompt after the input has already ;; been inserted and that throws off the extraction of the ;; result for Babel. (org-babel-comint-with-output diff --git a/elpa/org-20171030/ob-sass.el b/elpa/org-20190930/ob-sass.el similarity index 96% rename from elpa/org-20171030/ob-sass.el rename to elpa/org-20190930/ob-sass.el index 769c9011..b19314c6 100644 --- a/elpa/org-20171030/ob-sass.el +++ b/elpa/org-20190930/ob-sass.el @@ -1,10 +1,10 @@ ;;; ob-sass.el --- Babel Functions for the Sass CSS generation language -*- lexical-binding: t; -*- -;; Copyright (C) 2009-2017 Free Software Foundation, Inc. +;; Copyright (C) 2009-2019 Free Software Foundation, Inc. ;; Author: Eric Schulte ;; Keywords: literate programming, reproducible research -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; This file is part of GNU Emacs. diff --git a/elpa/org-20171030/ob-scheme.el b/elpa/org-20190930/ob-scheme.el similarity index 92% rename from elpa/org-20171030/ob-scheme.el rename to elpa/org-20190930/ob-scheme.el index f67080ad..251ed52b 100644 --- a/elpa/org-20171030/ob-scheme.el +++ b/elpa/org-20190930/ob-scheme.el @@ -1,11 +1,11 @@ ;;; ob-scheme.el --- Babel Functions for Scheme -*- lexical-binding: t; -*- -;; Copyright (C) 2010-2017 Free Software Foundation, Inc. +;; Copyright (C) 2010-2019 Free Software Foundation, Inc. ;; 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. @@ -40,6 +40,7 @@ ;;; Code: (require 'ob) (require 'geiser nil t) +(require 'geiser-impl nil t) (defvar geiser-repl--repl) ; Defined in geiser-repl.el (defvar geiser-impl--implementation) ; Defined in geiser-impl.el (defvar geiser-default-implementation) ; Defined in geiser-impl.el @@ -111,10 +112,9 @@ (or buffer (progn (run-geiser impl) - (if name - (progn - (rename-buffer name t) - (org-babel-scheme-set-session-buffer name (current-buffer)))) + (when name + (rename-buffer name t) + (org-babel-scheme-set-session-buffer name (current-buffer))) (current-buffer))))) (defun org-babel-scheme-make-session-name (buffer name impl) @@ -131,7 +131,7 @@ org-babel-scheme-execute-with-geiser will use a temporary session." (name))) (defmacro org-babel-scheme-capture-current-message (&rest body) - "Capture current message in both interactive and noninteractive mode" + "Capture current message in both interactive and noninteractive mode." `(if noninteractive (let ((original-message (symbol-function 'message)) (current-message nil)) @@ -147,10 +147,11 @@ org-babel-scheme-execute-with-geiser will use a temporary session." (current-message)))) (defun org-babel-scheme-execute-with-geiser (code output impl repl) - "Execute code in specified REPL. If the REPL doesn't exist, create it -using the given scheme implementation. + "Execute code in specified REPL. +If the REPL doesn't exist, create it using the given scheme +implementation. -Returns the output of executing the code if the output parameter +Returns the output of executing the code if the OUTPUT parameter is true; otherwise returns the last value." (let ((result nil)) (with-temp-buffer @@ -198,7 +199,7 @@ Emacs-lisp table, otherwise return the results as a string." (defun org-babel-execute:scheme (body params) "Execute a block of Scheme code with org-babel. -This function is called by `org-babel-execute-src-block'" +This function is called by `org-babel-execute-src-block'." (let* ((source-buffer (current-buffer)) (source-buffer-name (replace-regexp-in-string ;; zap surrounding * "^ ?\\*\\([^*]+\\)\\*" "\\1" @@ -212,6 +213,7 @@ This function is called by `org-babel-execute-src-block'" (session (org-babel-scheme-make-session-name source-buffer-name (cdr (assq :session params)) impl)) (full-body (org-babel-expand-body:scheme body params)) + (result-params (cdr (assq :result-params params))) (result (org-babel-scheme-execute-with-geiser full-body ; code @@ -225,7 +227,9 @@ This function is called by `org-babel-execute-src-block'" (cdr (assq :colnames params))) (org-babel-pick-name (cdr (assq :rowname-names params)) (cdr (assq :rownames params)))))) - (org-babel-scheme--table-or-string table)))))) + (org-babel-result-cond result-params + result + (org-babel-scheme--table-or-string table))))))) (provide 'ob-scheme) diff --git a/elpa/org-20171030/ob-screen.el b/elpa/org-20190930/ob-screen.el similarity index 98% rename from elpa/org-20171030/ob-screen.el rename to elpa/org-20190930/ob-screen.el index fbf167e0..a3d79841 100644 --- a/elpa/org-20171030/ob-screen.el +++ b/elpa/org-20190930/ob-screen.el @@ -1,10 +1,10 @@ ;;; ob-screen.el --- Babel Support for Interactive Terminal -*- lexical-binding: t; -*- -;; Copyright (C) 2009-2017 Free Software Foundation, Inc. +;; Copyright (C) 2009-2019 Free Software Foundation, Inc. ;; Author: Benjamin Andresen ;; Keywords: literate programming, interactive shell -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; This file is part of GNU Emacs. diff --git a/elpa/org-20171030/ob-sed.el b/elpa/org-20190930/ob-sed.el similarity index 96% rename from elpa/org-20171030/ob-sed.el rename to elpa/org-20190930/ob-sed.el index 7bd0bfb7..be4cff48 100644 --- a/elpa/org-20171030/ob-sed.el +++ b/elpa/org-20190930/ob-sed.el @@ -1,10 +1,10 @@ ;;; ob-sed.el --- Babel Functions for Sed Scripts -*- lexical-binding: t; -*- -;; Copyright (C) 2015-2017 Free Software Foundation, Inc. +;; Copyright (C) 2015-2019 Free Software Foundation, Inc. ;; Author: Bjarte Johansen ;; Keywords: literate programming, reproducible research -;; Version: 0.1.0 +;; Version: 0.1.1 ;; This file is part of GNU Emacs. @@ -79,7 +79,7 @@ function is called by `org-babel-execute-src-block'." (cmd (mapconcat #'identity (remq nil (list org-babel-sed-command - (format "--file=\"%s\"" code-file) + (format "-f \"%s\"" code-file) cmd-line in-file)) " "))) diff --git a/elpa/org-20171030/ob-shell.el b/elpa/org-20190930/ob-shell.el similarity index 75% rename from elpa/org-20171030/ob-shell.el rename to elpa/org-20190930/ob-shell.el index af64adb8..66c28f7f 100644 --- a/elpa/org-20171030/ob-shell.el +++ b/elpa/org-20190930/ob-shell.el @@ -1,10 +1,10 @@ ;;; ob-shell.el --- Babel Functions for Shell Evaluation -*- lexical-binding: t; -*- -;; Copyright (C) 2009-2017 Free Software Foundation, Inc. +;; Copyright (C) 2009-2019 Free Software Foundation, Inc. ;; Author: Eric Schulte ;; Keywords: literate programming, reproducible research -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; This file is part of GNU Emacs. @@ -27,6 +27,7 @@ ;;; Code: (require 'ob) +(require 'org-macs) (require 'shell) (require 'cl-lib) @@ -36,7 +37,6 @@ (declare-function org-babel-comint-buffer-livep "ob-comint" (buffer)) (declare-function org-babel-comint-with-output "ob-comint" (meta &rest body) t) -(declare-function org-trim "org" (s &optional keep-lead)) (declare-function orgtbl-to-generic "org-table" (table params)) (defvar org-babel-default-header-args:shell '()) @@ -57,10 +57,11 @@ is modified outside the Customize interface." 'org-babel-variable-assignments:shell ,(format "Return list of %s statements assigning to the block's \ variables." - name))))) + name))) + (eval `(defvar ,(intern (concat "org-babel-default-header-args:" name)) '())))) (defcustom org-babel-shell-names - '("sh" "bash" "csh" "ash" "dash" "ksh" "mksh" "posh") + '("sh" "bash" "zsh" "fish" "csh" "ash" "dash" "ksh" "mksh" "posh") "List of names of shell supported by babel shell code blocks. Call `org-babel-shell-initialize' when modifying this variable outside the Customize interface." @@ -206,62 +207,60 @@ var of the same value." If RESULT-TYPE equals `output' then return a list of the outputs of the statements in BODY, if RESULT-TYPE equals `value' then return the value of the last statement in BODY." - (let ((results - (cond - ((or stdin cmdline) ; external shell script w/STDIN - (let ((script-file (org-babel-temp-file "sh-script-")) - (stdin-file (org-babel-temp-file "sh-stdin-")) - (shebang (cdr (assq :shebang params))) - (padline (not (string= "no" (cdr (assq :padline params)))))) - (with-temp-file script-file - (when shebang (insert (concat shebang "\n"))) - (when padline (insert "\n")) - (insert body)) - (set-file-modes script-file #o755) - (with-temp-file stdin-file (insert (or stdin ""))) - (with-temp-buffer - (call-process-shell-command - (concat (if shebang script-file - (format "%s %s" shell-file-name script-file)) - (and cmdline (concat " " cmdline))) - stdin-file - (current-buffer)) - (buffer-string)))) - (session ; session evaluation - (mapconcat - #'org-babel-sh-strip-weird-long-prompt - (mapcar - #'org-trim - (butlast - (org-babel-comint-with-output - (session org-babel-sh-eoe-output t body) - (mapc - (lambda (line) - (insert line) - (comint-send-input nil t) - (while (save-excursion - (goto-char comint-last-input-end) - (not (re-search-forward - comint-prompt-regexp nil t))) - (accept-process-output - (get-buffer-process (current-buffer))))) - (append - (split-string (org-trim body) "\n") - (list org-babel-sh-eoe-indicator)))) - 2)) "\n")) - ('otherwise ; external shell script - (if (and (cdr (assq :shebang params)) - (> (length (cdr (assq :shebang params))) 0)) - (let ((script-file (org-babel-temp-file "sh-script-")) - (shebang (cdr (assq :shebang params))) - (padline (not (equal "no" (cdr (assq :padline params)))))) - (with-temp-file script-file - (when shebang (insert (concat shebang "\n"))) - (when padline (insert "\n")) - (insert body)) - (set-file-modes script-file #o755) - (org-babel-eval script-file "")) - (org-babel-eval shell-file-name (org-trim body))))))) + (let* ((shebang (cdr (assq :shebang params))) + (results + (cond + ((or stdin cmdline) ; external shell script w/STDIN + (let ((script-file (org-babel-temp-file "sh-script-")) + (stdin-file (org-babel-temp-file "sh-stdin-")) + (padline (not (string= "no" (cdr (assq :padline params)))))) + (with-temp-file script-file + (when shebang (insert shebang "\n")) + (when padline (insert "\n")) + (insert body)) + (set-file-modes script-file #o755) + (with-temp-file stdin-file (insert (or stdin ""))) + (with-temp-buffer + (call-process-shell-command + (concat (if shebang script-file + (format "%s %s" shell-file-name script-file)) + (and cmdline (concat " " cmdline))) + stdin-file + (current-buffer)) + (buffer-string)))) + (session ; session evaluation + (mapconcat + #'org-babel-sh-strip-weird-long-prompt + (mapcar + #'org-trim + (butlast + (org-babel-comint-with-output + (session org-babel-sh-eoe-output t body) + (dolist (line (append (split-string (org-trim body) "\n") + (list org-babel-sh-eoe-indicator))) + (insert line) + (comint-send-input nil t) + (while (save-excursion + (goto-char comint-last-input-end) + (not (re-search-forward + comint-prompt-regexp nil t))) + (accept-process-output + (get-buffer-process (current-buffer)))))) + 2)) + "\n")) + ;; External shell script, with or without a predefined + ;; shebang. + ((org-string-nw-p shebang) + (let ((script-file (org-babel-temp-file "sh-script-")) + (padline (not (equal "no" (cdr (assq :padline params)))))) + (with-temp-file script-file + (insert shebang "\n") + (when padline (insert "\n")) + (insert body)) + (set-file-modes script-file #o755) + (org-babel-eval script-file ""))) + (t + (org-babel-eval shell-file-name (org-trim body)))))) (when results (let ((result-params (cdr (assq :result-params params)))) (org-babel-result-cond result-params diff --git a/elpa/org-20171030/ob-shen.el b/elpa/org-20190930/ob-shen.el similarity index 94% rename from elpa/org-20171030/ob-shen.el rename to elpa/org-20190930/ob-shen.el index 6a4a3f18..f2daa676 100644 --- a/elpa/org-20171030/ob-shen.el +++ b/elpa/org-20190930/ob-shen.el @@ -1,10 +1,10 @@ ;;; ob-shen.el --- Babel Functions for Shen -*- lexical-binding: t; -*- -;; Copyright (C) 2010-2017 Free Software Foundation, Inc. +;; Copyright (C) 2010-2019 Free Software Foundation, Inc. ;; Author: Eric Schulte ;; Keywords: literate programming, reproducible research, shen -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; This file is part of GNU Emacs. @@ -61,7 +61,7 @@ (defun org-babel-execute:shen (body params) "Execute a block of Shen code with org-babel. -This function is called by `org-babel-execute-src-block'" +This function is called by `org-babel-execute-src-block'." (require 'inf-shen) (let* ((result-params (cdr (assq :result-params params))) (full-body (org-babel-expand-body:shen body params))) diff --git a/elpa/org-20171030/ob-sql.el b/elpa/org-20190930/ob-sql.el similarity index 94% rename from elpa/org-20171030/ob-sql.el rename to elpa/org-20190930/ob-sql.el index 1b1d2dc0..2a581889 100644 --- a/elpa/org-20171030/ob-sql.el +++ b/elpa/org-20190930/ob-sql.el @@ -1,10 +1,10 @@ ;;; ob-sql.el --- Babel Functions for SQL -*- lexical-binding: t; -*- -;; Copyright (C) 2009-2017 Free Software Foundation, Inc. +;; Copyright (C) 2009-2019 Free Software Foundation, Inc. ;; Author: Eric Schulte ;; Keywords: literate programming, reproducible research -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; This file is part of GNU Emacs. @@ -111,8 +111,24 @@ Pass nil to omit that arg." (when database (concat "-d" database)))))) (defun org-babel-sql-dbstring-oracle (host port user password database) - "Make Oracle command line args for database connection." - (format "%s/%s@%s:%s/%s" user password host port database)) + "Make Oracle command line arguments for database connection. + +If HOST and PORT are nil then don't pass them. This allows you +to use names defined in your \"TNSNAMES\" file. So you can +connect with + + /@:/ + +or + + /@ + +using its alias." + (cond ((and user password database host port) + (format "%s/%s@%s:%s/%s" user password host port database)) + ((and user password database) + (format "%s/%s@%s" user password database)) + (t (user-error "Missing information to connect to database")))) (defun org-babel-sql-dbstring-mssql (host user password database) "Make sqlcmd command line args for database connection. @@ -241,6 +257,7 @@ SET NEWPAGE 0 SET TAB OFF SET SPACE 0 SET LINESIZE 9999 +SET TRIMOUT ON TRIMSPOOL ON SET ECHO OFF SET FEEDBACK OFF SET VERIFY OFF diff --git a/elpa/org-20171030/ob-sqlite.el b/elpa/org-20190930/ob-sqlite.el similarity index 98% rename from elpa/org-20171030/ob-sqlite.el rename to elpa/org-20190930/ob-sqlite.el index 38058274..04bf4fe2 100644 --- a/elpa/org-20171030/ob-sqlite.el +++ b/elpa/org-20190930/ob-sqlite.el @@ -1,10 +1,10 @@ ;;; ob-sqlite.el --- Babel Functions for SQLite Databases -*- lexical-binding: t; -*- -;; Copyright (C) 2010-2017 Free Software Foundation, Inc. +;; Copyright (C) 2010-2019 Free Software Foundation, Inc. ;; Author: Eric Schulte ;; Keywords: literate programming, reproducible research -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; This file is part of GNU Emacs. diff --git a/elpa/org-20171030/ob-stan.el b/elpa/org-20190930/ob-stan.el similarity index 87% rename from elpa/org-20171030/ob-stan.el rename to elpa/org-20190930/ob-stan.el index 40fd8d9c..47b871d1 100644 --- a/elpa/org-20171030/ob-stan.el +++ b/elpa/org-20190930/ob-stan.el @@ -1,10 +1,10 @@ ;;; ob-stan.el --- Babel Functions for Stan -*- lexical-binding: t; -*- -;; Copyright (C) 2015-2017 Free Software Foundation, Inc. +;; Copyright (C) 2015-2019 Free Software Foundation, Inc. ;; Author: Kyle Meyer ;; Keywords: literate programming, reproducible research -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; This file is part of GNU Emacs. @@ -39,7 +39,7 @@ ;; that does not end in ".stan". ;; ;; For more information and usage examples, visit -;; http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-stan.html +;; https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-stan.html ;; ;; [1] http://mc-stan.org/ @@ -49,11 +49,12 @@ (defcustom org-babel-stan-cmdstan-directory nil "CmdStan source directory. -'make' will be called from this directory to compile the Stan -block. When nil, executing Stan blocks dumps the content to a -plain text file." +Call \"make\" from this directory to compile the Stan block. +When nil, executing Stan blocks dumps the content to a file." :group 'org-babel - :type 'string) + :type '(choice + (directory :tag "Compilation directory") + (const :tag "Dump to a file" nil))) (defvar org-babel-default-header-args:stan '((:results . "file"))) diff --git a/elpa/org-20171030/ob-table.el b/elpa/org-20190930/ob-table.el similarity index 97% rename from elpa/org-20171030/ob-table.el rename to elpa/org-20190930/ob-table.el index 3169f3d3..42eecea1 100644 --- a/elpa/org-20171030/ob-table.el +++ b/elpa/org-20190930/ob-table.el @@ -1,10 +1,10 @@ ;;; ob-table.el --- Support for Calling Babel Functions from Tables -*- lexical-binding: t; -*- -;; Copyright (C) 2009-2017 Free Software Foundation, Inc. +;; Copyright (C) 2009-2019 Free Software Foundation, Inc. ;; Author: Eric Schulte ;; Keywords: literate programming, reproducible research -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; This file is part of GNU Emacs. @@ -54,8 +54,7 @@ ;;; Code: (require 'ob-core) - -(declare-function org-trim "org" (s &optional keep-lead)) +(require 'org-macs) (defun org-babel-table-truncate-at-newline (string) "Replace newline character with ellipses. diff --git a/elpa/org-20171030/ob-tangle.el b/elpa/org-20190930/ob-tangle.el similarity index 98% rename from elpa/org-20171030/ob-tangle.el rename to elpa/org-20190930/ob-tangle.el index 09d011fc..dbab56f7 100644 --- a/elpa/org-20171030/ob-tangle.el +++ b/elpa/org-20190930/ob-tangle.el @@ -1,10 +1,10 @@ ;;; ob-tangle.el --- Extract Source Code From Org Files -*- lexical-binding: t; -*- -;; Copyright (C) 2009-2017 Free Software Foundation, Inc. +;; Copyright (C) 2009-2019 Free Software Foundation, Inc. ;; Author: Eric Schulte ;; Keywords: literate programming, reproducible research -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; This file is part of GNU Emacs. @@ -40,14 +40,12 @@ (declare-function org-element-type "org-element" (element)) (declare-function org-fill-template "org" (template alist)) (declare-function org-heading-components "org" ()) +(declare-function org-id-find "org-id" (id &optional markerp)) (declare-function org-in-commented-heading-p "org" (&optional no-inheritance)) (declare-function org-link-escape "org" (text &optional table merge)) (declare-function org-open-link-from-string "org" (s &optional arg reference-buffer)) -(declare-function org-remove-indentation "org" (code &optional n)) -(declare-function org-store-link "org" (arg)) -(declare-function org-trim "org" (s &optional keep-lead)) +(declare-function org-store-link "org" (arg &optional interactive?)) (declare-function outline-previous-heading "outline" ()) -(declare-function org-id-find "org-id" (id &optional markerp)) (defvar org-link-types-re) @@ -409,7 +407,8 @@ can be used to limit the collected code blocks by target file." (if by-lang (setcdr by-lang (cons block (cdr by-lang))) (push (cons src-lang (list block)) blocks))))))) ;; Ensure blocks are in the correct order. - (mapcar (lambda (b) (cons (car b) (nreverse (cdr b)))) blocks))) + (mapcar (lambda (b) (cons (car b) (nreverse (cdr b)))) + (nreverse blocks)))) (defun org-babel-tangle-single-block (block-counter &optional only-this-block) "Collect the tangled source for current block. @@ -583,10 +582,12 @@ which enable the original code blocks to be found." (t (org-babel-next-src-block (1- n))))) (org-babel-goto-named-src-block block-name)) (goto-char (org-babel-where-is-src-block-head)) - ;; Preserve location of point within the source code in tangled - ;; code file. (forward-line 1) - (forward-char (- mid body-start)) + ;; Try to preserve location of point within the source code in + ;; tangled code file. + (let ((offset (- mid body-start))) + (when (> end (+ offset (point))) + (forward-char offset))) (setq target-char (point))) (org-src-switch-to-buffer target-buffer t) (goto-char target-char) diff --git a/elpa/org-20171030/ob-vala.el b/elpa/org-20190930/ob-vala.el similarity index 96% rename from elpa/org-20171030/ob-vala.el rename to elpa/org-20190930/ob-vala.el index 580e2724..85868d8e 100644 --- a/elpa/org-20171030/ob-vala.el +++ b/elpa/org-20190930/ob-vala.el @@ -1,10 +1,10 @@ ;;; ob-vala.el --- Babel functions for Vala evaluation -*- lexical-binding: t; -*- -;; Copyright (C) 2017 Free Software Foundation, Inc. +;; Copyright (C) 2017-2019 Free Software Foundation, Inc. ;; Author: Christian Garbs ;; Keywords: literate programming, reproducible research -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;;; License: @@ -39,8 +39,7 @@ ;;; Code: (require 'ob) - -(declare-function org-trim "org" (s &optional keep-lead)) +(require 'org-macs) ;; File extension. (add-to-list 'org-babel-tangle-lang-exts '("vala" . "vala")) diff --git a/elpa/org-20171030/ob.el b/elpa/org-20190930/ob.el similarity index 92% rename from elpa/org-20171030/ob.el rename to elpa/org-20190930/ob.el index c5ce0c03..86d6928b 100644 --- a/elpa/org-20171030/ob.el +++ b/elpa/org-20190930/ob.el @@ -1,10 +1,10 @@ ;;; ob.el --- Working with Code Blocks in Org -*- lexical-binding: t; -*- -;; Copyright (C) 2009-2017 Free Software Foundation, Inc. +;; Copyright (C) 2009-2019 Free Software Foundation, Inc. ;; Authors: Eric Schulte ;; Keywords: literate programming, reproducible research -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; This file is part of GNU Emacs. diff --git a/elpa/org-20190930/org b/elpa/org-20190930/org new file mode 100644 index 00000000..09061855 --- /dev/null +++ b/elpa/org-20190930/org @@ -0,0 +1,22565 @@ +This is org, produced by makeinfo version 6.5 from org.texi. + +This manual is for Org version 9.2. + + Copyright © 2004–2019 Free Software Foundation, Inc. + + Permission is granted to copy, distribute and/or modify this + document under the terms of the GNU Free Documentation License, + Version 1.3 or any later version published by the Free Software + Foundation; with no Invariant Sections, with the Front-Cover Texts + being “A GNU Manual,” and with the Back-Cover Texts as in (a) + below. A copy of the license is included in the section entitled + “GNU Free Documentation License.” + + (a) The FSF’s Back-Cover Text is: “You have the freedom to copy and + modify this GNU manual.” + +INFO-DIR-SECTION Emacs editing modes +START-INFO-DIR-ENTRY +* Org Mode: (org). Outline-based notes management and organizer. +END-INFO-DIR-ENTRY + + +File: org, Node: Top, Next: Introduction, Up: (dir) + +The Org Manual +************** + +This manual is for Org version 9.2. + + Copyright © 2004–2019 Free Software Foundation, Inc. + + Permission is granted to copy, distribute and/or modify this + document under the terms of the GNU Free Documentation License, + Version 1.3 or any later version published by the Free Software + Foundation; with no Invariant Sections, with the Front-Cover Texts + being “A GNU Manual,” and with the Back-Cover Texts as in (a) + below. A copy of the license is included in the section entitled + “GNU Free Documentation License.” + + (a) The FSF’s Back-Cover Text is: “You have the freedom to copy and + modify this GNU manual.” + +* Menu: + +* Introduction:: Getting started. +* Document Structure:: A tree works like your brain. +* Tables:: Pure magic for quick formatting. +* Hyperlinks:: Notes in context. +* TODO Items:: Every tree branch can be a TODO item. +* Tags:: Tagging headlines and matching sets of tags. +* Properties and Columns:: Storing information about an entry. +* Dates and Times:: Making items useful for planning. +* Capture, Refile, Archive: Capture Refile Archive. The ins and outs for projects. +* Agenda Views:: Collecting information into views. +* Markup for Rich Contents:: Compose beautiful documents. +* Exporting:: Sharing and publishing notes. +* Publishing:: Create a web site of linked Org files. +* Working with Source Code:: Export, evaluate, and tangle code blocks. +* Miscellaneous:: All the rest which did not fit elsewhere. +* Hacking:: How to hack your way around. +* History and Acknowledgments:: How Org came into being. +* GNU Free Documentation License:: The license for this documentation. +* Main Index:: An index of Org’s concepts and features. +* Key Index:: Key bindings and where they are described. +* Command and Function Index:: Command names and some internal functions. +* Variable Index:: Variables mentioned in the manual. + +— The Detailed Node Listing — + +Introduction + +* Summary:: Brief summary of what Org does. +* Installation:: Installing Org. +* Activation:: How to activate Org for certain buffers. +* Feedback:: Bug reports, ideas, patches, etc. +* Conventions:: Typesetting conventions used in this manual. + +Document Structure + +* Headlines:: How to typeset Org tree headlines. +* Visibility Cycling:: Show and hide, much simplified. +* Motion:: Jumping to other headlines. +* Structure Editing:: Changing sequence and level of headlines. +* Sparse Trees:: Matches embedded in context. +* Plain Lists:: Additional structure within an entry. +* Drawers:: Tucking stuff away. +* Blocks:: Folding blocks. +* Creating Footnotes:: How footnotes are defined in Org’s syntax. + +Visibility Cycling + +* Global and local cycling:: Cycling through various visibility states. +* Initial visibility:: Setting the initial visibility state. +* Catching invisible edits:: Preventing mistakes when editing invisible parts. + +Tables + +* Built-in Table Editor:: Simple tables. +* Column Width and Alignment:: Overrule the automatic settings. +* Column Groups:: Grouping to trigger vertical lines. +* Orgtbl Mode:: The table editor as minor mode. +* The Spreadsheet:: The table editor has spreadsheet capabilities. +* Org Plot:: Plotting from Org tables. + +The Spreadsheet + +* References:: How to refer to another field or range. +* Formula syntax for Calc:: Using Calc to compute stuff. +* Formula syntax for Lisp:: Writing formulas in Emacs Lisp. +* Durations and time values:: How to compute durations and time values. +* Field and range formulas:: Formula for specific (ranges of) fields. +* Column formulas:: Formulas valid for an entire column. +* Lookup functions:: Lookup functions for searching tables. +* Editing and debugging formulas:: Fixing formulas. +* Updating the table:: Recomputing all dependent fields. +* Advanced features:: Field and column names, automatic recalculation... + +Hyperlinks + +* Link Format:: How links in Org are formatted. +* Internal Links:: Links to other places in the current file. +* Radio Targets:: Make targets trigger links in plain text. +* External Links:: URL-like links to the world. +* Handling Links:: Creating, inserting and following. +* Using Links Outside Org:: Linking from my C source code? +* Link Abbreviations:: Shortcuts for writing complex links. +* Search Options:: Linking to a specific location. +* Custom Searches:: When the default search is not enough. + +TODO Items + +* TODO Basics:: Marking and displaying TODO entries. +* TODO Extensions:: Workflow and assignments. +* Progress Logging:: Dates and notes for progress. +* Priorities:: Some things are more important than others. +* Breaking Down Tasks:: Splitting a task into manageable pieces. +* Checkboxes:: Tick-off lists. + +TODO Extensions + +* Workflow states:: From TODO to DONE in steps. +* TODO types:: I do this, Fred does the rest. +* Multiple sets in one file:: Mixing it all, still finding your way. +* Fast access to TODO states:: Single letter selection of state. +* Per-file keywords:: Different files, different requirements. +* Faces for TODO keywords:: Highlighting states. +* TODO dependencies:: When one task needs to wait for others. + +Progress Logging + +* Closing items:: When was this entry marked DONE? +* Tracking TODO state changes:: When did the status change? +* Tracking your habits:: How consistent have you been? + +Tags + +* Tag Inheritance:: Tags use the tree structure of an outline. +* Setting Tags:: How to assign tags to a headline. +* Tag Hierarchy:: Create a hierarchy of tags. +* Tag Searches:: Searching for combinations of tags. + +Properties and Columns + +* Property Syntax:: How properties are spelled out. +* Special Properties:: Access to other Org mode features. +* Property Searches:: Matching property values. +* Property Inheritance:: Passing values down a tree. +* Column View:: Tabular viewing and editing. + +Column View + +* Defining columns:: The COLUMNS format property. +* Using column view:: How to create and use column view. +* Capturing column view:: A dynamic block for column view. + +Defining columns + +* Scope of column definitions:: Where defined, where valid? +* Column attributes:: Appearance and content of a column. + +Dates and Times + +* Timestamps:: Assigning a time to a tree entry. +* Creating Timestamps:: Commands to insert timestamps. +* Deadlines and Scheduling:: Planning your work. +* Clocking Work Time:: Tracking how long you spend on a task. +* Effort Estimates:: Planning work effort in advance. +* Timers:: Notes with a running timer. + +Creating Timestamps + +* The date/time prompt:: How Org mode helps you enter dates and times. +* Custom time format:: Making dates look different. + +Deadlines and Scheduling + +* Inserting deadline/schedule:: Planning items. +* Repeated tasks:: Items that show up again and again. + +Clocking Work Time + +* Clocking commands:: Starting and stopping a clock. +* The clock table:: Detailed reports. +* Resolving idle time:: Resolving time when you’ve been idle. + +Capture, Refile, Archive + +* Capture:: Capturing new stuff. +* Attachments:: Add files to tasks. +* RSS Feeds:: Getting input from RSS feeds. +* Protocols:: External access to Emacs and Org. +* Refile and Copy:: Moving/copying a tree from one place to another. +* Archiving:: What to do with finished products. + +Capture + +* Setting up capture:: Where notes will be stored. +* Using capture:: Commands to invoke and terminate capture. +* Capture templates:: Define the outline of different note types. + +Capture templates + +* Template elements:: What is needed for a complete template entry. +* Template expansion:: Filling in information about time and context. +* Templates in contexts:: Only show a template in a specific context. + +Protocols + +* store-link protocol:: Store a link, push URL to kill-ring. +* capture protocol:: Fill a buffer with external information. +* open-source protocol:: Edit published contents. + +Archiving + +* Moving subtrees:: Moving a tree to an archive file. +* Internal archiving:: Switch off a tree but keep it in the file. + +Agenda Views + +* Agenda Files:: Files being searched for agenda information. +* Agenda Dispatcher:: Keyboard access to agenda views. +* Built-in Agenda Views:: What is available out of the box? +* Presentation and Sorting:: How agenda items are prepared for display. +* Agenda Commands:: Remote editing of Org trees. +* Custom Agenda Views:: Defining special searches and views. +* Exporting Agenda Views:: Writing a view to a file. +* Agenda Column View:: Using column view for collected entries. + +Built-in Agenda Views + +* Weekly/daily agenda:: The calendar page with current tasks. +* Global TODO list:: All unfinished action items. +* Matching tags and properties:: Structured information with fine-tuned search. +* Search view:: Find entries by searching for text. +* Stuck projects:: Find projects you need to review. + +Presentation and Sorting + +* Categories:: Not all tasks are equal. +* Time-of-day specifications:: How the agenda knows the time. +* Sorting of agenda items:: The order of things. +* Filtering/limiting agenda times:: Dynamically narrow the agenda. + +Custom Agenda Views + +* Storing searches:: Type once, use often. +* Block agenda:: All the stuff you need in a single buffer. +* Setting options:: Changing the rules. + +Markup for Rich Contents + +* Paragraphs:: The basic unit of text. +* Emphasis and Monospace:: Bold, italic, etc. +* Subscripts and Superscripts:: Simple syntax for raising/lowering text. +* Special Symbols:: Greek letters and other symbols. +* Embedded LaTeX:: LaTeX can be freely used inside Org documents. +* Literal Examples:: Source code examples with special formatting. +* Images:: Display an image. +* Captions:: Describe tables, images... +* Horizontal Rules:: Make a line. + +Embedded LaTeX + +* LaTeX fragments:: Complex formulas made easy. +* Previewing LaTeX fragments:: What will this snippet look like? +* CDLaTeX mode:: Speed up entering of formulas. + +Exporting + +* The Export Dispatcher:: The main interface. +* Export Settings:: Common export settings. +* Table of Contents:: The if and where of the table of contents. +* Include Files:: Include additional files into a document. +* Macro Replacement:: Use macros to create templates. +* Comment Lines:: What will not be exported. +* ASCII/Latin-1/UTF-8 export:: Exporting to flat files with encoding. +* Beamer Export:: +* HTML Export:: Exporting to HTML. +* LaTeX Export:: Exporting to LaTeX and processing to PDF. +* Markdown Export:: Exporting to Markdown. +* OpenDocument Text Export:: Exporting to OpenDocument Text. +* Org Export:: Exporting to Org. +* Texinfo Export:: Exporting to Texinfo. +* iCalendar Export:: Exporting to iCalendar. +* Other Built-in Back-ends:: Exporting to a man page. +* Advanced Export Configuration:: Fine-tuning the export output. +* Export in Foreign Buffers:: Author tables and lists in Org syntax. + +Beamer Export + +* Beamer export commands:: For creating Beamer documents. +* Beamer specific export settings:: For customizing Beamer export. +* Frames and Blocks in Beamer:: For composing Beamer slides. +* Beamer specific syntax:: For using in Org documents. +* Editing support:: Editing support. +* A Beamer example:: A complete presentation. + +HTML Export + +* HTML export commands:: Invoking HTML export. +* HTML specific export settings:: Settings for HTML export. +* HTML doctypes:: Exporting various (X)HTML flavors. +* HTML preamble and postamble:: Inserting preamble and postamble. +* Quoting HTML tags:: Using direct HTML in Org files. +* Links in HTML export:: Inserting and formatting links. +* Tables in HTML export:: How to modify the formatting of tables. +* Images in HTML export:: How to insert figures into HTML output. +* Math formatting in HTML export:: Beautiful math also on the web. +* Text areas in HTML export:: An alternate way to show an example. +* CSS support:: Changing the appearance of the output. +* JavaScript support:: Info and folding in a web browser. + +LaTeX Export + +* LaTeX/PDF export commands:: For producing LaTeX and PDF documents. +* LaTeX specific export settings:: Unique to this LaTeX back-end. +* LaTeX header and sectioning:: Setting up the export file structure. +* Quoting LaTeX code:: Incorporating literal LaTeX code. +* Tables in LaTeX export:: Options for exporting tables to LaTeX. +* Images in LaTeX export:: How to insert figures into LaTeX output. +* Plain lists in LaTeX export:: Attributes specific to lists. +* Source blocks in LaTeX export:: Attributes specific to source code blocks. +* Example blocks in LaTeX export:: Attributes specific to example blocks. +* Special blocks in LaTeX export:: Attributes specific to special blocks. +* Horizontal rules in LaTeX export:: Attributes specific to horizontal rules. + +OpenDocument Text Export + +* Pre-requisites for ODT export:: Required packages. +* ODT export commands:: Invoking export. +* ODT specific export settings:: Configuration options. +* Extending ODT export:: Producing DOC, PDF files. +* Applying custom styles:: Styling the output. +* Links in ODT export:: Handling and formatting links. +* Tables in ODT export:: Org tables conversions. +* Images in ODT export:: Inserting images. +* Math formatting in ODT export:: Formatting LaTeX fragments. +* Labels and captions in ODT export:: Rendering objects. +* Literal examples in ODT export:: For source code and example blocks. +* Advanced topics in ODT export:: For power users. + +Math formatting in ODT export + +* LaTeX math snippets:: Embedding in LaTeX format. +* MathML and OpenDocument formula files:: Embedding in native format. + +Texinfo Export + +* Texinfo export commands:: Invoking commands. +* Texinfo specific export settings:: Setting the environment. +* Texinfo file header:: Generating the header. +* Texinfo title and copyright page:: Creating preamble pages. +* Info directory file:: Installing a manual in Info file hierarchy. +* Headings and sectioning structure:: Building document structure. +* Indices:: Creating indices. +* Quoting Texinfo code:: Incorporating literal Texinfo code. +* Plain lists in Texinfo export:: List attributes. +* Tables in Texinfo export:: Table attributes. +* Images in Texinfo export:: Image attributes. +* Quotations in Texinfo export:: Quote block attributes. +* Special blocks in Texinfo export:: Special block attributes. +* A Texinfo example:: Processing Org to Texinfo. + +Publishing + +* Configuration:: Defining projects. +* Uploading Files:: How to get files up on the server. +* Sample Configuration:: Example projects. +* Triggering Publication:: Publication commands. + +Configuration + +* Project alist:: The central configuration variable. +* Sources and destinations:: From here to there. +* Selecting files:: What files are part of the project? +* Publishing action:: Setting the function doing the publishing. +* Publishing options:: Tweaking HTML/LaTeX export. +* Publishing links:: Which links keep working after publishing? +* Site map:: Generating a list of all pages. +* Generating an index:: An index that reaches across pages. + +Sample Configuration + +* Simple example:: One-component publishing. +* Complex example:: A multi-component publishing example. + +Working with Source Code + +* Structure of Code Blocks:: Code block syntax described. +* Using Header Arguments:: Different ways to set header arguments. +* Environment of a Code Block:: Arguments, sessions, working directory... +* Evaluating Code Blocks:: Place results of evaluation in the Org buffer. +* Results of Evaluation:: Choosing a results type, post-processing... +* Exporting Code Blocks:: Export contents and/or results. +* Extracting Source Code:: Create pure source code files. +* Languages:: List of supported code block languages. +* Editing Source Code:: Language major-mode editing. +* Noweb Reference Syntax:: Literate programming in Org mode. +* Library of Babel:: Use and contribute to a library of useful code blocks. +* Key bindings and Useful Functions:: Work quickly with code blocks. +* Batch Execution:: Call functions from the command line. + +Miscellaneous + +* Completion:: ‘M-’ guesses completions. +* Structure Templates:: Quick insertion of structural elements. +* Escape Character:: +* Speed Keys:: Electric commands at the beginning of a headline. +* Code Evaluation Security:: Org files evaluate in-line code. +* Customization:: Adapting Org to your taste. +* In-buffer Settings:: Overview of keywords. +* The Very Busy C-c C-c Key:: When in doubt, press ‘C-c C-c’. +* Clean View:: Getting rid of leading stars in the outline. +* TTY Keys:: Using Org on a tty. +* Documentation Access:: Read documentation about current syntax. +* Interaction:: With other Emacs packages. +* Org Crypt:: Encrypting Org files. +* Org Mobile:: Viewing and capture on a mobile device. +* Org Syntax:: Formal description of Org’s syntax. + +Interaction + +* Cooperation:: Packages Org cooperates with. +* Conflicts:: Packages that lead to conflicts. + +Org Mobile + +* Setting up the staging area:: For the mobile device. +* Pushing to the mobile application:: Uploading Org files and agendas. +* Pulling from the mobile application:: Integrating captured and flagged items. + +Hacking + +* Hooks: Hooks (2). How to reach into Org’s internals. +* Add-on Packages:: Available extensions. +* Adding Hyperlink Types:: New custom link types. +* Adding Export Back-ends:: How to write new export back-ends. +* Tables in Arbitrary Syntax:: Orgtbl for LaTeX and other programs. +* Dynamic Blocks:: Automatically filled blocks. +* Special Agenda Views:: Customized views. +* Speeding Up Your Agendas:: Tips on how to speed up your agendas. +* Extracting Agenda Information:: Post-processing agenda information. +* Using the Property API:: Writing programs that use entry properties. +* Using the Mapping API:: Mapping over all or selected entries. + +Tables in Arbitrary Syntax + +* Radio tables:: Sending and receiving radio tables. +* A LaTeX example:: Step by step, almost a tutorial. +* Translator functions:: Copy and modify. + + + +File: org, Node: Introduction, Next: Document Structure, Prev: Top, Up: Top + +1 Introduction +************** + +* Menu: + +* Summary:: Brief summary of what Org does. +* Installation:: Installing Org. +* Activation:: How to activate Org for certain buffers. +* Feedback:: Bug reports, ideas, patches, etc. +* Conventions:: Typesetting conventions used in this manual. + + +File: org, Node: Summary, Next: Installation, Up: Introduction + +1.1 Summary +=========== + +Org is a mode for keeping notes, maintaining TODO lists, and project +planning with a fast and effective plain-text markup language. It also +is an authoring system with unique support for literate programming and +reproducible research. + + Org is implemented on top of Outline mode, which makes it possible to +keep the content of large files well structured. Visibility cycling and +structure editing help to work with the tree. Tables are easily created +with a built-in table editor. Plain text URL-like links connect to +websites, emails, Usenet messages, BBDB entries, and any files related +to the projects. + + Org develops organizational tasks around notes files that contain +lists or information about projects as plain text. Project planning and +task management make use of metadata which is part of an outline node. +Based on this data, specific entries can be extracted in queries and +create dynamic _agenda views_ that also integrate the Emacs calendar and +diary. Org can be used to implement many different project planning +schemes, such as David Allen’s GTD system. + + Org files can serve as a single source authoring system with export +to many different formats such as HTML, LaTeX, Open Document, and +Markdown. New export backends can be derived from existing ones, or +defined from scratch. + + Org files can include source code blocks, which makes Org uniquely +suited for authoring technical documents with code examples. Org source +code blocks are fully functional; they can be evaluated in place and +their results can be captured in the file. This makes it possible to +create a single file reproducible research compendium. + + Org keeps simple things simple. When first fired up, it should feel +like a straightforward, easy to use outliner. Complexity is not +imposed, but a large amount of functionality is available when needed. +Org is a toolbox. Many users actually run only a—very personal—fraction +of Org’s capabilities, and know that there is more whenever they need +it. + + All of this is achieved with strictly plain text files, the most +portable and future-proof file format. Org runs in Emacs. Emacs is one +of the most widely ported programs, so that Org mode is available on +every major platform. + + There is a website for Org which provides links to the newest version +of Org, as well as additional information, frequently asked questions +(FAQ), links to tutorials, etc. This page is located at +. + + An earlier version (7.3) of this manual is available as a paperback +book from Network Theory Ltd. +(http://www.network-theory.co.uk/org/manual/). + + +File: org, Node: Installation, Next: Activation, Prev: Summary, Up: Introduction + +1.2 Installation +================ + +Org is included in all recent distributions of GNU Emacs, so you +probably do not need to install it. Most users will simply activate Org +and begin exploring its many features. + + If, for one reason or another, you want to install Org on top of this +pre-packaged version, there are three ways to do it: + + • by using the Emacs package system; + • by downloading Org as an archive; or + • by using Org’s git repository. + + We *strongly recommend* sticking to a single installation method. + +Using Emacs packaging system +---------------------------- + +Recent Emacs distributions include a packaging system which lets you +install Elisp libraries. You can install Org with ‘M-x package-install + org’. + + Important: You need to do this in a session where no ‘.org’ file + has been visited, i.e., where no Org built-in function have been + loaded. Otherwise autoload Org functions will mess up the + installation. + + If you want to use Org’s package repository, check out the Org ELPA +page (https://orgmode.org/elpa.html). + +Downloading Org as an archive +----------------------------- + +You can download Org latest release from Org’s website +(https://orgmode.org/). In this case, make sure you set the load-path +correctly in your Emacs init file: + + (add-to-list 'load-path "~/path/to/orgdir/lisp") + + The downloaded archive contains contributed libraries that are not +included in Emacs. If you want to use them, add the ‘contrib/’ +directory to your load-path: + + (add-to-list 'load-path "~/path/to/orgdir/contrib/lisp" t) + + Optionally, you can compile the files and/or install them in your +system. Run ‘make help’ to list compilation and installation options. + +Using Org’s git repository +-------------------------- + +You can clone Org’s repository and install Org like this: + + $ cd ~/src/ + $ git clone git@code.orgmode.org:bzg/org-mode.git + $ cd org-mode/ + $ make autoloads + + Note that in this case, ‘make autoloads’ is mandatory: it defines +Org’s version in ‘org-version.el’ and Org’s autoloads in +‘org-loaddefs.el’. + + Remember to add the correct load-path as described in the method +above. + + You can also compile with ‘make’, generate the documentation with +‘make doc’, create a local configuration with ‘make config’ and install +Org with ‘make install’. Please run ‘make help’ to get the list of +compilation/installation options. + + For more detailed explanations on Org’s build system, please check +the Org Build System page on Worg +(https://orgmode.org/worg/dev/org-build-system.html). + + +File: org, Node: Activation, Next: Feedback, Prev: Installation, Up: Introduction + +1.3 Activation +============== + +Org mode buffers need Font Lock to be turned on: this is the default in +Emacs(1). + + There are compatibility issues between Org mode and some other Elisp +packages (see *note Conflicts::). Please take the time to check the +list. + + For a better experience, the three Org commands ‘org-store-link’, +‘org-capture’ and ‘org-agenda’ ought to be accessible anywhere in Emacs, +not just in Org buffers. To that effect, you need to bind them to +globally available keys, like the ones reserved for users (see *note +(elisp)Key Binding Conventions::). Here are suggested bindings, please +modify the keys to your own liking. + + (global-set-key (kbd "C-c l") 'org-store-link) + (global-set-key (kbd "C-c a") 'org-agenda) + (global-set-key (kbd "C-c c") 'org-capture) + + Files with the ‘.org’ extension use Org mode by default. To turn on +Org mode in a file that does not have the extension ‘.org’, make the +first line of a file look like this: + + MY PROJECTS -*- mode: org; -*- + +which selects Org mode for this buffer no matter what the file’s name +is. See also the variable ‘org-insert-mode-line-in-empty-file’. + + Many commands in Org work on the region if the region is _active_. +To make use of this, you need to have ‘transient-mark-mode’ turned on, +which is the default. If you do not like ‘transient-mark-mode’, you can +create an active region by using the mouse to select a region, or +pressing ‘C-’ twice before moving point. + + ---------- Footnotes ---------- + + (1) If you do not use Font Lock globally turn it on in Org buffer +with ‘(add-hook 'org-mode-hook 'turn-on-font-lock)’. + + +File: org, Node: Feedback, Next: Conventions, Prev: Activation, Up: Introduction + +1.4 Feedback +============ + +If you find problems with Org, or if you have questions, remarks, or +ideas about it, please send an email to the Org mailing list +. You can subscribe to the list from this web +page (https://lists.gnu.org/mailman/listinfo/emacs-orgmode). If you are +not a member of the mailing list, your mail will be passed to the list +after a moderator has approved it(1). + + For bug reports, please first try to reproduce the bug with the +latest version of Org available—if you are running an outdated version, +it is quite possible that the bug has been fixed already. If the bug +persists, prepare a report and provide as much information as possible, +including the version information of Emacs (‘M-x emacs-version’) and Org +(‘M-x org-version’), as well as the Org related setup in the Emacs init +file. The easiest way to do this is to use the command + + M-x org-submit-bug-report + +which puts all this information into an Emacs mail buffer so that you +only need to add your description. If you are not sending the Email +from within Emacs, please copy and paste the content into your Email +program. + + Sometimes you might face a problem due to an error in your Emacs or +Org mode setup. Before reporting a bug, it is very helpful to start +Emacs with minimal customizations and reproduce the problem. Doing so +often helps you determine if the problem is with your customization or +with Org mode itself. You can start a typical minimal session with a +command like the example below. + + $ emacs -Q -l /path/to/minimal-org.el + + However if you are using Org mode as distributed with Emacs, a +minimal setup is not necessary. In that case it is sufficient to start +Emacs as ‘emacs -Q’. The ‘minimal-org.el’ setup file can have contents +as shown below. + + ;;; Minimal setup to load latest `org-mode'. + + ;; Activate debugging. + (setq debug-on-error t + debug-on-signal nil + debug-on-quit nil) + + ;; Add latest Org mode to load path. + (add-to-list 'load-path (expand-file-name "/path/to/org-mode/lisp")) + (add-to-list 'load-path (expand-file-name "/path/to/org-mode/contrib/lisp" t)) + + If an error occurs, a “backtrace” can be very useful—see below on how +to create one. Often a small example file helps, along with clear +information about: + + 1. What exactly did you do? + 2. What did you expect to happen? + 3. What happened instead? + + Thank you for helping to improve this program. + +How to create a useful backtrace +-------------------------------- + +If working with Org produces an error with a message you do not +understand, you may have hit a bug. The best way to report this is by +providing, in addition to what was mentioned above, a backtrace. This +is information from the built-in debugger about where and how the error +occurred. Here is how to produce a useful backtrace: + + 1. Reload uncompiled versions of all Org mode Lisp files. The + backtrace contains much more information if it is produced with + uncompiled code. To do this, use + + C-u M-x org-reload + + or, from the menu: Org → Refresh/Reload → Reload Org uncompiled. + + 2. Then, activate the debugger: + + M-x toggle-debug-or-error + + or, from the menu: Options → Enter Debugger on Error. + + 3. Do whatever you have to do to hit the error. Do not forget to + document the steps you take. + + 4. When you hit the error, a ‘*Backtrace*’ buffer appears on the + screen. Save this buffer to a file—for example using ‘C-x C-w’—and + attach it to your bug report. + + ---------- Footnotes ---------- + + (1) Please consider subscribing to the mailing list in order to +minimize the work the mailing list moderators have to do. + + +File: org, Node: Conventions, Prev: Feedback, Up: Introduction + +1.5 Typesetting Conventions Used in this Manual +=============================================== + +TODO keywords, tags, properties, etc. +------------------------------------- + +Org uses various syntactical elements: TODO keywords, tags, property +names, keywords, blocks, etc. In this manual we use the following +conventions: + +‘TODO’ +‘WAITING’ + TODO keywords are written with all capitals, even if they are + user-defined. + +‘boss’ +‘ARCHIVE’ + Tags are case-sensitive. User-defined tags are written in + lowercase; built-in tags with special meaning are written as they + should appear in the document, usually with all capitals. + +‘Release’ +‘PRIORITY’ + User-defined properties are capitalized; built-in properties with + special meaning are written with all capitals. + +‘TITLE’ +‘BEGIN’ ... ‘END’ + Keywords and blocks are written in uppercase to enhance their + readability, but you can use lowercase in your Org files. + +Key bindings and commands +------------------------- + +The manual lists both the keys and the corresponding commands for +accessing a functionality. Org mode often uses the same key for +different functions, depending on context. The command that is bound to +such keys has a generic name, like ‘org-metaright’. In the manual we +will, wherever possible, give the function that is internally called by +the generic command. For example, in the chapter on document structure, +‘M-’ will be listed to call ‘org-do-demote’, while in the chapter +on tables, it will be listed to call ‘org-table-move-column-right’. + + +File: org, Node: Document Structure, Next: Tables, Prev: Introduction, Up: Top + +2 Document Structure +******************** + +Org is an outliner. Outlines allow a document to be organized in a +hierarchical structure, which, least for me, is the best representation +of notes and thoughts. An overview of this structure is achieved by +folding, i.e., hiding large parts of the document to show only the +general document structure and the parts currently being worked on. Org +greatly simplifies the use of outlines by compressing the entire show +and hide functionalities into a single command, ‘org-cycle’, which is +bound to the ‘’ key. + +* Menu: + +* Headlines:: How to typeset Org tree headlines. +* Visibility Cycling:: Show and hide, much simplified. +* Motion:: Jumping to other headlines. +* Structure Editing:: Changing sequence and level of headlines. +* Sparse Trees:: Matches embedded in context. +* Plain Lists:: Additional structure within an entry. +* Drawers:: Tucking stuff away. +* Blocks:: Folding blocks. +* Creating Footnotes:: How footnotes are defined in Org’s syntax. + + +File: org, Node: Headlines, Next: Visibility Cycling, Up: Document Structure + +2.1 Headlines +============= + +Headlines define the structure of an outline tree. The headlines in Org +start with one or more stars, on the left margin(1). For example: + + * Top level headline + ** Second level + *** Third level + some text + *** Third level + more text + * Another top level headline + + The name defined in ‘org-footnote-section’ is reserved. Do not use +it as a title for your own headings. + + Some people find the many stars too noisy and would prefer an outline +that has whitespace followed by a single star as headline starters. See +*note Clean View::. + + An empty line after the end of a subtree is considered part of it and +is hidden when the subtree is folded. However, if you leave at least +two empty lines, one empty line remains visible after folding the +subtree, in order to structure the collapsed view. See the variable +‘org-cycle-separator-lines’ to modify this behavior. + + ---------- Footnotes ---------- + + (1) See the variables ‘org-special-ctrl-a/e’, ‘org-special-ctrl-k’, +and ‘org-ctrl-k-protect-subtree’ to configure special behavior of ‘C-a’, +‘C-e’, and ‘C-k’ in headlines. Note also that clocking only works with +headings indented less than 30 stars. + + +File: org, Node: Visibility Cycling, Next: Motion, Prev: Headlines, Up: Document Structure + +2.2 Visibility Cycling +====================== + +* Menu: + +* Global and local cycling:: Cycling through various visibility states. +* Initial visibility:: Setting the initial visibility state. +* Catching invisible edits:: Preventing mistakes when editing invisible parts. + + +File: org, Node: Global and local cycling, Next: Initial visibility, Up: Visibility Cycling + +2.2.1 Global and local cycling +------------------------------ + +Outlines make it possible to hide parts of the text in the buffer. Org +uses just two commands, bound to ‘’ and ‘S-’ to change the +visibility in the buffer. + +‘’ (‘org-cycle’) + _Subtree cycling_: Rotate current subtree among the states + + ,-> FOLDED -> CHILDREN -> SUBTREE --. + '-----------------------------------' + + Point must be on a headline for this to work(1). + +‘S-’ (‘org-global-cycle’) +‘C-u ’ + _Global cycling_: Rotate the entire buffer among the states + + ,-> OVERVIEW -> CONTENTS -> SHOW ALL --. + '--------------------------------------' + + When ‘S-’ is called with a numeric prefix argument N, the + CONTENTS view up to headlines of level N are shown. Note that + inside tables (see *note Tables::), ‘S-’ jumps to the previous + field instead. + + You can run global cycling using ‘’ only if point is at the + very beginning of the buffer, but not on a headline, and + ‘org-cycle-global-at-bob’ is set to a non-‘nil’ value. + +‘C-u C-u ’ (‘org-set-startup-visibility’) + Switch back to the startup visibility of the buffer (see *note + Initial visibility::). + +‘C-u C-u C-u ’ (‘outline-show-all’) + Show all, including drawers. + +‘C-c C-r’ (‘org-reveal’) + Reveal context around point, showing the current entry, the + following heading and the hierarchy above. Useful for working near + a location that has been exposed by a sparse tree command (see + *note Sparse Trees::) or an agenda command (see *note Agenda + Commands::). With a prefix argument show, on each level, all + sibling headings. With a double prefix argument, also show the + entire subtree of the parent. + +‘C-c C-k’ (‘outline-show-branches’) + Expose all the headings of the subtree, CONTENTS view for just one + subtree. + +‘C-c ’ (‘outline-show-children’) + Expose all direct children of the subtree. With a numeric prefix + argument N, expose all children down to level N. + +‘C-c C-x b’ (‘org-tree-to-indirect-buffer’) + Show the current subtree in an indirect buffer(2). With a numeric + prefix argument, N, go up to level N and then take that tree. If N + is negative then go up that many levels. With a ‘C-u’ prefix, do + not remove the previously used indirect buffer. + +‘C-c C-x v’ (‘org-copy-visible’) + Copy the _visible_ text in the region into the kill ring. + + ---------- Footnotes ---------- + + (1) See, however, the option ‘org-cycle-emulate-tab’. + + (2) The indirect buffer contains the entire buffer, but is narrowed +to the current tree. Editing the indirect buffer also changes the +original buffer, but without affecting visibility in that buffer. For +more information about indirect buffers, see *note GNU Emacs Manual: +(emacs)Indirect Buffers. + + +File: org, Node: Initial visibility, Next: Catching invisible edits, Prev: Global and local cycling, Up: Visibility Cycling + +2.2.2 Initial visibility +------------------------ + +When Emacs first visits an Org file, the global state is set to +OVERVIEW, i.e., only the top level headlines are visible(1). This can +be configured through the variable ‘org-startup-folded’, or on a +per-file basis by adding one of the following lines anywhere in the +buffer: + + #+STARTUP: overview + #+STARTUP: content + #+STARTUP: showall + #+STARTUP: showeverything + + Furthermore, any entries with a ‘VISIBILITY’ property (see *note +Properties and Columns::) get their visibility adapted accordingly. +Allowed values for this property are ‘folded’, ‘children’, ‘content’, +and ‘all’. + +‘C-u C-u ’ (‘org-set-startup-visibility’) + Switch back to the startup visibility of the buffer, i.e., whatever + is requested by startup options and ‘VISIBILITY’ properties in + individual entries. + + ---------- Footnotes ---------- + + (1) When ‘org-agenda-inhibit-startup’ is non-‘nil’, Org does not +honor the default visibility state when first opening a file for the +agenda (see *note Speeding Up Your Agendas::). + + +File: org, Node: Catching invisible edits, Prev: Initial visibility, Up: Visibility Cycling + +2.2.3 Catching invisible edits +------------------------------ + +Sometimes you may inadvertently edit an invisible part of the buffer and +be confused on what has been edited and how to undo the mistake. +Setting ‘org-catch-invisible-edits’ to non-‘nil’ helps preventing this. +See the docstring of this option on how Org should catch invisible edits +and process them. + + +File: org, Node: Motion, Next: Structure Editing, Prev: Visibility Cycling, Up: Document Structure + +2.3 Motion +========== + +The following commands jump to other headlines in the buffer. + +‘C-c C-n’ (‘org-next-visible-heading’) + Next heading. + +‘C-c C-p’ (‘org-previous-visible-heading’) + Previous heading. + +‘C-c C-f’ (‘org-forward-heading-same-level’) + Next heading same level. + +‘C-c C-b’ (‘org-backward-heading-same-level’) + Previous heading same level. + +‘C-c C-u’ (‘outline-up-heading’) + Backward to higher level heading. + +‘C-c C-j’ (‘org-goto’) + Jump to a different place without changing the current outline + visibility. Shows the document structure in a temporary buffer, + where you can use the following keys to find your destination: + + ‘’ Cycle visibility. + ‘’ / ‘’ Next/previous visible headline. + ‘’ Select this location. + ‘/’ Do a Sparse-tree search + + The following keys work if you turn off ‘org-goto-auto-isearch’ + + ‘n’ / ‘p’ Next/previous visible headline. + ‘f’ / ‘b’ Next/previous headline same level. + ‘u’ One level up. + ‘0’ ... ‘9’ Digit argument. + ‘q’ Quit. + + See also the variable ‘org-goto-interface’. + + +File: org, Node: Structure Editing, Next: Sparse Trees, Prev: Motion, Up: Document Structure + +2.4 Structure Editing +===================== + +‘M-’ (‘org-meta-return’) + Insert a new heading, item or row. + + If the command is used at the _beginning_ of a line, and if there + is a heading or a plain list item (see *note Plain Lists::) at + point, the new heading/item is created _before_ the current line. + When used at the beginning of a regular line of text, turn that + line into a heading. + + When this command is used in the middle of a line, the line is + split and the rest of the line becomes the new item or headline. + If you do not want the line to be split, customize + ‘org-M-RET-may-split-line’. + + Calling the command with a ‘C-u’ prefix unconditionally inserts a + new heading at the end of the current subtree, thus preserving its + contents. With a double ‘C-u C-u’ prefix, the new heading is + created at the end of the parent subtree instead. + +‘C-’ (‘org-insert-heading-respect-content’) + Insert a new heading at the end of the current subtree. + +‘M-S-’ (‘org-insert-todo-heading’) + Insert new TODO entry with same level as current heading. See also + the variable ‘org-treat-insert-todo-heading-as-state-change’. + +‘C-S-’ (‘org-insert-todo-heading-respect-content’) + Insert new TODO entry with same level as current heading. Like + ‘C-’, the new headline is inserted after the current subtree. + +‘’ (‘org-cycle’) + In a new entry with no text yet, the first ‘’ demotes the + entry to become a child of the previous one. The next ‘’ + makes it a parent, and so on, all the way to top level. Yet + another ‘’, and you are back to the initial level. + +‘M-’ (‘org-do-promote’) + Promote current heading by one level. + +‘M-’ (‘org-do-demote’) + Demote current heading by one level. + +‘M-S-’ (‘org-promote-subtree’) + Promote the current subtree by one level. + +‘M-S-’ (‘org-demote-subtree’) + Demote the current subtree by one level. + +‘M-’ (‘org-move-subtree-up’) + Move subtree up, i.e., swap with previous subtree of same level. + +‘M-’ (‘org-move-subtree-down’) + Move subtree down, i.e., swap with next subtree of same level. + +‘C-c @’ (‘org-mark-subtree’) + Mark the subtree at point. Hitting repeatedly marks subsequent + subtrees of the same level as the marked subtree. + +‘C-c C-x C-w’ (‘org-cut-subtree’) + Kill subtree, i.e., remove it from buffer but save in kill ring. + With a numeric prefix argument N, kill N sequential subtrees. + +‘C-c C-x M-w’ (‘org-copy-subtree’) + Copy subtree to kill ring. With a numeric prefix argument N, copy + the N sequential subtrees. + +‘C-c C-x C-y’ (‘org-paste-subtree’) + Yank subtree from kill ring. This does modify the level of the + subtree to make sure the tree fits in nicely at the yank position. + The yank level can also be specified with a numeric prefix + argument, or by yanking after a headline marker like ‘****’. + +‘C-y’ (‘org-yank’) + Depending on the variables ‘org-yank-adjusted-subtrees’ and + ‘org-yank-folded-subtrees’, Org’s internal ‘yank’ command pastes + subtrees folded and in a clever way, using the same command as ‘C-c + C-x C-y’. With the default settings, no level adjustment takes + place, but the yanked tree is folded unless doing so would swallow + text previously visible. Any prefix argument to this command + forces a normal ‘yank’ to be executed, with the prefix passed + along. A good way to force a normal yank is ‘C-u C-y’. If you use + ‘yank-pop’ after a yank, it yanks previous kill items plainly, + without adjustment and folding. + +‘C-c C-x c’ (‘org-clone-subtree-with-time-shift’) + Clone a subtree by making a number of sibling copies of it. You + are prompted for the number of copies to make, and you can also + specify if any timestamps in the entry should be shifted. This can + be useful, for example, to create a number of tasks related to a + series of lectures to prepare. For more details, see the docstring + of the command ‘org-clone-subtree-with-time-shift’. + +‘C-c C-w’ (‘org-refile’) + Refile entry or region to a different location. See *note Refile + and Copy::. + +‘C-c ^’ (‘org-sort’) + Sort same-level entries. When there is an active region, all + entries in the region are sorted. Otherwise the children of the + current headline are sorted. The command prompts for the sorting + method, which can be alphabetically, numerically, by time—first + timestamp with active preferred, creation time, scheduled time, + deadline time—by priority, by TODO keyword—in the sequence the + keywords have been defined in the setup—or by the value of a + property. Reverse sorting is possible as well. You can also + supply your own function to extract the sorting key. With a ‘C-u’ + prefix, sorting is case-sensitive. + +‘C-x n s’ (‘org-narrow-to-subtree’) + Narrow buffer to current subtree. + +‘C-x n b’ (‘org-narrow-to-block’) + Narrow buffer to current block. + +‘C-x n w’ (‘widen’) + Widen buffer to remove narrowing. + +‘C-c *’ (‘org-toggle-heading’) + Turn a normal line or plain list item into a headline—so that it + becomes a subheading at its location. Also turn a headline into a + normal line by removing the stars. If there is an active region, + turn all lines in the region into headlines. If the first line in + the region was an item, turn only the item lines into headlines. + Finally, if the first line is a headline, remove the stars from all + headlines in the region. + + When there is an active region—i.e., when Transient Mark mode is +active—promotion and demotion work on all headlines in the region. To +select a region of headlines, it is best to place both point and mark at +the beginning of a line, mark at the beginning of the first headline, +and point at the line just after the last headline to change. Note that +when point is inside a table (see *note Tables::), the Meta-Cursor keys +have different functionality. + + +File: org, Node: Sparse Trees, Next: Plain Lists, Prev: Structure Editing, Up: Document Structure + +2.5 Sparse Trees +================ + +An important feature of Org mode is the ability to construct _sparse +trees_ for selected information in an outline tree, so that the entire +document is folded as much as possible, but the selected information is +made visible along with the headline structure above it(1). Just try it +out and you will see immediately how it works. + + Org mode contains several commands creating such trees, all these +commands can be accessed through a dispatcher: + +‘C-c /’ (‘org-sparse-tree’) + This prompts for an extra key to select a sparse-tree creating + command. + +‘C-c / r’ or ‘C-c / /’ (‘org-occur’) + Prompts for a regexp and shows a sparse tree with all matches. If + the match is in a headline, the headline is made visible. If the + match is in the body of an entry, headline and body are made + visible. In order to provide minimal context, also the full + hierarchy of headlines above the match is shown, as well as the + headline following the match. Each match is also highlighted; the + highlights disappear when the buffer is changed by an editing + command, or by pressing ‘C-c C-c’(2). When called with a ‘C-u’ + prefix argument, previous highlights are kept, so several calls to + this command can be stacked. + +‘M-g n’ or ‘M-g M-n’ (‘next-error’) + Jump to the next sparse tree match in this buffer. + +‘M-g p’ or ‘M-g M-p’ (‘previous-error’) + Jump to the previous sparse tree match in this buffer. + + For frequently used sparse trees of specific search strings, you can +use the variable ‘org-agenda-custom-commands’ to define fast keyboard +access to specific sparse trees. These commands will then be accessible +through the agenda dispatcher (see *note Agenda Dispatcher::). For +example: + + (setq org-agenda-custom-commands + '(("f" occur-tree "FIXME"))) + +defines the key ‘f’ as a shortcut for creating a sparse tree matching +the string ‘FIXME’. + + The other sparse tree commands select headings based on TODO +keywords, tags, or properties and are discussed later in this manual. + + To print a sparse tree, you can use the Emacs command +‘ps-print-buffer-with-faces’ which does not print invisible parts of the +document. Or you can use the command ‘C-c C-e v’ to export only the +visible part of the document and print the resulting file. + + ---------- Footnotes ---------- + + (1) See also the variable ‘org-show-context-detail’ to decide how +much context is shown around each match. + + (2) This depends on the option ‘org-remove-highlights-with-change’. + + +File: org, Node: Plain Lists, Next: Drawers, Prev: Sparse Trees, Up: Document Structure + +2.6 Plain Lists +=============== + +Within an entry of the outline tree, hand-formatted lists can provide +additional structure. They also provide a way to create lists of +checkboxes (see *note Checkboxes::). Org supports editing such lists, +and every exporter (see *note Exporting::) can parse and format them. + + Org knows ordered lists, unordered lists, and description lists. + + • _Unordered_ list items start with ‘-’, ‘+’, or ‘*’(1) as bullets. + + • _Ordered_ list items start with a numeral followed by either a + period or a right parenthesis(2), such as ‘1.’ or ‘1)’(3) If you + want a list to start with a different value—e.g., 20—start the text + of the item with ‘[@20]’(4). Those constructs can be used in any + item of the list in order to enforce a particular numbering. + + • _Description_ list items are unordered list items, and contain the + separator ‘::’ to distinguish the description _term_ from the + description. + + Items belonging to the same list must have the same indentation on +the first line. In particular, if an ordered list reaches number ‘10.’, +then the 2-digit numbers must be written left-aligned with the other +numbers in the list. An item ends before the next line that is less or +equally indented than its bullet/number. + + A list ends whenever every item has ended, which means before any +line less or equally indented than items at top level. It also ends +before two blank lines. In that case, all items are closed. Here is an +example: + + * Lord of the Rings + My favorite scenes are (in this order) + 1. The attack of the Rohirrim + 2. Eowyn's fight with the witch king + + this was already my favorite scene in the book + + I really like Miranda Otto. + 3. Peter Jackson being shot by Legolas + - on DVD only + He makes a really funny face when it happens. + But in the end, no individual scenes matter but the film as a whole. + Important actors in this film are: + - Elijah Wood :: He plays Frodo + - Sean Astin :: He plays Sam, Frodo's friend. I still remember him + very well from his role as Mikey Walsh in /The Goonies/. + + Org supports these lists by tuning filling and wrapping commands to +deal with them correctly, and by exporting them properly (see *note +Exporting::). Since indentation is what governs the structure of these +lists, many structural constructs like ‘#+BEGIN_’ blocks can be indented +to signal that they belong to a particular item. + + If you find that using a different bullet for a sub-list—than that +used for the current list-level—improves readability, customize the +variable ‘org-list-demote-modify-bullet’. To get a greater difference +of indentation between items and theirs sub-items, customize +‘org-list-indent-offset’. + + The following commands act on items when point is in the first line +of an item—the line with the bullet or number. Some of them imply the +application of automatic rules to keep list structure intact. If some +of these actions get in your way, configure ‘org-list-automatic-rules’ +to disable them individually. + +‘’ (‘org-cycle’) + Items can be folded just like headline levels. Normally this works + only if point is on a plain list item. For more details, see the + variable ‘org-cycle-include-plain-lists’. If this variable is set + to ‘integrate’, plain list items are treated like low-level + headlines. The level of an item is then given by the indentation + of the bullet/number. Items are always subordinate to real + headlines, however; the hierarchies remain completely separated. + In a new item with no text yet, the first ‘’ demotes the item + to become a child of the previous one. Subsequent ‘’s move + the item to meaningful levels in the list and eventually get it + back to its initial position. + +‘M-’ (‘org-insert-heading’) + Insert new item at current level. With a prefix argument, force a + new heading (see *note Structure Editing::). If this command is + used in the middle of an item, that item is _split_ in two, and the + second part becomes the new item(5). If this command is executed + _before item’s body_, the new item is created _before_ the current + one. + +‘M-S-’ + Insert a new item with a checkbox (see *note Checkboxes::). + +‘S-’ +‘S-’ + Jump to the previous/next item in the current list, but only if + ‘org-support-shift-select’ is off(6). If not, you can still use + paragraph jumping commands like ‘C-’ and ‘C-’ to quite + similar effect. + +‘M-’ +‘M-’ + Move the item including subitems up/down(7), i.e., swap with + previous/next item of same indentation. If the list is ordered, + renumbering is automatic. + +‘M-’ +‘M-’ + Decrease/increase the indentation of an item, leaving children + alone. + +‘M-S-’ +‘M-S-’ + Decrease/increase the indentation of the item, including subitems. + Initially, the item tree is selected based on current indentation. + When these commands are executed several times in direct + succession, the initially selected region is used, even if the new + indentation would imply a different hierarchy. To use the new + hierarchy, break the command chain by moving point. + + As a special case, using this command on the very first item of a + list moves the whole list. This behavior can be disabled by + configuring ‘org-list-automatic-rules’. The global indentation of + a list has no influence on the text _after_ the list. + +‘C-c C-c’ + If there is a checkbox (see *note Checkboxes::) in the item line, + toggle the state of the checkbox. In any case, verify bullets and + indentation consistency in the whole list. + +‘C-c -’ + Cycle the entire list level through the different itemize/enumerate + bullets (‘-’, ‘+’, ‘*’, ‘1.’, ‘1)’) or a subset of them, depending + on ‘org-plain-list-ordered-item-terminator’, the type of list, and + its indentation. With a numeric prefix argument N, select the Nth + bullet from this list. If there is an active region when calling + this, selected text is changed into an item. With a prefix + argument, all lines are converted to list items. If the first line + already was a list item, any item marker is removed from the list. + Finally, even without an active region, a normal line is converted + into a list item. + +‘C-c *’ + Turn a plain list item into a headline—so that it becomes a + subheading at its location. See *note Structure Editing::, for a + detailed explanation. + +‘C-c C-*’ + Turn the whole plain list into a subtree of the current heading. + Checkboxes (see *note Checkboxes::) become TODO, respectively DONE, + keywords when unchecked, respectively checked. + +‘S-’ +‘S-’ + This command also cycles bullet styles when point is in on the + bullet or anywhere in an item line, details depending on + ‘org-support-shift-select’. + +‘C-c ^’ + Sort the plain list. Prompt for the sorting method: numerically, + alphabetically, by time, or by custom function. + + ---------- Footnotes ---------- + + (1) When using ‘*’ as a bullet, lines must be indented so that they +are not interpreted as headlines. Also, when you are hiding leading +stars to get a clean outline view, plain list items starting with a star +may be hard to distinguish from true headlines. In short: even though +‘*’ is supported, it may be better to not use it for plain list items. + + (2) You can filter out any of them by configuring +‘org-plain-list-ordered-item-terminator’. + + (3) You can also get ‘a.’, ‘A.’, ‘a)’ and ‘A)’ by configuring +‘org-list-allow-alphabetical’. To minimize confusion with normal text, +those are limited to one character only. Beyond that limit, bullets +automatically become numbers. + + (4) If there’s a checkbox in the item, the cookie must be put +_before_ the checkbox. If you have activated alphabetical lists, you +can also use counters like ‘[@b]’. + + (5) If you do not want the item to be split, customize the variable +‘org-M-RET-may-split-line’. + + (6) If you want to cycle around items that way, you may customize +‘org-list-use-circular-motion’. + + (7) See ‘org-list-use-circular-motion’ for a cyclic behavior. + + +File: org, Node: Drawers, Next: Blocks, Prev: Plain Lists, Up: Document Structure + +2.7 Drawers +=========== + +Sometimes you want to keep information associated with an entry, but you +normally do not want to see it. For this, Org mode has _drawers_. They +can contain anything but a headline and another drawer. Drawers look +like this: + + ** This is a headline + Still outside the drawer + :DRAWERNAME: + This is inside the drawer. + :END: + After the drawer. + + You can interactively insert a drawer at point by calling +‘org-insert-drawer’, which is bound to ‘C-c C-x d’. With an active +region, this command puts the region inside the drawer. With a prefix +argument, this command calls ‘org-insert-property-drawer’, which creates +a ‘PROPERTIES’ drawer right below the current headline. Org mode uses +this special drawer for storing properties (see *note Properties and +Columns::). You cannot use it for anything else. + + Completion over drawer keywords is also possible using ‘M-’(1). + + Visibility cycling (see *note Visibility Cycling::) on the headline +hides and shows the entry, but keep the drawer collapsed to a single +line. In order to look inside the drawer, you need to move point to the +drawer line and press ‘’ there. + + You can also arrange for state change notes (see *note Tracking TODO +state changes::) and clock times (see *note Clocking Work Time::) to be +stored in a ‘LOGBOOK’ drawer. If you want to store a quick note there, +in a similar way to state changes, use + +‘C-c C-z’ + Add a time-stamped note to the ‘LOGBOOK’ drawer. + + ---------- Footnotes ---------- + + (1) Many desktops intercept ‘M-’ to switch windows. Use ‘C-M-i’ +or ‘ ’ instead. + + +File: org, Node: Blocks, Next: Creating Footnotes, Prev: Drawers, Up: Document Structure + +2.8 Blocks +========== + +Org mode uses ‘#+BEGIN’ ... ‘#+END’ blocks for various purposes from +including source code examples (see *note Literal Examples::) to +capturing time logging information (see *note Clocking Work Time::). +These blocks can be folded and unfolded by pressing ‘’ in the +‘#+BEGIN’ line. You can also get all blocks folded at startup by +configuring the variable ‘org-hide-block-startup’ or on a per-file basis +by using + + #+STARTUP: hideblocks + #+STARTUP: nohideblocks + + +File: org, Node: Creating Footnotes, Prev: Blocks, Up: Document Structure + +2.9 Creating Footnotes +====================== + +Org mode supports the creation of footnotes. + + A footnote is started by a footnote marker in square brackets in +column 0, no indentation allowed. It ends at the next footnote +definition, headline, or after two consecutive empty lines. The +footnote reference is simply the marker in square brackets, inside text. +Markers always start with ‘fn:’. For example: + + The Org homepage[fn:1] now looks a lot better than it used to. + ... + [fn:1] The link is: https://orgmode.org + + Org mode extends the number-based syntax to _named_ footnotes and +optional inline definition. Here are the valid references: + +‘[fn:NAME]’ + A named footnote reference, where NAME is a unique label word, or, + for simplicity of automatic creation, a number. + +‘[fn:: This is the inline definition of this footnote]’ + A LaTeX-like anonymous footnote where the definition is given + directly at the reference point. + +‘[fn:NAME: a definition]’ + An inline definition of a footnote, which also specifies a name for + the note. Since Org allows multiple references to the same note, + you can then use ‘[fn:NAME]’ to create additional references. + + Footnote labels can be created automatically, or you can create names +yourself. This is handled by the variable ‘org-footnote-auto-label’ and +its corresponding ‘STARTUP’ keywords. See the docstring of that +variable for details. + + The following command handles footnotes: + +‘C-c C-x f’ + The footnote action command. + + When point is on a footnote reference, jump to the definition. + When it is at a definition, jump to the—first—reference. + + Otherwise, create a new footnote. Depending on the variable + ‘org-footnote-define-inline’(1), the definition is placed right + into the text as part of the reference, or separately into the + location determined by the variable ‘org-footnote-section’. + + When this command is called with a prefix argument, a menu of + additional options is offered: + + ‘s’ Sort the footnote definitions by reference sequence. + ‘r’ Renumber the simple ‘fn:N’ footnotes. + ‘S’ Short for first ‘r’, then ‘s’ action. + ‘n’ Rename all footnotes into a ‘fn:1’ ... ‘fn:n’ sequence. + ‘d’ Delete the footnote at point, including definition and + references. + + Depending on the variable ‘org-footnote-auto-adjust’(2), + renumbering and sorting footnotes can be automatic after each + insertion or deletion. + +‘C-c C-c’ + If point is on a footnote reference, jump to the definition. If it + is at the definition, jump back to the reference. When called at a + footnote location with a prefix argument, offer the same menu as + ‘C-c C-x f’. + +‘C-c C-o’ or ‘mouse-1/2’ + Footnote labels are also links to the corresponding definition or + reference, and you can use the usual commands to follow these + links. + + ---------- Footnotes ---------- + + (1) The corresponding in-buffer setting is: ‘#+STARTUP: fninline’ or +‘#+STARTUP: nofninline’. + + (2) The corresponding in-buffer options are ‘#+STARTUP: fnadjust’ and +‘#+STARTUP: nofnadjust’. + + +File: org, Node: Tables, Next: Hyperlinks, Prev: Document Structure, Up: Top + +3 Tables +******** + +Org comes with a fast and intuitive table editor. Spreadsheet-like +calculations are supported using the Emacs Calc package (see *note GNU +Emacs Calculator Manual: (calc)Top.). + +* Menu: + +* Built-in Table Editor:: Simple tables. +* Column Width and Alignment:: Overrule the automatic settings. +* Column Groups:: Grouping to trigger vertical lines. +* Orgtbl Mode:: The table editor as minor mode. +* The Spreadsheet:: The table editor has spreadsheet capabilities. +* Org Plot:: Plotting from Org tables. + + +File: org, Node: Built-in Table Editor, Next: Column Width and Alignment, Up: Tables + +3.1 Built-in Table Editor +========================= + +Org makes it easy to format tables in plain ASCII. Any line with ‘|’ as +the first non-whitespace character is considered part of a table. ‘|’ +is also the column separator(1). Moreover, a line starting with ‘|-’ is +a horizontal rule. It separates rows explicitely. Rows before the +first horizontal rule are header lines. A table might look like this: + + | Name | Phone | Age | + |-------+-------+-----| + | Peter | 1234 | 17 | + | Anna | 4321 | 25 | + + A table is re-aligned automatically each time you press ‘’, +‘’ or ‘C-c C-c’ inside the table. ‘’ also moves to the next +field—‘’ to the next row—and creates new table rows at the end of +the table or before horizontal lines. The indentation of the table is +set by the first line. Horizontal rules are automatically expanded on +every re-align to span the whole table width. So, to create the above +table, you would only type + + |Name|Phone|Age| + |- + +and then press ‘’ to align the table and start filling in fields. +Even faster would be to type ‘|Name|Phone|Age’ followed by ‘C-c ’. + + When typing text into a field, Org treats ‘DEL’, ‘Backspace’, and all +character keys in a special way, so that inserting and deleting avoids +shifting other fields. Also, when typing _immediately_ after point was +moved into a new field with ‘’, ‘S-’ or ‘’, the field is +automatically made blank. If this behavior is too unpredictable for +you, configure the option ‘org-table-auto-blank-field’. + +Creation and conversion +----------------------- + +‘C-c |’ (‘org-table-create-or-convert-from-region’) + Convert the active region to table. If every line contains at + least one ‘’ character, the function assumes that the material + is tab separated. If every line contains a comma, comma-separated + values (CSV) are assumed. If not, lines are split at whitespace + into fields. You can use a prefix argument to force a specific + separator: ‘C-u’ forces CSV, ‘C-u C-u’ forces ‘’, ‘C-u C-u + C-u’ prompts for a regular expression to match the separator, and a + numeric argument N indicates that at least N consecutive spaces, or + alternatively a ‘’ will be the separator. + + If there is no active region, this command creates an empty Org + table. But it is easier just to start typing, like ‘| N a m e | P + h o n e | A g e | - ’. + +Re-aligning and field motion +---------------------------- + +‘C-c C-c’ (‘org-table-align’) + Re-align the table without moving point. + +‘’ (‘org-table-next-field’) + Re-align the table, move to the next field. Creates a new row if + necessary. + +‘C-c ’ (‘org-table-blank-field’) + Blank the field at point. + +‘S-’ (‘org-table-previous-field’) + Re-align, move to previous field. + +‘’ (‘org-table-next-row’) + Re-align the table and move down to next row. Creates a new row if + necessary. At the beginning or end of a line, ‘’ still + inserts a new line, so it can be used to split a table. + +‘M-a’ (‘org-table-beginning-of-field’) + Move to beginning of the current table field, or on to the previous + field. + +‘M-e’ (‘org-table-end-of-field’) + Move to end of the current table field, or on to the next field. + +Column and row editing +---------------------- + +‘M-’ (‘org-table-move-column-left’) + Move the current column left. + +‘M-’ (‘org-table-move-column-right’) + Move the current column right. + +‘M-S-’ (‘org-table-delete-column’) + Kill the current column. + +‘M-S-’ (‘org-table-insert-column’) + Insert a new column to the left of point position. + +‘M-’ (‘org-table-move-row-up’) + Move the current row up. + +‘M-’ (‘org-table-move-row-down’) + Move the current row down. + +‘M-S-’ (‘org-table-kill-row’) + Kill the current row or horizontal line. + +‘M-S-’ (‘org-table-insert-row’) + Insert a new row above the current row. With a prefix argument, + the line is created below the current one. + +‘C-c -’ (‘org-table-insert-hline’) + Insert a horizontal line below current row. With a prefix + argument, the line is created above the current line. + +‘C-c ’ (‘org-table-hline-and-move’) + Insert a horizontal line below current row, and move point into the + row below that line. + +‘C-c ^’ (‘org-table-sort-lines’) + Sort the table lines in the region. The position of point + indicates the column to be used for sorting, and the range of lines + is the range between the nearest horizontal separator lines, or the + entire table. If point is before the first column, you are + prompted for the sorting column. If there is an active region, the + mark specifies the first line and the sorting column, while point + should be in the last line to be included into the sorting. The + command prompts for the sorting type, alphabetically, numerically, + or by time. You can sort in normal or reverse order. You can also + supply your own key extraction and comparison functions. When + called with a prefix argument, alphabetic sorting is + case-sensitive. + +Regions +------- + +‘C-c C-x M-w’ (‘org-table-copy-region’) + Copy a rectangular region from a table to a special clipboard. + Point and mark determine edge fields of the rectangle. If there is + no active region, copy just the current field. The process ignores + horizontal separator lines. + +‘C-c C-x C-w’ (‘org-table-cut-region’) + Copy a rectangular region from a table to a special clipboard, and + blank all fields in the rectangle. So this is the “cut” operation. + +‘C-c C-x C-y’ (‘org-table-paste-rectangle’) + Paste a rectangular region into a table. The upper left corner + ends up in the current field. All involved fields are overwritten. + If the rectangle does not fit into the present table, the table is + enlarged as needed. The process ignores horizontal separator + lines. + +‘M-’ (‘org-table-wrap-region’) + Split the current field at point position and move the rest to the + line below. If there is an active region, and both point and mark + are in the same column, the text in the column is wrapped to + minimum width for the given number of lines. A numeric prefix + argument may be used to change the number of desired lines. If + there is no region, but you specify a prefix argument, the current + field is made blank, and the content is appended to the field + above. + +Calculations +------------ + +‘C-c +’ (‘org-table-sum’) + Sum the numbers in the current column, or in the rectangle defined + by the active region. The result is shown in the echo area and can + be inserted with ‘C-y’. + +‘S-’ (‘org-table-copy-down’) + When current field is empty, copy from first non-empty field above. + When not empty, copy current field down to next row and move point + along with it. Depending on the variable + ‘org-table-copy-increment’, integer field values can be incremented + during copy. Integers that are too large are not incremented, + however. Also, a ‘0’ prefix argument temporarily disables the + increment. This key is also used by shift-selection and related + modes (see *note Conflicts::). + +Miscellaneous +------------- + +‘C-c `’ (‘org-table-edit-field’) + Edit the current field in a separate window. This is useful for + fields that are not fully visible (see *note Column Width and + Alignment::). When called with a ‘C-u’ prefix, just make the full + field visible, so that it can be edited in place. When called with + two ‘C-u’ prefixes, make the editor window follow point through the + table and always show the current field. The follow mode exits + automatically when point leaves the table, or when you repeat this + command with ‘C-u C-u C-c `’. + +‘M-x org-table-import’ + Import a file as a table. The table should be TAB or whitespace + separated. Use, for example, to import a spreadsheet table or data + from a database, because these programs generally can write + TAB-separated text files. This command works by inserting the file + into the buffer and then converting the region to a table. Any + prefix argument is passed on to the converter, which uses it to + determine the separator. + +‘C-c |’ (‘org-table-create-or-convert-from-region’) + Tables can also be imported by pasting tabular text into the Org + buffer, selecting the pasted text with ‘C-x C-x’ and then using the + ‘C-c |’ command (see *note Creation and conversion::). + +‘M-x org-table-export’ + Export the table, by default as a TAB-separated file. Use for data + exchange with, for example, spreadsheet or database programs. The + format used to export the file can be configured in the variable + ‘org-table-export-default-format’. You may also use properties + ‘TABLE_EXPORT_FILE’ and ‘TABLE_EXPORT_FORMAT’ to specify the file + name and the format for table export in a subtree. Org supports + quite general formats for exported tables. The exporter format is + the same as the format used by Orgtbl radio tables, see *note + Translator functions::, for a detailed description. + + ---------- Footnotes ---------- + + (1) To insert a vertical bar into a table field, use ‘\vert’ or, +inside a word ‘abc\vert{}def’. + + +File: org, Node: Column Width and Alignment, Next: Column Groups, Prev: Built-in Table Editor, Up: Tables + +3.2 Column Width and Alignment +============================== + +The width of columns is automatically determined by the table editor. +The alignment of a column is determined automatically from the fraction +of number-like versus non-number fields in the column. + + Editing a field may modify alignment of the table. Moving a +contiguous row or column—i.e., using ‘’ or ‘’—automatically +re-aligns it. If you want to disable this behavior, set +‘org-table-automatic-realign’ to ‘nil’. In any case, you can always +align manually a table: + +‘C-c C-c’ (‘org-table-align’) + Align the current table. + + Setting the option ‘org-startup-align-all-tables’ re-aligns all +tables in a file upon visiting it. You can also set this option on a +per-file basis with: + + #+STARTUP: align + #+STARTUP: noalign + + Sometimes a single field or a few fields need to carry more text, +leading to inconveniently wide columns. Maybe you want to hide away +several columns or display them with a fixed width, regardless of +content, as shown in the following example. + + |---+---------------------+--------| |---+-------…|…| + | | <6> | | | | <6> …|…| + | 1 | one | some | ----\ | 1 | one …|…| + | 2 | two | boring | ----/ | 2 | two …|…| + | 3 | This is a long text | column | | 3 | This i…|…| + |---+---------------------+--------| |---+-------…|…| + + To set the width of a column, one field anywhere in the column may +contain just the string ‘’ where N specifies the width as a number of +characters. You control displayed width of columns with the following +tools: + +‘C-c ’ (‘org-table-toggle-column-width’) + Shrink or expand current column. + + If a width cookie specifies a width W for the column, shrinking it + displays the first W visible characters only. Otherwise, the + column is shrunk to a single character. + + When called before the first column or after the last one, ask for + a list of column ranges to operate on. + +‘C-u C-c ’ (‘org-table-shrink’) + Shrink all columns with a column width. Expand the others. + +‘C-u C-u C-c ’ (‘org-table-expand’) + Expand all columns. + + To see the full text of a shrunk field, hold the mouse over it: a +tool-tip window then shows the full contents of the field. +Alternatively, ‘C-h .’ (‘display-local-help’) reveals them, too. For +convenience, any change near the shrunk part of a column expands it. + + Setting the option ‘org-startup-shrink-all-tables’ shrinks all +columns containing a width cookie in a file the moment it is visited. +You can also set this option on a per-file basis with: + + #+STARTUP: shrink + + If you would like to overrule the automatic alignment of number-rich +columns to the right and of string-rich columns to the left, you can use +‘’, ‘’ or ‘’ in a similar fashion. You may also combine +alignment and field width like this: ‘’. + + Lines which only contain these formatting cookies are removed +automatically upon exporting the document. + + +File: org, Node: Column Groups, Next: Orgtbl Mode, Prev: Column Width and Alignment, Up: Tables + +3.3 Column Groups +================= + +When Org exports tables, it does so by default without vertical lines +because that is visually more satisfying in general. Occasionally +however, vertical lines can be useful to structure a table into groups +of columns, much like horizontal lines can do for groups of rows. In +order to specify column groups, you can use a special row where the +first field contains only ‘/’. The further fields can either contain +‘<’ to indicate that this column should start a group, ‘>’ to indicate +the end of a column, or ‘<>’ (no space between ‘<’ and ‘>’) to make a +column a group of its own. Upon export, boundaries between column +groups are marked with vertical lines. Here is an example: + + | N | N^2 | N^3 | N^4 | sqrt(n) | sqrt[4](N) | + |---+-----+-----+-----+---------+------------| + | / | < | | > | < | > | + | 1 | 1 | 1 | 1 | 1 | 1 | + | 2 | 4 | 8 | 16 | 1.4142 | 1.1892 | + | 3 | 9 | 27 | 81 | 1.7321 | 1.3161 | + |---+-----+-----+-----+---------+------------| + #+TBLFM: $2=$1^2::$3=$1^3::$4=$1^4::$5=sqrt($1)::$6=sqrt(sqrt(($1))) + + It is also sufficient to just insert the column group starters after +every vertical line you would like to have: + + | N | N^2 | N^3 | N^4 | sqrt(n) | sqrt[4](N) | + |---+-----+-----+-----+---------+------------| + | / | < | | | < | | + + +File: org, Node: Orgtbl Mode, Next: The Spreadsheet, Prev: Column Groups, Up: Tables + +3.4 The Orgtbl Minor Mode +========================= + +If you like the intuitive way the Org table editor works, you might also +want to use it in other modes like Text mode or Mail mode. The minor +mode Orgtbl mode makes this possible. You can always toggle the mode +with ‘M-x orgtbl-mode’. To turn it on by default, for example in +Message mode, use + + (add-hook 'message-mode-hook 'turn-on-orgtbl) + + Furthermore, with some special setup, it is possible to maintain +tables in arbitrary syntax with Orgtbl mode. For example, it is +possible to construct LaTeX tables with the underlying ease and power of +Orgtbl mode, including spreadsheet capabilities. For details, see *note +Tables in Arbitrary Syntax::. + + +File: org, Node: The Spreadsheet, Next: Org Plot, Prev: Orgtbl Mode, Up: Tables + +3.5 The Spreadsheet +=================== + +The table editor makes use of the Emacs Calc package to implement +spreadsheet-like capabilities. It can also evaluate Emacs Lisp forms to +derive fields from other fields. While fully featured, Org’s +implementation is not identical to other spreadsheets. For example, Org +knows the concept of a _column formula_ that will be applied to all +non-header fields in a column without having to copy the formula to each +relevant field. There is also a formula debugger, and a formula editor +with features for highlighting fields in the table corresponding to the +references at point in the formula, moving these references by arrow +keys. + +* Menu: + +* References:: How to refer to another field or range. +* Formula syntax for Calc:: Using Calc to compute stuff. +* Formula syntax for Lisp:: Writing formulas in Emacs Lisp. +* Durations and time values:: How to compute durations and time values. +* Field and range formulas:: Formula for specific (ranges of) fields. +* Column formulas:: Formulas valid for an entire column. +* Lookup functions:: Lookup functions for searching tables. +* Editing and debugging formulas:: Fixing formulas. +* Updating the table:: Recomputing all dependent fields. +* Advanced features:: Field and column names, automatic recalculation... + + +File: org, Node: References, Next: Formula syntax for Calc, Up: The Spreadsheet + +3.5.1 References +---------------- + +To compute fields in the table from other fields, formulas must +reference other fields or ranges. In Org, fields can be referenced by +name, by absolute coordinates, and by relative coordinates. To find out +what the coordinates of a field are, press ‘C-c ?’ in that field, or +press ‘C-c }’ to toggle the display of a grid. + +Field references +................ + +Formulas can reference the value of another field in two ways. Like in +any other spreadsheet, you may reference fields with a letter/number +combination like ‘B3’, meaning the second field in the third row. +However, Org prefers to use another, more general representation that +looks like this:(1) + + @ROW$COLUMN + + Column specifications can be absolute like ‘$1’, ‘$2’, ..., ‘$N’, or +relative to the current column, i.e., the column of the field which is +being computed, like ‘$+1’ or ‘$-2’. ‘$<’ and ‘$>’ are immutable +references to the first and last column, respectively, and you can use +‘$>>>’ to indicate the third column from the right. + + The row specification only counts data lines and ignores horizontal +separator lines, or “hlines”. Like with columns, you can use absolute +row numbers ‘@1’, ‘@2’, ..., ‘@N’, and row numbers relative to the +current row like ‘@+3’ or ‘@-1’. ‘@<’ and ‘@>’ are immutable references +the first and last row in the table, respectively. You may also specify +the row relative to one of the hlines: ‘@I’ refers to the first hline, +‘@II’ to the second, etc. ‘@-I’ refers to the first such line above the +current line, ‘@+I’ to the first such line below the current line. You +can also write ‘@III+2’ which is the second data line after the third +hline in the table. + + ‘@0’ and ‘$0’ refer to the current row and column, respectively, +i.e., to the row/column for the field being computed. Also, if you omit +either the column or the row part of the reference, the current +row/column is implied. + + Org’s references with _unsigned_ numbers are fixed references in the +sense that if you use the same reference in the formula for two +different fields, the same field is referenced each time. Org’s +references with _signed_ numbers are floating references because the +same reference operator can reference different fields depending on the +field being calculated by the formula. + + Here are a few examples: + +‘@2$3’ 2nd row, 3rd column (same as ‘C2’) +‘$5’ column 5 in the current row (same as ‘E&’) +‘@2’ current column, row 2 +‘@-1$-3’ field one row up, three columns to the left +‘@-I$2’ field just under hline above current row, column 2 +‘@>$5’ field in the last row, in column 5 + +Range references +................ + +You may reference a rectangular range of fields by specifying two field +references connected by two dots ‘..’. If both fields are in the +current row, you may simply use ‘$2..$7’, but if at least one field is +in a different row, you need to use the general ‘@ROW$COLUMN’ format at +least for the first field, i.e., the reference must start with ‘@’ in +order to be interpreted correctly. Examples: + +‘$1..$3’ first three fields in the current row +‘$P..$Q’ range, using column names (see + *note Advanced features::) +‘$<<<..$>>’ start in third column, continue to the last but one +‘@2$1..@4$3’ six fields between these two fields (same as ‘A2..C4’) +‘@-1$-2..@-1’ 3 fields in the row above, starting from 2 columns on + the left +‘@I..II’ between first and second hline, short for ‘@I..@II’ + +Range references return a vector of values that can be fed into Calc +vector functions. Empty fields in ranges are normally suppressed, so +that the vector contains only the non-empty fields. For other options +with the mode switches ‘E’, ‘N’ and examples, see *note Formula syntax +for Calc::. + +Field coordinates in formulas +............................. + +One of the very first actions during evaluation of Calc formulas and +Lisp formulas is to substitute ‘@#’ and ‘$#’ in the formula with the row +or column number of the field where the current result will go to. The +traditional Lisp formula equivalents are ‘org-table-current-dline’ and +‘org-table-current-column’. Examples: + +‘if(@# % 2, $#, string(""))’ + Insert column number on odd rows, set field to empty on even rows. + +‘$2 = '(identity remote(FOO, @@#$1))’ + Copy text or values of each row of column 1 of the table named FOO + into column 2 of the current table. + +‘@3 = 2 * remote(FOO, @@1$$#)’ + Insert the doubled value of each column of row 1 of the table named + FOO into row 3 of the current table. + +For the second and third examples, table FOO must have at least as many +rows or columns as the current table. Note that this is inefficient(2) +for large number of rows. + +Named references +................ + +‘$name’ is interpreted as the name of a column, parameter or constant. +Constants are defined globally through the variable +‘org-table-formula-constants’, and locally—for the file—through a line +like this example: + + #+CONSTANTS: c=299792458. pi=3.14 eps=2.4e-6 + + Also, properties (see *note Properties and Columns::) can be used as +constants in table formulas: for a property ‘Xyz’ use the name +‘$PROP_Xyz’, and the property will be searched in the current outline +entry and in the hierarchy above it. If you have the ‘constants.el’ +package, it will also be used to resolve constants, including natural +constants like ‘$h’ for Planck’s constant, and units like ‘$km’ for +kilometers(3). Column names and parameters can be specified in special +table lines. These are described below, see *note Advanced features::. +All names must start with a letter, and further consist of letters and +numbers. + +Remote references +................. + +You may also reference constants, fields and ranges from a different +table, either in the current file or even in a different file. The +syntax is + + remote(NAME,REF) + +where NAME can be the name of a table in the current file as set by a +‘#+NAME:’ line before the table. It can also be the ID of an entry, +even in a different file, and the reference then refers to the first +table in that entry. REF is an absolute field or range reference as +described above for example ‘@3$3’ or ‘$somename’, valid in the +referenced table. + + When NAME has the format ‘@ROW$COLUMN’, it is substituted with the +name or ID found in this field of the current table. For example +‘remote($1, @@>$2)’ ⇒ ‘remote(year_2013, @@>$1)’. The format ‘B3’ is +not supported because it can not be distinguished from a plain table +name or ID. + + ---------- Footnotes ---------- + + (1) Org understands references typed by the user as ‘B4’, but it does +not use this syntax when offering a formula for editing. You can +customize this behavior using the variable +‘org-table-use-standard-references’. + + (2) The computation time scales as O(N^2) because table FOO is parsed +for each field to be copied. + + (3) The file ‘constants.el’ can supply the values of constants in two +different unit systems, ‘SI’ and ‘cgs’. Which one is used depends on +the value of the variable ‘constants-unit-system’. You can use the +‘STARTUP’ options ‘constSI’ and ‘constcgs’ to set this value for the +current buffer. + + +File: org, Node: Formula syntax for Calc, Next: Formula syntax for Lisp, Prev: References, Up: The Spreadsheet + +3.5.2 Formula syntax for Calc +----------------------------- + +A formula can be any algebraic expression understood by the Emacs Calc +package. Note that Calc has the non-standard convention that ‘/’ has +lower precedence than ‘*’, so that ‘a/b*c’ is interpreted as +‘(a/(b*c))’. Before evaluation by ‘calc-eval’ (see *note Calling Calc +from Your Lisp Programs: (calc)Calling Calc from Your Programs.), +variable substitution takes place according to the rules described +above. + + The range vectors can be directly fed into the Calc vector functions +like ‘vmean’ and ‘vsum’. + + A formula can contain an optional mode string after a semicolon. +This string consists of flags to influence Calc and other modes during +execution. By default, Org uses the standard Calc modes (precision 12, +angular units degrees, fraction and symbolic modes off). The display +format, however, has been changed to ‘(float 8)’ to keep tables compact. +The default settings can be configured using the variable +‘org-calc-default-modes’. + +‘p20’ + Set the internal Calc calculation precision to 20 digits. + +‘n3’, ‘s3’, ‘e2’, ‘f4’ + Normal, scientific, engineering or fixed format of the result of + Calc passed back to Org. Calc formatting is unlimited in precision + as long as the Calc calculation precision is greater. + +‘D’, ‘R’ + Degree and radian angle modes of Calc. + +‘F’, ‘S’ + Fraction and symbolic modes of Calc. + +‘T’, ‘t’, ‘U’ + Duration computations in Calc or Lisp, *note Durations and time + values::. + +‘E’ + If and how to consider empty fields. Without ‘E’ empty fields in + range references are suppressed so that the Calc vector or Lisp + list contains only the non-empty fields. With ‘E’ the empty fields + are kept. For empty fields in ranges or empty field references the + value ‘nan’ (not a number) is used in Calc formulas and the empty + string is used for Lisp formulas. Add ‘N’ to use 0 instead for + both formula types. For the value of a field the mode ‘N’ has + higher precedence than ‘E’. + +‘N’ + Interpret all fields as numbers, use 0 for non-numbers. See the + next section to see how this is essential for computations with + Lisp formulas. In Calc formulas it is used only occasionally + because there number strings are already interpreted as numbers + without ‘N’. + +‘L’ + Literal, for Lisp formulas only. See the next section. + + Unless you use large integer numbers or high-precision calculation +and display for floating point numbers you may alternatively provide a +‘printf’ format specifier to reformat the Calc result after it has been +passed back to Org instead of letting Calc already do the formatting(1). +A few examples: + +‘$1+$2’ Sum of first and second field +‘$1+$2;%.2f’ Same, format result to two decimals +‘exp($2)+exp($1)’ Math functions can be used +‘$0;%.1f’ Reformat current cell to 1 decimal +‘($3-32)*5/9’ Degrees F → C conversion +‘$c/$1/$cm’ Hz → cm conversion, using ‘constants.el’ +‘tan($1);Dp3s1’ Compute in degrees, precision 3, display SCI 1 +‘sin($1);Dp3%.1e’ Same, but use ‘printf’ specifier for display +‘vmean($2..$7)’ Compute column range mean, using vector function +‘vmean($2..$7);EN’ Same, but treat empty fields as 0 +‘taylor($3,x=7,2)’ Taylor series of $3, at x=7, second degree + + Calc also contains a complete set of logical operations (see *note +Logical Operations: (calc)Logical Operations.). For example + +‘if($1 < 20, teen, string(""))’ + ‘"teen"’ if age ‘$1’ is less than 20, else the Org table result + field is set to empty with the empty string. + +‘if("$1" =​= "nan" || "$2" =​= "nan", string(""), $1 + $2); E f-1’ + Sum of the first two columns. When at least one of the input + fields is empty the Org table result field is set to empty. ‘E’ is + required to not convert empty fields to 0. ‘f-1’ is an optional + Calc format string similar to ‘%.1f’ but leaves empty results + empty. + +‘if(typeof(vmean($1..$7)) =​= 12, string(""), vmean($1..$7); E’ + Mean value of a range unless there is any empty field. Every field + in the range that is empty is replaced by ‘nan’ which lets ‘vmean’ + result in ‘nan’. Then ‘typeof =’ 12= detects the ‘nan’ from + ‘vmean’ and the Org table result field is set to empty. Use this + when the sample set is expected to never have missing values. + +‘if("$1..$7" =​= "[]", string(""), vmean($1..$7))’ + Mean value of a range with empty fields skipped. Every field in + the range that is empty is skipped. When all fields in the range + are empty the mean value is not defined and the Org table result + field is set to empty. Use this when the sample set can have a + variable size. + +‘vmean($1..$7); EN’ + To complete the example before: Mean value of a range with empty + fields counting as samples with value 0. Use this only when + incomplete sample sets should be padded with 0 to the full size. + + You can add your own Calc functions defined in Emacs Lisp with +‘defmath’ and use them in formula syntax for Calc. + + ---------- Footnotes ---------- + + (1) The printf reformatting is limited in precision because the value +passed to it is converted into an “integer” or “double”. The “integer” +is limited in size by truncating the signed value to 32 bits. The +“double” is limited in precision to 64 bits overall which leaves +approximately 16 significant decimal digits. + + +File: org, Node: Formula syntax for Lisp, Next: Durations and time values, Prev: Formula syntax for Calc, Up: The Spreadsheet + +3.5.3 Emacs Lisp forms as formulas +---------------------------------- + +It is also possible to write a formula in Emacs Lisp. This can be +useful for string manipulation and control structures, if Calc’s +functionality is not enough. + + If a formula starts with a single-quote followed by an opening +parenthesis, then it is evaluated as a Lisp form. The evaluation should +return either a string or a number. Just as with Calc formulas, you can +specify modes and a ‘printf’ format after a semicolon. + + With Emacs Lisp forms, you need to be conscious about the way field +references are interpolated into the form. By default, a reference is +interpolated as a Lisp string (in double-quotes) containing the field. +If you provide the ‘N’ mode switch, all referenced elements are +numbers—non-number fields will be zero—and interpolated as Lisp numbers, +without quotes. If you provide the ‘L’ flag, all fields are +interpolated literally, without quotes. For example, if you want a +reference to be interpreted as a string by the Lisp form, enclose the +reference operator itself in double-quotes, like ‘"$3"’. Ranges are +inserted as space-separated fields, so you can embed them in list or +vector syntax. + + Here are a few examples—note how the ‘N’ mode is used when we do +computations in Lisp: + +‘'(concat (substring $1 1 2) (substring $1 0 1) (substring $1 2))’ + Swap the first two characters of the content of column 1. + +‘'(+ $1 $2);N’ + Add columns 1 and 2, equivalent to Calc’s ‘$1+$2’. + +‘'(apply '+ '($1..$4));N’ + Compute the sum of columns 1 to 4, like Calc’s ‘vsum($1..$4)’. + + +File: org, Node: Durations and time values, Next: Field and range formulas, Prev: Formula syntax for Lisp, Up: The Spreadsheet + +3.5.4 Durations and time values +------------------------------- + +If you want to compute time values use the ‘T’, ‘t’, or ‘U’ flag, either +in Calc formulas or Elisp formulas: + + | Task 1 | Task 2 | Total | + |---------+----------+----------| + | 2:12 | 1:47 | 03:59:00 | + | 2:12 | 1:47 | 03:59 | + | 3:02:20 | -2:07:00 | 0.92 | + #+TBLFM: @2$3=$1+$2;T::@3$3=$1+$2;U::@4$3=$1+$2;t + + Input duration values must be of the form ‘HH:MM[:SS]’, where seconds +are optional. With the ‘T’ flag, computed durations are displayed as +‘HH:MM:SS’ (see the first formula above). With the ‘U’ flag, seconds +are omitted so that the result is only ‘HH:MM’ (see second formula +above). Zero-padding of the hours field depends upon the value of the +variable ‘org-table-duration-hour-zero-padding’. + + With the ‘t’ flag, computed durations are displayed according to the +value of the option ‘org-table-duration-custom-format’, which defaults +to ‘hours’ and displays the result as a fraction of hours (see the third +formula in the example above). + + Negative duration values can be manipulated as well, and integers are +considered as seconds in addition and subtraction. + + +File: org, Node: Field and range formulas, Next: Column formulas, Prev: Durations and time values, Up: The Spreadsheet + +3.5.5 Field and range formulas +------------------------------ + +To assign a formula to a particular field, type it directly into the +field, preceded by ‘:=’, for example ‘vsum(@II..III)’. When you press +‘’ or ‘’ or ‘C-c C-c’ with point still in the field, the +formula is stored as the formula for this field, evaluated, and the +current field is replaced with the result. + + Formulas are stored in a special ‘TBLFM’ keyword located directly +below the table. If you type the equation in the fourth field of the +third data line in the table, the formula looks like ‘@3$4=$1+$2’. When +inserting/deleting/swapping column and rows with the appropriate +commands, _absolute references_ (but not relative ones) in stored +formulas are modified in order to still reference the same field. To +avoid this from happening, in particular in range references, anchor +ranges at the table borders (using ‘@<’, ‘@>’, ‘$<’, ‘$>’), or at hlines +using the ‘@I’ notation. Automatic adaptation of field references does +not happen if you edit the table structure with normal editing +commands—you must fix the formulas yourself. + + Instead of typing an equation into the field, you may also use the +following command + +‘C-u C-c =’ (‘org-table-eval-formula’) + Install a new formula for the current field. The command prompts + for a formula with default taken from the ‘TBLFM’ keyword, applies + it to the current field, and stores it. + + The left-hand side of a formula can also be a special expression in +order to assign the formula to a number of different fields. There is +no keyboard shortcut to enter such range formulas. To add them, use the +formula editor (see *note Editing and debugging formulas::) or edit the +‘TBLFM’ keyword directly. + +‘$2=’ + Column formula, valid for the entire column. This is so common + that Org treats these formulas in a special way, see *note Column + formulas::. + +‘@3=’ + Row formula, applies to all fields in the specified row. ‘@>=’ + means the last row. + +‘@1$2..@4$3=’ + Range formula, applies to all fields in the given rectangular + range. This can also be used to assign a formula to some but not + all fields in a row. + +‘$NAME=’ + Named field, see *note Advanced features::. + + +File: org, Node: Column formulas, Next: Lookup functions, Prev: Field and range formulas, Up: The Spreadsheet + +3.5.6 Column formulas +--------------------- + +When you assign a formula to a simple column reference like ‘$3=’, the +same formula is used in all fields of that column, with the following +very convenient exceptions: (i) If the table contains horizontal +separator hlines with rows above and below, everything before the first +such hline is considered part of the table _header_ and is not modified +by column formulas. Therefore a header is mandatory when you use column +formulas and want to add hlines to group rows, like for example to +separate a total row at the bottom from the summand rows above. (ii) +Fields that already get a value from a field/range formula are left +alone by column formulas. These conditions make column formulas very +easy to use. + + To assign a formula to a column, type it directly into any field in +the column, preceded by an equal sign, like ‘=$1+$2’. When you press +‘’ or ‘’ or ‘C-c C-c’ with point still in the field, the +formula is stored as the formula for the current column, evaluated and +the current field replaced with the result. If the field contains only +‘=’, the previously stored formula for this column is used. For each +column, Org only remembers the most recently used formula. In the +‘TBLFM’ keyword, column formulas look like ‘$4=$1+$2’. The left-hand +side of a column formula can not be the name of column, it must be the +numeric column reference or ‘$>’. + + Instead of typing an equation into the field, you may also use the +following command: + +‘C-c =’ (‘org-table-eval-formula’) + Install a new formula for the current column and replace current + field with the result of the formula. The command prompts for a + formula, with default taken from the ‘TBLFM’ keyword, applies it to + the current field and stores it. With a numeric prefix argument, + e.g., ‘C-5 C-c =’, the command applies it to that many consecutive + fields in the current column. + + +File: org, Node: Lookup functions, Next: Editing and debugging formulas, Prev: Column formulas, Up: The Spreadsheet + +3.5.7 Lookup functions +---------------------- + +Org has three predefined Emacs Lisp functions for lookups in tables. + +‘(org-lookup-first VAL S-LIST R-LIST &optional PREDICATE)’ + Searches for the first element S in list S-LIST for which + (PREDICATE VAL S) + is non-‘nil’; returns the value from the corresponding position in + list R-LIST. The default PREDICATE is ‘equal’. Note that the + parameters VAL and S are passed to PREDICATE in the same order as + the corresponding parameters are in the call to ‘org-lookup-first’, + where VAL precedes S-LIST. If R-LIST is ‘nil’, the matching + element S of S-LIST is returned. + +‘(org-lookup-last VAL S-LIST R-LIST &optional PREDICATE)’ + Similar to ‘org-lookup-first’ above, but searches for the _last_ + element for which PREDICATE is non-‘nil’. + +‘(org-lookup-all VAL S-LIST R-LIST &optional PREDICATE)’ + Similar to ‘org-lookup-first’, but searches for _all_ elements for + which PREDICATE is non-‘nil’, and returns _all_ corresponding + values. This function can not be used by itself in a formula, + because it returns a list of values. However, powerful lookups can + be built when this function is combined with other Emacs Lisp + functions. + + If the ranges used in these functions contain empty fields, the ‘E’ +mode for the formula should usually be specified: otherwise empty fields +are not included in S-LIST and/or R-LIST which can, for example, result +in an incorrect mapping from an element of S-LIST to the corresponding +element of R-LIST. + + These three functions can be used to implement associative arrays, +count matching cells, rank results, group data, etc. For practical +examples see this tutorial on Worg +(https://orgmode.org/worg/org-tutorials/org-lookups.html). + + +File: org, Node: Editing and debugging formulas, Next: Updating the table, Prev: Lookup functions, Up: The Spreadsheet + +3.5.8 Editing and debugging formulas +------------------------------------ + +You can edit individual formulas in the minibuffer or directly in the +field. Org can also prepare a special buffer with all active formulas +of a table. When offering a formula for editing, Org converts +references to the standard format (like ‘B3’ or ‘D&’) if possible. If +you prefer to only work with the internal format (like ‘@3$2’ or ‘$4’), +configure the variable ‘org-table-use-standard-references’. + +‘C-c =’ or ‘C-u C-c =’ (‘org-table-eval-formula’) + Edit the formula associated with the current column/field in the + minibuffer. See *note Column formulas::, and *note Field and range + formulas::. + +‘C-u C-u C-c =’ (‘org-table-eval-formula’) + Re-insert the active formula (either a field formula, or a column + formula) into the current field, so that you can edit it directly + in the field. The advantage over editing in the minibuffer is that + you can use the command ‘C-c ?’. + +‘C-c ?’ (‘org-table-field-info’) + While editing a formula in a table field, highlight the field(s) + referenced by the reference at point position in the formula. + +‘C-c }’ (‘org-table-toggle-coordinate-overlays’) + Toggle the display of row and column numbers for a table, using + overlays. These are updated each time the table is aligned; you + can force it with ‘C-c C-c’. + +‘C-c {’ (‘org-table-toggle-formula-debugger’) + Toggle the formula debugger on and off. See below. + +‘C-c '’ (‘org-table-edit-formulas’) + Edit all formulas for the current table in a special buffer, where + the formulas are displayed one per line. If the current field has + an active formula, point in the formula editor marks it. While + inside the special buffer, Org automatically highlights any field + or range reference at point position. You may edit, remove and add + formulas, and use the following commands: + + ‘C-c C-c’ or ‘C-x C-s’ (‘org-table-fedit-finish’) + Exit the formula editor and store the modified formulas. With + ‘C-u’ prefix, also apply the new formulas to the entire table. + + ‘C-c C-q’ (‘org-table-fedit-abort’) + Exit the formula editor without installing changes. + + ‘C-c C-r’ (‘org-table-fedit-toggle-ref-type’) + Toggle all references in the formula editor between standard + (like ‘B3’) and internal (like ‘@3$2’). + + ‘’ (‘org-table-fedit-lisp-indent’) + Pretty-print or indent Lisp formula at point. When in a line + containing a Lisp formula, format the formula according to + Emacs Lisp rules. Another ‘’ collapses the formula back + again. In the open formula, ‘’ re-indents just like in + Emacs Lisp mode. + + ‘M-’ (‘lisp-complete-symbol’) + Complete Lisp symbols, just like in Emacs Lisp mode. + + ‘S-’, ‘S-’, ‘S-’, ‘S-’ + Shift the reference at point. For example, if the reference + is ‘B3’ and you press ‘S-’, it becomes ‘C3’. This also + works for relative references and for hline references. + + ‘M-S-’ (‘org-table-fedit-line-up’) + Move the test line for column formulas up in the Org buffer. + + ‘M-S-’ (‘org-table-fedit-line-down’) + Move the test line for column formulas down in the Org buffer. + + ‘M-’ (‘org-table-fedit-scroll-up’) + Scroll up the window displaying the table. + + ‘M-’ (‘org-table-fedit-scroll-down’) + Scroll down the window displaying the table. + + ‘C-c }’ + Turn the coordinate grid in the table on and off. + + Making a table field blank does not remove the formula associated +with the field, because that is stored in a different line—the ‘TBLFM’ +keyword line. During the next recalculation, the field will be filled +again. To remove a formula from a field, you have to give an empty +reply when prompted for the formula, or to edit the ‘TBLFM’ keyword. + + You may edit the ‘TBLFM’ keyword directly and re-apply the changed +equations with ‘C-c C-c’ in that line or with the normal recalculation +commands in the table. + +Using multiple ‘TBLFM’ lines +............................ + +You may apply the formula temporarily. This is useful when you want to +switch the formula applied to the table. Place multiple ‘TBLFM’ +keywords right after the table, and then press ‘C-c C-c’ on the formula +to apply. Here is an example: + + | x | y | + |---+---| + | 1 | | + | 2 | | + #+TBLFM: $2=$1*1 + #+TBLFM: $2=$1*2 + +Pressing ‘C-c C-c’ in the line of ‘#+TBLFM: $2=$1*2’ yields: + + | x | y | + |---+---| + | 1 | 2 | + | 2 | 4 | + #+TBLFM: $2=$1*1 + #+TBLFM: $2=$1*2 + +If you recalculate this table, with ‘C-u C-c *’, for example, you get +the following result from applying only the first ‘TBLFM’ keyword. + + | x | y | + |---+---| + | 1 | 1 | + | 2 | 2 | + #+TBLFM: $2=$1*1 + #+TBLFM: $2=$1*2 + +Debugging formulas +.................. + +When the evaluation of a formula leads to an error, the field content +becomes the string ‘#ERROR’. If you would like to see what is going on +during variable substitution and calculation in order to find a bug, +turn on formula debugging in the Tbl menu and repeat the calculation, +for example by pressing ‘C-u C-u C-c = ’ in a field. Detailed +information are displayed. + + +File: org, Node: Updating the table, Next: Advanced features, Prev: Editing and debugging formulas, Up: The Spreadsheet + +3.5.9 Updating the table +------------------------ + +Recalculation of a table is normally not automatic, but needs to be +triggered by a command. To make recalculation at least semi-automatic, +see *note Advanced features::. + + In order to recalculate a line of a table or the entire table, use +the following commands: + +‘C-c *’ (‘org-table-recalculate’) + Recalculate the current row by first applying the stored column + formulas from left to right, and all field/range formulas in the + current row. + +‘C-u C-c *’ or ‘C-u C-c C-c’ + Recompute the entire table, line by line. Any lines before the + first hline are left alone, assuming that these are part of the + table header. + +‘C-u C-u C-c *’ or ‘C-u C-u C-c C-c’ (‘org-table-iterate’) + Iterate the table by recomputing it until no further changes occur. + This may be necessary if some computed fields use the value of + other fields that are computed _later_ in the calculation sequence. + +‘M-x org-table-recalculate-buffer-tables’ + Recompute all tables in the current buffer. + +‘M-x org-table-iterate-buffer-tables’ + Iterate all tables in the current buffer, in order to converge + table-to-table dependencies. + + +File: org, Node: Advanced features, Prev: Updating the table, Up: The Spreadsheet + +3.5.10 Advanced features +------------------------ + +If you want the recalculation of fields to happen automatically, or if +you want to be able to assign _names_(1) to fields and columns, you need +to reserve the first column of the table for special marking characters. + +‘C-#’ (‘org-table-rotate-recalc-marks’) + Rotate the calculation mark in first column through the states ‘#’, + ‘*’, ‘!’, ‘$’. When there is an active region, change all marks in + the region. + + Here is an example of a table that collects exam results of students +and makes use of these features: + + |---+---------+--------+--------+--------+-------+------| + | | Student | Prob 1 | Prob 2 | Prob 3 | Total | Note | + |---+---------+--------+--------+--------+-------+------| + | ! | | P1 | P2 | P3 | Tot | | + | # | Maximum | 10 | 15 | 25 | 50 | 10.0 | + | ^ | | m1 | m2 | m3 | mt | | + |---+---------+--------+--------+--------+-------+------| + | # | Peter | 10 | 8 | 23 | 41 | 8.2 | + | # | Sam | 2 | 4 | 3 | 9 | 1.8 | + |---+---------+--------+--------+--------+-------+------| + | | Average | | | | 25.0 | | + | ^ | | | | | at | | + | $ | max=50 | | | | | | + |---+---------+--------+--------+--------+-------+------| + #+TBLFM: $6=vsum($P1..$P3)::$7=10*$Tot/$max;%.1f::$at=vmean(@-II..@-I);%.1f + + Important: Please note that for these special tables, recalculating + the table with ‘C-u C-c *’ only affects rows that are marked ‘#’ or + ‘*’, and fields that have a formula assigned to the field itself. + The column formulas are not applied in rows with empty first field. + + The marking characters have the following meaning: + +‘!’ + The fields in this line define names for the columns, so that you + may refer to a column as ‘$Tot’ instead of ‘$6’. + +‘^’ + This row defines names for the fields _above_ the row. With such a + definition, any formula in the table may use ‘$m1’ to refer to the + value ‘10’. Also, if you assign a formula to a names field, it is + stored as ‘$name = ...’. + +‘_’ + Similar to ‘^’, but defines names for the fields in the row + _below_. + +‘$’ + Fields in this row can define _parameters_ for formulas. For + example, if a field in a ‘$’ row contains ‘max=50’, then formulas + in this table can refer to the value 50 using ‘$max’. Parameters + work exactly like constants, only that they can be defined on a + per-table basis. + +‘#’ + Fields in this row are automatically recalculated when pressing + ‘’ or ‘’ or ‘S-’ in this row. Also, this row is + selected for a global recalculation with ‘C-u C-c *’. Unmarked + lines are left alone by this command. + +‘*’ + Selects this line for global recalculation with ‘C-u C-c *’, but + not for automatic recalculation. Use this when automatic + recalculation slows down editing too much. + +‘/’ + Do not export this line. Useful for lines that contain the + narrowing ‘’ markers or column group markers. + + Finally, just to whet your appetite for what can be done with the +fantastic Calc package, here is a table that computes the Taylor series +of degree n at location x for a couple of functions. + + |---+-------------+---+-----+--------------------------------------| + | | Func | n | x | Result | + |---+-------------+---+-----+--------------------------------------| + | # | exp(x) | 1 | x | 1 + x | + | # | exp(x) | 2 | x | 1 + x + x^2 / 2 | + | # | exp(x) | 3 | x | 1 + x + x^2 / 2 + x^3 / 6 | + | # | x^2+sqrt(x) | 2 | x=0 | x*(0.5 / 0) + x^2 (2 - 0.25 / 0) / 2 | + | # | x^2+sqrt(x) | 2 | x=1 | 2 + 2.5 x - 2.5 + 0.875 (x - 1)^2 | + | * | tan(x) | 3 | x | 0.0175 x + 1.77e-6 x^3 | + |---+-------------+---+-----+--------------------------------------| + #+TBLFM: $5=taylor($2,$4,$3);n3 + + ---------- Footnotes ---------- + + (1) Such names must start with an alphabetic character and use only +alphanumeric/underscore characters. + + +File: org, Node: Org Plot, Prev: The Spreadsheet, Up: Tables + +3.6 Org Plot +============ + +Org Plot can produce graphs of information stored in Org tables, either +graphically or in ASCII art. + +Graphical plots using Gnuplot +----------------------------- + +Org Plot can produce 2D and 3D graphs of information stored in Org +tables using Gnuplot (http://www.gnuplot.info/) and Gnuplot mode +(http://cars9.uchicago.edu/~ravel/software/gnuplot-mode.html). To see +this in action, ensure that you have both Gnuplot and Gnuplot mode +installed on your system, then call ‘C-c " g’ or ‘M-x org-plot/gnuplot’ +on the following table. + + #+PLOT: title:"Citas" ind:1 deps:(3) type:2d with:histograms set:"yrange [0:]" + | Sede | Max cites | H-index | + |-----------+-----------+---------| + | Chile | 257.72 | 21.39 | + | Leeds | 165.77 | 19.68 | + | Sao Paolo | 71.00 | 11.50 | + | Stockholm | 134.19 | 14.33 | + | Morelia | 257.56 | 17.67 | + + Notice that Org Plot is smart enough to apply the table’s headers as +labels. Further control over the labels, type, content, and appearance +of plots can be exercised through the ‘PLOT’ keyword preceding a table. +See below for a complete list of Org Plot options. For more information +and examples see the Org Plot tutorial +(https://orgmode.org/worg/org-tutorials/org-plot.html). + +Plot options +............ + +‘set’ + Specify any Gnuplot option to be set when graphing. + +‘title’ + Specify the title of the plot. + +‘ind’ + Specify which column of the table to use as the ‘x’ axis. + +‘deps’ + Specify the columns to graph as a Lisp style list, surrounded by + parentheses and separated by spaces for example ‘dep:(3 4)’ to + graph the third and fourth columns. Defaults to graphing all other + columns aside from the ‘ind’ column. + +‘type’ + Specify whether the plot is ‘2d’, ‘3d’, or ‘grid’. + +‘with’ + Specify a ‘with’ option to be inserted for every column being + plotted, e.g., ‘lines’, ‘points’, ‘boxes’, ‘impulses’. Defaults to + ‘lines’. + +‘file’ + If you want to plot to a file, specify + ‘"path/to/desired/output-file"’. + +‘labels’ + List of labels to be used for the ‘deps’. Defaults to the column + headers if they exist. + +‘line’ + Specify an entire line to be inserted in the Gnuplot script. + +‘map’ + When plotting ‘3d’ or ‘grid’ types, set this to ‘t’ to graph a flat + mapping rather than a ‘3d’ slope. + +‘timefmt’ + Specify format of Org mode timestamps as they will be parsed by + Gnuplot. Defaults to ‘%Y-%m-%d-%H:%M:%S’. + +‘script’ + If you want total control, you can specify a script file—place the + file name between double-quotes—which will be used to plot. Before + plotting, every instance of ‘$datafile’ in the specified script + will be replaced with the path to the generated data file. Note: + even if you set this option, you may still want to specify the plot + type, as that can impact the content of the data file. + +ASCII bar plots +--------------- + +While point is on a column, typing ‘C-c `` a’ or ‘M-x orgtbl-ascii-plot’ +create a new column containing an ASCII-art bars plot. The plot is +implemented through a regular column formula. When the source column +changes, the bar plot may be updated by refreshing the table, for +example typing ‘C-u C-c *’. + + | Sede | Max cites | | + |---------------+-----------+--------------| + | Chile | 257.72 | WWWWWWWWWWWW | + | Leeds | 165.77 | WWWWWWWh | + | Sao Paolo | 71.00 | WWW; | + | Stockholm | 134.19 | WWWWWW: | + | Morelia | 257.56 | WWWWWWWWWWWH | + | Rochefourchat | 0.00 | | + #+TBLFM: $3='(orgtbl-ascii-draw $2 0.0 257.72 12) + + The formula is an Elisp call. + + -- Function: orgtbl-ascii-draw value min max &optional width + Draw an ASCII bar in a table. + + VALUE is the value to plot. + + MIN is the value displayed as an empty bar. MAX is the value + filling all the WIDTH. Sources values outside this range are + displayed as ‘too small’ or ‘too large’. + + WIDTH is the number of characters of the bar plot. It defaults to + ‘12’. + + +File: org, Node: Hyperlinks, Next: TODO Items, Prev: Tables, Up: Top + +4 Hyperlinks +************ + +Like HTML, Org provides support for links inside a file, external links +to other files, Usenet articles, emails, and much more. + +* Menu: + +* Link Format:: How links in Org are formatted. +* Internal Links:: Links to other places in the current file. +* Radio Targets:: Make targets trigger links in plain text. +* External Links:: URL-like links to the world. +* Handling Links:: Creating, inserting and following. +* Using Links Outside Org:: Linking from my C source code? +* Link Abbreviations:: Shortcuts for writing complex links. +* Search Options:: Linking to a specific location. +* Custom Searches:: When the default search is not enough. + + +File: org, Node: Link Format, Next: Internal Links, Up: Hyperlinks + +4.1 Link Format +=============== + +Org recognizes plain URIs, possibly wrapped within angle brackets(1), +and activate them as clickable links. + + The general link format, however, looks like this: + + [[LINK][DESCRIPTION]] + +or alternatively + + [[LINK]] + + The LINK part cannot contain ‘[’ and ‘]’ characters. You can replace +them with their percent-encoded counterparts, which are, respectively, +‘%5B’ and ‘%5D’. You also need to encode ‘%’ characters as ‘%25’. +Optionally, it may also come handy to encode consecutive spaces as +‘%20’. + + Org takes for granted that such links are correctly escaped. +Luckily, functions inserting links (see *note Handling Links::) take +care of this. You really need to bother about it only when inserting +manually a URI within square brackets. + + Once a link in the buffer is complete, with all brackets present, Org +changes the display so that ‘DESCRIPTION’ is displayed instead of +‘[[LINK][DESCRIPTION]]’ and ‘LINK’ is displayed instead of ‘[[LINK]]’. +Links are highlighted in the ‘org-link’ face, which, by default, is an +underlined face. + + You can directly edit the visible part of a link. This can be either +the LINK part, if there is no description, or the DESCRIPTION part +otherwise. To also edit the invisible LINK part, use ‘C-c C-l’ with +point on the link (see *note Handling Links::). + + If you place point at the beginning or just behind the end of the +displayed text and press ‘’, you remove the—invisible—bracket at +that location(2). This makes the link incomplete and the internals are +again displayed as plain text. Inserting the missing bracket hides the +link internals again. To show the internal structure of all links, use +the menu: Org → Hyperlinks → Literal links. + + ---------- Footnotes ---------- + + (1) Plain URIs are recognized only for a well-defined set of schemes. +See *note External Links::. Unlike URI syntax, they cannot contain +parenthesis or white spaces, either. URIs within angle brackets have no +such limitation. + + (2) More accurately, the precise behavior depends on how point +arrived there—see *note Invisible Text: (elisp)Invisible Text. + + +File: org, Node: Internal Links, Next: Radio Targets, Prev: Link Format, Up: Hyperlinks + +4.2 Internal Links +================== + +If the link does not look like a URL, it is considered to be internal in +the current file. The most important case is a link like +‘[[#my-custom-id]]’ which links to the entry with the ‘CUSTOM_ID’ +property ‘my-custom-id’. You are responsible yourself to make sure +these custom IDs are unique in a file. + + Links such as ‘[[My Target]]’ or ‘[[My Target][Find my target]]’ lead +to a text search in the current file. + + The link can be followed with ‘C-c C-o’ when point is on the link, or +with a mouse click (see *note Handling Links::). Links to custom IDs +point to the corresponding headline. The preferred match for a text +link is a _dedicated target_: the same string in double angular +brackets, like ‘<>’. + + If no dedicated target exists, the link tries to match the exact name +of an element within the buffer. Naming is done with the ‘NAME’ +keyword, which has to be put in the line before the element it refers +to, as in the following example + + #+NAME: My Target + | a | table | + |----+------------| + | of | four cells | + + If none of the above succeeds, Org searches for a headline that is +exactly the link text but may also include a TODO keyword and tags(1). + + During export, internal links are used to mark objects and assign +them a number. Marked objects are then referenced by links pointing to +them. In particular, links without a description appear as the number +assigned to the marked object(2). In the following excerpt from an Org +buffer + + 1. one item + 2. <>another item + Here we refer to item [[target]]. + +The last sentence will appear as ‘Here we refer to item 2’ when +exported. + + In non-Org files, the search looks for the words in the link text. +In the above example the search would be for ‘target’. + + Following a link pushes a mark onto Org’s own mark ring. You can +return to the previous position with ‘C-c &’. Using this command +several times in direct succession goes back to positions recorded +earlier. + + ---------- Footnotes ---------- + + (1) To insert a link targeting a headline, in-buffer completion can +be used. Just type a star followed by a few optional letters into the +buffer and press ‘M-’. All headlines in the current buffer are +offered as completions. + + (2) When targeting a ‘NAME’ keyword, the ‘CAPTION’ keyword is +mandatory in order to get proper numbering (see *note Captions::). + + +File: org, Node: Radio Targets, Next: External Links, Prev: Internal Links, Up: Hyperlinks + +4.3 Radio Targets +================= + +Org can automatically turn any occurrences of certain target names in +normal text into a link. So without explicitly creating a link, the +text connects to the target radioing its position. Radio targets are +enclosed by triple angular brackets. For example, a target ‘<<>>’ causes each occurrence of ‘my target’ in normal text to +become activated as a link. The Org file is scanned automatically for +radio targets only when the file is first loaded into Emacs. To update +the target list during editing, press ‘C-c C-c’ with point on or at a +target. + + +File: org, Node: External Links, Next: Handling Links, Prev: Radio Targets, Up: Hyperlinks + +4.4 External Links +================== + +Org supports links to files, websites, Usenet and email messages, BBDB +database entries and links to both IRC conversations and their logs. +External links are URL-like locators. They start with a short +identifying string followed by a colon. There can be no space after the +colon. The following list shows examples for each link type. + +‘https://staff.science.uva.nl/c.dominik/’ on the web +‘doi:10.1000/182’ DOI for an electronic resource +‘file:/home/dominik/images/jupiter.jpg’ file, absolute path +‘/home/dominik/images/jupiter.jpg’ same as above +‘file:papers/last.pdf’ file, relative path +‘./papers/last.pdf’ same as above +‘file:/ssh:me@some.where:papers/last.pdf’ file, path on remote machine +‘/ssh:me@some.where:papers/last.pdf’ same as above +‘file:sometextfile::NNN’ file, jump to line number +‘file:projects.org’ another Org file +‘file:projects.org::some words’ text search in Org file(1) +‘file:projects.org::*task title’ heading search in Org file +‘file+sys:/path/to/file’ open via OS, like double-click +‘file+emacs:/path/to/file’ force opening by Emacs +‘docview:papers/last.pdf::NNN’ open in doc-view mode at page +‘id:B7423F4D-2E8A-471B-8810-C40F074717E9’ link to heading by ID +‘news:comp.emacs’ Usenet link +‘mailto:adent@galaxy.net’ mail link +‘mhe:folder’ MH-E folder link +‘mhe:folder#id’ MH-E message link +‘rmail:folder’ Rmail folder link +‘rmail:folder#id’ Rmail message link +‘gnus:group’ Gnus group link +‘gnus:group#id’ Gnus article link +‘bbdb:R.*Stallman’ BBDB link (with regexp) +‘irc:/irc.com/#emacs/bob’ IRC link +‘info:org#External links’ Info node link +‘shell:ls *.org’ shell command +‘elisp:org-agenda’ interactive Elisp command +‘elisp:(find-file "Elisp.org")’ Elisp form to evaluate + + On top of these built-in link types, additional ones are available +through the ‘contrib/’ directory (see *note Installation::). For +example, these links to VM or Wanderlust messages are available when you +load the corresponding libraries from the ‘contrib/’ directory: + +‘vm:folder’ VM folder link +‘vm:folder#id’ VM message link +‘vm://myself@some.where.org/folder#id’ VM on remote machine +‘vm-imap:account:folder’ VM IMAP folder link +‘vm-imap:account:folder#id’ VM IMAP message link +‘wl:folder’ Wanderlust folder link +‘wl:folder#id’ Wanderlust message link + + For information on customizing Org to add new link types, see *note +Adding Hyperlink Types::. + + A link should be enclosed in double brackets and may contain +descriptive text to be displayed instead of the URL (see *note Link +Format::), for example: + + [[http://www.gnu.org/software/emacs/][GNU Emacs]] + + If the description is a file name or URL that points to an image, +HTML export (see *note HTML Export::) inlines the image as a clickable +button. If there is no description at all and the link points to an +image, that image is inlined into the exported HTML file. + + Org also finds external links in the normal text and activates them +as links. If spaces must be part of the link (for example in +‘bbdb:Richard Stallman’), or if you need to remove ambiguities about the +end of the link, enclose the link in square or angular brackets. + + ---------- Footnotes ---------- + + (1) The actual behavior of the search depends on the value of the +variable ‘org-link-search-must-match-exact-headline’. If its value is +‘nil’, then a fuzzy text search is done. If it is ‘t’, then only the +exact headline is matched, ignoring spaces and statistic cookies. If +the value is ‘query-to-create’, then an exact headline is searched; if +it is not found, then the user is queried to create it. + + +File: org, Node: Handling Links, Next: Using Links Outside Org, Prev: External Links, Up: Hyperlinks + +4.5 Handling Links +================== + +Org provides methods to create a link in the correct syntax, to insert +it into an Org file, and to follow the link. + + The main function is ‘org-store-link’, called with ‘M-x +org-store-link’. Because of its importance, we suggest to bind it to a +widely available key (see *note Activation::). It stores a link to the +current location. The link is stored for later insertion into an Org +buffer—see below. The kind of link that is created depends on the +current buffer: + +_Org mode buffers_ + For Org files, if there is a ‘<>’ at point, the link points + to the target. Otherwise it points to the current headline, which + is also the description(1). + + If the headline has a ‘CUSTOM_ID’ property, store a link to this + custom ID. In addition or alternatively, depending on the value of + ‘org-id-link-to-org-use-id’, create and/or use a globally unique + ‘ID’ property for the link(2). So using this command in Org + buffers potentially creates two links: a human-readable link from + the custom ID, and one that is globally unique and works even if + the entry is moved from file to file. Later, when inserting the + link, you need to decide which one to use. + +_Email/News clients: VM, Rmail, Wanderlust, MH-E, Gnus_ + Pretty much all Emacs mail clients are supported. The link points + to the current article, or, in some Gnus buffers, to the group. + The description is constructed according to the variable + ‘org-email-link-description-format’. By default, it refers to the + addressee and the subject, possibly truncated. + +_Web browsers: W3, W3M and EWW_ + Here the link is the current URL, with the page title as the + description. + +_Contacts: BBDB_ + Links created in a BBDB buffer point to the current entry. + +_Chat: IRC_ + For IRC links, if the variable ‘org-irc-link-to-logs’ is non-‘nil’, + create a ‘file’ style link to the relevant point in the logs for + the current conversation. Otherwise store an ‘irc’ style link to + the user/channel/server under the point. + +_Other files_ + For any other file, the link points to the file, with a search + string (see *note Search Options::) pointing to the contents of the + current line. If there is an active region, the selected words + form the basis of the search string. You can write custom Lisp + functions to select the search string and perform the search for + particular file types (see *note Custom Searches::). + + You can also define dedicated links to other files. See *note + Adding Hyperlink Types::. + +_Agenda view_ + When point is in an agenda view, the created link points to the + entry referenced by the current line. + + From an Org buffer, the following commands create, navigate or, more +generally, act on links. + +‘C-c C-l’ (‘org-insert-link’) + Insert a link(3). This prompts for a link to be inserted into the + buffer. You can just type a link, using text for an internal link, + or one of the link type prefixes mentioned in the examples above. + The link is inserted into the buffer, along with a descriptive + text(4). If some text was selected at this time, it becomes the + default description. + + _Inserting stored links_ + All links stored during the current session are part of the + history for this prompt, so you can access them with ‘’ + and ‘’ (or ‘M-p’, ‘M-n’). + + _Completion support_ + Completion with ‘’ helps you to insert valid link + prefixes like ‘http’ or ‘ftp’, including the prefixes defined + through link abbreviations (see *note Link Abbreviations::). + If you press ‘’ after inserting only the prefix, Org + offers specific completion support for some link types(5). + For example, if you type ‘f i l e ’—alternative access: + ‘C-u C-c C-l’, see below—Org offers file name completion, and + after ‘b b d b ’ you can complete contact names. + +‘C-u C-c C-l’ + When ‘C-c C-l’ is called with a ‘C-u’ prefix argument, insert a + link to a file. You may use file name completion to select the + name of the file. The path to the file is inserted relative to the + directory of the current Org file, if the linked file is in the + current directory or in a sub-directory of it, or if the path is + written relative to the current directory using ‘../’. Otherwise + an absolute path is used, if possible with ‘~/’ for your home + directory. You can force an absolute path with two ‘C-u’ prefixes. + +‘C-c C-l’ (with point on existing link) + When point is on an existing link, ‘C-c C-l’ allows you to edit the + link and description parts of the link. + +‘C-c C-o’ (‘org-open-at-point’) + Open link at point. This launches a web browser for URL (using + ‘browse-url-at-point’), run VM/MH-E/Wanderlust/Rmail/Gnus/BBDB for + the corresponding links, and execute the command in a shell link. + When point is on an internal link, this command runs the + corresponding search. When point is on the tags part of a + headline, it creates the corresponding tags view (see *note + Matching tags and properties::). If point is on a timestamp, it + compiles the agenda for that date. Furthermore, it visits text and + remote files in ‘file’ links with Emacs and select a suitable + application for local non-text files. Classification of files is + based on file extension only. See option ‘org-file-apps’. If you + want to override the default application and visit the file with + Emacs, use a ‘C-u’ prefix. If you want to avoid opening in Emacs, + use a ‘C-u C-u’ prefix. + + If point is on a headline, but not on a link, offer all links in + the headline and entry text. If you want to setup the frame + configuration for following links, customize + ‘org-link-frame-setup’. + +‘’ + When ‘org-return-follows-link’ is set, ‘’ also follows the + link at point. + +‘mouse-2’ or ‘mouse-1’ + On links, ‘mouse-1’ and ‘mouse-2’ opens the link just as ‘C-c C-o’ + does. + +‘mouse-3’ + Like ‘mouse-2’, but force file links to be opened with Emacs, and + internal links to be displayed in another window(6). + +‘C-c %’ (‘org-mark-ring-push’) + Push the current position onto the Org mark ring, to be able to + return easily. Commands following an internal link do this + automatically. + +‘C-c &’ (‘org-mark-ring-goto’) + Jump back to a recorded position. A position is recorded by the + commands following internal links, and by ‘C-c %’. Using this + command several times in direct succession moves through a ring of + previously recorded positions. + +‘C-c C-x C-n’ (‘org-next-link’) +‘C-c C-x C-p’ (‘org-previous-link’) + Move forward/backward to the next link in the buffer. At the limit + of the buffer, the search fails once, and then wraps around. The + key bindings for this are really too long; you might want to bind + this also to ‘M-n’ and ‘M-p’. + + (add-hook 'org-load-hook + (lambda () + (define-key org-mode-map "\M-n" 'org-next-link) + (define-key org-mode-map "\M-p" 'org-previous-link))) + + ---------- Footnotes ---------- + + (1) If the headline contains a timestamp, it is removed from the +link, which results in a wrong link—you should avoid putting a timestamp +in the headline. + + (2) The Org Id library must first be loaded, either through +‘org-customize’, by enabling ‘id’ in ‘org-modules’, or by adding +‘(require 'org-id)’ in your Emacs init file. + + (3) Note that you do not have to use this command to insert a link. +Links in Org are plain text, and you can type or paste them straight +into the buffer. By using this command, the links are automatically +enclosed in double brackets, and you will be asked for the optional +descriptive text. + + (4) After insertion of a stored link, the link will be removed from +the list of stored links. To keep it in the list for later use, use a +triple ‘C-u’ prefix argument to ‘C-c C-l’, or configure the option +‘org-keep-stored-link-after-insertion’. + + (5) This works if a function has been defined in the ‘:complete’ +property of a link in ‘org-link-parameters’. + + (6) See the variable +‘org-display-internal-link-with-indirect-buffer’. + + +File: org, Node: Using Links Outside Org, Next: Link Abbreviations, Prev: Handling Links, Up: Hyperlinks + +4.6 Using Links Outside Org +=========================== + +You can insert and follow links that have Org syntax not only in Org, +but in any Emacs buffer. For this, Org provides two functions: +‘org-insert-link-global’ and ‘org-open-at-point-global’. + + You might want to bind them to globally available keys. See *note +Activation:: for some advice. + + +File: org, Node: Link Abbreviations, Next: Search Options, Prev: Using Links Outside Org, Up: Hyperlinks + +4.7 Link Abbreviations +====================== + +Long URL can be cumbersome to type, and often many similar links are +needed in a document. For this you can use link abbreviations. An +abbreviated link looks like this + + [[linkword:tag][description]] + +where the tag is optional. The _linkword_ must be a word, starting with +a letter, followed by letters, numbers, ‘-’, and ‘_’. Abbreviations are +resolved according to the information in the variable +‘org-link-abbrev-alist’ that relates the linkwords to replacement text. +Here is an example: + + (setq org-link-abbrev-alist + '(("bugzilla" . "http://10.1.2.9/bugzilla/show_bug.cgi?id=") + ("url-to-ja" . "http://translate.google.fr/translate?sl=en&tl=ja&u=%h") + ("google" . "http://www.google.com/search?q=") + ("gmap" . "http://maps.google.com/maps?q=%s") + ("omap" . "http://nominatim.openstreetmap.org/search?q=%s&polygon=1") + ("ads" . "https://ui.adsabs.harvard.edu/search/q=%20author%3A\"%s\""))) + + If the replacement text contains the string ‘%s’, it is replaced with +the tag. Using ‘%h’ instead of ‘%s’ percent-encodes the tag (see the +example above, where we need to encode the URL parameter). Using +‘%(my-function)’ passes the tag to a custom Lisp function, and replace +it by the resulting string. + + If the replacement text do not contain any specifier, it is simply +appended to the string in order to create the link. + + Instead of a string, you may also specify a Lisp function to create +the link. Such a function will be called with the tag as the only +argument. + + With the above setting, you could link to a specific bug with +‘[[bugzilla:129]]’, search the web for ‘OrgMode’ with +‘[[google:OrgMode]]’, show the map location of the Free Software +Foundation ‘[[gmap:51 Franklin Street, Boston]]’ or of Carsten office +‘[[omap:Science Park 904, Amsterdam, The Netherlands]]’ and find out +what the Org author is doing besides Emacs hacking with +‘[[ads:Dominik,C]]’. + + If you need special abbreviations just for a single Org buffer, you +can define them in the file with + + #+LINK: bugzilla http://10.1.2.9/bugzilla/show_bug.cgi?id= + #+LINK: google http://www.google.com/search?q=%s + + In-buffer completion (see *note Completion::) can be used after ‘[’ +to complete link abbreviations. You may also define a Lisp function +that implements special (e.g., completion) support for inserting such a +link with ‘C-c C-l’. Such a function should not accept any arguments, +and should return the full link with a prefix. You can set the link +completion function like this: + + (org-link-set-parameter "type" :complete #'some-completion-function) + + +File: org, Node: Search Options, Next: Custom Searches, Prev: Link Abbreviations, Up: Hyperlinks + +4.8 Search Options in File Links +================================ + +File links can contain additional information to make Emacs jump to a +particular location in the file when following a link. This can be a +line number or a search option after a double colon(1). For example, +when the command ‘org-store-link’ creates a link (see *note Handling +Links::) to a file, it encodes the words in the current line as a search +string that can be used to find this line back later when following the +link with ‘C-c C-o’. + + Here is the syntax of the different ways to attach a search to a file +link, together with explanations for each: + + [[file:~/code/main.c::255]] + [[file:~/xx.org::My Target]] + [[file:~/xx.org::*My Target]] + [[file:~/xx.org::#my-custom-id]] + [[file:~/xx.org::/regexp/]] + +‘255’ + Jump to line 255. + +‘My Target’ + Search for a link target ‘<>’, or do a text search for + ‘my target’, similar to the search in internal links, see *note + Internal Links::. In HTML export (see *note HTML Export::), such a + file link becomes a HTML reference to the corresponding named + anchor in the linked file. + +‘*My Target’ + In an Org file, restrict search to headlines. + +‘#my-custom-id’ + Link to a heading with a ‘CUSTOM_ID’ property + +‘/REGEXP/’ + Do a regular expression search for REGEXP. This uses the Emacs + command ‘occur’ to list all matches in a separate window. If the + target file is in Org mode, ‘org-occur’ is used to create a sparse + tree with the matches. + + As a degenerate case, a file link with an empty file name can be used +to search the current file. For example, ‘[[file:::find me]]’ does a +search for ‘find me’ in the current file, just as ‘[[find me]]’ would. + + ---------- Footnotes ---------- + + (1) For backward compatibility, line numbers can also follow a single +colon. + + +File: org, Node: Custom Searches, Prev: Search Options, Up: Hyperlinks + +4.9 Custom Searches +=================== + +The default mechanism for creating search strings and for doing the +actual search related to a file link may not work correctly in all +cases. For example, BibTeX database files have many entries like +‘year="1993"’ which would not result in good search strings, because the +only unique identification for a BibTeX entry is the citation key. + + If you come across such a problem, you can write custom functions to +set the right search string for a particular file type, and to do the +search for the string in the file. Using ‘add-hook’, these functions +need to be added to the hook variables +‘org-create-file-search-functions’ and +‘org-execute-file-search-functions’. See the docstring for these +variables for more information. Org actually uses this mechanism for +BibTeX database files, and you can use the corresponding code as an +implementation example. See the file ‘org-bibtex.el’. + + +File: org, Node: TODO Items, Next: Tags, Prev: Hyperlinks, Up: Top + +5 TODO Items +************ + +Org mode does not maintain TODO lists as separate documents(1). +Instead, TODO items are an integral part of the notes file, because TODO +items usually come up while taking notes! With Org mode, simply mark +any entry in a tree as being a TODO item. In this way, information is +not duplicated, and the entire context from which the TODO item emerged +is always present. + + Of course, this technique for managing TODO items scatters them +throughout your notes file. Org mode compensates for this by providing +methods to give you an overview of all the things that you have to do. + +* Menu: + +* TODO Basics:: Marking and displaying TODO entries. +* TODO Extensions:: Workflow and assignments. +* Progress Logging:: Dates and notes for progress. +* Priorities:: Some things are more important than others. +* Breaking Down Tasks:: Splitting a task into manageable pieces. +* Checkboxes:: Tick-off lists. + + ---------- Footnotes ---------- + + (1) Of course, you can make a document that contains only long lists +of TODO items, but this is not required. + + +File: org, Node: TODO Basics, Next: TODO Extensions, Up: TODO Items + +5.1 Basic TODO Functionality +============================ + +Any headline becomes a TODO item when it starts with the word ‘TODO’, +for example: + + *** TODO Write letter to Sam Fortune + + The most important commands to work with TODO entries are: + +‘C-c C-t’ (‘org-todo’) + Rotate the TODO state of the current item among + + ,-> (unmarked) -> TODO -> DONE --. + '--------------------------------' + + If TODO keywords have fast access keys (see *note Fast access to + TODO states::), prompt for a TODO keyword through the fast + selection interface; this is the default behavior when + ‘org-use-fast-todo-selection’ is non-‘nil’. + + The same rotation can also be done “remotely” from the agenda + buffer with the ‘t’ command key (see *note Agenda Commands::). + +‘C-u C-c C-t’ + When TODO keywords have no selection keys, select a specific + keyword using completion; otherwise force cycling through TODO + states with no prompt. When ‘org-use-fast-todo-selection’ is set + to ‘prefix’, use the fast selection interface. + +‘S-’ ‘S-’ + Select the following/preceding TODO state, similar to cycling. + Useful mostly if more than two TODO states are possible (see *note + TODO Extensions::). See also *note Conflicts::, for a discussion + of the interaction with ‘shift-selection-mode’. See also the + variable ‘org-treat-S-cursor-todo-selection-as-state-change’. + +‘C-c / t’ (‘org-show-todo-tree’) + View TODO items in a _sparse tree_ (see *note Sparse Trees::). + Folds the entire buffer, but shows all TODO items—with not-DONE + state—and the headings hierarchy above them. With a prefix + argument, or by using ‘C-c / T’, search for a specific TODO. You + are prompted for the keyword, and you can also give a list of + keywords like ‘KWD1|KWD2|...’ to list entries that match any one of + these keywords. With a numeric prefix argument N, show the tree + for the Nth keyword in the variable ‘org-todo-keywords’. With two + prefix arguments, find all TODO states, both un-done and done. + +‘M-x org-agenda t’ (‘org-todo-list’) + Show the global TODO list. Collects the TODO items (with not-DONE + states) from all agenda files (see *note Agenda Views::) into a + single buffer. The new buffer is in Org Agenda mode, which + provides commands to examine and manipulate the TODO entries from + the new buffer (see *note Agenda Commands::). See *note Global + TODO list::, for more information. + +‘S-M-’ (‘org-insert-todo-heading’) + Insert a new TODO entry below the current one. + + Changing a TODO state can also trigger tag changes. See the +docstring of the option ‘org-todo-state-tags-triggers’ for details. + + +File: org, Node: TODO Extensions, Next: Progress Logging, Prev: TODO Basics, Up: TODO Items + +5.2 Extended Use of TODO Keywords +================================= + +By default, marked TODO entries have one of only two states: TODO and +DONE. Org mode allows you to classify TODO items in more complex ways +with _TODO keywords_ (stored in ‘org-todo-keywords’). With special +setup, the TODO keyword system can work differently in different files. + + Note that _tags_ are another way to classify headlines in general and +TODO items in particular (see *note Tags::). + +* Menu: + +* Workflow states:: From TODO to DONE in steps. +* TODO types:: I do this, Fred does the rest. +* Multiple sets in one file:: Mixing it all, still finding your way. +* Fast access to TODO states:: Single letter selection of state. +* Per-file keywords:: Different files, different requirements. +* Faces for TODO keywords:: Highlighting states. +* TODO dependencies:: When one task needs to wait for others. + + +File: org, Node: Workflow states, Next: TODO types, Up: TODO Extensions + +5.2.1 TODO keywords as workflow states +-------------------------------------- + +You can use TODO keywords to indicate different _sequential_ states in +the process of working on an item, for example(1): + + (setq org-todo-keywords + '((sequence "TODO" "FEEDBACK" "VERIFY" "|" "DONE" "DELEGATED"))) + + The vertical bar separates the TODO keywords (states that _need +action_) from the DONE states (which need _no further action_). If you +do not provide the separator bar, the last state is used as the DONE +state. + + With this setup, the command ‘C-c C-t’ cycles an entry from ‘TODO’ to +‘FEEDBACK’, then to ‘VERIFY’, and finally to ‘DONE’ and ‘DELEGATED’. +You may also use a numeric prefix argument to quickly select a specific +state. For example ‘C-3 C-c C-t’ changes the state immediately to +‘VERIFY’. Or you can use ‘S-’ to go backward through the +sequence. If you define many keywords, you can use in-buffer completion +(see *note Completion::) or even a special one-key selection scheme (see +*note Fast access to TODO states::) to insert these words into the +buffer. Changing a TODO state can be logged with a timestamp, see *note +Tracking TODO state changes::, for more information. + + ---------- Footnotes ---------- + + (1) Changing the variable ‘org-todo-keywords’ only becomes effective +after restarting Org mode in a buffer. + + +File: org, Node: TODO types, Next: Multiple sets in one file, Prev: Workflow states, Up: TODO Extensions + +5.2.2 TODO keywords as types +---------------------------- + +The second possibility is to use TODO keywords to indicate different +_types_ of action items. For example, you might want to indicate that +items are for “work” or “home”. Or, when you work with several people +on a single project, you might want to assign action items directly to +persons, by using their names as TODO keywords. This would be set up +like this: + + (setq org-todo-keywords '((type "Fred" "Sara" "Lucy" "|" "DONE"))) + + In this case, different keywords do not indicate a sequence, but +rather different types. So the normal work flow would be to assign a +task to a person, and later to mark it DONE. Org mode supports this +style by adapting the workings of the command ‘C-c C-t’(1). When used +several times in succession, it still cycles through all names, in order +to first select the right type for a task. But when you return to the +item after some time and execute ‘C-c C-t’ again, it will switch from +any name directly to ‘DONE’. Use prefix arguments or completion to +quickly select a specific name. You can also review the items of a +specific TODO type in a sparse tree by using a numeric prefix to ‘C-c / +t’. For example, to see all things Lucy has to do, you would use ‘C-3 +C-c / t’. To collect Lucy’s items from all agenda files into a single +buffer, you would use the numeric prefix argument as well when creating +the global TODO list: ‘C-3 M-x org-agenda t’. + + ---------- Footnotes ---------- + + (1) This is also true for the ‘t’ command in the agenda buffer. + + +File: org, Node: Multiple sets in one file, Next: Fast access to TODO states, Prev: TODO types, Up: TODO Extensions + +5.2.3 Multiple keyword sets in one file +--------------------------------------- + +Sometimes you may want to use different sets of TODO keywords in +parallel. For example, you may want to have the basic TODO/DONE, but +also a workflow for bug fixing, and a separate state indicating that an +item has been canceled—so it is not DONE, but also does not require +action. Your setup would then look like this: + + (setq org-todo-keywords + '((sequence "TODO" "|" "DONE") + (sequence "REPORT" "BUG" "KNOWNCAUSE" "|" "FIXED") + (sequence "|" "CANCELED"))) + + The keywords should all be different, this helps Org mode keep track +of which subsequence should be used for a given entry. In this setup, +‘C-c C-t’ only operates within a sub-sequence, so it switches from +‘DONE’ to (nothing) to ‘TODO’, and from ‘FIXED’ to (nothing) to +‘REPORT’. Therefore you need a mechanism to initially select the +correct sequence. In addition to typing a keyword or using completion +(see *note Completion::), you may also apply the following commands: + +‘C-u C-u C-c C-t’ +‘C-S-’ +‘C-S-’ + These keys jump from one TODO sub-sequence to the next. In the + above example, ‘C-u C-u C-c C-t’ or ‘C-S-’ would jump from + ‘TODO’ or ‘DONE’ to ‘REPORT’, and any of the words in the second + row to ‘CANCELED’. Note that the ‘C-S-’ key binding conflict with + ‘shift-selection-mode’ (see *note Conflicts::). + +‘S-’ +‘S-’ + ‘S-’ and ‘S-’ walk through _all_ keywords from all + sub-sequences, so for example ‘S-’ would switch from ‘DONE’ + to ‘REPORT’ in the example above. For a discussion of the + interaction with ‘shift-selection-mode’, see *note Conflicts::. + + +File: org, Node: Fast access to TODO states, Next: Per-file keywords, Prev: Multiple sets in one file, Up: TODO Extensions + +5.2.4 Fast access to TODO states +-------------------------------- + +If you would like to quickly change an entry to an arbitrary TODO state +instead of cycling through the states, you can set up keys for +single-letter access to the states. This is done by adding the +selection character after each keyword, in parentheses(1). For example: + + (setq org-todo-keywords + '((sequence "TODO(t)" "|" "DONE(d)") + (sequence "REPORT(r)" "BUG(b)" "KNOWNCAUSE(k)" "|" "FIXED(f)") + (sequence "|" "CANCELED(c)"))) + + If you then press ‘C-c C-t’ followed by the selection key, the entry +is switched to this state. ‘’ can be used to remove any TODO +keyword from an entry(2). + + ---------- Footnotes ---------- + + (1) All characters are allowed except ‘@’, ‘^’ and ‘!’, which have a +special meaning here. + + (2) Check also the variable ‘org-fast-tag-selection-include-todo’, it +allows you to change the TODO state through the tags interface (see +*note Setting Tags::), in case you like to mingle the two concepts. +Note that this means you need to come up with unique keys across both +sets of keywords. + + +File: org, Node: Per-file keywords, Next: Faces for TODO keywords, Prev: Fast access to TODO states, Up: TODO Extensions + +5.2.5 Setting up keywords for individual files +---------------------------------------------- + +It can be very useful to use different aspects of the TODO mechanism in +different files. For file-local settings, you need to add special lines +to the file which set the keywords and interpretation for that file +only. For example, to set one of the two examples discussed above, you +need one of the following lines, starting in column zero anywhere in the +file: + + #+TODO: TODO FEEDBACK VERIFY | DONE CANCELED + + You may also write ‘#+SEQ_TODO’ to be explicit about the +interpretation, but it means the same as ‘#+TODO’, or + + #+TYP_TODO: Fred Sara Lucy Mike | DONE + + A setup for using several sets in parallel would be: + + #+TODO: TODO | DONE + #+TODO: REPORT BUG KNOWNCAUSE | FIXED + #+TODO: | CANCELED + + To make sure you are using the correct keyword, type ‘#+’ into the +buffer and then use ‘M-’ to complete it (see *note Completion::). + + Remember that the keywords after the vertical bar—or the last keyword +if no bar is there—must always mean that the item is DONE, although you +may use a different word. After changing one of these lines, use ‘C-c +C-c’ with point still in the line to make the changes known to Org +mode(1). + + ---------- Footnotes ---------- + + (1) Org mode parses these lines only when Org mode is activated after +visiting a file. ‘C-c C-c’ with point in a line starting with ‘#+’ is +simply restarting Org mode for the current buffer. + + +File: org, Node: Faces for TODO keywords, Next: TODO dependencies, Prev: Per-file keywords, Up: TODO Extensions + +5.2.6 Faces for TODO keywords +----------------------------- + +Org mode highlights TODO keywords with special faces: ‘org-todo’ for +keywords indicating that an item still has to be acted upon, and +‘org-done’ for keywords indicating that an item is finished. If you are +using more than two different states, you might want to use special +faces for some of them. This can be done using the variable +‘org-todo-keyword-faces’. For example: + + (setq org-todo-keyword-faces + '(("TODO" . org-warning) ("STARTED" . "yellow") + ("CANCELED" . (:foreground "blue" :weight bold)))) + + While using a list with face properties as shown for ‘CANCELED’ +_should_ work, this does not always seem to be the case. If necessary, +define a special face and use that. A string is interpreted as a color. +The variable ‘org-faces-easy-properties’ determines if that color is +interpreted as a foreground or a background color. + + +File: org, Node: TODO dependencies, Prev: Faces for TODO keywords, Up: TODO Extensions + +5.2.7 TODO dependencies +----------------------- + +The structure of Org files—hierarchy and lists—makes it easy to define +TODO dependencies. Usually, a parent TODO task should not be marked +DONE until all TODO subtasks, or children tasks, are marked as DONE. +Sometimes there is a logical sequence to (sub)tasks, so that one subtask +cannot be acted upon before all siblings above it have been marked DONE. +If you customize the variable ‘org-enforce-todo-dependencies’, Org +blocks entries from changing state to DONE while they have TODO children +that are not DONE. Furthermore, if an entry has a property ‘ORDERED’, +each of its TODO children is blocked until all earlier siblings are +marked DONE. Here is an example: + + * TODO Blocked until (two) is done + ** DONE one + ** TODO two + + * Parent + :PROPERTIES: + :ORDERED: t + :END: + ** TODO a + ** TODO b, needs to wait for (a) + ** TODO c, needs to wait for (a) and (b) + + You can ensure an entry is never blocked by using the ‘NOBLOCKING’ +property (see *note Properties and Columns::): + + * This entry is never blocked + :PROPERTIES: + :NOBLOCKING: t + :END: + +‘C-c C-x o’ (‘org-toggle-ordered-property’) + Toggle the ‘ORDERED’ property of the current entry. A property is + used for this behavior because this should be local to the current + entry, not inherited from entries above like a tag (see *note + Tags::). However, if you would like to _track_ the value of this + property with a tag for better visibility, customize the variable + ‘org-track-ordered-property-with-tag’. + +‘C-u C-u C-u C-c C-t’ + Change TODO state, regardless of any state blocking. + + If you set the variable ‘org-agenda-dim-blocked-tasks’, TODO entries +that cannot be marked DONE because of unmarked children are shown in a +dimmed font or even made invisible in agenda views (see *note Agenda +Views::). + + You can also block changes of TODO states by using checkboxes (see +*note Checkboxes::). If you set the variable +‘org-enforce-todo-checkbox-dependencies’, an entry that has unchecked +checkboxes is blocked from switching to DONE. + + If you need more complex dependency structures, for example +dependencies between entries in different trees or files, check out the +contributed module ‘org-depend.el’. + + +File: org, Node: Progress Logging, Next: Priorities, Prev: TODO Extensions, Up: TODO Items + +5.3 Progress Logging +==================== + +Org mode can automatically record a timestamp and optionally a note when +you mark a TODO item as DONE, or even each time you change the state of +a TODO item. This system is highly configurable, settings can be on a +per-keyword basis and can be localized to a file or even a subtree. For +information on how to clock working time for a task, see *note Clocking +Work Time::. + +* Menu: + +* Closing items:: When was this entry marked DONE? +* Tracking TODO state changes:: When did the status change? +* Tracking your habits:: How consistent have you been? + + +File: org, Node: Closing items, Next: Tracking TODO state changes, Up: Progress Logging + +5.3.1 Closing items +------------------- + +The most basic logging is to keep track of _when_ a certain TODO item +was marked DONE. This can be achieved with(1) + + (setq org-log-done 'time) + +Then each time you turn an entry from a TODO (not-done) state into any +of the DONE states, a line ‘CLOSED: [timestamp]’ is inserted just after +the headline. If you turn the entry back into a TODO item through +further state cycling, that line is removed again. If you turn the +entry back to a non-TODO state (by pressing ‘C-c C-t ’ for +example), that line is also removed, unless you set +‘org-closed-keep-when-no-todo’ to non-‘nil’. If you want to record a +note along with the timestamp, use(2) + + (setq org-log-done 'note) + +You are then be prompted for a note, and that note is stored below the +entry with a ‘Closing Note’ heading. + + ---------- Footnotes ---------- + + (1) The corresponding in-buffer setting is: ‘#+STARTUP: logdone’. + + (2) The corresponding in-buffer setting is: ‘#+STARTUP: lognotedone’. + + +File: org, Node: Tracking TODO state changes, Next: Tracking your habits, Prev: Closing items, Up: Progress Logging + +5.3.2 Tracking TODO state changes +--------------------------------- + +When TODO keywords are used as workflow states (see *note *Workflow +states: Workflow states.), you might want to keep track of when a state +change occurred and maybe take a note about this change. You can either +record just a timestamp, or a time-stamped note. These records are +inserted after the headline as an itemized list, newest first(1). When +taking a lot of notes, you might want to get the notes out of the way +into a drawer (see *note Drawers::). Customize the variable +‘org-log-into-drawer’ to get this behavior—the recommended drawer for +this is called ‘LOGBOOK’(2). You can also overrule the setting of this +variable for a subtree by setting a ‘LOG_INTO_DRAWER’ property. + + Since it is normally too much to record a note for every state, Org +mode expects configuration on a per-keyword basis for this. This is +achieved by adding special markers ‘!’ (for a timestamp) or ‘@’ (for a +note with timestamp) in parentheses after each keyword. For example, +with the setting + + (setq org-todo-keywords + '((sequence "TODO(t)" "WAIT(w@/!)" "|" "DONE(d!)" "CANCELED(c@)"))) + +to record a timestamp without a note for TODO keywords configured with +‘@’, just type ‘C-c C-c’ to enter a blank note when prompted. + + You not only define global TODO keywords and fast access keys, but +also request that a time is recorded when the entry is set to ‘DONE’, +and that a note is recorded when switching to ‘WAIT’ or ‘CANCELED’(3). +The setting for ‘WAIT’ is even more special: the ‘!’ after the slash +means that in addition to the note taken when entering the state, a +timestamp should be recorded when _leaving_ the ‘WAIT’ state, if and +only if the _target_ state does not configure logging for entering it. +So it has no effect when switching from ‘WAIT’ to ‘DONE’, because ‘DONE’ +is configured to record a timestamp only. But when switching from +‘WAIT’ back to ‘TODO’, the ‘/!’ in the ‘WAIT’ setting now triggers a +timestamp even though ‘TODO’ has no logging configured. + + You can use the exact same syntax for setting logging preferences +local to a buffer: + + #+TODO: TODO(t) WAIT(w@/!) | DONE(d!) CANCELED(c@) + + In order to define logging settings that are local to a subtree or a +single item, define a ‘LOGGING’ property in this entry. Any non-empty +‘LOGGING’ property resets all logging settings to ‘nil’. You may then +turn on logging for this specific tree using ‘STARTUP’ keywords like +‘lognotedone’ or ‘logrepeat’, as well as adding state specific settings +like ‘TODO(!)’. For example: + + * TODO Log each state with only a time + :PROPERTIES: + :LOGGING: TODO(!) WAIT(!) DONE(!) CANCELED(!) + :END: + * TODO Only log when switching to WAIT, and when repeating + :PROPERTIES: + :LOGGING: WAIT(@) logrepeat + :END: + * TODO No logging at all + :PROPERTIES: + :LOGGING: nil + :END: + + ---------- Footnotes ---------- + + (1) See the variable ‘org-log-states-order-reversed’. + + (2) Note that the ‘LOGBOOK’ drawer is unfolded when pressing ‘’ +in the agenda to show an entry—use ‘C-u ’ to keep it folded here. + + (3) It is possible that Org mode records two timestamps when you are +using both ‘org-log-done’ and state change logging. However, it never +prompts for two notes: if you have configured both, the state change +recording note takes precedence and cancel the closing note. + + +File: org, Node: Tracking your habits, Prev: Tracking TODO state changes, Up: Progress Logging + +5.3.3 Tracking your habits +-------------------------- + +Org has the ability to track the consistency of a special category of +TODO, called “habits.” To use habits, you have to enable the ‘habits’ +module by customizing the variable ‘org-modules’. + + A habit has the following properties: + + 1. The habit is a TODO item, with a TODO keyword representing an open + state. + + 2. The property ‘STYLE’ is set to the value ‘habit’ (see *note + Properties and Columns::). + + 3. The TODO has a scheduled date, usually with a ‘.+’ style repeat + interval. A ‘++’ style may be appropriate for habits with time + constraints, e.g., must be done on weekends, or a ‘+’ style for an + unusual habit that can have a backlog, e.g., weekly reports. + + 4. The TODO may also have minimum and maximum ranges specified by + using the syntax ‘.+2d/3d’, which says that you want to do the task + at least every three days, but at most every two days. + + 5. State logging for the DONE state is enabled (see *note Tracking + TODO state changes::), in order for historical data to be + represented in the consistency graph. If it is not enabled it is + not an error, but the consistency graphs are largely meaningless. + + To give you an idea of what the above rules look like in action, +here’s an actual habit with some history: + + ** TODO Shave + SCHEDULED: <2009-10-17 Sat .+2d/4d> + :PROPERTIES: + :STYLE: habit + :LAST_REPEAT: [2009-10-19 Mon 00:36] + :END: + - State "DONE" from "TODO" [2009-10-15 Thu] + - State "DONE" from "TODO" [2009-10-12 Mon] + - State "DONE" from "TODO" [2009-10-10 Sat] + - State "DONE" from "TODO" [2009-10-04 Sun] + - State "DONE" from "TODO" [2009-10-02 Fri] + - State "DONE" from "TODO" [2009-09-29 Tue] + - State "DONE" from "TODO" [2009-09-25 Fri] + - State "DONE" from "TODO" [2009-09-19 Sat] + - State "DONE" from "TODO" [2009-09-16 Wed] + - State "DONE" from "TODO" [2009-09-12 Sat] + + What this habit says is: I want to shave at most every 2 days—given +by the ‘SCHEDULED’ date and repeat interval—and at least every 4 days. +If today is the 15th, then the habit first appears in the agenda (see +*note Agenda Views::) on Oct 17, after the minimum of 2 days has +elapsed, and will appear overdue on Oct 19, after four days have +elapsed. + + What’s really useful about habits is that they are displayed along +with a consistency graph, to show how consistent you’ve been at getting +that task done in the past. This graph shows every day that the task +was done over the past three weeks, with colors for each day. The +colors used are: + +Blue + If the task was not to be done yet on that day. +Green + If the task could have been done on that day. +Yellow + If the task was going to be overdue the next day. +Red + If the task was overdue on that day. + + In addition to coloring each day, the day is also marked with an +asterisk if the task was actually done that day, and an exclamation mark +to show where the current day falls in the graph. + + There are several configuration variables that can be used to change +the way habits are displayed in the agenda. + +‘org-habit-graph-column’ + The buffer column at which the consistency graph should be drawn. + This overwrites any text in that column, so it is a good idea to + keep your habits’ titles brief and to the point. + +‘org-habit-preceding-days’ + The amount of history, in days before today, to appear in + consistency graphs. + +‘org-habit-following-days’ + The number of days after today that appear in consistency graphs. + +‘org-habit-show-habits-only-for-today’ + If non-‘nil’, only show habits in today’s agenda view. The default + value is ‘t’. + + Lastly, pressing ‘K’ in the agenda buffer causes habits to +temporarily be disabled and do not appear at all. Press ‘K’ again to +bring them back. They are also subject to tag filtering, if you have +habits which should only be done in certain contexts, for example. + + +File: org, Node: Priorities, Next: Breaking Down Tasks, Prev: Progress Logging, Up: TODO Items + +5.4 Priorities +============== + +If you use Org mode extensively, you may end up with enough TODO items +that it starts to make sense to prioritize them. Prioritizing can be +done by placing a _priority cookie_ into the headline of a TODO item, +like this + + *** TODO [#A] Write letter to Sam Fortune + + By default, Org mode supports three priorities: ‘A’, ‘B’, and ‘C’. +‘A’ is the highest priority. An entry without a cookie is treated as +equivalent if it had priority ‘B’. Priorities make a difference only +for sorting in the agenda (see *note Weekly/daily agenda::); outside the +agenda, they have no inherent meaning to Org mode. The cookies are +displayed with the face defined by the variable ‘org-priority-faces’, +which can be customized. + + Priorities can be attached to any outline node; they do not need to +be TODO items. + +‘C-c ,’ (‘org-priority’) + Set the priority of the current headline. The command prompts for + a priority character ‘A’, ‘B’ or ‘C’. When you press ‘’ + instead, the priority cookie, if one is set, is removed from the + headline. The priorities can also be changed “remotely” from the + agenda buffer with the ‘,’ command (see *note Agenda Commands::). + +‘S-’ (‘org-priority-up’) +‘S-’ (‘org-priority-down’) + Increase/decrease the priority of the current headline(1). Note + that these keys are also used to modify timestamps (see *note + Creating Timestamps::). See also *note Conflicts::, for a + discussion of the interaction with ‘shift-selection-mode’. + + You can change the range of allowed priorities by setting the +variables ‘org-highest-priority’, ‘org-lowest-priority’, and +‘org-default-priority’. For an individual buffer, you may set these +values (highest, lowest, default) like this (please make sure that the +highest priority is earlier in the alphabet than the lowest priority): + + #+PRIORITIES: A C B + + ---------- Footnotes ---------- + + (1) See also the option ‘org-priority-start-cycle-with-default’. + + +File: org, Node: Breaking Down Tasks, Next: Checkboxes, Prev: Priorities, Up: TODO Items + +5.5 Breaking Down Tasks into Subtasks +===================================== + +It is often advisable to break down large tasks into smaller, manageable +subtasks. You can do this by creating an outline tree below a TODO +item, with detailed subtasks on the tree(1). To keep an overview of the +fraction of subtasks that have already been marked DONE, insert either +‘[/]’ or ‘[%]’ anywhere in the headline. These cookies are updated each +time the TODO status of a child changes, or when pressing ‘C-c C-c’ on +the cookie. For example: + + * Organize Party [33%] + ** TODO Call people [1/2] + *** TODO Peter + *** DONE Sarah + ** TODO Buy food + ** DONE Talk to neighbor + + If a heading has both checkboxes and TODO children below it, the +meaning of the statistics cookie become ambiguous. Set the property +‘COOKIE_DATA’ to either ‘checkbox’ or ‘todo’ to resolve this issue. + + If you would like to have the statistics cookie count any TODO +entries in the subtree (not just direct children), configure the +variable ‘org-hierarchical-todo-statistics’. To do this for a single +subtree, include the word ‘recursive’ into the value of the +‘COOKIE_DATA’ property. + + * Parent capturing statistics [2/20] + :PROPERTIES: + :COOKIE_DATA: todo recursive + :END: + + If you would like a TODO entry to automatically change to DONE when +all children are done, you can use the following setup: + + (defun org-summary-todo (n-done n-not-done) + "Switch entry to DONE when all subentries are done, to TODO otherwise." + (let (org-log-done org-log-states) ; turn off logging + (org-todo (if (= n-not-done 0) "DONE" "TODO")))) + + (add-hook 'org-after-todo-statistics-hook 'org-summary-todo) + + Another possibility is the use of checkboxes to identify (a hierarchy +of) a large number of subtasks (see *note Checkboxes::). + + ---------- Footnotes ---------- + + (1) To keep subtasks out of the global TODO list, see the option +‘org-agenda-todo-list-sublevels’. + + +File: org, Node: Checkboxes, Prev: Breaking Down Tasks, Up: TODO Items + +5.6 Checkboxes +============== + +Every item in a plain list(1) (see *note Plain Lists::) can be made into +a checkbox by starting it with the string ‘[ ]’. This feature is +similar to TODO items (see *note TODO Items::), but is more lightweight. +Checkboxes are not included into the global TODO list, so they are often +great to split a task into a number of simple steps. Or you can use +them in a shopping list. To toggle a checkbox, use ‘C-c C-c’, or use +the mouse (thanks to Piotr Zielinski’s ‘org-mouse.el’). + + Here is an example of a checkbox list. + + * TODO Organize party [2/4] + - [-] call people [1/3] + - [ ] Peter + - [X] Sarah + - [ ] Sam + - [X] order food + - [ ] think about what music to play + - [X] talk to the neighbors + + Checkboxes work hierarchically, so if a checkbox item has children +that are checkboxes, toggling one of the children checkboxes makes the +parent checkbox reflect if none, some, or all of the children are +checked. + + The ‘[2/4]’ and ‘[1/3]’ in the first and second line are cookies +indicating how many checkboxes present in this entry have been checked +off, and the total number of checkboxes present. This can give you an +idea on how many checkboxes remain, even without opening a folded entry. +The cookies can be placed into a headline or into (the first line of) a +plain list item. Each cookie covers checkboxes of direct children +structurally below the headline/item on which the cookie appears(2). +You have to insert the cookie yourself by typing either ‘[/]’ or ‘[%]’. +With ‘[/]’ you get an ‘n out of m’ result, as in the examples above. +With ‘[%]’ you get information about the percentage of checkboxes +checked (in the above example, this would be ‘[50%]’ and ‘[33%]’, +respectively). In a headline, a cookie can count either checkboxes +below the heading or TODO states of children, and it displays whatever +was changed last. Set the property ‘COOKIE_DATA’ to either ‘checkbox’ +or ‘todo’ to resolve this issue. + + If the current outline node has an ‘ORDERED’ property, checkboxes +must be checked off in sequence, and an error is thrown if you try to +check off a box while there are unchecked boxes above it. + + The following commands work with checkboxes: + +‘C-c C-c’ (‘org-toggle-checkbox’) + Toggle checkbox status or—with prefix argument—checkbox presence at + point. With a single prefix argument, add an empty checkbox or + remove the current one(3). With a double prefix argument, set it + to ‘[-]’, which is considered to be an intermediate state. + +‘C-c C-x C-b’ (‘org-toggle-checkbox’) + Toggle checkbox status or—with prefix argument—checkbox presence at + point. With double prefix argument, set it to ‘[-]’, which is + considered to be an intermediate state. + + • If there is an active region, toggle the first checkbox in the + region and set all remaining boxes to the same status as the + first. With a prefix argument, add or remove the checkbox for + all items in the region. + + • If point is in a headline, toggle checkboxes in the region + between this headline and the next—so _not_ the entire + subtree. + + • If there is no active region, just toggle the checkbox at + point. + +‘M-S-’ (‘org-insert-todo-heading’) + Insert a new item with a checkbox. This works only if point is + already in a plain list item (see *note Plain Lists::). + +‘C-c C-x o’ (‘org-toggle-ordered-property’) + Toggle the ‘ORDERED’ property of the entry, to toggle if checkboxes + must be checked off in sequence. A property is used for this + behavior because this should be local to the current entry, not + inherited like a tag. However, if you would like to _track_ the + value of this property with a tag for better visibility, customize + ‘org-track-ordered-property-with-tag’. + +‘C-c #’ (‘org-update-statistics-cookies’) + Update the statistics cookie in the current outline entry. When + called with a ‘C-u’ prefix, update the entire file. Checkbox + statistic cookies are updated automatically if you toggle + checkboxes with ‘C-c C-c’ and make new ones with ‘M-S-’. TODO + statistics cookies update when changing TODO states. If you delete + boxes/entries or add/change them by hand, use this command to get + things back into sync. + + ---------- Footnotes ---------- + + (1) With the exception of description lists. But you can allow it by +modifying ‘org-list-automatic-rules’ accordingly. + + (2) Set the variable ‘org-hierarchical-checkbox-statistics’ if you +want such cookies to count all checkboxes below the cookie, not just +those belonging to direct children. + + (3) ‘C-u C-c C-c’ on the _first_ item of a list with no checkbox adds +checkboxes to the rest of the list. + + +File: org, Node: Tags, Next: Properties and Columns, Prev: TODO Items, Up: Top + +6 Tags +****** + +An excellent way to implement labels and contexts for cross-correlating +information is to assign _tags_ to headlines. Org mode has extensive +support for tags. + + Every headline can contain a list of tags; they occur at the end of +the headline. Tags are normal words containing letters, numbers, ‘_’, +and ‘@’. Tags must be preceded and followed by a single colon, e.g., +‘:work:’. Several tags can be specified, as in ‘:work:urgent:’. Tags +by default are in bold face with the same color as the headline. You +may specify special faces for specific tags using the variable +‘org-tag-faces’, in much the same way as you can for TODO keywords (see +*note Faces for TODO keywords::). + +* Menu: + +* Tag Inheritance:: Tags use the tree structure of an outline. +* Setting Tags:: How to assign tags to a headline. +* Tag Hierarchy:: Create a hierarchy of tags. +* Tag Searches:: Searching for combinations of tags. + + +File: org, Node: Tag Inheritance, Next: Setting Tags, Up: Tags + +6.1 Tag Inheritance +=================== + +_Tags_ make use of the hierarchical structure of outline trees. If a +heading has a certain tag, all subheadings inherit the tag as well. For +example, in the list + + * Meeting with the French group :work: + ** Summary by Frank :boss:notes: + *** TODO Prepare slides for him :action: + +the final heading has the tags ‘work’, ‘boss’, ‘notes’, and ‘action’ +even though the final heading is not explicitly marked with those tags. +You can also set tags that all entries in a file should inherit just as +if these tags were defined in a hypothetical level zero that surrounds +the entire file. Use a line like this(1) + + #+FILETAGS: :Peter:Boss:Secret: + + To limit tag inheritance to specific tags, or to turn it off +entirely, use the variables ‘org-use-tag-inheritance’ and +‘org-tags-exclude-from-inheritance’. + + When a headline matches during a tags search while tag inheritance is +turned on, all the sublevels in the same tree—for a simple match +form—match as well(2). The list of matches may then become very long. +If you only want to see the first tags match in a subtree, configure the +variable ‘org-tags-match-list-sublevels’ (not recommended). + + Tag inheritance is relevant when the agenda search tries to match a +tag, either in the ‘tags’ or ‘tags-todo’ agenda types. In other agenda +types, ‘org-use-tag-inheritance’ has no effect. Still, you may want to +have your tags correctly set in the agenda, so that tag filtering works +fine, with inherited tags. Set ‘org-agenda-use-tag-inheritance’ to +control this: the default value includes all agenda types, but setting +this to ‘nil’ can really speed up agenda generation. + + ---------- Footnotes ---------- + + (1) As with all these in-buffer settings, pressing ‘C-c C-c’ +activates any changes in the line. + + (2) This is only true if the search does not involve more complex +tests including properties (see *note Property Searches::). + + +File: org, Node: Setting Tags, Next: Tag Hierarchy, Prev: Tag Inheritance, Up: Tags + +6.2 Setting Tags +================ + +Tags can simply be typed into the buffer at the end of a headline. +After a colon, ‘M-’ offers completion on tags. There is also a +special command for inserting tags: + +‘C-c C-q’ (‘org-set-tags-command’) + Enter new tags for the current headline. Org mode either offers + completion or a special single-key interface for setting tags, see + below. After pressing ‘’, the tags are inserted and aligned + to ‘org-tags-column’. When called with a ‘C-u’ prefix, all tags in + the current buffer are aligned to that column, just to make things + look nice. Tags are automatically realigned after promotion, + demotion, and TODO state changes (see *note TODO Basics::). + +‘C-c C-c’ (‘org-set-tags-command’) + When point is in a headline, this does the same as ‘C-c C-q’. + + Org supports tag insertion based on a _list of tags_. By default +this list is constructed dynamically, containing all tags currently used +in the buffer(1). You may also globally specify a hard list of tags +with the variable ‘org-tag-alist’. Finally you can set the default tags +for a given file using the ‘TAGS’ keyword, like + + #+TAGS: @work @home @tennisclub + #+TAGS: laptop car pc sailboat + + If you have globally defined your preferred set of tags using the +variable ‘org-tag-alist’, but would like to use a dynamic tag list in a +specific file, add an empty ‘TAGS’ keyword to that file: + + #+TAGS: + + If you have a preferred set of tags that you would like to use in +every file, in addition to those defined on a per-file basis by ‘TAGS’ +keyword, then you may specify a list of tags with the variable +‘org-tag-persistent-alist’. You may turn this off on a per-file basis +by adding a ‘STARTUP’ keyword to that file: + + #+STARTUP: noptag + + By default Org mode uses the standard minibuffer completion +facilities for entering tags. However, it also implements another, +quicker, tag selection method called _fast tag selection_. This allows +you to select and deselect tags with just a single key press. For this +to work well you should assign unique letters to most of your commonly +used tags. You can do this globally by configuring the variable +‘org-tag-alist’ in your Emacs init file. For example, you may find the +need to tag many items in different files with ‘@home’. In this case +you can set something like: + + (setq org-tag-alist '(("@work" . ?w) ("@home" . ?h) ("laptop" . ?l))) + + If the tag is only relevant to the file you are working on, then you +can instead set the ‘TAGS’ keyword as: + + #+TAGS: @work(w) @home(h) @tennisclub(t) laptop(l) pc(p) + + The tags interface shows the available tags in a splash window. If +you want to start a new line after a specific tag, insert ‘\n’ into the +tag list + + #+TAGS: @work(w) @home(h) @tennisclub(t) \n laptop(l) pc(p) + +or write them in two lines: + + #+TAGS: @work(w) @home(h) @tennisclub(t) + #+TAGS: laptop(l) pc(p) + + You can also group together tags that are mutually exclusive by using +braces, as in: + + #+TAGS: { @work(w) @home(h) @tennisclub(t) } laptop(l) pc(p) + +you indicate that at most one of ‘@work’, ‘@home’, and ‘@tennisclub’ +should be selected. Multiple such groups are allowed. + + Do not forget to press ‘C-c C-c’ with point in one of these lines to +activate any changes. + + To set these mutually exclusive groups in the variable +‘org-tags-alist’, you must use the dummy tags ‘:startgroup’ and +‘:endgroup’ instead of the braces. Similarly, you can use ‘:newline’ to +indicate a line break. The previous example would be set globally by +the following configuration: + + (setq org-tag-alist '((:startgroup . nil) + ("@work" . ?w) ("@home" . ?h) + ("@tennisclub" . ?t) + (:endgroup . nil) + ("laptop" . ?l) ("pc" . ?p))) + + If at least one tag has a selection key then pressing ‘C-c C-c’ +automatically presents you with a special interface, listing inherited +tags, the tags of the current headline, and a list of all valid tags +with corresponding keys(2). + + Pressing keys assigned to tags adds or removes them from the list of +tags in the current line. Selecting a tag in a group of mutually +exclusive tags turns off any other tag from that group. + + In this interface, you can also use the following special keys: + +‘’ + Enter a tag in the minibuffer, even if the tag is not in the + predefined list. You can complete on all tags present in the + buffer. You can also add several tags: just separate them with a + comma. + +‘’ + Clear all tags for this line. + +‘’ + Accept the modified set. + +‘C-g’ + Abort without installing changes. + +‘q’ + If ‘q’ is not assigned to a tag, it aborts like ‘C-g’. + +‘!’ + Turn off groups of mutually exclusive tags. Use this to (as an + exception) assign several tags from such a group. + +‘C-c’ + Toggle auto-exit after the next change (see below). If you are + using expert mode, the first ‘C-c’ displays the selection window. + + This method lets you assign tags to a headline with very few keys. +With the above setup, you could clear the current tags and set ‘@home’, +‘laptop’ and ‘pc’ tags with just the following keys: ‘C-c C-c h l +p ’. Switching from ‘@home’ to ‘@work’ would be done with ‘C-c C-c +w ’ or alternatively with ‘C-c C-c C-c w’. Adding the +non-predefined tag ‘sarah’ could be done with ‘C-c C-c s a r a h +’. + + If you find that most of the time you need only a single key press to +modify your list of tags, set the variable +‘org-fast-tag-selection-single-key’. Then you no longer have to press +‘’ to exit fast tag selection—it exits after the first change. If +you then occasionally need more keys, press ‘C-c’ to turn off auto-exit +for the current tag selection process (in effect: start selection with +‘C-c C-c C-c’ instead of ‘C-c C-c’). If you set the variable to the +value ‘expert’, the special window is not even shown for single-key tag +selection, it comes up only when you press an extra ‘C-c’. + + ---------- Footnotes ---------- + + (1) To extend this default list to all tags used in all agenda files +(see *note Agenda Views::), customize the variable +‘org-complete-tags-always-offer-all-agenda-tags’. + + (2) Keys are automatically assigned to tags that have no configured +keys. + + +File: org, Node: Tag Hierarchy, Next: Tag Searches, Prev: Setting Tags, Up: Tags + +6.3 Tag Hierarchy +================= + +Tags can be defined in hierarchies. A tag can be defined as a _group +tag_ for a set of other tags. The group tag can be seen as the “broader +term” for its set of tags. Defining multiple group tags and nesting +them creates a tag hierarchy. + + One use-case is to create a taxonomy of terms (tags) that can be used +to classify nodes in a document or set of documents. + + When you search for a group tag, it return matches for all members in +the group and its subgroups. In an agenda view, filtering by a group +tag displays or hide headlines tagged with at least one of the members +of the group or any of its subgroups. This makes tag searches and +filters even more flexible. + + You can set group tags by using brackets and inserting a colon +between the group tag and its related tags—beware that all whitespaces +are mandatory so that Org can parse this line correctly: + + #+TAGS: [ GTD : Control Persp ] + + In this example, ‘GTD’ is the group tag and it is related to two +other tags: ‘Control’, ‘Persp’. Defining ‘Control’ and ‘Persp’ as group +tags creates a hierarchy of tags: + + #+TAGS: [ Control : Context Task ] + #+TAGS: [ Persp : Vision Goal AOF Project ] + + That can conceptually be seen as a hierarchy of tags: + + • ‘GTD’ + • ‘Persp’ + • ‘Vision’ + • ‘Goal’ + • ‘AOF’ + • ‘Project’ + • ‘Control’ + • ‘Context’ + • ‘Task’ + + You can use the ‘:startgrouptag’, ‘:grouptags’ and ‘:endgrouptag’ +keyword directly when setting ‘org-tag-alist’ directly: + + (setq org-tag-alist '((:startgrouptag) + ("GTD") + (:grouptags) + ("Control") + ("Persp") + (:endgrouptag) + (:startgrouptag) + ("Control") + (:grouptags) + ("Context") + ("Task") + (:endgrouptag))) + + The tags in a group can be mutually exclusive if using the same group +syntax as is used for grouping mutually exclusive tags together; using +curly brackets. + + #+TAGS: { Context : @Home @Work @Call } + + When setting ‘org-tag-alist’ you can use ‘:startgroup’ and +‘:endgroup’ instead of ‘:startgrouptag’ and ‘:endgrouptag’ to make the +tags mutually exclusive. + + Furthermore, the members of a group tag can also be regular +expressions, creating the possibility of a more dynamic and rule-based +tag structure. The regular expressions in the group must be specified +within curly brackets. Here is an expanded example: + + #+TAGS: [ Vision : {V@.+} ] + #+TAGS: [ Goal : {G@.+} ] + #+TAGS: [ AOF : {AOF@.+} ] + #+TAGS: [ Project : {P@.+} ] + + Searching for the tag ‘Project’ now lists all tags also including +regular expression matches for ‘P@.+’, and similarly for tag searches on +‘Vision’, ‘Goal’ and ‘AOF’. For example, this would work well for a +project tagged with a common project-identifier, e.g., ‘P@2014_OrgTags’. + + If you want to ignore group tags temporarily, toggle group tags +support with ‘org-toggle-tags-groups’, bound to ‘C-c C-x q’. If you +want to disable tag groups completely, set ‘org-group-tags’ to ‘nil’. + + +File: org, Node: Tag Searches, Prev: Tag Hierarchy, Up: Tags + +6.4 Tag Searches +================ + +Once a system of tags has been set up, it can be used to collect related +information into special lists. + +‘C-c / m’ or ‘C-c \’ (‘org-match-sparse-tree’) + Create a sparse tree with all headlines matching a tags search. + With a ‘C-u’ prefix argument, ignore headlines that are not a TODO + line. + +‘M-x org-agenda m’ (‘org-tags-view’) + Create a global list of tag matches from all agenda files. See + *note Matching tags and properties::. + +‘M-x org-agenda M’ (‘org-tags-view’) + Create a global list of tag matches from all agenda files, but + check only TODO items and force checking subitems (see the option + ‘org-tags-match-list-sublevels’). + + These commands all prompt for a match string which allows basic +Boolean logic like ‘+boss+urgent-project1’, to find entries with tags +‘boss’ and ‘urgent’, but not ‘project1’, or ‘Kathy|Sally’ to find +entries which are tagged, like ‘Kathy’ or ‘Sally’. The full syntax of +the search string is rich and allows also matching against TODO +keywords, entry levels and properties. For a complete description with +many examples, see *note Matching tags and properties::. + + +File: org, Node: Properties and Columns, Next: Dates and Times, Prev: Tags, Up: Top + +7 Properties and Columns +************************ + +A property is a key-value pair associated with an entry. Properties can +be set so they are associated with a single entry, with every entry in a +tree, or with every entry in an Org file. + + There are two main applications for properties in Org mode. First, +properties are like tags, but with a value. Imagine maintaining a file +where you document bugs and plan releases for a piece of software. +Instead of using tags like ‘release_1’, ‘release_2’, you can use a +property, say ‘Release’, that in different subtrees has different +values, such as ‘1.0’ or ‘2.0’. Second, you can use properties to +implement (very basic) database capabilities in an Org buffer. Imagine +keeping track of your music CDs, where properties could be things such +as the album, artist, date of release, number of tracks, and so on. + + Properties can be conveniently edited and viewed in column view (see +*note Column View::). + +* Menu: + +* Property Syntax:: How properties are spelled out. +* Special Properties:: Access to other Org mode features. +* Property Searches:: Matching property values. +* Property Inheritance:: Passing values down a tree. +* Column View:: Tabular viewing and editing. + + +File: org, Node: Property Syntax, Next: Special Properties, Up: Properties and Columns + +7.1 Property Syntax +=================== + +Properties are key–value pairs. When they are associated with a single +entry or with a tree they need to be inserted into a special drawer (see +*note Drawers::) with the name ‘PROPERTIES’, which has to be located +right below a headline, and its planning line (see *note Deadlines and +Scheduling::) when applicable. Each property is specified on a single +line, with the key—surrounded by colons—first, and the value after it. +Keys are case-insensitive. Here is an example: + + * CD collection + ** Classic + *** Goldberg Variations + :PROPERTIES: + :Title: Goldberg Variations + :Composer: J.S. Bach + :Artist: Glenn Gould + :Publisher: Deutsche Grammophon + :NDisks: 1 + :END: + + Depending on the value of ‘org-use-property-inheritance’, a property +set this way is associated either with a single entry, or with the +sub-tree defined by the entry, see *note Property Inheritance::. + + You may define the allowed values for a particular property ‘Xyz’ by +setting a property ‘Xyz_ALL’. This special property is _inherited_, so +if you set it in a level 1 entry, it applies to the entire tree. When +allowed values are defined, setting the corresponding property becomes +easier and is less prone to typing errors. For the example with the CD +collection, we can pre-define publishers and the number of disks in a +box like this: + + * CD collection + :PROPERTIES: + :NDisks_ALL: 1 2 3 4 + :Publisher_ALL: "Deutsche Grammophon" Philips EMI + :END: + + If you want to set properties that can be inherited by any entry in a +file, use a line like: + + #+PROPERTY: NDisks_ALL 1 2 3 4 + + If you want to add to the value of an existing property, append a ‘+’ +to the property name. The following results in the property ‘var’ +having the value ‘foo=1 bar=2’. + + #+PROPERTY: var foo=1 + #+PROPERTY: var+ bar=2 + + It is also possible to add to the values of inherited properties. +The following results in the ‘Genres’ property having the value ‘Classic +Baroque’ under the ‘Goldberg Variations’ subtree. + + * CD collection + ** Classic + :PROPERTIES: + :Genres: Classic + :END: + *** Goldberg Variations + :PROPERTIES: + :Title: Goldberg Variations + :Composer: J.S. Bach + :Artist: Glenn Gould + :Publisher: Deutsche Grammophon + :NDisks: 1 + :Genres+: Baroque + :END: + + Note that a property can only have one entry per drawer. + + Property values set with the global variable ‘org-global-properties’ +can be inherited by all entries in all Org files. + + The following commands help to work with properties: + +‘M-’ (‘pcomplete’) + After an initial colon in a line, complete property keys. All keys + used in the current file are offered as possible completions. + +‘C-c C-x p’ (‘org-set-property’) + Set a property. This prompts for a property name and a value. If + necessary, the property drawer is created as well. + +‘C-u M-x org-insert-drawer’ + Insert a property drawer into the current entry. The drawer is + inserted early in the entry, but after the lines with planning + information like deadlines. + +‘C-c C-c’ (‘org-property-action’) + With point in a property drawer, this executes property commands. + +‘C-c C-c s’ (‘org-set-property’) + Set a property in the current entry. Both the property and the + value can be inserted using completion. + +‘S-’ (‘org-property-next-allowed-values’) +‘S-’ (‘org-property-previous-allowed-value’) + Switch property at point to the next/previous allowed value. + +‘C-c C-c d’ (‘org-delete-property’) + Remove a property from the current entry. + +‘C-c C-c D’ (‘org-delete-property-globally’) + Globally remove a property, from all entries in the current file. + +‘C-c C-c c’ (‘org-compute-property-at-point’) + Compute the property at point, using the operator and scope from + the nearest column format definition. + + +File: org, Node: Special Properties, Next: Property Searches, Prev: Property Syntax, Up: Properties and Columns + +7.2 Special Properties +====================== + +Special properties provide an alternative access method to Org mode +features, like the TODO state or the priority of an entry, discussed in +the previous chapters. This interface exists so that you can include +these states in a column view (see *note Column View::), or to use them +in queries. The following property names are special and should not be +used as keys in the properties drawer: + +‘ALLTAGS’ All tags, including inherited ones. +‘BLOCKED’ ‘t’ if task is currently blocked by children or siblings. +‘CATEGORY’ The category of an entry. +‘CLOCKSUM’ The sum of CLOCK intervals in the subtree. ‘org-clock-sum’ + must be run first to compute the values in the current buffer. +‘CLOCKSUM_T’ The sum of CLOCK intervals in the subtree for today. + ‘org-clock-sum-today’ must be run first to compute the + values in the current buffer. +‘CLOSED’ When was this entry closed? +‘DEADLINE’ The deadline time string, without the angular brackets. +‘FILE’ The filename the entry is located in. +‘ITEM’ The headline of the entry. +‘PRIORITY’ The priority of the entry, a string with a single letter. +‘SCHEDULED’ The scheduling timestamp, without the angular brackets. +‘TAGS’ The tags defined directly in the headline. +‘TIMESTAMP’ The first keyword-less timestamp in the entry. +‘TIMESTAMP_IA’ The first inactive timestamp in the entry. +‘TODO’ The TODO keyword of the entry. + + +File: org, Node: Property Searches, Next: Property Inheritance, Prev: Special Properties, Up: Properties and Columns + +7.3 Property Searches +===================== + +To create sparse trees and special lists with selection based on +properties, the same commands are used as for tag searches (see *note +Tag Searches::). + +‘C-c / m’ or ‘C-c \’ (‘org-match-sparse-tree’) + Create a sparse tree with all matching entries. With a ‘C-u’ + prefix argument, ignore headlines that are not a TODO line. + +‘M-x org-agenda m’, ‘org-tags-view’ + Create a global list of tag/property matches from all agenda files. + +‘M-x org-agenda M’ (‘org-tags-view’) + Create a global list of tag matches from all agenda files, but + check only TODO items and force checking of subitems (see the + option ‘org-tags-match-list-sublevels’). + + The syntax for the search string is described in *note Matching tags +and properties::. + + There is also a special command for creating sparse trees based on a +single property: + +‘C-c / p’ + Create a sparse tree based on the value of a property. This first + prompts for the name of a property, and then for a value. A sparse + tree is created with all entries that define this property with the + given value. If you enclose the value in curly braces, it is + interpreted as a regular expression and matched against the + property values. + + +File: org, Node: Property Inheritance, Next: Column View, Prev: Property Searches, Up: Properties and Columns + +7.4 Property Inheritance +======================== + +The outline structure of Org documents lends itself to an inheritance +model of properties: if the parent in a tree has a certain property, the +children can inherit this property. Org mode does not turn this on by +default, because it can slow down property searches significantly and is +often not needed. However, if you find inheritance useful, you can turn +it on by setting the variable ‘org-use-property-inheritance’. It may be +set to ‘t’ to make all properties inherited from the parent, to a list +of properties that should be inherited, or to a regular expression that +matches inherited properties. If a property has the value ‘nil’, this +is interpreted as an explicit un-define of the property, so that +inheritance search stops at this value and returns ‘nil’. + + Org mode has a few properties for which inheritance is hard-coded, at +least for the special applications for which they are used: + +‘COLUMNS’ + The ‘COLUMNS’ property defines the format of column view (see *note + Column View::). It is inherited in the sense that the level where + a ‘COLUMNS’ property is defined is used as the starting point for a + column view table, independently of the location in the subtree + from where columns view is turned on. + +‘CATEGORY’ + For agenda view, a category set through a ‘CATEGORY’ property + applies to the entire subtree. + +‘ARCHIVE’ + For archiving, the ‘ARCHIVE’ property may define the archive + location for the entire subtree (see *note Moving subtrees::). + +‘LOGGING’ + The ‘LOGGING’ property may define logging settings for an entry or + a subtree (see *note Tracking TODO state changes::). + + +File: org, Node: Column View, Prev: Property Inheritance, Up: Properties and Columns + +7.5 Column View +=============== + +A great way to view and edit properties in an outline tree is _column +view_. In column view, each outline node is turned into a table row. +Columns in this table provide access to properties of the entries. Org +mode implements columns by overlaying a tabular structure over the +headline of each item. While the headlines have been turned into a +table row, you can still change the visibility of the outline tree. For +example, you get a compact table by switching to “contents” +view—‘S-’ ‘S-’, or simply ‘c’ while column view is active—but +you can still open, read, and edit the entry below each headline. Or, +you can switch to column view after executing a sparse tree command and +in this way get a table only for the selected items. Column view also +works in agenda buffers (see *note Agenda Views::) where queries have +collected selected items, possibly from a number of files. + +* Menu: + +* Defining columns:: The COLUMNS format property. +* Using column view:: How to create and use column view. +* Capturing column view:: A dynamic block for column view. + + +File: org, Node: Defining columns, Next: Using column view, Up: Column View + +7.5.1 Defining columns +---------------------- + +Setting up a column view first requires defining the columns. This is +done by defining a column format line. + +* Menu: + +* Scope of column definitions:: Where defined, where valid? +* Column attributes:: Appearance and content of a column. + + +File: org, Node: Scope of column definitions, Next: Column attributes, Up: Defining columns + +7.5.1.1 Scope of column definitions +................................... + +To define a column format for an entire file, use a line like: + + #+COLUMNS: %25ITEM %TAGS %PRIORITY %TODO + + To specify a format that only applies to a specific tree, add a +‘COLUMNS’ property to the top node of that tree, for example: + + ** Top node for columns view + :PROPERTIES: + :COLUMNS: %25ITEM %TAGS %PRIORITY %TODO + :END: + + If a ‘COLUMNS’ property is present in an entry, it defines columns +for the entry itself, and for the entire subtree below it. Since the +column definition is part of the hierarchical structure of the document, +you can define columns on level 1 that are general enough for all +sublevels, and more specific columns further down, when you edit a +deeper part of the tree. + + +File: org, Node: Column attributes, Prev: Scope of column definitions, Up: Defining columns + +7.5.1.2 Column attributes +......................... + +A column definition sets the attributes of a column. The general +definition looks like this: + + %[WIDTH]PROPERTY[(TITLE)][{SUMMARY-TYPE}] + +Except for the percent sign and the property name, all items are +optional. The individual parts have the following meaning: + +WIDTH + An integer specifying the width of the column in characters. If + omitted, the width is determined automatically. + +PROPERTY + The property that should be edited in this column. Special + properties representing meta data are allowed here as well (see + *note Special Properties::). + +TITLE + The header text for the column. If omitted, the property name is + used. + +SUMMARY-TYPE + The summary type. If specified, the column values for parent nodes + are computed from the children(1). + + Supported summary types are: + + ‘+’ Sum numbers in this column. + ‘+;%.1f’ Like ‘+’, but format result with ‘%.1f’. + ‘$’ Currency, short for ‘+;%.2f’. + ‘min’ Smallest number in column. + ‘max’ Largest number. + ‘mean’ Arithmetic mean of numbers. + ‘X’ Checkbox status, ‘[X]’ if all children are ‘[X]’. + ‘X/’ Checkbox status, ‘[n/m]’. + ‘X%’ Checkbox status, ‘[n%]’. + ‘:’ Sum times, HH:MM, plain numbers are hours. + ‘:min’ Smallest time value in column. + ‘:max’ Largest time value. + ‘:mean’ Arithmetic mean of time values. + ‘@min’ Minimum age(2) (in days/hours/mins/seconds). + ‘@max’ Maximum age (in days/hours/mins/seconds). + ‘@mean’ Arithmetic mean of ages (in days/hours/mins/seconds). + ‘est+’ Add low-high estimates. + + You can also define custom summary types by setting + ‘org-columns-summary-types’. + + The ‘est+’ summary type requires further explanation. It is used for +combining estimates, expressed as low-high ranges. For example, instead +of estimating a particular task will take 5 days, you might estimate it +as 5–6 days if you’re fairly confident you know how much work is +required, or 1–10 days if you do not really know what needs to be done. +Both ranges average at 5.5 days, but the first represents a more +predictable delivery. + + When combining a set of such estimates, simply adding the lows and +highs produces an unrealistically wide result. Instead, ‘est+’ adds the +statistical mean and variance of the subtasks, generating a final +estimate from the sum. For example, suppose you had ten tasks, each of +which was estimated at 0.5 to 2 days of work. Straight addition +produces an estimate of 5 to 20 days, representing what to expect if +everything goes either extremely well or extremely poorly. In contrast, +‘est+’ estimates the full job more realistically, at 10–15 days. + + Here is an example for a complete columns definition, along with +allowed values(3). + + :COLUMNS: %25ITEM %9Approved(Approved?){X} %Owner %11Status \ + %10Time_Estimate{:} %CLOCKSUM %CLOCKSUM_T + :Owner_ALL: Tammy Mark Karl Lisa Don + :Status_ALL: "In progress" "Not started yet" "Finished" "" + :Approved_ALL: "[ ]" "[X]" + +The first column, ‘%25ITEM’, means the first 25 characters of the item +itself, i.e., of the headline. You probably always should start the +column definition with the ‘ITEM’ specifier. The other specifiers +create columns ‘Owner’ with a list of names as allowed values, for +‘Status’ with four different possible values, and for a checkbox field +‘Approved’. When no width is given after the ‘%’ character, the column +is exactly as wide as it needs to be in order to fully display all +values. The ‘Approved’ column does have a modified title (‘Approved?’, +with a question mark). Summaries are created for the ‘Time_Estimate’ +column by adding time duration expressions like HH:MM, and for the +‘Approved’ column, by providing an ‘[X]’ status if all children have +been checked. The ‘CLOCKSUM’ and ‘CLOCKSUM_T’ columns are special, they +lists the sums of CLOCK intervals in the subtree, either for all clocks +or just for today. + + ---------- Footnotes ---------- + + (1) If more than one summary type applies to the same property, the +parent values are computed according to the first of them. + + (2) An age can be defined as a duration, using units defined in +‘org-duration-units’, e.g., ‘3d 1h’. If any value in the column is as +such, the summary is also expressed as a duration. + + (3) Please note that the ‘COLUMNS’ definition must be on a single +line; it is wrapped here only because of formatting constraints. + + +File: org, Node: Using column view, Next: Capturing column view, Prev: Defining columns, Up: Column View + +7.5.2 Using column view +----------------------- + +Turning column view on or off +............................. + +‘C-c C-x C-c’ (‘org-columns’) + Turn on column view. If point is before the first headline in the + file, column view is turned on for the entire file, using the + ‘#+COLUMNS’ definition. If point is somewhere inside the outline, + this command searches the hierarchy, up from point, for a ‘COLUMNS’ + property that defines a format. When one is found, the column view + table is established for the tree starting at the entry that + contains the ‘COLUMNS’ property. If no such property is found, the + format is taken from the ‘#+COLUMNS’ line or from the variable + ‘org-columns-default-format’, and column view is established for + the current entry and its subtree. + +‘r’ or ‘g’ (‘org-columns-redo’) + Recreate the column view, to include recent changes made in the + buffer. + +‘q’ (‘org-columns-quit’) + Exit column view. + +Editing values +.............. + +‘’, ‘’, ‘’, ‘’ + Move through the column view from field to field. + +‘1..9,0’ + Directly select the Nth allowed value, ‘0’ selects the 10th value. + +‘n’ or ‘S-’ (‘org-columns-next-allowed-value’) +‘p’ or ‘S-’ (‘org-columns-previous-allowed-value’) + Switch to the next/previous allowed value of the field. For this, + you have to have specified allowed values for a property. + +‘e’ (‘org-columns-edit-value’) + Edit the property at point. For the special properties, this + invokes the same interface that you normally use to change that + property. For example, the tag completion or fast selection + interface pops up when editing a ‘TAGS’ property. + +‘C-c C-c’ (‘org-columns-set-tags-or-toggle’) + When there is a checkbox at point, toggle it. + +‘v’ (‘org-columns-show-value’) + View the full value of this property. This is useful if the width + of the column is smaller than that of the value. + +‘a’ (‘org-columns-edit-allowed’) + Edit the list of allowed values for this property. If the list is + found in the hierarchy, the modified values is stored there. If no + list is found, the new value is stored in the first entry that is + part of the current column view. + +Modifying column view on-the-fly +................................ + +‘<’ (‘org-columns-narrow’) +‘>’ (‘org-columns-widen’) + Make the column narrower/wider by one character. + +‘S-M-’ (‘org-columns-new’) + Insert a new column, to the left of the current column. + +‘S-M-’ (‘org-columns-delete’) + Delete the current column. + + +File: org, Node: Capturing column view, Prev: Using column view, Up: Column View + +7.5.3 Capturing column view +--------------------------- + +Since column view is just an overlay over a buffer, it cannot be +exported or printed directly. If you want to capture a column view, use +a ‘columnview’ dynamic block (see *note Dynamic Blocks::). The frame of +this block looks like this: + + * The column view + #+BEGIN: columnview :hlines 1 :id "label" + + #+END: + + This dynamic block has the following parameters: + +‘:id’ + This is the most important parameter. Column view is a feature + that is often localized to a certain (sub)tree, and the capture + block might be at a different location in the file. To identify + the tree whose view to capture, you can use four values: + + ‘local’ + Use the tree in which the capture block is located. + + ‘global’ + Make a global view, including all headings in the file. + + ‘file:FILENAME’ + Run column view at the top of the FILENAME file. + + ‘LABEL’ + Call column view in the tree that has an ‘ID’ property with + the value LABEL. You can use ‘M-x org-id-copy’ to create a + globally unique ID for the current entry and copy it to the + kill-ring. + +‘:hlines’ + When ‘t’, insert an hline after every line. When a number N, + insert an hline before each headline with level ‘<= N’. + +‘:vlines’ + When non-‘nil’, force column groups to get vertical lines. + +‘:maxlevel’ + When set to a number, do not capture entries below this level. + +‘:skip-empty-rows’ + When non-‘nil’, skip rows where the only non-empty specifier of the + column view is ‘ITEM’. + +‘:indent’ + When non-‘nil’, indent each ‘ITEM’ field according to its level. + +‘:format’ + Specify a column attribute (see *note Column attributes::) for the + dynamic block. + + The following commands insert or update the dynamic block: + +‘C-c C-x i’ (‘org-insert-columns-dblock’) + Insert a dynamic block capturing a column view. Prompt for the + scope or ID of the view. + +‘C-c C-c’ ‘C-c C-x C-u’ (‘org-dblock-update’) + Update dynamic block at point. point needs to be in the ‘#+BEGIN’ + line of the dynamic block. + +‘C-u C-c C-x C-u’ (‘org-update-all-dblocks’) + Update all dynamic blocks (see *note Dynamic Blocks::). This is + useful if you have several clock table blocks, column-capturing + blocks or other dynamic blocks in a buffer. + + You can add formulas to the column view table and you may add +plotting instructions in front of the table—these survive an update of +the block. If there is a ‘TBLFM’ keyword after the table, the table is +recalculated automatically after an update. + + An alternative way to capture and process property values into a +table is provided by Eric Schulte’s ‘org-collector.el’, which is a +contributed package(1). 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. + + ---------- Footnotes ---------- + + (1) Contributed packages are not part of Emacs, but are distributed +with the main distribution of Org—visit . + + +File: org, Node: Dates and Times, Next: Capture Refile Archive, Prev: Properties and Columns, Up: Top + +8 Dates and Times +***************** + +To assist project planning, TODO items can be labeled with a date and/or +a time. The specially formatted string carrying the date and time +information is called a _timestamp_ in Org mode. This may be a little +confusing because timestamp is often used as indicating when something +was created or last changed. However, in Org mode this term is used in +a much wider sense. + +* Menu: + +* Timestamps:: Assigning a time to a tree entry. +* Creating Timestamps:: Commands to insert timestamps. +* Deadlines and Scheduling:: Planning your work. +* Clocking Work Time:: Tracking how long you spend on a task. +* Effort Estimates:: Planning work effort in advance. +* Timers:: Notes with a running timer. + + +File: org, Node: Timestamps, Next: Creating Timestamps, Up: Dates and Times + +8.1 Timestamps, Deadlines and Scheduling +======================================== + +A timestamp is a specification of a date (possibly with a time or a +range of times) in a special format, either ‘<2003-09-16 Tue>’ or +‘<2003-09-16 Tue 09:39>’ or ‘<2003-09-16 Tue 12:00-12:30>’(1). A +timestamp can appear anywhere in the headline or body of an Org tree +entry. Its presence causes entries to be shown on specific dates in the +agenda (see *note Weekly/daily agenda::). We distinguish: + +Plain timestamp; Event; Appointment + A simple timestamp just assigns a date/time to an item. This is + just like writing down an appointment or event in a paper agenda. + In the agenda display, the headline of an entry associated with a + plain timestamp is shown exactly on that date. + + * Meet Peter at the movies + <2006-11-01 Wed 19:15> + * Discussion on climate change + <2006-11-02 Thu 20:00-22:00> + +Timestamp with repeater interval + A timestamp may contain a _repeater interval_, indicating that it + applies not only on the given date, but again and again after a + certain interval of N days (d), weeks (w), months (m), or years + (y). The following shows up in the agenda every Wednesday: + + * Pick up Sam at school + <2007-05-16 Wed 12:30 +1w> + +Diary-style sexp entries + For more complex date specifications, Org mode supports using the + special sexp diary entries implemented in the Emacs calendar/diary + package(2). For example, with optional time: + + * 22:00-23:00 The nerd meeting on every 2nd Thursday of the month + <%%(diary-float t 4 2)> + +Time/Date range + Two timestamps connected by ‘--’ denote a range. The headline is + shown on the first and last day of the range, and on any dates that + are displayed and fall in the range. Here is an example: + + ** Meeting in Amsterdam + <2004-08-23 Mon>--<2004-08-26 Thu> + +Inactive timestamp + Just like a plain timestamp, but with square brackets instead of + angular ones. These timestamps are inactive in the sense that they + do _not_ trigger an entry to show up in the agenda. + + * Gillian comes late for the fifth time + [2006-11-01 Wed] + + ---------- Footnotes ---------- + + (1) The Org date format is inspired by the standard ISO 8601 +date/time format. To use an alternative format, see *note Custom time +format::. The day name is optional when you type the date yourself. +However, any date inserted or modified by Org adds that day name, for +reading convenience. + + (2) When working with the standard diary sexp functions, you need to +be very careful with the order of the arguments. That order depends +evilly on the variable ‘calendar-date-style’. For example, to specify a +date December 12, 2005, the call might look like ‘(diary-date 12 1 +2005)’ or ‘(diary-date 1 12 2005)’ or ‘(diary-date 2005 12 1)’, +depending on the settings. This has been the source of much confusion. +Org mode users can resort to special versions of these functions like +‘org-date’ or ‘org-anniversary’. These work just like the corresponding +‘diary-’ functions, but with stable ISO order of arguments (year, month, +day) wherever applicable, independent of the value of +‘calendar-date-style’. + + +File: org, Node: Creating Timestamps, Next: Deadlines and Scheduling, Prev: Timestamps, Up: Dates and Times + +8.2 Creating Timestamps +======================= + +For Org mode to recognize timestamps, they need to be in the specific +format. All commands listed below produce timestamps in the correct +format. + +‘C-c .’ (‘org-time-stamp’) + Prompt for a date and insert a corresponding timestamp. When point + is at an existing timestamp in the buffer, the command is used to + modify this timestamp instead of inserting a new one. When this + command is used twice in succession, a time range is inserted. + + When called with a prefix argument, use the alternative format + which contains date and time. The default time can be rounded to + multiples of 5 minutes. See the option + ‘org-time-stamp-rounding-minutes’. + + With two prefix arguments, insert an active timestamp with the + current time without prompting. + +‘C-c !’ (‘org-time-stamp-inactive’) + Like ‘C-c .’, but insert an inactive timestamp that does not cause + an agenda entry. + +‘C-c C-c’ + Normalize timestamp, insert or fix day name if missing or wrong. + +‘C-c <’ (‘org-date-from-calendar’) + Insert a timestamp corresponding to point date in the calendar. + +‘C-c >’ (‘org-goto-calendar’) + Access the Emacs calendar for the current date. If there is a + timestamp in the current line, go to the corresponding date + instead. + +‘C-c C-o’ (‘org-open-at-point’) + Access the agenda for the date given by the timestamp or -range at + point (see *note Weekly/daily agenda::). + +‘S-’ (‘org-timestamp-down-day’) +‘S-’ (‘org-timestamp-up-day’) + Change date at point by one day. These key bindings conflict with + shift-selection and related modes (see *note Conflicts::). + +‘S-’ (‘org-timestamp-up’) +‘S-’ (‘org-timestamp-down’) + On the beginning or enclosing bracket of a timestamp, change its + type. Within a timestamp, change the item under point. Point can + be on a year, month, day, hour or minute. When the timestamp + contains a time range like ‘15:30-16:30’, modifying the first time + also shifts the second, shifting the time block with constant + length. To change the length, modify the second time. Note that + if point is in a headline and not at a timestamp, these same keys + modify the priority of an item (see *note Priorities::). The key + bindings also conflict with shift-selection and related modes (see + *note Conflicts::). + +‘C-c C-y’ (‘org-evaluate-time-range’) + Evaluate a time range by computing the difference between start and + end. With a prefix argument, insert result after the time range + (in a table: into the following column). + +* Menu: + +* The date/time prompt:: How Org mode helps you enter dates and times. +* Custom time format:: Making dates look different. + + +File: org, Node: The date/time prompt, Next: Custom time format, Up: Creating Timestamps + +8.2.1 The date/time prompt +-------------------------- + +When Org mode prompts for a date/time, the default is shown in default +date/time format, and the prompt therefore seems to ask for a specific +format. But it in fact accepts date/time information in a variety of +formats. Generally, the information should start at the beginning of +the string. Org mode finds whatever information is in there and derives +anything you have not specified from the _default date and time_. The +default is usually the current date and time, but when modifying an +existing timestamp, or when entering the second stamp of a range, it is +taken from the stamp in the buffer. When filling in information, Org +mode assumes that most of the time you want to enter a date in the +future: if you omit the month/year and the given day/month is _before_ +today, it assumes that you mean a future date(1). If the date has been +automatically shifted into the future, the time prompt shows this with +‘(=>F)’. + + For example, let’s assume that today is *June 13, 2006*. Here is how +various inputs are interpreted, the items filled in by Org mode are in +*bold*. + +‘3-2-5’ ⇒ 2003-02-05 +‘2/5/3’ ⇒ 2003-02-05 +‘14’ ⇒ *2006*-*06*-14 +‘12’ ⇒ *2006*-*07*-12 +‘2/5’ ⇒ *2007*-02-05 +‘Fri’ ⇒ nearest Friday (default date or later) +‘sep 15’ ⇒ *2006*-09-15 +‘feb 15’ ⇒ *2007*-02-15 +‘sep 12 9’ ⇒ 2009-09-12 +‘12:45’ ⇒ *2006*-*06*-*13* 12:45 +‘22 sept 0:34’ ⇒ *2006*-09-22 0:34 +‘w4’ ⇒ ISO week for of the current year *2006* +‘2012 w4 fri’ ⇒ Friday of ISO week 4 in 2012 +‘2012-w04-5’ ⇒ Same as above + + Furthermore you can specify a relative date by giving, as the _first_ +thing in the input: a plus/minus sign, a number and a letter—‘d’, ‘w’, +‘m’ or ‘y’—to indicate change in days, weeks, months, or years. With a +single plus or minus, the date is always relative to today. With a +double plus or minus, it is relative to the default date. If instead of +a single letter, you use the abbreviation of day name, the date is the +Nth such day, e.g.: + +‘+0’ ⇒ today +‘.’ ⇒ today +‘+4d’ ⇒ four days from today +‘+4’ ⇒ same as +4d +‘+2w’ ⇒ two weeks from today +‘++5’ ⇒ five days from default date +‘+2tue’ ⇒ second Tuesday from now + + The function understands English month and weekday abbreviations. If +you want to use un-abbreviated names and/or other languages, configure +the variables ‘parse-time-months’ and ‘parse-time-weekdays’. + + Not all dates can be represented in a given Emacs implementation. By +default Org mode forces dates into the compatibility range 1970–2037 +which works on all Emacs implementations. If you want to use dates +outside of this range, read the docstring of the variable +‘org-read-date-force-compatible-dates’. + + You can specify a time range by giving start and end times or by +giving a start time and a duration (in HH:MM format). Use one or two +dash(es) as the separator in the former case and use ‘+’ as the +separator in the latter case, e.g.: + +‘11am-1:15pm’ ⇒ 11:00-13:15 +‘11am--1:15pm’ ⇒ same as above +‘11am+2:15’ ⇒ same as above + + Parallel to the minibuffer prompt, a calendar is popped up(2). When +you exit the date prompt, either by clicking on a date in the calendar, +or by pressing ‘’, the date selected in the calendar is combined +with the information entered at the prompt. You can control the +calendar fully from the minibuffer: + +‘’ Choose date at point in calendar. +‘mouse-1’ Select date by clicking on it. +‘S-’ One day forward. +‘S-’ One day backward. +‘S-’ One week forward. +‘S-’ One week backward. +‘M-S-’ One month forward. +‘M-S-’ One month backward. +‘>’ Scroll calendar forward by one month. +‘<’ Scroll calendar backward by one month. +‘M-v’ Scroll calendar forward by 3 months. +‘C-v’ Scroll calendar backward by 3 months. + + The actions of the date/time prompt may seem complex, but I assure +you they will grow on you, and you will start getting annoyed by pretty +much any other way of entering a date/time out there. To help you +understand what is going on, the current interpretation of your input is +displayed live in the minibuffer(3). + + ---------- Footnotes ---------- + + (1) See the variable ‘org-read-date-prefer-future’. You may set that +variable to the symbol ‘time’ to even make a time before now shift the +date to tomorrow. + + (2) If you do not need/want the calendar, configure the variable +‘org-popup-calendar-for-date-prompt’. + + (3) If you find this distracting, turn off the display with +‘org-read-date-display-live’. + + +File: org, Node: Custom time format, Prev: The date/time prompt, Up: Creating Timestamps + +8.2.2 Custom time format +------------------------ + +Org mode uses the standard ISO notation for dates and times as it is +defined in ISO 8601. If you cannot get used to this and require another +representation of date and time to keep you happy, you can get it by +customizing the variables ‘org-display-custom-times’ and +‘org-time-stamp-custom-formats’. + +‘C-c C-x C-t’ (‘org-toggle-time-stamp-overlays’) + Toggle the display of custom formats for dates and times. + + Org mode needs the default format for scanning, so the custom +date/time format does not _replace_ the default format. Instead, it is +put _over_ the default format using text properties. This has the +following consequences: + + • You cannot place point onto a timestamp anymore, only before or + after. + + • The ‘S-’ and ‘S-’ keys can no longer be used to adjust + each component of a timestamp. If point is at the beginning of the + stamp, ‘S-’ and ‘S-’ change the stamp by one day, just + like ‘S-’ ‘S-’. At the end of the stamp, change the + time by one minute. + + • If the timestamp contains a range of clock times or a repeater, + these are not overlaid, but remain in the buffer as they were. + + • When you delete a timestamp character-by-character, it only + disappears from the buffer after _all_ (invisible) characters + belonging to the ISO timestamp have been removed. + + • If the custom timestamp format is longer than the default and you + are using dates in tables, table alignment will be messed up. If + the custom format is shorter, things do work as expected. + + +File: org, Node: Deadlines and Scheduling, Next: Clocking Work Time, Prev: Creating Timestamps, Up: Dates and Times + +8.3 Deadlines and Scheduling +============================ + +A timestamp may be preceded by special keywords to facilitate planning. +Both the timestamp and the keyword have to be positioned immediately +after the task they refer to. + +‘DEADLINE’ + Meaning: the task (most likely a TODO item, though not necessarily) + is supposed to be finished on that date. + + On the deadline date, the task is listed in the agenda. In + addition, the agenda for _today_ carries a warning about the + approaching or missed deadline, starting + ‘org-deadline-warning-days’ before the due date, and continuing + until the entry is marked DONE. An example: + + *** TODO write article about the Earth for the Guide + DEADLINE: <2004-02-29 Sun> + The editor in charge is [[bbdb:Ford Prefect]] + + You can specify a different lead time for warnings for a specific + deadlines using the following syntax. Here is an example with a + warning period of 5 days ‘DEADLINE: <2004-02-29 Sun -5d>’. This + warning is deactivated if the task gets scheduled and you set + ‘org-agenda-skip-deadline-prewarning-if-scheduled’ to ‘t’. + +‘SCHEDULED’ + Meaning: you are planning to start working on that task on the + given date. + + The headline is listed under the given date(1). In addition, a + reminder that the scheduled date has passed is present in the + compilation for _today_, until the entry is marked DONE, i.e., the + task is automatically forwarded until completed. + + *** TODO Call Trillian for a date on New Years Eve. + SCHEDULED: <2004-12-25 Sat> + + If you want to _delay_ the display of this task in the agenda, use + ‘SCHEDULED: <2004-12-25 Sat -2d>’: the task is still scheduled on + the 25th but will appear two days later. In case the task contains + a repeater, the delay is considered to affect all occurrences; if + you want the delay to only affect the first scheduled occurrence of + the task, use ‘--2d’ instead. See ‘org-scheduled-delay-days’ and + ‘org-agenda-skip-scheduled-delay-if-deadline’ for details on how to + control this globally or per agenda. + + Important: Scheduling an item in Org mode should _not_ be + understood in the same way that we understand _scheduling a + meeting_. Setting a date for a meeting is just a simple + appointment, you should mark this entry with a simple plain + timestamp, to get this item shown on the date where it + applies. This is a frequent misunderstanding by Org users. + In Org mode, _scheduling_ means setting a date when you want + to start working on an action item. + + You may use timestamps with repeaters in scheduling and deadline +entries. Org mode issues early and late warnings based on the +assumption that the timestamp represents the _nearest instance_ of the +repeater. However, the use of diary S-exp entries like + + <%%(diary-float t 42)> + +in scheduling and deadline timestamps is limited. Org mode does not +know enough about the internals of each S-exp function to issue early +and late warnings. However, it shows the item on each day where the +S-exp entry matches. + +* Menu: + +* Inserting deadline/schedule:: Planning items. +* Repeated tasks:: Items that show up again and again. + + ---------- Footnotes ---------- + + (1) It will still be listed on that date after it has been marked +DONE. If you do not like this, set the variable +‘org-agenda-skip-scheduled-if-done’. + + +File: org, Node: Inserting deadline/schedule, Next: Repeated tasks, Up: Deadlines and Scheduling + +8.3.1 Inserting deadlines or schedules +-------------------------------------- + +The following commands allow you to quickly insert a deadline or to +schedule an item:(1) + +‘C-c C-d’ (‘org-deadline’) + Insert ‘DEADLINE’ keyword along with a stamp. The insertion + happens in the line directly following the headline. Remove any + ‘CLOSED’ timestamp . When called with a prefix argument, also + remove any existing deadline from the entry. Depending on the + variable ‘org-log-redeadline’, take a note when changing an + existing deadline(2). + +‘C-c C-s’ (‘org-schedule’) + Insert ‘SCHEDULED’ keyword along with a stamp. The insertion + happens in the line directly following the headline. Remove any + ‘CLOSED’ timestamp. When called with a prefix argument, also + remove the scheduling date from the entry. Depending on the + variable ‘org-log-reschedule’, take a note when changing an + existing scheduling time(3). + +‘C-c / d’ (‘org-check-deadlines’) + Create a sparse tree with all deadlines that are either past-due, + or which will become due within ‘org-deadline-warning-days’. With + ‘C-u’ prefix, show all deadlines in the file. With a numeric + prefix, check that many days. For example, ‘C-1 C-c / d’ shows all + deadlines due tomorrow. + +‘C-c / b’ (‘org-check-before-date’) + Sparse tree for deadlines and scheduled items before a given date. + +‘C-c / a’ (‘org-check-after-date’) + Sparse tree for deadlines and scheduled items after a given date. + + Note that ‘org-schedule’ and ‘org-deadline’ supports setting the date +by indicating a relative time e.g., ‘+1d’ sets the date to the next day +after today, and ‘--1w’ sets the date to the previous week before any +current timestamp. + + ---------- Footnotes ---------- + + (1) The ‘SCHEDULED’ and ‘DEADLINE’ dates are inserted on the line +right below the headline. Do not put any text between this line and the +headline. + + (2) Note the corresponding ‘STARTUP’ options ‘logredeadline’, +‘lognoteredeadline’, and ‘nologredeadline’. + + (3) Note the corresponding ‘STARTUP’ options ‘logreschedule’, +‘lognotereschedule’, and ‘nologreschedule’. + + +File: org, Node: Repeated tasks, Prev: Inserting deadline/schedule, Up: Deadlines and Scheduling + +8.3.2 Repeated tasks +-------------------- + +Some tasks need to be repeated again and again. Org mode helps to +organize such tasks using a so-called repeater in a ‘DEADLINE’, +‘SCHEDULED’, or plain timestamps(1). In the following example: + + ** TODO Pay the rent + DEADLINE: <2005-10-01 Sat +1m> + +the ‘+1m’ is a repeater; the intended interpretation is that the task +has a deadline on ‘<2005-10-01>’ and repeats itself every (one) month +starting from that time. You can use yearly, monthly, weekly, daily and +hourly repeat cookies by using the ‘y’, ‘w’, ‘m’, ‘d’ and ‘h’ letters. +If you need both a repeater and a special warning period in a deadline +entry, the repeater should come first and the warning period last + + DEADLINE: <2005-10-01 Sat +1m -3d> + + Deadlines and scheduled items produce entries in the agenda when they +are over-due, so it is important to be able to mark such an entry as +DONE once you have done so. When you mark a ‘DEADLINE’ or a ‘SCHEDULED’ +with the TODO keyword ‘DONE’, it no longer produces entries in the +agenda. The problem with this is, however, is that then also the _next_ +instance of the repeated entry will not be active. Org mode deals with +this in the following way: when you try to mark such an entry DONE, +using ‘C-c C-t’, it shifts the base date of the repeating timestamp by +the repeater interval, and immediately sets the entry state back to +TODO(2). In the example above, setting the state to DONE would actually +switch the date like this: + + ** TODO Pay the rent + DEADLINE: <2005-11-01 Tue +1m> + + To mark a task with a repeater as DONE, use ‘C-- 1 C-c C-t’, i.e., +‘org-todo’ with a numeric prefix argument of ‘-1’. + + A timestamp(3) is added under the deadline, to keep a record that you +actually acted on the previous instance of this deadline. + + As a consequence of shifting the base date, this entry is no longer +visible in the agenda when checking past dates, but all future instances +will be visible. + + With the ‘+1m’ cookie, the date shift is always exactly one month. +So if you have not paid the rent for three months, marking this entry +DONE still keeps it as an overdue deadline. Depending on the task, this +may not be the best way to handle it. For example, if you forgot to +call your father for 3 weeks, it does not make sense to call him 3 times +in a single day to make up for it. Finally, there are tasks like +changing batteries which should always repeat a certain time _after_ the +last time you did it. For these tasks, Org mode has special repeaters +‘++’ and ‘.+’. For example: + + ** TODO Call Father + DEADLINE: <2008-02-10 Sun ++1w> + Marking this DONE shifts the date by at least one week, but also + by as many weeks as it takes to get this date into the future. + However, it stays on a Sunday, even if you called and marked it + done on Saturday. + + ** TODO Empty kitchen trash + DEADLINE: <2008-02-08 Fri 20:00 ++1d> + Marking this DONE shifts the date by at least one day, and also + by as many days as it takes to get the timestamp into the future. + Since there is a time in the timestamp, the next deadline in the + future will be on today's date if you complete the task before + 20:00. + + ** TODO Check the batteries in the smoke detectors + DEADLINE: <2005-11-01 Tue .+1m> + Marking this DONE will shift the date to one month after today. + + You may have both scheduling and deadline information for a specific +task. If the repeater is set for the scheduling information only, you +probably want the repeater to be ignored after the deadline. If so, set +the variable ‘org-agenda-skip-scheduled-if-deadline-is-shown’ to +‘repeated-after-deadline’. However, any scheduling information without +a repeater is no longer relevant once the task is done, and thus, +removed upon repeating the task. If you want both scheduling and +deadline information to repeat after the same interval, set the same +repeater for both timestamps. + + An alternative to using a repeater is to create a number of copies of +a task subtree, with dates shifted in each copy. The command ‘C-c C-x +c’ was created for this purpose; it is described in *note Structure +Editing::. + + ---------- Footnotes ---------- + + (1) Org does not repeat inactive timestamps, however. See *note +Timestamps::. + + (2) In fact, the target state is taken from, in this sequence, the +‘REPEAT_TO_STATE’ property, the variable ‘org-todo-repeat-to-state’ if +it is a string, the previous TODO state if ‘org-todo-repeat-to-state’ is +‘t’, or the first state of the TODO state sequence. + + (3) You can change this using the option ‘org-log-repeat’, or the +‘STARTUP’ options ‘logrepeat’, ‘lognoterepeat’, and ‘nologrepeat’. With +‘lognoterepeat’, you will also be prompted for a note. + + +File: org, Node: Clocking Work Time, Next: Effort Estimates, Prev: Deadlines and Scheduling, Up: Dates and Times + +8.4 Clocking Work Time +====================== + +Org mode allows you to clock the time you spend on specific tasks in a +project. When you start working on an item, you can start the clock. +When you stop working on that task, or when you mark the task done, the +clock is stopped and the corresponding time interval is recorded. It +also computes the total time spent on each subtree(1) of a project. And +it remembers a history or tasks recently clocked, to that you can jump +quickly between a number of tasks absorbing your time. + + To save the clock history across Emacs sessions, use: + + (setq org-clock-persist 'history) + (org-clock-persistence-insinuate) + + When you clock into a new task after resuming Emacs, the incomplete +clock(2) is retrieved (see *note Resolving idle time (1)::) and you are +prompted about what to do with it. + +* Menu: + +* Clocking commands:: Starting and stopping a clock. +* The clock table:: Detailed reports. +* Resolving idle time:: Resolving time when you’ve been idle. + + ---------- Footnotes ---------- + + (1) Clocking only works if all headings are indented with less than +30 stars. This is a hard-coded limitation of ‘lmax’ in ‘org-clock-sum’. + + (2) To resume the clock under the assumption that you have worked on +this task while outside Emacs, use ‘(setq org-clock-persist t)’. + + +File: org, Node: Clocking commands, Next: The clock table, Up: Clocking Work Time + +8.4.1 Clocking commands +----------------------- + +‘C-c C-x C-i’ (‘org-clock-in’) + Start the clock on the current item (clock-in). This inserts the + CLOCK keyword together with a timestamp. If this is not the first + clocking of this item, the multiple CLOCK lines are wrapped into a + ‘LOGBOOK’ drawer (see also the variable ‘org-clock-into-drawer’). + You can also overrule the setting of this variable for a subtree by + setting a ‘CLOCK_INTO_DRAWER’ or ‘LOG_INTO_DRAWER’ property. When + called with a ‘C-u’ prefix argument, select the task from a list of + recently clocked tasks. With two ‘C-u C-u’ prefixes, clock into + the task at point and mark it as the default task; the default task + is always be available with letter ‘d’ when selecting a clocking + task. With three ‘C-u C-u C-u’ prefixes, force continuous clocking + by starting the clock when the last clock stopped. + + While the clock is running, Org shows the current clocking time in + the mode line, along with the title of the task. The clock time + shown is all time ever clocked for this task and its children. If + the task has an effort estimate (see *note Effort Estimates::), the + mode line displays the current clocking time against it(1). If the + task is a repeating one (see *note Repeated tasks::), show only the + time since the last reset of the task(2). You can exercise more + control over show time with the ‘CLOCK_MODELINE_TOTAL’ property. + It may have the values ‘current’ to show only the current clocking + instance, ‘today’ to show all time clocked on this tasks today—see + also the variable ‘org-extend-today-until’, ‘all’ to include all + time, or ‘auto’ which is the default(3). Clicking with ‘mouse-1’ + onto the mode line entry pops up a menu with clocking options. + +‘C-c C-x C-o’ (‘org-clock-out’) + Stop the clock (clock-out). This inserts another timestamp at the + same location where the clock was last started. It also directly + computes the resulting time in inserts it after the time range as + ‘=>HH:MM’. See the variable ‘org-log-note-clock-out’ for the + possibility to record an additional note together with the + clock-out timestamp(4). + +‘C-c C-x C-x’ (‘org-clock-in-last’) + Re-clock the last clocked task. With one ‘C-u’ prefix argument, + select the task from the clock history. With two ‘C-u’ prefixes, + force continuous clocking by starting the clock when the last clock + stopped. + +‘C-c C-x C-e’ (‘org-clock-modify-effort-estimate’) + Update the effort estimate for the current clock task. + +‘C-c C-c’ or ‘C-c C-y’ (‘org-evaluate-time-range’) + Recompute the time interval after changing one of the timestamps. + This is only necessary if you edit the timestamps directly. If you + change them with ‘S-’ keys, the update is automatic. + +‘C-S-’ (‘org-clock-timestamps-up’) +‘C-S-’ (‘org-clock-timestamps-down’) + On CLOCK log lines, increase/decrease both timestamps so that the + clock duration keeps the same value. + +‘S-M-’ (‘org-timestamp-up’) +‘S-M-’ (‘org-timestamp-down’) + On ‘CLOCK’ log lines, increase/decrease the timestamp at point and + the one of the previous, or the next, clock timestamp by the same + duration. For example, if you hit ‘S-M-’ to increase a + clocked-out timestamp by five minutes, then the clocked-in + timestamp of the next clock is increased by five minutes. + +‘C-c C-t’ (‘org-todo’) + Changing the TODO state of an item to DONE automatically stops the + clock if it is running in this same item. + +‘C-c C-x C-q’ (‘org-clock-cancel’) + Cancel the current clock. This is useful if a clock was started by + mistake, or if you ended up working on something else. + +‘C-c C-x C-j’ (‘org-clock-goto’) + Jump to the headline of the currently clocked in task. With a + ‘C-u’ prefix argument, select the target task from a list of + recently clocked tasks. + +‘C-c C-x C-d’ (‘org-clock-display’) + Display time summaries for each subtree in the current buffer. + This puts overlays at the end of each headline, showing the total + time recorded under that heading, including the time of any + subheadings. You can use visibility cycling to study the tree, but + the overlays disappear when you change the buffer (see variable + ‘org-remove-highlights-with-change’) or press ‘C-c C-c’. + + The ‘l’ key may be used in the agenda (see *note Weekly/daily +agenda::) to show which tasks have been worked on or closed during a +day. + + *Important:* note that both ‘org-clock-out’ and ‘org-clock-in-last’ +can have a global keybinding and do not modify the window disposition. + + ---------- Footnotes ---------- + + (1) To add an effort estimate “on the fly”, hook a function doing +this to ‘org-clock-in-prepare-hook’. + + (2) The last reset of the task is recorded by the ‘LAST_REPEAT’ +property. + + (3) See also the variable ‘org-clock-mode-line-total’. + + (4) The corresponding in-buffer setting is: ‘#+STARTUP: +lognoteclock-out’. + + +File: org, Node: The clock table, Next: Resolving idle time, Prev: Clocking commands, Up: Clocking Work Time + +8.4.2 The clock table +--------------------- + +Org mode can produce quite complex reports based on the time clocking +information. Such a report is called a _clock table_, because it is +formatted as one or several Org tables. + +‘C-c C-x C-r’ (‘org-clock-report’) + Insert a dynamic block (see *note Dynamic Blocks::) containing a + clock report as an Org mode table into the current file. When + point is at an existing clock table, just update it. When called + with a prefix argument, jump to the first clock report in the + current document and update it. The clock table includes archived + trees. + +‘C-c C-c’ or ‘C-c C-x C-u’ (‘org-dblock-update’) + Update dynamic block at point. Point needs to be in the ‘BEGIN’ + line of the dynamic block. + +‘C-u C-c C-x C-u’ + Update all dynamic blocks (see *note Dynamic Blocks::). This is + useful if you have several clock table blocks in a buffer. + +‘S-’ +‘S-’ (‘org-clocktable-try-shift’) + Shift the current ‘:block’ interval and update the table. Point + needs to be in the ‘#+BEGIN: clocktable’ line for this command. If + ‘:block’ is ‘today’, it is shifted to ‘today-1’, etc. + + Here is an example of the frame for a clock table as it is inserted +into the buffer with the ‘C-c C-x C-r’ command: + + #+BEGIN: clocktable :maxlevel 2 :emphasize nil :scope file + #+END: clocktable + + The ‘#+BEGIN’ line and specify a number of options to define the +scope, structure, and formatting of the report. Defaults for all these +options can be configured in the variable ‘org-clocktable-defaults’. + + First there are options that determine which clock entries are to be +selected: + +‘:maxlevel’ + Maximum level depth to which times are listed in the table. Clocks + at deeper levels are summed into the upper level. + +‘:scope’ + The scope to consider. This can be any of the following: + + ‘nil’ the current buffer or narrowed region + ‘file’ the full current buffer + ‘subtree’ the subtree where the clocktable is located + ‘treeN’ the surrounding level N tree, for example ‘tree3’ + ‘tree’ the surrounding level 1 tree + ‘agenda’ all agenda files + ‘("file" ...)’ scan these files + ‘FUNCTION’ scan files returned by calling FUNCTION with no argument + ‘file-with-archives’ current file and its archives + ‘agenda-with-archives’ all agenda files, including archives + +‘:block’ + The time block to consider. This block is specified either + absolutely, or relative to the current time and may be any of these + formats: + + ‘2007-12-31’ New year eve 2007 + ‘2007-12’ December 2007 + ‘2007-W50’ ISO-week 50 in 2007 + ‘2007-Q2’ 2nd quarter in 2007 + ‘2007’ the year 2007 + ‘today’, ‘yesterday’, ‘today-N’ a relative day + ‘thisweek’, ‘lastweek’, ‘thisweek-N’ a relative week + ‘thismonth’, ‘lastmonth’, ‘thismonth-N’ a relative month + ‘thisyear’, ‘lastyear’, ‘thisyear-N’ a relative year + ‘untilnow’(1) all clocked time ever + + When this option is not set, Org falls back to the value in + ‘org-clock-display-default-range’, which defaults to the current + year. + + Use ‘S-’ or ‘S-’ to shift the time interval. + +‘:tstart’ + A time string specifying when to start considering times. Relative + times like ‘"<-2w>"’ can also be used. See *note Matching tags and + properties:: for relative time syntax. + +‘:tend’ + A time string specifying when to stop considering times. Relative + times like ‘""’ can also be used. See *note Matching tags and + properties:: for relative time syntax. + +‘:wstart’ + The starting day of the week. The default is 1 for Monday. + +‘:mstart’ + The starting day of the month. The default is 1 for the first. + +‘:step’ + Set to ‘week’ or ‘day’ to split the table into chunks. To use + this, ‘:block’ or ‘:tstart’, ‘:tend’ are needed. + +‘:stepskip0’ + When non-‘nil’, do not show steps that have zero time. + +‘:fileskip0’ + When non-‘nil’, do not show table sections from files which did not + contribute. + +‘:match’ + A tags match to select entries that should contribute. See *note + Matching tags and properties:: for the match syntax. + + Then there are options that determine the formatting of the table. +There options are interpreted by the function +‘org-clocktable-write-default’, but you can specify your own function +using the ‘:formatter’ parameter. + +‘:emphasize’ + When non-‘nil’, emphasize level one and level two items. + +‘:lang’ + Language(2) to use for descriptive cells like “Task”. + +‘:link’ + Link the item headlines in the table to their origins. + +‘:narrow’ + An integer to limit the width of the headline column in the Org + table. If you write it like ‘50!’, then the headline is also + shortened in export. + +‘:indent’ + Indent each headline field according to its level. + +‘:tcolumns’ + Number of columns to be used for times. If this is smaller than + ‘:maxlevel’, lower levels are lumped into one column. + +‘:level’ + Should a level number column be included? + +‘:sort’ + A cons cell containing the column to sort and a sorting type. + E.g., ‘:sort (1 . ?a)’ sorts the first column alphabetically. + +‘:compact’ + Abbreviation for ‘:level nil :indent t :narrow 40! :tcolumns 1’. + All are overwritten except if there is an explicit ‘:narrow’. + +‘:timestamp’ + A timestamp for the entry, when available. Look for ‘SCHEDULED’, + ‘DEADLINE’, ‘TIMESTAMP’ and ‘TIMESTAMP_IA’ special properties (see + *note Special Properties::), in this order. + +‘:tags’ + When this flag is non-‘nil’, show the headline’s tags. + +‘:properties’ + List of properties shown in the table. Each property gets its own + column. + +‘:inherit-props’ + When this flag is non-‘nil’, the values for ‘:properties’ are + inherited. + +‘:formula’ + Content of a ‘TBLFM’ keyword to be added and evaluated. As a + special case, ‘:formula %’ adds a column with % time. If you do + not specify a formula here, any existing formula below the clock + table survives updates and is evaluated. + +‘:formatter’ + A function to format clock data and insert it into the buffer. + + To get a clock summary of the current level 1 tree, for the current +day, you could write: + + #+BEGIN: clocktable :maxlevel 2 :block today :scope tree1 :link t + #+END: clocktable + +To use a specific time range you could write(3) + + #+BEGIN: clocktable :tstart "<2006-08-10 Thu 10:00>" + :tend "<2006-08-10 Thu 12:00>" + #+END: clocktable + +A range starting a week ago and ending right now could be written as + + #+BEGIN: clocktable :tstart "<-1w>" :tend "" + #+END: clocktable + +A summary of the current subtree with % times would be + + #+BEGIN: clocktable :scope subtree :link t :formula % + #+END: clocktable + +A horizontally compact representation of everything clocked during last +week would be + + #+BEGIN: clocktable :scope agenda :block lastweek :compact t + #+END: clocktable + + ---------- Footnotes ---------- + + (1) When using ‘:step’, ‘untilnow’ starts from the beginning of 2003, +not the beginning of time. + + (2) Language terms can be set through the variable +‘org-clock-clocktable-language-setup’. + + (3) Note that all parameters must be specified in a single line—the +line is broken here only to fit it into the manual. + + +File: org, Node: Resolving idle time, Prev: The clock table, Up: Clocking Work Time + +8.4.3 Resolving idle time and continuous clocking +------------------------------------------------- + +Resolving idle time +................... + +If you clock in on a work item, and then walk away from your +computer—perhaps to take a phone call—you often need to “resolve” the +time you were away by either subtracting it from the current clock, or +applying it to another one. + + By customizing the variable ‘org-clock-idle-time’ to some integer, +such as 10 or 15, Emacs can alert you when you get back to your computer +after being idle for that many minutes(1), and ask what you want to do +with the idle time. There will be a question waiting for you when you +get back, indicating how much idle time has passed constantly updated +with the current amount, as well as a set of choices to correct the +discrepancy: + +‘k’ + To keep some or all of the minutes and stay clocked in, press ‘k’. + Org asks how many of the minutes to keep. Press ‘’ to keep + them all, effectively changing nothing, or enter a number to keep + that many minutes. + +‘K’ + If you use the shift key and press ‘K’, it keeps however many + minutes you request and then immediately clock out of that task. + If you keep all of the minutes, this is the same as just clocking + out of the current task. + +‘s’ + To keep none of the minutes, use ‘s’ to subtract all the away time + from the clock, and then check back in from the moment you + returned. + +‘S’ + To keep none of the minutes and just clock out at the start of the + away time, use the shift key and press ‘S’. Remember that using + shift always leave you clocked out, no matter which option you + choose. + +‘C’ + To cancel the clock altogether, use ‘C’. Note that if instead of + canceling you subtract the away time, and the resulting clock + amount is less than a minute, the clock is still canceled rather + than cluttering up the log with an empty entry. + + What if you subtracted those away minutes from the current clock, and +now want to apply them to a new clock? Simply clock in to any task +immediately after the subtraction. Org will notice that you have +subtracted time “on the books”, so to speak, and will ask if you want to +apply those minutes to the next task you clock in on. + + There is one other instance when this clock resolution magic occurs. +Say you were clocked in and hacking away, and suddenly your cat chased a +mouse who scared a hamster that crashed into your UPS’s power button! +You suddenly lose all your buffers, but thanks to auto-save you still +have your recent Org mode changes, including your last clock in. + + If you restart Emacs and clock into any task, Org will notice that +you have a dangling clock which was never clocked out from your last +session. Using that clock’s starting time as the beginning of the +unaccounted-for period, Org will ask how you want to resolve that time. +The logic and behavior is identical to dealing with away time due to +idleness; it is just happening due to a recovery event rather than a set +amount of idle time. + + You can also check all the files visited by your Org agenda for +dangling clocks at any time using ‘M-x org-resolve-clocks ’ (or +‘C-c C-x C-z’). + +Continuous clocking +................... + +You may want to start clocking from the time when you clocked out the +previous task. To enable this systematically, set +‘org-clock-continuously’ to non-‘nil’. Each time you clock in, Org +retrieves the clock-out time of the last clocked entry for this session, +and start the new clock from there. + + If you only want this from time to time, use three universal prefix +arguments with ‘org-clock-in’ and two ‘C-u C-u’ with +‘org-clock-in-last’. + + ---------- Footnotes ---------- + + (1) On computers using macOS, idleness is based on actual user +idleness, not just Emacs’ idle time. For X11, you can install a utility +program ‘x11idle.c’, available in the ‘contrib/scripts/’ directory of +the Org Git distribution, or install the xprintidle package and set it +to the variable ‘org-clock-x11idle-program-name’ if you are running +Debian, to get the same general treatment of idleness. On other +systems, idle time refers to Emacs idle time only. + + +File: org, Node: Effort Estimates, Next: Timers, Prev: Clocking Work Time, Up: Dates and Times + +8.5 Effort Estimates +==================== + +If you want to plan your work in a very detailed way, or if you need to +produce offers with quotations of the estimated work effort, you may +want to assign effort estimates to entries. If you are also clocking +your work, you may later want to compare the planned effort with the +actual working time, a great way to improve planning estimates. Effort +estimates are stored in a special property ‘EFFORT’. You can set the +effort for an entry with the following commands: + +‘C-c C-x e’ (‘org-set-effort’) + Set the effort estimate for the current entry. With a prefix + argument, set it to the next allowed value—see below. This command + is also accessible from the agenda with the ‘e’ key. + +‘C-c C-x C-e’ (‘org-clock-modify-effort-estimate’) + Modify the effort estimate of the item currently being clocked. + + Clearly the best way to work with effort estimates is through column +view (see *note Column View::). You should start by setting up discrete +values for effort estimates, and a ‘COLUMNS’ format that displays these +values together with clock sums—if you want to clock your time. For a +specific buffer you can use: + + #+PROPERTY: Effort_ALL 0 0:10 0:30 1:00 2:00 3:00 4:00 5:00 6:00 7:00 + #+COLUMNS: %40ITEM(Task) %17Effort(Estimated Effort){:} %CLOCKSUM + +or, even better, you can set up these values globally by customizing the +variables ‘org-global-properties’ and ‘org-columns-default-format’. In +particular if you want to use this setup also in the agenda, a global +setup may be advised. + + The way to assign estimates to individual items is then to switch to +column mode, and to use ‘S-’ and ‘S-’ to change the value. +The values you enter are immediately summed up in the hierarchy. In the +column next to it, any clocked time is displayed. + + If you switch to column view in the daily/weekly agenda, the effort +column summarizes the estimated work effort for each day(1), and you can +use this to find space in your schedule. To get an overview of the +entire part of the day that is committed, you can set the option +‘org-agenda-columns-add-appointments-to-effort-sum’. The appointments +on a day that take place over a specified time interval are then also +added to the load estimate of the day. + + Effort estimates can be used in secondary agenda filtering that is +triggered with the ‘/’ key in the agenda (see *note Agenda Commands::). +If you have these estimates defined consistently, two or three key +presses narrow down the list to stuff that fits into an available time +slot. + + ---------- Footnotes ---------- + + (1) Please note the pitfalls of summing hierarchical data in a flat +list (see *note Agenda Column View::). + + +File: org, Node: Timers, Prev: Effort Estimates, Up: Dates and Times + +8.6 Taking Notes with a Relative Timer +====================================== + +Org provides two types of timers. There is a relative timer that counts +up, which can be useful when taking notes during, for example, a meeting +or a video viewing. There is also a countdown timer. + + The relative and countdown are started with separate commands. + +‘C-c C-x 0’ (‘org-timer-start’) + Start or reset the relative timer. By default, the timer is set to + 0. When called with a ‘C-u’ prefix, prompt the user for a starting + offset. If there is a timer string at point, this is taken as the + default, providing a convenient way to restart taking notes after a + break in the process. When called with a double prefix argument + ‘C-u C-u’, change all timer strings in the active region by a + certain amount. This can be used to fix timer strings if the timer + was not started at exactly the right moment. + +‘C-c C-x ;’ (‘org-timer-set-timer’) + Start a countdown timer. The user is prompted for a duration. + ‘org-timer-default-timer’ sets the default countdown value. Giving + a numeric prefix argument overrides this default value. This + command is available as ‘;’ in agenda buffers. + + Once started, relative and countdown timers are controlled with the +same commands. + +‘C-c C-x .’ (‘org-timer’) + Insert a relative time into the buffer. The first time you use + this, the timer starts. Using a prefix argument restarts it. + +‘C-c C-x -’ (‘org-timer-item’) + Insert a description list item with the current relative time. + With a prefix argument, first reset the timer to 0. + +‘M-’ (‘org-insert-heading’) + Once the timer list is started, you can also use ‘M-’ to + insert new timer items. + +‘C-c C-x ,’ (‘org-timer-pause-or-continue’) + Pause the timer, or continue it if it is already paused. + +‘C-c C-x _’ (‘org-timer-stop’) + Stop the timer. After this, you can only start a new timer, not + continue the old one. This command also removes the timer from the + mode line. + + +File: org, Node: Capture Refile Archive, Next: Agenda Views, Prev: Dates and Times, Up: Top + +9 Capture, Refile, Archive +************************** + +An important part of any organization system is the ability to quickly +capture new ideas and tasks, and to associate reference material with +them. Org does this using a process called _capture_. It also can +store files related to a task (_attachments_) in a special directory. +Once in the system, tasks and projects need to be moved around. Moving +completed project trees to an archive file keeps the system compact and +fast. + +* Menu: + +* Capture:: Capturing new stuff. +* Attachments:: Add files to tasks. +* RSS Feeds:: Getting input from RSS feeds. +* Protocols:: External access to Emacs and Org. +* Refile and Copy:: Moving/copying a tree from one place to another. +* Archiving:: What to do with finished products. + + +File: org, Node: Capture, Next: Attachments, Up: Capture Refile Archive + +9.1 Capture +=========== + +Capture lets you quickly store notes with little interruption of your +work flow. Org’s method for capturing new items is heavily inspired by +John Wiegley’s excellent Remember package. + +* Menu: + +* Setting up capture:: Where notes will be stored. +* Using capture:: Commands to invoke and terminate capture. +* Capture templates:: Define the outline of different note types. + + +File: org, Node: Setting up capture, Next: Using capture, Up: Capture + +9.1.1 Setting up capture +------------------------ + +The following customization sets a default target file for notes. + + (setq org-default-notes-file (concat org-directory "/notes.org")) + + You may also define a global key for capturing new material (see +*note Activation::). + + +File: org, Node: Using capture, Next: Capture templates, Prev: Setting up capture, Up: Capture + +9.1.2 Using capture +------------------- + +‘M-x org-capture’ (‘org-capture’) + Display the capture templates menu. If you have templates defined + (see *note Capture templates::), it offers these templates for + selection or use a new Org outline node as the default template. + It inserts the template into the target file and switch to an + indirect buffer narrowed to this new node. You may then insert the + information you want. + +‘C-c C-c’ (‘org-capture-finalize’) + Once you have finished entering information into the capture + buffer, ‘C-c C-c’ returns you to the window configuration before + the capture process, so that you can resume your work without + further distraction. When called with a prefix argument, finalize + and then jump to the captured item. + +‘C-c C-w’ (‘org-capture-refile’) + Finalize the capture process by refiling the note to a different + place (see *note Refile and Copy::). Please realize that this is a + normal refiling command that will be executed—so point position at + the moment you run this command is important. If you have inserted + a tree with a parent and children, first move point back to the + parent. Any prefix argument given to this command is passed on to + the ‘org-refile’ command. + +‘C-c C-k’ (‘org-capture-kill’) + Abort the capture process and return to the previous state. + + You can also call ‘org-capture’ in a special way from the agenda, +using the ‘k c’ key combination. With this access, any timestamps +inserted by the selected capture template defaults to the date at point +in the agenda, rather than to the current date. + + To find the locations of the last stored capture, use ‘org-capture’ +with prefix commands: + +‘C-u M-x org-capture’ + Visit the target location of a capture template. You get to select + the template in the usual way. + +‘C-u C-u M-x org-capture’ + Visit the last stored capture item in its buffer. + + You can also jump to the bookmark ‘org-capture-last-stored’, which is +automatically created unless you set ‘org-capture-bookmark’ to ‘nil’. + + To insert the capture at point in an Org buffer, call ‘org-capture’ +with a ‘C-0’ prefix argument. + + +File: org, Node: Capture templates, Prev: Using capture, Up: Capture + +9.1.3 Capture templates +----------------------- + +You can use templates for different types of capture items, and for +different target locations. The easiest way to create such templates is +through the customize interface. + +‘C’ + Customize the variable ‘org-capture-templates’. + + Before we give the formal description of template definitions, let’s +look at an example. Say you would like to use one template to create +general TODO entries, and you want to put these entries under the +heading ‘Tasks’ in your file ‘~/org/gtd.org’. Also, a date tree in the +file ‘journal.org’ should capture journal entries. A possible +configuration would look like: + + (setq org-capture-templates + '(("t" "Todo" entry (file+headline "~/org/gtd.org" "Tasks") + "* TODO %?\n %i\n %a") + ("j" "Journal" entry (file+datetree "~/org/journal.org") + "* %?\nEntered on %U\n %i\n %a"))) + +If you then press ‘t’ from the capture menu, Org will prepare the +template for you like this: + + * TODO + [[file:LINK TO WHERE YOU INITIATED CAPTURE]] + +During expansion of the template, ‘%a’ has been replaced by a link to +the location from where you called the capture command. This can be +extremely useful for deriving tasks from emails, for example. You fill +in the task definition, press ‘C-c C-c’ and Org returns you to the same +place where you started the capture process. + + To define special keys to capture to a particular template without +going through the interactive template selection, you can create your +key binding like this: + + (define-key global-map "\C-cx" + (lambda () (interactive) (org-capture nil "x"))) + +* Menu: + +* Template elements:: What is needed for a complete template entry. +* Template expansion:: Filling in information about time and context. +* Templates in contexts:: Only show a template in a specific context. + + +File: org, Node: Template elements, Next: Template expansion, Up: Capture templates + +9.1.3.1 Template elements +......................... + +Now lets look at the elements of a template definition. Each entry in +‘org-capture-templates’ is a list with the following items: + +keys + The keys that selects the template, as a string, characters only, + for example ‘"a"’, for a template to be selected with a single key, + or ‘"bt"’ for selection with two keys. When using several keys, + keys using the same prefix key must be sequential in the list and + preceded by a 2-element entry explaining the prefix key, for + example: + + ("b" "Templates for marking stuff to buy") + + If you do not define a template for the ‘C’ key, this key opens the + Customize buffer for this complex variable. + +description + A short string describing the template, shown during selection. + +type + The type of entry, a symbol. Valid values are: + + ‘entry’ + An Org mode node, with a headline. Will be filed as the child + of the target entry or as a top-level entry. The target file + should be an Org file. + + ‘item’ + A plain list item, placed in the first plain list at the + target location. Again the target file should be an Org file. + + ‘checkitem’ + A checkbox item. This only differs from the plain list item + by the default template. + + ‘table-line’ + A new line in the first table at the target location. Where + exactly the line will be inserted depends on the properties + ‘:prepend’ and ‘:table-line-pos’ (see below). + + ‘plain’ + Text to be inserted as it is. + +target + Specification of where the captured item should be placed. In Org + files, targets usually define a node. Entries will become children + of this node. Other types will be added to the table or list in + the body of this node. Most target specifications contain a file + name. If that file name is the empty string, it defaults to + ‘org-default-notes-file’. A file can also be given as a variable + or as a function called with no argument. When an absolute path is + not specified for a target, it is taken as relative to + ‘org-directory’. + + Valid values are: + + ‘(file "path/to/file")’ + Text will be placed at the beginning or end of that file. + + ‘(id "id of existing org entry")’ + Filing as child of this entry, or in the body of the entry. + + ‘(file+headline "filename" "node headline")’ + Fast configuration if the target heading is unique in the + file. + + ‘(file+olp "filename" "Level 1 heading" "Level 2" ...)’ + For non-unique headings, the full path is safer. + + ‘(file+regexp "filename" "regexp to find location")’ + Use a regular expression to position point. + + ‘(file+olp+datetree "filename" [ "Level 1 heading" ...])’ + This target(1) creates a heading in a date tree(2) for today’s + date. If the optional outline path is given, the tree will be + built under the node it is pointing to, instead of at top + level. Check out the ‘:time-prompt’ and ‘:tree-type’ + properties below for additional options. + + ‘(file+function "filename" function-finding-location)’ + A function to find the right location in the file. + + ‘(clock)’ + File to the entry that is currently being clocked. + + ‘(function function-finding-location)’ + Most general way: write your own function which both visits + the file and moves point to the right location. + +template + The template for creating the capture item. If you leave this + empty, an appropriate default template will be used. Otherwise + this is a string with escape codes, which will be replaced + depending on time and context of the capture call. The string with + escapes may be loaded from a template file, using the special + syntax ‘(file "template filename")’. See below for more details. + +properties + The rest of the entry is a property list of additional options. + Recognized properties are: + + ‘:prepend’ + Normally new captured information will be appended at the + target location (last child, last table line, last list item, + ...). Setting this property changes that. + + ‘:immediate-finish’ + When set, do not offer to edit the information, just file it + away immediately. This makes sense if the template only needs + information that can be added automatically. + + ‘:empty-lines’ + Set this to the number of lines to insert before and after the + new item. Default 0, and the only other common value is 1. + + ‘:clock-in’ + Start the clock in this item. + + ‘:clock-keep’ + Keep the clock running when filing the captured entry. + + ‘:clock-resume’ + If starting the capture interrupted a clock, restart that + clock when finished with the capture. Note that ‘:clock-keep’ + has precedence over ‘:clock-resume’. When setting both to + non-‘nil’, the current clock will run and the previous one + will not be resumed. + + ‘:time-prompt’ + Prompt for a date/time to be used for date/week trees and when + filling the template. Without this property, capture uses the + current date and time. Even if this property has not been + set, you can force the same behavior by calling ‘org-capture’ + with a ‘C-1’ prefix argument. + + ‘:tree-type’ + When ‘week’, make a week tree instead of the month tree, i.e., + place the headings for each day under a heading with the + current ISO week. + + ‘:unnarrowed’ + Do not narrow the target buffer, simply show the full buffer. + Default is to narrow it so that you only see the new material. + + ‘:table-line-pos’ + Specification of the location in the table where the new line + should be inserted. It should be a string like ‘II-3’ meaning + that the new line should become the third line before the + second horizontal separator line. + + ‘:kill-buffer’ + If the target file was not yet visited when capture was + invoked, kill the buffer again after capture is completed. + + ‘:no-save’ + Do not save the target file after finishing the capture. + + ---------- Footnotes ---------- + + (1) Org used to offer four different targets for date/week tree +capture. Now, Org automatically translates these to use +‘file+olp+datetree’, applying the ‘:time-prompt’ and ‘:tree-type’ +properties. Please rewrite your date/week-tree targets using +‘file+olp+datetree’ since the older targets are now deprecated. + + (2) A date tree is an outline structure with years on the highest +level, months or ISO weeks as sublevels and then dates on the lowest +level. Tags are allowed in the tree structure. + + +File: org, Node: Template expansion, Next: Templates in contexts, Prev: Template elements, Up: Capture templates + +9.1.3.2 Template expansion +.......................... + +In the template itself, special “%-escapes”(1) allow dynamic insertion +of content. The templates are expanded in the order given here: + +‘%[FILE]’ + Insert the contents of the file given by FILE. + +‘%(EXP)’ + Evaluate Elisp expression EXP and replace it with the result. The + EXP form must return a string. Only placeholders pre-existing + within the template, or introduced with ‘%[file]’, are expanded + this way. Since this happens after expanding non-interactive + “%-escapes”, those can be used to fill the expression. + +‘%’ + The result of format-time-string on the FORMAT specification. + +‘%t’ + Timestamp, date only. + +‘%T’ + Timestamp, with date and time. + +‘%u’, ‘%U’ + Like ‘%t’, ‘%T’ above, but inactive timestamps. + +‘%i’ + Initial content, the region when capture is called while the region + is active. If there is text before ‘%i’ on the same line, such as + indentation, and ‘%i’ is not inside a ‘%(exp)’ form, that prefix is + added before every line in the inserted text. + +‘%a’ + Annotation, normally the link created with ‘org-store-link’. + +‘%A’ + Like ‘%a’, but prompt for the description part. + +‘%l’ + Like ‘%a’, but only insert the literal link. + +‘%c’ + Current kill ring head. + +‘%x’ + Content of the X clipboard. + +‘%k’ + Title of the currently clocked task. + +‘%K’ + Link to the currently clocked task. + +‘%n’ + User name (taken from ‘user-full-name’). + +‘%f’ + File visited by current buffer when org-capture was called. + +‘%F’ + Full path of the file or directory visited by current buffer. + +‘%:keyword’ + Specific information for certain link types, see below. + +‘%^g’ + Prompt for tags, with completion on tags in target file. + +‘%^G’ + Prompt for tags, with completion all tags in all agenda files. + +‘%^t’ + Like ‘%t’, but prompt for date. Similarly ‘%^T’, ‘%^u’, ‘%^U’. + You may define a prompt like ‘%^{Birthday}t’. + +‘%^C’ + Interactive selection of which kill or clip to use. + +‘%^L’ + Like ‘%^C’, but insert as link. + +‘%^{PROP}p’ + Prompt the user for a value for property PROP. + +‘%^{PROMPT}’ + Prompt the user for a string and replace this sequence with it. + You may specify a default value and a completion table with + ‘%^{prompt|default|completion2|completion3...}’. The arrow keys + access a prompt-specific history. + +‘%\N’ + Insert the text entered at the Nth ‘%^{PROMPT}’, where N is a + number, starting from 1. + +‘%?’ + After completing the template, position point here. + + For specific link types, the following keywords are defined(2): + +Link type Available keywords +-------------------------------------------------------------------------- +bbdb ‘%:name’, ‘%:company’ +irc ‘%:server’, ‘%:port’, ‘%:nick’ +mh, rmail ‘%:type’, ‘%:subject’, ‘%:message-id’ + ‘%:from’, ‘%:fromname’, ‘%:fromaddress’ + ‘%:to’, ‘%:toname’, ‘%:toaddress’ + ‘%:date’ (message date header field) + ‘%:date-timestamp’ (date as active timestamp) + ‘%:date-timestamp-inactive’ (date as inactive timestamp) + ‘%:fromto’ (either “to NAME” or “from NAME”)(3) +gnus ‘%:group’, for messages also all email fields +w3, w3m ‘%:url’ +info ‘%:file’, ‘%:node’ +calendar ‘%:date’ +org-protocol ‘%:link’, ‘%:description’, ‘%:annotation’ + + ---------- Footnotes ---------- + + (1) If you need one of these sequences literally, escape the ‘%’ with +a backslash. + + (2) If you define your own link types (see *note Adding Hyperlink +Types::), any property you store with ‘org-store-link-props’ can be +accessed in capture templates in a similar way. + + (3) This is always the other, not the user. See the variable +‘org-from-is-user-regexp’. + + +File: org, Node: Templates in contexts, Prev: Template expansion, Up: Capture templates + +9.1.3.3 Templates in contexts +............................. + +To control whether a capture template should be accessible from a +specific context, you can customize ‘org-capture-templates-contexts’. +Let’s say, for example, that you have a capture template “p” for storing +Gnus emails containing patches. Then you would configure this option +like this: + + (setq org-capture-templates-contexts + '(("p" (in-mode . "message-mode")))) + + You can also tell that the command key ‘p’ should refer to another +template. In that case, add this command key like this: + + (setq org-capture-templates-contexts + '(("p" "q" (in-mode . "message-mode")))) + + See the docstring of the variable for more information. + + +File: org, Node: Attachments, Next: RSS Feeds, Prev: Capture, Up: Capture Refile Archive + +9.2 Attachments +=============== + +It is often useful to associate reference material with an outline +node/task. Small chunks of plain text can simply be stored in the +subtree of a project. Hyperlinks (see *note Hyperlinks::) can establish +associations with files that live elsewhere on your computer or in the +cloud, like emails or source code files belonging to a project. Another +method is _attachments_, which are files located in a directory +belonging to an outline node. Org uses directories named by the unique +ID of each entry. These directories are located in the ‘data/’ +directory which lives in the same directory where your Org file +lives(1). If you initialize this directory with ‘git init’, Org +automatically commits changes when it sees them. The attachment system +has been contributed to Org by John Wiegley. + + In cases where it seems better to do so, you can attach a directory +of your choice to an entry. You can also make children inherit the +attachment directory from a parent, so that an entire subtree uses the +same attached directory. + + The following commands deal with attachments: + +‘C-c C-a’ (‘org-attach’) + The dispatcher for commands related to the attachment system. + After these keys, a list of commands is displayed and you must + press an additional key to select a command: + + ‘a’ (‘org-attach-attach’) + Select a file and move it into the task’s attachment + directory. The file is copied, moved, or linked, depending on + ‘org-attach-method’. Note that hard links are not supported + on all systems. + + ‘c’/‘m’/‘l’ + Attach a file using the copy/move/link method. Note that hard + links are not supported on all systems. + + ‘n’ (‘org-attach-new’) + Create a new attachment as an Emacs buffer. + + ‘z’ (‘org-attach-sync’) + Synchronize the current task with its attachment directory, in + case you added attachments yourself. + + ‘o’ (‘org-attach-open’) + Open current task’s attachment. If there is more than one, + prompt for a file name first. Opening follows the rules set + by ‘org-file-apps’. For more details, see the information on + following hyperlinks (see *note Handling Links::). + + ‘O’ (‘org-attach-open-in-emacs’) + Also open the attachment, but force opening the file in Emacs. + + ‘f’ (‘org-attach-reveal’) + Open the current task’s attachment directory. + + ‘F’ (‘org-attach-reveal-in-emacs’) + Also open the directory, but force using Dired in Emacs. + + ‘d’ (‘org-attach-delete-one’) + Select and delete a single attachment. + + ‘D’ (‘org-attach-delete-all’) + Delete all of a task’s attachments. A safer way is to open + the directory in Dired and delete from there. + + ‘s’ (‘org-attach-set-directory’) + Set a specific directory as the entry’s attachment directory. + This works by putting the directory path into the ‘ATTACH_DIR’ + property. + + ‘i’ (‘org-attach-set-inherit’) + Set the ‘ATTACH_DIR_INHERIT’ property, so that children use + the same directory for attachments as the parent does. + + It is possible to attach files to a subtree from a Dired buffer. To +use this feature, have one window in Dired mode containing the file(s) +to be attached and another window with point in the subtree that shall +get the attachments. In the Dired window, with point on a file, ‘M-x +org-attach-dired-to-subtree’ attaches the file to the subtree using the +attachment method set by variable ‘org-attach-method’. When files are +marked in the Dired window then all marked files get attached. + + Add the following lines to the Emacs init file to have ‘C-c C-x a’ +attach files in Dired buffers. + + (add-hook 'dired-mode-hook + (lambda () + (define-key dired-mode-map + (kbd "C-c C-x a") + #'org-attach-dired-to-subtree))) + + The following code shows how to bind the previous command with a +specific attachment method. + + (add-hook 'dired-mode-hook + (lambda () + (define-key dired-mode-map (kbd "C-c C-x c") + (lambda () + (interactive) + (let ((org-attach-method 'cp)) + (call-interactively #'org-attach-dired-to-subtree)))))) + + ---------- Footnotes ---------- + + (1) If you move entries or Org files from one directory to another, +you may want to configure ‘org-attach-directory’ to contain an absolute +path. + + +File: org, Node: RSS Feeds, Next: Protocols, Prev: Attachments, Up: Capture Refile Archive + +9.3 RSS Feeds +============= + +Org can add and change entries based on information found in RSS feeds +and Atom feeds. You could use this to make a task out of each new +podcast in a podcast feed. Or you could use a phone-based note-creating +service on the web to import tasks into Org. To access feeds, configure +the variable ‘org-feed-alist’. The docstring of this variable has +detailed information. With the following + + (setq org-feed-alist + '(("Slashdot" + "http://rss.slashdot.org/Slashdot/slashdot" + "~/txt/org/feeds.org" "Slashdot Entries"))) + +new items from the feed provided by ‘rss.slashdot.org’ result in new +entries in the file ‘~/org/feeds.org’ under the heading ‘Slashdot +Entries’, whenever the following command is used: + +‘C-c C-x g’ (‘org-feed-update-all’) + Collect items from the feeds configured in ‘org-feed-alist’ and act + upon them. + +‘C-c C-x G’ (‘org-feed-goto-inbox’) + Prompt for a feed name and go to the inbox configured for this + feed. + + Under the same headline, Org creates a drawer ‘FEEDSTATUS’ in which +it stores information about the status of items in the feed, to avoid +adding the same item several times. + + For more information, including how to read atom feeds, see +‘org-feed.el’ and the docstring of ‘org-feed-alist’. + + +File: org, Node: Protocols, Next: Refile and Copy, Prev: RSS Feeds, Up: Capture Refile Archive + +9.4 Protocols for External Access +================================= + +Org protocol is a means to trigger custom actions in Emacs from external +applications. Any application that supports calling external programs +with an URL as argument may be used with this functionality. For +example, you can configure bookmarks in your web browser to send a link +to the current page to Org and create a note from it using capture (see +*note Capture::). You can also create a bookmark that tells Emacs to +open the local source file of a remote website you are browsing. + + In order to use Org protocol from an application, you need to +register ‘org-protocol://’ as a valid scheme-handler. External calls +are passed to Emacs through the ‘emacsclient’ command, so you also need +to ensure an Emacs server is running. More precisely, when the +application calls + + emacsclient org-protocol://PROTOCOL?key1=val1&key2=val2 + +Emacs calls the handler associated to PROTOCOL with argument ‘(:key1 +val1 :key2 val2)’. + + Org protocol comes with three predefined protocols, detailed in the +following sections. Configure ‘org-protocol-protocol-alist’ to define +your own. + +* Menu: + +* store-link protocol:: Store a link, push URL to kill-ring. +* capture protocol:: Fill a buffer with external information. +* open-source protocol:: Edit published contents. + + +File: org, Node: store-link protocol, Next: capture protocol, Up: Protocols + +9.4.1 ‘store-link’ protocol +--------------------------- + +Using ‘store-link’ handler, you can copy links, insertable through ‘M-x +org-insert-link’ or yanking thereafter. More precisely, the command + + emacsclient org-protocol://store-link?url=URL&title=TITLE + +stores the following link: + + [[URL][TITLE]] + + In addition, URL is pushed on the kill-ring for yanking. You need to +encode URL and TITLE if they contain slashes, and probably quote those +for the shell. + + To use this feature from a browser, add a bookmark with an arbitrary +name, e.g., ‘Org: store-link’ and enter this as _Location_: + + javascript:location.href='org-protocol://store-link?url='+ + encodeURIComponent(location.href); + + +File: org, Node: capture protocol, Next: open-source protocol, Prev: store-link protocol, Up: Protocols + +9.4.2 ‘capture’ protocol +------------------------ + +Activating “capture” handler pops up a ‘Capture’ buffer and fills the +capture template associated to the ‘X’ key with them. + + emacsclient org-protocol://capture?template=X?url=URL?title=TITLE?body=BODY + + To use this feature, add a bookmark with an arbitrary name, e.g., +‘Org: capture’, and enter this as ‘Location’: + + javascript:location.href='org-protocol://capture?template=x'+ + '&url='+encodeURIComponent(window.location.href)+ + '&title='+encodeURIComponent(document.title)+ + '&body='+encodeURIComponent(window.getSelection()); + + The result depends on the capture template used, which is set in the +bookmark itself, as in the example above, or in +‘org-protocol-default-template-key’. + + The following template placeholders are available: + + %:link The URL + %:description The webpage title + %:annotation Equivalent to [[%:link][%:description]] + %i The selected text + + +File: org, Node: open-source protocol, Prev: capture protocol, Up: Protocols + +9.4.3 ‘open-source’ protocol +---------------------------- + +The ‘open-source’ handler is designed to help with editing local sources +when reading a document. To that effect, you can use a bookmark with +the following location: + + javascript:location.href='org-protocol://open-source?&url='+ + encodeURIComponent(location.href) + + The variable ‘org-protocol-project-alist’ maps URLs to local file +names, by stripping URL parameters from the end and replacing the +‘:base-url’ with ‘:working-directory’ and ‘:online-suffix’ with +‘:working-suffix’. For example, assuming you own a local copy of +‘https://orgmode.org/worg/’ contents at ‘/home/user/worg’, you can set +‘org-protocol-project-alist’ to the following + + (setq org-protocol-project-alist + '(("Worg" + :base-url "https://orgmode.org/worg/" + :working-directory "/home/user/worg/" + :online-suffix ".html" + :working-suffix ".org"))) + +If you are now browsing +‘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. + + However, such mapping may not yield the desired results. Suppose you +maintain an online store located at ‘http://example.com/’. The local +sources reside in ‘/home/user/example/’. It is common practice to serve +all products in such a store through one file and rewrite URLs that do +not match an existing file on the server. That way, a request to +‘http://example.com/print/posters.html’ might be rewritten on the server +to something like +‘http://example.com/shop/products.php/posters.html.php’. The +‘open-source’ handler probably cannot find a file named +‘/home/user/example/print/posters.html.php’ and fails. + + Such an entry in ‘org-protocol-project-alist’ may hold an additional +property ‘:rewrites’. This property is a list of cons cells, each of +which maps a regular expression to a path relative to the +‘:working-directory’. + + Now map the URL to the path ‘/home/user/example/products.php’ by +adding ‘:rewrites’ rules like this: + + (setq org-protocol-project-alist + '(("example.com" + :base-url "http://example.com/" + :working-directory "/home/user/example/" + :online-suffix ".php" + :working-suffix ".php" + :rewrites (("example.com/print/" . "products.php") + ("example.com/$" . "index.php"))))) + +Since ‘example.com/$’ is used as a regular expression, it maps +‘http://example.com/’, ‘https://example.com’, ‘http://www.example.com/’ +and similar to ‘/home/user/example/index.php’. + + The ‘:rewrites’ rules are searched as a last resort if and only if no +existing file name is matched. + + Two functions can help you filling ‘org-protocol-project-alist’ with +valid contents: ‘org-protocol-create’ and ‘org-protocol-create-for-org’. +The latter is of use if you’re editing an Org file that is part of a +publishing project. + + +File: org, Node: Refile and Copy, Next: Archiving, Prev: Protocols, Up: Capture Refile Archive + +9.5 Refile and Copy +=================== + +When reviewing the captured data, you may want to refile or to copy some +of the entries into a different list, for example into a project. +Cutting, finding the right location, and then pasting the note is +cumbersome. To simplify this process, you can use the following special +command: + +‘C-c M-w’ (‘org-copy’) + Copying works like refiling, except that the original note is not + deleted. + +‘C-c C-w’ (‘org-refile’) + Refile the entry or region at point. This command offers possible + locations for refiling the entry and lets you select one with + completion. The item (or all items in the region) is filed below + the target heading as a subitem. Depending on + ‘org-reverse-note-order’, it is either the first or last subitem. + + By default, all level 1 headlines in the current buffer are + considered to be targets, but you can have more complex definitions + across a number of files. See the variable ‘org-refile-targets’ + for details. If you would like to select a location via a + file-path-like completion along the outline path, see the variables + ‘org-refile-use-outline-path’ and + ‘org-outline-path-complete-in-steps’. If you would like to be able + to create new nodes as new parents for refiling on the fly, check + the variable ‘org-refile-allow-creating-parent-nodes’. When the + variable ‘org-log-refile’(1) is set, a timestamp or a note is + recorded whenever an entry is refiled. + +‘C-u C-c C-w’ + Use the refile interface to jump to a heading. + +‘C-u C-u C-c C-w’ (‘org-refile-goto-last-stored’) + Jump to the location where ‘org-refile’ last moved a tree to. + +‘C-2 C-c C-w’ + Refile as the child of the item currently being clocked. + +‘C-3 C-c C-w’ + Refile and keep the entry in place. Also see ‘org-refile-keep’ to + make this the default behavior, and beware that this may result in + duplicated ‘ID’ properties. + +‘C-0 C-c C-w’ or ‘C-u C-u C-u C-c C-w’ (‘org-refile-cache-clear’) + Clear the target cache. Caching of refile targets can be turned on + by setting ‘org-refile-use-cache’. To make the command see new + possible targets, you have to clear the cache with this command. + + ---------- Footnotes ---------- + + (1) Note the corresponding ‘STARTUP’ options ‘logrefile’, +‘lognoterefile’, and ‘nologrefile’. + + +File: org, Node: Archiving, Prev: Refile and Copy, Up: Capture Refile Archive + +9.6 Archiving +============= + +When a project represented by a (sub)tree is finished, you may want to +move the tree out of the way and to stop it from contributing to the +agenda. Archiving is important to keep your working files compact and +global searches like the construction of agenda views fast. + +‘C-c C-x C-a’ (‘org-archive-subtree-default’) + Archive the current entry using the command specified in the + variable ‘org-archive-default-command’. + +* Menu: + +* Moving subtrees:: Moving a tree to an archive file. +* Internal archiving:: Switch off a tree but keep it in the file. + + +File: org, Node: Moving subtrees, Next: Internal archiving, Up: Archiving + +9.6.1 Moving a tree to an archive file +-------------------------------------- + +The most common archiving action is to move a project tree to another +file, the archive file. + +‘C-c C-x C-s’ or short ‘C-c $’ (‘org-archive-subtree’) + Archive the subtree starting at point position to the location + given by ‘org-archive-location’. + +‘C-u C-c C-x C-s’ + Check if any direct children of the current headline could be moved + to the archive. To do this, check each subtree for open TODO + entries. If none is found, the command offers to move it to the + archive location. If point is _not_ on a headline when this + command is invoked, check level 1 trees. + +‘C-u C-u C-c C-x C-s’ + As above, but check subtree for timestamps instead of TODO entries. + The command offers to archive the subtree if it _does_ contain a + timestamp, and that timestamp is in the past. + + The default archive location is a file in the same directory as the +current file, with the name derived by appending ‘_archive’ to the +current file name. You can also choose what heading to file archived +items under, with the possibility to add them to a datetree in a file. +For information and examples on how to specify the file and the heading, +see the documentation string of the variable ‘org-archive-location’. + + There is also an in-buffer option for setting this variable, for +example: + + #+ARCHIVE: %s_done:: + + If you would like to have a special archive location for a single +entry or a (sub)tree, give the entry an ‘ARCHIVE’ property with the +location as the value (see *note Properties and Columns::). + + When a subtree is moved, it receives a number of special properties +that record context information like the file from where the entry came, +its outline path the archiving time etc. Configure the variable +‘org-archive-save-context-info’ to adjust the amount of information +added. + + +File: org, Node: Internal archiving, Prev: Moving subtrees, Up: Archiving + +9.6.2 Internal archiving +------------------------ + +If you want to just switch off—for agenda views—certain subtrees without +moving them to a different file, you can use the ‘ARCHIVE’ tag. + + A headline that is marked with the ‘ARCHIVE’ tag (see *note Tags::) +stays at its location in the outline tree, but behaves in the following +way: + + • It does not open when you attempt to do so with a visibility + cycling command (see *note Visibility Cycling::). You can force + cycling archived subtrees with ‘C-’, or by setting the option + ‘org-cycle-open-archived-trees’. Also normal outline commands, + like ‘outline-show-all’, open archived subtrees. + + • During sparse tree construction (see *note Sparse Trees::), matches + in archived subtrees are not exposed, unless you configure the + option ‘org-sparse-tree-open-archived-trees’. + + • During agenda view construction (see *note Agenda Views::), the + content of archived trees is ignored unless you configure the + option ‘org-agenda-skip-archived-trees’, in which case these trees + are always included. In the agenda you can press ‘v a’ to get + archives temporarily included. + + • Archived trees are not exported (see *note Exporting::), only the + headline is. Configure the details using the variable + ‘org-export-with-archived-trees’. + + • Archived trees are excluded from column view unless the variable + ‘org-columns-skip-archived-trees’ is configured to ‘nil’. + + The following commands help manage the ‘ARCHIVE’ tag: + +‘C-c C-x a’ (‘org-toggle-archive-tag’) + Toggle the archive tag for the current headline. When the tag is + set, the headline changes to a shadowed face, and the subtree below + it is hidden. + +‘C-u C-c C-x a’ + Check if any direct children of the current headline should be + archived. To do this, check each subtree for open TODO entries. + If none is found, the command offers to set the ‘ARCHIVE’ tag for + the child. If point is _not_ on a headline when this command is + invoked, check the level 1 trees. + +‘C-’ (‘org-force-cycle-archived’) + Cycle a tree even if it is tagged with ‘ARCHIVE’. + +‘C-c C-x A’ (‘org-archive-to-archive-sibling’) + Move the current entry to the _Archive Sibling_. This is a sibling + of the entry with the heading ‘Archive’ and the archive tag. The + entry becomes a child of that sibling and in this way retains a lot + of its original context, including inherited tags and approximate + position in the outline. + + +File: org, Node: Agenda Views, Next: Markup for Rich Contents, Prev: Capture Refile Archive, Up: Top + +10 Agenda Views +*************** + +Due to the way Org works, TODO items, time-stamped items, and tagged +headlines can be scattered throughout a file or even a number of files. +To get an overview of open action items, or of events that are important +for a particular date, this information must be collected, sorted and +displayed in an organized way. + + Org can select items based on various criteria and display them in a +separate buffer. Six different view types are provided: + + • an _agenda_ that is like a calendar and shows information for + specific dates, + + • a _TODO list_ that covers all unfinished action items, + + • a _match view_, showings headlines based on the tags, properties, + and TODO state associated with them, + + • a _text search view_ that shows all entries from multiple files + that contain specified keywords, + + • a _stuck projects view_ showing projects that currently do not move + along, and + + • _custom views_ that are special searches and combinations of + different views. + + The extracted information is displayed in a special _agenda buffer_. +This buffer is read-only, but provides commands to visit the +corresponding locations in the original Org files, and even to edit +these files remotely. + + By default, the report ignores commented (see *note Comment Lines::) +and archived (see *note Internal archiving::) entries. You can override +this by setting ‘org-agenda-skip-comment-trees’ and +‘org-agenda-skip-archived-trees’ to ‘nil’. + + Two variables control how the agenda buffer is displayed and whether +the window configuration is restored when the agenda exits: +‘org-agenda-window-setup’ and ‘org-agenda-restore-windows-after-quit’. + +* Menu: + +* Agenda Files:: Files being searched for agenda information. +* Agenda Dispatcher:: Keyboard access to agenda views. +* Built-in Agenda Views:: What is available out of the box? +* Presentation and Sorting:: How agenda items are prepared for display. +* Agenda Commands:: Remote editing of Org trees. +* Custom Agenda Views:: Defining special searches and views. +* Exporting Agenda Views:: Writing a view to a file. +* Agenda Column View:: Using column view for collected entries. + + +File: org, Node: Agenda Files, Next: Agenda Dispatcher, Up: Agenda Views + +10.1 Agenda Files +================= + +The information to be shown is normally collected from all _agenda +files_, the files listed in the variable ‘org-agenda-files’(1). If a +directory is part of this list, all files with the extension ‘.org’ in +this directory are part of the list. + + Thus, even if you only work with a single Org file, that file should +be put into the list(2). You can customize ‘org-agenda-files’, but the +easiest way to maintain it is through the following commands + +‘C-c [’ (‘org-agenda-file-to-front’) + Add current file to the list of agenda files. The file is added to + the front of the list. If it was already in the list, it is moved + to the front. With a prefix argument, file is added/moved to the + end. + +‘C-c ]’ (‘org-remove-file’) + Remove current file from the list of agenda files. + +‘C-'’ +‘C-,’ (‘org-cycle-agenda-files’) + Cycle through agenda file list, visiting one file after the other. + +‘M-x org-switchb’ + Command to use an iswitchb-like interface to switch to and between + Org buffers. + +The Org menu contains the current list of files and can be used to visit +any of them. + + If you would like to focus the agenda temporarily on a file not in +this list, or on just one file in the list, or even on only a subtree in +a file, then this can be done in different ways. For a single agenda +command, you may press ‘<’ once or several times in the dispatcher (see +*note Agenda Dispatcher::). To restrict the agenda scope for an +extended period, use the following commands: + +‘C-c C-x <’ (‘org-agenda-set-restriction-lock’) + Restrict the agenda to the current subtree. If there already is a + restriction at point, remove it. When called with a universal + prefix argument or with point before the first headline in a file, + set the agenda scope to the entire file. This restriction remains + in effect until removed with ‘C-c C-x >’, or by typing either ‘<’ + or ‘>’ in the agenda dispatcher. If there is a window displaying + an agenda view, the new restriction takes effect immediately. + +‘C-c C-x >’ (‘org-agenda-remove-restriction-lock’) + Remove the restriction created by ‘C-c C-x <’. + + When working with Speedbar, you can use the following commands in the +Speedbar frame: + +‘<’ (‘org-speedbar-set-agenda-restriction’) + Restrict the agenda to the item—either an Org file or a subtree in + such a file—at point in the Speedbar frame. If agenda is already + restricted there, remove the restriction. If there is a window + displaying an agenda view, the new restriction takes effect + immediately. + +‘>’ (‘org-agenda-remove-restriction-lock’) + Remove the restriction. + + ---------- Footnotes ---------- + + (1) If the value of that variable is not a list, but a single file +name, then the list of agenda files in maintained in that external file. + + (2) When using the dispatcher, pressing ‘<’ before selecting a +command actually limits the command to the current file, and ignores +‘org-agenda-files’ until the next dispatcher command. + + +File: org, Node: Agenda Dispatcher, Next: Built-in Agenda Views, Prev: Agenda Files, Up: Agenda Views + +10.2 The Agenda Dispatcher +========================== + +The views are created through a dispatcher, accessible with ‘M-x +org-agenda’, or, better, bound to a global key (see *note Activation::). +It displays a menu from which an additional letter is required to +execute a command. The dispatcher offers the following default +commands: + +‘a’ + Create the calendar-like agenda (see *note Weekly/daily agenda::). + +‘t’ or ‘T’ + Create a list of all TODO items (see *note Global TODO list::). + +‘m’ or ‘M’ + Create a list of headlines matching a given expression (see *note + Matching tags and properties::). + +‘s’ + Create a list of entries selected by a boolean expression of + keywords and/or regular expressions that must or must not occur in + the entry. + +‘/’ + Search for a regular expression in all agenda files and + additionally in the files listed in + ‘org-agenda-text-search-extra-files’. This uses the Emacs command + ‘multi-occur’. A prefix argument can be used to specify the number + of context lines for each match, default is + 1. +‘#’ or ‘!’ + Create a list of stuck projects (see *note Stuck projects::). + +‘<’ + Restrict an agenda command to the current buffer(1). After + pressing ‘<’, you still need to press the character selecting the + command. + +‘< <’ + If there is an active region, restrict the following agenda command + to the region. Otherwise, restrict it to the current subtree(2). + After pressing ‘< <’, you still need to press the character + selecting the command. + +‘*’ + Toggle sticky agenda views. By default, Org maintains only a + single agenda buffer and rebuilds it each time you change the view, + to make sure everything is always up to date. If you switch + between views often and the build time bothers you, you can turn on + sticky agenda buffers (make this the default by customizing the + variable ‘org-agenda-sticky’). With sticky agendas, the dispatcher + only switches to the selected view, you need to update it by hand + with ‘r’ or ‘g’. You can toggle sticky agenda view any time with + ‘org-toggle-sticky-agenda’. + + You can also define custom commands that are accessible through the +dispatcher, just like the default commands. This includes the +possibility to create extended agenda buffers that contain several +blocks together, for example the weekly agenda, the global TODO list and +a number of special tags matches. See *note Custom Agenda Views::. + + ---------- Footnotes ---------- + + (1) For backward compatibility, you can also press ‘1’ to restrict to +the current buffer. + + (2) For backward compatibility, you can also press ‘0’ to restrict to +the current region/subtree. + + +File: org, Node: Built-in Agenda Views, Next: Presentation and Sorting, Prev: Agenda Dispatcher, Up: Agenda Views + +10.3 The Built-in Agenda Views +============================== + +In this section we describe the built-in views. + +* Menu: + +* Weekly/daily agenda:: The calendar page with current tasks. +* Global TODO list:: All unfinished action items. +* Matching tags and properties:: Structured information with fine-tuned search. +* Search view:: Find entries by searching for text. +* Stuck projects:: Find projects you need to review. + + +File: org, Node: Weekly/daily agenda, Next: Global TODO list, Up: Built-in Agenda Views + +10.3.1 Weekly/daily agenda +-------------------------- + +The purpose of the weekly/daily _agenda_ is to act like a page of a +paper agenda, showing all the tasks for the current week or day. + +‘M-x org-agenda a’ (‘org-agenda-list’) + Compile an agenda for the current week from a list of Org files. + The agenda shows the entries for each day. With a numeric prefix + argument(1)—like ‘C-u 2 1 M-x org-agenda a’—you may set the number + of days to be displayed. + + The default number of days displayed in the agenda is set by the +variable ‘org-agenda-span’. This variable can be set to any number of +days you want to see by default in the agenda, or to a span name, such a +‘day’, ‘week’, ‘month’ or ‘year’. For weekly agendas, the default is to +start on the previous Monday (see ‘org-agenda-start-on-weekday’). You +can also set the start date using a date shift: ‘(setq +org-agenda-start-day "+10d")’ starts the agenda ten days from today in +the future. + + Remote editing from the agenda buffer means, for example, that you +can change the dates of deadlines and appointments from the agenda +buffer. The commands available in the Agenda buffer are listed in *note +Agenda Commands::. + +Calendar/Diary integration +.......................... + +Emacs contains the calendar and diary by Edward M. Reingold. The +calendar displays a three-month calendar with holidays from different +countries and cultures. The diary allows you to keep track of +anniversaries, lunar phases, sunrise/set, recurrent appointments +(weekly, monthly) and more. In this way, it is quite complementary to +Org. It can be very useful to combine output from Org with the diary. + + In order to include entries from the Emacs diary into Org mode’s +agenda, you only need to customize the variable + + (setq org-agenda-include-diary t) + +After that, everything happens automatically. All diary entries +including holidays, anniversaries, etc., are included in the agenda +buffer created by Org mode. ‘’, ‘’, and ‘’ can be used +from the agenda buffer to jump to the diary file in order to edit +existing diary entries. The ‘i’ command to insert new entries for the +current date works in the agenda buffer, as well as the commands ‘S’, +‘M’, and ‘C’ to display Sunrise/Sunset times, show lunar phases and to +convert to other calendars, respectively. ‘c’ can be used to switch +back and forth between calendar and agenda. + + If you are using the diary only for S-exp entries and holidays, it is +faster to not use the above setting, but instead to copy or even move +the entries into an Org file. Org mode evaluates diary-style sexp +entries, and does it faster because there is no overhead for first +creating the diary display. Note that the sexp entries must start at +the left margin, no whitespace is allowed before them, as seen in the +following segment of an Org file:(2) + + * Holidays + :PROPERTIES: + :CATEGORY: Holiday + :END: + %%(org-calendar-holiday) ; special function for holiday names + + * Birthdays + :PROPERTIES: + :CATEGORY: Ann + :END: + %%(org-anniversary 1956 5 14) Arthur Dent is %d years old + %%(org-anniversary 1869 10 2) Mahatma Gandhi would be %d years old + +Anniversaries from BBDB +....................... + +If you are using the Insidious Big Brother Database to store your +contacts, you very likely prefer to store anniversaries in BBDB rather +than in a separate Org or diary file. Org supports this and can show +BBDB anniversaries as part of the agenda. All you need to do is to add +the following to one of your agenda files: + + * Anniversaries + :PROPERTIES: + :CATEGORY: Anniv + :END: + %%(org-bbdb-anniversaries) + + You can then go ahead and define anniversaries for a BBDB record. +Basically, you need a field named ‘anniversary’ for the BBDB record +which contains the date in the format ‘YYYY-MM-DD’ or ‘MM-DD’, followed +by a space and the class of the anniversary (‘birthday’, ‘wedding’, or a +format string). If you omit the class, it defaults to ‘birthday’. Here +are a few examples, the header for the file ‘org-bbdb.el’ contains more +detailed information. + + 1973-06-22 + 06-22 + 1955-08-02 wedding + 2008-04-14 %s released version 6.01 of Org mode, %d years ago + + After a change to BBDB, or for the first agenda display during an +Emacs session, the agenda display suffers a short delay as Org updates +its hash with anniversaries. However, from then on things will be very +fast, much faster in fact than a long list of ‘%%(diary-anniversary)’ +entries in an Org or Diary file. + + If you would like to see upcoming anniversaries with a bit of +forewarning, you can use the following instead: + + * Anniversaries + :PROPERTIES: + :CATEGORY: Anniv + :END: + %%(org-bbdb-anniversaries-future 3) + + That will give you three days’ warning: on the anniversary date +itself and the two days prior. The argument is optional: if omitted, it +defaults to 7. + +Appointment reminders +..................... + +Org can interact with Emacs appointments notification facility. To add +the appointments of your agenda files, use the command +‘org-agenda-to-appt’. This command lets you filter through the list of +your appointments and add only those belonging to a specific category or +matching a regular expression. It also reads a ‘APPT_WARNTIME’ property +which overrides the value of ‘appt-message-warning-time’ for this +appointment. See the docstring for details. + + ---------- Footnotes ---------- + + (1) For backward compatibility, the universal prefix argument ‘C-u’ +causes all TODO entries to be listed before the agenda. This feature is +deprecated, use the dedicated TODO list, or a block agenda instead (see +*note Block agenda::). + + (2) The variable ‘org-anniversary’ used in the example is just like +‘diary-anniversary’, but the argument order is always according to ISO +and therefore independent of the value of ‘calendar-date-style’. + + +File: org, Node: Global TODO list, Next: Matching tags and properties, Prev: Weekly/daily agenda, Up: Built-in Agenda Views + +10.3.2 The global TODO list +--------------------------- + +The global TODO list contains all unfinished TODO items formatted and +collected into a single place. + +‘M-x org-agenda t’ (‘org-todo-list’) + Show the global TODO list. This collects the TODO items from all + agenda files (see *note Agenda Views::) into a single buffer. By + default, this lists items with a state the is not a DONE state. + The buffer is in ‘agenda-mode’, so there are commands to examine + and manipulate the TODO entries directly from that buffer (see + *note Agenda Commands::). + +‘M-x org-agenda T’ (‘org-todo-list’) + Like the above, but allows selection of a specific TODO keyword. + You can also do this by specifying a prefix argument to ‘t’. You + are prompted for a keyword, and you may also specify several + keywords by separating them with ‘|’ as the boolean OR operator. + With a numeric prefix, the Nth keyword in ‘org-todo-keywords’ is + selected. + + The ‘r’ key in the agenda buffer regenerates it, and you can give a + prefix argument to this command to change the selected TODO + keyword, for example ‘3 r’. If you often need a search for a + specific keyword, define a custom command for it (see *note Agenda + Dispatcher::). + + Matching specific TODO keywords can also be done as part of a tags + search (see *note Tag Searches::). + + Remote editing of TODO items means that you can change the state of a +TODO entry with a single key press. The commands available in the TODO +list are described in *note Agenda Commands::. + + Normally the global TODO list simply shows all headlines with TODO +keywords. This list can become very long. There are two ways to keep +it more compact: + + • Some people view a TODO item that has been _scheduled_ for + execution or have a _deadline_ (see *note Timestamps::) as no + longer _open_. Configure the variables + ‘org-agenda-todo-ignore-scheduled’, + ‘org-agenda-todo-ignore-deadlines’, + ‘org-agenda-todo-ignore-timestamp’ and/or + ‘org-agenda-todo-ignore-with-date’ to exclude such items from the + global TODO list. + + • TODO items may have sublevels to break up the task into subtasks. + In such cases it may be enough to list only the highest level TODO + headline and omit the sublevels from the global list. Configure + the variable ‘org-agenda-todo-list-sublevels’ to get this behavior. + + +File: org, Node: Matching tags and properties, Next: Search view, Prev: Global TODO list, Up: Built-in Agenda Views + +10.3.3 Matching tags and properties +----------------------------------- + +If headlines in the agenda files are marked with _tags_ (see *note +Tags::), or have properties (see *note Properties and Columns::), you +can select headlines based on this metadata and collect them into an +agenda buffer. The match syntax described here also applies when +creating sparse trees with ‘C-c / m’. + +‘M-x org-agenda m’ (‘org-tags-view’) + Produce a list of all headlines that match a given set of tags. + The command prompts for a selection criterion, which is a boolean + logic expression with tags, like ‘+work+urgent-withboss’ or + ‘work|home’ (see *note Tags::). If you often need a specific + search, define a custom command for it (see *note Agenda + Dispatcher::). + +‘M-x org-agenda M’ (‘org-tags-view’) + Like ‘m’, but only select headlines that are also TODO items and + force checking subitems (see the variable + ‘org-tags-match-list-sublevels’). To exclude scheduled/deadline + items, see the variable + ‘org-agenda-tags-todo-honor-ignore-options’. Matching specific + TODO keywords together with a tags match is also possible, see + *note Tag Searches::. + + The commands available in the tags list are described in *note Agenda +Commands::. + + A search string can use Boolean operators ‘&’ for AND and ‘|’ for OR. +‘&’ binds more strongly than ‘|’. Parentheses are currently not +implemented. Each element in the search is either a tag, a regular +expression matching tags, or an expression like ‘PROPERTY OPERATOR +VALUE’ with a comparison operator, accessing a property value. Each +element may be preceded by ‘-’ to select against it, and ‘+’ is +syntactic sugar for positive selection. The AND operator ‘&’ is +optional when ‘+’ or ‘-’ is present. Here are some examples, using only +tags. + +‘+work-boss’ + Select headlines tagged ‘work’, but discard those also tagged + ‘boss’. + +‘work|laptop’ + Selects lines tagged ‘work’ or ‘laptop’. + +‘work|laptop+night’ + Like before, but require the ‘laptop’ lines to be tagged also + ‘night’. + + Instead of a tag, you may also specify a regular expression enclosed +in curly braces. For example, ‘work+{^boss.*}’ matches headlines that +contain the tag ‘:work:’ and any tag _starting_ with ‘boss’. + + Group tags (see *note Tag Hierarchy::) are expanded as regular +expressions. E.g., if ‘work’ is a group tag for the group +‘:work:lab:conf:’, then searching for ‘work’ also searches for +‘{\(?:work\|lab\|conf\)}’ and searching for ‘-work’ searches for all +headlines but those with one of the tags in the group (i.e., +‘-{\(?:work\|lab\|conf\)}’). + + You may also test for properties (see *note Properties and Columns::) +at the same time as matching tags. The properties may be real +properties, or special properties that represent other metadata (see +*note Special Properties::). For example, the property ‘TODO’ +represents the TODO keyword of the entry. Or, the property ‘LEVEL’ +represents the level of an entry. So searching +‘+LEVEL=3+boss-TODO​="DONE"’ lists all level three headlines that have +the tag ‘boss’ and are _not_ marked with the TODO keyword ‘DONE’. In +buffers with ‘org-odd-levels-only’ set, ‘LEVEL’ does not count the +number of stars, but ‘LEVEL=2’ corresponds to 3 stars etc. + + Here are more examples: + +‘work+TODO​="WAITING"’ + Select ‘work’-tagged TODO lines with the specific TODO keyword + ‘WAITING’. + +‘work+TODO​="WAITING"|home+TODO​="WAITING"’ + Waiting tasks both at work and at home. + + When matching properties, a number of different operators can be used +to test the value of a property. Here is a complex example: + + +work-boss+PRIORITY="A"+Coffee="unlimited"+Effort<2 + +With={Sarah|Denny}+SCHEDULED>="<2008-10-11>" + +The type of comparison depends on how the comparison value is written: + + • If the comparison value is a plain number, a numerical comparison + is done, and the allowed operators are ‘<’, ‘=’, ‘>’, ‘<=’, ‘>=’, + and ‘<>’. + + • If the comparison value is enclosed in double-quotes, a string + comparison is done, and the same operators are allowed. + + • If the comparison value is enclosed in double-quotes _and_ angular + brackets (like ‘DEADLINE<​="<2008-12-24 18:30>"’), both values are + assumed to be date/time specifications in the standard Org way, and + the comparison is done accordingly. Valid values also include + ‘""’ for now (including time), ‘""’, and ‘""’ + for these days at 0:00 hours, i.e., without a time specification. + You can also use strings like ‘"<+5d>"’ or ‘"<-2m>"’ with units + ‘d’, ‘w’, ‘m’, and ‘y’ for day, week, month, and year, + respectively. + + • If the comparison value is enclosed in curly braces, a regexp match + is performed, with ‘=’ meaning that the regexp matches the property + value, and ‘<>’ meaning that it does not match. + + So the search string in the example finds entries tagged ‘work’ but +not ‘boss’, which also have a priority value ‘A’, a ‘Coffee’ property +with the value ‘unlimited’, an ‘EFFORT’ property that is numerically +smaller than 2, a ‘With’ property that is matched by the regular +expression ‘Sarah|Denny’, and that are scheduled on or after October 11, +2008. + + You can configure Org mode to use property inheritance during a +search, but beware that this can slow down searches considerably. See +*note Property Inheritance::, for details. + + For backward compatibility, and also for typing speed, there is also +a different way to test TODO states in a search. For this, terminate +the tags/property part of the search string (which may include several +terms connected with ‘|’) with a ‘/’ and then specify a Boolean +expression just for TODO keywords. The syntax is then similar to that +for tags, but should be applied with care: for example, a positive +selection on several TODO keywords cannot meaningfully be combined with +boolean AND. However, _negative selection_ combined with AND can be +meaningful. To make sure that only lines are checked that actually have +any TODO keyword (resulting in a speed-up), use ‘M-x org-agenda M’, or +equivalently start the TODO part after the slash with ‘!’. Using ‘M-x +org-agenda M’ or ‘/!’ does not match TODO keywords in a DONE state. +Examples: + +‘work/WAITING’ + Same as ‘work+TODO​="WAITING"’. + +‘work/!-WAITING-NEXT’ + Select ‘work’-tagged TODO lines that are neither ‘WAITING’ nor + ‘NEXT’. + +‘work/!+WAITING|+NEXT’ + Select ‘work’-tagged TODO lines that are either ‘WAITING’ or + ‘NEXT’. + + +File: org, Node: Search view, Next: Stuck projects, Prev: Matching tags and properties, Up: Built-in Agenda Views + +10.3.4 Search view +------------------ + +This agenda view is a general text search facility for Org mode entries. +It is particularly useful to find notes. + +‘M-x org-agenda s’ (‘org-search-view’) + This is a special search that lets you select entries by matching a + substring or specific words using a boolean logic. + + For example, the search string ‘computer equipment’ matches entries +that contain ‘computer equipment’ as a substring, even if the two words +are separated by more space or a line break. + + Search view can also search for specific keywords in the entry, using +Boolean logic. The search string ‘+computer +wifi -ethernet +-{8\.11[bg]}’ matches note entries that contain the keywords ‘computer’ +and ‘wifi’, but not the keyword ‘ethernet’, and which are also not +matched by the regular expression ‘8\.11[bg]’, meaning to exclude both +‘8.11b’ and ‘8.11g’. The first ‘+’ is necessary to turn on boolean +search, other ‘+’ characters are optional. For more details, see the +docstring of the command ‘org-search-view’. + + You can incrementally adjust a boolean search with the following keys + +‘[’ Add a positive search word +‘]’ Add a negative search word +‘{’ Add a positive regular expression +‘}’ Add a negative regular expression + + Note that in addition to the agenda files, this command also searches +the files listed in ‘org-agenda-text-search-extra-files’. + + +File: org, Node: Stuck projects, Prev: Search view, Up: Built-in Agenda Views + +10.3.5 Stuck projects +--------------------- + +If you are following a system like David Allen’s GTD to organize your +work, one of the “duties” you have is a regular review to make sure that +all projects move along. A _stuck_ project is a project that has no +defined next actions, so it never shows up in the TODO lists Org mode +produces. During the review, you need to identify such projects and +define next actions for them. + +‘M-x org-agenda #’ (‘org-agenda-list-stuck-projects’) + List projects that are stuck. + +‘M-x org-agenda !’ + Customize the variable ‘org-stuck-projects’ to define what a stuck + project is and how to find it. + + You almost certainly need to configure this view before it works for +you. The built-in default assumes that all your projects are level-2 +headlines, and that a project is not stuck if it has at least one entry +marked with a TODO keyword ‘TODO’ or ‘NEXT’ or ‘NEXTACTION’. + + Let’s assume that you, in your own way of using Org mode, identify +projects with a tag ‘:PROJECT:’, and that you use a TODO keyword ‘MAYBE’ +to indicate a project that should not be considered yet. Let’s further +assume that the TODO keyword ‘DONE’ marks finished projects, and that +‘NEXT’ and ‘TODO’ indicate next actions. The tag ‘:@shop:’ indicates +shopping and is a next action even without the NEXT tag. Finally, if +the project contains the special word ‘IGNORE’ anywhere, it should not +be listed either. In this case you would start by identifying eligible +projects with a tags/TODO match (see *note Tag Searches::) +‘+PROJECT/-MAYBE-DONE’, and then check for ‘TODO’, ‘NEXT’, ‘@shop’, and +‘IGNORE’ in the subtree to identify projects that are not stuck. The +correct customization for this is: + + (setq org-stuck-projects + '("+PROJECT/-MAYBE-DONE" ("NEXT" "TODO") ("@shop") + "\\")) + + Note that if a project is identified as non-stuck, the subtree of +this entry is searched for stuck projects. + + +File: org, Node: Presentation and Sorting, Next: Agenda Commands, Prev: Built-in Agenda Views, Up: Agenda Views + +10.4 Presentation and Sorting +============================= + +Before displaying items in an agenda view, Org mode visually prepares +the items and sorts them. Each item occupies a single line. The line +starts with a _prefix_ that contains the _category_ (see *note +Categories::) of the item and other important information. You can +customize in which column tags are displayed through +‘org-agenda-tags-column’. You can also customize the prefix using the +option ‘org-agenda-prefix-format’. This prefix is followed by a +cleaned-up version of the outline headline associated with the item. + +* Menu: + +* Categories:: Not all tasks are equal. +* Time-of-day specifications:: How the agenda knows the time. +* Sorting of agenda items:: The order of things. +* Filtering/limiting agenda times:: Dynamically narrow the agenda. + + +File: org, Node: Categories, Next: Time-of-day specifications, Up: Presentation and Sorting + +10.4.1 Categories +----------------- + +The category is a broad label assigned to each agenda item. By default, +the category is simply derived from the file name, but you can also +specify it with a special line in the buffer, like this: + + #+CATEGORY: Thesis + + If you would like to have a special category for a single entry or a +(sub)tree, give the entry a ‘CATEGORY’ property with the special +category you want to apply as the value. + + The display in the agenda buffer looks best if the category is not +longer than 10 characters. + + You can set up icons for category by customizing the +‘org-agenda-category-icon-alist’ variable. + + +File: org, Node: Time-of-day specifications, Next: Sorting of agenda items, Prev: Categories, Up: Presentation and Sorting + +10.4.2 Time-of-day specifications +--------------------------------- + +Org mode checks each agenda item for a time-of-day specification. The +time can be part of the timestamp that triggered inclusion into the +agenda, for example + + <2005-05-10 Tue 19:00> + +Time ranges can be specified with two timestamps: + + <2005-05-10 Tue 20:30>--<2005-05-10 Tue 22:15> + + In the headline of the entry itself, a time(range)—like ‘12:45’ or a +‘8:30-1pm’—may also appear as plain text(1). + + If the agenda integrates the Emacs diary (see *note Weekly/daily +agenda::), time specifications in diary entries are recognized as well. + + For agenda display, Org mode extracts the time and displays it in a +standard 24 hour format as part of the prefix. The example times in the +previous paragraphs would end up in the agenda like this: + + 8:30-13:00 Arthur Dent lies in front of the bulldozer + 12:45...... Ford Prefect arrives and takes Arthur to the pub + 19:00...... The Vogon reads his poem + 20:30-22:15 Marvin escorts the Hitchhikers to the bridge + + If the agenda is in single-day mode, or for the display of today, the +timed entries are embedded in a time grid, like + + 8:00...... ------------------ + 8:30-13:00 Arthur Dent lies in front of the bulldozer + 10:00...... ------------------ + 12:00...... ------------------ + 12:45...... Ford Prefect arrives and takes Arthur to the pub + 14:00...... ------------------ + 16:00...... ------------------ + 18:00...... ------------------ + 19:00...... The Vogon reads his poem + 20:00...... ------------------ + 20:30-22:15 Marvin escorts the Hitchhikers to the bridge + + The time grid can be turned on and off with the variable +‘org-agenda-use-time-grid’, and can be configured with +‘org-agenda-time-grid’. + + ---------- Footnotes ---------- + + (1) You can, however, disable this by setting +‘org-agenda-search-headline-for-time’ variable to a ‘nil’ value. + + +File: org, Node: Sorting of agenda items, Next: Filtering/limiting agenda times, Prev: Time-of-day specifications, Up: Presentation and Sorting + +10.4.3 Sorting of agenda items +------------------------------ + +Before being inserted into a view, the items are sorted. How this is +done depends on the type of view. + + • For the daily/weekly agenda, the items for each day are sorted. + The default order is to first collect all items containing an + explicit time-of-day specification. These entries are shown at the + beginning of the list, as a _schedule_ for the day. After that, + items remain grouped in categories, in the sequence given by + ‘org-agenda-files’. Within each category, items are sorted by + priority (see *note Priorities::), which is composed of the base + priority (2000 for priority ‘A’, 1000 for ‘B’, and 0 for ‘C’), plus + additional increments for overdue scheduled or deadline items. + + • For the TODO list, items remain in the order of categories, but + within each category, sorting takes place according to priority + (see *note Priorities::). The priority used for sorting derives + from the priority cookie, with additions depending on how close an + item is to its due or scheduled date. + + • For tags matches, items are not sorted at all, but just appear in + the sequence in which they are found in the agenda files. + + Sorting can be customized using the variable +‘org-agenda-sorting-strategy’, and may also include criteria based on +the estimated effort of an entry (see *note Effort Estimates::). + + +File: org, Node: Filtering/limiting agenda times, Prev: Sorting of agenda items, Up: Presentation and Sorting + +10.4.4 Filtering/limiting agenda times +-------------------------------------- + +Agenda built-in or customized commands are statically defined. Agenda +filters and limits provide two ways of dynamically narrowing down the +list of agenda entries: _filters_ and _limits_. Filters only act on the +display of the items, while limits take effect before the list of agenda +entries is built. Filters are more often used interactively, while +limits are mostly useful when defined as local variables within custom +agenda commands. + +Filtering in the agenda +....................... + +‘/’ (‘org-agenda-filter-by-tag’) + Filter the agenda view with respect to a tag and/or effort + estimates. The difference between this and a custom agenda command + is that filtering is very fast, so that you can switch quickly + between different filters without having to recreate the agenda.(1) + + You are prompted for a tag selection letter; ‘’ means any tag + at all. Pressing ‘’ at that prompt offers completion to + select a tag, including any tags that do not have a selection + character. The command then hides all entries that do not contain + or inherit this tag. When called with prefix argument, remove the + entries that _do_ have the tag. A second ‘/’ at the prompt turns + off the filter and shows any hidden entries. Pressing ‘+’ or ‘-’ + switches between filtering and excluding the next tag. + + Org also supports automatic, context-aware tag filtering. If the + variable ‘org-agenda-auto-exclude-function’ is set to a + user-defined function, that function can decide which tags should + be excluded from the agenda automatically. Once this is set, the + ‘/’ command then accepts ‘’ as a sub-option key and runs the + auto exclusion logic. For example, let’s say you use a ‘Net’ tag + to identify tasks which need network access, an ‘Errand’ tag for + errands in town, and a ‘Call’ tag for making phone calls. You + could auto-exclude these tags based on the availability of the + Internet, and outside of business hours, with something like this: + + (defun org-my-auto-exclude-function (tag) + (and (cond + ((string= tag "Net") + (/= 0 (call-process "/sbin/ping" nil nil nil + "-c1" "-q" "-t1" "mail.gnu.org"))) + ((or (string= tag "Errand") (string= tag "Call")) + (let ((hour (nth 2 (decode-time)))) + (or (< hour 8) (> hour 21))))) + (concat "-" tag))) + + (setq org-agenda-auto-exclude-function 'org-my-auto-exclude-function) + +‘<’ (‘org-agenda-filter-by-category’) + Filter the current agenda view with respect to the category of the + item at point. Pressing ‘<’ another time removes this filter. + When called with a prefix argument exclude the category of the item + at point from the agenda. + + You can add a filter preset in custom agenda commands through the + option ‘org-agenda-category-filter-preset’. See *note Setting + options::. + +‘^’ (‘org-agenda-filter-by-top-headline’) + Filter the current agenda view and only display the siblings and + the parent headline of the one at point. + +‘=’ (‘org-agenda-filter-by-regexp’) + Filter the agenda view by a regular expression: only show agenda + entries matching the regular expression the user entered. When + called with a prefix argument, it filters _out_ entries matching + the regexp. Called in a regexp-filtered agenda view, remove the + filter, unless there are two universal prefix arguments, in which + case filters are cumulated. + + You can add a filter preset in custom agenda commands through the + option ‘org-agenda-regexp-filter-preset’. See *note Setting + options::. + +‘_’ (‘org-agenda-filter-by-effort’) + Filter the agenda view with respect to effort estimates. You first + need to set up allowed efforts globally, for example + + (setq org-global-properties + '(("Effort_ALL". "0 0:10 0:30 1:00 2:00 3:00 4:00"))) + + You can then filter for an effort by first typing an operator, one + of ‘<’, ‘>’ and ‘=’, and then the one-digit index of an effort + estimate in your array of allowed values, where ‘0’ means the 10th + value. The filter then restricts to entries with effort + smaller-or-equal, equal, or larger-or-equal than the selected + value. For application of the operator, entries without a defined + effort are treated according to the value of + ‘org-sort-agenda-noeffort-is-high’. + + When called with a prefix argument, it removes entries matching the + condition. With two universal prefix arguments, it clears effort + filters, which can be accumulated. + + You can add a filter preset in custom agenda commands through the + option ‘org-agenda-effort-filter-preset’. See *note Setting + options::. + +‘|’ (‘org-agenda-filter-remove-all’) + Remove all filters in the current agenda view. + +Setting limits for the agenda +............................. + +Here is a list of options that you can set, either globally, or locally +in your custom agenda views (see *note Custom Agenda Views::). + +‘org-agenda-max-entries’ + Limit the number of entries. + +‘org-agenda-max-effort’ + Limit the duration of accumulated efforts (as minutes). + +‘org-agenda-max-todos’ + Limit the number of entries with TODO keywords. + +‘org-agenda-max-tags’ + Limit the number of tagged entries. + + When set to a positive integer, each option excludes entries from +other categories: for example, ‘(setq org-agenda-max-effort 100)’ limits +the agenda to 100 minutes of effort and exclude any entry that has no +effort property. If you want to include entries with no effort +property, use a negative value for ‘org-agenda-max-effort’. One useful +setup is to use ‘org-agenda-max-entries’ locally in a custom command. +For example, this custom command displays the next five entries with a +‘NEXT’ TODO keyword. + + (setq org-agenda-custom-commands + '(("n" todo "NEXT" + ((org-agenda-max-entries 5))))) + + Once you mark one of these five entry as DONE, rebuilding the agenda +will again the next five entries again, including the first entry that +was excluded so far. + + You can also dynamically set temporary limits, which are lost when +rebuilding the agenda: + +‘~’ (‘org-agenda-limit-interactively’) + This prompts for the type of limit to apply and its value. + + ---------- Footnotes ---------- + + (1) Custom commands can preset a filter by binding the variable +‘org-agenda-tag-filter-preset’ as an option. This filter is then +applied to the view and persists as a basic filter through refreshes and +more secondary filtering. The filter is a global property of the entire +agenda view—in a block agenda, you should only set this in the global +options section, not in the section of an individual block. + + +File: org, Node: Agenda Commands, Next: Custom Agenda Views, Prev: Presentation and Sorting, Up: Agenda Views + +10.5 Commands in the Agenda Buffer +================================== + +Entries in the agenda buffer are linked back to the Org file or diary +file where they originate. You are not allowed to edit the agenda +buffer itself, but commands are provided to show and jump to the +original entry location, and to edit the Org files “remotely” from the +agenda buffer. In this way, all information is stored only once, +removing the risk that your agenda and note files may diverge. + + Some commands can be executed with mouse clicks on agenda lines. For +the other commands, point needs to be in the desired line. + +Motion +------ + +‘n’ (‘org-agenda-next-line’) + Next line (same as ‘’ and ‘C-n’). + +‘p’ (‘org-agenda-previous-line’) + Previous line (same as ‘’ and ‘C-p’). + +View/Go to Org file +------------------- + +‘’ or ‘mouse-3’ (‘org-agenda-show-and-scroll-up’) + Display the original location of the item in another window. With + a prefix argument, make sure that drawers stay folded. + +‘L’ (‘org-agenda-recenter’) + Display original location and recenter that window. + +‘’ or ‘mouse-2’ (‘org-agenda-goto’) + Go to the original location of the item in another window. + +‘’ (‘org-agenda-switch-to’) + Go to the original location of the item and delete other windows. + +‘F’ (‘org-agenda-follow-mode’) + Toggle Follow mode. In Follow mode, as you move point through the + agenda buffer, the other window always shows the corresponding + location in the Org file. The initial setting for this mode in new + agenda buffers can be set with the variable + ‘org-agenda-start-with-follow-mode’. + +‘C-c C-x b’ (‘org-agenda-tree-to-indirect-buffer’) + Display the entire subtree of the current item in an indirect + buffer. With a numeric prefix argument N, go up to level N and + then take that tree. If N is negative, go up that many levels. + With a ‘C-u’ prefix, do not remove the previously used indirect + buffer. + +‘C-c C-o’ (‘org-agenda-open-link’) + Follow a link in the entry. This offers a selection of any links + in the text belonging to the referenced Org node. If there is only + one link, follow it without a selection prompt. + +Change display +-------------- + +‘A’ + Interactively select another agenda view and append it to the + current view. + +‘o’ + Delete other windows. + +‘v d’ or short ‘d’ (‘org-agenda-day-view’) + Switch to day view. When switching to day view, this setting + becomes the default for subsequent agenda refreshes. A numeric + prefix argument may be used to jump directly to a specific day of + the year. For example, ‘32 d’ jumps to February 1st. When setting + day view, a year may be encoded in the prefix argument as well. + For example, ‘200712 d’ jumps to January 12, 2007. If such a year + specification has only one or two digits, it is expanded into one + of the 30 next years or the last 69 years. + +‘v w’ or short ‘w’ (‘org-agenda-week-view’) + Switch to week view. When switching week view, this setting + becomes the default for subsequent agenda refreshes. A numeric + prefix argument may be used to jump directly to a specific day of + the ISO week. For example ‘9 w’ to ISO week number 9. When + setting week view, a year may be encoded in the prefix argument as + well. For example, ‘200712 w’ jumps to week 12 in 2007. If such a + year specification has only one or two digits, it is expanded into + one of the 30 next years or the last 69 years. + +‘v m’ (‘org-agenda-month-view’) + Switch to month view. Because month views are slow to create, they + do not become the default for subsequent agenda refreshes. A + numeric prefix argument may be used to jump directly to a specific + day of the month. When setting month view, a year may be encoded + in the prefix argument as well. For example, ‘200712 m’ jumps to + December, 2007. If such a year specification has only one or two + digits, it is expanded into one of the 30 next years or the last 69 + years. + +‘v y’ (‘org-agenda-year-view’) + Switch to year view. Because year views are slow to create, they + do not become the default for subsequent agenda refreshes. A + numeric prefix argument may be used to jump directly to a specific + day of the year. + +‘v ’ (‘org-agenda-reset-view’) + Reset the current view to ‘org-agenda-span’. + +‘f’ (‘org-agenda-later’) + Go forward in time to display the span following the current one. + For example, if the display covers a week, switch to the following + week. With a prefix argument, repeat that many times. + +‘b’ (‘org-agenda-earlier’) + Go backward in time to display earlier dates. + +‘.’ (‘org-agenda-goto-today’) + Go to today. + +‘j’ (‘org-agenda-goto-date’) + Prompt for a date and go there. + +‘J’ (‘org-agenda-clock-goto’) + Go to the currently clocked-in task _in the agenda buffer_. + +‘D’ (‘org-agenda-toggle-diary’) + Toggle the inclusion of diary entries. See *note Weekly/daily + agenda::. + +‘v l’ or ‘v L’ or short ‘l’ (‘org-agenda-log-mode’) + Toggle Logbook mode. In Logbook mode, entries that were marked + DONE while logging was on (see the variable ‘org-log-done’) are + shown in the agenda, as are entries that have been clocked on that + day. You can configure the entry types that should be included in + log mode using the variable ‘org-agenda-log-mode-items’. When + called with a ‘C-u’ prefix, show all possible logbook entries, + including state changes. When called with two prefix arguments + ‘C-u C-u’, show only logging information, nothing else. ‘v L’ is + equivalent to ‘C-u v l’. + +‘v [’ or short ‘[’ (‘org-agenda-manipulate-query-add’) + Include inactive timestamps into the current view. Only for + weekly/daily agenda. + +‘v a’ (‘org-agenda-archives-mode’) + Toggle Archives mode. In Archives mode, trees that are archived + (see *note Internal archiving::) are also scanned when producing + the agenda. To exit archives mode, press ‘v a’ again. + +‘v A’ + Toggle Archives mode. Include all archive files as well. + +‘v R’ or short ‘R’ (‘org-agenda-clockreport-mode’) + Toggle Clockreport mode. In Clockreport mode, the daily/weekly + agenda always shows a table with the clocked times for the time + span and file scope covered by the current agenda view. The + initial setting for this mode in new agenda buffers can be set with + the variable ‘org-agenda-start-with-clockreport-mode’. By using a + prefix argument when toggling this mode (i.e., ‘C-u R’), the clock + table does not show contributions from entries that are hidden by + agenda filtering(1). See also the variable + ‘org-clock-report-include-clocking-task’. + +‘v c’ + Show overlapping clock entries, clocking gaps, and other clocking + problems in the current agenda range. You can then visit clocking + lines and fix them manually. See the variable + ‘org-agenda-clock-consistency-checks’ for information on how to + customize the definition of what constituted a clocking problem. + To return to normal agenda display, press ‘l’ to exit Logbook mode. + +‘v E’ or short ‘E’ (‘org-agenda-entry-text-mode’) + Toggle entry text mode. In entry text mode, a number of lines from + the Org outline node referenced by an agenda line are displayed + below the line. The maximum number of lines is given by the + variable ‘org-agenda-entry-text-maxlines’. Calling this command + with a numeric prefix argument temporarily modifies that number to + the prefix value. + +‘G’ (‘org-agenda-toggle-time-grid’) + Toggle the time grid on and off. See also the variables + ‘org-agenda-use-time-grid’ and ‘org-agenda-time-grid’. + +‘r’ (‘org-agenda-redo’) +‘g’ + Recreate the agenda buffer, for example to reflect the changes + after modification of the timestamps of items with ‘S-’ and + ‘S-’. When the buffer is the global TODO list, a prefix + argument is interpreted to create a selective list for a specific + TODO keyword. + +‘C-x C-s’ or short ‘s’ (‘org-save-all-org-buffers’) + Save all Org buffers in the current Emacs session, and also the + locations of IDs. + +‘C-c C-x C-c’ (‘org-agenda-columns’) + Invoke column view (see *note Column View::) in the agenda buffer. + The column view format is taken from the entry at point, or, if + there is no entry at point, from the first entry in the agenda + view. So whatever the format for that entry would be in the + original buffer (taken from a property, from a ‘COLUMNS’ keyword, + or from the default variable ‘org-columns-default-format’) is used + in the agenda. + +‘C-c C-x >’ (‘org-agenda-remove-restriction-lock’) + Remove the restriction lock on the agenda, if it is currently + restricted to a file or subtree (see *note Agenda Files::). + +‘M-’ (‘org-agenda-drag-line-backward’) + Drag the line at point backward one line. With a numeric prefix + argument, drag backward by that many lines. + + Moving agenda lines does not persist after an agenda refresh and + does not modify the contributing Org files. + +‘M-’ (‘org-agenda-drag-line-forward’) + Drag the line at point forward one line. With a numeric prefix + argument, drag forward by that many lines. + +Remote editing +-------------- + +‘0--9’ + Digit argument. + +‘C-_’ (‘org-agenda-undo’) + Undo a change due to a remote editing command. The change is + undone both in the agenda buffer and in the remote buffer. + +‘t’ (‘org-agenda-todo’) + Change the TODO state of the item, both in the agenda and in the + original Org file. + +‘C-S-’ (‘org-agenda-todo-nextset’) + Switch to the next set of TODO keywords. + +‘C-S-’, ‘org-agenda-todo-previousset’ + Switch to the previous set of TODO keywords. + +‘C-k’ (‘org-agenda-kill’) + Delete the current agenda item along with the entire subtree + belonging to it in the original Org file. If the text to be + deleted remotely is longer than one line, the kill needs to be + confirmed by the user. See variable ‘org-agenda-confirm-kill’. + +‘C-c C-w’ (‘org-agenda-refile’) + Refile the entry at point. + +‘C-c C-x C-a’ or short ‘a’ (‘org-agenda-archive-default-with-confirmation’) + Archive the subtree corresponding to the entry at point using the + default archiving command set in ‘org-archive-default-command’. + When using the ‘a’ key, confirmation is required. + +‘C-c C-x a’ (‘org-agenda-toggle-archive-tag’) + Toggle the archive tag (see *note Internal archiving::) for the + current headline. + +‘C-c C-x A’ (‘org-agenda-archive-to-archive-sibling’) + Move the subtree corresponding to the current entry to its _archive + sibling_. + +‘C-c C-x C-s’ or short ‘$’ (‘org-agenda-archive’) + Archive the subtree corresponding to the current headline. This + means the entry is moved to the configured archive location, most + likely a different file. + +‘T’ (‘org-agenda-show-tags’) + Show all tags associated with the current item. This is useful if + you have turned off ‘org-agenda-show-inherited-tags’, but still + want to see all tags of a headline occasionally. + +‘:’ (‘org-agenda-set-tags’) + Set tags for the current headline. If there is an active region in + the agenda, change a tag for all headings in the region. + +‘,’ (‘org-agenda-priority’) + Set the priority for the current item. Org mode prompts for the + priority character. If you reply with ‘’, the priority cookie + is removed from the entry. + +‘P’ (‘org-agenda-show-priority’) + Display weighted priority of current item. + +‘+’ or ‘S-’ (‘org-agenda-priority-up’) + Increase the priority of the current item. The priority is changed + in the original buffer, but the agenda is not resorted. Use the + ‘r’ key for this. + +‘-’ or ‘S-’ (‘org-agenda-priority-down’) + Decrease the priority of the current item. + +‘C-c C-z’ or short ‘z’ (‘org-agenda-add-note’) + Add a note to the entry. This note is recorded, and then filed to + the same location where state change notes are put. Depending on + ‘org-log-into-drawer’, this may be inside a drawer. + +‘C-c C-a’ (‘org-attach’) + Dispatcher for all command related to attachments. + +‘C-c C-s’ (‘org-agenda-schedule’) + Schedule this item. With a prefix argument, remove the scheduling + timestamp + +‘C-c C-d’ (‘org-agenda-deadline’) + Set a deadline for this item. With a prefix argument, remove the + deadline. + +‘S-’ (‘org-agenda-do-date-later’) + Change the timestamp associated with the current line by one day + into the future. If the date is in the past, the first call to + this command moves it to today. With a numeric prefix argument, + change it by that many days. For example, ‘3 6 5 S-’ + changes it by a year. With a ‘C-u’ prefix, change the time by one + hour. If you immediately repeat the command, it will continue to + change hours even without the prefix argument. With a double ‘C-u + C-u’ prefix, do the same for changing minutes. The stamp is + changed in the original Org file, but the change is not directly + reflected in the agenda buffer. Use ‘r’ or ‘g’ to update the + buffer. + +‘S-’ (‘org-agenda-do-date-earlier’) + Change the timestamp associated with the current line by one day + into the past. + +‘>’ (‘org-agenda-date-prompt’) + Change the timestamp associated with the current line. The key ‘>’ + has been chosen, because it is the same as ‘S-.’ on my keyboard. + +‘I’ (‘org-agenda-clock-in’) + Start the clock on the current item. If a clock is running + already, it is stopped first. + +‘O’ (‘org-agenda-clock-out’) + Stop the previously started clock. + +‘X’ (‘org-agenda-clock-cancel’) + Cancel the currently running clock. + +‘J’ (‘org-agenda-clock-goto’) + Jump to the running clock in another window. + +‘k’ (‘org-agenda-capture’) + Like ‘org-capture’, but use the date at point as the default date + for the capture template. See ‘org-capture-use-agenda-date’ to + make this the default behavior of ‘org-capture’. + +Bulk remote editing selected entries +------------------------------------ + +‘m’ (‘org-agenda-bulk-mark’) + + Mark the entry at point for bulk action. If there is an active + region in the agenda, mark the entries in the region. With numeric + prefix argument, mark that many successive entries. + +‘*’ (‘org-agenda-bulk-mark-all’) + + Mark all visible agenda entries for bulk action. + +‘u’ (‘org-agenda-bulk-unmark’) + + Unmark entry for bulk action. + +‘U’ (‘org-agenda-bulk-remove-all-marks’) + + Unmark all marked entries for bulk action. + +‘M-m’ (‘org-agenda-bulk-toggle’) + + Toggle mark of the entry at point for bulk action. + +‘M-*’ (‘org-agenda-bulk-toggle-all’) + + Toggle mark of every entry for bulk action. + +‘%’ (‘org-agenda-bulk-mark-regexp’) + + Mark entries matching a regular expression for bulk action. + +‘B’ (‘org-agenda-bulk-action’) + + Bulk action: act on all marked entries in the agenda. This prompts + for another key to select the action to be applied. The prefix + argument to ‘B’ is passed through to the ‘s’ and ‘d’ commands, to + bulk-remove these special timestamps. By default, marks are + removed after the bulk. If you want them to persist, set + ‘org-agenda-bulk-persistent-marks’ to ‘t’ or hit ‘p’ at the prompt. + + ‘*’ + Toggle persistent marks. + + ‘$’ + Archive all selected entries. + + ‘A’ + Archive entries by moving them to their respective archive + siblings. + + ‘t’ + Change TODO state. This prompts for a single TODO keyword and + changes the state of all selected entries, bypassing blocking + and suppressing logging notes—but not timestamps. + + ‘+’ + Add a tag to all selected entries. + + ‘-’ + Remove a tag from all selected entries. + + ‘s’ + Schedule all items to a new date. To shift existing schedule + dates by a fixed number of days, use something starting with + double plus at the prompt, for example ‘++8d’ or ‘++2w’. + + ‘d’ + Set deadline to a specific date. + + ‘r’ + Prompt for a single refile target and move all entries. The + entries are no longer in the agenda; refresh (‘g’) to bring + them back. + + ‘S’ + Reschedule randomly into the coming N days. N is prompted + for. With a prefix argument (‘C-u B S’), scatter only across + weekdays. + + ‘f’ + Apply a function(2) to marked entries. For example, the + function below sets the ‘CATEGORY’ property of the entries to + ‘web’. + + (defun set-category () + (interactive "P") + (let ((marker (or (org-get-at-bol 'org-hd-marker) + (org-agenda-error)))) + (org-with-point-at marker + (org-back-to-heading t) + (org-set-property "CATEGORY" "web")))) + +Calendar commands +----------------- + +‘c’ (‘org-agenda-goto-calendar’) + Open the Emacs calendar and go to the date at point in the agenda. + +‘c’ (‘org-calendar-goto-agenda’) + When in the calendar, compute and show the Org agenda for the date + at point. + +‘i’ (‘org-agenda-diary-entry’) + + Insert a new entry into the diary, using the date at point and (for + block entries) the date at the mark. This adds to the Emacs diary + file(3), in a way similar to the ‘i’ command in the calendar. The + diary file pops up in another window, where you can add the entry. + + If you configure ‘org-agenda-diary-file’ to point to an Org file, + Org creates entries in that file instead. Most entries are stored + in a date-based outline tree that will later make it easy to + archive appointments from previous months/years. The tree is built + under an entry with a ‘DATE_TREE’ property, or else with years as + top-level entries. Emacs prompts you for the entry text—if you + specify it, the entry is created in ‘org-agenda-diary-file’ without + further interaction. If you directly press ‘’ at the prompt + without typing text, the target file is shown in another window for + you to finish the entry there. See also the ‘k r’ command. + +‘M’ (‘org-agenda-phases-of-moon’) + Show the phases of the moon for the three months around current + date. + +‘S’ (‘org-agenda-sunrise-sunset’) + Show sunrise and sunset times. The geographical location must be + set with calendar variables, see the documentation for the Emacs + calendar. + +‘C’ (‘org-agenda-convert-date’) + Convert the date at point into many other cultural and historic + calendars. + +‘H’ (‘org-agenda-holidays’) + Show holidays for three months around point date. + +Quit and exit +------------- + +‘q’ (‘org-agenda-quit’) + + Quit agenda, remove the agenda buffer. + +‘x’ (‘org-agenda-exit’) + + Exit agenda, remove the agenda buffer and all buffers loaded by + Emacs for the compilation of the agenda. Buffers created by the + user to visit Org files are not removed. + + ---------- Footnotes ---------- + + (1) Only tags filtering is respected here, effort filtering is +ignored. + + (2) You can also create persistent custom functions through +‘org-agenda-bulk-custom-functions’. + + (3) This file is parsed for the agenda when +‘org-agenda-include-diary’ is set. + + +File: org, Node: Custom Agenda Views, Next: Exporting Agenda Views, Prev: Agenda Commands, Up: Agenda Views + +10.6 Custom Agenda Views +======================== + +Custom agenda commands serve two purposes: to store and quickly access +frequently used TODO and tags searches, and to create special composite +agenda buffers. Custom agenda commands are accessible through the +dispatcher (see *note Agenda Dispatcher::), just like the default +commands. + +* Menu: + +* Storing searches:: Type once, use often. +* Block agenda:: All the stuff you need in a single buffer. +* Setting options:: Changing the rules. + + +File: org, Node: Storing searches, Next: Block agenda, Up: Custom Agenda Views + +10.6.1 Storing searches +----------------------- + +The first application of custom searches is the definition of keyboard +shortcuts for frequently used searches, either creating an agenda +buffer, or a sparse tree (the latter covering of course only the current +buffer). + + Custom commands are configured in the variable +‘org-agenda-custom-commands’. You can customize this variable, for +example by pressing ‘C’ from the agenda dispatcher (see *note Agenda +Dispatcher::). You can also directly set it with Emacs Lisp in the +Emacs init file. The following example contains all valid agenda views: + + (setq org-agenda-custom-commands + '(("x" agenda) + ("y" agenda*) + ("w" todo "WAITING") + ("W" todo-tree "WAITING") + ("u" tags "+boss-urgent") + ("v" tags-todo "+boss-urgent") + ("U" tags-tree "+boss-urgent") + ("f" occur-tree "\\") + ("h" . "HOME+Name tags searches") ;description for "h" prefix + ("hl" tags "+home+Lisa") + ("hp" tags "+home+Peter") + ("hk" tags "+home+Kim"))) + +The initial string in each entry defines the keys you have to press +after the dispatcher command in order to access the command. Usually +this will be just a single character, but if you have many similar +commands, you can also define two-letter combinations where the first +character is the same in several combinations and serves as a prefix +key(1). The second parameter is the search type, followed by the string +or regular expression to be used for the matching. The example above +will therefore define: + +‘x’ + as a global search for agenda entries planned(2) this week/day. + +‘y’ + as the same search, but only for entries with an hour specification + like ‘[h]h:mm’—think of them as appointments. + +‘w’ + as a global search for TODO entries with ‘WAITING’ as the TODO + keyword. + +‘W’ + as the same search, but only in the current buffer and displaying + the results as a sparse tree. + +‘u’ + as a global tags search for headlines tagged ‘boss’ but not + ‘urgent’. + +‘v’ + The same search, but limiting it to headlines that are also TODO + items. + +‘U’ + as the same search, but only in the current buffer and displaying + the result as a sparse tree. + +‘f’ + to create a sparse tree (again, current buffer only) with all + entries containing the word ‘FIXME’. + +‘h’ + as a prefix command for a ‘HOME’ tags search where you have to + press an additional key (‘l’, ‘p’ or ‘k’) to select a name (Lisa, + Peter, or Kim) as additional tag to match. + + Note that ‘*-tree’ agenda views need to be called from an Org buffer +as they operate on the current buffer only. + + ---------- Footnotes ---------- + + (1) You can provide a description for a prefix key by inserting a +cons cell with the prefix and the description. + + (2) _Planned_ means here that these entries have some planning +information attached to them, like a time-stamp, a scheduled or a +deadline string. See ‘org-agenda-entry-types’ on how to set what +planning information is taken into account. + + +File: org, Node: Block agenda, Next: Setting options, Prev: Storing searches, Up: Custom Agenda Views + +10.6.2 Block agenda +------------------- + +Another possibility is the construction of agenda views that comprise +the results of _several_ commands, each of which creates a block in the +agenda buffer. The available commands include ‘agenda’ for the daily or +weekly agenda (as created with ‘a’) , ‘alltodo’ for the global TODO list +(as constructed with ‘t’), and the matching commands discussed above: +‘todo’, ‘tags’, and ‘tags-todo’. Here are two examples: + + (setq org-agenda-custom-commands + '(("h" "Agenda and Home-related tasks" + ((agenda "") + (tags-todo "home") + (tags "garden"))) + ("o" "Agenda and Office-related tasks" + ((agenda "") + (tags-todo "work") + (tags "office"))))) + +This defines ‘h’ to create a multi-block view for stuff you need to +attend to at home. The resulting agenda buffer contains your agenda for +the current week, all TODO items that carry the tag ‘home’, and also all +lines tagged with ‘garden’. Finally the command ‘o’ provides a similar +view for office tasks. + + +File: org, Node: Setting options, Prev: Block agenda, Up: Custom Agenda Views + +10.6.3 Setting options for custom commands +------------------------------------------ + +Org mode contains a number of variables regulating agenda construction +and display. The global variables define the behavior for all agenda +commands, including the custom commands. However, if you want to change +some settings just for a single custom view, you can do so. Setting +options requires inserting a list of variable names and values at the +right spot in ‘org-agenda-custom-commands’. For example: + + (setq org-agenda-custom-commands + '(("w" todo "WAITING" + ((org-agenda-sorting-strategy '(priority-down)) + (org-agenda-prefix-format " Mixed: "))) + ("U" tags-tree "+boss-urgent" + ((org-show-context-detail 'minimal))) + ("N" search "" + ((org-agenda-files '("~org/notes.org")) + (org-agenda-text-search-extra-files nil))))) + +Now the ‘w’ command sorts the collected entries only by priority, and +the prefix format is modified to just say ‘Mixed:’ instead of giving the +category of the entry. The sparse tags tree of ‘U’ now turns out +ultra-compact, because neither the headline hierarchy above the match, +nor the headline following the match are shown. The command ‘N’ does a +text search limited to only a single file. + + For command sets creating a block agenda, +‘org-agenda-custom-commands’ has two separate spots for setting options. +You can add options that should be valid for just a single command in +the set, and options that should be valid for all commands in the set. +The former are just added to the command entry; the latter must come +after the list of command entries. Going back to the block agenda +example (see *note Block agenda::), let’s change the sorting strategy +for the ‘h’ commands to ‘priority-down’, but let’s sort the results for +‘garden’ tags query in the opposite order, ‘priority-up’. This would +look like this: + + (setq org-agenda-custom-commands + '(("h" "Agenda and Home-related tasks" + ((agenda) + (tags-todo "home") + (tags "garden" + ((org-agenda-sorting-strategy '(priority-up))))) + ((org-agenda-sorting-strategy '(priority-down)))) + ("o" "Agenda and Office-related tasks" + ((agenda) + (tags-todo "work") + (tags "office"))))) + + As you see, the values and parentheses setting is a little complex. +When in doubt, use the customize interface to set this variable—it fully +supports its structure. Just one caveat: when setting options in this +interface, the _values_ are just Lisp expressions. So if the value is a +string, you need to add the double-quotes around the value yourself. + + To control whether an agenda command should be accessible from a +specific context, you can customize +‘org-agenda-custom-commands-contexts’. Let’s say for example that you +have an agenda command ‘o’ displaying a view that you only need when +reading emails. Then you would configure this option like this: + + (setq org-agenda-custom-commands-contexts + '(("o" (in-mode . "message-mode")))) + + You can also tell that the command key ‘o’ should refer to another +command key ‘r’. In that case, add this command key like this: + + (setq org-agenda-custom-commands-contexts + '(("o" "r" (in-mode . "message-mode")))) + + See the docstring of the variable for more information. + + +File: org, Node: Exporting Agenda Views, Next: Agenda Column View, Prev: Custom Agenda Views, Up: Agenda Views + +10.7 Exporting Agenda Views +=========================== + +If you are away from your computer, it can be very useful to have a +printed version of some agenda views to carry around. Org mode can +export custom agenda views as plain text, HTML(1), Postscript, PDF(2), +and iCalendar files. If you want to do this only occasionally, use the +following command: + +‘C-x C-w’ (‘org-agenda-write’) + + Write the agenda view to a file. + + If you need to export certain agenda views frequently, you can +associate any custom agenda command with a list of output file names(3). +Here is an example that first defines custom commands for the agenda and +the global TODO list, together with a number of files to which to export +them. Then we define two block agenda commands and specify file names +for them as well. File names can be relative to the current working +directory, or absolute. + + (setq org-agenda-custom-commands + '(("X" agenda "" nil ("agenda.html" "agenda.ps")) + ("Y" alltodo "" nil ("todo.html" "todo.txt" "todo.ps")) + ("h" "Agenda and Home-related tasks" + ((agenda "") + (tags-todo "home") + (tags "garden")) + nil + ("~/views/home.html")) + ("o" "Agenda and Office-related tasks" + ((agenda) + (tags-todo "work") + (tags "office")) + nil + ("~/views/office.ps" "~/calendars/office.ics")))) + + The extension of the file name determines the type of export. If it +is ‘.html’, Org mode uses the htmlize package to convert the buffer to +HTML and save it to this file name. If the extension is ‘.ps’, +‘ps-print-buffer-with-faces’ is used to produce Postscript output. If +the extension is ‘.ics’, iCalendar export is run export over all files +that were used to construct the agenda, and limit the export to entries +listed in the agenda. Any other extension produces a plain ASCII file. + + The export files are _not_ created when you use one of those commands +interactively because this might use too much overhead. Instead, there +is a special command to produce _all_ specified files in one step: + +‘e’ (‘org-store-agenda-views’) + Export all agenda views that have export file names associated with + them. + + You can use the options section of the custom agenda commands to also +set options for the export commands. For example: + + (setq org-agenda-custom-commands + '(("X" agenda "" + ((ps-number-of-columns 2) + (ps-landscape-mode t) + (org-agenda-prefix-format " [ ] ") + (org-agenda-with-colors nil) + (org-agenda-remove-tags t)) + ("theagenda.ps")))) + +This command sets two options for the Postscript exporter, to make it +print in two columns in landscape format—the resulting page can be cut +in two and then used in a paper agenda. The remaining settings modify +the agenda prefix to omit category and scheduling information, and +instead include a checkbox to check off items. We also remove the tags +to make the lines compact, and we do not want to use colors for the +black-and-white printer. Settings specified in +‘org-agenda-exporter-settings’ also apply, e.g., + + (setq org-agenda-exporter-settings + '((ps-number-of-columns 2) + (ps-landscape-mode t) + (org-agenda-add-entry-text-maxlines 5) + (htmlize-output-type 'css))) + +but the settings in ‘org-agenda-custom-commands’ take precedence. + + From the command line you may also use: + + emacs -eval (org-batch-store-agenda-views) -kill + +or, if you need to modify some parameters(4) + + emacs -eval '(org-batch-store-agenda-views \ + org-agenda-span (quote month) \ + org-agenda-start-day "2007-11-01" \ + org-agenda-include-diary nil \ + org-agenda-files (quote ("~/org/project.org")))' \ + -kill + +which creates the agenda views restricted to the file +‘~/org/project.org’, without diary entries and with a 30-day extent. + + You can also extract agenda information in a way that allows further +processing by other programs. See *note Extracting Agenda +Information::, for more information. + + ---------- Footnotes ---------- + + (1) For HTML you need to install Hrvoje NikÅ¡ić’s ‘htmlize.el’ from +Hrvoje NikÅ¡ić’s repository (https://github.com/hniksic/emacs-htmlize). + + (2) To create PDF output, the Ghostscript ps2pdf utility must be +installed on the system. Selecting a PDF file also creates the +postscript file. + + (3) If you want to store standard views like the weekly agenda or the +global TODO list as well, you need to define custom commands for them in +order to be able to specify file names. + + (4) Quoting depends on the system you use, please check the FAQ for +examples. + + +File: org, Node: Agenda Column View, Prev: Exporting Agenda Views, Up: Agenda Views + +10.8 Using Column View in the Agenda +==================================== + +Column view (see *note Column View::) is normally used to view and edit +properties embedded in the hierarchical structure of an Org file. It +can be quite useful to use column view also from the agenda, where +entries are collected by certain criteria. + +‘C-c C-x C-c’ (‘org-agenda-columns’) + + Turn on column view in the agenda. + + To understand how to use this properly, it is important to realize +that the entries in the agenda are no longer in their proper outline +environment. This causes the following issues: + + 1. Org needs to make a decision which columns format to use. Since + the entries in the agenda are collected from different files, and + different files may have different columns formats, this is a + non-trivial problem. Org first checks if the variable + ‘org-overriding-columns-format’ is currently set, and if so, takes + the format from there. Otherwise it takes the format associated + with the first item in the agenda, or, if that item does not have a + specific format (defined in a property, or in its file), it uses + ‘org-columns-default-format’. + + 2. If any of the columns has a summary type defined (see *note Column + attributes::), turning on column view in the agenda visits all + relevant agenda files and make sure that the computations of this + property are up to date. This is also true for the special + ‘CLOCKSUM’ property. Org then sums the values displayed in the + agenda. In the daily/weekly agenda, the sums cover a single day; + in all other views they cover the entire block. + + It is important to realize that the agenda may show the same entry + _twice_—for example as scheduled and as a deadline—and it may show + two entries from the same hierarchy (for example a _parent_ and its + _child_). In these cases, the summation in the agenda leads to + incorrect results because some values count double. + + 3. When the column view in the agenda shows the ‘CLOCKSUM’ property, + that is always the entire clocked time for this item. So even in + the daily/weekly agenda, the clocksum listed in column view may + originate from times outside the current view. This has the + advantage that you can compare these values with a column listing + the planned total effort for a task—one of the major applications + for column view in the agenda. If you want information about + clocked time in the displayed period use clock table mode (press + ‘R’ in the agenda). + + 4. When the column view in the agenda shows the ‘CLOCKSUM_T’ property, + that is always today’s clocked time for this item. So even in the + weekly agenda, the clocksum listed in column view only originates + from today. This lets you compare the time you spent on a task for + today, with the time already spent—via ‘CLOCKSUM’—and with the + planned total effort for it. + + +File: org, Node: Markup for Rich Contents, Next: Exporting, Prev: Agenda Views, Up: Top + +11 Markup for Rich Contents +*************************** + +Org is primarily about organizing and searching through your plain-text +notes. However, it also provides a lightweight yet robust markup +language for rich text formatting and more. For instance, you may want +to center or emphasize text. Or you may need to insert a formula or +image in your writing. Org offers syntax for all of this and more. +Used in conjunction with the export framework (see *note Exporting::), +you can author beautiful documents in Org—like the fine manual you are +currently reading. + +* Menu: + +* Paragraphs:: The basic unit of text. +* Emphasis and Monospace:: Bold, italic, etc. +* Subscripts and Superscripts:: Simple syntax for raising/lowering text. +* Special Symbols:: Greek letters and other symbols. +* Embedded LaTeX:: LaTeX can be freely used inside Org documents. +* Literal Examples:: Source code examples with special formatting. +* Images:: Display an image. +* Captions:: Describe tables, images... +* Horizontal Rules:: Make a line. + + +File: org, Node: Paragraphs, Next: Emphasis and Monospace, Up: Markup for Rich Contents + +11.1 Paragraphs +=============== + +Paragraphs are separated by at least one empty line. If you need to +enforce a line break within a paragraph, use ‘\\’ at the end of a line. + + To preserve the line breaks, indentation and blank lines in a region, +but otherwise use normal formatting, you can use this construct, which +can also be used to format poetry. + + #+BEGIN_VERSE + Great clouds overhead + Tiny black birds rise and fall + Snow covers Emacs + + ---AlexSchroeder + #+END_VERSE + + When quoting a passage from another document, it is customary to +format this as a paragraph that is indented on both the left and the +right margin. You can include quotations in Org documents like this: + + #+BEGIN_QUOTE + Everything should be made as simple as possible, + but not any simpler ---Albert Einstein + #+END_QUOTE + + If you would like to center some text, do it like this: + + #+BEGIN_CENTER + Everything should be made as simple as possible, \\ + but not any simpler + #+END_CENTER + + +File: org, Node: Emphasis and Monospace, Next: Subscripts and Superscripts, Prev: Paragraphs, Up: Markup for Rich Contents + +11.2 Emphasis and Monospace +=========================== + +You can make words ‘*bold*’, ‘/italic/’, ‘_underlined_’, ‘=verbatim=’ +and ‘~code~’, and, if you must, ‘+strike-through+’. Text in the code +and verbatim string is not processed for Org mode specific syntax; it is +exported verbatim. + + To turn off fontification for marked up text, you can set +‘org-fontify-emphasized-text’ to ‘nil’. To narrow down the list of +available markup syntax, you can customize ‘org-emphasis-alist’. + + +File: org, Node: Subscripts and Superscripts, Next: Special Symbols, Prev: Emphasis and Monospace, Up: Markup for Rich Contents + +11.3 Subscripts and Superscripts +================================ + +‘^’ and ‘_’ are used to indicate super- and subscripts. To increase the +readability of ASCII text, it is not necessary, but OK, to surround +multi-character sub- and superscripts with curly braces. For example + + The radius of the sun is R_sun = 6.96 x 10^8 m. On the other hand, + the radius of Alpha Centauri is R_{Alpha Centauri} = 1.28 x R_{sun}. + + If you write a text where the underscore is often used in a different +context, Org’s convention to always interpret these as subscripts can +get in your way. Configure the variable ‘org-use-sub-superscripts’ to +change this convention. For example, when setting this variable to +‘{}’, ‘a_b’ is not interpreted as a subscript, but ‘a_{b}’ is. + +‘C-c C-x \’ (‘org-toggle-pretty-entities’) + This command formats sub- and superscripts in a WYSIWYM way. + + +File: org, Node: Special Symbols, Next: Embedded LaTeX, Prev: Subscripts and Superscripts, Up: Markup for Rich Contents + +11.4 Special Symbols +==================== + +You can use LaTeX-like syntax to insert special symbols—named +entities—like ‘\alpha’ to indicate the Greek letter, or ‘\to’ to +indicate an arrow. Completion for these symbols is available, just type +‘\’ and maybe a few letters, and press ‘M-’ to see possible +completions. If you need such a symbol inside a word, terminate it with +a pair of curly brackets. For example + + Pro tip: Given a circle \Gamma of diameter d, the length of its + circumference is \pi{}d. + + A large number of entities is provided, with names taken from both +HTML and LaTeX; you can comfortably browse the complete list from a +dedicated buffer using the command ‘org-entities-help’. It is also +possible to provide your own special symbols in the variable +‘org-entities-user’. + + During export, these symbols are transformed into the native format +of the exporter back-end. Strings like ‘\alpha’ are exported as +‘α’ in the HTML output, and as ‘\(\alpha\)’ in the LaTeX output. +Similarly, ‘\nbsp’ becomes ‘ â€™ in HTML and ‘~’ in LaTeX. + + If you would like to see entities displayed as UTF-8 characters, use +the following command(1): + +‘C-c C-x \’ (‘org-toggle-pretty-entities’) + + Toggle display of entities as UTF-8 characters. This does not + change the buffer content which remains plain ASCII, but it + overlays the UTF-8 character for display purposes only. + + In addition to regular entities defined above, Org exports in a +special way(2) the following commonly used character combinations: ‘\-’ +is treated as a shy hyphen, ‘--’ and ‘---’ are converted into dashes, +and ‘...’ becomes a compact set of dots. + + ---------- Footnotes ---------- + + (1) You can turn this on by default by setting the variable +‘org-pretty-entities’, or on a per-file base with the ‘STARTUP’ option +‘entitiespretty’. + + (2) This behavior can be disabled with ‘-’ export setting (see *note +Export Settings::). + + +File: org, Node: Embedded LaTeX, Next: Literal Examples, Prev: Special Symbols, Up: Markup for Rich Contents + +11.5 Embedded LaTeX +=================== + +Plain ASCII is normally sufficient for almost all note taking. +Exceptions include scientific notes, which often require mathematical +symbols and the occasional formula. LaTeX(1) is widely used to typeset +scientific documents. Org mode supports embedding LaTeX code into its +files, because many academics are used to writing and reading LaTeX +source code, and because it can be readily processed to produce pretty +output for a number of export back-ends. + +* Menu: + +* LaTeX fragments:: Complex formulas made easy. +* Previewing LaTeX fragments:: What will this snippet look like? +* CDLaTeX mode:: Speed up entering of formulas. + + ---------- Footnotes ---------- + + (1) LaTeX is a macro system based on Donald E. Knuth’s TeX system. +Many of the features described here as “LaTeX” are really from TeX, but +for simplicity I am blurring this distinction. + + +File: org, Node: LaTeX fragments, Next: Previewing LaTeX fragments, Up: Embedded LaTeX + +11.5.1 LaTeX fragments +---------------------- + +Org mode can contain LaTeX math fragments, and it supports ways to +process these for several export back-ends. When exporting to LaTeX, +the code is left as it is. When exporting to HTML, Org can use either +MathJax (http://www.mathjax.org) (see *note Math formatting in HTML +export::) or transcode the math into images (see *note Previewing LaTeX +fragments::). + + LaTeX fragments do not need any special marking at all. The +following snippets are identified as LaTeX source code: + + • Environments of any kind(1). The only requirement is that the + ‘\begin’ statement appears on a new line, preceded by only + whitespace. + + • Text within the usual LaTeX math delimiters. To avoid conflicts + with currency specifications, single ‘$’ characters are only + recognized as math delimiters if the enclosed text contains at most + two line breaks, is directly attached to the ‘$’ characters with no + whitespace in between, and if the closing ‘$’ is followed by + whitespace, punctuation or a dash. For the other delimiters, there + is no such restriction, so when in doubt, use ‘\(...\)’ as inline + math delimiters. + +For example: + + \begin{equation} % arbitrary environments, + x=\sqrt{b} % even tables, figures + \end{equation} % etc + + If $a^2=b$ and \( b=2 \), then the solution must be + either $$ a=+\sqrt{2} $$ or \[ a=-\sqrt{2} \]. + + LaTeX processing can be configured with the variable +‘org-export-with-latex’. The default setting is ‘t’ which means MathJax +for HTML, and no processing for ASCII and LaTeX back-ends. You can also +set this variable on a per-file basis using one of these lines: + +‘#+OPTIONS: tex:t’ Do the right thing automatically (MathJax) +‘#+OPTIONS: tex:nil’ Do not process LaTeX fragments at all +‘#+OPTIONS: tex:verbatim’ Verbatim export, for jsMath or so + + ---------- Footnotes ---------- + + (1) When MathJax is used, only the environments recognized by MathJax +are processed. When dvipng, dvisvgm, or ImageMagick suite is used to +create images, any LaTeX environment is handled. + + +File: org, Node: Previewing LaTeX fragments, Next: CDLaTeX mode, Prev: LaTeX fragments, Up: Embedded LaTeX + +11.5.2 Previewing LaTeX fragments +--------------------------------- + +If you have a working LaTeX installation and ‘dvipng’, ‘dvisvgm’ or +‘convert’ installed(1), LaTeX fragments can be processed to produce +images of the typeset expressions to be used for inclusion while +exporting to HTML (see *note LaTeX fragments::), or for inline +previewing within Org mode. + + You can customize the variables ‘org-format-latex-options’ and +‘org-format-latex-header’ to influence some aspects of the preview. In +particular, the ‘:scale’ (and for HTML export, ‘:html-scale’) property +of the former can be used to adjust the size of the preview images. + +‘C-c C-x C-l’ (‘org-toggle-latex-fragment’) + + Produce a preview image of the LaTeX fragment at point and overlay + it over the source code. If there is no fragment at point, process + all fragments in the current entry (between two headlines). When + called with a prefix argument, process the entire subtree. When + called with two prefix arguments, or when point is before the first + headline, process the entire buffer. + + You can turn on the previewing of all LaTeX fragments in a file with + + #+STARTUP: latexpreview + + To disable it, simply use + + #+STARTUP: nolatexpreview + + ---------- Footnotes ---------- + + (1) These are respectively available at +, +and from the ImageMagick suite. Choose the converter by setting the +variable ‘org-preview-latex-default-process’ accordingly. + + +File: org, Node: CDLaTeX mode, Prev: Previewing LaTeX fragments, Up: Embedded LaTeX + +11.5.3 Using CDLaTeX to enter math +---------------------------------- + +CDLaTeX mode is a minor mode that is normally used in combination with a +major LaTeX mode like AUCTeX in order to speed-up insertion of +environments and math templates. Inside Org mode, you can make use of +some of the features of CDLaTeX mode. You need to install ‘cdlatex.el’ +and ‘texmathp.el’ (the latter comes also with AUCTeX) from +. Do not use CDLaTeX +mode itself under Org mode, but use the light version ‘org-cdlatex-mode’ +that comes as part of Org mode. Turn it on for the current buffer with +‘M-x org-cdlatex-mode’, or for all Org files with + + (add-hook 'org-mode-hook 'turn-on-org-cdlatex) + + When this mode is enabled, the following features are present (for +more details see the documentation of CDLaTeX mode): + +‘C-c {’ + + Insert an environment template. + +‘’ + + The ‘’ key expands the template if point is inside a LaTeX + fragment(1). For example, ‘’ expands ‘fr’ to ‘\frac{}{}’ and + position point correctly inside the first brace. Another ‘’ + gets you into the second brace. + + Even outside fragments, ‘’ expands environment abbreviations + at the beginning of a line. For example, if you write ‘equ’ at the + beginning of a line and press ‘’, this abbreviation is + expanded to an ‘equation’ environment. To get a list of all + abbreviations, type ‘M-x cdlatex-command-help’. + +‘^’ +‘_’ + + Pressing ‘_’ and ‘^’ inside a LaTeX fragment inserts these + characters together with a pair of braces. If you use ‘’ to + move out of the braces, and if the braces surround only a single + character or macro, they are removed again (depending on the + variable ‘cdlatex-simplify-sub-super-scripts’). + +‘`’ + + Pressing the backquote followed by a character inserts math macros, + also outside LaTeX fragments. If you wait more than 1.5 seconds + after the backquote, a help window pops up. + +‘'’ + + Pressing the single-quote followed by another character modifies + the symbol before point with an accent or a font. If you wait more + than 1.5 seconds after the single-quote, a help window pops up. + Character modification works only inside LaTeX fragments; outside + the quote is normal. + + ---------- Footnotes ---------- + + (1) Org mode has a method to test if point is inside such a fragment, +see the documentation of the function ‘org-inside-LaTeX-fragment-p’. + + +File: org, Node: Literal Examples, Next: Images, Prev: Embedded LaTeX, Up: Markup for Rich Contents + +11.6 Literal Examples +===================== + +You can include literal examples that should not be subjected to markup. +Such examples are typeset in monospace, so this is well suited for +source code and similar examples. + + #+BEGIN_EXAMPLE + Some example from a text file. + #+END_EXAMPLE + + Note that such blocks may be _indented_ in order to align nicely with +indented text and in particular with plain list structure (see *note +Plain Lists::). For simplicity when using small examples, you can also +start the example lines with a colon followed by a space. There may +also be additional whitespace before the colon: + + Here is an example + : Some example from a text file. + + If the example is source code from a programming language, or any +other text that can be marked up by Font Lock in Emacs, you can ask for +the example to look like the fontified Emacs buffer(1). This is done +with the code block, where you also need to specify the name of the +major mode that should be used to fontify the example(2), see *note +Structure Templates:: for shortcuts to easily insert code blocks. + + #+BEGIN_SRC emacs-lisp + (defun org-xor (a b) + "Exclusive or." + (if a (not b) b)) + #+END_SRC + + Both in ‘example’ and in ‘src’ snippets, you can add a ‘-n’ switch to +the end of the ‘#+BEGIN’ line, to get the lines of the example numbered. +The ‘-n’ takes an optional numeric argument specifying the starting line +number of the block. If you use a ‘+n’ switch, the numbering from the +previous numbered snippet is continued in the current one. The ‘+n’ +switch can also take a numeric argument. This adds the value of the +argument to the last line of the previous block to determine the +starting line number. + + #+BEGIN_SRC emacs-lisp -n 20 + ;; This exports with line number 20. + (message "This is line 21") + #+END_SRC + + #+BEGIN_SRC emacs-lisp +n 10 + ;; This is listed as line 31. + (message "This is line 32") + #+END_SRC + + In literal examples, Org interprets strings like ‘(ref:name)’ as +labels, and use them as targets for special hyperlinks like +‘[[(name)]]’—i.e., the reference name enclosed in single parenthesis. +In HTML, hovering the mouse over such a link remote-highlights the +corresponding code line, which is kind of cool. + + You can also add a ‘-r’ switch which _removes_ the labels from the +source code(3). With the ‘-n’ switch, links to these references are +labeled by the line numbers from the code listing. Otherwise links use +the labels with no parentheses. Here is an example: + + #+BEGIN_SRC emacs-lisp -n -r + (save-excursion (ref:sc) + (goto-char (point-min)) (ref:jump) + #+END_SRC + In line [[(sc)]] we remember the current position. [[(jump)][Line (jump)]] + jumps to point-min. + + Finally, you can use ‘-i’ to preserve the indentation of a specific +code block (see *note Editing Source Code::). + + If the syntax for the label format conflicts with the language +syntax, use a ‘-l’ switch to change the format, for example + + #+BEGIN_SRC pascal -n -r -l "((%s))" + +See also the variable ‘org-coderef-label-format’. + + HTML export also allows examples to be published as text areas (see +*note Text areas in HTML export::). + + Because the ‘#+BEGIN’ ... ‘#+END’ patterns need to be added so often, +a shortcut is provided (see *note Structure Templates::). + +‘C-c '’ (‘org-edit-special’) + Edit the source code example at point in its native mode. This + works by switching to a temporary buffer with the source code. You + need to exit by pressing ‘C-c '’ again(4). The edited version then + replaces the old version in the Org buffer. Fixed-width + regions—where each line starts with a colon followed by a space—are + edited using ‘artist-mode’(5) to allow creating ASCII drawings + easily. Using this command in an empty line creates a new + fixed-width region. + + Calling ‘org-store-link’ (see *note Handling Links::) while editing a +source code example in a temporary buffer created with ‘C-c '’ prompts +for a label. Make sure that it is unique in the current buffer, and +insert it with the proper formatting like ‘(ref:label)’ at the end of +the current line. Then the label is stored as a link ‘(label)’, for +retrieval with ‘C-c C-l’. + + ---------- Footnotes ---------- + + (1) This works automatically for the HTML backend (it requires +version 1.34 of the ‘htmlize.el’ package, which you need to install). +Fontified code chunks in LaTeX can be achieved using either the listings +(https://www.ctan.org/pkg/listings) package or the minted +(https://www.ctan.org/pkg/minted) package. Refer to +‘org-export-latex-listings’ for details. + + (2) Source code in code blocks may also be evaluated either +interactively or on export. See *note Working with Source Code:: for +more information on evaluating code blocks. + + (3) Adding ‘-k’ to ‘-n -r’ _keeps_ the labels in the source code +while using line numbers for the links, which might be useful to explain +those in an Org mode example code. + + (4) Upon exit, lines starting with ‘*’, ‘,*’, ‘#+’ and ‘,#+’ get a +comma prepended, to keep them from being interpreted by Org as outline +nodes or special syntax. These commas are stripped when editing with +‘C-c '’, and also before export. + + (5) You may select a different-mode with the variable +‘org-edit-fixed-width-region-mode’. + + +File: org, Node: Images, Next: Captions, Prev: Literal Examples, Up: Markup for Rich Contents + +11.7 Images +=========== + +An image is a link to an image file(1) that does not have a description +part, for example + + ./img/cat.jpg + + If you wish to define a caption for the image (see *note Captions::) +and maybe a label for internal cross references (see *note Internal +Links::), make sure that the link is on a line by itself and precede it +with ‘CAPTION’ and ‘NAME’ keywords as follows: + + #+CAPTION: This is the caption for the next figure link (or table) + #+NAME: fig:SED-HR4049 + [[./img/a.jpg]] + +Such images can be displayed within the buffer with the following +command: + +‘C-c C-x C-v’ (‘org-toggle-inline-images’) + Toggle the inline display of linked images. When called with a + prefix argument, also display images that do have a link + description. You can ask for inline images to be displayed at + startup by configuring the variable + ‘org-startup-with-inline-images’(2). + + ---------- Footnotes ---------- + + (1) What Emacs considers to be an image depends on +‘image-file-name-extensions’ and ‘image-file-name-regexps’. + + (2) The variable ‘org-startup-with-inline-images’ can be set within a +buffer with the ‘STARTUP’ options ‘inlineimages’ and ‘noinlineimages’. + + +File: org, Node: Captions, Next: Horizontal Rules, Prev: Images, Up: Markup for Rich Contents + +11.8 Captions +============= + +You can assign a caption to a specific part of a document by inserting a +‘CAPTION’ keyword immediately before it: + + #+CAPTION: This is the caption for the next table (or link) + | ... | ... | + |-----+-----| + + Optionally, the caption can take the form: + + #+CAPTION[Short caption]: Longer caption. + + Even though images and tables are prominent examples of captioned +structures, the same caption mechanism can apply to many others—e.g., +LaTeX equations, source code blocks. Depending on the export back-end, +those may or may not be handled. + + +File: org, Node: Horizontal Rules, Prev: Captions, Up: Markup for Rich Contents + +11.9 Horizontal Rules +===================== + +A line consisting of only dashes, and at least 5 of them, is exported as +a horizontal line. + + +File: org, Node: Exporting, Next: Publishing, Prev: Markup for Rich Contents, Up: Top + +12 Exporting +************ + +At some point you might want to print your notes, publish them on the +web, or share them with people not using Org. Org can convert and +export documents to a variety of other formats while retaining as much +structure (see *note Document Structure::) and markup (see *note Markup +for Rich Contents::) as possible. + + The libraries responsible for translating Org files to other formats +are called _back-ends_. Org ships with support for the following +back-ends: + + • _ascii_ (ASCII format) + • _beamer_ (LaTeX Beamer format) + • _html_ (HTML format) + • _icalendar_ (iCalendar format) + • _latex_ (LaTeX format) + • _md_ (Markdown format) + • _odt_ (OpenDocument Text format) + • _org_ (Org format) + • _texinfo_ (Texinfo format) + • _man_ (Man page format) + + Users can install libraries for additional formats from the Emacs +packaging system. For easy discovery, these packages have a common +naming scheme: ‘ox-NAME’, where NAME is a format. For example, +‘ox-koma-letter’ for _koma-letter_ back-end. More libraries can be +found in the ‘contrib/’ directory (see *note Installation::). + + Org only loads back-ends for the following formats by default: ASCII, +HTML, iCalendar, LaTeX, and ODT. Additional back-ends can be loaded in +either of two ways: by configuring the ‘org-export-backends’ variable, +or by requiring libraries in the Emacs init file. For example, to load +the Markdown back-end, add this to your Emacs config: + + (require 'ox-md) + +* Menu: + +* The Export Dispatcher:: The main interface. +* Export Settings:: Common export settings. +* Table of Contents:: The if and where of the table of contents. +* Include Files:: Include additional files into a document. +* Macro Replacement:: Use macros to create templates. +* Comment Lines:: What will not be exported. +* ASCII/Latin-1/UTF-8 export:: Exporting to flat files with encoding. +* Beamer Export:: +* HTML Export:: Exporting to HTML. +* LaTeX Export:: Exporting to LaTeX and processing to PDF. +* Markdown Export:: Exporting to Markdown. +* OpenDocument Text Export:: Exporting to OpenDocument Text. +* Org Export:: Exporting to Org. +* Texinfo Export:: Exporting to Texinfo. +* iCalendar Export:: Exporting to iCalendar. +* Other Built-in Back-ends:: Exporting to a man page. +* Advanced Export Configuration:: Fine-tuning the export output. +* Export in Foreign Buffers:: Author tables and lists in Org syntax. + + +File: org, Node: The Export Dispatcher, Next: Export Settings, Up: Exporting + +12.1 The Export Dispatcher +========================== + +The export dispatcher is the main interface for Org’s exports. A +hierarchical menu presents the currently configured export formats. +Options are shown as easy toggle switches on the same screen. + + Org also has a minimal prompt interface for the export dispatcher. +When the variable ‘org-export-dispatch-use-expert-ui’ is set to a +non-‘nil’ value, Org prompts in the minibuffer. To switch back to the +hierarchical menu, press ‘?’. + +‘C-c C-e’ (‘org-export’) + + Invokes the export dispatcher interface. The options show default + settings. The ‘C-u’ prefix argument preserves options from the + previous export, including any sub-tree selections. + + Org exports the entire buffer by default. If the Org buffer has an +active region, then Org exports just that region. + + Within the dispatcher interface, the following key combinations can +further alter what is exported, and how. + +‘C-a’ + + Toggle asynchronous export. Asynchronous export uses an external + Emacs process with a specially configured initialization file to + complete the exporting process in the background, without tying-up + Emacs. This is particularly useful when exporting long documents. + + Output from an asynchronous export is saved on the _export stack_. + To view this stack, call the export dispatcher with a double ‘C-u’ + prefix argument. If already in the export dispatcher menu, ‘&’ + displays the stack. + + You can make asynchronous export the default by setting + ‘org-export-in-background’. + + You can set the initialization file used by the background process + by setting ‘org-export-async-init-file’. + +‘C-b’ + + Toggle body-only export. Useful for excluding headers and footers + in the export. Affects only those back-end formats that have + sections like ‘...’ in HTML. + +‘C-s’ + + Toggle sub-tree export. When turned on, Org exports only the + sub-tree starting from point position at the time the export + dispatcher was invoked. Org uses the top heading of this sub-tree + as the document’s title. If point is not on a heading, Org uses + the nearest enclosing header. If point is in the document + preamble, Org signals an error and aborts export. + + To make sub-tree export the default, customize the variable + ‘org-export-initial-scope’. + +‘C-v’ + + Toggle visible-only export. This is useful for exporting only + certain parts of an Org document by adjusting the visibility of + particular headings. + + +File: org, Node: Export Settings, Next: Table of Contents, Prev: The Export Dispatcher, Up: Exporting + +12.2 Export Settings +==================== + +Export options can be set: globally with variables; for an individual +file by making variables buffer-local with in-buffer settings (see *note +In-buffer Settings::); by setting individual keywords or specifying them +in compact form with the ‘OPTIONS’ keyword; or for a tree by setting +properties (see *note Properties and Columns::). Options set at a +specific level override options set at a more general level. + + In-buffer settings may appear anywhere in the file, either directly +or indirectly through a file included using ‘#+SETUPFILE: filename or +URL’ syntax. Option keyword sets tailored to a particular back-end can +be inserted from the export dispatcher (see *note The Export +Dispatcher::) using the ‘Insert template’ command by pressing ‘#’. To +insert keywords individually, a good way to make sure the keyword is +correct is to type ‘#+’ and then to use ‘M-’(1) for completion. + + The export keywords available for every back-end, and their +equivalent global variables, include: + +‘AUTHOR’ + The document author (‘user-full-name’). + +‘CREATOR’ + Entity responsible for output generation + (‘org-export-creator-string’). + +‘DATE’ + A date or a time-stamp(2). + +‘EMAIL’ + The email address (‘user-mail-address’). + +‘LANGUAGE’ + Language to use for translating certain strings + (‘org-export-default-language’). With ‘#+LANGUAGE: fr’, for + example, Org translates ‘Table of contents’ to the French ‘Table + des matières’(3). + +‘SELECT_TAGS’ + The default value is ‘("export")’. When a tree is tagged with + ‘export’ (‘org-export-select-tags’), Org selects that tree and its + sub-trees for export. Org excludes trees with ‘noexport’ tags, see + below. When selectively exporting files with ‘export’ tags set, + Org does not export any text that appears before the first + headline. + +‘EXCLUDE_TAGS’ + The default value is ‘("noexport")’. When a tree is tagged with + ‘noexport’ (‘org-export-exclude-tags’), Org excludes that tree and + its sub-trees from export. Entries tagged with ‘noexport’ are + unconditionally excluded from the export, even if they have an + ‘export’ tag. Even if a sub-tree is not exported, Org executes any + code blocks contained there. + +‘TITLE’ + Org displays this title. For long titles, use multiple ‘#+TITLE’ + lines. + +‘EXPORT_FILE_NAME’ + The name of the output file to be generated. Otherwise, Org + generates the file name based on the buffer name and the extension + based on the back-end format. + + The ‘OPTIONS’ keyword is a compact form. To configure multiple +options, use several ‘OPTIONS’ lines. ‘OPTIONS’ recognizes the +following arguments. + +‘'’ + Toggle smart quotes (‘org-export-with-smart-quotes’). Depending on + the language used, when activated, Org treats pairs of double + quotes as primary quotes, pairs of single quotes as secondary + quotes, and single quote marks as apostrophes. + +‘*’ + Toggle emphasized text (‘org-export-with-emphasize’). + +‘-’ + Toggle conversion of special strings + (‘org-export-with-special-strings’). + +‘:’ + Toggle fixed-width sections (‘org-export-with-fixed-width’). + +‘<’ + Toggle inclusion of time/date active/inactive stamps + (‘org-export-with-timestamps’). + +‘\n’ + Toggles whether to preserve line breaks + (‘org-export-preserve-breaks’). + +‘^’ + Toggle TeX-like syntax for sub- and superscripts. If you write + ‘^:{}’, ‘a_{b}’ is interpreted, but the simple ‘a_b’ is left as it + is (‘org-export-with-sub-superscripts’). + +‘arch’ + Configure how archived trees are exported. When set to ‘headline’, + the export process skips the contents and processes only the + headlines (‘org-export-with-archived-trees’). + +‘author’ + Toggle inclusion of author name into exported file + (‘org-export-with-author’). + +‘broken-links’ + Toggles if Org should continue exporting upon finding a broken + internal link. When set to ‘mark’, Org clearly marks the problem + link in the output (‘org-export-with-broken-links’). + +‘c’ + Toggle inclusion of CLOCK keywords (‘org-export-with-clocks’). + +‘creator’ + Toggle inclusion of creator information in the exported file + (‘org-export-with-creator’). + +‘d’ + Toggles inclusion of drawers, or list of drawers to include, or + list of drawers to exclude (‘org-export-with-drawers’). + +‘date’ + Toggle inclusion of a date into exported file + (‘org-export-with-date’). + +‘e’ + Toggle inclusion of entities (‘org-export-with-entities’). + +‘email’ + Toggle inclusion of the author’s e-mail into exported file + (‘org-export-with-email’). + +‘f’ + Toggle the inclusion of footnotes (‘org-export-with-footnotes’). + +‘H’ + Set the number of headline levels for export + (‘org-export-headline-levels’). Below that level, headlines are + treated differently. In most back-ends, they become list items. + +‘inline’ + Toggle inclusion of inlinetasks (‘org-export-with-inlinetasks’). + +‘num’ + Toggle section-numbers (‘org-export-with-section-numbers’). When + set to number N, Org numbers only those headlines at level N or + above. Set ‘UNNUMBERED’ property to non-‘nil’ to disable numbering + of heading and subheadings entirely. Moreover, when the value is + ‘notoc’ the headline, and all its children, do not appear in the + table of contents either (see *note Table of Contents::). + +‘p’ + Toggle export of planning information (‘org-export-with-planning’). + “Planning information” comes from lines located right after the + headline and contain any combination of these cookies: ‘SCHEDULED’, + ‘DEADLINE’, or ‘CLOSED’. + +‘pri’ + Toggle inclusion of priority cookies (‘org-export-with-priority’). + +‘prop’ + Toggle inclusion of property drawers, or list the properties to + include (‘org-export-with-properties’). + +‘stat’ + Toggle inclusion of statistics cookies + (‘org-export-with-statistics-cookies’). + +‘tags’ + Toggle inclusion of tags, may also be ‘not-in-toc’ + (‘org-export-with-tags’). + +‘tasks’ + Toggle inclusion of tasks (TODO items); or ‘nil’ to remove all + tasks; or ‘todo’ to remove DONE tasks; or list the keywords to keep + (‘org-export-with-tasks’). + +‘tex’ + ‘nil’ does not export; ‘t’ exports; ‘verbatim’ keeps everything in + verbatim (‘org-export-with-latex’). + +‘timestamp’ + Toggle inclusion of the creation time in the exported file + (‘org-export-time-stamp-file’). + +‘title’ + Toggle inclusion of title (‘org-export-with-title’). + +‘toc’ + Toggle inclusion of the table of contents, or set the level limit + (‘org-export-with-toc’). + +‘todo’ + Toggle inclusion of TODO keywords into exported text + (‘org-export-with-todo-keywords’). + +‘|’ + Toggle inclusion of tables (‘org-export-with-tables’). + + When exporting sub-trees, special node properties can override the +above keywords. These properties have an ‘EXPORT_’ prefix. For +example, ‘DATE’ becomes, ‘EXPORT_DATE’ when used for a specific +sub-tree. Except for ‘SETUPFILE’, all other keywords listed above have +an ‘EXPORT_’ equivalent. + + If ‘org-export-allow-bind-keywords’ is non-‘nil’, Emacs variables can +become buffer-local during export by using the ‘BIND’ keyword. Its +syntax is ‘#+BIND: variable value’. This is particularly useful for +in-buffer settings that cannot be changed using keywords. + + ---------- Footnotes ---------- + + (1) Many desktops intercept ‘M-’ to switch windows. Use ‘C-M-i’ +or ‘ ’ instead. + + (2) The variable ‘org-export-date-timestamp-format’ defines how this +timestamp are exported. + + (3) For export to LaTeX format—or LaTeX-related formats such as +Beamer—, the ‘org-latex-package-alist’ variable needs further +configuration. See *note LaTeX specific export settings::. + + +File: org, Node: Table of Contents, Next: Include Files, Prev: Export Settings, Up: Exporting + +12.3 Table of Contents +====================== + +The table of contents includes all headlines in the document. Its depth +is therefore the same as the headline levels in the file. If you need +to use a different depth, or turn it off entirely, set the +‘org-export-with-toc’ variable accordingly. You can achieve the same on +a per file basis, using the following ‘toc’ item in ‘OPTIONS’ keyword: + + #+OPTIONS: toc:2 (only include two levels in TOC) + #+OPTIONS: toc:nil (no default TOC at all) + + Org includes both numbered and unnumbered headlines in the table of +contents(1). If you need to exclude an unnumbered headline, along with +all its children, set the ‘UNNUMBERED’ property to ‘notoc’ value. + + * Subtree not numbered, not in table of contents either + :PROPERTIES: + :UNNUMBERED: notoc + :END: + + Org normally inserts the table of contents directly before the first +headline of the file. To move the table of contents to a different +location, first turn off the default with ‘org-export-with-toc’ variable +or with ‘#+OPTIONS: toc:nil’. Then insert ‘#+TOC: headlines N’ at the +desired location(s). + + #+OPTIONS: toc:nil + ... + #+TOC: headlines 2 + + To adjust the table of contents depth for a specific section of the +Org document, append an additional ‘local’ parameter. This parameter +becomes a relative depth for the current level. The following example +inserts a local table of contents, with direct children only. + + * Section + #+TOC: headlines 1 local + + Note that for this feature to work properly in LaTeX export, the Org +file requires the inclusion of the titletoc package. Because of +compatibility issues, titletoc has to be loaded _before_ hyperref. +Customize the ‘org-latex-default-packages-alist’ variable. + + Use the ‘TOC’ keyword to generate list of tables—respectively, all +listings—with captions. + + #+TOC: listings + #+TOC: tables + + Normally Org uses the headline for its entry in the table of +contents. But with ‘ALT_TITLE’ property, a different entry can be +specified for the table of contents. + + ---------- Footnotes ---------- + + (1) At the moment, some export back-ends do not obey this +specification. For example, LaTeX export excludes every unnumbered +headline from the table of contents. + + +File: org, Node: Include Files, Next: Macro Replacement, Prev: Table of Contents, Up: Exporting + +12.4 Include Files +================== + +During export, you can include the content of another file. For +example, to include your ‘.emacs’ file, you could use: + + #+INCLUDE: "~/.emacs" src emacs-lisp + +The first parameter is the file name to include. The optional second +parameter specifies the block type: ‘example’, ‘export’ or ‘src’. The +optional third parameter specifies the source code language to use for +formatting the contents. This is relevant to both ‘export’ and ‘src’ +block types. + + If an included file is specified as having a markup language, Org +neither checks for valid syntax nor changes the contents in any way. +For example and source blocks, Org code-escapes the contents before +inclusion. + + If an included file is not specified as having any markup language, +Org assumes it be in Org format and proceeds as usual with a few +exceptions. Org makes the footnote labels (see *note Creating +Footnotes::) in the included file local to that file. The contents of +the included file belong to the same structure—headline, item—containing +the ‘INCLUDE’ keyword. In particular, headlines within the file become +children of the current section. That behavior can be changed by +providing an additional keyword parameter, ‘:minlevel’. It shifts the +headlines in the included file to become the lowest level. For example, +this syntax makes the included file a sibling of the current top-level +headline: + + #+INCLUDE: "~/my-book/chapter2.org" :minlevel 1 + + Inclusion of only portions of files are specified using ranges +parameter with ‘:lines’ keyword. The line at the upper end of the range +will not be included. The start and/or the end of the range may be +omitted to use the obvious defaults. + +‘#+INCLUDE: "~/.emacs" :lines "5-10"’ Include lines 5 to 10, 10 excluded +‘#+INCLUDE: "~/.emacs" :lines "-10"’ Include lines 1 to 10, 10 excluded +‘#+INCLUDE: "~/.emacs" :lines "10-"’ Include lines from 10 to EOF + + Inclusions may specify a file-link to extract an object matched by +‘org-link-search’(1) (see *note Search Options::). The ranges for +‘:lines’ keyword are relative to the requested element. Therefore, + + #+INCLUDE: "./paper.org::*conclusion" :lines 1-20 + +includes the first 20 lines of the headline named ‘conclusion’. + + To extract only the contents of the matched object, set +‘:only-contents’ property to non-‘nil’. This omits any planning lines +or property drawers. For example, to include the body of the heading +with the custom ID ‘theory’, you can use + + #+INCLUDE: "./paper.org::#theory" :only-contents t + + The following command allows navigating back and forth to the +included document: + +‘C-c '’ (‘org-edit~special’) + + Visit the included file at point. + + ---------- Footnotes ---------- + + (1) Note that ‘org-link-search-must-match-exact-headline’ is locally +bound to non-‘nil’. Therefore, ‘org-link-search’ only matches headlines +and named elements. + + +File: org, Node: Macro Replacement, Next: Comment Lines, Prev: Include Files, Up: Exporting + +12.5 Macro Replacement +====================== + +Macros replace text snippets during export. Macros are defined globally +in ‘org-export-global-macros’, or document-wise with the following +syntax: + + #+MACRO: name replacement text; $1, $2 are arguments + +which can be referenced using ‘{{{name(arg1, arg2)}}}’(1). For example + + #+MACRO: poem Rose is $1, violet's $2. Life's ordered: Org assists you. + {{{poem(red,blue)}}} + +becomes + + Rose is red, violet's blue. Life's ordered: Org assists you. + + As a special case, Org parses any replacement text starting with +‘(eval’ as an Emacs Lisp expression and evaluates it accordingly. +Within such templates, arguments become strings. Thus, the following +macro + + #+MACRO: gnustamp (eval (concat "GNU/" (capitalize $1))) + +turns ‘{{{gnustamp(linux)}}}’ into ‘GNU/Linux’ during export. + + Org recognizes macro references in following Org markup areas: +paragraphs, headlines, verse blocks, tables cells and lists. Org also +recognizes macro references in keywords, such as ‘CAPTION’, ‘TITLE’, +‘AUTHOR’, ‘DATE’, and for some back-end specific export options. + + Org comes with following pre-defined macros: + +‘{{{keyword(NAME)}}}’ +‘{{{title}}}’ +‘{{{author}}}’ +‘{{{email}}}’ + The ‘keyword’ macro collects all values from NAME keywords + throughout the buffer, separated with white space. ‘title’, + ‘author’ and ‘email’ macros are shortcuts for, respectively, + ‘{{{keyword(TITLE)}}}’, ‘{{{keyword(AUTHOR)}}}’ and + ‘{{{keyword(EMAIL)}}}’. + +‘{{{date}}}’ +‘{{{date(FORMAT)}}}’ + This macro refers to the ‘DATE’ keyword. FORMAT is an optional + argument to the ‘date’ macro that is used only if ‘DATE’ is a + single timestamp. FORMAT should be a format string understood by + ‘format-time-string’. + +‘{{{time(FORMAT)}}}’ +‘{{{modification-time(FORMAT, VC)}}}’ + These macros refer to the document’s date and time of export and + date and time of modification. FORMAT is a string understood by + ‘format-time-string’. If the second argument to the + ‘modification-time’ macro is non-‘nil’, Org uses ‘vc.el’ to + retrieve the document’s modification time from the version control + system. Otherwise Org reads the file attributes. + +‘{{{input-file}}}’ + This macro refers to the filename of the exported file. + +‘{{{property(PROPERTY-NAME)}}}’ +‘{{{property(PROPERTY-NAME, SEARCH OPTION)}}}’ + This macro returns the value of property PROPERTY-NAME in the + current entry. If SEARCH-OPTION (see *note Search Options::) + refers to a remote entry, use it instead. + +‘{{{n}}}’ +‘{{{n(NAME)}}}’ +‘{{{n(NAME, ACTION)}}}’ + This macro implements custom counters by returning the number of + times the macro has been expanded so far while exporting the + buffer. You can create more than one counter using different NAME + values. If ACTION is ‘-’, previous value of the counter is held, + i.e., the specified counter is not incremented. If the value is a + number, the specified counter is set to that value. If it is any + other non-empty string, the specified counter is reset to 1. You + may leave NAME empty to reset the default counter. + + Moreover, inline source blocks (see *note Structure of Code Blocks::) +use the special ‘results’ macro to mark their output. As such, you are +advised against re-defining it, unless you know what you are doing. + + The surrounding brackets can be made invisible by setting +‘org-hide-macro-markers’ to a non-‘nil’ value. + + Org expands macros at the very beginning of the export process. + + ---------- Footnotes ---------- + + (1) Since commas separate the arguments, commas within arguments have +to be escaped with the backslash character. So only those backslash +characters before a comma need escaping with another backslash +character. + + +File: org, Node: Comment Lines, Next: ASCII/Latin-1/UTF-8 export, Prev: Macro Replacement, Up: Exporting + +12.6 Comment Lines +================== + +Lines starting with zero or more whitespace characters followed by one +‘#’ and a whitespace are treated as comments and, as such, are not +exported. + + Likewise, regions surrounded by ‘#+BEGIN_COMMENT’ ... ‘#+END_COMMENT’ +are not exported. + + Finally, a ‘COMMENT’ keyword at the beginning of an entry, but after +any other keyword or priority cookie, comments out the entire subtree. +In this case, the subtree is not exported and no code block within it is +executed either(1). The command below helps changing the comment status +of a headline. + +‘C-c ;’ (‘org-toggle-comment’) + + Toggle the ‘COMMENT’ keyword at the beginning of an entry. + + ---------- Footnotes ---------- + + (1) For a less drastic behavior, consider using a select tag (see +*note Export Settings::) instead. + + +File: org, Node: ASCII/Latin-1/UTF-8 export, Next: Beamer Export, Prev: Comment Lines, Up: Exporting + +12.7 ASCII/Latin-1/UTF-8 export +=============================== + +ASCII export produces an output file containing only plain ASCII +characters. This is the simplest and most direct text output. It does +not contain any Org markup. Latin-1 and UTF-8 export use additional +characters and symbols available in these encoding standards. All three +of these export formats offer the most basic of text output for maximum +portability. + + On export, Org fills and justifies text according to the text width +set in ‘org-ascii-text-width’. + + Org exports links using a footnote-like style where the descriptive +part is in the text and the link is in a note before the next heading. +See the variable ‘org-ascii-links-to-notes’ for details. + +ASCII export commands +--------------------- + +‘C-c C-e t a’ (‘org-ascii-export-to-ascii’) +‘C-c C-e t l’ +‘C-c C-e t u’ + + Export as an ASCII file with a ‘.txt’ extension. For ‘myfile.org’, + Org exports to ‘myfile.txt’, overwriting without warning. For + ‘myfile.txt’, Org exports to ‘myfile.txt.txt’ in order to prevent + data loss. + +‘C-c C-e t A’ (‘org-ascii-export-to-ascii’) +‘C-c C-e t L’ +‘C-c C-e t U’ + + Export to a temporary buffer. Does not create a file. + +ASCII specific export settings +------------------------------ + +The ASCII export back-end has one extra keyword for customizing ASCII +output. Setting this keyword works similar to the general options (see +*note Export Settings::). + +‘SUBTITLE’ + The document subtitle. For long subtitles, use multiple + ‘#+SUBTITLE’ lines in the Org file. Org prints them on one + continuous line, wrapping into multiple lines if necessary. + +Header and sectioning structure +------------------------------- + +Org converts the first three outline levels into headlines for ASCII +export. The remaining levels are turned into lists. To change this +cut-off point where levels become lists, see *note Export Settings::. + +Quoting ASCII text +------------------ + +To insert text within the Org file by the ASCII back-end, use one the +following constructs, inline, keyword, or export block: + + Inline text @@ascii:and additional text@@ within a paragraph. + + #+ASCII: Some text + + #+BEGIN_EXPORT ascii + Org exports text in this block only when using ASCII back-end. + #+END_EXPORT + +ASCII specific attributes +------------------------- + +ASCII back-end recognizes only one attribute, ‘:width’, which specifies +the width of a horizontal rule in number of characters. The keyword and +syntax for specifying widths is: + + #+ATTR_ASCII: :width 10 + ----- + +ASCII special blocks +-------------------- + +Besides ‘#+BEGIN_CENTER’ blocks (see *note Paragraphs::), ASCII back-end +has these two left and right justification blocks: + + #+BEGIN_JUSTIFYLEFT + It's just a jump to the left... + #+END_JUSTIFYLEFT + + #+BEGIN_JUSTIFYRIGHT + ...and then a step to the right. + #+END_JUSTIFYRIGHT + + +File: org, Node: Beamer Export, Next: HTML Export, Prev: ASCII/Latin-1/UTF-8 export, Up: Exporting + +12.8 Beamer Export +================== + +Org uses Beamer export to convert an Org file tree structure into +high-quality interactive slides for presentations. Beamer is a LaTeX +document class for creating presentations in PDF, HTML, and other +popular display formats. + +* Menu: + +* Beamer export commands:: For creating Beamer documents. +* Beamer specific export settings:: For customizing Beamer export. +* Frames and Blocks in Beamer:: For composing Beamer slides. +* Beamer specific syntax:: For using in Org documents. +* Editing support:: Editing support. +* A Beamer example:: A complete presentation. + + +File: org, Node: Beamer export commands, Next: Beamer specific export settings, Up: Beamer Export + +12.8.1 Beamer export commands +----------------------------- + +‘C-c C-e l b’ (‘org-beamer-export-to-latex’) + + Export as LaTeX file with a ‘.tex’ extension. For ‘myfile.org’, + Org exports to ‘myfile.tex’, overwriting without warning. + +‘C-c C-e l B’ (‘org-beamer-export-as-latex’) + + Export to a temporary buffer. Does not create a file. + +‘C-c C-e l P’ (‘org-beamer-export-to-pdf’) + + Export as LaTeX file and then convert it to PDF format. + +‘C-c C-e l O’ + + Export as LaTeX file, convert it to PDF format, and then open the + PDF file. + + +File: org, Node: Beamer specific export settings, Next: Frames and Blocks in Beamer, Prev: Beamer export commands, Up: Beamer Export + +12.8.2 Beamer specific export settings +-------------------------------------- + +Beamer export back-end has several additional keywords for customizing +Beamer output. These keywords work similar to the general options +settings (see *note Export Settings::). + +‘BEAMER_THEME’ + The Beamer layout theme (‘org-beamer-theme’). Use square brackets + for options. For example: + + #+BEAMER_THEME: Rochester [height=20pt] + +‘BEAMER_FONT_THEME’ + The Beamer font theme. + +‘BEAMER_INNER_THEME’ + The Beamer inner theme. + +‘BEAMER_OUTER_THEME’ + The Beamer outer theme. + +‘BEAMER_HEADER’ + Arbitrary lines inserted in the preamble, just before the + ‘hyperref’ settings. + +‘DESCRIPTION’ + The document description. For long descriptions, use multiple + ‘DESCRIPTION’ keywords. By default, ‘hyperref’ inserts + ‘DESCRIPTION’ as metadata. Use ‘org-latex-hyperref-template’ to + configure document metadata. Use ‘org-latex-title-command’ to + configure typesetting of description as part of front matter. + +‘KEYWORDS’ + The keywords for defining the contents of the document. Use + multiple ‘KEYWORDS’ lines if necessary. By default, ‘hyperref’ + inserts ‘KEYWORDS’ as metadata. Use ‘org-latex-hyperref-template’ + to configure document metadata. Use ‘org-latex-title-command’ to + configure typesetting of keywords as part of front matter. + +‘SUBTITLE’ + Document’s subtitle. For typesetting, use + ‘org-beamer-subtitle-format’ string. Use + ‘org-latex-hyperref-template’ to configure document metadata. Use + ‘org-latex-title-command’ to configure typesetting of subtitle as + part of front matter. + + +File: org, Node: Frames and Blocks in Beamer, Next: Beamer specific syntax, Prev: Beamer specific export settings, Up: Beamer Export + +12.8.3 Frames and Blocks in Beamer +---------------------------------- + +Org transforms heading levels into Beamer’s sectioning elements, frames +and blocks. Any Org tree with a not-too-deep-level nesting should in +principle be exportable as a Beamer presentation. + + • Org headlines become Beamer frames when the heading level in Org is + equal to ‘org-beamer-frame-level’ or ‘H’ value in a ‘OPTIONS’ line + (see *note Export Settings::). + + Org overrides headlines to frames conversion for the current tree + of an Org file if it encounters the ‘BEAMER_ENV’ property set to + ‘frame’ or ‘fullframe’. Org ignores whatever + ‘org-beamer-frame-level’ happens to be for that headline level in + the Org tree. In Beamer terminology, a full frame is a frame + without its title. + + • Org exports a Beamer frame’s objects as block environments. Org + can enforce wrapping in special block types when ‘BEAMER_ENV’ + property is set(1). For valid values see + ‘org-beamer-environments-default’. To add more values, see + ‘org-beamer-environments-extra’. + + • If ‘BEAMER_ENV’ is set to ‘appendix’, Org exports the entry as an + appendix. When set to ‘note’, Org exports the entry as a note + within the frame or between frames, depending on the entry’s + heading level. When set to ‘noteNH’, Org exports the entry as a + note without its title. When set to ‘againframe’, Org exports the + entry with ‘\againframe’ command, which makes setting the + ‘BEAMER_REF’ property mandatory because ‘\againframe’ needs frame + to resume. + + When ‘ignoreheading’ is set, Org export ignores the entry’s + headline but not its content. This is useful for inserting content + between frames. It is also useful for properly closing a ‘column’ + environment. @end itemize + + When ‘BEAMER_ACT’ is set for a headline, Org export translates that + headline as an overlay or action specification. When enclosed in + square brackets, Org export makes the overlay specification a + default. Use ‘BEAMER_OPT’ to set any options applicable to the + current Beamer frame or block. The Beamer export back-end wraps + with appropriate angular or square brackets. It also adds the + ‘fragile’ option for any code that may require a verbatim block. + + To create a column on the Beamer slide, use the ‘BEAMER_COL’ + property for its headline in the Org file. Set the value of + ‘BEAMER_COL’ to a decimal number representing the fraction of the + total text width. Beamer export uses this value to set the + column’s width and fills the column with the contents of the Org + entry. If the Org entry has no specific environment defined, + Beamer export ignores the heading. If the Org entry has a defined + environment, Beamer export uses the heading as title. Behind the + scenes, Beamer export automatically handles LaTeX column + separations for contiguous headlines. To manually adjust them for + any unique configurations needs, use the ‘BEAMER_ENV’ property. + + ---------- Footnotes ---------- + + (1) If ‘BEAMER_ENV’ is set, Org export adds ‘B_environment’ tag to +make it visible. The tag serves as a visual aid and has no semantic +relevance. + + +File: org, Node: Beamer specific syntax, Next: Editing support, Prev: Frames and Blocks in Beamer, Up: Beamer Export + +12.8.4 Beamer specific syntax +----------------------------- + +Since Org’s Beamer export back-end is an extension of the LaTeX +back-end, it recognizes other LaTeX specific syntax—for example, +‘#+LATEX:’ or ‘#+ATTR_LATEX:’. See *note LaTeX Export::, for details. + + Beamer export wraps the table of contents generated with ‘toc:t’ +‘OPTION’ keyword in a ‘frame’ environment. Beamer export does not wrap +the table of contents generated with ‘TOC’ keyword (see *note Table of +Contents::). Use square brackets for specifying options. + + #+TOC: headlines [currentsection] + + Insert Beamer-specific code using the following constructs: + + #+BEAMER: \pause + + #+BEGIN_EXPORT beamer + Only Beamer export back-end exports this. + #+END_BEAMER + + Text @@beamer:some code@@ within a paragraph. + + Inline constructs, such as the last one above, are useful for adding +overlay specifications to objects with ‘bold’, ‘item’, ‘link’, +‘radio-target’ and ‘target’ types. Enclose the value in angular +brackets and place the specification at the beginning of the object as +shown in this example: + + A *@@beamer:<2->@@useful* feature + + Beamer export recognizes the ‘ATTR_BEAMER’ keyword with the following +attributes from Beamer configurations: ‘:environment’ for changing local +Beamer environment, ‘:overlay’ for specifying Beamer overlays in angular +or square brackets, and ‘:options’ for inserting optional arguments. + + #+ATTR_BEAMER: :environment nonindentlist + - item 1, not indented + - item 2, not indented + - item 3, not indented + + #+ATTR_BEAMER: :overlay <+-> + - item 1 + - item 2 + + #+ATTR_BEAMER: :options [Lagrange] + Let $G$ be a finite group, and let $H$ be + a subgroup of $G$. Then the order of $H$ divides the order of $G$. + + +File: org, Node: Editing support, Next: A Beamer example, Prev: Beamer specific syntax, Up: Beamer Export + +12.8.5 Editing support +---------------------- + +The ‘org-beamer-mode’ is a special minor mode for faster editing of +Beamer documents. + + #+STARTUP: beamer + +‘C-c C-b’ (‘org-beamer-select-environment’) + + The ‘org-beamer-mode’ provides this key for quicker selections in + Beamer normal environments, and for selecting the ‘BEAMER_COL’ + property. + + +File: org, Node: A Beamer example, Prev: Editing support, Up: Beamer Export + +12.8.6 A Beamer example +----------------------- + +Here is an example of an Org document ready for Beamer export. + + #+TITLE: Example Presentation + #+AUTHOR: Carsten Dominik + #+OPTIONS: H:2 toc:t num:t + #+LATEX_CLASS: beamer + #+LATEX_CLASS_OPTIONS: [presentation] + #+BEAMER_THEME: Madrid + #+COLUMNS: %45ITEM %10BEAMER_ENV(Env) %10BEAMER_ACT(Act) %4BEAMER_COL(Col) + + * This is the first structural section + + ** Frame 1 + *** Thanks to Eric Fraga :B_block: + :PROPERTIES: + :BEAMER_COL: 0.48 + :BEAMER_ENV: block + :END: + for the first viable Beamer setup in Org + *** Thanks to everyone else :B_block: + :PROPERTIES: + :BEAMER_COL: 0.48 + :BEAMER_ACT: <2-> + :BEAMER_ENV: block + :END: + for contributing to the discussion + **** This will be formatted as a beamer note :B_note: + :PROPERTIES: + :BEAMER_env: note + :END: + ** Frame 2 (where we will not use columns) + *** Request + Please test this stuff! + + +File: org, Node: HTML Export, Next: LaTeX Export, Prev: Beamer Export, Up: Exporting + +12.9 HTML Export +================ + +Org mode contains an HTML exporter with extensive HTML formatting +compatible with XHTML 1.0 strict standard. + +* Menu: + +* HTML export commands:: Invoking HTML export. +* HTML specific export settings:: Settings for HTML export. +* HTML doctypes:: Exporting various (X)HTML flavors. +* HTML preamble and postamble:: Inserting preamble and postamble. +* Quoting HTML tags:: Using direct HTML in Org files. +* Links in HTML export:: Inserting and formatting links. +* Tables in HTML export:: How to modify the formatting of tables. +* Images in HTML export:: How to insert figures into HTML output. +* Math formatting in HTML export:: Beautiful math also on the web. +* Text areas in HTML export:: An alternate way to show an example. +* CSS support:: Changing the appearance of the output. +* JavaScript support:: Info and folding in a web browser. + + +File: org, Node: HTML export commands, Next: HTML specific export settings, Up: HTML Export + +12.9.1 HTML export commands +--------------------------- + +‘C-c C-e h h’ (‘org-html-export-to-html’) + + Export as HTML file with a ‘.html’ extension. For ‘myfile.org’, + Org exports to ‘myfile.html’, overwriting without warning. + {{{kbd{C-c C-e h o)}}} exports to HTML and opens it in a web + browser. + +‘C-c C-e h H’ (‘org-html-export-as-html’) + + Exports to a temporary buffer. Does not create a file. + + +File: org, Node: HTML specific export settings, Next: HTML doctypes, Prev: HTML export commands, Up: HTML Export + +12.9.2 HTML specific export settings +------------------------------------ + +HTML export has a number of keywords, similar to the general options +settings described in *note Export Settings::. + +‘DESCRIPTION’ + This is the document’s description, which the HTML exporter inserts + it as a HTML meta tag in the HTML file. For long descriptions, use + multiple ‘DESCRIPTION’ lines. The exporter takes care of wrapping + the lines properly. + +‘HTML_DOCTYPE’ + Specify the document type, for example: HTML5 (‘org-html-doctype’). + +‘HTML_CONTAINER’ + Specify the HTML container, such as ‘div’, for wrapping sections + and elements (‘org-html-container-element’). + +‘HTML_LINK_HOME’ + The URL for home link (‘org-html-link-home’). + +‘HTML_LINK_UP’ + The URL for the up link of exported HTML pages + (‘org-html-link-up’). + +‘HTML_MATHJAX’ + Options for MathJax (‘org-html-mathjax-options’). MathJax is used + to typeset LaTeX math in HTML documents. See *note Math formatting + in HTML export::, for an example. + +‘HTML_HEAD’ + Arbitrary lines for appending to the HTML document’s head + (‘org-html-head’). + +‘HTML_HEAD_EXTRA’ + More arbitrary lines for appending to the HTML document’s head + (‘org-html-head-extra’). + +‘KEYWORDS’ + Keywords to describe the document’s content. HTML exporter inserts + these keywords as HTML meta tags. For long keywords, use multiple + ‘KEYWORDS’ lines. + +‘LATEX_HEADER’ + Arbitrary lines for appending to the preamble; HTML exporter + appends when transcoding LaTeX fragments to images (see *note Math + formatting in HTML export::). + +‘SUBTITLE’ + The document’s subtitle. HTML exporter formats subtitle if + document type is ‘HTML5’ and the CSS has a ‘subtitle’ class. + + Some of these keywords are explained in more detail in the following +sections of the manual. + + +File: org, Node: HTML doctypes, Next: HTML preamble and postamble, Prev: HTML specific export settings, Up: HTML Export + +12.9.3 HTML doctypes +-------------------- + +Org can export to various (X)HTML flavors. + + Set the ‘org-html-doctype’ variable for different (X)HTML variants. +Depending on the variant, the HTML exporter adjusts the syntax of HTML +conversion accordingly. Org includes the following ready-made variants: + + • ‘"html4-strict"’ + • ‘"html4-transitional"’ + • ‘"html4-frameset"’ + • ‘"xhtml-strict"’ + • ‘"xhtml-transitional"’ + • ‘"xhtml-frameset"’ + • ‘"xhtml-11"’ + • ‘"html5"’ + • ‘"xhtml5"’ + +See the variable ‘org-html-doctype-alist’ for details. The default is +‘"xhtml-strict"’. + + Org’s HTML exporter does not by default enable new block elements +introduced with the HTML5 standard. To enable them, set +‘org-html-html5-fancy’ to non-‘nil’. Or use an ‘OPTIONS’ line in the +file to set ‘html5-fancy’. + + HTML5 documents can now have arbitrary ‘#+BEGIN’ ... ‘#+END’ blocks. +For example: + + #+BEGIN_aside + Lorem ipsum + #+END_aside + +exports to: + + + +while this: + + #+ATTR_HTML: :controls controls :width 350 + #+BEGIN_video + #+HTML: + #+HTML: + Your browser does not support the video tag. + #+END_video + +exports to: + + + + When special blocks do not have a corresponding HTML5 element, the +HTML exporter reverts to standard translation (see +‘org-html-html5-elements’). For example, ‘#+BEGIN_lederhosen’ exports +to ‘
’. + + Special blocks cannot have headlines. For the HTML exporter to wrap +the headline and its contents in ‘
’ or ‘
’ tags, set +the ‘HTML_CONTAINER’ property for the headline. + + +File: org, Node: HTML preamble and postamble, Next: Quoting HTML tags, Prev: HTML doctypes, Up: HTML Export + +12.9.4 HTML preamble and postamble +---------------------------------- + +The HTML exporter has delineations for preamble and postamble. The +default value for ‘org-html-preamble’ is ‘t’, which makes the HTML +exporter insert the preamble. See the variable +‘org-html-preamble-format’ for the format string. + + Set ‘org-html-preamble’ to a string to override the default format +string. If the string is a function, the HTML exporter expects the +function to return a string upon execution. The HTML exporter inserts +this string in the preamble. The HTML exporter does not insert a +preamble if ‘org-html-preamble’ is set ‘nil’. + + The default value for ‘org-html-postamble’ is ‘auto’, which makes the +HTML exporter build a postamble from looking up author’s name, email +address, creator’s name, and date. Set ‘org-html-postamble’ to ‘t’ to +insert the postamble in the format specified in the +‘org-html-postamble-format’ variable. The HTML exporter does not insert +a postamble if ‘org-html-postamble’ is set to ‘nil’. + + +File: org, Node: Quoting HTML tags, Next: Links in HTML export, Prev: HTML preamble and postamble, Up: HTML Export + +12.9.5 Quoting HTML tags +------------------------ + +The HTML export back-end transforms ‘<’ and ‘>’ to ‘<’ and ‘>’. + + To include raw HTML code in the Org file so the HTML export back-end +can insert that HTML code in the output, use this inline syntax: +‘@@html:...@@’. For example: + + @@html:@@bold text@@html:@@ + + For larger raw HTML code blocks, use these HTML export code blocks: + + #+HTML: Literal HTML code for export + + #+BEGIN_EXPORT html + All lines between these markers are exported literally + #+END_EXPORT + + +File: org, Node: Links in HTML export, Next: Tables in HTML export, Prev: Quoting HTML tags, Up: HTML Export + +12.9.6 Links in HTML export +--------------------------- + +The HTML export back-end transforms Org’s internal links (see *note +Internal Links::) to equivalent HTML links in the output. The back-end +similarly handles Org’s automatic links created by radio targets (see +*note Radio Targets::) similarly. For Org links to external files, the +back-end transforms the links to _relative_ paths. + + For Org links to other ‘.org’ files, the back-end automatically +changes the file extension to ‘.html’ and makes file paths relative. If +the ‘.org’ files have an equivalent ‘.html’ version at the same +location, then the converted links should work without any further +manual intervention. However, to disable this automatic path +translation, set ‘org-html-link-org-files-as-html’ to ‘nil’. When +disabled, the HTML export back-end substitutes the ID-based links in the +HTML output. For more about linking files when publishing to a +directory, see *note Publishing links::. + + Org files can also have special directives to the HTML export +back-end. For example, by using ‘#+ATTR_HTML’ lines to specify new +format attributes to ‘’ or ‘’ tags. This example shows changing +the link’s title and style: + + #+ATTR_HTML: :title The Org mode homepage :style color:red; + [[https://orgmode.org]] + + +File: org, Node: Tables in HTML export, Next: Images in HTML export, Prev: Links in HTML export, Up: HTML Export + +12.9.7 Tables in HTML export +---------------------------- + +The HTML export back-end uses ‘org-html-table-default-attributes’ when +exporting Org tables to HTML. By default, the exporter does not draw +frames and cell borders. To change for this for a table, use the +following lines before the table in the Org file: + + #+CAPTION: This is a table with lines around and between cells + #+ATTR_HTML: border="2" rules="all" frame="border" + + The HTML export back-end preserves column groupings in Org tables +(see *note Column Groups::) when exporting to HTML. + + Additional options for customizing tables for HTML export. + +‘org-html-table-align-individual-fields’ + Non-‘nil’ attaches style attributes for alignment to each table + field. + +‘org-html-table-caption-above’ + Non-‘nil’ places caption string at the beginning of the table. + +‘org-html-table-data-tags’ + Opening and ending tags for table data fields. + +‘org-html-table-default-attributes’ + Default attributes and values for table tags. + +‘org-html-table-header-tags’ + Opening and ending tags for table’s header fields. + +‘org-html-table-row-tags’ + Opening and ending tags for table rows. + +‘org-html-table-use-header-tags-for-first-column’ + Non-‘nil’ formats column one in tables with header tags. + + +File: org, Node: Images in HTML export, Next: Math formatting in HTML export, Prev: Tables in HTML export, Up: HTML Export + +12.9.8 Images in HTML export +---------------------------- + +The HTML export back-end has features to convert Org image links to HTML +inline images and HTML clickable image links. + + When the link in the Org file has no description, the HTML export +back-end by default in-lines that image. For example: +‘[[file:myimg.jpg]]’ is in-lined, while ‘[[file:myimg.jpg][the image]]’ +links to the text, ‘the image’. For more details, see the variable +‘org-html-inline-images’. + + On the other hand, if the description part of the Org link is itself +another link, such as ‘file:’ or ‘http:’ URL pointing to an image, the +HTML export back-end in-lines this image and links to the main image. +This Org syntax enables the back-end to link low-resolution thumbnail to +the high-resolution version of the image, as shown in this example: + + [[file:highres.jpg][file:thumb.jpg]] + + To change attributes of in-lined images, use ‘#+ATTR_HTML’ lines in +the Org file. This example shows realignment to right, and adds ‘alt’ +and ‘title’ attributes in support of text viewers and modern web +accessibility standards. + + #+CAPTION: A black cat stalking a spider + #+ATTR_HTML: :alt cat/spider image :title Action! :align right + [[./img/a.jpg]] + + The HTML export back-end copies the ‘http’ links from the Org file +as-is. + + +File: org, Node: Math formatting in HTML export, Next: Text areas in HTML export, Prev: Images in HTML export, Up: HTML Export + +12.9.9 Math formatting in HTML export +------------------------------------- + +LaTeX math snippets (see *note LaTeX fragments::) can be displayed in +two different ways on HTML pages. The default is to use the MathJax +(http://www.mathjax.org), which should work out of the box with +Org(1)(2). Some MathJax display options can be configured via +‘org-html-mathjax-options’, or in the buffer. For example, with the +following settings, + + #+HTML_MATHJAX: align: left indent: 5em tagside: left font: Neo-Euler + #+HTML_MATHJAX: cancel.js noErrors.js + +equation labels are displayed on the left margin and equations are five +em from the left margin. In addition, it loads the two MathJax +extensions ‘cancel.js’ and ‘noErrors.js’(3). + + See the docstring of ‘org-html-mathjax-options’ for all supported +variables. The MathJax template can be configure via +‘org-html-mathjax-template’. + + If you prefer, you can also request that LaTeX fragments are +processed into small images that will be inserted into the browser page. +Before the availability of MathJax, this was the default method for Org +files. This method requires that the dvipng program, dvisvgm or +ImageMagick suite is available on your system. You can still get this +processing with + + #+OPTIONS: tex:dvipng + + #+OPTIONS: tex:dvisvgm + +or + + #+OPTIONS: tex:imagemagick + + ---------- Footnotes ---------- + + (1) By default Org loads MathJax from cdnjs.com (https://cdnjs.com) +as recommended by MathJax (http://www.mathjax.org). + + (2) Please note that exported formulas are part of an HTML document, +and that signs such as ‘<’, ‘>’, or ‘&’ have special meanings. See +MathJax TeX and LaTeX support +(http://docs.mathjax.org/en/latest/tex.html#tex-and-latex-in-html-documents). + + (3) See TeX and LaTeX extensions +(http://docs.mathjax.org/en/latest/tex.html#tex-extensions) in the +MathJax manual (http://docs.mathjax.org) to learn about extensions. + + +File: org, Node: Text areas in HTML export, Next: CSS support, Prev: Math formatting in HTML export, Up: HTML Export + +12.9.10 Text areas in HTML export +--------------------------------- + +Before Org mode’s Babel, one popular approach to publishing code in HTML +was by using ‘:textarea’. The advantage of this approach was that +copying and pasting was built into browsers with simple JavaScript +commands. Even editing before pasting was made simple. + + The HTML export back-end can create such text areas. It requires an +‘#+ATTR_HTML’ line as shown in the example below with the ‘:textarea’ +option. This must be followed by either an example or a source code +block. Other Org block types do not honor the ‘:textarea’ option. + + By default, the HTML export back-end creates a text area 80 +characters wide and height just enough to fit the content. Override +these defaults with ‘:width’ and ‘:height’ options on the ‘#+ATTR_HTML’ +line. + + #+ATTR_HTML: :textarea t :width 40 + #+BEGIN_EXAMPLE + (defun org-xor (a b) + "Exclusive or." + (if a (not b) b)) + #+END_EXAMPLE + + +File: org, Node: CSS support, Next: JavaScript support, Prev: Text areas in HTML export, Up: HTML Export + +12.9.11 CSS support +------------------- + +You can modify the CSS style definitions for the exported file. The +HTML exporter assigns the following special CSS classes(1) to +appropriate parts of the document—your style specifications may change +these, in addition to any of the standard classes like for headlines, +tables, etc. + +‘p.author’ author information, including email +‘p.date’ publishing date +‘p.creator’ creator info, about org mode version +‘.title’ document title +‘.subtitle’ document subtitle +‘.todo’ TODO keywords, all not-done states +‘.done’ the DONE keywords, all states that count as done +‘.WAITING’ each TODO keyword also uses a class named after itself +‘.timestamp’ timestamp +‘.timestamp-kwd’ keyword associated with a timestamp, like ‘SCHEDULED’ +‘.timestamp-wrapper’ span around keyword plus timestamp +‘.tag’ tag in a headline +‘._HOME’ each tag uses itself as a class, “@” replaced by “_” +‘.target’ target for links +‘.linenr’ the line number in a code example +‘.code-highlighted’ for highlighting referenced code lines +‘div.outline-N’ div for outline level N (headline plus text) +‘div.outline-text-N’ extra div for text at outline level N +‘.section-number-N’ section number in headlines, different for each level +‘.figure-number’ label like “Figure 1:” +‘.table-number’ label like “Table 1:” +‘.listing-number’ label like “Listing 1:” +‘div.figure’ how to format an in-lined image +‘pre.src’ formatted source code +‘pre.example’ normal example +‘p.verse’ verse paragraph +‘div.footnotes’ footnote section headline +‘p.footnote’ footnote definition paragraph, containing a footnote +‘.footref’ a footnote reference number (always a ) +‘.footnum’ footnote number in footnote definition (always ) +‘.org-svg’ default class for a linked ‘.svg’ image + + The HTML export back-end includes a compact default style in each +exported HTML file. To override the default style with another style, +use these keywords in the Org file. They will replace the global +defaults the HTML exporter uses. + + #+HTML_HEAD: + #+HTML_HEAD_EXTRA: + + To just turn off the default style, customize +‘org-html-head-include-default-style’ variable, or use this option line +in the Org file. + + #+OPTIONS: html-style:nil + + For longer style definitions, either use several ‘HTML_HEAD’ and +‘HTML_HEAD_EXTRA’ keywords, or use ‘’ blocks around +them. Both of these approaches can avoid referring to an external file. + + In order to add styles to a sub-tree, use the ‘HTML_CONTAINER_CLASS’ +property to assign a class to the tree. In order to specify CSS styles +for a particular headline, you can use the ID specified in a ‘CUSTOM_ID’ +property. + + Never change the ‘org-html-style-default’ constant. Instead use +other simpler ways of customizing as described above. + + ---------- Footnotes ---------- + + (1) If the classes on TODO keywords and tags lead to conflicts, use +the variables ‘org-html-todo-kwd-class-prefix’ and +‘org-html-tag-class-prefix’ to make them unique. + + +File: org, Node: JavaScript support, Prev: CSS support, Up: HTML Export + +12.9.12 JavaScript supported display of web pages +------------------------------------------------- + +Sebastian Rose has written a JavaScript program especially designed to +enhance the web viewing experience of HTML files created with Org. This +program enhances large files in two different ways of viewing. One is +an _Info_-like mode where each section is displayed separately and +navigation can be done with the ‘n’ and ‘p’ keys, and some other keys as +well, press ‘?’ for an overview of the available keys. The second one +has a _folding_ view, much like Org provides inside Emacs. The script +is available at and the documentation +at . The script is hosted +on , but for reliability, prefer installing it on +your own web server. + + To use this program, just add this line to the Org file: + + #+INFOJS_OPT: view:info toc:nil + +The HTML header now has the code needed to automatically invoke the +script. For setting options, use the syntax from the above line for +options described below: + +‘path:’ + The path to the script. The default is to grab the script from + , but you might want to have a + local copy and use a path like ‘../scripts/org-info.js’. + +‘view:’ + Initial view when the website is first shown. Possible values are: + + ‘info’ Info-like interface with one section per page + ‘overview’ Folding interface, initially showing only top-level + ‘content’ Folding interface, starting with all headlines visible + ‘showall’ Folding interface, all headlines and text visible + +‘sdepth:’ + Maximum headline level still considered as an independent section + for info and folding modes. The default is taken from + ‘org-export-headline-levels’, i.e., the ‘H’ switch in ‘OPTIONS’. + If this is smaller than in ‘org-export-headline-levels’, each + info/folding section can still contain child headlines. + +‘toc:’ + Should the table of contents _initially_ be visible? Even when + ‘nil’, you can always get to the “toc” with ‘i’. + +‘tdepth:’ + The depth of the table of contents. The defaults are taken from + the variables ‘org-export-headline-levels’ and + ‘org-export-with-toc’. + +‘ftoc:’ + Does the CSS of the page specify a fixed position for the “toc”? + If yes, the toc is displayed as a section. + +‘ltoc:’ + Should there be short contents (children) in each section? Make + this ‘above’ if the section should be above initial text. + +‘mouse:’ + Headings are highlighted when the mouse is over them. Should be + ‘underline’ (default) or a background color like ‘#cccccc’. + +‘buttons:’ + Should view-toggle buttons be everywhere? When ‘nil’ (the + default), only one such button is present. + + You can choose default values for these options by customizing the +variable ‘org-infojs-options’. If you always want to apply the script +to your pages, configure the variable ‘org-export-html-use-infojs’. + + +File: org, Node: LaTeX Export, Next: Markdown Export, Prev: HTML Export, Up: Exporting + +12.10 LaTeX Export +================== + +The LaTeX export back-end can handle complex documents, incorporate +standard or custom LaTeX document classes, generate documents using +alternate LaTeX engines, and produce fully linked PDF files with +indexes, bibliographies, and tables of contents, destined for +interactive online viewing or high-quality print publication. + + While the details are covered in-depth in this section, here are some +quick references to variables for the impatient: for engines, see +‘org-latex-compiler’; for build sequences, see ‘org-latex-pdf-process’; +for packages, see ‘org-latex-default-packages-alist’ and +‘org-latex-packages-alist’. + + An important note about the LaTeX export back-end: it is sensitive to +blank lines in the Org document. That’s because LaTeX itself depends on +blank lines to tell apart syntactical elements, such as paragraphs. + +* Menu: + +* LaTeX/PDF export commands:: For producing LaTeX and PDF documents. +* LaTeX specific export settings:: Unique to this LaTeX back-end. +* LaTeX header and sectioning:: Setting up the export file structure. +* Quoting LaTeX code:: Incorporating literal LaTeX code. +* Tables in LaTeX export:: Options for exporting tables to LaTeX. +* Images in LaTeX export:: How to insert figures into LaTeX output. +* Plain lists in LaTeX export:: Attributes specific to lists. +* Source blocks in LaTeX export:: Attributes specific to source code blocks. +* Example blocks in LaTeX export:: Attributes specific to example blocks. +* Special blocks in LaTeX export:: Attributes specific to special blocks. +* Horizontal rules in LaTeX export:: Attributes specific to horizontal rules. + + +File: org, Node: LaTeX/PDF export commands, Next: LaTeX specific export settings, Up: LaTeX Export + +12.10.1 LaTeX/PDF export commands +--------------------------------- + +‘C-c C-e l l’ (‘org-latex-export-to-latex’) + Export to a LaTeX file with a ‘.tex’ extension. For ‘myfile.org’, + Org exports to ‘myfile.tex’, overwriting without warning. + +‘C-c C-e l L’ (‘org-latex-export-as-latex’) + Export to a temporary buffer. Do not create a file. + +‘C-c C-e l p’ (‘org-latex-export-to-pdf’) + Export as LaTeX file and convert it to PDF file. + +‘C-c C-e l o’ + Export as LaTeX file and convert it to PDF, then open the PDF using + the default viewer. + +‘M-x org-export-region-as-latex’ + Convert the region to LaTeX under the assumption that it was in Org + mode syntax before. This is a global command that can be invoked + in any buffer. + + The LaTeX export back-end can use any of these LaTeX engines: +‘pdflatex’, ‘xelatex’, and ‘lualatex’. These engines compile LaTeX +files with different compilers, packages, and output options. The LaTeX +export back-end finds the compiler version to use from +‘org-latex-compiler’ variable or the ‘#+LATEX_COMPILER’ keyword in the +Org file. See the docstring for the ‘org-latex-default-packages-alist’ +for loading packages with certain compilers. Also see +‘org-latex-bibtex-compiler’ to set the bibliography compiler(1). + + ---------- Footnotes ---------- + + (1) This does not allow setting different bibliography compilers for +different files. However, “smart” LaTeX compilation systems, such as +latexmk, can select the correct bibliography compiler. + + +File: org, Node: LaTeX specific export settings, Next: LaTeX header and sectioning, Prev: LaTeX/PDF export commands, Up: LaTeX Export + +12.10.2 LaTeX specific export settings +-------------------------------------- + +The LaTeX export back-end has several additional keywords for +customizing LaTeX output. Setting these keywords works similar to the +general options (see *note Export Settings::). + +‘DESCRIPTION’ + The document’s description. The description along with author + name, keywords, and related file metadata are inserted in the + output file by the hyperref package. See + ‘org-latex-hyperref-template’ for customizing metadata items. See + ‘org-latex-title-command’ for typesetting description into the + document’s front matter. Use multiple ‘DESCRIPTION’ keywords for + long descriptions. + +‘LANGUAGE’ + In order to be effective, the ‘babel’ or ‘polyglossia’ + packages—according to the LaTeX compiler used—must be loaded with + the appropriate language as argument. This can be accomplished by + modifying the ‘org-latex-packages-alist’ variable, e.g., with the + following snippet: + + (add-to-list 'org-latex-packages-alist + '("AUTO" "babel" t ("pdflatex"))) + (add-to-list 'org-latex-packages-alist + '("AUTO" "polyglossia" t ("xelatex" "lualatex"))) + +‘LATEX_CLASS’ + This is LaTeX document class, such as _article_, _report_, _book_, + and so on, which contain predefined preamble and headline level + mapping that the LaTeX export back-end needs. The back-end reads + the default class name from the ‘org-latex-default-class’ variable. + Org has _article_ as the default class. A valid default class must + be an element of ‘org-latex-classes’. + +‘LATEX_CLASS_OPTIONS’ + Options the LaTeX export back-end uses when calling the LaTeX + document class. + +‘LATEX_COMPILER’ + The compiler, such as ‘pdflatex’, ‘xelatex’, ‘lualatex’, for + producing the PDF. See ‘org-latex-compiler’. + +‘LATEX_HEADER’ +‘LATEX_HEADER_EXTRA’ + Arbitrary lines to add to the document’s preamble, before the + hyperref settings. See ‘org-latex-classes’ for adjusting the + structure and order of the LaTeX headers. + +‘KEYWORDS’ + The keywords for the document. The description along with author + name, keywords, and related file metadata are inserted in the + output file by the hyperref package. See + ‘org-latex-hyperref-template’ for customizing metadata items. See + ‘org-latex-title-command’ for typesetting description into the + document’s front matter. Use multiple ‘KEYWORDS’ lines if + necessary. + +‘SUBTITLE’ + The document’s subtitle. It is typeset as per + ‘org-latex-subtitle-format’. If ‘org-latex-subtitle-separate’ is + non-‘nil’, it is typed as part of the ‘\title’ macro. See + ‘org-latex-hyperref-template’ for customizing metadata items. See + ‘org-latex-title-command’ for typesetting description into the + document’s front matter. + + The following sections have further details. + + +File: org, Node: LaTeX header and sectioning, Next: Quoting LaTeX code, Prev: LaTeX specific export settings, Up: LaTeX Export + +12.10.3 LaTeX header and sectioning structure +--------------------------------------------- + +The LaTeX export back-end converts the first three of Org’s outline +levels into LaTeX headlines. The remaining Org levels are exported as +lists. To change this globally for the cut-off point between levels and +lists, (see *note Export Settings::). + + By default, the LaTeX export back-end uses the _article_ class. + + To change the default class globally, edit ‘org-latex-default-class’. +To change the default class locally in an Org file, add option lines +‘#+LATEX_CLASS: myclass’. To change the default class for just a part +of the Org file, set a sub-tree property, ‘EXPORT_LATEX_CLASS’. The +class name entered here must be valid member of ‘org-latex-classes’. +This variable defines a header template for each class into which the +exporter splices the values of ‘org-latex-default-packages-alist’ and +‘org-latex-packages-alist’. Use the same three variables to define +custom sectioning or custom classes. + + The LaTeX export back-end sends the ‘LATEX_CLASS_OPTIONS’ keyword and +‘EXPORT_LATEX_CLASS_OPTIONS’ property as options to the LaTeX +‘\documentclass’ macro. The options and the syntax for specifying them, +including enclosing them in square brackets, follow LaTeX conventions. + + #+LATEX_CLASS_OPTIONS: [a4paper,11pt,twoside,twocolumn] + + The LaTeX export back-end appends values from ‘LATEX_HEADER’ and +‘LATEX_HEADER_EXTRA’ keywords to the LaTeX header. The docstring for +‘org-latex-classes’ explains in more detail. Also note that LaTeX +export back-end does not append ‘LATEX_HEADER_EXTRA’ to the header when +previewing LaTeX snippets (see *note Previewing LaTeX fragments::). + + A sample Org file with the above headers: + + #+LATEX_CLASS: article + #+LATEX_CLASS_OPTIONS: [a4paper] + #+LATEX_HEADER: \usepackage{xyz} + + * Headline 1 + some text + * Headline 2 + some more text + + +File: org, Node: Quoting LaTeX code, Next: Tables in LaTeX export, Prev: LaTeX header and sectioning, Up: LaTeX Export + +12.10.4 Quoting LaTeX code +-------------------------- + +The LaTeX export back-end can insert any arbitrary LaTeX code, see *note +Embedded LaTeX::. There are three ways to embed such code in the Org +file and they all use different quoting syntax. + + Inserting in-line quoted with @ symbols: + + Code embedded in-line @@latex:any arbitrary LaTeX code@@ in a paragraph. + + Inserting as one or more keyword lines in the Org file: + + #+LATEX: any arbitrary LaTeX code + + Inserting as an export block in the Org file, where the back-end +exports any code between begin and end markers: + + #+BEGIN_EXPORT latex + any arbitrary LaTeX code + #+END_EXPORT + + +File: org, Node: Tables in LaTeX export, Next: Images in LaTeX export, Prev: Quoting LaTeX code, Up: LaTeX Export + +12.10.5 Tables in LaTeX export +------------------------------ + +The LaTeX export back-end can pass several LaTeX attributes for table +contents and layout. Besides specifying a label (see *note Internal +Links::) and a caption (see *note Captions::), the other valid LaTeX +attributes include: + +‘:mode’ + The LaTeX export back-end wraps the table differently depending on + the mode for accurate rendering of math symbols. Mode is either + ‘table’, ‘math’, ‘inline-math’ or ‘verbatim’. + + For ‘math’ or ‘inline-math’ mode, LaTeX export back-end wraps the + table in a math environment, but every cell in it is exported + as-is. The LaTeX export back-end determines the default mode from + ‘org-latex-default-table-mode’. The LaTeX export back-end merges + contiguous tables in the same mode into a single environment. + +‘:environment’ + Set the default LaTeX table environment for the LaTeX export + back-end to use when exporting Org tables. Common LaTeX table + environments are provided by these packages: tabularx, longtable, + array, tabu, and bmatrix. For packages, such as tabularx and tabu, + or any newer replacements, include them in the + ‘org-latex-packages-alist’ variable so the LaTeX export back-end + can insert the appropriate load package headers in the converted + LaTeX file. Look in the docstring for the + ‘org-latex-packages-alist’ variable for configuring these packages + for LaTeX snippet previews, if any. + +‘:caption’ + Use ‘CAPTION’ keyword to set a simple caption for a table (see + *note Captions::). For custom captions, use ‘:caption’ attribute, + which accepts raw LaTeX code. ‘:caption’ value overrides ‘CAPTION’ + value. + +‘:float’ +‘:placement’ + The table environments by default are not floats in LaTeX. To make + them floating objects use ‘:float’ with one of the following + options: ‘sideways’, ‘multicolumn’, ‘t’, and ‘nil’. + + LaTeX floats can also have additional layout ‘:placement’ + attributes. These are the usual ‘[h t b p ! H]’ permissions + specified in square brackets. Note that for ‘:float sideways’ + tables, the LaTeX export back-end ignores ‘:placement’ attributes. + +‘:align’ +‘:font’ +‘:width’ + The LaTeX export back-end uses these attributes for regular tables + to set their alignments, fonts, and widths. + +‘:spread’ + When ‘:spread’ is non-‘nil’, the LaTeX export back-end spreads or + shrinks the table by the ‘:width’ for tabu and longtabu + environments. ‘:spread’ has no effect if ‘:width’ is not set. + +‘:booktabs’ +‘:center’ +‘:rmlines’ + All three commands are toggles. ‘:booktabs’ brings in modern + typesetting enhancements to regular tables. The booktabs package + has to be loaded through ‘org-latex-packages-alist’. ‘:center’ is + for centering the table. ‘:rmlines’ removes all but the very first + horizontal line made of ASCII characters from “table.el” tables + only. + +‘:math-prefix’ +‘:math-suffix’ +‘:math-arguments’ + The LaTeX export back-end inserts ‘:math-prefix’ string value in a + math environment before the table. The LaTeX export back-end + inserts ‘:math-suffix’ string value in a math environment after the + table. The LaTeX export back-end inserts ‘:math-arguments’ string + value between the macro name and the table’s contents. + ‘:math-arguments’ comes in use for matrix macros that require more + than one argument, such as ‘qbordermatrix’. + + LaTeX table attributes help formatting tables for a wide range of +situations, such as matrix product or spanning multiple pages: + + #+ATTR_LATEX: :environment longtable :align l|lp{3cm}r|l + | ... | ... | + | ... | ... | + + #+ATTR_LATEX: :mode math :environment bmatrix :math-suffix \times + | a | b | + | c | d | + #+ATTR_LATEX: :mode math :environment bmatrix + | 1 | 2 | + | 3 | 4 | + + Set the caption with the LaTeX command +‘\bicaption{HeadingA}{HeadingB}’: + + #+ATTR_LATEX: :caption \bicaption{HeadingA}{HeadingB} + | ... | ... | + | ... | ... | + + +File: org, Node: Images in LaTeX export, Next: Plain lists in LaTeX export, Prev: Tables in LaTeX export, Up: LaTeX Export + +12.10.6 Images in LaTeX export +------------------------------ + +The LaTeX export back-end processes image links in Org files that do not +have descriptions, such as these links ‘[[file:img.jpg]]’ or +‘[[./img.jpg]]’, as direct image insertions in the final PDF output. In +the PDF, they are no longer links but actual images embedded on the +page. The LaTeX export back-end uses ‘\includegraphics’ macro to insert +the image. But for TikZ () +images, the back-end uses an ‘\input’ macro wrapped within a +‘tikzpicture’ environment. + + For specifying image ‘:width’, ‘:height’, and other ‘:options’, use +this syntax: + + #+ATTR_LATEX: :width 5cm :options angle=90 + [[./img/sed-hr4049.pdf]] + + For custom commands for captions, use the ‘:caption’ attribute. It +overrides the default ‘#+CAPTION’ value: + + #+ATTR_LATEX: :caption \bicaption{HeadingA}{HeadingB} + [[./img/sed-hr4049.pdf]] + + When captions follow the method as described in *note Captions::, the +LaTeX export back-end wraps the picture in a floating ‘figure’ +environment. To float an image without specifying a caption, set the +‘:float’ attribute to one of the following: + +‘t’ + For a standard ‘figure’ environment; used by default whenever an + image has a caption. + +‘multicolumn’ + To span the image across multiple columns of a page; the back-end + wraps the image in a ‘figure*’ environment. + +‘wrap’ + For text to flow around the image on the right; the figure occupies + the left half of the page. + +‘sideways’ + For a new page with the image sideways, rotated ninety degrees, in + a ‘sidewaysfigure’ environment; overrides ‘:placement’ setting. + +‘nil’ + To avoid a ‘:float’ even if using a caption. + + Use the ‘placement’ attribute to modify a floating environment’s +placement. + + #+ATTR_LATEX: :float wrap :width 0.38\textwidth :placement {r}{0.4\textwidth} + [[./img/hst.png]] + + The LaTeX export back-end centers all images by default. Setting +‘:center’ to ‘nil’ disables centering. To disable centering globally, +set ‘org-latex-images-centered’ to ‘t’. + + Set the ‘:comment-include’ attribute to non-‘nil’ value for the LaTeX +export back-end to comment out the ‘\includegraphics’ macro. + + +File: org, Node: Plain lists in LaTeX export, Next: Source blocks in LaTeX export, Prev: Images in LaTeX export, Up: LaTeX Export + +12.10.7 Plain lists in LaTeX export +----------------------------------- + +The LaTeX export back-end accepts the ‘environment’ and ‘options’ +attributes for plain lists. Both attributes work together for +customizing lists, as shown in the examples: + + #+LATEX_HEADER: \usepackage[inline]{enumitem} + Some ways to say "Hello": + #+ATTR_LATEX: :environment itemize* + #+ATTR_LATEX: :options [label={}, itemjoin={,}, itemjoin*={, and}] + - Hola + - Bonjour + - Guten Tag. + + Since LaTeX supports only four levels of nesting for lists, use an +external package, such as ‘enumitem’ in LaTeX, for levels deeper than +four: + + #+LATEX_HEADER: \usepackage{enumitem} + #+LATEX_HEADER: \renewlist{itemize}{itemize}{9} + #+LATEX_HEADER: \setlist[itemize]{label=$\circ$} + - One + - Two + - Three + - Four + - Five + + +File: org, Node: Source blocks in LaTeX export, Next: Example blocks in LaTeX export, Prev: Plain lists in LaTeX export, Up: LaTeX Export + +12.10.8 Source blocks in LaTeX export +------------------------------------- + +The LaTeX export back-end can make source code blocks into floating +objects through the attributes ‘:float’ and ‘:options’. For ‘:float’: + +‘t’ + Makes a source block float; by default floats any source block with + a caption. + +‘multicolumn’ + Spans the source block across multiple columns of a page. + +‘nil’ + Avoids a ‘:float’ even if using a caption; useful for source code + blocks that may not fit on a page. + + #+ATTR_LATEX: :float nil + #+BEGIN_SRC emacs-lisp + Lisp code that may not fit in a single page. + #+END_SRC + + The LaTeX export back-end passes string values in ‘:options’ to LaTeX +packages for customization of that specific source block. In the +example below, the ‘:options’ are set for Minted. Minted is a source +code highlighting LaTeX package with many configurable options. + + #+ATTR_LATEX: :options commentstyle=\bfseries + #+BEGIN_SRC emacs-lisp + (defun Fib (n) + (if (< n 2) n (+ (Fib (- n 1)) (Fib (- n 2))))) + #+END_SRC + + To apply similar configuration options for all source blocks in a +file, use the ‘org-latex-listings-options’ and +‘org-latex-minted-options’ variables. + + +File: org, Node: Example blocks in LaTeX export, Next: Special blocks in LaTeX export, Prev: Source blocks in LaTeX export, Up: LaTeX Export + +12.10.9 Example blocks in LaTeX export +-------------------------------------- + +The LaTeX export back-end wraps the contents of example blocks in a +‘verbatim’ environment. To change this behavior to use another +environment globally, specify an appropriate export filter (see *note +Advanced Export Configuration::). To change this behavior to use +another environment for each block, use the ‘:environment’ parameter to +specify a custom environment. + + #+ATTR_LATEX: :environment myverbatim + #+BEGIN_EXAMPLE + This sentence is false. + #+END_EXAMPLE + + +File: org, Node: Special blocks in LaTeX export, Next: Horizontal rules in LaTeX export, Prev: Example blocks in LaTeX export, Up: LaTeX Export + +12.10.10 Special blocks in LaTeX export +--------------------------------------- + +For other special blocks in the Org file, the LaTeX export back-end +makes a special environment of the same name. The back-end also takes +‘:options’, if any, and appends as-is to that environment’s opening +string. For example: + + #+BEGIN_abstract + We demonstrate how to solve the Syracuse problem. + #+END_abstract + + #+ATTR_LATEX: :options [Proof of important theorem] + #+BEGIN_proof + ... + Therefore, any even number greater than 2 is the sum of two primes. + #+END_proof + +exports to + + \begin{abstract} + We demonstrate how to solve the Syracuse problem. + \end{abstract} + + \begin{proof}[Proof of important theorem] + ... + Therefore, any even number greater than 2 is the sum of two primes. + \end{proof} + + If you need to insert a specific caption command, use ‘:caption’ +attribute. It overrides standard ‘CAPTION’ value, if any. For example: + + #+ATTR_LATEX: :caption \MyCaption{HeadingA} + #+BEGIN_proof + ... + #+END_proof + + +File: org, Node: Horizontal rules in LaTeX export, Prev: Special blocks in LaTeX export, Up: LaTeX Export + +12.10.11 Horizontal rules in LaTeX export +----------------------------------------- + +The LaTeX export back-end converts horizontal rules by the specified +‘:width’ and ‘:thickness’ attributes. For example: + + #+ATTR_LATEX: :width .6\textwidth :thickness 0.8pt + ----- + + +File: org, Node: Markdown Export, Next: OpenDocument Text Export, Prev: LaTeX Export, Up: Exporting + +12.11 Markdown Export +===================== + +The Markdown export back-end, “md”, converts an Org file to Markdown +format, as defined at . + + Since it is built on top of the HTML back-end (see *note HTML +Export::), it converts every Org construct not defined in Markdown +syntax, such as tables, to HTML. + +Markdown export commands +------------------------ + +‘C-c C-e m m’ (‘org-md-export-to-markdown’) + Export to a text file with Markdown syntax. For ‘myfile.org’, Org + exports to ‘myfile.md’, overwritten without warning. + +‘C-c C-e m M’ (‘org-md-export-as-markdown’) + Export to a temporary buffer. Does not create a file. + +‘C-c C-e m o’ + Export as a text file with Markdown syntax, then open it. + +Header and sectioning structure +------------------------------- + +Based on ‘org-md-headline-style’, Markdown export can generate headlines +of both _atx_ and _setext_ types. _atx_ limits headline levels to two +whereas _setext_ limits headline levels to six. Beyond these limits, +the export back-end converts headlines to lists. To set a limit to a +level before the absolute limit (see *note Export Settings::). + + +File: org, Node: OpenDocument Text Export, Next: Org Export, Prev: Markdown Export, Up: Exporting + +12.12 OpenDocument Text Export +============================== + +The ODT export back-end handles creating of OpenDocument Text (ODT) +format. Documents created by this exporter use the ‘OpenDocument-v1.2 +specification’(1) and are compatible with LibreOffice 3.4. + +* Menu: + +* Pre-requisites for ODT export:: Required packages. +* ODT export commands:: Invoking export. +* ODT specific export settings:: Configuration options. +* Extending ODT export:: Producing DOC, PDF files. +* Applying custom styles:: Styling the output. +* Links in ODT export:: Handling and formatting links. +* Tables in ODT export:: Org tables conversions. +* Images in ODT export:: Inserting images. +* Math formatting in ODT export:: Formatting LaTeX fragments. +* Labels and captions in ODT export:: Rendering objects. +* Literal examples in ODT export:: For source code and example blocks. +* Advanced topics in ODT export:: For power users. + + ---------- Footnotes ---------- + + (1) See Open Document Format for Office Applications (OpenDocument) +Version 1.2 +(http://docs.oasis-open.org/office/v1.2/OpenDocument-v1.2.html). + + +File: org, Node: Pre-requisites for ODT export, Next: ODT export commands, Up: OpenDocument Text Export + +12.12.1 Pre-requisites for ODT export +------------------------------------- + +The ODT export back-end relies on the zip program to create the final +compressed ODT output. Check if ‘zip’ is locally available and +executable. Without it, export cannot finish. + + +File: org, Node: ODT export commands, Next: ODT specific export settings, Prev: Pre-requisites for ODT export, Up: OpenDocument Text Export + +12.12.2 ODT export commands +--------------------------- + +‘C-c C-e o o’ (‘org-export-to-odt’) + Export as OpenDocument Text file. + + If ‘org-odt-preferred-output-format’ is specified, the ODT export + back-end automatically converts the exported file to that format. + + For ‘myfile.org’, Org exports to ‘myfile.odt’, overwriting without + warning. The ODT export back-end exports a region only if a region + was active. + + If the selected region is a single tree, the ODT export back-end + makes the tree head the document title. Incidentally, ‘C-c @’ + selects the current sub-tree. If the tree head entry has, or + inherits, an ‘EXPORT_FILE_NAME’ property, the ODT export back-end + uses that for file name. + +‘C-c C-e o O’ + Export as an OpenDocument Text file and open the resulting file. + + If ‘org-export-odt-preferred-output-format’ is specified, open the + converted file instead. See *note Automatically exporting to other + formats::. + + +File: org, Node: ODT specific export settings, Next: Extending ODT export, Prev: ODT export commands, Up: OpenDocument Text Export + +12.12.3 ODT specific export settings +------------------------------------ + +The ODT export back-end has several additional keywords for customizing +ODT output. Setting these keywords works similar to the general options +(see *note Export Settings::). + +‘DESCRIPTION’ + This is the document’s description, which the ODT export back-end + inserts as document metadata. For long descriptions, use multiple + lines, prefixed with ‘DESCRIPTION’. + +‘KEYWORDS’ + The keywords for the document. The ODT export back-end inserts the + description along with author name, keywords, and related file + metadata as metadata in the output file. Use multiple ‘KEYWORDS’ + if necessary. + +‘ODT_STYLES_FILE’ + The ODT export back-end uses the ‘org-odt-styles-file’ by default. + See *note Applying custom styles:: for details. + +‘SUBTITLE’ + The document subtitle. + + +File: org, Node: Extending ODT export, Next: Applying custom styles, Prev: ODT specific export settings, Up: OpenDocument Text Export + +12.12.4 Extending ODT export +---------------------------- + +The ODT export back-end can produce documents in other formats besides +ODT using a specialized ODT converter process. Its common interface +works with popular converters to produce formats such as ‘doc’, or +convert a document from one format, say ‘csv’, to another format, say +‘xls’. + + Customize ‘org-odt-convert-process’ variable to point to ‘unoconv’, +which is the ODT’s preferred converter. Working installations of +LibreOffice would already have ‘unoconv’ installed. Alternatively, +other converters may be substituted here. See *note Configuring a +document converter::. + +Automatically exporting to other formats +........................................ + +If ODT format is just an intermediate step to get to other formats, such +as ‘doc’, ‘docx’, ‘rtf’, or ‘pdf’, etc., then extend the ODT export +back-end to directly produce that format. Specify the final format in +the ‘org-odt-preferred-output-format’ variable. This is one way to +extend (see *note ODT export commands::). + +Converting between document formats +................................... + +The Org export back-end is made to be inter-operable with a wide range +of text document format converters. Newer generation converters, such +as LibreOffice and Pandoc, can handle hundreds of formats at once. Org +provides a consistent interaction with whatever converter is installed. +Here are some generic commands: + +‘M-x org-odt-convert’ + Convert an existing document from one format to another. With a + prefix argument, opens the newly produced file. + + +File: org, Node: Applying custom styles, Next: Links in ODT export, Prev: Extending ODT export, Up: OpenDocument Text Export + +12.12.5 Applying custom styles +------------------------------ + +The ODT export back-end comes with many OpenDocument styles (see *note +Working with OpenDocument style files::). To expand or further +customize these built-in style sheets, either edit the style sheets +directly or generate them using an application such as LibreOffice. The +example here shows creating a style using LibreOffice. + +Applying custom styles: the easy way +.................................... + + 1. Create a sample ‘example.org’ file with settings as shown below, + and export it to ODT format. + + #+OPTIONS: H:10 num:t + + 2. Open the above ‘example.odt’ using LibreOffice. Use the _Stylist_ + to locate the target styles, which typically have the “Org” prefix. + Open one, modify, and save as either OpenDocument Text (ODT) or + OpenDocument Template (OTT) file. + + 3. Customize the variable ‘org-odt-styles-file’ and point it to the + newly created file. For additional configuration options, see + *note Overriding factory styles: x-overriding-factory-styles. + + To apply an ODT style to a particular file, use the + ‘ODT_STYLES_FILE’ keyword as shown in the example below: + + #+ODT_STYLES_FILE: "/path/to/example.ott" + + or + + #+ODT_STYLES_FILE: ("/path/to/file.ott" ("styles.xml" "image/hdr.png")) + +Using third-party styles and templates +...................................... + +The ODT export back-end relies on many templates and style names. Using +third-party styles and templates can lead to mismatches. Templates +derived from built in ODT templates and styles seem to have fewer +problems. + + +File: org, Node: Links in ODT export, Next: Tables in ODT export, Prev: Applying custom styles, Up: OpenDocument Text Export + +12.12.6 Links in ODT export +--------------------------- + +ODT exporter creates native cross-references for internal links. It +creates Internet-style links for all other links. + + A link with no description and pointing to a regular, un-itemized, +outline heading is replaced with a cross-reference and section number of +the heading. + + A ‘\ref{label}’-style reference to an image, table etc., is replaced +with a cross-reference and sequence number of the labeled entity. See +*note Labels and captions in ODT export::. + + +File: org, Node: Tables in ODT export, Next: Images in ODT export, Prev: Links in ODT export, Up: OpenDocument Text Export + +12.12.7 Tables in ODT export +---------------------------- + +The ODT export back-end handles native Org mode tables (see *note +Tables::) and simple ‘table.el’ tables. Complex ‘table.el’ tables +having column or row spans are not supported. Such tables are stripped +from the exported document. + + By default, the ODT export back-end exports a table with top and +bottom frames and with ruled lines separating row and column groups (see +*note Column Groups::). All tables are typeset to occupy the same +width. The ODT export back-end honors any table alignments and relative +widths for columns (see *note Column Width and Alignment::). + + Note that the ODT export back-end interprets column widths as +weighted ratios, the default weight being 1. + + Specifying ‘:rel-width’ property on an ‘ATTR_ODT’ line controls the +width of the table. For example: + + #+ATTR_ODT: :rel-width 50 + | Area/Month | Jan | Feb | Mar | Sum | + |---------------+-------+-------+-------+-------| + | / | < | | | < | + | | | | | | + | North America | 1 | 21 | 926 | 948 | + | Middle East | 6 | 75 | 844 | 925 | + | Asia Pacific | 9 | 27 | 790 | 826 | + |---------------+-------+-------+-------+-------| + | Sum | 16 | 123 | 2560 | 2699 | + + On export, the above table takes 50% of text width area. The +exporter sizes the columns in the ratio: 13:5:5:5:6. The first column +is left-aligned and rest of the columns, right-aligned. Vertical rules +separate the header and the last column. Horizontal rules separate the +header and the last row. + + For even more customization, create custom table styles and associate +them with a table using the ‘ATTR_ODT’ keyword. See *note Customizing +tables in ODT export::. + + +File: org, Node: Images in ODT export, Next: Math formatting in ODT export, Prev: Tables in ODT export, Up: OpenDocument Text Export + +12.12.8 Images in ODT export +---------------------------- + +Embedding images +................ + +The ODT export back-end processes image links in Org files that do not +have descriptions, such as these links ‘[[file:img.jpg]]’ or +‘[[./img.jpg]]’, as direct image insertions in the final output. Either +of these examples works: + + [[file:img.png]] + + [[./img.png]] + +Embedding clickable images +.......................... + +For clickable images, provide a link whose description is another link +to an image file. For example, to embed an image ‘org-mode-unicorn.png’ +which when clicked jumps to website, do the +following + + [[https://orgmode.org][./org-mode-unicorn.png]] + +Sizing and scaling of embedded images +..................................... + +Control the size and scale of the embedded images with the ‘ATTR_ODT’ +attribute. + + The ODT export back-end starts with establishing the size of the +image in the final document. The dimensions of this size are measured +in centimeters. The back-end then queries the image file for its +dimensions measured in pixels. For this measurement, the back-end +relies on ImageMagick’s identify program or Emacs ‘create-image’ and +‘image-size’ API. ImageMagick is the preferred choice for large file +sizes or frequent batch operations. The back-end then converts the +pixel dimensions using ‘org-odt-pixels-per-inch’ into the familiar 72 +dpi or 96 dpi. The default value for this is in +‘display-pixels-per-inch’, which can be tweaked for better results based +on the capabilities of the output device. Here are some common image +scaling operations: + +Explicitly size the image + To embed ‘img.png’ as a 10 cm x 10 cm image, do the following: + + #+ATTR_ODT: :width 10 :height 10 + [[./img.png]] + +Scale the image + To embed ‘img.png’ at half its size, do the following: + + #+ATTR_ODT: :scale 0.5 + [[./img.png]] + +Scale the image to a specific width + To embed ‘img.png’ with a width of 10 cm while retaining the + original height:width ratio, do the following: + + #+ATTR_ODT: :width 10 + [[./img.png]] + +Scale the image to a specific height + To embed ‘img.png’ with a height of 10 cm while retaining the + original height:width ratio, do the following: + + #+ATTR_ODT: :height 10 + [[./img.png]] + +Anchoring of images +................... + +The ODT export back-end can anchor images to ‘as-char’, ‘paragraph’, or +‘page’. Set the preferred anchor using the ‘:anchor’ property of the +‘ATTR_ODT’ line. + + To create an image that is anchored to a page: + + #+ATTR_ODT: :anchor page + [[./img.png]] + + +File: org, Node: Math formatting in ODT export, Next: Labels and captions in ODT export, Prev: Images in ODT export, Up: OpenDocument Text Export + +12.12.9 Math formatting in ODT export +------------------------------------- + +The ODT exporter has special support for handling math. + +* Menu: + +* LaTeX math snippets:: Embedding in LaTeX format. +* MathML and OpenDocument formula files:: Embedding in native format. + + +File: org, Node: LaTeX math snippets, Next: MathML and OpenDocument formula files, Up: Math formatting in ODT export + +12.12.9.1 LaTeX math snippets +............................. + +LaTeX math snippets (see *note LaTeX fragments::) can be embedded in the +ODT document in one of the following ways: + +MathML + Add this line to the Org file. This option is activated on a + per-file basis. + + #+OPTIONS: tex:t + + With this option, LaTeX fragments are first converted into MathML + fragments using an external LaTeX-to-MathML converter program. The + resulting MathML fragments are then embedded as an OpenDocument + Formula in the exported document. + + You can specify the LaTeX-to-MathML converter by customizing the + variables ‘org-latex-to-mathml-convert-command’ and + ‘org-latex-to-mathml-jar-file’. + + If you prefer to use MathToWeb(1) as your converter, you can + configure the above variables as shown below. + + (setq org-latex-to-mathml-convert-command + "java -jar %j -unicode -force -df %o %I" + org-latex-to-mathml-jar-file + "/path/to/mathtoweb.jar") + + or, to use LaTeX​ML(2) instead, + + (setq org-latex-to-mathml-convert-command + "latexmlmath \"%i\" --presentationmathml=%o") + + To quickly verify the reliability of the LaTeX-to-MathML converter, + use the following commands: + + ‘M-x org-export-as-odf’ + Convert a LaTeX math snippet to an OpenDocument formula + (‘.odf’) file. + + ‘M-x org-export-as-odf-and-open’ + Convert a LaTeX math snippet to an OpenDocument formula + (‘.odf’) file and open the formula file with the + system-registered application. + +PNG images + Add this line to the Org file. This option is activated on a + per-file basis. + + #+OPTIONS: tex:dvipng + + #+OPTIONS: tex:dvisvgm + + or + + #+OPTIONS: tex:imagemagick + + Under this option, LaTeX fragments are processed into PNG or SVG + images and the resulting images are embedded in the exported + document. This method requires dvipng program, dvisvgm or + ImageMagick programs. + + ---------- Footnotes ---------- + + (1) See MathToWeb +(http://www.mathtoweb.com/cgi-bin/mathtoweb_home.pl). + + (2) See . + + +File: org, Node: MathML and OpenDocument formula files, Prev: LaTeX math snippets, Up: Math formatting in ODT export + +12.12.9.2 MathML and OpenDocument formula files +............................................... + +When embedding LaTeX math snippets in ODT documents is not reliable, +there is one more option to try. Embed an equation by linking to its +MathML (‘.mml’) source or its OpenDocument formula (‘.odf’) file as +shown below: + + [[./equation.mml]] + +or + + [[./equation.odf]] + + +File: org, Node: Labels and captions in ODT export, Next: Literal examples in ODT export, Prev: Math formatting in ODT export, Up: OpenDocument Text Export + +12.12.10 Labels and captions in ODT export +------------------------------------------ + +ODT format handles labeling and captioning of objects based on their +types. Inline images, tables, LaTeX fragments, and Math formulas are +numbered and captioned separately. Each object also gets a unique +sequence number based on its order of first appearance in the Org file. +Each category has its own sequence. A caption is just a label applied +to these objects. + + #+CAPTION: Bell curve + #+NAME: fig:SED-HR4049 + [[./img/a.png]] + + When rendered, it may show as follows in the exported document: + + Figure 2: Bell curve + + To modify the category component of the caption, customize the option +‘org-odt-category-map-alist’. For example, to tag embedded images with +the string “Illustration” instead of the default string “Figure”, use +the following setting: + + (setq org-odt-category-map-alist + '(("__Figure__" "Illustration" "value" "Figure" org-odt--enumerable-image-p))) + + With the above modification, the previous example changes to: + + Illustration 2: Bell curve + + +File: org, Node: Literal examples in ODT export, Next: Advanced topics in ODT export, Prev: Labels and captions in ODT export, Up: OpenDocument Text Export + +12.12.11 Literal examples in ODT export +--------------------------------------- + +The ODT export back-end supports literal examples (see *note Literal +Examples::) with full fontification. Internally, the ODT export +back-end relies on ‘htmlfontify.el’ to generate the style definitions +needed for fancy listings. The auto-generated styles get ‘OrgSrc’ +prefix and inherit colors from the faces used by Emacs Font Lock library +for that source language. + + For custom fontification styles, customize the +‘org-odt-create-custom-styles-for-srcblocks’ option. + + To turn off fontification of literal examples, customize the +‘org-odt-fontify-srcblocks’ option. + + +File: org, Node: Advanced topics in ODT export, Prev: Literal examples in ODT export, Up: OpenDocument Text Export + +12.12.12 Advanced topics in ODT export +-------------------------------------- + +The ODT export back-end has extensive features useful for power users +and frequent uses of ODT formats. + +Configuring a document converter +................................ + +The ODT export back-end works with popular converters with little or no +extra configuration. See *note Extending ODT export::. The following +is for unsupported converters or tweaking existing defaults. + +Register the converter + Add the name of the converter to the ‘org-odt-convert-processes’ + variable. Note that it also requires how the converter is invoked + on the command line. See the variable’s docstring for details. + +Configure its capabilities + Specify which formats the converter can handle by customizing the + variable ‘org-odt-convert-capabilities’. Use the entry for the + default values in this variable for configuring the new converter. + Also see its docstring for details. + +Choose the converter + Select the newly added converter as the preferred one by + customizing the option ‘org-odt-convert-process’. + +Working with OpenDocument style files +..................................... + +This section explores the internals of the ODT exporter; the means by +which it produces styled documents; the use of automatic and custom +OpenDocument styles. + + The ODT exporter relies on two files for generating its output. +These files are bundled with the distribution under the directory +pointed to by the variable ‘org-odt-styles-dir’. The two files are: + +‘OrgOdtStyles.xml’ + This file contributes to the ‘styles.xml’ file of the final ODT + document. This file gets modified for the following purposes: + + 1. To control outline numbering based on user settings; + + 2. To add styles generated by ‘htmlfontify.el’ for fontification + of code blocks. + +‘OrgOdtContentTemplate.xml’ + This file contributes to the ‘content.xml’ file of the final ODT + document. The contents of the Org outline are inserted between the + ‘’ ... ‘’ elements of this file. + + Apart from serving as a template file for the final ‘content.xml’, + the file serves the following purposes: + + 1. It contains automatic styles for formatting of tables which + are referenced by the exporter; + + 2. It contains ‘’ ... ‘’ + elements that control numbering of tables, images, equations, + and similar entities. + + The following two variables control the location from where the ODT +exporter picks up the custom styles and content template files. +Customize these variables to override the factory styles used by the +exporter. + +‘org-odt-styles-file’ + The ODT export back-end uses the file pointed to by this variable, + such as ‘styles.xml’, for the final output. It can take one of the + following values: + + ‘FILE.xml’ + Use this file instead of the default ‘styles.xml’ + + ‘FILE.odt’ or ‘FILE.ott’ + Use the ‘styles.xml’ contained in the specified OpenDocument + Text or Template file + + ‘FILE.odt’ or ‘FILE.ott’ and a subset of included files + Use the ‘styles.xml’ contained in the specified OpenDocument + Text or Template file. Additionally extract the specified + member files and embed those within the final ODT document. + + Use this option if the ‘styles.xml’ file references additional + files like header and footer images. + + ‘nil’ + Use the default ‘styles.xml’. + +‘org-odt-content-template-file’ + Use this variable to specify the blank ‘content.xml’ used in the + final output. + +Creating one-off styles +....................... + +The ODT export back-end can read embedded raw OpenDocument XML from the +Org file. Such direct formatting is useful for one-off instances. + +Embedding ODT tags as part of regular text + Enclose OpenDocument syntax in ‘@@odt:...@@’ for inline markup. + For example, to highlight a region of text do the following: + + @@odt:This is highlighted + text@@. But this is regular text. + + *Hint:* To see the above example in action, edit the ‘styles.xml’ + (see *note Factory styles: x-orgodtstyles-xml.) and add a custom + _Highlight_ style as shown below: + + + + + +Embedding a one-line OpenDocument XML + The ODT export back-end can read one-liner options with ‘#+ODT:’ in + the Org file. For example, to force a page break: + + #+ODT: + + *Hint:* To see the above example in action, edit your ‘styles.xml’ + (see *note Factory styles: x-orgodtstyles-xml.) and add a custom + ‘PageBreak’ style as shown below. + + + + + +Embedding a block of OpenDocument XML + The ODT export back-end can also read ODT export blocks for + OpenDocument XML. Such blocks use the ‘#+BEGIN_EXPORT odt’ ... + ‘#+END_EXPORT’ constructs. + + For example, to create a one-off paragraph that uses bold text, do + the following: + + #+BEGIN_EXPORT odt + + This paragraph is specially formatted and uses bold text. + + #+END_EXPORT + +Customizing tables in ODT export +................................ + +Override the default table format by specifying a custom table style +with the ‘#+ATTR_ODT’ line. For a discussion on default formatting of +tables, see *note Tables in ODT export::. + + This feature closely mimics the way table templates are defined in +the OpenDocument-v1.2 specification(1). + + For quick preview of this feature, install the settings below and +export the table that follows: + + (setq org-export-odt-table-styles + (append org-export-odt-table-styles + '(("TableWithHeaderRowAndColumn" "Custom" + ((use-first-row-styles . t) + (use-first-column-styles . t))) + ("TableWithFirstRowandLastRow" "Custom" + ((use-first-row-styles . t) + (use-last-row-styles . t)))))) + + #+ATTR_ODT: :style TableWithHeaderRowAndColumn + | Name | Phone | Age | + | Peter | 1234 | 17 | + | Anna | 4321 | 25 | + + The example above used ‘Custom’ template and installed two table +styles ‘TableWithHeaderRowAndColumn’ and ‘TableWithFirstRowandLastRow’. +*Important:* The OpenDocument styles needed for producing the above +template were pre-defined. They are available in the section marked +‘Custom Table Template’ in ‘OrgOdtContentTemplate.xml’ (see *note +Factory styles: x-orgodtcontenttemplate-xml.). For adding new +templates, define new styles there. + + To use this feature proceed as follows: + + 1. Create a table template(2). + + A table template is set of ‘table-cell’ and ‘paragraph’ styles for + each of the following table cell categories: + + • Body + • First column + • Last column + • First row + • Last row + • Even row + • Odd row + • Even column + • Odd Column + + The names for the above styles must be chosen based on the name of + the table template using a well-defined convention. + + The naming convention is better illustrated with an example. For a + table template with the name ‘Custom’, the needed style names are + listed in the following table. + + Cell type Cell style Paragraph style + ---------------------------------------------------------------------------------- + Body ‘CustomTableCell’ ‘CustomTableParagraph’ + First column ‘CustomFirstColumnTableCell’ ‘CustomFirstColumnTableParagraph’ + Last column ‘CustomLastColumnTableCell’ ‘CustomLastColumnTableParagraph’ + First row ‘CustomFirstRowTableCell’ ‘CustomFirstRowTableParagraph’ + Last row ‘CustomLastRowTableCell’ ‘CustomLastRowTableParagraph’ + Even row ‘CustomEvenRowTableCell’ ‘CustomEvenRowTableParagraph’ + Odd row ‘CustomOddRowTableCell’ ‘CustomOddRowTableParagraph’ + Even column ‘CustomEvenColumnTableCell’ ‘CustomEvenColumnTableParagraph’ + Odd column ‘CustomOddColumnTableCell’ ‘CustomOddColumnTableParagraph’ + + To create a table template with the name ‘Custom’, define the above + styles in the ‘’ ... + ‘’ element of the content template file + (see *note Factory styles: x-orgodtcontenttemplate-xml.). + + 2. Define a table style(3). + + To define a table style, create an entry for the style in the + variable ‘org-odt-table-styles’ and specify the following: + + • the name of the table template created in step (1), + • the set of cell styles in that template that are to be + activated. + + For example, the entry below defines two different table styles + ‘TableWithHeaderRowAndColumn’ and ‘TableWithFirstRowandLastRow’ + based on the same template ‘Custom’. The styles achieve their + intended effect by selectively activating the individual cell + styles in that template. + + (setq org-export-odt-table-styles + (append org-export-odt-table-styles + '(("TableWithHeaderRowAndColumn" "Custom" + ((use-first-row-styles . t) + (use-first-column-styles . t))) + ("TableWithFirstRowandLastRow" "Custom" + ((use-first-row-styles . t) + (use-last-row-styles . t)))))) + + 3. Associate a table with the table style. + + To do this, specify the table style created in step (2) as part of + the ‘ATTR_ODT’ line as shown below. + + #+ATTR_ODT: :style TableWithHeaderRowAndColumn + | Name | Phone | Age | + | Peter | 1234 | 17 | + | Anna | 4321 | 25 | + +Validating OpenDocument XML +........................... + +Sometimes ODT format files may not open due to ‘.odt’ file corruption. +To verify if such a file is corrupt, validate it against the +OpenDocument Relax NG Compact (RNC) syntax schema. But first the ‘.odt’ +files have to be decompressed using ‘zip’. Note that ‘.odt’ files are +ZIP archives: *note (emacs)File Archives::. The contents of ODT files +are in XML. For general help with validation—and schema-sensitive +editing—of XML files: *note (nxml-mode)Introduction::. + + Customize ‘org-odt-schema-dir’ to point to a directory with +OpenDocument RNC files and the needed schema-locating rules. The ODT +export back-end takes care of updating the ‘rng-schema-locating-files’. + + ---------- Footnotes ---------- + + (1) OpenDocument-v1.2 Specification +(http://docs.oasis-open.org/office/v1.2/OpenDocument-v1.2.html) + + (2) See the ‘’ element of the OpenDocument-v1.2 +specification. + + (3) See the attributes ‘table:template-name’, +‘table:use-first-row-styles’, ‘table:use-last-row-styles’, +‘table:use-first-column-styles’, ‘table:use-last-column-styles’, +‘table:use-banding-rows-styles’, and ‘table:use-banding-column-styles’ +of the ‘’ element in the OpenDocument-v1.2 specification. + + +File: org, Node: Org Export, Next: Texinfo Export, Prev: OpenDocument Text Export, Up: Exporting + +12.13 Org Export +================ + +_org_ export back-end creates a normalized version of the Org document +in current buffer. The exporter evaluates Babel code (see *note +Evaluating Code Blocks::) and removes content specific to other +back-ends. + +Org export commands +------------------- + +‘C-c C-e O o’ (‘org-org-export-to-org’) + Export as an Org file with a ‘.org’ extension. For ‘myfile.org’, + Org exports to ‘myfile.org.org’, overwriting without warning. + +‘C-c C-e O v’ (~~) + Export to an Org file, then open it. + + +File: org, Node: Texinfo Export, Next: iCalendar Export, Prev: Org Export, Up: Exporting + +12.14 Texinfo Export +==================== + +* Menu: + +* Texinfo export commands:: Invoking commands. +* Texinfo specific export settings:: Setting the environment. +* Texinfo file header:: Generating the header. +* Texinfo title and copyright page:: Creating preamble pages. +* Info directory file:: Installing a manual in Info file hierarchy. +* Headings and sectioning structure:: Building document structure. +* Indices:: Creating indices. +* Quoting Texinfo code:: Incorporating literal Texinfo code. +* Plain lists in Texinfo export:: List attributes. +* Tables in Texinfo export:: Table attributes. +* Images in Texinfo export:: Image attributes. +* Quotations in Texinfo export:: Quote block attributes. +* Special blocks in Texinfo export:: Special block attributes. +* A Texinfo example:: Processing Org to Texinfo. + + +File: org, Node: Texinfo export commands, Next: Texinfo specific export settings, Up: Texinfo Export + +12.14.1 Texinfo export commands +------------------------------- + +‘C-c C-e i t’ (‘org-texinfo-export-to-texinfo’) + Export as a Texinfo file with ‘.texi’ extension. For ‘myfile.org’, + Org exports to ‘myfile.texi’, overwriting without warning. + +‘C-c C-e i i’ (‘org-texinfo-export-to-info’) + Export to Texinfo format first and then process it to make an Info + file. To generate other formats, such as DocBook, customize the + ‘org-texinfo-info-process’ variable. + + +File: org, Node: Texinfo specific export settings, Next: Texinfo file header, Prev: Texinfo export commands, Up: Texinfo Export + +12.14.2 Texinfo specific export settings +---------------------------------------- + +The Texinfo export back-end has several additional keywords for +customizing Texinfo output. Setting these keywords works similar to the +general options (see *note Export Settings::). + +‘SUBTITLE’ + The document subtitle. + +‘SUBAUTHOR’ + Additional authors for the document. + +‘TEXINFO_FILENAME’ + The Texinfo filename. + +‘TEXINFO_CLASS’ + The default document class (‘org-texinfo-default-class’), which + must be a member of ‘org-texinfo-classes’. + +‘TEXINFO_HEADER’ + Arbitrary lines inserted at the end of the header. + +‘TEXINFO_POST_HEADER’ + Arbitrary lines inserted after the end of the header. + +‘TEXINFO_DIR_CATEGORY’ + The directory category of the document. + +‘TEXINFO_DIR_TITLE’ + The directory title of the document. + +‘TEXINFO_DIR_DESC’ + The directory description of the document. + +‘TEXINFO_PRINTED_TITLE’ + The printed title of the document. + + +File: org, Node: Texinfo file header, Next: Texinfo title and copyright page, Prev: Texinfo specific export settings, Up: Texinfo Export + +12.14.3 Texinfo file header +--------------------------- + +After creating the header for a Texinfo file, the Texinfo back-end +automatically generates a name and destination path for the Info file. +To override this default with a more sensible path and name, specify the +‘TEXINFO_FILENAME’ keyword. + + Along with the output’s file name, the Texinfo header also contains +language details (see *note Export Settings::) and encoding system as +set in the ‘org-texinfo-coding-system’ variable. Insert +‘TEXINFO_HEADER’ keywords for each additional command in the header, for +example: + + #+TEXINFO_HEADER: @synindex + + Instead of repeatedly installing the same set of commands, define a +class in ‘org-texinfo-classes’ once, and then activate it in the +document by setting the ‘TEXINFO_CLASS’ keyword to that class. + + +File: org, Node: Texinfo title and copyright page, Next: Info directory file, Prev: Texinfo file header, Up: Texinfo Export + +12.14.4 Texinfo title and copyright page +---------------------------------------- + +The default template for hard copy output has a title page with ‘TITLE’ +and ‘AUTHOR’ keywords (see *note Export Settings::). To replace the +regular title with something different for the printed version, use the +‘TEXINFO_PRINTED_TITLE’ and ‘SUBTITLE’ keywords. Both expect raw +Texinfo code for setting their values. + + If one ‘AUTHOR’ line is not sufficient, add multiple ‘SUBAUTHOR’ +keywords. They have to be set in raw Texinfo code. + + #+AUTHOR: Jane Smith + #+SUBAUTHOR: John Doe + #+TEXINFO_PRINTED_TITLE: This Long Title@@inlinefmt{tex,@*} Is Broken in @TeX{} + + Copying material is defined in a dedicated headline with a non-‘nil’ +‘COPYING’ property. The back-end inserts the contents within a +‘@copying’ command at the beginning of the document. The heading itself +does not appear in the structure of the document. + + Copyright information is printed on the back of the title page. + + * Legalese + :PROPERTIES: + :COPYING: t + :END: + + This is a short example of a complete Texinfo file, version 1.0. + + Copyright \copy 2016 Free Software Foundation, Inc. + + +File: org, Node: Info directory file, Next: Headings and sectioning structure, Prev: Texinfo title and copyright page, Up: Texinfo Export + +12.14.5 Info directory file +--------------------------- + +The end result of the Texinfo export process is the creation of an Info +file. This Info file’s metadata has variables for category, title, and +description: ‘TEXINFO_DIR_CATEGORY’, ‘TEXINFO_DIR_TITLE’, and +‘TEXINFO_DIR_DESC’ keywords that establish where in the Info hierarchy +the file fits. + + Here is an example that writes to the Info directory file: + + #+TEXINFO_DIR_CATEGORY: Emacs + #+TEXINFO_DIR_TITLE: Org Mode: (org) + #+TEXINFO_DIR_DESC: Outline-based notes management and organizer + + +File: org, Node: Headings and sectioning structure, Next: Indices, Prev: Info directory file, Up: Texinfo Export + +12.14.6 Headings and sectioning structure +----------------------------------------- + +The Texinfo export back-end uses a pre-defined scheme to convert Org +headlines to equivalent Texinfo structuring commands. A scheme like +this maps top-level headlines to numbered chapters tagged as ‘@chapter’ +and lower-level headlines to unnumbered chapters tagged as +‘@unnumbered’. To override such mappings to introduce ‘@part’ or other +Texinfo structuring commands, define a new class in +‘org-texinfo-classes’. Activate the new class with the ‘TEXINFO_CLASS’ +keyword. When no new class is defined and activated, the Texinfo export +back-end defaults to the ‘org-texinfo-default-class’. + + If an Org headline’s level has no associated Texinfo structuring +command, or is below a certain threshold (see *note Export Settings::), +then the Texinfo export back-end makes it into a list item. + + The Texinfo export back-end makes any headline with a non-‘nil’ +‘APPENDIX’ property into an appendix. This happens independent of the +Org headline level or the ‘TEXINFO_CLASS’ keyword. + + The Texinfo export back-end creates a menu entry after the Org +headline for each regular sectioning structure. To override this with a +shorter menu entry, use the ‘ALT_TITLE’ property (see *note Table of +Contents::). Texinfo menu entries also have an option for a longer +‘DESCRIPTION’ property. Here’s an example that uses both to override +the default menu entry: + + * Controlling Screen Display + :PROPERTIES: + :ALT_TITLE: Display + :DESCRIPTION: Controlling Screen Display + :END: + + The text before the first headline belongs to the _Top_ node, i.e., +the node in which a reader enters an Info manual. As such, it is +expected not to appear in printed output generated from the ‘.texi’ +file. See *note (texinfo)The Top Node::, for more information. + + +File: org, Node: Indices, Next: Quoting Texinfo code, Prev: Headings and sectioning structure, Up: Texinfo Export + +12.14.7 Indices +--------------- + +The Texinfo export back-end recognizes these indexing keywords if used +in the Org file: ‘CINDEX’, ‘FINDEX’, ‘KINDEX’, ‘PINDEX’, ‘TINDEX’ and +‘VINDEX’. Write their value as verbatim Texinfo code; in particular, +‘{’, ‘}’ and ‘@’ characters need to be escaped with ‘@’ if they do not +belong to a Texinfo command. + + #+CINDEX: Defining indexing entries + + For the back-end to generate an index entry for a headline, set the +‘INDEX’ property to ‘cp’ or ‘vr’. These abbreviations come from Texinfo +that stand for concept index and variable index. The Texinfo manual has +abbreviations for all other kinds of indexes. The back-end exports the +headline as an unnumbered chapter or section command, and then inserts +the index after its contents. + + * Concept Index + :PROPERTIES: + :INDEX: cp + :END: + + +File: org, Node: Quoting Texinfo code, Next: Plain lists in Texinfo export, Prev: Indices, Up: Texinfo Export + +12.14.8 Quoting Texinfo code +---------------------------- + +Use any of the following three methods to insert or escape raw Texinfo +code: + + Richard @@texinfo:@sc{@@Stallman@@texinfo:}@@ commence' GNU. + + #+TEXINFO: @need800 + This paragraph is preceded by... + + #+BEGIN_EXPORT texinfo + @auindex Johnson, Mark + @auindex Lakoff, George + #+END_EXPORT + + +File: org, Node: Plain lists in Texinfo export, Next: Tables in Texinfo export, Prev: Quoting Texinfo code, Up: Texinfo Export + +12.14.9 Plain lists in Texinfo export +------------------------------------- + +The Texinfo export back-end by default converts description lists in the +Org file using the default command ‘@table’, which results in a table +with two columns. To change this behavior, specify ‘:table-type’ with +‘ftable’ or ‘vtable’ attributes. For more information, see *note +(texinfo)Two-column Tables::. + + The Texinfo export back-end by default also applies a text highlight +based on the defaults stored in ‘org-texinfo-table-default-markup’. To +override the default highlight command, specify another one with the +‘:indic’ attribute. + + Org syntax is limited to one entry per list item. Nevertheless, the +Texinfo export back-end can split that entry according to any text +provided through the ‘:sep’ attribute. Each part then becomes a new +entry in the first column of the table. + + The following example illustrates all the attributes above: + + #+ATTR_TEXINFO: :table-type vtable :sep , :indic asis + - foo, bar :: This is the common text for variables foo and bar. + +becomes + + @vtable @asis + @item foo + @itemx bar + This is the common text for variables foo and bar. + @end table + + +File: org, Node: Tables in Texinfo export, Next: Images in Texinfo export, Prev: Plain lists in Texinfo export, Up: Texinfo Export + +12.14.10 Tables in Texinfo export +--------------------------------- + +When exporting tables, the Texinfo export back-end uses the widest cell +width in each column. To override this and instead specify as fractions +of line length, use the ‘:columns’ attribute. See example below. + + #+ATTR_TEXINFO: :columns .5 .5 + | a cell | another cell | + + +File: org, Node: Images in Texinfo export, Next: Quotations in Texinfo export, Prev: Tables in Texinfo export, Up: Texinfo Export + +12.14.11 Images in Texinfo export +--------------------------------- + +Insert a file link to the image in the Org file, and the Texinfo export +back-end inserts the image. These links must have the usual supported +image extensions and no descriptions. To scale the image, use ‘:width’ +and ‘:height’ attributes. For alternate text, use ‘:alt’ and specify +the text using Texinfo code, as shown in the example: + + #+ATTR_TEXINFO: :width 1in :alt Alternate @i{text} + [[ridt.pdf]] + + +File: org, Node: Quotations in Texinfo export, Next: Special blocks in Texinfo export, Prev: Images in Texinfo export, Up: Texinfo Export + +12.14.12 Quotations in Texinfo export +------------------------------------- + +You can write the text of a quotation within a quote block (see *note +Paragraphs::). You may also emphasize some text at the beginning of the +quotation with the ‘:tag’ attribute. + + #+ATTR_TEXINFO: :tag Warning + #+BEGIN_QUOTE + Striking your thumb with a hammer may cause severe pain and discomfort. + #+END_QUOTE + + To specify the author of the quotation, use the ‘:author’ attribute. + + #+ATTR_TEXINFO: :author King Arthur + #+BEGIN_QUOTE + The Lady of the Lake, her arm clad in the purest shimmering samite, + held aloft Excalibur from the bosom of the water, signifying by divine + providence that I, Arthur, was to carry Excalibur. That is why I am + your king. + #+END_QUOTE + + +File: org, Node: Special blocks in Texinfo export, Next: A Texinfo example, Prev: Quotations in Texinfo export, Up: Texinfo Export + +12.14.13 Special blocks in Texinfo export +----------------------------------------- + +The Texinfo export back-end converts special blocks to commands with the +same name. It also adds any ‘:options’ attributes to the end of the +command, as shown in this example: + + #+ATTR_TEXINFO: :options org-org-export-to-org ... + #+BEGIN_defun + A somewhat obsessive function name. + #+END_defun + +becomes + + @defun org-org-export-to-org ... + A somewhat obsessive function name. + @end defun + + +File: org, Node: A Texinfo example, Prev: Special blocks in Texinfo export, Up: Texinfo Export + +12.14.14 A Texinfo example +-------------------------- + +Here is a more detailed example Org file. See *note (texinfo)GNU Sample +Texts:: for an equivalent example using Texinfo code. + + #+TITLE: GNU Sample {{{version}}} + #+SUBTITLE: for version {{{version}}}, {{{updated}}} + #+AUTHOR: A.U. Thor + #+EMAIL: bug-sample@gnu.org + + #+OPTIONS: ':t toc:t author:t email:t + #+LANGUAGE: en + + #+MACRO: version 2.0 + #+MACRO: updated last updated 4 March 2014 + + #+TEXINFO_FILENAME: sample.info + #+TEXINFO_HEADER: @syncodeindex pg cp + + #+TEXINFO_DIR_CATEGORY: Texinfo documentation system + #+TEXINFO_DIR_TITLE: sample: (sample) + #+TEXINFO_DIR_DESC: Invoking sample + + #+TEXINFO_PRINTED_TITLE: GNU Sample + + This manual is for GNU Sample (version {{{version}}}, + {{{updated}}}). + + * Copying + :PROPERTIES: + :COPYING: t + :END: + + This manual is for GNU Sample (version {{{version}}}, + {{{updated}}}), which is an example in the Texinfo documentation. + + Copyright \copy 2016 Free Software Foundation, Inc. + + #+BEGIN_QUOTE + Permission is granted to copy, distribute and/or modify this + document under the terms of the GNU Free Documentation License, + Version 1.3 or any later version published by the Free Software + Foundation; with no Invariant Sections, with no Front-Cover Texts, + and with no Back-Cover Texts. A copy of the license is included in + the section entitled "GNU Free Documentation License". + #+END_QUOTE + + * Invoking sample + + #+PINDEX: sample + #+CINDEX: invoking @command{sample} + + This is a sample manual. There is no sample program to invoke, but + if there were, you could see its basic usage and command line + options here. + + * GNU Free Documentation License + :PROPERTIES: + :APPENDIX: t + :END: + + #+TEXINFO: @include fdl.texi + + * Index + :PROPERTIES: + :INDEX: cp + :END: + + +File: org, Node: iCalendar Export, Next: Other Built-in Back-ends, Prev: Texinfo Export, Up: Exporting + +12.15 iCalendar Export +====================== + +A large part of Org mode’s interoperability success is its ability to +easily export to or import from external applications. The iCalendar +export back-end takes calendar data from Org files and exports to the +standard iCalendar format. + + The iCalendar export back-end can also incorporate TODO entries based +on the configuration of the ‘org-icalendar-include-todo’ variable. The +back-end exports plain timestamps as ‘VEVENT’, TODO items as ‘VTODO’, +and also create events from deadlines that are in non-TODO items. The +back-end uses the deadlines and scheduling dates in Org TODO items for +setting the start and due dates for the iCalendar TODO entry. Consult +the ‘org-icalendar-use-deadline’ and ‘org-icalendar-use-scheduled’ +variables for more details. + + For tags on the headline, the iCalendar export back-end makes them +into iCalendar categories. To tweak the inheritance of tags and TODO +states, configure the variable ‘org-icalendar-categories’. To assign +clock alarms based on time, configure the ‘org-icalendar-alarm-time’ +variable. + + The iCalendar format standard requires globally unique identifier—or +UID—for each entry. The iCalendar export back-end creates UIDs during +export. To save a copy of the UID in the Org file set the variable +‘org-icalendar-store-UID’. The back-end looks for the ‘ID’ property of +the entry for re-using the same UID for subsequent exports. + + Since a single Org entry can result in multiple iCalendar +entries—timestamp, deadline, scheduled item, or TODO item—Org adds +prefixes to the UID, depending on which part of the Org entry triggered +the creation of the iCalendar entry. Prefixing ensures UIDs remains +unique, yet enable synchronization programs trace the connections. + +‘C-c C-e c f’ (‘org-icalendar-export-to-ics’) + Create iCalendar entries from the current Org buffer and store them + in the same directory, using a file extension ‘.ics’. + +‘C-c C-e c a’ (‘org-icalendar-export-agenda-files’) + Create iCalendar entries from Org files in ‘org-agenda-files’ and + store in a separate iCalendar file for each Org file. + +‘C-c C-e c c’ (‘org-icalendar-combine-agenda-files’) + Create a combined iCalendar file from Org files in + ‘org-agenda-files’ and write it to + ‘org-icalendar-combined-agenda-file’ file name. + + The iCalendar export back-end includes ‘SUMMARY’, ‘DESCRIPTION’, +‘LOCATION’ and ‘TIMEZONE’ properties from the Org entries when +exporting. To force the back-end to inherit the ‘LOCATION’ and +‘TIMEZONE’ properties, configure the ‘org-use-property-inheritance’ +variable. + + When Org entries do not have ‘SUMMARY’, ‘DESCRIPTION’ and ‘LOCATION’ +properties, the iCalendar export back-end derives the summary from the +headline, and derives the description from the body of the Org item. +The ‘org-icalendar-include-body’ variable limits the maximum number of +characters of the content are turned into its description. + + The ‘TIMEZONE’ property can be used to specify a per-entry time zone, +and is applied to any entry with timestamp information. Time zones +should be specified as per the IANA time zone database format, e.g., +‘Asia/Almaty’. Alternately, the property value can be ‘UTC’, to force +UTC time for this entry only. + + Exporting to iCalendar format depends in large part on the +capabilities of the destination application. Some are more lenient than +others. Consult the Org mode FAQ for advice on specific applications. + + +File: org, Node: Other Built-in Back-ends, Next: Advanced Export Configuration, Prev: iCalendar Export, Up: Exporting + +12.16 Other Built-in Back-ends +============================== + +Other export back-ends included with Org are: + + • ‘ox-man.el’: Export to a man page. + + To activate such back-ends, either customize ‘org-export-backends’ or +load directly with ‘(require 'ox-man)’. On successful load, the +back-end adds new keys in the export dispatcher (see *note The Export +Dispatcher::). + + Follow the comment section of such files, for example, ‘ox-man.el’, +for usage and configuration details. + + +File: org, Node: Advanced Export Configuration, Next: Export in Foreign Buffers, Prev: Other Built-in Back-ends, Up: Exporting + +12.17 Advanced Export Configuration +=================================== + +Hooks +----- + +The export process executes two hooks before the actual exporting +begins. The first hook, ‘org-export-before-processing-hook’, runs +before any expansions of macros, Babel code, and include keywords in the +buffer. The second hook, ‘org-export-before-parsing-hook’, runs before +the buffer is parsed. + + Functions added to these hooks are called with a single argument: the +export back-end actually used, as a symbol. You may use them for heavy +duty structural modifications of the document. For example, you can +remove every headline in the buffer during export like this: + + (defun my-headline-removal (backend) + "Remove all headlines in the current buffer. + BACKEND is the export back-end being used, as a symbol." + (org-map-entries + (lambda () (delete-region (point) (line-beginning-position 2))))) + + (add-hook 'org-export-before-parsing-hook 'my-headline-removal) + +Filters +------- + +Filters are lists of functions to be applied to certain parts for a +given back-end. The output from the first function in the filter is +passed on to the next function in the filter. The final output is the +output from the final function in the filter. + + The Org export process has many filter sets applicable to different +types of objects, plain text, parse trees, export options, and final +output formats. The filters are named after the element type or object +type: ‘org-export-filter-TYPE-functions’, where TYPE is the type +targeted by the filter. Valid types are: + +body bold babel-call +center-block clock code +diary-sexp drawer dynamic-block +entity example-block export-block +export-snippet final-output fixed-width +footnote-definition footnote-reference headline +horizontal-rule inline-babel-call inline-src-block +inlinetask italic item +keyword latex-environment latex-fragment +line-break link node-property +options paragraph parse-tree +plain-list plain-text planning +property-drawer quote-block radio-target +section special-block src-block +statistics-cookie strike-through subscript +superscript table table-cell +table-row target timestamp +underline verbatim verse-block + + Here is an example filter that replaces non-breaking spaces ‘ ’ in +the Org buffer with ‘~’ for the LaTeX back-end. + + (defun my-latex-filter-nobreaks (text backend info) + "Ensure \" \" are properly handled in LaTeX export." + (when (org-export-derived-backend-p backend 'latex) + (replace-regexp-in-string " " "~" text))) + + (add-to-list 'org-export-filter-plain-text-functions + 'my-latex-filter-nobreaks) + + A filter requires three arguments: the code to be transformed, the +name of the back-end, and some optional information about the export +process. The third argument can be safely ignored. Note the use of +‘org-export-derived-backend-p’ predicate that tests for _latex_ back-end +or any other back-end, such as _beamer_, derived from _latex_. + +Defining filters for individual files +------------------------------------- + +The Org export can filter not just for back-ends, but also for specific +files through the ‘BIND’ keyword. Here is an example with two filters; +one removes brackets from time stamps, and the other removes +strike-through text. The filter functions are defined in a code block +in the same Org file, which is a handy location for debugging. + + #+BIND: org-export-filter-timestamp-functions (tmp-f-timestamp) + #+BIND: org-export-filter-strike-through-functions (tmp-f-strike-through) + #+BEGIN_SRC emacs-lisp :exports results :results none + (defun tmp-f-timestamp (s backend info) + (replace-regexp-in-string "&[lg]t;\\|[][]" "" s)) + (defun tmp-f-strike-through (s backend info) "") + #+END_SRC + +Extending an existing back-end +------------------------------ + +Some parts of the conversion process can be extended for certain +elements so as to introduce a new or revised translation. That is how +the HTML export back-end was extended to handle Markdown format. The +extensions work seamlessly so any aspect of filtering not done by the +extended back-end is handled by the original back-end. Of all the +export customization in Org, extending is very powerful as it operates +at the parser level. + + For this example, make the _ascii_ back-end display the language used +in a source code block. Also make it display only when some attribute +is non-‘nil’, like the following: + + #+ATTR_ASCII: :language t + + Then extend ASCII back-end with a custom “my-ascii” back-end. + + (defun my-ascii-src-block (src-block contents info) + "Transcode a SRC-BLOCK element from Org to ASCII. + CONTENTS is nil. INFO is a plist used as a communication + channel." + (if (not (org-export-read-attribute :attr_ascii src-block :language)) + (org-export-with-backend 'ascii src-block contents info) + (concat + (format ",--[ %s ]--\n%s`----" + (org-element-property :language src-block) + (replace-regexp-in-string + "^" "| " + (org-element-normalize-string + (org-export-format-code-default src-block info))))))) + + (org-export-define-derived-backend 'my-ascii 'ascii + :translate-alist '((src-block . my-ascii-src-block))) + + The ‘my-ascii-src-block’ function looks at the attribute above the +current element. If not true, hands over to _ascii_ back-end. If true, +which it is in this example, it creates a box around the code and leaves +room for the inserting a string for language. The last form creates the +new back-end that springs to action only when translating ‘src-block’ +type elements. + + To use the newly defined back-end, evaluate the following from an Org +buffer: + + (org-export-to-buffer 'my-ascii "*Org MY-ASCII Export*") + + Further steps to consider would be an interactive function, +self-installing an item in the export dispatcher menu, and other +user-friendly improvements. + + +File: org, Node: Export in Foreign Buffers, Prev: Advanced Export Configuration, Up: Exporting + +12.18 Export in Foreign Buffers +=============================== + +The export back-ends in Org often include commands to convert selected +regions. A convenient feature of this in-place conversion is that the +exported output replaces the original source. Here are such functions: + +‘org-ascii-convert-region-to-ascii’ + Convert the selected region into ASCII. + +‘org-ascii-convert-region-to-utf8’ + Convert the selected region into UTF-8. + +‘org-html-convert-region-to-html’ + Convert the selected region into HTML. + +‘org-latex-convert-region-to-latex’ + Convert the selected region into LaTeX. + +‘org-texinfo-convert-region-to-texinfo’ + Convert the selected region into Texinfo. + +‘org-md-convert-region-to-md’ + Convert the selected region into Markdown. + + In-place conversions are particularly handy for quick conversion of +tables and lists in foreign buffers. For example, in an HTML buffer, +write a list in Org syntax, select it, and convert it to HTML with ‘M-x +org-html-convert-region-to-html’. + + +File: org, Node: Publishing, Next: Working with Source Code, Prev: Exporting, Up: Top + +13 Publishing +************* + +Org includes a publishing management system that allows you to configure +automatic HTML conversion of _projects_ composed of interlinked Org +files. You can also configure Org to automatically upload your exported +HTML pages and related attachments, such as images and source code +files, to a web server. + + You can also use Org to convert files into PDF, or even combine HTML +and PDF conversion so that files are available in both formats on the +server. + + Publishing has been contributed to Org by David O’Toole. + +* Menu: + +* Configuration:: Defining projects. +* Uploading Files:: How to get files up on the server. +* Sample Configuration:: Example projects. +* Triggering Publication:: Publication commands. + + +File: org, Node: Configuration, Next: Uploading Files, Up: Publishing + +13.1 Configuration +================== + +Publishing needs significant configuration to specify files, destination +and many other properties of a project. + +* Menu: + +* Project alist:: The central configuration variable. +* Sources and destinations:: From here to there. +* Selecting files:: What files are part of the project? +* Publishing action:: Setting the function doing the publishing. +* Publishing options:: Tweaking HTML/LaTeX export. +* Publishing links:: Which links keep working after publishing? +* Site map:: Generating a list of all pages. +* Generating an index:: An index that reaches across pages. + + +File: org, Node: Project alist, Next: Sources and destinations, Up: Configuration + +13.1.1 The variable ‘org-publish-project-alist’ +----------------------------------------------- + +Publishing is configured almost entirely through setting the value of +one variable, called ‘org-publish-project-alist’. Each element of the +list configures one project, and may be in one of the two following +forms: + + ("project-name" :property value :property value ...) + +i.e., a well-formed property list with alternating keys and values, or: + + ("project-name" :components ("project-name" "project-name" ...)) + + In both cases, projects are configured by specifying property values. +A project defines the set of files that are to be published, as well as +the publishing configuration to use when publishing those files. When a +project takes the second form listed above, the individual members of +the ‘:components’ property are taken to be sub-projects, which group +together files requiring different publishing options. When you publish +such a “meta-project”, all the components are also published, in the +sequence given. + + +File: org, Node: Sources and destinations, Next: Selecting files, Prev: Project alist, Up: Configuration + +13.1.2 Sources and destinations for files +----------------------------------------- + +Most properties are optional, but some should always be set. In +particular, Org needs to know where to look for source files, and where +to put published files. + +‘:base-directory’ + Directory containing publishing source files. + +‘:publishing-directory’ + Directory where output files are published. You can directly + publish to a webserver using a file name syntax appropriate for the + Emacs tramp package. Or you can publish to a local directory and + use external tools to upload your website (see *note Uploading + Files::). + +‘:preparation-function’ + Function or list of functions to be called before starting the + publishing process, for example, to run ‘make’ for updating files + to be published. Each preparation function is called with a single + argument, the project property list. + +‘:completion-function’ + Function or list of functions called after finishing the publishing + process, for example, to change permissions of the resulting files. + Each completion function is called with a single argument, the + project property list. + + +File: org, Node: Selecting files, Next: Publishing action, Prev: Sources and destinations, Up: Configuration + +13.1.3 Selecting files +---------------------- + +By default, all files with extension ‘.org’ in the base directory are +considered part of the project. This can be modified by setting the +following properties + +‘:base-extension’ + Extension—without the dot—of source files. This actually is a + regular expression. Set this to the symbol ‘any’ if you want to + get all files in ‘:base-directory’, even without extension. + +‘:exclude’ + Regular expression to match file names that should not be + published, even though they have been selected on the basis of + their extension. + +‘:include’ + List of files to be included regardless of ‘:base-extension’ and + ‘:exclude’. + +‘:recursive’ + Non-‘nil’ means, check base-directory recursively for files to + publish. + + +File: org, Node: Publishing action, Next: Publishing options, Prev: Selecting files, Up: Configuration + +13.1.4 Publishing action +------------------------ + +Publishing means that a file is copied to the destination directory and +possibly transformed in the process. The default transformation is to +export Org files as HTML files, and this is done by the function +‘org-publish-org-to-html’ which calls the HTML exporter (see *note HTML +Export::). But you can also publish your content as PDF files using +‘org-publish-org-to-pdf’, or as ASCII, Texinfo, etc., using the +corresponding functions. + + If you want to publish the Org file as an ‘.org’ file but with +_archived_, _commented_, and _tag-excluded_ trees removed, use +‘org-publish-org-to-org’. This produces ‘file.org’ and put it in the +publishing directory. If you want a htmlized version of this file, set +the parameter ‘:htmlized-source’ to ‘t’. It produces ‘file.org.html’ in +the publishing directory(1). + + Other files like images only need to be copied to the publishing +destination; for this you can use ‘org-publish-attachment’. For non-Org +files, you always need to specify the publishing function: + +‘:publishing-function’ + Function executing the publication of a file. This may also be a + list of functions, which are all called in turn. + +‘:htmlized-source’ + Non-‘nil’ means, publish htmlized source. + + The function must accept three arguments: a property list containing +at least a ‘:publishing-directory’ property, the name of the file to be +published, and the path to the publishing directory of the output file. +It should take the specified file, make the necessary transformation, if +any, and place the result into the destination folder. + + ---------- Footnotes ---------- + + (1) If the publishing directory is the same as the source directory, +‘file.org’ is exported as ‘file.org.org’, so you probably do not want to +do this. + + +File: org, Node: Publishing options, Next: Publishing links, Prev: Publishing action, Up: Configuration + +13.1.5 Options for the exporters +-------------------------------- + +The property list can be used to set many export options for the HTML +and LaTeX exporters. In most cases, these properties correspond to user +variables in Org. The table below lists these properties along with the +variable they belong to. See the documentation string for the +respective variable for details. + + When a property is given a value in ‘org-publish-project-alist’, its +setting overrides the value of the corresponding user variable, if any, +during publishing. Options set within a file (see *note Export +Settings::), however, override everything. + +Generic properties +.................. + +‘:archived-trees’ ‘org-export-with-archived-trees’ +‘:exclude-tags’ ‘org-export-exclude-tags’ +‘:headline-levels’ ‘org-export-headline-levels’ +‘:language’ ‘org-export-default-language’ +‘:preserve-breaks’ ‘org-export-preserve-breaks’ +‘:section-numbers’ ‘org-export-with-section-numbers’ +‘:select-tags’ ‘org-export-select-tags’ +‘:with-author’ ‘org-export-with-author’ +‘:with-broken-links’ ‘org-export-with-broken-links’ +‘:with-clocks’ ‘org-export-with-clocks’ +‘:with-creator’ ‘org-export-with-creator’ +‘:with-date’ ‘org-export-with-date’ +‘:with-drawers’ ‘org-export-with-drawers’ +‘:with-email’ ‘org-export-with-email’ +‘:with-emphasize’ ‘org-export-with-emphasize’ +‘:with-fixed-width’ ‘org-export-with-fixed-width’ +‘:with-footnotes’ ‘org-export-with-footnotes’ +‘:with-latex’ ‘org-export-with-latex’ +‘:with-planning’ ‘org-export-with-planning’ +‘:with-priority’ ‘org-export-with-priority’ +‘:with-properties’ ‘org-export-with-properties’ +‘:with-special-strings’ ‘org-export-with-special-strings’ +‘:with-sub-superscript’ ‘org-export-with-sub-superscripts’ +‘:with-tables’ ‘org-export-with-tables’ +‘:with-tags’ ‘org-export-with-tags’ +‘:with-tasks’ ‘org-export-with-tasks’ +‘:with-timestamps’ ‘org-export-with-timestamps’ +‘:with-title’ ‘org-export-with-title’ +‘:with-toc’ ‘org-export-with-toc’ +‘:with-todo-keywords’ ‘org-export-with-todo-keywords’ + +ASCII specific properties +......................... + +‘:ascii-bullets’ ‘org-ascii-bullets’ +‘:ascii-caption-above’ ‘org-ascii-caption-above’ +‘:ascii-charset’ ‘org-ascii-charset’ +‘:ascii-global-margin’ ‘org-ascii-global-margin’ +‘:ascii-format-drawer-function’ ‘org-ascii-format-drawer-function’ +‘:ascii-format-inlinetask-function’ ‘org-ascii-format-inlinetask-function’ +‘:ascii-headline-spacing’ ‘org-ascii-headline-spacing’ +‘:ascii-indented-line-width’ ‘org-ascii-indented-line-width’ +‘:ascii-inlinetask-width’ ‘org-ascii-inlinetask-width’ +‘:ascii-inner-margin’ ‘org-ascii-inner-margin’ +‘:ascii-links-to-notes’ ‘org-ascii-links-to-notes’ +‘:ascii-list-margin’ ‘org-ascii-list-margin’ +‘:ascii-paragraph-spacing’ ‘org-ascii-paragraph-spacing’ +‘:ascii-quote-margin’ ‘org-ascii-quote-margin’ +‘:ascii-table-keep-all-vertical-lines’ ‘org-ascii-table-keep-all-vertical-lines’ +‘:ascii-table-use-ascii-art’ ‘org-ascii-table-use-ascii-art’ +‘:ascii-table-widen-columns’ ‘org-ascii-table-widen-columns’ +‘:ascii-text-width’ ‘org-ascii-text-width’ +‘:ascii-underline’ ‘org-ascii-underline’ +‘:ascii-verbatim-format’ ‘org-ascii-verbatim-format’ + +Beamer specific properties +.......................... + +‘:beamer-theme’ ‘org-beamer-theme’ +‘:beamer-column-view-format’ ‘org-beamer-column-view-format’ +‘:beamer-environments-extra’ ‘org-beamer-environments-extra’ +‘:beamer-frame-default-options’ ‘org-beamer-frame-default-options’ +‘:beamer-outline-frame-options’ ‘org-beamer-outline-frame-options’ +‘:beamer-outline-frame-title’ ‘org-beamer-outline-frame-title’ +‘:beamer-subtitle-format’ ‘org-beamer-subtitle-format’ + +HTML specific properties +........................ + +‘:html-allow-name-attribute-in-anchors’ ‘org-html-allow-name-attribute-in-anchors’ +‘:html-checkbox-type’ ‘org-html-checkbox-type’ +‘:html-container’ ‘org-html-container-element’ +‘:html-divs’ ‘org-html-divs’ +‘:html-doctype’ ‘org-html-doctype’ +‘:html-extension’ ‘org-html-extension’ +‘:html-footnote-format’ ‘org-html-footnote-format’ +‘:html-footnote-separator’ ‘org-html-footnote-separator’ +‘:html-footnotes-section’ ‘org-html-footnotes-section’ +‘:html-format-drawer-function’ ‘org-html-format-drawer-function’ +‘:html-format-headline-function’ ‘org-html-format-headline-function’ +‘:html-format-inlinetask-function’ ‘org-html-format-inlinetask-function’ +‘:html-head-extra’ ‘org-html-head-extra’ +‘:html-head-include-default-style’ ‘org-html-head-include-default-style’ +‘:html-head-include-scripts’ ‘org-html-head-include-scripts’ +‘:html-head’ ‘org-html-head’ +‘:html-home/up-format’ ‘org-html-home/up-format’ +‘:html-html5-fancy’ ‘org-html-html5-fancy’ +‘:html-indent’ ‘org-html-indent’ +‘:html-infojs-options’ ‘org-html-infojs-options’ +‘:html-infojs-template’ ‘org-html-infojs-template’ +‘:html-inline-image-rules’ ‘org-html-inline-image-rules’ +‘:html-inline-images’ ‘org-html-inline-images’ +‘:html-link-home’ ‘org-html-link-home’ +‘:html-link-org-files-as-html’ ‘org-html-link-org-files-as-html’ +‘:html-link-up’ ‘org-html-link-up’ +‘:html-link-use-abs-url’ ‘org-html-link-use-abs-url’ +‘:html-mathjax-options’ ‘org-html-mathjax-options’ +‘:html-mathjax-template’ ‘org-html-mathjax-template’ +‘:html-metadata-timestamp-format’ ‘org-html-metadata-timestamp-format’ +‘:html-postamble-format’ ‘org-html-postamble-format’ +‘:html-postamble’ ‘org-html-postamble’ +‘:html-preamble-format’ ‘org-html-preamble-format’ +‘:html-preamble’ ‘org-html-preamble’ +‘:html-table-align-individual-field’ ‘de{org-html-table-align-individual-fields’ +‘:html-table-attributes’ ‘org-html-table-default-attributes’ +‘:html-table-caption-above’ ‘org-html-table-caption-above’ +‘:html-table-data-tags’ ‘org-html-table-data-tags’ +‘:html-table-header-tags’ ‘org-html-table-header-tags’ +‘:html-table-row-tags’ ‘org-html-table-row-tags’ +‘:html-table-use-header-tags-for-first-column’ ‘org-html-table-use-header-tags-for-first-column’ +‘:html-tag-class-prefix’ ‘org-html-tag-class-prefix’ +‘:html-text-markup-alist’ ‘org-html-text-markup-alist’ +‘:html-todo-kwd-class-prefix’ ‘org-html-todo-kwd-class-prefix’ +‘:html-toplevel-hlevel’ ‘org-html-toplevel-hlevel’ +‘:html-use-infojs’ ‘org-html-use-infojs’ +‘:html-validation-link’ ‘org-html-validation-link’ +‘:html-viewport’ ‘org-html-viewport’ +‘:html-xml-declaration’ ‘org-html-xml-declaration’ + +LaTeX specific properties +......................... + +‘:latex-active-timestamp-format’ ‘org-latex-active-timestamp-format’ +‘:latex-caption-above’ ‘org-latex-caption-above’ +‘:latex-classes’ ‘org-latex-classes’ +‘:latex-class’ ‘org-latex-default-class’ +‘:latex-compiler’ ‘org-latex-compiler’ +‘:latex-default-figure-position’ ‘org-latex-default-figure-position’ +‘:latex-default-table-environment’ ‘org-latex-default-table-environment’ +‘:latex-default-table-mode’ ‘org-latex-default-table-mode’ +‘:latex-diary-timestamp-format’ ‘org-latex-diary-timestamp-format’ +‘:latex-footnote-defined-format’ ‘org-latex-footnote-defined-format’ +‘:latex-footnote-separator’ ‘org-latex-footnote-separator’ +‘:latex-format-drawer-function’ ‘org-latex-format-drawer-function’ +‘:latex-format-headline-function’ ‘org-latex-format-headline-function’ +‘:latex-format-inlinetask-function’ ‘org-latex-format-inlinetask-function’ +‘:latex-hyperref-template’ ‘org-latex-hyperref-template’ +‘:latex-image-default-height’ ‘org-latex-image-default-height’ +‘:latex-image-default-option’ ‘org-latex-image-default-option’ +‘:latex-image-default-width’ ‘org-latex-image-default-width’ +‘:latex-images-centered’ ‘org-latex-images-centered’ +‘:latex-inactive-timestamp-format’ ‘org-latex-inactive-timestamp-format’ +‘:latex-inline-image-rules’ ‘org-latex-inline-image-rules’ +‘:latex-link-with-unknown-path-format’ ‘org-latex-link-with-unknown-path-format’ +‘:latex-listings-langs’ ‘org-latex-listings-langs’ +‘:latex-listings-options’ ‘org-latex-listings-options’ +‘:latex-listings’ ‘org-latex-listings’ +‘:latex-minted-langs’ ‘org-latex-minted-langs’ +‘:latex-minted-options’ ‘org-latex-minted-options’ +‘:latex-prefer-user-labels’ ‘org-latex-prefer-user-labels’ +‘:latex-subtitle-format’ ‘org-latex-subtitle-format’ +‘:latex-subtitle-separate’ ‘org-latex-subtitle-separate’ +‘:latex-table-scientific-notation’ ‘org-latex-table-scientific-notation’ +‘:latex-tables-booktabs’ ‘org-latex-tables-booktabs’ +‘:latex-tables-centered’ ‘org-latex-tables-centered’ +‘:latex-text-markup-alist’ ‘org-latex-text-markup-alist’ +‘:latex-title-command’ ‘org-latex-title-command’ +‘:latex-toc-command’ ‘org-latex-toc-command’ + +Markdown specific properties +............................ + +‘:md-footnote-format’ ‘org-md-footnote-format’ +‘:md-footnotes-section’ ‘org-md-footnotes-section’ +‘:md-headline-style’ ‘org-md-headline-style’ + +ODT specific properties +....................... + +‘:odt-content-template-file’ ‘org-odt-content-template-file’ +‘:odt-display-outline-level’ ‘org-odt-display-outline-level’ +‘:odt-fontify-srcblocks’ ‘org-odt-fontify-srcblocks’ +‘:odt-format-drawer-function’ ‘org-odt-format-drawer-function’ +‘:odt-format-headline-function’ ‘org-odt-format-headline-function’ +‘:odt-format-inlinetask-function’ ‘org-odt-format-inlinetask-function’ +‘:odt-inline-formula-rules’ ‘org-odt-inline-formula-rules’ +‘:odt-inline-image-rules’ ‘org-odt-inline-image-rules’ +‘:odt-pixels-per-inch’ ‘org-odt-pixels-per-inch’ +‘:odt-styles-file’ ‘org-odt-styles-file’ +‘:odt-table-styles’ ‘org-odt-table-styles’ +‘:odt-use-date-fields’ ‘org-odt-use-date-fields’ + +Texinfo specific properties +........................... + +‘:texinfo-active-timestamp-format’ ‘org-texinfo-active-timestamp-format’ +‘:texinfo-classes’ ‘org-texinfo-classes’ +‘:texinfo-class’ ‘org-texinfo-default-class’ +‘:texinfo-table-default-markup’ ‘org-texinfo-table-default-markup’ +‘:texinfo-diary-timestamp-format’ ‘org-texinfo-diary-timestamp-format’ +‘:texinfo-filename’ ‘org-texinfo-filename’ +‘:texinfo-format-drawer-function’ ‘org-texinfo-format-drawer-function’ +‘:texinfo-format-headline-function’ ‘org-texinfo-format-headline-function’ +‘:texinfo-format-inlinetask-function’ ‘org-texinfo-format-inlinetask-function’ +‘:texinfo-inactive-timestamp-format’ ‘org-texinfo-inactive-timestamp-format’ +‘:texinfo-link-with-unknown-path-format’ ‘org-texinfo-link-with-unknown-path-format’ +‘:texinfo-node-description-column’ ‘org-texinfo-node-description-column’ +‘:texinfo-table-scientific-notation’ ‘org-texinfo-table-scientific-notation’ +‘:texinfo-tables-verbatim’ ‘org-texinfo-tables-verbatim’ +‘:texinfo-text-markup-alist’ ‘org-texinfo-text-markup-alist’ + + +File: org, Node: Publishing links, Next: Site map, Prev: Publishing options, Up: Configuration + +13.1.6 Publishing links +----------------------- + +To create a link from one Org file to another, you would use something +like ‘[[file:foo.org][The foo]]’ or simply ‘[[file:foo.org]]’ (see *note +External Links::). When published, this link becomes a link to +‘foo.html’. You can thus interlink the pages of your “Org web” project +and the links will work as expected when you publish them to HTML. If +you also publish the Org source file and want to link to it, use an +‘http’ link instead of a ‘file:’ link, because ‘file’ links are +converted to link to the corresponding ‘.html’ file. + + You may also link to related files, such as images. Provided you are +careful with relative file names, and provided you have also configured +Org to upload the related files, these links will work too. See *note +Complex example::, for an example of this usage. + + Eventually, links between published documents can contain some search +options (see *note Search Options::), which will be resolved to the +appropriate location in the linked file. For example, once published to +HTML, the following links all point to a dedicated anchor in ‘foo.html’. + + [[file:foo.org::*heading]] + [[file:foo.org::#custom-id]] + [[file:foo.org::target]] + + +File: org, Node: Site map, Next: Generating an index, Prev: Publishing links, Up: Configuration + +13.1.7 Generating a sitemap +--------------------------- + +The following properties may be used to control publishing of a map of +files for a given project. + +‘:auto-sitemap’ + When non-‘nil’, publish a sitemap during + ‘org-publish-current-project’ or ‘org-publish-all’. + +‘:sitemap-filename’ + Filename for output of sitemap. Defaults to ‘sitemap.org’, which + becomes ‘sitemap.html’. + +‘:sitemap-title’ + Title of sitemap page. Defaults to name of file. + +‘:sitemap-format-entry’ + With this option one can tell how a site-map entry is formatted in + the site-map. It is a function called with three arguments: the + file or directory name relative to base directory of the project, + the site-map style and the current project. It is expected to + return a string. Default value turns file names into links and use + document titles as descriptions. For specific formatting needs, + one can use ‘org-publish-find-date’, ‘org-publish-find-title’ and + ‘org-publish-find-property’, to retrieve additional information + about published documents. + +‘:sitemap-function’ + Plug-in function to use for generation of the sitemap. It is + called with two arguments: the title of the site-map and a + representation of the files and directories involved in the project + as a nested list, which can further be transformed using + ‘org-list-to-generic’, ‘org-list-to-subtree’ and alike. Default + value generates a plain list of links to all files in the project. + +‘:sitemap-sort-folders’ + Where folders should appear in the sitemap. Set this to ‘first’ + (default) or ‘last’ to display folders first or last, respectively. + When set to ‘ignore’, folders are ignored altogether. Any other + value mixes files and folders. This variable has no effect when + site-map style is ‘tree’. + +‘:sitemap-sort-files’ + How the files are sorted in the site map. Set this to + ‘alphabetically’ (default), ‘chronologically’ or + ‘anti-chronologically’. ‘chronologically’ sorts the files with + older date first while ‘anti-chronologically’ sorts the files with + newer date first. ‘alphabetically’ sorts the files alphabetically. + The date of a file is retrieved with ‘org-publish-find-date’. + +‘:sitemap-ignore-case’ + Should sorting be case-sensitive? Default ‘nil’. + +‘:sitemap-file-entry-format’ + With this option one can tell how a sitemap’s entry is formatted in + the sitemap. This is a format string with some escape sequences: + ‘%t’ stands for the title of the file, ‘%a’ stands for the author + of the file and ‘%d’ stands for the date of the file. The date is + retrieved with the ‘org-publish-find-date’ function and formatted + with ‘org-publish-sitemap-date-format’. Default ‘%t’. + +‘:sitemap-date-format’ + Format string for the ‘format-time-string’ function that tells how + a sitemap entry’s date is to be formatted. This property bypasses + ‘org-publish-sitemap-date-format’ which defaults to ‘%Y-%m-%d’. + + +File: org, Node: Generating an index, Prev: Site map, Up: Configuration + +13.1.8 Generating an index +-------------------------- + +Org mode can generate an index across the files of a publishing project. + +‘:makeindex’ + When non-‘nil’, generate in index in the file ‘theindex.org’ and + publish it as ‘theindex.html’. + + The file is created when first publishing a project with the +‘:makeindex’ set. The file only contains a statement ‘#+INCLUDE: +"theindex.inc"’. You can then build around this include statement by +adding a title, style information, etc. + + Index entries are specified with ‘INDEX’ keyword. An entry that +contains an exclamation mark creates a sub item. + + *** Curriculum Vitae + #+INDEX: CV + #+INDEX: Application!CV + + +File: org, Node: Uploading Files, Next: Sample Configuration, Prev: Configuration, Up: Publishing + +13.2 Uploading Files +==================== + +For those people already utilizing third party sync tools such as Rsync +or Unison, it might be preferable not to use the built-in remote +publishing facilities of Org mode which rely heavily on Tramp. Tramp, +while very useful and powerful, tends not to be so efficient for +multiple file transfer and has been known to cause problems under heavy +usage. + + Specialized synchronization utilities offer several advantages. In +addition to timestamp comparison, they also do content and +permissions/attribute checks. For this reason you might prefer to +publish your web to a local directory—possibly even _in place_ with your +Org files—and then use Unison or Rsync to do the synchronization with +the remote host. + + Since Unison, for example, can be configured as to which files to +transfer to a certain remote destination, it can greatly simplify the +project publishing definition. Simply keep all files in the correct +location, process your Org files with ‘org-publish’ and let the +synchronization tool do the rest. You do not need, in this scenario, to +include attachments such as JPG, CSS or PNG files in the project +definition since the third-party tool syncs them. + + Publishing to a local directory is also much faster than to a remote +one, so that you can afford more easily to republish entire projects. +If you set ‘org-publish-use-timestamps-flag’ to ‘nil’, you gain the main +benefit of re-including any changed external files such as source +example files you might include with ‘INCLUDE’ keyword. The timestamp +mechanism in Org is not smart enough to detect if included files have +been modified. + + +File: org, Node: Sample Configuration, Next: Triggering Publication, Prev: Uploading Files, Up: Publishing + +13.3 Sample Configuration +========================= + +Below we provide two example configurations. The first one is a simple +project publishing only a set of Org files. The second example is more +complex, with a multi-component project. + +* Menu: + +* Simple example:: One-component publishing. +* Complex example:: A multi-component publishing example. + + +File: org, Node: Simple example, Next: Complex example, Up: Sample Configuration + +13.3.1 Example: simple publishing configuration +----------------------------------------------- + +This example publishes a set of Org files to the ‘public_html’ directory +on the local machine. + + (setq org-publish-project-alist + '(("org" + :base-directory "~/org/" + :publishing-directory "~/public_html" + :section-numbers nil + :table-of-contents nil + :style ""))) + + +File: org, Node: Complex example, Prev: Simple example, Up: Sample Configuration + +13.3.2 Example: complex publishing configuration +------------------------------------------------ + +This more complicated example publishes an entire website, including Org +files converted to HTML, image files, Emacs Lisp source code, and style +sheets. The publishing directory is remote and private files are +excluded. + + To ensure that links are preserved, care should be taken to replicate +your directory structure on the web server, and to use relative file +paths. For example, if your Org files are kept in ‘~/org/’ and your +publishable images in ‘~/images/’, you would link to an image with + + file:../images/myimage.png + + On the web server, the relative path to the image should be the same. +You can accomplish this by setting up an ‘images/’ folder in the right +place on the web server, and publishing images to it. + + (setq org-publish-project-alist + '(("orgfiles" + :base-directory "~/org/" + :base-extension "org" + :publishing-directory "/ssh:user@host:~/html/notebook/" + :publishing-function org-html-publish-to-html + :exclude "PrivatePage.org" ;; regexp + :headline-levels 3 + :section-numbers nil + :with-toc nil + :html-head "" + :html-preamble t) + + ("images" + :base-directory "~/images/" + :base-extension "jpg\\|gif\\|png" + :publishing-directory "/ssh:user@host:~/html/images/" + :publishing-function org-publish-attachment) + + ("other" + :base-directory "~/other/" + :base-extension "css\\|el" + :publishing-directory "/ssh:user@host:~/html/other/" + :publishing-function org-publish-attachment) + ("website" :components ("orgfiles" "images" "other")))) + + +File: org, Node: Triggering Publication, Prev: Sample Configuration, Up: Publishing + +13.4 Triggering Publication +=========================== + +Once properly configured, Org can publish with the following commands: + +‘C-c C-e X’ (‘org-publish’) + Prompt for a specific project and publish all files that belong to + it. + +‘C-c C-e P’ (‘org-publish-current-project’) + Publish the project containing the current file. + +‘C-c C-e F’ (‘org-publish-current-file’) + Publish only the current file. + +‘C-c C-e E’ (‘org-publish-all’) + Publish every project. + + Org uses timestamps to track when a file has changed. The above +functions normally only publish changed files. You can override this +and force publishing of all files by giving a prefix argument to any of +the commands above, or by customizing the variable +‘org-publish-use-timestamps-flag’. This may be necessary in particular +if files include other files via ‘SETUPFILE’ or ‘INCLUDE’ keywords. + + +File: org, Node: Working with Source Code, Next: Miscellaneous, Prev: Publishing, Up: Top + +14 Working with Source Code +*************************** + +Source code here refers to any plain text collection of computer +instructions, possibly with comments, written using a human-readable +programming language. Org can manage source code in an Org document +when the source code is identified with begin and end markers. Working +with source code begins with identifying source code blocks. A source +code block can be placed almost anywhere in an Org document; it is not +restricted to the preamble or the end of the document. However, Org +cannot manage a source code block if it is placed inside an Org comment +or within a fixed width section. + + Here is an example source code block in the Emacs Lisp language: + + #+BEGIN_SRC emacs-lisp + (defun org-xor (a b) + "Exclusive or." + (if a (not b) b)) + #+END_SRC + + Org can manage the source code in the block delimited by +‘#+BEGIN_SRC’ ... ‘#+END_SRC’ in several ways that can simplify +housekeeping tasks essential to modern source code maintenance. Org can +edit, format, extract, export, and publish source code blocks. Org can +also compile and execute a source code block, then capture the results. +The Org mode literature sometimes refers to source code blocks as _live +code_ blocks because they can alter the content of the Org document or +the material that it exports. Users can control how live they want each +source code block by tweaking the header arguments (see *note Using +Header Arguments::) for compiling, execution, extraction, and exporting. + + Source code blocks are one of many Org block types, which also +include “center”, “comment”, “dynamic”, “example”, “export”, “quote”, +“special”, and “verse”. This section pertains to blocks between +‘#+BEGIN_SRC’ and ‘#+END_SRC’. + + For editing and formatting a source code block, Org uses an +appropriate Emacs major mode that includes features specifically +designed for source code in that language. + + Org can extract one or more source code blocks and write them to one +or more source files—a process known as _tangling_ in literate +programming terminology. + + For exporting and publishing, Org’s back-ends can format a source +code block appropriately, often with native syntax highlighting. + + For executing and compiling a source code block, the user can +configure Org to select the appropriate compiler. Org provides +facilities to collect the result of the execution or compiler output, +insert it into the Org document, and/or export it. In addition to text +results, Org can insert links to other data types, including audio, +video, and graphics. Org can also link a compiler error message to the +appropriate line in the source code block. + + An important feature of Org’s management of source code blocks is the +ability to pass variables, functions, and results to one another using a +common syntax for source code blocks in any language. Although most +literate programming facilities are restricted to one language or +another, Org’s language-agnostic approach lets the literate programmer +match each programming task with the appropriate computer language and +to mix them all together in a single Org document. This +interoperability among languages explains why Org’s source code +management facility was named _Org Babel_ by its originators, Eric +Schulte and Dan Davison. + + Org mode fulfills the promise of easy verification and maintenance of +publishing reproducible research by keeping text, data, code, +configuration settings of the execution environment, the results of the +execution, and associated narratives, claims, references, and internal +and external links in a single Org document. + + Details of Org’s facilities for working with source code are +described in the following sections. + +* Menu: + +* Structure of Code Blocks:: Code block syntax described. +* Using Header Arguments:: Different ways to set header arguments. +* Environment of a Code Block:: Arguments, sessions, working directory... +* Evaluating Code Blocks:: Place results of evaluation in the Org buffer. +* Results of Evaluation:: Choosing a results type, post-processing... +* Exporting Code Blocks:: Export contents and/or results. +* Extracting Source Code:: Create pure source code files. +* Languages:: List of supported code block languages. +* Editing Source Code:: Language major-mode editing. +* Noweb Reference Syntax:: Literate programming in Org mode. +* Library of Babel:: Use and contribute to a library of useful code blocks. +* Key bindings and Useful Functions:: Work quickly with code blocks. +* Batch Execution:: Call functions from the command line. + + +File: org, Node: Structure of Code Blocks, Next: Using Header Arguments, Up: Working with Source Code + +14.1 Structure of Code Blocks +============================= + +Org offers two ways to structure source code in Org documents: in a +source code block, and directly inline. Both specifications are shown +below. + + A source code block conforms to this structure: + + #+NAME: + #+BEGIN_SRC
+ + #+END_SRC + + Do not be put-off by having to remember the source block syntax. Org +mode offers a command for wrapping existing text in a block (see *note +Structure Templates::). Org also works with other completion systems in +Emacs, some of which predate Org and have custom domain-specific +languages for defining templates. Regular use of templates reduces +errors, increases accuracy, and maintains consistency. + + An inline code block conforms to this structure: + + src_{} + +or + + src_[
]{} + +‘#+NAME: ’ + Optional. Names the source block so it can be called, like a + function, from other source blocks or inline code to evaluate or to + capture the results. Code from other blocks, other files, and from + table formulas (see *note The Spreadsheet::) can use the name to + reference a source block. This naming serves the same purpose as + naming Org tables. Org mode requires unique names. For duplicate + names, Org mode’s behavior is undefined. + +‘#+BEGIN_SRC’ ... ‘#+END_SRC’ + Mandatory. They mark the start and end of a block that Org + requires. The ‘#+BEGIN_SRC’ line takes additional arguments, as + described next. + +‘’ + Mandatory. It is the identifier of the source code language in the + block. See *note Languages::, for identifiers of supported + languages. + +‘’ + Optional. Switches provide finer control of the code execution, + export, and format (see the discussion of switches in *note Literal + Examples::). + +‘
’ + Optional. Heading arguments control many aspects of evaluation, + export and tangling of code blocks (see *note Using Header + Arguments::). Using Org’s properties feature, header arguments can + be selectively applied to the entire buffer or specific sub-trees + of the Org document. + +‘’ + Source code in the dialect of the specified language identifier. + + +File: org, Node: Using Header Arguments, Next: Environment of a Code Block, Prev: Structure of Code Blocks, Up: Working with Source Code + +14.2 Using Header Arguments +=========================== + +Org comes with many header arguments common to all languages. New +header arguments are added for specific languages as they become +available for use in source code blocks. A header argument is specified +with an initial colon followed by the argument’s name in lowercase. + + Since header arguments can be set in several ways, Org prioritizes +them in case of overlaps or conflicts by giving local settings a higher +priority. Header values in function calls, for example, override header +values from global defaults. + +System-wide header arguments +---------------------------- + +System-wide values of header arguments can be specified by customizing +the ‘org-babel-default-header-args’ variable, which defaults to the +following values: + + :session => "none" + :results => "replace" + :exports => "code" + :cache => "no" + :noweb => "no" + + The example below sets ‘:noweb’ header arguments to ‘yes’, which +makes Org expand ‘:noweb’ references by default. + + (setq org-babel-default-header-args + (cons '(:noweb . "yes") + (assq-delete-all :noweb org-babel-default-header-args))) + + Each language can have separate default header arguments by +customizing the variable ‘org-babel-default-header-args:’, where + is the name of the language. For details, see the +language-specific online documentation at +. + +Header arguments in Org mode properties +--------------------------------------- + +For header arguments applicable to the buffer, use ‘PROPERTY’ keyword +anywhere in the Org file (see *note Property Syntax::). + + The following example makes all the R code blocks execute in the same +session. Setting ‘:results’ to ‘silent’ ignores the results of +executions for all blocks, not just R code blocks; no results inserted +for any block. + + #+PROPERTY: header-args:R :session *R* + #+PROPERTY: header-args :results silent + + Header arguments set through Org’s property drawers (see *note +Property Syntax::) apply at the sub-tree level on down. Since these +property drawers can appear anywhere in the file hierarchy, Org uses +outermost call or source block to resolve the values. Org ignores +‘org-use-property-inheritance’ setting. + + In this example, ‘:cache’ defaults to ‘yes’ for all code blocks in +the sub-tree. + + * sample header + :PROPERTIES: + :header-args: :cache yes + :END: + + Properties defined through ‘org-set-property’ function, bound to ‘C-c +C-x p’, apply to all active languages. They override properties set in +‘org-babel-default-header-args’. + + Language-specific header arguments are also read from properties +‘header-args:’ where is the language identifier. For +example, + + * Heading + :PROPERTIES: + :header-args:clojure: :session *clojure-1* + :header-args:R: :session *R* + :END: + ** Subheading + :PROPERTIES: + :header-args:clojure: :session *clojure-2* + :END: + +would force separate sessions for Clojure blocks in ‘Heading’ and +‘Subheading’, but use the same session for all R blocks. Blocks in +‘Subheading’ inherit settings from ‘Heading’. + +Code block specific header arguments +------------------------------------ + +Header arguments are most commonly set at the source code block level, +on the ‘#+BEGIN_SRC’ line. Arguments set at this level take precedence +over those set in the ‘org-babel-default-header-args’ variable, and also +those set as header properties. + + In the following example, setting ‘:results’ to ‘silent’ makes it +ignore results of the code execution. Setting ‘:exports’ to ‘code’ +exports only the body of the code block to HTML or LaTeX. + + #+NAME: factorial + #+BEGIN_SRC haskell :results silent :exports code :var n=0 + fac 0 = 1 + fac n = n * fac (n-1) + #+END_SRC + + The same header arguments in an inline code block: + + src_haskell[:exports both]{fac 5} + + Code block header arguments can span multiple lines using ‘#+HEADER:’ +on each line. Note that Org currently accepts the plural spelling of +‘#+HEADER:’ only as a convenience for backward-compatibility. It may be +removed at some point. + + Multi-line header arguments on an unnamed code block: + + #+HEADER: :var data1=1 + #+BEGIN_SRC emacs-lisp :var data2=2 + (message "data1:%S, data2:%S" data1 data2) + #+END_SRC + + #+RESULTS: + : data1:1, data2:2 + + Multi-line header arguments on a named code block: + + #+NAME: named-block + #+HEADER: :var data=2 + #+BEGIN_SRC emacs-lisp + (message "data:%S" data) + #+END_SRC + + #+RESULTS: named-block + : data:2 + +Header arguments in function calls +---------------------------------- + +Header arguments in function calls are the most specific and override +all other settings in case of an overlap. They get the highest +priority. Two ‘#+CALL:’ examples are shown below. For the complete +syntax of ‘CALL’ keyword, see *note Evaluating Code Blocks::. + + In this example, ‘:exports results’ header argument is applied to the +evaluation of the ‘#+CALL:’ line. + + #+CALL: factorial(n=5) :exports results + + In this example, ‘:session special’ header argument is applied to the +evaluation of ‘factorial’ code block. + + #+CALL: factorial[:session special](n=5) + + +File: org, Node: Environment of a Code Block, Next: Evaluating Code Blocks, Prev: Using Header Arguments, Up: Working with Source Code + +14.3 Environment of a Code Block +================================ + +Passing arguments +----------------- + +Use ‘var’ for passing arguments to source code blocks. The specifics of +variables in code blocks vary by the source language and are covered in +the language-specific documentation. The syntax for ‘var’, however, is +the same for all languages. This includes declaring a variable, and +assigning a default value. + + The following syntax is used to pass arguments to code blocks using +the ‘var’ header argument. + + :var NAME=ASSIGN + +NAME is the name of the variable bound in the code block body. ASSIGN +is a literal value, such as a string, a number, a reference to a table, +a list, a literal example, another code block—with or without +arguments—or the results of evaluating a code block. + + Here are examples of passing values by reference: + +table + A table named with a ‘NAME’ keyword. + + #+NAME: example-table + | 1 | + | 2 | + | 3 | + | 4 | + + #+NAME: table-length + #+BEGIN_SRC emacs-lisp :var table=example-table + (length table) + #+END_SRC + + #+RESULTS: table-length + : 4 + + When passing a table, you can treat specially the row, or the + column, containing labels for the columns, or the rows, in the + table. + + The ‘colnames’ header argument accepts ‘yes’, ‘no’, or ‘nil’ + values. The default value is ‘nil’: if an input table has column + names—because the second row is a horizontal rule—then Org removes + the column names, processes the table, puts back the column names, + and then writes the table to the results block. Using ‘yes’, Org + does the same to the first row, even if the initial table does not + contain any horizontal rule. When set to ‘no’, Org does not + pre-process column names at all. + + #+NAME: less-cols + | a | + |---| + | b | + | c | + + #+BEGIN_SRC python :var tab=less-cols :colnames nil + return [[val + '*' for val in row] for row in tab] + #+END_SRC + + #+RESULTS: + | a | + |----| + | b* | + | c* | + + Similarly, the ‘rownames’ header argument can take two values: + ‘yes’ or ‘no’. When set to ‘yes’, Org removes the first column, + processes the table, puts back the first column, and then writes + the table to the results block. The default is ‘no’, which means + Org does not pre-process the first column. Note that Emacs Lisp + code blocks ignore ‘rownames’ header argument because of the ease + of table-handling in Emacs. + + #+NAME: with-rownames + | one | 1 | 2 | 3 | 4 | 5 | + | two | 6 | 7 | 8 | 9 | 10 | + + #+BEGIN_SRC python :var tab=with-rownames :rownames yes + return [[val + 10 for val in row] for row in tab] + #+END_SRC + + #+RESULTS: + | one | 11 | 12 | 13 | 14 | 15 | + | two | 16 | 17 | 18 | 19 | 20 | + +list + A simple named list. + + #+NAME: example-list + - simple + - not + - nested + - list + + #+BEGIN_SRC emacs-lisp :var x=example-list + (print x) + #+END_SRC + + #+RESULTS: + | simple | list | + + Note that only the top level list items are passed along. Nested + list items are ignored. + +code block without arguments + A code block name, as assigned by ‘NAME’ keyword from the example + above, optionally followed by parentheses. + + #+BEGIN_SRC emacs-lisp :var length=table-length() + (* 2 length) + #+END_SRC + + #+RESULTS: + : 8 + +code block with arguments + A code block name, as assigned by ‘NAME’ keyword, followed by + parentheses and optional arguments passed within the parentheses. + + #+NAME: double + #+BEGIN_SRC emacs-lisp :var input=8 + (* 2 input) + #+END_SRC + + #+RESULTS: double + : 16 + + #+NAME: squared + #+BEGIN_SRC emacs-lisp :var input=double(input=1) + (* input input) + #+END_SRC + + #+RESULTS: squared + : 4 + +literal example + A literal example block named with a ‘NAME’ keyword. + + #+NAME: literal-example + #+BEGIN_EXAMPLE + A literal example + on two lines + #+END_EXAMPLE + + #+NAME: read-literal-example + #+BEGIN_SRC emacs-lisp :var x=literal-example + (concatenate #'string x " for you.") + #+END_SRC + + #+RESULTS: read-literal-example + : A literal example + : on two lines for you. + + Indexing variable values enables referencing portions of a variable. +Indexes are 0 based with negative values counting backwards from the +end. If an index is separated by commas then each subsequent section +indexes as the next dimension. Note that this indexing occurs _before_ +other table-related header arguments are applied, such as ‘hlines’, +‘colnames’ and ‘rownames’. The following example assigns the last cell +of the first row the table ‘example-table’ to the variable ‘data’: + + #+NAME: example-table + | 1 | a | + | 2 | b | + | 3 | c | + | 4 | d | + + #+BEGIN_SRC emacs-lisp :var data=example-table[0,-1] + data + #+END_SRC + + #+RESULTS: + : a + + Two integers separated by a colon reference a range of variable +values. In that case the entire inclusive range is referenced. For +example the following assigns the middle three rows of ‘example-table’ +to ‘data’. + + #+NAME: example-table + | 1 | a | + | 2 | b | + | 3 | c | + | 4 | d | + | 5 | 3 | + + #+BEGIN_SRC emacs-lisp :var data=example-table[1:3] + data + #+END_SRC + + #+RESULTS: + | 2 | b | + | 3 | c | + | 4 | d | + + To pick the entire range, use an empty index, or the single character +‘*’. ‘0:-1’ does the same thing. Example below shows how to reference +the first column only. + + #+NAME: example-table + | 1 | a | + | 2 | b | + | 3 | c | + | 4 | d | + + #+BEGIN_SRC emacs-lisp :var data=example-table[,0] + data + #+END_SRC + + #+RESULTS: + | 1 | 2 | 3 | 4 | + + Index referencing can be used for tables and code blocks. Index +referencing can handle any number of dimensions. Commas delimit +multiple dimensions, as shown below. + + #+NAME: 3D + #+BEGIN_SRC emacs-lisp + '(((1 2 3) (4 5 6) (7 8 9)) + ((10 11 12) (13 14 15) (16 17 18)) + ((19 20 21) (22 23 24) (25 26 27))) + #+END_SRC + + #+BEGIN_SRC emacs-lisp :var data=3D[1,,1] + data + #+END_SRC + + #+RESULTS: + | 11 | 14 | 17 | + + Note that row names and column names are not removed prior to +variable indexing. You need to take them into account, even when +‘colnames’ or ‘rownames’ header arguments remove them. + + Emacs lisp code can also set the values for variables. To +differentiate a value from Lisp code, Org interprets any value starting +with ‘(’, ‘[’, ‘'’ or ‘`’ as Emacs Lisp code. The result of evaluating +that code is then assigned to the value of that variable. The following +example shows how to reliably query and pass the file name of the Org +mode buffer to a code block using headers. We need reliability here +because the file’s name could change once the code in the block starts +executing. + + #+BEGIN_SRC sh :var filename=(buffer-file-name) :exports both + wc -w $filename + #+END_SRC + + Note that values read from tables and lists are not mistakenly +evaluated as Emacs Lisp code, as illustrated in the following example. + + #+NAME: table + | (a b c) | + + #+HEADER: :var data=table[0,0] + #+BEGIN_SRC perl + $data + #+END_SRC + + #+RESULTS: + : (a b c) + +Using sessions +-------------- + +Two code blocks can share the same environment. The ‘session’ header +argument is for running multiple source code blocks under one session. +Org runs code blocks with the same session name in the same interpreter +process. + +‘none’ + Default. Each code block gets a new interpreter process to + execute. The process terminates once the block is evaluated. + +STRING + Any string besides ‘none’ turns that string into the name of that + session. For example, ‘:session STRING’ names it ‘STRING’. If + ‘session’ has no value, then the session name is derived from the + source language identifier. Subsequent blocks with the same source + code language use the same session. Depending on the language, + state variables, code from other blocks, and the overall + interpreted environment may be shared. Some interpreted languages + support concurrent sessions when subsequent source code language + blocks change session names. + + Only languages that provide interactive evaluation can have session +support. Not all languages provide this support, such as C and ditaa. +Even languages, such as Python and Haskell, that do support interactive +evaluation impose limitations on allowable language constructs that can +run interactively. Org inherits those limitations for those code blocks +running in a session. + +Choosing a working directory +---------------------------- + +The ‘dir’ header argument specifies the default directory during code +block execution. If it is absent, then the directory associated with +the current buffer is used. In other words, supplying ‘:dir PATH’ +temporarily has the same effect as changing the current directory with +‘M-x cd PATH’, and then not setting ‘dir’. Under the surface, ‘dir’ +simply sets the value of the Emacs variable ‘default-directory’. + + For example, to save the plot file in the ‘Work/’ folder of the home +directory—notice tilde is expanded: + + #+BEGIN_SRC R :file myplot.png :dir ~/Work + matplot(matrix(rnorm(100), 10), type="l") + #+END_SRC + + To evaluate the code block on a remote machine, supply a remote +directory name using Tramp syntax. For example: + + #+BEGIN_SRC R :file plot.png :dir /scp:dand@yakuba.princeton.edu: + plot(1:10, main=system("hostname", intern=TRUE)) + #+END_SRC + + Org first captures the text results as usual for insertion in the Org +file. Then Org also inserts a link to the remote file, thanks to Emacs +Tramp. Org constructs the remote path to the file name from ‘dir’ and +‘default-directory’, as illustrated here: + + [[file:/scp:dand@yakuba.princeton.edu:/home/dand/plot.png][plot.png]] + + When ‘dir’ is used with ‘session’, Org sets the starting directory +for a new session. But Org does not alter the directory of an already +existing session. + + Do not use ‘dir’ with ‘:exports results’ or with ‘:exports both’ to +avoid Org inserting incorrect links to remote files. That is because +Org does not expand ‘default directory’ to avoid some underlying +portability issues. + +Inserting headers and footers +----------------------------- + +The ‘prologue’ header argument is for appending to the top of the code +block for execution, like a reset instruction. For example, you may use +‘:prologue "reset"’ in a Gnuplot code block or, for every such block: + + (add-to-list 'org-babel-default-header-args:gnuplot + '((:prologue . "reset"))) + + + Likewise, the value of the ‘epilogue’ header argument is for +appending to the end of the code block for execution. + + +File: org, Node: Evaluating Code Blocks, Next: Results of Evaluation, Prev: Environment of a Code Block, Up: Working with Source Code + +14.4 Evaluating Code Blocks +=========================== + +A note about security: With code evaluation comes the risk of harm. Org +safeguards by prompting for user’s permission before executing any code +in the source block. To customize this safeguard, or disable it, see +*note Code Evaluation Security::. + +How to evaluate source code +--------------------------- + +Org captures the results of the code block evaluation and inserts them +in the Org file, right after the code block. The insertion point is +after a newline and the ‘RESULTS’ keyword. Org creates the ‘RESULTS’ +keyword if one is not already there. + + By default, Org enables only Emacs Lisp code blocks for execution. +See *note Languages:: to enable other languages. + + Org provides many ways to execute code blocks. ‘C-c C-c’ or ‘C-c C-v +e’ with the point on a code block(1) calls the +‘org-babel-execute-src-block’ function, which executes the code in the +block, collects the results, and inserts them in the buffer. + + By calling a named code block(2) from an Org mode buffer or a table. +Org can call the named code blocks from the current Org mode buffer or +from the “Library of Babel” (see *note Library of Babel::). + + The syntax for ‘CALL’ keyword is: + + #+CALL: () + #+CALL: []() + + The syntax for inline named code blocks is: + + ... call_() ... + ... call_[]()[] ... + + When inline syntax is used, the result is wrapped based on the +variable ‘org-babel-inline-result-wrap’, which by default is set to +‘"=%s="’ to produce verbatim text suitable for markup. + +‘’ + This is the name of the code block (see *note Structure of Code + Blocks::) to be evaluated in the current document. If the block is + located in another file, start ‘’ with the file name followed + by a colon. For example, in order to execute a block named + ‘clear-data’ in ‘file.org’, you can write the following: + + #+CALL: file.org:clear-data() + +‘’ + Org passes arguments to the code block using standard function call + syntax. For example, a ‘#+CALL:’ line that passes ‘4’ to a code + block named ‘double’, which declares the header argument ‘:var + n=2’, would be written as: + + #+CALL: double(n=4) + + Note how this function call syntax is different from the header + argument syntax. + +‘’ + Org passes inside header arguments to the named code block using + the header argument syntax. Inside header arguments apply to code + block evaluation. For example, ‘[:results output]’ collects + results printed to stdout during code execution of that block. + Note how this header argument syntax is different from the function + call syntax. + +‘’ + End header arguments affect the results returned by the code block. + For example, ‘:results html’ wraps the results in a ‘#+BEGIN_EXPORT + html’ block before inserting the results in the Org buffer. + +Limit code block evaluation +--------------------------- + +The ‘eval’ header argument can limit evaluation of specific code blocks +and ‘CALL’ keyword. It is useful for protection against evaluating +untrusted code blocks by prompting for a confirmation. + +‘never’ or ‘no’ + Org never evaluates the source code. + +‘query’ + Org prompts the user for permission to evaluate the source code. + +‘never-export’ or ‘no-export’ + Org does not evaluate the source code when exporting, yet the user + can evaluate it interactively. + +‘query-export’ + Org prompts the user for permission to evaluate the source code + during export. + + If ‘eval’ header argument is not set, then Org determines whether to +evaluate the source code from the ‘org-confirm-babel-evaluate’ variable +(see *note Code Evaluation Security::). + +Cache results of evaluation +--------------------------- + +The ‘cache’ header argument is for caching results of evaluating code +blocks. Caching results can avoid re-evaluating a code block that have +not changed since the previous run. To benefit from the cache and avoid +redundant evaluations, the source block must have a result already +present in the buffer, and neither the header arguments—including the +value of ‘var’ references—nor the text of the block itself has changed +since the result was last computed. This feature greatly helps avoid +long-running calculations. For some edge cases, however, the cached +results may not be reliable. + + The caching feature is best for when code blocks are pure functions, +that is functions that return the same value for the same input +arguments (see *note Environment of a Code Block::), and that do not +have side effects, and do not rely on external variables other than the +input arguments. Functions that depend on a timer, file system objects, +and random number generators are clearly unsuitable for caching. + + A note of warning: when ‘cache’ is used in a session, caching may +cause unexpected results. + + When the caching mechanism tests for any source code changes, it does +not expand Noweb style references (see *note Noweb Reference Syntax::). +For reasons why, see +. + + The ‘cache’ header argument can have one of two values: ‘yes’ or +‘no’. + +‘no’ + Default. No caching of results; code block evaluated every time. + +‘yes’ + Whether to run the code or return the cached results is determined + by comparing the SHA1 hash value of the combined code block and + arguments passed to it. This hash value is packed on the + ‘#+RESULTS:’ line from previous evaluation. When hash values + match, Org does not evaluate the code block. When hash values + mismatch, Org evaluates the code block, inserts the results, + recalculates the hash value, and updates ‘#+RESULTS:’ line. + + In this example, both functions are cached. But ‘caller’ runs only +if the result from ‘random’ has changed since the last run. + + #+NAME: random + #+BEGIN_SRC R :cache yes + runif(1) + #+END_SRC + + #+RESULTS[a2a72cd647ad44515fab62e144796432793d68e1]: random + 0.4659510825295 + + #+NAME: caller + #+BEGIN_SRC emacs-lisp :var x=random :cache yes + x + #+END_SRC + + #+RESULTS[bec9c8724e397d5df3b696502df3ed7892fc4f5f]: caller + 0.254227238707244 + + ---------- Footnotes ---------- + + (1) The option ‘org-babel-no-eval-on-ctrl-c-ctrl-c’ can be used to +remove code evaluation from the ‘C-c C-c’ key binding. + + (2) Actually, the constructs ‘call_()’ and ‘src_{}’ are +not evaluated when they appear in a keyword (see *note In-buffer +Settings::). + + +File: org, Node: Results of Evaluation, Next: Exporting Code Blocks, Prev: Evaluating Code Blocks, Up: Working with Source Code + +14.5 Results of Evaluation +========================== + +How Org handles results of a code block execution depends on many header +arguments working together. The primary determinant, however, is the +‘results’ header argument. It accepts four classes of options. Each +code block can take only one option per class: + +collection + For how the results should be collected from the code block; + +type + For which type of result the code block will return; affects how + Org processes and inserts results in the Org buffer; + +format + For the result; affects how Org processes and inserts results in + the Org buffer; + +handling + For processing results after evaluation of the code block; + +Collection +---------- + +Collection options specify the results. Choose one of the options; they +are mutually exclusive. + +‘value’ + Default. Functional mode. Org gets the value by wrapping the code + in a function definition in the language of the source block. That + is why when using ‘:results value’, code should execute like a + function and return a value. For languages like Python, an + explicit ‘return’ statement is mandatory when using ‘:results + value’. Result is the value returned by the last statement in the + code block. + + When evaluating the code block in a session (see *note Environment + of a Code Block::), Org passes the code to an interpreter running + as an interactive Emacs inferior process. Org gets the value from + the source code interpreter’s last statement output. Org has to + use language-specific methods to obtain the value. For example, + from the variable ‘_’ in Python and Ruby, and the value of + ‘.Last.value’ in R. + +‘output’ + Scripting mode. Org passes the code to an external process running + the interpreter. Org returns the contents of the standard output + stream as text results. + + When using a session, Org passes the code to the interpreter + running as an interactive Emacs inferior process. Org concatenates + any text output from the interpreter and returns the collection as + a result. + + Note that this collection is not the same as that would be + collected from stdout of a non-interactive interpreter running as + an external process. Compare for example these two blocks: + + #+BEGIN_SRC python :results output + print "hello" + 2 + print "bye" + #+END_SRC + + #+RESULTS: + : hello + : bye + + In the above non-session mode, the “2” is not printed; so it does + not appear in results. + + #+BEGIN_SRC python :results output :session + print "hello" + 2 + print "bye" + #+END_SRC + + #+RESULTS: + : hello + : 2 + : bye + + In the above session, the interactive interpreter receives and + prints “2”. Results show that. + +Type +---- + +Type tells what result types to expect from the execution of the code +block. Choose one of the options; they are mutually exclusive. The +default behavior is to automatically determine the result type. + +‘table’ +‘vector’ + Interpret the results as an Org table. If the result is a single + value, create a table with one row and one column. Usage example: + ‘:results value table’. + + In-between each table row or below the table headings, sometimes + results have horizontal lines, which are also known as “hlines”. + The ‘hlines’ argument with the default ‘no’ value strips such lines + from the input table. For most code, this is desirable, or else + those ‘hline’ symbols raise unbound variable errors. A ‘yes’ + accepts such lines, as demonstrated in the following example. + + #+NAME: many-cols + | a | b | c | + |---+---+---| + | d | e | f | + |---+---+---| + | g | h | i | + + #+NAME: no-hline + #+BEGIN_SRC python :var tab=many-cols :hlines no + return tab + #+END_SRC + + #+RESULTS: no-hline + | a | b | c | + | d | e | f | + | g | h | i | + + #+NAME: hlines + #+BEGIN_SRC python :var tab=many-cols :hlines yes + return tab + #+END_SRC + + #+RESULTS: hlines + | a | b | c | + |---+---+---| + | d | e | f | + |---+---+---| + | g | h | i | + +‘list’ + Interpret the results as an Org list. If the result is a single + value, create a list of one element. + +‘scalar’ +‘verbatim’ + Interpret literally and insert as quoted text. Do not create a + table. Usage example: ‘:results value verbatim’. + +‘file’ + Interpret as a filename. Save the results of execution of the code + block to that file, then insert a link to it. You can control both + the filename and the description associated to the link. + + Org first tries to generate the filename from the value of the + ‘file’ header argument and the directory specified using the + ‘output-dir’ header arguments. If ‘output-dir’ is not specified, + Org assumes it is the current directory. + + #+BEGIN_SRC asymptote :results value file :file circle.pdf :output-dir img/ + size(2cm); + draw(unitcircle); + #+END_SRC + + If ‘file’ is missing, Org generates the base name of the output + file from the name of the code block, and its extension from the + ‘file-ext’ header argument. In that case, both the name and the + extension are mandatory(1). + + #+name: circle + #+BEGIN_SRC asymptote :results value file :file-ext pdf + size(2cm); + draw(unitcircle); + #+END_SRC + + The ‘file-desc’ header argument defines the description (see *note + Link Format::) for the link. If ‘file-desc’ has no value, Org uses + the generated file name for both the “link” and “description” parts + of the link. + + By default, Org assumes that a table written to a file has + TAB-delimited output. You can choose a different separator with + the ‘sep’ header argument. + +Format +------ + +Format pertains to the type of the result returned by the code block. +Choose one of the options; they are mutually exclusive. The default +follows from the type specified above. + +‘code’ + Result enclosed in a code block. Useful for parsing. Usage + example: ‘:results value code’. + +‘drawer’ + Result wrapped in a ‘RESULTS’ drawer. Useful for containing ‘raw’ + or ‘org’ results for later scripting and automated processing. + Usage example: ‘:results value drawer’. + +‘html’ + Results enclosed in a ‘BEGIN_EXPORT html’ block. Usage example: + ‘:results value html’. + +‘latex’ + Results enclosed in a ‘BEGIN_EXPORT latex’ block. Usage example: + ‘:results value latex’. + +‘link’ +‘graphics’ + Result is a link to the file specified in ‘:file’ header argument. + However, unlike plain ‘:file’, nothing is written to the disk. The + block is used for its side-effects only, as in the following + example: + + #+begin_src shell :results link :file "download.tar.gz" + wget -c "http://example.com/download.tar.gz" + #+end_src + +‘org’ + Results enclosed in a ‘BEGIN_SRC org’ block. For comma-escape, + either ‘’ in the block, or export the file. Usage example: + ‘:results value org’. + +‘pp’ + Result converted to pretty-print source code. Enclosed in a code + block. Languages supported: Emacs Lisp, Python, and Ruby. Usage + example: ‘:results value pp’. + +‘raw’ + Interpreted as raw Org mode. Inserted directly into the buffer. + Aligned if it is a table. Usage example: ‘:results value raw’. + + The ‘wrap’ header argument unconditionnally marks the results block +by appending strings to ‘#+BEGIN_’ and ‘#+END_’. If no string is +specified, Org wraps the results in a ‘#+BEGIN_results’ ... +‘#+END_results’ block. It takes precedent over the ‘results’ value +listed above. E.g., + + #+BEGIN_SRC emacs-lisp :results html :wrap EXPORT markdown + "Welcome back to the 90's" + #+END_SRC + + #+RESULTS: + #+BEGIN_EXPORT markdown + Welcome back to the 90's + #+END_EXPORT + +Handling +-------- + +Handling options after collecting the results. + +‘silent’ + Do not insert results in the Org mode buffer, but echo them in the + minibuffer. Usage example: ‘:results output silent’. + +‘replace’ + Default. Insert results in the Org buffer. Remove previous + results. Usage example: ‘:results output replace’. + +‘append’ + Append results to the Org buffer. Latest results are at the + bottom. Does not remove previous results. Usage example: + ‘:results output append’. + +‘prepend’ + Prepend results to the Org buffer. Latest results are at the top. + Does not remove previous results. Usage example: ‘:results output + prepend’. + +Post-processing +--------------- + +The ‘post’ header argument is for post-processing results from block +evaluation. When ‘post’ has any value, Org binds the results to +‘*this*’ variable for easy passing to ‘var’ header argument +specifications (see *note Environment of a Code Block::). That makes +results available to other code blocks, or even for direct Emacs Lisp +code execution. + + The following two examples illustrate ‘post’ header argument in +action. The first one shows how to attach an ‘ATTR_LATEX’ keyword using +‘post’. + + #+NAME: attr_wrap + #+BEGIN_SRC sh :var data="" :var width="\\textwidth" :results output + echo "#+ATTR_LATEX: :width $width" + echo "$data" + #+END_SRC + + #+HEADER: :file /tmp/it.png + #+BEGIN_SRC dot :post attr_wrap(width="5cm", data=*this*) :results drawer + digraph{ + a -> b; + b -> c; + c -> a; + } + #+end_src + + #+RESULTS: + :RESULTS: + #+ATTR_LATEX :width 5cm + [[file:/tmp/it.png]] + :END: + + The second example shows use of ‘colnames’ header argument in ‘post’ +to pass data between code blocks. + + #+NAME: round-tbl + #+BEGIN_SRC emacs-lisp :var tbl="" fmt="%.3f" + (mapcar (lambda (row) + (mapcar (lambda (cell) + (if (numberp cell) + (format fmt cell) + cell)) + row)) + tbl) + #+end_src + + #+BEGIN_SRC R :colnames yes :post round-tbl[:colnames yes](*this*) + set.seed(42) + data.frame(foo=rnorm(1)) + #+END_SRC + + #+RESULTS: + | foo | + |-------| + | 1.371 | + + ---------- Footnotes ---------- + + (1) Due to the way this header argument is implemented, it implies +“:results file”. Therefore if it is set for multiple blocks at once (by +a subtree or buffer property for example), all blocks are forced to +produce file results. This is seldom desired behavior, so it is +recommended to set this header only on a per-block basis. It is +possible that this aspect of the implementation might change in the +future. + + +File: org, Node: Exporting Code Blocks, Next: Extracting Source Code, Prev: Results of Evaluation, Up: Working with Source Code + +14.6 Exporting Code Blocks +========================== + +It is possible to export the _code_ of code blocks, the _results_ of +code block evaluation, _both_ the code and the results of code block +evaluation, or _none_. Org defaults to exporting _code_ for most +languages. For some languages, such as ditaa, Org defaults to +_results_. To export just the body of code blocks, see *note Literal +Examples::. To selectively export sub-trees of an Org document, see +*note Exporting::. + + The ‘exports’ header argument is to specify if that part of the Org +file is exported to, say, HTML or LaTeX formats. + +‘code’ + The default. The body of code is included into the exported file. + Example: ‘:exports code’. + +‘results’ + The results of evaluation of the code is included in the exported + file. Example: ‘:exports results’. + +‘both’ + Both the code and results of evaluation are included in the + exported file. Example: ‘:exports both’. + +‘none’ + Neither the code nor the results of evaluation is included in the + exported file. Whether the code is evaluated at all depends on + other options. Example: ‘:exports none’. + + To stop Org from evaluating code blocks to speed exports, use the +header argument ‘:eval never-export’ (see *note Evaluating Code +Blocks::). To stop Org from evaluating code blocks for greater +security, set the ‘org-export-use-babel’ variable to ‘nil’, but +understand that header arguments will have no effect. + + Turning off evaluation comes in handy when batch processing. For +example, markup languages for wikis, which have a high risk of untrusted +code. Stopping code block evaluation also stops evaluation of all +header arguments of the code block. This may not be desirable in some +circumstances. So during export, to allow evaluation of just the header +arguments but not any code evaluation in the source block, set ‘:eval +never-export’ (see *note Evaluating Code Blocks::). + + Org never evaluates code blocks in commented sub-trees when exporting +(see *note Comment Lines::). On the other hand, Org does evaluate code +blocks in sub-trees excluded from export (see *note Export Settings::). + + +File: org, Node: Extracting Source Code, Next: Languages, Prev: Exporting Code Blocks, Up: Working with Source Code + +14.7 Extracting Source Code +=========================== + +Extracting source code from code blocks is a basic task in literate +programming. Org has features to make this easy. In literate +programming parlance, documents on creation are _woven_ with code and +documentation, and on export, the code is tangled for execution by a +computer. Org facilitates weaving and tangling for producing, +maintaining, sharing, and exporting literate programming documents. Org +provides extensive customization options for extracting source code. + + When Org tangles code blocks, it expands, merges, and transforms +them. Then Org recomposes them into one or more separate files, as +configured through the options. During this tangling process, Org +expands variables in the source code, and resolves any Noweb style +references (see *note Noweb Reference Syntax::). + +Header arguments +---------------- + +The ‘tangle’ header argument specifies if the code block is exported to +source file(s). + +‘yes’ + Export the code block to source file. The file name for the source + file is derived from the name of the Org file, and the file + extension is derived from the source code language identifier. + Example: ‘:tangle yes’. + +‘no’ + The default. Do not extract the code in a source code file. + Example: ‘:tangle no’. + +FILENAME + Export the code block to source file whose file name is derived + from any string passed to the ‘tangle’ header argument. Org + derives the file name as being relative to the directory of the Org + file’s location. Example: ‘:tangle FILENAME’. + + The ‘mkdirp’ header argument creates parent directories for tangled +files if the directory does not exist. ‘yes’ enables directory creation +and ‘no’ inhibits directory creation. + + The ‘comments’ header argument controls inserting comments into +tangled files. These are above and beyond whatever comments may already +exist in the code block. + +‘no’ + The default. Do not insert any extra comments during tangling. + +‘link’ + Wrap the code block in comments. Include links pointing back to + the place in the Org file from where the code was tangled. + +‘yes’ + Kept for backward compatibility; same as ‘link’. + +‘org’ + Nearest headline text from Org file is inserted as comment. The + exact text that is inserted is picked from the leading context of + the source block. + +‘both’ + Includes both ‘link’ and ‘org’ options. + +‘noweb’ + Includes ‘link’ option, expands Noweb references (see *note Noweb + Reference Syntax::), and wraps them in link comments inside the + body of the code block. + + The ‘padline’ header argument controls insertion of newlines to pad +source code in the tangled file. + +‘yes’ + Default. Insert a newline before and after each code block in the + tangled file. + +‘no’ + Do not insert newlines to pad the tangled code blocks. + + The ‘shebang’ header argument can turn results into executable script +files. By setting it to a string value—for example, ‘:shebang +"#!/bin/bash"’—Org inserts that string as the first line of the tangled +file that the code block is extracted to. Org then turns on the tangled +file’s executable permission. + + The ‘tangle-mode’ header argument specifies what permissions to set +for tangled files by ‘set-file-modes’. For example, to make a read-only +tangled file, use ‘:tangle-mode (identity #o444)’. To make it +executable, use ‘:tangle-mode (identity #o755)’. It also overrides +executable permission granted by ‘shebang’. When multiple source code +blocks tangle to a single file with different and conflicting +‘tangle-mode’ header arguments, Org’s behavior is undefined. + + By default Org expands code blocks during tangling. The ‘no-expand’ +header argument turns off such expansions. Note that one side-effect of +expansion by ‘org-babel-expand-src-block’ also assigns values (see *note +Environment of a Code Block::) to variables. Expansions also replace +Noweb references with their targets (see *note Noweb Reference +Syntax::). Some of these expansions may cause premature assignment, +hence this option. This option makes a difference only for tangling. +It has no effect when exporting since code blocks for execution have to +be expanded anyway. + +Functions +--------- + +‘org-babel-tangle’ + Tangle the current file. Bound to ‘C-c C-v t’. + + With prefix argument only tangle the current code block. + +‘org-babel-tangle-file’ + Choose a file to tangle. Bound to ‘C-c C-v f’. + +Hooks +----- + +‘org-babel-post-tangle-hook’ + This hook is run from within code files tangled by + ‘org-babel-tangle’, making it suitable for post-processing, + compilation, and evaluation of code in the tangled files. + +Jumping between code and Org +---------------------------- + +Debuggers normally link errors and messages back to the source code. +But for tangled files, we want to link back to the Org file, not to the +tangled source file. To make this extra jump, Org uses +‘org-babel-tangle-jump-to-org’ function with two additional source code +block header arguments: + + 1. Set ‘padline’ to true—this is the default setting. + 2. Set ‘comments’ to ‘link’, which makes Org insert links to the Org + file. + + +File: org, Node: Languages, Next: Editing Source Code, Prev: Extracting Source Code, Up: Working with Source Code + +14.8 Languages +============== + +Code blocks in the following languages are supported. + +Language Identifier Language Identifier +----------------------------------------------------------------------- +Asymptote ‘asymptote’ Lua ‘lua’ +Awk ‘awk’ MATLAB ‘matlab’ +C ‘C’ Mscgen ‘mscgen’ +C++ ‘C++’(1) OCaml ‘ocaml’ +Clojure ‘clojure’ Octave ‘octave’ +CSS ‘css’ Org mode ‘org’ +D ‘D’(2) Oz ‘oz’ +ditaa ‘ditaa’ Perl ‘perl’ +Emacs Calc ‘calc’ Plantuml ‘plantuml’ +Emacs Lisp ‘emacs-lisp’ Processing.js ‘processing’ +Fortran ‘fortran’ Python ‘python’ +Gnuplot ‘gnuplot’ R ‘R’ +GNU Screen ‘screen’ Ruby ‘ruby’ +Graphviz ‘dot’ Sass ‘sass’ +Haskell ‘haskell’ Scheme ‘scheme’ +Java ‘java’ Sed ‘sed’ +Javascript ‘js’ shell ‘sh’ +LaTeX ‘latex’ SQL ‘sql’ +Ledger ‘ledger’ SQLite ‘sqlite’ +Lilypond ‘lilypond’ Vala ‘vala’ +Lisp ‘lisp’ + + Additional documentation for some languages is at +. + + By default, only Emacs Lisp is enabled for evaluation. To enable or +disable other languages, customize the ‘org-babel-load-languages’ +variable either through the Emacs customization interface, or by adding +code to the init file as shown next. + + In this example, evaluation is disabled for Emacs Lisp, and enabled +for R. + + (org-babel-do-load-languages + 'org-babel-load-languages + '((emacs-lisp . nil) + (R . t))) + + Note that this is not the only way to enable a language. Org also +enables languages when loaded with ‘require’ statement. For example, +the following enables execution of Clojure code blocks: + + (require 'ob-clojure) + + ---------- Footnotes ---------- + + (1) C++ language is handled in ‘ob-C.el’. Even though the identifier +for such source blocks is ‘C++’, you activate it by loading the C +language. + + (2) D language is handled in ‘ob-C.el’. Even though the identifier +for such source blocks is ‘D’, you activate it by loading the C +language. + + +File: org, Node: Editing Source Code, Next: Noweb Reference Syntax, Prev: Languages, Up: Working with Source Code + +14.9 Editing Source Code +======================== + +Use ‘C-c '’ to edit the current code block. It opens a new major-mode +edit buffer containing the body of the source code block, ready for any +edits. Use ‘C-c '’ again to close the buffer and return to the Org +buffer. + + ‘C-x C-s’ saves the buffer and updates the contents of the Org +buffer. Set ‘org-edit-src-auto-save-idle-delay’ to save the base buffer +after a certain idle delay time. Set ‘org-edit-src-turn-on-auto-save’ +to auto-save this buffer into a separate file using Auto-save mode. + + While editing the source code in the major mode, the Org Src minor +mode remains active. It provides these customization variables as +described below. For even more variables, look in the customization +group ‘org-edit-structure’. + +‘org-src-lang-modes’ + If an Emacs major-mode named ‘-mode’ exists, where is + the language identifier from code block’s header line, then the + edit buffer uses that major mode. Use this variable to arbitrarily + map language identifiers to major modes. + +‘org-src-window-setup’ + For specifying Emacs window arrangement when the new edit buffer is + created. + +‘org-src-preserve-indentation’ + Default is ‘nil’. Source code is indented. This indentation + applies during export or tangling, and depending on the context, + may alter leading spaces and tabs. When non-‘nil’, source code is + aligned with the leftmost column. No lines are modified during + export or tangling, which is very useful for white-space sensitive + languages, such as Python. + +‘org-src-ask-before-returning-to-edit-buffer’ + When ‘nil’, Org returns to the edit buffer without further prompts. + The default prompts for a confirmation. + + Set ‘org-src-fontify-natively’ to non-‘nil’ to turn on native code +fontification in the _Org_ buffer. Fontification of code blocks can +give visual separation of text and code on the display page. To further +customize the appearance of ‘org-block’ for specific languages, +customize ‘org-src-block-faces’. The following example shades the +background of regular blocks, and colors source blocks only for Python +and Emacs Lisp languages. + + (require 'color) + (set-face-attribute 'org-block nil :background + (color-darken-name + (face-attribute 'default :background) 3)) + + (setq org-src-block-faces '(("emacs-lisp" (:background "#EEE2FF")) + ("python" (:background "#E5FFB8")))) + + +File: org, Node: Noweb Reference Syntax, Next: Library of Babel, Prev: Editing Source Code, Up: Working with Source Code + +14.10 Noweb Reference Syntax +============================ + +Org supports named blocks in Noweb(1) style syntax: + + <> + + Org can replace the construct with the source code, or the results of +evaluation, of the code block identified as CODE-BLOCK-ID. + + The ‘noweb’ header argument controls expansion of Noweb syntax +references. Expansions occur when source code blocks are evaluated, +tangled, or exported. + +‘no’ + Default. No expansion of Noweb syntax references in the body of + the code when evaluating, tangling, or exporting. + +‘yes’ + Expansion of Noweb syntax references in the body of the code block + when evaluating, tangling, or exporting. + +‘tangle’ + Expansion of Noweb syntax references in the body of the code block + when tangling. No expansion when evaluating or exporting. + +‘no-export’ + Expansion of Noweb syntax references in the body of the code block + when evaluating or tangling. No expansion when exporting. + +‘strip-export’ + Expansion of Noweb syntax references in the body of the code block + when expanding prior to evaluating or tangling. Removes Noweb + syntax references when exporting. + +‘eval’ + Expansion of Noweb syntax references in the body of the code block + only before evaluating. + + In the following example, + + #+NAME: initialization + #+BEGIN_SRC emacs-lisp + (setq sentence "Never a foot too far, even.") + #+END_SRC + + #+BEGIN_SRC emacs-lisp :noweb yes + <> + (reverse sentence) + #+END_SRC + +the second code block is expanded as + + #+BEGIN_SRC emacs-lisp :noweb yes + (setq sentence "Never a foot too far, even.") + (reverse sentence) + #+END_SRC + + Noweb insertions honor prefix characters that appear before the Noweb +syntax reference. This behavior is illustrated in the following +example. Because the ‘<>’ Noweb reference appears behind the +SQL comment syntax, each line of the expanded Noweb reference is +commented. With: + + #+NAME: example + #+BEGIN_SRC text + this is the + multi-line body of example + #+END_SRC + +this code block: + + #+BEGIN_SRC sql :noweb yes + ---<> + #+END_SRC + +expands to: + + #+BEGIN_SRC sql :noweb yes + ---this is the + ---multi-line body of example + #+END_SRC + + Since this change does not affect Noweb replacement text without +newlines in them, inline Noweb references are acceptable. + + This feature can also be used for management of indentation in +exported code snippets. With: + + #+NAME: if-true + #+BEGIN_SRC python :exports none + print('do things when true') + #+end_src + + #+name: if-false + #+begin_src python :exports none + print('do things when false') + #+end_src + +this code block: + + #+begin_src python :noweb yes :results output + if true: + <> + else: + <> + #+end_src + +expands to: + + if true: + print('do things when true') + else: + print('do things when false') + + When expanding Noweb style references, Org concatenates code blocks +by matching the reference name to either the code block name or, if none +is found, to the ‘noweb-ref’ header argument. + + For simple concatenation, set this ‘noweb-ref’ header argument at the +sub-tree or file level. In the example Org file shown next, the body of +the source code in each block is extracted for concatenation to a pure +code file when tangled. + + #+BEGIN_SRC sh :tangle yes :noweb yes :shebang #!/bin/sh + <> + #+END_SRC + * the mount point of the fullest disk + :PROPERTIES: + :header-args: :noweb-ref fullest-disk + :END: + + ** query all mounted disks + #+BEGIN_SRC sh + df \ + #+END_SRC + + ** strip the header row + #+BEGIN_SRC sh + |sed '1d' \ + #+END_SRC + + ** output mount point of fullest disk + #+BEGIN_SRC sh + |awk '{if (u < +$5) {u = +$5; m = $6}} END {print m}' + #+END_SRC + + By default a newline separates each noweb reference concatenation. +To change this newline separator, edit the ‘noweb-sep’ header argument. + + Eventually, Org can include the results of a code block rather than +its body. To that effect, append parentheses, possibly including +arguments, to the code block name, as shown below. + + <> + + Note that when using the above approach to a code block’s results, +the code block name set by ‘NAME’ keyword is required; the reference set +by ‘noweb-ref’ does not work in that case. + + Here is an example that demonstrates how the exported content changes +when Noweb style references are used with parentheses versus without. +With: + + #+NAME: some-code + #+BEGIN_SRC python :var num=0 :results output :exports none + print(num*10) + #+END_SRC + +this code block: + + #+BEGIN_SRC text :noweb yes + <> + #+END_SRC + +expands to: + + print(num*10) + + Below, a similar Noweb style reference is used, but with parentheses, +while setting a variable ‘num’ to 10: + + #+BEGIN_SRC text :noweb yes + <> + #+END_SRC + +Note that now the expansion contains the results of the code block +‘some-code’, not the code block itself: + + 100 + + ---------- Footnotes ---------- + + (1) For Noweb literate programming details, see +. + + +File: org, Node: Library of Babel, Next: Key bindings and Useful Functions, Prev: Noweb Reference Syntax, Up: Working with Source Code + +14.11 Library of Babel +====================== + +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 Worg +(https://orgmode.org/worg/library-of-babel.html). For remote code block +evaluation syntax, see *note Evaluating Code Blocks::. + + For any user to add code to the library, first save the code in +regular code blocks of an Org file, and then load the Org file with +‘org-babel-lob-ingest’, which is bound to ‘C-c C-v i’. + + +File: org, Node: Key bindings and Useful Functions, Next: Batch Execution, Prev: Library of Babel, Up: Working with Source Code + +14.12 Key bindings and Useful Functions +======================================= + +Many common Org mode key sequences are re-bound depending on the +context. + + Active key bindings in code blocks: + +Key binding Function +-------------------------------------------------------- +‘C-c C-c’ ‘org-babel-execute-src-block’ +‘C-c C-o’ ‘org-babel-open-src-block-result’ +‘M-’ ‘org-babel-load-in-session’ +‘M-’ ‘org-babel-pop-to-session’ + + Active key bindings in Org mode buffer: + +Key binding Function +-------------------------------------------------------------------------- +‘C-c C-v p’ or ‘C-c C-v C-p’ ‘org-babel-previous-src-block’ +‘C-c C-v n’ or ‘C-c C-v C-n’ ‘org-babel-next-src-block’ +‘C-c C-v e’ or ‘C-c C-v C-e’ ‘org-babel-execute-maybe’ +‘C-c C-v o’ or ‘C-c C-v C-o’ ‘org-babel-open-src-block-result’ +‘C-c C-v v’ or ‘C-c C-v C-v’ ‘org-babel-expand-src-block’ +‘C-c C-v u’ or ‘C-c C-v C-u’ ‘org-babel-goto-src-block-head’ +‘C-c C-v g’ or ‘C-c C-v C-g’ ‘org-babel-goto-named-src-block’ +‘C-c C-v r’ or ‘C-c C-v C-r’ ‘org-babel-goto-named-result’ +‘C-c C-v b’ or ‘C-c C-v C-b’ ‘org-babel-execute-buffer’ +‘C-c C-v s’ or ‘C-c C-v C-s’ ‘org-babel-execute-subtree’ +‘C-c C-v d’ or ‘C-c C-v C-d’ ‘org-babel-demarcate-block’ +‘C-c C-v t’ or ‘C-c C-v C-t’ ‘org-babel-tangle’ +‘C-c C-v f’ or ‘C-c C-v C-f’ ‘org-babel-tangle-file’ +‘C-c C-v c’ or ‘C-c C-v C-c’ ‘org-babel-check-src-block’ +‘C-c C-v j’ or ‘C-c C-v C-j’ ‘org-babel-insert-header-arg’ +‘C-c C-v l’ or ‘C-c C-v C-l’ ‘org-babel-load-in-session’ +‘C-c C-v i’ or ‘C-c C-v C-i’ ‘org-babel-lob-ingest’ +‘C-c C-v I’ or ‘C-c C-v C-I’ ‘org-babel-view-src-block-info’ +‘C-c C-v z’ or ‘C-c C-v C-z’ ‘org-babel-switch-to-session-with-code’ +‘C-c C-v a’ or ‘C-c C-v C-a’ ‘org-babel-sha1-hash’ +‘C-c C-v h’ or ‘C-c C-v C-h’ ‘org-babel-describe-bindings’ +‘C-c C-v x’ or ‘C-c C-v C-x’ ‘org-babel-do-key-sequence-in-edit-buffer’ + + +File: org, Node: Batch Execution, Prev: Key bindings and Useful Functions, Up: Working with Source Code + +14.13 Batch Execution +===================== + +Org mode features, including working with source code facilities can be +invoked from the command line. This enables building shell scripts for +batch processing, running automated system tasks, and expanding Org +mode’s usefulness. + + The sample script shows batch processing of multiple files using +‘org-babel-tangle’. + + #!/bin/sh + # Tangle files with Org mode + # + emacs -Q --batch --eval " + (progn + (require 'ob-tangle) + (dolist (file command-line-args-left) + (with-current-buffer (find-file-noselect file) + (org-babel-tangle)))) + " "$@" + + +File: org, Node: Miscellaneous, Next: Hacking, Prev: Working with Source Code, Up: Top + +15 Miscellaneous +**************** + +* Menu: + +* Completion:: ‘M-’ guesses completions. +* Structure Templates:: Quick insertion of structural elements. +* Escape Character:: +* Speed Keys:: Electric commands at the beginning of a headline. +* Code Evaluation Security:: Org files evaluate in-line code. +* Customization:: Adapting Org to your taste. +* In-buffer Settings:: Overview of keywords. +* The Very Busy C-c C-c Key:: When in doubt, press ‘C-c C-c’. +* Clean View:: Getting rid of leading stars in the outline. +* TTY Keys:: Using Org on a tty. +* Documentation Access:: Read documentation about current syntax. +* Interaction:: With other Emacs packages. +* Org Crypt:: Encrypting Org files. +* Org Mobile:: Viewing and capture on a mobile device. +* Org Syntax:: Formal description of Org’s syntax. + + +File: org, Node: Completion, Next: Structure Templates, Up: Miscellaneous + +15.1 Completion +=============== + +Org has in-buffer completions. Unlike minibuffer completions, which are +useful for quick command interactions, Org’s in-buffer completions are +more suitable for content creation in Org documents. Type one or more +letters and invoke the hot key to complete the text in-place. Depending +on the context and the keys, Org offers different types of completions. +No minibuffer is involved. Such mode-specific hot keys have become an +integral part of Emacs and Org provides several shortcuts. + +‘M-’ + + Complete word at point. + + • At the beginning of a headline, complete TODO keywords. + + • After ‘\’, complete TeX symbols supported by the exporter. + + • After ‘*’, complete headlines in the current buffer so that + they can be used in search links like: + + [[*find this headline]] + + • After ‘:’ in a headline, complete tags. Org deduces the list + of tags from the ‘TAGS’ in-buffer option (see *note Setting + Tags::), the variable ‘org-tag-alist’, or from all tags used + in the current buffer. + + • After ‘:’ and not in a headline, complete property keys. The + list of keys is constructed dynamically from all keys used in + the current buffer. + + • After ‘[’, complete link abbreviations (see *note Link + Abbreviations::). + + • After ‘#+’, complete the special keywords like ‘TYP_TODO’ or + file-specific ‘OPTIONS’. After option keyword is complete, + pressing ‘M-’ again inserts example settings for this + keyword. + + • After ‘STARTUP’ keyword, complete startup items. + + • When point is anywhere else, complete dictionary words using + Ispell. + + +File: org, Node: Structure Templates, Next: Escape Character, Prev: Completion, Up: Miscellaneous + +15.2 Structure Templates +======================== + +With just a few keystrokes, it is possible to insert empty structural +blocks, such as ‘#+BEGIN_SRC’ ... ‘#+END_SRC’, or to wrap existing text +in such a block. + +‘C-c C-,’ (‘org-insert-structure-template’) + Prompt for a type of block structure, and insert the block at + point. If the region is active, it is wrapped in the block. First + prompts the user for keys, which are used to look up a structure + type from the variable below. If the key is ‘’, ‘’, or + ‘’, the user is prompted to enter a block type. + + Available structure types are defined in +‘org-structure-template-alist’, see the docstring for adding or changing +values. + + Org Tempo expands snippets to structures defined in +‘org-structure-template-alist’ and ‘org-tempo-keywords-alist’. For +example, ‘< s ’ creates a code block. Enable it by customizing +‘org-modules’ or add ‘(require 'org-tempo)’ to your Emacs init file(1). + +‘a’ ‘#+BEGIN_EXPORT ascii’ ... ‘#+END_EXPORT’ +‘c’ ‘#+BEGIN_CENTER’ ... ‘#+END_CENTER’ +‘C’ ‘#+BEGIN_COMMENT’ ... ‘#+END_COMMENT’ +‘e’ ‘#+BEGIN_EXAMPLE’ ... ‘#+END_EXAMPLE’ +‘E’ ‘#+BEGIN_EXPORT’ ... ‘#+END_EXPORT’ +‘h’ ‘#+BEGIN_EXPORT html’ ... ‘#+END_EXPORT’ +‘l’ ‘#+BEGIN_EXPORT latex’ ... ‘#+END_EXPORT’ +‘q’ ‘#+BEGIN_QUOTE’ ... ‘#+END_QUOTE’ +‘s’ ‘#+BEGIN_SRC’ ... ‘#+END_SRC’ +‘v’ ‘#+BEGIN_VERSE’ ... ‘#+END_VERSE’ + + ---------- Footnotes ---------- + + (1) For more information, please refer to the commentary section in +‘org-tempo.el’. + + +File: org, Node: Escape Character, Next: Speed Keys, Prev: Structure Templates, Up: Miscellaneous + +15.3 Escape Character +===================== + +You may sometimes want to write text that looks like Org syntax, but +should really read as plain text. Org may use a specific escape +character in some situations, e.g., a backslash in macros (see *note +Macro Replacement::). In the general case, however, we suggest to use +the zero width space. You can get it with one of the following: + + C-x 8 zero width space + C-x 8 200B + + For example, in order to write ‘[[1,2]]’ as-is in your document, you +can write this, where ‘X’ denotes the zero width space character: + + [[X1,2]] + + +File: org, Node: Speed Keys, Next: Code Evaluation Security, Prev: Escape Character, Up: Miscellaneous + +15.4 Speed Keys +=============== + +Single keystrokes can execute custom commands in an Org file when point +is on a headline. Without the extra burden of a meta or modifier key, +Speed Keys can speed navigation or execute custom commands. Besides +faster navigation, Speed Keys may come in handy on small mobile devices +that do not have full keyboards. Speed Keys may also work on TTY +devices known for their problems when entering Emacs key chords. + + By default, Org has Speed Keys disabled. To activate Speed Keys, set +the variable ‘org-use-speed-commands’ to a non-‘nil’ value. To trigger +a Speed Key, point must be at the beginning of an Org headline, before +any of the stars. + + Org comes with a pre-defined list of Speed Keys. To add or modify +Speed Keys, customize the variable, ‘org-speed-commands-user’. For more +details, see the variable’s docstring. With Speed Keys activated, ‘M-x +org-speed-command-help’, or ‘?’ when point is at the beginning of an Org +headline, shows currently active Speed Keys, including the user-defined +ones. + + +File: org, Node: Code Evaluation Security, Next: Customization, Prev: Speed Keys, Up: Miscellaneous + +15.5 Code Evaluation and Security Issues +======================================== + +Unlike plain text, running code comes with risk. Each source code +block, in terms of risk, is equivalent to an executable file. Org +therefore puts a few confirmation prompts by default. This is to alert +the casual user from accidentally running untrusted code. + + For users who do not run code blocks or write code regularly, Org’s +default settings should suffice. However, some users may want to tweak +the prompts for fewer interruptions. To weigh the risks of automatic +execution of code blocks, here are some details about code evaluation. + + Org evaluates code in the following circumstances: + +_Source code blocks_ + Org evaluates source code blocks in an Org file during export. Org + also evaluates a source code block with the ‘C-c C-c’ key chord. + Users exporting or running code blocks must load files only from + trusted sources. Be wary of customizing variables that remove or + alter default security measures. + + -- User Option: org-confirm-babel-evaluate + When ‘t’, Org prompts the user for confirmation before + executing each code block. When ‘nil’, Org executes code + blocks without prompting the user for confirmation. When this + option is set to a custom function, Org invokes the function + with these two arguments: the source code language and the + body of the code block. The custom function must return + either a ‘t’ or ‘nil’, which determines if the user is + prompted. Each source code language can be handled separately + through this function argument. + + For example, here is how to execute ditaa code blocks without + prompting: + + (defun my-org-confirm-babel-evaluate (lang body) + (not (string= lang "ditaa"))) ;don't ask for ditaa + (setq org-confirm-babel-evaluate #'my-org-confirm-babel-evaluate) + +_Following ‘shell’ and ‘elisp’ links_ + Org has two link types that can directly evaluate code (see *note + External Links::). Because such code is not visible, these links + have a potential risk. Org therefore prompts the user when it + encounters such links. The customization variables are: + + -- User Option: org-confirm-shell-link-function + Function that prompts the user before executing a shell link. + + -- User Option: org-confirm-elisp-link-function + Function that prompts the user before executing an Emacs Lisp + link. + +_Formulas in tables_ + Formulas in tables (see *note The Spreadsheet::) are code that is + evaluated either by the Calc interpreter, or by the Emacs Lisp + interpreter. + + +File: org, Node: Customization, Next: In-buffer Settings, Prev: Code Evaluation Security, Up: Miscellaneous + +15.6 Customization +================== + +Org has more than 500 variables for customization. They can be accessed +through the usual ‘M-x org-customize’ command. Or through the Org menu: +Org → Customization → Browse Org Group. + + Org also has per-file settings for some variables (see *note +In-buffer Settings::). + + +File: org, Node: In-buffer Settings, Next: The Very Busy C-c C-c Key, Prev: Customization, Up: Miscellaneous + +15.7 Summary of In-Buffer Settings +================================== + +In-buffer settings start with ‘#+’, followed by a keyword, a colon, and +then a word for each setting. Org accepts multiple settings on the same +line. Org also accepts multiple lines for a keyword. This manual +describes these settings throughout. A summary follows here. + + ‘C-c C-c’ activates any changes to the in-buffer settings. Closing +and reopening the Org file in Emacs also activates the changes. + +‘#+ARCHIVE: %s_done’ + Sets the archive location of the agenda file. The corresponding + variable is ‘org-archive-location’. + +‘#+CATEGORY’ + Sets the category of the agenda file, which applies to the entire + document. + +‘#+COLUMNS: %25ITEM ...’ + Set the default format for columns view. This format applies when + columns view is invoked in locations where no ‘COLUMNS’ property + applies. + +‘#+CONSTANTS: name1=value1 ...’ + Set file-local values for constants that table formulas can use. + This line sets the local variable + ‘org-table-formula-constants-local’. The global version of this + variable is ‘org-table-formula-constants’. + +‘#+FILETAGS: :tag1:tag2:tag3:’ + Set tags that all entries in the file inherit from, including the + top-level entries. + +‘#+LINK: linkword replace’ + Each line specifies one abbreviation for one link. Use multiple + ‘LINK’ keywords for more, see *note Link Abbreviations::. The + corresponding variable is ‘org-link-abbrev-alist’. + +‘#+PRIORITIES: highest lowest default’ + This line sets the limits and the default for the priorities. All + three must be either letters A–Z or numbers 0–9. The highest + priority must have a lower ASCII number than the lowest priority. + +‘#+PROPERTY: Property_Name Value’ + This line sets a default inheritance value for entries in the + current buffer, most useful for specifying the allowed values of a + property. + +‘#+SETUPFILE: file’ + The setup file or a URL pointing to such file is for additional + in-buffer settings. Org loads this file and parses it for any + settings in it only when Org opens the main file. If URL is + specified, the contents are downloaded and stored in a temporary + file cache. ‘C-c C-c’ on the settings line parses and loads the + file, and also resets the temporary file cache. Org also parses + and loads the document during normal exporting process. Org parses + the contents of this document as if it was included in the buffer. + It can be another Org file. To visit the file—not a URL—use ‘C-c + '’ while point is on the line with the file name. + +‘#+STARTUP:’ + Startup options Org uses when first visiting a file. + + The first set of options deals with the initial visibility of the + outline tree. The corresponding variable for global default + settings is ‘org-startup-folded’ with a default value of ‘t’, which + is the same as ‘overview’. + + ‘overview’ + Top-level headlines only. + + ‘content’ + All headlines. + + ‘showall’ + No folding on any entry. + + ‘showeverything’ + Show even drawer contents. + + Dynamic virtual indentation is controlled by the variable + ‘org-startup-indented’(1). + + ‘indent’ + Start with ‘org-indent-mode’ turned on. + + ‘noindent’ + Start with ‘org-indent-mode’ turned off. + + Aligns tables consistently upon visiting a file. The corresponding + variable is ‘org-startup-align-all-tables’ with ‘nil’ as default + value. + + ‘align’ + Align all tables. + + ‘noalign’ + Do not align tables on startup. + + Shrink table columns with a width cookie. The corresponding + variable is ‘org-startup-shrink-all-tables’ with ‘nil’ as default + value. + + When visiting a file, inline images can be automatically displayed. + The corresponding variable is ‘org-startup-with-inline-images’, + with a default value ‘nil’ to avoid delays when visiting a file. + + ‘inlineimages’ + Show inline images. + + ‘noinlineimages’ + Do not show inline images on startup. + + Logging the closing and reopening of TODO items and clock intervals + can be configured using these options (see variables + ‘org-log-done’, ‘org-log-note-clock-out’, and ‘org-log-repeat’). + + ‘logdone’ + Record a timestamp when an item is marked DONE. + + ‘lognotedone’ + Record timestamp and a note when DONE. + + ‘nologdone’ + Do not record when items are marked DONE. + + ‘logrepeat’ + Record a time when reinstating a repeating item. + + ‘lognoterepeat’ + Record a note when reinstating a repeating item. + + ‘nologrepeat’ + Do not record when reinstating repeating item. + + ‘lognoteclock-out’ + Record a note when clocking out. + + ‘nolognoteclock-out’ + Do not record a note when clocking out. + + ‘logreschedule’ + Record a timestamp when scheduling time changes. + + ‘lognotereschedule’ + Record a note when scheduling time changes. + + ‘nologreschedule’ + Do not record when a scheduling date changes. + + ‘logredeadline’ + Record a timestamp when deadline changes. + + ‘lognoteredeadline’ + Record a note when deadline changes. + + ‘nologredeadline’ + Do not record when a deadline date changes. + + ‘logrefile’ + Record a timestamp when refiling. + + ‘lognoterefile’ + Record a note when refiling. + + ‘nologrefile’ + Do not record when refiling. + + Here are the options for hiding leading stars in outline headings, + and for indenting outlines. The corresponding variables are + ‘org-hide-leading-stars’ and ‘org-odd-levels-only’, both with a + default setting ‘nil’ (meaning ‘showstars’ and ‘oddeven’). + + ‘hidestars’ + Make all but one of the stars starting a headline invisible. + + ‘showstars’ + Show all stars starting a headline. + + ‘indent’ + Virtual indentation according to outline level. + + ‘noindent’ + No virtual indentation according to outline level. + + ‘odd’ + Allow only odd outline levels (1, 3, ...). + + ‘oddeven’ + Allow all outline levels. + + To turn on custom format overlays over timestamps (variables + ‘org-put-time-stamp-overlays’ and + ‘org-time-stamp-overlay-formats’), use: + + ‘customtime’ + Overlay custom time format. + + The following options influence the table spreadsheet (variable + ‘constants-unit-system’). + + ‘constcgs’ + ‘constants.el’ should use the c-g-s unit system. + + ‘constSI’ + ‘constants.el’ should use the SI unit system. + + To influence footnote settings, use the following keywords. The + corresponding variables are ‘org-footnote-define-inline’, + ‘org-footnote-auto-label’, and ‘org-footnote-auto-adjust’. + + ‘fninline’ + Define footnotes inline. + + ‘fnnoinline’ + Define footnotes in separate section. + + ‘fnlocal’ + Define footnotes near first reference, but not inline. + + ‘fnprompt’ + Prompt for footnote labels. + + ‘fnauto’ + Create ‘[fn:1]’-like labels automatically (default). + + ‘fnconfirm’ + Offer automatic label for editing or confirmation. + + ‘fnadjust’ + Automatically renumber and sort footnotes. + + ‘nofnadjust’ + Do not renumber and sort automatically. + + To hide blocks on startup, use these keywords. The corresponding + variable is ‘org-hide-block-startup’. + + ‘hideblocks’ + Hide all begin/end blocks on startup. + + ‘nohideblocks’ + Do not hide blocks on startup. + + The display of entities as UTF-8 characters is governed by the + variable ‘org-pretty-entities’ and the keywords + + ‘entitiespretty’ + Show entities as UTF-8 characters where possible. + + ‘entitiesplain’ + Leave entities plain. + +‘#+TAGS: TAG1(c1) TAG2(c2)’ + These lines (several such lines are allowed) specify the valid tags + in this file, and (potentially) the corresponding _fast tag + selection_ keys. The corresponding variable is ‘org-tag-alist’. + +‘#+TODO:’ +‘#+SEQ_TODO:’ +‘#+TYP_TODO:’ + These lines set the TODO keywords and their interpretation in the + current file. The corresponding variable is ‘org-todo-keywords’. + + ---------- Footnotes ---------- + + (1) Note that ‘org-indent-mode’ also sets the ‘wrap-prefix’ property, +such that ‘visual-line-mode’ (or purely setting ‘word-wrap’) wraps long +lines (including headlines) correctly indented. + + +File: org, Node: The Very Busy C-c C-c Key, Next: Clean View, Prev: In-buffer Settings, Up: Miscellaneous + +15.8 The Very Busy ‘C-c C-c’ Key +================================ + +The ‘C-c C-c’ key in Org serves many purposes depending on the context. +It is probably the most over-worked, multi-purpose key combination in +Org. Its uses are well documented throughout this manual, but here is a +consolidated list for easy reference. + + • If any highlights shown in the buffer from the creation of a sparse + tree, or from clock display, remove such highlights. + + • If point is in one of the special ‘KEYWORD’ lines, scan the buffer + for these lines and update the information. Also reset the Org + file cache used to temporary store the contents of URLs used as + values for keywords like ‘SETUPFILE’. + + • If point is inside a table, realign the table. The table realigns + even if automatic table editor is turned off. + + • If point is on a ‘TBLFM’ keyword, re-apply the formulas to the + entire table. + + • If the current buffer is a capture buffer, close the note and file + it. With a prefix argument, also jump to the target location after + saving the note. + + • If point is on a ‘<<>>’, update radio targets and + corresponding links in this buffer. + + • If point is on a property line or at the start or end of a property + drawer, offer property commands. + + • If point is at a footnote reference, go to the corresponding + definition, and _vice versa_. + + • If point is on a statistics cookie, update it. + + • If point is in a plain list item with a checkbox, toggle the status + of the checkbox. + + • If point is on a numbered item in a plain list, renumber the + ordered list. + + • If point is on the ‘#+BEGIN’ line of a dynamic block, the block is + updated. + + • If point is at a timestamp, fix the day name in the timestamp. + + +File: org, Node: Clean View, Next: TTY Keys, Prev: The Very Busy C-c C-c Key, Up: Miscellaneous + +15.9 A Cleaner Outline View +=========================== + +Org’s default outline with stars and no indents can become too cluttered +for short documents. For _book-like_ long documents, the effect is not +as noticeable. Org provides an alternate stars and indentation scheme, +as shown on the right in the following table. It uses only one star and +indents text to line with the heading: + + * Top level headline | * Top level headline + ** Second level | * Second level + *** Third level | * Third level + some text | some text + *** Third level | * Third level + more text | more text + * Another top level headline | * Another top level headline + + To turn this mode on, use the minor mode, ‘org-indent-mode’. Text +lines that are not headlines are prefixed with spaces to vertically +align with the headline text(1). + + To make more horizontal space, the headlines are shifted by two +stars. This can be configured by the ‘org-indent-indentation-per-level’ +variable. Only one star on each headline is visible, the rest are +masked with the same font color as the background. + + Note that turning on ‘org-indent-mode’ sets ‘org-hide-leading-stars’ +to ‘t’ and ‘org-adapt-indentation’ to ‘nil’. + + To globally turn on ‘org-indent-mode’ for all files, customize the +variable ‘org-startup-indented’. + + To turn on indenting for individual files, use ‘STARTUP’ keyword as +follows: + + #+STARTUP: indent + + Indent on startup makes Org use hard spaces to align text with +headings as shown in examples below. + +_Indentation of text below headlines_ + Indent text to align with the headline. + + *** Third level + more text, now indented + + Org supports this with paragraph filling, line wrapping, and + structure editing, preserving or adapting the indentation as + appropriate(2). + +_Hiding leading stars_ + Org can make leading stars invisible. For global preference, + configure the variable ‘org-hide-leading-stars’. For per-file + preference, use these file ‘STARTUP’ options: + + #+STARTUP: hidestars + #+STARTUP: showstars + + With stars hidden, the tree is shown as: + + * Top level headline + * Second level + * Third level + ... + + Because Org makes the font color the same as the background color + to hide to stars, sometimes ‘org-hide’ face may need tweaking to + get the effect right. For some black and white combinations, + ‘grey90’ on a white background might mask the stars better. + +_Odd levels_ + Using stars for only odd levels, 1, 3, 5, ..., can also clean up + the clutter. This removes two stars from each level(3). For Org + to properly handle this cleaner structure during edits and exports, + configure the variable ‘org-odd-levels-only’. To set this + per-file, use either one of the following lines: + + #+STARTUP: odd + #+STARTUP: oddeven + + To switch between single and double stars layouts, use ‘M-x + org-convert-to-odd-levels’ and ‘M-x org-convert-to-oddeven-levels’. + + ---------- Footnotes ---------- + + (1) The ‘org-indent-mode’ also sets the ‘wrap-prefix’ correctly for +indenting and wrapping long lines of headlines or text. This minor mode +handles ‘visual-line-mode’ and directly applied settings through +‘word-wrap’. + + (2) Also see the variable ‘org-adapt-indentation’. + + (3) Because ‘LEVEL=2’ has 3 stars, ‘LEVEL=3’ has 5 stars, and so on. + + +File: org, Node: TTY Keys, Next: Documentation Access, Prev: Clean View, Up: Miscellaneous + +15.10 Using Org on a TTY +======================== + +Org provides alternative key bindings for TTY and modern mobile devices +that cannot perform movement commands on point and key bindings with +modifier keys. Some of these workarounds may be more cumbersome than +necessary. Users should look into customizing these further based on +their usage needs. For example, the normal ‘S-’ for editing +timestamp might be better with ‘C-c .’ chord. + +Default Alternative 1 Speed key Alternative 2 +---------------------------------------------------------------- +‘S-’ ‘C-u ’ ‘C’ +‘M-’ ‘C-c C-x l’ ‘l’ ‘Esc ’ +‘M-S-’ ‘C-c C-x L’ ‘L’ +‘M-’ ‘C-c C-x r’ ‘r’ ‘Esc ’ +‘M-S-’ ‘C-c C-x R’ ‘R’ +‘M-’ ‘C-c C-x u’ ‘Esc ’ +‘M-S-’ ‘C-c C-x U’ ‘U’ +‘M-’ ‘C-c C-x d’ ‘Esc ’ +‘M-S-’ ‘C-c C-x D’ ‘D’ +‘S-’ ‘C-c C-x c’ +‘M-’ ‘C-c C-x m’ ‘Esc ’ +‘M-S-’ ‘C-c C-x M’ +‘S-’ ‘C-c ’ +‘S-’ ‘C-c ’ +‘S-’ ‘C-c ’ +‘S-’ ‘C-c ’ +‘C-S-’ ‘C-c C-x ’ +‘C-S-’ ‘C-c C-x ’ + + +File: org, Node: Documentation Access, Next: Interaction, Prev: TTY Keys, Up: Miscellaneous + +15.11 Context Dependent Documentation +===================================== + +‘C-c C-x I’ in an Org file tries to open a suitable section of the Org +manual depending on the syntax at point. For example, using it on a +headline displays “Document Structure” section. + + ‘q’ closes the Info window. + + +File: org, Node: Interaction, Next: Org Crypt, Prev: Documentation Access, Up: Miscellaneous + +15.12 Interaction with Other Packages +===================================== + +Org’s compatibility and the level of interaction with other Emacs +packages are documented here. + +* Menu: + +* Cooperation:: Packages Org cooperates with. +* Conflicts:: Packages that lead to conflicts. + + +File: org, Node: Cooperation, Next: Conflicts, Up: Interaction + +15.12.1 Packages that Org cooperates with +----------------------------------------- + +‘calc.el’ by Dave Gillespie + + Org uses the Calc package for implementing spreadsheet + functionality in its tables (see *note The Spreadsheet::). Org + also uses Calc for embedded calculations. See *note GNU Emacs Calc + Manual: (calc)Embedded Mode. + +‘constants.el’ by Carsten Dominik + + Org can use names for constants in formulas in tables. Org can + also use calculation suffixes for units, such as ‘M’ for ‘Mega’. + For a standard collection of such constants, install the + ‘constants’ package. Install version 2.0 of this package, + available at . Org checks + if the function ‘constants-get’ has been autoloaded. Installation + instructions are in the file ‘constants.el’. + +‘cdlatex.el’ by Carsten Dominik + + Org mode can make use of the CDLaTeX package to efficiently enter + LaTeX fragments into Org files. See *note CDLaTeX mode::. + +‘imenu.el’ by Ake Stenhoff and Lars Lindberg + + Imenu creates dynamic menus based on an index of items in a file. + Org mode supports Imenu menus. Enable it with a mode hook as + follows: + + (add-hook 'org-mode-hook + (lambda () (imenu-add-to-menubar "Imenu"))) + + By default the index is two levels deep—you can modify the depth + using the option ‘org-imenu-depth’. + +‘speedbar.el’ by Eric M. Ludlam + + Speedbar package creates a special Emacs frame for displaying files + and index items in files. Org mode supports Speedbar; users can + drill into Org files directly from the Speedbar. The ‘<’ in the + Speedbar frame tweaks the agenda commands to that file or to a + subtree. + +‘table.el’ by Takaaki Ota + + Complex ASCII tables with automatic line wrapping, column- and + row-spanning, and alignment can be created using the Emacs table + package by Takaaki Ota. Org mode recognizes such tables and + exports them properly. ‘C-c '’ to edit these tables in a special + buffer, much like Org’s code blocks. Because of interference with + other Org mode functionality, Takaaki Ota tables cannot be edited + directly in the Org buffer. + + ‘C-c '’ (‘org-edit-special’) + Edit a ‘table.el’ table. Works when point is in a ‘table.el’ + table. + + ‘C-c ~​’ (‘org-table-create-with-table.el’) + Insert a ‘table.el’ table. If there is already a table at + point, this command converts it between the ‘table.el’ format + and the Org mode format. See the documentation string of the + command ‘org-convert-table’ for the restrictions under which + this is possible. + + +File: org, Node: Conflicts, Prev: Cooperation, Up: Interaction + +15.12.2 Packages that conflict with Org mode +-------------------------------------------- + +In Emacs, ‘shift-selection-mode’ combines motions of point with shift +key to enlarge regions. Emacs sets this mode by default. This +conflicts with Org’s use of ‘S-’ commands to change timestamps, +TODO keywords, priorities, and item bullet types, etc. Since +‘S-’ commands outside of specific contexts do not do anything, +Org offers the variable ‘org-support-shift-select’ for customization. +Org mode accommodates shift selection by (i) making it available outside +of the special contexts where special commands apply, and (ii) extending +an existing active region even if point moves across a special context. + +‘cua.el’ by Kim F. Storm + Org key bindings conflict with ‘S-’ keys used by CUA mode. + For Org to relinquish these bindings to CUA mode, configure the + variable ‘org-replace-disputed-keys’. When set, Org moves the + following key bindings in Org files, and in the agenda buffer—but + not during date selection. + + ‘S-’ ⇒ ‘M-p’ ‘S-’ ⇒ ‘M-n’ + ‘S-’ ⇒ ‘M--’ ‘S-’ ⇒ ‘M-+’ + ‘C-S-’ ⇒ ‘M-S--’ ‘C-S-’ ⇒ ‘M-S-+’ + + Yes, these are unfortunately more difficult to remember. If you + want to have other replacement keys, look at the variable + ‘org-disputed-keys’. + +‘ecomplete.el’ by Lars Magne Ingebrigtsen + Ecomplete provides “electric” address completion in address header + lines in message buffers. Sadly Orgtbl mode cuts Ecomplete’s power + supply: no completion happens when Orgtbl mode is enabled in + message buffers while entering text in address header lines. If + one wants to use ecomplete one should _not_ follow the advice to + automagically turn on Orgtbl mode in message buffers (see *note + Orgtbl Mode::), but instead—after filling in the message + headers—turn on Orgtbl mode manually when needed in the messages + body. + +‘filladapt.el’ by Kyle Jones + Org mode tries to do the right thing when filling paragraphs, list + items and other elements. Many users reported problems using both + ‘filladapt.el’ and Org mode, so a safe thing to do is to disable + filladapt like this: + + (add-hook 'org-mode-hook 'turn-off-filladapt-mode) + +‘viper.el’ by Michael Kifer + + Viper uses ‘C-c /’ and therefore makes this key not access the + corresponding Org mode command ‘org-sparse-tree’. You need to find + another key for this command, or override the key in + ‘viper-vi-global-user-map’ with + + (define-key viper-vi-global-user-map "C-c /" 'org-sparse-tree) + +‘windmove.el’ by Hovav Shacham + + This package also uses the ‘S-’ keys, so everything written + in the paragraph above about CUA mode also applies here. If you + want to make the windmove function active in locations where Org + mode does not have special functionality on ‘S-’, add this + to your configuration: + + ;; Make windmove work in Org mode: + (add-hook 'org-shiftup-final-hook 'windmove-up) + (add-hook 'org-shiftleft-final-hook 'windmove-left) + (add-hook 'org-shiftdown-final-hook 'windmove-down) + (add-hook 'org-shiftright-final-hook 'windmove-right) + +‘yasnippet.el’ + The way Org mode binds the ‘’ key (binding to ‘[tab]’ instead + of ‘"\t"’) overrules YASnippet’s access to this key. The following + code fixed this problem: + + (add-hook 'org-mode-hook + (lambda () + (setq-local yas/trigger-key [tab]) + (define-key yas/keymap [tab] 'yas/next-field-or-maybe-expand))) + + The latest version of YASnippet does not play well with Org mode. + If the above code does not fix the conflict, start by defining the + following function: + + (defun yas/org-very-safe-expand () + (let ((yas/fallback-behavior 'return-nil)) (yas/expand))) + + Then, tell Org mode to use that function: + + (add-hook 'org-mode-hook + (lambda () + (make-variable-buffer-local 'yas/trigger-key) + (setq yas/trigger-key [tab]) + (add-to-list 'org-tab-first-hook 'yas/org-very-safe-expand) + (define-key yas/keymap [tab] 'yas/next-field))) + + +File: org, Node: Org Crypt, Next: Org Mobile, Prev: Interaction, Up: Miscellaneous + +15.13 Org Crypt +=============== + +Org Crypt encrypts the text of an entry, but not the headline, or +properties. Behind the scene, it uses the Emacs EasyPG library to +encrypt and decrypt files. + + Any text below a headline that has a ‘crypt’ tag is automatically +encrypted when the file is saved. To use a different tag, customize the +‘org-crypt-tag-matcher’ setting. + + Here is a suggestion for Org Crypt settings in Emacs init file: + + (require 'org-crypt) + (org-crypt-use-before-save-magic) + (setq org-tags-exclude-from-inheritance '("crypt")) + + (setq org-crypt-key nil) + ;; GPG key to use for encryption + ;; Either the Key ID or set to nil to use symmetric encryption. + + (setq auto-save-default nil) + ;; Auto-saving does not cooperate with org-crypt.el: so you need to + ;; turn it off if you plan to use org-crypt.el quite often. Otherwise, + ;; you'll get an (annoying) message each time you start Org. + + ;; To turn it off only locally, you can insert this: + ;; + ;; # -*- buffer-auto-save-file-name: nil; -*- + + It’s possible to use different keys for different headings by +specifying the respective key as property ‘CRYPTKEY’, e.g.: + + * Totally secret :crypt: + :PROPERTIES: + :CRYPTKEY: 0x0123456789012345678901234567890123456789 + :END: + + Excluding the ‘crypt’ tag from inheritance prevents already encrypted +text from being encrypted again. + + +File: org, Node: Org Mobile, Next: Org Syntax, Prev: Org Crypt, Up: Miscellaneous + +15.14 Org Mobile +================ + +Org Mobile is a protocol for synchronizing Org files between Emacs and +other applications, e.g., on mobile devices. It enables offline-views +and capture support for an Org mode system that is rooted on a “real” +computer. The external application can also record changes to existing +entries. + + This appendix describes Org’s support for agenda view formats +compatible with Org Mobile. It also describes synchronizing changes, +such as to notes, between the mobile application and the computer. + + To change tags and TODO states in the mobile application, first +customize the variables ‘org-todo-keywords’ and ‘org-tag-alist’. These +should cover all the important tags and TODO keywords, even if Org files +use only some of them. Though the mobile application is expected to +support in-buffer settings, it is required to understand TODO states +_sets_ (see *note Per-file keywords::) and _mutually exclusive_ tags +(see *note Setting Tags::) only for those set in these variables. + +* Menu: + +* Setting up the staging area:: For the mobile device. +* Pushing to the mobile application:: Uploading Org files and agendas. +* Pulling from the mobile application:: Integrating captured and flagged items. + + +File: org, Node: Setting up the staging area, Next: Pushing to the mobile application, Up: Org Mobile + +15.14.1 Setting up the staging area +----------------------------------- + +The mobile application needs access to a file directory on a server(1) +to interact with Emacs. Pass its location through the +‘org-mobile-directory’ variable. If you can mount that directory +locally just set the variable to point to that directory: + + (setq org-mobile-directory "~/orgmobile/") + + Alternatively, by using TRAMP (see *note TRAMP User Manual: +(tramp)Top.), ‘org-mobile-directory’ may point to a remote directory +accessible through, for example, SSH, SCP, or DAVS: + + (setq org-mobile-directory "/davs:user@remote.host:/org/webdav/") + + With a public server, consider encrypting the files. Org also +requires OpenSSL installed on the local computer. To turn on +encryption, set the same password in the mobile application and in +Emacs. Set the password in the variable ‘org-mobile-use-encryption’(2). +Note that even after the mobile application encrypts the file contents, +the file name remains visible on the file systems of the local computer, +the server, and the mobile device. + + ---------- Footnotes ---------- + + (1) For a server to host files, consider using a WebDAV server, such +as Nextcloud (https://nextcloud.com). Additional help is at this FAQ +entry (https://orgmode.org/worg/org-faq.html#mobileorg_webdav). + + (2) If Emacs is configured for safe storing of passwords, then +configure the variable ‘org-mobile-encryption-password’; please read the +docstring of that variable. + + +File: org, Node: Pushing to the mobile application, Next: Pulling from the mobile application, Prev: Setting up the staging area, Up: Org Mobile + +15.14.2 Pushing to the mobile application +----------------------------------------- + +The command ‘org-mobile-push’ copies files listed in ‘org-mobile-files’ +into the staging area. Files include agenda files (as listed in +‘org-agenda-files’). Customize ‘org-mobile-files’ to add other files. +File names are staged with paths relative to ‘org-directory’, so all +files should be inside this directory(1). + + Push creates a special Org file ‘agendas.org’ with custom agenda +views defined by the user(2). + + Finally, Org writes the file ‘index.org’, containing links to other +files. The mobile application reads this file first from the server to +determine what other files to download for agendas. For faster +downloads, it is expected to only read files whose checksums(3) have +changed. + + ---------- Footnotes ---------- + + (1) Symbolic links in ‘org-directory’ need to have the same name as +their targets. + + (2) While creating the agendas, Org mode forces ‘ID’ properties on +all referenced entries, so that these entries can be uniquely identified +if Org Mobile flags them for further action. To avoid setting +properties configure the variable ‘org-mobile-force-id-on-agenda-items’ +to ‘nil’. Org mode then relies on outline paths, assuming they are +unique. + + (3) Checksums are stored automatically in the file ‘checksums.dat’. + + +File: org, Node: Pulling from the mobile application, Prev: Pushing to the mobile application, Up: Org Mobile + +15.14.3 Pulling from the mobile application +------------------------------------------- + +The command ‘org-mobile-pull’ synchronizes changes with the server. +More specifically, it first pulls the Org files for viewing. It then +appends captured entries and pointers to flagged or changed entries to +the file ‘mobileorg.org’ on the server. Org ultimately integrates its +data in an inbox file format, through the following steps: + + 1. Org moves all entries found in ‘mobileorg.org’(1) and appends them + to the file pointed to by the variable ‘org-mobile-inbox-for-pull’. + It should reside neither in the staging area nor on the server. + Each captured entry and each editing event is a top-level entry in + the inbox file. + + 2. After moving the entries, Org processes changes to the shared + files. Some of them are applied directly and without user + interaction. Examples include changes to tags, TODO state, + headline and body text. Entries requiring further action are + tagged as ‘FLAGGED’. Org marks entries with problems with an error + message in the inbox. They have to be resolved manually. + + 3. Org generates an agenda view for flagged entries for user + intervention to clean up. For notes stored in flagged entries, Org + displays them in the echo area when point is on the corresponding + agenda item. + + ‘?’ + Pressing ‘?’ displays the entire flagged note in another + window. Org also pushes it to the kill ring. To store + flagged note as a normal note, use ‘? z C-y C-c C-c’. + Pressing ‘?’ twice does these things: first it removes the + ‘FLAGGED’ tag; second, it removes the flagged note from the + property drawer; third, it signals that manual editing of the + flagged entry is now finished. + + From the agenda dispatcher, ‘?’ returns to the view to finish +processing flagged entries. Note that these entries may not be the most +recent since the mobile application searches files that were last +pulled. To get an updated agenda view with changes since the last pull, +pull again. + + ---------- Footnotes ---------- + + (1) The file will be empty after this operation. + + +File: org, Node: Org Syntax, Prev: Org Mobile, Up: Miscellaneous + +15.15 Org Syntax +================ + +A reference document providing a formal description of Org’s syntax is +available as a draft on Worg +(https://orgmode.org/worg/dev/org-syntax.html), written and maintained +by Nicolas Goaziou. It defines Org’s core internal concepts such as +“headlines”, “sections”, “affiliated keywords”, “(greater) elements” and +“objects”. Each part of an Org document belongs to one of the previous +categories. + + To explore the abstract structure of an Org buffer, run this in a +buffer: + + M-: (org-element-parse-buffer) + +It outputs a list containing the buffer’s content represented as an +abstract structure. The export engine relies on the information stored +in this list. Most interactive commands—e.g., for structure +editing—also rely on the syntactic meaning of the surrounding context. + + You can probe the syntax of your documents with the command + + M-x org-lint + +It runs a number of checks to find common mistakes. It then displays +their location in a dedicated buffer, along with a description and a +“trust level”, since false-positive are possible. From there, you can +operate on the reports with the following keys: + +‘C-j’, ‘’ Display the offending line +‘’ Move point to the offending line +‘g’ Check the document again +‘h’ Hide all reports from the same checker +‘i’ Also remove them from all subsequent checks +‘S’ Sort reports by the column at point + + +File: org, Node: Hacking, Next: History and Acknowledgments, Prev: Miscellaneous, Up: Top + +Appendix A Hacking +****************** + +This appendix describes some ways a user can extend the functionality of +Org. + +* Menu: + +* Hooks: Hooks (2). How to reach into Org’s internals. +* Add-on Packages:: Available extensions. +* Adding Hyperlink Types:: New custom link types. +* Adding Export Back-ends:: How to write new export back-ends. +* Tables in Arbitrary Syntax:: Orgtbl for LaTeX and other programs. +* Dynamic Blocks:: Automatically filled blocks. +* Special Agenda Views:: Customized views. +* Speeding Up Your Agendas:: Tips on how to speed up your agendas. +* Extracting Agenda Information:: Post-processing agenda information. +* Using the Property API:: Writing programs that use entry properties. +* Using the Mapping API:: Mapping over all or selected entries. + + +File: org, Node: Hooks (2), Next: Add-on Packages, Up: Hacking + +A.1 Hooks +========= + +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 +. + + +File: org, Node: Add-on Packages, Next: Adding Hyperlink Types, Prev: Hooks (2), Up: Hacking + +A.2 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 +. See the ‘contrib/README’ file in the source code +directory for a list of contributed files. Worg page with more +information is at: . + + +File: org, Node: Adding Hyperlink Types, Next: Adding Export Back-ends, Prev: Add-on Packages, Up: Hacking + +A.3 Adding Hyperlink Types +========================== + +Org has many built-in hyperlink types (see *note Hyperlinks::), and an +interface for adding new link types. The following example shows the +process of adding Org links to Unix man pages, which look like this + + [[man:printf][The printf manual]] + +The following ‘org-man.el’ file implements it + + ;;; org-man.el - Support for links to man pages in Org mode + (require 'org) + + (org-link-set-parameters "man" + :follow org-man-command + :export #'org-man-export + :store #'org-man-store-link) + + (defcustom org-man-command 'man + "The Emacs command to be used to display a man page." + :group 'org-link + :type '(choice (const man) (const woman))) + + (defun org-man-store-link () + "Store a link to a man page." + (when (memq major-mode '(Man-mode woman-mode)) + ;; This is a man page, we do make this link. + (let* ((page (org-man-get-page-name)) + (link (concat "man:" page)) + (description (format "Man page for %s" page))) + (org-store-link-props + :type "man" + :link link + :description description)))) + + (defun org-man-get-page-name () + "Extract the page name from the buffer name." + ;; This works for both `Man-mode' and `woman-mode'. + (if (string-match " \\(\\S-+\\)\\*" (buffer-name)) + (match-string 1 (buffer-name)) + (error "Cannot create link to this man page"))) + + (defun org-man-export (link description format) + "Export a man page link from Org files." + (let ((path (format "http://man.he.net/?topic=%s§ion=all" link)) + (desc (or description link))) + (pcase format + (`html (format "%s" path desc)) + (`latex (format "\\href{%s}{%s}" path desc)) + (`texinfo (format "@uref{%s,%s}" path desc)) + (`ascii (format "%s (%s)" desc path)) + (t path)))) + + (provide 'org-man) + ;;; org-man.el ends here + +To activate links to man pages in Org, enter this in the Emacs init +file: + + (require 'org-man) + +A review of ‘org-man.el’: + + 1. First, ‘(require 'org)’ ensures ‘org.el’ is loaded. + + 2. Then ‘org-link-set-parameters’ defines a new link type with ‘man’ + prefix and associates functions for following, exporting and + storing such links. See the variable ‘org-link-parameters’ for a + complete list of possible associations. + + 3. The rest of the file implements necessary variables and functions. + + For example, ‘org-man-store-link’ is responsible for storing a link + when ‘org-store-link’ (see *note Handling Links::) is called from a + buffer displaying a man page. It first checks if the ‘major-mode’ + is appropriate. If check fails, the function returns ‘nil’, which + means it isn’t responsible for creating a link to the current + buffer. Otherwise the function makes a link string by combining + the ‘man:’ prefix with the man topic. It also provides a default + description. The function ‘org-insert-link’ can insert it back + into an Org buffer later on. + + +File: org, Node: Adding Export Back-ends, Next: Tables in Arbitrary Syntax, Prev: Adding Hyperlink Types, Up: Hacking + +A.4 Adding Export Back-ends +=========================== + +Org’s export engine makes it easy for writing new back-ends. The +framework on which the engine was built makes it easy to derive new +back-ends from existing ones. + + The two main entry points to the export engine are: +‘org-export-define-backend’ and ‘org-export-define-derived-backend’. To +grok these functions, see ‘ox-latex.el’ for an example of defining a new +back-end from scratch, and ‘ox-beamer.el’ for an example of deriving +from an existing engine. + + For creating a new back-end from scratch, first set its name as a +symbol in an alist consisting of elements and export functions. To make +the back-end visible to the export dispatcher, set ‘:menu-entry’ +keyword. For export options specific to this back-end, set the +‘:options-alist’. + + For creating a new back-end from an existing one, set +‘:translate-alist’ to an alist of export functions. This alist replaces +the parent back-end functions. + + For complete documentation, see the Org Export Reference on Worg +(https://orgmode.org/worg/dev/org-export-reference.html). + + +File: org, Node: Tables in Arbitrary Syntax, Next: Dynamic Blocks, Prev: Adding Export Back-ends, Up: Hacking + +A.5 Tables in Arbitrary Syntax +============================== + +Due to Org’s success in handling tables with Orgtbl, a frequently +requested feature is the use of Org’s table functions in other modes, +e.g., LaTeX. This would be hard to do in a general way without +complicated customization nightmares. Moreover, that would take Org +away from its simplicity roots that Orgtbl has proven. There is, +however, an alternate approach to accomplishing the same. + + This approach involves implementing a custom _translate_ function +that operates on a native Org _source table_ to produce a table in +another format. This strategy would keep the excellently working Orgtbl +simple and isolate complications, if any, confined to the translate +function. To add more alien table formats, we just add more translate +functions. Also the burden of developing custom translate functions for +new table formats is in the hands of those who know those formats best. + +* Menu: + +* Radio tables:: Sending and receiving radio tables. +* A LaTeX example:: Step by step, almost a tutorial. +* Translator functions:: Copy and modify. + + +File: org, Node: Radio tables, Next: A LaTeX example, Up: Tables in Arbitrary Syntax + +A.5.1 Radio tables +------------------ + +Radio tables are target locations for translated tables that are not +near their source. Org finds the target location and inserts the +translated table. + + The key to finding the target location is the magic words ‘BEGIN/END +RECEIVE ORGTBL’. They have to appear as comments in the current mode. +If the mode is C, then: + + /* BEGIN RECEIVE ORGTBL table_name */ + /* END RECEIVE ORGTBL table_name */ + + At the location of source, Org needs a special line to direct Orgtbl +to translate and to find the target for inserting the translated table. +For example: + + #+ORGTBL: SEND table_name translation_function arguments ... + +‘table_name’ is the table’s reference name, which is also used in the +receiver lines, and the ‘translation_function’ is the Lisp function that +translates. This line, in addition, may also contain alternating key +and value arguments at the end. The translation function gets these +values as a property list. A few standard parameters are already +recognized and acted upon before the translation function is called: + +‘:skip N’ + Skip the first N lines of the table. Hlines do count; include them + if they are to be skipped. + +‘:skipcols (n1 n2 ...)’ + List of columns to be skipped. First Org automatically discards + columns with calculation marks and then sends the table to the + translator function, which then skips columns as specified in + ‘skipcols’. + + To keep the source table intact in the buffer without being disturbed +when the source file is compiled or otherwise being worked on, use one +of these strategies: + + • Place the table in a block comment. For example, in C mode you + could wrap the table between ‘/*’ and ‘*/’ lines. + + • Put the table after an “end” statement. For example ‘\bye’ in TeX + and ‘\end{document}’ in LaTeX. + + • Comment and un-comment each line of the table during edits. The + ‘M-x orgtbl-toggle-comment’ command makes toggling easy. + + +File: org, Node: A LaTeX example, Next: Translator functions, Prev: Radio tables, Up: Tables in Arbitrary Syntax + +A.5.2 A LaTeX example of radio tables +------------------------------------- + +To wrap a source table in LaTeX, use the ‘comment’ environment provided +by ‘comment.sty’(1). To activate it, put ‘\usepackage{comment}’ in the +document header. Orgtbl mode inserts a radio table skeleton(2) with the +command ‘M-x orgtbl-insert-radio-table’, which prompts for a table name. +For example, if ‘salesfigures’ is the name, the template inserts: + + % BEGIN RECEIVE ORGTBL salesfigures + % END RECEIVE ORGTBL salesfigures + \begin{comment} + #+ORGTBL: SEND salesfigures orgtbl-to-latex + | | | + \end{comment} + +The line ‘#+ORGTBL: SEND’ tells Orgtbl mode to use the function +‘orgtbl-to-latex’ to convert the table to LaTeX format, then insert the +table at the target (receive) location named ‘salesfigures’. Now the +table is ready for data entry. It can even use spreadsheet features(3): + + % BEGIN RECEIVE ORGTBL salesfigures + % END RECEIVE ORGTBL salesfigures + \begin{comment} + #+ORGTBL: SEND salesfigures orgtbl-to-latex + | Month | Days | Nr sold | per day | + |-------+------+---------+---------| + | Jan | 23 | 55 | 2.4 | + | Feb | 21 | 16 | 0.8 | + | March | 22 | 278 | 12.6 | + #+TBLFM: $4=$3/$2;%.1f + % $ (optional extra dollar to keep Font Lock happy, see footnote) + \end{comment} + + After editing, ‘C-c C-c’ inserts the translated table at the target +location, between the two marker lines. + + For hand-made custom tables, note that the translator needs to skip +the first two lines of the source table. Also the command has to +_splice_ out the target table without the header and footer. + + \begin{tabular}{lrrr} + Month & \multicolumn{1}{c}{Days} & Nr.\ sold & per day\\ + % BEGIN RECEIVE ORGTBL salesfigures + % END RECEIVE ORGTBL salesfigures + \end{tabular} + % + \begin{comment} + #+ORGTBL: SEND salesfigures orgtbl-to-latex :splice t :skip 2 + | Month | Days | Nr sold | per day | + |-------+------+---------+---------| + | Jan | 23 | 55 | 2.4 | + | Feb | 21 | 16 | 0.8 | + | March | 22 | 278 | 12.6 | + #+TBLFM: $4=$3/$2;%.1f + \end{comment} + + The LaTeX translator function ‘orgtbl-to-latex’ is already part of +Orgtbl mode and uses a ‘tabular’ environment to typeset the table and +marks horizontal lines with ‘\hline’. For additional parameters to +control output, see *note Translator functions::: + +‘:splice BOOLEAN’ + When {{{var(BOOLEAN}}} is non-‘nil’, return only table body lines; + i.e., not wrapped in ‘tabular’ environment. Default is ‘nil’. + +‘:fmt FMT’ + Format string to warp each field. It should contain ‘%s’ for the + original field value. For example, to wrap each field value in + dollar symbol, you could use ‘:fmt "$%s$"’. Format can also wrap a + property list with column numbers and formats, for example ‘:fmt (2 + "$%s$" 4 "%s\\%%")’. In place of a string, a function of one + argument can be used; the function must return a formatted string. + +‘:efmt EFMT’ + Format numbers as exponentials. The spec should have ‘%s’ twice + for inserting mantissa and exponent, for example + ‘"%s\\times10^{%s}"’. This may also be a property list with column + numbers and formats, for example ‘:efmt (2 "$%s\\times10^{%s}$" 4 + "$%s\\cdot10^{%s}$")’. After EFMT has been applied to a value, + FMT—see above—is also applied. Functions with two arguments can be + supplied instead of strings. By default, no special formatting is + applied. + + ---------- Footnotes ---------- + + (1) + + (2) By default this works only for LaTeX, HTML, and Texinfo. +Configure the variable ‘orgtbl-radio-table-templates’ to install +templates for other modes. + + (3) If the ‘TBLFM’ keyword contains an odd number of dollar +characters, this may cause problems with Font Lock in LaTeX mode. As +shown in the example you can fix this by adding an extra line inside the +‘comment’ environment that is used to balance the dollar expressions. +If you are using AUCTeX with the font-latex library, a much better +solution is to add the ‘comment’ environment to the variable +‘LaTeX-verbatim-environments’. + + +File: org, Node: Translator functions, Prev: A LaTeX example, Up: Tables in Arbitrary Syntax + +A.5.3 Translator functions +-------------------------- + +Orgtbl mode has built-in translator functions: ‘orgtbl-to-csv’ +(comma-separated values), ‘orgtbl-to-tsv’ (TAB-separated values), +‘orgtbl-to-latex’, ‘orgtbl-to-html’, ‘orgtbl-to-texinfo’, +‘orgtbl-to-unicode’ and ‘orgtbl-to-orgtbl’. They use the generic +translator, ‘orgtbl-to-generic’, which delegates translations to various +export back-ends. + + Properties passed to the function through the ‘ORGTBL SEND’ line take +precedence over properties defined inside the function. For example, +this overrides the default LaTeX line endings, ‘\\’, with ‘\\[2mm]’: + + #+ORGTBL: SEND test orgtbl-to-latex :lend " \\\\[2mm]" + + For a new language translator, define a converter function. It can +be a generic function, such as shown in this example. It marks a +beginning and ending of a table with ‘!BTBL!’ and ‘!ETBL!’; a beginning +and ending of lines with ‘!BL!’ and ‘!EL!’; and uses a TAB for a field +separator: + + (defun orgtbl-to-language (table params) + "Convert the orgtbl-mode TABLE to language." + (orgtbl-to-generic + table + (org-combine-plists + '(:tstart "!BTBL!" :tend "!ETBL!" :lstart "!BL!" :lend "!EL!" :sep "\t") + params))) + +The documentation for the ‘orgtbl-to-generic’ function shows a complete +list of parameters, each of which can be passed through to +‘orgtbl-to-latex’, ‘orgtbl-to-texinfo’, and any other function using +that generic function. + + For complicated translations the generic translator function could be +replaced by a custom translator function. Such a custom function must +take two arguments and return a single string containing the formatted +table. The first argument is the table whose lines are a list of fields +or the symbol ‘hline’. The second argument is the property list +consisting of parameters specified in the ‘#+ORGTBL: SEND’ line. Please +share your translator functions by posting them to the Org users mailing +list, at . + + +File: org, Node: Dynamic Blocks, Next: Special Agenda Views, Prev: Tables in Arbitrary Syntax, Up: Hacking + +A.6 Dynamic Blocks +================== + +Org supports _dynamic blocks_ in Org documents. They are inserted with +begin and end markers like any other code block, but the contents are +updated automatically by a user function. For example, ‘C-c C-x C-r’ +inserts a dynamic table that updates the work time (see *note Clocking +Work Time::). + + Dynamic blocks can have names and function parameters. The syntax is +similar to source code block specifications: + + #+BEGIN: myblock :parameter1 value1 :parameter2 value2 ... + ... + #+END: + + These commands update dynamic blocks: + +‘C-c C-x C-u’ (‘org-dblock-update’) + Update dynamic block at point. + +‘C-u C-c C-x C-u’ + Update all dynamic blocks in the current file. + + Before updating a dynamic block, Org removes content between the +‘BEGIN’ and ‘END’ markers. Org then reads the parameters on the ‘BEGIN’ +line for passing to the writer function. If the function expects to +access the removed content, then Org expects an extra parameter, +‘:content’, on the ‘BEGIN’ line. + + The syntax for naming a writer function with a dynamic block labelled +‘myblock’ is: ‘org-dblock-write:myblock’. Parameters come from the +‘BEGIN’ line. + + The following is an example of a dynamic block and a block writer +function that updates the time when the function was last run: + + #+BEGIN: block-update-time :format "on %m/%d/%Y at %H:%M" + ... + #+END: + +The dynamic block’s writer function: + + (defun org-dblock-write:block-update-time (params) + (let ((fmt (or (plist-get params :format) "%d. %m. %Y"))) + (insert "Last block update at: " + (format-time-string fmt)))) + + To keep dynamic blocks up-to-date in an Org file, use the function, +‘org-update-all-dblocks’ in hook, such as ‘before-save-hook’. The +‘org-update-all-dblocks’ function does not run if the file is not in Org +mode. + + Dynamic blocks, like any other block, can be narrowed with +‘org-narrow-to-block’. + + +File: org, Node: Special Agenda Views, Next: Speeding Up Your Agendas, Prev: Dynamic Blocks, Up: Hacking + +A.7 Special Agenda Views +======================== + +Org provides a special hook to further limit items in agenda views: +‘agenda’, ‘agenda*’(1), ‘todo’, ‘alltodo’, ‘tags’, ‘tags-todo’, +‘tags-tree’. Specify a custom function that tests inclusion of every +matched item in the view. This function can also skip as much as is +needed. + + For a global condition applicable to agenda views, use the +‘org-agenda-skip-function-global’ variable. Org uses a global condition +with ‘org-agenda-skip-function’ for custom searching. + + This example defines a function for a custom view showing TODO items +with ‘waiting’ status. Manually this is a multi-step search process, +but with a custom view, this can be automated as follows: + + The custom function searches the subtree for the ‘waiting’ tag and +returns ‘nil’ on match. Otherwise it gives the location from where the +search continues. + + (defun my-skip-unless-waiting () + "Skip trees that are not waiting" + (let ((subtree-end (save-excursion (org-end-of-subtree t)))) + (if (re-search-forward ":waiting:" subtree-end t) + nil ; tag found, do not skip + subtree-end))) ; tag not found, continue after end of subtree + + To use this custom function in a custom agenda command: + + (org-add-agenda-custom-command + '("b" todo "PROJECT" + ((org-agenda-skip-function 'my-skip-unless-waiting) + (org-agenda-overriding-header "Projects waiting for something: ")))) + + Note that this also binds ‘org-agenda-overriding-header’ to a more +meaningful string suitable for the agenda view. + + Search for entries with a limit set on levels for the custom search. +This is a general approach to creating custom searches in Org. To +include all levels, use ‘LEVEL>0’(2). Then to selectively pick the +matched entries, use ‘org-agenda-skip-function’, which also accepts Lisp +forms, such as ‘org-agenda-skip-entry-if’ and +‘org-agenda-skip-subtree-if’. For example: + +‘(org-agenda-skip-entry-if 'scheduled)’ + Skip current entry if it has been scheduled. + +‘(org-agenda-skip-entry-if 'notscheduled)’ + Skip current entry if it has not been scheduled. + +‘(org-agenda-skip-entry-if 'deadline)’ + Skip current entry if it has a deadline. + +‘(org-agenda-skip-entry-if 'scheduled 'deadline)’ + Skip current entry if it has a deadline, or if it is scheduled. + +‘(org-agenda-skip-entry-if 'todo '("TODO" "WAITING"))’ + Skip current entry if the TODO keyword is TODO or WAITING. + +‘(org-agenda-skip-entry-if 'todo 'done)’ + Skip current entry if the TODO keyword marks a DONE state. + +‘(org-agenda-skip-entry-if 'timestamp)’ + Skip current entry if it has any timestamp, may also be deadline or + scheduled. + +‘(org-agenda-skip-entry-if 'regexp "regular expression")’ + Skip current entry if the regular expression matches in the entry. + +‘(org-agenda-skip-entry-if 'notregexp "regular expression")’ + Skip current entry unless the regular expression matches. + +‘(org-agenda-skip-subtree-if 'regexp "regular expression")’ + Same as above, but check and skip the entire subtree. + + The following is an example of a search for ‘waiting’ without the +special function: + + (org-add-agenda-custom-command + '("b" todo "PROJECT" + ((org-agenda-skip-function '(org-agenda-skip-subtree-if + 'regexp ":waiting:")) + (org-agenda-overriding-header "Projects waiting for something: ")))) + + ---------- Footnotes ---------- + + (1) The ‘agenda*’ view is the same as ‘agenda’ except that it only +considers _appointments_, i.e., scheduled and deadline items that have a +time specification ‘[h]h:mm’ in their time-stamps. + + (2) Note that, for ‘org-odd-levels-only’, a level number corresponds +to order in the hierarchy, not to the number of stars. + + +File: org, Node: Speeding Up Your Agendas, Next: Extracting Agenda Information, Prev: Special Agenda Views, Up: Hacking + +A.8 Speeding Up Your Agendas +============================ + +Some agenda commands slow down when the Org files grow in size or +number. Here are tips to speed up: + + • Reduce the number of Org agenda files to avoid slowdowns due to + hard drive accesses. + + • Reduce the number of DONE and archived headlines so agenda + operations that skip over these can finish faster. + + • Do not dim blocked tasks: + + (setq org-agenda-dim-blocked-tasks nil) + + • Stop preparing agenda buffers on startup: + + (setq org-agenda-inhibit-startup t) + + • Disable tag inheritance for agendas: + + (setq org-agenda-use-tag-inheritance nil) + + 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 dedicated Worg page +(https://orgmode.org/worg/agenda-optimization.html) for agenda +optimization. + + +File: org, Node: Extracting Agenda Information, Next: Using the Property API, Prev: Speeding Up Your Agendas, Up: Hacking + +A.9 Extracting Agenda Information +================================= + +Org provides commands to access agendas through Emacs batch mode. +Through this command-line interface, agendas are automated for further +processing or printing. + + ‘org-batch-agenda’ creates an agenda view in ASCII and outputs to +standard output. This command takes one string parameter. When string +consists of a single character, Org uses it as a key to +‘org-agenda-custom-commands’. These are the same ones available through +the agenda dispatcher (see *note Agenda Dispatcher::). + + This example command line directly prints the TODO list to the +printer: + + emacs -batch -l ~/.emacs -eval '(org-batch-agenda "t")' | lpr + + When the string parameter length is two or more characters, Org +matches it with tags/TODO strings. For example, this example command +line prints items tagged with ‘shop’, but excludes items tagged with +‘NewYork’: + + emacs -batch -l ~/.emacs \ + -eval '(org-batch-agenda "+shop-NewYork")' | lpr + +An example showing on-the-fly parameter modifications: + + emacs -batch -l ~/.emacs \ + -eval '(org-batch-agenda "a" \ + org-agenda-span (quote month) \ + org-agenda-include-diary nil \ + org-agenda-files (quote ("~/org/project.org")))' \ + | lpr + +which produces an agenda for the next 30 days from just the +‘~/org/projects.org’ file. + + For structured processing of agenda output, use +‘org-batch-agenda-csv’ with the following fields: + +category + The category of the item +head + The headline, without TODO keyword, TAGS and PRIORITY +type + The type of the agenda entry, can be + + ‘todo’ selected in TODO match + ‘tagsmatch’ selected in tags match + ‘diary’ imported from diary + ‘deadline’ a deadline + ‘scheduled’ scheduled + ‘timestamp’ appointment, selected by timestamp + ‘closed’ entry was closed on date + ‘upcoming-deadline’ warning about nearing deadline + ‘past-scheduled’ forwarded scheduled item + ‘block’ entry has date block including date + +todo + The TODO keyword, if any +tags + All tags including inherited ones, separated by colons +date + The relevant date, like ‘2007-2-14’ +time + The time, like ‘15:00-16:50’ +extra + String with extra planning info +priority-l + The priority letter if any was given +priority-n + The computed numerical priority + + If the selection of the agenda item was based on a timestamp, +including those items with ‘DEADLINE’ and ‘SCHEDULED’ keywords, then Org +includes date and time in the output. + + If the selection of the agenda item was based on a timestamp (or +deadline/scheduled), then Org includes date and time in the output. + + Here is an example of a post-processing script in Perl. It takes the +CSV output from Emacs and prints with a checkbox: + + #!/usr/bin/perl + + # define the Emacs command to run + $cmd = "emacs -batch -l ~/.emacs -eval '(org-batch-agenda-csv \"t\")'"; + + # run it and capture the output + $agenda = qx{$cmd 2>/dev/null}; + + # loop over all lines + foreach $line (split(/\n/,$agenda)) { + # get the individual values + ($category,$head,$type,$todo,$tags,$date,$time,$extra, + $priority_l,$priority_n) = split(/,/,$line); + # process and print + print "[ ] $head\n"; + } + + +File: org, Node: Using the Property API, Next: Using the Mapping API, Prev: Extracting Agenda Information, Up: Hacking + +A.10 Using the Property API +=========================== + +Here is a description of the functions that can be used to work with +properties. + + -- Function: org-entry-properties &optional pom which + Get all properties of the entry at point-or-marker POM. This + includes the TODO keyword, the tags, time strings for deadline, + scheduled, and clocking, and any additional properties defined in + the entry. The return value is an alist. Keys may occur multiple + times if the property key was used several times. POM may also be + ‘nil’, in which case the current entry is used. If WHICH is ‘nil’ + or ‘all’, get all properties. If WHICH is ‘special’ or ‘standard’, + only get that subclass. + + -- Function: org-entry-get pom property &optional inherit + Get value of PROPERTY for entry at point-or-marker POM. By + default, this only looks at properties defined locally in the + entry. If INHERIT is non-‘nil’ and the entry does not have the + property, then also check higher levels of the hierarchy. If + INHERIT is the symbol ‘selective’, use inheritance if and only if + the setting of ‘org-use-property-inheritance’ selects PROPERTY for + inheritance. + + -- Function: org-entry-delete pom property + Delete the property PROPERTY from entry at point-or-marker POM. + + -- Function: org-entry-put pom property value + Set PROPERTY to VALUES for entry at point-or-marker POM. + + -- Function: org-buffer-property-keys &optional include-specials + Get all property keys in the current buffer. + + -- Function: org-insert-property-drawer + Insert a property drawer for the current entry. Also + + -- Function: org-entry-put-multivalued-property pom property &rest + values + Set PROPERTY at point-or-marker POM to VALUES. VALUES should be a + list of strings. They are concatenated, with spaces as separators. + + -- Function: org-entry-get-multivalued-property pom property + Treat the value of the property PROPERTY as a whitespace-separated + list of values and return the values as a list of strings. + + -- Function: org-entry-add-to-multivalued-property pom property value + Treat the value of the property PROPERTY as a whitespace-separated + list of values and make sure that VALUE is in this list. + + -- Function: org-entry-remove-from-multivalued-property pom property + value + Treat the value of the property PROPERTY as a whitespace-separated + list of values and make sure that VALUE is _not_ in this list. + + -- Function: org-entry-member-in-multivalued-property pom property + value + Treat the value of the property PROPERTY as a whitespace-separated + list of values and check if VALUE is in this list. + + -- User Option: org-property-allowed-value-functions + Hook for functions supplying allowed values for a specific + property. The functions must take a single argument, the name of + the property, and return a flat list of allowed values. If ‘:ETC’ + is one of the values, use the values as completion help, but allow + also other values to be entered. The functions must return ‘nil’ + if they are not responsible for this property. + + +File: org, Node: Using the Mapping API, Prev: Using the Property API, Up: Hacking + +A.11 Using the Mapping API +========================== + +Org has sophisticated mapping capabilities to find all entries +satisfying certain criteria. Internally, this functionality is used to +produce agenda views, but there is also an API that can be used to +execute arbitrary functions for each or selected entries. The main +entry point for this API is: + + -- Function: org-map-entries func &optional match scope &rest skip + Call FUNC at each headline selected by MATCH in SCOPE. + + FUNC is a function or a Lisp form. With point positioned at the + beginning of the headline, call the function without arguments. + Org returns an alist of return values of calls to the function. + + To avoid preserving point, Org wraps the call to FUNC in + ‘save-excursion’ form. After evaluation, Org moves point to the + end of the line that was just processed. Search continues from + that point forward. This may not always work as expected under + some conditions, such as if the current sub-tree was removed by a + previous archiving operation. In such rare circumstances, Org + skips the next entry entirely when it should not. To stop Org from + such skips, make FUNC set the variable ‘org-map-continue-from’ to a + specific buffer position. + + MATCH is a tags/property/TODO match. Org iterates only matched + headlines. Org iterates over all headlines when MATCH is ‘nil’ or + ‘t’. + + SCOPE determines the scope of this command. It can be any of: + + ‘nil’ + The current buffer, respecting the restriction, if any. + + ‘tree’ + The subtree started with the entry at point. + + ‘region’ + The entries within the active region, if any. + + ‘file’ + The current buffer, without restriction. + + ‘file-with-archives’ + The current buffer, and any archives associated with it. + + ‘agenda’ + All agenda files. + + ‘agenda-with-archives’ + All agenda files with any archive files associated with them. + + list of filenames + If this is a list, all files in the list are scanned. + + The remaining arguments are treated as settings for the scanner’s + skipping facilities. Valid arguments are: + + ‘archive’ + Skip trees with the ‘ARCHIVE’ tag. + + ‘comment’ + Skip trees with the COMMENT keyword. + + function or Lisp form + Used as value for ‘org-agenda-skip-function’, so whenever the + function returns ‘t’, FUNC is called for that entry and search + continues from the point where the function leaves it. + + The mapping routine can call any arbitrary function, even functions +that change meta data or query the property API (see *note Using the +Property API::). Here are some handy functions: + + -- Function: org-todo &optional arg + Change the TODO state of the entry. See the docstring of the + functions for the many possible values for the argument ARG. + + -- Function: org-priority &optional action + Change the priority of the entry. See the docstring of this + function for the possible values for ACTION. + + -- Function: org-toggle-tag tag &optional onoff + Toggle the tag TAG in the current entry. Setting ONOFF to either + ‘on’ or ‘off’ does not toggle tag, but ensure that it is either on + or off. + + -- Function: org-promote + Promote the current entry. + + -- Function: org-demote + Demote the current entry. + + This example turns all entries tagged with ‘TOMORROW’ into TODO +entries with keyword ‘UPCOMING’. Org ignores entries in comment trees +and archive trees. + + (org-map-entries '(org-todo "UPCOMING") + "+TOMORROW" 'file 'archive 'comment) + + The following example counts the number of entries with TODO keyword +‘WAITING’, in all agenda files. + + (length (org-map-entries t "/+WAITING" 'agenda)) + + +File: org, Node: History and Acknowledgments, Next: GNU Free Documentation License, Prev: Hacking, Up: Top + +Appendix B History and Acknowledgments +************************************** + +B.1 From Carsten +================ + +Org was born in 2003, out of frustration over the user interface of the +Emacs Outline mode. I was trying to organize my notes and projects, and +using Emacs seemed to be the natural way to go. However, having to +remember eleven different commands with two or three keys per command, +only to hide and show parts of the outline tree, that seemed entirely +unacceptable to me. Also, when using outlines to take notes, I +constantly wanted to restructure the tree, organizing it parallel to my +thoughts and plans. _Visibility cycling_ and _structure editing_ were +originally implemented in the package ‘outline-magic.el’, but quickly +moved to the more general ‘org.el’. As this environment became +comfortable for project planning, the next step was adding _TODO +entries_, basic _timestamps_, and _table support_. These areas +highlighted the two main goals that Org still has today: to be a new, +outline-based, plain text mode with innovative and intuitive editing +features, and to incorporate project planning functionality directly +into a notes file. + + Since the first release, literally thousands of emails to me or to +the mailing list have provided a constant stream +of bug reports, feedback, new ideas, and sometimes patches and add-on +code. Many thanks to everyone who has helped to improve this package. +I am trying to keep here a list of the people who had significant +influence in shaping one or more aspects of Org. The list may not be +complete, if I have forgotten someone, please accept my apologies and +let me know. + + Before I get to this list, a few special mentions are in order: + +Bastien Guerry + Bastien has written a large number of extensions to Org (most of + them integrated into the core by now), including the LaTeX exporter + and the plain list parser. His support during the early days was + central to the success of this project. Bastien also invented + Worg, helped establishing the Web presence of Org, and sponsored + hosting costs for the orgmode.org website. Bastien stepped in as + maintainer of Org between 2011 and 2013, at a time when I + desperately needed a break. + +Eric Schulte and Dan Davison + Eric and Dan are jointly responsible for the Org Babel system, + which turns Org into a multi-language environment for evaluating + code and doing literate programming and reproducible research. + This has become one of Org’s killer features that define what Org + is today. + +John Wiegley + John has contributed a number of great ideas and patches directly + to Org, including the attachment system (‘org-attach.el’), + integration with Apple Mail (‘org-mac-message.el’), hierarchical + dependencies of TODO items, habit tracking (‘org-habits.el’), and + encryption (‘org-crypt.el’). Also, the capture system is really an + extended copy of his great ‘remember.el’. + +Sebastian Rose + Without Sebastian, the HTML/XHTML publishing of Org would be the + pitiful work of an ignorant amateur. Sebastian has pushed this + part of Org onto a much higher level. He also wrote ‘org-info.js’, + a Java script for displaying webpages derived from Org using an + Info-like or a folding interface with single-key navigation. + + See below for the full list of contributions! Again, please let me +know what I am missing here! + +B.2 From Bastien +================ + +I (Bastien) have been maintaining Org between 2011 and 2013. This +appendix would not be complete without adding a few more acknowledgments +and thanks. + + I am first grateful to Carsten for his trust while handing me over +the maintainership of Org. His unremitting support is what really +helped me getting more confident over time, with both the community and +the code. + + When I took over maintainership, I knew I would have to make Org more +collaborative than ever, as I would have to rely on people that are more +knowledgeable than I am on many parts of the code. Here is a list of +the persons I could rely on, they should really be considered +co-maintainers, either of the code or the community: + +Eric Schulte + Eric is maintaining the Babel parts of Org. His reactivity here + kept me away from worrying about possible bugs here and let me + focus on other parts. + +Nicolas Goaziou + Nicolas is maintaining the consistency of the deepest parts of Org. + His work on ‘org-element.el’ and ‘ox.el’ has been outstanding, and + it opened the doors for many new ideas and features. He rewrote + many of the old exporters to use the new export engine, and helped + with documenting this major change. More importantly (if that’s + possible), he has been more than reliable during all the work done + for Org 8.0, and always very reactive on the mailing list. + +Achim Gratz + Achim rewrote the building process of Org, turning some _ad hoc_ + tools into a flexible and conceptually clean process. He patiently + coped with the many hiccups that such a change can create for + users. + +Nick Dokos + The Org mode mailing list would not be such a nice place without + Nick, who patiently helped users so many times. It is impossible + to overestimate such a great help, and the list would not be so + active without him. + + I received support from so many users that it is clearly impossible +to be fair when shortlisting a few of them, but Org’s history would not +be complete if the ones above were not mentioned in this manual. + +B.3 List of Contributions +========================= + + • Russel Adams came up with the idea for drawers. + + • Thomas Baumann wrote ‘org-bbdb.el’ and ‘org-mhe.el’. + + • Christophe Bataillon created the great unicorn logo that we use on + the Org mode website. + + • Alex Bochannek provided a patch for rounding timestamps. + + • Jan Böcker wrote ‘org-docview.el’. + + • Brad Bozarth showed how to pull RSS feed data into Org files. + + • Tom Breton wrote ‘org-choose.el’. + + • Charles Cave’s suggestion sparked the implementation of templates + for Remember, which are now templates for capture. + + • Pavel Chalmoviansky influenced the agenda treatment of items with + specified time. + + • Gregory Chernov patched support for Lisp forms into table + calculations and improved XEmacs compatibility, in particular by + porting ‘nouline.el’ to XEmacs. + + • Sacha Chua suggested copying some linking code from Planner. + + • Baoqiu Cui contributed the DocBook exporter. + + • Eddward DeVilla proposed and tested checkbox statistics. He also + came up with the idea of properties, and that there should be an + API for them. + + • Nick Dokos tracked down several nasty bugs. + + • Kees Dullemond used to edit projects lists directly in HTML and so + inspired some of the early development, including HTML export. He + also asked for a way to narrow wide table columns. + + • Thomas S. Dye contributed documentation on Worg and helped + integrating the Org Babel documentation into the manual. + + • Christian Egli converted the documentation into Texinfo format, + inspired the agenda, patched CSS formatting into the HTML exporter, + and wrote ‘org-taskjuggler.el’. + + • David Emery provided a patch for custom CSS support in exported + HTML agendas. + + • Nic Ferrier contributed mailcap and XOXO support. + + • Miguel A. Figueroa-Villanueva implemented hierarchical checkboxes. + + • John Foerch figured out how to make incremental search show context + around a match in a hidden outline tree. + + • Raimar Finken wrote ‘org-git-line.el’. + + • Mikael Fornius works as a mailing list moderator. + + • Austin Frank works as a mailing list moderator. + + • Eric Fraga drove the development of Beamer export with ideas and + testing. + + • Barry Gidden did proofreading the manual in preparation for the + book publication through Network Theory Ltd. + + • Niels Giesen had the idea to automatically archive DONE trees. + + • Nicolas Goaziou rewrote much of the plain list code. + + • Kai Grossjohann pointed out key-binding conflicts with other + packages. + + • Brian Gough of Network Theory Ltd publishes the Org mode manual as + a book. + + • Bernt Hansen has driven much of the support for auto-repeating + tasks, task state change logging, and the clocktable. His clear + explanations have been critical when we started to adopt the Git + version control system. + + • Manuel Hermenegildo has contributed various ideas, small fixes and + patches. + + • Phil Jackson wrote ‘org-irc.el’. + + • Scott Jaderholm proposed footnotes, control over whitespace between + folded entries, and column view for properties. + + • Matt Jones wrote MobileOrg Android. + + • Tokuya Kameshima wrote ‘org-wl.el’ and ‘org-mew.el’. + + • Shidai Liu (“Leo”) asked for embedded LaTeX and tested it. He also + provided frequent feedback and some patches. + + • Matt Lundin has proposed last-row references for table formulas and + named invisible anchors. He has also worked a lot on the FAQ. + + • David Maus wrote ‘org-atom.el’, maintains the issues file for Org, + and is a prolific contributor on the mailing list with competent + replies, small fixes and patches. + + • Jason F. McBrayer suggested agenda export to CSV format. + + • Max Mikhanosha came up with the idea of refiling. + + • Dmitri Minaev sent a patch to set priority limits on a per-file + basis. + + • Stefan Monnier provided a patch to keep the Emacs Lisp compiler + happy. + + • Richard Moreland wrote MobileOrg for the iPhone. + + • Rick Moynihan proposed allowing multiple TODO sequences in a file + and being able to quickly restrict the agenda to a subtree. + + • Todd Neal provided patches for links to Info files and Elisp forms. + + • Greg Newman refreshed the unicorn logo into its current form. + + • Tim O’Callaghan suggested in-file links, search options for general + file links, and tags. + + • Osamu Okano wrote ‘orgcard2ref.pl’, a Perl program to create a text + version of the reference card. + + • Takeshi Okano translated the manual and David O’Toole’s tutorial + into Japanese. + + • Oliver Oppitz suggested multi-state TODO items. + + • Scott Otterson sparked the introduction of descriptive text for + links, among other things. + + • Pete Phillips helped during the development of the TAGS feature, + and provided frequent feedback. + + • Martin Pohlack provided the code snippet to bundle character + insertion into bundles of 20 for undo. + + • T. V. Raman reported bugs and suggested improvements. + + • Matthias Rempe (Oelde) provided ideas, Windows support, and quality + control. + + • Paul Rivier provided the basic implementation of named footnotes. + He also acted as mailing list moderator for some time. + + • Kevin Rogers contributed code to access VM files on remote hosts. + + • Frank Ruell solved the mystery of the ‘keymapp nil’ bug, a conflict + with ‘allout.el’. + + • Jason Riedy generalized the send-receive mechanism for Orgtbl + tables with extensive patches. + + • Philip Rooke created the Org reference card, provided lots of + feedback, developed and applied standards to the Org documentation. + + • Christian Schlauer proposed angular brackets around links, among + other things. + + • Paul Sexton wrote ‘org-ctags.el’. + + • Tom Shannon’s ‘organizer-mode.el’ inspired linking to VM/BBDB/Gnus. + + • Ilya Shlyakhter proposed the Archive Sibling, line numbering in + literal examples, and remote highlighting for referenced code + lines. + + • Stathis Sideris wrote the ‘ditaa.jar’ ASCII to PNG converter that + is now packaged into Org’s ‘contrib/’ directory. + + • Daniel Sinder came up with the idea of internal archiving by + locking subtrees. + + • Dale Smith proposed link abbreviations. + + • James TD Smith has contributed a large number of patches for useful + tweaks and features. + + • Adam Spiers asked for global linking commands, inspired the link + extension system, added support for Mairix, and proposed the + mapping API. + + • Ulf Stegemann created the table to translate special symbols to + HTML, LaTeX, UTF-8, Latin-1 and ASCII. + + • Andy Stewart contributed code to ‘org-w3m.el’, to copy HTML content + with links transformation to Org syntax. + + • David O’Toole wrote ‘org-publish.el’ and drafted the manual chapter + about publishing. + + • Jambunathan K. contributed the ODT exporter. + + • Sebastien Vauban reported many issues with LaTeX and Beamer export + and enabled source code highlighting in Gnus. + + • Stefan Vollmar organized a video-recorded talk at the + Max-Planck-Institute for Neurology. He also inspired the creation + of a concept index for HTML export. + + • Jürgen Vollmer contributed code generating the table of contents in + HTML output. + + • Samuel Wales has provided important feedback and bug reports. + + • Chris Wallace provided a patch implementing the ‘QUOTE’ block. + + • David Wainberg suggested archiving, and improvements to the linking + system. + + • Carsten Wimmer suggested some changes and helped fix a bug in + linking to Gnus. + + • Roland Winkler requested additional key bindings to make Org work + on a TTY. + + • Piotr Zielinski wrote ‘org-mouse.el’, proposed agenda blocks and + contributed various ideas and code snippets. + + • Marco Wahl wrote ‘org-eww.el’. + + +File: org, Node: GNU Free Documentation License, Next: Main Index, Prev: History and Acknowledgments, Up: Top + +Appendix C GNU Free Documentation License +***************************************** + + Version 1.3, 3 November 2008 + + Copyright © 2000, 2001, 2002, 2007, 2008, 2013, 2014, 2018 Free Software Foundation, Inc. + + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + 0. PREAMBLE + + The purpose of this License is to make a manual, textbook, or other + functional and useful document “free” in the sense of freedom: to + assure everyone the effective freedom to copy and redistribute it, + with or without modifying it, either commercially or + noncommercially. Secondarily, this License preserves for the + author and publisher a way to get credit for their work, while not + being considered responsible for modifications made by others. + + This License is a kind of “copyleft”, which means that derivative + works of the document must themselves be free in the same sense. + It complements the GNU General Public License, which is a copyleft + license designed for free software. + + We have designed this License in order to use it for manuals for + free software, because free software needs free documentation: a + free program should come with manuals providing the same freedoms + that the software does. But this License is not limited to + software manuals; it can be used for any textual work, regardless + of subject matter or whether it is published as a printed book. We + recommend this License principally for works whose purpose is + instruction or reference. + + 1. APPLICABILITY AND DEFINITIONS + + This License applies to any manual or other work, in any medium, + that contains a notice placed by the copyright holder saying it can + be distributed under the terms of this License. Such a notice + grants a world-wide, royalty-free license, unlimited in duration, + to use that work under the conditions stated herein. The + “Document”, below, refers to any such manual or work. Any member + of the public is a licensee, and is addressed as “you”. You accept + the license if you copy, modify or distribute the work in a way + requiring permission under copyright law. + + A “Modified Version” of the Document means any work containing the + Document or a portion of it, either copied verbatim, or with + modifications and/or translated into another language. + + A “Secondary Section” is a named appendix or a front-matter section + of the Document that deals exclusively with the relationship of the + publishers or authors of the Document to the Document’s overall + subject (or to related matters) and contains nothing that could + fall directly within that overall subject. (Thus, if the Document + is in part a textbook of mathematics, a Secondary Section may not + explain any mathematics.) The relationship could be a matter of + historical connection with the subject or with related matters, or + of legal, commercial, philosophical, ethical or political position + regarding them. + + The “Invariant Sections” are certain Secondary Sections whose + titles are designated, as being those of Invariant Sections, in the + notice that says that the Document is released under this License. + If a section does not fit the above definition of Secondary then it + is not allowed to be designated as Invariant. The Document may + contain zero Invariant Sections. If the Document does not identify + any Invariant Sections then there are none. + + The “Cover Texts” are certain short passages of text that are + listed, as Front-Cover Texts or Back-Cover Texts, in the notice + that says that the Document is released under this License. A + Front-Cover Text may be at most 5 words, and a Back-Cover Text may + be at most 25 words. + + A “Transparent” copy of the Document means a machine-readable copy, + represented in a format whose specification is available to the + general public, that is suitable for revising the document + straightforwardly with generic text editors or (for images composed + of pixels) generic paint programs or (for drawings) some widely + available drawing editor, and that is suitable for input to text + formatters or for automatic translation to a variety of formats + suitable for input to text formatters. A copy made in an otherwise + Transparent file format whose markup, or absence of markup, has + been arranged to thwart or discourage subsequent modification by + readers is not Transparent. An image format is not Transparent if + used for any substantial amount of text. A copy that is not + “Transparent” is called “Opaque”. + + Examples of suitable formats for Transparent copies include plain + ASCII without markup, Texinfo input format, LaTeX input format, + SGML or XML using a publicly available DTD, and standard-conforming + simple HTML, PostScript or PDF designed for human modification. + Examples of transparent image formats include PNG, XCF and JPG. + Opaque formats include proprietary formats that can be read and + edited only by proprietary word processors, SGML or XML for which + the DTD and/or processing tools are not generally available, and + the machine-generated HTML, PostScript or PDF produced by some word + processors for output purposes only. + + The “Title Page” means, for a printed book, the title page itself, + plus such following pages as are needed to hold, legibly, the + material this License requires to appear in the title page. For + works in formats which do not have any title page as such, “Title + Page” means the text near the most prominent appearance of the + work’s title, preceding the beginning of the body of the text. + + The “publisher” means any person or entity that distributes copies + of the Document to the public. + + A section “Entitled XYZ” means a named subunit of the Document + whose title either is precisely XYZ or contains XYZ in parentheses + following text that translates XYZ in another language. (Here XYZ + stands for a specific section name mentioned below, such as + “Acknowledgements”, “Dedications”, “Endorsements”, or “History”.) + To “Preserve the Title” of such a section when you modify the + Document means that it remains a section “Entitled XYZ” according + to this definition. + + The Document may include Warranty Disclaimers next to the notice + which states that this License applies to the Document. These + Warranty Disclaimers are considered to be included by reference in + this License, but only as regards disclaiming warranties: any other + implication that these Warranty Disclaimers may have is void and + has no effect on the meaning of this License. + + 2. VERBATIM COPYING + + You may copy and distribute the Document in any medium, either + commercially or noncommercially, provided that this License, the + copyright notices, and the license notice saying this License + applies to the Document are reproduced in all copies, and that you + add no other conditions whatsoever to those of this License. You + may not use technical measures to obstruct or control the reading + or further copying of the copies you make or distribute. However, + you may accept compensation in exchange for copies. If you + distribute a large enough number of copies you must also follow the + conditions in section 3. + + You may also lend copies, under the same conditions stated above, + and you may publicly display copies. + + 3. COPYING IN QUANTITY + + If you publish printed copies (or copies in media that commonly + have printed covers) of the Document, numbering more than 100, and + the Document’s license notice requires Cover Texts, you must + enclose the copies in covers that carry, clearly and legibly, all + these Cover Texts: Front-Cover Texts on the front cover, and + Back-Cover Texts on the back cover. Both covers must also clearly + and legibly identify you as the publisher of these copies. The + front cover must present the full title with all words of the title + equally prominent and visible. You may add other material on the + covers in addition. Copying with changes limited to the covers, as + long as they preserve the title of the Document and satisfy these + conditions, can be treated as verbatim copying in other respects. + + If the required texts for either cover are too voluminous to fit + legibly, you should put the first ones listed (as many as fit + reasonably) on the actual cover, and continue the rest onto + adjacent pages. + + If you publish or distribute Opaque copies of the Document + numbering more than 100, you must either include a machine-readable + Transparent copy along with each Opaque copy, or state in or with + each Opaque copy a computer-network location from which the general + network-using public has access to download using public-standard + network protocols a complete Transparent copy of the Document, free + of added material. If you use the latter option, you must take + reasonably prudent steps, when you begin distribution of Opaque + copies in quantity, to ensure that this Transparent copy will + remain thus accessible at the stated location until at least one + year after the last time you distribute an Opaque copy (directly or + through your agents or retailers) of that edition to the public. + + It is requested, but not required, that you contact the authors of + the Document well before redistributing any large number of copies, + to give them a chance to provide you with an updated version of the + Document. + + 4. MODIFICATIONS + + You may copy and distribute a Modified Version of the Document + under the conditions of sections 2 and 3 above, provided that you + release the Modified Version under precisely this License, with the + Modified Version filling the role of the Document, thus licensing + distribution and modification of the Modified Version to whoever + possesses a copy of it. In addition, you must do these things in + the Modified Version: + + A. Use in the Title Page (and on the covers, if any) a title + distinct from that of the Document, and from those of previous + versions (which should, if there were any, be listed in the + History section of the Document). You may use the same title + as a previous version if the original publisher of that + version gives permission. + + B. List on the Title Page, as authors, one or more persons or + entities responsible for authorship of the modifications in + the Modified Version, together with at least five of the + principal authors of the Document (all of its principal + authors, if it has fewer than five), unless they release you + from this requirement. + + C. State on the Title page the name of the publisher of the + Modified Version, as the publisher. + + D. Preserve all the copyright notices of the Document. + + E. Add an appropriate copyright notice for your modifications + adjacent to the other copyright notices. + + F. Include, immediately after the copyright notices, a license + notice giving the public permission to use the Modified + Version under the terms of this License, in the form shown in + the Addendum below. + + G. Preserve in that license notice the full lists of Invariant + Sections and required Cover Texts given in the Document’s + license notice. + + H. Include an unaltered copy of this License. + + I. Preserve the section Entitled “History”, Preserve its Title, + and add to it an item stating at least the title, year, new + authors, and publisher of the Modified Version as given on the + Title Page. If there is no section Entitled “History” in the + Document, create one stating the title, year, authors, and + publisher of the Document as given on its Title Page, then add + an item describing the Modified Version as stated in the + previous sentence. + + J. Preserve the network location, if any, given in the Document + for public access to a Transparent copy of the Document, and + likewise the network locations given in the Document for + previous versions it was based on. These may be placed in the + “History” section. You may omit a network location for a work + that was published at least four years before the Document + itself, or if the original publisher of the version it refers + to gives permission. + + K. For any section Entitled “Acknowledgements” or “Dedications”, + Preserve the Title of the section, and preserve in the section + all the substance and tone of each of the contributor + acknowledgements and/or dedications given therein. + + L. Preserve all the Invariant Sections of the Document, unaltered + in their text and in their titles. Section numbers or the + equivalent are not considered part of the section titles. + + M. Delete any section Entitled “Endorsements”. Such a section + may not be included in the Modified Version. + + N. Do not retitle any existing section to be Entitled + “Endorsements” or to conflict in title with any Invariant + Section. + + O. Preserve any Warranty Disclaimers. + + If the Modified Version includes new front-matter sections or + appendices that qualify as Secondary Sections and contain no + material copied from the Document, you may at your option designate + some or all of these sections as invariant. To do this, add their + titles to the list of Invariant Sections in the Modified Version’s + license notice. These titles must be distinct from any other + section titles. + + You may add a section Entitled “Endorsements”, provided it contains + nothing but endorsements of your Modified Version by various + parties—for example, statements of peer review or that the text has + been approved by an organization as the authoritative definition of + a standard. + + You may add a passage of up to five words as a Front-Cover Text, + and a passage of up to 25 words as a Back-Cover Text, to the end of + the list of Cover Texts in the Modified Version. Only one passage + of Front-Cover Text and one of Back-Cover Text may be added by (or + through arrangements made by) any one entity. If the Document + already includes a cover text for the same cover, previously added + by you or by arrangement made by the same entity you are acting on + behalf of, you may not add another; but you may replace the old + one, on explicit permission from the previous publisher that added + the old one. + + The author(s) and publisher(s) of the Document do not by this + License give permission to use their names for publicity for or to + assert or imply endorsement of any Modified Version. + + 5. COMBINING DOCUMENTS + + You may combine the Document with other documents released under + this License, under the terms defined in section 4 above for + modified versions, provided that you include in the combination all + of the Invariant Sections of all of the original documents, + unmodified, and list them all as Invariant Sections of your + combined work in its license notice, and that you preserve all + their Warranty Disclaimers. + + The combined work need only contain one copy of this License, and + multiple identical Invariant Sections may be replaced with a single + copy. If there are multiple Invariant Sections with the same name + but different contents, make the title of each such section unique + by adding at the end of it, in parentheses, the name of the + original author or publisher of that section if known, or else a + unique number. Make the same adjustment to the section titles in + the list of Invariant Sections in the license notice of the + combined work. + + In the combination, you must combine any sections Entitled + “History” in the various original documents, forming one section + Entitled “History”; likewise combine any sections Entitled + “Acknowledgements”, and any sections Entitled “Dedications”. You + must delete all sections Entitled “Endorsements.” + + 6. COLLECTIONS OF DOCUMENTS + + You may make a collection consisting of the Document and other + documents released under this License, and replace the individual + copies of this License in the various documents with a single copy + that is included in the collection, provided that you follow the + rules of this License for verbatim copying of each of the documents + in all other respects. + + You may extract a single document from such a collection, and + distribute it individually under this License, provided you insert + a copy of this License into the extracted document, and follow this + License in all other respects regarding verbatim copying of that + document. + + 7. AGGREGATION WITH INDEPENDENT WORKS + + A compilation of the Document or its derivatives with other + separate and independent documents or works, in or on a volume of a + storage or distribution medium, is called an “aggregate” if the + copyright resulting from the compilation is not used to limit the + legal rights of the compilation’s users beyond what the individual + works permit. When the Document is included in an aggregate, this + License does not apply to the other works in the aggregate which + are not themselves derivative works of the Document. + + If the Cover Text requirement of section 3 is applicable to these + copies of the Document, then if the Document is less than one half + of the entire aggregate, the Document’s Cover Texts may be placed + on covers that bracket the Document within the aggregate, or the + electronic equivalent of covers if the Document is in electronic + form. Otherwise they must appear on printed covers that bracket + the whole aggregate. + + 8. TRANSLATION + + Translation is considered a kind of modification, so you may + distribute translations of the Document under the terms of section + 4. Replacing Invariant Sections with translations requires special + permission from their copyright holders, but you may include + translations of some or all Invariant Sections in addition to the + original versions of these Invariant Sections. You may include a + translation of this License, and all the license notices in the + Document, and any Warranty Disclaimers, provided that you also + include the original English version of this License and the + original versions of those notices and disclaimers. In case of a + disagreement between the translation and the original version of + this License or a notice or disclaimer, the original version will + prevail. + + If a section in the Document is Entitled “Acknowledgements”, + “Dedications”, or “History”, the requirement (section 4) to + Preserve its Title (section 1) will typically require changing the + actual title. + + 9. TERMINATION + + You may not copy, modify, sublicense, or distribute the Document + except as expressly provided under this License. Any attempt + otherwise to copy, modify, sublicense, or distribute it is void, + and will automatically terminate your rights under this License. + + However, if you cease all violation of this License, then your + license from a particular copyright holder is reinstated (a) + provisionally, unless and until the copyright holder explicitly and + finally terminates your license, and (b) permanently, if the + copyright holder fails to notify you of the violation by some + reasonable means prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is + reinstated permanently if the copyright holder notifies you of the + violation by some reasonable means, this is the first time you have + received notice of violation of this License (for any work) from + that copyright holder, and you cure the violation prior to 30 days + after your receipt of the notice. + + Termination of your rights under this section does not terminate + the licenses of parties who have received copies or rights from you + under this License. If your rights have been terminated and not + permanently reinstated, receipt of a copy of some or all of the + same material does not give you any rights to use it. + + 10. FUTURE REVISIONS OF THIS LICENSE + + The Free Software Foundation may publish new, revised versions of + the GNU Free Documentation License from time to time. Such new + versions will be similar in spirit to the present version, but may + differ in detail to address new problems or concerns. See + . + + Each version of the License is given a distinguishing version + number. If the Document specifies that a particular numbered + version of this License “or any later version” applies to it, you + have the option of following the terms and conditions either of + that specified version or of any later version that has been + published (not as a draft) by the Free Software Foundation. If the + Document does not specify a version number of this License, you may + choose any version ever published (not as a draft) by the Free + Software Foundation. If the Document specifies that a proxy can + decide which future versions of this License can be used, that + proxy’s public statement of acceptance of a version permanently + authorizes you to choose that version for the Document. + + 11. RELICENSING + + “Massive Multiauthor Collaboration Site” (or “MMC Site”) means any + World Wide Web server that publishes copyrightable works and also + provides prominent facilities for anybody to edit those works. A + public wiki that anybody can edit is an example of such a server. + A “Massive Multiauthor Collaboration” (or “MMC”) contained in the + site means any set of copyrightable works thus published on the MMC + site. + + “CC-BY-SA” means the Creative Commons Attribution-Share Alike 3.0 + license published by Creative Commons Corporation, a not-for-profit + corporation with a principal place of business in San Francisco, + California, as well as future copyleft versions of that license + published by that same organization. + + “Incorporate” means to publish or republish a Document, in whole or + in part, as part of another Document. + + An MMC is “eligible for relicensing” if it is licensed under this + License, and if all works that were first published under this + License somewhere other than this MMC, and subsequently + incorporated in whole or in part into the MMC, (1) had no cover + texts or invariant sections, and (2) were thus incorporated prior + to November 1, 2008. + + The operator of an MMC Site may republish an MMC contained in the + site under CC-BY-SA on the same site at any time before August 1, + 2009, provided the MMC is eligible for relicensing. + +ADDENDUM: How to use this License for your documents +==================================================== + +To use this License in a document you have written, include a copy of +the License in the document and put the following copyright and license +notices just after the title page: + + Copyright (C) YEAR YOUR NAME. + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.3 + or any later version published by the Free Software Foundation; + with no Invariant Sections, no Front-Cover Texts, and no Back-Cover + Texts. A copy of the license is included in the section entitled ``GNU + Free Documentation License''. + + If you have Invariant Sections, Front-Cover Texts and Back-Cover +Texts, replace the “with...Texts.” line with this: + + with the Invariant Sections being LIST THEIR TITLES, with + the Front-Cover Texts being LIST, and with the Back-Cover Texts + being LIST. + + If you have Invariant Sections without Cover Texts, or some other +combination of the three, merge those two alternatives to suit the +situation. + + If your document contains nontrivial examples of program code, we +recommend releasing these examples in parallel under your choice of free +software license, such as the GNU General Public License, to permit +their use in free software. + + +File: org, Node: Main Index, Next: Key Index, Prev: GNU Free Documentation License, Up: Top + +D Main Index +************ + +[index] +* Menu: + +* *this*, in post header argument: Results of Evaluation. + (line 272) +* + suffix, in properties: Property Syntax. (line 48) +* _ALL suffix, in properties: Property Syntax. (line 46) +* abbreviation, links: Link Abbreviations. (line 6) +* abstract, in LaTeX export: Special blocks in LaTeX export. + (line 6) +* action, for publishing: Publishing action. (line 6) +* activation: Activation. (line 6) +* active region: Structure Editing. (line 132) +* add-on packages: Add-on Packages. (line 6) +* agenda: Weekly/daily agenda. (line 6) +* agenda dispatcher: Agenda Dispatcher. (line 6) +* agenda files: Agenda Files. (line 6) +* agenda files, removing buffers: Agenda Commands. (line 494) +* agenda filtering: Filtering/limiting agenda times. + (line 17) +* agenda views: Agenda Views. (line 6) +* agenda views, custom: Custom Agenda Views. (line 6) +* agenda views, exporting: Exporting Agenda Views. + (line 6) +* agenda views, exporting <1>: Exporting Agenda Views. + (line 13) +* agenda views, main example: Storing searches. (line 11) +* agenda views, optimization: Speeding Up Your Agendas. + (line 6) +* agenda views, user-defined: Special Agenda Views. + (line 6) +* agenda*, as an agenda views: Storing searches. (line 11) +* agenda, as an agenda views: Storing searches. (line 11) +* agenda, column view: Agenda Column View. (line 6) +* agenda, pipe: Extracting Agenda Information. + (line 6) +* agenda, with block views: Block agenda. (line 6) +* alignment in tables: Column Width and Alignment. + (line 6) +* ALLTAGS, special property: Special Properties. (line 13) +* ALT_TITLE, property: Table of Contents. (line 53) +* ALT_TITLE, property <1>: Headings and sectioning structure. + (line 24) +* angle bracket links: Link Format. (line 6) +* angular brackets, around links: External Links. (line 70) +* anniversaries, from BBDB: Weekly/daily agenda. (line 78) +* API, for mapping: Using the Mapping API. + (line 6) +* API, for properties: Using the Property API. + (line 6) +* APPENDIX, property: Headings and sectioning structure. + (line 20) +* appointment: Timestamps. (line 14) +* appointment <1>: Weekly/daily agenda. (line 125) +* appointment reminders: Weekly/daily agenda. (line 125) +* appt.el: Weekly/daily agenda. (line 125) +* APPT_WARNTIME, keyword: Weekly/daily agenda. (line 125) +* archive locations: Moving subtrees. (line 25) +* ARCHIVE, keyword: Moving subtrees. (line 35) +* ARCHIVE, keyword <1>: In-buffer Settings. (line 15) +* ARCHIVE, property: Property Inheritance. + (line 33) +* ARCHIVE, property <1>: Moving subtrees. (line 37) +* ARCHIVE, tag: Internal archiving. (line 6) +* archived entries, in agenda views: Agenda Views. (line 37) +* archiving: Archiving. (line 6) +* arguments, in code blocks: Environment of a Code Block. + (line 9) +* ASCII export: ASCII/Latin-1/UTF-8 export. + (line 6) +* ASCII, keyword: ASCII/Latin-1/UTF-8 export. + (line 63) +* Atom feeds: RSS Feeds. (line 6) +* attach from Dired: Attachments. (line 79) +* attachments: Attachments. (line 6) +* ATTACH_DIR, property: Attachments. (line 71) +* ATTACH_DIR_INHERIT, property: Attachments. (line 76) +* ATTR_ASCII, keyword: ASCII/Latin-1/UTF-8 export. + (line 74) +* ATTR_BEAMER, keyword: Beamer specific syntax. + (line 35) +* ATTR_HTML, keyword: Links in HTML export. + (line 27) +* ATTR_HTML, keyword <1>: Tables in HTML export. + (line 11) +* ATTR_HTML, keyword <2>: Images in HTML export. + (line 28) +* ATTR_LATEX, keyword: Images in LaTeX export. + (line 6) +* ATTR_LATEX, keyword <1>: Plain lists in LaTeX export. + (line 6) +* ATTR_LATEX, keyword <2>: Source blocks in LaTeX export. + (line 6) +* ATTR_LATEX, keyword <3>: Example blocks in LaTeX export. + (line 6) +* ATTR_LATEX, keyword <4>: Special blocks in LaTeX export. + (line 6) +* ATTR_LATEX, keyword <5>: Horizontal rules in LaTeX export. + (line 6) +* ATTR_ODT, keyword: Tables in ODT export. + (line 20) +* ATTR_ODT, keyword <1>: Images in ODT export. + (line 31) +* ATTR_ODT, keyword <2>: Images in ODT export. + (line 76) +* ATTR_ODT, keyword <3>: Advanced topics in ODT export. + (line 151) +* ATTR_TEXINFO, keyword: Plain lists in Texinfo export. + (line 6) +* ATTR_TEXINFO, keyword <1>: Tables in Texinfo export. + (line 6) +* ATTR_TEXINFO, keyword <2>: Images in Texinfo export. + (line 6) +* ATTR_TEXINFO, keyword <3>: Quotations in Texinfo export. + (line 6) +* ATTR_TEXINFO, keyword <4>: Special blocks in Texinfo export. + (line 6) +* author: Feedback. (line 6) +* AUTHOR, keyword: Export Settings. (line 25) +* author, macro: Macro Replacement. (line 41) +* auto-save, in code block editing: Editing Source Code. (line 11) +* autoload: Activation. (line 6) +* babel, languages: Languages. (line 6) +* babel, library of: Library of Babel. (line 6) +* backtrace of an error: Feedback. (line 66) +* BBDB links: External Links. (line 6) +* BBDB, anniversaries: Weekly/daily agenda. (line 78) +* Beamer export: Beamer Export. (line 6) +* BEAMER, keyword: Beamer specific syntax. + (line 19) +* BEAMER_ACT, property: Frames and Blocks in Beamer. + (line 41) +* BEAMER_COL, property: Frames and Blocks in Beamer. + (line 49) +* BEAMER_ENV, property: Frames and Blocks in Beamer. + (line 14) +* BEAMER_FONT_THEME, keyword: Beamer specific export settings. + (line 17) +* BEAMER_HEADER, keyword: Beamer specific export settings. + (line 26) +* BEAMER_INNER_THEME, keyword: Beamer specific export settings. + (line 20) +* BEAMER_OPT, property: Frames and Blocks in Beamer. + (line 41) +* BEAMER_OUTER_THEME, keyword: Beamer specific export settings. + (line 23) +* BEAMER_REF, property: Frames and Blocks in Beamer. + (line 27) +* BEAMER_THEME, keyword: Beamer specific export settings. + (line 11) +* BEGIN clocktable: The clock table. (line 35) +* BEGIN columnview: Capturing column view. + (line 11) +* BEGIN_CENTER: Paragraphs. (line 32) +* BEGIN_COMMENT: Comment Lines. (line 10) +* BEGIN_EXAMPLE: Literal Examples. (line 10) +* BEGIN_EXPORT ascii: ASCII/Latin-1/UTF-8 export. + (line 63) +* BEGIN_EXPORT beamer: Beamer specific syntax. + (line 19) +* BEGIN_EXPORT html: Quoting HTML tags. (line 14) +* BEGIN_EXPORT latex: Quoting LaTeX code. (line 18) +* BEGIN_EXPORT texinfo: Quoting Texinfo code. + (line 9) +* BEGIN_JUSTIFYLEFT: ASCII/Latin-1/UTF-8 export. + (line 84) +* BEGIN_JUSTIFYRIGHT: ASCII/Latin-1/UTF-8 export. + (line 84) +* BEGIN_QUOTE: Paragraphs. (line 25) +* BEGIN_SRC: Literal Examples. (line 30) +* BEGIN_SRC <1>: Structure of Code Blocks. + (line 6) +* BEGIN_VERSE: Paragraphs. (line 13) +* BIND, keyword: Export Settings. (line 210) +* block agenda: Block agenda. (line 6) +* BLOCKED, special property: Special Properties. (line 13) +* blocking, of checkboxes: Checkboxes. (line 46) +* blocks, folding: Blocks. (line 6) +* bold text, markup rules: Emphasis and Monospace. + (line 6) +* boolean logic, for agenda searches: Matching tags and properties. + (line 32) +* bracket links: Link Format. (line 9) +* bug reports: Feedback. (line 6) +* C-c C-c, overview: The Very Busy C-c C-c Key. + (line 6) +* cache results of code evaluation: Evaluating Code Blocks. + (line 106) +* cache, header argument: Evaluating Code Blocks. + (line 106) +* Calc package: The Spreadsheet. (line 6) +* calc.el: Cooperation. (line 7) +* calculations, in tables: Built-in Table Editor. + (line 167) +* calculations, in tables <1>: The Spreadsheet. (line 6) +* calendar commands, from agenda: Agenda Commands. (line 444) +* calendar integration: Weekly/daily agenda. (line 32) +* calendar, for selecting date: The date/time prompt. + (line 75) +* CALL, keyword: Evaluating Code Blocks. + (line 27) +* CAPTION, keyword: Captions. (line 6) +* CAPTION, keyword <1>: Tables in HTML export. + (line 11) +* CAPTION, keyword <2>: Images in HTML export. + (line 28) +* captions, markup rules: Captions. (line 6) +* capture: Capture Refile Archive. + (line 6) +* capture <1>: Capture. (line 6) +* capture protocol: capture protocol. (line 6) +* capturing, from agenda: Agenda Commands. (line 343) +* category: Categories. (line 6) +* category filtering, in agenda: Filtering/limiting agenda times. + (line 17) +* category, for tags/property match: Matching tags and properties. + (line 64) +* CATEGORY, keyword: Categories. (line 6) +* CATEGORY, keyword <1>: In-buffer Settings. (line 19) +* CATEGORY, property: Property Inheritance. + (line 29) +* CATEGORY, property <1>: Categories. (line 12) +* CDLaTeX: CDLaTeX mode. (line 6) +* cdlatex.el: Cooperation. (line 24) +* center blocks: Paragraphs. (line 32) +* center image in LaTeX export: Images in LaTeX export. + (line 57) +* change agenda display: Agenda Commands. (line 63) +* checkbox blocking: Checkboxes. (line 46) +* checkbox statistics: Checkboxes. (line 30) +* checkboxes: Checkboxes. (line 6) +* checkboxes and TODO dependencies: TODO dependencies. (line 53) +* children, subtree visibility state: Global and local cycling. + (line 6) +* CINDEX, keyword: Indices. (line 6) +* clean outline view: Clean View. (line 6) +* clocking time: Clocking Work Time. (line 6) +* CLOCKSUM, special property: Special Properties. (line 13) +* CLOCKSUM, special property <1>: Agenda Column View. (line 29) +* CLOCKSUM_T, special property: Special Properties. (line 13) +* CLOCKSUM_T, special property <1>: Agenda Column View. (line 53) +* clocktable, dynamic block: The clock table. (line 6) +* CLOCK_MODELINE_TOTAL, property: Clocking commands. (line 20) +* CLOSED, special property: Special Properties. (line 13) +* code block, batch execution: Batch Execution. (line 6) +* code block, editing: Editing Source Code. (line 6) +* code block, evaluating: Evaluating Code Blocks. + (line 6) +* code block, exporting: Exporting Code Blocks. + (line 6) +* code block, extracting source code: Extracting Source Code. + (line 6) +* code block, key bindings: Key bindings and Useful Functions. + (line 6) +* code block, languages: Languages. (line 6) +* code block, library: Library of Babel. (line 6) +* code block, Noweb reference: Noweb Reference Syntax. + (line 6) +* code block, results of evaluation: Results of Evaluation. + (line 6) +* code block, structure: Structure of Code Blocks. + (line 6) +* code line references, markup rules: Literal Examples. (line 6) +* code text, markup rules: Emphasis and Monospace. + (line 6) +* colnames, header argument: Environment of a Code Block. + (line 48) +* column formula: Column formulas. (line 6) +* column view, for properties: Defining columns. (line 6) +* column view, in agenda: Agenda Column View. (line 6) +* column, of field coordinates: References. (line 89) +* COLUMNS, keyword: Scope of column definitions. + (line 8) +* COLUMNS, property: Property Inheritance. + (line 22) +* COLUMNS, property <1>: In-buffer Settings. (line 23) +* commands, in agenda buffer: Agenda Commands. (line 6) +* comment block: Comment Lines. (line 10) +* comment lines: Comment Lines. (line 6) +* comment trees: Comment Lines. (line 13) +* commented entries, in agenda views: Agenda Views. (line 37) +* comments, header argument: Extracting Source Code. + (line 46) +* completion, of dictionary words: Completion. (line 6) +* completion, of file names: Handling Links. (line 92) +* completion, of link abbreviations: Completion. (line 6) +* completion, of links: Handling Links. (line 69) +* completion, of option keywords: Per-file keywords. (line 26) +* completion, of option keywords <1>: Completion. (line 6) +* completion, of property keys: Completion. (line 6) +* completion, of tags: Setting Tags. (line 11) +* completion, of tags <1>: Completion. (line 6) +* completion, of TeX symbols: Completion. (line 6) +* completion, of TODO keywords: Workflow states. (line 17) +* completion, of TODO keywords <1>: Completion. (line 6) +* concept index, in Texinfo export: Indices. (line 6) +* constants, in calculations: References. (line 113) +* CONSTANTS, keyword: References. (line 113) +* CONSTANTS, keyword <1>: In-buffer Settings. (line 28) +* constants.el: Cooperation. (line 14) +* contents, global visibility state: Global and local cycling. + (line 20) +* continuous clocking: Resolving idle time. (line 78) +* control code block evaluation: Evaluating Code Blocks. + (line 81) +* convert: Advanced topics in ODT export. + (line 12) +* converter: Advanced topics in ODT export. + (line 12) +* COOKIE_DATA, property: Breaking Down Tasks. (line 21) +* COOKIE_DATA, property <1>: Checkboxes. (line 30) +* coordinates, of field: References. (line 89) +* copying notes: Refile and Copy. (line 6) +* copying, of subtrees: Structure Editing. (line 6) +* COPYING, property: Texinfo title and copyright page. + (line 19) +* countdown timer: Timers. (line 6) +* counter, macro: Macro Replacement. (line 75) +* CREATOR, keyword: Export Settings. (line 28) +* CSS, for HTML export: CSS support. (line 6) +* cua.el: Conflicts. (line 17) +* custom agenda views: Custom Agenda Views. (line 6) +* custom date/time format: Custom time format. (line 6) +* custom search strings: Custom Searches. (line 6) +* customization: Customization. (line 6) +* CUSTOM_ID, property: Internal Links. (line 6) +* CUSTOM_ID, property <1>: Handling Links. (line 21) +* cutting, of subtrees: Structure Editing. (line 6) +* cycling, in plain lists: Plain Lists. (line 70) +* cycling, of agenda files: Agenda Files. (line 26) +* cycling, of TODO states: TODO Basics. (line 14) +* cycling, visibility: Visibility Cycling. (line 6) +* daily agenda: Weekly/daily agenda. (line 6) +* dash, special symbol: Special Symbols. (line 36) +* data type index, in Texinfo export: Indices. (line 6) +* date format, custom: Custom time format. (line 6) +* date range: Timestamps. (line 42) +* date stamp: Dates and Times. (line 6) +* date stamps: Timestamps. (line 6) +* date tree: Using capture. (line 7) +* DATE, keyword: Export Settings. (line 32) +* date, macro: Macro Replacement. (line 49) +* date, reading in minibuffer: The date/time prompt. + (line 6) +* dates: Dates and Times. (line 6) +* DEADLINE marker: Deadlines and Scheduling. + (line 11) +* DEADLINE, special property: Special Properties. (line 13) +* deadlines: Timestamps. (line 6) +* debugging, of table formulas: Editing and debugging formulas. + (line 132) +* default header arguments per language: Using Header Arguments. + (line 36) +* defining new protocols: Protocols. (line 25) +* demotion, of subtrees: Structure Editing. (line 6) +* dependencies, of TODO states: TODO dependencies. (line 6) +* DESCRIPTION, keyword: Beamer specific export settings. + (line 30) +* DESCRIPTION, keyword <1>: HTML specific export settings. + (line 10) +* DESCRIPTION, keyword <2>: LaTeX specific export settings. + (line 11) +* DESCRIPTION, keyword <3>: ODT specific export settings. + (line 11) +* DESCRIPTION, property: Headings and sectioning structure. + (line 24) +* DESCRIPTION, property <1>: iCalendar Export. (line 51) +* diary entries, creating from agenda: Agenda Commands. (line 453) +* diary integration: Weekly/daily agenda. (line 32) +* diary style timestamps: Timestamps. (line 34) +* dictionary word completion: Completion. (line 6) +* dir file, in Texinfo export: Info directory file. (line 6) +* dir, header argument: Environment of a Code Block. + (line 302) +* directories, for publishing: Sources and destinations. + (line 6) +* dispatcher, for export commands: The Export Dispatcher. + (line 6) +* dispatching agenda commands: Agenda Dispatcher. (line 6) +* display changing, in agenda: Agenda Commands. (line 63) +* doc, docx, rtf: Advanced topics in ODT export. + (line 12) +* document structure: Document Structure. (line 6) +* document title: Export Settings. (line 60) +* documentation: Documentation Access. + (line 6) +* DONE, final TODO keyword: Per-file keywords. (line 29) +* drawer, for properties: Property Syntax. (line 6) +* drawer, for state change recording: Tracking TODO state changes. + (line 6) +* drawers: Drawers. (line 6) +* duration, computing: Durations and time values. + (line 6) +* dvipng: Math formatting in HTML export. + (line 6) +* dvipng <1>: LaTeX math snippets. (line 50) +* dvisvgm: Math formatting in HTML export. + (line 6) +* dvisvgm <1>: LaTeX math snippets. (line 50) +* dynamic blocks: Dynamic Blocks. (line 6) +* dynamic indentation: Clean View. (line 6) +* ecomplete.el: Conflicts. (line 32) +* editing tables: Tables. (line 6) +* editing, of table formulas: Editing and debugging formulas. + (line 6) +* edits, catching invisible: Catching invisible edits. + (line 6) +* effort estimates: Effort Estimates. (line 6) +* effort filtering, in agenda: Filtering/limiting agenda times. + (line 17) +* EFFORT, property: Effort Estimates. (line 6) +* Elisp links: External Links. (line 6) +* ellipsis, special symbol: Special Symbols. (line 36) +* ELPA: Activation. (line 6) +* EMAIL, keyword: Export Settings. (line 35) +* email, macro: Macro Replacement. (line 41) +* embedding images in ODT: Images in ODT export. + (line 6) +* entities: Special Symbols. (line 6) +* epilogue, header argument: Environment of a Code Block. + (line 350) +* escape character: Escape Character. (line 6) +* escape syntax, for links: Link Format. (line 17) +* eval, header argument: Evaluating Code Blocks. + (line 81) +* evaluate time range: Creating Timestamps. (line 62) +* example block: Literal Examples. (line 10) +* example blocks, in LaTeX export: Example blocks in LaTeX export. + (line 6) +* EXCLUDE_TAGS, keyword: Export Settings. (line 52) +* excluding entries from table of contents: Table of Contents. + (line 15) +* export back-end: Exporting. (line 12) +* export, dispatcher: The Export Dispatcher. + (line 6) +* export, include files: Include Files. (line 6) +* export, OpenDocument: OpenDocument Text Export. + (line 6) +* Export, settings: Export Settings. (line 6) +* Export, writing back-ends: Adding Export Back-ends. + (line 6) +* exporting: Exporting. (line 6) +* exporting agenda views: Exporting Agenda Views. + (line 13) +* exporting, not: Comment Lines. (line 6) +* exports, header argument: Exporting Code Blocks. + (line 14) +* EXPORT_FILE_NAME, keyword: Export Settings. (line 64) +* EXPORT_FILE_NAME, property: ODT export commands. (line 9) +* EXPORT_LATEX_CLASS, property: LaTeX header and sectioning. + (line 23) +* EXPORT_LATEX_CLASS_OPTIONS, property: LaTeX header and sectioning. + (line 23) +* extended TODO keywords: TODO Extensions. (line 6) +* external archiving: Moving subtrees. (line 6) +* external links: External Links. (line 6) +* external links, in HTML export: Links in HTML export. + (line 6) +* faces, for TODO keywords: Faces for TODO keywords. + (line 6) +* FAQ: Summary. (line 49) +* feedback: Feedback. (line 6) +* field coordinates: References. (line 89) +* field formula: Field and range formulas. + (line 6) +* field references: References. (line 15) +* file links: External Links. (line 6) +* file links, searching: Search Options. (line 6) +* file name completion: Handling Links. (line 92) +* file, header argument: Results of Evaluation. + (line 152) +* FILE, special property: Special Properties. (line 13) +* file-desc, header argument: Results of Evaluation. + (line 173) +* file-ext, header argument: Results of Evaluation. + (line 162) +* files for agenda: Agenda Files. (line 6) +* files, adding to agenda list: Agenda Files. (line 16) +* files, selecting for publishing: Selecting files. (line 6) +* FILETAGS, keyword: Tag Inheritance. (line 20) +* FILETAGS, keyword <1>: In-buffer Settings. (line 34) +* filladapt.el: Conflicts. (line 43) +* filtering entries, in agenda: Filtering/limiting agenda times. + (line 17) +* Filters, exporting: Advanced Export Configuration. + (line 31) +* FINDEX, keyword: Indices. (line 6) +* FLAGGED, tag: Pulling from the mobile application. + (line 18) +* folded, subtree visibility state: Global and local cycling. + (line 6) +* folding, sparse trees: Sparse Trees. (line 6) +* following links: Handling Links. (line 102) +* footers, in code blocks: Environment of a Code Block. + (line 342) +* footnotes: Creating Footnotes. (line 6) +* format specifier, in spreadsheet: Formula syntax for Calc. + (line 17) +* format, of links: Link Format. (line 6) +* formatting source code, markup rules: Literal Examples. (line 23) +* formula debugging: Editing and debugging formulas. + (line 132) +* formula editing: Editing and debugging formulas. + (line 6) +* formula syntax, Calc: Formula syntax for Calc. + (line 6) +* formula, for individual table field: Field and range formulas. + (line 6) +* formula, for range of fields: Field and range formulas. + (line 6) +* formula, for table column: Column formulas. (line 6) +* formula, in tables: Built-in Table Editor. + (line 167) +* function index, in Texinfo export: Indices. (line 6) +* global cycling: Global and local cycling. + (line 20) +* global key bindings: Activation. (line 6) +* global TODO list: Global TODO list. (line 6) +* global visibility states: Global and local cycling. + (line 20) +* Gnus links: External Links. (line 6) +* graph, in tables: Org Plot. (line 6) +* group tags: Tag Hierarchy. (line 6) +* group tags, as regular expressions: Matching tags and properties. + (line 57) +* grouping columns in tables: Column Groups. (line 6) +* habits: Tracking your habits. + (line 6) +* hacking: Hacking. (line 6) +* header arguments per language: Using Header Arguments. + (line 74) +* header arguments, in code blocks: Structure of Code Blocks. + (line 57) +* header lines, in tables: Built-in Table Editor. + (line 6) +* header, for LaTeX files: LaTeX header and sectioning. + (line 6) +* HEADER, keyword: Using Header Arguments. + (line 114) +* headers, in code blocks: Environment of a Code Block. + (line 342) +* headline navigation: Motion. (line 6) +* headline tagging: Tags. (line 6) +* headline, promotion and demotion: Structure Editing. (line 6) +* headlines: Headlines. (line 6) +* hide text: Visibility Cycling. (line 6) +* hiding leading stars: Clean View. (line 6) +* hlines, header argument: Results of Evaluation. + (line 102) +* hooks: Hooks (2). (line 6) +* horizontal rule, in tables: Built-in Table Editor. + (line 6) +* horizontal rules, in ASCII export: ASCII/Latin-1/UTF-8 export. + (line 74) +* horizontal rules, in LaTeX export: Horizontal rules in LaTeX export. + (line 6) +* horizontal rules, markup rules: Horizontal Rules. (line 6) +* HTML export: HTML Export. (line 6) +* HTML export, CSS: CSS support. (line 6) +* HTML, and Orgtbl mode: Translator functions. + (line 6) +* HTML, keyword: Quoting HTML tags. (line 14) +* html-style, OPTIONS item: CSS support. (line 56) +* HTML5, export new elements: HTML doctypes. (line 25) +* HTML_CONTAINER, keyword: HTML specific export settings. + (line 19) +* HTML_CONTAINER_CLASS, property: CSS support. (line 62) +* HTML_DOCTYPE, keyword: HTML specific export settings. + (line 16) +* HTML_HEAD, keyword: HTML specific export settings. + (line 35) +* HTML_HEAD, keyword <1>: CSS support. (line 49) +* HTML_HEAD_EXTRA, keyword: HTML specific export settings. + (line 39) +* HTML_HEAD_EXTRA, keyword <1>: CSS support. (line 49) +* HTML_INCLUDE_STYLE, keyword: CSS support. (line 44) +* HTML_LINK_HOME, keyword: HTML specific export settings. + (line 23) +* HTML_LINK_UP, keyword: HTML specific export settings. + (line 26) +* HTML_MATHJAX, keyword: HTML specific export settings. + (line 30) +* hyperlinks: Hyperlinks. (line 6) +* hyperlinks, adding new types: Adding Hyperlink Types. + (line 6) +* iCalendar export: iCalendar Export. (line 6) +* ID, property: Handling Links. (line 21) +* ID, property <1>: Capturing column view. + (line 34) +* ID, property <2>: iCalendar Export. (line 26) +* identify, ImageMagick: Images in ODT export. + (line 34) +* idle, resolve, dangling: Resolving idle time. (line 9) +* image, centering in LaTeX export: Images in LaTeX export. + (line 57) +* ImageMagick: Math formatting in HTML export. + (line 6) +* ImageMagick <1>: LaTeX math snippets. (line 50) +* images, embedding in ODT: Images in ODT export. + (line 6) +* images, inline in HTML: Images in HTML export. + (line 6) +* images, inline in LaTeX: Images in LaTeX export. + (line 6) +* images, markup rules: Images. (line 6) +* imenu.el: Cooperation. (line 29) +* in-buffer settings: In-buffer Settings. (line 6) +* inactive timestamp: Timestamps. (line 50) +* include files, during export: Include Files. (line 6) +* INCLUDE, keyword: Include Files. (line 6) +* Indent mode: Clean View. (line 20) +* indentation, in code blocks: Editing Source Code. (line 32) +* indentation, in source blocks: Literal Examples. (line 73) +* index, in a publishing project: Generating an index. (line 6) +* INDEX, keyword: Generating an index. (line 17) +* INDEX, property: Indices. (line 14) +* Info: Documentation Access. + (line 6) +* Info directory file, in Texinfo export: Info directory file. + (line 6) +* Info links: External Links. (line 6) +* INFOJS_OPT, keyword: JavaScript support. (line 20) +* inheritance, of properties: Property Inheritance. + (line 6) +* inheritance, of tags: Tag Inheritance. (line 6) +* inline, in LaTeX export: Quoting LaTeX code. (line 10) +* inlining images: Images. (line 6) +* inlining images in HTML: Images in HTML export. + (line 6) +* inlining images in LaTeX: Images in LaTeX export. + (line 6) +* input-file, macro: Macro Replacement. (line 64) +* inserting links: Handling Links. (line 69) +* insertion, of templates: Structure Templates. (line 6) +* insertion, of templates <1>: Structure Templates. (line 21) +* install-info, in Texinfo export: Info directory file. (line 6) +* installation: Installation. (line 6) +* Installing Org protocol: Protocols. (line 14) +* internal links: Internal Links. (line 6) +* internal links, in HTML export: Links in HTML export. + (line 6) +* introduction: Introduction. (line 6) +* irc links: External Links. (line 6) +* italic text, markup rules: Emphasis and Monospace. + (line 6) +* ITEM, special property: Special Properties. (line 13) +* jumping, to headlines: Motion. (line 6) +* key bindings, global: Activation. (line 6) +* keystroke index, in Texinfo export: Indices. (line 6) +* keyword options: Per-file keywords. (line 6) +* keyword, macro: Macro Replacement. (line 41) +* KEYWORDS, keyword: Beamer specific export settings. + (line 37) +* KEYWORDS, keyword <1>: HTML specific export settings. + (line 43) +* KEYWORDS, keyword <2>: LaTeX specific export settings. + (line 54) +* KEYWORDS, keyword <3>: ODT specific export settings. + (line 16) +* KINDEX, keyword: Indices. (line 6) +* language specific default header arguments: Using Header Arguments. + (line 36) +* language specific header arguments properties: Using Header Arguments. + (line 74) +* language, in code blocks: Structure of Code Blocks. + (line 47) +* LANGUAGE, keyword: Export Settings. (line 38) +* LANGUAGE, keyword <1>: LaTeX specific export settings. + (line 20) +* LAST_REPEAT, property: Clocking commands. (line 20) +* LaTeX class: LaTeX header and sectioning. + (line 6) +* LaTeX export: LaTeX Export. (line 6) +* LaTeX fragments: LaTeX fragments. (line 6) +* LaTeX fragments, preview: Previewing LaTeX fragments. + (line 6) +* LaTeX header: LaTeX header and sectioning. + (line 6) +* LaTeX interpretation: Embedded LaTeX. (line 6) +* LaTeX sectioning structure: LaTeX header and sectioning. + (line 6) +* LaTeX, and Orgtbl mode: A LaTeX example. (line 6) +* LATEX, keyword: Quoting LaTeX code. (line 14) +* LATEX_CLASS, keyword: LaTeX specific export settings. + (line 32) +* LATEX_CLASS, keyword <1>: LaTeX header and sectioning. + (line 23) +* LATEX_CLASS_OPTIONS, keyword: LaTeX specific export settings. + (line 40) +* LATEX_CLASS_OPTIONS, keyword <1>: LaTeX header and sectioning. + (line 23) +* LATEX_COMPILER, keyword: LaTeX/PDF export commands. + (line 25) +* LATEX_COMPILER, keyword <1>: LaTeX specific export settings. + (line 44) +* LATEX_HEADER, keyword: HTML specific export settings. + (line 48) +* LATEX_HEADER, keyword <1>: LaTeX specific export settings. + (line 49) +* LATEX_HEADER, keyword <2>: LaTeX header and sectioning. + (line 30) +* LATEX_HEADER_EXTRA, keyword: LaTeX specific export settings. + (line 49) +* LATEX_HEADER_EXTRA, keyword <1>: LaTeX header and sectioning. + (line 30) +* Latin-1 export: ASCII/Latin-1/UTF-8 export. + (line 6) +* level, for tags/property match: Matching tags and properties. + (line 64) +* LibreOffice: OpenDocument Text Export. + (line 6) +* limits, in agenda: Filtering/limiting agenda times. + (line 111) +* line breaks, markup rules: Paragraphs. (line 9) +* lines, include: Include Files. (line 36) +* link abbreviations: Link Abbreviations. (line 6) +* link abbreviations, completion of: Completion. (line 6) +* link completion: Handling Links. (line 69) +* link format: Link Format. (line 6) +* LINK, keyword: Link Abbreviations. (line 50) +* LINK, keyword <1>: In-buffer Settings. (line 38) +* links, external: External Links. (line 6) +* links, finding next/previous: Handling Links. (line 151) +* links, handling: Handling Links. (line 6) +* links, in HTML export: Links in HTML export. + (line 6) +* links, in ODT export: Links in ODT export. (line 6) +* links, internal: Internal Links. (line 6) +* links, publishing: Publishing links. (line 6) +* links, radio targets: Radio Targets. (line 6) +* links, returning to: Handling Links. (line 144) +* linter: Org Syntax. (line 24) +* Lisp forms, as table formulas: Formula syntax for Lisp. + (line 6) +* list of listings: Table of Contents. (line 6) +* list of tables: Table of Contents. (line 6) +* lists, in other modes: Tables in Arbitrary Syntax. + (line 6) +* lists, ordered: Plain Lists. (line 6) +* lists, plain: Plain Lists. (line 6) +* literal examples, markup rules: Literal Examples. (line 6) +* LOCATION, property: iCalendar Export. (line 51) +* logging, of progress: Progress Logging. (line 6) +* LOGGING, property: Tracking TODO state changes. + (line 46) +* LOGGING, property <1>: Property Inheritance. + (line 37) +* LOG_INTO_DRAWER, property: Tracking TODO state changes. + (line 6) +* LOG_INTO_DRAWER, property <1>: Clocking commands. (line 7) +* lookup functions in tables: Lookup functions. (line 6) +* lualatex: LaTeX/PDF export commands. + (line 25) +* macro replacement, during export: Macro Replacement. (line 6) +* MACRO, keyword: Macro Replacement. (line 6) +* maintainer: Feedback. (line 6) +* mapping entries, API: Using the Mapping API. + (line 6) +* mappings in open-source protocol: open-source protocol. + (line 67) +* mark ring: Handling Links. (line 139) +* Markdown export: Markdown Export. (line 6) +* marking characters, tables: Advanced features. (line 39) +* match view: Matching tags and properties. + (line 6) +* matching, of properties: Matching tags and properties. + (line 6) +* matching, of tags: Matching tags and properties. + (line 6) +* matching, tags: Tags. (line 6) +* math symbols: Special Symbols. (line 6) +* MathJax: Math formatting in HTML export. + (line 6) +* MathML: LaTeX math snippets. (line 10) +* MH-E links: External Links. (line 6) +* minlevel, include: Include Files. (line 22) +* minor mode for tables: Orgtbl Mode. (line 6) +* mkdirp, header argument: Extracting Source Code. + (line 42) +* mode, for Calc: Formula syntax for Calc. + (line 17) +* modification-time, macro: Macro Replacement. (line 56) +* motion commands in agenda: Agenda Commands. (line 19) +* motion, between headlines: Motion. (line 6) +* multiple formula lines: Editing and debugging formulas. + (line 98) +* multiple items in Texinfo lists: Plain lists in Texinfo export. + (line 17) +* n, macro: Macro Replacement. (line 75) +* NAME keyword, in source blocks: Structure of Code Blocks. + (line 6) +* NAME, keyword: References. (line 134) +* NAME, keyword <1>: Internal Links. (line 21) +* name, of column or field: References. (line 113) +* name, of column or field <1>: References. (line 134) +* named references: References. (line 113) +* names as TODO keywords: TODO types. (line 6) +* narrow columns in tables: Column Width and Alignment. + (line 6) +* no-expand, header argument: Extracting Source Code. + (line 97) +* NOBLOCKING, property: TODO dependencies. (line 29) +* noweb, header argument: Noweb Reference Syntax. + (line 13) +* noweb-ref, header argument: Noweb Reference Syntax. + (line 118) +* noweb-sep, header argument: Noweb Reference Syntax. + (line 150) +* occur, command: Sparse Trees. (line 6) +* occur-tree: Storing searches. (line 11) +* odd-levels-only outlines: Clean View. (line 6) +* ODT: OpenDocument Text Export. + (line 6) +* ODT, keyword: Advanced topics in ODT export. + (line 120) +* ODT_STYLES_FILE, keyword: ODT specific export settings. + (line 22) +* ODT_STYLES_FILE, keyword <1>: Applying custom styles. + (line 29) +* only-contents, include: Include Files. (line 53) +* open-source protocol: open-source protocol. + (line 6) +* OpenDocument: OpenDocument Text Export. + (line 6) +* option keyword completion: Completion. (line 6) +* options, for custom agenda views: Setting options. (line 6) +* options, for customization: Customization. (line 6) +* options, for export: Export Settings. (line 6) +* options, for publishing: Publishing options. (line 6) +* OPTIONS, keyword: Export Settings. (line 6) +* ordered lists: Plain Lists. (line 6) +* ORDERED, property: TODO dependencies. (line 6) +* ORDERED, property <1>: Checkboxes. (line 46) +* Org export: Org Export. (line 6) +* Org mode, turning on: Activation. (line 24) +* Org protocol, set-up: Protocols. (line 14) +* org-agenda, command: Weekly/daily agenda. (line 10) +* Orgtbl mode: Orgtbl Mode. (line 6) +* Orgtbl mode <1>: Tables in Arbitrary Syntax. + (line 6) +* ORGTBL, keyword: Radio tables. (line 21) +* outline tree: Headlines. (line 6) +* output-dir, header argument: Results of Evaluation. + (line 152) +* overview, global visibility state: Global and local cycling. + (line 20) +* packages, interaction with other: Interaction. (line 6) +* padline, header argument: Extracting Source Code. + (line 73) +* paragraphs, markup rules: Paragraphs. (line 6) +* passing arguments to code blocks: Environment of a Code Block. + (line 9) +* pasting, of subtrees: Structure Editing. (line 6) +* PDF export: LaTeX Export. (line 6) +* pdflatex: LaTeX/PDF export commands. + (line 25) +* per-file keywords: Per-file keywords. (line 6) +* PINDEX, keyword: Indices. (line 6) +* plain links: Link Format. (line 6) +* plain lists: Plain Lists. (line 6) +* plain lists, in LaTeX export: Plain lists in LaTeX export. + (line 6) +* plain text external links: External Links. (line 70) +* plot tables using Gnuplot: Org Plot. (line 6) +* PLOT, keyword: Org Plot. (line 12) +* post, header argument: Results of Evaluation. + (line 272) +* presentation, of agenda items: Presentation and Sorting. + (line 6) +* print edition: Summary. (line 54) +* printing sparse trees: Sparse Trees. (line 52) +* priorities: Priorities. (line 6) +* PRIORITIES, keyword: Priorities. (line 44) +* PRIORITIES, keyword <1>: In-buffer Settings. (line 43) +* priorities, of agenda items: Sorting of agenda items. + (line 6) +* priority cookie: Priorities. (line 6) +* PRIORITY, special property: Special Properties. (line 13) +* program index, in Texinfo export: Indices. (line 6) +* progress logging: Progress Logging. (line 6) +* projects, for publishing: Project alist. (line 6) +* prologue, header argument: Environment of a Code Block. + (line 342) +* promotion, of subtrees: Structure Editing. (line 6) +* proof, in LaTeX export: Special blocks in LaTeX export. + (line 6) +* properties: Properties and Columns. + (line 6) +* properties, API: Using the Property API. + (line 6) +* properties, column view: Defining columns. (line 6) +* properties, inheritance: Property Inheritance. + (line 6) +* properties, searching: Property Searches. (line 6) +* properties, special: Special Properties. (line 6) +* property syntax: Property Syntax. (line 6) +* PROPERTY, keyword: Property Syntax. (line 46) +* PROPERTY, keyword <1>: In-buffer Settings. (line 48) +* property, macro: Macro Replacement. (line 68) +* protocol, capture: capture protocol. (line 6) +* protocol, new protocol: Protocols. (line 25) +* protocol, open-source: open-source protocol. + (line 6) +* protocol, open-source rewritten URL: open-source protocol. + (line 32) +* protocol, open-source, set-up mapping: open-source protocol. + (line 67) +* protocol, store-link: store-link protocol. (line 6) +* protocols, for external access: Protocols. (line 6) +* publishing: Publishing. (line 6) +* publishing options: Publishing options. (line 6) +* query editing, in agenda: Filtering/limiting agenda times. + (line 17) +* quote blocks: Paragraphs. (line 25) +* radio tables: Radio tables. (line 6) +* radio targets: Radio Targets. (line 6) +* range formula: Field and range formulas. + (line 6) +* range references: References. (line 64) +* ranges, time: Timestamps. (line 6) +* recomputing table fields: Updating the table. (line 6) +* references: References. (line 6) +* references, named: References. (line 113) +* references, remote: References. (line 134) +* references, to a different table: References. (line 134) +* references, to fields: References. (line 15) +* references, to ranges: References. (line 64) +* refiling notes: Refile and Copy. (line 6) +* refresh set-up: In-buffer Settings. (line 11) +* region, active: Structure Editing. (line 132) +* regular expressions, with tags search: Matching tags and properties. + (line 53) +* relative timer: Timers. (line 6) +* reminders: Weekly/daily agenda. (line 125) +* remote editing, bulk, from agenda: Agenda Commands. (line 350) +* remote editing, from agenda: Agenda Commands. (line 223) +* remote editing, undo: Agenda Commands. (line 227) +* remote references: References. (line 134) +* repeated tasks: Repeated tasks. (line 6) +* report, of clocked time: The clock table. (line 6) +* reporting a bug: Feedback. (line 6) +* resolve idle time: Resolving idle time. (line 9) +* results, header argument: Results of Evaluation. + (line 6) +* RESULTS, keyword: Evaluating Code Blocks. + (line 6) +* results, macro: Macro Replacement. (line 84) +* revealing context: Global and local cycling. + (line 42) +* rewritten URL in open-source protocol: open-source protocol. + (line 32) +* Rmail links: External Links. (line 6) +* row separator, in tables: Built-in Table Editor. + (line 6) +* row, of field coordinates: References. (line 89) +* rownames, header argument: Environment of a Code Block. + (line 73) +* RSS feeds: RSS Feeds. (line 6) +* rsync: Uploading Files. (line 6) +* SCHEDULED marker: Deadlines and Scheduling. + (line 31) +* SCHEDULED, special property: Special Properties. (line 13) +* scheduling: Timestamps. (line 6) +* scripts, for agenda processing: Extracting Agenda Information. + (line 6) +* search option in file links: Search Options. (line 6) +* search strings, custom: Custom Searches. (line 6) +* search view: Search view. (line 6) +* searching for tags: Tag Searches. (line 6) +* searching, for text: Search view. (line 6) +* searching, of properties: Property Searches. (line 6) +* sectioning structure, for LaTeX export: LaTeX header and sectioning. + (line 6) +* SELECT_TAGS, keyword: Export Settings. (line 44) +* sep, header argument: Results of Evaluation. + (line 178) +* SEQ_TODO, keyword: Per-file keywords. (line 6) +* SEQ_TODO, keyword <1>: In-buffer Settings. (line 265) +* session, header argument: Environment of a Code Block. + (line 272) +* setting tags: Setting Tags. (line 6) +* SETUPFILE, keyword: Export Settings. (line 13) +* SETUPFILE, keyword <1>: In-buffer Settings. (line 53) +* sexp timestamps: Timestamps. (line 34) +* shebang, header argument: Extracting Source Code. + (line 83) +* shell links: External Links. (line 6) +* shift-selection-mode: Plain Lists. (line 95) +* shift-selection-mode <1>: Conflicts. (line 6) +* show all, command: Global and local cycling. + (line 39) +* show all, global visibility state: Global and local cycling. + (line 20) +* show branches, command: Global and local cycling. + (line 51) +* show children, command: Global and local cycling. + (line 55) +* show hidden text: Visibility Cycling. (line 6) +* shy hyphen, special symbol: Special Symbols. (line 36) +* sitemap, of published pages: Site map. (line 6) +* smartphone: Org Mobile. (line 6) +* sorting, of agenda items: Sorting of agenda items. + (line 6) +* sorting, of plain list: Plain Lists. (line 159) +* sorting, of subtrees: Structure Editing. (line 6) +* source block: Literal Examples. (line 30) +* source blocks, in LaTeX export: Source blocks in LaTeX export. + (line 6) +* source code, batch execution: Batch Execution. (line 6) +* source code, block structure: Structure of Code Blocks. + (line 6) +* source code, editing: Editing Source Code. (line 6) +* source code, evaluating: Evaluating Code Blocks. + (line 6) +* source code, exporting: Exporting Code Blocks. + (line 6) +* source code, extracting: Extracting Source Code. + (line 6) +* source code, inline: Structure of Code Blocks. + (line 24) +* source code, languages: Languages. (line 6) +* source code, library: Library of Babel. (line 6) +* source code, Noweb reference: Noweb Reference Syntax. + (line 6) +* source code, results of evaluation: Results of Evaluation. + (line 6) +* source code, working with: Working with Source Code. + (line 6) +* sparse tree, for deadlines: Inserting deadline/schedule. + (line 26) +* sparse tree, for TODO: TODO Basics. (line 41) +* sparse tree, tag based: Tags. (line 6) +* sparse trees: Sparse Trees. (line 6) +* special blocks, in ASCII export: ASCII/Latin-1/UTF-8 export. + (line 84) +* special blocks, in LaTeX export: Special blocks in LaTeX export. + (line 6) +* special keywords: In-buffer Settings. (line 6) +* special symbols: Special Symbols. (line 6) +* special symbols, in-buffer display: Special Symbols. (line 27) +* speed keys: Speed Keys. (line 6) +* speedbar.el: Cooperation. (line 41) +* spreadsheet capabilities: The Spreadsheet. (line 6) +* square brackets in links: Link Format. (line 17) +* square brackets, around links: External Links. (line 70) +* startup visibility: Global and local cycling. + (line 35) +* STARTUP, keyword: Initial visibility. (line 12) +* STARTUP, keyword <1>: Blocks. (line 14) +* STARTUP, keyword <2>: In-buffer Settings. (line 65) +* statistics, for checkboxes: Checkboxes. (line 30) +* statistics, for TODO items: Breaking Down Tasks. (line 6) +* store-link protocol: store-link protocol. (line 6) +* storing link, in a source code buffer: Literal Examples. (line 99) +* storing links: Handling Links. (line 9) +* strike-through text, markup rules: Emphasis and Monospace. + (line 6) +* structure editing: Structure Editing. (line 6) +* structure of document: Document Structure. (line 6) +* STYLE, property: Tracking your habits. + (line 6) +* styles, custom: Applying custom styles. + (line 6) +* styles, custom <1>: Advanced topics in ODT export. + (line 34) +* SUBAUTHOR, keyword: Texinfo specific export settings. + (line 14) +* SUBAUTHOR, keyword <1>: Texinfo title and copyright page. + (line 12) +* sublevels, inclusion into tags match: Tag Inheritance. (line 6) +* sublevels, inclusion into TODO list: Global TODO list. (line 38) +* subscript: Subscripts and Superscripts. + (line 6) +* SUBTITLE, keyword: ASCII/Latin-1/UTF-8 export. + (line 46) +* SUBTITLE, keyword <1>: Beamer specific export settings. + (line 44) +* SUBTITLE, keyword <2>: HTML specific export settings. + (line 53) +* SUBTITLE, keyword <3>: LaTeX specific export settings. + (line 63) +* SUBTITLE, keyword <4>: ODT specific export settings. + (line 26) +* SUBTITLE, keyword <5>: Texinfo specific export settings. + (line 11) +* subtree cycling: Global and local cycling. + (line 6) +* subtree visibility states: Global and local cycling. + (line 6) +* subtree, cut and paste: Structure Editing. (line 6) +* subtree, subtree visibility state: Global and local cycling. + (line 6) +* subtrees, cut and paste: Structure Editing. (line 6) +* summary: Summary. (line 6) +* SUMMARY, property: iCalendar Export. (line 51) +* superscript: Subscripts and Superscripts. + (line 6) +* switches, in code blocks: Structure of Code Blocks. + (line 52) +* syntax checker: Org Syntax. (line 24) +* syntax, Noweb: Noweb Reference Syntax. + (line 6) +* syntax, of formulas: Formula syntax for Calc. + (line 6) +* table editor, built-in: Built-in Table Editor. + (line 6) +* table editor, table.el: Cooperation. (line 49) +* table indirection: References. (line 147) +* table lookup functions: Lookup functions. (line 6) +* table of contents: Table of Contents. (line 6) +* table of contents, exclude entries: Table of Contents. (line 15) +* table syntax: Built-in Table Editor. + (line 6) +* table types, in Texinfo export: Plain lists in Texinfo export. + (line 6) +* table.el: Cooperation. (line 49) +* tables: Tables. (line 6) +* tables, in HTML: Tables in HTML export. + (line 6) +* tables, in LaTeX export: Tables in LaTeX export. + (line 6) +* tables, in ODT export: Tables in ODT export. + (line 6) +* tables, in ODT export <1>: Advanced topics in ODT export. + (line 151) +* tables, in other modes: Tables in Arbitrary Syntax. + (line 6) +* tag completion: Completion. (line 6) +* tag filtering, in agenda: Filtering/limiting agenda times. + (line 17) +* tag inheritance: Tag Inheritance. (line 6) +* tag searches: Tag Searches. (line 6) +* tags: Tags. (line 6) +* tags hierarchy: Tag Hierarchy. (line 6) +* tags view: Matching tags and properties. + (line 6) +* tags, as an agenda view: Storing searches. (line 11) +* tags, groups: Tag Hierarchy. (line 6) +* TAGS, keyword: Setting Tags. (line 22) +* TAGS, keyword <1>: In-buffer Settings. (line 258) +* tags, setting: Setting Tags. (line 6) +* TAGS, special property: Special Properties. (line 13) +* tags-todo: Storing searches. (line 11) +* tags-tree: Storing searches. (line 11) +* tangle, header argument: Extracting Source Code. + (line 23) +* tangle-mode, header argument: Extracting Source Code. + (line 89) +* tangling: Extracting Source Code. + (line 6) +* targets, for links: Internal Links. (line 6) +* targets, radio: Radio Targets. (line 6) +* tasks, breaking down: Breaking Down Tasks. (line 6) +* tasks, repeated: Repeated tasks. (line 6) +* TBLFM keywords, multiple: Editing and debugging formulas. + (line 98) +* TBLFM, keyword: Field and range formulas. + (line 12) +* TBLFM, switching: Editing and debugging formulas. + (line 98) +* template expansion: Structure Templates. (line 21) +* template insertion: Structure Templates. (line 6) +* template, custom: Applying custom styles. + (line 6) +* template, custom <1>: Advanced topics in ODT export. + (line 34) +* templates, for Capture: Capture templates. (line 6) +* Tempo: Structure Templates. (line 21) +* TeX interpretation: Embedded LaTeX. (line 6) +* TeX symbol completion: Completion. (line 6) +* TEXINFO, keyword: Quoting Texinfo code. + (line 9) +* TEXINFO_CLASS, keyword: Texinfo specific export settings. + (line 20) +* TEXINFO_CLASS, keyword <1>: Texinfo file header. (line 19) +* TEXINFO_CLASS, keyword <2>: Headings and sectioning structure. + (line 6) +* TEXINFO_DIR_CATEGORY, keyword: Texinfo specific export settings. + (line 30) +* TEXINFO_DIR_CATEGORY, keyword <1>: Info directory file. (line 6) +* TEXINFO_DIR_DESC, keyword: Texinfo specific export settings. + (line 36) +* TEXINFO_DIR_DESC, keyword <1>: Info directory file. (line 6) +* TEXINFO_DIR_TITLE, keyword: Texinfo specific export settings. + (line 33) +* TEXINFO_DIR_TITLE, keyword <1>: Info directory file. (line 6) +* TEXINFO_FILENAME, keyword: Texinfo specific export settings. + (line 17) +* TEXINFO_FILENAME, keyword <1>: Texinfo file header. (line 6) +* TEXINFO_HEADER, keyword: Texinfo specific export settings. + (line 24) +* TEXINFO_HEADER, keyword <1>: Texinfo file header. (line 11) +* TEXINFO_POST_HEADER, keyword: Texinfo specific export settings. + (line 27) +* TEXINFO_PRINTED_TITLE, keyword: Texinfo specific export settings. + (line 39) +* TEXINFO_PRINTED_TITLE, keyword <1>: Texinfo title and copyright page. + (line 6) +* text areas, in HTML: Text areas in HTML export. + (line 6) +* text search: Search view. (line 6) +* time clocking: Clocking Work Time. (line 6) +* time format, custom: Custom time format. (line 6) +* time grid: Time-of-day specifications. + (line 31) +* time, computing: Durations and time values. + (line 6) +* time, macro: Macro Replacement. (line 56) +* time, reading in minibuffer: The date/time prompt. + (line 6) +* time-of-day specification: Time-of-day specifications. + (line 6) +* timerange: Timestamps. (line 42) +* times: Dates and Times. (line 6) +* timestamp: Dates and Times. (line 6) +* timestamp <1>: Timestamps. (line 14) +* timestamp, inactive: Timestamps. (line 50) +* TIMESTAMP, special property: Special Properties. (line 13) +* timestamp, with repeater interval: Timestamps. (line 25) +* timestamps: Timestamps. (line 6) +* TIMESTAMP_IA, special property: Special Properties. (line 13) +* TIMEZONE, property: iCalendar Export. (line 51) +* TINDEX, keyword: Indices. (line 6) +* TITLE, keyword: Export Settings. (line 60) +* title, macro: Macro Replacement. (line 41) +* toc, in OPTIONS keyword: Table of Contents. (line 6) +* TOC, keyword: Table of Contents. (line 24) +* TODO dependencies: TODO dependencies. (line 6) +* TODO dependencies, NOBLOCKING: TODO dependencies. (line 29) +* TODO items: TODO Items. (line 6) +* TODO keyword matching: Global TODO list. (line 18) +* TODO keyword matching, with tags search: Matching tags and properties. + (line 64) +* TODO keyword sets: Multiple sets in one file. + (line 6) +* TODO keywords completion: Completion. (line 6) +* TODO list, global: Global TODO list. (line 6) +* TODO types: TODO types. (line 6) +* TODO workflow: Workflow states. (line 6) +* todo, as an agenda view: Storing searches. (line 11) +* TODO, keyword: Per-file keywords. (line 6) +* TODO, keyword <1>: In-buffer Settings. (line 265) +* TODO, special property: Special Properties. (line 13) +* todo-tree: Storing searches. (line 11) +* top headline filtering, in agenda: Filtering/limiting agenda times. + (line 17) +* Top node, in Texinfo export: Headings and sectioning structure. + (line 37) +* transient mark mode: Structure Editing. (line 132) +* translator function: Translator functions. + (line 6) +* trees, sparse: Sparse Trees. (line 6) +* trees, visibility: Visibility Cycling. (line 6) +* tty key bindings: TTY Keys. (line 6) +* two-column tables, in Texinfo export: Plain lists in Texinfo export. + (line 6) +* types as TODO keywords: TODO types. (line 6) +* TYP_TODO, keyword: Per-file keywords. (line 6) +* TYP_TODO, keyword <1>: In-buffer Settings. (line 265) +* underlined text, markup rules: Emphasis and Monospace. + (line 6) +* undoing remote-editing events: Agenda Commands. (line 227) +* unison: Uploading Files. (line 6) +* UNNUMBERED, property: Export Settings. (line 149) +* unoconv: Extending ODT export. + (line 12) +* updating, table: Updating the table. (line 6) +* URL links: External Links. (line 6) +* Usenet links: External Links. (line 6) +* using sessions in code blocks: Environment of a Code Block. + (line 272) +* UTF-8 export: ASCII/Latin-1/UTF-8 export. + (line 6) +* var, header argument: Environment of a Code Block. + (line 9) +* variable index, in Texinfo export: Indices. (line 6) +* variables, for customization: Customization. (line 6) +* vectors, in table calculations: Formula syntax for Calc. + (line 14) +* verbatim blocks, in LaTeX export: Example blocks in LaTeX export. + (line 6) +* verbatim text, markup rules: Emphasis and Monospace. + (line 6) +* verse blocks: Paragraphs. (line 13) +* view file commands in agenda: Agenda Commands. (line 28) +* VINDEX, keyword: Indices. (line 6) +* viper.el: Conflicts. (line 51) +* visibility cycling: Visibility Cycling. (line 6) +* visibility cycling, drawers: Drawers. (line 6) +* VISIBILITY, property: Initial visibility. (line 17) +* visible text, printing: Sparse Trees. (line 52) +* VM links: External Links. (line 43) +* Wanderlust links: External Links. (line 43) +* weekly agenda: Weekly/daily agenda. (line 6) +* windmove.el: Conflicts. (line 60) +* workflow states as TODO keywords: Workflow states. (line 6) +* working directory, in a code block: Environment of a Code Block. + (line 302) +* wrap, header argument: Results of Evaluation. + (line 231) +* xelatex: LaTeX/PDF export commands. + (line 25) +* yasnippet.el: Conflicts. (line 74) +* zero width space: Escape Character. (line 6) +* zip: Pre-requisites for ODT export. + (line 6) + + +File: org, Node: Key Index, Next: Command and Function Index, Prev: Main Index, Up: Top + +E Key Index +*********** + +[index] +* Menu: + +* !: Setting Tags. (line 126) +* ! (Agenda dispatcher): Stuck projects. (line 17) +* # (Agenda dispatcher): Stuck projects. (line 14) +* $: Agenda Commands. (line 263) +* %: Agenda Commands. (line 377) +* ': CDLaTeX mode. (line 54) +* *: Agenda Commands. (line 357) +* * (Agenda dispatcher): Agenda Dispatcher. (line 49) +* +: Agenda Commands. (line 285) +* ,: Agenda Commands. (line 277) +* -: Agenda Commands. (line 290) +* .: Agenda Commands. (line 118) +* / (Agenda dispatcher): Agenda Dispatcher. (line 28) +* 1..9,0: Using column view. (line 35) +* :: Agenda Commands. (line 273) +* <: Using column view. (line 66) +* < <1>: The date/time prompt. + (line 81) +* < (Agenda dispatcher): Agenda Dispatcher. (line 38) +* < < (Agenda dispatcher): Agenda Dispatcher. (line 43) +* >: Using column view. (line 66) +* > <1>: The date/time prompt. + (line 81) +* > <2>: Agenda Commands. (line 326) +* ? (Agenda dispatcher): Pulling from the mobile application. + (line 39) +* [: Agenda Commands. (line 142) +* ^: CDLaTeX mode. (line 40) +* _: CDLaTeX mode. (line 40) +* `: CDLaTeX mode. (line 48) +* a: Using column view. (line 56) +* A: Agenda Commands. (line 64) +* a <1>: Agenda Commands. (line 250) +* a (Agenda dispatcher): Weekly/daily agenda. (line 10) +* b: Agenda Commands. (line 115) +* B: Agenda Commands. (line 381) +* C: Resolving idle time. (line 46) +* c: Agenda Commands. (line 445) +* c <1>: Agenda Commands. (line 448) +* C <1>: Agenda Commands. (line 479) +* C (Agenda dispatcher): Storing searches. (line 11) +* C (Capture menu: Capture templates. (line 11) +* C-#: Advanced features. (line 11) +* C-': Agenda Files. (line 26) +* C-,: Agenda Files. (line 26) +* C-0 C-c C-w: Refile and Copy. (line 50) +* C-2 C-c C-w: Refile and Copy. (line 42) +* C-3 C-c C-w: Refile and Copy. (line 45) +* C-c !: Creating Timestamps. (line 25) +* C-c #: Checkboxes. (line 88) +* C-c $: Moving subtrees. (line 10) +* C-c %: Handling Links. (line 139) +* C-c &: Handling Links. (line 144) +* C-c ': Editing and debugging formulas. + (line 37) +* C-c ' <1>: Literal Examples. (line 90) +* C-c ' <2>: Include Files. (line 64) +* C-c ' <3>: Editing Source Code. (line 6) +* C-c ' <4>: Cooperation. (line 59) +* C-c *: Structure Editing. (line 124) +* C-c * <1>: Plain Lists. (line 143) +* C-c * <2>: Updating the table. (line 14) +* C-c +: Built-in Table Editor. + (line 168) +* C-c ,: Priorities. (line 25) +* C-c -: Plain Lists. (line 131) +* C-c - <1>: Built-in Table Editor. + (line 113) +* C-c .: Creating Timestamps. (line 11) +* C-c /: Sparse Trees. (line 16) +* C-c / <1>: Conflicts. (line 51) +* C-c / /: Sparse Trees. (line 20) +* C-c / a: Inserting deadline/schedule. + (line 36) +* C-c / b: Inserting deadline/schedule. + (line 33) +* C-c / d: Inserting deadline/schedule. + (line 26) +* C-c / m: Tag Searches. (line 10) +* C-c / m <1>: Property Searches. (line 11) +* C-c / p: Property Searches. (line 29) +* C-c / r: Sparse Trees. (line 20) +* C-c / t: TODO Basics. (line 41) +* C-c ;: Comment Lines. (line 20) +* C-c <: Creating Timestamps. (line 32) +* C-c =: Column formulas. (line 33) +* C-c = <1>: Editing and debugging formulas. + (line 14) +* C-c >: Creating Timestamps. (line 35) +* C-c ?: Editing and debugging formulas. + (line 25) +* C-c @: Structure Editing. (line 61) +* C-c C-*: Plain Lists. (line 148) +* C-c C-,: Structure Templates. (line 11) +* C-c C-a: Attachments. (line 27) +* C-c C-a <1>: Agenda Commands. (line 298) +* C-c C-a a: Attachments. (line 32) +* C-c C-a c: Attachments. (line 38) +* C-c C-a d: Attachments. (line 64) +* C-c C-a D: Attachments. (line 67) +* C-c C-a f: Attachments. (line 58) +* C-c C-a F: Attachments. (line 61) +* C-c C-a i: Attachments. (line 76) +* C-c C-a l: Attachments. (line 38) +* C-c C-a m: Attachments. (line 38) +* C-c C-a n: Attachments. (line 42) +* C-c C-a o: Attachments. (line 49) +* C-c C-a O: Attachments. (line 55) +* C-c C-a s: Attachments. (line 71) +* C-c C-a z: Attachments. (line 45) +* C-c C-b: Motion. (line 18) +* C-c C-b <1>: Editing support. (line 12) +* C-c C-c: Plain Lists. (line 126) +* C-c C-c <1>: Creating Footnotes. (line 67) +* C-c C-c <2>: Built-in Table Editor. + (line 60) +* C-c C-c <3>: Column Width and Alignment. + (line 17) +* C-c C-c <4>: Editing and debugging formulas. + (line 45) +* C-c C-c <5>: Editing and debugging formulas. + (line 91) +* C-c C-c <6>: Editing and debugging formulas. + (line 98) +* C-c C-c <7>: Checkboxes. (line 53) +* C-c C-c <8>: Setting Tags. (line 20) +* C-c C-c <9>: Setting Tags. (line 130) +* C-c C-c <10>: Property Syntax. (line 95) +* C-c C-c <11>: Using column view. (line 49) +* C-c C-c <12>: Capturing column view. + (line 67) +* C-c C-c <13>: Creating Timestamps. (line 29) +* C-c C-c <14>: Clocking commands. (line 52) +* C-c C-c <15>: The clock table. (line 19) +* C-c C-c <16>: Evaluating Code Blocks. + (line 22) +* C-c C-c <17>: Key bindings and Useful Functions. + (line 11) +* C-c C-c <18>: The Very Busy C-c C-c Key. + (line 6) +* C-c C-c (Capture buffer): Using capture. (line 15) +* C-c C-c c: Property Syntax. (line 112) +* C-c C-c d: Property Syntax. (line 106) +* C-c C-c D: Property Syntax. (line 109) +* C-c C-c m m: Markdown Export. (line 17) +* C-c C-c m M: Markdown Export. (line 21) +* C-c C-c s: Property Syntax. (line 98) +* C-c C-d: Inserting deadline/schedule. + (line 10) +* C-c C-d <1>: Agenda Commands. (line 305) +* C-c C-e: The Export Dispatcher. + (line 16) +* C-c C-e c a: iCalendar Export. (line 43) +* C-c C-e c c: iCalendar Export. (line 47) +* C-c C-e c f: iCalendar Export. (line 39) +* C-c C-e C-a: The Export Dispatcher. + (line 28) +* C-c C-e C-b: The Export Dispatcher. + (line 46) +* C-c C-e C-s: The Export Dispatcher. + (line 52) +* C-c C-e C-v: The Export Dispatcher. + (line 64) +* C-c C-e E: Triggering Publication. + (line 19) +* C-c C-e F: Triggering Publication. + (line 16) +* C-c C-e h h: HTML export commands. + (line 7) +* C-c C-e h H: HTML export commands. + (line 14) +* C-c C-e h o: HTML export commands. + (line 7) +* C-c C-e i i: Texinfo export commands. + (line 11) +* C-c C-e i t: Texinfo export commands. + (line 7) +* C-c C-e l b: Beamer export commands. + (line 7) +* C-c C-e l B: Beamer export commands. + (line 12) +* C-c C-e l l: LaTeX/PDF export commands. + (line 7) +* C-c C-e l L: LaTeX/PDF export commands. + (line 11) +* C-c C-e l O: Beamer export commands. + (line 20) +* C-c C-e l o: LaTeX/PDF export commands. + (line 17) +* C-c C-e l P: Beamer export commands. + (line 16) +* C-c C-e l p: LaTeX/PDF export commands. + (line 14) +* C-c C-e m o: Markdown Export. (line 24) +* C-c C-e o o: ODT export commands. (line 7) +* C-c C-e o O: ODT export commands. (line 23) +* C-c C-e O o: Org Export. (line 15) +* C-c C-e O v: Org Export. (line 19) +* C-c C-e P: Triggering Publication. + (line 13) +* C-c C-e t a: ASCII/Latin-1/UTF-8 export. + (line 26) +* C-c C-e t A: ASCII/Latin-1/UTF-8 export. + (line 35) +* C-c C-e t l: ASCII/Latin-1/UTF-8 export. + (line 26) +* C-c C-e t L: ASCII/Latin-1/UTF-8 export. + (line 35) +* C-c C-e t u: ASCII/Latin-1/UTF-8 export. + (line 26) +* C-c C-e t U: ASCII/Latin-1/UTF-8 export. + (line 35) +* C-c C-e v: Sparse Trees. (line 52) +* C-c C-e X: Triggering Publication. + (line 9) +* C-c C-f: Motion. (line 15) +* C-c C-j: Motion. (line 24) +* C-c C-k: Global and local cycling. + (line 51) +* C-c C-k (Capture buffer): Using capture. (line 31) +* C-c C-l: Handling Links. (line 69) +* C-c C-n: Motion. (line 9) +* C-c C-o: Creating Footnotes. (line 73) +* C-c C-o <1>: Handling Links. (line 106) +* C-c C-o <2>: Creating Timestamps. (line 40) +* C-c C-o <3>: Agenda Commands. (line 56) +* C-c C-o <4>: Key bindings and Useful Functions. + (line 11) +* C-c C-p: Motion. (line 12) +* C-c C-q: Editing and debugging formulas. + (line 49) +* C-c C-q <1>: Setting Tags. (line 11) +* C-c C-r: Global and local cycling. + (line 42) +* C-c C-r <1>: Editing and debugging formulas. + (line 52) +* C-c C-s: Inserting deadline/schedule. + (line 18) +* C-c C-s <1>: Agenda Commands. (line 301) +* C-c C-t: TODO Basics. (line 14) +* C-c C-t <1>: Clocking commands. (line 70) +* C-c C-u: Motion. (line 21) +* C-c C-v a: Key bindings and Useful Functions. + (line 20) +* C-c C-v b: Key bindings and Useful Functions. + (line 20) +* C-c C-v c: Key bindings and Useful Functions. + (line 20) +* C-c C-v C-a: Key bindings and Useful Functions. + (line 20) +* C-c C-v C-b: Key bindings and Useful Functions. + (line 20) +* C-c C-v C-c: Key bindings and Useful Functions. + (line 20) +* C-c C-v C-d: Key bindings and Useful Functions. + (line 20) +* C-c C-v C-e: Key bindings and Useful Functions. + (line 20) +* C-c C-v C-f: Key bindings and Useful Functions. + (line 20) +* C-c C-v C-g: Key bindings and Useful Functions. + (line 20) +* C-c C-v C-h: Key bindings and Useful Functions. + (line 20) +* C-c C-v C-i: Key bindings and Useful Functions. + (line 20) +* C-c C-v C-I: Key bindings and Useful Functions. + (line 20) +* C-c C-v C-j: Key bindings and Useful Functions. + (line 20) +* C-c C-v C-l: Key bindings and Useful Functions. + (line 20) +* C-c C-v C-n: Key bindings and Useful Functions. + (line 20) +* C-c C-v C-o: Key bindings and Useful Functions. + (line 20) +* C-c C-v C-p: Key bindings and Useful Functions. + (line 20) +* C-c C-v C-r: Key bindings and Useful Functions. + (line 20) +* C-c C-v C-s: Key bindings and Useful Functions. + (line 20) +* C-c C-v C-t: Key bindings and Useful Functions. + (line 20) +* C-c C-v C-u: Key bindings and Useful Functions. + (line 20) +* C-c C-v C-v: Key bindings and Useful Functions. + (line 20) +* C-c C-v C-x: Key bindings and Useful Functions. + (line 20) +* C-c C-v C-z: Key bindings and Useful Functions. + (line 20) +* C-c C-v d: Key bindings and Useful Functions. + (line 20) +* C-c C-v e: Evaluating Code Blocks. + (line 22) +* C-c C-v e <1>: Key bindings and Useful Functions. + (line 20) +* C-c C-v f: Extracting Source Code. + (line 116) +* C-c C-v f <1>: Key bindings and Useful Functions. + (line 20) +* C-c C-v g: Key bindings and Useful Functions. + (line 20) +* C-c C-v h: Key bindings and Useful Functions. + (line 20) +* C-c C-v i: Library of Babel. (line 12) +* C-c C-v i <1>: Key bindings and Useful Functions. + (line 20) +* C-c C-v I: Key bindings and Useful Functions. + (line 20) +* C-c C-v j: Key bindings and Useful Functions. + (line 20) +* C-c C-v l: Key bindings and Useful Functions. + (line 20) +* C-c C-v n: Key bindings and Useful Functions. + (line 20) +* C-c C-v o: Key bindings and Useful Functions. + (line 20) +* C-c C-v p: Key bindings and Useful Functions. + (line 20) +* C-c C-v r: Key bindings and Useful Functions. + (line 20) +* C-c C-v s: Key bindings and Useful Functions. + (line 20) +* C-c C-v t: Extracting Source Code. + (line 111) +* C-c C-v t <1>: Key bindings and Useful Functions. + (line 20) +* C-c C-v u: Key bindings and Useful Functions. + (line 20) +* C-c C-v v: Key bindings and Useful Functions. + (line 20) +* C-c C-v x: Key bindings and Useful Functions. + (line 20) +* C-c C-v z: Key bindings and Useful Functions. + (line 20) +* C-c C-w: Structure Editing. (line 99) +* C-c C-w <1>: Refile and Copy. (line 17) +* C-c C-w <2>: Agenda Commands. (line 247) +* C-c C-w (Capture buffer): Using capture. (line 22) +* C-c C-x ,: Timers. (line 44) +* C-c C-x -: Timers. (line 36) +* C-c C-x .: Timers. (line 32) +* C-c C-x 0: Timers. (line 13) +* C-c C-x ;: Timers. (line 23) +* C-c C-x <: Agenda Files. (line 43) +* C-c C-x >: Agenda Files. (line 52) +* C-c C-x > <1>: Agenda Commands. (line 206) +* C-c C-x a: Internal archiving. (line 39) +* C-c C-x A: Internal archiving. (line 54) +* C-c C-x a <1>: Agenda Commands. (line 255) +* C-c C-x A <1>: Agenda Commands. (line 259) +* C-c C-x b: Global and local cycling. + (line 59) +* C-c C-x b <1>: Agenda Commands. (line 49) +* C-c C-x c: Structure Editing. (line 91) +* C-c C-x C-a: Archiving. (line 12) +* C-c C-x C-a <1>: Agenda Commands. (line 250) +* C-c C-x C-b: Checkboxes. (line 59) +* C-c C-x C-c: Using column view. (line 10) +* C-c C-x C-c <1>: Agenda Commands. (line 197) +* C-c C-x C-c <2>: Agenda Column View. (line 12) +* C-c C-x C-d: Clocking commands. (line 83) +* C-c C-x C-e: Clocking commands. (line 49) +* C-c C-x C-e <1>: Effort Estimates. (line 20) +* C-c C-x C-i: Clocking commands. (line 7) +* C-c C-x C-j: Clocking commands. (line 78) +* C-c C-x C-l: Previewing LaTeX fragments. + (line 18) +* C-c C-x C-n: Handling Links. (line 151) +* C-c C-x C-o: Clocking commands. (line 35) +* C-c C-x C-p: Handling Links. (line 151) +* C-c C-x C-q: Clocking commands. (line 74) +* C-c C-x C-r: The clock table. (line 11) +* C-c C-x C-s: Moving subtrees. (line 10) +* C-c C-x C-s <1>: Agenda Commands. (line 263) +* C-c C-x C-t: Custom time format. (line 13) +* C-c C-x C-u: Capturing column view. + (line 67) +* C-c C-x C-u <1>: The clock table. (line 19) +* C-c C-x C-u <2>: Dynamic Blocks. (line 22) +* C-c C-x C-v: Images. (line 24) +* C-c C-x C-w: Structure Editing. (line 65) +* C-c C-x C-w <1>: Built-in Table Editor. + (line 144) +* C-c C-x C-x: Clocking commands. (line 43) +* C-c C-x C-y: Structure Editing. (line 73) +* C-c C-x C-y <1>: Built-in Table Editor. + (line 148) +* C-c C-x d: Drawers. (line 18) +* C-c C-x e: Effort Estimates. (line 15) +* C-c C-x f: Creating Footnotes. (line 44) +* C-c C-x g: RSS Feeds. (line 23) +* C-c C-x G: RSS Feeds. (line 27) +* C-c C-x i: Capturing column view. + (line 63) +* C-c C-x I: Documentation Access. + (line 6) +* C-c C-x M-w: Structure Editing. (line 69) +* C-c C-x M-w <1>: Built-in Table Editor. + (line 138) +* C-c C-x o: TODO dependencies. (line 38) +* C-c C-x o <1>: Checkboxes. (line 80) +* C-c C-x p: Property Syntax. (line 86) +* C-c C-x p <1>: Using Header Arguments. + (line 70) +* C-c C-x q: Tag Hierarchy. (line 86) +* C-c C-x v: Global and local cycling. + (line 65) +* C-c C-x \: Subscripts and Superscripts. + (line 20) +* C-c C-x \ <1>: Special Symbols. (line 31) +* C-c C-x _: Timers. (line 47) +* C-c C-y: Creating Timestamps. (line 62) +* C-c C-y <1>: Clocking commands. (line 52) +* C-c C-z: Drawers. (line 39) +* C-c C-z <1>: Agenda Commands. (line 293) +* C-c M-w: Refile and Copy. (line 13) +* C-c RET: Built-in Table Editor. + (line 117) +* C-c SPC: Built-in Table Editor. + (line 67) +* C-c TAB: Global and local cycling. + (line 55) +* C-c TAB <1>: Column Width and Alignment. + (line 44) +* C-c [: Agenda Files. (line 16) +* C-c \: Tag Searches. (line 10) +* C-c \ <1>: Property Searches. (line 11) +* C-c ]: Agenda Files. (line 22) +* C-c ^: Structure Editing. (line 103) +* C-c ^ <1>: Plain Lists. (line 159) +* C-c ^ <2>: Built-in Table Editor. + (line 121) +* C-c `: Built-in Table Editor. + (line 186) +* C-c {: Editing and debugging formulas. + (line 34) +* C-c { <1>: CDLaTeX mode. (line 22) +* C-c |: Built-in Table Editor. + (line 42) +* C-c | <1>: Built-in Table Editor. + (line 205) +* C-c }: Editing and debugging formulas. + (line 29) +* C-c } <1>: Editing and debugging formulas. + (line 83) +* C-c ~: Cooperation. (line 63) +* C-g: Setting Tags. (line 120) +* C-k: Agenda Commands. (line 241) +* C-RET: Structure Editing. (line 26) +* C-S-DOWN: Clocking commands. (line 58) +* C-S-LEFT: Multiple sets in one file. + (line 28) +* C-S-LEFT <1>: Agenda Commands. (line 238) +* C-S-RET: Structure Editing. (line 33) +* C-S-RIGHT: Multiple sets in one file. + (line 28) +* C-S-RIGHT <1>: Agenda Commands. (line 235) +* C-S-UP: Clocking commands. (line 58) +* C-TAB: Internal archiving. (line 51) +* C-u C-c !: Creating Timestamps. (line 25) +* C-u C-c *: Updating the table. (line 19) +* C-u C-c .: Creating Timestamps. (line 16) +* C-u C-c =: Field and range formulas. + (line 28) +* C-u C-c = <1>: Editing and debugging formulas. + (line 14) +* C-u C-c C-c: Updating the table. (line 19) +* C-u C-c C-l: Handling Links. (line 92) +* C-u C-c C-t: TODO Basics. (line 28) +* C-u C-c C-w: Refile and Copy. (line 36) +* C-u C-c C-x a: Internal archiving. (line 44) +* C-u C-c C-x C-s: Moving subtrees. (line 14) +* C-u C-c C-x C-u: Capturing column view. + (line 71) +* C-u C-c C-x C-u <1>: The clock table. (line 23) +* C-u C-c C-x C-u <2>: Dynamic Blocks. (line 25) +* C-u C-c TAB: Column Width and Alignment. + (line 54) +* C-u C-u C-c !: Creating Timestamps. (line 25) +* C-u C-u C-c *: Updating the table. (line 24) +* C-u C-u C-c .: Creating Timestamps. (line 21) +* C-u C-u C-c =: Editing and debugging formulas. + (line 19) +* C-u C-u C-c C-c: Updating the table. (line 24) +* C-u C-u C-c C-t: Multiple sets in one file. + (line 28) +* C-u C-u C-c C-w: Refile and Copy. (line 39) +* C-u C-u C-c C-x C-s: Moving subtrees. (line 21) +* C-u C-u C-c TAB: Column Width and Alignment. + (line 57) +* C-u C-u C-u C-c C-t: TODO dependencies. (line 46) +* C-u C-u C-u C-c C-w: Refile and Copy. (line 50) +* C-u C-u C-u TAB: Global and local cycling. + (line 39) +* C-u C-u TAB: Global and local cycling. + (line 35) +* C-u C-u TAB <1>: Initial visibility. (line 23) +* C-u TAB: Global and local cycling. + (line 20) +* C-v: The date/time prompt. + (line 81) +* C-x C-s: Editing and debugging formulas. + (line 45) +* C-x C-s <1>: Agenda Commands. (line 193) +* C-x C-s <2>: Editing Source Code. (line 11) +* C-x C-w: Exporting Agenda Views. + (line 13) +* C-x n b: Structure Editing. (line 118) +* C-x n s: Structure Editing. (line 115) +* C-x n w: Structure Editing. (line 121) +* C-y: Structure Editing. (line 79) +* C-_: Agenda Commands. (line 227) +* d: Agenda Commands. (line 71) +* D: Agenda Commands. (line 127) +* e: Using column view. (line 43) +* E: Agenda Commands. (line 173) +* e (Agenda dispatcher): Exporting Agenda Views. + (line 53) +* F: Agenda Commands. (line 42) +* f: Agenda Commands. (line 110) +* g: Using column view. (line 22) +* G: Agenda Commands. (line 181) +* g <1>: Agenda Commands. (line 186) +* H: Agenda Commands. (line 483) +* I: Agenda Commands. (line 330) +* i: Agenda Commands. (line 452) +* j: Agenda Commands. (line 121) +* J: Agenda Commands. (line 124) +* J <1>: Agenda Commands. (line 340) +* k: Resolving idle time. (line 23) +* K: Resolving idle time. (line 29) +* k <1>: Agenda Commands. (line 343) +* k c (Agenda): Using capture. (line 33) +* l: Agenda Commands. (line 131) +* m: Agenda Commands. (line 351) +* M: Agenda Commands. (line 470) +* m (Agenda dispatcher): Tag Searches. (line 15) +* M (Agenda dispatcher): Tag Searches. (line 19) +* m (Agenda dispatcher) <1>: Property Searches. (line 15) +* M (Agenda dispatcher) <1>: Property Searches. (line 18) +* m (Agenda dispatcher) <2>: Matching tags and properties. + (line 13) +* M (Agenda dispatcher) <2>: Matching tags and properties. + (line 21) +* M-*: Agenda Commands. (line 373) +* M-a: Built-in Table Editor. + (line 78) +* M-DOWN: Structure Editing. (line 58) +* M-DOWN <1>: Plain Lists. (line 102) +* M-DOWN <2>: Built-in Table Editor. + (line 103) +* M-DOWN <3>: Editing and debugging formulas. + (line 80) +* M-DOWN <4>: Agenda Commands. (line 217) +* M-DOWN <5>: Key bindings and Useful Functions. + (line 11) +* M-e: Built-in Table Editor. + (line 82) +* M-g M-n: Sparse Trees. (line 32) +* M-g M-p: Sparse Trees. (line 35) +* M-g n: Sparse Trees. (line 32) +* M-g p: Sparse Trees. (line 35) +* M-LEFT: Structure Editing. (line 43) +* M-LEFT <1>: Plain Lists. (line 108) +* M-LEFT <2>: Built-in Table Editor. + (line 88) +* M-m: Agenda Commands. (line 369) +* M-RET: Structure Editing. (line 7) +* M-RET <1>: Plain Lists. (line 83) +* M-RET <2>: Built-in Table Editor. + (line 155) +* M-RET <3>: Timers. (line 40) +* M-RIGHT: Structure Editing. (line 46) +* M-RIGHT <1>: Plain Lists. (line 108) +* M-RIGHT <2>: Built-in Table Editor. + (line 91) +* M-S-DOWN: Built-in Table Editor. + (line 109) +* M-S-DOWN <1>: Editing and debugging formulas. + (line 74) +* M-S-LEFT: Structure Editing. (line 49) +* M-S-LEFT <1>: Plain Lists. (line 113) +* M-S-LEFT <2>: Built-in Table Editor. + (line 94) +* M-S-LEFT <3>: The date/time prompt. + (line 81) +* M-S-RET: Structure Editing. (line 29) +* M-S-RET <1>: Plain Lists. (line 91) +* M-S-RET <2>: Checkboxes. (line 76) +* M-S-RIGHT: Structure Editing. (line 52) +* M-S-RIGHT <1>: Plain Lists. (line 113) +* M-S-RIGHT <2>: Built-in Table Editor. + (line 97) +* M-S-RIGHT <3>: The date/time prompt. + (line 81) +* M-S-UP: Built-in Table Editor. + (line 106) +* M-S-UP <1>: Editing and debugging formulas. + (line 71) +* M-TAB: Editing and debugging formulas. + (line 63) +* M-TAB <1>: Per-file keywords. (line 26) +* M-TAB <2>: Setting Tags. (line 6) +* M-TAB <3>: Property Syntax. (line 82) +* M-TAB <4>: Completion. (line 15) +* M-UP: Structure Editing. (line 55) +* M-UP <1>: Plain Lists. (line 102) +* M-UP <2>: Built-in Table Editor. + (line 100) +* M-UP <3>: Editing and debugging formulas. + (line 77) +* M-UP <4>: Agenda Commands. (line 210) +* M-UP <5>: Key bindings and Useful Functions. + (line 11) +* M-v: The date/time prompt. + (line 81) +* mouse-1: Creating Footnotes. (line 73) +* mouse-1 <1>: Handling Links. (line 131) +* mouse-1 <2>: The date/time prompt. + (line 81) +* mouse-2: Creating Footnotes. (line 73) +* mouse-2 <1>: Handling Links. (line 131) +* mouse-2 <2>: Agenda Commands. (line 36) +* mouse-3: Handling Links. (line 135) +* mouse-3 <1>: Agenda Commands. (line 29) +* n: Using column view. (line 39) +* n <1>: Agenda Commands. (line 20) +* o: Agenda Commands. (line 68) +* O: Agenda Commands. (line 334) +* p: Using column view. (line 39) +* p <1>: Agenda Commands. (line 23) +* P: Agenda Commands. (line 282) +* q: Setting Tags. (line 123) +* q <1>: Using column view. (line 26) +* q <2>: Agenda Commands. (line 489) +* r: Using column view. (line 22) +* r <1>: Global TODO list. (line 25) +* R: Agenda Commands. (line 154) +* r <2>: Agenda Commands. (line 186) +* RET: Built-in Table Editor. + (line 73) +* RET <1>: Handling Links. (line 127) +* RET <2>: Setting Tags. (line 117) +* RET <3>: The date/time prompt. + (line 81) +* RET <4>: Agenda Commands. (line 39) +* s: Resolving idle time. (line 35) +* S: Resolving idle time. (line 40) +* s <1>: Agenda Commands. (line 193) +* S <1>: Agenda Commands. (line 474) +* s (Agenda dispatcher): Agenda Dispatcher. (line 23) +* s (Agenda dispatcher) <1>: Search view. (line 10) +* S-DOWN: Plain Lists. (line 95) +* S-DOWN <1>: Editing and debugging formulas. + (line 66) +* S-DOWN <2>: Priorities. (line 33) +* S-DOWN <3>: Creating Timestamps. (line 50) +* S-DOWN <4>: The date/time prompt. + (line 81) +* S-DOWN <5>: Agenda Commands. (line 290) +* S-LEFT: Plain Lists. (line 154) +* S-LEFT <1>: Editing and debugging formulas. + (line 66) +* S-LEFT <2>: TODO Basics. (line 34) +* S-LEFT <3>: Multiple sets in one file. + (line 36) +* S-LEFT <4>: Property Syntax. (line 103) +* S-LEFT <5>: Using column view. (line 39) +* S-LEFT <6>: Creating Timestamps. (line 45) +* S-LEFT <7>: The date/time prompt. + (line 81) +* S-LEFT <8>: The clock table. (line 28) +* S-LEFT <9>: Agenda Commands. (line 322) +* S-M-DOWN: Clocking commands. (line 63) +* S-M-LEFT: Using column view. (line 72) +* S-M-RET: TODO Basics. (line 60) +* S-M-RIGHT: Using column view. (line 69) +* S-M-UP: Clocking commands. (line 63) +* S-RET: Built-in Table Editor. + (line 173) +* S-RIGHT: Plain Lists. (line 154) +* S-RIGHT <1>: Editing and debugging formulas. + (line 66) +* S-RIGHT <2>: TODO Basics. (line 34) +* S-RIGHT <3>: Multiple sets in one file. + (line 36) +* S-RIGHT <4>: Property Syntax. (line 103) +* S-RIGHT <5>: Using column view. (line 39) +* S-RIGHT <6>: Creating Timestamps. (line 45) +* S-RIGHT <7>: The date/time prompt. + (line 81) +* S-RIGHT <8>: The clock table. (line 28) +* S-RIGHT <9>: Agenda Commands. (line 309) +* S-TAB: Global and local cycling. + (line 20) +* S-TAB <1>: Built-in Table Editor. + (line 70) +* S-UP: Plain Lists. (line 95) +* S-UP <1>: Editing and debugging formulas. + (line 66) +* S-UP <2>: Priorities. (line 33) +* S-UP <3>: Creating Timestamps. (line 50) +* S-UP <4>: The date/time prompt. + (line 81) +* S-UP <5>: Agenda Commands. (line 285) +* SPC: Setting Tags. (line 114) +* SPC <1>: Agenda Commands. (line 29) +* t: Agenda Commands. (line 231) +* T: Agenda Commands. (line 268) +* t (Agenda dispatcher): TODO Basics. (line 52) +* t (Agenda dispatcher) <1>: Global TODO list. (line 10) +* T (Agenda dispatcher): Global TODO list. (line 18) +* TAB: Global and local cycling. + (line 11) +* TAB <1>: Structure Editing. (line 37) +* TAB <2>: Plain Lists. (line 70) +* TAB <3>: Built-in Table Editor. + (line 63) +* TAB <4>: Editing and debugging formulas. + (line 56) +* TAB <5>: Setting Tags. (line 108) +* TAB <6>: Agenda Commands. (line 36) +* TAB <7>: CDLaTeX mode. (line 26) +* u: Agenda Commands. (line 361) +* U: Agenda Commands. (line 365) +* v: Using column view. (line 52) +* v a: Agenda Commands. (line 146) +* v A: Agenda Commands. (line 151) +* v c: Agenda Commands. (line 165) +* v d: Agenda Commands. (line 71) +* v E: Agenda Commands. (line 173) +* v l: Agenda Commands. (line 131) +* v L: Agenda Commands. (line 131) +* v m: Agenda Commands. (line 91) +* v R: Agenda Commands. (line 154) +* v SPC: Agenda Commands. (line 107) +* v w: Agenda Commands. (line 81) +* v y: Agenda Commands. (line 101) +* v [: Agenda Commands. (line 142) +* w: Agenda Commands. (line 81) +* X: Agenda Commands. (line 337) +* x: Agenda Commands. (line 493) +* z: Agenda Commands. (line 293) + + +File: org, Node: Command and Function Index, Next: Variable Index, Prev: Key Index, Up: Top + +F Command and Function Index +**************************** + +[index] +* Menu: + +* lisp-complete-symbol: Editing and debugging formulas. + (line 63) +* next-error: Sparse Trees. (line 32) +* or-clock-goto: Clocking commands. (line 78) +* org-agenda: Activation. (line 13) +* org-agenda-add-note: Agenda Commands. (line 293) +* org-agenda-archive: Agenda Commands. (line 263) +* org-agenda-archive-default-with-confirmation: Agenda Commands. + (line 250) +* org-agenda-archive-to-archive-sibling: Agenda Commands. (line 259) +* org-agenda-archives-mode: Agenda Commands. (line 146) +* org-agenda-bulk-action: Agenda Commands. (line 381) +* org-agenda-bulk-mark: Agenda Commands. (line 351) +* org-agenda-bulk-mark-all: Agenda Commands. (line 357) +* org-agenda-bulk-mark-regexp: Agenda Commands. (line 377) +* org-agenda-bulk-remove-all-marks: Agenda Commands. (line 365) +* org-agenda-bulk-toggle: Agenda Commands. (line 369) +* org-agenda-bulk-toggle-all: Agenda Commands. (line 373) +* org-agenda-bulk-unmark: Agenda Commands. (line 361) +* org-agenda-capture: Agenda Commands. (line 343) +* org-agenda-clock-cancel: Agenda Commands. (line 337) +* org-agenda-clock-goto: Agenda Commands. (line 124) +* org-agenda-clock-goto <1>: Agenda Commands. (line 340) +* org-agenda-clock-in: Agenda Commands. (line 330) +* org-agenda-clock-out: Agenda Commands. (line 334) +* org-agenda-clockreport-mode: Agenda Commands. (line 154) +* org-agenda-columns: Agenda Commands. (line 197) +* org-agenda-columns <1>: Agenda Column View. (line 12) +* org-agenda-convert-date: Agenda Commands. (line 479) +* org-agenda-date-prompt: Agenda Commands. (line 326) +* org-agenda-day-view: Agenda Commands. (line 71) +* org-agenda-deadline: Agenda Commands. (line 305) +* org-agenda-diary-entry: Agenda Commands. (line 452) +* org-agenda-do-date-earlier: Agenda Commands. (line 322) +* org-agenda-do-date-later: Agenda Commands. (line 309) +* org-agenda-drag-line-backward: Agenda Commands. (line 210) +* org-agenda-drag-line-forward: Agenda Commands. (line 217) +* org-agenda-earlier: Agenda Commands. (line 115) +* org-agenda-entry-text-mode: Agenda Commands. (line 173) +* org-agenda-exit: Agenda Commands. (line 493) +* org-agenda-file-to-front: Agenda Files. (line 16) +* org-agenda-filter-by-category: Filtering/limiting agenda times. + (line 56) +* org-agenda-filter-by-effort: Filtering/limiting agenda times. + (line 82) +* org-agenda-filter-by-regexp: Filtering/limiting agenda times. + (line 70) +* org-agenda-filter-by-tag: Filtering/limiting agenda times. + (line 18) +* org-agenda-filter-by-top-headline: Filtering/limiting agenda times. + (line 66) +* org-agenda-follow-mode: Agenda Commands. (line 42) +* org-agenda-goto: Agenda Commands. (line 36) +* org-agenda-goto-calendar: Agenda Commands. (line 445) +* org-agenda-goto-date: Agenda Commands. (line 121) +* org-agenda-goto-today: Agenda Commands. (line 118) +* org-agenda-holidays: Agenda Commands. (line 483) +* org-agenda-kill: Agenda Commands. (line 241) +* org-agenda-later: Agenda Commands. (line 110) +* org-agenda-limit-interactively: Filtering/limiting agenda times. + (line 147) +* org-agenda-list: Weekly/daily agenda. (line 10) +* org-agenda-list-stuck-projects: Stuck projects. (line 14) +* org-agenda-log-mode: Agenda Commands. (line 131) +* org-agenda-manipulate-query-add: Agenda Commands. (line 142) +* org-agenda-month-view: Agenda Commands. (line 91) +* org-agenda-next-line: Agenda Commands. (line 20) +* org-agenda-open-link: Agenda Commands. (line 56) +* org-agenda-phases-of-moon: Agenda Commands. (line 470) +* org-agenda-previous-line: Agenda Commands. (line 23) +* org-agenda-priority: Agenda Commands. (line 277) +* org-agenda-priority-down: Agenda Commands. (line 290) +* org-agenda-priority-up: Agenda Commands. (line 285) +* org-agenda-quit: Agenda Commands. (line 489) +* org-agenda-recenter: Agenda Commands. (line 33) +* org-agenda-redo: Agenda Commands. (line 186) +* org-agenda-refile: Agenda Commands. (line 247) +* org-agenda-remove-restriction-lock: Agenda Files. (line 52) +* org-agenda-remove-restriction-lock <1>: Agenda Files. (line 65) +* org-agenda-remove-restriction-lock <2>: Agenda Commands. (line 206) +* org-agenda-reset-view: Agenda Commands. (line 107) +* org-agenda-schedule: Agenda Commands. (line 301) +* org-agenda-set-restriction-lock: Agenda Files. (line 43) +* org-agenda-set-tags: Agenda Commands. (line 273) +* org-agenda-show-and-scroll-up: Agenda Commands. (line 29) +* org-agenda-show-priority: Agenda Commands. (line 282) +* org-agenda-show-tags: Agenda Commands. (line 268) +* org-agenda-sunrise-sunset: Agenda Commands. (line 474) +* org-agenda-switch-to: Agenda Commands. (line 39) +* org-agenda-todo: Agenda Commands. (line 231) +* org-agenda-todo-nextset: Agenda Commands. (line 235) +* org-agenda-toggle-archive-tag: Agenda Commands. (line 255) +* org-agenda-toggle-diary: Agenda Commands. (line 127) +* org-agenda-tree-to-indirect-buffer: Agenda Commands. (line 49) +* org-agenda-undo: Agenda Commands. (line 227) +* org-agenda-week-view: Agenda Commands. (line 81) +* org-agenda-write: Exporting Agenda Views. + (line 13) +* org-agenda-year-view: Agenda Commands. (line 101) +* org-archive-subtree: Moving subtrees. (line 10) +* org-archive-subtree-default: Archiving. (line 12) +* org-archive-to-archive-sibling: Internal archiving. (line 54) +* org-ascii-convert-region-to-ascii: Export in Foreign Buffers. + (line 11) +* org-ascii-convert-region-to-utf8: Export in Foreign Buffers. + (line 14) +* org-ascii-export-to-ascii: ASCII/Latin-1/UTF-8 export. + (line 26) +* org-ascii-export-to-ascii <1>: ASCII/Latin-1/UTF-8 export. + (line 35) +* org-attach: Attachments. (line 27) +* org-attach <1>: Agenda Commands. (line 298) +* org-attach-attach: Attachments. (line 32) +* org-attach-dired-to-subtree: Attachments. (line 79) +* org-attach-new: Attachments. (line 42) +* org-attach-open: Attachments. (line 49) +* org-attach-open-in-emacs: Attachments. (line 55) +* org-attach-reveal: Attachments. (line 58) +* org-attach-reveal-in-emacs: Attachments. (line 61) +* org-attach-sync: Attachments. (line 45) +* org-babel-check-src-block: Key bindings and Useful Functions. + (line 20) +* org-babel-demarcate-block: Key bindings and Useful Functions. + (line 20) +* org-babel-describe-bindings: Key bindings and Useful Functions. + (line 20) +* org-babel-do-key-sequence-in-edit-buffer: Key bindings and Useful Functions. + (line 20) +* org-babel-execute-buffer: Key bindings and Useful Functions. + (line 20) +* org-babel-execute-maybe: Key bindings and Useful Functions. + (line 20) +* org-babel-execute-src-block: Evaluating Code Blocks. + (line 22) +* org-babel-execute-src-block <1>: Key bindings and Useful Functions. + (line 11) +* org-babel-execute-subtree: Key bindings and Useful Functions. + (line 20) +* org-babel-expand-src-block: Key bindings and Useful Functions. + (line 20) +* org-babel-goto-named-result: Key bindings and Useful Functions. + (line 20) +* org-babel-goto-named-src-block: Key bindings and Useful Functions. + (line 20) +* org-babel-goto-src-block-head: Key bindings and Useful Functions. + (line 20) +* org-babel-insert-header-arg: Key bindings and Useful Functions. + (line 20) +* org-babel-load-in-session: Key bindings and Useful Functions. + (line 11) +* org-babel-load-in-session <1>: Key bindings and Useful Functions. + (line 20) +* org-babel-lob-ingest: Library of Babel. (line 12) +* org-babel-lob-ingest <1>: Key bindings and Useful Functions. + (line 20) +* org-babel-next-src-block: Key bindings and Useful Functions. + (line 20) +* org-babel-open-src-block-result: Key bindings and Useful Functions. + (line 11) +* org-babel-open-src-block-result <1>: Key bindings and Useful Functions. + (line 20) +* org-babel-pop-to-session: Key bindings and Useful Functions. + (line 11) +* org-babel-previous-src-block: Key bindings and Useful Functions. + (line 20) +* org-babel-sha1-hash: Key bindings and Useful Functions. + (line 20) +* org-babel-switch-to-session-with-code: Key bindings and Useful Functions. + (line 20) +* org-babel-tangle: Extracting Source Code. + (line 111) +* org-babel-tangle <1>: Key bindings and Useful Functions. + (line 20) +* org-babel-tangle-file: Extracting Source Code. + (line 116) +* org-babel-tangle-file <1>: Key bindings and Useful Functions. + (line 20) +* org-babel-tangle-jump-to-org: Extracting Source Code. + (line 129) +* org-babel-view-src-block-info: Key bindings and Useful Functions. + (line 20) +* org-backward-heading-same-level: Motion. (line 18) +* org-batch-agenda: Extracting Agenda Information. + (line 10) +* org-batch-agenda-csv: Extracting Agenda Information. + (line 41) +* org-bbdb-anniversaries: Weekly/daily agenda. (line 78) +* org-bbdb-anniversaries-future: Weekly/daily agenda. (line 109) +* org-beamer-export-as-latex: Beamer export commands. + (line 12) +* org-beamer-export-to-latex: Beamer export commands. + (line 7) +* org-beamer-export-to-pdf: Beamer export commands. + (line 16) +* org-beamer-select-environment: Editing support. (line 12) +* org-buffer-property-keys: Using the Property API. + (line 34) +* org-calendar-goto-agenda: Agenda Commands. (line 448) +* org-capture: Activation. (line 13) +* org-capture <1>: Using capture. (line 7) +* org-capture-finalize: Using capture. (line 15) +* org-capture-kill: Using capture. (line 31) +* org-capture-refile: Using capture. (line 22) +* org-check-after-date: Inserting deadline/schedule. + (line 36) +* org-check-before-date: Inserting deadline/schedule. + (line 33) +* org-check-deadlines: Inserting deadline/schedule. + (line 26) +* org-clock-cancel: Clocking commands. (line 74) +* org-clock-display: Clocking commands. (line 83) +* org-clock-in: Clocking commands. (line 7) +* org-clock-in-last: Clocking commands. (line 43) +* org-clock-modify-effort-estimate: Clocking commands. (line 49) +* org-clock-modify-effort-estimate <1>: Effort Estimates. (line 20) +* org-clock-out: Clocking commands. (line 35) +* org-clock-report: The clock table. (line 11) +* org-clock-timestamp-down: Clocking commands. (line 63) +* org-clock-timestamp-up: Clocking commands. (line 63) +* org-clock-timestamps-down: Clocking commands. (line 58) +* org-clock-timestamps-up: Clocking commands. (line 58) +* org-clocktable-try-shift: The clock table. (line 28) +* org-clocktable-write-default: The clock table. (line 116) +* org-clone-subtree-with-time-shift: Structure Editing. (line 91) +* org-columns-delete: Using column view. (line 72) +* org-columns-edit-allowed: Using column view. (line 56) +* org-columns-edit-value: Using column view. (line 43) +* org-columns-narrow: Using column view. (line 66) +* org-columns-new: Using column view. (line 69) +* org-columns-next-allowed-value: Using column view. (line 39) +* org-columns-previous-allowed-value: Using column view. (line 39) +* org-columns-quit: Using column view. (line 26) +* org-columns-redo: Using column view. (line 22) +* org-columns-set-tags-or-toggle: Using column view. (line 49) +* org-columns-show-value: Using column view. (line 52) +* org-columns-widen: Using column view. (line 66) +* org-compute-property-at-point: Property Syntax. (line 112) +* org-copy: Refile and Copy. (line 13) +* org-copy-subtree: Structure Editing. (line 69) +* org-copy-visible: Global and local cycling. + (line 65) +* org-cut-subtree: Structure Editing. (line 65) +* org-cycle: Global and local cycling. + (line 11) +* org-cycle <1>: Structure Editing. (line 37) +* org-cycle <2>: Plain Lists. (line 70) +* org-cycle-agenda-files: Agenda Files. (line 26) +* org-date-from-calendar: Creating Timestamps. (line 32) +* org-dblock-update: Capturing column view. + (line 67) +* org-dblock-update <1>: The clock table. (line 19) +* org-dblock-update <2>: Dynamic Blocks. (line 22) +* org-deadline: Inserting deadline/schedule. + (line 10) +* org-delete-property: Property Syntax. (line 106) +* org-delete-property-globally: Property Syntax. (line 109) +* org-demote: Using the Mapping API. + (line 93) +* org-demote-subtree: Structure Editing. (line 52) +* org-do-demote: Structure Editing. (line 46) +* org-do-promote: Structure Editing. (line 43) +* org-edit-special: Literal Examples. (line 90) +* org-edit-special <1>: Include Files. (line 64) +* org-edit-special <2>: Cooperation. (line 59) +* org-entities-help: Special Symbols. (line 16) +* org-entry-add-to-multivalued-property: Using the Property API. + (line 49) +* org-entry-delete: Using the Property API. + (line 28) +* org-entry-get: Using the Property API. + (line 19) +* org-entry-get-multivalued-property: Using the Property API. + (line 45) +* org-entry-member-in-multivalued-property: Using the Property API. + (line 58) +* org-entry-properties: Using the Property API. + (line 9) +* org-entry-put: Using the Property API. + (line 31) +* org-entry-put-multivalued-property: Using the Property API. + (line 40) +* org-entry-remove-from-multivalued-property: Using the Property API. + (line 53) +* org-evaluate-time-range: Creating Timestamps. (line 62) +* org-evaluate-time-range <1>: Clocking commands. (line 52) +* org-export: The Export Dispatcher. + (line 16) +* org-export-define-backend: Adding Export Back-ends. + (line 10) +* org-export-define-derived-backend: Adding Export Back-ends. + (line 10) +* org-export-to-odt: ODT export commands. (line 7) +* org-forward-heading-same-level: Motion. (line 15) +* org-global-cycle: Global and local cycling. + (line 20) +* org-goto: Motion. (line 24) +* org-goto-calendar: Creating Timestamps. (line 35) +* org-html-convert-region-to-html: Export in Foreign Buffers. + (line 17) +* org-html-export-as-html: HTML export commands. + (line 14) +* org-html-export-to-html: HTML export commands. + (line 7) +* org-icalendar-combine-agenda-files: iCalendar Export. (line 47) +* org-icalendar-export-agenda-files: iCalendar Export. (line 43) +* org-icalendar-export-to-ics: iCalendar Export. (line 39) +* org-indent-mode: Clean View. (line 20) +* org-info-find-node: Documentation Access. + (line 6) +* org-insert-columns-dblock: Capturing column view. + (line 63) +* org-insert-drawer: Drawers. (line 18) +* org-insert-drawer <1>: Property Syntax. (line 90) +* org-insert-heading: Plain Lists. (line 83) +* org-insert-heading <1>: Timers. (line 40) +* org-insert-heading-respect-content: Structure Editing. (line 26) +* org-insert-link: Handling Links. (line 69) +* org-insert-link-global: Using Links Outside Org. + (line 6) +* org-insert-property-drawer: Using the Property API. + (line 19) +* org-insert-property-drawer <1>: Using the Property API. + (line 37) +* org-insert-structure-template: Structure Templates. (line 11) +* org-insert-todo-heading: Structure Editing. (line 29) +* org-insert-todo-heading <1>: TODO Basics. (line 60) +* org-insert-todo-heading <2>: Checkboxes. (line 76) +* org-insert-todo-heading-respect-content: Structure Editing. (line 33) +* org-latex-convert-region-to-latex: Export in Foreign Buffers. + (line 20) +* org-latex-export-as-latex: LaTeX/PDF export commands. + (line 11) +* org-latex-export-to-latex~: LaTeX/PDF export commands. + (line 7) +* org-latex-export-to-pdf: LaTeX/PDF export commands. + (line 14) +* org-link-set-parameters: Adding Hyperlink Types. + (line 69) +* org-lint: Org Syntax. (line 24) +* org-lookup-all: Lookup functions. (line 23) +* org-lookup-first: Lookup functions. (line 9) +* org-lookup-last: Lookup functions. (line 19) +* org-map-entries: Using the Mapping API. + (line 12) +* org-mark-ring-goto: Handling Links. (line 144) +* org-mark-ring-push: Handling Links. (line 139) +* org-mark-subtree: Structure Editing. (line 61) +* org-match-sparse-tree: Tag Searches. (line 10) +* org-match-sparse-tree <1>: Property Searches. (line 11) +* org-md-convert-region-to-md: Export in Foreign Buffers. + (line 26) +* org-md-export-as-markdown: Markdown Export. (line 21) +* org-md-export-to-markdown: Markdown Export. (line 17) +* org-meta-return: Structure Editing. (line 7) +* org-mobile-pull: Pulling from the mobile application. + (line 6) +* org-mobile-push: Pushing to the mobile application. + (line 6) +* org-move-subtree-down: Structure Editing. (line 58) +* org-move-subtree-up: Structure Editing. (line 55) +* org-narrow-to-block: Structure Editing. (line 118) +* org-narrow-to-block <1>: Dynamic Blocks. (line 56) +* org-narrow-to-subtree: Structure Editing. (line 115) +* org-next-link: Handling Links. (line 151) +* org-next-visible-heading: Motion. (line 9) +* org-occur: Sparse Trees. (line 20) +* org-odt-convert: Extending ODT export. + (line 37) +* org-open-at-point: Handling Links. (line 106) +* org-open-at-point <1>: Creating Timestamps. (line 40) +* org-open-at-point-global: Using Links Outside Org. + (line 6) +* org-org-export-to-org: Org Export. (line 15) +* org-paste-subtree: Structure Editing. (line 73) +* org-previous-link: Handling Links. (line 151) +* org-previous-visible-heading: Motion. (line 12) +* org-priority: Priorities. (line 25) +* org-priority <1>: Using the Mapping API. + (line 81) +* org-priority-down: Priorities. (line 33) +* org-priority-up: Priorities. (line 33) +* org-promote: Using the Mapping API. + (line 90) +* org-promote-subtree: Structure Editing. (line 49) +* org-property-action: Property Syntax. (line 95) +* org-protocol-create: open-source protocol. + (line 67) +* org-protocol-create-for-org: open-source protocol. + (line 67) +* org-publish: Triggering Publication. + (line 9) +* org-publish-all: Triggering Publication. + (line 19) +* org-publish-current-file: Triggering Publication. + (line 16) +* org-publish-current-project: Triggering Publication. + (line 13) +* org-publish-find-date: Site map. (line 21) +* org-publish-find-property: Site map. (line 21) +* org-publish-find-title: Site map. (line 21) +* org-refile: Structure Editing. (line 99) +* org-refile <1>: Refile and Copy. (line 17) +* org-refile-cache-clear: Refile and Copy. (line 50) +* org-refile-goto-last-stored: Refile and Copy. (line 39) +* org-remove-file: Agenda Files. (line 22) +* org-reveal: Global and local cycling. + (line 42) +* org-save-all-org-buffers: Agenda Commands. (line 193) +* org-schedule: Inserting deadline/schedule. + (line 18) +* org-search-view: Search view. (line 10) +* org-set-effort: Effort Estimates. (line 15) +* org-set-property: Property Syntax. (line 86) +* org-set-property <1>: Property Syntax. (line 98) +* org-set-property <2>: Using Header Arguments. + (line 70) +* org-set-startup-visibility: Global and local cycling. + (line 35) +* org-set-startup-visibility <1>: Initial visibility. (line 23) +* org-set-tags-command: Setting Tags. (line 11) +* org-show-todo-tree: TODO Basics. (line 41) +* org-sort: Structure Editing. (line 103) +* org-sparse-tree: Sparse Trees. (line 16) +* org-speed-command-help: Speed Keys. (line 18) +* org-speedbar-set-agenda-restriction: Agenda Files. (line 58) +* org-store-agenda-views: Exporting Agenda Views. + (line 53) +* org-store-link: Activation. (line 13) +* org-store-link <1>: Handling Links. (line 9) +* org-submit-bug-report: Feedback. (line 13) +* org-switchb: Agenda Files. (line 29) +* org-table-align: Built-in Table Editor. + (line 60) +* org-table-align <1>: Column Width and Alignment. + (line 17) +* org-table-beginning-of-field: Built-in Table Editor. + (line 78) +* org-table-blank-field: Built-in Table Editor. + (line 67) +* org-table-copy-down: Built-in Table Editor. + (line 173) +* org-table-copy-region: Built-in Table Editor. + (line 138) +* org-table-create-or-convert-from-region: Built-in Table Editor. + (line 42) +* org-table-create-or-convert-from-region <1>: Built-in Table Editor. + (line 205) +* org-table-create-with-table.el: Cooperation. (line 63) +* org-table-cut-region: Built-in Table Editor. + (line 144) +* org-table-delete-column: Built-in Table Editor. + (line 94) +* org-table-edit-field: Built-in Table Editor. + (line 186) +* org-table-edit-formulas: Editing and debugging formulas. + (line 37) +* org-table-end-of-field: Built-in Table Editor. + (line 82) +* org-table-eval-formula: Field and range formulas. + (line 28) +* org-table-eval-formula <1>: Column formulas. (line 33) +* org-table-eval-formula <2>: Editing and debugging formulas. + (line 14) +* org-table-eval-formula <3>: Editing and debugging formulas. + (line 19) +* org-table-expand: Column Width and Alignment. + (line 57) +* org-table-export: Built-in Table Editor. + (line 210) +* org-table-fedit-abort: Editing and debugging formulas. + (line 49) +* org-table-fedit-finish: Editing and debugging formulas. + (line 45) +* org-table-fedit-line-down: Editing and debugging formulas. + (line 74) +* org-table-fedit-line-up: Editing and debugging formulas. + (line 71) +* org-table-fedit-lisp-indent: Editing and debugging formulas. + (line 56) +* org-table-fedit-ref-down: Editing and debugging formulas. + (line 66) +* org-table-fedit-ref-left: Editing and debugging formulas. + (line 66) +* org-table-fedit-ref-right: Editing and debugging formulas. + (line 66) +* org-table-fedit-ref-up: Editing and debugging formulas. + (line 66) +* org-table-fedit-scroll-down: Editing and debugging formulas. + (line 80) +* org-table-fedit-scroll-up: Editing and debugging formulas. + (line 77) +* org-table-fedit-toggle-ref-type: Editing and debugging formulas. + (line 52) +* org-table-field-info: Editing and debugging formulas. + (line 25) +* org-table-hline-and-move: Built-in Table Editor. + (line 117) +* org-table-import: Built-in Table Editor. + (line 196) +* org-table-insert-column: Built-in Table Editor. + (line 97) +* org-table-insert-hline: Built-in Table Editor. + (line 113) +* org-table-insert-row: Built-in Table Editor. + (line 109) +* org-table-iterate: Updating the table. (line 24) +* org-table-iterate-buffer-tables: Updating the table. (line 32) +* org-table-kill-row: Built-in Table Editor. + (line 106) +* org-table-move-column-left: Built-in Table Editor. + (line 88) +* org-table-move-column-right: Built-in Table Editor. + (line 91) +* org-table-move-row-down: Built-in Table Editor. + (line 103) +* org-table-move-row-up: Built-in Table Editor. + (line 100) +* org-table-next-field: Built-in Table Editor. + (line 63) +* org-table-next-row: Built-in Table Editor. + (line 73) +* org-table-paste-rectangle: Built-in Table Editor. + (line 148) +* org-table-previous-field: Built-in Table Editor. + (line 70) +* org-table-recalculate: Updating the table. (line 14) +* org-table-recalculate-buffer-tables: Updating the table. (line 29) +* org-table-rotate-recalc-marks: Advanced features. (line 11) +* org-table-shrink: Column Width and Alignment. + (line 54) +* org-table-sort-lines: Built-in Table Editor. + (line 121) +* org-table-sum: Built-in Table Editor. + (line 168) +* org-table-toggle-column-width: Column Width and Alignment. + (line 44) +* org-table-toggle-coordinate-overlays: Editing and debugging formulas. + (line 29) +* org-table-toggle-coordinate-overlays <1>: Editing and debugging formulas. + (line 83) +* org-table-toggle-formula-debugger: Editing and debugging formulas. + (line 34) +* org-table-wrap-region: Built-in Table Editor. + (line 155) +* org-tags-view: Tag Searches. (line 15) +* org-tags-view <1>: Property Searches. (line 15) +* org-tags-view <2>: Matching tags and properties. + (line 13) +* org-tags-view <3>: Matching tags and properties. + (line 21) +* org-texinfo-convert-region-to-texinfo: Export in Foreign Buffers. + (line 23) +* org-texinfo-export-to-info: Texinfo export commands. + (line 11) +* org-texinfo-export-to-texinfo: Texinfo export commands. + (line 7) +* org-time-stamp: Creating Timestamps. (line 11) +* org-time-stamp-inactive: Creating Timestamps. (line 25) +* org-timer: Timers. (line 32) +* org-timer-item: Timers. (line 36) +* org-timer-pause-or-continue: Timers. (line 44) +* org-timer-set-timer: Timers. (line 23) +* org-timer-start: Timers. (line 13) +* org-timer-stop: Timers. (line 47) +* org-timestamp-down-day: Creating Timestamps. (line 45) +* org-timestamp-up-day: Creating Timestamps. (line 45) +* org-todo: Clocking commands. (line 70) +* org-todo <1>: Using the Mapping API. + (line 77) +* org-todo-list: Global TODO list. (line 10) +* org-todo-list <1>: Global TODO list. (line 18) +* org-toggle-archive-tag: Internal archiving. (line 39) +* org-toggle-checkbox: Checkboxes. (line 53) +* org-toggle-comment: Comment Lines. (line 20) +* org-toggle-heading: Structure Editing. (line 124) +* org-toggle-inline-images: Images. (line 24) +* org-toggle-latex-fragment: Previewing LaTeX fragments. + (line 18) +* org-toggle-ordered-property: TODO dependencies. (line 38) +* org-toggle-ordered-property <1>: Checkboxes. (line 80) +* org-toggle-pretty-entities: Subscripts and Superscripts. + (line 20) +* org-toggle-pretty-entities <1>: Special Symbols. (line 31) +* org-toggle-sticky-agenda: Agenda Dispatcher. (line 49) +* org-toggle-tag: Using the Mapping API. + (line 85) +* org-toggle-tags-groups: Tag Hierarchy. (line 86) +* org-toggle-time-stamp-overlays: Custom time format. (line 13) +* org-tree-to-indirect-buffer: Global and local cycling. + (line 59) +* org-update-statistics-cookies: Checkboxes. (line 88) +* org-version: Feedback. (line 13) +* org-yank: Structure Editing. (line 79) +* orgtbl-ascii-draw: Org Plot. (line 109) +* orgtbl-mode: Orgtbl Mode. (line 6) +* orgtbl-to-csv: Translator functions. + (line 6) +* orgtbl-to-generic: Translator functions. + (line 6) +* orgtbl-to-html: Translator functions. + (line 6) +* orgtbl-to-latex: Translator functions. + (line 6) +* orgtbl-to-orgtbl: Translator functions. + (line 6) +* orgtbl-to-texinfo: Translator functions. + (line 6) +* orgtbl-to-tsv: Translator functions. + (line 6) +* orgtbl-to-unicode: Translator functions. + (line 6) +* outline-show-all: Global and local cycling. + (line 39) +* outline-show-branches: Global and local cycling. + (line 51) +* outline-show-children: Global and local cycling. + (line 55) +* outline-up-heading: Motion. (line 21) +* pcomplete: Property Syntax. (line 82) +* previous-error: Sparse Trees. (line 35) +* widen: Structure Editing. (line 121) + + +File: org, Node: Variable Index, Prev: Command and Function Index, Up: Top + +G Variable Index +**************** + +This is not a complete index of variables and faces, only the ones that +are mentioned in the manual. For a more complete list, use ‘M-x +org-customize’ and then click yourself through the tree. + +[index] +* Menu: + +* cdlatex-simplify-sub-super-scripts: CDLaTeX mode. (line 40) +* constants-unit-system: References. (line 120) +* constants-unit-system <1>: In-buffer Settings. (line 202) +* LaTeX-verbatim-environments: A LaTeX example. (line 19) +* org-adapt-indentation: Clean View. (line 49) +* org-agenda-auto-exclude-function: Filtering/limiting agenda times. + (line 32) +* org-agenda-bulk-custom-functions: Agenda Commands. (line 350) +* org-agenda-bulk-custom-functions <1>: Agenda Commands. (line 429) +* org-agenda-bulk-persistent-marks: Agenda Commands. (line 381) +* org-agenda-category-filter-preset: Filtering/limiting agenda times. + (line 61) +* org-agenda-category-icon-alist: Categories. (line 19) +* org-agenda-clock-consistency-checks: Agenda Commands. (line 165) +* org-agenda-columns-add-appointments-to-effort-sum: Effort Estimates. + (line 41) +* org-agenda-confirm-kill: Agenda Commands. (line 241) +* org-agenda-custom-commands: Sparse Trees. (line 37) +* org-agenda-custom-commands <1>: Storing searches. (line 11) +* org-agenda-custom-commands <2>: Setting options. (line 6) +* org-agenda-custom-commands <3>: Extracting Agenda Information. + (line 10) +* org-agenda-custom-commands-contexts: Setting options. (line 59) +* org-agenda-diary-file: Agenda Commands. (line 458) +* org-agenda-dim-blocked-tasks: TODO dependencies. (line 48) +* org-agenda-dim-blocked-tasks <1>: Speeding Up Your Agendas. + (line 15) +* org-agenda-effort-filter-preset: Filtering/limiting agenda times. + (line 101) +* org-agenda-entry-text-maxlines: Agenda Commands. (line 173) +* org-agenda-exporter-settings: Exporting Agenda Views. + (line 14) +* org-agenda-exporter-settings <1>: Exporting Agenda Views. + (line 68) +* org-agenda-files: Agenda Files. (line 6) +* org-agenda-files <1>: Sorting of agenda items. + (line 9) +* org-agenda-inhibit-startup: Speeding Up Your Agendas. + (line 19) +* org-agenda-log-mode-items: Agenda Commands. (line 131) +* org-agenda-max-effort: Filtering/limiting agenda times. + (line 118) +* org-agenda-max-entries: Filtering/limiting agenda times. + (line 115) +* org-agenda-max-tags: Filtering/limiting agenda times. + (line 124) +* org-agenda-max-todos: Filtering/limiting agenda times. + (line 121) +* org-agenda-overriding-header: Special Agenda Views. + (line 38) +* org-agenda-prefix-format: Presentation and Sorting. + (line 6) +* org-agenda-regexp-filter-preset: Filtering/limiting agenda times. + (line 77) +* org-agenda-restore-windows-after-quit: Agenda Views. (line 42) +* org-agenda-search-headline-for-time: Time-of-day specifications. + (line 16) +* org-agenda-show-inherited-tags: Agenda Commands. (line 268) +* org-agenda-show-inherited-tags <1>: Speeding Up Your Agendas. + (line 23) +* org-agenda-skip-archived-trees: Internal archiving. (line 23) +* org-agenda-skip-archived-trees <1>: Agenda Views. (line 37) +* org-agenda-skip-comment-trees: Agenda Views. (line 37) +* org-agenda-skip-deadline-prewarning-if-scheduled: Deadlines and Scheduling. + (line 24) +* org-agenda-skip-function: Special Agenda Views. + (line 6) +* org-agenda-skip-function <1>: Special Agenda Views. + (line 41) +* org-agenda-skip-function <2>: Using the Mapping API. + (line 69) +* org-agenda-skip-function-global: Special Agenda Views. + (line 6) +* org-agenda-skip-scheduled-delay-if-deadline: Deadlines and Scheduling. + (line 42) +* org-agenda-skip-scheduled-if-deadline-is-shown: Repeated tasks. + (line 76) +* org-agenda-skip-scheduled-if-done: Deadlines and Scheduling. + (line 34) +* org-agenda-sorting-strategy: Sorting of agenda items. + (line 28) +* org-agenda-span: Weekly/daily agenda. (line 15) +* org-agenda-span <1>: Agenda Commands. (line 107) +* org-agenda-start-day: Weekly/daily agenda. (line 15) +* org-agenda-start-on-weekday: Weekly/daily agenda. (line 15) +* org-agenda-start-with-clockreport-mode: Agenda Commands. (line 154) +* org-agenda-start-with-entry-text-mode: Agenda Commands. (line 173) +* org-agenda-start-with-follow-mode: Agenda Commands. (line 42) +* org-agenda-sticky: Agenda Dispatcher. (line 49) +* org-agenda-tag-filter-preset: Filtering/limiting agenda times. + (line 18) +* org-agenda-tags-column: Presentation and Sorting. + (line 6) +* org-agenda-tags-todo-honor-ignore-options: Matching tags and properties. + (line 21) +* org-agenda-text-search-extra-files: Agenda Dispatcher. (line 28) +* org-agenda-text-search-extra-files <1>: Search view. (line 33) +* org-agenda-time-grid: Time-of-day specifications. + (line 46) +* org-agenda-time-grid <1>: Agenda Commands. (line 181) +* org-agenda-todo-ignore-deadlines: Global TODO list. (line 42) +* org-agenda-todo-ignore-scheduled: Global TODO list. (line 42) +* org-agenda-todo-ignore-timestamp: Global TODO list. (line 42) +* org-agenda-todo-ignore-with-date: Global TODO list. (line 42) +* org-agenda-todo-list-sublevels: Breaking Down Tasks. (line 6) +* org-agenda-todo-list-sublevels <1>: Global TODO list. (line 51) +* org-agenda-use-tag-inheritance: Tag Inheritance. (line 32) +* org-agenda-use-tag-inheritance <1>: Speeding Up Your Agendas. + (line 23) +* org-agenda-use-time-grid: Time-of-day specifications. + (line 46) +* org-agenda-use-time-grid <1>: Agenda Commands. (line 181) +* org-agenda-window-setup: Agenda Views. (line 42) +* org-alphabetical-lists: Plain Lists. (line 15) +* org-archive-default-command: Archiving. (line 12) +* org-archive-default-command <1>: Agenda Commands. (line 250) +* org-archive-location: Moving subtrees. (line 10) +* org-archive-location <1>: In-buffer Settings. (line 15) +* org-archive-save-context-info: Moving subtrees. (line 41) +* org-ascii-links-to-notes: ASCII/Latin-1/UTF-8 export. + (line 16) +* org-ascii-text-width: ASCII/Latin-1/UTF-8 export. + (line 13) +* org-attach-directory: Attachments. (line 6) +* org-attach-method: Attachments. (line 32) +* org-babel-default-header-args: Using Header Arguments. + (line 19) +* org-babel-default-header-args <1>: Using Header Arguments. + (line 19) +* org-babel-inline-result-wrap: Evaluating Code Blocks. + (line 27) +* org-babel-load-languages: Languages. (line 35) +* org-babel-post-tangle-hook: Extracting Source Code. + (line 122) +* org-beamer-environments-default: Frames and Blocks in Beamer. + (line 25) +* org-beamer-environments-extra: Frames and Blocks in Beamer. + (line 25) +* org-beamer-frame-level: Frames and Blocks in Beamer. + (line 10) +* org-beamer-theme: Beamer specific export settings. + (line 11) +* org-calc-default-modes: Formula syntax for Calc. + (line 17) +* org-capture-bookmark: Using capture. (line 48) +* org-capture-last-stored: Using capture. (line 48) +* org-capture-templates: Capture templates. (line 11) +* org-capture-templates-contexts: Templates in contexts. + (line 6) +* org-capture-use-agenda-date: Agenda Commands. (line 343) +* org-catch-invisible-edits: Catching invisible edits. + (line 6) +* org-clock-continuously: Clocking commands. (line 7) +* org-clock-continuously <1>: Clocking commands. (line 43) +* org-clock-continuously <2>: Resolving idle time. (line 78) +* org-clock-display-default-range: The clock table. (line 79) +* org-clock-idle-time: Resolving idle time. (line 14) +* org-clock-in-prepare-hook: Clocking commands. (line 20) +* org-clock-into-drawer: Clocking commands. (line 7) +* org-clock-mode-line-total: Clocking commands. (line 20) +* org-clock-persist: Clocking Work Time. (line 19) +* org-clock-report-include-clocking-task: Agenda Commands. (line 154) +* org-clock-x11idle-program-name: Resolving idle time. (line 14) +* org-clocktable-defaults: The clock table. (line 38) +* org-closed-keep-when-no-todo: Closing items. (line 11) +* org-coderef-label-format: Literal Examples. (line 76) +* org-columns: Using column view. (line 10) +* org-columns-default-format: Using column view. (line 10) +* org-columns-default-format <1>: Effort Estimates. (line 31) +* org-columns-default-format <2>: Agenda Commands. (line 197) +* org-columns-default-format <3>: Agenda Column View. (line 19) +* org-columns-skip-archived-trees: Internal archiving. (line 33) +* org-columns-summary-types: Column attributes. (line 51) +* org-complete-tags-always-offer-all-agenda-tags: Setting Tags. + (line 22) +* org-confirm-babel-evaluate: Code Evaluation Security. + (line 25) +* org-confirm-elisp-link-function: Code Evaluation Security. + (line 52) +* org-confirm-shell-link-function: Code Evaluation Security. + (line 49) +* org-create-file-search-functions: Custom Searches. (line 12) +* org-crypt-tag-matcher: Org Crypt. (line 10) +* org-ctrl-k-protect-subtree: Headlines. (line 6) +* org-cycle-emulate-tab: Global and local cycling. + (line 16) +* org-cycle-global-at-bob: Global and local cycling. + (line 30) +* org-cycle-include-plain-lists: Plain Lists. (line 70) +* org-cycle-open-archived-trees: Internal archiving. (line 13) +* org-cycle-separator-lines: Headlines. (line 24) +* org-deadline-warning-days: Deadlines and Scheduling. + (line 14) +* org-deadline-warning-days <1>: Inserting deadline/schedule. + (line 26) +* org-default-notes-file: Setting up capture. (line 8) +* org-default-notes-file <1>: Template elements. (line 50) +* org-default-priority: Priorities. (line 38) +* org-default-priority <1>: In-buffer Settings. (line 43) +* org-directory: Template elements. (line 50) +* org-display-custom-times: Custom time format. (line 6) +* org-display-internal-link-with-indirect-buffer: Handling Links. + (line 135) +* org-disputed-keys: Conflicts. (line 27) +* org-done, face: Faces for TODO keywords. + (line 6) +* org-edit-src-auto-save-idle-delay: Editing Source Code. (line 11) +* org-effort-property: Effort Estimates. (line 6) +* org-email-link-description-format: Handling Links. (line 31) +* org-enforce-todo-dependencies: TODO dependencies. (line 6) +* org-enforce-todo-dependencies <1>: TODO dependencies. (line 53) +* org-entities-user: Special Symbols. (line 16) +* org-execute-file-search-functions: Custom Searches. (line 12) +* org-export-allow-bind-keywords: Export Settings. (line 210) +* org-export-async-init-file: The Export Dispatcher. + (line 42) +* org-export-backends: Exporting. (line 33) +* org-export-before-parsing-hook: Advanced Export Configuration. + (line 9) +* org-export-before-processing-hook: Advanced Export Configuration. + (line 9) +* org-export-creator-string: HTML preamble and postamble. + (line 6) +* org-export-date-timestamp-format: Export Settings. (line 32) +* org-export-default-language: Export Settings. (line 38) +* org-export-dispatch-use-expert-ui: The Export Dispatcher. + (line 10) +* org-export-exclude-tags: Export Settings. (line 52) +* org-export-global-macros: Macro Replacement. (line 6) +* org-export-headline-levels: Export Settings. (line 141) +* org-export-html-table-tag: Tables in HTML export. + (line 6) +* org-export-html-tag-class-prefix: CSS support. (line 6) +* org-export-html-todo-kwd-class-prefix: CSS support. (line 6) +* org-export-html-use-infojs: JavaScript support. (line 71) +* org-export-in-background: The Export Dispatcher. + (line 39) +* org-export-initial-scope: The Export Dispatcher. + (line 60) +* org-export-odt-convert-capabilities: Advanced topics in ODT export. + (line 22) +* org-export-odt-convert-process: Advanced topics in ODT export. + (line 28) +* org-export-odt-convert-processes: Advanced topics in ODT export. + (line 17) +* org-export-odt-preferred-output-format: ODT export commands. + (line 25) +* org-export-odt-schema-dir: Advanced topics in ODT export. + (line 269) +* org-export-preserve-breaks: Export Settings. (line 93) +* org-export-select-tags: Export Settings. (line 44) +* org-export-time-stamp-file: Export Settings. (line 187) +* org-export-time-stamp-file <1>: HTML preamble and postamble. + (line 6) +* org-export-use-babel: Exporting Code Blocks. + (line 34) +* org-export-with-archived-trees: Internal archiving. (line 29) +* org-export-with-archived-trees <1>: Export Settings. (line 102) +* org-export-with-author: Export Settings. (line 107) +* org-export-with-broken-links: Export Settings. (line 111) +* org-export-with-clocks: Export Settings. (line 116) +* org-export-with-creator: Export Settings. (line 119) +* org-export-with-date: Export Settings. (line 127) +* org-export-with-drawers: Export Settings. (line 123) +* org-export-with-email: Export Settings. (line 134) +* org-export-with-emphasize: Export Settings. (line 79) +* org-export-with-entities: Export Settings. (line 131) +* org-export-with-fixed-width: Export Settings. (line 86) +* org-export-with-footnotes: Export Settings. (line 138) +* org-export-with-inlinetasks: Export Settings. (line 146) +* org-export-with-latex: LaTeX fragments. (line 38) +* org-export-with-latex <1>: Export Settings. (line 183) +* org-export-with-planning: Export Settings. (line 157) +* org-export-with-priority: Export Settings. (line 163) +* org-export-with-properties: Export Settings. (line 166) +* org-export-with-section-numbers: Export Settings. (line 149) +* org-export-with-smart-quotes: Export Settings. (line 73) +* org-export-with-special-strings: Export Settings. (line 82) +* org-export-with-statistics-cookies: Export Settings. (line 170) +* org-export-with-sub-superscripts: Export Settings. (line 97) +* org-export-with-tables: Export Settings. (line 202) +* org-export-with-tags: Export Settings. (line 174) +* org-export-with-tasks: Export Settings. (line 178) +* org-export-with-timestamps: Export Settings. (line 89) +* org-export-with-title: Export Settings. (line 191) +* org-export-with-toc: Export Settings. (line 194) +* org-export-with-toc <1>: Table of Contents. (line 6) +* org-export-with-todo-keywords: Export Settings. (line 198) +* org-expot-creator-string: Export Settings. (line 28) +* org-faces-easy-properties: Faces for TODO keywords. + (line 17) +* org-fast-tag-selection-include-todo: Fast access to TODO states. + (line 16) +* org-fast-tag-selection-single-key: Setting Tags. (line 141) +* org-file-apps: Handling Links. (line 106) +* org-file-apps <1>: Attachments. (line 49) +* org-fontify-emphasized-text: Emphasis and Monospace. + (line 11) +* org-footnote-auto-adjust: Creating Footnotes. (line 62) +* org-footnote-auto-adjust <1>: In-buffer Settings. (line 211) +* org-footnote-auto-label: Creating Footnotes. (line 34) +* org-footnote-auto-label <1>: In-buffer Settings. (line 211) +* org-footnote-define-inline: Creating Footnotes. (line 47) +* org-footnote-define-inline <1>: In-buffer Settings. (line 211) +* org-footnote-section: Headlines. (line 17) +* org-footnote-section <1>: Creating Footnotes. (line 47) +* org-format-latex-header: LaTeX fragments. (line 6) +* org-format-latex-header <1>: Previewing LaTeX fragments. + (line 12) +* org-format-latex-options: Previewing LaTeX fragments. + (line 12) +* org-from-is-user-regexp: Template expansion. (line 104) +* org-global-properties: Property Syntax. (line 76) +* org-global-properties <1>: Effort Estimates. (line 31) +* org-goto-auto-isearch: Motion. (line 24) +* org-goto-interface: Motion. (line 41) +* org-group-tags: Tag Hierarchy. (line 86) +* org-habit-following-days: Tracking your habits. + (line 91) +* org-habit-graph-column: Tracking your habits. + (line 82) +* org-habit-preceding-days: Tracking your habits. + (line 87) +* org-habit-show-habits-only-for-today: Tracking your habits. + (line 94) +* org-hide, face: Clean View. (line 68) +* org-hide-block-startup: Blocks. (line 6) +* org-hide-block-startup <1>: In-buffer Settings. (line 239) +* org-hide-leading-stars: In-buffer Settings. (line 172) +* org-hide-leading-stars <1>: Clean View. (line 54) +* org-hide-macro-markers: Macro Replacement. (line 88) +* org-hierarchical-checkbox-statistics: Checkboxes. (line 30) +* org-hierarchical-todo-statistics: Breaking Down Tasks. (line 25) +* org-highest-priority: Priorities. (line 38) +* org-highest-priority <1>: In-buffer Settings. (line 43) +* org-html-container-element: HTML specific export settings. + (line 19) +* org-html-doctype: HTML specific export settings. + (line 16) +* org-html-doctype <1>: HTML doctypes. (line 8) +* org-html-doctype-alist: HTML doctypes. (line 8) +* org-html-head: HTML specific export settings. + (line 35) +* org-html-head <1>: CSS support. (line 44) +* org-html-head-extra: HTML specific export settings. + (line 39) +* org-html-head-extra <1>: CSS support. (line 44) +* org-html-head-include-default-style: CSS support. (line 52) +* org-html-html5-elements: HTML doctypes. (line 60) +* org-html-html5-fancy: HTML doctypes. (line 25) +* org-html-inline-images: Images in HTML export. + (line 9) +* org-html-link-home: HTML specific export settings. + (line 23) +* org-html-link-org-files-as-html: Links in HTML export. + (line 12) +* org-html-link-up: HTML specific export settings. + (line 26) +* org-html-mathjax-options: HTML specific export settings. + (line 30) +* org-html-mathjax-options~: Math formatting in HTML export. + (line 6) +* org-html-mathjax-template: Math formatting in HTML export. + (line 20) +* org-html-postamble: HTML preamble and postamble. + (line 6) +* org-html-postamble-format: HTML preamble and postamble. + (line 6) +* org-html-preamble: HTML preamble and postamble. + (line 6) +* org-html-preamble-format: HTML preamble and postamble. + (line 6) +* org-html-style-default: CSS support. (line 44) +* org-html-table-align-individual-fields: Tables in HTML export. + (line 20) +* org-html-table-caption-above: Tables in HTML export. + (line 24) +* org-html-table-data-tags: Tables in HTML export. + (line 27) +* org-html-table-default-attributes: Tables in HTML export. + (line 30) +* org-html-table-header-tags: Tables in HTML export. + (line 33) +* org-html-table-row-tags: Tables in HTML export. + (line 36) +* org-html-table-use-header-tags-for-first-column: Tables in HTML export. + (line 39) +* org-html-validation-link: HTML preamble and postamble. + (line 6) +* org-icalendar-alarm-time: iCalendar Export. (line 20) +* org-icalendar-categories: iCalendar Export. (line 20) +* org-icalendar-combined-agenda-file: iCalendar Export. (line 47) +* org-icalendar-include-body: iCalendar Export. (line 57) +* org-icalendar-include-todo: iCalendar Export. (line 11) +* org-icalendar-store-UID: iCalendar Export. (line 26) +* org-icalendar-use-deadline: iCalendar Export. (line 11) +* org-icalendar-use-scheduled: iCalendar Export. (line 11) +* org-id-link-to-org-use-id: Handling Links. (line 21) +* org-imenu-depth: Cooperation. (line 37) +* org-indent-indentation-per-level: Clean View. (line 24) +* org-infojs-options: JavaScript support. (line 71) +* org-insert-mode-line-in-empty-file: Activation. (line 30) +* org-irc-links-to-logs: Handling Links. (line 45) +* org-keep-stored-link-after-insertion: Handling Links. (line 69) +* org-latex-bibtex-compiler: LaTeX/PDF export commands. + (line 25) +* org-latex-classes: LaTeX specific export settings. + (line 32) +* org-latex-classes <1>: LaTeX specific export settings. + (line 49) +* org-latex-classes <2>: LaTeX header and sectioning. + (line 13) +* org-latex-compiler: LaTeX/PDF export commands. + (line 25) +* org-latex-compiler <1>: LaTeX specific export settings. + (line 44) +* org-latex-default-class: LaTeX specific export settings. + (line 32) +* org-latex-default-class <1>: LaTeX header and sectioning. + (line 13) +* org-latex-default-packages-alist: LaTeX/PDF export commands. + (line 25) +* org-latex-default-packages-alist <1>: LaTeX header and sectioning. + (line 13) +* org-latex-default-table-environment: Tables in LaTeX export. + (line 23) +* org-latex-default-table-mode: Tables in LaTeX export. + (line 12) +* org-latex-hyperref-template: LaTeX specific export settings. + (line 11) +* org-latex-hyperref-template <1>: LaTeX specific export settings. + (line 54) +* org-latex-images-centered: Images in LaTeX export. + (line 57) +* org-latex-listings: Literal Examples. (line 23) +* org-latex-listings-options: Source blocks in LaTeX export. + (line 25) +* org-latex-minted-options: Source blocks in LaTeX export. + (line 25) +* org-latex-package-alist: LaTeX specific export settings. + (line 20) +* org-latex-packages-alist: LaTeX header and sectioning. + (line 13) +* org-latex-subtitle-format: LaTeX specific export settings. + (line 63) +* org-latex-subtitle-separate: LaTeX specific export settings. + (line 63) +* org-latex-tables-booktabs: Tables in LaTeX export. + (line 65) +* org-latex-tables-centered: Tables in LaTeX export. + (line 65) +* org-latex-title-command: LaTeX specific export settings. + (line 11) +* org-latex-title-command <1>: LaTeX specific export settings. + (line 54) +* org-latex-to-mathml-convert-command: LaTeX math snippets. (line 20) +* org-latex-to-mathml-jar-file: LaTeX math snippets. (line 20) +* org-link-abbrev-alist: Link Abbreviations. (line 12) +* org-link-abbrev-alist <1>: In-buffer Settings. (line 38) +* org-link-frame-setup: Handling Links. (line 121) +* org-link-parameters: Adding Hyperlink Types. + (line 69) +* org-list-automatic-rules: Plain Lists. (line 63) +* org-list-automatic-rules <1>: Checkboxes. (line 6) +* org-list-demote-modify-bullet: Plain Lists. (line 57) +* org-list-indent-offset: Plain Lists. (line 57) +* org-list-use-circular-motion: Plain Lists. (line 95) +* org-log-done: Tracking TODO state changes. + (line 29) +* org-log-done <1>: Agenda Commands. (line 131) +* org-log-done <2>: In-buffer Settings. (line 117) +* org-log-into-drawer: Tracking TODO state changes. + (line 6) +* org-log-into-drawer <1>: Agenda Commands. (line 293) +* org-log-note-clock-out: Clocking commands. (line 35) +* org-log-note-clock-out <1>: In-buffer Settings. (line 117) +* org-log-redeadline: Inserting deadline/schedule. + (line 10) +* org-log-refile: Refile and Copy. (line 17) +* org-log-repeat: Repeated tasks. (line 40) +* org-log-repeat <1>: In-buffer Settings. (line 117) +* org-log-reschedule: Inserting deadline/schedule. + (line 18) +* org-log-states-order-reversed: Tracking TODO state changes. + (line 6) +* org-lowest-priority: Priorities. (line 38) +* org-lowest-priority <1>: In-buffer Settings. (line 43) +* org-M-RET-may-split-line: Structure Editing. (line 7) +* org-M-RET-may-split-line <1>: Plain Lists. (line 83) +* org-md-headline-style: Markdown Export. (line 29) +* org-mobile-directory: Setting up the staging area. + (line 6) +* org-mobile-encryption: Setting up the staging area. + (line 19) +* org-mobile-files: Pushing to the mobile application. + (line 6) +* org-mobile-inbox-for-pull: Pulling from the mobile application. + (line 12) +* org-odd-levels-only: Matching tags and properties. + (line 64) +* org-odd-levels-only <1>: In-buffer Settings. (line 172) +* org-odd-levels-only <2>: Clean View. (line 74) +* org-odd-levels-only <3>: Special Agenda Views. + (line 41) +* org-odt-category-map-alist: Labels and captions in ODT export. + (line 21) +* org-odt-convert-process: Extending ODT export. + (line 12) +* org-odt-create-custom-styles-for-srcblocks: Literal examples in ODT export. + (line 16) +* org-odt-fontify-srcblocks: Literal examples in ODT export. + (line 13) +* org-odt-pixels-per-inch: Images in ODT export. + (line 34) +* org-odt-preferred-output-format: ODT export commands. (line 9) +* org-odt-preferred-output-format <1>: Extending ODT export. + (line 21) +* org-odt-styles-file: ODT specific export settings. + (line 22) +* org-odt-styles-file <1>: Applying custom styles. + (line 25) +* org-odt-table-styles: Advanced topics in ODT export. + (line 158) +* org-odt-table-styles <1>: Advanced topics in ODT export. + (line 226) +* org-outline-path-complete-in-steps: Refile and Copy. (line 17) +* org-overriding-columns-format: Agenda Column View. (line 19) +* org-plain-list-ordered-item-terminator: Plain Lists. (line 15) +* org-plain-list-ordered-item-terminator <1>: Plain Lists. (line 131) +* org-popup-calendar-for-date-prompt: The date/time prompt. + (line 75) +* org-pretty-entities: In-buffer Settings. (line 248) +* org-preview-latex-default-process: Previewing LaTeX fragments. + (line 6) +* org-priority-faces: Priorities. (line 13) +* org-priority-start-cycle-with-default: Priorities. (line 33) +* org-property-allowed-value-functions: Using the Property API. + (line 63) +* org-protocol-default-template-key: capture protocol. (line 19) +* org-protocol-project-alist: open-source protocol. + (line 13) +* org-publish-project-alist: Project alist. (line 6) +* org-publish-project-alist <1>: Publishing options. (line 12) +* org-publish-use-timestamps-flag: Triggering Publication. + (line 21) +* org-put-time-stamp-overlays: In-buffer Settings. (line 195) +* org-read-date-display-live: The date/time prompt. + (line 94) +* org-read-date-force-compatible-dates: The date/time prompt. + (line 60) +* org-read-date-prefer-future: The date/time prompt. + (line 6) +* org-refile-allow-creating-parent-nodes: Refile and Copy. (line 17) +* org-refile-keep: Refile and Copy. (line 45) +* org-refile-targets: Refile and Copy. (line 17) +* org-refile-use-cache: Refile and Copy. (line 50) +* org-refile-use-outline-path: Refile and Copy. (line 17) +* org-remove-highlights-with-change: Sparse Trees. (line 20) +* org-remove-highlights-with-change <1>: Clocking commands. (line 83) +* org-replace-disputed-keys: Conflicts. (line 17) +* org-return-follows-link: Handling Links. (line 127) +* org-reverse-note-order: Refile and Copy. (line 17) +* org-scheduled-delay-days: Deadlines and Scheduling. + (line 42) +* org-show-context-detail: Sparse Trees. (line 6) +* org-sort-agenda-noeffort-is-high: Filtering/limiting agenda times. + (line 88) +* org-sparse-tree-open-archived-trees: Internal archiving. (line 19) +* org-special-ctrl-a/e: Headlines. (line 6) +* org-special-ctrl-k: Headlines. (line 6) +* org-speed-commands-user: Speed Keys. (line 18) +* org-src-ask-before-returning-to-edit-buffer: Editing Source Code. + (line 40) +* org-src-block-faces: Editing Source Code. (line 43) +* org-src-fontify-natively: Editing Source Code. (line 43) +* org-src-lang-modes: Editing Source Code. (line 22) +* org-src-preserve-indentation: Editing Source Code. (line 32) +* org-src-window-setup: Editing Source Code. (line 28) +* org-startup-align-all-tables: Column Width and Alignment. + (line 19) +* org-startup-align-all-tables <1>: In-buffer Settings. (line 93) +* org-startup-folded: Initial visibility. (line 6) +* org-startup-folded <1>: In-buffer Settings. (line 67) +* org-startup-folded <2>: Speeding Up Your Agendas. + (line 19) +* org-startup-indented: In-buffer Settings. (line 84) +* org-startup-indented <1>: Clean View. (line 32) +* org-startup-shrink-all-tables: Column Width and Alignment. + (line 64) +* org-startup-shrink-all-tables <1>: In-buffer Settings. (line 103) +* org-startup-with-inline-images: Images. (line 24) +* org-startup-with-inline-images <1>: In-buffer Settings. (line 107) +* org-startup-with-latex-preview: Previewing LaTeX fragments. + (line 26) +* org-store-link-props: Template expansion. (line 102) +* org-structure-template-alist: Structure Templates. (line 17) +* org-stuck-projects: Stuck projects. (line 17) +* org-support-shift-select: Plain Lists. (line 95) +* org-support-shift-select <1>: Plain Lists. (line 154) +* org-support-shift-select <2>: Conflicts. (line 6) +* org-table-automatic-realign: Column Width and Alignment. + (line 10) +* org-table-copy-increment: Built-in Table Editor. + (line 173) +* org-table-current-column: References. (line 89) +* org-table-current-dline: References. (line 89) +* org-table-duration-custom-format: Durations and time values. + (line 6) +* org-table-export-default-format: Built-in Table Editor. + (line 210) +* org-table-formula: In-buffer Settings. (line 28) +* org-table-formula-constants: References. (line 113) +* org-table-formula-constants <1>: In-buffer Settings. (line 28) +* org-table-formula-constants <2>: Cooperation. (line 14) +* org-table-use-standard-references: Editing and debugging formulas. + (line 6) +* org-tag-alist: Setting Tags. (line 22) +* org-tag-alist <1>: In-buffer Settings. (line 258) +* org-tag-faces: Tags. (line 10) +* org-tag-persistent-alist: Setting Tags. (line 37) +* org-tags-column: Setting Tags. (line 11) +* org-tags-exclude-from-inheritance: Tag Inheritance. (line 22) +* org-tags-match-list-sublevels: Tag Inheritance. (line 26) +* org-tags-match-list-sublevels <1>: Tag Searches. (line 19) +* org-tags-match-list-sublevels <2>: Property Searches. (line 18) +* org-tags-match-list-sublevels <3>: Matching tags and properties. + (line 21) +* org-tempo-keywords-alist: Structure Templates. (line 21) +* org-texinfo-classes: Texinfo file header. (line 19) +* org-texinfo-classes <1>: Headings and sectioning structure. + (line 6) +* org-texinfo-coding-system: Texinfo file header. (line 11) +* org-texinfo-default-class: Texinfo specific export settings. + (line 20) +* org-texinfo-default-class <1>: Headings and sectioning structure. + (line 6) +* org-texinfo-info-process: Texinfo export commands. + (line 11) +* org-texinfo-table-default-markup: Plain lists in Texinfo export. + (line 12) +* org-time-stamp-custom-formats: Custom time format. (line 6) +* org-time-stamp-overlay-formats: In-buffer Settings. (line 195) +* org-time-stamp-rounding-minutes: Creating Timestamps. (line 16) +* org-timer-default-timer: Timers. (line 23) +* org-todo, face: Faces for TODO keywords. + (line 6) +* org-todo-keyword-faces: Faces for TODO keywords. + (line 6) +* org-todo-keywords: TODO Basics. (line 41) +* org-todo-keywords <1>: TODO Extensions. (line 6) +* org-todo-keywords <2>: Global TODO list. (line 18) +* org-todo-keywords <3>: In-buffer Settings. (line 265) +* org-todo-repeat-to-state: Repeated tasks. (line 22) +* org-todo-state-tags-triggers: TODO Basics. (line 62) +* org-track-ordered-property-with-tag: TODO dependencies. (line 38) +* org-track-ordered-property-with-tag <1>: Checkboxes. (line 80) +* org-treat-insert-todo-heading-as-state-change: Structure Editing. + (line 29) +* org-treat-S-cursor-todo-selection-as-state-change: TODO Basics. + (line 34) +* org-use-property-inheritance: Property Inheritance. + (line 6) +* org-use-property-inheritance <1>: Using Header Arguments. + (line 56) +* org-use-property-inheritance <2>: Using the Property API. + (line 19) +* org-use-speed-commands: Speed Keys. (line 13) +* org-use-sub-superscripts: Subscripts and Superscripts. + (line 13) +* org-use-tag-inheritance: Tag Inheritance. (line 22) +* org-yank-adjusted-subtrees: Structure Editing. (line 79) +* org-yank-folded-subtrees: Structure Editing. (line 79) +* parse-time-months: The date/time prompt. + (line 56) +* parse-time-weekdays: The date/time prompt. + (line 56) +* user-full-name: Export Settings. (line 25) +* user-mail-address: Export Settings. (line 35) + + + +Tag Table: +Node: Top879 +Node: Introduction21533 +Node: Summary21990 +Node: Installation24702 +Ref: Using Emacs packaging system25327 +Ref: Downloading Org as an archive25884 +Ref: Using Org's git repository26542 +Node: Activation27438 +Ref: Activation-Footnote-129082 +Node: Feedback29209 +Ref: How to create a useful backtrace31802 +Ref: Feedback-Footnote-132954 +Node: Conventions33080 +Ref: TODO keywords tags properties etc33246 +Ref: Key bindings and commands34131 +Node: Document Structure34761 +Node: Headlines36006 +Ref: Headlines-Footnote-137073 +Node: Visibility Cycling37352 +Node: Global and local cycling37737 +Ref: Global and local cycling-Footnote-140471 +Ref: Global and local cycling-Footnote-240533 +Node: Initial visibility40837 +Ref: Initial visibility-Footnote-141905 +Node: Catching invisible edits42098 +Node: Motion42569 +Node: Structure Editing44028 +Node: Sparse Trees50487 +Ref: Sparse Trees-Footnote-153043 +Ref: Sparse Trees-Footnote-253158 +Node: Plain Lists53234 +Ref: Plain Lists-Footnote-160730 +Ref: Plain Lists-Footnote-261094 +Ref: Plain Lists-Footnote-361194 +Ref: Plain Lists-Footnote-461451 +Ref: Plain Lists-Footnote-561628 +Ref: Plain Lists-Footnote-661732 +Ref: Plain Lists-Footnote-761838 +Node: Drawers61908 +Ref: Drawers-Footnote-163573 +Node: Blocks63685 +Node: Creating Footnotes64300 +Ref: Creating Footnotes-Footnote-167462 +Ref: Creating Footnotes-Footnote-267568 +Node: Tables67675 +Node: Built-in Table Editor68353 +Ref: Creation and conversion70083 +Ref: Re-aligning and field motion71021 +Ref: Column and row editing71948 +Ref: Regions73904 +Ref: Calculations75303 +Ref: Miscellaneous (1)76101 +Ref: Built-in Table Editor-Footnote-178161 +Node: Column Width and Alignment78269 +Node: Column Groups81601 +Node: Orgtbl Mode83163 +Node: The Spreadsheet83972 +Node: References85441 +Ref: Field references85895 +Ref: Range references88334 +Ref: Field coordinates in formulas89556 +Ref: Named references90542 +Ref: Remote references91513 +Ref: References-Footnote-192435 +Ref: References-Footnote-292663 +Ref: References-Footnote-392766 +Node: Formula syntax for Calc93091 +Ref: Formula syntax for Calc-Footnote-198613 +Node: Formula syntax for Lisp98952 +Node: Durations and time values100730 +Node: Field and range formulas102112 +Node: Column formulas104576 +Node: Lookup functions106683 +Node: Editing and debugging formulas108647 +Ref: Using multiple TBLFM lines113159 +Ref: Debugging formulas114002 +Node: Updating the table114426 +Node: Advanced features115793 +Ref: Advanced features-Footnote-1120239 +Node: Org Plot120347 +Ref: Graphical plots using Gnuplot120543 +Ref: Plot options121742 +Ref: ASCII bar plots123515 +Node: Hyperlinks124765 +Node: Link Format125624 +Ref: Link Format-Footnote-1127540 +Ref: Link Format-Footnote-2127772 +Node: Internal Links127904 +Ref: Internal Links-Footnote-1130121 +Ref: Internal Links-Footnote-2130361 +Node: Radio Targets130502 +Node: External Links131214 +Ref: External Links-Footnote-1135355 +Node: Handling Links135779 +Ref: Handling Links-Footnote-1143481 +Ref: Handling Links-Footnote-2143642 +Ref: Handling Links-Footnote-3143832 +Ref: Handling Links-Footnote-4144128 +Ref: Handling Links-Footnote-5144390 +Ref: Handling Links-Footnote-6144512 +Node: Using Links Outside Org144591 +Node: Link Abbreviations145061 +Node: Search Options147947 +Ref: Search Options-Footnote-1149906 +Node: Custom Searches149987 +Node: TODO Items151017 +Ref: TODO Items-Footnote-1152137 +Node: TODO Basics152251 +Node: TODO Extensions155170 +Node: Workflow states156218 +Ref: Workflow states-Footnote-1157577 +Node: TODO types157693 +Ref: TODO types-Footnote-1159332 +Node: Multiple sets in one file159404 +Node: Fast access to TODO states161366 +Ref: Fast access to TODO states-Footnote-1162244 +Ref: Fast access to TODO states-Footnote-2162351 +Node: Per-file keywords162653 +Ref: Per-file keywords-Footnote-1164097 +Node: Faces for TODO keywords164301 +Node: TODO dependencies165369 +Node: Progress Logging167818 +Node: Closing items168534 +Ref: Closing items-Footnote-1169519 +Ref: Closing items-Footnote-2169593 +Node: Tracking TODO state changes169671 +Ref: Tracking TODO state changes-Footnote-1172879 +Ref: Tracking TODO state changes-Footnote-2172941 +Ref: Tracking TODO state changes-Footnote-3173099 +Node: Tracking your habits173377 +Node: Priorities177729 +Ref: Priorities-Footnote-1179859 +Node: Breaking Down Tasks179932 +Ref: Breaking Down Tasks-Footnote-1181965 +Node: Checkboxes182072 +Ref: Checkboxes-Footnote-1186720 +Ref: Checkboxes-Footnote-2186848 +Ref: Checkboxes-Footnote-3187028 +Node: Tags187142 +Node: Tag Inheritance188230 +Ref: Tag Inheritance-Footnote-1190097 +Ref: Tag Inheritance-Footnote-2190201 +Node: Setting Tags190331 +Ref: Setting Tags-Footnote-1196802 +Ref: Setting Tags-Footnote-2196980 +Node: Tag Hierarchy197058 +Node: Tag Searches200619 +Node: Properties and Columns201925 +Node: Property Syntax203318 +Node: Special Properties207588 +Node: Property Searches209335 +Node: Property Inheritance210770 +Node: Column View212637 +Node: Defining columns213883 +Node: Scope of column definitions214263 +Node: Column attributes215173 +Ref: Column attributes-Footnote-1219577 +Ref: Column attributes-Footnote-2219708 +Ref: Column attributes-Footnote-3219906 +Node: Using column view220045 +Ref: Turning column view on or off220206 +Ref: Editing values221184 +Ref: Modifying column view on-the-fly222554 +Node: Capturing column view222926 +Ref: Capturing column view-Footnote-1226166 +Node: Dates and Times226303 +Node: Timestamps227217 +Ref: Timestamps-Footnote-1229614 +Ref: Timestamps-Footnote-2229910 +Node: Creating Timestamps230653 +Node: The date/time prompt233662 +Ref: The date/time prompt-Footnote-1238397 +Ref: The date/time prompt-Footnote-2238568 +Ref: The date/time prompt-Footnote-3238679 +Node: Custom time format238777 +Node: Deadlines and Scheduling240541 +Ref: Deadlines and Scheduling-Footnote-1244094 +Node: Inserting deadline/schedule244254 +Ref: Inserting deadline/schedule-Footnote-1246241 +Ref: Inserting deadline/schedule-Footnote-2246402 +Ref: Inserting deadline/schedule-Footnote-3246528 +Node: Repeated tasks246654 +Ref: Repeated tasks-Footnote-1251131 +Ref: Repeated tasks-Footnote-2251214 +Ref: Repeated tasks-Footnote-3251497 +Node: Clocking Work Time251719 +Ref: Clocking Work Time-Footnote-1252919 +Ref: Clocking Work Time-Footnote-2253072 +Node: Clocking commands253214 +Ref: Clocking commands-Footnote-1258297 +Ref: Clocking commands-Footnote-2258412 +Ref: Clocking commands-Footnote-3258494 +Ref: Clocking commands-Footnote-4258557 +Node: The clock table258640 +Ref: The clock table-Footnote-1266594 +Ref: The clock table-Footnote-2266703 +Ref: The clock table-Footnote-3266801 +Node: Resolving idle time266927 +Ref: Resolving idle time (1)267118 +Ref: Continuous clocking270315 +Ref: Resolving idle time-Footnote-1270857 +Node: Effort Estimates271336 +Ref: Effort Estimates-Footnote-1274112 +Node: Timers274223 +Node: Capture Refile Archive276437 +Node: Capture277418 +Node: Setting up capture277934 +Node: Using capture278290 +Node: Capture templates280681 +Node: Template elements282704 +Ref: Template elements-Footnote-1289403 +Ref: Template elements-Footnote-2289736 +Node: Template expansion289923 +Ref: Template expansion-Footnote-1293838 +Ref: Template expansion-Footnote-2293929 +Ref: Template expansion-Footnote-3294119 +Node: Templates in contexts294216 +Node: Attachments295050 +Ref: Attachments-Footnote-1299737 +Node: RSS Feeds299891 +Node: Protocols301351 +Node: store-link protocol302813 +Node: capture protocol303627 +Node: open-source protocol304771 +Node: Refile and Copy307978 +Ref: Refile and Copy-Footnote-1310444 +Node: Archiving310558 +Node: Moving subtrees311266 +Node: Internal archiving313290 +Node: Agenda Views316010 +Node: Agenda Files318411 +Ref: Agenda Files-Footnote-1321317 +Ref: Agenda Files-Footnote-2321461 +Node: Agenda Dispatcher321659 +Ref: Agenda Dispatcher-Footnote-1324393 +Ref: Agenda Dispatcher-Footnote-2324491 +Node: Built-in Agenda Views324597 +Node: Weekly/daily agenda325189 +Ref: Calendar/Diary integration326524 +Ref: Anniversaries from BBDB328583 +Ref: Appointment reminders330375 +Ref: Weekly/daily agenda-Footnote-1330925 +Ref: Weekly/daily agenda-Footnote-2331169 +Node: Global TODO list331389 +Node: Matching tags and properties334011 +Node: Search view341079 +Node: Stuck projects342676 +Node: Presentation and Sorting344808 +Node: Categories345780 +Node: Time-of-day specifications346524 +Ref: Time-of-day specifications-Footnote-1348510 +Node: Sorting of agenda items348633 +Node: Filtering/limiting agenda times350246 +Ref: Filtering in the agenda350885 +Ref: Setting limits for the agenda355552 +Ref: Filtering/limiting agenda times-Footnote-1357101 +Node: Agenda Commands357517 +Ref: Motion (1)358245 +Ref: View/Go to Org file358448 +Ref: Change display359954 +Ref: Remote editing367453 +Ref: Bulk remote editing selected entries372613 +Ref: Calendar commands375708 +Ref: Quit and exit377589 +Ref: Agenda Commands-Footnote-1377951 +Ref: Agenda Commands-Footnote-2378027 +Ref: Agenda Commands-Footnote-3378131 +Node: Custom Agenda Views378218 +Node: Storing searches378865 +Ref: Storing searches-Footnote-1381814 +Ref: Storing searches-Footnote-2381931 +Node: Block agenda382178 +Node: Setting options383429 +Node: Exporting Agenda Views387038 +Ref: Exporting Agenda Views-Footnote-1391572 +Ref: Exporting Agenda Views-Footnote-2391726 +Ref: Exporting Agenda Views-Footnote-3391876 +Ref: Exporting Agenda Views-Footnote-4392063 +Node: Agenda Column View392145 +Node: Markup for Rich Contents395255 +Node: Paragraphs396490 +Node: Emphasis and Monospace397620 +Node: Subscripts and Superscripts398271 +Node: Special Symbols399323 +Ref: Special Symbols-Footnote-1401231 +Ref: Special Symbols-Footnote-2401396 +Node: Embedded LaTeX401493 +Ref: Embedded LaTeX-Footnote-1402337 +Node: LaTeX fragments402533 +Ref: LaTeX fragments-Footnote-1404684 +Node: Previewing LaTeX fragments404877 +Ref: Previewing LaTeX fragments-Footnote-1406315 +Node: CDLaTeX mode406563 +Ref: CDLaTeX mode-Footnote-1409119 +Node: Literal Examples409266 +Ref: Literal Examples-Footnote-1413845 +Ref: Literal Examples-Footnote-2414215 +Ref: Literal Examples-Footnote-3414393 +Ref: Literal Examples-Footnote-4414578 +Ref: Literal Examples-Footnote-5414843 +Node: Images414941 +Ref: Images-Footnote-1416020 +Ref: Images-Footnote-2416143 +Node: Captions416304 +Node: Horizontal Rules416999 +Node: Exporting417223 +Node: The Export Dispatcher419937 +Node: Export Settings422650 +Ref: Export Settings-Footnote-1430738 +Ref: Export Settings-Footnote-2430850 +Ref: Export Settings-Footnote-3430951 +Node: Table of Contents431149 +Ref: Table of Contents-Footnote-1433438 +Node: Include Files433605 +Ref: Include Files-Footnote-1436552 +Node: Macro Replacement436730 +Ref: Macro Replacement-Footnote-1440605 +Node: Comment Lines440822 +Ref: Comment Lines-Footnote-1441680 +Node: ASCII/Latin-1/UTF-8 export441784 +Ref: ASCII export commands442633 +Ref: ASCII specific export settings443166 +Ref: Header and sectioning structure443610 +Ref: Quoting ASCII text443884 +Ref: ASCII specific attributes444256 +Ref: ASCII special blocks444533 +Node: Beamer Export444880 +Node: Beamer export commands445625 +Node: Beamer specific export settings446325 +Node: Frames and Blocks in Beamer448225 +Ref: Frames and Blocks in Beamer-Footnote-1451592 +Node: Beamer specific syntax451751 +Node: Editing support453725 +Node: A Beamer example454216 +Node: HTML Export455465 +Node: HTML export commands456515 +Node: HTML specific export settings457061 +Node: HTML doctypes459150 +Node: HTML preamble and postamble461326 +Node: Quoting HTML tags462516 +Node: Links in HTML export463210 +Node: Tables in HTML export464668 +Node: Images in HTML export466123 +Node: Math formatting in HTML export467608 +Ref: Math formatting in HTML export-Footnote-1469141 +Ref: Math formatting in HTML export-Footnote-2469265 +Ref: Math formatting in HTML export-Footnote-3469526 +Node: Text areas in HTML export469698 +Node: CSS support470838 +Ref: CSS support-Footnote-1474388 +Node: JavaScript support474568 +Node: LaTeX Export477821 +Node: LaTeX/PDF export commands479594 +Ref: LaTeX/PDF export commands-Footnote-1481092 +Node: LaTeX specific export settings481294 +Node: LaTeX header and sectioning484521 +Node: Quoting LaTeX code486633 +Node: Tables in LaTeX export487424 +Node: Images in LaTeX export491837 +Node: Plain lists in LaTeX export494335 +Node: Source blocks in LaTeX export495350 +Node: Example blocks in LaTeX export496775 +Node: Special blocks in LaTeX export497496 +Node: Horizontal rules in LaTeX export498754 +Node: Markdown Export499149 +Ref: Markdown export commands499611 +Ref: Header and sectioning structure (1)500048 +Node: OpenDocument Text Export500465 +Ref: OpenDocument Text Export-Footnote-1501566 +Node: Pre-requisites for ODT export501715 +Node: ODT export commands502088 +Node: ODT specific export settings503264 +Node: Extending ODT export504310 +Ref: Automatically exporting to other formats505116 +Ref: Converting between document formats505542 +Node: Applying custom styles506084 +Ref: Applying custom styles the easy way506611 +Ref: Using third-party styles and templates507569 +Node: Links in ODT export507866 +Node: Tables in ODT export508523 +Node: Images in ODT export510528 +Ref: Embedding images510727 +Ref: Embedding clickable images511044 +Ref: Sizing and scaling of embedded images511378 +Ref: Anchoring of images513062 +Node: Math formatting in ODT export513384 +Node: LaTeX math snippets513808 +Ref: LaTeX math snippets-Footnote-1516056 +Ref: LaTeX math snippets-Footnote-2516132 +Node: MathML and OpenDocument formula files516177 +Node: Labels and captions in ODT export516680 +Node: Literal examples in ODT export517951 +Node: Advanced topics in ODT export518787 +Ref: Configuring a document converter519092 +Ref: Working with OpenDocument style files520033 +Ref: x-orgodtstyles-xml520499 +Ref: x-orgodtcontenttemplate-xml520841 +Ref: x-overriding-factory-styles521485 +Ref: Creating one-off styles522729 +Ref: Customizing tables in ODT export524733 +Ref: Validating OpenDocument XML529593 +Ref: Advanced topics in ODT export-Footnote-1530390 +Ref: Advanced topics in ODT export-Footnote-2530494 +Ref: Advanced topics in ODT export-Footnote-3530587 +Node: Org Export530935 +Ref: Org export commands531286 +Node: Texinfo Export531592 +Node: Texinfo export commands532570 +Node: Texinfo specific export settings533190 +Node: Texinfo file header534338 +Node: Texinfo title and copyright page535316 +Node: Info directory file536675 +Node: Headings and sectioning structure537395 +Node: Indices539420 +Node: Quoting Texinfo code540444 +Node: Plain lists in Texinfo export540937 +Node: Tables in Texinfo export542296 +Node: Images in Texinfo export542787 +Node: Quotations in Texinfo export543420 +Node: Special blocks in Texinfo export544368 +Node: A Texinfo example545016 +Node: iCalendar Export547123 +Node: Other Built-in Back-ends550856 +Node: Advanced Export Configuration551483 +Ref: Hooks551690 +Ref: Filters552613 +Ref: Defining filters for individual files555122 +Ref: Extending an existing back-end555928 +Node: Export in Foreign Buffers558168 +Node: Publishing559316 +Node: Configuration560194 +Node: Project alist560971 +Node: Sources and destinations562108 +Node: Selecting files563421 +Node: Publishing action564371 +Ref: Publishing action-Footnote-1566195 +Node: Publishing options566358 +Ref: Generic properties567105 +Ref: ASCII specific properties568992 +Ref: Beamer specific properties570592 +Ref: HTML specific properties571157 +Ref: LaTeX specific properties575378 +Ref: Markdown specific properties578302 +Ref: ODT specific properties578540 +Ref: Texinfo specific properties579472 +Node: Publishing links580819 +Node: Site map582194 +Node: Generating an index585506 +Node: Uploading Files586293 +Node: Sample Configuration588071 +Node: Simple example588564 +Node: Complex example589212 +Node: Triggering Publication591256 +Node: Working with Source Code592269 +Node: Structure of Code Blocks597124 +Node: Using Header Arguments599603 +Ref: System-wide header arguments600325 +Ref: Header arguments in Org mode properties601248 +Ref: Code block specific header arguments603076 +Ref: Header arguments in function calls604575 +Node: Environment of a Code Block605249 +Ref: Passing arguments605458 +Ref: Using sessions613328 +Ref: Choosing a working directory614727 +Ref: Inserting headers and footers616465 +Node: Evaluating Code Blocks616975 +Ref: How to evaluate source code617425 +Ref: Limit code block evaluation620327 +Ref: Cache results of evaluation621187 +Ref: Evaluating Code Blocks-Footnote-1623773 +Ref: Evaluating Code Blocks-Footnote-2623907 +Node: Results of Evaluation624065 +Ref: Collection624905 +Ref: Type627165 +Ref: Format630445 +Ref: Handling632695 +Ref: Post-processing633410 +Ref: Results of Evaluation-Footnote-1635160 +Node: Exporting Code Blocks635582 +Node: Extracting Source Code637930 +Ref: Header arguments638906 +Ref: Functions642451 +Ref: Hooks (1)642702 +Ref: Jumping between code and Org642937 +Node: Languages643447 +Ref: Languages-Footnote-1646075 +Ref: Languages-Footnote-2646233 +Node: Editing Source Code646387 +Node: Noweb Reference Syntax649110 +Ref: Noweb Reference Syntax-Footnote-1654617 +Node: Library of Babel654707 +Node: Key bindings and Useful Functions655420 +Node: Batch Execution657840 +Node: Miscellaneous658618 +Node: Completion659714 +Node: Structure Templates661624 +Ref: Structure Templates-Footnote-1663375 +Node: Escape Character663467 +Node: Speed Keys664188 +Node: Code Evaluation Security665371 +Node: Customization668227 +Node: In-buffer Settings668664 +Ref: In-buffer Settings-Footnote-1677647 +Node: The Very Busy C-c C-c Key677857 +Node: Clean View679821 +Ref: Clean View-Footnote-1683253 +Ref: Clean View-Footnote-2683492 +Ref: Clean View-Footnote-3683551 +Node: TTY Keys683632 +Node: Documentation Access685239 +Node: Interaction685648 +Node: Cooperation686063 +Node: Conflicts688950 +Node: Org Crypt693557 +Node: Org Mobile695091 +Node: Setting up the staging area696429 +Ref: Setting up the staging area-Footnote-1697664 +Ref: Setting up the staging area-Footnote-2697871 +Node: Pushing to the mobile application698043 +Ref: Pushing to the mobile application-Footnote-1699049 +Ref: Pushing to the mobile application-Footnote-2699140 +Ref: Pushing to the mobile application-Footnote-3699507 +Node: Pulling from the mobile application699583 +Ref: Pulling from the mobile application-Footnote-1701891 +Node: Org Syntax701944 +Node: Hacking703559 +Node: Hooks (2)704505 +Node: Add-on Packages704828 +Node: Adding Hyperlink Types705366 +Node: Adding Export Back-ends708789 +Node: Tables in Arbitrary Syntax710041 +Node: Radio tables711305 +Node: A LaTeX example713437 +Ref: A LaTeX example-Footnote-1717284 +Ref: A LaTeX example-Footnote-2717327 +Ref: A LaTeX example-Footnote-3717488 +Node: Translator functions717940 +Node: Dynamic Blocks720111 +Node: Special Agenda Views722257 +Ref: Special Agenda Views-Footnote-1725963 +Ref: Special Agenda Views-Footnote-2726170 +Node: Speeding Up Your Agendas726302 +Node: Extracting Agenda Information727356 +Node: Using the Property API731156 +Node: Using the Mapping API734506 +Node: History and Acknowledgments738537 +Ref: From Carsten738730 +Ref: From Bastien742154 +Ref: List of Contributions744286 +Node: GNU Free Documentation License752495 +Node: Main Index777875 +Node: Key Index871484 +Node: Command and Function Index925433 +Node: Variable Index970155 + +End Tag Table + + +Local Variables: +coding: utf-8 +End: diff --git a/elpa/org-20171030/org-agenda.el b/elpa/org-20190930/org-agenda.el similarity index 92% rename from elpa/org-20171030/org-agenda.el rename to elpa/org-20190930/org-agenda.el index cf7a4dbf..690d7e27 100644 --- a/elpa/org-20171030/org-agenda.el +++ b/elpa/org-20190930/org-agenda.el @@ -1,10 +1,10 @@ ;;; org-agenda.el --- Dynamic task and appointment lists for Org -;; Copyright (C) 2004-2017 Free Software Foundation, Inc. +;; Copyright (C) 2004-2019 Free Software Foundation, Inc. ;; Author: Carsten Dominik ;; Keywords: outlines, hypermedia, calendar, wp -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; ;; This file is part of GNU Emacs. ;; @@ -267,7 +267,7 @@ you can \"misuse\" it to also add other text to the header." "List of types searched for when creating the daily/weekly agenda. This variable is a list of symbols that controls the types of items that appear in the daily/weekly agenda. Allowed symbols in this -list are are +list are :timestamp List items containing a date stamp or date range matching the selected date. This includes sexp entries in angular @@ -395,35 +395,35 @@ the daily/weekly agenda, see `org-agenda-skip-function'.") (choice :tag "Condition type" (list :tag "Regexp matches" :inline t - (const :format "" 'regexp) + (const :format "" regexp) (regexp)) (list :tag "Regexp does not match" :inline t - (const :format "" 'notregexp) + (const :format "" notregexp) (regexp)) (list :tag "TODO state is" :inline t - (const 'todo) + (const todo) (choice - (const :tag "Any not-done state" 'todo) - (const :tag "Any done state" 'done) - (const :tag "Any state" 'any) + (const :tag "Any not-done state" todo) + (const :tag "Any done state" done) + (const :tag "Any state" any) (list :tag "Keyword list" (const :format "" quote) (repeat (string :tag "Keyword"))))) (list :tag "TODO state is not" :inline t - (const 'nottodo) + (const nottodo) (choice - (const :tag "Any not-done state" 'todo) - (const :tag "Any done state" 'done) - (const :tag "Any state" 'any) + (const :tag "Any not-done state" todo) + (const :tag "Any done state" done) + (const :tag "Any state" any) (list :tag "Keyword list" (const :format "" quote) (repeat (string :tag "Keyword"))))) - (const :tag "scheduled" 'scheduled) - (const :tag "not scheduled" 'notscheduled) - (const :tag "deadline" 'deadline) - (const :tag "no deadline" 'notdeadline) - (const :tag "timestamp" 'timestamp) - (const :tag "no timestamp" 'nottimestamp)))))) + (const :tag "scheduled" scheduled) + (const :tag "not scheduled" notscheduled) + (const :tag "deadline" deadline) + (const :tag "no deadline" notdeadline) + (const :tag "timestamp" timestamp) + (const :tag "no timestamp" nottimestamp)))))) (list :tag "Non-standard skipping condition" :value (org-agenda-skip-function) (const org-agenda-skip-function) @@ -606,8 +606,8 @@ subtree to see if any of the subtasks have project status. See also the variable `org-tags-match-list-sublevels' which applies to projects matched by this search as well. -After defining this variable, you may use `\\[org-agenda-list-stuck-projects]' -\(bound to `C-c a #') to produce the list." +After defining this variable, you may use `org-agenda-list-stuck-projects' +\(bound to `\\[org-agenda] #') to produce the list." :group 'org-agenda-custom-commands :type '(list (string :tag "Tags/TODO match to identify a project") @@ -1225,9 +1225,9 @@ These days get the special face `org-agenda-date-weekend' in the agenda." (defcustom org-agenda-move-date-from-past-immediately-to-today t "Non-nil means jump to today when moving a past date forward in time. -When using S-right in the agenda to move a a date forward, and the date +When using S-right in the agenda to move a date forward, and the date stamp currently points to the past, the first key press will move it -to today. WHen nil, just move one day forward even if the date stays +to today. When nil, just move one day forward even if the date stays in the past." :group 'org-agenda-daily/weekly :version "24.1" @@ -1401,6 +1401,9 @@ current display in the agenda." :group 'org-agenda-daily/weekly :type 'plist) +(defvaralias 'org-agenda-search-view-search-words-only + 'org-agenda-search-view-always-boolean) + (defcustom org-agenda-search-view-always-boolean nil "Non-nil means the search string is interpreted as individual parts. @@ -1429,9 +1432,6 @@ boolean search." :version "24.1" :type 'boolean) -(defvaralias 'org-agenda-search-view-search-words-only - 'org-agenda-search-view-always-boolean) - (defcustom org-agenda-search-view-force-full-words nil "Non-nil means, search words must be matches as complete words. When nil, they may also match part of a word." @@ -1498,7 +1498,7 @@ The third item is a string which will be placed right after the times that have a grid line. The fourth item is a string placed after the grid times. This -will align with agenda items" +will align with agenda items." :group 'org-agenda-time-grid :type '(list @@ -1542,18 +1542,18 @@ This is a list of symbols which will be used in sequence to determine if an entry should be listed before another entry. The following symbols are recognized: -time-up Put entries with time-of-day indications first, early first -time-down Put entries with time-of-day indications first, late first -timestamp-up Sort by any timestamp, early first -timestamp-down Sort by any timestamp, late first -scheduled-up Sort by scheduled timestamp, early first -scheduled-down Sort by scheduled timestamp, late first -deadline-up Sort by deadline timestamp, early first -deadline-down Sort by deadline timestamp, late first -ts-up Sort by active timestamp, early first -ts-down Sort by active timestamp, late first -tsia-up Sort by inactive timestamp, early first -tsia-down Sort by inactive timestamp, late first +time-up Put entries with time-of-day indications first, early first. +time-down Put entries with time-of-day indications first, late first. +timestamp-up Sort by any timestamp, early first. +timestamp-down Sort by any timestamp, late first. +scheduled-up Sort by scheduled timestamp, early first. +scheduled-down Sort by scheduled timestamp, late first. +deadline-up Sort by deadline timestamp, early first. +deadline-down Sort by deadline timestamp, late first. +ts-up Sort by active timestamp, early first. +ts-down Sort by active timestamp, late first. +tsia-up Sort by inactive timestamp, early first. +tsia-down Sort by inactive timestamp, late first. category-keep Keep the default order of categories, corresponding to the sequence in `org-agenda-files'. category-up Sort alphabetically by category, A-Z. @@ -1568,10 +1568,10 @@ effort-up Sort numerically by estimated effort, high effort last. effort-down Sort numerically by estimated effort, high effort first. user-defined-up Sort according to `org-agenda-cmp-user-defined', high last. user-defined-down Sort according to `org-agenda-cmp-user-defined', high first. -habit-up Put entries that are habits first -habit-down Put entries that are habits last -alpha-up Sort headlines alphabetically -alpha-down Sort headlines alphabetically, reversed +habit-up Put entries that are habits first. +habit-down Put entries that are habits last. +alpha-up Sort headlines alphabetically. +alpha-down Sort headlines alphabetically, reversed. The different possibilities will be tried in sequence, and testing stops if one comparison returns a \"not-equal\". For example, the default @@ -1644,9 +1644,10 @@ When nil, such items are sorted as 0 minutes effort." (tags . " %i %-12:c") (search . " %i %-12:c")) "Format specifications for the prefix of items in the agenda views. -An alist with five entries, each for the different agenda types. The -keys of the sublists are `agenda', `todo', `search' and `tags'. -The values are format strings. + +An alist with one entry per agenda type. The keys of the +sublists are `agenda', `todo', `search' and `tags'. The values +are format strings. This format works similar to a printf format, with the following meaning: @@ -1872,6 +1873,9 @@ Nil means don't hide any tags." (const :tag "Hide none" nil) (string :tag "Regexp "))) +(defvaralias 'org-agenda-remove-tags-when-in-prefix + 'org-agenda-remove-tags) + (defcustom org-agenda-remove-tags nil "Non-nil means remove the tags from the headline copy in the agenda. When this is the symbol `prefix', only remove tags when @@ -1882,8 +1886,7 @@ When this is the symbol `prefix', only remove tags when (const :tag "Never" nil) (const :tag "When prefix format contains %T" prefix))) -(defvaralias 'org-agenda-remove-tags-when-in-prefix - 'org-agenda-remove-tags) +(defvaralias 'org-agenda-align-tags-to-column 'org-agenda-tags-column) (defcustom org-agenda-tags-column 'auto "Shift tags in agenda items to this column. @@ -1901,8 +1904,6 @@ character screen." :package-version '(Org . "9.1") :version "26.1") -(defvaralias 'org-agenda-align-tags-to-column 'org-agenda-tags-column) - (defcustom org-agenda-fontify-priorities 'cookies "Non-nil means highlight low and high priorities in agenda. When t, the highest priority entries are bold, lowest priority italic. @@ -2064,18 +2065,38 @@ works you probably want to add it to `org-agenda-custom-commands' for good." (setcdr ass (cdr entry)) (push entry org-agenda-custom-commands)))) +(defmacro org-agenda--insert-overriding-header (default) + "Insert header into agenda view. +The inserted header depends on `org-agenda-overriding-header'. +If the empty string, don't insert a header. If any other string, +insert it as a header. If nil, insert DEFAULT, which should +evaluate to a string." + (declare (debug (form)) (indent defun)) + `(cond + ((not org-agenda-overriding-header) (insert ,default)) + ((equal org-agenda-overriding-header "") nil) + ((stringp org-agenda-overriding-header) + (insert (propertize org-agenda-overriding-header + 'face 'org-agenda-structure) + "\n")) + (t (user-error "Invalid value for `org-agenda-overriding-header': %S" + org-agenda-overriding-header)))) + ;;; Define the org-agenda-mode +(defvaralias 'org-agenda-keymap 'org-agenda-mode-map) (defvar org-agenda-mode-map (make-sparse-keymap) "Keymap for `org-agenda-mode'.") -(defvaralias 'org-agenda-keymap 'org-agenda-mode-map) (defvar org-agenda-menu) ; defined later in this file. (defvar org-agenda-restrict nil) ; defined later in this file. (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 @@ -2163,29 +2184,36 @@ The following commands are available: \\{org-agenda-mode-map}" (interactive) - (cond (org-agenda-doing-sticky-redo - ;; Refreshing sticky agenda-buffer - ;; - ;; Preserve the value of `org-agenda-local-vars' variables, - ;; while letting `kill-all-local-variables' kill the rest - (let ((save (buffer-local-variables))) - (kill-all-local-variables) - (mapc #'make-local-variable org-agenda-local-vars) - (dolist (elem save) - (pcase elem - (`(,var . ,val) ;ignore unbound variables - (when (and val (memq var org-agenda-local-vars)) - (set var val)))))) - (setq-local org-agenda-this-buffer-is-sticky t)) - (org-agenda-sticky - ;; Creating a sticky Agenda buffer for the first time - (kill-all-local-variables) - (mapc 'make-local-variable org-agenda-local-vars) - (setq-local org-agenda-this-buffer-is-sticky t)) - (t - ;; Creating a non-sticky agenda buffer - (kill-all-local-variables) - (setq-local org-agenda-this-buffer-is-sticky nil))) + (let ((agenda-local-vars-to-keep + '(text-scale-mode-amount + text-scale-mode + text-scale-mode-lighter + face-remapping-alist)) + (save (buffer-local-variables))) + (kill-all-local-variables) + (cl-flet ((reset-saved (var-set) + "Reset variables in VAR-SET to possibly stored value in SAVE." + (dolist (elem save) + (pcase elem + (`(,var . ,val) ;ignore unbound variables + (when (and val (memq var var-set)) + (set var val))))))) + (cond (org-agenda-doing-sticky-redo + ;; Refreshing sticky agenda-buffer + ;; + ;; Preserve the value of `org-agenda-local-vars' variables. + (mapc #'make-local-variable org-agenda-local-vars) + (reset-saved org-agenda-local-vars) + (setq-local org-agenda-this-buffer-is-sticky t)) + (org-agenda-sticky + ;; Creating a sticky Agenda buffer for the first time + (mapc 'make-local-variable org-agenda-local-vars) + (setq-local org-agenda-this-buffer-is-sticky t)) + (t + ;; Creating a non-sticky agenda buffer + (setq-local org-agenda-this-buffer-is-sticky nil))) + (mapc #'make-local-variable agenda-local-vars-to-keep) + (reset-saved agenda-local-vars-to-keep))) (setq org-agenda-undo-list nil org-agenda-pending-undo-list nil org-agenda-bulk-marked-entries nil) @@ -2196,20 +2224,24 @@ The following commands are available: (setq indent-tabs-mode nil) (use-local-map org-agenda-mode-map) (easy-menu-add org-agenda-menu) - (if org-startup-truncated (setq truncate-lines t)) + (when org-startup-truncated (setq truncate-lines t)) (setq-local line-move-visual nil) (add-hook 'post-command-hook 'org-agenda-update-agenda-type nil 'local) (add-hook 'pre-command-hook 'org-unhighlight nil 'local) ;; Make sure properties are removed when copying text - (add-hook 'filter-buffer-substring-functions - (lambda (fun start end delete) - (substring-no-properties (funcall fun start end delete))) - nil t) + (if (boundp 'filter-buffer-substring-functions) + (add-hook 'filter-buffer-substring-functions + (lambda (fun start end delete) + (substring-no-properties (funcall fun start end delete))) + nil t) + ;; Emacs >= 24.4. + (add-function :filter-return (local 'filter-buffer-substring-function) + #'substring-no-properties)) (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 @@ -2367,6 +2399,7 @@ The following commands are available: (define-key org-agenda-mode-map "?" 'org-agenda-show-the-flagging-note) (org-defkey org-agenda-mode-map "\C-c\C-x\C-mg" 'org-mobile-pull) (org-defkey org-agenda-mode-map "\C-c\C-x\C-mp" 'org-mobile-push) +(org-defkey org-agenda-mode-map "\C-c\C-xI" 'org-info-find-node) (org-defkey org-agenda-mode-map [mouse-2] 'org-agenda-goto-mouse) (org-defkey org-agenda-mode-map [mouse-3] 'org-agenda-show-mouse) @@ -2520,7 +2553,7 @@ The following commands are available: ("MobileOrg" ["Push Files and Views" org-mobile-push t] ["Get Captured and Flagged" org-mobile-pull t] - ["Find FLAGGED Tasks" (org-agenda nil "?") :active t :keys "C-c a ?"] + ["Find FLAGGED Tasks" (org-agenda nil "?") :active t :keys "\\[org-agenda] ?"] ["Show note / unflag" org-agenda-show-the-flagging-note t] "--" ["Setup" (progn (require 'org-mobile) (customize-group 'org-mobile)) t]) @@ -2543,30 +2576,30 @@ that have been changed along." (interactive) (or org-agenda-allow-remote-undo (user-error "Check the variable `org-agenda-allow-remote-undo' to activate remote undo")) - (if (not (eq this-command last-command)) - (setq org-agenda-undo-has-started-in nil - org-agenda-pending-undo-list org-agenda-undo-list)) - (if (not org-agenda-pending-undo-list) - (user-error "No further undo information")) + (when (not (eq this-command last-command)) + (setq org-agenda-undo-has-started-in nil + org-agenda-pending-undo-list org-agenda-undo-list)) + (when (not org-agenda-pending-undo-list) + (user-error "No further undo information")) (let* ((entry (pop org-agenda-pending-undo-list)) buf line cmd rembuf) (setq cmd (pop entry) line (pop entry)) (setq rembuf (nth 2 entry)) (org-with-remote-undo rembuf (while (bufferp (setq buf (pop entry))) - (if (pop entry) - (with-current-buffer buf - (let ((last-undo-buffer buf) - (inhibit-read-only t)) - (unless (memq buf org-agenda-undo-has-started-in) - (push buf org-agenda-undo-has-started-in) - (make-local-variable 'pending-undo-list) - (undo-start)) - (while (and pending-undo-list - (listp pending-undo-list) - (not (car pending-undo-list))) - (pop pending-undo-list)) - (undo-more 1)))))) + (when (pop entry) + (with-current-buffer buf + (let ((last-undo-buffer buf) + (inhibit-read-only t)) + (unless (memq buf org-agenda-undo-has-started-in) + (push buf org-agenda-undo-has-started-in) + (make-local-variable 'pending-undo-list) + (undo-start)) + (while (and pending-undo-list + (listp pending-undo-list) + (not (car pending-undo-list))) + (pop pending-undo-list)) + (undo-more 1)))))) (org-goto-line line) (message "`%s' undone (buffer %s)" cmd (buffer-name rembuf)))) @@ -2789,9 +2822,9 @@ Pressing `<' twice means to restrict to the current subtree or region ;; If we have sticky agenda buffers, set a name for the buffer, ;; depending on the invoking keys. The user may still set this ;; as a command option, which will overwrite what we do here. - (if org-agenda-sticky - (setq org-agenda-buffer-name - (format "*Org Agenda(%s)*" org-keys))) + (when org-agenda-sticky + (setq org-agenda-buffer-name + (format "*Org Agenda(%s)*" org-keys))) ;; Establish the restriction, if any (when (and (not org-agenda-overriding-restriction) restriction) (put 'org-agenda-files 'org-restrict (list bfn)) @@ -2815,10 +2848,10 @@ Pressing `<' twice means to restrict to the current subtree or region (progn (setq type (nth 2 entry) org-match (eval (nth 3 entry)) lprops (nth 4 entry)) - (if org-agenda-sticky - (setq org-agenda-buffer-name - (or (and (stringp org-match) (format "*Org Agenda(%s:%s)*" org-keys org-match)) - (format "*Org Agenda(%s)*" org-keys)))) + (when org-agenda-sticky + (setq org-agenda-buffer-name + (or (and (stringp org-match) (format "*Org Agenda(%s:%s)*" org-keys org-match)) + (format "*Org Agenda(%s)*" org-keys)))) (put 'org-agenda-redo-command 'org-lprops lprops) (cond ((eq type 'agenda) @@ -2874,13 +2907,12 @@ Pressing `<' twice means to restrict to the current subtree or region (let* ((m (org-agenda-get-any-marker)) (note (and m (org-entry-get m "THEFLAGGINGNOTE")))) (when note - (message (concat - "FLAGGING-NOTE ([?] for more info): " - (org-add-props - (replace-regexp-in-string - "\\\\n" "//" - (copy-sequence note)) - nil 'face 'org-warning))))))) + (message "FLAGGING-NOTE ([?] for more info): %s" + (org-add-props + (replace-regexp-in-string + "\\\\n" "//" + (copy-sequence note)) + nil 'face 'org-warning)))))) t t)) ((equal org-keys "#") (call-interactively 'org-agenda-list-stuck-projects)) ((equal org-keys "/") (call-interactively 'org-occur-in-agenda-files)) @@ -2993,19 +3025,18 @@ s Search for keywords M Like m, but only TODO entries (symbol-name type) "Lambda expression")) (t "???")))) - (if org-agenda-menu-show-matcher - (setq line - (concat line ": " - (cond - ((stringp match) - (setq match (copy-sequence match)) - (org-add-props match nil 'face 'org-warning)) - ((listp type) - (format "set of %d commands" (length type)))))) - (if (org-string-nw-p match) - (add-text-properties - 0 (length line) (list 'help-echo - (concat "Matcher: " match)) line))) + (cond + ((not (org-string-nw-p match)) nil) + (org-agenda-menu-show-matcher + (setq line + (concat line ": " + (cond + ((stringp match) + (propertize match 'face 'org-warning)) + ((listp type) + (format "set of %d commands" (length type))))))) + (t + (org-add-props line nil 'help-echo (concat "Matcher: " match)))) (push line lines))) (setq lines (nreverse lines)) (when prefixes @@ -3041,8 +3072,8 @@ s Search for keywords M Like m, but only TODO entries ;; Make the window the right size (goto-char (point-min)) (if second-time - (if (not (pos-visible-in-window-p (point-max))) - (org-fit-window-to-buffer)) + (when (not (pos-visible-in-window-p (point-max))) + (org-fit-window-to-buffer)) (setq second-time t) (org-fit-window-to-buffer)) @@ -3238,11 +3269,9 @@ agenda-day The day in the agenda where this is listed" (org-tags-view nil cmd-key) (org-agenda nil cmd-key))) (set-buffer org-agenda-buffer-name) - (let* ((lines (org-split-string (buffer-string) "\n")) - line) - (while (setq line (pop lines)) - (catch 'next - (if (not (get-text-property 0 'org-category line)) (throw 'next nil)) + (let ((lines (org-split-string (buffer-string) "\n"))) + (dolist (line lines) + (when (get-text-property 0 'org-category line) (setq org-agenda-info (org-fix-agenda-info (text-properties-at 0 line))) (princ @@ -3259,14 +3288,14 @@ This ensures the export commands can easily use it." (when (setq tmp (plist-get props 'tags)) (setq props (plist-put props 'tags (mapconcat 'identity tmp ":")))) (when (setq tmp (plist-get props 'date)) - (if (integerp tmp) (setq tmp (calendar-gregorian-from-absolute tmp))) + (when (integerp tmp) (setq tmp (calendar-gregorian-from-absolute tmp))) (let ((calendar-date-display-form '(year "-" month "-" day))) '((format "%4d, %9s %2s, %4s" dayname monthname day year)) (setq tmp (calendar-date-string tmp))) (setq props (plist-put props 'date tmp))) (when (setq tmp (plist-get props 'day)) - (if (integerp tmp) (setq tmp (calendar-gregorian-from-absolute tmp))) + (when (integerp tmp) (setq tmp (calendar-gregorian-from-absolute tmp))) (let ((calendar-date-display-form '(year "-" month "-" day))) (setq tmp (calendar-date-string tmp))) (setq props (plist-put props 'day tmp)) @@ -3529,15 +3558,15 @@ removed from the entry content. Currently only `planning' is allowed here." (replace-match ""))))) (goto-char (point-max)) (skip-chars-backward " \t\n") - (if (looking-at "[ \t\n]+\\'") (replace-match "")) + (when (looking-at "[ \t\n]+\\'") (replace-match "")) ;; find and remove min common indentation (goto-char (point-min)) (untabify (point-min) (point-max)) - (setq ind (org-get-indentation)) + (setq ind (current-indentation)) (while (not (eobp)) (unless (looking-at "[ \t]*$") - (setq ind (min ind (org-get-indentation)))) + (setq ind (min ind (current-indentation)))) (beginning-of-line 2)) (goto-char (point-min)) (while (not (eobp)) @@ -3563,7 +3592,7 @@ removed from the entry content. Currently only `planning' is allowed here." txt)) (defun org-check-for-org-mode () - "Make sure current buffer is in org-mode. Error if not." + "Make sure current buffer is in Org mode. Error if not." (or (derived-mode-p 'org-mode) (error "Cannot execute Org agenda command on buffer in %s" major-mode))) @@ -3674,13 +3703,13 @@ FILTER-ALIST is an alist of filters we need to apply when (or wconf org-agenda-pre-window-conf)))) (defun org-agenda-prepare (&optional name) - (let ((filter-alist (if org-agenda-persistent-filter - (with-current-buffer - (get-buffer-create org-agenda-buffer-name) - (list `(tag . ,org-agenda-tag-filter) - `(re . ,org-agenda-regexp-filter) - `(effort . ,org-agenda-effort-filter) - `(cat . ,org-agenda-category-filter)))))) + (let ((filter-alist (when org-agenda-persistent-filter + (with-current-buffer + (get-buffer-create org-agenda-buffer-name) + `((tag . ,org-agenda-tag-filter) + (re . ,org-agenda-regexp-filter) + (effort . ,org-agenda-effort-filter) + (cat . ,org-agenda-category-filter)))))) (if (org-agenda-use-sticky-p) (progn (put 'org-agenda-tag-filter :preset-filter nil) @@ -3736,7 +3765,8 @@ FILTER-ALIST is an alist of filters we need to apply when (setq-local org-agenda-name name))) (setq buffer-read-only nil)))) -(defvar org-agenda-overriding-columns-format) ; From org-colview.el +(defvar org-overriding-columns-format) +(defvar org-local-columns-format) (defun org-agenda-finalize () "Finishing touch for the agenda buffer, called just before displaying it." (unless org-agenda-multi @@ -3751,13 +3781,11 @@ FILTER-ALIST is an alist of filters we need to apply when (org-agenda-align-tags)) (unless org-agenda-with-colors (remove-text-properties (point-min) (point-max) '(face nil))) - (if (and (boundp 'org-agenda-overriding-columns-format) - org-agenda-overriding-columns-format) - (setq-local org-agenda-overriding-columns-format - org-agenda-overriding-columns-format)) - (if (and (boundp 'org-agenda-view-columns-initially) - org-agenda-view-columns-initially) - (org-agenda-columns)) + (when (bound-and-true-p org-overriding-columns-format) + (setq-local org-local-columns-format + org-overriding-columns-format)) + (when org-agenda-view-columns-initially + (org-agenda-columns)) (when org-agenda-fontify-priorities (org-agenda-fontify-priorities)) (when (and org-agenda-dim-blocked-tasks org-blocker-hook) @@ -3766,9 +3794,9 @@ FILTER-ALIST is an alist of filters we need to apply when (when org-agenda-entry-text-mode (org-agenda-entry-text-hide) (org-agenda-entry-text-show)) - (if (and (functionp 'org-habit-insert-consistency-graphs) - (save-excursion (next-single-property-change (point-min) 'org-habit-p))) - (org-habit-insert-consistency-graphs)) + (when (and (featurep 'org-habit) + (save-excursion (next-single-property-change (point-min) 'org-habit-p))) + (org-habit-insert-consistency-graphs)) (setq org-agenda-type (org-get-at-bol 'org-agenda-type)) (unless (or (eq org-agenda-show-inherited-tags 'always) (and (listp org-agenda-show-inherited-tags) @@ -3784,9 +3812,9 @@ FILTER-ALIST is an alist of filters we need to apply when (while (equal (forward-line) 0) (when (setq mrk (get-text-property (point) 'org-hd-marker)) (put-text-property (point-at-bol) (point-at-eol) - 'tags (org-with-point-at mrk - (delete-dups - (mapcar 'downcase (org-get-tags-at)))))))))) + 'tags + (org-with-point-at mrk + (mapcar #'downcase (org-get-tags))))))))) (run-hooks 'org-agenda-finalize-hook) (when org-agenda-top-headline-filter (org-agenda-filter-top-headline-apply @@ -3838,15 +3866,15 @@ FILTER-ALIST is an alist of filters we need to apply when (defun org-agenda-unmark-clocking-task () "Unmark the current clocking task." (mapc (lambda (o) - (if (eq (overlay-get o 'type) 'org-agenda-clocking) - (delete-overlay o))) + (when (eq (overlay-get o 'type) 'org-agenda-clocking) + (delete-overlay o))) (overlays-in (point-min) (point-max)))) (defun org-agenda-fontify-priorities () "Make highest priority lines bold, and lowest italic." (interactive) - (mapc (lambda (o) (if (eq (overlay-get o 'org-type) 'org-priority) - (delete-overlay o))) + (mapc (lambda (o) (when (eq (overlay-get o 'org-type) 'org-priority) + (delete-overlay o))) (overlays-in (point-min) (point-max))) (save-excursion (let (b e p ov h l) @@ -4046,12 +4074,11 @@ This check for agenda markers in all agenda buffers currently active." (defun org-agenda-entry-text-hide () "Remove any shown entry context." - (delq nil - (mapcar (lambda (o) - (if (eq (overlay-get o 'org-overlay-type) - 'agenda-entry-content) - (progn (delete-overlay o) t))) - (overlays-in (point-min) (point-max))))) + (mapc (lambda (o) + (when (eq (overlay-get o 'org-overlay-type) + 'agenda-entry-content) + (delete-overlay o))) + (overlays-in (point-min) (point-max)))) (defun org-agenda-get-day-face (date) "Return the face DATE should be displayed with." @@ -4092,28 +4119,28 @@ given in `org-agenda-start-on-weekday'. When WITH-HOUR is non-nil, only include scheduled and deadline items if they have an hour specification like [h]h:mm." (interactive "P") - (if org-agenda-overriding-arguments - (setq arg (car org-agenda-overriding-arguments) - start-day (nth 1 org-agenda-overriding-arguments) - span (nth 2 org-agenda-overriding-arguments))) - (if (and (integerp arg) (> arg 0)) - (setq span arg arg nil)) + (when org-agenda-overriding-arguments + (setq arg (car org-agenda-overriding-arguments) + start-day (nth 1 org-agenda-overriding-arguments) + span (nth 2 org-agenda-overriding-arguments))) + (when (and (integerp arg) (> arg 0)) + (setq span arg arg nil)) (catch 'exit (setq org-agenda-buffer-name (or org-agenda-buffer-tmp-name (and org-agenda-doing-sticky-redo org-agenda-buffer-name) - (if org-agenda-sticky - (cond ((and org-keys (stringp org-match)) - (format "*Org Agenda(%s:%s)*" org-keys org-match)) - (org-keys - (format "*Org Agenda(%s)*" org-keys)) - (t "*Org Agenda(a)*"))) + (when org-agenda-sticky + (cond ((and org-keys (stringp org-match)) + (format "*Org Agenda(%s:%s)*" org-keys org-match)) + (org-keys + (format "*Org Agenda(%s)*" org-keys)) + (t "*Org Agenda(a)*"))) "*Org Agenda*")) (org-agenda-prepare "Day/Week") (setq start-day (or start-day org-agenda-start-day)) - (if (stringp start-day) - ;; Convert to an absolute day number - (setq start-day (time-to-days (org-read-date nil t start-day)))) + (when (stringp start-day) + ;; Convert to an absolute day number + (setq start-day (time-to-days (org-read-date nil t start-day)))) (org-compile-prefix-format 'agenda) (org-set-sorting-strategy 'agenda) (let* ((span (org-agenda-ndays-to-span (or span org-agenda-span))) @@ -4121,8 +4148,8 @@ items if they have an hour specification like [h]h:mm." (sd (or start-day today)) (ndays (org-agenda-span-to-ndays span sd)) (org-agenda-start-on-weekday - (if (or (eq ndays 7) (eq ndays 14)) - org-agenda-start-on-weekday)) + (and (or (eq ndays 7) (eq ndays 14)) + org-agenda-start-on-weekday)) (thefiles (org-agenda-files nil 'ifmode)) (files thefiles) (start (if (or (null org-agenda-start-on-weekday) @@ -4155,28 +4182,27 @@ items if they have an hour specification like [h]h:mm." (w1 (org-days-to-iso-week d1)) (w2 (org-days-to-iso-week d2))) (setq s (point)) - (if org-agenda-overriding-header - (insert (org-add-props (copy-sequence org-agenda-overriding-header) - nil 'face 'org-agenda-structure) "\n") - (insert (org-agenda-span-name span) + (org-agenda--insert-overriding-header + (concat (org-agenda-span-name span) "-agenda" - (if (< (- d2 d1) 350) - (if (= w1 w2) - (format " (W%02d)" w1) - (format " (W%02d-W%02d)" w1 w2)) - "") + (cond ((<= 350 (- d2 d1)) "") + ((= w1 w2) (format " (W%02d)" w1)) + (t (format " (W%02d-W%02d)" w1 w2))) ":\n"))) - (add-text-properties s (1- (point)) (list 'face 'org-agenda-structure - 'org-date-line t)) - (org-agenda-mark-header-line s)) + ;; Add properties if we actually inserted a header. + (when (> (point) s) + (add-text-properties s (1- (point)) + (list 'face 'org-agenda-structure + 'org-date-line t)) + (org-agenda-mark-header-line s))) (while (setq d (pop day-numbers)) (setq date (calendar-gregorian-from-absolute d) s (point)) (if (or (setq todayp (= d today)) (and (not start-pos) (= d sd))) (setq start-pos (point)) - (if (and start-pos (not end-pos)) - (setq end-pos (point)))) + (when (and start-pos (not end-pos)) + (setq end-pos (point)))) (setq files thefiles rtnall nil) (while (setq file (pop files)) @@ -4216,34 +4242,33 @@ items if they have an hour specification like [h]h:mm." file date org-agenda-entry-types))))) (setq rtnall (append rtnall rtn)))) ;; all entries - (if org-agenda-include-diary - (let ((org-agenda-search-headline-for-time t)) - (require 'diary-lib) - (setq rtn (org-get-entries-from-diary date)) - (setq rtnall (append rtnall rtn)))) - (if (or rtnall org-agenda-show-all-dates) - (progn - (setq day-cnt (1+ day-cnt)) - (insert - (if (stringp org-agenda-format-date) - (format-time-string org-agenda-format-date - (org-time-from-absolute date)) - (funcall org-agenda-format-date date)) - "\n") - (put-text-property s (1- (point)) 'face - (org-agenda-get-day-face date)) - (put-text-property s (1- (point)) 'org-date-line t) - (put-text-property s (1- (point)) 'org-agenda-date-header t) - (put-text-property s (1- (point)) 'org-day-cnt day-cnt) - (when todayp - (put-text-property s (1- (point)) 'org-today t)) - (setq rtnall - (org-agenda-add-time-grid-maybe rtnall ndays todayp)) - (if rtnall (insert ;; all entries - (org-agenda-finalize-entries rtnall 'agenda) - "\n")) - (put-text-property s (1- (point)) 'day d) - (put-text-property s (1- (point)) 'org-day-cnt day-cnt)))) + (when org-agenda-include-diary + (let ((org-agenda-search-headline-for-time t)) + (require 'diary-lib) + (setq rtn (org-get-entries-from-diary date)) + (setq rtnall (append rtnall rtn)))) + (when (or rtnall org-agenda-show-all-dates) + (setq day-cnt (1+ day-cnt)) + (insert + (if (stringp org-agenda-format-date) + (format-time-string org-agenda-format-date + (org-time-from-absolute date)) + (funcall org-agenda-format-date date)) + "\n") + (put-text-property s (1- (point)) 'face + (org-agenda-get-day-face date)) + (put-text-property s (1- (point)) 'org-date-line t) + (put-text-property s (1- (point)) 'org-agenda-date-header t) + (put-text-property s (1- (point)) 'org-day-cnt day-cnt) + (when todayp + (put-text-property s (1- (point)) 'org-today t)) + (setq rtnall + (org-agenda-add-time-grid-maybe rtnall ndays todayp)) + (when rtnall (insert ;; all entries + (org-agenda-finalize-entries rtnall 'agenda) + "\n")) + (put-text-property s (1- (point)) 'day d) + (put-text-property s (1- (point)) 'org-day-cnt day-cnt))) (when (and org-agenda-clockreport-mode clocktable-start) (let ((org-agenda-files (org-agenda-files nil 'ifmode)) ;; the above line is to ensure the restricted range! @@ -4257,22 +4282,22 @@ items if they have an hour specification like [h]h:mm." (insert tbl))) (goto-char (point-min)) (or org-agenda-multi (org-agenda-fit-window-to-buffer)) - (unless (and (pos-visible-in-window-p (point-min)) - (pos-visible-in-window-p (point-max))) + (unless (or (not (get-buffer-window)) + (and (pos-visible-in-window-p (point-min)) + (pos-visible-in-window-p (point-max)))) (goto-char (1- (point-max))) (recenter -1) - (if (not (pos-visible-in-window-p (or start-pos 1))) - (progn - (goto-char (or start-pos 1)) - (recenter 1)))) + (when (not (pos-visible-in-window-p (or start-pos 1))) + (goto-char (or start-pos 1)) + (recenter 1))) (goto-char (or start-pos 1)) (add-text-properties (point-min) (point-max) `(org-agenda-type agenda org-last-args (,arg ,start-day ,span) org-redo-cmd ,org-agenda-redo-command org-series-cmd ,org-cmd)) - (if (eq org-agenda-show-log-scoped 'clockcheck) - (org-agenda-show-clocking-issues)) + (when (eq org-agenda-show-log-scoped 'clockcheck) + (org-agenda-show-clocking-issues)) (org-agenda-finalize) (setq buffer-read-only t) (message "")))) @@ -4372,10 +4397,10 @@ This command searches the agenda files, and in addition the files listed in `org-agenda-text-search-extra-files' unless a restriction lock is active." (interactive "P") - (if org-agenda-overriding-arguments - (setq todo-only (car org-agenda-overriding-arguments) - string (nth 1 org-agenda-overriding-arguments) - edit-at (nth 2 org-agenda-overriding-arguments))) + (when org-agenda-overriding-arguments + (setq todo-only (car org-agenda-overriding-arguments) + string (nth 1 org-agenda-overriding-arguments) + edit-at (nth 2 org-agenda-overriding-arguments))) (let* ((props (list 'face nil 'done-face 'org-agenda-done 'org-not-done-regexp org-not-done-regexp @@ -4400,12 +4425,12 @@ is active." (edit-at string)) 'org-agenda-search-history))) (catch 'exit - (if org-agenda-sticky - (setq org-agenda-buffer-name - (if (stringp string) - (format "*Org Agenda(%s:%s)*" - (or org-keys (or (and todo-only "S") "s")) string) - (format "*Org Agenda(%s)*" (or (and todo-only "S") "s"))))) + (when org-agenda-sticky + (setq org-agenda-buffer-name + (if (stringp string) + (format "*Org Agenda(%s:%s)*" + (or org-keys (or (and todo-only "S") "s")) string) + (format "*Org Agenda(%s)*" (or (and todo-only "S") "s"))))) (org-agenda-prepare "SEARCH") (org-compile-prefix-format 'search) (org-set-sorting-strategy 'search) @@ -4423,9 +4448,9 @@ is active." (when (equal (string-to-char words) ?:) (setq full-words t words (substring words 1))) - (if (or org-agenda-search-view-always-boolean - (member (string-to-char words) '(?- ?+ ?\{))) - (setq boolean t)) + (when (or org-agenda-search-view-always-boolean + (member (string-to-char words) '(?- ?+ ?\{))) + (setq boolean t)) (setq words (split-string words)) (let (www w) (while (setq w (pop words)) @@ -4445,12 +4470,12 @@ is active." (when boolean (let (wds w) (while (setq w (pop words)) - (if (or (equal (substring w 0 1) "\"") - (and (> (length w) 1) - (member (substring w 0 1) '("+" "-")) - (equal (substring w 1 2) "\""))) - (while (and words (not (equal (substring w -1) "\""))) - (setq w (concat w " " (pop words))))) + (when (or (equal (substring w 0 1) "\"") + (and (> (length w) 1) + (member (substring w 0 1) '("+" "-")) + (equal (substring w 1 2) "\""))) + (while (and words (not (equal (substring w -1) "\""))) + (setq w (concat w " " (pop words))))) (and (string-match "\\`\\([-+]?\\)\"" w) (setq w (replace-match "\\1" nil nil w))) (and (equal (substring w -1) "\"") (setq w (substring w 0 -1))) @@ -4477,14 +4502,14 @@ is active." (if (not regexps+) (setq regexp org-outline-regexp-bol) (setq regexp (pop regexps+)) - (if hdl-only (setq regexp (concat org-outline-regexp-bol ".*?" - regexp)))) + (when hdl-only (setq regexp (concat org-outline-regexp-bol ".*?" + regexp)))) (setq files (org-agenda-files nil 'ifmode)) ;; Add `org-agenda-text-search-extra-files' unless there is some ;; restriction. - (unless (get 'org-agenda-files 'org-restrict) - (when (eq (car org-agenda-text-search-extra-files) 'agenda-archives) - (pop org-agenda-text-search-extra-files) + (when (eq (car org-agenda-text-search-extra-files) 'agenda-archives) + (pop org-agenda-text-search-extra-files) + (unless (get 'org-agenda-files 'org-restrict) (setq files (org-add-archive-files files)))) ;; Uniquify files. However, let `org-check-agenda-file' handle ;; non-existent ones. @@ -4502,14 +4527,14 @@ is active." (setq buffer (if (file-exists-p file) (org-get-agenda-file-buffer file) (error "No such file %s" file))) - (if (not buffer) - ;; If file does not exist, make sure an error message is sent - (setq rtn (list (format "ORG-AGENDA-ERROR: No such org-file %s" - file)))) + (unless buffer + ;; If file does not exist, make sure an error message is sent + (setq rtn (list (format "ORG-AGENDA-ERROR: No such org-file %s" + file)))) (with-current-buffer buffer (with-syntax-table (org-search-syntax-table) (unless (derived-mode-p 'org-mode) - (error "Agenda file %s is not in `org-mode'" file)) + (error "Agenda file %s is not in Org mode" file)) (let ((case-fold-search t)) (save-excursion (save-restriction @@ -4570,7 +4595,7 @@ is active." (and (eq org-agenda-show-inherited-tags t) (or (eq org-agenda-use-tag-inheritance t) (memq 'todo org-agenda-use-tag-inheritance)))) - tags (org-get-tags-at nil (not inherited-tags)) + tags (org-get-tags nil (not inherited-tags)) txt (org-agenda-format-item "" (buffer-substring-no-properties @@ -4587,25 +4612,25 @@ is active." (goto-char (1- end)))))))))) (setq rtn (nreverse ee)) (setq rtnall (append rtnall rtn))) - (if org-agenda-overriding-header - (insert (org-add-props (copy-sequence org-agenda-overriding-header) - nil 'face 'org-agenda-structure) "\n") - (insert "Search words: ") - (add-text-properties (point-min) (1- (point)) - (list 'face 'org-agenda-structure)) - (setq pos (point)) - (insert string "\n") - (add-text-properties pos (1- (point)) (list 'face 'org-warning)) - (setq pos (point)) - (unless org-agenda-multi - (insert (substitute-command-keys "\ + (org-agenda--insert-overriding-header + (with-temp-buffer + (insert "Search words: ") + (add-text-properties (point-min) (1- (point)) + (list 'face 'org-agenda-structure)) + (setq pos (point)) + (insert string "\n") + (add-text-properties pos (1- (point)) (list 'face 'org-warning)) + (setq pos (point)) + (unless org-agenda-multi + (insert (substitute-command-keys "\\\ Press `\\[org-agenda-manipulate-query-add]', \ `\\[org-agenda-manipulate-query-subtract]' to add/sub word, \ `\\[org-agenda-manipulate-query-add-re]', \ `\\[org-agenda-manipulate-query-subtract-re]' to add/sub regexp, \ `\\[universal-argument] \\[org-agenda-redo]' to edit\n")) - (add-text-properties pos (1- (point)) - (list 'face 'org-agenda-structure)))) + (add-text-properties pos (1- (point)) + (list 'face 'org-agenda-structure))) + (buffer-string))) (org-agenda-mark-header-line (point-min)) (when rtnall (insert (org-agenda-finalize-entries rtnall 'search) "\n")) @@ -4644,31 +4669,31 @@ the list to these. When using `\\[universal-argument]', you will be prompted for a keyword. A numeric prefix directly selects the Nth keyword in `org-todo-keywords-1'." (interactive "P") - (if org-agenda-overriding-arguments - (setq arg org-agenda-overriding-arguments)) - (if (and (stringp arg) (not (string-match "\\S-" arg))) (setq arg nil)) + (when org-agenda-overriding-arguments + (setq arg org-agenda-overriding-arguments)) + (when (and (stringp arg) (not (string-match "\\S-" arg))) (setq arg nil)) (let* ((today (org-today)) (date (calendar-gregorian-from-absolute today)) - (kwds org-todo-keywords-for-agenda) (completion-ignore-case t) - (org-select-this-todo-keyword - (if (stringp arg) arg - (and arg (integerp arg) (> arg 0) - (nth (1- arg) kwds)))) - rtn rtnall files file pos) - (when (equal arg '(4)) - (setq org-select-this-todo-keyword - (completing-read "Keyword (or KWD1|K2D2|...): " - (mapcar #'list kwds) nil nil))) - (and (equal 0 arg) (setq org-select-this-todo-keyword nil)) + kwds org-select-this-todo-keyword rtn rtnall files file pos) (catch 'exit - (if org-agenda-sticky - (setq org-agenda-buffer-name - (if (stringp org-select-this-todo-keyword) - (format "*Org Agenda(%s:%s)*" (or org-keys "t") - org-select-this-todo-keyword) - (format "*Org Agenda(%s)*" (or org-keys "t"))))) + (when org-agenda-sticky + (setq org-agenda-buffer-name + (if (stringp org-select-this-todo-keyword) + (format "*Org Agenda(%s:%s)*" (or org-keys "t") + org-select-this-todo-keyword) + (format "*Org Agenda(%s)*" (or org-keys "t"))))) (org-agenda-prepare "TODO") + (setq kwds org-todo-keywords-for-agenda + org-select-this-todo-keyword (if (stringp arg) arg + (and (integerp arg) + (> arg 0) + (nth (1- arg) kwds)))) + (when (equal arg '(4)) + (setq org-select-this-todo-keyword + (completing-read "Keyword (or KWD1|K2D2|...): " + (mapcar #'list kwds) nil nil))) + (and (equal 0 arg) (setq org-select-this-todo-keyword nil)) (org-compile-prefix-format 'todo) (org-set-sorting-strategy 'todo) (setq org-agenda-redo-command @@ -4683,31 +4708,31 @@ for a keyword. A numeric prefix directly selects the Nth keyword in (org-check-agenda-file file) (setq rtn (org-agenda-get-day-entries file date :todo)) (setq rtnall (append rtnall rtn)))) - (if org-agenda-overriding-header - (insert (org-add-props (copy-sequence org-agenda-overriding-header) - nil 'face 'org-agenda-structure) "\n") - (insert "Global list of TODO items of type: ") - (add-text-properties (point-min) (1- (point)) - (list 'face 'org-agenda-structure - 'short-heading - (concat "ToDo: " - (or org-select-this-todo-keyword "ALL")))) - (org-agenda-mark-header-line (point-min)) - (insert (org-agenda-propertize-selected-todo-keywords - org-select-this-todo-keyword)) - (setq pos (point)) - (unless org-agenda-multi - (insert (substitute-command-keys "Available with \ -`N \\[org-agenda-redo]': (0)[ALL]")) - (let ((n 0) s) - (mapc (lambda (x) - (setq s (format "(%d)%s" (setq n (1+ n)) x)) - (if (> (+ (current-column) (string-width s) 1) (frame-width)) - (insert "\n ")) - (insert " " s)) - kwds)) - (insert "\n")) - (add-text-properties pos (1- (point)) (list 'face 'org-agenda-structure))) + (org-agenda--insert-overriding-header + (with-temp-buffer + (insert "Global list of TODO items of type: ") + (add-text-properties (point-min) (1- (point)) + (list 'face 'org-agenda-structure + 'short-heading + (concat "ToDo: " + (or org-select-this-todo-keyword "ALL")))) + (org-agenda-mark-header-line (point-min)) + (insert (org-agenda-propertize-selected-todo-keywords + org-select-this-todo-keyword)) + (setq pos (point)) + (unless org-agenda-multi + (insert (substitute-command-keys "Press \ +\\`N \\[org-agenda-redo]' (e.g. `0 \\[org-agenda-redo]') \ +to search again: (0)[ALL]")) + (let ((n 0)) + (dolist (k kwds) + (let ((s (format "(%d)%s" (cl-incf n) k))) + (when (> (+ (current-column) (string-width s) 1) (window-width)) + (insert "\n ")) + (insert " " s)))) + (insert "\n")) + (add-text-properties pos (1- (point)) (list 'face 'org-agenda-structure)) + (buffer-string))) (org-agenda-mark-header-line (point-min)) (when rtnall (insert (org-agenda-finalize-entries rtnall 'todo) "\n")) @@ -4728,9 +4753,9 @@ for a keyword. A numeric prefix directly selects the Nth keyword in "Show all headlines for all `org-agenda-files' matching a TAGS criterion. The prefix arg TODO-ONLY limits the search to TODO entries." (interactive "P") - (if org-agenda-overriding-arguments - (setq todo-only (car org-agenda-overriding-arguments) - match (nth 1 org-agenda-overriding-arguments))) + (when org-agenda-overriding-arguments + (setq todo-only (car org-agenda-overriding-arguments) + match (nth 1 org-agenda-overriding-arguments))) (let* ((org-tags-match-list-sublevels org-tags-match-list-sublevels) (completion-ignore-case t) @@ -4740,17 +4765,18 @@ The prefix arg TODO-ONLY limits the search to TODO entries." (when (and (stringp match) (not (string-match "\\S-" match))) (setq match nil)) (catch 'exit - (if org-agenda-sticky - (setq org-agenda-buffer-name - (if (stringp match) - (format "*Org Agenda(%s:%s)*" - (or org-keys (or (and todo-only "M") "m")) match) - (format "*Org Agenda(%s)*" (or (and todo-only "M") "m"))))) + ;; TODO: this code is repeated a lot... + (when org-agenda-sticky + (setq org-agenda-buffer-name + (if (stringp match) + (format "*Org Agenda(%s:%s)*" + (or org-keys (or (and todo-only "M") "m")) match) + (format "*Org Agenda(%s)*" (or (and todo-only "M") "m"))))) + (setq matcher (org-make-tags-matcher match)) ;; Prepare agendas (and `org-tag-alist-for-agenda') before ;; expanding tags within `org-make-tags-matcher' (org-agenda-prepare (concat "TAGS " match)) - (setq matcher (org-make-tags-matcher match) - match (car matcher) + (setq match (car matcher) matcher (cdr matcher)) (org-compile-prefix-format 'tags) (org-set-sorting-strategy 'tags) @@ -4774,7 +4800,7 @@ The prefix arg TODO-ONLY limits the search to TODO entries." rtnall (append rtnall rtn)) (with-current-buffer buffer (unless (derived-mode-p 'org-mode) - (error "Agenda file %s is not in `org-mode'" file)) + (error "Agenda file %s is not in Org mode" file)) (save-excursion (save-restriction (if (eq buffer org-agenda-restrict) @@ -4785,24 +4811,25 @@ The prefix arg TODO-ONLY limits the search to TODO entries." matcher org--matcher-tags-todo-only)) (setq rtnall (append rtnall rtn)))))))) - (if org-agenda-overriding-header - (insert (org-add-props (copy-sequence org-agenda-overriding-header) - nil 'face 'org-agenda-structure) "\n") - (insert "Headlines with TAGS match: ") - (add-text-properties (point-min) (1- (point)) - (list 'face 'org-agenda-structure - 'short-heading - (concat "Match: " match))) - (setq pos (point)) - (insert match "\n") - (add-text-properties pos (1- (point)) (list 'face 'org-warning)) - (setq pos (point)) - (unless org-agenda-multi - (insert (substitute-command-keys - "Press `\\[universal-argument] \\[org-agenda-redo]' \ -to search again with new search string\n"))) - (add-text-properties pos (1- (point)) - (list 'face 'org-agenda-structure))) + (org-agenda--insert-overriding-header + (with-temp-buffer + (insert "Headlines with TAGS match: ") + (add-text-properties (point-min) (1- (point)) + (list 'face 'org-agenda-structure + 'short-heading + (concat "Match: " match))) + (setq pos (point)) + (insert match "\n") + (add-text-properties pos (1- (point)) (list 'face 'org-warning)) + (setq pos (point)) + (unless org-agenda-multi + (insert (substitute-command-keys + "Press \ +\\`\\[universal-argument] \\[org-agenda-redo]' \ +to search again\n"))) + (add-text-properties pos (1- (point)) + (list 'face 'org-agenda-structure)) + (buffer-string))) (org-agenda-mark-header-line (point-min)) (when rtnall (insert (org-agenda-finalize-entries rtnall 'tags) "\n")) @@ -4826,8 +4853,11 @@ used by user-defined selections using `org-agenda-skip-function'.") (defvar org-agenda-overriding-header nil "When set during agenda, todo and tags searches it replaces the header. -This variable should not be set directly, but custom commands can bind it -in the options section.") +If an empty string, no header will be inserted. If any other +string, it will be inserted as a header. If nil, a header will +be generated automatically according to the command. This +variable should not be set directly, but custom commands can bind +it in the options section.") (defun org-agenda-skip-entry-if (&rest conditions) "Skip entry if any of CONDITIONS is true. @@ -4974,14 +5004,14 @@ of what a project is and how to check if it stuck, customize the variable (format "^\\*+[ \t]+\\(%s\\)\\>" (mapconcat #'identity todo-wds "\\|")))) (tags-re (cond ((null tags) nil) - ((member "*" tags) - (eval-when-compile + ((member "*" tags) org-tag-line-re) + (tags + (let ((other-tags (format "\\(?:%s:\\)*" org-tag-re))) (concat org-outline-regexp-bol - ".*:[[:alnum:]_@#%]+:[ \t]*$"))) - (tags (concat org-outline-regexp-bol - ".*:\\(" - (mapconcat #'identity tags "\\|") - "\\):[[:alnum:]_@#%:]*[ \t]*$")) + ".*?[ \t]:" + other-tags + (regexp-opt tags t) + ":" other-tags "[ \t]*$"))) (t nil))) (re-list (delq nil (list todo-re tags-re gen-re))) (skip-re @@ -5067,9 +5097,9 @@ of what a project is and how to check if it stuck, customize the variable (defun org-agenda-cleanup-fancy-diary () "Remove unwanted stuff in buffer created by `fancy-diary-display'. -This gets rid of the date, the underline under the date, and -the dummy entry installed by `org-mode' to ensure non-empty diary for each -date. It also removes lines that contain only whitespace." +This gets rid of the date, the underline under the date, and the +dummy entry installed by Org mode to ensure non-empty diary for +each date. It also removes lines that contain only whitespace." (goto-char (point-min)) (if (looking-at ".*?:[ \t]*") (progn @@ -5083,23 +5113,10 @@ date. It also removes lines that contain only whitespace." (while (re-search-forward "^ +\n" nil t) (replace-match "")) (goto-char (point-min)) - (if (re-search-forward "^Org mode dummy\n?" nil t) - (replace-match "")) + (when (re-search-forward "^Org mode dummy\n?" nil t) + (replace-match "")) (run-hooks 'org-agenda-cleanup-fancy-diary-hook)) -;; Make sure entries from the diary have the right text properties. -(eval-after-load "diary-lib" - '(if (boundp 'diary-modify-entry-list-string-function) - ;; We can rely on the hook, nothing to do - nil - ;; Hook not available, must use advice to make this work - (defadvice add-to-diary-list (before org-mark-diary-entry activate) - "Make the position visible." - (if (and org-disable-agenda-to-diary ;; called from org-agenda - (stringp string) - buffer-file-name) - (setq string (org-modify-diary-entry-string string)))))) - (defun org-modify-diary-entry-string (string) "Add text properties to string, allowing Org to act on it." (org-add-props string nil @@ -5177,7 +5194,7 @@ function from a program - use `org-agenda-get-day-entries' instead." (setq org-diary-last-run-time time) ;; If this is called during org-agenda, don't return any entries to ;; the calendar. Org Agenda will list these entries itself. - (if org-disable-agenda-to-diary (setq files nil)) + (when org-disable-agenda-to-diary (setq files nil)) (while (setq file (pop files)) (setq rtn (apply 'org-agenda-get-day-entries file date args)) (setq results (append results rtn))) @@ -5214,7 +5231,7 @@ the documentation of `org-diary'." (list (format "ORG-AGENDA-ERROR: No such org-file %s" file)) (with-current-buffer buffer (unless (derived-mode-p 'org-mode) - (error "Agenda file %s is not in `org-mode'" file)) + (error "Agenda file %s is not in Org mode" file)) (setq org-agenda-buffer (or org-agenda-buffer buffer)) (setf org-agenda-current-date date) (save-excursion @@ -5359,7 +5376,7 @@ and the timestamp type relevant for the sorting strategy in (and (eq org-agenda-show-inherited-tags t) (or (eq org-agenda-use-tag-inheritance t) (memq 'todo org-agenda-use-tag-inheritance)))) - tags (org-get-tags-at nil (not inherited-tags)) + tags (org-get-tags nil (not inherited-tags)) level (make-string (org-reduced-level (org-outline-level)) ? ) txt (org-agenda-format-item "" txt level category tags t) priority (1+ (org-get-priority txt))) @@ -5414,7 +5431,7 @@ This function is invoked if `org-agenda-todo-ignore-deadlines', (and org-agenda-todo-ignore-deadlines (re-search-forward org-deadline-time-regexp end t) (cond - ((memq org-agenda-todo-ignore-deadlines '(t all)) t) + ((eq org-agenda-todo-ignore-deadlines 'all) t) ((eq org-agenda-todo-ignore-deadlines 'far) (not (org-deadline-close-p (match-string 1)))) ((eq org-agenda-todo-ignore-deadlines 'future) @@ -5483,8 +5500,8 @@ displayed in agenda view." (substring (format-time-string (car org-time-stamp-formats) - (apply #'encode-time ; DATE bound by calendar - (list 0 0 0 (nth 1 date) (car date) (nth 2 date)))) + (encode-time ; DATE bound by calendar + 0 0 0 (nth 1 date) (car date) (nth 2 date))) 1 11)) "\\|\\(<[0-9]+-[0-9]+-[0-9]+[^>\n]+?\\+[0-9]+[hdwmy]>\\)" "\\|\\(<%%\\(([^>\n]+)\\)>\\)")) @@ -5569,7 +5586,7 @@ displayed in agenda view." (or (eq org-agenda-use-tag-inheritance t) (memq 'agenda org-agenda-use-tag-inheritance))))) - (tags (org-get-tags-at nil (not inherited-tags))) + (tags (org-get-tags nil (not inherited-tags))) (level (make-string (org-reduced-level (org-outline-level)) ?\s)) (head (and (looking-at "\\*+[ \t]+\\(.*\\)") @@ -5633,7 +5650,7 @@ displayed in agenda view." (and (eq org-agenda-show-inherited-tags t) (or (eq org-agenda-use-tag-inheritance t) (memq 'agenda org-agenda-use-tag-inheritance)))) - tags (org-get-tags-at nil (not inherited-tags)) + tags (org-get-tags nil (not inherited-tags)) todo-state (org-get-todo-state) warntime (get-text-property (point) 'org-appt-warntime) extra nil) @@ -5721,10 +5738,10 @@ then those holidays will be skipped." (parts (delq nil (list - (if (memq 'closed items) (concat "\\<" org-closed-string)) - (if (memq 'clock items) (concat "\\<" org-clock-string)) - (if (memq 'state items) - (format "- State \"%s\".*?" org-todo-regexp))))) + (when (memq 'closed items) (concat "\\<" org-closed-string)) + (when (memq 'clock items) (concat "\\<" org-clock-string)) + (when (memq 'state items) + (format "- +State \"%s\".*?" org-todo-regexp))))) (parts-re (if parts (mapconcat 'identity parts "\\|") (error "`org-agenda-log-mode-items' is empty"))) (regexp (concat @@ -5734,11 +5751,11 @@ then those holidays will be skipped." (substring (format-time-string (car org-time-stamp-formats) - (apply 'encode-time ; DATE bound by calendar - (list 0 0 0 (nth 1 date) (car date) (nth 2 date)))) + (encode-time ; DATE bound by calendar + 0 0 0 (nth 1 date) (car date) (nth 2 date))) 1 11)))) (org-agenda-search-headline-for-time nil) - marker hdmarker priority category level tags closedp + marker hdmarker priority category level tags closedp type statep clockp state ee txt extra timestr rest clocked inherited-tags) (goto-char (point-min)) (while (re-search-forward regexp nil t) @@ -5783,7 +5800,7 @@ then those holidays will be skipped." (and (eq org-agenda-show-inherited-tags t) (or (eq org-agenda-use-tag-inheritance t) (memq 'todo org-agenda-use-tag-inheritance)))) - tags (org-get-tags-at nil (not inherited-tags)) + tags (org-get-tags nil (not inherited-tags)) level (make-string (org-reduced-level (org-outline-level)) ? )) (looking-at "\\*+[ \t]+\\([^\r\n]+\\)") (setq txt (match-string 1)) @@ -5798,11 +5815,14 @@ then those holidays will be skipped." (statep (concat "State: (" state ")")) (t (concat "Clocked: (" clocked ")"))) txt level category tags timestr))) + (setq type (cond (closedp "closed") + (statep "state") + (t "clock"))) (setq priority 100000) (org-add-props txt props 'org-marker marker 'org-hd-marker hdmarker 'face 'org-agenda-done 'priority priority 'level level - 'type "closed" 'date date + 'type type 'date date 'undone-face 'org-warning 'done-face 'org-agenda-done) (push txt ee)) (goto-char (point-at-eol)))) @@ -5852,21 +5872,19 @@ See also the user option `org-agenda-clock-consistency-checks'." (throw 'next t)) (setq ts (match-string 1) te (match-string 3) - ts (float-time - (apply #'encode-time (org-parse-time-string ts))) - te (float-time - (apply #'encode-time (org-parse-time-string te))) + ts (float-time (org-time-string-to-time ts)) + te (float-time (org-time-string-to-time te)) dt (- te ts)))) (cond ((> dt (* 60 maxtime)) ;; a very long clocking chunk (setq issue (format "Clocking interval is very long: %s" - (org-duration-from-minutes (floor (/ dt 60.)))) + (org-duration-from-minutes (floor dt 60))) face (or (plist-get pl :long-face) face))) ((< dt (* 60 mintime)) ;; a very short clocking chunk (setq issue (format "Clocking interval is very short: %s" - (org-duration-from-minutes (floor (/ dt 60.)))) + (org-duration-from-minutes (floor dt 60))) face (or (plist-get pl :short-face) face))) ((and (> tlend 0) (< ts tlend)) ;; Two clock entries are overlapping @@ -5899,15 +5917,15 @@ See also the user option `org-agenda-clock-consistency-checks'." (unless ok-list ;; there are no OK times for gaps... (throw 'exit nil)) - (if (> (- (/ t2 36000) (/ t1 36000)) 24) - ;; This is more than 24 hours, so it is OK. - ;; because we have at least one OK time, that must be in the - ;; 24 hour interval. - (throw 'exit t)) + (when (> (- (/ t2 36000) (/ t1 36000)) 24) + ;; This is more than 24 hours, so it is OK. + ;; because we have at least one OK time, that must be in the + ;; 24 hour interval. + (throw 'exit t)) ;; We have a shorter gap. ;; Now we have to get the minute of the day when these times are - (let* ((t1dec (decode-time (seconds-to-time t1))) - (t2dec (decode-time (seconds-to-time t2))) + (let* ((t1dec (org-decode-time t1)) + (t2dec (org-decode-time t2)) ;; compute the minute on the day (min1 (+ (nth 1 t1dec) (* 60 (nth 2 t1dec)))) (min2 (+ (nth 1 t2dec) (* 60 (nth 2 t2dec))))) @@ -5918,7 +5936,7 @@ See also the user option `org-agenda-clock-consistency-checks'." ;; Now check if any of the OK times is in the gap (mapc (lambda (x) ;; Wrap the time to after midnight if necessary - (if (< x min1) (setq x (+ x 1440))) + (when (< x min1) (setq x (+ x 1440))) ;; Check if in interval (and (<= min1 x) (>= min2 x) (throw 'exit t))) ok-list) @@ -5999,10 +6017,7 @@ specification like [h]h:mm." org-deadline-warning-days)) ;; Set pre-warning to deadline. (t 0)))) - (wdays (if suppress-prewarning - (let ((org-deadline-warning-days suppress-prewarning)) - (org-get-wdays s)) - (org-get-wdays s)))) + (wdays (or suppress-prewarning (org-get-wdays s)))) (cond ;; Only display deadlines at their base date, at future ;; repeat occurrences or in today agenda. @@ -6034,7 +6049,7 @@ specification like [h]h:mm." (or (eq org-agenda-use-tag-inheritance t) (memq 'agenda org-agenda-use-tag-inheritance))))) - (tags (org-get-tags-at nil (not inherited-tags))) + (tags (org-get-tags nil (not inherited-tags))) (time (cond ;; No time of day designation if it is only @@ -6172,7 +6187,7 @@ scheduled items with an hour specification like [h]h:mm." ;; Nullify delay when a repeater triggered already ;; and the delay is of the form --Xd. ((and (string-match-p "--[0-9]+[hdwmy]" s) - (> current schedule)) + (> schedule (org-agenda--timestamp-to-absolute s))) 0) (suppress-delay (let ((org-scheduled-delay-days suppress-delay)) @@ -6234,7 +6249,7 @@ scheduled items with an hour specification like [h]h:mm." (or (eq org-agenda-use-tag-inheritance t) (memq 'agenda org-agenda-use-tag-inheritance))))) - (tags (org-get-tags-at nil (not inherited-tags))) + (tags (org-get-tags nil (not inherited-tags))) (level (make-string (org-reduced-level (org-outline-level)) ?\s)) (head (buffer-substring (point) (line-end-position))) @@ -6319,59 +6334,59 @@ scheduled items with an hour specification like [h]h:mm." pos (current-buffer) (error-message-string err)))))) - (if (and (> (- d0 d1) -1) (> (- d2 d0) -1)) - ;; Only allow days between the limits, because the normal - ;; date stamps will catch the limits. - (save-excursion - (setq todo-state (org-get-todo-state)) - (setq donep (member todo-state org-done-keywords)) - (if (and donep org-agenda-skip-timestamp-if-done) - (throw :skip t)) - (setq marker (org-agenda-new-marker (point)) - category (org-get-category)) - (if (not (re-search-backward org-outline-regexp-bol nil t)) - (throw :skip nil) - (goto-char (match-beginning 0)) - (setq hdmarker (org-agenda-new-marker (point)) - inherited-tags - (or (eq org-agenda-show-inherited-tags 'always) - (and (listp org-agenda-show-inherited-tags) - (memq 'agenda org-agenda-show-inherited-tags)) - (and (eq org-agenda-show-inherited-tags t) - (or (eq org-agenda-use-tag-inheritance t) - (memq 'agenda org-agenda-use-tag-inheritance)))) - - tags (org-get-tags-at nil (not inherited-tags))) - (setq level (make-string (org-reduced-level (org-outline-level)) ? )) - (looking-at "\\*+[ \t]+\\(.*\\)") - (setq head (match-string 1)) - (let ((remove-re - (if org-agenda-remove-timeranges-from-blocks - (concat - "<" (regexp-quote s1) ".*?>" - "--" - "<" (regexp-quote s2) ".*?>") - nil))) - (setq txt (org-agenda-format-item - (format - (nth (if (= d1 d2) 0 1) - org-agenda-timerange-leaders) - (1+ (- d0 d1)) (1+ (- d2 d1))) - head level category tags - (cond ((and (= d1 d0) (= d2 d0)) - (concat "<" start-time ">--<" end-time ">")) - ((= d1 d0) - (concat "<" start-time ">")) - ((= d2 d0) - (concat "<" end-time ">"))) - remove-re)))) - (org-add-props txt props - 'org-marker marker 'org-hd-marker hdmarker - 'type "block" 'date date - 'level level - 'todo-state todo-state - 'priority (org-get-priority txt)) - (push txt ee)))) + (when (and (> (- d0 d1) -1) (> (- d2 d0) -1)) + ;; Only allow days between the limits, because the normal + ;; date stamps will catch the limits. + (save-excursion + (setq todo-state (org-get-todo-state)) + (setq donep (member todo-state org-done-keywords)) + (when (and donep org-agenda-skip-timestamp-if-done) + (throw :skip t)) + (setq marker (org-agenda-new-marker (point)) + category (org-get-category)) + (if (not (re-search-backward org-outline-regexp-bol nil t)) + (throw :skip nil) + (goto-char (match-beginning 0)) + (setq hdmarker (org-agenda-new-marker (point)) + inherited-tags + (or (eq org-agenda-show-inherited-tags 'always) + (and (listp org-agenda-show-inherited-tags) + (memq 'agenda org-agenda-show-inherited-tags)) + (and (eq org-agenda-show-inherited-tags t) + (or (eq org-agenda-use-tag-inheritance t) + (memq 'agenda org-agenda-use-tag-inheritance)))) + + tags (org-get-tags nil (not inherited-tags))) + (setq level (make-string (org-reduced-level (org-outline-level)) ? )) + (looking-at "\\*+[ \t]+\\(.*\\)") + (setq head (match-string 1)) + (let ((remove-re + (if org-agenda-remove-timeranges-from-blocks + (concat + "<" (regexp-quote s1) ".*?>" + "--" + "<" (regexp-quote s2) ".*?>") + nil))) + (setq txt (org-agenda-format-item + (format + (nth (if (= d1 d2) 0 1) + org-agenda-timerange-leaders) + (1+ (- d0 d1)) (1+ (- d2 d1))) + head level category tags + (cond ((and (= d1 d0) (= d2 d0)) + (concat "<" start-time ">--<" end-time ">")) + ((= d1 d0) + (concat "<" start-time ">")) + ((= d2 d0) + (concat "<" end-time ">"))) + remove-re)))) + (org-add-props txt props + 'org-marker marker 'org-hd-marker hdmarker + 'type "block" 'date date + 'level level + 'todo-state todo-state + 'priority (org-get-priority txt)) + (push txt ee)))) (goto-char pos))) ;; Sort the entries by expiration date. (nreverse ee))) @@ -6455,9 +6470,9 @@ Any match of REMOVE-RE will be removed from TXT." (tag (if tags (nth (1- (length tags)) tags) "")) (time-grid-trailing-characters (nth 2 org-agenda-time-grid)) time - (ts (if dotime (concat - (if (stringp dotime) dotime "") - (and org-agenda-search-headline-for-time txt)))) + (ts (when dotime (concat + (if (stringp dotime) dotime "") + (and org-agenda-search-headline-for-time txt)))) (time-of-day (and dotime (org-get-time-of-day ts))) stamp plain s0 s1 s2 rtn srp l duration breadcrumbs) @@ -6475,17 +6490,17 @@ Any match of REMOVE-RE will be removed from TXT." ;; If the times are in TXT (not in DOTIMES), and the prefix will list ;; them, we might want to remove them there to avoid duplication. ;; The user can turn this off with a variable. - (if (and org-prefix-has-time - org-agenda-remove-times-when-in-prefix (or stamp plain) - (string-match (concat (regexp-quote s0) " *") txt) - (not (equal ?\] (string-to-char (substring txt (match-end 0))))) - (if (eq org-agenda-remove-times-when-in-prefix 'beg) - (= (match-beginning 0) 0) - t)) - (setq txt (replace-match "" nil nil txt)))) + (when (and org-prefix-has-time + org-agenda-remove-times-when-in-prefix (or stamp plain) + (string-match (concat (regexp-quote s0) " *") txt) + (not (equal ?\] (string-to-char (substring txt (match-end 0))))) + (if (eq org-agenda-remove-times-when-in-prefix 'beg) + (= (match-beginning 0) 0) + t)) + (setq txt (replace-match "" nil nil txt)))) ;; Normalize the time(s) to 24 hour - (if s1 (setq s1 (org-get-time-of-day s1 'string t))) - (if s2 (setq s2 (org-get-time-of-day s2 'string t))) + (when s1 (setq s1 (org-get-time-of-day s1 'string t))) + (when s2 (setq s2 (org-get-time-of-day s2 'string t))) ;; Try to set s2 if s1 and ;; `org-agenda-default-appointment-duration' are set @@ -6501,7 +6516,7 @@ Any match of REMOVE-RE will be removed from TXT." (setq duration (- (org-duration-to-minutes s2) (org-duration-to-minutes s1))))) - (when (string-match "\\([ \t]+\\)\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$" txt) + (when (string-match org-tag-group-re txt) ;; Tags are in the string (if (or (eq org-agenda-remove-tags t) (and org-agenda-remove-tags @@ -6509,7 +6524,7 @@ Any match of REMOVE-RE will be removed from TXT." (setq txt (replace-match "" t t txt)) (setq txt (replace-match (concat (make-string (max (- 50 (length txt)) 1) ?\ ) - (match-string 2 txt)) + (match-string 1 txt)) t t txt)))) (when remove-re @@ -6521,14 +6536,16 @@ Any match of REMOVE-RE will be removed from TXT." (add-text-properties 0 (length txt) '(org-heading t) txt) ;; Prepare the variables needed in the eval of the compiled format - (if org-prefix-has-breadcrumbs - (setq breadcrumbs (org-with-point-at (org-get-at-bol 'org-marker) - (let ((s (org-display-outline-path nil nil "->" t))) - (if (eq "" s) "" (concat s "->")))))) + (when org-prefix-has-breadcrumbs + (setq breadcrumbs (org-with-point-at (org-get-at-bol 'org-marker) + (let ((s (org-format-outline-path (org-get-outline-path) + (1- (frame-width)) + nil "->"))) + (if (eq "" s) "" (concat s "->")))))) (setq time (cond (s2 (concat (org-agenda-time-of-day-to-ampm-maybe s1) "-" (org-agenda-time-of-day-to-ampm-maybe s2) - (if org-agenda-timegrid-use-ampm " "))) + (when org-agenda-timegrid-use-ampm " "))) (s1 (concat (org-agenda-time-of-day-to-ampm-maybe s1) (if org-agenda-timegrid-use-ampm @@ -6548,9 +6565,9 @@ Any match of REMOVE-RE will be removed from TXT." (org-add-props category nil 'extra-space (make-string (- org-prefix-category-length l 1) ?\ )))) - (if (and org-prefix-category-max-length - (>= (length category) org-prefix-category-max-length)) - (setq category (substring category 0 (1- org-prefix-category-max-length))))) + (when (and org-prefix-category-max-length + (>= (length category) org-prefix-category-max-length)) + (setq category (substring category 0 (1- org-prefix-category-max-length))))) ;; Evaluate the compiled format (setq rtn (concat (eval formatter) txt)) @@ -6576,8 +6593,8 @@ Any match of REMOVE-RE will be removed from TXT." The modified list may contain inherited tags, and tags matched by `org-agenda-hide-tags-regexp' will be removed." (when (or add-inherited hide-re) - (if (string-match "\\([ \t]+\\)\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$" txt) - (setq txt (substring txt 0 (match-beginning 0)))) + (when (string-match org-tag-group-re txt) + (setq txt (substring txt 0 (match-beginning 0)))) (setq tags (delq nil (mapcar (lambda (tg) @@ -6631,9 +6648,9 @@ TODAYP is t when the current agenda view is on today." (req (car org-agenda-time-grid)) (remove (member 'remove-match req)) new time) - (if (and (member 'require-timed req) (not have)) - ;; don't show empty grid - (throw 'exit list)) + (when (and (member 'require-timed req) (not have)) + ;; don't show empty grid + (throw 'exit list)) (while (setq time (pop gridtimes)) (unless (and remove (member time have)) (setq time (replace-regexp-in-string " " "0" (format "%04s" time))) @@ -6681,19 +6698,19 @@ and stored in the variable `org-prefix-format-compiled'." c (or (match-string 3 s) "") opt (match-beginning 1) start (1+ (match-beginning 0))) - (if (eq var 'time) (setq org-prefix-has-time t)) - (if (eq var 'tag) (setq org-prefix-has-tag t)) - (if (eq var 'effort) (setq org-prefix-has-effort t)) - (if (eq var 'breadcrumbs) (setq org-prefix-has-breadcrumbs t)) + (cl-case var + (time (setq org-prefix-has-time t)) + (tag (setq org-prefix-has-tag t)) + (effort (setq org-prefix-has-effort t)) + (breadcrumbs (setq org-prefix-has-breadcrumbs t))) (setq f (concat "%" (match-string 2 s) "s")) (when (eq var 'category) (setq org-prefix-category-length (floor (abs (string-to-number (match-string 2 s))))) (setq org-prefix-category-max-length (let ((x (match-string 2 s))) - (save-match-data - (if (string-match "\\.[0-9]+" x) - (string-to-number (substring (match-string 0 x) 1))))))) + (when (string-match-p "\\.[0-9]+" x) + (string-to-number (substring (match-string 0 x) 1)))))) (if (eq var 'eval) (setq varform `(format ,f (org-eval ,(read (match-string 4 s))))) (if opt @@ -6741,7 +6758,7 @@ HH:MM." (not (eq (get-text-property 1 'face s) 'org-link))) (let* ((h (string-to-number (match-string 1 s))) (m (if (match-end 3) (string-to-number (match-string 3 s)) 0)) - (ampm (if (match-end 4) (downcase (match-string 4 s)))) + (ampm (when (match-end 4) (downcase (match-string 4 s)))) (am-p (equal ampm "am")) (h1 (cond ((not ampm) h) ((= h 12) (if am-p 0 12)) @@ -6818,7 +6835,7 @@ The optional argument TYPE tells the agenda type." "Limit the number of agenda entries." (let ((include (and limit (< limit 0)))) (if limit - (let ((fun (or fn (lambda (p) (if p 1)))) + (let ((fun (or fn (lambda (p) (when p 1)))) (lim 0)) (delq nil (mapcar @@ -6826,7 +6843,7 @@ The optional argument TYPE tells the agenda type." (let ((pval (funcall fun (get-text-property (1- (length e)) prop e)))) - (if pval (setq lim (+ lim pval))) + (when pval (setq lim (+ lim pval))) (cond ((and pval (<= lim (abs limit))) e) ((and include (not pval)) e)))) list))) @@ -6964,16 +6981,17 @@ The optional argument TYPE tells the agenda type." (tb (and plb (substring b plb))) (case-fold-search nil)) (when pla - (if (string-match (concat "\\`[ \t]*" (or (get-text-property 0 'org-todo-regexp a) "") - "\\([ \t]*\\[[a-zA-Z0-9]\\]\\)? *") ta) - (setq ta (substring ta (match-end 0)))) + (when (string-match (concat "\\`[ \t]*" (or (get-text-property 0 'org-todo-regexp a) "") + "\\([ \t]*\\[[a-zA-Z0-9]\\]\\)? *") ta) + (setq ta (substring ta (match-end 0)))) (setq ta (downcase ta))) (when plb - (if (string-match (concat "\\`[ \t]*" (or (get-text-property 0 'org-todo-regexp b) "") - "\\([ \t]*\\[[a-zA-Z0-9]\\]\\)? *") tb) - (setq tb (substring tb (match-end 0)))) + (when (string-match (concat "\\`[ \t]*" (or (get-text-property 0 'org-todo-regexp b) "") + "\\([ \t]*\\[[a-zA-Z0-9]\\]\\)? *") tb) + (setq tb (substring tb (match-end 0)))) (setq tb (downcase tb))) - (cond ((not ta) +1) + (cond ((not (or ta tb)) nil) + ((not ta) +1) ((not tb) -1) ((string-lessp ta tb) -1) ((string-lessp tb ta) +1)))) @@ -6982,7 +7000,8 @@ The optional argument TYPE tells the agenda type." "Compare the string values of the first tags of A and B." (let ((ta (car (last (get-text-property 1 'tags a)))) (tb (car (last (get-text-property 1 'tags b))))) - (cond ((not ta) +1) + (cond ((not (or ta tb)) nil) + ((not ta) +1) ((not tb) -1) ((string-lessp ta tb) -1) ((string-lessp tb ta) +1)))) @@ -7001,15 +7020,15 @@ When TYPE is \"scheduled\", \"deadline\", \"timestamp\" or \"timestamp_ia\", compare within each of these type. When TYPE is the empty string, compare all timestamps without respect of their type." - (let* ((def (if org-sort-agenda-notime-is-late most-positive-fixnum -1)) + (let* ((def (and (not org-sort-agenda-notime-is-late) -1)) (ta (or (and (string-match type (or (get-text-property 1 'type a) "")) (get-text-property 1 'ts-date a)) def)) (tb (or (and (string-match type (or (get-text-property 1 'type b) "")) (get-text-property 1 'ts-date b)) def))) - (cond ((< ta tb) -1) - ((< tb ta) +1)))) + (cond ((if ta (and tb (< ta tb)) tb) -1) + ((if tb (and ta (< tb ta)) ta) +1)))) (defsubst org-cmp-habit-p (a b) "Compare the todo states of strings A and B." @@ -7069,11 +7088,11 @@ their type." (alpha-down (if alpha-up (- alpha-up) nil)) (need-user-cmp (org-em 'user-defined-up 'user-defined-down ss)) user-defined-up user-defined-down) - (if (and need-user-cmp org-agenda-cmp-user-defined - (functionp org-agenda-cmp-user-defined)) - (setq user-defined-up - (funcall org-agenda-cmp-user-defined a b) - user-defined-down (if user-defined-up (- user-defined-up) nil))) + (when (and need-user-cmp org-agenda-cmp-user-defined + (functionp org-agenda-cmp-user-defined)) + (setq user-defined-up + (funcall org-agenda-cmp-user-defined a b) + user-defined-down (if user-defined-up (- user-defined-up) nil))) (cdr (assoc (eval (cons 'or org-agenda-sorting-strategy-selected)) '((-1 . t) (1 . nil) (nil . nil)))))) @@ -7106,58 +7125,69 @@ Argument ARG is the prefix argument." ;;;###autoload (defun org-agenda-set-restriction-lock (&optional type) - "Set restriction lock for agenda, to current subtree or file. -Restriction will be the file if TYPE is `file', or if type is the -universal prefix \\='(4), or if the cursor is before the first headline -in the file. Otherwise, restriction will be to the current subtree." + "Set restriction lock for agenda to current subtree or file. +When in a restricted subtree, remove it. + +The restriction will span over the entire file if TYPE is `file', +or if type is '(4), or if the cursor is before the first headline +in the file. Otherwise, only apply the restriction to the current +subtree." (interactive "P") - (org-agenda-remove-restriction-lock 'noupdate) - (and (equal type '(4)) (setq type 'file)) - (setq type (cond - (type type) - ((org-at-heading-p) 'subtree) - ((condition-case nil (org-back-to-heading t) (error nil)) - 'subtree) - (t 'file))) - (if (eq type 'subtree) - (progn - (setq org-agenda-restrict (current-buffer)) - (setq org-agenda-overriding-restriction 'subtree) - (put 'org-agenda-files 'org-restrict - (list (buffer-file-name (buffer-base-buffer)))) - (org-back-to-heading t) - (move-overlay org-agenda-restriction-lock-overlay - (point) - (if org-agenda-restriction-lock-highlight-subtree - (save-excursion (org-end-of-subtree t t) (point)) - (point-at-eol))) - (move-marker org-agenda-restrict-begin (point)) - (move-marker org-agenda-restrict-end - (save-excursion (org-end-of-subtree t t))) - (message "Locking agenda restriction to subtree")) - (put 'org-agenda-files 'org-restrict - (list (buffer-file-name (buffer-base-buffer)))) - (setq org-agenda-restrict nil) - (setq org-agenda-overriding-restriction 'file) - (move-marker org-agenda-restrict-begin nil) - (move-marker org-agenda-restrict-end nil) - (message "Locking agenda restriction to file")) - (setq current-prefix-arg nil) + (if (and org-agenda-overriding-restriction + (member org-agenda-restriction-lock-overlay + (overlays-at (point))) + (equal (overlay-start org-agenda-restriction-lock-overlay) + (point))) + (org-agenda-remove-restriction-lock 'noupdate) + (org-agenda-remove-restriction-lock 'noupdate) + (and (equal type '(4)) (setq type 'file)) + (setq type (cond + (type type) + ((org-at-heading-p) 'subtree) + ((condition-case nil (org-back-to-heading t) (error nil)) + 'subtree) + (t 'file))) + (if (eq type 'subtree) + (progn + (setq org-agenda-restrict (current-buffer)) + (setq org-agenda-overriding-restriction 'subtree) + (put 'org-agenda-files 'org-restrict + (list (buffer-file-name (buffer-base-buffer)))) + (org-back-to-heading t) + (move-overlay org-agenda-restriction-lock-overlay + (point) + (if org-agenda-restriction-lock-highlight-subtree + (save-excursion (org-end-of-subtree t t) (point)) + (point-at-eol))) + (move-marker org-agenda-restrict-begin (point)) + (move-marker org-agenda-restrict-end + (save-excursion (org-end-of-subtree t t))) + (message "Locking agenda restriction to subtree")) + (put 'org-agenda-files 'org-restrict + (list (buffer-file-name (buffer-base-buffer)))) + (setq org-agenda-restrict nil) + (setq org-agenda-overriding-restriction 'file) + (move-marker org-agenda-restrict-begin nil) + (move-marker org-agenda-restrict-end nil) + (message "Locking agenda restriction to file")) + (setq current-prefix-arg nil)) (org-agenda-maybe-redo)) (defun org-agenda-remove-restriction-lock (&optional noupdate) - "Remove the agenda restriction lock." + "Remove agenda restriction lock." (interactive "P") - (delete-overlay org-agenda-restriction-lock-overlay) - (delete-overlay org-speedbar-restriction-lock-overlay) - (setq org-agenda-overriding-restriction nil) - (setq org-agenda-restrict nil) - (put 'org-agenda-files 'org-restrict nil) - (move-marker org-agenda-restrict-begin nil) - (move-marker org-agenda-restrict-end nil) - (setq current-prefix-arg nil) - (message "Agenda restriction lock removed") - (or noupdate (org-agenda-maybe-redo))) + (if (not org-agenda-restrict) + (message "No agenda restriction to remove.") + (delete-overlay org-agenda-restriction-lock-overlay) + (delete-overlay org-speedbar-restriction-lock-overlay) + (setq org-agenda-overriding-restriction nil) + (setq org-agenda-restrict nil) + (put 'org-agenda-files 'org-restrict nil) + (move-marker org-agenda-restrict-begin nil) + (move-marker org-agenda-restrict-end nil) + (setq current-prefix-arg nil) + (message "Agenda restriction lock removed") + (or noupdate (org-agenda-maybe-redo)))) (defun org-agenda-maybe-redo () "If there is any window showing the agenda view, update it." @@ -7356,17 +7386,20 @@ With a prefix argument, do so in all agenda buffers." (defvar org-agenda-filter-form nil) (defvar org-agenda-filtered-by-category nil) +(defsubst org-agenda-get-category () + "Return the category of the agenda line." + (org-get-at-bol 'org-category)) + (defun org-agenda-filter-by-category (strip) "Filter lines in the agenda buffer that have a specific category. The category is that of the current line. Without prefix argument, keep only the lines of that category. -With a prefix argument, exclude the lines of that category. -" +With a prefix argument, exclude the lines of that category." (interactive "P") (if (and org-agenda-filtered-by-category org-agenda-category-filter) (org-agenda-filter-show-all-cat) - (let ((cat (org-no-properties (org-get-at-eol 'org-category 1)))) + (let ((cat (org-no-properties (org-agenda-get-category)))) (cond ((and cat strip) (org-agenda-filter-apply @@ -7404,22 +7437,23 @@ The top headline is that of the current line." (defvar org-agenda-regexp-filter nil) (defun org-agenda-filter-by-regexp (strip) - "Filter agenda entries by a regular expression. -Regexp filters are cumulative. -With no prefix argument, keep entries matching the regexp. + "Filter agenda entries by regular expressions. + With one prefix argument, filter out entries matching the regexp. -With two prefix arguments, remove the regexp filters." +If there is already a regexp filter, remove it unless called with +two prefix arguments." (interactive "P") - (if (not (equal strip '(16))) - (let ((flt (concat (if (equal strip '(4)) "-" "+") + (cond + ((and org-agenda-regexp-filter (not (equal strip '(16)))) + (org-agenda-filter-show-all-re) + (message "Regexp filter removed")) + (t (let ((flt (concat (if (equal strip '(4)) "-" "+") (read-from-minibuffer (if (equal strip '(4)) "Filter out entries matching regexp: " "Narrow to entries matching regexp: "))))) (push flt org-agenda-regexp-filter) - (org-agenda-filter-apply org-agenda-regexp-filter 'regexp)) - (org-agenda-filter-show-all-re) - (message "Regexp filter removed"))) + (org-agenda-filter-apply org-agenda-regexp-filter 'regexp))))) (defvar org-agenda-effort-filter nil) (defun org-agenda-filter-by-effort (strip) @@ -7510,7 +7544,7 @@ also press `-' or `+' to switch between filtering and excluding." a n tag) (unless char (while (not (memq char valid-char-list)) - (message + (org-unlogged-message "%s by tag [%s ]:tag-char, [TAB]:tag, %s[/]:off, [+/-]:filter/exclude%s, [q]:quit" (if exclude "Exclude" "Filter") tag-chars @@ -7534,10 +7568,10 @@ also press `-' or `+' to switch between filtering and excluding." (setq org-agenda-tag-filter nil) (dolist (tag (org-agenda-get-represented-tags)) (let ((modifier (funcall org-agenda-auto-exclude-function tag))) - (if modifier - (push modifier org-agenda-tag-filter)))) - (if (not (null org-agenda-tag-filter)) - (org-agenda-filter-apply org-agenda-tag-filter 'tag expand)))) + (when modifier + (push modifier org-agenda-tag-filter)))) + (unless (null org-agenda-tag-filter) + (org-agenda-filter-apply org-agenda-tag-filter 'tag expand)))) ((eq char ?/) (org-agenda-filter-show-all-tag) (when (get 'org-agenda-tag-filter :preset-filter) @@ -7685,7 +7719,7 @@ When NO-OPERATOR is non-nil, do not add the + operator to returned tags." argument EXPAND can be used for the TYPE tag and will expand the tags in the FILTER if any of the tags in FILTER are grouptags." ;; Deactivate `org-agenda-entry-text-mode' when filtering - (if org-agenda-entry-text-mode (org-agenda-entry-text-mode)) + (when org-agenda-entry-text-mode (org-agenda-entry-text-mode)) (let (tags cat txt) (setq org-agenda-filter-form (org-agenda-filter-make-matcher filter type expand)) ;; Only set `org-agenda-filtered-by-category' to t when a unique @@ -7700,14 +7734,14 @@ tags in the FILTER if any of the tags in FILTER are grouptags." (if (org-get-at-bol 'org-marker) (progn (setq tags (org-get-at-bol 'tags) - cat (org-get-at-eol 'org-category 1) + cat (org-agenda-get-category) txt (org-get-at-bol 'txt)) - (if (not (eval org-agenda-filter-form)) - (org-agenda-filter-hide-line type)) + (unless (eval org-agenda-filter-form) + (org-agenda-filter-hide-line type)) (beginning-of-line 2)) (beginning-of-line 2)))) - (if (get-char-property (point) 'invisible) - (ignore-errors (org-agenda-previous-line))))) + (when (get-char-property (point) 'invisible) + (ignore-errors (org-agenda-previous-line))))) (defun org-agenda-filter-top-headline-apply (hl &optional negative) "Filter by top headline HL." @@ -7717,12 +7751,12 @@ tags in the FILTER if any of the tags in FILTER are grouptags." (while (not (eobp)) (let* ((pos (org-get-at-bol 'org-hd-marker)) (tophl (and pos (org-find-top-headline pos)))) - (if (and tophl (funcall (if negative 'identity 'not) - (string= hl tophl))) - (org-agenda-filter-hide-line 'top-headline))) + (when (and tophl (funcall (if negative 'identity 'not) + (string= hl tophl))) + (org-agenda-filter-hide-line 'top-headline))) (beginning-of-line 2))) - (if (get-char-property (point) 'invisible) - (org-agenda-previous-line)) + (when (get-char-property (point) 'invisible) + (org-agenda-previous-line)) (setq org-agenda-top-headline-filter hl org-agenda-filtered-by-top-headline t)) @@ -7877,7 +7911,7 @@ Negative selection means regexp must not match for selection of an entry." (defun org-agenda-forward-block (&optional backward) "Move forward by one agenda block. -When optional argument BACKWARD is set, go backward" +When optional argument BACKWARD is set, go backward." (interactive) (cond ((not (derived-mode-p 'org-agenda-mode)) (user-error @@ -7951,9 +7985,10 @@ With prefix ARG, go backward that many times the current span." (defun org-agenda-view-mode-dispatch () "Call one of the view mode commands." (interactive) - (message "View: [d]ay [w]eek for[t]night [m]onth [y]ear [SPC]reset [q]uit/abort - time[G]rid [[]inactive [f]ollow [l]og [L]og-all [c]lockcheck - [a]rch-trees [A]rch-files clock[R]eport include[D]iary [E]ntryText") + (org-unlogged-message + "View: [d]ay [w]eek for[t]night [m]onth [y]ear [SPC]reset [q]uit/abort + time[G]rid [[]inactive [f]ollow [l]og [L]og-all [c]lockcheck + [a]rch-trees [A]rch-files clock[R]eport include[D]iary [E]ntryText") (pcase (read-char-exclusive) (?\ (call-interactively 'org-agenda-reset-view)) (?d (call-interactively 'org-agenda-day-view)) @@ -8038,8 +8073,8 @@ SPAN may be `day', `week', `fortnight', `month', `year'." (org-agenda-check-type t 'agenda) (let* ((args (get-text-property (min (1- (point-max)) (point)) 'org-last-args)) (curspan (nth 2 args))) - (if (and (not n) (equal curspan span)) - (error "Viewing span is already \"%s\"" span)) + (when (and (not n) (equal curspan span)) + (error "Viewing span is already \"%s\"" span)) (let* ((sd (or (org-get-at-bol 'day) (nth 1 args) org-starting-day)) @@ -8103,11 +8138,10 @@ so that the date SD will be in that range." (org-agenda-check-type t 'agenda) (beginning-of-line 1) ;; This does not work if user makes date format that starts with a blank - (if (looking-at "^\\S-") (forward-char 1)) - (if (not (re-search-forward "^\\S-" nil t arg)) - (progn - (backward-char 1) - (error "No next date after this line in this buffer"))) + (when (looking-at-p "^\\S-") (forward-char 1)) + (unless (re-search-forward "^\\S-" nil t arg) + (backward-char 1) + (error "No next date after this line in this buffer")) (goto-char (match-beginning 0))) (defun org-agenda-previous-date-line (&optional arg) @@ -8115,8 +8149,8 @@ so that the date SD will be in that range." (interactive "p") (org-agenda-check-type t 'agenda) (beginning-of-line 1) - (if (not (re-search-backward "^\\S-" nil t arg)) - (error "No previous date before this line in this buffer"))) + (unless (re-search-backward "^\\S-" nil t arg) + (error "No previous date before this line in this buffer"))) ;; Initialize the highlight (defvar org-hl (make-overlay 1 1)) @@ -8177,7 +8211,6 @@ so that the date SD will be in that range." (interactive) (org-agenda-check-type t 'agenda) (setq org-agenda-clockreport-mode (not org-agenda-clockreport-mode)) - (setq org-agenda-start-with-clockreport-mode org-agenda-clockreport-mode) (org-agenda-set-mode-name) (org-agenda-redo) (message "Clocktable mode is %s" @@ -8201,7 +8234,6 @@ log items, nothing else." nil 'clockcheck)) (special '(closed clock state)) (t (not org-agenda-show-log)))) - (setq org-agenda-start-with-log-mode org-agenda-show-log) (org-agenda-set-mode-name) (org-agenda-redo) (message "Log mode is %s" (if org-agenda-show-log "on" "off"))) @@ -8371,7 +8403,7 @@ When called with a prefix argument, include all archive files as well." (goto (save-excursion (move-end-of-line 0) (previous-single-property-change (point) 'org-marker)))) - (if goto (goto-char goto)) + (when goto (goto-char goto)) (org-move-to-column col))) (org-agenda-do-context-action)) @@ -8658,9 +8690,8 @@ if it was hidden in the outline." When called repeatedly, scroll the window that is displaying the buffer. -With a `\\[universal-argument]' prefix, use `org-show-entry' instead of \ -`outline-show-subtree' -to display the item, so that drawers and logbooks stay folded." +With a `\\[universal-argument]' prefix argument, display the item, but \ +fold drawers." (interactive "P") (let ((win (selected-window))) (if (and (window-live-p org-agenda-show-window) @@ -8669,7 +8700,13 @@ to display the item, so that drawers and logbooks stay folded." (select-window org-agenda-show-window) (ignore-errors (scroll-up))) (org-agenda-goto t) - (if arg (org-show-entry) (outline-show-subtree)) + (org-show-entry) + (if arg (org-cycle-hide-drawers 'children) + (org-with-wide-buffer + (narrow-to-region (org-entry-beginning-position) + (org-entry-end-position)) + (org-show-all '(drawers)))) + (when arg ) (setq org-agenda-show-window (selected-window))) (select-window win))) @@ -8753,8 +8790,8 @@ docstring of `org-agenda-show-1'." (if (equal org-agenda-cycle-counter 0) (setq org-agenda-cycle-counter 2) (setq org-agenda-cycle-counter (1+ org-agenda-cycle-counter)) - (if (> org-agenda-cycle-counter 3) - (setq org-agenda-cycle-counter 0))))) + (when (> org-agenda-cycle-counter 3) + (setq org-agenda-cycle-counter 0))))) (org-agenda-show-1 org-agenda-cycle-counter)) (defun org-agenda-recenter (arg) @@ -8773,8 +8810,8 @@ docstring of `org-agenda-show-1'." (defun org-agenda-check-no-diary () "Check if the entry is a diary link and abort if yes." - (if (org-get-at-bol 'org-agenda-diary-link) - (org-agenda-error))) + (when (org-get-at-bol 'org-agenda-diary-link) + (org-agenda-error))) (defun org-agenda-error () "Throw an error when a command is not allowed in the agenda." @@ -8820,7 +8857,7 @@ the dedicated frame." (with-current-buffer buffer (save-excursion (goto-char pos) - (funcall 'org-tree-to-indirect-buffer arg))))) + (org-tree-to-indirect-buffer arg))))) (defvar org-last-heading-marker (make-marker) "Marker pointing to the headline that last changed its TODO state @@ -8905,14 +8942,12 @@ The new content of the line will be NEWHEAD (as modified by If FIXFACE is non-nil, the face of each item is modified according to the new TODO state. If JUST-THIS is non-nil, change just the current line, not all. -If FORCE-TAGS is non nil, the car of it returns the new tags." +If FORCE-TAGS is non-nil, the car of it returns the new tags." (let* ((inhibit-read-only t) (line (org-current-line)) (org-agenda-buffer (current-buffer)) (thetags (with-current-buffer (marker-buffer hdmarker) - (org-with-wide-buffer - (goto-char hdmarker) - (org-get-tags-at)))) + (org-get-tags hdmarker))) props m pl undone-face done-face finish new dotime level cat tags) (save-excursion (goto-char (point-max)) @@ -8924,7 +8959,7 @@ If FORCE-TAGS is non nil, the car of it returns the new tags." (equal m hdmarker)) (setq props (text-properties-at (point)) dotime (org-get-at-bol 'dotime) - cat (org-get-at-eol 'org-category 1) + cat (org-agenda-get-category) level (org-get-at-bol 'level) tags thetags new @@ -8968,32 +9003,35 @@ If FORCE-TAGS is non nil, the car of it returns the new tags." (beginning-of-line 0))))) (defun org-agenda-align-tags (&optional line) - "Align all tags in agenda items to `org-agenda-tags-column'." + "Align all tags in agenda items to `org-agenda-tags-column'. +When optional argument LINE is non-nil, align tags only on the +current line." (let ((inhibit-read-only t) (org-agenda-tags-column (if (eq 'auto org-agenda-tags-column) (- (window-text-width)) org-agenda-tags-column)) + (end (and line (line-end-position))) l c) (save-excursion - (goto-char (if line (point-at-bol) (point-min))) - (while (re-search-forward "\\([ \t]+\\)\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$" - (if line (point-at-eol) nil) t) + (goto-char (if line (line-beginning-position) (point-min))) + (while (re-search-forward org-tag-group-re end t) (add-text-properties - (match-beginning 2) (match-end 2) + (match-beginning 1) (match-end 1) (list 'face (delq nil (let ((prop (get-text-property - (match-beginning 2) 'face))) + (match-beginning 1) 'face))) (or (listp prop) (setq prop (list prop))) (if (memq 'org-tag prop) prop (cons 'org-tag prop)))))) - (setq l (- (match-end 2) (match-beginning 2)) + (setq l (string-width (match-string 1)) c (if (< org-agenda-tags-column 0) (- (abs org-agenda-tags-column) l) org-agenda-tags-column)) - (delete-region (match-beginning 1) (match-end 1)) (goto-char (match-beginning 1)) + (delete-region (save-excursion (skip-chars-backward " \t") (point)) + (point)) (insert (org-add-props - (make-string (max 1 (- c (current-column))) ?\ ) + (make-string (max 1 (- c (current-column))) ?\s) (plist-put (copy-sequence (text-properties-at (point))) 'face nil)))) (goto-char (point-min)) @@ -9033,7 +9071,7 @@ Called with a universal prefix arg, show the priority instead of setting it." (widen) (goto-char pos) (org-show-context 'agenda) - (funcall 'org-priority force-direction) + (org-priority force-direction) (end-of-line 1) (setq newhead (org-get-heading))) (org-agenda-change-all-lines newhead hdmarker) @@ -9059,7 +9097,7 @@ Called with a universal prefix arg, show the priority instead of setting it." (org-show-context 'agenda) (if tag (org-toggle-tag tag onoff) - (call-interactively 'org-set-tags)) + (call-interactively #'org-set-tags-command)) (end-of-line 1) (setq newhead (org-get-heading))) (org-agenda-change-all-lines newhead hdmarker) @@ -9178,9 +9216,9 @@ Called with a universal prefix arg, show the priority instead of setting it." cdate (calendar-absolute-from-gregorian (list (nth 4 cdate) (nth 3 cdate) (nth 5 cdate))) today (org-today)) - (if (> today cdate) - ;; immediately shift to today - (setq arg (- today cdate)))) + (when (> today cdate) + ;; immediately shift to today + (setq arg (- today cdate)))) (org-timestamp-change arg (or what 'day)) (when (and (org-at-date-range-p) (re-search-backward org-tr-regexp-both (point-at-bol))) @@ -9227,7 +9265,7 @@ Called with a universal prefix arg, show the priority instead of setting it." (goto-char (point-max)) (while (not (bobp)) (when (equal marker (org-get-at-bol 'org-marker)) - (remove-text-properties (point-at-bol) (point-at-eol) '(display)) + (remove-text-properties (point-at-bol) (point-at-eol) '(display nil)) (org-move-to-column (- (window-width) (length stamp)) t) (add-text-properties (1- (point)) (point-at-eol) @@ -9313,7 +9351,6 @@ ARG is passed through to `org-deadline'." (widen) (goto-char pos) (org-show-context 'agenda) - (org-cycle-hide-drawers 'children) (org-clock-in arg) (setq newhead (org-get-heading))) (org-agenda-change-all-lines newhead hdmarker)) @@ -9353,8 +9390,8 @@ buffer, display it in another window." (interactive) (let (pos) (mapc (lambda (o) - (if (eq (overlay-get o 'type) 'org-agenda-clocking) - (setq pos (overlay-start o)))) + (when (eq (overlay-get o 'type) 'org-agenda-clocking) + (setq pos (overlay-start o)))) (overlays-in (point-min) (point-max))) (cond (pos (goto-char pos)) ;; If the currently clocked entry is not in the agenda @@ -9440,9 +9477,9 @@ the resulting entry will not be shown. When TEXT is empty, switch to (find-file-noselect org-agenda-diary-file)) (widen) (goto-char (point-min)) - (cond - ((eq type 'anniversary) - (or (re-search-forward "^*[ \t]+Anniversaries" nil t) + (cl-case type + (anniversary + (or (re-search-forward "^\\*[ \t]+Anniversaries" nil t) (progn (or (org-at-heading-p t) (progn @@ -9455,23 +9492,23 @@ the resulting entry will not be shown. When TEXT is empty, switch to (insert "\n") (insert (format "%%%%(org-anniversary %d %2d %2d) %s" (nth 2 d1) (car d1) (nth 1 d1) text))) - ((eq type 'day) + (day (let ((org-prefix-has-time t) (org-agenda-time-leading-zero t) fmt time time2) - (if org-agenda-insert-diary-extract-time - ;; Use org-agenda-format-item to parse text for a time-range and - ;; remove it. FIXME: This is a hack, we should refactor - ;; that function to make time extraction available separately - (setq fmt (org-agenda-format-item nil text nil nil nil t) - time (get-text-property 0 'time fmt) - time2 (if (> (length time) 0) - ;; split-string removes trailing ...... if - ;; no end time given. First space - ;; separates time from date. - (concat " " (car (split-string time "\\."))) - nil) - text (get-text-property 0 'txt fmt))) + (when org-agenda-insert-diary-extract-time + ;; Use org-agenda-format-item to parse text for a time-range and + ;; remove it. FIXME: This is a hack, we should refactor + ;; that function to make time extraction available separately + (setq fmt (org-agenda-format-item nil text nil nil nil t) + time (get-text-property 0 'time fmt) + time2 (if (> (length time) 0) + ;; split-string removes trailing ...... if + ;; no end time given. First space + ;; separates time from date. + (concat " " (car (split-string time "\\."))) + nil) + text (get-text-property 0 'txt fmt))) (if (eq org-agenda-insert-diary-strategy 'top-level) (org-agenda-insert-diary-as-top-level text) (require 'org-datetree) @@ -9481,10 +9518,12 @@ the resulting entry will not be shown. When TEXT is empty, switch to (calendar-absolute-from-gregorian d1)) nil nil nil nil time2)) (end-of-line 0)) - ((eq type 'block) - (if (> (calendar-absolute-from-gregorian d1) - (calendar-absolute-from-gregorian d2)) - (setq d1 (prog1 d2 (setq d2 d1)))) + ((block) ;; Wrap this in (strictly unnecessary) parens because + ;; otherwise the indentation gets confused by the + ;; special meaning of 'block + (when (> (calendar-absolute-from-gregorian d1) + (calendar-absolute-from-gregorian d2)) + (setq d1 (prog1 d2 (setq d2 d1)))) (if (eq org-agenda-insert-diary-strategy 'top-level) (org-agenda-insert-diary-as-top-level text) (require 'org-datetree) @@ -9552,9 +9591,9 @@ entries in that Org file." (if (not (eq org-agenda-diary-file 'diary-file)) (org-agenda-diary-entry-in-org-file) (require 'diary-lib) - (let* ((char (progn - (message "Diary entry: [d]ay [w]eekly [m]onthly [y]early [a]nniversary [b]lock [c]yclic") - (read-char-exclusive))) + (let* ((char (read-char-exclusive + "Diary entry: [d]ay [w]eekly [m]onthly [y]early\ + [a]nniversary [b]lock [c]yclic")) (cmd (cdr (assoc char '((?d . diary-insert-entry) (?w . diary-insert-weekly-entry) @@ -9699,8 +9738,20 @@ This is a command that has to be installed in `calendar-mode-map'." 'org-marked-entry-overlay)) (defun org-agenda-bulk-mark (&optional arg) - "Mark the entry at point for future bulk action." + "Mark entries for future bulk action. + +When ARG is nil or one and region is not active then mark the +entry at point. + +When ARG is nil or one and region is active then mark the entries +in the region. + +When ARG is greater than one mark ARG lines." (interactive "p") + (when (and (or (not arg) (= arg 1)) (use-region-p)) + (setq arg (count-lines (region-beginning) (region-end))) + (goto-char (region-beginning)) + (deactivate-mark)) (dotimes (i (or arg 1)) (unless (org-get-at-bol 'org-agenda-diary-link) (let* ((m (org-get-at-bol 'org-hd-marker)) @@ -9718,9 +9769,9 @@ This is a command that has to be installed in `calendar-mode-map'." (goto-char (next-single-property-change (point) 'org-hd-marker))) (beginning-of-line 2)) (while (and (get-char-property (point) 'invisible) (not (eobp))) - (beginning-of-line 2)) - (message "%d entries marked for bulk action" - (length org-agenda-bulk-marked-entries)))))) + (beginning-of-line 2))))) + (message "%d entries marked for bulk action" + (length org-agenda-bulk-marked-entries))) (defun org-agenda-bulk-mark-all () "Mark all entries for future agenda bulk action." @@ -9742,8 +9793,8 @@ This is a command that has to be installed in `calendar-mode-map'." (setq entries-marked (1+ entries-marked)) (call-interactively 'org-agenda-bulk-mark))))) - (if (not entries-marked) - (message "No entry matching this regexp.")))) + (unless entries-marked + (message "No entry matching this regexp.")))) (defun org-agenda-bulk-unmark (&optional arg) "Unmark the entry at point for future bulk action." @@ -9815,8 +9866,9 @@ bulk action." "Execute an remote-editing action on all marked entries. The prefix arg is passed through to the command if possible." (interactive "P") - ;; Make sure we have markers, and only valid ones. - (unless org-agenda-bulk-marked-entries (user-error "No entries are marked")) + ;; When there is no mark, act on the agenda entry at point. + (if (not org-agenda-bulk-marked-entries) + (save-excursion (org-agenda-bulk-mark))) (dolist (m org-agenda-bulk-marked-entries) (unless (and (markerp m) (marker-buffer m) @@ -9825,10 +9877,10 @@ The prefix arg is passed through to the command if possible." (user-error "Marker %s for bulk command is invalid" m))) ;; Prompt for the bulk command. - (message + (org-unlogged-message (concat (if org-agenda-persistent-marks "Bulk (persistent): " "Bulk: ") "[$]arch [A]rch->sib [t]odo [+/-]tag [s]chd [d]eadline [r]efile " - "[S]catter [f]unction " + "[S]catter [f]unction [p]ersist-toggle " (and org-agenda-bulk-custom-functions (format " Custom: [%s]" (mapconcat (lambda (f) (char-to-string (car f))) @@ -9895,32 +9947,33 @@ The prefix arg is passed through to the command if possible." (org-agenda-set-tags ,tag ,(if (eq action ?+) ''on ''off)))))) - (?s - (let ((time - (and (not arg) - (org-read-date nil nil nil "(Re)Schedule to" - org-overriding-default-time)))) + ((and (or ?s ?d) c) + (let* ((schedule? (eq c ?s)) + (prompt (if schedule? "(Re)Schedule to" "(Re)Set Deadline to")) + (time + (and (not arg) + (let ((new (org-read-date + nil nil nil prompt org-overriding-default-time))) + ;; A "double plus" answer applies to every + ;; scheduled time. Do not turn it into + ;; a fixed date yet. + (if (string-match-p "\\`[ \t]*\\+\\+" + org-read-date-final-answer) + org-read-date-final-answer + new))))) ;; Make sure to not prompt for a note when bulk - ;; rescheduling as Org cannot cope with simultaneous notes. - ;; Besides, it could be annoying depending on the number of - ;; items re-scheduled. + ;; rescheduling/resetting deadline as Org cannot cope with + ;; simultaneous notes. Besides, it could be annoying + ;; depending on the number of marked items. (setq cmd - `(lambda () - (let ((org-log-reschedule (and org-log-reschedule 'time))) - (org-agenda-schedule arg ,time)))))) - (?d - (let ((time - (and (not arg) - (org-read-date nil nil nil "(Re)Set Deadline to" - org-overriding-default-time)))) - ;; Make sure to not prompt for a note when bulk - ;; rescheduling as Org cannot cope with simultaneous - ;; notes. Besides, it could be annoying depending on the - ;; number of items re-scheduled. - (setq cmd - `(lambda () - (let ((org-log-redeadline (and org-log-redeadline 'time))) - (org-agenda-deadline arg ,time)))))) + (if schedule? + `(lambda () + (let ((org-log-reschedule + (and org-log-reschedule 'time))) + (org-agenda-schedule arg ,time))) + `(lambda () + (let ((org-log-redeadline (and org-log-redeadline 'time))) + (org-agenda-deadline arg ,time))))))) (?S (unless (org-agenda-check-type nil 'agenda 'todo) @@ -10142,9 +10195,9 @@ details and examples. If an entry has a APPT_WARNTIME property, its value will be used to override `appt-message-warning-time'." (interactive "P") - (if refresh (setq appt-time-msg-list nil)) - (if (eq filter t) - (setq filter (read-from-minibuffer "Regexp filter: "))) + (when refresh (setq appt-time-msg-list nil)) + (when (eq filter t) + (setq filter (read-from-minibuffer "Regexp filter: "))) (let* ((cnt 0) ; count added events (scope (or args '(:deadline* :scheduled* :timestamp))) (org-agenda-new-buffers nil) @@ -10153,7 +10206,7 @@ to override `appt-message-warning-time'." ;; time and without date as argument, so it may pass wrong ;; information otherwise (today (org-date-to-gregorian - (time-to-days (current-time)))) + (time-to-days nil))) (org-agenda-restrict nil) (files (org-agenda-files 'unrestricted)) entries file (org-agenda-buffer nil)) @@ -10202,7 +10255,7 @@ to override `appt-message-warning-time'." (message "Added %d event%s for today" cnt (if (> cnt 1) "s" ""))))) (defun org-agenda-today-p (date) - "Non nil when DATE means today. + "Non-nil when DATE means today. DATE is either a list of the form (month day year) or a number of days as returned by `calendar-absolute-from-gregorian' or `org-today'. This function considers `org-extend-today-until' diff --git a/elpa/org-20171030/org-archive.el b/elpa/org-20190930/org-archive.el similarity index 87% rename from elpa/org-20171030/org-archive.el rename to elpa/org-20190930/org-archive.el index 03376172..55c5681b 100644 --- a/elpa/org-20171030/org-archive.el +++ b/elpa/org-20190930/org-archive.el @@ -1,10 +1,10 @@ ;;; org-archive.el --- Archiving for Org -*- lexical-binding: t; -*- -;; Copyright (C) 2004-2017 Free Software Foundation, Inc. +;; Copyright (C) 2004-2019 Free Software Foundation, Inc. ;; Author: Carsten Dominik ;; Keywords: outlines, hypermedia, calendar, wp -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; ;; This file is part of GNU Emacs. ;; @@ -29,6 +29,7 @@ ;;; Code: (require 'org) +(require 'cl-lib) (declare-function org-element-type "org-element" (element)) (declare-function org-datetree-find-date-create "org-datetree" (date &optional keep-restriction)) @@ -126,22 +127,6 @@ Hook functions are called with point on the subtree in the original file. At this stage, the subtree has been added to the archive location, but not yet deleted from the original file.") -(defun org-get-local-archive-location () - "Get the archive location applicable at point." - (let ((re "^[ \t]*#\\+ARCHIVE:[ \t]+\\(\\S-.*\\S-\\)[ \t]*$") - prop) - (save-excursion - (save-restriction - (widen) - (setq prop (org-entry-get nil "ARCHIVE" 'inherit)) - (cond - ((and prop (string-match "\\S-" prop)) - prop) - ((or (re-search-backward re nil t) - (re-search-forward re nil t)) - (match-string 1)) - (t org-archive-location)))))) - ;;;###autoload (defun org-add-archive-files (files) "Splice the archive files into the list of files. @@ -159,47 +144,36 @@ archive file is." files)))) (defun org-all-archive-files () - "Get a list of all archive files used in the current buffer." - (let ((case-fold-search t) - files) - (org-with-wide-buffer - (goto-char (point-min)) - (while (re-search-forward - "^[ \t]*\\(#\\+\\|:\\)ARCHIVE:[ \t]+\\(.*\\)" - nil t) - (when (save-match-data - (if (eq (match-string 1) ":") (org-at-property-p) - (eq (org-element-type (org-element-at-point)) 'keyword))) - (let ((file (org-extract-archive-file - (match-string-no-properties 2)))) - (when (and (org-string-nw-p file) (file-exists-p file)) - (push file files)))))) - (setq files (nreverse files)) - (let ((file (org-extract-archive-file))) - (when (and (org-string-nw-p file) (file-exists-p file)) - (push file files))) - files)) - -(defun org-extract-archive-file (&optional location) - "Extract and expand the file name from archive LOCATION. -if LOCATION is not given, the value of `org-archive-location' is used." - (setq location (or location org-archive-location)) - (if (string-match "\\(.*\\)::\\(.*\\)" location) - (if (= (match-beginning 1) (match-end 1)) - (buffer-file-name (buffer-base-buffer)) - (expand-file-name - (format (match-string 1 location) - (file-name-nondirectory - (buffer-file-name (buffer-base-buffer)))))))) - -(defun org-extract-archive-heading (&optional location) - "Extract the heading from archive LOCATION. -if LOCATION is not given, the value of `org-archive-location' is used." - (setq location (or location org-archive-location)) - (if (string-match "\\(.*\\)::\\(.*\\)" location) - (format (match-string 2 location) - (file-name-nondirectory - (buffer-file-name (buffer-base-buffer)))))) + "List of all archive files used in the current buffer." + (let* ((case-fold-search t) + (files `(,(car (org-archive--compute-location org-archive-location))))) + (org-with-point-at 1 + (while (re-search-forward "^[ \t]*:ARCHIVE:" nil t) + (when (org-at-property-p) + (pcase (org-archive--compute-location (match-string 3)) + (`(,file . ,_) + (when (org-string-nw-p file) + (cl-pushnew file files :test #'file-equal-p)))))) + (cl-remove-if-not #'file-exists-p (nreverse files))))) + +(defun org-archive--compute-location (location) + "Extract and expand the location from archive LOCATION. +Return a pair (FILE . HEADING) where FILE is the file name and +HEADING the heading of the archive location, as strings. Raise +an error if LOCATION is not a valid archive location." + (unless (string-match "::" location) + (error "Invalid archive location: %S" location)) + (let ((current-file (buffer-file-name (buffer-base-buffer))) + (file-fmt (substring location 0 (match-beginning 0))) + (heading-fmt (substring location (match-end 0)))) + (cons + ;; File part. + (if (org-string-nw-p file-fmt) + (expand-file-name + (format file-fmt (file-name-nondirectory current-file))) + current-file) + ;; Heading part. + (format heading-fmt (file-name-nondirectory current-file))))) ;;;###autoload (defun org-archive-subtree (&optional find-done) @@ -231,7 +205,7 @@ direct children of this heading." ((equal find-done '(4)) (org-archive-all-done)) ((equal find-done '(16)) (org-archive-all-old)) (t - ;; Save all relevant TODO keyword-relatex variables + ;; Save all relevant TODO keyword-related variables. (let* ((tr-org-todo-keywords-1 org-todo-keywords-1) (tr-org-todo-kwd-alist org-todo-kwd-alist) (tr-org-done-keywords org-done-keywords) @@ -244,10 +218,11 @@ direct children of this heading." (file (abbreviate-file-name (or (buffer-file-name (buffer-base-buffer)) (error "No file associated to buffer")))) - (location (org-get-local-archive-location)) - (afile (or (org-extract-archive-file location) - (error "Invalid `org-archive-location'"))) - (heading (org-extract-archive-heading location)) + (location (org-archive--compute-location + (or (org-entry-get nil "ARCHIVE" 'inherit) + org-archive-location))) + (afile (car location)) + (heading (cdr location)) (infile-p (equal file (abbreviate-file-name (or afile "")))) (newfile-p (and (org-string-nw-p afile) (not (file-exists-p afile)))) @@ -271,9 +246,15 @@ direct children of this heading." (org-back-to-heading t) ;; Get context information that will be lost by moving the ;; tree. See `org-archive-save-context-info'. - (let* ((all-tags (org-get-tags-at)) - (local-tags (org-get-tags)) - (inherited-tags (org-delete-all local-tags all-tags)) + (let* ((all-tags (org-get-tags)) + (local-tags + (cl-remove-if (lambda (tag) + (get-text-property 0 'inherited tag)) + all-tags)) + (inherited-tags + (cl-remove-if-not (lambda (tag) + (get-text-property 0 'inherited tag)) + all-tags)) (context `((category . ,(org-get-category nil 'force-refresh)) (file . ,file) @@ -315,12 +296,12 @@ direct children of this heading." org-odd-levels-only tr-org-odd-levels-only))) (goto-char (point-min)) - (outline-show-all) + (org-show-all '(headings blocks)) (if (and heading (not (and datetree-date (not datetree-subheading-p)))) (progn (if (re-search-forward (concat "^" (regexp-quote heading) - "[ \t]*\\(:[[:alnum:]_@#%:]+:\\)?[ \t]*\\($\\|\r\\)") + "\\([ \t]+:\\(" org-tag-re ":\\)+\\)?[ \t]*$") nil t) (goto-char (match-end 0)) ;; Heading not found, just insert it at the end @@ -345,8 +326,7 @@ direct children of this heading." (if org-archive-reversed-order (progn (goto-char (point-min)) - (unless (org-at-heading-p) (outline-next-heading)) - (insert "\n") (backward-char 1)) + (unless (org-at-heading-p) (outline-next-heading))) (goto-char (point-max)) ;; Subtree narrowing can let the buffer end on ;; a headline. `org-paste-subtree' then deletes it. @@ -361,7 +341,7 @@ direct children of this heading." (or (and (eq org-archive-subtree-add-inherited-tags 'infile) infile-p) (eq org-archive-subtree-add-inherited-tags t)) - (org-set-tags-to all-tags)) + (org-set-tags all-tags)) ;; Mark the entry as done (when (and org-archive-mark-done (let ((case-fold-search nil)) @@ -381,10 +361,7 @@ direct children of this heading." (point) (concat "ARCHIVE_" (upcase (symbol-name item))) value)))) - (widen) - ;; Save and kill the buffer, if it is not the same - ;; buffer. - (unless (eq this-buffer buffer) (save-buffer))))) + (widen)))) ;; Here we are back in the original buffer. Everything seems ;; to have worked. So now run hooks, cut the tree and finish ;; up. @@ -393,6 +370,12 @@ direct children of this heading." (when (featurep 'org-inlinetask) (org-inlinetask-remove-END-maybe)) (setq org-markers-to-move nil) + (when org-provide-todo-statistics + (save-excursion + ;; Go to parent, even if no children exist. + (org-up-heading-safe) + ;; Update cookie of parent. + (org-update-statistics-cookies nil))) (message "Subtree archived %s" (if (eq this-buffer buffer) (concat "under heading: " heading) @@ -419,7 +402,7 @@ Archiving time is retained in the ARCHIVE_TIME node property." '(progn (setq org-map-continue-from (progn (org-back-to-heading) (if (looking-at (concat "^.*:" org-archive-tag ":.*$")) - (org-end-of-subtree t) + (org-end-of-subtree t) (point)))) (when (org-at-heading-p) (org-archive-to-archive-sibling))) @@ -432,7 +415,7 @@ Archiving time is retained in the ARCHIVE_TIME node property." (looking-at org-outline-regexp) (setq leader (match-string 0) level (funcall outline-level)) - (setq pos (point)) + (setq pos (point-marker)) (condition-case nil (outline-up-heading 1 t) (error (setq e (point-max)) (goto-char (point-min)))) @@ -469,6 +452,9 @@ Archiving time is retained in the ARCHIVE_TIME node property." (outline-up-heading 1 t) (outline-hide-subtree) (org-cycle-show-empty-lines 'folded) + (when org-provide-todo-statistics + ;; Update TODO statistics of parent. + (org-update-parent-todo-statistics)) (goto-char pos))) (org-reveal) (if (looking-at "^[ \t]*$") diff --git a/elpa/org-20171030/org-attach.el b/elpa/org-20190930/org-attach.el similarity index 93% rename from elpa/org-20171030/org-attach.el rename to elpa/org-20190930/org-attach.el index 38b79cec..4100d6f0 100644 --- a/elpa/org-20171030/org-attach.el +++ b/elpa/org-20190930/org-attach.el @@ -1,6 +1,6 @@ ;;; org-attach.el --- Manage file attachments to Org tasks -*- lexical-binding: t; -*- -;; Copyright (C) 2008-2017 Free Software Foundation, Inc. +;; Copyright (C) 2008-2019 Free Software Foundation, Inc. ;; Author: John Wiegley ;; Keywords: org data task @@ -54,7 +54,8 @@ If this is a relative path, it will be interpreted relative to the directory where the Org file lives." :group 'org-attach - :type 'directory) + :type 'directory + :safe #'stringp) (defcustom org-attach-commit t "If non-nil commit attachments with git. @@ -192,7 +193,7 @@ D Delete all of a task's attachments. A safer way is s Set a specific attachment directory for this entry or reset to default. i Make children of the current entry inherit its attachment directory."))) (org-fit-window-to-buffer (get-buffer-window "*Org Attach*")) - (message "Select command: [acmlzoOfFdD]") + (message "Select command: [acmlyunzoOfFdD]") (setq c (read-char-exclusive)) (and (get-buffer "*Org Attach*") (kill-buffer "*Org Attach*")))) (cond @@ -319,7 +320,8 @@ the ATTACH_DIR property) their own attachment directory." (defun org-attach-annex-get-maybe (path) "Call git annex get PATH (via shell) if using git annex. Signals an error if the file content is not available and it was not retrieved." - (let ((path-relative (file-relative-name path))) + (let* ((default-directory (expand-file-name org-attach-directory)) + (path-relative (file-relative-name path))) (when (and (org-attach-use-annex) (not (string-equal @@ -352,7 +354,7 @@ This checks for the existence of a \".git\" directory in that directory." (shell-command-to-string "git ls-files -zmo --exclude-standard") "\0" t)) (if (and use-annex - (>= (nth 7 (file-attributes new-or-modified)) + (>= (file-attribute-size (file-attributes new-or-modified)) org-attach-git-annex-cutoff)) (call-process "git" nil nil nil "annex" "add" new-or-modified) (call-process "git" nil nil nil "add" new-or-modified)) @@ -507,7 +509,7 @@ This can be used after files have been added externally." (let ((attach-dir (org-attach-dir))) (when attach-dir (let ((files (org-attach-file-list attach-dir))) - (and files (org-attach-tag)) + (org-attach-tag (not files)) (when org-attach-file-list-property (dolist (file files) (unless (string-match "^\\.\\.?\\'" file) @@ -572,10 +574,45 @@ prefix." "Maybe delete subtree attachments when archiving. This function is called by `org-archive-hook'. The option `org-attach-archive-delete' controls its behavior." - (when (if (eq org-attach-archive-delete 'query) - (yes-or-no-p "Delete all attachments? ") - org-attach-archive-delete) - (org-attach-delete-all t))) + (when org-attach-archive-delete + (org-attach-delete-all (not (eq org-attach-archive-delete 'query))))) + + +;; Attach from dired. + +;; Add the following lines to the config file to get a binding for +;; dired-mode. + +;; (add-hook +;; 'dired-mode-hook +;; (lambda () +;; (define-key dired-mode-map (kbd "C-c C-x a") #'org-attach-dired-to-subtree)))) + +;;;###autoload +(defun org-attach-dired-to-subtree (files) + "Attach FILES marked or current file in dired to subtree in other window. +Takes the method given in `org-attach-method' for the attach action. +Precondition: Point must be in a dired buffer. +Idea taken from `gnus-dired-attach'." + (interactive + (list (dired-get-marked-files))) + (unless (eq major-mode 'dired-mode) + (user-error "This command must be triggered in a dired buffer.")) + (let ((start-win (selected-window)) + (other-win + (get-window-with-predicate + (lambda (window) + (with-current-buffer (window-buffer window) + (eq major-mode 'org-mode)))))) + (unless other-win + (user-error + "Can't attach to subtree. No window displaying an Org buffer")) + (select-window other-win) + (dolist (file files) + (org-attach-attach file)) + (select-window start-win))) + + (add-hook 'org-archive-hook 'org-attach-archive-delete-maybe) diff --git a/elpa/org-20190930/org-autoloads.el b/elpa/org-20190930/org-autoloads.el new file mode 100644 index 00000000..6496da61 --- /dev/null +++ b/elpa/org-20190930/org-autoloads.el @@ -0,0 +1,1483 @@ +;;; org-autoloads.el --- automatically extracted autoloads +;; +;;; Code: + +(add-to-list 'load-path (directory-file-name + (or (file-name-directory #$) (car load-path)))) + + +;;;### (autoloads nil "ob-C" "ob-C.el" (0 0 0 0)) +;;; Generated autoloads from ob-C.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-C" '("org-babel-"))) + +;;;*** + +;;;### (autoloads nil "ob-J" "ob-J.el" (0 0 0 0)) +;;; Generated autoloads from ob-J.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-J" '("obj-" "org-babel-"))) + +;;;*** + +;;;### (autoloads nil "ob-R" "ob-R.el" (0 0 0 0)) +;;; Generated autoloads from ob-R.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-R" '("ob-R-" "org-babel-"))) + +;;;*** + +;;;### (autoloads nil "ob-abc" "ob-abc.el" (0 0 0 0)) +;;; Generated autoloads from ob-abc.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-abc" '("org-babel-"))) + +;;;*** + +;;;### (autoloads nil "ob-asymptote" "ob-asymptote.el" (0 0 0 0)) +;;; Generated autoloads from ob-asymptote.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-asymptote" '("org-babel-"))) + +;;;*** + +;;;### (autoloads nil "ob-awk" "ob-awk.el" (0 0 0 0)) +;;; Generated autoloads from ob-awk.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-awk" '("org-babel-"))) + +;;;*** + +;;;### (autoloads nil "ob-calc" "ob-calc.el" (0 0 0 0)) +;;; Generated autoloads from ob-calc.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-calc" '("org-babel-"))) + +;;;*** + +;;;### (autoloads nil "ob-clojure" "ob-clojure.el" (0 0 0 0)) +;;; Generated autoloads from ob-clojure.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-clojure" '("org-babel-"))) + +;;;*** + +;;;### (autoloads nil "ob-comint" "ob-comint.el" (0 0 0 0)) +;;; Generated autoloads from ob-comint.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-comint" '("org-babel-comint-"))) + +;;;*** + +;;;### (autoloads nil "ob-coq" "ob-coq.el" (0 0 0 0)) +;;; Generated autoloads from ob-coq.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-coq" '("org-babel-" "coq-program-name"))) + +;;;*** + +;;;### (autoloads nil "ob-css" "ob-css.el" (0 0 0 0)) +;;; Generated autoloads from ob-css.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-css" '("org-babel-"))) + +;;;*** + +;;;### (autoloads nil "ob-ditaa" "ob-ditaa.el" (0 0 0 0)) +;;; Generated autoloads from ob-ditaa.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-ditaa" '("org-"))) + +;;;*** + +;;;### (autoloads nil "ob-dot" "ob-dot.el" (0 0 0 0)) +;;; Generated autoloads from ob-dot.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-dot" '("org-babel-"))) + +;;;*** + +;;;### (autoloads nil "ob-ebnf" "ob-ebnf.el" (0 0 0 0)) +;;; Generated autoloads from ob-ebnf.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-ebnf" '("org-babel-"))) + +;;;*** + +;;;### (autoloads nil "ob-emacs-lisp" "ob-emacs-lisp.el" (0 0 0 0)) +;;; Generated autoloads from ob-emacs-lisp.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-emacs-lisp" '("org-babel-"))) + +;;;*** + +;;;### (autoloads nil "ob-eval" "ob-eval.el" (0 0 0 0)) +;;; Generated autoloads from ob-eval.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-eval" '("org-babel-"))) + +;;;*** + +;;;### (autoloads nil "ob-exp" "ob-exp.el" (0 0 0 0)) +;;; Generated autoloads from ob-exp.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-exp" '("org-"))) + +;;;*** + +;;;### (autoloads nil "ob-forth" "ob-forth.el" (0 0 0 0)) +;;; Generated autoloads from ob-forth.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-forth" '("org-babel-"))) + +;;;*** + +;;;### (autoloads nil "ob-fortran" "ob-fortran.el" (0 0 0 0)) +;;; Generated autoloads from ob-fortran.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-fortran" '("org-babel-"))) + +;;;*** + +;;;### (autoloads nil "ob-gnuplot" "ob-gnuplot.el" (0 0 0 0)) +;;; Generated autoloads from ob-gnuplot.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-gnuplot" '("org-babel-" "*org-babel-gnuplot-"))) + +;;;*** + +;;;### (autoloads nil "ob-groovy" "ob-groovy.el" (0 0 0 0)) +;;; Generated autoloads from ob-groovy.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-groovy" '("org-babel-"))) + +;;;*** + +;;;### (autoloads nil "ob-haskell" "ob-haskell.el" (0 0 0 0)) +;;; Generated autoloads from ob-haskell.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-haskell" '("org-babel-"))) + +;;;*** + +;;;### (autoloads nil "ob-hledger" "ob-hledger.el" (0 0 0 0)) +;;; Generated autoloads from ob-hledger.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-hledger" '("org-babel-"))) + +;;;*** + +;;;### (autoloads nil "ob-io" "ob-io.el" (0 0 0 0)) +;;; Generated autoloads from ob-io.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-io" '("org-babel-"))) + +;;;*** + +;;;### (autoloads nil "ob-java" "ob-java.el" (0 0 0 0)) +;;; Generated autoloads from ob-java.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-java" '("org-babel-"))) + +;;;*** + +;;;### (autoloads nil "ob-js" "ob-js.el" (0 0 0 0)) +;;; Generated autoloads from ob-js.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-js" '("org-babel-"))) + +;;;*** + +;;;### (autoloads nil "ob-latex" "ob-latex.el" (0 0 0 0)) +;;; Generated autoloads from ob-latex.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-latex" '("org-babel-"))) + +;;;*** + +;;;### (autoloads nil "ob-ledger" "ob-ledger.el" (0 0 0 0)) +;;; Generated autoloads from ob-ledger.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-ledger" '("org-babel-"))) + +;;;*** + +;;;### (autoloads nil "ob-lilypond" "ob-lilypond.el" (0 0 0 0)) +;;; Generated autoloads from ob-lilypond.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-lilypond" '("org-babel-" "lilypond-mode"))) + +;;;*** + +;;;### (autoloads nil "ob-lisp" "ob-lisp.el" (0 0 0 0)) +;;; Generated autoloads from ob-lisp.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-lisp" '("org-babel-"))) + +;;;*** + +;;;### (autoloads nil "ob-lua" "ob-lua.el" (0 0 0 0)) +;;; Generated autoloads from ob-lua.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-lua" '("org-babel-"))) + +;;;*** + +;;;### (autoloads nil "ob-makefile" "ob-makefile.el" (0 0 0 0)) +;;; Generated autoloads from ob-makefile.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-makefile" '("org-babel-"))) + +;;;*** + +;;;### (autoloads nil "ob-maxima" "ob-maxima.el" (0 0 0 0)) +;;; Generated autoloads from ob-maxima.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-maxima" '("org-babel-"))) + +;;;*** + +;;;### (autoloads nil "ob-mscgen" "ob-mscgen.el" (0 0 0 0)) +;;; Generated autoloads from ob-mscgen.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-mscgen" '("org-babel-"))) + +;;;*** + +;;;### (autoloads nil "ob-ocaml" "ob-ocaml.el" (0 0 0 0)) +;;; Generated autoloads from ob-ocaml.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-ocaml" '("org-babel-"))) + +;;;*** + +;;;### (autoloads nil "ob-octave" "ob-octave.el" (0 0 0 0)) +;;; Generated autoloads from ob-octave.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-octave" '("org-babel-"))) + +;;;*** + +;;;### (autoloads nil "ob-org" "ob-org.el" (0 0 0 0)) +;;; Generated autoloads from ob-org.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-org" '("org-babel-"))) + +;;;*** + +;;;### (autoloads nil "ob-perl" "ob-perl.el" (0 0 0 0)) +;;; Generated autoloads from ob-perl.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-perl" '("org-babel-"))) + +;;;*** + +;;;### (autoloads nil "ob-picolisp" "ob-picolisp.el" (0 0 0 0)) +;;; Generated autoloads from ob-picolisp.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-picolisp" '("org-babel-"))) + +;;;*** + +;;;### (autoloads nil "ob-plantuml" "ob-plantuml.el" (0 0 0 0)) +;;; Generated autoloads from ob-plantuml.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-plantuml" '("org-"))) + +;;;*** + +;;;### (autoloads nil "ob-processing" "ob-processing.el" (0 0 0 0)) +;;; Generated autoloads from ob-processing.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-processing" '("org-babel-"))) + +;;;*** + +;;;### (autoloads nil "ob-python" "ob-python.el" (0 0 0 0)) +;;; Generated autoloads from ob-python.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-python" '("org-babel-"))) + +;;;*** + +;;;### (autoloads nil "ob-ref" "ob-ref.el" (0 0 0 0)) +;;; Generated autoloads from ob-ref.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-ref" '("org-babel-"))) + +;;;*** + +;;;### (autoloads nil "ob-ruby" "ob-ruby.el" (0 0 0 0)) +;;; Generated autoloads from ob-ruby.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-ruby" '("org-babel-"))) + +;;;*** + +;;;### (autoloads nil "ob-sass" "ob-sass.el" (0 0 0 0)) +;;; Generated autoloads from ob-sass.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-sass" '("org-babel-"))) + +;;;*** + +;;;### (autoloads nil "ob-scheme" "ob-scheme.el" (0 0 0 0)) +;;; Generated autoloads from ob-scheme.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-scheme" '("org-babel-"))) + +;;;*** + +;;;### (autoloads nil "ob-screen" "ob-screen.el" (0 0 0 0)) +;;; Generated autoloads from ob-screen.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-screen" '("org-babel-"))) + +;;;*** + +;;;### (autoloads nil "ob-sed" "ob-sed.el" (0 0 0 0)) +;;; Generated autoloads from ob-sed.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-sed" '("org-babel-"))) + +;;;*** + +;;;### (autoloads nil "ob-shell" "ob-shell.el" (0 0 0 0)) +;;; Generated autoloads from ob-shell.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-shell" '("org-babel-"))) + +;;;*** + +;;;### (autoloads nil "ob-shen" "ob-shen.el" (0 0 0 0)) +;;; Generated autoloads from ob-shen.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-shen" '("org-babel-"))) + +;;;*** + +;;;### (autoloads nil "ob-sql" "ob-sql.el" (0 0 0 0)) +;;; Generated autoloads from ob-sql.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-sql" '("org-babel-"))) + +;;;*** + +;;;### (autoloads nil "ob-sqlite" "ob-sqlite.el" (0 0 0 0)) +;;; Generated autoloads from ob-sqlite.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-sqlite" '("org-babel-"))) + +;;;*** + +;;;### (autoloads nil "ob-stan" "ob-stan.el" (0 0 0 0)) +;;; Generated autoloads from ob-stan.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-stan" '("org-babel-"))) + +;;;*** + +;;;### (autoloads nil "ob-table" "ob-table.el" (0 0 0 0)) +;;; Generated autoloads from ob-table.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-table" '("org-"))) + +;;;*** + +;;;### (autoloads nil "ob-vala" "ob-vala.el" (0 0 0 0)) +;;; Generated autoloads from ob-vala.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-vala" '("org-babel-"))) + +;;;*** + +;;;### (autoloads nil "org" "org.el" (0 0 0 0)) +;;; Generated autoloads from org.el + +(autoload 'org-babel-do-load-languages "org" "\ +Load the languages defined in `org-babel-load-languages'. + +\(fn SYM VALUE)" nil nil) + +(autoload 'org-babel-load-file "org" "\ +Load Emacs Lisp source code blocks in the Org FILE. +This function exports the source code using `org-babel-tangle' +and then loads the resulting file using `load-file'. With prefix +arg (noninteractively: 2nd arg) COMPILE the tangled Emacs Lisp +file to byte-code before it is loaded. + +\(fn FILE &optional COMPILE)" t nil) + +(autoload 'org-version "org" "\ +Show the Org version. +Interactively, or when MESSAGE is non-nil, show it in echo area. +With prefix argument, or when HERE is non-nil, insert it at point. +In non-interactive uses, a reduced version string is output unless +FULL is given. + +\(fn &optional HERE FULL MESSAGE)" t nil) + +(autoload 'turn-on-orgtbl "org" "\ +Unconditionally turn on `orgtbl-mode'. + +\(fn)" nil nil) + +(autoload 'org-clock-persistence-insinuate "org" "\ +Set up hooks for clock persistence. + +\(fn)" nil nil) + +(autoload 'org-mode "org" "\ +Outline-based notes management and organizer, alias +\"Carsten's outline-mode for keeping track of everything.\" + +Org mode develops organizational tasks around a NOTES file which +contains information about projects as plain text. Org mode is +implemented on top of Outline mode, which is ideal to keep the content +of large files well structured. It supports ToDo items, deadlines and +time stamps, which magically appear in the diary listing of the Emacs +calendar. Tables are easily created with a built-in table editor. +Plain text URL-like links connect to websites, emails (VM), Usenet +messages (Gnus), BBDB entries, and any files related to the project. +For printing and sharing of notes, an Org file (or a part of it) +can be exported as a structured ASCII or HTML file. + +The following commands are available: + +\\{org-mode-map} + +\(fn)" t nil) + +(autoload 'org-cycle "org" "\ +TAB-action and visibility cycling for Org mode. + +This is the command invoked in Org mode by the `TAB' key. Its main +purpose is outline visibility cycling, but it also invokes other actions +in special contexts. + +When this function is called with a `\\[universal-argument]' prefix, rotate the entire +buffer through 3 states (global cycling) + 1. OVERVIEW: Show only top-level headlines. + 2. CONTENTS: Show all headlines of all levels, but no body text. + 3. SHOW ALL: Show everything. + +With a `\\[universal-argument] \\[universal-argument]' prefix argument, switch to the startup visibility, +determined by the variable `org-startup-folded', and by any VISIBILITY +properties in the buffer. + +With a `\\[universal-argument] \\[universal-argument] \\[universal-argument]' prefix argument, show the entire buffer, including +any drawers. + +When inside a table, re-align the table and move to the next field. + +When point is at the beginning of a headline, rotate the subtree started +by this line through 3 different states (local cycling) + 1. FOLDED: Only the main headline is shown. + 2. CHILDREN: The main headline and the direct children are shown. + From this state, you can move to one of the children + and zoom in further. + 3. SUBTREE: Show the entire subtree, including body text. +If there is no subtree, switch directly from CHILDREN to FOLDED. + +When point is at the beginning of an empty headline and the variable +`org-cycle-level-after-item/entry-creation' is set, cycle the level +of the headline by demoting and promoting it to likely levels. This +speeds up creation document structure by pressing `TAB' once or several +times right after creating a new headline. + +When there is a numeric prefix, go up to a heading with level ARG, do +a `show-subtree' and return to the previous cursor position. If ARG +is negative, go up that many levels. + +When point is not at the beginning of a headline, execute the global +binding for `TAB', which is re-indenting the line. See the option +`org-cycle-emulate-tab' for details. + +As a special case, if point is at the beginning of the buffer and there is +no headline in line 1, this function will act as if called with prefix arg +\(`\\[universal-argument] TAB', same as `S-TAB') also when called without prefix arg, but only +if the variable `org-cycle-global-at-bob' is t. + +\(fn &optional ARG)" t nil) + +(autoload 'org-global-cycle "org" "\ +Cycle the global visibility. For details see `org-cycle'. +With `\\[universal-argument]' prefix ARG, switch to startup visibility. +With a numeric prefix, show all headlines up to that level. + +\(fn &optional ARG)" t nil) + +(autoload 'org-run-like-in-org-mode "org" "\ +Run a command, pretending that the current buffer is in Org mode. +This will temporarily bind local variables that are typically bound in +Org mode to the values they have in Org mode, and then interactively +call CMD. + +\(fn CMD)" nil nil) + +(autoload 'org-store-link "org" "\ +Store a link to the current location. +\\ +This link is added to `org-stored-links' and can later be inserted +into an Org buffer with `org-insert-link' (`\\[org-insert-link]'). + +For some link types, a `\\[universal-argument]' prefix ARG is interpreted. A single +`\\[universal-argument]' negates `org-context-in-file-links' for file links or +`org-gnus-prefer-web-links' for links to Usenet articles. + +A `\\[universal-argument] \\[universal-argument]' prefix ARG forces skipping storing functions that are not +part of Org core. + +A `\\[universal-argument] \\[universal-argument] \\[universal-argument]' prefix ARG forces storing a link for each line in the +active region. + +Assume the function is called interactively if INTERACTIVE? is +non-nil. + +\(fn ARG &optional INTERACTIVE\\=\\?)" t nil) + +(autoload 'org-insert-link-global "org" "\ +Insert a link like Org mode does. +This command can be called in any mode to insert a link in Org syntax. + +\(fn)" t nil) + +(autoload 'org-open-at-point-global "org" "\ +Follow a link or a time-stamp like Org mode does. +Also follow links and emails as seen by `thing-at-point'. +This command can be called in any mode to follow an external +link or a time-stamp that has Org mode syntax. Its behavior +is undefined when called on internal links like fuzzy links. +Raise a user error when there is nothing to follow. + +\(fn)" t nil) + +(autoload 'org-open-link-from-string "org" "\ +Open a link in the string S, as if it was in Org mode. + +\(fn S &optional ARG REFERENCE-BUFFER)" t nil) + +(autoload 'org-switchb "org" "\ +Switch between Org buffers. + +With `\\[universal-argument]' prefix, restrict available buffers to files. + +With `\\[universal-argument] \\[universal-argument]' prefix, restrict available buffers to agenda files. + +\(fn &optional ARG)" t nil) + +(autoload 'org-cycle-agenda-files "org" "\ +Cycle through the files in `org-agenda-files'. +If the current buffer visits an agenda file, find the next one in the list. +If the current buffer does not, find the first agenda file. + +\(fn)" t nil) + +(autoload 'org-submit-bug-report "org" "\ +Submit a bug report on Org via mail. + +Don't hesitate to report any problems or inaccurate documentation. + +If you don't have setup sending mail from (X)Emacs, please copy the +output buffer into your mail program, as it gives us important +information about your Org version and configuration. + +\(fn)" t nil) + +(autoload 'org-reload "org" "\ +Reload all Org Lisp files. +With prefix arg UNCOMPILED, load the uncompiled versions. + +\(fn &optional UNCOMPILED)" t nil) + +(autoload 'org-customize "org" "\ +Call the customize function with org as argument. + +\(fn)" t nil) + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org" '("org-" "turn-on-org-cdlatex"))) + +;;;*** + +;;;### (autoloads nil "org-agenda" "org-agenda.el" (0 0 0 0)) +;;; Generated autoloads from org-agenda.el + +(autoload 'org-toggle-sticky-agenda "org-agenda" "\ +Toggle `org-agenda-sticky'. + +\(fn &optional ARG)" t nil) + +(autoload 'org-agenda "org-agenda" "\ +Dispatch agenda commands to collect entries to the agenda buffer. +Prompts for a command to execute. Any prefix arg will be passed +on to the selected command. The default selections are: + +a Call `org-agenda-list' to display the agenda for current day or week. +t Call `org-todo-list' to display the global todo list. +T Call `org-todo-list' to display the global todo list, select only + entries with a specific TODO keyword (the user gets a prompt). +m Call `org-tags-view' to display headlines with tags matching + a condition (the user is prompted for the condition). +M Like `m', but select only TODO entries, no ordinary headlines. +e Export views to associated files. +s Search entries for keywords. +S Search entries for keywords, only with TODO keywords. +/ Multi occur across all agenda files and also files listed + in `org-agenda-text-search-extra-files'. +< Restrict agenda commands to buffer, subtree, or region. + Press several times to get the desired effect. +> Remove a previous restriction. +# List \"stuck\" projects. +! Configure what \"stuck\" means. +C Configure custom agenda commands. + +More commands can be added by configuring the variable +`org-agenda-custom-commands'. In particular, specific tags and TODO keyword +searches can be pre-defined in this way. + +If the current buffer is in Org mode and visiting a file, you can also +first press `<' once to indicate that the agenda should be temporarily +\(until the next use of `\\[org-agenda]') restricted to the current file. +Pressing `<' twice means to restrict to the current subtree or region +\(if active). + +\(fn &optional ARG ORG-KEYS RESTRICTION)" t nil) + +(autoload 'org-batch-agenda "org-agenda" "\ +Run an agenda command in batch mode and send the result to STDOUT. +If CMD-KEY is a string of length 1, it is used as a key in +`org-agenda-custom-commands' and triggers this command. If it is a +longer string it is used as a tags/todo match string. +Parameters are alternating variable names and values that will be bound +before running the agenda command. + +\(fn CMD-KEY &rest PARAMETERS)" nil t) + +(autoload 'org-batch-agenda-csv "org-agenda" "\ +Run an agenda command in batch mode and send the result to STDOUT. +If CMD-KEY is a string of length 1, it is used as a key in +`org-agenda-custom-commands' and triggers this command. If it is a +longer string it is used as a tags/todo match string. +Parameters are alternating variable names and values that will be bound +before running the agenda command. + +The output gives a line for each selected agenda item. Each +item is a list of comma-separated values, like this: + +category,head,type,todo,tags,date,time,extra,priority-l,priority-n + +category The category of the item +head The headline, without TODO kwd, TAGS and PRIORITY +type The type of the agenda entry, can be + todo selected in TODO match + tagsmatch selected in tags match + diary imported from diary + deadline a deadline on given date + scheduled scheduled on given date + timestamp entry has timestamp on given date + closed entry was closed on given date + upcoming-deadline warning about deadline + past-scheduled forwarded scheduled item + block entry has date block including g. date +todo The todo keyword, if any +tags All tags including inherited ones, separated by colons +date The relevant date, like 2007-2-14 +time The time, like 15:00-16:50 +extra Sting with extra planning info +priority-l The priority letter if any was given +priority-n The computed numerical priority +agenda-day The day in the agenda where this is listed + +\(fn CMD-KEY &rest PARAMETERS)" nil t) + +(autoload 'org-store-agenda-views "org-agenda" "\ +Store agenda views. + +\(fn &rest PARAMETERS)" t nil) + +(autoload 'org-batch-store-agenda-views "org-agenda" "\ +Run all custom agenda commands that have a file argument. + +\(fn &rest PARAMETERS)" nil t) + +(autoload 'org-agenda-list "org-agenda" "\ +Produce a daily/weekly view from all files in variable `org-agenda-files'. +The view will be for the current day or week, but from the overview buffer +you will be able to go to other days/weeks. + +With a numeric prefix argument in an interactive call, the agenda will +span ARG days. Lisp programs should instead specify SPAN to change +the number of days. SPAN defaults to `org-agenda-span'. + +START-DAY defaults to TODAY, or to the most recent match for the weekday +given in `org-agenda-start-on-weekday'. + +When WITH-HOUR is non-nil, only include scheduled and deadline +items if they have an hour specification like [h]h:mm. + +\(fn &optional ARG START-DAY SPAN WITH-HOUR)" t nil) + +(autoload 'org-search-view "org-agenda" "\ +Show all entries that contain a phrase or words or regular expressions. + +With optional prefix argument TODO-ONLY, only consider entries that are +TODO entries. The argument STRING can be used to pass a default search +string into this function. If EDIT-AT is non-nil, it means that the +user should get a chance to edit this string, with cursor at position +EDIT-AT. + +The search string can be viewed either as a phrase that should be found as +is, or it can be broken into a number of snippets, each of which must match +in a Boolean way to select an entry. The default depends on the variable +`org-agenda-search-view-always-boolean'. +Even if this is turned off (the default) you can always switch to +Boolean search dynamically by preceding the first word with \"+\" or \"-\". + +The default is a direct search of the whole phrase, where each space in +the search string can expand to an arbitrary amount of whitespace, +including newlines. + +If using a Boolean search, the search string is split on whitespace and +each snippet is searched separately, with logical AND to select an entry. +Words prefixed with a minus must *not* occur in the entry. Words without +a prefix or prefixed with a plus must occur in the entry. Matching is +case-insensitive. Words are enclosed by word delimiters (i.e. they must +match whole words, not parts of a word) if +`org-agenda-search-view-force-full-words' is set (default is nil). + +Boolean search snippets enclosed by curly braces are interpreted as +regular expressions that must or (when preceded with \"-\") must not +match in the entry. Snippets enclosed into double quotes will be taken +as a whole, to include whitespace. + +- If the search string starts with an asterisk, search only in headlines. +- If (possibly after the leading star) the search string starts with an + exclamation mark, this also means to look at TODO entries only, an effect + that can also be achieved with a prefix argument. +- If (possibly after star and exclamation mark) the search string starts + with a colon, this will mean that the (non-regexp) snippets of the + Boolean search must match as full words. + +This command searches the agenda files, and in addition the files +listed in `org-agenda-text-search-extra-files' unless a restriction lock +is active. + +\(fn &optional TODO-ONLY STRING EDIT-AT)" t nil) + +(autoload 'org-todo-list "org-agenda" "\ +Show all (not done) TODO entries from all agenda file in a single list. +The prefix arg can be used to select a specific TODO keyword and limit +the list to these. When using `\\[universal-argument]', you will be prompted +for a keyword. A numeric prefix directly selects the Nth keyword in +`org-todo-keywords-1'. + +\(fn &optional ARG)" t nil) + +(autoload 'org-tags-view "org-agenda" "\ +Show all headlines for all `org-agenda-files' matching a TAGS criterion. +The prefix arg TODO-ONLY limits the search to TODO entries. + +\(fn &optional TODO-ONLY MATCH)" t nil) + +(autoload 'org-agenda-list-stuck-projects "org-agenda" "\ +Create agenda view for projects that are stuck. +Stuck projects are project that have no next actions. For the definitions +of what a project is and how to check if it stuck, customize the variable +`org-stuck-projects'. + +\(fn &rest IGNORE)" t nil) + +(autoload 'org-diary "org-agenda" "\ +Return diary information from org files. +This function can be used in a \"sexp\" diary entry in the Emacs calendar. +It accesses org files and extracts information from those files to be +listed in the diary. The function accepts arguments specifying what +items should be listed. For a list of arguments allowed here, see the +variable `org-agenda-entry-types'. + +The call in the diary file should look like this: + + &%%(org-diary) ~/path/to/some/orgfile.org + +Use a separate line for each org file to check. Or, if you omit the file name, +all files listed in `org-agenda-files' will be checked automatically: + + &%%(org-diary) + +If you don't give any arguments (as in the example above), the default value +of `org-agenda-entry-types' is used: (:deadline :scheduled :timestamp :sexp). +So the example above may also be written as + + &%%(org-diary :deadline :timestamp :sexp :scheduled) + +The function expects the lisp variables `entry' and `date' to be provided +by the caller, because this is how the calendar works. Don't use this +function from a program - use `org-agenda-get-day-entries' instead. + +\(fn &rest ARGS)" nil nil) + +(autoload 'org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item "org-agenda" "\ +Do we have a reason to ignore this TODO entry because it has a time stamp? + +\(fn &optional END)" nil nil) + +(autoload 'org-agenda-set-restriction-lock "org-agenda" "\ +Set restriction lock for agenda to current subtree or file. +When in a restricted subtree, remove it. + +The restriction will span over the entire file if TYPE is `file', +or if type is '(4), or if the cursor is before the first headline +in the file. Otherwise, only apply the restriction to the current +subtree. + +\(fn &optional TYPE)" t nil) + +(autoload 'org-calendar-goto-agenda "org-agenda" "\ +Compute the Org agenda for the calendar date displayed at the cursor. +This is a command that has to be installed in `calendar-mode-map'. + +\(fn)" t nil) + +(autoload 'org-agenda-to-appt "org-agenda" "\ +Activate appointments found in `org-agenda-files'. + +With a `\\[universal-argument]' prefix, refresh the list of appointments. + +If FILTER is t, interactively prompt the user for a regular +expression, and filter out entries that don't match it. + +If FILTER is a string, use this string as a regular expression +for filtering entries out. + +If FILTER is a function, filter out entries against which +calling the function returns nil. This function takes one +argument: an entry from `org-agenda-get-day-entries'. + +FILTER can also be an alist with the car of each cell being +either `headline' or `category'. For example: + + \\='((headline \"IMPORTANT\") + (category \"Work\")) + +will only add headlines containing IMPORTANT or headlines +belonging to the \"Work\" category. + +ARGS are symbols indicating what kind of entries to consider. +By default `org-agenda-to-appt' will use :deadline*, :scheduled* +\(i.e., deadlines and scheduled items with a hh:mm specification) +and :timestamp entries. See the docstring of `org-diary' for +details and examples. + +If an entry has a APPT_WARNTIME property, its value will be used +to override `appt-message-warning-time'. + +\(fn &optional REFRESH FILTER &rest ARGS)" t nil) + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-agenda" '("org-"))) + +;;;*** + +;;;### (autoloads nil "org-bibtex" "org-bibtex.el" (0 0 0 0)) +;;; Generated autoloads from org-bibtex.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-bibtex" '("org-"))) + +;;;*** + +;;;### (autoloads nil "org-capture" "org-capture.el" (0 0 0 0)) +;;; Generated autoloads from org-capture.el + +(autoload 'org-capture-string "org-capture" "\ +Capture STRING with the template selected by KEYS. + +\(fn STRING &optional KEYS)" t nil) + +(autoload 'org-capture "org-capture" "\ +Capture something. +\\ +This will let you select a template from `org-capture-templates', and +then file the newly captured information. The text is immediately +inserted at the target location, and an indirect buffer is shown where +you can edit it. Pressing `\\[org-capture-finalize]' brings you back to the previous +state of Emacs, so that you can continue your work. + +When called interactively with a `\\[universal-argument]' prefix argument GOTO, don't +capture anything, just go to the file/headline where the selected +template stores its notes. + +With a `\\[universal-argument] \\[universal-argument]' prefix argument, go to the last note stored. + +When called with a `C-0' (zero) prefix, insert a template at point. + +When called with a `C-1' (one) prefix, force prompting for a date when +a datetree entry is made. + +ELisp programs can set KEYS to a string associated with a template +in `org-capture-templates'. In this case, interactive selection +will be bypassed. + +If `org-capture-use-agenda-date' is non-nil, capturing from the +agenda will use the date at point as the default date. Then, a +`C-1' prefix will tell the capture process to use the HH:MM time +of the day at point (if any) or the current HH:MM time. + +\(fn &optional GOTO KEYS)" t nil) + +(autoload 'org-capture-import-remember-templates "org-capture" "\ +Set `org-capture-templates' to be similar to `org-remember-templates'. + +\(fn)" t nil) + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-capture" '("org-capture-"))) + +;;;*** + +;;;### (autoloads nil "org-colview" "org-colview.el" (0 0 0 0)) +;;; Generated autoloads from org-colview.el + +(autoload 'org-columns-remove-overlays "org-colview" "\ +Remove all currently active column overlays. + +\(fn)" t nil) + +(autoload 'org-columns-get-format-and-top-level "org-colview" "\ + + +\(fn)" nil nil) + +(autoload 'org-columns "org-colview" "\ +Turn on column view on an Org mode file. + +Column view applies to the whole buffer if point is before the +first headline. Otherwise, it applies to the first ancestor +setting \"COLUMNS\" property. If there is none, it defaults to +the current headline. With a `\\[universal-argument]' prefix argument, turn on column +view for the whole buffer unconditionally. + +When COLUMNS-FMT-STRING is non-nil, use it as the column format. + +\(fn &optional GLOBAL COLUMNS-FMT-STRING)" t nil) + +(autoload 'org-columns-compute "org-colview" "\ +Summarize the values of PROPERTY hierarchically. +Also update existing values for PROPERTY according to the first +column specification. + +\(fn PROPERTY)" t nil) + +(autoload 'org-dblock-write:columnview "org-colview" "\ +Write the column view table. + +PARAMS is a property list of parameters: + +`:id' (mandatory) + + The ID property of the entry where the columns view should be + built. When the symbol `local', call locally. When `global' + call column view with the cursor at the beginning of the + buffer (usually this means that the whole buffer switches to + column view). When \"file:path/to/file.org\", invoke column + view at the start of that file. Otherwise, the ID is located + using `org-id-find'. + +`:exclude-tags' + + List of tags to exclude from column view table. + +`:format' + + When non-nil, specify the column view format to use. + +`:hlines' + + When non-nil, insert a hline before each item. When + a number, insert a hline before each level inferior or equal + to that number. + +`:indent' + + When non-nil, indent each ITEM field according to its level. + +`:match' + + When set to a string, use this as a tags/property match filter. + +`:maxlevel' + + When set to a number, don't capture headlines below this level. + +`:skip-empty-rows' + + When non-nil, skip rows where all specifiers other than ITEM + are empty. + +`:vlines' + + When non-nil, make each column a column group to enforce + vertical lines. + +\(fn PARAMS)" nil nil) + +(autoload 'org-columns-insert-dblock "org-colview" "\ +Create a dynamic block capturing a column view table. + +\(fn)" t nil) + +(autoload 'org-agenda-columns "org-colview" "\ +Turn on or update column view in the agenda. + +\(fn)" t nil) + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-colview" '("org-"))) + +;;;*** + +;;;### (autoloads nil "org-compat" "org-compat.el" (0 0 0 0)) +;;; Generated autoloads from org-compat.el + +(autoload 'org-check-version "org-compat" "\ +Try very hard to provide sensible version strings. + +\(fn)" nil t) + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-compat" '("org-"))) + +;;;*** + +;;;### (autoloads nil "org-crypt" "org-crypt.el" (0 0 0 0)) +;;; Generated autoloads from org-crypt.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-crypt" '("org-"))) + +;;;*** + +;;;### (autoloads nil "org-ctags" "org-ctags.el" (0 0 0 0)) +;;; Generated autoloads from org-ctags.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-ctags" '("org-ctags-"))) + +;;;*** + +;;;### (autoloads nil "org-docview" "org-docview.el" (0 0 0 0)) +;;; Generated autoloads from org-docview.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-docview" '("org-docview-"))) + +;;;*** + +;;;### (autoloads nil "org-duration" "org-duration.el" (0 0 0 0)) +;;; Generated autoloads from org-duration.el + +(autoload 'org-duration-set-regexps "org-duration" "\ +Set duration related regexps. + +\(fn)" t nil) + +(autoload 'org-duration-p "org-duration" "\ +Non-nil when string S is a time duration. + +\(fn S)" nil nil) + +(autoload 'org-duration-to-minutes "org-duration" "\ +Return number of minutes of DURATION string. + +When optional argument CANONICAL is non-nil, ignore +`org-duration-units' and use standard time units value. + +A bare number is translated into minutes. The empty string is +translated into 0.0. + +Return value as a float. Raise an error if duration format is +not recognized. + +\(fn DURATION &optional CANONICAL)" nil nil) + +(autoload 'org-duration-from-minutes "org-duration" "\ +Return duration string for a given number of MINUTES. + +Format duration according to `org-duration-format' or FMT, when +non-nil. + +When optional argument CANONICAL is non-nil, ignore +`org-duration-units' and use standard time units value. + +Raise an error if expected format is unknown. + +\(fn MINUTES &optional FMT CANONICAL)" nil nil) + +(autoload 'org-duration-h:mm-only-p "org-duration" "\ +Non-nil when every duration in TIMES has \"H:MM\" or \"H:MM:SS\" format. + +TIMES is a list of duration strings. + +Return nil if any duration is expressed with units, as defined in +`org-duration-units'. Otherwise, if any duration is expressed +with \"H:MM:SS\" format, return `h:mm:ss'. Otherwise, return +`h:mm'. + +\(fn TIMES)" nil nil) + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-duration" '("org-duration-"))) + +;;;*** + +;;;### (autoloads nil "org-entities" "org-entities.el" (0 0 0 0)) +;;; Generated autoloads from org-entities.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-entities" '("org-entit"))) + +;;;*** + +;;;### (autoloads nil "org-eshell" "org-eshell.el" (0 0 0 0)) +;;; Generated autoloads from org-eshell.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-eshell" '("org-eshell-"))) + +;;;*** + +;;;### (autoloads nil "org-eww" "org-eww.el" (0 0 0 0)) +;;; Generated autoloads from org-eww.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-eww" '("org-eww-"))) + +;;;*** + +;;;### (autoloads nil "org-faces" "org-faces.el" (0 0 0 0)) +;;; Generated autoloads from org-faces.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-faces" '("org-"))) + +;;;*** + +;;;### (autoloads nil "org-gnus" "org-gnus.el" (0 0 0 0)) +;;; Generated autoloads from org-gnus.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-gnus" '("org-gnus-"))) + +;;;*** + +;;;### (autoloads nil "org-goto" "org-goto.el" (0 0 0 0)) +;;; Generated autoloads from org-goto.el + +(autoload 'org-goto-location "org-goto" "\ +Let the user select a location in current buffer. +This function uses a recursive edit. It returns the selected +position or nil. + +\(fn &optional BUF HELP)" nil nil) + +(autoload 'org-goto "org-goto" "\ +Look up a different location in the current file, keeping current visibility. + +When you want look-up or go to a different location in a +document, the fastest way is often to fold the entire buffer and +then dive into the tree. This method has the disadvantage, that +the previous location will be folded, which may not be what you +want. + +This command works around this by showing a copy of the current +buffer in an indirect buffer, in overview mode. You can dive +into the tree in that copy, use org-occur and incremental search +to find a location. When pressing RET or `Q', the command +returns to the original buffer in which the visibility is still +unchanged. After RET it will also jump to the location selected +in the indirect buffer and expose the headline hierarchy above. + +With a prefix argument, use the alternative interface: e.g., if +`org-goto-interface' is `outline' use `outline-path-completion'. + +\(fn &optional ALTERNATIVE-INTERFACE)" t nil) + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-goto" '("org-goto-"))) + +;;;*** + +;;;### (autoloads nil "org-habit" "org-habit.el" (0 0 0 0)) +;;; Generated autoloads from org-habit.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-habit" '("org-"))) + +;;;*** + +;;;### (autoloads nil "org-info" "org-info.el" (0 0 0 0)) +;;; Generated autoloads from org-info.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-info" '("org-info-"))) + +;;;*** + +;;;### (autoloads nil "org-inlinetask" "org-inlinetask.el" (0 0 0 +;;;;;; 0)) +;;; Generated autoloads from org-inlinetask.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-inlinetask" '("org-inlinetask-"))) + +;;;*** + +;;;### (autoloads nil "org-lint" "org-lint.el" (0 0 0 0)) +;;; Generated autoloads from org-lint.el + +(autoload 'org-lint "org-lint" "\ +Check current Org buffer for syntax mistakes. + +By default, run all checkers. With a `\\[universal-argument]' prefix ARG, select one +category of checkers only. With a `\\[universal-argument] \\[universal-argument]' prefix, run one precise +checker by its name. + +ARG can also be a list of checker names, as symbols, to run. + +\(fn &optional ARG)" t nil) + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-lint" '("org-lint-"))) + +;;;*** + +;;;### (autoloads nil "org-list" "org-list.el" (0 0 0 0)) +;;; Generated autoloads from org-list.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-list" '("org-"))) + +;;;*** + +;;;### (autoloads nil "org-macro" "org-macro.el" (0 0 0 0)) +;;; Generated autoloads from org-macro.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-macro" '("org-macro-"))) + +;;;*** + +;;;### (autoloads nil "org-macs" "org-macs.el" (0 0 0 0)) +;;; Generated autoloads from org-macs.el + +(autoload 'org-load-noerror-mustsuffix "org-macs" "\ +Load FILE with optional arguments NOERROR and MUSTSUFFIX. + +\(fn FILE)" nil t) + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-macs" '("org-"))) + +;;;*** + +;;;### (autoloads nil "org-mhe" "org-mhe.el" (0 0 0 0)) +;;; Generated autoloads from org-mhe.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-mhe" '("org-mhe-"))) + +;;;*** + +;;;### (autoloads "actual autoloads are elsewhere" "org-mobile" "org-mobile.el" +;;;;;; (0 0 0 0)) +;;; Generated autoloads from org-mobile.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-mobile" '("org-mobile-"))) + +;;;*** + +;;;### (autoloads nil "org-mouse" "org-mouse.el" (0 0 0 0)) +;;; Generated autoloads from org-mouse.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-mouse" '("org-mouse-"))) + +;;;*** + +;;;### (autoloads nil "org-pcomplete" "org-pcomplete.el" (0 0 0 0)) +;;; Generated autoloads from org-pcomplete.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-pcomplete" '("pcomplete/org-mode/" "org-"))) + +;;;*** + +;;;### (autoloads "actual autoloads are elsewhere" "org-plot" "org-plot.el" +;;;;;; (0 0 0 0)) +;;; Generated autoloads from org-plot.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-plot" '("org-plot"))) + +;;;*** + +;;;### (autoloads nil "org-protocol" "org-protocol.el" (0 0 0 0)) +;;; Generated autoloads from org-protocol.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-protocol" '("org-protocol-"))) + +;;;*** + +;;;### (autoloads nil "org-rmail" "org-rmail.el" (0 0 0 0)) +;;; Generated autoloads from org-rmail.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-rmail" '("org-rmail-"))) + +;;;*** + +;;;### (autoloads nil "org-src" "org-src.el" (0 0 0 0)) +;;; Generated autoloads from org-src.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-src" '("org-"))) + +;;;*** + +;;;### (autoloads "actual autoloads are elsewhere" "org-table" "org-table.el" +;;;;;; (0 0 0 0)) +;;; Generated autoloads from org-table.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-table" '("org"))) + +;;;*** + +;;;### (autoloads nil "org-tempo" "org-tempo.el" (0 0 0 0)) +;;; Generated autoloads from org-tempo.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-tempo" '("org-tempo-"))) + +;;;*** + +;;;### (autoloads "actual autoloads are elsewhere" "org-timer" "org-timer.el" +;;;;;; (0 0 0 0)) +;;; Generated autoloads from org-timer.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-timer" '("org-timer-"))) + +;;;*** + +;;;### (autoloads nil "org-version" "org-version.el" (0 0 0 0)) +;;; Generated autoloads from org-version.el + +(autoload 'org-release "org-version" "\ +The release version of Org. +Inserted by installing Org mode or when a release is made. + +\(fn)" nil nil) + +(autoload 'org-git-version "org-version" "\ +The Git version of Org mode. +Inserted by installing Org or when a release is made. + +\(fn)" nil nil) + +(defvar org-odt-data-dir "/usr/share/emacs/etc/org" "\ +The location of ODT styles.") + +;;;*** + +;;;### (autoloads nil "org-w3m" "org-w3m.el" (0 0 0 0)) +;;; Generated autoloads from org-w3m.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-w3m" '("org-w3m-"))) + +;;;*** + +;;;### (autoloads "actual autoloads are elsewhere" "ox" "ox.el" (0 +;;;;;; 0 0 0)) +;;; Generated autoloads from ox.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ox" '("org-export-"))) + +;;;*** + +;;;### (autoloads "actual autoloads are elsewhere" "ox-ascii" "ox-ascii.el" +;;;;;; (0 0 0 0)) +;;; Generated autoloads from ox-ascii.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ox-ascii" '("org-ascii-"))) + +;;;*** + +;;;### (autoloads "actual autoloads are elsewhere" "ox-beamer" "ox-beamer.el" +;;;;;; (0 0 0 0)) +;;; Generated autoloads from ox-beamer.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ox-beamer" '("org-beamer-"))) + +;;;*** + +;;;### (autoloads "actual autoloads are elsewhere" "ox-html" "ox-html.el" +;;;;;; (0 0 0 0)) +;;; Generated autoloads from ox-html.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ox-html" '("org-html-"))) + +;;;*** + +;;;### (autoloads "actual autoloads are elsewhere" "ox-icalendar" +;;;;;; "ox-icalendar.el" (0 0 0 0)) +;;; Generated autoloads from ox-icalendar.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ox-icalendar" '("org-icalendar-"))) + +;;;*** + +;;;### (autoloads "actual autoloads are elsewhere" "ox-latex" "ox-latex.el" +;;;;;; (0 0 0 0)) +;;; Generated autoloads from ox-latex.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ox-latex" '("org-latex-"))) + +;;;*** + +;;;### (autoloads "actual autoloads are elsewhere" "ox-man" "ox-man.el" +;;;;;; (0 0 0 0)) +;;; Generated autoloads from ox-man.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ox-man" '("org-man-"))) + +;;;*** + +;;;### (autoloads "actual autoloads are elsewhere" "ox-md" "ox-md.el" +;;;;;; (0 0 0 0)) +;;; Generated autoloads from ox-md.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ox-md" '("org-md-"))) + +;;;*** + +;;;### (autoloads "actual autoloads are elsewhere" "ox-odt" "ox-odt.el" +;;;;;; (0 0 0 0)) +;;; Generated autoloads from ox-odt.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ox-odt" '("org-odt-"))) + +;;;*** + +;;;### (autoloads "actual autoloads are elsewhere" "ox-org" "ox-org.el" +;;;;;; (0 0 0 0)) +;;; Generated autoloads from ox-org.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ox-org" '("org-org-"))) + +;;;*** + +;;;### (autoloads "actual autoloads are elsewhere" "ox-publish" "ox-publish.el" +;;;;;; (0 0 0 0)) +;;; Generated autoloads from ox-publish.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ox-publish" '("org-publish-"))) + +;;;*** + +;;;### (autoloads "actual autoloads are elsewhere" "ox-texinfo" "ox-texinfo.el" +;;;;;; (0 0 0 0)) +;;; Generated autoloads from ox-texinfo.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ox-texinfo" '("org-texinfo-"))) + +;;;*** + +;;;### (autoloads nil nil ("ob-core.el" "ob-keys.el" "ob-lob.el" +;;;;;; "ob-matlab.el" "ob-tangle.el" "ob.el" "org-archive.el" "org-attach.el" +;;;;;; "org-bbdb.el" "org-clock.el" "org-datetree.el" "org-element.el" +;;;;;; "org-feed.el" "org-footnote.el" "org-id.el" "org-indent.el" +;;;;;; "org-install.el" "org-irc.el" "org-loaddefs.el" "org-mobile.el" +;;;;;; "org-pkg.el" "org-plot.el" "org-table.el" "org-timer.el" +;;;;;; "ox-ascii.el" "ox-beamer.el" "ox-html.el" "ox-icalendar.el" +;;;;;; "ox-latex.el" "ox-man.el" "ox-md.el" "ox-odt.el" "ox-org.el" +;;;;;; "ox-publish.el" "ox-texinfo.el" "ox.el") (0 0 0 0)) + +;;;*** + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; coding: utf-8 +;; End: +;;; org-autoloads.el ends here diff --git a/elpa/org-20171030/org-bbdb.el b/elpa/org-20190930/org-bbdb.el similarity index 99% rename from elpa/org-20171030/org-bbdb.el rename to elpa/org-20190930/org-bbdb.el index 889271af..c1f79734 100644 --- a/elpa/org-20171030/org-bbdb.el +++ b/elpa/org-20190930/org-bbdb.el @@ -1,11 +1,11 @@ ;;; org-bbdb.el --- Support for links to BBDB entries -*- lexical-binding: t; -*- -;; Copyright (C) 2004-2017 Free Software Foundation, Inc. +;; Copyright (C) 2004-2019 Free Software Foundation, Inc. ;; Authors: Carsten Dominik ;; Thomas Baumann ;; Keywords: outlines, hypermedia, calendar, wp -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; ;; This file is part of GNU Emacs. ;; @@ -300,7 +300,7 @@ italicized, in all other cases it is left unchanged." Argument TIME-STR is the value retrieved from BBDB. If YYYY- is omitted it will be considered unknown." (pcase (org-split-string time-str "-") - (`(,a ,b nil) (list (string-to-number a) (string-to-number b) nil)) + (`(,a ,b) (list (string-to-number a) (string-to-number b) nil)) (`(,a ,b ,c) (list (string-to-number b) (string-to-number c) (string-to-number a))))) diff --git a/elpa/org-20171030/org-bibtex.el b/elpa/org-20190930/org-bibtex.el similarity index 99% rename from elpa/org-20171030/org-bibtex.el rename to elpa/org-20190930/org-bibtex.el index 8876085f..9891012b 100644 --- a/elpa/org-20171030/org-bibtex.el +++ b/elpa/org-20190930/org-bibtex.el @@ -1,6 +1,6 @@ ;;; org-bibtex.el --- Org links to BibTeX entries -*- lexical-binding: t; -*- ;; -;; Copyright (C) 2007-2017 Free Software Foundation, Inc. +;; Copyright (C) 2007-2019 Free Software Foundation, Inc. ;; ;; Authors: Bastien Guerry ;; Carsten Dominik @@ -354,9 +354,8 @@ and `org-exclude-tags-from-inheritance'." (append org-bibtex-tags org-bibtex-no-export-tags)) tag)) - (if org-bibtex-inherit-tags - (org-get-tags-at) - (org-get-local-tags-at))))))) + (if org-bibtex-inherit-tags (org-get-tags) + (org-get-tags nil t))))))) (when type (let ((entry (format "@%s{%s,\n%s\n}\n" type id diff --git a/elpa/org-20171030/org-capture.el b/elpa/org-20190930/org-capture.el similarity index 79% rename from elpa/org-20171030/org-capture.el rename to elpa/org-20190930/org-capture.el index 25af674b..d24045fd 100644 --- a/elpa/org-20171030/org-capture.el +++ b/elpa/org-20190930/org-capture.el @@ -1,10 +1,10 @@ ;;; org-capture.el --- Fast note taking in Org -*- lexical-binding: t; -*- -;; Copyright (C) 2010-2017 Free Software Foundation, Inc. +;; Copyright (C) 2010-2019 Free Software Foundation, Inc. ;; Author: Carsten Dominik ;; Keywords: outlines, hypermedia, calendar, wp -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; ;; This file is part of GNU Emacs. ;; @@ -51,20 +51,23 @@ (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" ()) (declare-function org-table-current-dline "org-table" ()) +(declare-function org-table-fix-formulas "org-table" (key replace &optional limit delta remove)) (declare-function org-table-goto-line "org-table" (N)) +(defvar dired-buffers) (defvar org-end-time-was-given) (defvar org-remember-default-headline) (defvar org-remember-templates) -(defvar org-table-hlines) +(defvar org-table-border-regexp) (defvar org-table-current-begin-pos) -(defvar dired-buffers) +(defvar org-table-fix-formulas-confirm) +(defvar org-table-hlines) (defvar org-capture-clock-was-started nil "Internal flag, noting if the clock was started.") @@ -79,6 +82,12 @@ (defvar org-capture-is-refiling nil "Non-nil when capture process is refiling an entry.") +(defvar org-capture--prompt-history-table (make-hash-table :test #'equal) + "Hash table for all history lists per prompt.") + +(defvar org-capture--prompt-history nil + "History list for prompt placeholders.") + (defgroup org-capture nil "Options concerning capturing new entries." :tag "Org Capture" @@ -143,7 +152,7 @@ type The type of entry. Valid types are: first plain list at the target location. checkitem a checkbox item. This differs from the - plain list item only is so far as it uses a + plain list item only in so far as it uses a different default template. table-line a new line in the first table at target location. plain text to be inserted as it is. @@ -257,6 +266,8 @@ properties are: capture was invoked, kill the buffer again after capture is finalized. + :no-save Do not save the target file after finishing the capture. + The template defines the text to be inserted. Often this is an Org mode entry (so the first line should start with a star) that will be filed as a child of the target headline. It can also be @@ -278,8 +289,10 @@ be replaced with content and expanded: with `org-capture-use-agenda-date' set. %T Time stamp as above, with date and time. %u, %U Like the above, but inactive time stamps. - %i Initial content, copied from the active region. If %i is - indented, the entire inserted text will be indented as well. + %i Initial content, copied from the active region. If + there is text before %i on the same line, such as + indentation, and %i is not inside a %(sexp), that prefix + will be added before every line in the inserted text. %a Annotation, normally the link created with `org-store-link'. %A Like %a, but prompt for the description part. %l Like %a, but only insert the literal link. @@ -468,37 +481,32 @@ this is necessary after initialization of the capture process, to avoid conflicts with other active capture processes." (plist-get (if local org-capture-current-plist org-capture-plist) prop)) -(defun org-capture-member (prop &optional local) - "Is PROP a property in `org-capture-plist'. -When LOCAL is set, use the local variable `org-capture-current-plist', -this is necessary after initialization of the capture process, -to avoid conflicts with other active capture processes." - (plist-get (if local org-capture-current-plist org-capture-plist) prop)) - ;;; The minor mode -(defvar org-capture-mode-map (make-sparse-keymap) +(defvar org-capture-mode-map + (let ((map (make-sparse-keymap))) + (define-key map "\C-c\C-c" #'org-capture-finalize) + (define-key map "\C-c\C-k" #'org-capture-kill) + (define-key map "\C-c\C-w" #'org-capture-refile) + map) "Keymap for `org-capture-mode', a minor mode. Use this map to set additional keybindings for when Org mode is used for a capture buffer.") (defvar org-capture-mode-hook nil - "Hook for the minor `org-capture-mode'.") + "Hook for the `org-capture-mode' minor mode.") (define-minor-mode org-capture-mode "Minor mode for special key bindings in a capture buffer. Turning on this mode runs the normal hook `org-capture-mode-hook'." - nil " Rem" org-capture-mode-map + nil " Cap" org-capture-mode-map (setq-local header-line-format (substitute-command-keys "\\Capture buffer. Finish \ `\\[org-capture-finalize]', refile `\\[org-capture-refile]', \ abort `\\[org-capture-kill]'."))) -(define-key org-capture-mode-map "\C-c\C-c" 'org-capture-finalize) -(define-key org-capture-mode-map "\C-c\C-k" 'org-capture-kill) -(define-key org-capture-mode-map "\C-c\C-w" 'org-capture-refile) ;;; The main commands @@ -535,8 +543,8 @@ not-in-buffer: command not displayed in matching buffers If you define several checks, the agenda command will be accessible if there is at least one valid check. -You can also bind a key to another agenda custom command -depending on contextual rules. +You can also bind a key to another capture template depending on +contextual rules. \\='((\"c\" \"d\" ((in-mode . \"message-mode\")))) @@ -654,7 +662,7 @@ of the day at point (if any) or the current HH:MM time." (org-capture-put :template (org-capture-fill-template)) ((error quit) (if (get-buffer "*Capture*") (kill-buffer "*Capture*")) - (error "Capture abort: %s" error))) + (error "Capture abort: %s" (error-message-string error)))) (setq org-capture-clock-keep (org-capture-get :clock-keep)) (if (equal goto 0) @@ -664,26 +672,24 @@ of the day at point (if any) or the current HH:MM time." (org-capture-place-template (eq (car (org-capture-get :target)) 'function)) ((error quit) - (if (and (buffer-base-buffer (current-buffer)) - (string-prefix-p "CAPTURE-" (buffer-name))) - (kill-buffer (current-buffer))) + (when (and (buffer-base-buffer (current-buffer)) + (string-prefix-p "CAPTURE-" (buffer-name))) + (kill-buffer (current-buffer))) (set-window-configuration (org-capture-get :return-to-wconf)) (error "Capture template `%s': %s" (org-capture-get :key) - (nth 1 error)))) - (if (and (derived-mode-p 'org-mode) - (org-capture-get :clock-in)) - (condition-case nil - (progn - (if (org-clock-is-active) - (org-capture-put :interrupted-clock - (copy-marker org-clock-marker))) - (org-clock-in) - (setq-local org-capture-clock-was-started t)) - (error - "Could not start the clock in this capture buffer"))) - (if (org-capture-get :immediate-finish) - (org-capture-finalize))))))))) + (error-message-string error)))) + (when (and (derived-mode-p 'org-mode) (org-capture-get :clock-in)) + (condition-case nil + (progn + (when (org-clock-is-active) + (org-capture-put :interrupted-clock + (copy-marker org-clock-marker))) + (org-clock-in) + (setq-local org-capture-clock-was-started t)) + (error "Could not start the clock in this capture buffer"))) + (when (org-capture-get :immediate-finish) + (org-capture-finalize))))))))) (defun org-capture-get-template () "Get the template from a file or a function if necessary." @@ -718,25 +724,26 @@ captured item after finalizing." ;; Did we start the clock in this capture buffer? (when (and org-capture-clock-was-started - org-clock-marker (marker-buffer org-clock-marker) - (equal (marker-buffer org-clock-marker) (buffer-base-buffer)) - (> org-clock-marker (point-min)) + org-clock-marker + (eq (marker-buffer org-clock-marker) (buffer-base-buffer)) + (>= org-clock-marker (point-min)) (< org-clock-marker (point-max))) - ;; Looks like the clock we started is still running. Clock out. - (when (not org-capture-clock-keep) (let (org-log-note-clock-out) (org-clock-out))) - (when (and (not org-capture-clock-keep) - (org-capture-get :clock-resume 'local) - (markerp (org-capture-get :interrupted-clock 'local)) - (buffer-live-p (marker-buffer - (org-capture-get :interrupted-clock 'local)))) - (let ((clock-in-task (org-capture-get :interrupted-clock 'local))) - (org-with-point-at clock-in-task - (org-clock-in))) - (message "Interrupted clock has been resumed"))) - - (let ((beg (point-min)) - (end (point-max)) - (abort-note nil)) + ;; 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 ((abort-note nil)) ;; Store the size of the capture buffer (org-capture-put :captured-entry-size (- (point-max) (point-min))) (widen) @@ -744,16 +751,11 @@ captured item after finalizing." (org-capture-put :insertion-point (point)) (if org-note-abort - (let ((m1 (org-capture-get :begin-marker 'local)) - (m2 (org-capture-get :end-marker 'local))) - (if (and m1 m2 (= m1 beg) (= m2 end)) - (progn - (setq m2 (if (cdr (assq 'heading org-blank-before-new-entry)) - m2 (1+ m2)) - m2 (if (< (point-max) m2) (point-max) m2)) - (setq abort-note 'clean) - (kill-region m1 m2)) - (setq abort-note 'dirty))) + (let ((beg (org-capture-get :begin-marker 'local)) + (end (org-capture-get :end-marker 'local))) + (if (not (and beg end)) (setq abort-note 'dirty) + (setq abort-note t) + (org-with-wide-buffer (kill-region beg end)))) ;; Postprocessing: Update Statistics cookies, do the sorting (when (derived-mode-p 'org-mode) @@ -765,9 +767,21 @@ captured item after finalizing." ;; If we have added a table line, maybe recompute? (when (and (eq (org-capture-get :type 'local) 'table-line) (org-at-table-p)) - (if (org-table-get-stored-formulas) - (org-table-recalculate 'all) ;; FIXME: Should we iterate??? - (org-table-align)))) + (if (not (org-table-get-stored-formulas)) (org-table-align) + ;; Adjust formulas, if necessary. We assume a non-nil + ;; `:immediate-finish' means that no confirmation is + ;; required. Else, obey `org-table-fix-formulas-confirm'. + ;; + ;; The delta required to fix formulas depends on the + ;; number of rows inserted by the template. + (when (or (org-capture-get :immediate-finish) + (not org-table-fix-formulas-confirm) + (funcall org-table-fix-formulas-confirm "Fix formulas? ")) + (org-table-fix-formulas + "@" nil (1- (org-table-current-dline)) + (count-lines (org-capture-get :begin-marker 'local) + (org-capture-get :end-marker 'local)))) + (org-table-recalculate 'all)))) ;FIXME: should we iterate? ;; Store this place as the last one where we stored something ;; Do the marking in the base buffer, so that it makes sense after ;; the indirect buffer has been killed. @@ -781,8 +795,8 @@ captured item after finalizing." (goto-char (org-capture-get :decrypted)) (org-encrypt-entry))) - ;; Kill the indirect buffer - (save-buffer) + (unless (org-capture-get :no-save) (save-buffer)) + (let ((return-wconf (org-capture-get :return-to-wconf 'local)) (new-buffer (org-capture-get :new-buffer 'local)) (kill-buffer (org-capture-get :kill-buffer 'local)) @@ -858,17 +872,15 @@ for `entry'-type templates")) ;; early. We want to wait for the refiling to be over, so we ;; control when the latter function is called. (org-capture-put :kill-buffer nil :jump-to-captured nil) - (unwind-protect - (progn - (org-capture-finalize) - (save-window-excursion - (with-current-buffer base - (org-with-wide-buffer - (goto-char pos) - (call-interactively 'org-refile)))) - (when kill-buffer (kill-buffer base)) - (when jump-to-captured (org-capture-goto-last-stored))) - (set-marker pos nil)))) + (org-capture-finalize) + (save-window-excursion + (with-current-buffer base + (org-with-point-at pos + (call-interactively 'org-refile)))) + (when kill-buffer + (with-current-buffer base (save-buffer)) + (kill-buffer base)) + (when jump-to-captured (org-capture-goto-last-stored)))) (defun org-capture-kill () "Abort the current capture process." @@ -921,18 +933,24 @@ Store them in the capture property list." (_ (error "Cannot find target ID \"%s\"" id)))) (`(file+headline ,path ,headline) (set-buffer (org-capture-target-buffer path)) + ;; Org expects the target file to be in Org mode, otherwise + ;; it throws an error. However, the default notes files + ;; should work out of the box. In this case, we switch it to + ;; Org mode. (unless (derived-mode-p 'org-mode) - (error "Target buffer \"%s\" for file+headline not in Org mode" - (current-buffer))) + (org-display-warning + (format "Capture requirement: switching buffer %S to Org mode" + (current-buffer))) + (org-mode)) (org-capture-put-target-region-and-position) (widen) (goto-char (point-min)) (if (re-search-forward (format org-complex-heading-regexp-format (regexp-quote headline)) nil t) - (goto-char (line-beginning-position)) + (beginning-of-line) (goto-char (point-max)) - (or (bolp) (insert "\n")) + (unless (bolp) (insert "\n")) (insert "* " headline "\n") (beginning-of-line 0))) (`(file+olp ,path . ,outline-path) @@ -985,8 +1003,7 @@ Store them in the capture property list." (equal current-prefix-arg 1)) ;; Prompt for date. (let ((prompt-time (org-read-date - nil t nil "Date for tree entry:" - (current-time)))) + nil t nil "Date for tree entry:"))) (org-capture-put :default-time (cond ((and (or (not (boundp 'org-time-was-given)) @@ -994,9 +1011,9 @@ Store them in the capture property list." (not (= (time-to-days prompt-time) (org-today)))) ;; Use 00:00 when no time is given for another ;; date than today? - (apply #'encode-time - (append '(0 0 0) - (cl-cdddr (decode-time prompt-time))))) + (apply #'encode-time 0 0 + org-extend-today-until + (cl-cdddr (decode-time prompt-time)))) ((string-match "\\([^ ]+\\)--?[^ ]+[ ]+\\(.*\\)" org-read-date-final-answer) ;; Replace any time range by its start. @@ -1013,7 +1030,7 @@ Store them in the capture property list." (org-today)))) ;; the following is the keep-restriction argument for ;; org-datetree-find-date-create - (if outline-path 'subtree-at-point)))) + (when outline-path 'subtree-at-point)))) (`(file+function ,path ,function) (set-buffer (org-capture-target-buffer path)) (org-capture-put-target-region-and-position) @@ -1082,7 +1099,7 @@ may have been stored before." (org-switch-to-buffer-other-window (org-capture-get-indirect-buffer (org-capture-get :buffer) "CAPTURE")) (widen) - (outline-show-all) + (org-show-all) (goto-char (org-capture-get :pos)) (setq-local outline-level 'org-outline-level) (pcase (org-capture-get :type) @@ -1096,8 +1113,10 @@ may have been stored before." (defun org-capture-place-entry () "Place the template as a new Org entry." - (let ((reversed? (org-capture-get :prepend)) + (let ((template (org-capture-get :template)) + (reversed? (org-capture-get :prepend)) (level 1)) + (org-capture-verify-tree template) (when (org-capture-get :exact-position) (goto-char (org-capture-get :exact-position))) (cond @@ -1106,172 +1125,220 @@ may have been stored before." (setq level (org-get-valid-level (if (org-at-heading-p) (org-outline-level) 1) 1)) - (if reversed? (outline-next-heading) (org-end-of-subtree t))) + (if reversed? (outline-next-heading) (org-end-of-subtree t t))) ;; Insert as a top-level entry at the beginning of the file. (reversed? (goto-char (point-min)) (unless (org-at-heading-p) (outline-next-heading))) ;; Otherwise, insert as a top-level entry at the end of the file. (t (goto-char (point-max)))) - (unless (bolp) (insert "\n")) - (org-capture-empty-lines-before) - (let ((beg (point)) - (template (org-capture-get :template))) - (org-capture-verify-tree template) - (org-paste-subtree level template 'for-yank) - (org-capture-empty-lines-after) - (org-capture-position-for-last-stored beg) - (unless (org-at-heading-p) (outline-next-heading)) - (let ((end (point))) - (org-capture-mark-kill-region beg end) - (org-capture-narrow beg end) - (when (or (re-search-backward "%\\?" beg t) - (re-search-forward "%\\?" end t)) - (replace-match "")))))) + (let ((origin (point))) + (unless (bolp) (insert "\n")) + (org-capture-empty-lines-before) + (let ((beg (point))) + (org-paste-subtree level template 'for-yank) + (org-capture-position-for-last-stored beg) + (let ((end (if (org-at-heading-p) (line-end-position 0) (point)))) + (org-capture-empty-lines-after) + (unless (org-at-heading-p) (outline-next-heading)) + (org-capture-mark-kill-region origin (point)) + (org-capture-narrow beg end) + (when (or (search-backward "%?" beg t) + (search-forward "%?" end t)) + (replace-match ""))))))) (defun org-capture-place-item () "Place the template as a new plain list item." - (let* ((txt (org-capture-get :template)) - (target-entry-p (org-capture-get :target-entry-p)) - (ind 0) - beg end) - (if (org-capture-get :exact-position) - (goto-char (org-capture-get :exact-position)) - (cond - ((not target-entry-p) - ;; Insert as top-level entry, either at beginning or at end of file - (setq beg (point-min) end (point-max))) - (t - (setq beg (1+ (point-at-eol)) - end (save-excursion (outline-next-heading) (point))))) - (setq ind nil) - (if (org-capture-get :prepend) - (progn - (goto-char beg) - (when (org-list-search-forward (org-item-beginning-re) end t) - (goto-char (match-beginning 0)) - (setq ind (org-get-indentation)))) - (goto-char end) - (when (org-list-search-backward (org-item-beginning-re) beg t) - (setq ind (org-get-indentation)) - (org-end-of-item))) - (unless ind (goto-char end))) - ;; Remove common indentation - (setq txt (org-remove-indentation txt)) - ;; Make sure this is indeed an item - (unless (string-match (concat "\\`" (org-item-re)) txt) - (setq txt (concat "- " - (mapconcat 'identity (split-string txt "\n") - "\n ")))) - ;; Prepare surrounding empty lines. - (unless (bolp) (insert "\n")) - (org-capture-empty-lines-before) - (setq beg (point)) - (unless (eolp) (save-excursion (insert "\n"))) - (unless ind - (org-indent-line) - (setq ind (org-get-indentation)) - (delete-region beg (point))) - ;; Set the correct indentation, depending on context - (setq ind (make-string ind ?\ )) - (setq txt (concat ind - (mapconcat 'identity (split-string txt "\n") - (concat "\n" ind)) - "\n")) - ;; Insert item. - (insert txt) - (org-capture-empty-lines-after) - (org-capture-position-for-last-stored beg) - (setq end (point)) - (org-capture-mark-kill-region beg end) - (org-capture-narrow beg end) - (if (or (re-search-backward "%\\?" beg t) - (re-search-forward "%\\?" end t)) - (replace-match "")))) + (let ((prepend? (org-capture-get :prepend)) + (template (org-remove-indentation (org-capture-get :template))) + item) + ;; Make template suitable for insertion. In particular, add + ;; a main bullet if it is missing. + (unless (string-match-p (concat "\\`" (org-item-re)) template) + (setq template (concat "- " (mapconcat #'identity + (split-string template "\n") + "\n ")))) + ;; Delimit the area where we should look for a plain list. + (pcase-let ((`(,beg . ,end) + (cond ((org-capture-get :exact-position) + ;; User gave a specific position. Start + ;; looking for lists from here. + (cons (save-excursion + (goto-char (org-capture-get :exact-position)) + (line-beginning-position)) + (org-entry-end-position))) + ((org-capture-get :target-entry-p) + ;; At a heading, limit search to its body. + (cons (line-beginning-position 2) + (org-entry-end-position))) + (t + ;; Table is not necessarily under a heading. + ;; Search whole buffer. + (cons (point-min) (point-max)))))) + ;; Find the first plain list in the delimited area. + (goto-char beg) + (let ((item-regexp (org-item-beginning-re))) + (catch :found + (while (re-search-forward item-regexp end t) + (when (setq item (org-element-lineage + (org-element-at-point) '(plain-list) t)) + (goto-char (org-element-property (if prepend? :post-affiliated + :contents-end) + item)) + (throw :found t))) + ;; No list found. Move to the location when to insert + ;; template. Skip planning info and properties drawers, if + ;; any. + (goto-char (cond ((not prepend?) end) + ((org-before-first-heading-p) beg) + (t (max (save-excursion + (org-end-of-meta-data) + (point)) + beg))))))) + ;; Insert template. + (let ((origin (point))) + (unless (bolp) (insert "\n")) + ;; When a new list is created, always obey to `:empty-lines' and + ;; friends. + ;; + ;; When capturing in an existing list, do not change blank lines + ;; above or below the list; consider it to be a stable + ;; structure. However, we can control how many blank lines + ;; separate items. So obey to `:empty-lines' between items as + ;; long as it does not insert more than one empty line. In the + ;; specific case of empty lines above, it means we only obey the + ;; parameter when appending an item. + (unless (and item prepend?) + (org-capture-empty-lines-before + (and item + (not prepend?) + (min 1 (or (org-capture-get :empty-lines-before) + (org-capture-get :empty-lines) + 0))))) + (org-capture-position-for-last-stored (point)) + (let ((beg (line-beginning-position)) + (end (progn + (insert (org-trim template) "\n") + (point-marker)))) + (when item + (let ((i (save-excursion + (goto-char (org-element-property :post-affiliated item)) + (current-indentation)))) + (save-excursion + (goto-char beg) + (save-excursion + (while (< (point) end) + (indent-to i) + (forward-line))) + ;; Pre-pending an item could change the type of the list + ;; if there is a mismatch. In this situation, + ;; prioritize the existing list. + (when prepend? + (let ((ordered? (eq 'ordered (org-element-property :type item)))) + (when (org-xor ordered? + (string-match-p "\\`[A-Za-z0-9]\\([.)]\\)" + template)) + (org-cycle-list-bullet (if ordered? "1." "-"))))) + ;; Eventually repair the list for proper indentation and + ;; bullets. + (org-list-repair)))) + ;; Limit number of empty lines. See above for details. + (unless (and item (not prepend?)) + (org-capture-empty-lines-after + (and item + prepend? + (min 1 (or (org-capture-get :empty-lines-after) + (org-capture-get :empty-lines) + 0))))) + (org-capture-mark-kill-region origin (point)) + ;; ITEM always end with a newline character. Make sure we do + ;; not narrow at the beginning of the next line, possibly + ;; altering its structure (e.g., when it is a headline). + (org-capture-narrow beg (1- end)) + (when (or (search-backward "%?" beg t) + (search-forward "%?" end t)) + (replace-match "")))))) (defun org-capture-place-table-line () "Place the template as a table line." (require 'org-table) - (let* ((txt (org-capture-get :template)) - (target-entry-p (org-capture-get :target-entry-p)) - (table-line-pos (org-capture-get :table-line-pos)) - beg end) + (let ((text + (pcase (org-trim (org-capture-get :template)) + ((pred (string-match-p org-table-border-regexp)) + "| %?Bad template |") + (text (concat text "\n")))) + (table-line-pos (org-capture-get :table-line-pos)) + beg end) (cond ((org-capture-get :exact-position) - (goto-char (org-capture-get :exact-position))) - ((not target-entry-p) - ;; Table is not necessarily under a heading + (setq beg (org-capture-get :exact-position)) + (setq end (save-excursion (outline-next-heading) (point)))) + ((not (org-capture-get :target-entry-p)) + ;; Table is not necessarily under a heading. Find first table + ;; in the buffer. (setq beg (point-min) end (point-max))) (t - ;; WE are at a heading, limit search to the body - (setq beg (1+ (point-at-eol)) - end (save-excursion (outline-next-heading) (point))))) - (if (re-search-forward org-table-dataline-regexp end t) - (let ((b (org-table-begin)) (e (org-table-end)) (case-fold-search t)) - (goto-char e) - (if (looking-at "[ \t]*#\\+tblfm:") - (forward-line 1)) - (narrow-to-region b (point))) + ;; We are at a heading, limit search to the body. + (setq beg (line-beginning-position 2)) + (setq end (save-excursion (outline-next-heading) (point))))) + (goto-char beg) + ;; Narrow to the table, possibly creating one if necessary. + (catch :found + (while (re-search-forward org-table-dataline-regexp end t) + (pcase (org-element-lineage (org-element-at-point) '(table) t) + (`nil nil) + ((pred (lambda (e) (eq 'table.el (org-element-property :type e)))) + nil) + (table + (goto-char (org-element-property :contents-end table)) + (narrow-to-region (org-element-property :post-affiliated table) + (point)) + (throw :found t)))) + ;; No table found. Create it with an empty header. (goto-char end) - (insert "\n| |\n|----|\n| |\n") - (narrow-to-region (1+ end) (point))) - ;; We are narrowed to the table, or to an empty line if there was no table - - ;; Check if the template is good - (if (not (string-match org-table-dataline-regexp txt)) - (setq txt "| %?Bad template |\n")) - (if (functionp table-line-pos) - (setq table-line-pos (funcall table-line-pos)) - (setq table-line-pos (eval table-line-pos))) + (unless (bolp) (insert "\n")) + (let ((origin (point))) + (insert "| |\n|----|\n") + (narrow-to-region origin (point)))) + ;; In the current table, find the appropriate location for TEXT. (cond ((and table-line-pos - (string-match "\\(I+\\)\\([-+][0-9]\\)" table-line-pos)) + (string-match "\\(I+\\)\\([-+][0-9]+\\)" table-line-pos)) (goto-char (point-min)) - ;; we have a complex line specification - (let ((ll (ignore-errors - (save-match-data (org-table-analyze)) - (aref org-table-hlines - (- (match-end 1) (match-beginning 1))))) + (let ((line + (condition-case _ + (progn + (save-match-data (org-table-analyze)) + (aref org-table-hlines + (- (match-end 1) (match-beginning 1)))) + (error + (error "Invalid table line specification %S" table-line-pos)))) (delta (string-to-number (match-string 2 table-line-pos)))) - ;; The user wants a special position in the table - (unless ll - (error "Invalid table line specification \"%s\"" table-line-pos)) - (goto-char org-table-current-begin-pos) - (forward-line (+ ll delta (if (< delta 0) 0 -1))) - (org-table-insert-row 'below) - (beginning-of-line 1) - (delete-region (point) (1+ (point-at-eol))) - (setq beg (point)) - (insert txt) - (setq end (point)))) + (forward-line (+ line delta (if (< delta 0) 0 -1))) + (forward-line))) ;insert below ((org-capture-get :prepend) (goto-char (point-min)) - (re-search-forward org-table-hline-regexp nil t) - (beginning-of-line 1) - (re-search-forward org-table-dataline-regexp nil t) - (beginning-of-line 1) - (setq beg (point)) - (org-table-insert-row) - (beginning-of-line 1) - (delete-region (point) (1+ (point-at-eol))) - (insert txt) - (setq end (point))) + (cond + ((not (re-search-forward org-table-hline-regexp nil t))) + ((re-search-forward org-table-dataline-regexp nil t) (beginning-of-line)) + (t (goto-char (org-table-end))))) (t - (goto-char (point-max)) - (re-search-backward org-table-dataline-regexp nil t) - (beginning-of-line 1) - (org-table-insert-row 'below) - (beginning-of-line 1) - (delete-region (point) (1+ (point-at-eol))) - (setq beg (point)) - (insert txt) - (setq end (point)))) - (goto-char beg) - (org-capture-position-for-last-stored 'table-line) - (if (or (re-search-backward "%\\?" beg t) - (re-search-forward "%\\?" end t)) - (replace-match "")) - (org-table-align))) + (goto-char (org-table-end)))) + ;; Insert text and position point according to template. + (let ((origin (point))) + (unless (bolp) (insert "\n")) + (let ((beg (point)) + (end (save-excursion + (insert text) + (point)))) + (org-capture-position-for-last-stored 'table-line) + (org-capture-mark-kill-region origin end) + ;; TEXT is guaranteed to end with a newline character. Ignore + ;; it when narrowing so as to not alter data on the next line. + (org-capture-narrow beg (1- end)) + (when (or (search-backward "%?" beg t) + (search-forward "%?" end t)) + (replace-match "")))))) (defun org-capture-place-plain-text () "Place the template plainly. @@ -1279,40 +1346,41 @@ If the target locator points at an Org node, place the template into the text of the entry, before the first child. If not, place the template at the beginning or end of the file. Of course, if exact position has been required, just put it there." - (let* ((txt (org-capture-get :template)) - beg end) - (cond - ((org-capture-get :exact-position) - (goto-char (org-capture-get :exact-position))) - ((and (org-capture-get :target-entry-p) - (bolp) - (looking-at org-outline-regexp)) - ;; we should place the text into this entry - (if (org-capture-get :prepend) - ;; Skip meta data and drawers - (org-end-of-meta-data t) - ;; go to ent of the entry text, before the next headline - (outline-next-heading))) - (t - ;; beginning or end of file - (goto-char (if (org-capture-get :prepend) (point-min) (point-max))))) - (or (bolp) (newline)) + (cond + ((org-capture-get :exact-position) + (goto-char (org-capture-get :exact-position))) + ((org-capture-get :target-entry-p) + ;; Place the text into this entry. + (if (org-capture-get :prepend) + ;; Skip meta data and drawers. + (org-end-of-meta-data t) + ;; Go to end of the entry text, before the next headline. + (outline-next-heading))) + (t + ;; Beginning or end of file. + (goto-char (if (org-capture-get :prepend) (point-min) (point-max))))) + (let ((origin (point))) + (unless (bolp) (insert "\n")) (org-capture-empty-lines-before) - (setq beg (point)) - (insert txt) - (org-capture-empty-lines-after) - (org-capture-position-for-last-stored beg) - (setq end (point)) - (org-capture-mark-kill-region beg (1- end)) - (org-capture-narrow beg (1- end)) - (if (or (re-search-backward "%\\?" beg t) - (re-search-forward "%\\?" end t)) - (replace-match "")))) + (org-capture-position-for-last-stored (point)) + (let ((beg (point))) + (insert (org-capture-get :template)) + (unless (bolp) (insert "\n")) + ;; Ignore the final newline character so as to not alter data + ;; after inserted text. Yet, if the template is empty, make + ;; sure END matches BEG instead of pointing before it. + (let ((end (max beg (1- (point))))) + (org-capture-empty-lines-after) + (org-capture-mark-kill-region origin (point)) + (org-capture-narrow beg end) + (when (or (search-backward "%?" beg t) + (search-forward "%?" end t)) + (replace-match "")))))) (defun org-capture-mark-kill-region (beg end) "Mark the region that will have to be killed when aborting capture." - (let ((m1 (move-marker (make-marker) beg)) - (m2 (move-marker (make-marker) end))) + (let ((m1 (copy-marker beg)) + (m2 (copy-marker end t))) (org-capture-put :begin-marker m1) (org-capture-put :end-marker m2))) @@ -1364,7 +1432,7 @@ Point will be after the empty lines, so insertion can directly be done." (let ((pos (point))) (org-back-over-empty-lines) (delete-region (point) pos) - (if (> n 0) (newline n)))) + (when (> n 0) (newline n)))) (defun org-capture-empty-lines-after (&optional n) "Set the correct number of empty lines after the inserted string. @@ -1374,7 +1442,7 @@ Point will remain at the first line after the inserted text." (org-back-over-empty-lines) (while (looking-at "[ \t]*\n") (replace-match "")) (let ((pos (point))) - (if (> n 0) (newline n)) + (when (> n 0) (newline n)) (goto-char pos))) (defvar org-clock-marker) ; Defined in org.el @@ -1464,94 +1532,6 @@ Use PREFIX as a prefix for the name of the indirect buffer." (unless (org-kill-is-subtree-p tree) (error "Template is not a valid Org entry or tree"))) -(defun org-mks (table title &optional prompt specials) - "Select a member of an alist with multiple keys. - -TABLE is the alist which should contain entries where the car is a string. -There should be two types of entries. - -1. prefix descriptions like (\"a\" \"Description\") - This indicates that `a' is a prefix key for multi-letter selection, and - that there are entries following with keys like \"ab\", \"ax\"... - -2. Select-able members must have more than two elements, with the first - being the string of keys that lead to selecting it, and the second a - short description string of the item. - -The command will then make a temporary buffer listing all entries -that can be selected with a single key, and all the single key -prefixes. When you press the key for a single-letter entry, it is selected. -When you press a prefix key, the commands (and maybe further prefixes) -under this key will be shown and offered for selection. - -TITLE will be placed over the selection in the temporary buffer, -PROMPT will be used when prompting for a key. SPECIAL is an -alist with (\"key\" \"description\") entries. When one of these -is selected, only the bare key is returned." - (save-window-excursion - (let ((inhibit-quit t) - (buffer (org-switch-to-buffer-other-window "*Org Select*")) - (prompt (or prompt "Select: ")) - current) - (unwind-protect - (catch 'exit - (while t - (erase-buffer) - (insert title "\n\n") - (let ((des-keys nil) - (allowed-keys '("\C-g")) - (cursor-type nil)) - ;; Populate allowed keys and descriptions keys - ;; available with CURRENT selector. - (let ((re (format "\\`%s\\(.\\)\\'" - (if current (regexp-quote current) ""))) - (prefix (if current (concat current " ") ""))) - (dolist (entry table) - (pcase entry - ;; Description. - (`(,(and key (pred (string-match re))) ,desc) - (let ((k (match-string 1 key))) - (push k des-keys) - (push k allowed-keys) - (insert prefix "[" k "]" "..." " " desc "..." "\n"))) - ;; Usable entry. - (`(,(and key (pred (string-match re))) ,desc . ,_) - (let ((k (match-string 1 key))) - (insert prefix "[" k "]" " " desc "\n") - (push k allowed-keys))) - (_ nil)))) - ;; Insert special entries, if any. - (when specials - (insert "----------------------------------------------------\ ----------------------------\n") - (pcase-dolist (`(,key ,description) specials) - (insert (format "[%s] %s\n" key description)) - (push key allowed-keys))) - ;; Display UI and let user select an entry or - ;; a sub-level prefix. - (goto-char (point-min)) - (unless (pos-visible-in-window-p (point-max)) - (org-fit-window-to-buffer)) - (message prompt) - (let ((pressed (char-to-string (read-char-exclusive)))) - (while (not (member pressed allowed-keys)) - (message "Invalid key `%s'" pressed) (sit-for 1) - (message prompt) - (setq pressed (char-to-string (read-char-exclusive)))) - (setq current (concat current pressed)) - (cond - ((equal pressed "\C-g") (user-error "Abort")) - ;; Selection is a prefix: open a new menu. - ((member pressed des-keys)) - ;; Selection matches an association: return it. - ((let ((entry (assoc current table))) - (and entry (throw 'exit entry)))) - ;; Selection matches a special entry: return the - ;; selection prefix. - ((assoc current specials) (throw 'exit current)) - (t (error "No entry available"))))))) - (when buffer (kill-buffer buffer)))))) - ;;; The template code (defun org-capture-select-template (&optional keys) "Select a capture template. @@ -1592,7 +1572,8 @@ The template may still contain \"%?\" for cursor positioning." (v-c (and kill-ring (current-kill 0))) (v-x (or (org-get-x-clipboard 'PRIMARY) (org-get-x-clipboard 'CLIPBOARD) - (org-get-x-clipboard 'SECONDARY))) + (org-get-x-clipboard 'SECONDARY) + "")) ;ensure it is a string ;; `initial' and `annotation' might have been passed. But if ;; the property list has them, we prefer those values. (v-i (or (plist-get org-store-link-plist :initial) @@ -1633,10 +1614,8 @@ The template may still contain \"%?\" for cursor positioning." (org-get-x-clipboard 'CLIPBOARD) (org-get-x-clipboard 'SECONDARY) v-c)))) - (setq org-store-link-plist (plist-put org-store-link-plist :annotation v-a)) (setq org-store-link-plist (plist-put org-store-link-plist :initial v-i)) - (unless template (setq template "") (message "no template") (ding) @@ -1648,7 +1627,6 @@ The template may still contain \"%?\" for cursor positioning." (setq mark-active nil) (insert template) (goto-char (point-min)) - ;; %[] insert contents of a file. (save-excursion (while (re-search-forward "%\\[\\(.+\\)\\]" nil t) @@ -1665,12 +1643,10 @@ The template may still contain \"%?\" for cursor positioning." (insert (format "%%![couldn not insert %s: %s]" filename error)))))))) - ;; Mark %() embedded elisp for later evaluation. (org-capture-expand-embedded-elisp 'mark) - ;; Expand non-interactive templates. - (let ((regexp "%\\(:[-a-za-z]+\\|<\\([^>\n]+\\)>\\|[aAcfFikKlntTuUx]\\)")) + (let ((regexp "%\\(:[-A-Za-z]+\\|<\\([^>\n]+\\)>\\|[aAcfFikKlntTuUx]\\)")) (save-excursion (while (re-search-forward regexp nil t) ;; `org-capture-escaped-%' may modify buffer and cripple @@ -1696,11 +1672,9 @@ The template may still contain \"%?\" for cursor positioning." ;; Outside embedded Lisp, repeat leading ;; characters before initial place holder ;; every line. - (let ((lead (buffer-substring-no-properties - (line-beginning-position) (point)))) - (replace-regexp-in-string "\n\\(.\\)" - (concat lead "\\1") - v-i nil nil 1)))) + (let ((lead (concat "\n" + (org-current-line-string t)))) + (replace-regexp-in-string "\n" lead v-i nil t)))) (?a v-a) (?A v-A) (?c v-c) @@ -1720,10 +1694,8 @@ The template may still contain \"%?\" for cursor positioning." ;; Escape sensitive characters. (replace-regexp-in-string "[\\\"]" "\\\\\\&" replacement) replacement)))))))) - ;; Expand %() embedded Elisp. Limit to Sexp originally marked. (org-capture-expand-embedded-elisp) - ;; Expand interactive templates. This is the last step so that ;; template is mostly expanded when prompting happens. Turn on ;; Org mode and set local variables. This is to support @@ -1769,9 +1741,7 @@ The template may still contain \"%?\" for cursor positioning." (unless (eq (char-before) ?:) (insert ":")) (insert ins) (unless (eq (char-after) ?:) (insert ":")) - (and (org-at-heading-p) - (let ((org-ignore-region t)) - (org-set-tags nil 'align)))))) + (when (org-at-heading-p) (org-align-tags))))) ((or "C" "L") (let ((insert-fun (if (equal key "C") #'insert (lambda (s) (org-insert-link 0 s))))) @@ -1786,7 +1756,36 @@ The template may still contain \"%?\" for cursor positioning." first-value))) (_ (error "Invalid `org-capture--clipboards' value: %S" org-capture--clipboards))))) - ("p" (org-set-property prompt nil)) + ("p" + ;; We remove file properties inherited from + ;; target buffer so `org-read-property-value' has + ;; a chance to find allowed values in sub-trees + ;; from the target buffer. + (setq-local org-file-properties nil) + (let* ((origin (set-marker (make-marker) + (org-capture-get :pos) + (org-capture-get :buffer))) + ;; Find location from where to get allowed + ;; values. If `:target-entry-p' is + ;; non-nil, the current headline in the + ;; target buffer is going to be a parent + ;; headline, so location is fine. + ;; Otherwise, find the parent headline in + ;; the target buffer. + (pom (if (org-capture-get :target-entry-p) origin + (let ((level (progn + (while (org-up-heading-safe)) + (org-current-level)))) + (org-with-point-at origin + (let ((l (if (org-at-heading-p) + (org-current-level) + most-positive-fixnum))) + (while (and l (>= l level)) + (setq l (org-up-heading-safe))) + (if l (point-marker) + (point-min-marker))))))) + (value (org-read-property-value prompt pom))) + (org-set-property prompt value))) ((or "t" "T" "u" "U") ;; These are the date/time related ones. (let* ((upcase? (equal (upcase key) key)) @@ -1797,17 +1796,23 @@ The template may still contain \"%?\" for cursor positioning." (member key '("u" "U")) nil nil (list org-end-time-was-given)))) (`nil + ;; Load history list for current prompt. + (setq org-capture--prompt-history + (gethash prompt org-capture--prompt-history-table)) (push (org-completing-read (concat (or prompt "Enter string") (and default (format " [%s]" default)) ": ") - completions nil nil nil nil default) + completions + nil nil nil 'org-capture--prompt-history default) strings) - (insert (car strings))) + (insert (car strings)) + ;; Save updated history list for current prompt. + (puthash prompt org-capture--prompt-history + org-capture--prompt-history-table)) (_ (error "Unknown template placeholder: \"%%^%s\"" key)))))))) - ;; Replace %n escapes with nth %^{...} string. (setq strings (nreverse strings)) (save-excursion @@ -1816,16 +1821,16 @@ The template may still contain \"%?\" for cursor positioning." (replace-match (nth (1- (string-to-number (match-string 1))) strings) nil t))))) - ;; Make sure there are no empty lines before the text, and that - ;; it ends with a newline character. + ;; it ends with a newline character or it is empty. (skip-chars-forward " \t\n") (delete-region (point-min) (line-beginning-position)) (goto-char (point-max)) (skip-chars-backward " \t\n") - (delete-region (point) (point-max)) - (insert "\n") - + (if (bobp) (delete-region (point) (line-end-position)) + (end-of-line) + (delete-region (point) (point-max)) + (insert "\n")) ;; Return the expanded template and kill the capture buffer. (untabify (point-min) (point-max)) (set-buffer-modified-p nil) @@ -1932,9 +1937,9 @@ Assume sexps have been marked with (setq jump-to-captured t)) (append (list key desc type target template) - (if prepend '(:prepend t)) - (if immediate '(:immediate-finish t)) - (if jump-to-captured '(:jump-to-captured t))))) + (and prepend '(:prepend t)) + (and immediate '(:immediate-finish t)) + (and jump-to-captured '(:jump-to-captured t))))) org-remember-templates)))) diff --git a/elpa/org-20171030/org-clock.el b/elpa/org-20190930/org-clock.el similarity index 85% rename from elpa/org-20171030/org-clock.el rename to elpa/org-20190930/org-clock.el index 4d909d0a..d0548d00 100644 --- a/elpa/org-20171030/org-clock.el +++ b/elpa/org-20190930/org-clock.el @@ -1,10 +1,10 @@ ;;; org-clock.el --- The time clocking code for Org mode -*- lexical-binding: t; -*- -;; Copyright (C) 2004-2017 Free Software Foundation, Inc. +;; Copyright (C) 2004-2019 Free Software Foundation, Inc. ;; Author: Carsten Dominik ;; Keywords: outlines, hypermedia, calendar, wp -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; ;; This file is part of GNU Emacs. ;; @@ -38,6 +38,7 @@ (declare-function org-table-goto-line "org-table" (n)) (defvar org-frame-title-format-backup frame-title-format) +(defvar org-state) (defvar org-time-stamp-formats) @@ -156,7 +157,10 @@ state to switch it to." (symbol :tag "Function"))) (defcustom org-clock-history-length 5 - "Number of clock tasks to remember in history." + "Number of clock tasks to remember in history. +Clocking in using history works best if this is at most 35, in +which case all digits and capital letters are used up by the +*Clock Task Select* buffer." :group 'org-clock :type 'integer) @@ -294,6 +298,7 @@ string as argument." :stepskip0 nil :fileskip0 nil :tags nil + :match nil :emphasize nil :link nil :narrow '40! @@ -328,11 +333,12 @@ For more information, see `org-clocktable-write-default'." :version "24.1" :type 'alist) -(defcustom org-clock-clocktable-default-properties '(:maxlevel 2 :scope file) +(defcustom org-clock-clocktable-default-properties '(:maxlevel 2) "Default properties for new clocktables. These will be inserted into the BEGIN line, to make it easy for users to play with them." :group 'org-clocktable + :package-version '(Org . "9.2") :type 'plist) (defcustom org-clock-idle-time nil @@ -430,7 +436,9 @@ This applies when using `org-clock-goto'." :type 'integer) (defcustom org-clock-display-default-range 'thisyear - "Default range when displaying clocks with `org-clock-display'." + "Default range when displaying clocks with `org-clock-display'. +Valid values are: `today', `yesterday', `thisweek', `lastweek', +`thismonth', `lastmonth', `thisyear', `lastyear' and `untilnow'." :group 'org-clock :type '(choice (const today) (const yesterday) @@ -441,7 +449,8 @@ This applies when using `org-clock-goto'." (const thisyear) (const lastyear) (const untilnow) - (const :tag "Select range interactively" interactive))) + (const :tag "Select range interactively" interactive)) + :safe #'symbolp) (defvar org-clock-in-prepare-hook nil "Hook run when preparing the clock. @@ -465,38 +474,6 @@ to add an effort property.") (defvar org-clock-stored-resume-clock nil "Clock to resume, saved by `org-clock-load'") -(defconst org-clock--oldest-date - (let* ((dichotomy - (lambda (min max pred) - (if (funcall pred min) min - (cl-incf min) - (while (> (- max min) 1) - (let ((mean (+ (ash min -1) (ash max -1) (logand min max 1)))) - (if (funcall pred mean) (setq max mean) (setq min mean))))) - max)) - (high - (funcall dichotomy - most-negative-fixnum - 0 - (lambda (m) - ;; libc in macOS 10.6 hangs when decoding times - ;; around year -2**31. Limit `high' not to go - ;; any earlier than that. - (unless (and (eq system-type 'darwin) - (string-match-p - "10\\.6\\.[[:digit:]]" - (shell-command-to-string - "sw_vers -productVersion")) - (<= m -1034058203136)) - (ignore-errors (decode-time (list m 0))))))) - (low - (funcall dichotomy - most-negative-fixnum - 0 - (lambda (m) (ignore-errors (decode-time (list high m))))))) - (list high low)) - "Internal time for oldest date representable on the system.") - ;;; The clock for measuring work time. (defvar org-mode-line-string "") @@ -542,6 +519,15 @@ cannot be translated." (assoc-string language org-clock-clocktable-language-setup t)) s)) +(defun org-clock--mode-line-heading () + "Return currently clocked heading, formatted for mode line." + (cond ((functionp org-clock-heading-function) + (funcall org-clock-heading-function)) + ((org-before-first-heading-p) "???") + (t (replace-regexp-in-string + org-bracket-link-analytic-regexp "\\5" + (org-no-properties (org-get-heading t t t t)))))) + (defun org-clock-menu () (interactive) (popup-menu @@ -553,7 +539,7 @@ cannot be translated." (defun org-clock-history-push (&optional pos buffer) "Push a marker to the clock history." - (setq org-clock-history-length (max 1 (min 35 org-clock-history-length))) + (setq org-clock-history-length (max 1 org-clock-history-length)) (let ((m (move-marker (make-marker) (or pos (point)) (org-base-buffer (or buffer (current-buffer))))) @@ -690,19 +676,18 @@ If not, show simply the clocked time like 01:50." (if org-clock-effort (let* ((effort-in-minutes (org-duration-to-minutes org-clock-effort)) (work-done-str - (propertize - (org-duration-from-minutes clocked-time) - 'face (if (and org-clock-task-overrun (not org-clock-task-overrun-text)) - 'org-mode-line-clock-overrun 'org-mode-line-clock))) - (effort-str (org-duration-from-minutes effort-in-minutes)) - (clockstr (propertize - (concat " [%s/" effort-str - "] (" (replace-regexp-in-string "%" "%%" org-clock-heading) ")") - 'face 'org-mode-line-clock))) - (format clockstr work-done-str)) - (propertize (concat " [" (org-duration-from-minutes clocked-time) - "]" (format " (%s)" org-clock-heading)) - 'face 'org-mode-line-clock)))) + (propertize (org-duration-from-minutes clocked-time) + 'face + (if (and org-clock-task-overrun + (not org-clock-task-overrun-text)) + 'org-mode-line-clock-overrun + 'org-mode-line-clock))) + (effort-str (org-duration-from-minutes effort-in-minutes))) + (format (propertize " [%s/%s] (%s)" 'face 'org-mode-line-clock) + work-done-str effort-str org-clock-heading)) + (format (propertize " [%s] (%s)" 'face 'org-mode-line-clock) + (org-duration-from-minutes clocked-time) + org-clock-heading)))) (defun org-clock-get-last-clock-out-time () "Get the last clock-out time for the current subtree." @@ -712,10 +697,13 @@ If not, show simply the clocked time like 01:50." ".*\\]--\\(\\[[^]]+\\]\\)") end t) (org-time-string-to-time (match-string 1)))))) -(defun org-clock-update-mode-line () +(defun org-clock-update-mode-line (&optional refresh) + "Update mode line with clock information. +When optional argument is non-nil, refresh cached heading." (if org-clock-effort (org-clock-notify-once-if-expired) (setq org-clock-task-overrun nil)) + (when refresh (setq org-clock-heading (org-clock--mode-line-heading))) (setq org-mode-line-string (propertize (let ((clock-string (org-clock-get-clock-string)) @@ -741,8 +729,9 @@ menu\nmouse-2 will jump to task")) The time returned includes the time spent on this task in previous clocking intervals." (let ((currently-clocked-time - (floor (- (float-time) - (float-time org-clock-start-time)) 60))) + (floor (org-time-convert-to-integer + (org-time-since org-clock-start-time)) + 60))) (+ currently-clocked-time (or org-clock-total-time 0)))) (defun org-clock-modify-effort-estimate (&optional value) @@ -750,8 +739,8 @@ previous clocking intervals." VALUE can be a number of minutes, or a string with format hh:mm or mm. When the string starts with a + or a - sign, the current value of the effort property will be changed by that amount. If the effort value is expressed -as an `org-effort-durations' (e.g. \"3h\"), the modified value will be -converted to a hh:mm duration. +as an unit defined in `org-duration-units' (e.g. \"3h\"), the modified +value will be converted to a hh:mm duration. This command will update the \"Effort\" property of the currently clocked item, and the value displayed in the mode line." @@ -931,47 +920,52 @@ If necessary, clock-out of the currently active clock." (defvar org-clock-resolving-clocks nil) (defvar org-clock-resolving-clocks-due-to-idleness nil) -(defun org-clock-resolve-clock (clock resolve-to clock-out-time - &optional close-p restart-p fail-quietly) - "Resolve `CLOCK' given the time `RESOLVE-TO', and the present. -`CLOCK' is a cons cell of the form (MARKER START-TIME)." - (let ((org-clock-resolving-clocks t)) - (cond - ((null resolve-to) - (org-clock-clock-cancel clock) - (if (and restart-p (not org-clock-clocking-in)) - (org-clock-clock-in clock))) - - ((eq resolve-to 'now) - (if restart-p - (error "RESTART-P is not valid here")) - (if (or close-p org-clock-clocking-in) - (org-clock-clock-out clock fail-quietly) - (unless (org-is-active-clock clock) - (org-clock-clock-in clock t)))) - - ((not (time-less-p resolve-to (current-time))) - (error "RESOLVE-TO must refer to a time in the past")) - - (t - (if restart-p - (error "RESTART-P is not valid here")) - (org-clock-clock-out clock fail-quietly (or clock-out-time - resolve-to)) - (unless org-clock-clocking-in - (if close-p - (setq org-clock-leftover-time (and (null clock-out-time) - resolve-to)) - (org-clock-clock-in clock nil (and clock-out-time - resolve-to)))))))) +(defun org-clock-resolve-clock + (clock resolve-to clock-out-time close restart fail-quietly) + "Resolve CLOCK given the time RESOLVE-TO, and the present. +CLOCK is a cons cell of the form (MARKER START-TIME)." + (let ((org-clock-resolving-clocks t) + ;; If the clocked entry contained only a clock and possibly + ;; the associated drawer, and we either cancel it or clock it + ;; out, `org-clock-out-remove-zero-time-clocks' may clear all + ;; contents, and leave point on the /next/ headline. We store + ;; the current entry location to be able to get back here when + ;; we need to clock in again the previously clocked task. + (heading (org-with-point-at (car clock) + (org-back-to-heading t) + (point-marker)))) + (pcase resolve-to + (`nil + (org-clock-clock-cancel clock) + (when (and restart (not org-clock-clocking-in)) + (org-with-point-at heading (org-clock-in)))) + (`now + (cond + (restart (error "RESTART is not valid here")) + ((or close org-clock-clocking-in) + (org-clock-clock-out clock fail-quietly)) + ((org-is-active-clock clock) nil) + (t (org-clock-clock-in clock t)))) + ((pred (org-time-less-p nil)) + (error "RESOLVE-TO must refer to a time in the past")) + (_ + (when restart (error "RESTART is not valid here")) + (org-clock-clock-out clock fail-quietly (or clock-out-time resolve-to)) + (cond + (org-clock-clocking-in nil) + (close + (setq org-clock-leftover-time (and (null clock-out-time) resolve-to))) + (t + (org-with-point-at heading + (org-clock-in nil (and clock-out-time resolve-to))))))))) (defun org-clock-jump-to-current-clock (&optional effective-clock) - (interactive) + "When an Org clock is running, jump to it." (let ((drawer (org-clock-into-drawer)) (clock (or effective-clock (cons org-clock-marker org-clock-start-time)))) (unless (marker-buffer (car clock)) - (error "No clock is currently running")) + (user-error "No Org clock is currently running")) (org-with-clock clock (org-clock-goto)) (with-current-buffer (marker-buffer (car clock)) (goto-char (car clock)) @@ -1051,8 +1045,8 @@ to be CLOCKED OUT.")))) nil 45))) (and (not (memq char-pressed '(?i ?q))) char-pressed))))) (default - (floor (/ (float-time - (time-subtract (current-time) last-valid)) 60))) + (floor (org-time-convert-to-integer (org-time-since last-valid)) + 60)) (keep (and (memq ch '(?k ?K)) (read-number "Keep how many minutes? " default))) @@ -1060,8 +1054,9 @@ to be CLOCKED OUT.")))) (and (memq ch '(?g ?G)) (read-number "Got back how many minutes ago? " default))) (subtractp (memq ch '(?s ?S))) - (barely-started-p (< (- (float-time last-valid) - (float-time (cdr clock))) 45)) + (barely-started-p (org-time-less-p + (org-time-subtract last-valid (cdr clock)) + 45)) (start-over (and subtractp barely-started-p))) (cond ((memq ch '(?j ?J)) @@ -1087,10 +1082,9 @@ to be CLOCKED OUT.")))) (and gotback (= gotback default))) 'now) (keep - (time-add last-valid (seconds-to-time (* 60 keep)))) + (org-time-add last-valid (* 60 keep))) (gotback - (time-subtract (current-time) - (seconds-to-time (* 60 gotback)))) + (org-time-since (* 60 gotback))) (t (error "Unexpected, please report this as a bug"))) (and gotback last-valid) @@ -1120,9 +1114,9 @@ If `only-dangling-p' is non-nil, only ask to resolve dangling (lambda (clock) (format "Dangling clock started %d mins ago" - (floor (- (float-time) - (float-time (cdr clock))) - 60))))) + (floor (org-time-convert-to-integer + (org-time-since (cdr clock))) + 60))))) (or last-valid (cdr clock))))))))))) @@ -1172,8 +1166,7 @@ so long." org-clock-marker (marker-buffer org-clock-marker)) (let* ((org-clock-user-idle-seconds (org-user-idle-seconds)) (org-clock-user-idle-start - (time-subtract (current-time) - (seconds-to-time org-clock-user-idle-seconds))) + (org-time-since org-clock-user-idle-seconds)) (org-clock-resolving-clocks-due-to-idleness t)) (if (> org-clock-user-idle-seconds (* 60 org-clock-idle-time)) (org-clock-resolve @@ -1182,9 +1175,8 @@ so long." (lambda (_) (format "Clocked in & idle for %.1f mins" (/ (float-time - (time-subtract (current-time) - org-clock-user-idle-start)) - 60.0))) + (time-since org-clock-user-idle-start)) + 60))) org-clock-user-idle-start))))) (defvar org-clock-current-task nil "Task currently clocked in.") @@ -1232,36 +1224,31 @@ the default behavior." (when (equal select '(64)) ;; Set start-time to `org-clock-out-time' (let ((org-clock-continuously t)) - (org-clock-in nil org-clock-out-time))) + (org-clock-in nil org-clock-out-time) + (throw 'abort nil))) (when (equal select '(4)) - (setq selected-task (org-clock-select-task "Clock-in on task: ")) - (if selected-task - (setq selected-task (copy-marker selected-task)) - (error "Abort"))) + (pcase (org-clock-select-task "Clock-in on task: ") + (`nil (error "Abort")) + (task (setq selected-task (copy-marker task))))) (when (equal select '(16)) ;; Mark as default clocking task (org-clock-mark-default-task)) (when interrupting - ;; We are interrupting the clocking of a different task. - ;; Save a marker to this task, so that we can go back. - ;; First check if we are trying to clock into the same task! - (when (save-excursion - (unless selected-task - (org-back-to-heading t)) - (and (equal (marker-buffer org-clock-hd-marker) - (if selected-task - (marker-buffer selected-task) - (current-buffer))) - (= (marker-position org-clock-hd-marker) - (if selected-task - (marker-position selected-task) - (point))) - (equal org-clock-current-task (nth 4 (org-heading-components))))) - (message "Clock continues in \"%s\"" org-clock-heading) - (throw 'abort nil)) + ;; We are interrupting the clocking of a different task. Save + ;; a marker to this task, so that we can go back. First check + ;; if we are trying to clock into the same task! + (when (or selected-task (derived-mode-p 'org-mode)) + (org-with-point-at selected-task + (unless selected-task (org-back-to-heading t)) + (when (and (eq (marker-buffer org-clock-hd-marker) + (org-base-buffer (current-buffer))) + (= (point) (marker-position org-clock-hd-marker)) + (equal org-clock-current-task (org-get-heading t t t t))) + (message "Clock continues in %S" org-clock-heading) + (throw 'abort nil)))) (move-marker org-clock-interrupted-task (marker-position org-clock-marker) (marker-buffer org-clock-marker)) @@ -1286,7 +1273,7 @@ the default behavior." (or interrupting (move-marker org-clock-interrupted-task nil)) (run-hooks 'org-clock-in-prepare-hook) (org-clock-history-push) - (setq org-clock-current-task (nth 4 (org-heading-components))) + (setq org-clock-current-task (org-get-heading t t t t)) (cond ((functionp org-clock-in-switch-to-state) (let ((case-fold-search nil)) (looking-at org-complex-heading-regexp)) @@ -1298,15 +1285,7 @@ the default behavior." org-clock-in-switch-to-state "\\>")))) (org-todo org-clock-in-switch-to-state))) - (setq org-clock-heading - (cond ((and org-clock-heading-function - (functionp org-clock-heading-function)) - (funcall org-clock-heading-function)) - ((nth 4 (org-heading-components)) - (replace-regexp-in-string - "\\[\\[.*?\\]\\[\\(.*?\\)\\]\\]" "\\1" - (match-string-no-properties 4))) - (t "???"))) + (setq org-clock-heading (org-clock--mode-line-heading)) (org-clock-find-position org-clock-in-resume) (cond ((and org-clock-in-resume @@ -1318,8 +1297,7 @@ the default behavior." (setq ts (concat "[" (match-string 1) "]")) (goto-char (match-end 1)) (setq org-clock-start-time - (apply 'encode-time - (org-parse-time-string (match-string 1)))) + (org-time-string-to-time (match-string 1))) (setq org-clock-effort (org-entry-get (point) org-effort-property)) (setq org-clock-total-time (org-clock-sum-current-item (org-clock-get-sum-start)))) @@ -1338,7 +1316,7 @@ the default behavior." (end-of-line 0) (org-in-item-p))) (beginning-of-line 1) - (indent-line-to (- (org-get-indentation) 2))) + (indent-line-to (- (current-indentation) 2))) (insert org-clock-string " ") (setq org-clock-effort (org-entry-get (point) org-effort-property)) (setq org-clock-total-time (org-clock-sum-current-item @@ -1349,9 +1327,10 @@ the default behavior." (y-or-n-p (format "You stopped another clock %d mins ago; start this one from then? " - (/ (- (float-time - (org-current-time org-clock-rounding-minutes t)) - (float-time leftover)) + (/ (org-time-convert-to-integer + (org-time-subtract + (org-current-time org-clock-rounding-minutes t) + leftover)) 60))) leftover) start-time @@ -1394,7 +1373,7 @@ the default behavior." ;;;###autoload (defun org-clock-in-last (&optional arg) "Clock in the last closed clocked item. -When already clocking in, send an warning. +When already clocking in, send a warning. With a universal prefix argument, select the task you want to clock in from the last clocked in tasks. With two universal prefix arguments, start clocking using the @@ -1442,7 +1421,7 @@ in particular CLOCK_MODELINE_TOTAL and the corresponding variable `org-clock-mode-line-total' and then decides which time to use. The time is always returned as UTC." - (let ((cmt (or (org-entry-get nil "CLOCK_MODELINE_TOTAL") + (let ((cmt (or (org-entry-get nil "CLOCK_MODELINE_TOTAL" 'selective) (symbol-name org-clock-mode-line-total))) (lr (org-entry-get nil "LAST_REPEAT"))) (cond @@ -1451,13 +1430,12 @@ The time is always returned as UTC." (current-time)) ((equal cmt "today") (setq org--msg-extra "showing today's task time.") - (let* ((dt (org-decode-time nil t)) + (let* ((dt (decode-time)) (hour (nth 2 dt)) (day (nth 3 dt))) (if (< hour org-extend-today-until) (setf (nth 3 dt) (1- day))) (setf (nth 2 dt) org-extend-today-until) - (setq dt (append (list 0 0) (nthcdr 2 dt) '(t))) - (apply #'encode-time dt))) + (apply #'encode-time 0 0 (nthcdr 2 dt)))) ((or (equal cmt "all") (and (or (not cmt) (equal cmt "auto")) (not lr))) @@ -1467,7 +1445,7 @@ The time is always returned as UTC." (and (or (not cmt) (equal cmt "auto")) lr)) (setq org--msg-extra "showing task time since last repeat.") - (and lr (org-time-string-to-time lr t))) + (and lr (org-time-string-to-time lr))) (t nil)))) (defun org-clock-find-position (find-unclosed) @@ -1528,9 +1506,9 @@ line and position cursor in that line." (let ((beg (point))) (insert ":" drawer ":\n:END:\n") (org-indent-region beg (point)) - (goto-char beg) - (org-flag-drawer t) - (forward-line)))) + (org-flag-region + (line-end-position -1) (1- (point)) t 'org-hide-drawer) + (forward-line -1)))) ;; When a clock drawer needs to be created because of the ;; number of clock items or simply if it is missing, collect ;; all clocks in the section and wrap them within the drawer. @@ -1554,7 +1532,7 @@ line and position cursor in that line." (let ((end (point-marker))) (goto-char beg) (save-excursion (insert ":" drawer ":\n")) - (org-flag-drawer t) + (org-flag-region (line-end-position) (1- end) t 'org-hide-drawer) (org-indent-region (point) end) (forward-line) (unless org-log-states-order-reversed @@ -1603,21 +1581,19 @@ to, overriding the existing value of `org-clock-out-switch-to-state'." (delete-region (point) (point-at-eol)) (insert "--") (setq te (org-insert-time-stamp (or at-time now) 'with-hm 'inactive)) - (setq s (- (float-time - (apply #'encode-time (org-parse-time-string te nil t))) - (float-time - (apply #'encode-time (org-parse-time-string ts nil t)))) - h (floor (/ s 3600)) - s (- s (* 3600 h)) - m (floor (/ s 60)) - s (- s (* 60 s))) + (setq s (org-time-convert-to-integer + (time-subtract + (org-time-string-to-time te) + (org-time-string-to-time ts))) + h (floor s 3600) + m (floor (mod s 3600) 60)) (insert " => " (format "%2d:%02d" h m)) (move-marker org-clock-marker nil) (move-marker org-clock-hd-marker nil) ;; Possibly remove zero time clocks. However, do not add ;; a note associated to the CLOCK line in this case. (cond ((and org-clock-out-remove-zero-time-clocks - (= (+ h m) 0)) + (= 0 h m)) (setq remove t) (delete-region (line-beginning-position) (line-beginning-position 2))) @@ -1651,9 +1627,10 @@ to, overriding the existing value of `org-clock-out-switch-to-state'." "\\>")))) (org-todo org-clock-out-switch-to-state)))))) (force-mode-line-update) - (message (concat "Clock stopped at %s after " - (org-duration-from-minutes (+ (* 60 h) m)) "%s") - te (if remove " => LINE REMOVED" "")) + (message (if remove + "Clock stopped at %s after %s => LINE REMOVED" + "Clock stopped at %s after %s") + te (org-duration-from-minutes (+ (* 60 h) m))) (run-hooks 'org-clock-out-hook) (unless (org-clocking-p) (setq org-clock-current-task nil))))))) @@ -1711,8 +1688,8 @@ Optional argument N tells to change by that many units." (begts (if updatets1 begts1 begts2))) (setq tdiff (time-subtract - (org-time-string-to-time org-last-changed-timestamp t) - (org-time-string-to-time ts t))) + (org-time-string-to-time org-last-changed-timestamp) + (org-time-string-to-time ts))) (save-excursion (goto-char begts) (org-timestamp-change @@ -1775,7 +1752,6 @@ With prefix arg SELECT, offer recently clocked tasks for selection." (goto-char m) (org-show-entry) (org-back-to-heading t) - (org-cycle-hide-drawers 'children) (recenter org-clock-goto-before-context) (org-reveal) (if recent @@ -1785,6 +1761,7 @@ With prefix arg SELECT, offer recently clocked tasks for selection." (defvar-local org-clock-file-total-minutes nil "Holds the file total time in minutes, after a call to `org-clock-sum'.") +;;;###autoload (defun org-clock-sum-today (&optional headline-filter) "Sum the times for each subtree for today." (let ((range (org-clock-special-range 'today))) @@ -1813,88 +1790,87 @@ HEADLINE-FILTER is a zero-arg function that, if specified, is called for each headline in the time range with point at the headline. Headlines for which HEADLINE-FILTER returns nil are excluded from the clock summation. PROPNAME lets you set a custom text property instead of :org-clock-minutes." - (org-with-silent-modifications - (let* ((re (concat "^\\(\\*+\\)[ \t]\\|^[ \t]*" - org-clock-string - "[ \t]*\\(?:\\(\\[.*?\\]\\)-+\\(\\[.*?\\]\\)\\|=>[ \t]+\\([0-9]+\\):\\([0-9]+\\)\\)")) - (lmax 30) - (ltimes (make-vector lmax 0)) - (level 0) - (tstart (cond ((stringp tstart) (org-time-string-to-seconds tstart t)) - ((consp tstart) (float-time tstart)) - (t tstart))) - (tend (cond ((stringp tend) (org-time-string-to-seconds tend t)) - ((consp tend) (float-time tend)) - (t tend))) - (t1 0) - time) - (remove-text-properties (point-min) (point-max) - `(,(or propname :org-clock-minutes) t - :org-clock-force-headline-inclusion t)) - (save-excursion - (goto-char (point-max)) - (while (re-search-backward re nil t) - (cond - ((match-end 2) - ;; Two time stamps. - (let* ((ts (float-time - (apply #'encode-time - (save-match-data - (org-parse-time-string - (match-string 2) nil t))))) - (te (float-time - (apply #'encode-time - (org-parse-time-string (match-string 3) nil t)))) - (dt (- (if tend (min te tend) te) - (if tstart (max ts tstart) ts)))) - (when (> dt 0) (cl-incf t1 (floor (/ dt 60)))))) - ((match-end 4) - ;; A naked time. - (setq t1 (+ t1 (string-to-number (match-string 5)) - (* 60 (string-to-number (match-string 4)))))) - (t ;A headline - ;; Add the currently clocking item time to the total. - (when (and org-clock-report-include-clocking-task - (eq (org-clocking-buffer) (current-buffer)) - (eq (marker-position org-clock-hd-marker) (point)) - tstart - tend - (>= (float-time org-clock-start-time) tstart) - (<= (float-time org-clock-start-time) tend)) - (let ((time (floor (- (float-time) - (float-time org-clock-start-time)) - 60))) - (setq t1 (+ t1 time)))) - (let* ((headline-forced - (get-text-property (point) - :org-clock-force-headline-inclusion)) - (headline-included - (or (null headline-filter) - (save-excursion - (save-match-data (funcall headline-filter)))))) - (setq level (- (match-end 1) (match-beginning 1))) - (when (>= level lmax) - (setq ltimes (vconcat ltimes (make-vector lmax 0)) lmax (* 2 lmax))) - (when (or (> t1 0) (> (aref ltimes level) 0)) - (when (or headline-included headline-forced) - (if headline-included - (cl-loop for l from 0 to level do - (aset ltimes l (+ (aref ltimes l) t1)))) - (setq time (aref ltimes level)) - (goto-char (match-beginning 0)) - (put-text-property (point) (point-at-eol) - (or propname :org-clock-minutes) time) - (when headline-filter - (save-excursion - (save-match-data - (while (org-up-heading-safe) - (put-text-property - (point) (line-end-position) - :org-clock-force-headline-inclusion t)))))) - (setq t1 0) - (cl-loop for l from level to (1- lmax) do - (aset ltimes l 0))))))) - (setq org-clock-file-total-minutes (aref ltimes 0)))))) + (with-silent-modifications + (let* ((re (concat "^\\(\\*+\\)[ \t]\\|^[ \t]*" + org-clock-string + "[ \t]*\\(?:\\(\\[.*?\\]\\)-+\\(\\[.*?\\]\\)\\|=>[ \t]+\\([0-9]+\\):\\([0-9]+\\)\\)")) + (lmax 30) + (ltimes (make-vector lmax 0)) + (level 0) + (tstart (cond ((stringp tstart) (org-time-string-to-seconds tstart)) + ((consp tstart) (float-time tstart)) + (t tstart))) + (tend (cond ((stringp tend) (org-time-string-to-seconds tend)) + ((consp tend) (float-time tend)) + (t tend))) + (t1 0) + time) + (remove-text-properties (point-min) (point-max) + `(,(or propname :org-clock-minutes) t + :org-clock-force-headline-inclusion t)) + (save-excursion + (goto-char (point-max)) + (while (re-search-backward re nil t) + (cond + ((match-end 2) + ;; Two time stamps. + (let* ((ts (float-time + (apply #'encode-time + (save-match-data + (org-parse-time-string (match-string 2)))))) + (te (float-time + (apply #'encode-time + (org-parse-time-string (match-string 3))))) + (dt (- (if tend (min te tend) te) + (if tstart (max ts tstart) ts)))) + (when (> dt 0) (cl-incf t1 (floor dt 60))))) + ((match-end 4) + ;; A naked time. + (setq t1 (+ t1 (string-to-number (match-string 5)) + (* 60 (string-to-number (match-string 4)))))) + (t ;A headline + ;; Add the currently clocking item time to the total. + (when (and org-clock-report-include-clocking-task + (eq (org-clocking-buffer) (current-buffer)) + (eq (marker-position org-clock-hd-marker) (point)) + tstart + tend + (>= (float-time org-clock-start-time) tstart) + (<= (float-time org-clock-start-time) tend)) + (let ((time (floor (org-time-convert-to-integer + (org-time-since org-clock-start-time)) + 60))) + (setq t1 (+ t1 time)))) + (let* ((headline-forced + (get-text-property (point) + :org-clock-force-headline-inclusion)) + (headline-included + (or (null headline-filter) + (save-excursion + (save-match-data (funcall headline-filter)))))) + (setq level (- (match-end 1) (match-beginning 1))) + (when (>= level lmax) + (setq ltimes (vconcat ltimes (make-vector lmax 0)) lmax (* 2 lmax))) + (when (or (> t1 0) (> (aref ltimes level) 0)) + (when (or headline-included headline-forced) + (if headline-included + (cl-loop for l from 0 to level do + (aset ltimes l (+ (aref ltimes l) t1)))) + (setq time (aref ltimes level)) + (goto-char (match-beginning 0)) + (put-text-property (point) (point-at-eol) + (or propname :org-clock-minutes) time) + (when headline-filter + (save-excursion + (save-match-data + (while (org-up-heading-safe) + (put-text-property + (point) (line-end-position) + :org-clock-force-headline-inclusion t)))))) + (setq t1 0) + (cl-loop for l from level to (1- lmax) do + (aset ltimes l 0))))))) + (setq org-clock-file-total-minutes (aref ltimes 0)))))) (defun org-clock-sum-current-item (&optional tstart) "Return time, clocked on current item in total." @@ -1931,64 +1907,63 @@ Use `\\[org-clock-remove-overlays]' to remove the subtree times." (prop (cond ((not arg) :org-clock-minutes-default) (todayp :org-clock-minutes-today) (customp :org-clock-minutes-custom) - (t :org-clock-minutes))) - time h m p) + (t :org-clock-minutes)))) (cond ((not arg) (org-clock-sum-custom nil org-clock-display-default-range prop)) (todayp (org-clock-sum-today)) (customp (org-clock-sum-custom nil arg)) (t (org-clock-sum))) - (unless (eq arg '(64)) + (unless (equal arg '(64)) (save-excursion (goto-char (point-min)) - (while (or (and (equal (setq p (point)) (point-min)) - (get-text-property p prop)) - (setq p (next-single-property-change - (point) prop))) - (goto-char p) - (when (setq time (get-text-property p prop)) - (org-clock-put-overlay time))) - (setq h (/ org-clock-file-total-minutes 60) - m (- org-clock-file-total-minutes (* 60 h))) + (let ((p nil)) + (while (or (and (equal (setq p (point)) (point-min)) + (get-text-property p prop)) + (setq p (next-single-property-change (point) prop))) + (goto-char p) + (let ((time (get-text-property p prop))) + (when time (org-clock-put-overlay time))))) ;; Arrange to remove the overlays upon next change. (when org-remove-highlights-with-change (add-hook 'before-change-functions 'org-clock-remove-overlays - nil 'local)))) - (message (concat (format "Total file time%s: " - (cond (todayp " for today") - (customp " (custom)") - (t ""))) - (org-duration-from-minutes - org-clock-file-total-minutes) - " (%d hours and %d minutes)") - h m))) + nil 'local)))) + (let* ((h (/ org-clock-file-total-minutes 60)) + (m (- org-clock-file-total-minutes (* 60 h)))) + (message (cond + (todayp + "Total file time for today: %s (%d hours and %d minutes)") + (customp + "Total file time (custom): %s (%d hours and %d minutes)") + (t + "Total file time: %s (%d hours and %d minutes)")) + (org-duration-from-minutes org-clock-file-total-minutes) + h m)))) (defvar-local org-clock-overlays nil) (defun org-clock-put-overlay (time) - "Put an overlays on the current line, displaying TIME. -This creates a new overlay and stores it in `org-clock-overlays', so that it -will be easy to remove." - (let (ov tx) - (beginning-of-line) - (let ((case-fold-search nil)) - (when (looking-at org-complex-heading-regexp) - (goto-char (match-beginning 4)))) - (setq ov (make-overlay (point) (point-at-eol)) - tx (concat (buffer-substring-no-properties (point) (match-end 4)) - (org-add-props - (make-string - (max 0 (- (- 60 (current-column)) - (- (match-end 4) (match-beginning 4)) - (length (org-get-at-bol 'line-prefix)))) - ?\·) - '(face shadow)) - (org-add-props - (format " %9s " (org-duration-from-minutes time)) - '(face org-clock-overlay)) - "")) - (overlay-put ov 'display tx) - (push ov org-clock-overlays))) + "Put an overlay on the headline at point, displaying TIME. +Create a new overlay and store it in `org-clock-overlays', so +that it will be easy to remove. This function assumes point is +on a headline." + (org-match-line org-complex-heading-regexp) + (goto-char (match-beginning 4)) + (let* ((headline (match-string 4)) + (text (concat headline + (org-add-props + (make-string + (max (- (- 60 (current-column)) + (org-string-width headline) + (length (org-get-at-bol 'line-prefix))) + 0) + ?\·) + '(face shadow)) + (org-add-props + (format " %9s " (org-duration-from-minutes time)) + '(face org-clock-overlay)))) + (o (make-overlay (point) (line-end-position)))) + (org-overlay-display o text) + (push o org-clock-overlays))) ;;;###autoload (defun org-clock-remove-overlays (&optional _beg _end noremove) @@ -2003,7 +1978,7 @@ If NOREMOVE is nil, remove this function from the (remove-hook 'before-change-functions 'org-clock-remove-overlays 'local)))) -(defvar org-state) ;; dynamically scoped into this function +;;;###autoload (defun org-clock-out-if-current () "Clock out if the current entry contains the running clock. This is used to stop the clock after a TODO entry is marked DONE, @@ -2020,16 +1995,13 @@ and is only done if the variable `org-clock-out-when-done' is not nil." (or (buffer-base-buffer (current-buffer)) (current-buffer))) (< (point) org-clock-marker) - (> (save-excursion (outline-next-heading) (point)) + (> (org-with-wide-buffer (org-entry-end-position)) org-clock-marker)) ;; Clock out, but don't accept a logging message for this. (let ((org-log-note-clock-out nil) (org-clock-out-switch-to-state nil)) (org-clock-out)))) -(add-hook 'org-after-todo-state-change-hook - 'org-clock-out-if-current) - ;;;###autoload (defun org-clock-get-clocktable (&rest props) "Get a formatted clocktable with parameters according to PROPS. @@ -2053,27 +2025,32 @@ fontified, and then returned." ;;;###autoload (defun org-clock-report (&optional arg) - "Create a table containing a report about clocked time. -If the cursor is inside an existing clocktable block, then the table -will be updated. If not, a new clocktable will be inserted. The scope -of the new clock will be subtree when called from within a subtree, and -file elsewhere. - -When called with a prefix argument, move to the first clock table in the -buffer and update it." + "Update or create a table containing a report about clocked time. + +If point is inside an existing clocktable block, update it. +Otherwise, insert a new one. + +The new table inherits its properties from the variable +`org-clock-clocktable-default-properties'. The scope of the +clocktable, when not specified in the previous variable, is +`subtree' when the function is called from within a subtree, and +`file' elsewhere. + +When called with a prefix argument, move to the first clock table +in the buffer and update it." (interactive "P") (org-clock-remove-overlays) (when arg (org-find-dblock "clocktable") (org-show-entry)) - (if (org-in-clocktable-p) - (goto-char (org-in-clocktable-p)) - (let ((props (if (ignore-errors - (save-excursion (org-back-to-heading))) - (list :name "clocktable" :scope 'subtree) - (list :name "clocktable")))) - (org-create-dblock - (org-combine-plists org-clock-clocktable-default-properties props)))) + (pcase (org-in-clocktable-p) + (`nil + (org-create-dblock + (org-combine-plists + (list :scope (if (org-before-first-heading-p) 'file 'subtree)) + org-clock-clocktable-default-properties + '(:name "clocktable")))) + (start (goto-char start))) (org-update-dblock)) (defun org-day-of-week (day month year) @@ -2147,9 +2124,10 @@ time. The return value is a list containing two internal times, one for the beginning of the range and one for its end, like the ones -returned by `current time' or `encode-time' and a string used to +returned by `current-time' or `encode-time' and a string used to display information. If AS-STRINGS is non-nil, the returned -times will be formatted strings. +times will be formatted strings. Note that the first element is +always nil when KEY is `untilnow'. If WSTART is non-nil, use this number to specify the starting day of a week (monday is 1). If MSTART is non-nil, use this number @@ -2223,13 +2201,17 @@ have priority." (`lastq (setq key 'quarter shift -1)))) ;; Prepare start and end times depending on KEY's type. (pcase key - ((or `day `today) (setq m 0 h 0 h1 24 d (+ d shift))) + ((or `day `today) (setq m 0 + h org-extend-today-until + h1 (+ 24 org-extend-today-until) + d (+ d shift))) ((or `week `thisweek) (let* ((ws (or wstart 1)) (diff (+ (* -7 shift) (if (= dow 0) (- 7 ws) (- dow ws))))) - (setq m 0 h 0 d (- d diff) d1 (+ 7 d)))) + (setq m 0 h org-extend-today-until d (- d diff) d1 (+ 7 d)))) ((or `month `thismonth) - (setq h 0 m 0 d (or mstart 1) month (+ month shift) month1 (1+ month))) + (setq h org-extend-today-until m 0 d (or mstart 1) + month (+ month shift) month1 (1+ month))) ((or `quarter `thisq) ;; Compute if this shift remains in this year. If not, compute ;; how many years and quarters we have to shift (via floor*) and @@ -2247,20 +2229,22 @@ have priority." (setq shiftedy (- y (+ 1 (nth 0 tmp))) shiftedm (- 13 (* 3 (nth 1 tmp))) shiftedq (- 5 (nth 1 tmp))))) - (setq m 0 h 0 d 1 month shiftedm month1 (+ 3 shiftedm) y shiftedy)) + (setq m 0 h org-extend-today-until d 1 + month shiftedm month1 (+ 3 shiftedm) y shiftedy)) ((> (+ q shift) 0) ; Shift is within this year. (setq shiftedq (+ q shift)) (setq shiftedy y) (let ((qshift (* 3 (1- (+ q shift))))) - (setq m 0 h 0 d 1 month (+ 1 qshift) month1 (+ 4 qshift)))))) + (setq m 0 h org-extend-today-until d 1 + month (+ 1 qshift) month1 (+ 4 qshift)))))) ((or `year `thisyear) - (setq m 0 h 0 d 1 month 1 y (+ y shift) y1 (1+ y))) + (setq m 0 h org-extend-today-until d 1 month 1 y (+ y shift) y1 (1+ y))) ((or `interactive `untilnow)) ; Special cases, ignore them. (_ (user-error "No such time block %s" key))) ;; 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) + (`untilnow nil) (_ (encode-time 0 m h d month y)))) (end (pcase key (`interactive (org-read-date nil t nil "Range end? ")) @@ -2284,7 +2268,7 @@ have priority." (`untilnow "now")))) (if (not as-strings) (list start end text) (let ((f (cdr org-time-stamp-formats))) - (list (format-time-string f start) + (list (and start (format-time-string f start)) (format-time-string f end) text)))))) @@ -2392,9 +2376,15 @@ the currently selected interval size." (`file-with-archives (and buffer-file-name (org-add-archive-files (list buffer-file-name)))) + ((or `nil `file `subtree `tree + (and (pred symbolp) + (guard (string-match "\\`tree\\([0-9]+\\)\\'" + (symbol-name scope))))) + (or (buffer-file-name (buffer-base-buffer)) + (current-buffer))) ((pred functionp) (funcall scope)) ((pred consp) scope) - (_ (or (buffer-file-name) (current-buffer))))) + (_ (user-error "Unknown scope: %S" scope)))) (block (plist-get params :block)) (ts (plist-get params :tstart)) (te (plist-get params :tend)) @@ -2485,6 +2475,7 @@ from the dynamic block definition." (narrow (or (plist-get params :narrow) (and compact? '40!))) (level? (and (not compact?) (plist-get params :level))) (timestamp (plist-get params :timestamp)) + (tags (plist-get params :tags)) (properties (plist-get params :properties)) (time-columns (if (or compact? (< maxlevel 2)) 1 @@ -2545,6 +2536,7 @@ from the dynamic block definition." (if multifile "|" "") ;file column, maybe (if level? "|" "") ;level column, maybe (if timestamp "|" "") ;timestamp column, maybe + (if tags "|" "") ;tags columns, maybe (if properties ;properties columns, maybe (make-string (length properties) ?|) "") @@ -2562,6 +2554,8 @@ from the dynamic block definition." (if timestamp ;timestamp column, maybe (concat (org-clock--translate "Timestamp" lang) "|") "") + (if tags "Tags |" "") ;tags columns, maybe + (if properties ;properties columns, maybe (concat (mapconcat #'identity properties "|") "|") "") @@ -2576,8 +2570,9 @@ from the dynamic block definition." "|" ;table line starter (if multifile (format "| %s " (org-clock--translate "ALL" lang)) "") ;file column, maybe - (if level? "|" "") ;level column, maybe + (if level? "|" "") ;level column, maybe (if timestamp "|" "") ;timestamp column, maybe + (if tags "|" "") ;timestamp column, maybe (make-string (length properties) ?|) ;properties columns, maybe (concat (format org-clock-total-time-cell-format (org-clock--translate "Total time" lang)) @@ -2602,13 +2597,14 @@ from the dynamic block definition." (when multifile ;; Summarize the time collected from this file. (insert-before-markers - (format (concat "| %s %s | %s%s" + (format (concat "| %s %s | %s%s%s" (format org-clock-file-time-cell-format (org-clock--translate "File time" lang)) " | *%s*|\n") (file-name-nondirectory file-name) - (if level? "| " "") ;level column, maybe + (if level? "| " "") ;level column, maybe (if timestamp "| " "") ;timestamp column, maybe + (if tags "| " "") ;tags column, maybe (if properties ;properties columns, maybe (make-string (length properties) ?|) "") @@ -2616,7 +2612,7 @@ from the dynamic block definition." ;; Get the list of node entries and iterate over it (when (> maxlevel 0) - (pcase-dolist (`(,level ,headline ,ts ,time ,props) entries) + (pcase-dolist (`(,level ,headline ,tgs ,ts ,time ,props) entries) (when narrow-cut-p (setq headline (if (and (string-match @@ -2638,6 +2634,7 @@ from the dynamic block definition." (if multifile "|" "") ;free space for file name column? (if level? (format "%d|" level) "") ;level, maybe (if timestamp (concat ts "|") "") ;timestamp, maybe + (if tags (concat (mapconcat #'identity tgs ", ") "|") "") ;tags, maybe (if properties ;properties columns, maybe (concat (mapconcat (lambda (p) (or (cdr (assoc p props)) "")) properties @@ -2692,21 +2689,30 @@ LEVEL is an integer. Indent by two spaces per level above 1." (if (= level 1) "" (concat "\\_" (make-string (* 2 (1- level)) ?\s)))) +(defun org-clocktable-increment-day (ts &optional n) + "Increment day in TS by N (defaulting to 1). +The TS argument has the same type as the return values of +`float-time' or `current-time'." + (let ((tsd (org-decode-time ts))) + (cl-incf (nth 3 tsd) (or n 1)) + (setf (nth 8 tsd) nil) ; no time zone: increasing day skips one whole day + (apply 'encode-time tsd))) + (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)) + (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) + ts (or (car cc) + ;; The year Org was born. + "<2003-01-01 Thu 00:00>") te (nth 1 cc))) (cond ((numberp ts) @@ -2714,49 +2720,49 @@ LEVEL is an integer. Indent by two spaces per level above 1." ;; org-agenda. (pcase-let ((`(,month ,day ,year) (calendar-gregorian-from-absolute ts))) (setq ts (float-time (encode-time 0 0 0 day month year))))) - (ts - (setq ts (float-time (apply #'encode-time (org-parse-time-string ts)))))) + (ts (setq ts (org-matcher-time ts)))) (cond ((numberp te) ;; Likewise for te. (pcase-let ((`(,month ,day ,year) (calendar-gregorian-from-absolute te))) (setq te (float-time (encode-time 0 0 0 day month year))))) - (te - (setq te (float-time (apply #'encode-time (org-parse-time-string te)))))) + (te (setq te (org-matcher-time te)))) (setq tsb (if (eq step0 'week) - (let ((dow (nth 6 (decode-time (seconds-to-time ts))))) - (if (< dow ws) ts - (- ts (* 86400 (- dow ws))))) + (let ((dow (nth 6 (org-decode-time ts)))) + (if (<= dow ws) ts + (float-time (org-clocktable-increment-day ts ; decrement + (- ws dow))))) 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 (max tsb ts)) + (dow (nth 6 (org-decode-time tsb))) + (days-to-skip (cond ((eq step0 'day) 1) + ;; else 'week: + ((= dow ws) 7) + (t (- ws dow))))) + (setq tsb (float-time (org-clocktable-increment-day tsb days-to-skip))) + (insert "\n" + (if (eq step0 'day) "Daily report: " + "Weekly report starting on: ") + (org-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 (org-format-time-string (org-time-stamp-format t t) + start-time) + :tend (org-format-time-string (org-time-stamp-format t t) + (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) @@ -2769,13 +2775,14 @@ file time (in minutes) as 1st and 2nd elements. The third element of this list will be a list of headline entries. Each entry has the following structure: - (LEVEL HEADLINE TIMESTAMP TIME PROPERTIES) + (LEVEL HEADLINE TAGS TIMESTAMP TIME PROPERTIES) LEVEL: The level of the headline, as an integer. This will be the reduced level, so 1,2,3,... even if only odd levels are being used. HEADLINE: The text of the headline. Depending on PARAMS, this may already be formatted like a link. +TAGS: The list of tags of the headline. TIMESTAMP: If PARAMS require it, this will be a time stamp found in the entry, any of SCHEDULED, DEADLINE, NORMAL, or first inactive, in this sequence. @@ -2794,9 +2801,10 @@ PROPERTIES: The list properties specified in the `:properties' parameter (block (plist-get params :block)) (link (plist-get params :link)) (tags (plist-get params :tags)) + (match (plist-get params :match)) (properties (plist-get params :properties)) (inherit-property-p (plist-get params :inherit-props)) - (matcher (and tags (cdr (org-make-tags-matcher tags)))) + (matcher (and match (cdr (org-make-tags-matcher match)))) cc st p tbl) (setq org-clock-file-total-minutes nil) @@ -2817,10 +2825,11 @@ PROPERTIES: The list properties specified in the `:properties' parameter (org-clock-sum ts te (when matcher `(lambda () - (let* ((tags-list (org-get-tags-at)) + (let* ((todo (org-get-todo-state)) + (tags-list (org-get-tags)) (org-scanner-tags tags-list) (org-trust-scanner-tags t)) - (funcall ,matcher nil tags-list nil))))) + (funcall ,matcher todo tags-list nil))))) (goto-char (point-min)) (setq st t) (while (or (and (bobp) (prog1 st (setq st nil)) @@ -2849,6 +2858,7 @@ PROPERTIES: The list properties specified in the `:properties' parameter (replace-regexp-in-string "\\[[0-9]+%\\]\\|\\[[0-9]+/[0-9]+\\]" "" headline))))))) + (tgs (and tags (org-get-tags))) (tsp (and timestamp (cl-some (lambda (p) (org-entry-get (point) p)) @@ -2863,7 +2873,7 @@ PROPERTIES: The list properties specified in the `:properties' parameter (point) p inherit-property-p))) (and v (cons p v)))) properties))))) - (push (list level hdl tsp time props) tbl))))))) + (push (list level hdl tgs tsp time props) tbl))))))) (list file org-clock-file-total-minutes (nreverse tbl))))) ;; Saving and loading the clock @@ -2893,8 +2903,7 @@ Otherwise, return nil." (<= org-clock-marker (point-at-eol))) ;; The clock is running here (setq org-clock-start-time - (apply 'encode-time - (org-parse-time-string (match-string 1)))) + (org-time-string-to-time (match-string 1))) (org-clock-update-mode-line))) (t (and (match-end 4) (delete-region (match-beginning 4) (match-end 4))) @@ -2902,9 +2911,9 @@ Otherwise, return nil." (setq ts (match-string 1) te (match-string 3)) (setq s (- (float-time - (apply #'encode-time (org-parse-time-string te nil t))) + (apply #'encode-time (org-parse-time-string te))) (float-time - (apply #'encode-time (org-parse-time-string ts nil t)))) + (apply #'encode-time (org-parse-time-string ts)))) neg (< s 0) s (abs s) h (floor (/ s 3600)) diff --git a/elpa/org-20171030/org-colview.el b/elpa/org-20190930/org-colview.el similarity index 89% rename from elpa/org-20171030/org-colview.el rename to elpa/org-20190930/org-colview.el index eac29c50..27120dd5 100644 --- a/elpa/org-20171030/org-colview.el +++ b/elpa/org-20190930/org-colview.el @@ -1,10 +1,10 @@ ;;; org-colview.el --- Column View in Org -*- lexical-binding: t; -*- -;; Copyright (C) 2004-2017 Free Software Foundation, Inc. +;; Copyright (C) 2004-2019 Free Software Foundation, Inc. ;; Author: Carsten Dominik ;; Keywords: outlines, hypermedia, calendar, wp -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; ;; This file is part of GNU Emacs. ;; @@ -67,7 +67,8 @@ or nil if the normal value should be used." (defcustom org-columns-summary-types nil "Alist between operators and summarize functions. -Each association follows the pattern (LABEL . SUMMARIZE) where +Each association follows the pattern (LABEL . SUMMARIZE), +or (LABEL SUMMARIZE COLLECT) where LABEL is a string used in #+COLUMNS definition describing the summary type. It can contain any character but \"}\". It is @@ -78,6 +79,13 @@ Each association follows the pattern (LABEL . SUMMARIZE) where The second one is a format string or nil. It has to return a string summarizing the list of values. + COLLECT is a function called with one argument, a property + name. It is called in the context of a headline and must + return the collected property, or the empty string. You can + use this to only collect a property if a related conditional + properties is set, e.g., to return VACATION_DAYS only if + CONFIRMED is true. + Note that the return value can become one value for an higher order summary, so the function is expected to handle its own output. @@ -88,7 +96,11 @@ in `org-columns-summary-types-default', which see." :version "26.1" :package-version '(Org . "9.0") :type '(alist :key-type (string :tag " Label") - :value-type (function :tag "Summarize"))) + :value-type + (choice (function :tag "Summarize") + (list :tag "Collect and summarize" + (function :tag "Summarize") + (function :tag "Collect"))))) @@ -221,21 +233,27 @@ See `org-columns-summary-types' for details.") "--" ["Quit" org-columns-quit t])) -(defun org-columns--displayed-value (spec value) +(defun org-columns--displayed-value (spec value &optional no-star) "Return displayed value for specification SPEC in current entry. + SPEC is a column format specification as stored in `org-columns-current-fmt-compiled'. VALUE is the real value to -display, as a string." +display, as a string. + +When NO-STAR is non-nil, do not add asterisks before displayed +value for ITEM property." (or (and (functionp org-columns-modify-value-for-display-function) (funcall org-columns-modify-value-for-display-function (nth 1 spec) ;column name value)) (pcase spec (`("ITEM" . ,_) - (concat (make-string (1- (org-current-level)) - (if org-hide-leading-stars ?\s ?*)) - "* " - (org-columns-compact-links value))) + (let ((stars + (and (not no-star) + (concat (make-string (1- (org-current-level)) + (if org-hide-leading-stars ?\s ?*)) + "* ")))) + (concat stars (org-columns-compact-links value)))) (`(,_ ,_ ,_ ,_ nil) value) ;; If PRINTF is set, assume we are displaying a number and ;; obey to the format string. @@ -268,7 +286,11 @@ possible to override it with optional argument COMPILED-FMT." (get-text-property (point) 'duration)) 'face 'org-warning)) ""))) - (list spec v (org-columns--displayed-value spec v)))))) + ;; A non-nil COMPILED-FMT means we're calling from Org + ;; Agenda mode, where we do not want leading stars for + ;; ITEM. Hence the optional argument for + ;; `org-columns--displayed-value'. + (list spec v (org-columns--displayed-value spec v compiled-fmt)))))) (or compiled-fmt org-columns-current-fmt-compiled)))) (defun org-columns--set-widths (cache) @@ -301,13 +323,29 @@ integers greater than 0." (defun org-columns--summarize (operator) "Return summary function associated to string OPERATOR." - (if (not operator) nil - (cdr (or (assoc operator org-columns-summary-types) - (assoc operator org-columns-summary-types-default) - (error "Unknown %S operator" operator))))) + (pcase (or (assoc operator org-columns-summary-types) + (assoc operator org-columns-summary-types-default)) + (`nil (error "Unknown %S operator" operator)) + (`(,_ . ,(and (pred functionp) summarize)) summarize) + (`(,_ ,summarize ,_) summarize) + (_ (error "Invalid definition for operator %S" operator)))) + +(defun org-columns--collect (operator) + "Return collect function associated to string OPERATOR. +Return nil if no collect function is associated to OPERATOR." + (pcase (or (assoc operator org-columns-summary-types) + (assoc operator org-columns-summary-types-default)) + (`nil (error "Unknown %S operator" operator)) + (`(,_ . ,(pred functionp)) nil) ;default value + (`(,_ ,_ ,collect) collect) + (_ (error "Invalid definition for operator %S" operator)))) (defun org-columns--overlay-text (value fmt width property original) - "Return text " + "Return decorated VALUE string for columns overlay display. +FMT is a format string. WIDTH is the width of the column, as an +integer. PROPERTY is the property being displayed, as a string. +ORIGINAL is the real string, i.e., before it is modified by +`org-columns--displayed-value'." (format fmt (let ((v (org-columns-add-ellipses value width))) (pcase property @@ -387,14 +425,14 @@ DATELINE is non-nil when the face used should be (line-beginning-position 2)))) (overlay-put ov 'keymap org-columns-map) (push ov org-columns-overlays)) - (org-with-silent-modifications - (let ((inhibit-read-only t)) - (put-text-property - (line-end-position 0) - (line-beginning-position 2) - 'read-only - (substitute-command-keys - "Type \\`\\[org-columns-edit-value]' \ + (with-silent-modifications + (let ((inhibit-read-only t)) + (put-text-property + (line-end-position 0) + (line-beginning-position 2) + 'read-only + (substitute-command-keys + "Type \\`\\[org-columns-edit-value]' \ to edit property"))))))) (defun org-columns-add-ellipses (string width) @@ -424,6 +462,7 @@ for the duration of the command.") "Overlay the newline before the current line with the table title." (interactive) (let ((title "") + (linum-offset (org-line-number-display-width 'columns)) (i 0)) (dolist (column org-columns-current-fmt-compiled) (pcase column @@ -435,7 +474,7 @@ for the duration of the command.") (setq-local org-previous-header-line-format header-line-format) (setq org-columns-full-header-line-format (concat - (org-add-props " " nil 'display '(space :align-to 0)) + (org-add-props " " nil 'display `(space :align-to ,linum-offset)) (org-add-props (substring title 0 -1) nil 'face 'org-column-title))) (setq org-columns-previous-hscroll -1) (add-hook 'post-command-hook 'org-columns-hscroll-title nil 'local))) @@ -443,13 +482,15 @@ for the duration of the command.") (defun org-columns-hscroll-title () "Set the `header-line-format' so that it scrolls along with the table." (sit-for .0001) ; need to force a redisplay to update window-hscroll - (when (not (= (window-hscroll) org-columns-previous-hscroll)) - (setq header-line-format - (concat (substring org-columns-full-header-line-format 0 1) - (substring org-columns-full-header-line-format - (1+ (window-hscroll)))) - org-columns-previous-hscroll (window-hscroll)) - (force-mode-line-update))) + (let ((hscroll (window-hscroll))) + (when (/= org-columns-previous-hscroll hscroll) + (setq header-line-format + (concat (substring org-columns-full-header-line-format 0 1) + (substring org-columns-full-header-line-format + (min (length org-columns-full-header-line-format) + (1+ hscroll)))) + org-columns-previous-hscroll hscroll) + (force-mode-line-update)))) (defvar org-colview-initial-truncate-line-value nil "Remember the value of `truncate-lines' across colview.") @@ -466,11 +507,11 @@ for the duration of the command.") (set-marker org-columns-begin-marker nil) (when (markerp org-columns-top-level-marker) (set-marker org-columns-top-level-marker nil)) - (org-with-silent-modifications - (mapc #'delete-overlay org-columns-overlays) - (setq org-columns-overlays nil) - (let ((inhibit-read-only t)) - (remove-text-properties (point-min) (point-max) '(read-only t)))) + (with-silent-modifications + (mapc #'delete-overlay org-columns-overlays) + (setq org-columns-overlays nil) + (let ((inhibit-read-only t)) + (remove-text-properties (point-min) (point-max) '(read-only t)))) (when org-columns-flyspell-was-active (flyspell-mode 1)) (when (local-variable-p 'org-colview-initial-truncate-line-value) @@ -495,10 +536,10 @@ for the duration of the command.") (defun org-columns-quit () "Remove the column overlays and in this way exit column editing." (interactive) - (org-with-silent-modifications - (org-columns-remove-overlays) - (let ((inhibit-read-only t)) - (remove-text-properties (point-min) (point-max) '(read-only t)))) + (with-silent-modifications + (org-columns-remove-overlays) + (let ((inhibit-read-only t)) + (remove-text-properties (point-min) (point-max) '(read-only t)))) (if (not (eq major-mode 'org-agenda-mode)) (setq org-columns-current-fmt nil) (setq org-agenda-columns-active nil) @@ -526,9 +567,15 @@ for the duration of the command.") (org-columns-next-allowed-value) (org-columns-edit-value "TAGS"))) -(defvar org-agenda-overriding-columns-format nil +(defvar org-overriding-columns-format nil "When set, overrides any other format definition for the agenda. -Don't set this, this is meant for dynamic scoping.") +Don't set this, this is meant for dynamic scoping. Set +`org-local-columns-format' instead.") + +(defvar-local org-local-columns-format nil + "When set, overrides any other format definition for the agenda. +This can be set as a buffer local value to avoid interfering with +dynamic scoping for `org-overriding-columns-format'.") (defun org-columns-edit-value (&optional key) "Edit the value of the property at point in column view. @@ -540,11 +587,11 @@ Where possible, use the standard interface for changing this line." (eol (line-end-position)) (pom (or (get-text-property bol 'org-hd-marker) (point))) (key (or key (get-char-property (point) 'org-columns-key))) - (org-columns--time (float-time (current-time))) + (org-columns--time (float-time)) (action (pcase key ("CLOCKSUM" - (error "This special column cannot be edited")) + (user-error "This special column cannot be edited")) ("ITEM" (lambda () (org-with-point-at pom (org-edit-headline)))) ("TODO" @@ -561,7 +608,7 @@ Where possible, use the standard interface for changing this line." (if (eq org-fast-tag-selection-single-key 'expert) t org-fast-tag-selection-single-key))) - (call-interactively #'org-set-tags))))) + (call-interactively #'org-set-tags-command))))) ("DEADLINE" (lambda () (org-with-point-at pom (call-interactively #'org-deadline)))) @@ -589,7 +636,7 @@ Where possible, use the standard interface for changing this line." (org-columns--call action) ;; The following let preserves the current format, and makes ;; sure that in only a single file things need to be updated. - (let* ((org-agenda-overriding-columns-format org-columns-current-fmt) + (let* ((org-overriding-columns-format org-columns-current-fmt) (buffer (marker-buffer pom)) (org-agenda-contributing-files (list (with-current-buffer buffer @@ -597,8 +644,8 @@ Where possible, use the standard interface for changing this line." (org-agenda-columns))) (t (let ((inhibit-read-only t)) - (org-with-silent-modifications - (remove-text-properties (max (point-min) (1- bol)) eol '(read-only t))) + (with-silent-modifications + (remove-text-properties (max (point-min) (1- bol)) eol '(read-only t))) (org-columns--call action)) ;; Some properties can modify headline (e.g., "TODO"), and ;; possible shuffle overlays. Make sure they are still all at @@ -683,7 +730,7 @@ an integer, select that value." (org-columns--call action) ;; The following let preserves the current format, and makes ;; sure that in only a single file things need to be updated. - (let* ((org-agenda-overriding-columns-format org-columns-current-fmt) + (let* ((org-overriding-columns-format org-columns-current-fmt) (buffer (marker-buffer pom)) (org-agenda-contributing-files (list (with-current-buffer buffer @@ -783,17 +830,17 @@ view for the whole buffer unconditionally. When COLUMNS-FMT-STRING is non-nil, use it as the column format." (interactive "P") (org-columns-remove-overlays) - (when global (goto-char (point-min))) - (if (markerp org-columns-begin-marker) - (move-marker org-columns-begin-marker (point)) - (setq org-columns-begin-marker (point-marker))) - (org-columns-goto-top-level) - ;; Initialize `org-columns-current-fmt' and - ;; `org-columns-current-fmt-compiled'. - (let ((org-columns--time (float-time (current-time)))) - (org-columns-get-format columns-fmt-string) - (unless org-columns-inhibit-recalculation (org-columns-compute-all)) - (save-excursion + (save-excursion + (when global (goto-char (point-min))) + (if (markerp org-columns-begin-marker) + (move-marker org-columns-begin-marker (point)) + (setq org-columns-begin-marker (point-marker))) + (org-columns-goto-top-level) + ;; Initialize `org-columns-current-fmt' and + ;; `org-columns-current-fmt-compiled'. + (let ((org-columns--time (float-time))) + (org-columns-get-format columns-fmt-string) + (unless org-columns-inhibit-recalculation (org-columns-compute-all)) (save-restriction (when (and (not global) (org-at-heading-p)) (narrow-to-region (point) (org-end-of-subtree t t))) @@ -1011,8 +1058,8 @@ the current buffer." (defun org-columns-uncompile-format (compiled) "Turn the compiled columns format back into a string representation. -COMPILED is an alist, as returned by -`org-columns-compile-format', which see." + +COMPILED is an alist, as returned by `org-columns-compile-format'." (mapconcat (lambda (spec) (pcase spec @@ -1070,7 +1117,7 @@ as a canonical duration, i.e., using units defined in (cond ((string-match-p org-ts-regexp s) (/ (- org-columns--time - (float-time (apply #'encode-time (org-parse-time-string s nil t)))) + (float-time (org-time-string-to-time s))) 60)) ((org-duration-p s) (org-duration-to-minutes s t)) ;skip user units (t (user-error "Invalid age: %S" s)))) @@ -1111,7 +1158,9 @@ properties drawers." (last-level lmax) (property (car spec)) (printf (nth 4 spec)) - (summarize (org-columns--summarize (nth 3 spec)))) + (operator (nth 3 spec)) + (collect (and operator (org-columns--collect operator))) + (summarize (and operator (org-columns--summarize operator)))) (org-with-wide-buffer ;; Find the region to compute. (goto-char org-columns-top-level-marker) @@ -1123,7 +1172,8 @@ properties drawers." (setq last-level level)) (setq level (org-reduced-level (org-outline-level))) (let* ((pos (match-beginning 0)) - (value (org-entry-get nil property)) + (value (if collect (funcall collect property) + (org-entry-get (point) property))) (value-set (org-string-nw-p value))) (cond ((< level last-level) @@ -1142,9 +1192,9 @@ properties drawers." (old (assoc spec summaries-alist))) (if old (setcdr old summary) (push (cons spec summary) summaries-alist) - (org-with-silent-modifications - (add-text-properties - pos (1+ pos) (list 'org-summaries summaries-alist))))) + (with-silent-modifications + (add-text-properties + pos (1+ pos) (list 'org-summaries summaries-alist))))) ;; When PROPERTY exists in current node, even if empty, ;; but its value doesn't match the one computed, use ;; the latter instead. @@ -1180,9 +1230,9 @@ column specification." (defun org-columns-compute-all () "Compute all columns that have operators defined." - (org-with-silent-modifications - (remove-text-properties (point-min) (point-max) '(org-summaries t))) - (let ((org-columns--time (float-time (current-time))) + (with-silent-modifications + (remove-text-properties (point-min) (point-max) '(org-summaries t))) + (let ((org-columns--time (float-time)) seen) (dolist (spec org-columns-current-fmt-compiled) (let ((property (car spec))) @@ -1261,17 +1311,17 @@ When PRINTF is non-nil, use it to format the result." times)) (defun org-columns--summary-min-age (ages _) - "Compute the minimum time among AGES." + "Compute the minimum age among AGES." (org-columns--format-age (apply #'min (mapcar #'org-columns--age-to-minutes ages)))) (defun org-columns--summary-max-age (ages _) - "Compute the maximum time among AGES." + "Compute the maximum age among AGES." (org-columns--format-age (apply #'max (mapcar #'org-columns--age-to-minutes ages)))) (defun org-columns--summary-mean-age (ages _) - "Compute the minimum time among AGES." + "Compute the mean age among AGES." (org-columns--format-age (/ (apply #'+ (mapcar #'org-columns--age-to-minutes ages)) (float (length ages))))) @@ -1298,7 +1348,7 @@ and variances (respectively) of the individual estimates." ;;; Dynamic block for Column view -(defun org-columns--capture-view (maxlevel skip-empty format local) +(defun org-columns--capture-view (maxlevel match skip-empty format local) "Get the column view of the current buffer. MAXLEVEL sets the level limit. SKIP-EMPTY tells whether to skip @@ -1333,7 +1383,8 @@ other rows. Each row is a list of fields, as strings, or (or (null r) (and has-item (= (length r) 1))))) (push (cons (org-reduced-level (org-current-level)) (nreverse row)) table))))) - (and maxlevel (format "LEVEL<=%d" maxlevel)) + (or (and maxlevel (format "LEVEL<=%d" maxlevel)) + (and match match)) (and local 'tree) 'archive 'comment) (org-columns-quit) @@ -1357,24 +1408,54 @@ an inline src-block." ;;;###autoload (defun org-dblock-write:columnview (params) "Write the column view table. + PARAMS is a property list of parameters: -:id the :ID: property of the entry where the columns view - should be built. When the symbol `local', call locally. - When `global' call column view with the cursor at the beginning - of the buffer (usually this means that the whole buffer switches - to column view). When \"file:path/to/file.org\", invoke column - view at the start of that file. Otherwise, the ID is located - using `org-id-find'. -:hlines When t, insert a hline before each item. When a number, insert - a hline before each level <= that number. -:indent When non-nil, indent each ITEM field according to its level. -:vlines When t, make each column a colgroup to enforce vertical lines. -:maxlevel When set to a number, don't capture headlines below this level. -:skip-empty-rows - When t, skip rows where all specifiers other than ITEM are empty. -:width apply widths specified in columns format using specifiers. -:format When non-nil, specify the column view format to use." +`:id' (mandatory) + + The ID property of the entry where the columns view should be + built. When the symbol `local', call locally. When `global' + call column view with the cursor at the beginning of the + buffer (usually this means that the whole buffer switches to + column view). When \"file:path/to/file.org\", invoke column + view at the start of that file. Otherwise, the ID is located + using `org-id-find'. + +`:exclude-tags' + + List of tags to exclude from column view table. + +`:format' + + When non-nil, specify the column view format to use. + +`:hlines' + + When non-nil, insert a hline before each item. When + a number, insert a hline before each level inferior or equal + to that number. + +`:indent' + + When non-nil, indent each ITEM field according to its level. + +`:match' + + When set to a string, use this as a tags/property match filter. + +`:maxlevel' + + When set to a number, don't capture headlines below this level. + +`:skip-empty-rows' + + When non-nil, skip rows where all specifiers other than ITEM + are empty. + +`:vlines' + + When non-nil, make each column a column group to enforce + vertical lines." (let ((table (let ((id (plist-get params :id)) view-file view-pos) @@ -1397,6 +1478,7 @@ PARAMS is a property list of parameters: (org-with-wide-buffer (when view-pos (goto-char view-pos)) (org-columns--capture-view (plist-get params :maxlevel) + (plist-get params :match) (plist-get params :skip-empty-rows) (plist-get params :format) view-pos)))))) @@ -1429,14 +1511,6 @@ PARAMS is a property list of parameters: (concat "\\_" (make-string (* 2 (1- level)) ?\s) item) item)))) (push (cdr row) new-table)))) - (when (plist-get params :width) - (setq table - (append table - (list - (mapcar (lambda (spec) - (let ((w (nth 2 spec))) - (if w (format "<%d>" (max 3 w)) ""))) - org-columns-current-fmt-compiled))))) (when (plist-get params :vlines) (setq table (let ((size (length org-columns-current-fmt-compiled))) @@ -1494,10 +1568,11 @@ PARAMS is a property list of parameters: (if (markerp org-columns-begin-marker) (move-marker org-columns-begin-marker (point)) (setq org-columns-begin-marker (point-marker))) - (let* ((org-columns--time (float-time (current-time))) + (let* ((org-columns--time (float-time)) (fmt (cond - ((bound-and-true-p org-agenda-overriding-columns-format)) + ((bound-and-true-p org-overriding-columns-format)) + ((bound-and-true-p org-local-columns-format)) ((let ((m (org-get-at-bol 'org-hd-marker))) (and m (or (org-entry-get m "COLUMNS" t) @@ -1616,8 +1691,8 @@ This will add overlays to the date lines, to show the summary for each day." (let ((b (find-buffer-visiting file))) (with-current-buffer (or (buffer-base-buffer b) b) (org-with-wide-buffer - (org-with-silent-modifications - (remove-text-properties (point-min) (point-max) '(org-summaries t))) + (with-silent-modifications + (remove-text-properties (point-min) (point-max) '(org-summaries t))) (goto-char (point-min)) (org-columns-get-format-and-top-level) (dolist (spec fmt) diff --git a/elpa/org-20190930/org-compat.el b/elpa/org-20190930/org-compat.el new file mode 100644 index 00000000..7603f968 --- /dev/null +++ b/elpa/org-20190930/org-compat.el @@ -0,0 +1,1011 @@ +;;; org-compat.el --- Compatibility Code for Older Emacsen -*- lexical-binding: t; -*- + +;; Copyright (C) 2004-2019 Free Software Foundation, Inc. + +;; Author: Carsten Dominik +;; Keywords: outlines, hypermedia, calendar, wp +;; Homepage: https://orgmode.org +;; +;; This file is part of GNU Emacs. +;; +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;;; Commentary: + +;; This file contains code needed for compatibility with older +;; versions of GNU Emacs and integration with other packages. + +;;; Code: + +(require 'cl-lib) +(require 'org-macs) + +(declare-function org-agenda-diary-entry "org-agenda") +(declare-function org-agenda-maybe-redo "org-agenda" ()) +(declare-function org-agenda-remove-restriction-lock "org-agenda" (&optional noupdate)) +(declare-function org-align-tags "org" (&optional all)) +(declare-function org-at-heading-p "org" (&optional ignored)) +(declare-function org-at-table.el-p "org" ()) +(declare-function org-element-at-point "org-element" ()) +(declare-function org-element-context "org-element" (&optional element)) +(declare-function org-element-lineage "org-element" (blob &optional types with-self)) +(declare-function org-element-type "org-element" (element)) +(declare-function org-element-property "org-element" (property element)) +(declare-function org-end-of-subtree "org" (&optional invisible-ok to-heading)) +(declare-function org-get-heading "org" (&optional no-tags no-todo no-priority no-comment)) +(declare-function org-get-tags "org" (&optional pos local)) +(declare-function org-link-display-format "org" (s)) +(declare-function org-link-set-parameters "org" (type &rest rest)) +(declare-function org-log-into-drawer "org" ()) +(declare-function org-make-tag-string "org" (tags)) +(declare-function org-reduced-level "org" (l)) +(declare-function org-show-context "org" (&optional key)) +(declare-function org-table-end "org-table" (&optional table-type)) +(declare-function outline-next-heading "outline" ()) +(declare-function speedbar-line-directory "speedbar" (&optional depth)) +(declare-function table--at-cell-p "table" (position &optional object at-column)) + +(defvar calendar-mode-map) +(defvar org-complex-heading-regexp) +(defvar org-agenda-diary-file) +(defvar org-agenda-overriding-restriction) +(defvar org-agenda-restriction-lock-overlay) +(defvar org-table-any-border-regexp) +(defvar org-table-dataline-regexp) +(defvar org-table-tab-recognizes-table.el) +(defvar org-table1-hline-regexp) + + +;;; Emacs < 27.1 compatibility + +(unless (fboundp 'proper-list-p) + ;; `proper-list-p' was added in Emacs 27.1. The function below is + ;; taken from Emacs subr.el 200195e824b^. + (defun proper-list-p (object) + "Return OBJECT's length if it is a proper list, nil otherwise. +A proper list is neither circular nor dotted (i.e., its last cdr +is nil)." + (and (listp object) (ignore-errors (length object))))) + +(if (fboundp 'xor) + ;; `xor' was added in Emacs 27.1. + (defalias 'org-xor #'xor) + (defsubst org-xor (a b) + "Exclusive `or'." + (if a (not b) b))) + +(unless (fboundp 'pcomplete-uniquify-list) + ;; The misspelled variant was made obsolete in Emacs 27.1 + (defalias 'pcomplete-uniquify-list 'pcomplete-uniqify-list)) + +(if (fboundp 'time-convert) + (progn + (defsubst org-time-convert-to-integer (time) + (time-convert time 'integer)) + (defsubst org-time-convert-to-list (time) + (time-convert time 'list))) + (defun org-time-convert-to-integer (time) + (floor (float-time time))) + (defun org-time-convert-to-list (time) + (seconds-to-time (float-time time)))) + + +;;; Emacs < 26.1 compatibility + +(if (fboundp 'line-number-display-width) + (defalias 'org-line-number-display-width 'line-number-display-width) + (defun org-line-number-display-width (&rest _) 0)) + +(unless (fboundp 'file-attribute-modification-time) + (defsubst file-attribute-modification-time (attributes) + "The modification time in ATTRIBUTES returned by `file-attributes'. +This is the time of the last change to the file's contents, and +is a list of integers (HIGH LOW USEC PSEC) in the same style +as (current-time)." + (nth 5 attributes))) + +(unless (fboundp 'file-attribute-size) + (defsubst file-attribute-size (attributes) + "The size (in bytes) in ATTRIBUTES returned by `file-attributes'. +This is a floating point number if the size is too large for an integer." + (nth 7 attributes))) + + +;;; Emacs < 25.1 compatibility + +(when (< emacs-major-version 25) + (defalias 'outline-hide-entry 'hide-entry) + (defalias 'outline-hide-sublevels 'hide-sublevels) + (defalias 'outline-hide-subtree 'hide-subtree) + (defalias 'outline-show-branches 'show-branches) + (defalias 'outline-show-children 'show-children) + (defalias 'outline-show-entry 'show-entry) + (defalias 'outline-show-subtree 'show-subtree) + (defalias 'xref-find-definitions 'find-tag) + (defalias 'format-message 'format) + (defalias 'gui-get-selection 'x-get-selection)) + +(unless (fboundp 'directory-name-p) + (defun directory-name-p (name) + "Return non-nil if NAME ends with a directory separator character." + (let ((len (length name)) + (lastc ?.)) + (if (> len 0) + (setq lastc (aref name (1- len)))) + (or (= lastc ?/) + (and (memq system-type '(windows-nt ms-dos)) + (= lastc ?\\)))))) + +;; `string-collate-lessp' is new in Emacs 25. +(if (fboundp 'string-collate-lessp) + (defalias 'org-string-collate-lessp + 'string-collate-lessp) + (defun org-string-collate-lessp (s1 s2 &rest _) + "Return non-nil if STRING1 is less than STRING2 in lexicographic order. +Case is significant." + (string< s1 s2))) + +;; The time- functions below translate nil to `current-time` and +;; accept an integer as of Emacs 25. `decode-time` and +;; `format-time-string` accept nil on Emacs 24 but don't accept an +;; integer until Emacs 25. +(if (< emacs-major-version 25) + (let ((convert + (lambda (time) + (cond ((not time) (current-time)) + ((numberp time) (seconds-to-time time)) + (t time))))) + (defun org-decode-time (&optional time) + (decode-time (funcall convert time))) + (defun org-format-time-string (format-string &optional time universal) + (format-time-string format-string (funcall convert time) universal)) + (defun org-time-add (a b) + (time-add (funcall convert a) (funcall convert b))) + (defun org-time-subtract (a b) + (time-subtract (funcall convert a) (funcall convert b))) + (defun org-time-since (time) + (time-since (funcall convert time))) + (defun org-time-less-p (t1 t2) + (time-less-p (funcall convert t1) (funcall convert t2)))) + (defalias 'org-decode-time 'decode-time) + (defalias 'org-format-time-string 'format-time-string) + (defalias 'org-time-add 'time-add) + (defalias 'org-time-subtract 'time-subtract) + (defalias 'org-time-since 'time-since) + (defalias 'org-time-less-p 'time-less-p)) + + +;;; Obsolete aliases (remove them after the next major release). + +;;;; XEmacs compatibility, now removed. +(define-obsolete-function-alias 'org-activate-mark 'activate-mark "Org 9.0") +(define-obsolete-function-alias 'org-add-hook 'add-hook "Org 9.0") +(define-obsolete-function-alias 'org-bound-and-true-p 'bound-and-true-p "Org 9.0") +(define-obsolete-function-alias 'org-decompose-region 'decompose-region "Org 9.0") +(define-obsolete-function-alias 'org-defvaralias 'defvaralias "Org 9.0") +(define-obsolete-function-alias 'org-detach-overlay 'delete-overlay "Org 9.0") +(define-obsolete-function-alias 'org-file-equal-p 'file-equal-p "Org 9.0") +(define-obsolete-function-alias 'org-float-time 'float-time "Org 9.0") +(define-obsolete-function-alias 'org-indent-line-to 'indent-line-to "Org 9.0") +(define-obsolete-function-alias 'org-indent-to-column 'indent-to-column "Org 9.0") +(define-obsolete-function-alias 'org-looking-at-p 'looking-at-p "Org 9.0") +(define-obsolete-function-alias 'org-looking-back 'looking-back "Org 9.0") +(define-obsolete-function-alias 'org-match-string-no-properties 'match-string-no-properties "Org 9.0") +(define-obsolete-function-alias 'org-propertize 'propertize "Org 9.0") +(define-obsolete-function-alias 'org-select-frame-set-input-focus 'select-frame-set-input-focus "Org 9.0") +(define-obsolete-function-alias 'org-file-remote-p 'file-remote-p "Org 9.2") + +(defmacro org-re (s) + "Replace posix classes in regular expression S." + (declare (debug (form)) + (obsolete "you can safely remove it." "Org 9.0")) + s) + +;;;; Functions from cl-lib that Org used to have its own implementation of. +(define-obsolete-function-alias 'org-count 'cl-count "Org 9.0") +(define-obsolete-function-alias 'org-every 'cl-every "Org 9.0") +(define-obsolete-function-alias 'org-find-if 'cl-find-if "Org 9.0") +(define-obsolete-function-alias 'org-reduce 'cl-reduce "Org 9.0") +(define-obsolete-function-alias 'org-remove-if 'cl-remove-if "Org 9.0") +(define-obsolete-function-alias 'org-remove-if-not 'cl-remove-if-not "Org 9.0") +(define-obsolete-function-alias 'org-some 'cl-some "Org 9.0") +(define-obsolete-function-alias 'org-floor* 'cl-floor "Org 9.0") + +(defun org-sublist (list start end) + "Return a section of LIST, from START to END. +Counting starts at 1." + (cl-subseq list (1- start) end)) +(make-obsolete 'org-sublist + "use cl-subseq (note the 0-based counting)." + "Org 9.0") + + +;;;; Functions available since Emacs 24.3 +(define-obsolete-function-alias 'org-buffer-narrowed-p 'buffer-narrowed-p "Org 9.0") +(define-obsolete-function-alias 'org-called-interactively-p 'called-interactively-p "Org 9.0") +(define-obsolete-function-alias 'org-char-to-string 'char-to-string "Org 9.0") +(define-obsolete-function-alias 'org-delete-directory 'delete-directory "Org 9.0") +(define-obsolete-function-alias 'org-format-seconds 'format-seconds "Org 9.0") +(define-obsolete-function-alias 'org-link-escape-browser 'url-encode-url "Org 9.0") +(define-obsolete-function-alias 'org-no-warnings 'with-no-warnings "Org 9.0") +(define-obsolete-function-alias 'org-number-sequence 'number-sequence "Org 9.0") +(define-obsolete-function-alias 'org-pop-to-buffer-same-window 'pop-to-buffer-same-window "Org 9.0") +(define-obsolete-function-alias 'org-string-match-p 'string-match-p "Org 9.0") + +;;;; Functions and variables from previous releases now obsolete. +(define-obsolete-function-alias 'org-element-remove-indentation + 'org-remove-indentation "Org 9.0") +(define-obsolete-variable-alias 'org-latex-create-formula-image-program + 'org-preview-latex-default-process "Org 9.0") +(define-obsolete-variable-alias 'org-latex-preview-ltxpng-directory + 'org-preview-latex-image-directory "Org 9.0") +(define-obsolete-function-alias 'org-table-p 'org-at-table-p "Org 9.0") +(define-obsolete-function-alias 'org-on-heading-p 'org-at-heading-p "Org 9.0") +(define-obsolete-function-alias 'org-at-regexp-p 'org-in-regexp "Org 8.3") +(define-obsolete-function-alias 'org-image-file-name-regexp + 'image-file-name-regexp "Org 9.0") +(define-obsolete-function-alias 'org-completing-read-no-i + 'completing-read "Org 9.0") +(define-obsolete-function-alias 'org-icompleting-read + 'completing-read "Org 9.0") +(define-obsolete-function-alias 'org-iread-file-name 'read-file-name "Org 9.0") +(define-obsolete-function-alias 'org-days-to-time + 'org-time-stamp-to-now "Org 8.2") +(define-obsolete-variable-alias 'org-agenda-ignore-drawer-properties + 'org-agenda-ignore-properties "Org 9.0") +(define-obsolete-function-alias 'org-preview-latex-fragment + 'org-toggle-latex-fragment "Org 8.3") +(define-obsolete-function-alias 'org-export-get-genealogy + 'org-element-lineage "Org 9.0") +(define-obsolete-variable-alias 'org-latex-with-hyperref + 'org-latex-hyperref-template "Org 9.0") +(define-obsolete-variable-alias 'hfy-optimisations 'hfy-optimizations "Org 9.0") +(define-obsolete-variable-alias 'org-export-htmlized-org-css-url + 'org-org-htmlized-css-url "Org 8.2") +(define-obsolete-function-alias 'org-list-parse-list 'org-list-to-lisp "Org 9.0") +(define-obsolete-function-alias 'org-agenda-todayp + 'org-agenda-today-p "Org 9.0") +(define-obsolete-function-alias 'org-babel-examplize-region + 'org-babel-examplify-region "Org 9.0") +(define-obsolete-variable-alias 'org-babel-capitalize-example-region-markers + 'org-babel-uppercase-example-markers "Org 9.1") + +(define-obsolete-function-alias 'org-babel-trim 'org-trim "Org 9.0") +(define-obsolete-variable-alias 'org-html-style 'org-html-head "24.4") +(define-obsolete-function-alias 'org-insert-columns-dblock + 'org-columns-insert-dblock "Org 9.0") +(define-obsolete-variable-alias 'org-export-babel-evaluate + 'org-export-use-babel "Org 9.1") +(define-obsolete-function-alias 'org-activate-bracket-links + 'org-activate-links "Org 9.0") +(define-obsolete-function-alias 'org-activate-plain-links 'ignore "Org 9.0") +(define-obsolete-function-alias 'org-activate-angle-links 'ignore "Org 9.0") +(define-obsolete-function-alias 'org-remove-double-quotes 'org-strip-quotes "Org 9.0") +(define-obsolete-function-alias 'org-get-indentation + 'current-indentation "Org 9.2") +(define-obsolete-function-alias 'org-capture-member 'org-capture-get "Org 9.2") +(define-obsolete-function-alias 'org-remove-from-invisibility-spec + 'remove-from-invisibility-spec "Org 9.2") + +(define-obsolete-variable-alias 'org-effort-durations 'org-duration-units + "Org 9.2") + +(defun org-in-fixed-width-region-p () + "Non-nil if point in a fixed-width region." + (save-match-data + (eq 'fixed-width (org-element-type (org-element-at-point))))) +(make-obsolete 'org-in-fixed-width-region-p + "use `org-element' library" + "Org 9.0") + +(defun org-compatible-face (inherits specs) + "Make a compatible face specification. +If INHERITS is an existing face and if the Emacs version supports +it, just inherit the face. If INHERITS is not given and SPECS +is, use SPECS to define the face." + (declare (indent 1)) + (if (facep inherits) + (list (list t :inherit inherits)) + specs)) +(make-obsolete 'org-compatible-face "you can remove it." "Org 9.0") + +(defun org-add-link-type (type &optional follow export) + "Add a new TYPE link. +FOLLOW and EXPORT are two functions. + +FOLLOW should take the link path as the single argument and do whatever +is necessary to follow the link, for example find a file or display +a mail message. + +EXPORT should format the link path for export to one of the export formats. +It should be a function accepting three arguments: + + path the path of the link, the text after the prefix (like \"http:\") + desc the description of the link, if any + format the export format, a symbol like `html' or `latex' or `ascii'. + +The function may use the FORMAT information to return different values +depending on the format. The return value will be put literally into +the exported file. If the return value is nil, this means Org should +do what it normally does with links which do not have EXPORT defined. + +Org mode has a built-in default for exporting links. If you are happy with +this default, there is no need to define an export function for the link +type. For a simple example of an export function, see `org-bbdb.el'. + +If TYPE already exists, update it with the arguments. +See `org-link-parameters' for documentation on the other parameters." + (org-link-set-parameters type :follow follow :export export) + (message "Created %s link." type)) + +(make-obsolete 'org-add-link-type "use `org-link-set-parameters' instead." "Org 9.0") + +;;;; Functions unused in Org core. +(defun org-table-recognize-table.el () + "If there is a table.el table nearby, recognize it and move into it." + (when (and org-table-tab-recognizes-table.el (org-at-table.el-p)) + (beginning-of-line) + (unless (or (looking-at org-table-dataline-regexp) + (not (looking-at org-table1-hline-regexp))) + (forward-line) + (when (looking-at org-table-any-border-regexp) + (forward-line -2))) + (if (re-search-forward "|" (org-table-end t) t) + (progn + (require 'table) + (if (table--at-cell-p (point)) t + (message "recognizing table.el table...") + (table-recognize-table) + (message "recognizing table.el table...done"))) + (error "This should not happen")))) + +;; Not used since commit 6d1e3082, Feb 2010. +(make-obsolete 'org-table-recognize-table.el + "please notify Org mailing list if you use this function." + "Org 9.0") + +(defmacro org-preserve-lc (&rest body) + (declare (debug (body)) + (obsolete "please notify Org mailing list if you use this function." + "Org 9.2")) + (org-with-gensyms (line col) + `(let ((,line (org-current-line)) + (,col (current-column))) + (unwind-protect + (progn ,@body) + (org-goto-line ,line) + (org-move-to-column ,col))))) + +(defun org-version-check (version &rest _) + "Non-nil if VERSION is lower (older) than `emacs-version'." + (declare (obsolete "use `version<' or `fboundp' instead." + "Org 9.2")) + (version< version emacs-version)) + +(defun org-remove-angle-brackets (s) + (org-unbracket-string "<" ">" s)) +(make-obsolete 'org-remove-angle-brackets 'org-unbracket-string "Org 9.0") + +(defcustom org-publish-sitemap-file-entry-format "%t" + "Format string for site-map file entry. +You could use brackets to delimit on what part the link will be. + +%t is the title. +%a is the author. +%d is the date formatted using `org-publish-sitemap-date-format'." + :group 'org-export-publish + :type 'string) +(make-obsolete-variable + 'org-publish-sitemap-file-entry-format + "set `:sitemap-format-entry' in `org-publish-project-alist' instead." + "Org 9.1") + +(defvar org-agenda-skip-regexp) +(defun org-agenda-skip-entry-when-regexp-matches () + "Check if the current entry contains match for `org-agenda-skip-regexp'. +If yes, it returns the end position of this entry, causing agenda commands +to skip the entry but continuing the search in the subtree. This is a +function that can be put into `org-agenda-skip-function' for the duration +of a command." + (declare (obsolete "use `org-agenda-skip-if' instead." "Org 9.1")) + (let ((end (save-excursion (org-end-of-subtree t))) + skip) + (save-excursion + (setq skip (re-search-forward org-agenda-skip-regexp end t))) + (and skip end))) + +(defun org-agenda-skip-subtree-when-regexp-matches () + "Check if the current subtree contains match for `org-agenda-skip-regexp'. +If yes, it returns the end position of this tree, causing agenda commands +to skip this subtree. This is a function that can be put into +`org-agenda-skip-function' for the duration of a command." + (declare (obsolete "use `org-agenda-skip-if' instead." "Org 9.1")) + (let ((end (save-excursion (org-end-of-subtree t))) + skip) + (save-excursion + (setq skip (re-search-forward org-agenda-skip-regexp end t))) + (and skip end))) + +(defun org-agenda-skip-entry-when-regexp-matches-in-subtree () + "Check if the current subtree contains match for `org-agenda-skip-regexp'. +If yes, it returns the end position of the current entry (NOT the tree), +causing agenda commands to skip the entry but continuing the search in +the subtree. This is a function that can be put into +`org-agenda-skip-function' for the duration of a command. An important +use of this function is for the stuck project list." + (declare (obsolete "use `org-agenda-skip-if' instead." "Org 9.1")) + (let ((end (save-excursion (org-end-of-subtree t))) + (entry-end (save-excursion (outline-next-heading) (1- (point)))) + skip) + (save-excursion + (setq skip (re-search-forward org-agenda-skip-regexp end t))) + (and skip entry-end))) + +(define-obsolete-function-alias 'org-minutes-to-clocksum-string + 'org-duration-from-minutes "Org 9.1") + +(define-obsolete-function-alias 'org-hh:mm-string-to-minutes + 'org-duration-to-minutes "Org 9.1") + +(define-obsolete-function-alias 'org-duration-string-to-minutes + 'org-duration-to-minutes "Org 9.1") + +(make-obsolete-variable 'org-time-clocksum-format + "set `org-duration-format' instead." "Org 9.1") + +(make-obsolete-variable 'org-time-clocksum-use-fractional + "set `org-duration-format' instead." "Org 9.1") + +(make-obsolete-variable 'org-time-clocksum-fractional-format + "set `org-duration-format' instead." "Org 9.1") + +(make-obsolete-variable 'org-time-clocksum-use-effort-durations + "set `org-duration-units' instead." "Org 9.1") + +(define-obsolete-function-alias 'org-babel-number-p + 'org-babel--string-to-number "Org 9.0") + +(define-obsolete-variable-alias 'org-usenet-links-prefer-google + 'org-gnus-prefer-web-links "Org 9.1") + +(define-obsolete-variable-alias 'org-texinfo-def-table-markup + 'org-texinfo-table-default-markup "Org 9.1") + +(define-obsolete-variable-alias 'org-agenda-overriding-columns-format + 'org-overriding-columns-format "Org 9.2.2") + +;; The function was made obsolete by commit 65399674d5 of 2013-02-22. +;; This make-obsolete call was added 2016-09-01. +(make-obsolete 'org-capture-import-remember-templates + "use the `org-capture-templates' variable instead." + "Org 9.0") + +(defun org-show-block-all () + "Unfold all blocks in the current buffer." + (interactive) + (remove-overlays nil nil 'invisible 'org-hide-block)) + +(make-obsolete 'org-show-block-all + "use `org-show-all' instead." + "Org 9.2") + +(define-obsolete-function-alias 'org-get-tags-at 'org-get-tags "Org 9.2") + +(defun org-get-local-tags () + "Get a list of tags defined in the current headline." + (declare (obsolete "use `org-get-tags' instead." "Org 9.2")) + (org-get-tags nil 'local)) + +(defun org-get-local-tags-at (&optional pos) + "Get a list of tags defined in the current headline." + (declare (obsolete "use `org-get-tags' instead." "Org 9.2")) + (org-get-tags pos 'local)) + +(defun org-get-tags-string () + "Get the TAGS string in the current headline." + (declare (obsolete "use `org-make-tag-string' instead." "Org 9.2")) + (org-make-tag-string (org-get-tags nil t))) + +(define-obsolete-function-alias 'org-set-tags-to 'org-set-tags "Org 9.2") + +(defun org-align-all-tags () + "Align the tags in all headings." + (declare (obsolete "use `org-align-tags' instead." "Org 9.2")) + (org-align-tags t)) + +(defmacro org-with-silent-modifications (&rest body) + (declare (obsolete "use `with-silent-modifications' instead." "Org 9.2") + (debug (body))) + `(with-silent-modifications ,@body)) + +(define-obsolete-function-alias 'org-babel-strip-quotes + 'org-strip-quotes "Org 9.2") + +;;;; Obsolete link types + +(eval-after-load 'org + '(progn + (org-link-set-parameters "file+emacs") ;since Org 9.0 + (org-link-set-parameters "file+sys"))) ;since Org 9.0 + + + +;;; Miscellaneous functions + +(defun org-get-x-clipboard (value) + "Get the value of the X or Windows clipboard." + (cond ((and (eq window-system 'x) + (fboundp 'gui-get-selection)) ;Silence byte-compiler. + (org-no-properties + (ignore-errors + (or (gui-get-selection value 'UTF8_STRING) + (gui-get-selection value 'COMPOUND_TEXT) + (gui-get-selection value 'STRING) + (gui-get-selection value 'TEXT))))) + ((and (eq window-system 'w32) (fboundp 'w32-get-clipboard-data)) + (w32-get-clipboard-data)))) + +;; `set-transient-map' is only in Emacs >= 24.4 +(defalias 'org-set-transient-map + (if (fboundp 'set-transient-map) + 'set-transient-map + 'set-temporary-overlay-map)) + + +;;; Region compatibility + +(defvar org-ignore-region nil + "Non-nil means temporarily disable the active region.") + +(defun org-region-active-p () + "Non-nil when the region active. +Unlike to `use-region-p', this function also checks +`org-ignore-region'." + (and (not org-ignore-region) (use-region-p))) + +(defun org-cursor-to-region-beginning () + (when (and (org-region-active-p) + (> (point) (region-beginning))) + (exchange-point-and-mark))) + + +;;; Invisibility compatibility + +(defun org-in-invisibility-spec-p (arg) + "Is ARG a member of `buffer-invisibility-spec'?" + (when (consp buffer-invisibility-spec) + (member arg buffer-invisibility-spec))) + +(defun org-move-to-column (column &optional force _buffer) + "Move to column COLUMN. +Pass COLUMN and FORCE to `move-to-column'." + (let ((buffer-invisibility-spec + (if (listp buffer-invisibility-spec) + (remove '(org-filtered) buffer-invisibility-spec) + buffer-invisibility-spec))) + (move-to-column column force))) + +(defmacro org-find-library-dir (library) + `(file-name-directory (or (locate-library ,library) ""))) + +(defun org-count-lines (s) + "How many lines in string S?" + (let ((start 0) (n 1)) + (while (string-match "\n" s start) + (setq start (match-end 0) n (1+ n))) + (when (and (> (length s) 0) (= (aref s (1- (length s))) ?\n)) + (setq n (1- n))) + n)) + +(defun org-kill-new (string &rest args) + (remove-text-properties 0 (length string) '(line-prefix t wrap-prefix t) + string) + (apply 'kill-new string args)) + +;; `font-lock-ensure' is only available from 24.4.50 on +(defalias 'org-font-lock-ensure + (if (fboundp 'font-lock-ensure) + #'font-lock-ensure + (lambda (&optional _beg _end) + (with-no-warnings (font-lock-fontify-buffer))))) + +;; `file-local-name' was added in Emacs 26.1. +(defalias 'org-babel-local-file-name + (if (fboundp 'file-local-name) + 'file-local-name + (lambda (file) + "Return the local name component of FILE." + (or (file-remote-p file 'localname) file)))) + +;;;###autoload +(defmacro org-check-version () + "Try very hard to provide sensible version strings." + (let* ((org-dir (org-find-library-dir "org")) + (org-version.el (concat org-dir "org-version.el")) + (org-fixup.el (concat org-dir "../mk/org-fixup.el"))) + (if (require 'org-version org-version.el 'noerror) + '(progn + (autoload 'org-release "org-version.el") + (autoload 'org-git-version "org-version.el")) + (if (require 'org-fixup org-fixup.el 'noerror) + '(org-fixup) + ;; provide fallback definitions and complain + (warn "Could not define org version correctly. Check installation!") + '(progn + (defun org-release () "N/A") + (defun org-git-version () "N/A !!check installation!!")))))) + + + +;;; Functions for Emacs < 24.4 compatibility + +(defun org-define-error (name message) + "Define NAME as a new error signal. +MESSAGE is a string that will be output to the echo area if such +an error is signaled without being caught by a `condition-case'. +Implements `define-error' for older emacsen." + (if (fboundp 'define-error) (define-error name message) + (put name 'error-conditions + (copy-sequence (cons name (get 'error 'error-conditions)))))) + +(unless (fboundp 'string-suffix-p) + ;; From Emacs subr.el. + (defun string-suffix-p (suffix string &optional ignore-case) + "Return non-nil if SUFFIX is a suffix of STRING. +If IGNORE-CASE is non-nil, the comparison is done without paying +attention to case differences." + (let ((start-pos (- (length string) (length suffix)))) + (and (>= start-pos 0) + (eq t (compare-strings suffix nil nil + string start-pos nil ignore-case)))))) + + +;;; Integration with and fixes for other packages + +(defgroup org-imenu-and-speedbar nil + "Options concerning imenu and speedbar in Org mode." + :tag "Org Imenu and Speedbar" + :group 'org-structure) + +(defcustom org-imenu-depth 2 + "The maximum level for Imenu access to Org headlines. +This also applied for speedbar access." + :group 'org-imenu-and-speedbar + :type 'integer) + +;;;; Imenu + +(defvar-local org-imenu-markers nil + "All markers currently used by Imenu.") + +(defun org-imenu-get-tree () + "Produce the index for Imenu." + (dolist (x org-imenu-markers) (move-marker x nil)) + (setq org-imenu-markers nil) + (org-with-wide-buffer + (goto-char (point-max)) + (let* ((re (concat "^" (org-get-limited-outline-regexp))) + (subs (make-vector (1+ org-imenu-depth) nil)) + (last-level 0)) + (while (re-search-backward re nil t) + (let ((level (org-reduced-level (funcall outline-level))) + (headline (org-no-properties + (org-link-display-format (org-get-heading t t t t))))) + (when (and (<= level org-imenu-depth) (org-string-nw-p headline)) + (let* ((m (point-marker)) + (item (propertize headline 'org-imenu-marker m 'org-imenu t))) + (push m org-imenu-markers) + (if (>= level last-level) + (push (cons item m) (aref subs level)) + (push (cons item + (cl-mapcan #'identity (cl-subseq subs (1+ level)))) + (aref subs level)) + (cl-loop for i from (1+ level) to org-imenu-depth + do (aset subs i nil))) + (setq last-level level))))) + (aref subs 1)))) + +(eval-after-load "imenu" + '(progn + (add-hook 'imenu-after-jump-hook + (lambda () + (when (derived-mode-p 'org-mode) + (org-show-context 'org-goto)))) + (add-hook 'org-mode-hook + (lambda () + (setq imenu-create-index-function 'org-imenu-get-tree))))) + +;;;; Speedbar + +(defvar org-speedbar-restriction-lock-overlay (make-overlay 1 1) + "Overlay marking the agenda restriction line in speedbar.") +(overlay-put org-speedbar-restriction-lock-overlay + 'face 'org-agenda-restriction-lock) +(overlay-put org-speedbar-restriction-lock-overlay + 'help-echo "Agendas are currently limited to this item.") +(delete-overlay org-speedbar-restriction-lock-overlay) + +(defun org-speedbar-set-agenda-restriction () + "Restrict future agenda commands to the location at point in speedbar. +If there is already a restriction lock at the location, remove it. + +To get rid of the restriction, use `\\[org-agenda-remove-restriction-lock]'." + (interactive) + (require 'org-agenda) + (let (p m tp np dir txt) + (cond + ((setq p (text-property-any (point-at-bol) (point-at-eol) + 'org-imenu t)) + (setq m (get-text-property p 'org-imenu-marker)) + (with-current-buffer (marker-buffer m) + (goto-char m) + (if (and org-agenda-overriding-restriction + (member org-agenda-restriction-lock-overlay + (overlays-at (point)))) + (org-agenda-remove-restriction-lock 'noupdate) + (org-agenda-set-restriction-lock 'subtree)))) + ((setq p (text-property-any (point-at-bol) (point-at-eol) + 'speedbar-function 'speedbar-find-file)) + (setq tp (previous-single-property-change + (1+ p) 'speedbar-function) + np (next-single-property-change + tp 'speedbar-function) + dir (speedbar-line-directory) + txt (buffer-substring-no-properties (or tp (point-min)) + (or np (point-max)))) + (with-current-buffer (find-file-noselect + (let ((default-directory dir)) + (expand-file-name txt))) + (unless (derived-mode-p 'org-mode) + (user-error "Cannot restrict to non-Org mode file")) + (org-agenda-set-restriction-lock 'file))) + (t (user-error "Don't know how to restrict Org mode agenda"))) + (move-overlay org-speedbar-restriction-lock-overlay + (point-at-bol) (point-at-eol)) + (setq current-prefix-arg nil) + (org-agenda-maybe-redo))) + +(defvar speedbar-file-key-map) +(declare-function speedbar-add-supported-extension "speedbar" (extension)) +(eval-after-load "speedbar" + '(progn + (speedbar-add-supported-extension ".org") + (define-key speedbar-file-key-map "<" 'org-speedbar-set-agenda-restriction) + (define-key speedbar-file-key-map "\C-c\C-x<" 'org-speedbar-set-agenda-restriction) + (define-key speedbar-file-key-map ">" 'org-agenda-remove-restriction-lock) + (define-key speedbar-file-key-map "\C-c\C-x>" 'org-agenda-remove-restriction-lock) + (add-hook 'speedbar-visiting-tag-hook + (lambda () (and (derived-mode-p 'org-mode) (org-show-context 'org-goto)))))) + +;;;; Add Log + +(defun org-add-log-current-headline () + "Return current headline or nil. +This function ignores inlinetasks. It is meant to be used as +`add-log-current-defun-function' value." + (org-with-limited-levels (org-get-heading t t t t))) + +;;;; Flyspell + +(defun org--flyspell-object-check-p (element) + "Non-nil when Flyspell can check object at point. +ELEMENT is the element at point." + (let ((object (save-excursion + (when (looking-at-p "\\>") (backward-char)) + (org-element-context element)))) + (cl-case (org-element-type object) + ;; Prevent checks in links due to keybinding conflict with + ;; Flyspell. + ((code entity export-snippet inline-babel-call + inline-src-block line-break latex-fragment link macro + statistics-cookie target timestamp verbatim) + nil) + (footnote-reference + ;; Only in inline footnotes, within the definition. + (and (eq (org-element-property :type object) 'inline) + (< (save-excursion + (goto-char (org-element-property :begin object)) + (search-forward ":" nil t 2)) + (point)))) + (otherwise t)))) + +(defun org-mode-flyspell-verify () + "Function used for `flyspell-generic-check-word-predicate'." + (if (org-at-heading-p) + ;; At a headline or an inlinetask, check title only. This is + ;; faster than relying on `org-element-at-point'. + (and (save-excursion (beginning-of-line) + (and (let ((case-fold-search t)) + (not (looking-at-p "\\*+ END[ \t]*$"))) + (let ((case-fold-search nil)) + (looking-at org-complex-heading-regexp)))) + (match-beginning 4) + (>= (point) (match-beginning 4)) + (or (not (match-beginning 5)) + (< (point) (match-beginning 5)))) + (let* ((element (org-element-at-point)) + (post-affiliated (org-element-property :post-affiliated element))) + (cond + ;; Ignore checks in all affiliated keywords but captions. + ((< (point) post-affiliated) + (and (save-excursion + (beginning-of-line) + (let ((case-fold-search t)) (looking-at "[ \t]*#\\+CAPTION:"))) + (> (point) (match-end 0)) + (org--flyspell-object-check-p element))) + ;; Ignore checks in LOGBOOK (or equivalent) drawer. + ((let ((log (org-log-into-drawer))) + (and log + (let ((drawer (org-element-lineage element '(drawer)))) + (and drawer + (eq (compare-strings + log nil nil + (org-element-property :drawer-name drawer) nil nil t) + t))))) + nil) + (t + (cl-case (org-element-type element) + ((comment quote-section) t) + (comment-block + ;; Allow checks between block markers, not on them. + (and (> (line-beginning-position) post-affiliated) + (save-excursion + (end-of-line) + (skip-chars-forward " \r\t\n") + (< (point) (org-element-property :end element))))) + ;; Arbitrary list of keywords where checks are meaningful. + ;; Make sure point is on the value part of the element. + (keyword + (and (member (org-element-property :key element) + '("DESCRIPTION" "TITLE")) + (save-excursion + (search-backward ":" (line-beginning-position) t)))) + ;; Check is globally allowed in paragraphs verse blocks and + ;; table rows (after affiliated keywords) but some objects + ;; must not be affected. + ((paragraph table-row verse-block) + (let ((cbeg (org-element-property :contents-begin element)) + (cend (org-element-property :contents-end element))) + (and cbeg (>= (point) cbeg) (< (point) cend) + (org--flyspell-object-check-p element)))))))))) +(put 'org-mode 'flyspell-mode-predicate 'org-mode-flyspell-verify) + +(defun org-remove-flyspell-overlays-in (beg end) + "Remove flyspell overlays in region." + (and (bound-and-true-p flyspell-mode) + (fboundp 'flyspell-delete-region-overlays) + (flyspell-delete-region-overlays beg end))) + +(defvar flyspell-delayed-commands) +(eval-after-load "flyspell" + '(add-to-list 'flyspell-delayed-commands 'org-self-insert-command)) + +;;;; Bookmark + +(defun org-bookmark-jump-unhide () + "Unhide the current position, to show the bookmark location." + (and (derived-mode-p 'org-mode) + (or (org-invisible-p) + (save-excursion (goto-char (max (point-min) (1- (point)))) + (org-invisible-p))) + (org-show-context 'bookmark-jump))) + +;; Make `bookmark-jump' shows the jump location if it was hidden. +(eval-after-load "bookmark" + '(if (boundp 'bookmark-after-jump-hook) + ;; We can use the hook + (add-hook 'bookmark-after-jump-hook 'org-bookmark-jump-unhide) + ;; Hook not available, use advice + (defadvice bookmark-jump (after org-make-visible activate) + "Make the position visible." + (org-bookmark-jump-unhide)))) + +;;;; Calendar + +(defcustom org-calendar-to-agenda-key 'default + "Key to be installed in `calendar-mode-map' for switching to the agenda. + +The command `org-calendar-goto-agenda' will be bound to this key. + +When set to `default', bind the function to `c', but only if it is +available in the Calendar keymap. This is the default choice because +`c' can then be used to switch back and forth between agenda and calendar. + +When nil, `org-calendar-goto-agenda' is not bound to any key." + :group 'org-agenda + :type '(choice + (const :tag "Bind to `c' if available" default) + (key-sequence :tag "Other binding") + (const :tag "No binding" nil)) + :safe (lambda (v) (or (symbolp v) (stringp v))) + :package-version '(Org . "9.2")) + +(defcustom org-calendar-insert-diary-entry-key [?i] + "The key to be installed in `calendar-mode-map' for adding diary entries. +This option is irrelevant until `org-agenda-diary-file' has been configured +to point to an Org file. When that is the case, the command +`org-agenda-diary-entry' will be bound to the key given here, by default +`i'. In the calendar, `i' normally adds entries to `diary-file'. So +if you want to continue doing this, you need to change this to a different +key." + :group 'org-agenda + :type 'sexp) + +(defun org--setup-calendar-bindings () + "Bind Org functions in Calendar keymap." + (pcase org-calendar-to-agenda-key + (`nil nil) + ((and key (pred stringp)) + (local-set-key (kbd key) #'org-calendar-goto-agenda)) + ((guard (not (lookup-key calendar-mode-map "c"))) + (local-set-key "c" #'org-calendar-goto-agenda)) + (_ nil)) + (unless (eq org-agenda-diary-file 'diary-file) + (local-set-key org-calendar-insert-diary-entry-key + #'org-agenda-diary-entry))) + +(eval-after-load "calendar" + '(add-hook 'calendar-mode-hook #'org--setup-calendar-bindings)) + +;;;; Saveplace + +;; Make sure saveplace shows the location if it was hidden +(eval-after-load "saveplace" + '(defadvice save-place-find-file-hook (after org-make-visible activate) + "Make the position visible." + (org-bookmark-jump-unhide))) + +;;;; Ecb + +;; Make sure ecb shows the location if it was hidden +(eval-after-load "ecb" + '(defadvice ecb-method-clicked (after esf/org-show-context activate) + "Make hierarchy visible when jumping into location from ECB tree buffer." + (when (derived-mode-p 'org-mode) + (org-show-context)))) + +;;;; Simple + +(defun org-mark-jump-unhide () + "Make the point visible with `org-show-context' after jumping to the mark." + (when (and (derived-mode-p 'org-mode) + (org-invisible-p)) + (org-show-context 'mark-goto))) + +(eval-after-load "simple" + '(defadvice pop-to-mark-command (after org-make-visible activate) + "Make the point visible with `org-show-context'." + (org-mark-jump-unhide))) + +(eval-after-load "simple" + '(defadvice exchange-point-and-mark (after org-make-visible activate) + "Make the point visible with `org-show-context'." + (org-mark-jump-unhide))) + +(eval-after-load "simple" + '(defadvice pop-global-mark (after org-make-visible activate) + "Make the point visible with `org-show-context'." + (org-mark-jump-unhide))) + +;;;; Session + +;; Make "session.el" ignore our circular variable. +(defvar session-globals-exclude) +(eval-after-load "session" + '(add-to-list 'session-globals-exclude 'org-mark-ring)) + +(provide 'org-compat) + +;;; org-compat.el ends here diff --git a/elpa/org-20171030/org-crypt.el b/elpa/org-20190930/org-crypt.el similarity index 99% rename from elpa/org-20171030/org-crypt.el rename to elpa/org-20190930/org-crypt.el index 48c3ff0a..9cd76c9e 100644 --- a/elpa/org-20171030/org-crypt.el +++ b/elpa/org-20190930/org-crypt.el @@ -1,5 +1,5 @@ ;;; org-crypt.el --- Public Key Encryption for Org Entries -*- lexical-binding: t; -*- -;; Copyright (C) 2007-2017 Free Software Foundation, Inc. +;; Copyright (C) 2007-2019 Free Software Foundation, Inc. ;; Emacs Lisp Archive Entry ;; Filename: org-crypt.el diff --git a/elpa/org-20171030/org-ctags.el b/elpa/org-20190930/org-ctags.el similarity index 98% rename from elpa/org-20171030/org-ctags.el rename to elpa/org-20190930/org-ctags.el index fe6caf20..111be379 100644 --- a/elpa/org-20171030/org-ctags.el +++ b/elpa/org-20190930/org-ctags.el @@ -1,6 +1,6 @@ ;;; org-ctags.el - Integrate Emacs "tags" Facility with Org -*- lexical-binding: t; -*- ;; -;; Copyright (C) 2007-2017 Free Software Foundation, Inc. +;; Copyright (C) 2007-2019 Free Software Foundation, Inc. ;; Author: Paul Sexton @@ -137,6 +137,7 @@ ;;; Code: +(eval-when-compile (require 'cl-lib)) (require 'org) (defgroup org-ctags nil @@ -235,7 +236,7 @@ buffer position where the tag is found." (with-current-buffer (get-file-buffer tags-file-name) (goto-char (point-min)) (cond - ((re-search-forward (format "^.*%s\\([0-9]+\\),\\([0-9]+\\)$" + ((re-search-forward (format "^.*\^?%s\^A\\([0-9]+\\),\\([0-9]+\\)$" (regexp-quote tag)) nil t) (let ((line (string-to-number (match-string 1))) (pos (string-to-number (match-string 2)))) @@ -260,7 +261,7 @@ Return the list." (visit-tags-table-buffer 'same) (with-current-buffer (get-file-buffer tags-file-name) (goto-char (point-min)) - (while (re-search-forward "^.*\\(.*\\)\\([0-9]+\\),\\([0-9]+\\)$" + (while (re-search-forward "^.*\^?\\(.*\\)\^A\\([0-9]+\\),\\([0-9]+\\)$" nil t) (push (substring-no-properties (match-string 1)) taglist))) taglist))) diff --git a/elpa/org-20171030/org-datetree.el b/elpa/org-20190930/org-datetree.el similarity index 96% rename from elpa/org-20171030/org-datetree.el rename to elpa/org-20190930/org-datetree.el index 6d1926bc..b4797de1 100644 --- a/elpa/org-20171030/org-datetree.el +++ b/elpa/org-20190930/org-datetree.el @@ -1,10 +1,10 @@ ;;; org-datetree.el --- Create date entries in a tree -*- lexical-binding: t; -*- -;; Copyright (C) 2009-2017 Free Software Foundation, Inc. +;; Copyright (C) 2009-2019 Free Software Foundation, Inc. ;; Author: Carsten Dominik ;; Keywords: outlines, hypermedia, calendar, wp -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; ;; This file is part of GNU Emacs. ;; @@ -138,15 +138,16 @@ will be built under the headline at point." "^\\*+[ \t]+%d-%02d-\\([0123][0-9]\\) \\w+$" year month day)))) -(defun org-datetree--find-create (regex year &optional month day insert) - "Find the datetree matched by REGEX for YEAR, MONTH, or DAY. -REGEX is passed to `format' with YEAR, MONTH, and DAY as +(defun org-datetree--find-create + (regex-template year &optional month day insert) + "Find the datetree matched by REGEX-TEMPLATE for YEAR, MONTH, or DAY. +REGEX-TEMPLATE is passed to `format' with YEAR, MONTH, and DAY as arguments. Match group 1 is compared against the specified date component. If INSERT is non-nil and there is no match then it is inserted into the buffer." (when (or month day) (org-narrow-to-subtree)) - (let ((re (format regex year month day)) + (let ((re (format regex-template year month day)) match) (goto-char (point-min)) (while (and (setq match (re-search-forward re nil t)) diff --git a/elpa/org-20171030/org-docview.el b/elpa/org-20190930/org-docview.el similarity index 92% rename from elpa/org-20171030/org-docview.el rename to elpa/org-20190930/org-docview.el index 3361b0e5..40b06d3b 100644 --- a/elpa/org-20171030/org-docview.el +++ b/elpa/org-20190930/org-docview.el @@ -1,10 +1,10 @@ ;;; org-docview.el --- Support for links to doc-view-mode buffers -*- lexical-binding: t; -*- -;; Copyright (C) 2009-2017 Free Software Foundation, Inc. +;; Copyright (C) 2009-2019 Free Software Foundation, Inc. ;; Author: Jan Böcker ;; Keywords: outlines, hypermedia, calendar, wp -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; ;; This file is part of GNU Emacs. ;; @@ -56,11 +56,11 @@ (defun org-docview-export (link description format) "Export a docview link from Org files." - (let* ((path (if (string-match "\\(.+\\)::.+" link) (match-string 1 link) - link)) - (desc (or description link))) + (let ((path (if (string-match "\\(.+\\)::.+" link) (match-string 1 link) + link)) + (desc (or description link))) (when (stringp path) - (setq path (org-link-escape (expand-file-name path))) + (setq path (expand-file-name path)) (cond ((eq format 'html) (format "%s" path desc)) ((eq format 'latex) (format "\\href{%s}{%s}" path desc)) diff --git a/elpa/org-20171030/org-duration.el b/elpa/org-20190930/org-duration.el similarity index 96% rename from elpa/org-20171030/org-duration.el rename to elpa/org-20190930/org-duration.el index 096e973d..e350bc74 100644 --- a/elpa/org-20171030/org-duration.el +++ b/elpa/org-20190930/org-duration.el @@ -1,6 +1,6 @@ ;;; org-duration.el --- Library handling durations -*- lexical-binding: t; -*- -;; Copyright (C) 2017 Free Software Foundation, Inc. +;; Copyright (C) 2017-2019 Free Software Foundation, Inc. ;; Author: Nicolas Goaziou ;; Keywords: outlines, hypermedia, calendar, wp @@ -51,7 +51,6 @@ (require 'cl-lib) (require 'org-macs) -(declare-function org-trim "org-trim" (s &optional keep-lead)) ;;; Public variables @@ -99,8 +98,8 @@ sure to call the following command: :set (lambda (var val) (set-default var val) (org-duration-set-regexps)) :initialize 'custom-initialize-changed :type '(choice - (const :tag "H:MM" 'h:mm) - (const :tag "H:MM:SS" 'h:mm:ss) + (const :tag "H:MM" h:mm) + (const :tag "H:MM:SS" h:mm:ss) (alist :key-type (string :tag "Unit") :value-type (number :tag "Modifier")))) @@ -317,11 +316,10 @@ When optional argument CANONICAL is non-nil, ignore Raise an error if expected format is unknown." (pcase (or fmt org-duration-format) (`h:mm - (let ((minutes (floor minutes))) - (format "%d:%02d" (/ minutes 60) (mod minutes 60)))) + (format "%d:%02d" (/ minutes 60) (mod minutes 60))) (`h:mm:ss (let* ((whole-minutes (floor minutes)) - (seconds (floor (* 60 (- minutes whole-minutes))))) + (seconds (mod (* 60 minutes) 60))) (format "%s:%02d" (org-duration-from-minutes whole-minutes 'h:mm) seconds))) @@ -402,9 +400,7 @@ Raise an error if expected format is unknown." (pcase-let* ((`(,unit . ,required?) units) (modifier (org-duration--modifier unit canonical))) (cond ((<= modifier minutes) - (let ((value (if (integerp modifier) - (/ (floor minutes) modifier) - (floor (/ minutes modifier))))) + (let ((value (floor minutes modifier))) (cl-decf minutes (* value modifier)) (format " %d%s" value unit))) (required? (concat " 0" unit)) diff --git a/elpa/org-20171030/org-element.el b/elpa/org-20190930/org-element.el similarity index 96% rename from elpa/org-20171030/org-element.el rename to elpa/org-20190930/org-element.el index f2b3002f..77b8f95a 100644 --- a/elpa/org-20171030/org-element.el +++ b/elpa/org-20190930/org-element.el @@ -1,6 +1,6 @@ ;;; org-element.el --- Parser for Org Syntax -*- lexical-binding: t; -*- -;; Copyright (C) 2012-2017 Free Software Foundation, Inc. +;; Copyright (C) 2012-2019 Free Software Foundation, Inc. ;; Author: Nicolas Goaziou ;; Keywords: outlines, hypermedia, calendar, wp @@ -22,7 +22,7 @@ ;;; Commentary: ;; -;; See for details about +;; See for details about ;; Org syntax. ;; ;; Lisp-wise, a syntax object can be represented as a list. @@ -307,8 +307,9 @@ Don't modify it, set `org-element-affiliated-keywords' instead.") (strike-through ,@standard-set) (subscript ,@standard-set) (superscript ,@standard-set) - ;; Ignore inline babel call and inline src block as formulas are - ;; possible. Also ignore line breaks and statistics cookies. + ;; Ignore inline babel call and inline source block as formulas + ;; are possible. Also ignore line breaks and statistics + ;; cookies. (table-cell bold code entity export-snippet footnote-reference italic latex-fragment link macro radio-target strike-through subscript superscript target timestamp underline verbatim) @@ -491,6 +492,7 @@ objects, or a strings. The function takes care of setting `:parent' property for CHILD. Return parent element." + (declare (indent 1)) (if (not children) parent ;; Link every child to PARENT. If PARENT is nil, it is a secondary ;; string: parent is the list itself. @@ -677,7 +679,7 @@ Assume point is at the beginning of the block." (defun org-element-center-block-interpreter (_ contents) "Interpret a center-block element as Org syntax. CONTENTS is the contents of the element." - (format "#+BEGIN_CENTER\n%s#+END_CENTER" contents)) + (format "#+begin_center\n%s#+end_center" contents)) ;;;; Drawer @@ -787,7 +789,7 @@ Assume point is at beginning of dynamic block." (defun org-element-dynamic-block-interpreter (dynamic-block contents) "Interpret DYNAMIC-BLOCK element as Org syntax. CONTENTS is the contents of the element." - (format "#+BEGIN: %s%s\n%s#+END:" + (format "#+begin: %s%s\n%s#+end:" (org-element-property :block-name dynamic-block) (let ((args (org-element-property :arguments dynamic-block))) (if args (concat " " args) "")) @@ -812,7 +814,8 @@ their value. Return a list whose CAR is `footnote-definition' and CDR is a plist containing `:label', `:begin' `:end', `:contents-begin', -`:contents-end', `:post-blank' and `:post-affiliated' keywords. +`:contents-end', `:pre-blank',`:post-blank' and +`:post-affiliated' keywords. Assume point is at the beginning of the footnote definition." (save-excursion @@ -838,12 +841,16 @@ Assume point is at the beginning of the footnote definition." ((eq ?* (char-after (match-beginning 0))) (match-beginning 0)) (t (skip-chars-forward " \r\t\n" limit) (if (= limit (point)) limit (line-beginning-position)))))) + (pre-blank 0) (contents-begin (progn (search-forward "]") (skip-chars-forward " \r\t\n" end) (cond ((= (point) end) nil) ((= (line-beginning-position) post-affiliated) (point)) - (t (line-beginning-position))))) + (t + (setq pre-blank + (count-lines (line-beginning-position) begin)) + (line-beginning-position))))) (contents-end (progn (goto-char end) (skip-chars-backward " \r\t\n") @@ -855,6 +862,7 @@ Assume point is at the beginning of the footnote definition." :end end :contents-begin contents-begin :contents-end (and contents-begin contents-end) + :pre-blank pre-blank :post-blank (count-lines contents-end end) :post-affiliated post-affiliated) (cdr affiliated)))))) @@ -862,9 +870,18 @@ Assume point is at the beginning of the footnote definition." (defun org-element-footnote-definition-interpreter (footnote-definition contents) "Interpret FOOTNOTE-DEFINITION element as Org syntax. CONTENTS is the contents of the footnote-definition." - (concat (format "[fn:%s]" (org-element-property :label footnote-definition)) - " " - contents)) + (let ((pre-blank + (min (or (org-element-property :pre-blank footnote-definition) + ;; 0 is specific to paragraphs at the beginning of + ;; the footnote definition, so we use 1 as + ;; a fall-back value, which is more universal. + 1) + ;; Footnote ends after more than two consecutive empty + ;; lines: limit ourselves to 2 newline characters. + 2))) + (concat (format "[fn:%s]" (org-element-property :label footnote-definition)) + (if (= pre-blank 0) (concat " " (org-trim contents)) + (concat (make-string pre-blank ?\n) contents))))) ;;;; Headline @@ -931,10 +948,10 @@ Assume point is at beginning of the headline." (level (prog1 (org-reduced-level (skip-chars-forward "*")) (skip-chars-forward " \t"))) (todo (and org-todo-regexp - (let (case-fold-search) (looking-at org-todo-regexp)) + (let (case-fold-search) (looking-at (concat org-todo-regexp " "))) (progn (goto-char (match-end 0)) (skip-chars-forward " \t") - (match-string 0)))) + (match-string 1)))) (todo-type (and todo (if (member todo org-done-keywords) 'done 'todo))) (priority (and (looking-at "\\[#.\\][ \t]*") @@ -1172,18 +1189,18 @@ CONTENTS is the contents of inlinetask." (concat (make-string (max (- (+ org-tags-column (length task) (length tags))) 1) - ? ) + ?\s) tags)) (t (concat - (make-string (max (- org-tags-column (length task)) 1) ? ) + (make-string (max (- org-tags-column (length task)) 1) ?\s) tags)))) ;; Prefer degenerate inlinetasks when there are no ;; contents. (when contents (concat "\n" contents - (make-string level ?*) " END"))))) + (make-string level ?*) " end"))))) ;;;; Item @@ -1195,8 +1212,8 @@ STRUCT is the structure of the plain list. Return a list whose CAR is `item' and CDR is a plist containing `:bullet', `:begin', `:end', `:contents-begin', `:contents-end', -`:checkbox', `:counter', `:tag', `:structure', `:post-blank' and -`:post-affiliated' keywords. +`:checkbox', `:counter', `:tag', `:structure', `:pre-blank', +`:post-blank' and `:post-affiliated' keywords. When optional argument RAW-SECONDARY-P is non-nil, item's tag, if any, will not be parsed as a secondary string, but as a plain @@ -1223,20 +1240,25 @@ Assume point is at the beginning of the item." (string-to-number (match-string 0 c))))))) (end (progn (goto-char (nth 6 (assq (point) struct))) (if (bolp) (point) (line-beginning-position 2)))) + (pre-blank 0) (contents-begin - (progn (goto-char - ;; Ignore tags in un-ordered lists: they are just - ;; a part of item's body. - (if (and (match-beginning 4) - (save-match-data (string-match "[.)]" bullet))) - (match-beginning 4) - (match-end 0))) - (skip-chars-forward " \r\t\n" end) - (cond ((= (point) end) nil) - ;; If first line isn't empty, contents really - ;; start at the text after item's meta-data. - ((= (line-beginning-position) begin) (point)) - (t (line-beginning-position))))) + (progn + (goto-char + ;; Ignore tags in un-ordered lists: they are just + ;; a part of item's body. + (if (and (match-beginning 4) + (save-match-data (string-match "[.)]" bullet))) + (match-beginning 4) + (match-end 0))) + (skip-chars-forward " \r\t\n" end) + (cond ((= (point) end) nil) + ;; If first line isn't empty, contents really + ;; start at the text after item's meta-data. + ((= (line-beginning-position) begin) (point)) + (t + (setq pre-blank + (count-lines (line-beginning-position) begin)) + (line-beginning-position))))) (contents-end (and contents-begin (progn (goto-char end) (skip-chars-backward " \r\t\n") @@ -1251,6 +1273,7 @@ Assume point is at the beginning of the item." :checkbox checkbox :counter counter :structure struct + :pre-blank pre-blank :post-blank (count-lines (or contents-end begin) end) :post-affiliated begin)))) (org-element-put-property @@ -1266,35 +1289,43 @@ Assume point is at the beginning of the item." (defun org-element-item-interpreter (item contents) "Interpret ITEM element as Org syntax. CONTENTS is the contents of the element." - (let* ((bullet (let ((bullet (org-element-property :bullet item))) - (org-list-bullet-string - (cond ((not (string-match "[0-9a-zA-Z]" bullet)) "- ") - ((eq org-plain-list-ordered-item-terminator ?\)) "1)") - (t "1."))))) - (checkbox (org-element-property :checkbox item)) - (counter (org-element-property :counter item)) - (tag (let ((tag (org-element-property :tag item))) - (and tag (org-element-interpret-data tag)))) - ;; Compute indentation. - (ind (make-string (length bullet) 32)) - (item-starts-with-par-p - (eq (org-element-type (car (org-element-contents item))) - 'paragraph))) - ;; Indent contents. + (let ((tag (pcase (org-element-property :tag item) + (`nil nil) + (tag (format "%s :: " (org-element-interpret-data tag))))) + (bullet + (org-list-bullet-string + (cond + ((not (string-match-p "[0-9a-zA-Z]" + (org-element-property :bullet item))) "- ") + ((eq org-plain-list-ordered-item-terminator ?\)) "1)") + (t "1."))))) (concat bullet - (and counter (format "[@%d] " counter)) - (pcase checkbox + (pcase (org-element-property :counter item) + (`nil nil) + (counter (format "[@%d] " counter))) + (pcase (org-element-property :checkbox item) (`on "[X] ") (`off "[ ] ") (`trans "[-] ") (_ nil)) - (and tag (format "%s :: " tag)) + tag (when contents - (let ((contents (replace-regexp-in-string - "\\(^\\)[ \t]*\\S-" ind contents nil nil 1))) - (if item-starts-with-par-p (org-trim contents) - (concat "\n" contents))))))) + (let* ((ind (make-string (if tag 5 (length bullet)) ?\s)) + (pre-blank + (min (or (org-element-property :pre-blank item) + ;; 0 is specific to paragraphs at the + ;; beginning of the item, so we use 1 as + ;; a fall-back value, which is more universal. + 1) + ;; Lists ends after more than two consecutive + ;; empty lines: limit ourselves to 2 newline + ;; characters. + 2)) + (contents (replace-regexp-in-string + "\\(^\\)[ \t]*\\S-" ind contents nil nil 1))) + (if (= pre-blank 0) (org-trim contents) + (concat (make-string pre-blank ?\n) contents))))))) ;;;; Plain List @@ -1308,23 +1339,19 @@ CONTENTS is the contents of the element." (inlinetask-re (and (featurep 'org-inlinetask) "^\\*+ ")) items struct) (save-excursion - (catch 'exit + (catch :exit (while t (cond ;; At limit: end all items. ((>= (point) limit) - (throw 'exit - (let ((end (progn (skip-chars-backward " \r\t\n") - (forward-line) - (point)))) - (dolist (item items (sort (nconc items struct) - 'car-less-than-car)) - (setcar (nthcdr 6 item) end))))) + (let ((end (progn (skip-chars-backward " \r\t\n") + (line-beginning-position 2)))) + (dolist (item items) (setcar (nthcdr 6 item) end))) + (throw :exit (sort (nconc items struct) #'car-less-than-car))) ;; At list end: end all items. ((looking-at org-list-end-re) - (throw 'exit (dolist (item items (sort (nconc items struct) - 'car-less-than-car)) - (setcar (nthcdr 6 item) (point))))) + (dolist (item items) (setcar (nthcdr 6 item) (point))) + (throw :exit (sort (nconc items struct) #'car-less-than-car))) ;; At a new item: end previous sibling. ((looking-at item-re) (let ((ind (save-excursion (skip-chars-forward " \t") @@ -1348,7 +1375,7 @@ CONTENTS is the contents of the element." ;; Ending position, unknown so far. nil))) items)) - (forward-line 1)) + (forward-line)) ;; Skip empty lines. ((looking-at "^[ \t]*$") (forward-line)) ;; Skip inline tasks and blank lines along the way. @@ -1360,17 +1387,18 @@ CONTENTS is the contents of the element." (goto-char origin))))) ;; At some text line. Check if it ends any previous item. (t - (let ((ind (save-excursion (skip-chars-forward " \t") - (current-column)))) - (when (<= ind top-ind) - (skip-chars-backward " \r\t\n") - (forward-line)) + (let ((ind (save-excursion + (skip-chars-forward " \t") + (current-column))) + (end (save-excursion + (skip-chars-backward " \r\t\n") + (line-beginning-position 2)))) (while (<= ind (nth 1 (car items))) (let ((item (pop items))) - (setcar (nthcdr 6 item) (line-beginning-position)) + (setcar (nthcdr 6 item) end) (push item struct) (unless items - (throw 'exit (sort struct #'car-less-than-car)))))) + (throw :exit (sort struct #'car-less-than-car)))))) ;; Skip blocks (any type) and drawers contents. (cond ((and (looking-at "[ \t]*#\\+BEGIN\\(:\\|_\\S-+\\)") @@ -1519,7 +1547,7 @@ Assume point is at the beginning of the block." (defun org-element-quote-block-interpreter (_ contents) "Interpret quote-block element as Org syntax. CONTENTS is the contents of the element." - (format "#+BEGIN_QUOTE\n%s#+END_QUOTE" contents)) + (format "#+begin_quote\n%s#+end_quote" contents)) ;;;; Section @@ -1605,7 +1633,7 @@ Assume point is at the beginning of the block." "Interpret SPECIAL-BLOCK element as Org syntax. CONTENTS is the contents of the element." (let ((block-type (org-element-property :type special-block))) - (format "#+BEGIN_%s\n%s#+END_%s" block-type contents block-type))) + (format "#+begin_%s\n%s#+end_%s" block-type contents block-type))) @@ -1673,7 +1701,7 @@ containing `:call', `:inside-header', `:arguments', (defun org-element-babel-call-interpreter (babel-call _) "Interpret BABEL-CALL element as Org syntax." - (concat "#+CALL: " + (concat "#+call: " (org-element-property :call babel-call) (let ((h (org-element-property :inside-header babel-call))) (and h (format "[%s]" h))) @@ -1827,7 +1855,7 @@ Assume point is at comment block beginning." (defun org-element-comment-block-interpreter (comment-block _) "Interpret COMMENT-BLOCK element as Org syntax." - (format "#+BEGIN_COMMENT\n%s#+END_COMMENT" + (format "#+begin_comment\n%s#+end_comment" (org-element-normalize-string (org-remove-indentation (org-element-property :value comment-block))))) @@ -1954,15 +1982,22 @@ containing `:begin', `:end', `:number-lines', `:preserve-indent', (defun org-element-example-block-interpreter (example-block _) "Interpret EXAMPLE-BLOCK element as Org syntax." (let ((switches (org-element-property :switches example-block)) - (value (org-element-property :value example-block))) - (concat "#+BEGIN_EXAMPLE" (and switches (concat " " switches)) "\n" - (org-element-normalize-string - (org-escape-code-in-string - (if (or org-src-preserve-indentation - (org-element-property :preserve-indent example-block)) - value - (org-remove-indentation value)))) - "#+END_EXAMPLE"))) + (value + (let ((val (org-element-property :value example-block))) + (cond + ((or org-src-preserve-indentation + (org-element-property :preserve-indent example-block)) + val) + ((= 0 org-edit-src-content-indentation) + (org-remove-indentation val)) + (t + (let ((ind (make-string org-edit-src-content-indentation ?\s))) + (replace-regexp-in-string "^[ \t]*\\S-" + (concat ind "\\&") + (org-remove-indentation val)))))))) + (concat "#+begin_example" (and switches (concat " " switches)) "\n" + (org-element-normalize-string (org-escape-code-in-string value)) + "#+end_example"))) ;;;; Export Block @@ -2015,7 +2050,7 @@ Assume point is at export-block beginning." (defun org-element-export-block-interpreter (export-block _) "Interpret EXPORT-BLOCK element as Org syntax." - (format "#+BEGIN_EXPORT %s\n%s#+END_EXPORT" + (format "#+begin_export %s\n%s#+end_export" (org-element-property :type export-block) (org-element-property :value export-block))) @@ -2038,26 +2073,22 @@ Assume point is at the beginning of the fixed-width area." (save-excursion (let* ((begin (car affiliated)) (post-affiliated (point)) - value (end-area (progn (while (and (< (point) limit) (looking-at "[ \t]*:\\( \\|$\\)")) - ;; Accumulate text without starting colons. - (setq value - (concat value - (buffer-substring-no-properties - (match-end 0) (point-at-eol)) - "\n")) (forward-line)) - (point))) + (if (bolp) (line-end-position 0) (point)))) (end (progn (skip-chars-forward " \r\t\n" limit) (if (eobp) (point) (line-beginning-position))))) (list 'fixed-width (nconc (list :begin begin :end end - :value value + :value (replace-regexp-in-string + "^[ \t]*: ?" "" + (buffer-substring-no-properties post-affiliated + end-area)) :post-blank (count-lines end-area end) :post-affiliated post-affiliated) (cdr affiliated)))))) @@ -2065,10 +2096,7 @@ Assume point is at the beginning of the fixed-width area." (defun org-element-fixed-width-interpreter (fixed-width _) "Interpret FIXED-WIDTH element as Org syntax." (let ((value (org-element-property :value fixed-width))) - (and value - (replace-regexp-in-string - "^" ": " - (if (string-match "\n\\'" value) (substring value 0 -1) value))))) + (and value (replace-regexp-in-string "^" ": " value)))) ;;;; Horizontal Rule @@ -2122,7 +2150,7 @@ containing `:key', `:value', `:begin', `:end', `:post-blank' and ;; this corner case. (let ((begin (or (car affiliated) (point))) (post-affiliated (point)) - (key (progn (looking-at "[ \t]*#\\+\\(\\S-+*\\):") + (key (progn (looking-at "[ \t]*#\\+\\(\\S-*\\):") (upcase (match-string-no-properties 1)))) (value (org-trim (buffer-substring-no-properties (match-end 0) (point-at-eol)))) @@ -2142,7 +2170,7 @@ containing `:key', `:value', `:begin', `:end', `:post-blank' and (defun org-element-keyword-interpreter (keyword _) "Interpret KEYWORD element as Org syntax." (format "#+%s: %s" - (org-element-property :key keyword) + (downcase (org-element-property :key keyword)) (org-element-property :value keyword))) @@ -2372,7 +2400,7 @@ containing `:closed', `:deadline', `:scheduled', `:begin', ;;;; Src Block (defun org-element-src-block-parser (limit affiliated) - "Parse a src block. + "Parse a source block. LIMIT bounds the search. AFFILIATED is a list of which CAR is the buffer position at the beginning of the first affiliated @@ -2428,7 +2456,7 @@ Assume point is at the beginning of the block." (string-match "-l +\"\\([^\"\n]+\\)\"" switches) (match-string 1 switches))) ;; Should labels be retained in (or stripped from) - ;; src blocks? + ;; source blocks? (retain-labels (or (not switches) (not (string-match "-r\\>" switches)) @@ -2483,14 +2511,14 @@ Assume point is at the beginning of the block." (org-remove-indentation val)) (t (let ((ind (make-string org-edit-src-content-indentation ?\s))) - (replace-regexp-in-string - "^" ind (org-remove-indentation val)))))))) - (concat (format "#+BEGIN_SRC%s\n" - (concat (and lang (concat " " lang)) - (and switches (concat " " switches)) - (and params (concat " " params)))) - (org-element-normalize-string (org-escape-code-in-string value)) - "#+END_SRC"))) + (replace-regexp-in-string "^[ \t]*\\S-" + (concat ind "\\&") + (org-remove-indentation val)))))))) + (format "#+begin_src%s\n%s#+end_src" + (concat (and lang (concat " " lang)) + (and switches (concat " " switches)) + (and params (concat " " params))) + (org-element-normalize-string (org-escape-code-in-string value))))) ;;;; Table @@ -2638,7 +2666,7 @@ Assume point is at beginning of the block." (defun org-element-verse-block-interpreter (_ contents) "Interpret verse-block element as Org syntax. CONTENTS is verse block contents." - (format "#+BEGIN_VERSE\n%s#+END_VERSE" contents)) + (format "#+begin_verse\n%s#+end_verse" contents)) @@ -2902,7 +2930,7 @@ When at an inline source block, return a list whose car is `:language', `:value', `:parameters' and `:post-blank' as keywords. Otherwise, return nil. -Assume point is at the beginning of the inline src block." +Assume point is at the beginning of the inline source block." (save-excursion (catch :no-object (when (let ((case-fold-search nil)) @@ -3068,14 +3096,14 @@ Assume point is at the beginning of the link." (setq path (match-string-no-properties 1)) (setq contents-begin (match-beginning 1)) (setq contents-end (match-end 1))) - ;; Type 2: Standard link, i.e. [[http://orgmode.org][homepage]] + ;; Type 2: Standard link, i.e. [[https://orgmode.org][homepage]] ((looking-at org-bracket-link-regexp) (setq format 'bracket) (setq contents-begin (match-beginning 3)) (setq contents-end (match-end 3)) (setq link-end (match-end 0)) - ;; RAW-LINK is the original link. Expand any - ;; abbreviation in it. + ;; RAW-LINK is the original link. Decode any encoding. + ;; Expand any abbreviation in it. ;; ;; Also treat any newline character and associated ;; indentation as a single space character. This is not @@ -3086,9 +3114,10 @@ Assume point is at the beginning of the link." ;; [[shell:ls *.org]], which defeats Org's focus on ;; simplicity. (setq raw-link (org-link-expand-abbrev - (replace-regexp-in-string - "[ \t]*\n[ \t]*" " " - (match-string-no-properties 1)))) + (org-link-unescape + (replace-regexp-in-string + "[ \t]*\n[ \t]*" " " + (match-string-no-properties 1))))) ;; Determine TYPE of link and set PATH accordingly. According ;; to RFC 3986, remove whitespaces from URI in external links. ;; In internal ones, treat indentation as a single space. @@ -3117,14 +3146,14 @@ Assume point is at the beginning of the link." (t (setq type "fuzzy") (setq path raw-link)))) - ;; Type 3: Plain link, e.g., http://orgmode.org + ;; Type 3: Plain link, e.g., https://orgmode.org ((looking-at org-plain-link-re) (setq format 'plain) (setq raw-link (match-string-no-properties 0)) (setq type (match-string-no-properties 1)) (setq link-end (match-end 0)) (setq path (match-string-no-properties 2))) - ;; Type 4: Angular link, e.g., . Unlike to + ;; Type 4: Angular link, e.g., . Unlike to ;; bracket links, follow RFC 3986 and remove any extra ;; whitespace in URI. ((looking-at org-angle-link-re) @@ -3221,15 +3250,18 @@ a plist with `:key', `:args', `:begin', `:end', `:value' and Assume point is at the macro." (save-excursion - (when (looking-at "{{{\\([a-zA-Z][-a-zA-Z0-9_]*\\)\\(([ \t\n]*\\([^\000]*?\\))\\)?}}}") + (when (looking-at "{{{\\([a-zA-Z][-a-zA-Z0-9_]*\\)\\((\\([^\000]*?\\))\\)?}}}") (let ((begin (point)) (key (downcase (match-string-no-properties 1))) (value (match-string-no-properties 0)) (post-blank (progn (goto-char (match-end 0)) (skip-chars-forward " \t"))) (end (point)) - (args (let ((args (match-string-no-properties 3))) - (and args (org-macro-extract-arguments args))))) + (args (pcase (match-string-no-properties 3) + (`nil nil) + (a (org-macro-extract-arguments + (replace-regexp-in-string + "[ \t\r\n]+" " " (org-trim a))))))) (list 'macro (list :key key :value value @@ -3240,7 +3272,11 @@ Assume point is at the macro." (defun org-element-macro-interpreter (macro _) "Interpret MACRO object as Org syntax." - (org-element-property :value macro)) + (format "{{{%s%s}}}" + (org-element-property :key macro) + (pcase (org-element-property :args macro) + (`nil "") + (args (format "(%s)" (apply #'org-macro-escape-arguments args)))))) ;;;; Radio-target @@ -3877,7 +3913,18 @@ element it has to parse." ((looking-at "%%(") (org-element-diary-sexp-parser limit affiliated)) ;; Table. - ((looking-at "[ \t]*\\(|\\|\\+\\(-+\\+\\)+[ \t]*$\\)") + ((or (looking-at "[ \t]*|") + ;; There is no strict definition of a table.el + ;; table. Try to prevent false positive while being + ;; quick. + (let ((rule-regexp "[ \t]*\\+\\(-+\\+\\)+[ \t]*$") + (next (line-beginning-position 2))) + (and (looking-at rule-regexp) + (save-excursion + (forward-line) + (re-search-forward "^[ \t]*\\($\\|[^|]\\)" limit t) + (and (> (line-beginning-position) next) + (org-match-line rule-regexp)))))) (org-element-table-parser limit affiliated)) ;; List. ((looking-at (org-item-re)) @@ -4049,7 +4096,10 @@ If STRING is the empty string or nil, return nil." (ignore-errors (if (symbolp v) (makunbound v) (set (make-local-variable (car v)) (cdr v))))) - (insert string) + ;; Transferring local variables may put the temporary buffer + ;; into a read-only state. Make sure we can insert STRING. + (let ((inhibit-read-only t)) (insert string)) + ;; Prevent "Buffer *temp* modified; kill anyway?". (restore-buffer-modified-p nil) (org-element--parse-objects (point-min) (point-max) nil restriction parent)))))) @@ -4535,8 +4585,9 @@ to interpret. Return Org syntax as a string." (and (eq type 'paragraph) (memq (org-element-type parent) '(footnote-definition item)) - (eq data - (car (org-element-contents parent))))))) + (eq data (car (org-element-contents parent))) + (eq (org-element-property :pre-blank parent) + 0))))) "")))))) (if (memq type '(org-data plain-text nil)) results ;; Build white spaces. If no `:post-blank' property @@ -4558,7 +4609,7 @@ If there is no affiliated keyword, return the empty string." (let (dual) (when (member key org-element-dual-keywords) (setq dual (cdr value) value (car value))) - (concat "#+" key + (concat "#+" (downcase key) (and dual (format "[%s]" (org-element-interpret-data dual))) ": " @@ -4724,7 +4775,7 @@ indentation removed from its contents." ;; Cache is enabled by default, but can be disabled globally with ;; `org-element-use-cache'. `org-element-cache-sync-idle-time', ;; org-element-cache-sync-duration' and `org-element-cache-sync-break' -;; can be tweaked to control caching behaviour. +;; can be tweaked to control caching behavior. ;; ;; Internally, parsed elements are stored in an AVL tree, ;; `org-element--cache'. This tree is updated lazily: whenever @@ -4768,13 +4819,13 @@ you want to help debugging the issue.") (defvar org-element-cache-sync-idle-time 0.6 "Length, in seconds, of idle time before syncing cache.") -(defvar org-element-cache-sync-duration (seconds-to-time 0.04) +(defvar org-element-cache-sync-duration 0.04 "Maximum duration, as a time value, for a cache synchronization. If the synchronization is not over after this delay, the process pauses and resumes after `org-element-cache-sync-break' seconds.") -(defvar org-element-cache-sync-break (seconds-to-time 0.3) +(defvar org-element-cache-sync-break 0.3 "Duration, as a time value, of the pause between synchronizations. See `org-element-cache-sync-duration' for more information.") @@ -4859,7 +4910,7 @@ table is cleared once the synchronization is complete." (defun org-element--cache-generate-key (lower upper) "Generate a key between LOWER and UPPER. -LOWER and UPPER are integers or lists, possibly empty. +LOWER and UPPER are fixnums or lists of same, possibly empty. If LOWER and UPPER are equals, return LOWER. Otherwise, return a unique key, as an integer or a list of integers, according to @@ -5056,7 +5107,7 @@ Assume ELEMENT belongs to cache and that a cache is active." (setq org-element--cache-sync-timer (run-with-idle-timer (let ((idle (current-idle-time))) - (if idle (time-add idle org-element-cache-sync-break) + (if idle (org-time-add idle org-element-cache-sync-break) org-element-cache-sync-idle-time)) nil #'org-element--cache-sync @@ -5067,7 +5118,7 @@ Assume ELEMENT belongs to cache and that a cache is active." TIME-LIMIT is a time value or nil." (and time-limit (or (input-pending-p) - (time-less-p time-limit (current-time))))) + (org-time-less-p time-limit nil)))) (defsubst org-element--cache-shift-positions (element offset &optional props) "Shift ELEMENT properties relative to buffer positions by OFFSET. @@ -5121,8 +5172,8 @@ updated before current modification are actually submitted." (and next (aref next 0)) threshold (and (not threshold) - (time-add (current-time) - org-element-cache-sync-duration)) + (org-time-add nil + org-element-cache-sync-duration)) future-change) ;; Request processed. Merge current and next offsets and ;; transfer ending position. @@ -5871,24 +5922,24 @@ Providing it allows for quicker computation." ;; Otherwise, return NEXT. (t (throw 'exit next))))))))))))) -(defun org-element-lineage (blob &optional types with-self) +(defun org-element-lineage (datum &optional types with-self) "List all ancestors of a given element or object. -BLOB is an object or element. +DATUM is an object or element. -When optional argument TYPES is a list of symbols, return the -first element or object in the lineage whose type belongs to that -list. +Return ancestors from the closest to the farthest. When optional +argument TYPES is a list of symbols, return the first element or +object in the lineage whose type belongs to that list instead. When optional argument WITH-SELF is non-nil, lineage includes -BLOB itself as the first element, and TYPES, if provided, also +DATUM itself as the first element, and TYPES, if provided, also apply to it. -When BLOB is obtained through `org-element-context' or +When DATUM is obtained through `org-element-context' or `org-element-at-point', only ancestors from its section can be -found. There is no such limitation when BLOB belongs to a full +found. There is no such limitation when DATUM belongs to a full parse tree." - (let ((up (if with-self blob (org-element-property :parent blob))) + (let ((up (if with-self datum (org-element-property :parent datum))) ancestors) (while (and up (not (memq (org-element-type up) types))) (unless types (push up ancestors)) @@ -5916,16 +5967,16 @@ end of ELEM-A." ;; ELEM-A position in such a situation. Note that the case of ;; a footnote definition is impossible: it cannot contain two ;; paragraphs in a row because it cannot contain a blank line. - (if (and specialp - (or (not (eq (org-element-type elem-B) 'paragraph)) - (/= (org-element-property :begin elem-B) - (org-element-property :contents-begin elem-B)))) - (error "Cannot swap elements")) + (when (and specialp + (or (not (eq (org-element-type elem-B) 'paragraph)) + (/= (org-element-property :begin elem-B) + (org-element-property :contents-begin elem-B)))) + (error "Cannot swap elements")) ;; In a special situation, ELEM-A will have no indentation. We'll ;; give it ELEM-B's (which will in, in turn, have no indentation). (let* ((ind-B (when specialp (goto-char (org-element-property :begin elem-B)) - (org-get-indentation))) + (current-indentation))) (beg-A (org-element-property :begin elem-A)) (end-A (save-excursion (goto-char (org-element-property :end elem-A)) diff --git a/elpa/org-20171030/org-entities.el b/elpa/org-20190930/org-entities.el similarity index 98% rename from elpa/org-20171030/org-entities.el rename to elpa/org-20190930/org-entities.el index a138764f..a5c05eaa 100644 --- a/elpa/org-20171030/org-entities.el +++ b/elpa/org-20190930/org-entities.el @@ -1,11 +1,11 @@ ;;; org-entities.el --- Support for Special Entities -*- lexical-binding: t; -*- -;; Copyright (C) 2010-2017 Free Software Foundation, Inc. +;; Copyright (C) 2010-2019 Free Software Foundation, Inc. ;; Author: Carsten Dominik , ;; Ulf Stegemann ;; Keywords: outlines, calendar, wp -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; ;; This file is part of GNU Emacs. ;; @@ -543,11 +543,11 @@ This first checks the user list, then the built-in list." (dolist (e org-entities) (pcase e (`(,name ,latex ,mathp ,html ,ascii ,latin ,utf8) - (if (equal ascii "|") (setq ascii "\\vert")) - (if (equal latin "|") (setq latin "\\vert")) - (if (equal utf8 "|") (setq utf8 "\\vert")) - (if (equal ascii "=>") (setq ascii "= >")) - (if (equal latin "=>") (setq latin "= >")) + (when (equal ascii "|") (setq ascii "\\vert")) + (when (equal latin "|") (setq latin "\\vert")) + (when (equal utf8 "|") (setq utf8 "\\vert")) + (when (equal ascii "=>") (setq ascii "= >")) + (when (equal latin "=>") (setq latin "= >")) (insert "|" name "|" (format "=%s=" latex) "|" (format (if mathp "$%s$" "$\\mbox{%s}$") latex) diff --git a/elpa/org-20171030/org-eshell.el b/elpa/org-20190930/org-eshell.el similarity index 92% rename from elpa/org-20171030/org-eshell.el rename to elpa/org-20190930/org-eshell.el index b0e9631e..be6db477 100644 --- a/elpa/org-20171030/org-eshell.el +++ b/elpa/org-20190930/org-eshell.el @@ -1,6 +1,6 @@ ;;; org-eshell.el - Support for Links to Working Directories in Eshell -*- lexical-binding: t; -*- -;; Copyright (C) 2011-2017 Free Software Foundation, Inc. +;; Copyright (C) 2011-2019 Free Software Foundation, Inc. ;; Author: Konrad Hinsen @@ -32,12 +32,12 @@ :store #'org-eshell-store-link) (defun org-eshell-open (link) - "Switch to am eshell buffer and execute a command line. + "Switch to an eshell buffer and execute a command line. The link can be just a command line (executed in the default eshell buffer) or a command line prefixed by a buffer name followed by a colon." (let* ((buffer-and-command - (if (string-match "\\([A-Za-z0-9-+*]+\\):\\(.*\\)" link) + (if (string-match "\\([A-Za-z0-9+*-]+\\):\\(.*\\)" link) (list (match-string 1 link) (match-string 2 link)) (list eshell-buffer-name link))) diff --git a/elpa/org-20171030/org-eww.el b/elpa/org-20190930/org-eww.el similarity index 88% rename from elpa/org-20171030/org-eww.el rename to elpa/org-20190930/org-eww.el index 372b543f..47f02a32 100644 --- a/elpa/org-20171030/org-eww.el +++ b/elpa/org-20190930/org-eww.el @@ -1,10 +1,10 @@ ;;; org-eww.el --- Store url and kill from Eww mode for Org -*- lexical-binding: t -*- -;; Copyright (C) 2014-2017 Free Software Foundation, Inc. +;; Copyright (C) 2014-2019 Free Software Foundation, Inc. ;; Author: Marco Wahl a ;; Keywords: link, eww -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; This file is part of GNU Emacs. @@ -25,9 +25,9 @@ ;;; Commentary: ;; When this module is active `org-store-link' (often on key C-c l) in -;; a eww buffer stores a link to the current url of the eww buffer. +;; an EWW buffer stores a link to the current url of the eww buffer. -;; In an eww buffer function `org-eww-copy-for-org-mode' kills either +;; In an EWW buffer function `org-eww-copy-for-org-mode' kills either ;; a region or the whole buffer if no region is set and transforms the ;; text on the fly so that it can be pasted into an Org buffer with ;; hot links. @@ -58,7 +58,7 @@ ;; Store Org-link in eww-mode buffer (org-link-set-parameters "eww" :follow #'eww :store #'org-eww-store-link) (defun org-eww-store-link () - "Store a link to the url of a Eww buffer." + "Store a link to the url of an EWW buffer." (when (eq major-mode 'eww-mode) (org-store-link-props :type "eww" @@ -93,11 +93,12 @@ Otherwise point is not moved. Return point." (defun org-eww-copy-for-org-mode () "Copy current buffer content or active region with `org-mode' style links. This will encode `link-title' and `link-location' with -`org-make-link-string', and insert the transformed test into the kill ring, -so that it can be yanked into an Org mode buffer with links working correctly. +`org-make-link-string' and insert the transformed text into the +kill ring, so that it can be yanked into an Org mode buffer with +links working correctly. -Further lines starting with a star get quoted with a comma to keep -the structure of the Org file." +Further lines starting with a star get quoted with a comma to +keep the structure of the Org file." (interactive) (let* ((regionp (org-region-active-p)) (transform-start (point-min)) @@ -140,13 +141,13 @@ the structure of the Org file." ;; concat `org-mode' style url to `return-content'. (setq return-content (concat return-content - (if (stringp link-location) - ;; hint: link-location is different for form-elements. + (if (org-string-nw-p link-location) + ;; Hint: link-location is different + ;; for form-elements. (org-make-link-string link-location link-title) link-title)))) (goto-char temp-position) ; reset point before jump next anchor - (setq out-bound t) ; for break out `while' loop - )) + (setq out-bound t))) ; for break out `while' loop ;; Add the rest until end of the region to be copied. (when (< (point) transform-end) (setq return-content diff --git a/elpa/org-20171030/org-faces.el b/elpa/org-20190930/org-faces.el similarity index 96% rename from elpa/org-20171030/org-faces.el rename to elpa/org-20190930/org-faces.el index eab9f3e3..b3e01fe8 100644 --- a/elpa/org-20171030/org-faces.el +++ b/elpa/org-20190930/org-faces.el @@ -1,10 +1,10 @@ ;;; org-faces.el --- Face definitions -*- lexical-binding: t; -*- -;; Copyright (C) 2004-2017 Free Software Foundation, Inc. +;; Copyright (C) 2004-2019 Free Software Foundation, Inc. ;; Author: Carsten Dominik ;; Keywords: outlines, hypermedia, calendar, wp -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; ;; This file is part of GNU Emacs. ;; @@ -311,7 +311,7 @@ determines if it is a foreground or a background color." (if (not value) (setq org-tags-special-faces-re nil) (setq org-tags-special-faces-re - (concat ":\\(" (mapconcat 'car value "\\|") "\\):")))) + (concat ":" (regexp-opt (mapcar #'car value) t) ":")))) (defface org-checkbox '((t :inherit bold)) "Face for checkboxes." @@ -395,8 +395,7 @@ follows a #+DATE:, #+AUTHOR: or #+EMAIL: keyword." (defface org-block '((t :inherit shadow)) "Face text in #+begin ... #+end blocks. -For source-blocks `org-src-block-faces' takes precedence. -See also `org-fontify-quote-and-verse-blocks'." +For source-blocks `org-src-block-faces' takes precedence." :group 'org-faces :version "26.1") @@ -409,16 +408,18 @@ See also `org-fontify-quote-and-verse-blocks'." :group 'org-faces) (defface org-verbatim '((t (:inherit shadow))) - "Face for fixed-with text like code snippets" + "Face for fixed-with text like code snippets." :group 'org-faces :version "22.1") (defface org-quote '((t (:inherit org-block))) - "Face for #+BEGIN_QUOTE ... #+END_QUOTE blocks." + "Face for #+BEGIN_QUOTE ... #+END_QUOTE blocks. +Active when `org-fontify-quote-and-verse-blocks' is set." :group 'org-faces) (defface org-verse '((t (:inherit org-block))) - "Face for #+BEGIN_VERSE ... #+END_VERSE blocks." + "Face for #+BEGIN_VERSE ... #+END_VERSE blocks. +Active when `org-fontify-quote-and-verse-blocks' is set." :group 'org-faces) (defcustom org-fontify-quote-and-verse-blocks nil @@ -511,13 +512,18 @@ which days belong to the weekend." (((class color) (min-colors 8) (background light)) (:foreground "red")) (((class color) (min-colors 8) (background dark)) (:foreground "red" :bold t)) (t (:bold t))) - "Face for items scheduled previously, and not yet done." + "Face for items scheduled previously, and not yet done. +See also `org-agenda-deadline-faces'." :group 'org-faces) +(defface org-upcoming-distant-deadline '((t :inherit org-default)) + "Face for items scheduled previously, not done, and have a distant deadline. +See also `org-agenda-deadline-faces'.") + (defcustom org-agenda-deadline-faces '((1.0 . org-warning) (0.5 . org-upcoming-deadline) - (0.0 . default)) + (0.0 . org-upcoming-distant-deadline)) "Faces for showing deadlines in the agenda. This is a list of cons cells. The cdr of each cell is a face to be used, and it can also just be like \\='(:foreground \"yellow\"). @@ -602,8 +608,8 @@ If it is less than 8, the level-1 face gets re-used for level N+1 etc." (defcustom org-cycle-level-faces t "Non-nil means level styles cycle after level `org-n-level-faces'. Then so level org-n-level-faces+1 is styled like level 1. -If nil, then all levels >=org-n-level-faces are styled like -level org-n-level-faces" +If nil, then all levels >= org-n-level-faces are styled like +level org-n-level-faces." :group 'org-appearance :group 'org-faces :version "24.1" diff --git a/elpa/org-20171030/org-feed.el b/elpa/org-20190930/org-feed.el similarity index 97% rename from elpa/org-20171030/org-feed.el rename to elpa/org-20190930/org-feed.el index 0119864d..0f186730 100644 --- a/elpa/org-20171030/org-feed.el +++ b/elpa/org-20190930/org-feed.el @@ -1,10 +1,10 @@ ;;; org-feed.el --- Add RSS feed items to Org files -*- lexical-binding: t; -*- ;; -;; Copyright (C) 2009-2017 Free Software Foundation, Inc. +;; Copyright (C) 2009-2019 Free Software Foundation, Inc. ;; ;; Author: Carsten Dominik ;; Keywords: outlines, hypermedia, calendar, wp -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; ;; This file is part of GNU Emacs. ;; @@ -276,14 +276,21 @@ have been saved." (defun org-feed-update-all () "Get inbox items from all feeds in `org-feed-alist'." (interactive) - (let ((nfeeds (length org-feed-alist)) - (nnew (apply '+ (mapcar 'org-feed-update org-feed-alist)))) - (message "%s from %d %s" - (cond ((= nnew 0) "No new entries") - ((= nnew 1) "1 new entry") - (t (format "%d new entries" nnew))) - nfeeds - (if (= nfeeds 1) "feed" "feeds")))) + (let ((entries 0) + (errors 0) + (total-feeds (length org-feed-alist))) + (dolist (feed org-feed-alist) + (let ((items (ignore-errors (org-feed-update feed)))) + (if items (cl-incf entries items) + (cl-incf errors)))) + (message "%s from %d %s%s" + (pcase entries + (0 "No new entries") + (1 "1 new entry") + (_ (format "%d new entries" entries))) + total-feeds + (if (= total-feeds 1) "feed" "feeds") + (if (= 0 errors) "" (format " (unavailable feeds: %d)" errors))))) ;;;###autoload (defun org-feed-update (feed &optional retrieve-only) @@ -407,7 +414,6 @@ it can be a list structured like an entry in `org-feed-alist'." (goto-char inbox-pos) (outline-hide-subtree) (org-show-children) - (org-cycle-hide-drawers 'children) ;; Hooks and messages (when org-feed-save-after-adding (save-buffer)) @@ -560,7 +566,7 @@ If that property is already present, nothing changes." (if (looking-at (concat "^\\([ \t]*\\)%" name "[ \t]*$")) (org-feed-make-indented-block - v (org-get-indentation)) + v (current-indentation)) v)))))))) (when replacement (insert @@ -624,7 +630,7 @@ containing the properties `:guid' and `:item-full-text'." end (and (re-search-forward "" nil t) (match-beginning 0))) (setq item (buffer-substring beg end) - guid (if (string-match ".*?>\\(.*?\\)" item) + guid (if (string-match ".*?>\\([^\000]*?\\)" item) (xml-substitute-special (match-string-no-properties 1 item)))) (setq entry (list :guid guid :item-full-text item)) (push entry entries) diff --git a/elpa/org-20171030/org-footnote.el b/elpa/org-20190930/org-footnote.el similarity index 68% rename from elpa/org-20171030/org-footnote.el rename to elpa/org-20190930/org-footnote.el index e039ab78..4a296b13 100644 --- a/elpa/org-20171030/org-footnote.el +++ b/elpa/org-20190930/org-footnote.el @@ -1,10 +1,10 @@ ;;; org-footnote.el --- Footnote support in Org -*- lexical-binding: t; -*- ;; -;; Copyright (C) 2009-2017 Free Software Foundation, Inc. +;; Copyright (C) 2009-2019 Free Software Foundation, Inc. ;; ;; Author: Carsten Dominik ;; Keywords: outlines, hypermedia, calendar, wp -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; ;; This file is part of GNU Emacs. ;; @@ -45,15 +45,13 @@ (declare-function org-element-property "org-element" (property element)) (declare-function org-element-type "org-element" (element)) (declare-function org-end-of-subtree "org" (&optional invisible-ok to-heading)) -(declare-function org-fill-paragraph "org" (&optional justify)) +(declare-function org-fill-paragraph "org" (&optional justify region)) (declare-function org-in-block-p "org" (names)) -(declare-function org-in-regexp "org" (re &optional nlines visually)) (declare-function org-in-verbatim-emphasis "org" ()) (declare-function org-inside-LaTeX-fragment-p "org" ()) (declare-function org-inside-latex-macro-p "org" ()) (declare-function org-mark-ring-push "org" (&optional pos buffer)) (declare-function org-show-context "org" (&optional key)) -(declare-function org-trim "org" (s &optional keep-lead)) (declare-function outline-next-heading "outline") (defvar electric-indent-mode) @@ -116,7 +114,8 @@ you will need to run the following command after the change: (org-element-cache-reset 'all))) :type '(choice (string :tag "Collect footnotes under heading") - (const :tag "Define footnotes locally" nil))) + (const :tag "Define footnotes locally" nil)) + :safe #'string-or-null-p) (defcustom org-footnote-define-inline nil "Non-nil means define footnotes inline, at reference location. @@ -124,7 +123,8 @@ When nil, footnotes will be defined in a special section near the end of the document. When t, the [fn:label:definition] notation will be used to define the footnote at the reference position." :group 'org-footnote - :type 'boolean) + :type 'boolean + :safe #'booleanp) (defcustom org-footnote-auto-label t "Non-nil means define automatically new labels for footnotes. @@ -141,7 +141,8 @@ random Automatically generate a unique, random label." (const :tag "Prompt for label" nil) (const :tag "Create automatic [fn:N]" t) (const :tag "Offer automatic [fn:N] for editing" confirm) - (const :tag "Create a random label" random))) + (const :tag "Create a random label" random)) + :safe #'symbolp) (defcustom org-footnote-auto-adjust nil "Non-nil means automatically adjust footnotes after insert/delete. @@ -159,7 +160,8 @@ The main values of this variable can be set with in-buffer options: (const :tag "No adjustment" nil) (const :tag "Renumber" renumber) (const :tag "Sort" sort) - (const :tag "Renumber and Sort" t))) + (const :tag "Renumber and Sort" t)) + :safe #'symbolp) (defcustom org-footnote-fill-after-inline-note-extraction nil "Non-nil means fill paragraphs after extracting footnotes. @@ -167,7 +169,8 @@ When extracting inline footnotes, the lengths of lines can change a lot. When this option is set, paragraphs from which an inline footnote has been extracted will be filled again." :group 'org-footnote - :type 'boolean) + :type 'boolean + :safe #'booleanp) ;;;; Predicates @@ -186,76 +189,53 @@ extracted will be filled again." (org-in-block-p org-footnote-forbidden-blocks))))) (defun org-footnote-at-reference-p () - "Is the cursor at a footnote reference? - + "Non-nil if point is at a footnote reference. If so, return a list containing its label, beginning and ending -positions, and the definition, when inlined." - (when (and (org-footnote-in-valid-context-p) - (or (looking-at org-footnote-re) - (org-in-regexp org-footnote-re) - (save-excursion (re-search-backward org-footnote-re nil t))) - (/= (match-beginning 0) (line-beginning-position))) - (let* ((beg (match-beginning 0)) - (label (match-string-no-properties 1)) - ;; Inline footnotes don't end at (match-end 0) as - ;; `org-footnote-re' stops just after the second colon. - ;; Find the real ending with `scan-sexps', so Org doesn't - ;; get fooled by unrelated closing square brackets. - (end (ignore-errors (scan-sexps beg 1)))) - ;; Point is really at a reference if it's located before true - ;; ending of the footnote. - (when (and end - (< (point) end) - ;; Verify match isn't a part of a link. - (not (save-excursion - (goto-char beg) - (let ((linkp - (save-match-data - (org-in-regexp org-bracket-link-regexp)))) - (and linkp (< (point) (cdr linkp)))))) - ;; Verify point doesn't belong to a LaTeX macro. - (not (org-inside-latex-macro-p))) - (list label beg end - ;; Definition: ensure this is an inline footnote first. - (and (match-end 2) - (org-trim - (buffer-substring-no-properties - (match-end 0) (1- end))))))))) +positions, and the definition, when inline." + (let ((reference (org-element-context))) + (when (eq 'footnote-reference (org-element-type reference)) + (let ((end (save-excursion + (goto-char (org-element-property :end reference)) + (skip-chars-backward " \t") + (point)))) + (when (< (point) end) + (list (org-element-property :label reference) + (org-element-property :begin reference) + end + (and (eq 'inline (org-element-property :type reference)) + (buffer-substring-no-properties + (org-element-property :contents-begin reference) + (org-element-property :contents-end + reference))))))))) (defun org-footnote-at-definition-p () - "Is point within a footnote definition? + "Non-nil if point is within a footnote definition. -This matches only pure definitions like [1] or [fn:name] at the +This matches only pure definitions like [fn:name] at the beginning of a line. It does not match references like \[fn:name:definition], where the footnote text is included and defined locally. -The return value will be nil if not at a footnote definition, and +The return value is nil if not at a footnote definition, and a list with label, start, end and definition of the footnote otherwise." - (when (save-excursion (beginning-of-line) (org-footnote-in-valid-context-p)) - (save-excursion - (end-of-line) - ;; Footnotes definitions are separated by new headlines, another - ;; footnote definition or 2 blank lines. - (let ((lim (save-excursion - (re-search-backward - (concat org-outline-regexp-bol - "\\|^\\([ \t]*\n\\)\\{2,\\}") nil t)))) - (when (re-search-backward org-footnote-definition-re lim t) - (let ((label (match-string-no-properties 1)) - (beg (match-beginning 0)) - (beg-def (match-end 0)) - (end (if (progn - (end-of-line) - (re-search-forward - (concat org-outline-regexp-bol "\\|" - org-footnote-definition-re "\\|" - "^\\([ \t]*\n\\)\\{2,\\}") nil 'move)) - (match-beginning 0) - (point)))) - (list label beg end - (org-trim (buffer-substring-no-properties beg-def end))))))))) + (pcase (org-element-lineage (org-element-at-point) '(footnote-definition) t) + (`nil nil) + (definition + (let* ((label (org-element-property :label definition)) + (begin (org-element-property :post-affiliated definition)) + (end (save-excursion + (goto-char (org-element-property :end definition)) + (skip-chars-backward " \r\t\n") + (line-beginning-position 2))) + (contents-begin (org-element-property :contents-begin definition)) + (contents-end (org-element-property :contents-end definition)) + (contents + (if (not contents-begin) "" + (org-trim + (buffer-substring-no-properties contents-begin + contents-end))))) + (list label begin end contents))))) ;;;; Internal functions @@ -313,23 +293,23 @@ otherwise." (defun org-footnote--clear-footnote-section () "Remove all footnote sections in buffer and create a new one. -New section is created at the end of the buffer, before any file -local variable definition. Leave point within the new section." +New section is created at the end of the buffer. Leave point +within the new section." (when org-footnote-section (goto-char (point-min)) - (let ((regexp - (format "^\\*+ +%s[ \t]*$" - (regexp-quote org-footnote-section)))) + (let ((regexp (format "^\\*+ +%s[ \t]*$" + (regexp-quote org-footnote-section)))) (while (re-search-forward regexp nil t) (delete-region (match-beginning 0) - (progn (org-end-of-subtree t t) - (if (not (eobp)) (point) - (org-footnote--goto-local-insertion-point) - (skip-chars-forward " \t\n") - (if (eobp) (point) (line-beginning-position))))))) + (org-end-of-subtree t t)))) (goto-char (point-max)) - (org-footnote--goto-local-insertion-point) + ;; Clean-up blank lines at the end of the buffer. + (skip-chars-backward " \r\t\n") + (unless (bobp) + (forward-line) + (when (eolp) (insert "\n"))) + (delete-region (point) (point-max)) (when (and (cdr (assq 'heading org-blank-before-new-entry)) (zerop (save-excursion (org-back-over-empty-lines)))) (insert "\n")) @@ -448,14 +428,8 @@ while collecting them." "Find insertion point for footnote, just before next outline heading. Assume insertion point is within currently accessible part of the buffer." (org-with-limited-levels (outline-next-heading)) - ;; Skip file local variables. See `modify-file-local-variable'. - (when (eobp) - (let ((case-fold-search t)) - (re-search-backward "^[ \t]*# +Local Variables:" - (max (- (point-max) 3000) (point-min)) - t))) (skip-chars-backward " \t\n") - (forward-line) + (unless (bobp) (forward-line)) (unless (bolp) (insert "\n"))) @@ -470,16 +444,15 @@ the buffer position bounding the search. Return value is a list like those provided by `org-footnote-at-reference-p'. If no footnote is found, return nil." - (save-excursion - (let* ((label-fmt (if label (format "\\[fn:%s[]:]" label) org-footnote-re))) - (catch 'exit - (while t - (unless (funcall (if backward #'re-search-backward #'re-search-forward) - label-fmt limit t) - (throw 'exit nil)) + (let ((label-regexp (if label (format "\\[fn:%s[]:]" label) org-footnote-re))) + (catch :exit + (save-excursion + (while (funcall (if backward #'re-search-backward #'re-search-forward) + label-regexp limit t) (unless backward (backward-char)) - (let ((ref (org-footnote-at-reference-p))) - (when ref (throw 'exit ref)))))))) + (pcase (org-footnote-at-reference-p) + (`nil nil) + (reference (throw :exit reference)))))))) (defun org-footnote-next-reference-or-definition (limit) "Move point to next footnote reference or definition. @@ -488,8 +461,10 @@ LIMIT is the buffer position bounding the search. Return value is a list like those provided by `org-footnote-at-reference-p' or `org-footnote-at-definition-p'. -If no footnote is found, return nil." - (let* (ref (origin (point))) +If no footnote is found, return nil. + +This function is meant to be used for fontification only." + (let ((origin (point))) (catch 'exit (while t (unless (re-search-forward org-footnote-re limit t) @@ -499,15 +474,56 @@ If no footnote is found, return nil." ;; the closing square bracket. (backward-char) (cond - ((setq ref (org-footnote-at-reference-p)) - (throw 'exit ref)) + ((and (/= (match-beginning 0) (line-beginning-position)) + (let* ((beg (match-beginning 0)) + (label (match-string-no-properties 1)) + ;; Inline footnotes don't end at (match-end 0) + ;; as `org-footnote-re' stops just after the + ;; second colon. Find the real ending with + ;; `scan-sexps', so Org doesn't get fooled by + ;; unrelated closing square brackets. + (end (ignore-errors (scan-sexps beg 1)))) + (and end + ;; Verify match isn't a part of a link. + (not (save-excursion + (goto-char beg) + (let ((linkp + (save-match-data + (org-in-regexp org-bracket-link-regexp)))) + (and linkp (< (point) (cdr linkp)))))) + ;; Verify point doesn't belong to a LaTeX macro. + (not (org-inside-latex-macro-p)) + (throw 'exit + (list label beg end + ;; Definition: ensure this is an + ;; inline footnote first. + (and (match-end 2) + (org-trim + (buffer-substring-no-properties + (match-end 0) (1- end)))))))))) ;; Definition: also grab the last square bracket, matched in ;; `org-footnote-re' for non-inline footnotes. - ((save-match-data (org-footnote-at-definition-p)) - (let ((end (match-end 0))) - (throw 'exit - (list nil (match-beginning 0) - (if (eq (char-before end) ?\]) end (1+ end))))))))))) + ((and (save-excursion + (beginning-of-line) + (save-match-data (org-footnote-in-valid-context-p))) + (save-excursion + (end-of-line) + ;; Footnotes definitions are separated by new + ;; headlines, another footnote definition or 2 blank + ;; lines. + (let ((end (match-end 0)) + (lim (save-excursion + (re-search-backward + (concat org-outline-regexp-bol + "\\|^\\([ \t]*\n\\)\\{2,\\}") + nil t)))) + (and (re-search-backward org-footnote-definition-re lim t) + (throw 'exit + (list nil + (match-beginning 0) + (if (eq (char-before end) ?\]) end + (1+ end))))))))) + (t nil)))))) (defun org-footnote-goto-definition (label &optional location) "Move point to the definition of the footnote LABEL. @@ -528,7 +544,7 @@ value if point was successfully moved." (user-error "Definition is outside narrowed part of buffer"))) (org-mark-ring-push) (goto-char def-start) - (looking-at (format "\\[fn:%s[]:] ?" (regexp-quote label))) + (looking-at (format "\\[fn:%s[]:]" (regexp-quote label))) (goto-char (match-end 0)) (org-show-context 'link-search) (when (derived-mode-p 'org-mode) @@ -540,21 +556,23 @@ value if point was successfully moved." (defun org-footnote-goto-previous-reference (label) "Find the first closest (to point) reference of footnote with label LABEL." (interactive "sLabel: ") - (org-mark-ring-push) - (let ((label (org-footnote-normalize-label label)) - ref) - (save-excursion - (setq ref (or (org-footnote-get-next-reference label t) - (org-footnote-get-next-reference label) - (save-restriction - (widen) - (or - (org-footnote-get-next-reference label t) - (org-footnote-get-next-reference label)))))) - (if (not ref) - (error "Cannot find reference of footnote %s" label) - (goto-char (nth 1 ref)) - (org-show-context 'link-search)))) + (let* ((label (org-footnote-normalize-label label)) + (reference + (save-excursion + (or (org-footnote-get-next-reference label t) + (org-footnote-get-next-reference label) + (and (buffer-narrowed-p) + (org-with-wide-buffer + (or (org-footnote-get-next-reference label t) + (org-footnote-get-next-reference label))))))) + (start (nth 1 reference))) + (cond ((not reference) + (user-error "Cannot find reference of footnote %S" label)) + ((or (> start (point-max)) (< start (point-min))) + (user-error "Reference is outside narrowed part of buffer"))) + (org-mark-ring-push) + (goto-char start) + (org-show-context 'link-search))) ;;;; Getters @@ -636,7 +654,7 @@ or new, let the user edit the definition of the footnote." (let* ((all (org-footnote-all-labels)) (label (if (eq org-footnote-auto-label 'random) - (format "%x" (random most-positive-fixnum)) + (format "%x" (abs (random))) (org-footnote-normalize-label (let ((propose (org-footnote-unique-label all))) (if (eq org-footnote-auto-label t) propose @@ -676,21 +694,22 @@ Return buffer position at the beginning of the definition. This function doesn't move point." (let ((label (org-footnote-normalize-label label)) electric-indent-mode) ; Prevent wrong indentation. - (org-with-wide-buffer - (cond - ((not org-footnote-section) (org-footnote--goto-local-insertion-point)) - ((save-excursion - (goto-char (point-min)) - (re-search-forward - (concat "^\\*+[ \t]+" (regexp-quote org-footnote-section) "[ \t]*$") - nil t)) - (goto-char (match-end 0)) - (forward-line) - (unless (bolp) (insert "\n"))) - (t (org-footnote--clear-footnote-section))) - (when (zerop (org-back-over-empty-lines)) (insert "\n")) - (insert "[fn:" label "] \n") - (line-beginning-position 0)))) + (org-preserve-local-variables + (org-with-wide-buffer + (cond + ((not org-footnote-section) (org-footnote--goto-local-insertion-point)) + ((save-excursion + (goto-char (point-min)) + (re-search-forward + (concat "^\\*+[ \t]+" (regexp-quote org-footnote-section) "[ \t]*$") + nil t)) + (goto-char (match-end 0)) + (forward-line) + (unless (bolp) (insert "\n"))) + (t (org-footnote--clear-footnote-section))) + (when (zerop (org-back-over-empty-lines)) (insert "\n")) + (insert "[fn:" label "] \n") + (line-beginning-position 0))))) (defun org-footnote-delete-references (label) "Delete every reference to footnote LABEL. @@ -733,31 +752,32 @@ and all references of a footnote label. If LABEL is non-nil, delete that footnote instead." (catch 'done - (let* ((nref 0) (ndef 0) x - ;; 1. Determine LABEL of footnote at point. - (label (cond - ;; LABEL is provided as argument. - (label) - ;; Footnote reference at point. If the footnote is - ;; anonymous, delete it and exit instead. - ((setq x (org-footnote-at-reference-p)) - (or (car x) - (progn - (delete-region (nth 1 x) (nth 2 x)) - (message "Anonymous footnote removed") - (throw 'done t)))) - ;; Footnote definition at point. - ((setq x (org-footnote-at-definition-p)) - (car x)) - (t (error "Don't know which footnote to remove"))))) - ;; 2. Now that LABEL is non-nil, find every reference and every - ;; definition, and delete them. - (setq nref (org-footnote-delete-references label) - ndef (org-footnote-delete-definitions label)) - ;; 3. Verify consistency of footnotes and notify user. - (org-footnote-auto-adjust-maybe) - (message "%d definition(s) of and %d reference(s) of footnote %s removed" - ndef nref label)))) + (org-preserve-local-variables + (let* ((nref 0) (ndef 0) x + ;; 1. Determine LABEL of footnote at point. + (label (cond + ;; LABEL is provided as argument. + (label) + ;; Footnote reference at point. If the footnote is + ;; anonymous, delete it and exit instead. + ((setq x (org-footnote-at-reference-p)) + (or (car x) + (progn + (delete-region (nth 1 x) (nth 2 x)) + (message "Anonymous footnote removed") + (throw 'done t)))) + ;; Footnote definition at point. + ((setq x (org-footnote-at-definition-p)) + (car x)) + (t (error "Don't know which footnote to remove"))))) + ;; 2. Now that LABEL is non-nil, find every reference and every + ;; definition, and delete them. + (setq nref (org-footnote-delete-references label) + ndef (org-footnote-delete-definitions label)) + ;; 3. Verify consistency of footnotes and notify user. + (org-footnote-auto-adjust-maybe) + (message "%d definition(s) of and %d reference(s) of footnote %s removed" + ndef nref label))))) ;;;; Sorting, Renumbering, Normalizing @@ -765,28 +785,25 @@ If LABEL is non-nil, delete that footnote instead." (defun org-footnote-renumber-fn:N () "Order numbered footnotes into a sequence in the document." (interactive) - (let ((references (org-footnote--collect-references))) - (unwind-protect - (let* ((c 0) - (references (cl-remove-if-not - (lambda (r) (string-match-p "\\`[0-9]+\\'" (car r))) - references)) - (alist (mapcar (lambda (l) (cons l (number-to-string (cl-incf c)))) - (delete-dups (mapcar #'car references))))) - (org-with-wide-buffer - ;; Re-number references. - (dolist (ref references) - (goto-char (nth 1 ref)) - (org-footnote--set-label (cdr (assoc (nth 0 ref) alist)))) - ;; Re-number definitions. - (goto-char (point-min)) - (while (re-search-forward "^\\[fn:\\([0-9]+\\)\\]" nil t) - (replace-match (or (cdr (assoc (match-string 1) alist)) - ;; Un-referenced definitions get - ;; higher numbers. - (number-to-string (cl-incf c))) - nil nil nil 1)))) - (dolist (r references) (set-marker (nth 1 r) nil))))) + (let* ((c 0) + (references (cl-remove-if-not + (lambda (r) (string-match-p "\\`[0-9]+\\'" (car r))) + (org-footnote--collect-references))) + (alist (mapcar (lambda (l) (cons l (number-to-string (cl-incf c)))) + (delete-dups (mapcar #'car references))))) + (org-with-wide-buffer + ;; Re-number references. + (dolist (ref references) + (goto-char (nth 1 ref)) + (org-footnote--set-label (cdr (assoc (nth 0 ref) alist)))) + ;; Re-number definitions. + (goto-char (point-min)) + (while (re-search-forward "^\\[fn:\\([0-9]+\\)\\]" nil t) + (replace-match (or (cdr (assoc (match-string 1) alist)) + ;; Un-referenced definitions get higher + ;; numbers. + (number-to-string (cl-incf c))) + nil nil nil 1))))) (defun org-footnote-sort () "Rearrange footnote definitions in the current buffer. @@ -795,129 +812,121 @@ references. Also relocate definitions at the end of their relative section or within a single footnote section, according to `org-footnote-section'. Inline definitions are ignored." (let ((references (org-footnote--collect-references))) - (unwind-protect - (let ((definitions (org-footnote--collect-definitions 'delete))) - (org-with-wide-buffer - (org-footnote--clear-footnote-section) - ;; Insert footnote definitions at the appropriate location, - ;; separated by a blank line. Each definition is inserted - ;; only once throughout the buffer. - (let (inserted) - (dolist (cell references) - (let ((label (car cell)) - (nested (not (nth 2 cell))) - (inline (nth 3 cell))) - (unless (or (member label inserted) inline) - (push label inserted) - (unless (or org-footnote-section nested) - ;; If `org-footnote-section' is non-nil, or - ;; reference is nested, point is already at the - ;; correct position. Otherwise, move at the - ;; appropriate location within the section - ;; containing the reference. - (goto-char (nth 1 cell)) - (org-footnote--goto-local-insertion-point)) - (insert "\n" - (or (cdr (assoc label definitions)) - (format "[fn:%s] DEFINITION NOT FOUND." label)) - "\n")))) - ;; Insert un-referenced footnote definitions at the end. - (let ((unreferenced - (cl-remove-if (lambda (d) (member (car d) inserted)) - definitions))) - (dolist (d unreferenced) (insert "\n" (cdr d) "\n")))))) - ;; Clear dangling markers in the buffer. - (dolist (r references) (set-marker (nth 1 r) nil))))) + (org-preserve-local-variables + (let ((definitions (org-footnote--collect-definitions 'delete))) + (org-with-wide-buffer + (org-footnote--clear-footnote-section) + ;; Insert footnote definitions at the appropriate location, + ;; separated by a blank line. Each definition is inserted + ;; only once throughout the buffer. + (let (inserted) + (dolist (cell references) + (let ((label (car cell)) + (nested (not (nth 2 cell))) + (inline (nth 3 cell))) + (unless (or (member label inserted) inline) + (push label inserted) + (unless (or org-footnote-section nested) + ;; If `org-footnote-section' is non-nil, or + ;; reference is nested, point is already at the + ;; correct position. Otherwise, move at the + ;; appropriate location within the section + ;; containing the reference. + (goto-char (nth 1 cell)) + (org-footnote--goto-local-insertion-point)) + (insert "\n" + (or (cdr (assoc label definitions)) + (format "[fn:%s] DEFINITION NOT FOUND." label)) + "\n")))) + ;; Insert un-referenced footnote definitions at the end. + (pcase-dolist (`(,label . ,definition) definitions) + (unless (member label inserted) + (insert "\n" definition "\n"))))))))) (defun org-footnote-normalize () "Turn every footnote in buffer into a numbered one." (interactive) - (let ((references (org-footnote--collect-references 'anonymous))) - (unwind-protect - (let ((n 0) - (translations nil) - (definitions nil)) - (org-with-wide-buffer - ;; Update label for reference. We need to do this before - ;; clearing definitions in order to rename nested footnotes - ;; before they are deleted. - (dolist (cell references) - (let* ((label (car cell)) - (anonymous (not label)) - (new - (cond - ;; In order to differentiate anonymous - ;; references from regular ones, set their - ;; labels to integers, not strings. - (anonymous (setcar cell (cl-incf n))) - ((cdr (assoc label translations))) - (t (let ((l (number-to-string (cl-incf n)))) - (push (cons label l) translations) - l))))) - (goto-char (nth 1 cell)) ; Move to reference's start. - (org-footnote--set-label - (if anonymous (number-to-string new) new)) - (let ((size (nth 3 cell))) - ;; Transform inline footnotes into regular references - ;; and retain their definition for later insertion as - ;; a regular footnote definition. - (when size - (let ((def (concat - (format "[fn:%s] " new) - (org-trim - (substring - (delete-and-extract-region - (point) (+ (point) size 1)) - 1))))) - (push (cons (if anonymous new label) def) definitions) - (when org-footnote-fill-after-inline-note-extraction - (org-fill-paragraph))))))) - ;; Collect definitions. Update labels according to ALIST. - (let ((definitions - (nconc definitions - (org-footnote--collect-definitions 'delete))) - (inserted)) - (org-footnote--clear-footnote-section) - (dolist (cell references) - (let* ((label (car cell)) - (anonymous (integerp label)) - (pos (nth 1 cell))) - ;; Move to appropriate location, if required. When - ;; there is a footnote section or reference is - ;; nested, point is already at the expected location. - (unless (or org-footnote-section (not (nth 2 cell))) - (goto-char pos) - (org-footnote--goto-local-insertion-point)) - ;; Insert new definition once label is updated. - (unless (member label inserted) - (push label inserted) - (let ((stored (cdr (assoc label definitions))) - ;; Anonymous footnotes' label is already - ;; up-to-date. - (new (if anonymous label - (cdr (assoc label translations))))) - (insert "\n" - (cond - ((not stored) - (format "[fn:%s] DEFINITION NOT FOUND." new)) - (anonymous stored) - (t - (replace-regexp-in-string - "\\`\\[fn:\\(.*?\\)\\]" new stored nil nil 1))) - "\n"))))) - ;; Insert un-referenced footnote definitions at the end. - (let ((unreferenced - (cl-remove-if (lambda (d) (member (car d) inserted)) - definitions))) - (dolist (d unreferenced) - (insert "\n" - (replace-regexp-in-string - org-footnote-definition-re - (format "[fn:%d]" (cl-incf n)) - (cdr d)) - "\n")))))) - ;; Clear dangling markers. - (dolist (r references) (set-marker (nth 1 r) nil))))) + (org-preserve-local-variables + (let ((n 0) + (translations nil) + (definitions nil) + (references (org-footnote--collect-references 'anonymous))) + (org-with-wide-buffer + ;; Update label for reference. We need to do this before + ;; clearing definitions in order to rename nested footnotes + ;; before they are deleted. + (dolist (cell references) + (let* ((label (car cell)) + (anonymous (not label)) + (new + (cond + ;; In order to differentiate anonymous references + ;; from regular ones, set their labels to integers, + ;; not strings. + (anonymous (setcar cell (cl-incf n))) + ((cdr (assoc label translations))) + (t (let ((l (number-to-string (cl-incf n)))) + (push (cons label l) translations) + l))))) + (goto-char (nth 1 cell)) ; Move to reference's start. + (org-footnote--set-label + (if anonymous (number-to-string new) new)) + (let ((size (nth 3 cell))) + ;; Transform inline footnotes into regular references and + ;; retain their definition for later insertion as + ;; a regular footnote definition. + (when size + (let ((def (concat + (format "[fn:%s] " new) + (org-trim + (substring + (delete-and-extract-region + (point) (+ (point) size 1)) + 1))))) + (push (cons (if anonymous new label) def) definitions) + (when org-footnote-fill-after-inline-note-extraction + (org-fill-paragraph))))))) + ;; Collect definitions. Update labels according to ALIST. + (let ((definitions + (nconc definitions + (org-footnote--collect-definitions 'delete))) + (inserted)) + (org-footnote--clear-footnote-section) + (dolist (cell references) + (let* ((label (car cell)) + (anonymous (integerp label)) + (pos (nth 1 cell))) + ;; Move to appropriate location, if required. When there + ;; is a footnote section or reference is nested, point is + ;; already at the expected location. + (unless (or org-footnote-section (not (nth 2 cell))) + (goto-char pos) + (org-footnote--goto-local-insertion-point)) + ;; Insert new definition once label is updated. + (unless (member label inserted) + (push label inserted) + (let ((stored (cdr (assoc label definitions))) + ;; Anonymous footnotes' label is already + ;; up-to-date. + (new (if anonymous label + (cdr (assoc label translations))))) + (insert "\n" + (cond + ((not stored) + (format "[fn:%s] DEFINITION NOT FOUND." new)) + (anonymous stored) + (t + (replace-regexp-in-string + "\\`\\[fn:\\(.*?\\)\\]" new stored nil nil 1))) + "\n"))))) + ;; Insert un-referenced footnote definitions at the end. + (pcase-dolist (`(,label . ,definition) definitions) + (unless (member label inserted) + (insert "\n" + (replace-regexp-in-string org-footnote-definition-re + (format "[fn:%d]" (cl-incf n)) + definition) + "\n")))))))) (defun org-footnote-auto-adjust-maybe () "Renumber and/or sort footnotes according to user settings." diff --git a/elpa/org-20171030/org-gnus.el b/elpa/org-20190930/org-gnus.el similarity index 84% rename from elpa/org-20171030/org-gnus.el rename to elpa/org-20190930/org-gnus.el index 687bc08b..9e07500c 100644 --- a/elpa/org-20171030/org-gnus.el +++ b/elpa/org-20190930/org-gnus.el @@ -1,11 +1,11 @@ ;;; org-gnus.el --- Support for Links to Gnus Groups and Messages -*- lexical-binding: t; -*- -;; Copyright (C) 2004-2017 Free Software Foundation, Inc. +;; Copyright (C) 2004-2019 Free Software Foundation, Inc. ;; Author: Carsten Dominik ;; Tassilo Horn ;; Keywords: outlines, hypermedia, calendar, wp -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; ;; This file is part of GNU Emacs. ;; @@ -31,15 +31,32 @@ ;;; Code: -(require 'org) +(require 'gnus-sum) (require 'gnus-util) +(require 'nnheader) +(require 'nnir) +(require 'org) ;;; Declare external functions and variables +(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)) (declare-function message-fetch-field "message" (header &optional not-all)) +(declare-function message-generate-headers "message" (headers)) +(declare-function message-narrow-to-headers "message") +(declare-function message-tokenize-header "message" (header &optional separator)) +(declare-function message-unquote-tokens "message" (elems)) (declare-function nnvirtual-map-article "nnvirtual" (article)) +(defvar gnus-newsgroup-name) +(defvar gnus-summary-buffer) +(defvar gnus-other-frame-object) + ;;; Customization variables @@ -120,11 +137,20 @@ If `org-store-link' was called with a prefix arg the meaning of (let* ((group (pcase (gnus-find-method-for-group gnus-newsgroup-name) (`(nnvirtual . ,_) - (car (nnvirtual-map-article (gnus-summary-article-number)))) + (save-excursion + (car (nnvirtual-map-article (gnus-summary-article-number))))) (`(nnir . ,_) - (nnir-article-group (gnus-summary-article-number))) + (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))) @@ -217,7 +243,9 @@ If `org-store-link' was called with a prefix arg the meaning of (let ((articles 1) group-opened) (while (and (not group-opened) - ;; Stop on integer overflows. + ;; Stop on integer overflows. Note: We + ;; can drop this once we require at least + ;; Emacs 27, which supports bignums. (> articles 0)) (setq group-opened (gnus-group-read-group articles t group)) (setq articles (if (< articles 16) diff --git a/elpa/org-20190930/org-goto.el b/elpa/org-20190930/org-goto.el new file mode 100644 index 00000000..a399899c --- /dev/null +++ b/elpa/org-20190930/org-goto.el @@ -0,0 +1,314 @@ +;;; org-goto.el --- Fast navigation in an Org buffer -*- lexical-binding: t; -*- + +;; Copyright (C) 2012-2019 Free Software Foundation, Inc. + +;; Author: Carsten Dominik +;; Keywords: outlines, hypermedia, calendar, wp + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +;;; Code: + +(require 'org-macs) +(require 'org-compat) + +(declare-function org-at-heading-p "org" (&optional ignored)) +(declare-function org-beginning-of-line "org" (&optional n)) +(declare-function org-defkey "org" (keymap key def)) +(declare-function org-mark-ring-push "org" (&optional pos buffer)) +(declare-function org-overview "org" ()) +(declare-function org-refile-check-position "org" (refile-pointer)) +(declare-function org-refile-get-location "org" (&optional prompt default-buffer new-nodes)) +(declare-function org-show-context "org" (&optional key)) +(declare-function org-show-set-visibility "org" (detail)) + +(defvar org-complex-heading-regexp) +(defvar org-startup-align-all-tables) +(defvar org-startup-folded) +(defvar org-startup-truncated) +(defvar org-special-ctrl-a/e) +(defvar org-refile-target-verify-function) +(defvar org-refile-use-outline-path) +(defvar org-refile-targets) + +(defvar org-goto-exit-command nil) +(defvar org-goto-map nil) +(defvar org-goto-marker nil) +(defvar org-goto-selected-point nil) +(defvar org-goto-start-pos nil) +(defvar org-goto-window-configuration nil) + +(defconst org-goto-local-auto-isearch-map (make-sparse-keymap)) +(set-keymap-parent org-goto-local-auto-isearch-map isearch-mode-map) + +(defconst org-goto-help + "Browse buffer copy, to find location or copy text.%s +RET=jump to location C-g=quit and return to previous location +\[Up]/[Down]=next/prev headline TAB=cycle visibility [/] org-occur") + + + +;;; Customization + +(defgroup org-goto nil + "Options concerning Org Goto navigation interface." + :tag "Org Goto" + :group 'org) + +(defcustom org-goto-interface 'outline + "The default interface to be used for `org-goto'. + +Allowed values are: + +`outline' + + The interface shows an outline of the relevant file and the + correct heading is found by moving through the outline or by + searching with incremental search. + +`outline-path-completion' + + Headlines in the current buffer are offered via completion. + This is the interface also used by the refile command." + :group 'org-goto + :type '(choice + (const :tag "Outline" outline) + (const :tag "Outline-path-completion" outline-path-completion))) + +(defcustom org-goto-max-level 5 + "Maximum target level when running `org-goto' with refile interface." + :group 'org-goto + :type 'integer) + +(defcustom org-goto-auto-isearch t + "Non-nil means typing characters in `org-goto' starts incremental search. +When nil, you can use these keybindings to navigate the buffer: + + q Quit the Org Goto interface + n Go to the next visible heading + p Go to the previous visible heading + f Go one heading forward on same level + b Go one heading backward on same level + u Go one heading up" + :group 'org-goto + :type 'boolean) + + + +;;; Internal functions + +(defun org-goto--set-map () + "Set the keymap `org-goto'." + (setq org-goto-map + (let ((map (make-sparse-keymap))) + (let ((cmds '(isearch-forward isearch-backward kill-ring-save set-mark-command + mouse-drag-region universal-argument org-occur))) + (dolist (cmd cmds) + (substitute-key-definition cmd cmd map global-map))) + (suppress-keymap map) + (org-defkey map "\C-m" 'org-goto-ret) + (org-defkey map [(return)] 'org-goto-ret) + (org-defkey map [(left)] 'org-goto-left) + (org-defkey map [(right)] 'org-goto-right) + (org-defkey map [(control ?g)] 'org-goto-quit) + (org-defkey map "\C-i" 'org-cycle) + (org-defkey map [(tab)] 'org-cycle) + (org-defkey map [(down)] 'outline-next-visible-heading) + (org-defkey map [(up)] 'outline-previous-visible-heading) + (if org-goto-auto-isearch + (if (fboundp 'define-key-after) + (define-key-after map [t] 'org-goto-local-auto-isearch) + nil) + (org-defkey map "q" 'org-goto-quit) + (org-defkey map "n" 'outline-next-visible-heading) + (org-defkey map "p" 'outline-previous-visible-heading) + (org-defkey map "f" 'outline-forward-same-level) + (org-defkey map "b" 'outline-backward-same-level) + (org-defkey map "u" 'outline-up-heading)) + (org-defkey map "/" 'org-occur) + (org-defkey map "\C-c\C-n" 'outline-next-visible-heading) + (org-defkey map "\C-c\C-p" 'outline-previous-visible-heading) + (org-defkey map "\C-c\C-f" 'outline-forward-same-level) + (org-defkey map "\C-c\C-b" 'outline-backward-same-level) + (org-defkey map "\C-c\C-u" 'outline-up-heading) + map))) + +;; `isearch-other-control-char' was removed in Emacs 24.4. +(if (fboundp 'isearch-other-control-char) + (progn + (define-key org-goto-local-auto-isearch-map "\C-i" 'isearch-other-control-char) + (define-key org-goto-local-auto-isearch-map "\C-m" 'isearch-other-control-char)) + (define-key org-goto-local-auto-isearch-map "\C-i" nil) + (define-key org-goto-local-auto-isearch-map "\C-m" nil) + (define-key org-goto-local-auto-isearch-map [return] nil)) + +(defun org-goto--local-search-headings (string bound noerror) + "Search and make sure that any matches are in headlines." + (catch 'return + (while (if isearch-forward + (search-forward string bound noerror) + (search-backward string bound noerror)) + (when (save-match-data + (and (save-excursion + (beginning-of-line) + (looking-at org-complex-heading-regexp)) + (or (not (match-beginning 5)) + (< (point) (match-beginning 5))))) + (throw 'return (point)))))) + +(defun org-goto-local-auto-isearch () + "Start isearch." + (interactive) + (goto-char (point-min)) + (let ((keys (this-command-keys))) + (when (eq (lookup-key isearch-mode-map keys) 'isearch-printing-char) + (isearch-mode t) + (isearch-process-search-char (string-to-char keys)) + (org-font-lock-ensure)))) + +(defun org-goto-ret (&optional _arg) + "Finish `org-goto' by going to the new location." + (interactive "P") + (setq org-goto-selected-point (point)) + (setq org-goto-exit-command 'return) + (throw 'exit nil)) + +(defun org-goto-left () + "Finish `org-goto' by going to the new location." + (interactive) + (if (org-at-heading-p) + (progn + (beginning-of-line 1) + (setq org-goto-selected-point (point) + org-goto-exit-command 'left) + (throw 'exit nil)) + (user-error "Not on a heading"))) + +(defun org-goto-right () + "Finish `org-goto' by going to the new location." + (interactive) + (if (org-at-heading-p) + (progn + (setq org-goto-selected-point (point) + org-goto-exit-command 'right) + (throw 'exit nil)) + (user-error "Not on a heading"))) + +(defun org-goto-quit () + "Finish `org-goto' without cursor motion." + (interactive) + (setq org-goto-selected-point nil) + (setq org-goto-exit-command 'quit) + (throw 'exit nil)) + + + +;;; Public API + +;;;###autoload +(defun org-goto-location (&optional _buf help) + "Let the user select a location in current buffer. +This function uses a recursive edit. It returns the selected +position or nil." + (org-no-popups + (let ((isearch-mode-map org-goto-local-auto-isearch-map) + (isearch-hide-immediately nil) + (isearch-search-fun-function + (lambda () #'org-goto--local-search-headings)) + (org-goto-selected-point org-goto-exit-command) + (help (or help org-goto-help))) + (save-excursion + (save-window-excursion + (delete-other-windows) + (and (get-buffer "*org-goto*") (kill-buffer "*org-goto*")) + (pop-to-buffer-same-window + (condition-case nil + (make-indirect-buffer (current-buffer) "*org-goto*") + (error (make-indirect-buffer (current-buffer) "*org-goto*")))) + (let (temp-buffer-show-function temp-buffer-show-hook) + (with-output-to-temp-buffer "*Org Help*" + (princ (format help (if org-goto-auto-isearch + " Just type for auto-isearch." + " n/p/f/b/u to navigate, q to quit."))))) + (org-fit-window-to-buffer (get-buffer-window "*Org Help*")) + (setq buffer-read-only nil) + (let ((org-startup-truncated t) + (org-startup-folded nil) + (org-startup-align-all-tables nil)) + (org-mode) + (org-overview)) + (setq buffer-read-only t) + (if (and (boundp 'org-goto-start-pos) + (integer-or-marker-p org-goto-start-pos)) + (progn (goto-char org-goto-start-pos) + (when (org-invisible-p) + (org-show-set-visibility 'lineage))) + (goto-char (point-min))) + (let (org-special-ctrl-a/e) (org-beginning-of-line)) + (message "Select location and press RET") + (use-local-map org-goto-map) + (recursive-edit))) + (kill-buffer "*org-goto*") + (cons org-goto-selected-point org-goto-exit-command)))) + +;;;###autoload +(defun org-goto (&optional alternative-interface) + "Look up a different location in the current file, keeping current visibility. + +When you want look-up or go to a different location in a +document, the fastest way is often to fold the entire buffer and +then dive into the tree. This method has the disadvantage, that +the previous location will be folded, which may not be what you +want. + +This command works around this by showing a copy of the current +buffer in an indirect buffer, in overview mode. You can dive +into the tree in that copy, use org-occur and incremental search +to find a location. When pressing RET or `Q', the command +returns to the original buffer in which the visibility is still +unchanged. After RET it will also jump to the location selected +in the indirect buffer and expose the headline hierarchy above. + +With a prefix argument, use the alternative interface: e.g., if +`org-goto-interface' is `outline' use `outline-path-completion'." + (interactive "P") + (org-goto--set-map) + (let* ((org-refile-targets `((nil . (:maxlevel . ,org-goto-max-level)))) + (org-refile-use-outline-path t) + (org-refile-target-verify-function nil) + (interface + (if (not alternative-interface) + org-goto-interface + (if (eq org-goto-interface 'outline) + 'outline-path-completion + 'outline))) + (org-goto-start-pos (point)) + (selected-point + (if (eq interface 'outline) (car (org-goto-location)) + (let ((pa (org-refile-get-location "Goto"))) + (org-refile-check-position pa) + (nth 3 pa))))) + (if selected-point + (progn + (org-mark-ring-push org-goto-start-pos) + (goto-char selected-point) + (when (or (org-invisible-p) (org-invisible-p2)) + (org-show-context 'org-goto))) + (message "Quit")))) + +(provide 'org-goto) + +;;; org-goto.el ends here diff --git a/elpa/org-20171030/org-habit.el b/elpa/org-20190930/org-habit.el similarity index 98% rename from elpa/org-20171030/org-habit.el rename to elpa/org-20190930/org-habit.el index 89b75e6f..d19ab1b8 100644 --- a/elpa/org-20171030/org-habit.el +++ b/elpa/org-20190930/org-habit.el @@ -1,10 +1,10 @@ ;;; org-habit.el --- The habit tracking code for Org -*- lexical-binding: t; -*- -;; Copyright (C) 2009-2017 Free Software Foundation, Inc. +;; Copyright (C) 2009-2019 Free Software Foundation, Inc. ;; Author: John Wiegley ;; Keywords: outlines, hypermedia, calendar, wp -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; ;; This file is part of GNU Emacs. ;; @@ -288,7 +288,7 @@ Habits are assigned colors on the following basis: (deadline (if scheduled-days (+ scheduled-days (- d-repeat s-repeat)) (org-habit-deadline habit))) - (m-days (or now-days (time-to-days (current-time))))) + (m-days (or now-days (time-to-days nil)))) (cond ((< m-days scheduled) '(org-habit-clear-face . org-habit-clear-future-face)) @@ -406,8 +406,8 @@ current time." "Insert consistency graph for any habitual tasks." (let ((inhibit-read-only t) (buffer-invisibility-spec '(org-link)) - (moment (time-subtract (current-time) - (list 0 (* 3600 org-extend-today-until) 0)))) + (moment (org-time-subtract nil + (* 3600 org-extend-today-until)))) (save-excursion (goto-char (if line (point-at-bol) (point-min))) (while (not (eobp)) diff --git a/elpa/org-20171030/org-id.el b/elpa/org-20190930/org-id.el similarity index 96% rename from elpa/org-20171030/org-id.el rename to elpa/org-20190930/org-id.el index a508e761..ee131651 100644 --- a/elpa/org-20171030/org-id.el +++ b/elpa/org-20190930/org-id.el @@ -1,10 +1,10 @@ ;;; org-id.el --- Global identifiers for Org entries -*- lexical-binding: t; -*- ;; -;; Copyright (C) 2008-2017 Free Software Foundation, Inc. +;; Copyright (C) 2008-2019 Free Software Foundation, Inc. ;; ;; Author: Carsten Dominik ;; Keywords: outlines, hypermedia, calendar, wp -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; ;; This file is part of GNU Emacs. ;; @@ -73,6 +73,7 @@ (require 'org) (declare-function message-make-fqdn "message" ()) +(declare-function org-goto-location "org-goto" (&optional _buf help)) ;;; Customization @@ -83,8 +84,7 @@ (defcustom org-id-link-to-org-use-id nil "Non-nil means storing a link to an Org file will use entry IDs. -\\\ - +\\ The variable can have the following values: t Create an ID if needed to make a link to the current entry. @@ -160,9 +160,9 @@ to have no space characters in them." (defcustom org-id-include-domain nil "Non-nil means add the domain name to new IDs. This ensures global uniqueness of IDs, and is also suggested by -RFC 2445 in combination with RFC 822. This is only relevant if -`org-id-method' is `org'. When uuidgen is used, the domain will never -be added. +the relevant RFCs. This is relevant only if `org-id-method' is +`org'. When uuidgen is used, the domain will never be added. + The default is to not use this because we have no really good way to get the true domain, and Org entries will normally not be shared with enough people to make this necessary." @@ -242,7 +242,7 @@ Create an ID if necessary." "Get the ID property of the entry at point-or-marker POM. If POM is nil, refer to the entry at point. If the entry does not have an ID, the function returns nil. -However, when CREATE is non nil, create an ID if none is present already. +However, when CREATE is non-nil, create an ID if none is present already. PREFIX will be passed through to `org-id-new'. In any case, the ID of the entry is returned." (org-with-point-at pom @@ -276,9 +276,9 @@ If necessary, the ID is created." ;;;###autoload (defun org-id-get-with-outline-drilling () "Use an outline-cycling interface to retrieve the ID of an entry. -This only finds entries in the current buffer, using `org-get-location'. +This only finds entries in the current buffer, using `org-goto-location'. It returns the ID of the entry. If necessary, the ID is created." - (let* ((spos (org-get-location (current-buffer) org-goto-help)) + (let* ((spos (org-goto-location)) (pom (and spos (move-marker (make-marker) (car spos))))) (prog1 (org-id-get pom 'create) (move-marker pom nil)))) @@ -357,7 +357,7 @@ So a typical ID could look like \"Org:4nd91V40HI\"." "Return string with random (version 4) UUID." (let ((rnd (md5 (format "%s%s%s%s%s%s%s" (random) - (current-time) + (org-time-convert-to-list nil) (user-uid) (emacs-pid) (user-full-name) @@ -413,18 +413,21 @@ The input I may be a character, or a single-letter string." r)) (defun org-id-time-to-b36 (&optional time) - "Encode TIME as a 10-digit string. + "Encode TIME as a 12-digit string. This string holds the time to micro-second accuracy, and can be decoded using `org-id-decode'." - (setq time (or time (current-time))) + ;; FIXME: If TIME represents N seconds after the epoch, then + ;; this encoding assumes 0 <= N < 110075314176 = (* (expt 36 4) 65536), + ;; i.e., that TIME is from 1970-01-01 00:00:00 to 5458-02-23 20:09:36 UTC. + (setq time (org-time-convert-to-list nil)) (concat (org-id-int-to-b36 (nth 0 time) 4) (org-id-int-to-b36 (nth 1 time) 4) - (org-id-int-to-b36 (or (nth 2 time) 0) 4))) + (org-id-int-to-b36 (nth 2 time) 4))) (defun org-id-decode (id) "Split ID into the prefix and the time value that was used to create it. The return value is (prefix . time) where PREFIX is nil or a string, -and time is the usual three-integer representation of time." +and TIME is a Lisp time value (HI LO USEC)." (let (prefix time parts) (setq parts (org-split-string id ":")) (if (= 2 (length parts)) @@ -539,8 +542,7 @@ When FILES is given, scan these files instead." (with-temp-buffer (condition-case nil (progn - (insert-file-contents-literally org-id-locations-file) - (goto-char (point-min)) + (insert-file-contents org-id-locations-file) (setq org-id-locations (read (current-buffer)))) (error (message "Could not read org-id-values from %s. Setting it to nil." diff --git a/elpa/org-20171030/org-indent.el b/elpa/org-20190930/org-indent.el similarity index 84% rename from elpa/org-20171030/org-indent.el rename to elpa/org-20190930/org-indent.el index b34586e0..a69293a8 100644 --- a/elpa/org-20171030/org-indent.el +++ b/elpa/org-20190930/org-indent.el @@ -1,10 +1,10 @@ ;;; org-indent.el --- Dynamic indentation for Org -*- lexical-binding: t; -*- -;; Copyright (C) 2009-2017 Free Software Foundation, Inc. +;; Copyright (C) 2009-2019 Free Software Foundation, Inc. ;; ;; Author: Carsten Dominik ;; Keywords: outlines, hypermedia, calendar, wp -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; ;; This file is part of GNU Emacs. ;; @@ -150,15 +150,16 @@ useful to make it ever so slightly different." ;; Text line prefixes. (aset org-indent--text-line-prefixes n - (concat (org-add-props (make-string (+ n indentation) ?\s) - nil 'face 'org-indent) - (and (> n 0) - (char-to-string org-indent-boundary-char))))))) + (org-add-props + (concat (make-string (+ n indentation) ?\s) + (and (> n 0) + (char-to-string org-indent-boundary-char))) + nil 'face 'org-indent))))) (defsubst org-indent-remove-properties (beg end) "Remove indentations between BEG and END." - (org-with-silent-modifications - (remove-text-properties beg end '(line-prefix nil wrap-prefix nil)))) + (with-silent-modifications + (remove-text-properties beg end '(line-prefix nil wrap-prefix nil)))) ;;;###autoload (define-minor-mode org-indent-mode @@ -183,11 +184,15 @@ during idle time." org-hide-leading-stars) (setq-local org-hide-leading-stars t)) (org-indent--compute-prefixes) - (add-hook 'filter-buffer-substring-functions - (lambda (fun start end delete) - (org-indent-remove-properties-from-string - (funcall fun start end delete))) - nil t) + (if (boundp 'filter-buffer-substring-functions) + (add-hook 'filter-buffer-substring-functions + (lambda (fun start end delete) + (org-indent-remove-properties-from-string + (funcall fun start end delete))) + nil t) + ;; Emacs >= 24.4. + (add-function :filter-return (local 'filter-buffer-substring-function) + #'org-indent-remove-properties-from-string)) (add-hook 'after-change-functions 'org-indent-refresh-maybe nil 'local) (add-hook 'before-change-functions 'org-indent-notify-modified-headline nil 'local) @@ -211,10 +216,13 @@ during idle time." (when (boundp 'org-hide-leading-stars-before-indent-mode) (setq-local org-hide-leading-stars org-hide-leading-stars-before-indent-mode)) - (remove-hook 'filter-buffer-substring-functions - (lambda (fun start end delete) - (org-indent-remove-properties-from-string - (funcall fun start end delete)))) + (if (boundp 'filter-buffer-substring-functions) + (remove-hook 'filter-buffer-substring-functions + (lambda (fun start end delete) + (org-indent-remove-properties-from-string + (funcall fun start end delete)))) + (remove-function (local 'filter-buffer-substring-function) + #'org-indent-remove-properties-from-string)) (remove-hook 'after-change-functions 'org-indent-refresh-maybe 'local) (remove-hook 'before-change-functions 'org-indent-notify-modified-headline 'local) @@ -291,7 +299,7 @@ LEVEL is the current level of heading. INDENTATION is the expected indentation when wrapping line. When optional argument HEADING is non-nil, assume line is at -a heading. Moreover, if is is `inlinetask', the first star will +a heading. Moreover, if it is `inlinetask', the first star will have `org-warning' face." (let* ((line (aref (pcase heading (`nil org-indent--text-line-prefixes) @@ -325,39 +333,39 @@ stopped." (let* ((case-fold-search t) (limited-re (org-get-limited-outline-regexp)) (level (or (org-current-level) 0)) - (time-limit (and delay (time-add (current-time) delay)))) + (time-limit (and delay (org-time-add nil delay)))) ;; For each line, set `line-prefix' and `wrap-prefix' ;; properties depending on the type of line (headline, inline ;; task, item or other). - (org-with-silent-modifications - (while (and (<= (point) end) (not (eobp))) - (cond - ;; When in asynchronous mode, check if interrupt is - ;; required. - ((and delay (input-pending-p)) (throw 'interrupt (point))) - ;; In asynchronous mode, take a break of - ;; `org-indent-agent-resume-delay' every DELAY to avoid - ;; blocking any other idle timer or process output. - ((and delay (time-less-p time-limit (current-time))) - (setq org-indent-agent-resume-timer - (run-with-idle-timer - (time-add (current-idle-time) org-indent-agent-resume-delay) - nil #'org-indent-initialize-agent)) - (throw 'interrupt (point))) - ;; Headline or inline task. - ((looking-at org-outline-regexp) - (let* ((nstars (- (match-end 0) (match-beginning 0) 1)) - (type (or (looking-at-p limited-re) 'inlinetask))) - (org-indent-set-line-properties nstars 0 type) - ;; At an headline, define new value for LEVEL. - (unless (eq type 'inlinetask) (setq level nstars)))) - ;; List item: `wrap-prefix' is set where body starts. - ((org-at-item-p) - (org-indent-set-line-properties - level (org-list-item-body-column (point)))) - ;; Regular line. - (t - (org-indent-set-line-properties level (org-get-indentation)))))))))) + (with-silent-modifications + (while (and (<= (point) end) (not (eobp))) + (cond + ;; When in asynchronous mode, check if interrupt is + ;; required. + ((and delay (input-pending-p)) (throw 'interrupt (point))) + ;; In asynchronous mode, take a break of + ;; `org-indent-agent-resume-delay' every DELAY to avoid + ;; blocking any other idle timer or process output. + ((and delay (org-time-less-p time-limit nil)) + (setq org-indent-agent-resume-timer + (run-with-idle-timer + (time-add (current-idle-time) org-indent-agent-resume-delay) + nil #'org-indent-initialize-agent)) + (throw 'interrupt (point))) + ;; Headline or inline task. + ((looking-at org-outline-regexp) + (let* ((nstars (- (match-end 0) (match-beginning 0) 1)) + (type (or (looking-at-p limited-re) 'inlinetask))) + (org-indent-set-line-properties nstars 0 type) + ;; At an headline, define new value for LEVEL. + (unless (eq type 'inlinetask) (setq level nstars)))) + ;; List item: `wrap-prefix' is set where body starts. + ((org-at-item-p) + (org-indent-set-line-properties + level (org-list-item-body-column (point)))) + ;; Regular line. + (t + (org-indent-set-line-properties level (current-indentation)))))))))) (defun org-indent-notify-modified-headline (beg end) "Set `org-indent-modified-headline-flag' depending on context. diff --git a/elpa/org-20171030/org-info.el b/elpa/org-20190930/org-info.el similarity index 96% rename from elpa/org-20171030/org-info.el rename to elpa/org-20190930/org-info.el index 7f859f90..e21ac6b8 100644 --- a/elpa/org-20171030/org-info.el +++ b/elpa/org-20190930/org-info.el @@ -1,10 +1,10 @@ ;;; org-info.el --- Support for Links to Info Nodes -*- lexical-binding: t; -*- -;; Copyright (C) 2004-2017 Free Software Foundation, Inc. +;; Copyright (C) 2004-2019 Free Software Foundation, Inc. ;; Author: Carsten Dominik ;; Keywords: outlines, hypermedia, calendar, wp -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; ;; This file is part of GNU Emacs. ;; @@ -66,7 +66,7 @@ (defun org-info-follow-link (name) "Follow an Info file and node link specified by NAME." - (if (or (string-match "\\(.*\\)[#:]:?\\(.*\\)" name) + (if (or (string-match "\\(.*\\)\\(?:#\\|::\\)\\(.*\\)" name) (string-match "\\(.*\\)" name)) (let ((filename (match-string 1 name)) (nodename-or-index (or (match-string 2 name) "Top"))) @@ -129,7 +129,7 @@ See `org-info-emacs-documents' and `org-info-other-documents' for details." (defun org-info-export (path desc format) "Export an info link. See `org-link-parameters' for details about PATH, DESC and FORMAT." - (let* ((parts (split-string path "[#:]:?")) + (let* ((parts (split-string path "#\\|::")) (manual (car parts)) (node (or (nth 1 parts) "Top"))) (pcase format diff --git a/elpa/org-20171030/org-inlinetask.el b/elpa/org-20190930/org-inlinetask.el similarity index 83% rename from elpa/org-20171030/org-inlinetask.el rename to elpa/org-20190930/org-inlinetask.el index 4a8e43db..775facd2 100644 --- a/elpa/org-20171030/org-inlinetask.el +++ b/elpa/org-20190930/org-inlinetask.el @@ -1,10 +1,10 @@ ;;; org-inlinetask.el --- Tasks Independent of Outline Hierarchy -*- lexical-binding: t; -*- -;; Copyright (C) 2009-2017 Free Software Foundation, Inc. +;; Copyright (C) 2009-2019 Free Software Foundation, Inc. ;; ;; Author: Carsten Dominik ;; Keywords: outlines, hypermedia, calendar, wp -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; This file is part of GNU Emacs. @@ -40,9 +40,9 @@ ;; parent into children. ;; ;; Special fontification of inline tasks, so that they can be -;; immediately recognized. From the stars of the headline, only the -;; first and the last two will be visible, the others will be hidden -;; using the `org-hide' face. +;; immediately recognized. From the stars of the headline, only last +;; two will be visible, the others will be hidden using the `org-hide' +;; face. ;; ;; An inline task is identified solely by a minimum outline level, ;; given by the variable `org-inlinetask-min-level', default 15. @@ -54,14 +54,14 @@ ;; ;; As an example, here are two valid inline tasks: ;; -;; **************** TODO a small task +;; **************** TODO A small task ;; ;; and ;; -;; **************** TODO another small task +;; **************** TODO Another small task ;; DEADLINE: <2009-03-30 Mon> ;; :PROPERTIES: -;; :SOMETHING: or other +;; :SOMETHING: another thing ;; :END: ;; And here is some extra text ;; **************** END @@ -123,7 +123,8 @@ default, or nil if no state should be assigned." (defun org-inlinetask-insert-task (&optional no-state) "Insert an inline task. -If prefix arg NO-STATE is set, ignore `org-inlinetask-default-state'." +If prefix arg NO-STATE is set, ignore `org-inlinetask-default-state'. +If there is a region wrap it inside the inline task." (interactive "P") ;; Error when inside an inline task, except if point was at its very ;; beginning, in which case the new inline task will be inserted @@ -135,13 +136,19 @@ If prefix arg NO-STATE is set, ignore `org-inlinetask-default-state'." (let* ((indent (if org-odd-levels-only (1- (* 2 org-inlinetask-min-level)) org-inlinetask-min-level)) - (indent-string (concat (make-string indent ?*) " "))) + (indent-string (concat (make-string indent ?*) " ")) + (rbeg (if (org-region-active-p) (region-beginning) (point))) + (rend (if (org-region-active-p) (region-end) (point)))) + (goto-char rend) + (insert "\n" indent-string "END\n") + (goto-char rbeg) + (unless (bolp) (insert "\n")) (insert indent-string (if (or no-state (not org-inlinetask-default-state)) - "\n" - (concat org-inlinetask-default-state " \n")) - indent-string "END\n")) - (end-of-line -1)) + "" + (concat org-inlinetask-default-state " ")) + (if (= rend rbeg) "" "\n")) + (unless (= rend rbeg) (end-of-line 0)))) (define-key org-mode-map "\C-c\C-xt" 'org-inlinetask-insert-task) (defun org-inlinetask-outline-regexp () @@ -152,24 +159,24 @@ The number of levels is controlled by `org-inlinetask-min-level'." org-inlinetask-min-level))) (format "^\\(\\*\\{%d,\\}\\)[ \t]+" nstars))) +(defun org-inlinetask-end-p () + "Return a non-nil value if point is on inline task's END part." + (let ((case-fold-search t)) + (org-match-line (concat (org-inlinetask-outline-regexp) "END[ \t]*$")))) + (defun org-inlinetask-at-task-p () - "Return true if point is at beginning of an inline task." - (save-excursion - (beginning-of-line) - (and (looking-at (concat (org-inlinetask-outline-regexp) "\\(.*\\)")) - (not (string-match "^end[ \t]*$" (downcase (match-string 2))))))) + "Return non-nil if point is at beginning of an inline task." + (and (org-match-line (concat (org-inlinetask-outline-regexp) "\\(.*\\)")) + (not (org-inlinetask-end-p)))) (defun org-inlinetask-in-task-p () "Return true if point is inside an inline task." (save-excursion (beginning-of-line) - (let* ((case-fold-search t) - (stars-re (org-inlinetask-outline-regexp)) - (task-beg-re (concat stars-re "\\(?:.*\\)")) - (task-end-re (concat stars-re "END[ \t]*$"))) - (or (looking-at-p task-beg-re) + (let ((case-fold-search t)) + (or (looking-at-p (concat (org-inlinetask-outline-regexp) "\\(?:.*\\)")) (and (re-search-forward "^\\*+[ \t]+" nil t) - (progn (beginning-of-line) (looking-at-p task-end-re))))))) + (org-inlinetask-end-p)))))) (defun org-inlinetask-goto-beginning () "Go to the beginning of the inline task at point." @@ -177,29 +184,32 @@ The number of levels is controlled by `org-inlinetask-min-level'." (let ((case-fold-search t) (inlinetask-re (org-inlinetask-outline-regexp))) (re-search-backward inlinetask-re nil t) - (when (looking-at-p (concat inlinetask-re "END[ \t]*$")) + (when (org-inlinetask-end-p) (re-search-backward inlinetask-re nil t)))) (defun org-inlinetask-goto-end () "Go to the end of the inline task at point. -Return point." + Return point." (save-match-data (beginning-of-line) - (let* ((case-fold-search t) - (inlinetask-re (org-inlinetask-outline-regexp)) - (task-end-re (concat inlinetask-re "END[ \t]*$"))) + (let ((case-fold-search t) + (inlinetask-re (org-inlinetask-outline-regexp))) (cond - ((looking-at task-end-re)) - ((looking-at inlinetask-re) - (forward-line) - (cond - ((looking-at task-end-re)) - ((looking-at inlinetask-re)) - ((org-inlinetask-in-task-p) - (re-search-forward inlinetask-re nil t)))) - (t (re-search-forward inlinetask-re nil t))) - (end-of-line) - (point)))) + ((org-inlinetask-end-p) + (forward-line)) + ((looking-at-p inlinetask-re) + (forward-line) + (cond + ((org-inlinetask-end-p) (forward-line)) + ((looking-at-p inlinetask-re)) + ((org-inlinetask-in-task-p) + (re-search-forward inlinetask-re nil t) + (forward-line)) + (t nil))) + (t + (re-search-forward inlinetask-re nil t) + (forward-line))))) + (point)) (defun org-inlinetask-get-task-level () "Get the level of the inline task around. @@ -313,9 +323,8 @@ If the task has an end part, also demote it." ((= end start)) ;; Inlinetask was folded: expand it. ((eq (get-char-property (1+ start) 'invisible) 'outline) - (outline-flag-region start end nil) - (org-cycle-hide-drawers 'children)) - (t (outline-flag-region start end t))))) + (org-flag-region start end nil 'outline)) + (t (org-flag-region start end t 'outline))))) (defun org-inlinetask-hide-tasks (state) "Hide inline tasks in buffer when STATE is `contents' or `children'. @@ -330,7 +339,9 @@ This function is meant to be used in `org-cycle-hook'." (org-inlinetask-goto-end))))) (`children (save-excursion - (while (and (outline-next-heading) (org-inlinetask-at-task-p)) + (while + (or (org-inlinetask-at-task-p) + (and (outline-next-heading) (org-inlinetask-at-task-p))) (org-inlinetask-toggle-visibility) (org-inlinetask-goto-end)))))) diff --git a/elpa/org-20171030/org-install.el b/elpa/org-20190930/org-install.el similarity index 100% rename from elpa/org-20171030/org-install.el rename to elpa/org-20190930/org-install.el diff --git a/elpa/org-20171030/org-irc.el b/elpa/org-20190930/org-irc.el similarity index 93% rename from elpa/org-20171030/org-irc.el rename to elpa/org-20190930/org-irc.el index 5889f6d2..dd8fd161 100644 --- a/elpa/org-20171030/org-irc.el +++ b/elpa/org-20190930/org-irc.el @@ -1,6 +1,6 @@ ;;; org-irc.el --- Store Links to IRC Sessions -*- lexical-binding: t; -*- ;; -;; Copyright (C) 2008-2017 Free Software Foundation, Inc. +;; Copyright (C) 2008-2019 Free Software Foundation, Inc. ;; ;; Author: Philip Jackson ;; Keywords: erc, irc, link, org @@ -50,18 +50,20 @@ (require 'org) -;; Declare the function form ERC that we use. +(declare-function erc-buffer-filter "erc" (predicate &optional proc)) +(declare-function erc-channel-p "erc" (channel)) +(declare-function erc-cmd-JOIN "erc" (channel &optional key)) (declare-function erc-current-logfile "erc-log" (&optional buffer)) -(declare-function erc-prompt "erc" ()) (declare-function erc-default-target "erc" ()) -(declare-function erc-channel-p "erc" (channel)) -(declare-function erc-buffer-filter "erc" (predicate &optional proc)) -(declare-function erc-server-buffer "erc" ()) (declare-function erc-get-server-nickname-list "erc" ()) -(declare-function erc-cmd-JOIN "erc" (channel &optional key)) +(declare-function erc-logging-enabled "erc-log" (&optional buffer)) +(declare-function erc-prompt "erc" ()) +(declare-function erc-save-buffer-in-logs "erc-log" (&optional buffer)) +(declare-function erc-server-buffer "erc" ()) (defvar org-irc-client 'erc "The IRC client to act on.") + (defvar org-irc-link-to-logs nil "Non-nil will store a link to the logs, nil will store an irc: style link.") @@ -71,7 +73,10 @@ ;; Generic functions/config (extend these for other clients) -(org-link-set-parameters "irc" :follow #'org-irc-visit :store #'org-irc-store-link) +(org-link-set-parameters "irc" + :follow #'org-irc-visit + :store #'org-irc-store-link + :export #'org-irc-export) (defun org-irc-visit (link) "Parse LINK and dispatch to the correct function based on the client found." @@ -245,6 +250,16 @@ default." ;; no server match, make new connection (erc-select :server server :port port)))) +(defun org-irc-export (link description format) + "Export an IRC link. +See `org-link-parameters' for details about LINK, DESCRIPTION and +FORMAT." + (let ((desc (or description link))) + (pcase format + (`html (format "%s" link desc)) + (`md (format "[%s](irc:%s)" desc link)) + (_ nil)))) + (provide 'org-irc) ;; Local variables: diff --git a/elpa/org-20171030/org-lint.el b/elpa/org-20190930/org-lint.el similarity index 97% rename from elpa/org-20171030/org-lint.el rename to elpa/org-20190930/org-lint.el index 8372ae0f..95cbb8dc 100644 --- a/elpa/org-20171030/org-lint.el +++ b/elpa/org-20190930/org-lint.el @@ -1,6 +1,6 @@ ;;; org-lint.el --- Linting for Org documents -*- lexical-binding: t; -*- -;; Copyright (C) 2015-2017 Free Software Foundation, Inc. +;; Copyright (C) 2015-2019 Free Software Foundation, Inc. ;; Author: Nicolas Goaziou ;; Keywords: outlines, hypermedia, calendar, wp @@ -69,13 +69,13 @@ ;; - duplicate footnote definitions ;; - orphaned affiliated keywords ;; - obsolete affiliated keywords -;; - missing language in src blocks +;; - missing language in source blocks ;; - missing back-end in export blocks ;; - invalid Babel call blocks ;; - NAME values with a colon ;; - deprecated export block syntax ;; - deprecated Babel header properties -;; - wrong header arguments in src blocks +;; - wrong header arguments in source blocks ;; - misuse of CATEGORY keyword ;; - "coderef" links with unknown destination ;; - "custom-id" links with unknown destination @@ -100,7 +100,7 @@ ;; - indented diary-sexps ;; - obsolete QUOTE section ;; - obsolete "file+application" link -;; - blank headlines with tags +;; - spurious colons in tags ;;; Code: @@ -162,7 +162,7 @@ :trust 'low) (make-org-lint-checker :name 'missing-language-in-src-block - :description "Report missing language in src blocks" + :description "Report missing language in source blocks" :categories '(babel)) (make-org-lint-checker :name 'missing-backend-in-export-block @@ -288,10 +288,8 @@ :description "Report obsolete \"file+application\" link" :categories '(link obsolete)) (make-org-lint-checker - :name 'empty-headline-with-tags - :description "Report ambiguous empty headlines with tags" - :categories '(headline) - :trust 'low)) + :name 'spurious-colons + :description "Report spurious colons in tags")) "List of all available checkers.") (defun org-lint--collect-duplicates @@ -560,8 +558,8 @@ Use :header-args: instead" (defun org-lint-link-to-local-file (ast) (org-element-map ast 'link (lambda (l) - (when (equal (org-element-property :type l) "file") - (let ((file (org-link-unescape (org-element-property :path l)))) + (when (equal "file" (org-element-property :type l)) + (let ((file (org-element-property :path l))) (and (not (file-remote-p file)) (not (file-exists-p file)) (list (org-element-property :begin l) @@ -576,12 +574,13 @@ Use :header-args: instead" (lambda (k) (when (equal (org-element-property :key k) "SETUPFILE") (let ((file (org-unbracket-string - "\"" "\"" - (org-element-property :value k)))) - (and (not (file-remote-p file)) + "\"" "\"" + (org-element-property :value k)))) + (and (not (org-file-url-p file)) + (not (file-remote-p file)) (not (file-exists-p file)) (list (org-element-property :begin k) - (format "Non-existent setup file \"%s\"" file)))))))) + (format "Non-existent setup file %S" file)))))))) (defun org-lint-wrong-include-link-parameter (ast) (org-element-map ast 'keyword @@ -591,7 +590,7 @@ Use :header-args: instead" (path (and (string-match "^\\(\".+\"\\|\\S-+\\)[ \t]*" value) (save-match-data - (org-unbracket-string "\"" "\"" (match-string 1 value)))))) + (org-strip-quotes (match-string 1 value)))))) (if (not path) (list (org-element-property :post-affiliated k) "Missing location argument in INCLUDE keyword") @@ -1037,14 +1036,13 @@ Use \"export %s\" instead" reports)))))))))))) reports)) -(defun org-lint-empty-headline-with-tags (ast) +(defun org-lint-spurious-colons (ast) (org-element-map ast '(headline inlinetask) (lambda (h) - (let ((title (org-element-property :raw-value h))) - (and (string-match-p "\\`:[[:alnum:]_@#%:]+:\\'" title) - (list (org-element-property :begin h) - (format "Headline containing only tags is ambiguous: %S" - title))))))) + (when (member "" (org-element-property :tags h)) + (list (org-element-property :begin h) + "Tags contain a spurious colon"))))) + ;;; Reports UI diff --git a/elpa/org-20171030/org-list.el b/elpa/org-20190930/org-list.el similarity index 94% rename from elpa/org-20171030/org-list.el rename to elpa/org-20190930/org-list.el index 8ea569f9..2a95947c 100644 --- a/elpa/org-20171030/org-list.el +++ b/elpa/org-20190930/org-list.el @@ -1,11 +1,11 @@ ;;; org-list.el --- Plain lists for Org -*- lexical-binding: t; -*- ;; -;; Copyright (C) 2004-2017 Free Software Foundation, Inc. +;; Copyright (C) 2004-2019 Free Software Foundation, Inc. ;; ;; Author: Carsten Dominik ;; Bastien Guerry ;; Keywords: outlines, hypermedia, calendar, wp -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; ;; This file is part of GNU Emacs. ;; @@ -91,6 +91,7 @@ (defvar org-drawer-regexp) (defvar org-element-all-objects) (defvar org-inhibit-startup) +(defvar org-loop-over-headlines-in-active-region) (defvar org-odd-levels-only) (defvar org-outline-regexp-bol) (defvar org-scheduled-string) @@ -101,42 +102,31 @@ (declare-function org-at-heading-p "org" (&optional invisible-ok)) (declare-function org-back-to-heading "org" (&optional invisible-ok)) (declare-function org-before-first-heading-p "org" ()) -(declare-function org-combine-plists "org" (&rest plists)) (declare-function org-current-level "org" ()) (declare-function org-element-at-point "org-element" ()) (declare-function org-element-context "org-element" (&optional element)) (declare-function org-element-interpret-data "org-element" (data)) -(declare-function - org-element-lineage "org-element" (blob &optional types with-self)) +(declare-function org-element-lineage "org-element" (blob &optional types with-self)) (declare-function org-element-macro-interpreter "org-element" (macro ##)) -(declare-function - org-element-map "org-element" - (data types fun &optional info first-match no-recursion with-affiliated)) +(declare-function org-element-map "org-element" (data types fun &optional info first-match no-recursion with-affiliated)) (declare-function org-element-normalize-string "org-element" (s)) -(declare-function org-element-parse-buffer "org-element" - (&optional granularity visible-only)) +(declare-function org-element-parse-buffer "org-element" (&optional granularity visible-only)) (declare-function org-element-property "org-element" (property element)) -(declare-function org-element-put-property "org-element" - (element property value)) +(declare-function org-element-put-property "org-element" (element property value)) (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-entry-get "org" - (pom property &optional inherit literal-nil)) +(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) (declare-function org-export-data-with-backend "ox" (data backend info)) (declare-function org-export-get-backend "ox" (name)) -(declare-function org-export-get-environment "ox" - (&optional backend subtreep ext-plist)) -(declare-function org-export-get-next-element "ox" - (blob info &optional n)) -(declare-function org-export-with-backend "ox" - (backend data &optional contents info)) +(declare-function org-export-get-environment "ox" (&optional backend subtreep ext-plist)) +(declare-function org-export-get-next-element "ox" (blob info &optional n)) +(declare-function org-export-with-backend "ox" (backend data &optional contents info)) (declare-function org-fix-tags-on-the-fly "org" ()) -(declare-function org-get-indentation "org" (&optional line)) (declare-function org-get-todo-state "org" ()) (declare-function org-in-block-p "org" (names)) -(declare-function org-in-regexp "org" (re &optional nlines visually)) (declare-function org-inlinetask-goto-beginning "org-inlinetask" ()) (declare-function org-inlinetask-goto-end "org-inlinetask" ()) (declare-function org-inlinetask-in-task-p "org-inlinetask" ()) @@ -146,16 +136,12 @@ (declare-function org-outline-level "org" ()) (declare-function org-previous-line-empty-p "org" ()) (declare-function org-reduced-level "org" (L)) -(declare-function org-remove-indentation "org" (code &optional n)) +(declare-function org-set-tags "org" (tags)) (declare-function org-show-subtree "org" ()) (declare-function org-sort-remove-invisible "org" (S)) -(declare-function org-time-string-to-seconds "org" (s &optional zone)) +(declare-function org-time-string-to-seconds "org" (s)) (declare-function org-timer-hms-to-secs "org-timer" (hms)) (declare-function org-timer-item "org-timer" (&optional arg)) -(declare-function org-trim "org" (s &optional keep-lead)) -(declare-function org-uniquify "org" (list)) -(declare-function org-invisible-p "org" (&optional pos)) -(declare-function outline-flag-region "outline" (from to flag)) (declare-function outline-next-heading "outline" ()) (declare-function outline-previous-heading "outline" ()) @@ -235,7 +221,7 @@ into (defcustom org-plain-list-ordered-item-terminator t "The character that makes a line with leading number an ordered list item. -Valid values are ?. and ?\). To get both terminators, use t. +Valid values are ?. and ?\\). To get both terminators, use t. This variable needs to be set before org.el is loaded. If you need to make a change while Emacs is running, use the customize @@ -347,7 +333,8 @@ with the word \"recursive\" in the value." When the indentation would be larger than this, it will become 5 characters instead." :group 'org-plain-lists - :type 'integer) + :type 'integer + :safe #'wholenump) (defcustom org-list-indent-offset 0 "Additional indentation for sub-items in a list. @@ -357,33 +344,6 @@ clearly distinguish sub-items in a list." :version "24.1" :type 'integer) -(defcustom org-list-radio-list-templates - '((latex-mode "% BEGIN RECEIVE ORGLST %n -% END RECEIVE ORGLST %n -\\begin{comment} -#+ORGLST: SEND %n org-list-to-latex -- -\\end{comment}\n") - (texinfo-mode "@c BEGIN RECEIVE ORGLST %n -@c END RECEIVE ORGLST %n -@ignore -#+ORGLST: SEND %n org-list-to-texinfo -- -@end ignore\n") - (html-mode " - -\n")) - "Templates for radio lists in different major modes. -All occurrences of %n in a template will be replaced with the name of the -list, obtained by prompting the user." - :group 'org-plain-lists - :type '(repeat - (list (symbol :tag "Major mode") - (string :tag "Format")))) - (defvar org-list-forbidden-blocks '("example" "verse" "src" "export") "Names of blocks where lists are not allowed. Names must be in lower case.") @@ -461,7 +421,7 @@ group 4: description tag") (ind-ref (if (or (looking-at "^[ \t]*$") (and inlinetask-re (looking-at inlinetask-re))) 10000 - (org-get-indentation)))) + (current-indentation)))) (cond ((eq (nth 2 context) 'invalid) nil) ((looking-at item-re) (point)) @@ -483,7 +443,7 @@ group 4: description tag") ;; Look for an item, less indented that reference line. (catch 'exit (while t - (let ((ind (org-get-indentation))) + (let ((ind (current-indentation))) (cond ;; This is exactly what we want. ((and (looking-at item-re) (< ind ind-ref)) @@ -653,7 +613,7 @@ Assume point is at an item." (item-re (org-item-re)) (inlinetask-re (and (featurep 'org-inlinetask) (org-inlinetask-outline-regexp))) - (beg-cell (cons (point) (org-get-indentation))) + (beg-cell (cons (point) (current-indentation))) itm-lst itm-lst-2 end-lst end-lst-2 struct (assoc-at-point (function @@ -681,7 +641,7 @@ Assume point is at an item." (save-excursion (catch 'exit (while t - (let ((ind (org-get-indentation))) + (let ((ind (current-indentation))) (cond ((<= (point) lim-up) ;; At upward limit: if we ended at an item, store it, @@ -741,7 +701,7 @@ Assume point is at an item." ;; position of items in END-LST-2. (catch 'exit (while t - (let ((ind (org-get-indentation))) + (let ((ind (current-indentation))) (cond ((>= (point) lim-down) ;; At downward limit: this is de facto the end of the @@ -860,6 +820,17 @@ This function modifies STRUCT." (t (cons pos (cdar ind-to-ori)))))) (cdr struct))))) +(defun org-list--delete-metadata () + "Delete metadata from the heading at point. +Metadata are tags, planning information and properties drawers." + (save-match-data + (org-with-wide-buffer + (org-set-tags nil) + (delete-region (line-beginning-position 2) + (save-excursion + (org-end-of-meta-data) + (org-skip-whitespace) + (if (eobp) (point) (line-beginning-position))))))) ;;; Accessors @@ -1280,10 +1251,18 @@ function ends. This function modifies STRUCT." (let ((case-fold-search t)) - ;; 1. Get information about list: position of point with regards - ;; to item start (BEFOREP), blank lines number separating items - ;; (BLANK-NB), if we're allowed to (SPLIT-LINE-P). - (let* ((item (progn (goto-char pos) (goto-char (org-list-get-item-begin)))) + ;; 1. Get information about list: ITEM containing POS, position of + ;; point with regards to item start (BEFOREP), blank lines + ;; number separating items (BLANK-NB), if we're allowed to + ;; (SPLIT-LINE-P). + (let* ((item (goto-char (catch :exit + (let ((inner-item 0)) + (pcase-dolist (`(,i . ,_) struct) + (cond + ((= i pos) (throw :exit i)) + ((< i pos) (setq inner-item i)) + (t (throw :exit inner-item)))) + inner-item)))) (item-end (org-list-get-item-end item struct)) (item-end-no-blank (org-list-get-item-end-before-blank item struct)) (beforep @@ -1496,8 +1475,8 @@ This function returns, destructively, the new list structure." (org-M-RET-may-split-line nil) ;; Store inner overlays (to preserve visibility). (overlays (cl-remove-if (lambda (o) (or (< (overlay-start o) item) - (> (overlay-end o) item))) - (overlays-in item item-end)))) + (> (overlay-end o) item))) + (overlays-in item item-end)))) (cond ((eq dest 'delete) (org-list-delete-item item struct)) ((eq dest 'kill) @@ -1589,23 +1568,6 @@ STRUCT may be modified if `org-list-demote-modify-bullet' matches bullets between START and END." (let* (acc (set-assoc (lambda (cell) (push cell acc) cell)) - (change-bullet-maybe - (function - (lambda (item) - (let ((new-bul-p - (cdr (assoc - ;; Normalize ordered bullets. - (let ((bul (org-trim - (org-list-get-bullet item struct)))) - (cond ((string-match "[A-Z]\\." bul) "A.") - ((string-match "[A-Z])" bul) "A)") - ((string-match "[a-z]\\." bul) "a.") - ((string-match "[a-z])" bul) "a)") - ((string-match "[0-9]\\." bul) "1.") - ((string-match "[0-9])" bul) "1)") - (t bul))) - org-list-demote-modify-bullet)))) - (when new-bul-p (org-list-set-bullet item struct new-bul-p)))))) (ind (lambda (cell) (let* ((item (car cell)) @@ -1621,11 +1583,24 @@ bullets between START and END." ;; Item is in zone... (let ((prev (org-list-get-prev-item item struct prevs))) ;; Check if bullet needs to be changed. - (funcall change-bullet-maybe item) + (pcase (assoc (let ((b (org-list-get-bullet item struct)) + (case-fold-search nil)) + (cond ((string-match "[A-Z]\\." b) "A.") + ((string-match "[A-Z])" b) "A)") + ((string-match "[a-z]\\." b) "a.") + ((string-match "[a-z])" b) "a)") + ((string-match "[0-9]\\." b) "1.") + ((string-match "[0-9])" b) "1)") + (t (org-trim b)))) + org-list-demote-modify-bullet) + (`(,_ . ,bullet) + (org-list-set-bullet + item struct (org-list-bullet-string bullet))) + (_ nil)) (cond ;; First item indented but not parent: error - ((and (not prev) (< parent start)) - (error "Cannot indent the first item of a list")) + ((and (not prev) (or (not parent) (< parent start))) + (user-error "Cannot indent the first item of a list")) ;; First item and parent indented: keep same ;; parent. ((not prev) (funcall set-assoc cell)) @@ -1898,7 +1873,7 @@ Initial position of cursor is restored after the changes." (org-inlinetask-goto-beginning)) ;; Shift only non-empty lines. ((looking-at-p "^[ \t]*\\S-") - (indent-line-to (+ (org-get-indentation) delta)))) + (indent-line-to (+ (current-indentation) delta)))) (forward-line -1))))) (modify-item (function @@ -1907,7 +1882,7 @@ Initial position of cursor is restored after the changes." (lambda (item) (goto-char item) (let* ((new-ind (org-list-get-ind item struct)) - (old-ind (org-get-indentation)) + (old-ind (current-indentation)) (new-bul (org-list-bullet-string (org-list-get-bullet item struct))) (old-bul (org-list-get-bullet item old-struct)) @@ -1982,7 +1957,7 @@ Initial position of cursor is restored after the changes." ;; Ignore empty lines. Also ignore blocks and ;; drawers contents. (unless (looking-at-p "[ \t]*$") - (setq min-ind (min (org-get-indentation) min-ind)) + (setq min-ind (min (current-indentation) min-ind)) (cond ((and (looking-at "#\\+BEGIN\\(:\\|_\\S-+\\)") (re-search-forward @@ -2036,7 +2011,9 @@ doesn't correspond anymore to the real list in buffer." ;; 5. Eventually fix checkboxes. (org-list-struct-fix-box struct parents prevs)) ;; 6. Apply structure modifications to buffer. - (org-list-struct-apply-struct struct old-struct))) + (org-list-struct-apply-struct struct old-struct)) + ;; 7. Return the updated structure + struct) @@ -2077,8 +2054,8 @@ Possible values are: `folded', `children' or `subtree'. See ((eq view 'folded) (let ((item-end (org-list-get-item-end-before-blank item struct))) ;; Hide from eol - (outline-flag-region (save-excursion (goto-char item) (point-at-eol)) - item-end t))) + (org-flag-region (save-excursion (goto-char item) (line-end-position)) + item-end t 'outline))) ((eq view 'children) ;; First show everything. (org-list-set-item-visibility item struct 'subtree) @@ -2091,7 +2068,7 @@ Possible values are: `folded', `children' or `subtree'. See ((eq view 'subtree) ;; Show everything (let ((item-end (org-list-get-item-end item struct))) - (outline-flag-region item item-end nil))))) + (org-flag-region item item-end nil 'outline))))) (defun org-list-item-body-column (item) "Return column at which body of ITEM should start." @@ -2104,7 +2081,7 @@ Possible values are: `folded', `children' or `subtree'. See ;; Descriptive list item. Body starts after item's tag, if ;; possible. (let ((start (1+ (- (match-beginning 1) (line-beginning-position)))) - (ind (org-get-indentation))) + (ind (current-indentation))) (if (> start (+ ind org-list-description-max-indent)) (+ ind 5) start)) @@ -2279,7 +2256,7 @@ item is invisible." (string-match "[.)]" (match-string 1)))) (match-beginning 4) (match-end 0))) - (if desc (backward-char 1)) + (when desc (backward-char 1)) t))))) (defun org-list-repair () @@ -2356,27 +2333,23 @@ is an integer, 0 means `-', 1 means `+' etc. If WHICH is (defun org-toggle-checkbox (&optional toggle-presence) "Toggle the checkbox in the current line. -With prefix arg TOGGLE-PRESENCE, add or remove checkboxes. With -double prefix, set checkbox to [-]. + +With prefix argument TOGGLE-PRESENCE, add or remove checkboxes. +With a double prefix argument, set the checkbox to \"[-]\". When there is an active region, toggle status or presence of the first checkbox there, and make every item inside have the same status or presence, respectively. -If the cursor is in a headline, apply this to all checkbox items -in the text below the heading, taking as reference the first item -in subtree, ignoring drawers." +If point is on a headline, apply this to all checkbox items in +the text below the heading, taking as reference the first item in +subtree, ignoring planning line and any drawer following it." (interactive "P") (save-excursion (let* (singlep block-item lim-up lim-down - (keyword-re (concat "^[ \t]*\\<\\(" org-scheduled-string - "\\|" org-deadline-string - "\\|" org-closed-string - "\\|" org-clock-string "\\)" - " *[[<]\\([^]>]+\\)[]>]")) (orderedp (org-entry-get nil "ORDERED")) (_bounds ;; In a region, start at first item in region. @@ -2389,15 +2362,10 @@ in subtree, ignoring drawers." (error "No item in region")) (setq lim-down (copy-marker limit)))) ((org-at-heading-p) - ;; On an heading, start at first item after drawers and + ;; On a heading, start at first item after drawers and ;; time-stamps (scheduled, etc.). (let ((limit (save-excursion (outline-next-heading) (point)))) - (forward-line 1) - (while (or (looking-at org-drawer-regexp) - (looking-at keyword-re)) - (if (looking-at keyword-re) - (forward-line 1) - (re-search-forward "^[ \t]*:END:" limit nil))) + (org-end-of-meta-data t) (if (org-list-search-forward (org-item-beginning-re) limit t) (setq lim-up (point-at-bol)) (error "No item in subtree")) @@ -2656,8 +2624,8 @@ Return t if successful." (= top (point-at-bol)) (cdr (assq 'indent org-list-automatic-rules)) (if no-subtree - (error - "First item of list cannot move without its subtree") + (user-error + "At first item: use S-M- 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. @@ -2686,7 +2654,7 @@ Return t if successful." (error "Cannot outdent beyond margin") ;; Change bullet if necessary. (when (and (= (+ top-ind offset) 0) - (string-match "*" + (string-match "\\*" (org-list-get-bullet beg struct))) (org-list-set-bullet beg struct (org-list-bullet-string "-"))) @@ -2715,11 +2683,12 @@ Return t if successful." (error "Cannot outdent an item without its children")) ;; Normal shifting (t - (let* ((new-parents + (let* ((old-struct (copy-tree struct)) + (new-parents (if (< arg 0) (org-list-struct-outdent beg end struct parents) (org-list-struct-indent beg end struct parents prevs)))) - (org-list-write-struct struct new-parents)) + (org-list-write-struct struct new-parents old-struct)) (org-update-checkbox-count-maybe)))))) t) @@ -2848,7 +2817,8 @@ Sorting can be alphabetically, numerically, by date/time as given by a time stamp, by a property or by priority. Comparing entries ignores case by default. However, with an -optional argument WITH-CASE, the sorting considers case as well. +optional argument WITH-CASE, the sorting considers case as well, +if the current locale allows for it. The command prompts for the sorting type unless it has been given to the function through the SORTING-TYPE argument, which needs to @@ -2894,7 +2864,7 @@ function is being called interactively." (error "Missing key extractor")))) (sort-func (cond - ((= dcst ?a) #'string<) + ((= dcst ?a) #'org-string-collate-lessp) ((= dcst ?f) (or compare-func (and interactive? @@ -2985,7 +2955,7 @@ With a prefix argument ARG, change the region in a single item." (save-excursion (catch 'exit (while (< (point) end) - (let ((i (org-get-indentation))) + (let ((i (current-indentation))) (cond ;; Skip blank lines and inline tasks. ((looking-at "^[ \t]*$")) @@ -3001,7 +2971,7 @@ With a prefix argument ARG, change the region in a single item." (while (< (point) end) (unless (or (looking-at "^[ \t]*$") (looking-at org-outline-regexp-bol)) - (indent-line-to (+ (org-get-indentation) delta))) + (indent-line-to (+ (current-indentation) delta))) (forward-line)))))) (skip-blanks (lambda (pos) @@ -3035,6 +3005,9 @@ With a prefix argument ARG, change the region in a single item." (forward-line))) ;; Case 2. Start at an heading: convert to items. ((org-at-heading-p) + ;; Remove metadata + (let (org-loop-over-headlines-in-active-region) + (org-list--delete-metadata)) (let* ((bul (org-list-bullet-string "-")) (bul-len (length bul)) ;; Indentation of the first heading. It should be @@ -3055,6 +3028,9 @@ With a prefix argument ARG, change the region in a single item." ;; one, set it as reference, in order to preserve ;; subtrees. (when (< level ref-level) (setq ref-level level)) + ;; Remove metadata + (let (org-loop-over-headlines-in-active-region) + (org-list--delete-metadata)) ;; Remove stars and TODO keyword. (let ((case-fold-search nil)) (looking-at org-todo-line-regexp)) (delete-region (point) (or (match-beginning 3) @@ -3087,7 +3063,7 @@ With a prefix argument ARG, change the region in a single item." ;; set them as item's body. (arg (let* ((bul (org-list-bullet-string "-")) (bul-len (length bul)) - (ref-ind (org-get-indentation))) + (ref-ind (current-indentation))) (skip-chars-forward " \t") (insert bul) (forward-line) @@ -3206,77 +3182,7 @@ Point is left at list's end." (if (not (ignore-errors (goto-char (org-in-item-p)))) (error "Not in a list") (let ((list (save-excursion (org-list-to-lisp t)))) - (insert (org-list-to-subtree list))))) - -(defun org-list-insert-radio-list () - "Insert a radio list template appropriate for this major mode." - (interactive) - (let* ((e (cl-assoc-if #'derived-mode-p org-list-radio-list-templates)) - (txt (nth 1 e)) - name pos) - (unless e (error "No radio list setup defined for %s" major-mode)) - (setq name (read-string "List name: ")) - (while (string-match "%n" txt) - (setq txt (replace-match name t t txt))) - (or (bolp) (insert "\n")) - (setq pos (point)) - (insert txt) - (goto-char pos))) - -(defun org-list-send-list (&optional maybe) - "Send a transformed version of this list to the receiver position. -With argument MAYBE, fail quietly if no transformation is defined -for this list." - (interactive) - (catch 'exit - (unless (org-at-item-p) (error "Not at a list item")) - (save-excursion - (let ((case-fold-search t)) - (re-search-backward "^[ \t]*#\\+ORGLST:" nil t) - (unless (looking-at - "[ \t]*#\\+ORGLST:[ \t]+SEND[ \t]+\\(\\S-+\\)[ \t]+\\([^ \t\n]+\\)") - (if maybe (throw 'exit nil) - (error "Don't know how to transform this list"))))) - (let* ((name (regexp-quote (match-string 1))) - (transform (intern (match-string 2))) - (bottom-point - (save-excursion - (re-search-forward - "\\(\\\\end{comment}\\|@end ignore\\|-->\\)" nil t) - (match-beginning 0))) - (top-point - (progn - (re-search-backward "#\\+ORGLST" nil t) - (re-search-forward (org-item-beginning-re) bottom-point t) - (match-beginning 0))) - (plain-list (save-excursion - (goto-char top-point) - (org-list-to-lisp)))) - (unless (fboundp transform) - (error "No such transformation function %s" transform)) - (let ((txt (funcall transform plain-list))) - ;; Find the insertion(s) place(s). - (save-excursion - (goto-char (point-min)) - (let ((receiver-count 0) - (begin-re (format "BEGIN +RECEIVE +ORGLST +%s\\([ \t]\\|$\\)" - name)) - (end-re (format "END +RECEIVE +ORGLST +%s\\([ \t]\\|$\\)" - name))) - (while (re-search-forward begin-re nil t) - (cl-incf receiver-count) - (let ((beg (line-beginning-position 2))) - (unless (re-search-forward end-re nil t) - (user-error "Cannot find end of receiver location at %d" beg)) - (beginning-of-line) - (delete-region beg (point)) - (insert txt "\n"))) - (cond - ((> receiver-count 1) - (message "List converted and installed at receiver locations")) - ((= receiver-count 1) - (message "List converted and installed at receiver location")) - (t (user-error "No valid receiver location found"))))))))) + (insert (org-list-to-subtree list) "\n")))) (defun org-list-to-generic (list params) "Convert a LIST parsed through `org-list-to-lisp' to a custom format. diff --git a/elpa/org-20171030/org-loaddefs.el b/elpa/org-20190930/org-loaddefs.el similarity index 91% rename from elpa/org-20171030/org-loaddefs.el rename to elpa/org-20190930/org-loaddefs.el index 66dfed68..fbd6472f 100644 --- a/elpa/org-20171030/org-loaddefs.el +++ b/elpa/org-20190930/org-loaddefs.el @@ -68,11 +68,11 @@ ;;;### (autoloads nil "ob-coq" "ob-coq.el" (0 0 0 0)) ;;; Generated autoloads from ob-coq.el -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-coq" '("org-babel-" "coq-program-name"))) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-coq" '("coq-program-name" "org-babel-"))) ;;;*** -;;;### (autoloads nil "ob-core" "ob-core.el" "c10e99cea469e108ee743b6990f67238") +;;;### (autoloads nil "ob-core" "ob-core.el" (0 0 0 0)) ;;; Generated autoloads from ob-core.el (autoload 'org-babel-execute-safely-maybe "ob-core" "\ @@ -94,21 +94,21 @@ a window into the `org-babel-get-src-block-info' function. (autoload 'org-babel-expand-src-block-maybe "ob-core" "\ Conditionally expand a source block. -Detect if this is context for a org-babel src-block and if so +Detect if this is context for an org-babel src-block and if so then run `org-babel-expand-src-block'. \(fn)" t nil) (autoload 'org-babel-load-in-session-maybe "ob-core" "\ Conditionally load a source block in a session. -Detect if this is context for a org-babel src-block and if so +Detect if this is context for an org-babel src-block and if so then run `org-babel-load-in-session'. \(fn)" t nil) (autoload 'org-babel-pop-to-session-maybe "ob-core" "\ Conditionally pop to a session. -Detect if this is context for a org-babel src-block and if so +Detect if this is context for an org-babel src-block and if so then run `org-babel-switch-to-session'. \(fn)" t nil) @@ -184,10 +184,12 @@ Return t if a code block was found at point, nil otherwise. \(fn &rest BODY)" nil t) (autoload 'org-babel-open-src-block-result "ob-core" "\ -If `point' is on a src block then open the results of the -source code block, otherwise return nil. With optional prefix -argument RE-RUN the source-code block is evaluated even if -results already exist. +Open results of source block at point. + +If `point' is on a source block then open the results of the source +code block, otherwise return nil. With optional prefix argument +RE-RUN the source-code block is evaluated even if results already +exist. \(fn &optional RE-RUN)" t nil) @@ -259,9 +261,11 @@ the current subtree. \(fn &optional ARG)" t nil) (autoload 'org-babel-sha1-hash "ob-core" "\ -Generate an sha1 hash based on the value of info. +Generate a sha1 hash based on the value of INFO. +CONTEXT specifies the context of evaluation. It can be `:eval', +`:export', `:tangle'. A nil value means `:eval'. -\(fn &optional INFO)" t nil) +\(fn &optional INFO CONTEXT)" t nil) (autoload 'org-babel-hide-result-toggle-maybe "ob-core" "\ Toggle visibility of result at point. @@ -296,10 +300,12 @@ With optional prefix argument ARG, jump backward ARG many source blocks. \(fn &optional ARG)" t nil) (autoload 'org-babel-mark-block "ob-core" "\ -Mark current src block. +Mark current source block. \(fn)" t nil) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-core" '("org-"))) + ;;;*** ;;;### (autoloads nil "ob-css" "ob-css.el" (0 0 0 0)) @@ -368,7 +374,7 @@ Mark current src block. ;;;### (autoloads nil "ob-gnuplot" "ob-gnuplot.el" (0 0 0 0)) ;;; Generated autoloads from ob-gnuplot.el -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-gnuplot" '("org-babel-" "*org-babel-gnuplot-"))) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-gnuplot" '("*org-babel-gnuplot-" "org-babel-"))) ;;;*** @@ -414,7 +420,7 @@ Mark current src block. ;;;*** -;;;### (autoloads nil "ob-keys" "ob-keys.el" "3161ee07d0549e3364a20f32d7f314c3") +;;;### (autoloads nil "ob-keys" "ob-keys.el" (0 0 0 0)) ;;; Generated autoloads from ob-keys.el (autoload 'org-babel-describe-bindings "ob-keys" "\ @@ -422,6 +428,8 @@ Describe all keybindings behind `org-babel-key-prefix'. \(fn)" t nil) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-keys" '("org-babel-"))) + ;;;*** ;;;### (autoloads nil "ob-latex" "ob-latex.el" (0 0 0 0)) @@ -441,7 +449,7 @@ Describe all keybindings behind `org-babel-key-prefix'. ;;;### (autoloads nil "ob-lilypond" "ob-lilypond.el" (0 0 0 0)) ;;; Generated autoloads from ob-lilypond.el -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-lilypond" '("org-babel-" "lilypond-mode"))) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-lilypond" '("lilypond-mode" "org-babel-"))) ;;;*** @@ -452,7 +460,7 @@ Describe all keybindings behind `org-babel-key-prefix'. ;;;*** -;;;### (autoloads nil "ob-lob" "ob-lob.el" "da6fae3fe58faf1a7f39ade45fcb6b51") +;;;### (autoloads nil "ob-lob" "ob-lob.el" (0 0 0 0)) ;;; Generated autoloads from ob-lob.el (autoload 'org-babel-lob-execute-maybe "ob-lob" "\ @@ -464,12 +472,17 @@ if so then run the appropriate source block from the Library. (autoload 'org-babel-lob-get-info "ob-lob" "\ 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. \(fn &optional DATUM)" nil nil) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-lob" '("org-babel-"))) + ;;;*** ;;;### (autoloads nil "ob-lua" "ob-lua.el" (0 0 0 0)) @@ -640,7 +653,7 @@ compatible with `org-babel-get-src-block-info', which see. ;;;*** -;;;### (autoloads nil "ob-tangle" "ob-tangle.el" "56bac5a8334a3db19b0d144c118cbbdd") +;;;### (autoloads nil "ob-tangle" "ob-tangle.el" (0 0 0 0)) ;;; Generated autoloads from ob-tangle.el (autoload 'org-babel-tangle-file "ob-tangle" "\ @@ -666,6 +679,8 @@ used to limit the exported source code blocks by language. \(fn &optional ARG TARGET-FILE LANG)" t nil) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-tangle" '("org-babel-"))) + ;;;*** ;;;### (autoloads nil "ob-vala" "ob-vala.el" (0 0 0 0)) @@ -898,10 +913,13 @@ Do we have a reason to ignore this TODO entry because it has a time stamp? \(fn &optional END)" nil nil) (autoload 'org-agenda-set-restriction-lock "org-agenda" "\ -Set restriction lock for agenda, to current subtree or file. -Restriction will be the file if TYPE is `file', or if type is the -universal prefix \\='(4), or if the cursor is before the first headline -in the file. Otherwise, restriction will be to the current subtree. +Set restriction lock for agenda to current subtree or file. +When in a restricted subtree, remove it. + +The restriction will span over the entire file if TYPE is `file', +or if type is '(4), or if the cursor is before the first headline +in the file. Otherwise, only apply the restriction to the current +subtree. \(fn &optional TYPE)" t nil) @@ -950,7 +968,7 @@ to override `appt-message-warning-time'. ;;;*** -;;;### (autoloads nil "org-archive" "org-archive.el" "8aec942d540c34adf5b02eb0583e28c0") +;;;### (autoloads nil "org-archive" "org-archive.el" (0 0 0 0)) ;;; Generated autoloads from org-archive.el (autoload 'org-add-archive-files "org-archive" "\ @@ -1008,9 +1026,11 @@ This command is set with the variable `org-archive-default-command'. \(fn)" t nil) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-archive" '("org-a"))) + ;;;*** -;;;### (autoloads nil "org-attach" "org-attach.el" "bfb84dce60a9d8c09a3e157a5e36bd65") +;;;### (autoloads nil "org-attach" "org-attach.el" (0 0 0 0)) ;;; Generated autoloads from org-attach.el (autoload 'org-attach "org-attach" "\ @@ -1019,9 +1039,19 @@ Shows a list of commands and prompts for another key to execute a command. \(fn)" t nil) +(autoload 'org-attach-dired-to-subtree "org-attach" "\ +Attach FILES marked or current file in dired to subtree in other window. +Takes the method given in `org-attach-method' for the attach action. +Precondition: Point must be in a dired buffer. +Idea taken from `gnus-dired-attach'. + +\(fn FILES)" t nil) + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-attach" '("org-attach-"))) + ;;;*** -;;;### (autoloads nil "org-bbdb" "org-bbdb.el" "5e10f2614943e683755df547195c23eb") +;;;### (autoloads nil "org-bbdb" "org-bbdb.el" (0 0 0 0)) ;;; Generated autoloads from org-bbdb.el (autoload 'org-bbdb-anniversaries "org-bbdb" "\ @@ -1029,6 +1059,8 @@ Extract anniversaries from BBDB for display in the agenda. \(fn)" nil nil) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-bbdb" '("org-bbdb-"))) + ;;;*** ;;;### (autoloads nil "org-bibtex" "org-bibtex.el" (0 0 0 0)) @@ -1082,11 +1114,11 @@ Set `org-capture-templates' to be similar to `org-remember-templates'. \(fn)" t nil) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-capture" '("org-"))) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-capture" '("org-capture-"))) ;;;*** -;;;### (autoloads nil "org-clock" "org-clock.el" "5dc6a04c27c4c424b767f0710fe713e3") +;;;### (autoloads nil "org-clock" "org-clock.el" (0 0 0 0)) ;;; Generated autoloads from org-clock.el (autoload 'org-resolve-clocks "org-clock" "\ @@ -1116,7 +1148,7 @@ the default behavior. (autoload 'org-clock-in-last "org-clock" "\ Clock in the last closed clocked item. -When already clocking in, send an warning. +When already clocking in, send a warning. With a universal prefix argument, select the task you want to clock in from the last clocked in tasks. With two universal prefix arguments, start clocking using the @@ -1146,6 +1178,11 @@ With prefix arg SELECT, offer recently clocked tasks for selection. \(fn &optional SELECT)" t nil) +(autoload 'org-clock-sum-today "org-clock" "\ +Sum the times for each subtree for today. + +\(fn &optional HEADLINE-FILTER)" nil nil) + (autoload 'org-clock-sum "org-clock" "\ Sum the times for each subtree. Puts the resulting times in minutes as a text property on each headline. @@ -1180,6 +1217,13 @@ If NOREMOVE is nil, remove this function from the \(fn &optional BEG END NOREMOVE)" t nil) +(autoload 'org-clock-out-if-current "org-clock" "\ +Clock out if the current entry contains the running clock. +This is used to stop the clock after a TODO entry is marked DONE, +and is only done if the variable `org-clock-out-when-done' is not nil. + +\(fn)" nil nil) + (autoload 'org-clock-get-clocktable "org-clock" "\ Get a formatted clocktable with parameters according to PROPS. The table is created in a temporary buffer, fully formatted and @@ -1188,14 +1232,19 @@ fontified, and then returned. \(fn &rest PROPS)" nil nil) (autoload 'org-clock-report "org-clock" "\ -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. +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. +When called with a prefix argument, move to the first clock table +in the buffer and update it. \(fn &optional ARG)" t nil) @@ -1222,6 +1271,8 @@ Otherwise, return nil. \(fn)" t nil) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-clock" '("org-"))) + ;;;*** ;;;### (autoloads nil "org-colview" "org-colview.el" (0 0 0 0)) @@ -1259,24 +1310,54 @@ column specification. (autoload 'org-dblock-write:columnview "org-colview" "\ Write the column view table. + PARAMS is a property list of parameters: -:id the :ID: property of the entry where the columns view - should be built. When the symbol `local', call locally. - When `global' call column view with the cursor at the beginning - of the buffer (usually this means that the whole buffer switches - to column view). When \"file:path/to/file.org\", invoke column - view at the start of that file. Otherwise, the ID is located - using `org-id-find'. -:hlines When t, insert a hline before each item. When a number, insert - a hline before each level <= that number. -:indent When non-nil, indent each ITEM field according to its level. -:vlines When t, make each column a colgroup to enforce vertical lines. -:maxlevel When set to a number, don't capture headlines below this level. -:skip-empty-rows - When t, skip rows where all specifiers other than ITEM are empty. -:width apply widths specified in columns format using specifiers. -:format When non-nil, specify the column view format to use. +`:id' (mandatory) + + The ID property of the entry where the columns view should be + built. When the symbol `local', call locally. When `global' + call column view with the cursor at the beginning of the + buffer (usually this means that the whole buffer switches to + column view). When \"file:path/to/file.org\", invoke column + view at the start of that file. Otherwise, the ID is located + using `org-id-find'. + +`:exclude-tags' + + List of tags to exclude from column view table. + +`:format' + + When non-nil, specify the column view format to use. + +`:hlines' + + When non-nil, insert a hline before each item. When + a number, insert a hline before each level inferior or equal + to that number. + +`:indent' + + When non-nil, indent each ITEM field according to its level. + +`:match' + + When set to a string, use this as a tags/property match filter. + +`:maxlevel' + + When set to a number, don't capture headlines below this level. + +`:skip-empty-rows' + + When non-nil, skip rows where all specifiers other than ITEM + are empty. + +`:vlines' + + When non-nil, make each column a column group to enforce + vertical lines. \(fn PARAMS)" nil nil) @@ -1320,7 +1401,7 @@ Try very hard to provide sensible version strings. ;;;*** -;;;### (autoloads nil "org-datetree" "org-datetree.el" "d964f74a702f8611ad75d5a641806c96") +;;;### (autoloads nil "org-datetree" "org-datetree.el" (0 0 0 0)) ;;; Generated autoloads from org-datetree.el (autoload 'org-datetree-find-date-create "org-datetree" "\ @@ -1342,6 +1423,8 @@ will be built under the headline at point. \(fn D &optional KEEP-RESTRICTION)" nil nil) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-datetree" '("org-datetree-"))) + ;;;*** ;;;### (autoloads nil "org-docview" "org-docview.el" (0 0 0 0)) @@ -1407,7 +1490,7 @@ with \"H:MM:SS\" format, return `h:mm:ss'. Otherwise, return ;;;*** -;;;### (autoloads nil "org-element" "org-element.el" "03d829101dc213d1682bfba0d7890ca5") +;;;### (autoloads nil "org-element" "org-element.el" (0 0 0 0)) ;;; Generated autoloads from org-element.el (autoload 'org-element-update-syntax "org-element" "\ @@ -1477,6 +1560,8 @@ Providing it allows for quicker computation. \(fn &optional ELEMENT)" nil nil) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-element" '("org-element-"))) + ;;;*** ;;;### (autoloads nil "org-entities" "org-entities.el" (0 0 0 0)) @@ -1507,7 +1592,7 @@ Providing it allows for quicker computation. ;;;*** -;;;### (autoloads nil "org-feed" "org-feed.el" "f11679986a3b24c8601e88f292ca3bee") +;;;### (autoloads nil "org-feed" "org-feed.el" (0 0 0 0)) ;;; Generated autoloads from org-feed.el (autoload 'org-feed-update-all "org-feed" "\ @@ -1532,9 +1617,11 @@ Show the raw feed buffer of a feed. \(fn FEED)" t nil) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-feed" '("org-feed-"))) + ;;;*** -;;;### (autoloads nil "org-footnote" "org-footnote.el" "3436205c7366b73bcde2dfda5121f165") +;;;### (autoloads nil "org-footnote" "org-footnote.el" (0 0 0 0)) ;;; Generated autoloads from org-footnote.el (autoload 'org-footnote-action "org-footnote" "\ @@ -1553,6 +1640,8 @@ offer additional commands in a menu. \(fn &optional SPECIAL)" t nil) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-footnote" '("org-footnote-"))) + ;;;*** ;;;### (autoloads nil "org-gnus" "org-gnus.el" (0 0 0 0)) @@ -1560,6 +1649,42 @@ offer additional commands in a menu. (if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-gnus" '("org-gnus-"))) +;;;*** + +;;;### (autoloads nil "org-goto" "org-goto.el" (0 0 0 0)) +;;; Generated autoloads from org-goto.el + +(autoload 'org-goto-location "org-goto" "\ +Let the user select a location in current buffer. +This function uses a recursive edit. It returns the selected +position or nil. + +\(fn &optional BUF HELP)" nil nil) + +(autoload 'org-goto "org-goto" "\ +Look up a different location in the current file, keeping current visibility. + +When you want look-up or go to a different location in a +document, the fastest way is often to fold the entire buffer and +then dive into the tree. This method has the disadvantage, that +the previous location will be folded, which may not be what you +want. + +This command works around this by showing a copy of the current +buffer in an indirect buffer, in overview mode. You can dive +into the tree in that copy, use org-occur and incremental search +to find a location. When pressing RET or `Q', the command +returns to the original buffer in which the visibility is still +unchanged. After RET it will also jump to the location selected +in the indirect buffer and expose the headline hierarchy above. + +With a prefix argument, use the alternative interface: e.g., if +`org-goto-interface' is `outline' use `outline-path-completion'. + +\(fn &optional ALTERNATIVE-INTERFACE)" t nil) + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-goto" '("org-goto-"))) + ;;;*** ;;;### (autoloads nil "org-habit" "org-habit.el" (0 0 0 0)) @@ -1569,7 +1694,7 @@ offer additional commands in a menu. ;;;*** -;;;### (autoloads nil "org-id" "org-id.el" "f3e60c63640177585f811203dd07c9db") +;;;### (autoloads nil "org-id" "org-id.el" (0 0 0 0)) ;;; Generated autoloads from org-id.el (autoload 'org-id-get-create "org-id" "\ @@ -1589,7 +1714,7 @@ Create an ID if necessary. Get the ID property of the entry at point-or-marker POM. If POM is nil, refer to the entry at point. If the entry does not have an ID, the function returns nil. -However, when CREATE is non nil, create an ID if none is present already. +However, when CREATE is non-nil, create an ID if none is present already. PREFIX will be passed through to `org-id-new'. In any case, the ID of the entry is returned. @@ -1606,7 +1731,7 @@ If necessary, the ID is created. (autoload 'org-id-get-with-outline-drilling "org-id" "\ Use an outline-cycling interface to retrieve the ID of an entry. -This only finds entries in the current buffer, using `org-get-location'. +This only finds entries in the current buffer, using `org-goto-location'. It returns the ID of the entry. If necessary, the ID is created. \(fn)" nil nil) @@ -1659,14 +1784,21 @@ Store a link to the current entry, using its ID. \(fn)" t nil) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-id" '("org-id-"))) + ;;;*** -;;;### (autoloads nil "org-indent" "org-indent.el" "eee2432e1a5f142a523bbd4fc09be244") +;;;### (autoloads nil "org-indent" "org-indent.el" (0 0 0 0)) ;;; Generated autoloads from org-indent.el (autoload 'org-indent-mode "org-indent" "\ When active, indent text according to outline structure. +If called interactively, enable Org-Indent mode if ARG is positive, and +disable it if ARG is zero or negative. If called from Lisp, +also enable the mode if ARG is omitted or nil, and toggle it +if ARG is `toggle'; disable the mode otherwise. + Internally this works by adding `line-prefix' and `wrap-prefix' properties, after each buffer modification, on the modified zone. @@ -1676,6 +1808,8 @@ during idle time. \(fn &optional ARG)" t nil) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-indent" '("org-"))) + ;;;*** ;;;### (autoloads nil "org-info" "org-info.el" (0 0 0 0)) @@ -1693,7 +1827,7 @@ during idle time. ;;;*** -;;;### (autoloads nil "org-irc" "org-irc.el" "b3922c389fd549fb82a61d926d6d1493") +;;;### (autoloads nil "org-irc" "org-irc.el" (0 0 0 0)) ;;; Generated autoloads from org-irc.el (autoload 'org-irc-store-link "org-irc" "\ @@ -1701,6 +1835,8 @@ Dispatch to the appropriate function to store a link to an IRC session. \(fn)" nil nil) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-irc" '("org-irc-"))) + ;;;*** ;;;### (autoloads nil "org-lint" "org-lint.el" (0 0 0 0)) @@ -1754,7 +1890,7 @@ Load FILE with optional arguments NOERROR and MUSTSUFFIX. ;;;*** -;;;### (autoloads nil "org-mobile" "org-mobile.el" "1a99cb7a355ce070f9c4cf0623000a79") +;;;### (autoloads nil "org-mobile" "org-mobile.el" "f2d2d0e3563b888bb9ecf8f7c178ccc2") ;;; Generated autoloads from org-mobile.el (autoload 'org-mobile-push "org-mobile" "\ @@ -1787,7 +1923,7 @@ agenda view showing the flagged items. ;;;*** -;;;### (autoloads nil "org-plot" "org-plot.el" "d0f670aabb3623b2ef51be20ae67a661") +;;;### (autoloads nil "org-plot" "org-plot.el" "5b1b5812de5673417289c68c9576764f") ;;; Generated autoloads from org-plot.el (autoload 'org-plot/gnuplot "org-plot" "\ @@ -1820,7 +1956,7 @@ line directly before or after the table. ;;;*** -;;;### (autoloads nil "org-table" "org-table.el" "9de03c05d6a1accae5c8271012de00f9") +;;;### (autoloads nil "org-table" "org-table.el" "78dad654d2f5d4809d1ddb26566dc777") ;;; Generated autoloads from org-table.el (autoload 'org-table-create-with-table\.el "org-table" "\ @@ -1870,11 +2006,24 @@ nil When nil, the command tries to be smart and figure out the (autoload 'org-table-import "org-table" "\ Import FILE as a table. -The file is assumed to be tab-separated. Such files can be produced by most -spreadsheet and database applications. If no tabs (at least one per line) -are found, lines will be split on whitespace into fields. -\(fn FILE ARG)" t nil) +The command tries to be smart and figure out the separator in the +following way: + + - when each line contains a TAB, assume TAB-separated material + - when each line contains a comma, assume CSV material + - else, assume one or more SPACE characters as separator. + +When non-nil, SEPARATOR specifies the field separator in the +lines. It can have the following values: + +\(4) Use the comma as a field separator +\(16) Use a TAB as field separator +\(64) Prompt for a regular expression as field separator +integer When a number, use that many spaces, or a TAB, as field separator +regexp When a regular expression, use it to match the separator. + +\(fn FILE SEPARATOR)" t nil) (autoload 'org-table-export "org-table" "\ Export table to a file, with configurable format. @@ -2055,7 +2204,8 @@ alphabetically, numerically, or by time (as given in a time stamp in the field, or as a HH:MM value). Sorting in reverse order is also possible. -With prefix argument WITH-CASE, alphabetic sorting will be case-sensitive. +With prefix argument WITH-CASE, alphabetic sorting will be case-sensitive +if the locale allows for it. If SORTING-TYPE is specified when this function is called from a Lisp program, no prompting will take place. SORTING-TYPE must be a character, @@ -2080,8 +2230,9 @@ If there is no active region, use just the field at point. (autoload 'org-table-copy-region "org-table" "\ Copy rectangular region in table to clipboard. -A special clipboard is used which can only be accessed -with `org-table-paste-rectangle'. +A special clipboard is used which can only be accessed with +`org-table-paste-rectangle'. Return the region copied, as a list +of lists of fields. \(fn BEG END &optional CUT)" t nil) @@ -2284,6 +2435,50 @@ Edit the formulas of the current table in a separate buffer. \(fn)" t nil) +(autoload 'org-table-toggle-column-width "org-table" "\ +Shrink or expand current column in an Org table. + +If a width cookie specifies a width W for the column, the first +W visible characters are displayed. Otherwise, the column is +shrunk to a single character. + +When point is before the first column or after the last one, ask +for the columns to shrink or expand, as a list of ranges. +A column range can be one of the following patterns: + + N column N only + N-M every column between N and M (both inclusive) + N- every column between N (inclusive) and the last column + -M every column between the first one and M (inclusive) + - every column + +When optional argument ARG is a string, use it as white space +separated list of column ranges. + +When called with `\\[universal-argument]' prefix, call `org-table-shrink', i.e., +shrink columns with a width cookie and expand the others. + +When called with `\\[universal-argument] \\[universal-argument]' prefix, expand all columns. + +\(fn &optional ARG)" t nil) + +(autoload 'org-table-shrink "org-table" "\ +Shrink all columns with a width cookie in the table at point. + +Columns without a width cookie are expanded. + +Optional arguments BEGIN and END, when non-nil, specify the +beginning and end position of the current table. + +\(fn &optional BEGIN END)" t nil) + +(autoload 'org-table-expand "org-table" "\ +Expand all columns in the table at point. +Optional arguments BEGIN and END, when non-nil, specify the +beginning and end position of the current table. + +\(fn &optional BEGIN END)" t nil) + (autoload 'org-table-toggle-coordinate-overlays "org-table" "\ Toggle the display of Row/Column numbers in tables. @@ -2295,7 +2490,7 @@ Toggle the formula debugger in tables. \(fn)" t nil) (autoload 'orgtbl-mode "org-table" "\ -The `org-mode' table editor as a minor mode for use in other modes. +The Org mode table editor as a minor mode for use in other modes. \(fn &optional ARG)" t nil) @@ -2505,7 +2700,14 @@ which will prompt for the width. ;;;*** -;;;### (autoloads nil "org-timer" "org-timer.el" "ba7c8d93d3a4aa18f0c819fe6fb12401") +;;;### (autoloads nil "org-tempo" "org-tempo.el" (0 0 0 0)) +;;; Generated autoloads from org-tempo.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-tempo" '("org-tempo-"))) + +;;;*** + +;;;### (autoloads nil "org-timer" "org-timer.el" "bc6a3c092cda456629c77cbbad6be0a5") ;;; Generated autoloads from org-timer.el (autoload 'org-timer-start "org-timer" "\ @@ -2521,6 +2723,17 @@ the region 0:00:00. \(fn &optional OFFSET)" t nil) +(autoload 'org-timer-pause-or-continue "org-timer" "\ +Pause or continue the relative or countdown timer. +With prefix arg STOP, stop it entirely. + +\(fn &optional STOP)" t nil) + +(autoload 'org-timer-stop "org-timer" "\ +Stop the relative or countdown timer. + +\(fn)" t nil) + (autoload 'org-timer "org-timer" "\ Insert a H:MM:SS string from the timer into the buffer. The first time this command is used, the timer is started. @@ -2581,7 +2794,7 @@ Inserted by installing Org mode or when a release is made. \(fn)" nil nil) (autoload 'org-git-version "org-version" "\ -The Git version of org-mode. +The Git version of Org mode. Inserted by installing Org or when a release is made. \(fn)" nil nil) @@ -2713,26 +2926,6 @@ With `\\[universal-argument]' prefix ARG, switch to startup visibility. With a numeric prefix, show all headlines up to that level. \(fn &optional ARG)" t nil) -(put 'orgstruct-heading-prefix-regexp 'safe-local-variable 'stringp) - -(autoload 'orgstruct-mode "org" "\ -Toggle the minor mode `orgstruct-mode'. -This mode is for using Org mode structure commands in other -modes. The following keys behave as if Org mode were active, if -the cursor is on a headline, or on a plain list item (both as -defined by Org mode). - -\(fn &optional ARG)" t nil) - -(autoload 'turn-on-orgstruct "org" "\ -Unconditionally turn on `orgstruct-mode'. - -\(fn)" nil nil) - -(autoload 'turn-on-orgstruct++ "org" "\ -Unconditionally turn on `orgstruct++-mode'. - -\(fn)" nil nil) (autoload 'org-run-like-in-org-mode "org" "\ Run a command, pretending that the current buffer is in Org mode. @@ -2743,7 +2936,7 @@ call CMD. \(fn CMD)" nil nil) (autoload 'org-store-link "org" "\ -Store an org-link to the current location. +Store a link to the current location. \\ This link is added to `org-stored-links' and can later be inserted into an Org buffer with `org-insert-link' (`\\[org-insert-link]'). @@ -2758,7 +2951,10 @@ part of Org core. A `\\[universal-argument] \\[universal-argument] \\[universal-argument]' prefix ARG forces storing a link for each line in the active region. -\(fn ARG)" t nil) +Assume the function is called interactively if INTERACTIVE? is +non-nil. + +\(fn ARG &optional INTERACTIVE\\=\\?)" t nil) (autoload 'org-insert-link-global "org" "\ Insert a link like Org mode does. @@ -2767,11 +2963,12 @@ This command can be called in any mode to insert a link in Org syntax. \(fn)" t nil) (autoload 'org-open-at-point-global "org" "\ -Follow a link or time-stamp like Org mode does. -This command can be called in any mode to follow an external link -or a time-stamp that has Org mode syntax. Its behavior is -undefined when called on internal links (e.g., fuzzy links). -Raise an error when there is nothing to follow. +Follow a link or a time-stamp like Org mode does. +Also follow links and emails as seen by `thing-at-point'. +This command can be called in any mode to follow an external +link or a time-stamp that has Org mode syntax. Its behavior +is undefined when called on internal links like fuzzy links. +Raise a user error when there is nothing to follow. \(fn)" t nil) @@ -2808,7 +3005,7 @@ information about your Org version and configuration. \(fn)" t nil) (autoload 'org-reload "org" "\ -Reload all org lisp files. +Reload all Org Lisp files. With prefix arg UNCOMPILED, load the uncompiled versions. \(fn &optional UNCOMPILED)" t nil) @@ -2818,11 +3015,11 @@ Call the customize function with org as argument. \(fn)" t nil) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org" '("org" "turn-on-org-cdlatex"))) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org" '("org-" "turn-on-org-cdlatex"))) ;;;*** -;;;### (autoloads nil "ox" "ox.el" "861524bae5370b1ab6712ebe2d80bede") +;;;### (autoloads nil "ox" "ox.el" "9c5401ffd412922a5c0d1912ea6687fe") ;;; Generated autoloads from ox.el (autoload 'org-export-get-backend "ox" "\ @@ -3011,9 +3208,19 @@ When ARG is `\\[universal-argument] \\[universal-argument]', display the asynchr ;;;*** -;;;### (autoloads nil "ox-ascii" "ox-ascii.el" "ca8b95939d46c9376737538c2660aa31") +;;;### (autoloads nil "ox-ascii" "ox-ascii.el" "05e3f27f1926aa80e03e60c5a144698a") ;;; Generated autoloads from ox-ascii.el +(autoload 'org-ascii-convert-region-to-ascii "ox-ascii" "\ +Assume region has Org syntax, and convert it to plain ASCII. + +\(fn)" t nil) + +(autoload 'org-ascii-convert-region-to-utf8 "ox-ascii" "\ +Assume region has Org syntax, and convert it to UTF-8. + +\(fn)" t nil) + (autoload 'org-ascii-export-as-ascii "ox-ascii" "\ Export current buffer to a text buffer. @@ -3111,7 +3318,7 @@ Return output file name. ;;;*** -;;;### (autoloads nil "ox-beamer" "ox-beamer.el" "affe7e6681922d7ab773925092606eae") +;;;### (autoloads nil "ox-beamer" "ox-beamer.el" "8f4c533f7a78db11f5254c3eac3bd74a") ;;; Generated autoloads from ox-beamer.el (autoload 'org-beamer-mode "ox-beamer" "\ @@ -3246,7 +3453,7 @@ Return output file name. ;;;*** -;;;### (autoloads nil "ox-html" "ox-html.el" "ffa356f63d3f19a586258a14fc9f224a") +;;;### (autoloads nil "ox-html" "ox-html.el" "82d63fef0c62428e845fa0420d223001") ;;; Generated autoloads from ox-html.el (put 'org-html-head-include-default-style 'safe-local-variable 'booleanp) @@ -3352,7 +3559,7 @@ Return output file name. ;;;*** -;;;### (autoloads nil "ox-icalendar" "ox-icalendar.el" "0df89a368427479a7202699fc43e1e35") +;;;### (autoloads nil "ox-icalendar" "ox-icalendar.el" "3b1b67f6565e5b4d0184ce28171ddf72") ;;; Generated autoloads from ox-icalendar.el (autoload 'org-icalendar-export-to-ics "ox-icalendar" "\ @@ -3402,7 +3609,7 @@ The file is stored under the name chosen in ;;;*** -;;;### (autoloads nil "ox-latex" "ox-latex.el" "59a57319462788c1880bc548afed2b9a") +;;;### (autoloads nil "ox-latex" "ox-latex.el" "f053f99b85a13076e25129148beb2444") ;;; Generated autoloads from ox-latex.el (autoload 'org-latex-make-preamble "ox-latex" "\ @@ -3545,7 +3752,7 @@ Return output file name. ;;;*** -;;;### (autoloads nil "ox-md" "ox-md.el" "d350145384c591e5f0f7f44f40c89943") +;;;### (autoloads nil "ox-md" "ox-md.el" "8c71b478d4e65b73ade054f063fd7180") ;;; Generated autoloads from ox-md.el (autoload 'org-md-export-as-markdown "ox-md" "\ @@ -3617,7 +3824,7 @@ Return output file name. ;;;*** -;;;### (autoloads nil "ox-odt" "ox-odt.el" "2a23ef74aec1c6ce1ef331acb862f62e") +;;;### (autoloads nil "ox-odt" "ox-odt.el" "45fb134b33513af3eedc7e3f23c9c3cc") ;;; Generated autoloads from ox-odt.el (put 'org-odt-preferred-output-format 'safe-local-variable 'stringp) @@ -3679,7 +3886,7 @@ is non-nil then the newly converted file is opened using ;;;*** -;;;### (autoloads nil "ox-org" "ox-org.el" "9e35d02fdd46f270db72ae523ca317f0") +;;;### (autoloads nil "ox-org" "ox-org.el" "972097e855219af48a9bbf11d46718cf") ;;; Generated autoloads from ox-org.el (autoload 'org-org-export-as-org "ox-org" "\ @@ -3715,7 +3922,7 @@ non-nil. \(fn &optional ASYNC SUBTREEP VISIBLE-ONLY BODY-ONLY EXT-PLIST)" t nil) (autoload 'org-org-export-to-org "ox-org" "\ -Export current buffer to an org file. +Export current buffer to an Org file. If narrowing is active in the current buffer, only export its narrowed part. @@ -3745,7 +3952,7 @@ Return output file name. \(fn &optional ASYNC SUBTREEP VISIBLE-ONLY BODY-ONLY EXT-PLIST)" t nil) (autoload 'org-org-publish-to-org "ox-org" "\ -Publish an org file to org. +Publish an Org file to Org. FILENAME is the filename of the Org file to be published. PLIST is the property list for the given project. PUB-DIR is the @@ -3757,7 +3964,7 @@ Return output file name. ;;;*** -;;;### (autoloads nil "ox-publish" "ox-publish.el" "41c1de538019e00c45586522bbc29cee") +;;;### (autoloads nil "ox-publish" "ox-publish.el" "c482babb6cfcbf40e277920bd2c79d0e") ;;; Generated autoloads from ox-publish.el (defalias 'org-publish-project 'org-publish) @@ -3800,7 +4007,7 @@ the project. ;;;*** -;;;### (autoloads nil "ox-texinfo" "ox-texinfo.el" "6be5b8d2636a1cca1165c298f517d40d") +;;;### (autoloads nil "ox-texinfo" "ox-texinfo.el" "3b67fdba7e3d087dfe1bfff25105323a") ;;; Generated autoloads from ox-texinfo.el (autoload 'org-texinfo-export-to-texinfo "ox-texinfo" "\ diff --git a/elpa/org-20171030/org-macro.el b/elpa/org-20190930/org-macro.el similarity index 57% rename from elpa/org-20171030/org-macro.el rename to elpa/org-20190930/org-macro.el index 1d2823ea..e1241c30 100644 --- a/elpa/org-20171030/org-macro.el +++ b/elpa/org-20190930/org-macro.el @@ -1,6 +1,6 @@ ;;; org-macro.el --- Macro Replacement Code for Org -*- lexical-binding: t; -*- -;; Copyright (C) 2013-2017 Free Software Foundation, Inc. +;; Copyright (C) 2013-2019 Free Software Foundation, Inc. ;; Author: Nicolas Goaziou ;; Keywords: outlines, hypermedia, calendar, wp @@ -52,18 +52,24 @@ (declare-function org-element-at-point "org-element" ()) (declare-function org-element-context "org-element" (&optional element)) +(declare-function org-element-copy "org-element" (datum)) (declare-function org-element-macro-parser "org-element" ()) +(declare-function org-element-parse-secondary-string "org-element" (string restriction &optional parent)) (declare-function org-element-property "org-element" (property element)) +(declare-function org-element-restriction "org-element" (element)) (declare-function org-element-type "org-element" (element)) +(declare-function org-entry-get "org" (pom property &optional inherit literal-nil)) (declare-function org-file-contents "org" (file &optional noerror nocache)) (declare-function org-file-url-p "org" (file)) (declare-function org-in-commented-heading-p "org" (&optional no-inheritance)) +(declare-function org-link-search "org" (s &optional avoid-pos stealth)) (declare-function org-mode "org" ()) -(declare-function org-trim "org" (s &optional keep-lead)) (declare-function vc-backend "vc-hooks" (f)) (declare-function vc-call "vc-hooks" (fun file &rest args) t) (declare-function vc-exec-after "vc-dispatcher" (code)) +(defvar org-link-search-must-match-exact-headline) + ;;; Variables (defvar-local org-macro-templates nil @@ -77,94 +83,99 @@ directly, use instead: ;;; Functions -(defun org-macro--collect-macros () +(defun org-macro--set-template (name value templates) + "Set template for the macro NAME. +VALUE is the template of the macro. The new value override the +previous one, unless VALUE is nil. TEMPLATES is the list of +templates. Return the updated list." + (when value + (let ((old-definition (assoc name templates))) + (if old-definition + (setcdr old-definition value) + (push (cons name value) templates)))) + templates) + +(defun org-macro--collect-macros (&optional files templates) "Collect macro definitions in current buffer and setup files. -Return an alist containing all macro templates found." - (letrec ((collect-macros - (lambda (files templates) - ;; Return an alist of macro templates. FILES is a list - ;; of setup files names read so far, used to avoid - ;; circular dependencies. TEMPLATES is the alist - ;; collected so far. - (let ((case-fold-search t)) - (org-with-wide-buffer - (goto-char (point-min)) - (while (re-search-forward - "^[ \t]*#\\+\\(MACRO\\|SETUPFILE\\):" nil t) - (let ((element (org-element-at-point))) - (when (eq (org-element-type element) 'keyword) - (let ((val (org-element-property :value element))) - (if (equal (org-element-property :key element) "MACRO") - ;; Install macro in TEMPLATES. - (when (string-match - "^\\(.*?\\)\\(?:\\s-+\\(.*\\)\\)?\\s-*$" val) - (let* ((name (match-string 1 val)) - (template (or (match-string 2 val) "")) - (old-cell (assoc name templates))) - (if old-cell (setcdr old-cell template) - (push (cons name template) templates)))) - ;; Enter setup file. - (let* ((uri (org-unbracket-string "\"" "\"" (org-trim val))) - (uri-is-url (org-file-url-p uri)) - (uri (if uri-is-url - uri - (expand-file-name uri)))) - ;; Avoid circular dependencies. - (unless (member uri files) - (with-temp-buffer - (unless uri-is-url - (setq default-directory - (file-name-directory uri))) - (org-mode) - (insert (org-file-contents uri 'noerror)) - (setq templates - (funcall collect-macros (cons uri files) - templates))))))))))) - templates)))) - (funcall collect-macros nil nil))) +Return an alist containing all macro templates found. + +FILES is a list of setup files names read so far, used to avoid +circular dependencies. TEMPLATES is the alist collected so far. +The two arguments are used in recursive calls." + (let ((case-fold-search t)) + (org-with-point-at 1 + (while (re-search-forward "^[ \t]*#\\+\\(MACRO\\|SETUPFILE\\):" nil t) + (let ((element (org-element-at-point))) + (when (eq (org-element-type element) 'keyword) + (let ((val (org-element-property :value element))) + (if (equal "MACRO" (org-element-property :key element)) + ;; Install macro in TEMPLATES. + (when (string-match "^\\(\\S-+\\)[ \t]*" val) + (let ((name (match-string 1 val)) + (value (substring val (match-end 0)))) + (setq templates + (org-macro--set-template name value templates)))) + ;; Enter setup file. + (let* ((uri (org-strip-quotes val)) + (uri-is-url (org-file-url-p uri)) + (uri (if uri-is-url + uri + (expand-file-name uri)))) + ;; Avoid circular dependencies. + (unless (member uri files) + (with-temp-buffer + (unless uri-is-url + (setq default-directory (file-name-directory uri))) + (org-mode) + (insert (org-file-contents uri 'noerror)) + (setq templates + (org-macro--collect-macros + (cons uri files) templates))))))))))) + (let ((macros `(("author" . ,(org-macro--find-keyword-value "AUTHOR")) + ("email" . ,(org-macro--find-keyword-value "EMAIL")) + ("title" . ,(org-macro--find-keyword-value "TITLE" t)) + ("date" . ,(org-macro--find-date))))) + (pcase-dolist (`(,name . ,value) macros) + (setq templates (org-macro--set-template name value templates)))) + templates)) (defun org-macro-initialize-templates () "Collect macro templates defined in current buffer. + Templates are stored in buffer-local variable -`org-macro-templates'. In addition to buffer-defined macros, the -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)) - (update-templates - (lambda (cell) - (let ((old-template (assoc (car cell) templates))) - (if old-template (setcdr old-template (cdr cell)) - (push cell templates)))))) - ;; Install "property", "time" macros. - (mapc update-templates - (list (cons "property" - "(eval (save-excursion - (let ((l \"$2\")) - (when (org-string-nw-p l) - (condition-case _ - (let ((org-link-search-must-match-exact-headline t)) - (org-link-search l nil t)) - (error - (error \"Macro property failed: cannot find location %s\" - l))))) - (org-entry-get nil \"$1\" 'selective)))") - (cons "time" "(eval (format-time-string \"$1\"))"))) - ;; Install "input-file", "modification-time" macros. - (let ((visited-file (buffer-file-name (buffer-base-buffer)))) - (when (and visited-file (file-exists-p visited-file)) - (mapc update-templates - (list (cons "input-file" (file-name-nondirectory visited-file)) - (cons "modification-time" - (format "(eval (format-time-string \"$1\" (or (and (org-string-nw-p \"$2\") (org-macro--vc-modified-time %s)) '%s)))" - (prin1-to-string visited-file) - (prin1-to-string - (nth 5 (file-attributes visited-file))))))))) - ;; Initialize and install "n" macro. - (org-macro--counter-initialize) - (funcall update-templates - (cons "n" "(eval (org-macro--counter-increment \"$1\" \"$2\"))")) - (setq org-macro-templates templates))) +`org-macro-templates'. + +In addition to buffer-defined macros, the function installs the +following ones: \"n\", \"author\", \"email\", \"keyword\", +\"time\", \"property\", and, if the buffer is associated to +a file, \"input-file\" and \"modification-time\"." + (org-macro--counter-initialize) ;for "n" macro + (setq org-macro-templates + (nconc + ;; Install user-defined macros. + (org-macro--collect-macros) + ;; Install file-specific macros. + (let ((visited-file (buffer-file-name (buffer-base-buffer)))) + (and visited-file + (file-exists-p visited-file) + (list + `("input-file" . ,(file-name-nondirectory visited-file)) + `("modification-time" . + ,(format "(eval +\(format-time-string $1 + (or (and (org-string-nw-p $2) + (org-macro--vc-modified-time %s)) + '%s)))" + (prin1-to-string visited-file) + (prin1-to-string + (file-attribute-modification-time + (file-attributes visited-file)))))))) + ;; Install generic macros. + (list + '("n" . "(eval (org-macro--counter-increment $1 $2))") + '("keyword" . "(eval (org-macro--find-keyword-value $1))") + '("time" . "(eval (format-time-string $1))") + '("property" . "(eval (org-macro--get-property $1 $2))"))))) (defun org-macro-expand (macro templates) "Return expanded MACRO, as a string. @@ -176,31 +187,35 @@ default value. Return nil if no template was found." ;; Macro names are case-insensitive. (cdr (assoc-string (org-element-property :key macro) templates t)))) (when template - (let ((value (replace-regexp-in-string - "\\$[0-9]+" - (lambda (arg) - (or (nth (1- (string-to-number (substring arg 1))) - (org-element-property :args macro)) - ;; No argument: remove place-holder. - "")) - template nil 'literal))) - ;; VALUE starts with "(eval": it is a s-exp, `eval' it. - (when (string-match "\\`(eval\\>" value) - (setq value (eval (read value)))) - ;; Return string. + (let* ((eval? (string-match-p "\\`(eval\\>" template)) + (value + (replace-regexp-in-string + "\\$[0-9]+" + (lambda (m) + (let ((arg (or (nth (1- (string-to-number (substring m 1))) + (org-element-property :args macro)) + ;; No argument: remove place-holder. + ""))) + ;; `eval' implies arguments are strings. + (if eval? (format "%S" arg) arg))) + template nil 'literal))) + (when eval? + (setq value (eval (condition-case nil (read value) + (error (debug)))))) + ;; Force return value to be a string. (format "%s" (or value "")))))) -(defun org-macro-replace-all (templates &optional finalize keywords) +(defun org-macro-replace-all (templates &optional keywords) "Replace all macros in current buffer by their expansion. TEMPLATES is an alist of templates used for expansion. See `org-macro-templates' for a buffer-local default value. -If optional arg FINALIZE is non-nil, raise an error if a macro is -found in the buffer with no definition in TEMPLATES. - Optional argument KEYWORDS, when non-nil is a list of keywords, -as strings, where macro expansion is allowed." +as strings, where macro expansion is allowed. + +Return an error if a macro in the buffer cannot be associated to +a definition in TEMPLATES." (org-with-wide-buffer (goto-char (point-min)) (let ((properties-regexp (format "\\`EXPORT_%s\\+?\\'" @@ -224,7 +239,8 @@ as strings, where macro expansion is allowed." (goto-char (match-beginning 0)) (org-element-macro-parser)))))) (when macro - (let* ((value (org-macro-expand macro templates)) + (let* ((key (org-element-property :key macro)) + (value (org-macro-expand macro templates)) (begin (org-element-property :begin macro)) (signature (list begin macro @@ -233,8 +249,7 @@ as strings, where macro expansion is allowed." ;; macro with the same arguments is expanded at the ;; same position twice. (cond ((member signature record) - (error "Circular macro expansion: %s" - (org-element-property :key macro))) + (error "Circular macro expansion: %s" key)) (value (push signature record) (delete-region @@ -246,7 +261,11 @@ as strings, where macro expansion is allowed." ;; Leave point before replacement in case of ;; recursive expansions. (save-excursion (insert value))) - (finalize + ;; Special "results" macro: if it is not defined, + ;; simply leave it as-is. It will be expanded in + ;; a second phase. + ((equal key "results")) + (t (error "Undefined Org macro: %s; aborting" (org-element-property :key macro)))))))))))) @@ -294,6 +313,53 @@ Return a list of arguments, as strings. This is the opposite of ;;; Helper functions and variables for internal macros +(defun org-macro--get-property (property location) + "Find PROPERTY's value at LOCATION. +PROPERTY is a string. LOCATION is a search string, as expected +by `org-link-search', or the empty string." + (save-excursion + (when (org-string-nw-p location) + (condition-case _ + (let ((org-link-search-must-match-exact-headline t)) + (org-link-search location nil t)) + (error + (error "Macro property failed: cannot find location %s" location)))) + (org-entry-get nil property 'selective))) + +(defun org-macro--find-keyword-value (name &optional collect) + "Find value for keyword NAME in current buffer. +Return value associated to the keywords named after NAME, as +a string, or nil. When optional argument COLLECT is non-nil, +concatenate values, separated with a space, from various keywords +in the buffer." + (org-with-point-at 1 + (let ((regexp (format "^[ \t]*#\\+%s:" (regexp-quote name))) + (case-fold-search t) + (result nil)) + (catch :exit + (while (re-search-forward regexp nil t) + (let ((element (org-element-at-point))) + (when (eq 'keyword (org-element-type element)) + (let ((value (org-element-property :value element))) + (if (not collect) (throw :exit value) + (setq result (concat result " " value))))))) + (and result (org-trim result)))))) + +(defun org-macro--find-date () + "Find value for DATE in current buffer. +Return value as a string." + (let* ((value (org-macro--find-keyword-value "DATE")) + (date (org-element-parse-secondary-string + value (org-element-restriction 'keyword)))) + (if (and (consp date) + (not (cdr date)) + (eq 'timestamp (org-element-type (car date)))) + (format "(eval (if (org-string-nw-p $1) %s %S))" + (format "(org-timestamp-format '%S $1)" + (org-element-copy (car date))) + value) + value))) + (defun org-macro--vc-modified-time (file) (save-window-excursion (when (vc-backend file) diff --git a/elpa/org-20190930/org-macs.el b/elpa/org-20190930/org-macs.el new file mode 100644 index 00000000..23f96ef2 --- /dev/null +++ b/elpa/org-20190930/org-macs.el @@ -0,0 +1,1163 @@ +;;; org-macs.el --- Top-level Definitions for Org -*- lexical-binding: t; -*- + +;; Copyright (C) 2004-2019 Free Software Foundation, Inc. + +;; Author: Carsten Dominik +;; Keywords: outlines, hypermedia, calendar, wp +;; Homepage: https://orgmode.org +;; +;; This file is part of GNU Emacs. +;; +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;;; Commentary: + +;; This file contains macro definitions, defsubst definitions, other +;; stuff needed for compilation and top-level forms in Org mode, as +;; well lots of small functions that are not Org mode specific but +;; simply generally useful stuff. + +;;; Code: + +(require 'cl-lib) +(require 'format-spec) + +(declare-function org-string-collate-lessp "org-compat" (s1 s2 &optional locale ignore-case)) + +(defvar org-ts-regexp0) + + +;;; Macros + +(defmacro org-with-gensyms (symbols &rest body) + (declare (debug (sexp body)) (indent 1)) + `(let ,(mapcar (lambda (s) + `(,s (make-symbol (concat "--" (symbol-name ',s))))) + symbols) + ,@body)) + +;; Use `with-silent-modifications' to ignore cosmetic changes and +;; `org-unmodified' to ignore real text modifications. +(defmacro org-unmodified (&rest body) + "Run BODY while preserving the buffer's `buffer-modified-p' state." + (declare (debug (body))) + (org-with-gensyms (was-modified) + `(let ((,was-modified (buffer-modified-p))) + (unwind-protect + (let ((buffer-undo-list t) + (inhibit-modification-hooks t)) + ,@body) + (set-buffer-modified-p ,was-modified))))) + +(defmacro org-without-partial-completion (&rest body) + (declare (debug (body))) + `(if (and (boundp 'partial-completion-mode) + partial-completion-mode + (fboundp 'partial-completion-mode)) + (unwind-protect + (progn + (partial-completion-mode -1) + ,@body) + (partial-completion-mode 1)) + ,@body)) + +(defmacro org-with-point-at (pom &rest body) + "Move to buffer and point of point-or-marker POM for the duration of BODY." + (declare (debug (form body)) (indent 1)) + (org-with-gensyms (mpom) + `(let ((,mpom ,pom)) + (save-excursion + (when (markerp ,mpom) (set-buffer (marker-buffer ,mpom))) + (org-with-wide-buffer + (goto-char (or ,mpom (point))) + ,@body))))) + +(defmacro org-with-remote-undo (buffer &rest body) + "Execute BODY while recording undo information in two buffers." + (declare (debug (form body)) (indent 1)) + (org-with-gensyms (cline cmd buf1 buf2 undo1 undo2 c1 c2) + `(let ((,cline (org-current-line)) + (,cmd this-command) + (,buf1 (current-buffer)) + (,buf2 ,buffer) + (,undo1 buffer-undo-list) + (,undo2 (with-current-buffer ,buffer buffer-undo-list)) + ,c1 ,c2) + ,@body + (when org-agenda-allow-remote-undo + (setq ,c1 (org-verify-change-for-undo + ,undo1 (with-current-buffer ,buf1 buffer-undo-list)) + ,c2 (org-verify-change-for-undo + ,undo2 (with-current-buffer ,buf2 buffer-undo-list))) + (when (or ,c1 ,c2) + ;; make sure there are undo boundaries + (and ,c1 (with-current-buffer ,buf1 (undo-boundary))) + (and ,c2 (with-current-buffer ,buf2 (undo-boundary))) + ;; remember which buffer to undo + (push (list ,cmd ,cline ,buf1 ,c1 ,buf2 ,c2) + org-agenda-undo-list)))))) + +(defmacro org-no-read-only (&rest body) + "Inhibit read-only for BODY." + (declare (debug (body))) + `(let ((inhibit-read-only t)) ,@body)) + +(defmacro org-save-outline-visibility (use-markers &rest body) + "Save and restore outline visibility around BODY. +If USE-MARKERS is non-nil, use markers for the positions. This +means that the buffer may change while running BODY, but it also +means that the buffer should stay alive during the operation, +because otherwise all these markers will point to nowhere." + (declare (debug (form body)) (indent 1)) + (org-with-gensyms (data invisible-types markers?) + `(let* ((,invisible-types '(org-hide-block org-hide-drawer outline)) + (,markers? ,use-markers) + (,data + (mapcar (lambda (o) + (let ((beg (overlay-start o)) + (end (overlay-end o)) + (type (overlay-get o 'invisible))) + (and beg end + (> end beg) + (memq type ,invisible-types) + (list (if ,markers? (copy-marker beg) beg) + (if ,markers? (copy-marker end t) end) + type)))) + (org-with-wide-buffer + (overlays-in (point-min) (point-max)))))) + (unwind-protect (progn ,@body) + (org-with-wide-buffer + (dolist (type ,invisible-types) + (remove-overlays (point-min) (point-max) 'invisible type)) + (pcase-dolist (`(,beg ,end ,type) (delq nil ,data)) + (org-flag-region beg end t type) + (when ,markers? + (set-marker beg nil) + (set-marker end nil)))))))) + +(defmacro org-with-wide-buffer (&rest body) + "Execute body while temporarily widening the buffer." + (declare (debug (body))) + `(save-excursion + (save-restriction + (widen) + ,@body))) + +(defmacro org-with-limited-levels (&rest body) + "Execute BODY with limited number of outline levels." + (declare (debug (body))) + `(progn + (defvar org-called-with-limited-levels) + (defvar org-outline-regexp) + (defvar outline-regexp) + (defvar org-outline-regexp-bol) + (let* ((org-called-with-limited-levels t) + (org-outline-regexp (org-get-limited-outline-regexp)) + (outline-regexp org-outline-regexp) + (org-outline-regexp-bol (concat "^" org-outline-regexp))) + ,@body))) + +(defmacro org-eval-in-environment (environment form) + (declare (debug (form form)) (indent 1)) + `(eval (list 'let ,environment ',form))) + +;;;###autoload +(defmacro org-load-noerror-mustsuffix (file) + "Load FILE with optional arguments NOERROR and MUSTSUFFIX." + `(load ,file 'noerror nil nil 'mustsuffix)) + +(defmacro org-preserve-local-variables (&rest body) + "Execute BODY while preserving local variables." + (declare (debug (body))) + `(let ((local-variables + (org-with-wide-buffer + (goto-char (point-max)) + (let ((case-fold-search t)) + (and (re-search-backward "^[ \t]*# +Local Variables:" + (max (- (point) 3000) 1) + t) + (delete-and-extract-region (point) (point-max))))))) + (unwind-protect (progn ,@body) + (when local-variables + (org-with-wide-buffer + (goto-char (point-max)) + ;; If last section is folded, make sure to also hide file + ;; local variables after inserting them back. + (let ((overlay + (cl-find-if (lambda (o) + (eq 'outline (overlay-get o 'invisible))) + (overlays-at (1- (point)))))) + (unless (bolp) (insert "\n")) + (insert local-variables) + (when overlay + (move-overlay overlay (overlay-start overlay) (point-max))))))))) + +(defmacro org-no-popups (&rest body) + "Suppress popup windows and evaluate BODY." + `(let (pop-up-frames display-buffer-alist) + ,@body)) + +(defmacro org-table-with-shrunk-field (&rest body) + "Save field shrunk state, execute BODY and restore state." + (declare (debug (body))) + (org-with-gensyms (end shrunk size) + `(let* ((,shrunk (save-match-data (org-table--shrunk-field))) + (,end (and ,shrunk (copy-marker (overlay-end ,shrunk) t))) + (,size (and ,shrunk (- ,end (overlay-start ,shrunk))))) + (when ,shrunk (delete-overlay ,shrunk)) + (unwind-protect (progn ,@body) + (when ,shrunk (move-overlay ,shrunk (- ,end ,size) ,end)))))) + + +;;; Buffer and windows + +(defun org-base-buffer (buffer) + "Return the base buffer of BUFFER, if it has one. Else return the buffer." + (when buffer + (or (buffer-base-buffer buffer) + buffer))) + +(defun org-find-base-buffer-visiting (file) + "Like `find-buffer-visiting' but always return the base buffer and +not an indirect buffer." + (let ((buf (or (get-file-buffer file) + (find-buffer-visiting file)))) + (org-base-buffer buf))) + +(defun org-switch-to-buffer-other-window (&rest args) + "Switch to buffer in a second window on the current frame. +In particular, do not allow pop-up frames. +Returns the newly created buffer." + (org-no-popups (apply #'switch-to-buffer-other-window args))) + +(defun org-fit-window-to-buffer (&optional window max-height min-height + shrink-only) + "Fit WINDOW to the buffer, but only if it is not a side-by-side window. +WINDOW defaults to the selected window. MAX-HEIGHT and MIN-HEIGHT are +passed through to `fit-window-to-buffer'. If SHRINK-ONLY is set, call +`shrink-window-if-larger-than-buffer' instead, the height limit is +ignored in this case." + (cond ((if (fboundp 'window-full-width-p) + (not (window-full-width-p window)) + ;; Do nothing if another window would suffer. + (> (frame-width) (window-width window)))) + ((and (fboundp 'fit-window-to-buffer) (not shrink-only)) + (fit-window-to-buffer window max-height min-height)) + ((fboundp 'shrink-window-if-larger-than-buffer) + (shrink-window-if-larger-than-buffer window))) + (or window (selected-window))) + + + +;;; File + +(defun org-file-newer-than-p (file time) + "Non-nil if FILE is newer than TIME. +FILE is a filename, as a string, TIME is a list of integers, as +returned by, e.g., `current-time'." + (and (file-exists-p file) + ;; Only compare times up to whole seconds as some file-systems + ;; (e.g. HFS+) do not retain any finer granularity. As + ;; a consequence, make sure we return non-nil when the two + ;; times are equal. + (not (time-less-p (cl-subseq (nth 5 (file-attributes file)) 0 2) + (cl-subseq time 0 2))))) + +(defun org-compile-file (source process ext &optional err-msg log-buf spec) + "Compile a SOURCE file using PROCESS. + +PROCESS is either a function or a list of shell commands, as +strings. EXT is a file extension, without the leading dot, as +a string. It is used to check if the process actually succeeded. + +PROCESS must create a file with the same base name and directory +as SOURCE, but ending with EXT. The function then returns its +filename. Otherwise, it raises an error. The error message can +then be refined by providing string ERR-MSG, which is appended to +the standard message. + +If PROCESS is a function, it is called with a single argument: +the SOURCE file. + +If it is a list of commands, each of them is called using +`shell-command'. By default, in each command, %b, %f, %F, %o and +%O are replaced with, respectively, SOURCE base name, name, full +name, directory and absolute output file name. It is possible, +however, to use more place-holders by specifying them in optional +argument SPEC, as an alist following the pattern + + (CHARACTER . REPLACEMENT-STRING). + +When PROCESS is a list of commands, optional argument LOG-BUF can +be set to a buffer or a buffer name. `shell-command' then uses +it for output." + (let* ((base-name (file-name-base source)) + (full-name (file-truename source)) + (out-dir (or (file-name-directory source) "./")) + (output (expand-file-name (concat base-name "." ext) out-dir)) + (time (current-time)) + (err-msg (if (stringp err-msg) (concat ". " err-msg) ""))) + (save-window-excursion + (pcase process + ((pred functionp) (funcall process (shell-quote-argument source))) + ((pred consp) + (let ((log-buf (and log-buf (get-buffer-create log-buf))) + (spec (append spec + `((?b . ,(shell-quote-argument base-name)) + (?f . ,(shell-quote-argument source)) + (?F . ,(shell-quote-argument full-name)) + (?o . ,(shell-quote-argument out-dir)) + (?O . ,(shell-quote-argument output)))))) + (dolist (command process) + (shell-command (format-spec command spec) log-buf)) + (when log-buf (with-current-buffer log-buf (compilation-mode))))) + (_ (error "No valid command to process %S%s" source err-msg)))) + ;; Check for process failure. Output file is expected to be + ;; located in the same directory as SOURCE. + (unless (org-file-newer-than-p output time) + (error (format "File %S wasn't produced%s" output err-msg))) + output)) + + + +;;; Indentation + +(defun org-do-remove-indentation (&optional n) + "Remove the maximum common indentation from the buffer. +When optional argument N is a positive integer, remove exactly +that much characters from indentation, if possible. Return nil +if it fails." + (catch :exit + (goto-char (point-min)) + ;; Find maximum common indentation, if not specified. + (let ((n (or n + (let ((min-ind (point-max))) + (save-excursion + (while (re-search-forward "^[ \t]*\\S-" nil t) + (let ((ind (1- (current-column)))) + (if (zerop ind) (throw :exit nil) + (setq min-ind (min min-ind ind)))))) + min-ind)))) + (if (zerop n) (throw :exit nil) + ;; Remove exactly N indentation, but give up if not possible. + (while (not (eobp)) + (let ((ind (progn (skip-chars-forward " \t") (current-column)))) + (cond ((eolp) (delete-region (line-beginning-position) (point))) + ((< ind n) (throw :exit nil)) + (t (indent-line-to (- ind n)))) + (forward-line))) + ;; Signal success. + t)))) + + + +;;; Input + +(defun org-read-function (prompt &optional allow-empty?) + "Prompt for a function. +If ALLOW-EMPTY? is non-nil, return nil rather than raising an +error when the user input is empty." + (let ((func (completing-read prompt obarray #'fboundp t))) + (cond ((not (string= func "")) + (intern func)) + (allow-empty? nil) + (t (user-error "Empty input is not valid"))))) + +(defun org-completing-read (&rest args) + "Completing-read with SPACE being a normal character." + (let ((enable-recursive-minibuffers t) + (minibuffer-local-completion-map + (copy-keymap minibuffer-local-completion-map))) + (define-key minibuffer-local-completion-map " " 'self-insert-command) + (define-key minibuffer-local-completion-map "?" 'self-insert-command) + (define-key minibuffer-local-completion-map (kbd "C-c !") + 'org-time-stamp-inactive) + (apply #'completing-read args))) + +(defun org--mks-read-key (allowed-keys prompt) + "Read a key and ensure it is a member of ALLOWED-KEYS. +TAB, SPC and RET are treated equivalently." + (let* ((key (char-to-string + (pcase (read-char-exclusive prompt) + ((or ?\s ?\t ?\r) ?\t) + (char char))))) + (if (member key allowed-keys) + key + (message "Invalid key: `%s'" key) + (sit-for 1) + (org--mks-read-key allowed-keys prompt)))) + +(defun org-mks (table title &optional prompt specials) + "Select a member of an alist with multiple keys. + +TABLE is the alist which should contain entries where the car is a string. +There should be two types of entries. + +1. prefix descriptions like (\"a\" \"Description\") + This indicates that `a' is a prefix key for multi-letter selection, and + that there are entries following with keys like \"ab\", \"ax\"... + +2. Select-able members must have more than two elements, with the first + being the string of keys that lead to selecting it, and the second a + short description string of the item. + +The command will then make a temporary buffer listing all entries +that can be selected with a single key, and all the single key +prefixes. When you press the key for a single-letter entry, it is selected. +When you press a prefix key, the commands (and maybe further prefixes) +under this key will be shown and offered for selection. + +TITLE will be placed over the selection in the temporary buffer, +PROMPT will be used when prompting for a key. SPECIALS is an +alist with (\"key\" \"description\") entries. When one of these +is selected, only the bare key is returned." + (save-window-excursion + (let ((inhibit-quit t) + (buffer (org-switch-to-buffer-other-window "*Org Select*")) + (prompt (or prompt "Select: ")) + current) + (unwind-protect + (catch 'exit + (while t + (erase-buffer) + (insert title "\n\n") + (let ((des-keys nil) + (allowed-keys '("\C-g")) + (tab-alternatives '("\s" "\t" "\r")) + (cursor-type nil)) + ;; Populate allowed keys and descriptions keys + ;; available with CURRENT selector. + (let ((re (format "\\`%s\\(.\\)\\'" + (if current (regexp-quote current) ""))) + (prefix (if current (concat current " ") ""))) + (dolist (entry table) + (pcase entry + ;; Description. + (`(,(and key (pred (string-match re))) ,desc) + (let ((k (match-string 1 key))) + (push k des-keys) + ;; Keys ending in tab, space or RET are equivalent. + (if (member k tab-alternatives) + (push "\t" allowed-keys) + (push k allowed-keys)) + (insert prefix "[" k "]" "..." " " desc "..." "\n"))) + ;; Usable entry. + (`(,(and key (pred (string-match re))) ,desc . ,_) + (let ((k (match-string 1 key))) + (insert prefix "[" k "]" " " desc "\n") + (push k allowed-keys))) + (_ nil)))) + ;; Insert special entries, if any. + (when specials + (insert "----------------------------------------------------\ +---------------------------\n") + (pcase-dolist (`(,key ,description) specials) + (insert (format "[%s] %s\n" key description)) + (push key allowed-keys))) + ;; Display UI and let user select an entry or + ;; a sub-level prefix. + (goto-char (point-min)) + (unless (pos-visible-in-window-p (point-max)) + (org-fit-window-to-buffer)) + (let ((pressed (org--mks-read-key allowed-keys prompt))) + (setq current (concat current pressed)) + (cond + ((equal pressed "\C-g") (user-error "Abort")) + ;; Selection is a prefix: open a new menu. + ((member pressed des-keys)) + ;; Selection matches an association: return it. + ((let ((entry (assoc current table))) + (and entry (throw 'exit entry)))) + ;; Selection matches a special entry: return the + ;; selection prefix. + ((assoc current specials) (throw 'exit current)) + (t (error "No entry available"))))))) + (when buffer (kill-buffer buffer)))))) + + +;;; List manipulation + +(defsubst org-get-alist-option (option key) + (cond ((eq key t) t) + ((eq option t) t) + ((assoc key option) (cdr (assoc key option))) + (t (let ((r (cdr (assq 'default option)))) + (if (listp r) (delq nil r) r))))) + +(defsubst org-last (list) + "Return the last element of LIST." + (car (last list))) + +(defsubst org-uniquify (list) + "Non-destructively remove duplicate elements from LIST." + (let ((res (copy-sequence list))) (delete-dups res))) + +(defun org-uniquify-alist (alist) + "Merge elements of ALIST with the same key. + +For example, in this alist: + +\(org-uniquify-alist \\='((a 1) (b 2) (a 3))) + => \\='((a 1 3) (b 2)) + +merge (a 1) and (a 3) into (a 1 3). + +The function returns the new ALIST." + (let (rtn) + (dolist (e alist rtn) + (let (n) + (if (not (assoc (car e) rtn)) + (push e rtn) + (setq n (cons (car e) (append (cdr (assoc (car e) rtn)) (cdr e)))) + (setq rtn (assq-delete-all (car e) rtn)) + (push n rtn)))))) + +(defun org-delete-all (elts list) + "Remove all elements in ELTS from LIST. +Comparison is done with `equal'. It is a destructive operation +that may remove elements by altering the list structure." + (while elts + (setq list (delete (pop elts) list))) + list) + +(defun org-plist-delete (plist property) + "Delete PROPERTY from PLIST. +This is in contrast to merely setting it to 0." + (let (p) + (while plist + (if (not (eq property (car plist))) + (setq p (plist-put p (car plist) (nth 1 plist)))) + (setq plist (cddr plist))) + p)) + +(defun org-combine-plists (&rest plists) + "Create a single property list from all plists in PLISTS. +The process starts by copying the first list, and then setting properties +from the other lists. Settings in the last list are the most significant +ones and overrule settings in the other lists." + (let ((rtn (copy-sequence (pop plists))) + p v ls) + (while plists + (setq ls (pop plists)) + (while ls + (setq p (pop ls) v (pop ls)) + (setq rtn (plist-put rtn p v)))) + rtn)) + + + +;;; Local variables + +(defconst org-unique-local-variables + '(org-element--cache + org-element--cache-objects + org-element--cache-sync-keys + org-element--cache-sync-requests + org-element--cache-sync-timer) + "List of local variables that cannot be transferred to another buffer.") + +(defun org-get-local-variables () + "Return a list of all local variables in an Org mode buffer." + (delq nil + (mapcar + (lambda (x) + (let* ((binding (if (symbolp x) (list x) (list (car x) (cdr x)))) + (name (car binding))) + (and (not (get name 'org-state)) + (not (memq name org-unique-local-variables)) + (string-match-p + "\\`\\(org-\\|orgtbl-\\|outline-\\|comment-\\|paragraph-\\|\ +auto-fill\\|normal-auto-fill\\|fill-paragraph\\|indent-\\)" + (symbol-name name)) + binding))) + (with-temp-buffer + (org-mode) + (buffer-local-variables))))) + +(defun org-clone-local-variables (from-buffer &optional regexp) + "Clone local variables from FROM-BUFFER. +Optional argument REGEXP selects variables to clone." + (dolist (pair (buffer-local-variables from-buffer)) + (pcase pair + (`(,name . ,value) ;ignore unbound variables + (when (and (not (memq name org-unique-local-variables)) + (or (null regexp) (string-match-p regexp (symbol-name name)))) + (ignore-errors (set (make-local-variable name) value))))))) + + +;;; Miscellaneous + +(defsubst org-call-with-arg (command arg) + "Call COMMAND interactively, but pretend prefix arg was ARG." + (let ((current-prefix-arg arg)) (call-interactively command))) + +(defsubst org-check-external-command (cmd &optional use no-error) + "Check if external program CMD for USE exists, error if not. +When the program does exist, return its path. +When it does not exist and NO-ERROR is set, return nil. +Otherwise, throw an error. The optional argument USE can describe what this +program is needed for, so that the error message can be more informative." + (or (executable-find cmd) + (if no-error + nil + (error "Can't find `%s'%s" cmd + (if use (format " (%s)" use) ""))))) + +(defun org-display-warning (message) + "Display the given MESSAGE as a warning." + (display-warning 'org message :warning)) + +(defun org-unlogged-message (&rest args) + "Display a message, but avoid logging it in the *Messages* buffer." + (let ((message-log-max nil)) + (apply #'message args))) + +(defun org-let (list &rest body) + (eval (cons 'let (cons list body)))) +(put 'org-let 'lisp-indent-function 1) + +(defun org-let2 (list1 list2 &rest body) + (eval (cons 'let (cons list1 (list (cons 'let (cons list2 body))))))) +(put 'org-let2 'lisp-indent-function 2) + +(defun org-eval (form) + "Eval FORM and return result." + (condition-case error + (eval form) + (error (format "%%![Error: %s]" error)))) + +(defvar org-outline-regexp) ; defined in org.el +(defvar org-odd-levels-only) ; defined in org.el +(defvar org-inlinetask-min-level) ; defined in org-inlinetask.el +(defun org-get-limited-outline-regexp () + "Return outline-regexp with limited number of levels. +The number of levels is controlled by `org-inlinetask-min-level'." + (cond ((not (derived-mode-p 'org-mode)) + outline-regexp) + ((not (featurep 'org-inlinetask)) + org-outline-regexp) + (t + (let* ((limit-level (1- org-inlinetask-min-level)) + (nstars (if org-odd-levels-only + (1- (* limit-level 2)) + limit-level))) + (format "\\*\\{1,%d\\} " nstars))))) + + + +;;; Motion + +(defsubst org-goto-line (N) + (save-restriction + (widen) + (goto-char (point-min)) + (forward-line (1- N)))) + +(defsubst org-current-line (&optional pos) + (save-excursion + (and pos (goto-char pos)) + ;; works also in narrowed buffer, because we start at 1, not point-min + (+ (if (bolp) 1 0) (count-lines 1 (point))))) + + + +;;; Overlays + +(defun org-overlay-display (ovl text &optional face evap) + "Make overlay OVL display TEXT with face FACE." + (overlay-put ovl 'display text) + (when face (overlay-put ovl 'face face)) + (when evap (overlay-put ovl 'evaporate t))) + +(defun org-overlay-before-string (ovl text &optional face evap) + "Make overlay OVL display TEXT with face FACE." + (when face (org-add-props text nil 'face face)) + (overlay-put ovl 'before-string text) + (when evap (overlay-put ovl 'evaporate t))) + +(defun org-find-overlays (prop &optional pos delete) + "Find all overlays specifying PROP at POS or point. +If DELETE is non-nil, delete all those overlays." + (let (found) + (dolist (ov (overlays-at (or pos (point))) found) + (cond ((not (overlay-get ov prop))) + (delete (delete-overlay ov)) + (t (push ov found)))))) + +(defun org-flag-region (from to flag spec) + "Hide or show lines from FROM to TO, according to FLAG. +SPEC is the invisibility spec, as a symbol." + (remove-overlays from to 'invisible spec) + ;; Use `front-advance' since text right before to the beginning of + ;; the overlay belongs to the visible line than to the contents. + (when flag + (let ((o (make-overlay from to nil 'front-advance))) + (overlay-put o 'evaporate t) + (overlay-put o 'invisible spec) + (overlay-put o 'isearch-open-invisible #'delete-overlay)))) + + + +;;; Regexp matching + +(defsubst org-pos-in-match-range (pos n) + (and (match-beginning n) + (<= (match-beginning n) pos) + (>= (match-end n) pos))) + +(defun org-skip-whitespace () + "Skip over space, tabs and newline characters." + (skip-chars-forward " \t\n\r")) + +(defun org-match-line (regexp) + "Match REGEXP at the beginning of the current line." + (save-excursion + (beginning-of-line) + (looking-at regexp))) + +(defun org-match-any-p (re list) + "Non-nil if regexp RE matches an element in LIST." + (cl-some (lambda (x) (string-match-p re x)) list)) + +(defun org-in-regexp (regexp &optional nlines visually) + "Check if point is inside a match of REGEXP. + +Normally only the current line is checked, but you can include +NLINES extra lines around point into the search. If VISUALLY is +set, require that the cursor is not after the match but really +on, so that the block visually is on the match. + +Return nil or a cons cell (BEG . END) where BEG and END are, +respectively, the positions at the beginning and the end of the +match." + (catch :exit + (let ((pos (point)) + (eol (line-end-position (if nlines (1+ nlines) 1)))) + (save-excursion + (beginning-of-line (- 1 (or nlines 0))) + (while (and (re-search-forward regexp eol t) + (<= (match-beginning 0) pos)) + (let ((end (match-end 0))) + (when (or (> end pos) (and (= end pos) (not visually))) + (throw :exit (cons (match-beginning 0) (match-end 0)))))))))) + +(defun org-point-in-group (point group &optional context) + "Check if POINT is in match-group GROUP. +If CONTEXT is non-nil, return a list with CONTEXT and the boundaries of the +match. If the match group does not exist or point is not inside it, +return nil." + (and (match-beginning group) + (>= point (match-beginning group)) + (<= point (match-end group)) + (if context + (list context (match-beginning group) (match-end group)) + t))) + + + +;;; String manipulation + +(defun org-string< (a b) + (org-string-collate-lessp a b)) + +(defun org-string<= (a b) + (or (string= a b) (org-string-collate-lessp a b))) + +(defun org-string>= (a b) + (not (org-string-collate-lessp a b))) + +(defun org-string> (a b) + (and (not (string= a b)) + (not (org-string-collate-lessp a b)))) + +(defun org-string<> (a b) + (not (string= a b))) + +(defsubst org-trim (s &optional keep-lead) + "Remove whitespace at the beginning and the end of string S. +When optional argument KEEP-LEAD is non-nil, removing blank lines +at the beginning of the string does not affect leading indentation." + (replace-regexp-in-string + (if keep-lead "\\`\\([ \t]*\n\\)+" "\\`[ \t\n\r]+") "" + (replace-regexp-in-string "[ \t\n\r]+\\'" "" s))) + +(defun org-string-nw-p (s) + "Return S if S is a string containing a non-blank character. +Otherwise, return nil." + (and (stringp s) + (string-match-p "[^ \r\t\n]" s) + s)) + +(defun org-reverse-string (string) + "Return the reverse of STRING." + (apply #'string (nreverse (string-to-list string)))) + +(defun org-split-string (string &optional separators) + "Splits STRING into substrings at SEPARATORS. + +SEPARATORS is a regular expression. When nil, it defaults to +\"[ \f\t\n\r\v]+\". + +Unlike `split-string', matching SEPARATORS at the beginning and +end of string are ignored." + (let ((separators (or separators "[ \f\t\n\r\v]+"))) + (if (not (string-match separators string)) (list string) + (let ((i (match-end 0)) + (results + (and (/= 0 (match-beginning 0)) ;skip leading separator + (list (substring string 0 (match-beginning 0)))))) + (while (string-match separators string i) + (push (substring string i (match-beginning 0)) + results) + (setq i (match-end 0))) + (nreverse (if (= i (length string)) + results ;skip trailing separator + (cons (substring string i) results))))))) + +(defun org--string-from-props (s property beg end) + "Return the visible part of string S. +Visible part is determined according to text PROPERTY, which is +either `invisible' or `display'. BEG and END are 0-indices +delimiting S." + (let ((width 0) + (cursor beg)) + (while (setq beg (text-property-not-all beg end property nil s)) + (let* ((next (next-single-property-change beg property s end)) + (props (text-properties-at beg s)) + (spec (plist-get props property)) + (value + (pcase property + (`invisible + ;; If `invisible' property in PROPS means text is to + ;; be invisible, return 0. Otherwise return nil so + ;; as to resume search. + (and (or (eq t buffer-invisibility-spec) + (assoc-string spec buffer-invisibility-spec)) + 0)) + (`display + (pcase spec + (`nil nil) + (`(space . ,props) + (let ((width (plist-get props :width))) + (and (wholenump width) width))) + (`(image . ,_) + (ceiling (car (image-size spec)))) + ((pred stringp) + ;; Displayed string could contain invisible parts, + ;; but no nested display. + (org--string-from-props spec 'invisible 0 (length spec))) + (_ + ;; Un-handled `display' value. Ignore it. + ;; Consider the original string instead. + nil))) + (_ (error "Unknown property: %S" property))))) + (when value + (cl-incf width + ;; When looking for `display' parts, we still need + ;; to look for `invisible' property elsewhere. + (+ (cond ((eq property 'display) + (org--string-from-props s 'invisible cursor beg)) + ((= cursor beg) 0) + (t (string-width (substring s cursor beg)))) + value)) + (setq cursor next)) + (setq beg next))) + (+ width + ;; Look for `invisible' property in the last part of the + ;; string. See above. + (cond ((eq property 'display) + (org--string-from-props s 'invisible cursor end)) + ((= cursor end) 0) + (t (string-width (substring s cursor end))))))) + +(defun org-string-width (string) + "Return width of STRING when displayed in the current buffer. +Unlike `string-width', this function takes into consideration +`invisible' and `display' text properties. It supports the +latter in a limited way, mostly for combinations used in Org. +Results may be off sometimes if it cannot handle a given +`display' value." + (org--string-from-props string 'display 0 (length string))) + +(defun org-not-nil (v) + "If V not nil, and also not the string \"nil\", then return V. +Otherwise return nil." + (and v (not (equal v "nil")) v)) + +(defun org-unbracket-string (pre post string) + "Remove PRE/POST from the beginning/end of STRING. +Both PRE and POST must be pre-/suffixes of STRING, or neither is +removed. Return the new string. If STRING is nil, return nil." + (declare (indent 2)) + (and string + (if (and (string-prefix-p pre string) + (string-suffix-p post string)) + (substring string (length pre) (- (length post))) + string))) + +(defun org-strip-quotes (string) + "Strip double quotes from around STRING, if applicable. +If STRING is nil, return nil." + (org-unbracket-string "\"" "\"" string)) + +(defsubst org-current-line-string (&optional to-here) + "Return current line, as a string. +If optional argument TO-HERE is non-nil, return string from +beginning of line up to point." + (buffer-substring (line-beginning-position) + (if to-here (point) (line-end-position)))) + +(defun org-shorten-string (s maxlength) + "Shorten string S so that it is no longer than MAXLENGTH characters. +If the string is shorter or has length MAXLENGTH, just return the +original string. If it is longer, the functions finds a space in the +string, breaks this string off at that locations and adds three dots +as ellipsis. Including the ellipsis, the string will not be longer +than MAXLENGTH. If finding a good breaking point in the string does +not work, the string is just chopped off in the middle of a word +if necessary." + (if (<= (length s) maxlength) + s + (let* ((n (max (- maxlength 4) 1)) + (re (concat "\\`\\(.\\{1," (int-to-string n) "\\}[^ ]\\)\\([ ]\\|\\'\\)"))) + (if (string-match re s) + (concat (match-string 1 s) "...") + (concat (substring s 0 (max (- maxlength 3) 0)) "..."))))) + +(defun org-remove-tabs (s &optional width) + "Replace tabulators in S with spaces. +Assumes that s is a single line, starting in column 0." + (setq width (or width tab-width)) + (while (string-match "\t" s) + (setq s (replace-match + (make-string + (- (* width (/ (+ (match-beginning 0) width) width)) + (match-beginning 0)) ?\ ) + t t s))) + s) + +(defun org-wrap (string &optional width lines) + "Wrap string to either a number of lines, or a width in characters. +If WIDTH is non-nil, the string is wrapped to that width, however many lines +that costs. If there is a word longer than WIDTH, the text is actually +wrapped to the length of that word. +IF WIDTH is nil and LINES is non-nil, the string is forced into at most that +many lines, whatever width that takes. +The return value is a list of lines, without newlines at the end." + (let* ((words (split-string string)) + (maxword (apply 'max (mapcar 'org-string-width words))) + w ll) + (cond (width + (org--do-wrap words (max maxword width))) + (lines + (setq w maxword) + (setq ll (org--do-wrap words maxword)) + (if (<= (length ll) lines) + ll + (setq ll words) + (while (> (length ll) lines) + (setq w (1+ w)) + (setq ll (org--do-wrap words w))) + ll)) + (t (error "Cannot wrap this"))))) + +(defun org--do-wrap (words width) + "Create lines of maximum width WIDTH (in characters) from word list WORDS." + (let (lines line) + (while words + (setq line (pop words)) + (while (and words (< (+ (length line) (length (car words))) width)) + (setq line (concat line " " (pop words)))) + (setq lines (push line lines))) + (nreverse lines))) + +(defun org-remove-indentation (code &optional n) + "Remove maximum common indentation in string CODE and return it. +N may optionally be the number of columns to remove. Return CODE +as-is if removal failed." + (with-temp-buffer + (insert code) + (if (org-do-remove-indentation n) (buffer-string) code))) + + + +;;; Text properties + +(defconst org-rm-props '(invisible t face t keymap t intangible t mouse-face t + rear-nonsticky t mouse-map t fontified t + org-emphasis t) + "Properties to remove when a string without properties is wanted.") + +(defsubst org-no-properties (s &optional restricted) + "Remove all text properties from string S. +When RESTRICTED is non-nil, only remove the properties listed +in `org-rm-props'." + (if restricted (remove-text-properties 0 (length s) org-rm-props s) + (set-text-properties 0 (length s) nil s)) + s) +(defun org-add-props (string plist &rest props) + "Add text properties to entire string, from beginning to end. +PLIST may be a list of properties, PROPS are individual properties and values +that will be added to PLIST. Returns the string that was modified." + (declare (indent 2)) + (add-text-properties + 0 (length string) (if props (append plist props) plist) string) + string) + +(defun org-make-parameter-alist (flat) + "Return alist based on FLAT. +FLAT is a list with alternating symbol names and values. The +returned alist is a list of lists with the symbol name in car and +the value in cdr." + (when flat + (cons (list (car flat) (cadr flat)) + (org-make-parameter-alist (cddr flat))))) + +(defsubst org-get-at-bol (property) + "Get text property PROPERTY at the beginning of line." + (get-text-property (point-at-bol) property)) + +(defun org-get-at-eol (property n) + "Get text property PROPERTY at the end of line less N characters." + (get-text-property (- (point-at-eol) n) property)) + +(defun org-find-text-property-in-string (prop s) + "Return the first non-nil value of property PROP in string S." + (or (get-text-property 0 prop s) + (get-text-property (or (next-single-property-change 0 prop s) 0) + prop s))) + +(defun org-invisible-p (&optional pos) + "Non-nil if the character after POS is invisible. +If POS is nil, use `point' instead." + (get-char-property (or pos (point)) 'invisible)) + +(defun org-truely-invisible-p () + "Check if point is at a character currently not visible. +This version does not only check the character property, but also +`visible-mode'." + (unless (bound-and-true-p visible-mode) + (org-invisible-p))) + +(defun org-invisible-p2 () + "Check if point is at a character currently not visible. +If the point is at EOL (and not at the beginning of a buffer too), +move it back by one char before doing this check." + (save-excursion + (when (and (eolp) (not (bobp))) + (backward-char 1)) + (org-invisible-p))) + + +;;; Time + +(defun org-2ft (s) + "Convert S to a floating point time. +If S is already a number, just return it. If it is a string, +parse it as a time string and apply `float-time' to it. If S is +nil, just return 0." + (cond + ((numberp s) s) + ((stringp s) + (condition-case nil + (float-time (org-time-string-to-time s)) + (error 0))) + (t 0))) + +(defun org-time= (a b) + (let ((a (org-2ft a)) + (b (org-2ft b))) + (and (> a 0) (> b 0) (= a b)))) + +(defun org-time< (a b) + (let ((a (org-2ft a)) + (b (org-2ft b))) + (and (> a 0) (> b 0) (< a b)))) + +(defun org-time<= (a b) + (let ((a (org-2ft a)) + (b (org-2ft b))) + (and (> a 0) (> b 0) (<= a b)))) + +(defun org-time> (a b) + (let ((a (org-2ft a)) + (b (org-2ft b))) + (and (> a 0) (> b 0) (> a b)))) + +(defun org-time>= (a b) + (let ((a (org-2ft a)) + (b (org-2ft b))) + (and (> a 0) (> b 0) (>= a b)))) + +(defun org-time<> (a b) + (let ((a (org-2ft a)) + (b (org-2ft b))) + (and (> a 0) (> b 0) (\= a b)))) + +(defun org-parse-time-string (s &optional nodefault) + "Parse Org time string S. + +If time is not given, defaults to 0:00. However, with optional +NODEFAULT, hour and minute fields are nil if not given. + +Throw an error if S does not contain a valid Org time string. +Note that the first match for YYYY-MM-DD will be used (e.g., +\"-52000-02-03\" will be taken as \"2000-02-03\"). + +This should be a lot faster than the `parse-time-string'." + (unless (string-match org-ts-regexp0 s) + (error "Not an Org time string: %s" s)) + (list 0 + (cond ((match-beginning 8) (string-to-number (match-string 8 s))) + (nodefault nil) + (t 0)) + (cond ((match-beginning 7) (string-to-number (match-string 7 s))) + (nodefault nil) + (t 0)) + (string-to-number (match-string 4 s)) + (string-to-number (match-string 3 s)) + (string-to-number (match-string 2 s)) + nil nil nil)) + +(defun org-matcher-time (s) + "Interpret a time comparison value S as a floating point time. + +S can be an Org time stamp, a modifier, e.g., \"<+2d>\", or the +following special strings: \"\", \"\", +\"\", and \"\". + +Return 0. if S is not recognized as a valid value." + (let ((today (float-time (apply #'encode-time + (append '(0 0 0) (nthcdr 3 (decode-time))))))) + (save-match-data + (cond + ((string= s "") (float-time)) + ((string= s "") today) + ((string= s "") (+ 86400.0 today)) + ((string= s "") (- today 86400.0)) + ((string-match "\\`<\\([-+][0-9]+\\)\\([hdwmy]\\)>\\'" s) + (+ today + (* (string-to-number (match-string 1 s)) + (cdr (assoc (match-string 2 s) + '(("d" . 86400.0) ("w" . 604800.0) + ("m" . 2678400.0) ("y" . 31557600.0))))))) + ((string-match org-ts-regexp0 s) (org-2ft s)) + (t 0.))))) + + + +(provide 'org-macs) + +;;; org-macs.el ends here diff --git a/elpa/org-20171030/org-mhe.el b/elpa/org-20190930/org-mhe.el similarity index 98% rename from elpa/org-20171030/org-mhe.el rename to elpa/org-20190930/org-mhe.el index f06fea77..a37c41ad 100644 --- a/elpa/org-20171030/org-mhe.el +++ b/elpa/org-20190930/org-mhe.el @@ -1,10 +1,10 @@ ;;; org-mhe.el --- Support for Links to MH-E Messages -*- lexical-binding: t; -*- -;; Copyright (C) 2004-2017 Free Software Foundation, Inc. +;; Copyright (C) 2004-2019 Free Software Foundation, Inc. ;; Author: Thomas Baumann ;; Keywords: outlines, hypermedia, calendar, wp -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; ;; This file is part of GNU Emacs. ;; @@ -142,7 +142,7 @@ So if you use sequences, it will now work." "Return the name of the message folder in an index folder buffer." (save-excursion (mh-index-previous-folder) - (if (re-search-forward "^\\(+.*\\)$" nil t) + (if (re-search-forward "^\\(\\+.*\\)$" nil t) (message "%s" (match-string 1))))) (defun org-mhe-get-message-folder () diff --git a/elpa/org-20171030/org-mobile.el b/elpa/org-20190930/org-mobile.el similarity index 93% rename from elpa/org-20171030/org-mobile.el rename to elpa/org-20190930/org-mobile.el index a548930c..ecbf82be 100644 --- a/elpa/org-20171030/org-mobile.el +++ b/elpa/org-20190930/org-mobile.el @@ -1,9 +1,9 @@ ;;; org-mobile.el --- Code for Asymmetric Sync With a Mobile Device -*- lexical-binding: t; -*- -;; Copyright (C) 2009-2017 Free Software Foundation, Inc. +;; Copyright (C) 2009-2019 Free Software Foundation, Inc. ;; ;; Author: Carsten Dominik ;; Keywords: outlines, hypermedia, calendar, wp -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; ;; This file is part of GNU Emacs. ;; @@ -24,12 +24,12 @@ ;; ;;; Commentary: ;; -;; This file contains the code to interact with Richard Moreland's -;; iPhone application MobileOrg, as well as with the Android version -;; by Matthew Jones. This code is documented in Appendix B of the Org -;; manual. The code is not specific for the iPhone and Android - any -;; external viewer/flagging/editing application that uses the same -;; conventions could be used. +;; This file contains the code to interact with a mobile application, +;; such as Richard Moreland's iPhone application MobileOrg, or the +;; Android version by Matthew Jones. This code is documented in +;; Appendix B of the Org manual. The code is not specific for the +;; iPhone and Android - any external viewer/flagging/editing +;; application that uses the same conventions could be used. (require 'org) (require 'org-agenda) @@ -45,17 +45,19 @@ :group 'org) (defcustom org-mobile-files '(org-agenda-files) - "Files to be staged for MobileOrg. + "Files to be staged for the mobile application. + This is basically a list of files and directories. Files will be staged -directly. Directories will be search for files with the extension `.org'. +directly. Directories will be search for files with the extension \".org\". In addition to this, the list may also contain the following symbols: -org-agenda-files +`org-agenda-files' This means include the complete, unrestricted list of files given in the variable `org-agenda-files'. -org-agenda-text-search-extra-files + +`org-agenda-text-search-extra-files' Include the files given in the variable - `org-agenda-text-search-extra-files'" + `org-agenda-text-search-extra-files'." :group 'org-mobile :type '(list :greedy t (option (const :tag "org-agenda-files" org-agenda-files)) @@ -84,12 +86,14 @@ org-agenda-text-search-extra-files (defcustom org-mobile-use-encryption nil "Non-nil means keep only encrypted files on the WebDAV server. + Encryption uses AES-256, with a password given in -`org-mobile-encryption-password'. -When nil, plain files are kept on the server. -Turning on encryption requires setting the same password in the MobileOrg -application. Before turning this on, check of MobileOrg does already -support it - at the time of this writing it did not yet." +`org-mobile-encryption-password'. When nil, plain files are kept +on the server. + +Turning on encryption requires setting the same password in the +mobile application. Before turning this on, check if the mobile +application does support it." :group 'org-mobile :version "24.1" :type 'boolean) @@ -104,9 +108,10 @@ You might want to put this file into a directory where only you have access." (defcustom org-mobile-encryption-password "" "Password for encrypting files uploaded to the server. + This is a single password which is used for AES-256 encryption. The same -password must also be set in the MobileOrg application. All Org files, -including mobileorg.org will be encrypted using this password. +password must also be set in the mobile application. All Org files, +including \"mobileorg.org\" will be encrypted using this password. SECURITY CONSIDERATIONS: @@ -129,12 +134,12 @@ session." (or (org-string-nw-p org-mobile-encryption-password) (org-string-nw-p org-mobile-encryption-password-session) (setq org-mobile-encryption-password-session - (read-passwd "Password for MobileOrg: " t)))) + (read-passwd "Password for mobile application: " t)))) (defcustom org-mobile-inbox-for-pull "~/org/from-mobile.org" "The file where captured notes and flags will be appended to. During the execution of `org-mobile-pull', the file -`org-mobile-capture-file' will be emptied it's contents have +`org-mobile-capture-file' is emptied as soon as its contents have been appended to the file given here. This file should be in `org-directory', and not in the staging area or on the web server." :group 'org-mobile @@ -142,23 +147,25 @@ been appended to the file given here. This file should be in (defconst org-mobile-capture-file "mobileorg.org" "The capture file where the mobile stores captured notes and flags. -This should not be changed, because MobileOrg assumes this name.") +This must not be changed, because the mobile application assumes this name.") (defcustom org-mobile-index-file "index.org" - "The index file with links to all Org files that should be loaded by MobileOrg. -Relative to `org-mobile-directory'. The Address field in the MobileOrg setup -should point to this file." + "Index file with links to all Org files. +It should be loaded by the mobile application. The file name is +relative to `org-mobile-directory'. The \"Address\" field in the +mobile application setup should point to this file." :group 'org-mobile :type 'file) (defcustom org-mobile-agendas 'all - "The agendas that should be pushed to MobileOrg. + "The agendas that should be pushed to the mobile application. + Allowed values: -default the weekly agenda and the global TODO list -custom all custom agendas defined by the user -all the custom agendas and the default ones -list a list of selection key(s) as string." +`default' the weekly agenda and the global TODO list +`custom' all custom agendas defined by the user +`all' the custom agendas and the default ones +`list' a list of selection key(s) as string." :group 'org-mobile :version "24.1" :type '(choice @@ -229,7 +236,9 @@ using `rsync' or `scp'.") (defconst org-mobile-action-alist '(("edit" . org-mobile-edit)) "Alist with flags and actions for mobile sync. -When flagging an entry, MobileOrg will create entries that look like + +When flagging an entry, the mobile application creates entries +that look like * F(action:data) [[id:entry-id][entry title]] @@ -311,6 +320,11 @@ create all custom agenda views, for upload to the mobile phone." (let ((org-agenda-buffer-name "*SUMO*") (org-agenda-tag-filter org-agenda-tag-filter) (org-agenda-redo-command org-agenda-redo-command)) + ;; Offer to save agenda-related buffers before pushing, preventing + ;; "Non-existent agenda file" prompt for lock files (see #19448). + (let ((agenda-buffers (org-buffer-list 'agenda))) + (save-some-buffers nil + (lambda () (memq (current-buffer) agenda-buffers)))) (save-excursion (save-restriction (save-window-excursion @@ -472,7 +486,7 @@ agenda view showing the flagged items." (concat (shell-quote-argument org-mobile-checksum-binary) " " (shell-quote-argument (expand-file-name file))))) - (when (string-match "[a-fA-F0-9]\\{30,40\\}" check) + (when (string-match "[[:xdigit:]]\\{30,40\\}" check) (push (cons link-name (match-string 0 check)) org-mobile-checksum-files)))) @@ -761,7 +775,7 @@ If nothing new has been added, return nil." (buffer (find-file-noselect file))) (when buffer (with-current-buffer buffer - (when (re-search-forward (concat "\\([0-9a-fA-F]\\{30,\\}\\).*?" + (when (re-search-forward (concat "\\([[:xdigit:]]\\{30,\\}\\).*?" (regexp-quote org-mobile-capture-file) "[ \t]*$") nil t) (goto-char (match-beginning 1)) @@ -845,11 +859,11 @@ If BEG and END are given, only do this in that region." (cl-incf cnt-error) (throw 'next t)) (move-marker bos-marker (point)) - (if (re-search-forward "^** Old value[ \t]*$" eos t) + (if (re-search-forward "^\\** Old value[ \t]*$" eos t) (setq old (buffer-substring (1+ (match-end 0)) (progn (outline-next-heading) (point))))) - (if (re-search-forward "^** New value[ \t]*$" eos t) + (if (re-search-forward "^\\** New value[ \t]*$" eos t) (setq new (buffer-substring (1+ (match-end 0)) (progn (outline-next-heading) @@ -869,7 +883,7 @@ If BEG and END are given, only do this in that region." (funcall cmd data old new) (unless (member data '("delete" "archive" "archive-sibling" "addheading")) - (when (member "FLAGGED" (org-get-tags)) + (when (member "FLAGGED" (org-get-tags nil t)) (add-to-list 'org-mobile-last-flagged-files (buffer-file-name))))) (error (setq org-mobile-error msg))) @@ -994,7 +1008,7 @@ be returned that indicates what went wrong." old current)))) ((eq what 'tags) - (setq current (org-get-tags) + (setq current (org-get-tags nil t) new1 (and new (org-split-string new ":+")) old1 (and old (org-split-string old ":+"))) (cond @@ -1002,7 +1016,7 @@ be returned that indicates what went wrong." ((or (org-mobile-tags-same-p current old1) (eq org-mobile-force-mobile-change t) (memq 'tags org-mobile-force-mobile-change)) - (org-set-tags-to new1) t) + (org-set-tags new1) t) (t (error "Tags before change were expected as \"%s\", but are \"%s\"" (or old "") (or current ""))))) @@ -1031,8 +1045,10 @@ be returned that indicates what went wrong." (goto-char (match-beginning 4)) (insert new) (delete-region (point) (+ (point) (length current))) - (org-set-tags nil 'align)) - (t (error "Heading changed in MobileOrg and on the computer"))))))) + (org-align-tags)) + (t + (error + "Heading changed in the mobile device and on the computer"))))))) ((eq what 'addheading) (if (org-at-heading-p) ; if false we are in top-level of file @@ -1085,7 +1101,8 @@ be returned that indicates what went wrong." (outline-next-heading) (point)))) t) - (t (error "Body was changed in MobileOrg and on the computer"))))))) + (t (error + "Body was changed in the mobile device and on the computer"))))))) (defun org-mobile-tags-same-p (list1 list2) "Are the two tag lists the same?" diff --git a/elpa/org-20171030/org-mouse.el b/elpa/org-20190930/org-mouse.el similarity index 98% rename from elpa/org-20171030/org-mouse.el rename to elpa/org-20190930/org-mouse.el index 7c982423..13d88dad 100644 --- a/elpa/org-20171030/org-mouse.el +++ b/elpa/org-20190930/org-mouse.el @@ -1,6 +1,6 @@ ;;; org-mouse.el --- Better mouse support for Org -*- lexical-binding: t; -*- -;; Copyright (C) 2006-2017 Free Software Foundation, Inc. +;; Copyright (C) 2006-2019 Free Software Foundation, Inc. ;; Author: Piotr Zielinski ;; Maintainer: Carsten Dominik @@ -24,7 +24,7 @@ ;; ;; Org-mouse provides mouse support for org-mode. ;; -;; http://orgmode.org +;; https://orgmode.org ;; ;; Org mouse implements the following features: ;; * following links with the left mouse button @@ -422,7 +422,7 @@ SCHEDULED: or DEADLINE: or ANYTHINGLIKETHIS:" (defun org-mouse-tag-menu () ;todo "Create the tags menu." (append - (let ((tags (org-get-tags))) + (let ((tags (org-get-tags nil t))) (org-mouse-keyword-menu (sort (mapcar 'car (org-get-buffer-tags)) 'string-lessp) `(lambda (tag) @@ -434,22 +434,12 @@ SCHEDULED: or DEADLINE: or ANYTHINGLIKETHIS:" `(lambda (tag) (member tag (quote ,tags))) )) '("--" - ["Align Tags Here" (org-set-tags nil t) t] - ["Align Tags in Buffer" (org-set-tags t t) t] - ["Set Tags ..." (org-set-tags) t]))) + ["Align Tags Here" (org-align-tags) t] + ["Align Tags in Buffer" (org-align-tags t) t] + ["Set Tags ..." (org-set-tags-command) t]))) (defun org-mouse-set-tags (tags) - (save-excursion - ;; remove existing tags first - (beginning-of-line) - (when (org-mouse-re-search-line ":\\(\\([A-Za-z_]+:\\)+\\)") - (replace-match "")) - - ;; set new tags if any - (when tags - (end-of-line) - (insert " :" (mapconcat 'identity tags ":") ":") - (org-set-tags nil t)))) + (org-set-tags tags)) (defun org-mouse-insert-checkbox () (interactive) @@ -498,7 +488,7 @@ SCHEDULED: or DEADLINE: or ANYTHINGLIKETHIS:" `("Main Menu" ["Show Overview" org-mouse-show-overview t] ["Show Headlines" org-mouse-show-headlines t] - ["Show All" outline-show-all t] + ["Show All" org-show-all t] ["Remove Highlights" org-remove-occur-highlights :visible org-occur-highlights] "--" @@ -643,7 +633,7 @@ This means, between the beginning of line and the point." ,@(org-mouse-list-options-menu (mapcar 'car org-startup-options) 'org-mode-restart)))) ((or (eolp) - (and (looking-at "\\( \\|\t\\)\\(+:[0-9a-zA-Z_:]+\\)?\\( \\|\t\\)+$") + (and (looking-at "\\( \\|\t\\)\\(\\+:[0-9a-zA-Z_:]+\\)?\\( \\|\t\\)+$") (looking-back " \\|\t" (- (point) 2) (line-beginning-position)))) (org-mouse-popup-global-menu)) diff --git a/elpa/org-20171030/org-pcomplete.el b/elpa/org-20190930/org-pcomplete.el similarity index 67% rename from elpa/org-20171030/org-pcomplete.el rename to elpa/org-20190930/org-pcomplete.el index 3c2561d1..38fd27f6 100644 --- a/elpa/org-20171030/org-pcomplete.el +++ b/elpa/org-20190930/org-pcomplete.el @@ -1,11 +1,11 @@ ;;; org-pcomplete.el --- In-buffer Completion Code -*- lexical-binding: t; -*- -;; Copyright (C) 2004-2017 Free Software Foundation, Inc. +;; Copyright (C) 2004-2019 Free Software Foundation, Inc. ;; ;; Author: Carsten Dominik ;; John Wiegley ;; Keywords: outlines, hypermedia, calendar, wp -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; ;; This file is part of GNU Emacs. ;; @@ -31,75 +31,126 @@ (require 'org-compat) (require 'pcomplete) -(declare-function org-make-org-heading-search-string "org" (&optional string)) -(declare-function org-get-buffer-tags "org" ()) -(declare-function org-get-tags "org" ()) -(declare-function org-buffer-property-keys "org" - (&optional specials defaults columns ignore-malformed)) +(declare-function org-at-heading-p "org" (&optional ignored)) +(declare-function org-before-first-heading-p "org" ()) +(declare-function org-buffer-property-keys "org" (&optional specials defaults columns)) +(declare-function org-element-at-point "org-element" ()) +(declare-function org-element-property "org-element" property element) +(declare-function org-element-type "org-element" (element)) +(declare-function org-end-of-meta-data "org" (&optional full)) (declare-function org-entry-properties "org" (&optional pom which)) +(declare-function org-export-backend-options "ox" (cl-x) t) +(declare-function org-get-buffer-tags "org" ()) +(declare-function org-get-export-keywords "org" ()) +(declare-function org-get-heading "org" (&optional no-tags no-todo no-priority no-comment)) +(declare-function org-get-tags "org" (&optional pos local)) +(declare-function org-make-org-heading-search-string "org" (&optional string)) (declare-function org-tag-alist-to-string "org" (alist &optional skip-key)) -;;;; Customization variables - -(defgroup org-complete nil - "Outline-based notes management and organizer." - :tag "Org" - :group 'org) - +(defvar org-current-tag-alist) +(defvar org-default-priority) (defvar org-drawer-regexp) +(defvar org-element-affiliated-keywords) +(defvar org-entities) +(defvar org-export-default-language) +(defvar org-export-exclude-tags) +(defvar org-export-select-tags) +(defvar org-file-tags) +(defvar org-highest-priority) +(defvar org-link-abbrev-alist) +(defvar org-link-abbrev-alist-local) +(defvar org-lowest-priority) +(defvar org-options-keywords) +(defvar org-outline-regexp) (defvar org-property-re) -(defvar org-current-tag-alist) +(defvar org-startup-options) +(defvar org-tag-re) +(defvar org-time-stamp-formats) +(defvar org-todo-keywords-1) +(defvar org-todo-line-regexp) + + +;;; Internal Functions (defun org-thing-at-point () "Examine the thing at point and let the caller know what it is. The return value is a string naming the thing at point." - (let ((beg1 (save-excursion - (skip-chars-backward "[:alnum:]-_@") - (point))) - (beg (save-excursion - (skip-chars-backward "a-zA-Z0-9-_:$") - (point))) - (line-to-here (buffer-substring (point-at-bol) (point)))) + (let ((line-to-here (org-current-line-string t)) + (case-fold-search t)) (cond - ((string-match "\\`[ \t]*#\\+begin: clocktable[ \t]+" line-to-here) + ;; Parameters on a clock table opening line. + ((org-match-line "[ \t]*#\\+BEGIN: clocktable[ \t]") (cons "block-option" "clocktable")) - ((string-match "\\`[ \t]*#\\+begin_src[ \t]+" line-to-here) + ;; Flags and parameters on a source block opening line. + ((org-match-line "[ \t]*#\\+BEGIN_SRC[ \t]") (cons "block-option" "src")) - ((save-excursion - (re-search-backward "^[ \t]*#\\+\\([A-Z_]+\\):.*" - (line-beginning-position) t)) + ;; Value for a known keyword. + ((org-match-line "[ \t]*#\\+\\(\\S-+\\):") (cons "file-option" (match-string-no-properties 1))) - ((string-match "\\`[ \t]*#\\+[a-zA-Z_]*\\'" line-to-here) + ;; Keyword name. + ((and (org-match-line "[ \t]*#\\+[a-zA-Z_]*$") + (looking-at-p "[ \t]*$")) (cons "file-option" nil)) - ((equal (char-before beg) ?\[) + ;; Link abbreviation. + ((save-excursion + (skip-chars-backward "-A-Za-z0-9_") + (and (eq ?\[ (char-before)) + (eq ?\[ (char-before (1- (point)))))) (cons "link" nil)) - ((equal (char-before beg) ?\\) + ;; Entities. Some of them accept numbers, but only at their end. + ;; So, we first skip numbers, then letters. + ((eq ?\\ (save-excursion + (skip-chars-backward "0-9") + (skip-chars-backward "a-zA-Z") + (char-before))) (cons "tex" nil)) - ((string-match "\\`\\*+[ \t]+\\'" - (buffer-substring (point-at-bol) beg)) + ;; Tags on a headline. + ((and (org-match-line + (format "\\*+ \\(?:.+? \\)?\\(:\\)\\(\\(?::\\|%s\\)+\\)?[ \t]*$" + org-tag-re)) + (or (org-point-in-group (point) 2) + (= (point) (match-end 1)))) + (cons "tag" nil)) + ;; TODO keywords on an empty headline. + ((and (string-match "^\\*+ +\\S-*$" line-to-here) + (looking-at-p "[ \t]*$")) (cons "todo" nil)) - ((equal (char-before beg) ?*) + ;; Heading after a star for search strings or links. + ((save-excursion + (skip-chars-backward "^*" (line-beginning-position)) + (and (eq ?* (char-before)) + (eq (char-before (1- (point))) '?\[) + (eq (char-before (- (point) 2)) '?\[))) (cons "searchhead" nil)) - ((and (equal (char-before beg1) ?:) - (equal (char-after (point-at-bol)) ?*)) - (cons "tag" nil)) - ((and (equal (char-before beg1) ?:) - (not (equal (char-after (point-at-bol)) ?*)) - (save-excursion - (move-beginning-of-line 1) - (skip-chars-backward "[ \t\n]") - ;; org-drawer-regexp matches a whole line but while - ;; looking-back, we just ignore trailing whitespaces - (or (looking-back (substring org-drawer-regexp 0 -1) - (line-beginning-position)) - (looking-back org-property-re - (line-beginning-position))))) - (cons "prop" nil)) - ((and (equal (char-before beg1) ?:) - (not (equal (char-after (point-at-bol)) ?*))) - (cons "drawer" nil)) + ;; Property or drawer name, depending on point. If point is at + ;; a valid location for a node property, offer completion on all + ;; node properties in the buffer. Otherwise, offer completion on + ;; all drawer names, including "PROPERTIES". + ((and (string-match "^[ \t]*:\\S-*$" line-to-here) + (looking-at-p "[ \t]*$")) + (let ((origin (line-beginning-position))) + (if (org-before-first-heading-p) (cons "drawer" nil) + (save-excursion + (org-end-of-meta-data) + (if (or (= origin (point)) + (not (org-match-line "[ \t]*:PROPERTIES:[ \t]*$"))) + (cons "drawer" nil) + (while (org-match-line org-property-re) + (forward-line)) + (if (= origin (point)) (cons "prop" nil) + (cons "drawer" nil))))))) (t nil)))) +(defun org-pcomplete-case-double (list) + "Return list with both upcase and downcase version of all strings in LIST." + (let (e res) + (while (setq e (pop list)) + (setq res (cons (downcase e) (cons (upcase e) res)))) + (nreverse res))) + + +;;; Completion API + (defun org-command-at-point () "Return the qualified name of the Org completion entity at point. When completing for #+STARTUP, for example, this function returns @@ -138,9 +189,9 @@ When completing for #+STARTUP, for example, this function returns (car (org-thing-at-point))) pcomplete-default-completion-function)))) -(defvar org-options-keywords) ; From org.el -(defvar org-element-affiliated-keywords) ; From org-element.el -(declare-function org-get-export-keywords "org" ()) + +;;; Completion functions + (defun pcomplete/org-mode/file-option () "Complete against all valid file options." (require 'org-element) @@ -172,7 +223,6 @@ When completing for #+STARTUP, for example, this function returns "Complete arguments for the #+AUTHOR file option." (pcomplete-here (list user-full-name))) -(defvar org-time-stamp-formats) (defun pcomplete/org-mode/file-option/date () "Complete arguments for the #+DATE file option." (pcomplete-here (list (format-time-string (car org-time-stamp-formats))))) @@ -181,7 +231,6 @@ When completing for #+STARTUP, for example, this function returns "Complete arguments for the #+EMAIL file option." (pcomplete-here (list user-mail-address))) -(defvar org-export-exclude-tags) (defun pcomplete/org-mode/file-option/exclude_tags () "Complete arguments for the #+EXCLUDE_TAGS file option." (require 'ox) @@ -189,22 +238,17 @@ When completing for #+STARTUP, for example, this function returns (and org-export-exclude-tags (list (mapconcat 'identity org-export-exclude-tags " "))))) -(defvar org-file-tags) (defun pcomplete/org-mode/file-option/filetags () "Complete arguments for the #+FILETAGS file option." (pcomplete-here (and org-file-tags (mapconcat 'identity org-file-tags " ")))) -(defvar org-export-default-language) (defun pcomplete/org-mode/file-option/language () "Complete arguments for the #+LANGUAGE file option." (require 'ox) (pcomplete-here - (pcomplete-uniqify-list + (pcomplete-uniquify-list (list org-export-default-language "en")))) -(defvar org-default-priority) -(defvar org-highest-priority) -(defvar org-lowest-priority) (defun pcomplete/org-mode/file-option/priorities () "Complete arguments for the #+PRIORITIES file option." (pcomplete-here (list (format "%c %c %c" @@ -212,7 +256,6 @@ When completing for #+STARTUP, for example, this function returns org-lowest-priority org-default-priority)))) -(defvar org-export-select-tags) (defun pcomplete/org-mode/file-option/select_tags () "Complete arguments for the #+SELECT_TAGS file option." (require 'ox) @@ -220,11 +263,10 @@ When completing for #+STARTUP, for example, this function returns (and org-export-select-tags (list (mapconcat 'identity org-export-select-tags " "))))) -(defvar org-startup-options) (defun pcomplete/org-mode/file-option/startup () "Complete arguments for the #+STARTUP file option." (while (pcomplete-here - (let ((opts (pcomplete-uniqify-list + (let ((opts (pcomplete-uniquify-list (mapcar 'car org-startup-options)))) ;; Some options are mutually exclusive, and shouldn't be completed ;; against if certain other options have already been seen. @@ -249,11 +291,10 @@ When completing for #+STARTUP, for example, this function returns (buffer-name (buffer-base-buffer))))))) -(declare-function org-export-backend-options "ox" (cl-x) t) (defun pcomplete/org-mode/file-option/options () "Complete arguments for the #+OPTIONS file option." (while (pcomplete-here - (pcomplete-uniqify-list + (pcomplete-uniquify-list (append ;; Hard-coded OPTION items always available. '("H:" "\\n:" "num:" "timestamp:" "arch:" "author:" "c:" @@ -272,7 +313,7 @@ When completing for #+STARTUP, for example, this function returns (defun pcomplete/org-mode/file-option/infojs_opt () "Complete arguments for the #+INFOJS_OPT file option." (while (pcomplete-here - (pcomplete-uniqify-list + (pcomplete-uniquify-list (mapcar (lambda (item) (format "%s:" (car item))) (bound-and-true-p org-html-infojs-opts-table)))))) @@ -280,81 +321,96 @@ When completing for #+STARTUP, for example, this function returns "Complete arguments for the #+BIND file option, which are variable names." (let (vars) (mapatoms - (lambda (a) (if (boundp a) (setq vars (cons (symbol-name a) vars))))) + (lambda (a) (when (boundp a) (setq vars (cons (symbol-name a) vars))))) (pcomplete-here vars))) -(defvar org-link-abbrev-alist-local) -(defvar org-link-abbrev-alist) (defun pcomplete/org-mode/link () "Complete against defined #+LINK patterns." (pcomplete-here - (pcomplete-uniqify-list + (pcomplete-uniquify-list (copy-sequence - (append (mapcar 'car org-link-abbrev-alist-local) - (mapcar 'car org-link-abbrev-alist)))))) + (mapcar (lambda (e) (concat (car e) ":")) + (append org-link-abbrev-alist-local + org-link-abbrev-alist)))))) -(defvar org-entities) (defun pcomplete/org-mode/tex () "Complete against TeX-style HTML entity names." (require 'org-entities) (while (pcomplete-here - (pcomplete-uniqify-list (remove nil (mapcar 'car-safe org-entities))) + (pcomplete-uniquify-list (remove nil (mapcar 'car-safe org-entities))) (substring pcomplete-stub 1)))) -(defvar org-todo-keywords-1) (defun pcomplete/org-mode/todo () "Complete against known TODO keywords." - (pcomplete-here (pcomplete-uniqify-list (copy-sequence org-todo-keywords-1)))) + (pcomplete-here (pcomplete-uniquify-list (copy-sequence org-todo-keywords-1)))) -(defvar org-todo-line-regexp) (defun pcomplete/org-mode/searchhead () "Complete against all headings. This needs more work, to handle headings with lots of spaces in them." - (while - (pcomplete-here - (save-excursion - (goto-char (point-min)) - (let (tbl) - (let ((case-fold-search nil)) - (while (re-search-forward org-todo-line-regexp nil t) - (push (org-make-org-heading-search-string - (match-string-no-properties 3)) - tbl))) - (pcomplete-uniqify-list tbl))) - (substring pcomplete-stub 1)))) + (while (pcomplete-here + (save-excursion + (goto-char (point-min)) + (let (tbl) + (while (re-search-forward org-outline-regexp nil t) + (push (org-make-org-heading-search-string + (org-get-heading t t t t)) + tbl)) + (pcomplete-uniquify-list tbl))) + ;; When completing a bracketed link, i.e., "[[*", argument + ;; starts at the star, so remove this character. + (substring pcomplete-stub 1)))) (defun pcomplete/org-mode/tag () "Complete a tag name. Omit tags already set." (while (pcomplete-here (mapcar (lambda (x) (concat x ":")) - (let ((lst (pcomplete-uniqify-list + (let ((lst (pcomplete-uniquify-list (or (remq nil (mapcar (lambda (x) (org-string-nw-p (car x))) org-current-tag-alist)) (mapcar #'car (org-get-buffer-tags)))))) - (dolist (tag (org-get-tags)) + (dolist (tag (org-get-tags nil t)) (setq lst (delete tag lst))) lst)) (and (string-match ".*:" pcomplete-stub) - (substring pcomplete-stub (match-end 0)))))) + (substring pcomplete-stub (match-end 0))) + t))) + +(defun pcomplete/org-mode/drawer () + "Complete a drawer name, including \"PROPERTIES\"." + (pcomplete-here + (org-pcomplete-case-double + (mapcar (lambda (x) (concat x ":")) + (let ((names (list "PROPERTIES"))) + (save-excursion + (goto-char (point-min)) + (while (re-search-forward org-drawer-regexp nil t) + (let ((drawer (org-element-at-point))) + (when (memq (org-element-type drawer) + '(drawer property-drawer)) + (push (org-element-property :drawer-name drawer) names) + (goto-char (org-element-property :end drawer)))))) + (pcomplete-uniquify-list names)))) + (substring pcomplete-stub 1))) ;remove initial colon (defun pcomplete/org-mode/prop () "Complete a property name. Omit properties already set." (pcomplete-here - (mapcar (lambda (x) - (concat x ": ")) - (let ((lst (pcomplete-uniqify-list - (copy-sequence - (org-buffer-property-keys nil t t t))))) - (dolist (prop (org-entry-properties)) - (setq lst (delete (car prop) lst))) - lst)) + (org-pcomplete-case-double + (mapcar (lambda (x) + (concat x ": ")) + (let ((lst (pcomplete-uniquify-list + (copy-sequence (org-buffer-property-keys nil t t))))) + (dolist (prop (org-entry-properties)) + (setq lst (delete (car prop) lst))) + lst))) (substring pcomplete-stub 1))) (defun pcomplete/org-mode/block-option/src () - "Complete the arguments of a begin_src block. -Complete a language in the first field, the header arguments and switches." + "Complete the arguments of a source block. +Complete a language in the first field, the header arguments and +switches." (pcomplete-here (mapcar (lambda(x) (symbol-name (nth 3 x))) @@ -377,14 +433,8 @@ Complete a language in the first field, the header arguments and switches." ":tcolumns" ":level" ":compact" ":timestamp" ":formula" ":formatter" ":wstart" ":mstart")))) -(defun org-pcomplete-case-double (list) - "Return list with both upcase and downcase version of all strings in LIST." - (let (e res) - (while (setq e (pop list)) - (setq res (cons (downcase e) (cons (upcase e) res)))) - (nreverse res))) - -;;;; Finish up + +;;; Finish up (provide 'org-pcomplete) diff --git a/elpa/org-20190930/org-pkg.el b/elpa/org-20190930/org-pkg.el new file mode 100644 index 00000000..b3683663 --- /dev/null +++ b/elpa/org-20190930/org-pkg.el @@ -0,0 +1,5 @@ +(define-package "org" + "20190930" "Outline-based notes management and organizer" ( )) +;; Local Variables: +;; no-byte-compile: t +;; End: diff --git a/elpa/org-20171030/org-plot.el b/elpa/org-20190930/org-plot.el similarity index 98% rename from elpa/org-20171030/org-plot.el rename to elpa/org-20190930/org-plot.el index a8028324..a5635e32 100644 --- a/elpa/org-20171030/org-plot.el +++ b/elpa/org-20190930/org-plot.el @@ -1,10 +1,10 @@ ;;; org-plot.el --- Support for Plotting from Org -*- lexical-binding: t; -*- -;; Copyright (C) 2008-2017 Free Software Foundation, Inc. +;; Copyright (C) 2008-2019 Free Software Foundation, Inc. ;; ;; Author: Eric Schulte ;; Keywords: tables, plotting -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; ;; This file is part of GNU Emacs. ;; @@ -336,7 +336,7 @@ line directly before or after the table." (insert "\n") (insert-file-contents (plist-get params :script)) (goto-char (point-min)) - (while (re-search-forward "$datafile" nil t) + (while (re-search-forward "\\$datafile" nil t) (replace-match data-file nil nil))) (insert (org-plot/gnuplot-script data-file num-cols params))) ;; Graph table. diff --git a/elpa/org-20171030/org-protocol.el b/elpa/org-20190930/org-protocol.el similarity index 91% rename from elpa/org-20171030/org-protocol.el rename to elpa/org-20190930/org-protocol.el index d92bfc6a..0577c315 100644 --- a/elpa/org-20171030/org-protocol.el +++ b/elpa/org-20190930/org-protocol.el @@ -1,6 +1,6 @@ ;;; org-protocol.el --- Intercept Calls from Emacsclient to Trigger Custom Actions -*- lexical-binding: t; -*- ;; -;; Copyright (C) 2008-2017 Free Software Foundation, Inc. +;; Copyright (C) 2008-2019 Free Software Foundation, Inc. ;; ;; Authors: Bastien Guerry ;; Daniel M German @@ -122,6 +122,7 @@ (declare-function server-edit "server" (&optional arg)) (defvar org-capture-link-is-already-stored) +(defvar org-capture-templates) (defgroup org-protocol nil "Intercept calls from emacsclient to trigger custom actions. @@ -184,10 +185,10 @@ Possible properties are: Example: (setq org-protocol-project-alist - \\='((\"http://orgmode.org/worg/\" + \\='((\"https://orgmode.org/worg/\" :online-suffix \".php\" :working-suffix \".org\" - :base-url \"http://orgmode.org/worg/\" + :base-url \"https://orgmode.org/worg/\" :working-directory \"/home/user/org/Worg/\") (\"http://localhost/org-notes/\" :online-suffix \".html\" @@ -297,11 +298,9 @@ SEPARATOR is specified or SEPARATOR is nil, assume \"/+\". The results of that splitting are returned as a list." (let* ((sep (or separator "/+\\|\\?")) (split-parts (split-string data sep))) - (if unhexify - (if (fboundp unhexify) - (mapcar unhexify split-parts) - (mapcar 'org-link-unescape split-parts)) - split-parts))) + (cond ((not unhexify) split-parts) + ((fboundp unhexify) (mapcar unhexify split-parts)) + (t (mapcar #'org-link-unescape split-parts))))) (defun org-protocol-flatten-greedy (param-list &optional strip-path replacement) "Transform PARAM-LIST into a flat list for greedy handlers. @@ -331,7 +330,7 @@ returned list." (len 0) dir ret) - (when (string-match "^\\(.*\\)\\(org-protocol:/+[a-zA-z0-9][-_a-zA-z0-9]*:/+\\)\\(.*\\)" trigger) + (when (string-match "^\\(.*\\)\\(org-protocol:/+[a-zA-Z0-9][-_a-zA-Z0-9]*:/+\\)\\(.*\\)" trigger) (setq dir (match-string 1 trigger)) (setq len (length dir)) (setcar l (concat dir (match-string 3 trigger)))) @@ -349,17 +348,20 @@ returned list." ret) l))) -(defun org-protocol-flatten (list) - "Transform LIST into a flat list. +(defalias 'org-protocol-flatten + (if (fboundp 'flatten-tree) 'flatten-tree + (lambda (list) + "Transform LIST into a flat list. Greedy handlers might receive a list like this from emacsclient: \((\"/dir/org-protocol:/greedy:/~/path1\" (23 . 12)) (\"/dir/param\")) where \"/dir/\" is the absolute path to emacsclients working directory. This function transforms it into a flat list." - (if (null list) () - (if (listp list) - (append (org-protocol-flatten (car list)) (org-protocol-flatten (cdr list))) - (list list)))) + (if list + (if (consp list) + (append (org-protocol-flatten (car list)) + (org-protocol-flatten (cdr list))) + (list list)))))) (defun org-protocol-parse-parameters (info &optional new-style default-order) "Return a property list of parameters from INFO. @@ -378,11 +380,8 @@ If INFO is already a property list, return it unchanged." result) (while data (setq result - (append - result - (list - (pop data) - (org-link-unescape (pop data)))))) + (append result + (list (pop data) (org-link-unescape (pop data)))))) result) (let ((data (org-protocol-split-data info t org-protocol-data-separator))) (if default-order @@ -441,9 +440,9 @@ form URL/TITLE can also be used." (when (boundp 'org-stored-links) (push (list uri title) org-stored-links)) (kill-new uri) - (message "`%s' to insert new org-link, `%s' to insert `%s'" - (substitute-command-keys "`\\[org-insert-link]'") - (substitute-command-keys "`\\[yank]'") + (message "`%s' to insert new Org link, `%s' to insert %S" + (substitute-command-keys "\\[org-insert-link]") + (substitute-command-keys "\\[yank]") uri)) nil) @@ -468,43 +467,33 @@ You may specify the template with a template= query parameter, like this: javascript:location.href = \\='org-protocol://capture?template=b\\='+ ... Now template ?b will be used." - (if (and (boundp 'org-stored-links) - (org-protocol-do-capture info)) - (message "Item captured.")) - nil) - -(defun org-protocol-convert-query-to-plist (query) - "Convert QUERY key=value pairs in the URL to a property list." - (if query - (apply 'append (mapcar (lambda (x) - (let ((c (split-string x "="))) - (list (intern (concat ":" (car c))) (cadr c)))) - (split-string query "&"))))) - -(defun org-protocol-do-capture (info) - "Perform the actual capture based on INFO." - (let* ((temp-parts (org-protocol-parse-parameters info)) - (parts - (cond - ((and (listp info) (symbolp (car info))) info) - ((= (length (car temp-parts)) 1) ;; First parameter is exactly one character long - (org-protocol-assign-parameters temp-parts '(:template :url :title :body))) - (t - (org-protocol-assign-parameters temp-parts '(:url :title :body))))) + (let* ((parts + (pcase (org-protocol-parse-parameters info) + ;; New style links are parsed as a plist. + ((let `(,(pred keywordp) . ,_) info) info) + ;; Old style links, with or without template key, are + ;; parsed as a list of strings. + (p + (let ((k (if (= 1 (length (car p))) + '(:template :url :title :body) + '(:url :title :body)))) + (org-protocol-assign-parameters p k))))) (template (or (plist-get parts :template) org-protocol-default-template-key)) - (url (and (plist-get parts :url) (org-protocol-sanitize-uri (plist-get parts :url)))) - (type (and url (if (string-match "^\\([a-z]+\\):" url) - (match-string 1 url)))) + (url (and (plist-get parts :url) + (org-protocol-sanitize-uri (plist-get parts :url)))) + (type (and url + (string-match "^\\([a-z]+\\):" url) + (match-string 1 url))) (title (or (plist-get parts :title) "")) (region (or (plist-get parts :body) "")) - (orglink (if url - (org-make-link-string - url (if (string-match "[^[:space:]]" title) title url)) - title)) - (org-capture-link-is-already-stored t)) ;; avoid call to org-store-link - (setq org-stored-links - (cons (list url title) org-stored-links)) + (orglink + (if (null url) title + (org-make-link-string url (or (org-string-nw-p title) url)))) + ;; Avoid call to `org-store-link'. + (org-capture-link-is-already-stored t)) + ;; Only store link if there's a URL to insert later on. + (when url (push (list url title) org-stored-links)) (org-store-link-props :type type :link url :description title @@ -512,7 +501,19 @@ Now template ?b will be used." :initial region :query parts) (raise-frame) - (funcall 'org-capture nil template))) + (org-capture nil template) + (message "Item captured.") + ;; Make sure we do not return a string, as `server-visit-files', + ;; through `server-edit', would interpret it as a file name. + nil)) + +(defun org-protocol-convert-query-to-plist (query) + "Convert QUERY key=value pairs in the URL to a property list." + (when query + (apply 'append (mapcar (lambda (x) + (let ((c (split-string x "="))) + (list (intern (concat ":" (car c))) (cadr c)))) + (split-string query "&"))))) (defun org-protocol-open-source (fname) "Process an org-protocol://open-source?url= style URL with FNAME. @@ -663,7 +664,7 @@ to deal with new-style links.") ;;; Org specific functions: (defun org-protocol-create-for-org () - "Create a Org protocol project for the current file's project. + "Create an Org protocol project for the current file's project. The visited file needs to be part of a publishing project in `org-publish-project-alist' for this to work. The function delegates most of the work to `org-protocol-create'." @@ -688,7 +689,7 @@ the cdr of an element in `org-publish-project-alist', reuse (let ((working-dir (expand-file-name (or (plist-get project-plist :base-directory) default-directory))) - (base-url "http://orgmode.org/worg/") + (base-url "https://orgmode.org/worg/") (strip-suffix (or (plist-get project-plist :html-extension) ".html")) (working-suffix (if (plist-get project-plist :base-extension) (concat "." (plist-get project-plist :base-extension)) diff --git a/elpa/org-20171030/org-rmail.el b/elpa/org-20190930/org-rmail.el similarity index 97% rename from elpa/org-20171030/org-rmail.el rename to elpa/org-20190930/org-rmail.el index 332c669a..c3d941e6 100644 --- a/elpa/org-20171030/org-rmail.el +++ b/elpa/org-20190930/org-rmail.el @@ -1,10 +1,10 @@ ;;; org-rmail.el --- Support for Links to Rmail Messages -*- lexical-binding: t; -*- -;; Copyright (C) 2004-2017 Free Software Foundation, Inc. +;; Copyright (C) 2004-2019 Free Software Foundation, Inc. ;; Author: Carsten Dominik ;; Keywords: outlines, hypermedia, calendar, wp -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; ;; This file is part of GNU Emacs. ;; diff --git a/elpa/org-20171030/org-src.el b/elpa/org-20190930/org-src.el similarity index 89% rename from elpa/org-20171030/org-src.el rename to elpa/org-20190930/org-src.el index 4191d9aa..de6d0d76 100644 --- a/elpa/org-20171030/org-src.el +++ b/elpa/org-20190930/org-src.el @@ -1,12 +1,12 @@ ;;; org-src.el --- Source code examples in Org -*- lexical-binding: t; -*- ;; -;; Copyright (C) 2004-2017 Free Software Foundation, Inc. +;; Copyright (C) 2004-2019 Free Software Foundation, Inc. ;; ;; Author: Carsten Dominik ;; Bastien Guerry ;; Dan Davison ;; Keywords: outlines, hypermedia, calendar, wp -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; ;; This file is part of GNU Emacs. ;; @@ -37,8 +37,6 @@ (require 'ob-keys) (require 'ob-comint) -(declare-function org-base-buffer "org" (buffer)) -(declare-function org-do-remove-indentation "org" (&optional n)) (declare-function org-element-at-point "org-element" ()) (declare-function org-element-class "org-element" (datum &optional parent)) (declare-function org-element-context "org-element" (&optional element)) @@ -48,9 +46,6 @@ (declare-function org-element-type "org-element" (element)) (declare-function org-footnote-goto-definition "org-footnote" (label &optional location)) -(declare-function org-get-indentation "org" (&optional line)) -(declare-function org-switch-to-buffer-other-window "org" (&rest args)) -(declare-function org-trim "org" (s &optional keep-lead)) (defvar org-inhibit-startup) @@ -128,7 +123,8 @@ editing it with `\\[org-edit-src-code]'. It has no effect if `org-src-preserve-indentation' is non-nil." :group 'org-edit-structure - :type 'integer) + :type 'integer + :safe #'wholenump) (defcustom org-edit-src-persistent-message t "Non-nil means show persistent exit help message while editing src examples. @@ -152,17 +148,20 @@ the existing edit buffer." "How the source code edit buffer should be displayed. Possible values for this option are: -current-window Show edit buffer in the current window, keeping all other - windows. -other-window Use `switch-to-buffer-other-window' to display edit buffer. -reorganize-frame Show only two windows on the current frame, the current - window and the edit buffer. When exiting the edit buffer, - return to one window. -other-frame Use `switch-to-buffer-other-frame' to display edit buffer. - Also, when exiting the edit buffer, kill that frame." +current-window Show edit buffer in the current window, keeping all other + windows. +split-window-below Show edit buffer below the current window, keeping all + other windows. +other-window Use `switch-to-buffer-other-window' to display edit buffer. +reorganize-frame Show only two windows on the current frame, the current + window and the edit buffer. When exiting the edit buffer, + return to one window. +other-frame Use `switch-to-buffer-other-frame' to display edit buffer. + Also, when exiting the edit buffer, kill that frame." :group 'org-edit-structure :type '(choice (const current-window) + (const split-window-below) (const other-frame) (const other-window) (const reorganize-frame))) @@ -179,17 +178,29 @@ or similar things which you want to have when editing a source code file, but which mess up the display of a snippet in Org exported files.") (defcustom org-src-lang-modes - '(("ocaml" . tuareg) ("elisp" . emacs-lisp) ("ditaa" . artist) - ("asymptote" . asy) ("dot" . fundamental) ("sqlite" . sql) - ("calc" . fundamental) ("C" . c) ("cpp" . c++) ("C++" . c++) - ("screen" . shell-script) ("shell" . sh) ("bash" . sh)) + '(("C" . c) + ("C++" . c++) + ("asymptote" . asy) + ("bash" . sh) + ("beamer" . latex) + ("calc" . fundamental) + ("cpp" . c++) + ("ditaa" . artist) + ("dot" . fundamental) + ("elisp" . emacs-lisp) + ("ocaml" . tuareg) + ("screen" . shell-script) + ("shell" . sh) + ("sqlite" . sql)) "Alist mapping languages to their major mode. -The key is the language name, the value is the string that should -be inserted as the name of the major mode. For many languages this is -simple, but for language where this is not the case, this variable -provides a way to simplify things on the user side. -For example, there is no ocaml-mode in Emacs, but the mode to use is -`tuareg-mode'." + +The key is the language name. The value is the mode name, as +a string or a symbol, without the \"-mode\" suffix. + +For many languages this is simple, but for language where this is +not the case, this variable provides a way to simplify things on +the user side. For example, there is no `ocaml-mode' in Emacs, +but the mode to use is `tuareg-mode'." :group 'org-edit-structure :type '(repeat (cons @@ -229,23 +240,52 @@ issued in the language major mode buffer." ;;; Internal functions and variables -(defvar org-src--allow-write-back t) -(defvar org-src--auto-save-timer nil) -(defvar org-src--babel-info nil) -(defvar org-src--beg-marker nil) -(defvar org-src--block-indentation nil) -(defvar org-src--end-marker nil) -(defvar org-src--from-org-mode nil) -(defvar org-src--overlay nil) -(defvar org-src--preserve-indentation nil) -(defvar org-src--remote nil) -(defvar org-src--saved-temp-window-config nil) -(defvar org-src--source-type nil +(defvar org-src--auto-save-timer nil + "Idle Timer auto-saving remote editing buffers.") + +(defvar-local org-src--allow-write-back t) +(put 'org-src--allow-write-back 'permanent-local t) + +(defvar-local org-src--babel-info nil) +(put 'org-src--babel-info 'permanent-local t) + +(defvar-local org-src--beg-marker nil) +(put 'org-src--beg-marker 'permanent-local t) + +(defvar-local org-src--block-indentation nil) +(put 'org-src--block-indentation 'permanent-local t) + +(defvar-local org-src--end-marker nil) +(put 'org-src--end-marker 'permanent-local t) + +(defvar-local org-src--from-org-mode nil) +(put 'org-src--from-org-mode 'permanent-local t) + +(defvar-local org-src--overlay nil) +(put 'org-src--overlay 'permanent-local t) + +(defvar-local org-src--preserve-indentation nil) +(put 'org-src--preserve-indentation 'permanent-local t) + +(defvar-local org-src--remote nil) +(put 'org-src--remote 'permanent-local t) + +(defvar-local org-src--saved-temp-window-config nil) +(put 'org-src--saved-temp-window-config 'permanent-local t) + +(defvar-local org-src--source-type nil "Type of element being edited, as a symbol.") -(defvar org-src--tab-width nil +(put 'org-src--source-type 'permanent-local t) + +(defvar-local org-src--tab-width nil "Contains `tab-width' value from Org source buffer. However, if `indent-tabs-mode' is nil in that buffer, its value is 0.") +(put 'org-src--tab-width 'permanent-local t) + +(defvar-local org-src-source-file-name nil + "File name associated to Org source buffer, or nil.") +(put 'org-src-source-file-name 'permanent-local t) (defun org-src--construct-edit-buffer-name (org-buffer-name lang) "Construct the buffer name for a source editing buffer." @@ -264,12 +304,6 @@ Return nil if there is no such buffer." (eq (marker-buffer end) (marker-buffer org-src--end-marker)) (throw 'exit b)))))) -(defun org-src--source-buffer () - "Return source buffer edited by current buffer." - (unless (org-src-edit-buffer-p) (error "Not in a source buffer")) - (or (marker-buffer org-src--beg-marker) - (error "No source buffer available for current editing session"))) - (defun org-src--get-lang-mode (lang) "Return major mode that should be used for LANG. LANG is a string, and the returned major mode is a symbol." @@ -405,8 +439,8 @@ Assume point is in the corresponding edit buffer." (write-back org-src--allow-write-back)) (with-temp-buffer ;; Reproduce indentation parameters from source buffer. - (setq-local indent-tabs-mode use-tabs?) - (when (> source-tab-width 0) (setq-local tab-width source-tab-width)) + (setq indent-tabs-mode use-tabs?) + (when (> source-tab-width 0) (setq tab-width source-tab-width)) ;; Apply WRITE-BACK function on edit buffer contents. (insert (org-no-properties contents)) (goto-char (point-min)) @@ -457,11 +491,12 @@ Leave point in edit buffer." (with-current-buffer old-edit-buffer (org-src--remove-overlay)) (kill-buffer old-edit-buffer)) (let* ((org-mode-p (derived-mode-p 'org-mode)) + (source-file-name (buffer-file-name (buffer-base-buffer))) (source-tab-width (if indent-tabs-mode tab-width 0)) (type (org-element-type datum)) (ind (org-with-wide-buffer (goto-char (org-element-property :begin datum)) - (org-get-indentation))) + (current-indentation))) (preserve-ind (and (memq type '(example-block src-block)) (or (org-element-property :preserve-indent datum) @@ -498,16 +533,17 @@ Leave point in edit buffer." ;; Transmit buffer-local variables for exit function. It must ;; be done after initializing major mode, as this operation ;; may reset them otherwise. - (setq-local org-src--tab-width source-tab-width) - (setq-local org-src--from-org-mode org-mode-p) - (setq-local org-src--beg-marker beg) - (setq-local org-src--end-marker end) - (setq-local org-src--remote remote) - (setq-local org-src--source-type type) - (setq-local org-src--block-indentation ind) - (setq-local org-src--preserve-indentation preserve-ind) - (setq-local org-src--overlay overlay) - (setq-local org-src--allow-write-back write-back) + (setq org-src--tab-width source-tab-width) + (setq org-src--from-org-mode org-mode-p) + (setq org-src--beg-marker beg) + (setq org-src--end-marker end) + (setq org-src--remote remote) + (setq org-src--source-type type) + (setq org-src--block-indentation ind) + (setq org-src--preserve-indentation preserve-ind) + (setq org-src--overlay overlay) + (setq org-src--allow-write-back write-back) + (setq org-src-source-file-name source-file-name) ;; Start minor mode. (org-src-mode) ;; Move mark and point in edit buffer to the corresponding @@ -631,13 +667,12 @@ This minor mode is turned on in two situations: See also `org-src-mode-hook'." nil " OrgSrc" nil (when org-edit-src-persistent-message - (setq-local - header-line-format - (substitute-command-keys - (if org-src--allow-write-back - "Edit, then exit with `\\[org-edit-src-exit]' or abort with \ + (setq header-line-format + (substitute-command-keys + (if org-src--allow-write-back + "Edit, then exit with `\\[org-edit-src-exit]' or abort with \ `\\[org-edit-src-abort]'" - "Exit with `\\[org-edit-src-exit]' or abort with \ + "Exit with `\\[org-edit-src-exit]' or abort with \ `\\[org-edit-src-abort]'")))) ;; Possibly activate various auto-save features (for the edit buffer ;; or the source buffer). @@ -646,7 +681,8 @@ See also `org-src-mode-hook'." (concat (make-temp-name "org-src-") (format-time-string "-%Y-%d-%m") ".txt"))) - (unless (or org-src--auto-save-timer (zerop org-edit-src-auto-save-idle-delay)) + (unless (or org-src--auto-save-timer + (= 0 org-edit-src-auto-save-idle-delay)) (setq org-src--auto-save-timer (run-with-idle-timer org-edit-src-auto-save-idle-delay t @@ -663,15 +699,13 @@ See also `org-src-mode-hook'." (setq org-src--auto-save-timer nil))))))))) (defun org-src-mode-configure-edit-buffer () + "Configure the src edit buffer." (when (bound-and-true-p org-src--from-org-mode) (add-hook 'kill-buffer-hook #'org-src--remove-overlay nil 'local) (if (bound-and-true-p org-src--allow-write-back) (progn (setq buffer-offer-save t) - (setq buffer-file-name - (concat (buffer-file-name (marker-buffer org-src--beg-marker)) - "[" (buffer-name) "]")) - (setq-local write-contents-functions '(org-edit-src-save))) + (setq write-contents-functions '(org-edit-src-save))) (setq buffer-read-only t)))) (add-hook 'org-src-mode-hook #'org-src-mode-configure-edit-buffer) @@ -740,11 +774,27 @@ If BUFFER is non-nil, test it instead." (local-variable-p 'org-src--beg-marker buffer) (local-variable-p 'org-src--end-marker buffer)))) +(defun org-src-source-buffer () + "Return source buffer edited in current buffer. +Raise an error when current buffer is not a source editing buffer." + (unless (org-src-edit-buffer-p) (error "Not in a source buffer")) + (or (marker-buffer org-src--beg-marker) + (error "No source buffer available for current editing session"))) + +(defun org-src-source-type () + "Return type of element edited in current buffer. +Raise an error when current buffer is not a source editing buffer." + (unless (org-src-edit-buffer-p) (error "Not in a source buffer")) + org-src--source-type) + (defun org-src-switch-to-buffer (buffer context) (pcase org-src-window-setup (`current-window (pop-to-buffer-same-window buffer)) (`other-window (switch-to-buffer-other-window buffer)) + (`split-window-below + (select-window (split-window-vertically)) + (pop-to-buffer-same-window buffer)) (`other-frame (pcase context (`exit @@ -977,7 +1027,7 @@ name of the sub-editing buffer." (or (org-element-property :label-fmt element) org-coderef-label-format)) (when (eq type 'src-block) - (setq-local org-src--babel-info babel-info) + (setq org-src--babel-info babel-info) (let ((edit-prep-func (intern (concat "org-babel-edit-prep:" lang)))) (when (fboundp edit-prep-func) (funcall edit-prep-func babel-info)))) @@ -1000,7 +1050,7 @@ name of the sub-editing buffer." (org-src--construct-edit-buffer-name (buffer-name) lang) lang-f (lambda () - ;; Inline src blocks are limited to one line. + ;; Inline source blocks are limited to one line. (while (re-search-forward "\n[ \t]*" nil t) (replace-match " ")) ;; Trim contents. (goto-char (point-min)) @@ -1010,8 +1060,8 @@ name of the sub-editing buffer." (skip-chars-backward " \t") (delete-region (point) (point-max)))) ;; Finalize buffer. - (setq-local org-src--babel-info babel-info) - (setq-local org-src--preserve-indentation t) + (setq org-src--babel-info babel-info) + (setq org-src--preserve-indentation t) (let ((edit-prep-func (intern (concat "org-babel-edit-prep:" lang)))) (when (fboundp edit-prep-func) (funcall edit-prep-func babel-info))) ;; Return success. @@ -1066,7 +1116,7 @@ Throw an error if there is no such buffer." (beg org-src--beg-marker) (end org-src--end-marker) (overlay org-src--overlay)) - (with-current-buffer (org-src--source-buffer) + (with-current-buffer (org-src-source-buffer) (undo-boundary) (goto-char beg) ;; Temporarily disable read-only features of OVERLAY in order to diff --git a/elpa/org-20171030/org-table.el b/elpa/org-20190930/org-table.el similarity index 83% rename from elpa/org-20171030/org-table.el rename to elpa/org-20190930/org-table.el index 8dc648ea..f6eb4257 100644 --- a/elpa/org-20171030/org-table.el +++ b/elpa/org-20190930/org-table.el @@ -1,10 +1,10 @@ ;;; org-table.el --- The Table Editor for Org -*- lexical-binding: t; -*- -;; Copyright (C) 2004-2017 Free Software Foundation, Inc. +;; Copyright (C) 2004-2019 Free Software Foundation, Inc. ;; Author: Carsten Dominik ;; Keywords: outlines, hypermedia, calendar, wp -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; ;; This file is part of GNU Emacs. ;; @@ -135,7 +135,7 @@ the fixed string \"#+ORGTBL: SEND\", followed by instruction on how to convert the table into a data structure useful in the language of the buffer. Check the manual for the section on \"Translator functions\", and more generally check out -http://orgmode.org/manual/Tables-in-arbitrary-syntax.html#Tables-in-arbitrary-syntax +the Info node `(org)Tables in arbitrary syntax'. All occurrences of %n in a template will be replaced with the name of the table, obtained by prompting the user." @@ -155,7 +155,7 @@ table, obtained by prompting the user." :type 'string) (defcustom org-table-number-regexp - "^\\([<>]?[-+^.0-9]*[0-9][-+^.0-9eEdDx()%:]*\\|[<>]?[-+]?0[xX][0-9a-fA-F.]+\\|[<>]?[-+]?[0-9]+#[0-9a-zA-Z.]+\\|nan\\|[-+u]?inf\\)$" + "^\\([<>]?[-+^.0-9]*[0-9][-+^.0-9eEdDx()%:]*\\|[<>]?[-+]?0[xX][[:xdigit:].]+\\|[<>]?[-+]?[0-9]+#[0-9a-zA-Z.]+\\|nan\\|[-+u]?inf\\)$" "Regular expression for recognizing numbers in table columns. If a table column contains mostly numbers, it will be aligned to the right. If not, it will be aligned to the left. @@ -180,9 +180,9 @@ Other options offered by the customize interface are more restrictive." (const :tag "Exponential, Floating point, Integer" "^[-+]?[0-9.]+\\([eEdD][-+0-9]+\\)?$") (const :tag "Very General Number-Like, including hex and Calc radix" - "^\\([<>]?[-+^.0-9]*[0-9][-+^.0-9eEdDx()%]*\\|[<>]?[-+]?0[xX][0-9a-fA-F.]+\\|[<>]?[-+]?[0-9]+#[0-9a-zA-Z.]+\\|nan\\|[-+u]?inf\\)$") + "^\\([<>]?[-+^.0-9]*[0-9][-+^.0-9eEdDx()%]*\\|[<>]?[-+]?0[xX][[:xdigit:].]+\\|[<>]?[-+]?[0-9]+#[0-9a-zA-Z.]+\\|nan\\|[-+u]?inf\\)$") (const :tag "Very General Number-Like, including hex and Calc radix, allows comma as decimal mark" - "^\\([<>]?[-+^.,0-9]*[0-9][-+^.0-9eEdDx()%]*\\|[<>]?[-+]?0[xX][0-9a-fA-F.]+\\|[<>]?[-+]?[0-9]+#[0-9a-zA-Z.]+\\|nan\\|[-+u]?inf\\)$") + "^\\([<>]?[-+^.,0-9]*[0-9][-+^.0-9eEdDx()%]*\\|[<>]?[-+]?0[xX][[:xdigit:].]+\\|[<>]?[-+]?[0-9]+#[0-9a-zA-Z.]+\\|nan\\|[-+u]?inf\\)$") (string :tag "Regexp:"))) (defcustom org-table-number-fraction 0.5 @@ -231,9 +231,6 @@ fields." (const :tag "with yes-or-no" yes-or-no-p) (const :tag "with y-or-n" y-or-n-p) (const :tag "no confirmation" nil))) -(put 'org-table-fix-formulas-confirm - 'safe-local-variable - #'(lambda (x) (member x '(yes-or-no-p y-or-n-p)))) (defcustom org-table-tab-jumps-over-hlines t "Non-nil means tab in the last column of a table with jump over a hline. @@ -387,16 +384,19 @@ portability of tables." (const :tag "Error on attempt to cross" error))) (defcustom org-table-formula-create-columns nil - "Non-nil means that evaluation of a field formula can add new -columns if an out-of-bounds field is being set." + "Non-nil means evaluation of formula can add new columns. +When non-nil, evaluating an out-of-bounds field can insert as +many columns as needed. When set to `warn', issue a warning when +doing so. When set to `prompt', ask user before creating a new +column. Otherwise, throw an error." :group 'org-table-calculation :version "26.1" :package-version '(Org . "8.3") :type '(choice - (const :tag "Setting an out-of-bounds field generates an error (default)" nil) - (const :tag "Setting an out-of-bounds field silently adds columns as needed" t) - (const :tag "Setting an out-of-bounds field adds columns as needed, but issues a warning message" warn) - (const :tag "When setting an out-of-bounds field, the user is prompted" prompt))) + (const :tag "Out-of-bounds field generates an error (default)" nil) + (const :tag "Out-of-bounds field silently adds columns as needed" t) + (const :tag "Out-of-bounds field adds columns, but issues a warning" warn) + (const :tag "Prompt user when setting an out-of-bounds field" prompt))) (defgroup org-table-import-export nil "Options concerning table import and export in Org mode." @@ -422,6 +422,14 @@ prevents it from hanging emacs." :version "26.1" :package-version '(Org . "8.3")) +(defcustom org-table-shrunk-column-indicator "…" + "String to be displayed in a shrunk column." + :group 'org-table-editing + :type 'string + :version "27.1" + :package-version '(Org . "9.2") + :safe (lambda (v) (and (stringp v) (not (equal v ""))))) + (defconst org-table-auto-recalculate-regexp "^[ \t]*| *# *\\(|\\|$\\)" "Regexp matching a line marked for automatic recalculation.") @@ -481,8 +489,8 @@ Line numbers are counted from the beginning of the table. This variable is initialized with `org-table-analyze'.") (defconst org-table-range-regexp - "@\\([-+]?I*[-+]?[0-9]*\\)?\\(\\$[-+]?[0-9]+\\)?\\(\\.\\.@?\\([-+]?I*[-+]?[0-9]*\\)?\\(\\$[-+]?[0-9]+\\)?\\)?" - ;; 1 2 3 4 5 + "@\\([-+]?I*[-+]?[0-9]*\\)\\(\\$[-+]?[0-9]+\\)?\\(\\.\\.@?\\([-+]?I*[-+]?[0-9]*\\)\\(\\$[-+]?[0-9]+\\)?\\)?" + ;; 1 2 3 4 5 "Regular expression for matching ranges in formulas.") (defconst org-table-range-regexp2 @@ -496,6 +504,12 @@ variable is initialized with `org-table-analyze'.") (concat "\\(" "@[-0-9I$]+" "\\|" "[a-zA-Z]\\{1,2\\}\\([0-9]+\\|&\\)" "\\)") "Match a reference that needs translation, for reference display.") +(defconst org-table-separator-space + (propertize " " 'display '(space :relative-width 1)) + "Space used around fields when aligning the table. +This space serves as a segment separator for the purposes of the +bidirectional reordering.") + (defmacro org-table-save-field (&rest body) "Save current field; execute BODY; restore field. Field is restored even in case of abnormal exit." @@ -509,6 +523,23 @@ Field is restored even in case of abnormal exit." (org-table-goto-column ,column) (set-marker ,line nil))))) +;;; See org-macs.el for the definition of org-table-with-shrunk-field, +;;; including the reason why it is defined there and not here. + +(defmacro org-table-with-shrunk-columns (&rest body) + "Expand all columns before executing BODY, then shrink them again." + (declare (debug (body))) + (org-with-gensyms (shrunk-columns begin end) + `(let ((,begin (copy-marker (org-table-begin))) + (,end (copy-marker (org-table-end) t)) + (,shrunk-columns (org-table--list-shrunk-columns))) + (org-with-point-at ,begin (org-table-expand ,begin ,end)) + (unwind-protect + (progn ,@body) + (org-table--shrink-columns ,shrunk-columns ,begin ,end) + (set-marker ,begin nil) + (set-marker ,end nil))))) + ;;;###autoload (defun org-table-create-with-table.el () "Use the table.el package to insert a new table. @@ -517,13 +548,13 @@ and table.el tables." (interactive) (require 'table) (cond - ((org-at-table.el-p) - (if (y-or-n-p "Convert table to Org table? ") - (org-table-convert))) - ((org-at-table-p) - (when (y-or-n-p "Convert table to table.el table? ") - (org-table-align) - (org-table-convert))) + ((and (org-at-table.el-p) + (y-or-n-p "Convert table to Org table? ")) + (org-table-convert)) + ((and (org-at-table-p) + (y-or-n-p "Convert table to table.el table? ")) + (org-table-align) + (org-table-convert)) (t (call-interactively 'table-insert)))) ;;;###autoload @@ -564,12 +595,11 @@ SIZE is a string Columns x Rows like for example \"3x2\"." ;; (mapcar (lambda (x) (insert line)) (make-list rows t)) (dotimes (_ rows) (insert line)) (goto-char pos) - (if (> rows 1) - ;; Insert a hline after the first row. - (progn - (end-of-line 1) - (insert "\n|-") - (goto-char pos))) + (when (> rows 1) + ;; Insert a hline after the first row. + (end-of-line 1) + (insert "\n|-") + (goto-char pos)) (org-table-align))) ;;;###autoload @@ -599,8 +629,8 @@ nil When nil, the command tries to be smart and figure out the (if (> (count-lines beg end) org-table-convert-region-max-lines) (user-error "Region is longer than `org-table-convert-region-max-lines' (%s) lines; not converting" org-table-convert-region-max-lines) - (if (equal separator '(64)) - (setq separator (read-regexp "Regexp for field separator"))) + (when (equal separator '(64)) + (setq separator (read-regexp "Regexp for field separator"))) (goto-char beg) (beginning-of-line 1) (setq beg (point-marker)) @@ -644,17 +674,30 @@ nil When nil, the command tries to be smart and figure out the (org-table-align)))) ;;;###autoload -(defun org-table-import (file arg) +(defun org-table-import (file separator) "Import FILE as a table. -The file is assumed to be tab-separated. Such files can be produced by most -spreadsheet and database applications. If no tabs (at least one per line) -are found, lines will be split on whitespace into fields." + +The command tries to be smart and figure out the separator in the +following way: + + - when each line contains a TAB, assume TAB-separated material + - when each line contains a comma, assume CSV material + - else, assume one or more SPACE characters as separator. + +When non-nil, SEPARATOR specifies the field separator in the +lines. It can have the following values: + +(4) Use the comma as a field separator +(16) Use a TAB as field separator +(64) Prompt for a regular expression as field separator +integer When a number, use that many spaces, or a TAB, as field separator +regexp When a regular expression, use it to match the separator." (interactive "f\nP") - (or (bolp) (newline)) + (unless (bolp) (insert "\n")) (let ((beg (point)) (pm (point-max))) (insert-file-contents file) - (org-table-convert-region beg (+ (point) (- (point-max) pm)) arg))) + (org-table-convert-region beg (+ (point) (- (point-max) pm)) separator))) ;;;###autoload @@ -749,171 +792,112 @@ When nil, simply write \"#ERROR\" in corrupted fields.") "Overlay coordinates after each align of a table.") (defvar org-last-recalc-line nil) -(defvar org-table-do-narrow t) ; for dynamic scoping -(defconst org-narrow-column-arrow "=>" - "Used as display property in narrowed table columns.") + +(defun org-table--align-field (field width align) + "Format FIELD according to column WIDTH and alignement ALIGN. +FIELD is a string. WIDTH is a number. ALIGN is either \"c\", +\"l\" or\"r\"." + (let* ((spaces (- width (org-string-width field))) + (prefix (pcase align + ("l" "") + ("r" (make-string spaces ?\s)) + ("c" (make-string (/ spaces 2) ?\s)))) + (suffix (make-string (- spaces (length prefix)) ?\s))) + (concat org-table-separator-space + prefix + field + suffix + org-table-separator-space))) ;;;###autoload (defun org-table-align () "Align the table at point by aligning all vertical bars." (interactive) - (let* ((beg (org-table-begin)) - (end (copy-marker (org-table-end)))) + (let ((beg (org-table-begin)) + (end (copy-marker (org-table-end)))) (org-table-save-field ;; Make sure invisible characters in the table are at the right ;; place since column widths take them into account. - (font-lock-fontify-region beg end) + (org-font-lock-ensure beg end) (move-marker org-table-aligned-begin-marker beg) (move-marker org-table-aligned-end-marker end) (goto-char beg) - (let* ((indent (progn (looking-at "[ \t]*") (match-string 0))) - ;; Table's rows. Separators are replaced by nil. Trailing - ;; spaces are also removed. - (lines (mapcar (lambda (l) - (and (not (string-match-p "\\`[ \t]*|-" l)) - (let ((l (org-trim l))) - (remove-text-properties - 0 (length l) '(display t org-cwidth t) l) - l))) - (org-split-string (buffer-substring beg end) "\n"))) - ;; Get the data fields by splitting the lines. - (fields (mapcar (lambda (l) (org-split-string l " *| *")) - (remq nil lines))) - ;; Compute number of fields in the longest line. If the - ;; table contains no field, create a default table. - (maxfields (if fields (apply #'max (mapcar #'length fields)) - (kill-region beg end) - (org-table-create org-table-default-size) - (user-error "Empty table - created default table"))) - ;; A list of empty strings to fill any short rows on output. - (emptycells (make-list maxfields "")) - lengths typenums) - ;; Check for special formatting. - (dotimes (i maxfields) - (let ((column (mapcar (lambda (x) (or (nth i x) "")) fields)) - fmax falign) - ;; Look for an explicit width or alignment. - (when (save-excursion - (or (re-search-forward "| *<[lrc][0-9]*> *\\(|\\|$\\)" end t) - (and org-table-do-narrow - (re-search-forward - "| *<[lrc]?[0-9]+> *\\(|\\|$\\)" end t)))) - (catch :exit - (dolist (cell column) - (when (string-match "\\`<\\([lrc]\\)?\\([0-9]+\\)?>\\'" cell) - (when (match-end 1) (setq falign (match-string 1 cell))) - (when (and org-table-do-narrow (match-end 2)) - (setq fmax (string-to-number (match-string 2 cell)))) - (when (or falign fmax) (throw :exit nil))))) - ;; Find fields that are wider than FMAX, and shorten them. - (when fmax - (dolist (x column) - (when (> (string-width x) fmax) - (org-add-props x nil - 'help-echo - (concat - "Clipped table field, use `\\[org-table-edit-field]' to \ -edit. Full value is:\n" - (substring-no-properties x))) - (let ((l (length x)) - (f1 (min fmax - (or (string-match org-bracket-link-regexp x) - fmax))) - (f2 1)) - (unless (> f1 1) - (user-error - "Cannot narrow field starting with wide link \"%s\"" - (match-string 0 x))) - (if (= (org-string-width x) l) (setq f2 f1) - (setq f2 1) - (while (< (org-string-width (substring x 0 f2)) f1) - (cl-incf f2))) - (add-text-properties f2 l (list 'org-cwidth t) x) - (add-text-properties - (if (>= (string-width (substring x (1- f2) f2)) 2) (1- f2) - (- f2 2)) - f2 - (list 'display org-narrow-column-arrow) - x)))))) - ;; Get the maximum width for each column - (push (or fmax (apply #'max 1 (mapcar #'org-string-width column))) - lengths) - ;; Get the fraction of numbers among non-empty cells to - ;; decide about alignment of the column. - (if falign (push (equal (downcase falign) "r") typenums) - (let ((cnt 0) - (frac 0.0)) - (dolist (x column) - (unless (equal x "") - (setq frac - (/ (+ (* frac cnt) - (if (string-match-p org-table-number-regexp x) - 1 - 0)) - (cl-incf cnt))))) - (push (>= frac org-table-number-fraction) typenums))))) - (setq lengths (nreverse lengths)) - (setq typenums (nreverse typenums)) - ;; Store alignment of this table, for later editing of single - ;; fields. - (setq org-table-last-alignment typenums) - (setq org-table-last-column-widths lengths) - ;; With invisible characters, `format' does not get the field - ;; width right So we need to make these fields wide by hand. - ;; Invisible characters may be introduced by fontified links, - ;; emphasis, macros or sub/superscripts. - (when (or (text-property-any beg end 'invisible 'org-link) - (text-property-any beg end 'invisible t)) - (dotimes (i maxfields) - (let ((len (nth i lengths))) - (dotimes (j (length fields)) - (let* ((c (nthcdr i (nth j fields))) - (cell (car c))) - (when (and - (stringp cell) - (let ((l (length cell))) - (or (text-property-any 0 l 'invisible 'org-link cell) - (text-property-any beg end 'invisible t))) - (< (org-string-width cell) len)) - (let ((s (make-string (- len (org-string-width cell)) ?\s))) - (setcar c (if (nth i typenums) (concat s cell) - (concat cell s)))))))))) - - ;; Compute the formats needed for output of the table. - (let ((hfmt (concat indent "|")) - (rfmt (concat indent "|")) - (rfmt1 " %%%s%ds |") - (hfmt1 "-%s-+")) - (dolist (l lengths (setq hfmt (concat (substring hfmt 0 -1) "|"))) - (let ((ty (if (pop typenums) "" "-"))) ; Flush numbers right. - (setq rfmt (concat rfmt (format rfmt1 ty l))) - (setq hfmt (concat hfmt (format hfmt1 (make-string l ?-)))))) - ;; Replace modified lines only. Check not only contents, but - ;; also columns' width. - (dolist (l lines) - (let ((line - (if l (apply #'format rfmt (append (pop fields) emptycells)) - hfmt)) - (previous (buffer-substring (point) (line-end-position)))) - (if (and (equal previous line) - (let ((a 0) - (b 0)) - (while (and (progn - (setq a (next-single-property-change - a 'org-cwidth previous)) - (setq b (next-single-property-change - b 'org-cwidth line))) - (eq a b))) - (eq a b))) - (forward-line) - (insert line "\n") - (delete-region (point) (line-beginning-position 2)))))) - (when (and orgtbl-mode (not (derived-mode-p 'org-mode))) - (goto-char org-table-aligned-begin-marker) - (while (org-hide-wide-columns org-table-aligned-end-marker))) - (set-marker end nil) - (when org-table-overlay-coordinates (org-table-overlay-coordinates)) - (setq org-table-may-need-update nil))))) + (org-table-with-shrunk-columns + (let* ((indent (progn (looking-at "[ \t]*") (match-string 0))) + ;; Table's rows as lists of fields. Rules are replaced + ;; by nil. Trailing spaces are removed. + (fields (mapcar + (lambda (l) + (and (not (string-match-p org-table-hline-regexp l)) + (org-split-string l "[ \t]*|[ \t]*"))) + (split-string (buffer-substring beg end) "\n" t))) + ;; Compute number of columns. If the table contains no + ;; field, create a default table and bail out. + (columns-number + (if fields (apply #'max (mapcar #'length fields)) + (kill-region beg end) + (org-table-create org-table-default-size) + (user-error "Empty table - created default table"))) + (widths nil) + (alignments nil)) + ;; Compute alignment and width for each column. + (dotimes (i columns-number) + (let* ((max-width 1) + (fixed-align? nil) + (numbers 0) + (non-empty 0)) + (dolist (row fields) + (let ((cell (or (nth i row) ""))) + (setq max-width (max max-width (org-string-width cell))) + (cond (fixed-align? nil) + ((equal cell "") nil) + ((string-match "\\`<\\([lrc]\\)[0-9]*>\\'" cell) + (setq fixed-align? (match-string 1 cell))) + (t + (cl-incf non-empty) + (when (string-match-p org-table-number-regexp cell) + (cl-incf numbers)))))) + (push max-width widths) + (push (cond + (fixed-align?) + ((>= numbers (* org-table-number-fraction non-empty)) "r") + (t "l")) + alignments))) + (setq widths (nreverse widths)) + (setq alignments (nreverse alignments)) + ;; Store alignment of this table, for later editing of single + ;; fields. + (setq org-table-last-alignment alignments) + (setq org-table-last-column-widths widths) + ;; Build new table rows. Only replace rows that actually + ;; changed. + (dolist (row fields) + (let ((previous (buffer-substring (point) (line-end-position))) + (new + (format "%s|%s|" + indent + (if (null row) ;horizontal rule + (mapconcat (lambda (w) (make-string (+ 2 w) ?-)) + widths + "+") + (let ((cells ;add missing fields + (append row + (make-list (- columns-number + (length row)) + "")))) + (mapconcat #'identity + (cl-mapcar #'org-table--align-field + cells + widths + alignments) + "|")))))) + (if (equal new previous) + (forward-line) + (insert new "\n") + (delete-region (point) (line-beginning-position 2))))) + (set-marker end nil) + (when org-table-overlay-coordinates (org-table-overlay-coordinates)) + (setq org-table-may-need-update nil)))))) ;;;###autoload (defun org-table-begin (&optional table-type) @@ -972,22 +956,27 @@ Optional argument NEW may specify text to replace the current field content." (skip-chars-backward "^|") (if (not (looking-at " *\\([^|\n]*?\\) *\\(|\\|$\\)")) (setq org-table-may-need-update t) - (let* ((numbers? (nth (1- col) org-table-last-alignment)) + (let* ((align (nth (1- col) org-table-last-alignment)) + (width (nth (1- col) org-table-last-column-widths)) (cell (match-string 0)) (field (match-string 1)) - (len (max 1 (- (org-string-width cell) 3))) (properly-closed? (/= (match-beginning 2) (match-end 2))) - (fmt (format (if numbers? " %%%ds %s" " %%-%ds %s") - len - (if properly-closed? "|" - (setq org-table-may-need-update t) - ""))) (new-cell - (cond ((not new) (format fmt field)) - ((<= (org-string-width new) len) (format fmt new)) - (t - (setq org-table-may-need-update t) - (format " %s |" new))))) + (save-match-data + (cond (org-table-may-need-update + (format " %s |" (or new field))) + ((not properly-closed?) + (setq org-table-may-need-update t) + (format " %s |" (or new field))) + ((not new) + (concat (org-table--align-field field width align) + "|")) + ((<= (org-string-width new) width) + (concat (org-table--align-field new width align) + "|")) + (t + (setq org-table-may-need-update t) + (format " %s |" new)))))) (unless (equal new-cell cell) (let (org-table-may-need-update) (replace-match new-cell t t))) @@ -1000,9 +989,9 @@ Before doing so, re-align the table if necessary." (interactive) (org-table-maybe-eval-formula) (org-table-maybe-recalculate-line) - (if (and org-table-automatic-realign - org-table-may-need-update) - (org-table-align)) + (when (and org-table-automatic-realign + org-table-may-need-update) + (org-table-align)) (let ((end (org-table-end))) (if (org-at-table-hline-p) (end-of-line 1)) @@ -1062,7 +1051,7 @@ With numeric argument N, move N-1 fields backward first." (user-error "No more table fields before the current") (goto-char (match-end 0)) (and (looking-at " ") (forward-char 1))) - (if (>= (point) pos) (org-table-beginning-of-field 2)))) + (when (>= (point) pos) (org-table-beginning-of-field 2)))) (defun org-table-end-of-field (&optional n) "Move to the end of the current table field. @@ -1076,9 +1065,9 @@ With numeric argument N, move N-1 fields forward first." (when (re-search-forward "|" (point-at-eol 1) t) (backward-char 1) (skip-chars-backward " ") - (if (and (equal (char-before (point)) ?|) (looking-at " ")) - (forward-char 1))) - (if (<= (point) pos) (org-table-end-of-field 2)))) + (when (and (equal (char-before (point)) ?|) (equal (char-after (point)) ?\s)) + (forward-char 1))) + (when (<= (point) pos) (org-table-end-of-field 2)))) ;;;###autoload (defun org-table-next-row () @@ -1087,22 +1076,19 @@ Before doing so, re-align the table if necessary." (interactive) (org-table-maybe-eval-formula) (org-table-maybe-recalculate-line) - (if (or (looking-at "[ \t]*$") - (save-excursion (skip-chars-backward " \t") (bolp))) - (newline) - (if (and org-table-automatic-realign - org-table-may-need-update) - (org-table-align)) - (let ((col (org-table-current-column))) - (beginning-of-line 2) - (if (or (not (org-at-table-p)) + (if (and org-table-automatic-realign + org-table-may-need-update) + (org-table-align)) + (let ((col (org-table-current-column))) + (beginning-of-line 2) + (unless (bolp) (insert "\n")) ;missing newline at eob + (when (or (not (org-at-table-p)) (org-at-table-hline-p)) - (progn - (beginning-of-line 0) - (org-table-insert-row 'below))) - (org-table-goto-column col) - (skip-chars-backward "^|\n\r") - (if (looking-at " ") (forward-char 1))))) + (beginning-of-line 0) + (org-table-insert-row 'below)) + (org-table-goto-column col) + (skip-chars-backward "^|\n\r") + (when (looking-at " ") (forward-char)))) ;;;###autoload (defun org-table-copy-down (n) @@ -1158,9 +1144,10 @@ to a number. In the case of a timestamp, increment by days." (<= (setq n (1- n)) 0)) (throw 'exit (match-string 1)))))) (setq non-empty-up (and field-up (string-match "[^ \t]" field-up)))) - ;; Above field was not empty, go down to the next row + ;; Above field was not empty, go down to the next row. Skip + ;; alignment since we do it at the end of the process anyway. (setq txt (org-trim field)) - (org-table-next-row) + (let ((org-table-may-need-update nil)) (org-table-next-row)) (org-table-blank-field)) (if non-empty-up (setq txt-up (org-trim field-up))) (setq inc (cond @@ -1170,7 +1157,7 @@ to a number. In the case of a timestamp, increment by days." (- (org-time-string-to-absolute txt) (org-time-string-to-absolute txt-up))) ((string-match org-ts-regexp3 txt) 1) - ((string-match "\\([-+]\\)?[0-9]+\\(?:\.[0-9]+\\)?" txt-up) + ((string-match "\\([-+]\\)?[0-9]*\\(?:\\.[0-9]+\\)?" txt-up) (- (string-to-number txt) (string-to-number (match-string 0 txt-up)))) (t 1))) @@ -1190,14 +1177,16 @@ to a number. In the case of a timestamp, increment by days." (org-table-align) (org-move-to-column col)))) -(defun org-table-check-inside-data-field (&optional noerror) - "Is point inside a table data field? -I.e. not on a hline or before the first or after the last column? -This actually throws an error, so it aborts the current command." - (cond ((and (org-at-table-p) +(defun org-table-check-inside-data-field (&optional noerror assume-table) + "Non-nil when point is inside a table data field. +Raise an error otherwise, unless NOERROR is non-nil. In that +case, return nil if point is not inside a data field. When +optional argument ASSUME-TABLE is non-nil, assume point is within +a table." + (cond ((and (or assume-table (org-at-table-p)) (not (save-excursion (skip-chars-backward " \t") (bolp))) (not (org-at-table-hline-p)) - (not (looking-at "[ \t]*$")))) + (not (looking-at-p "[ \t]*$")))) (noerror nil) (t (user-error "Not in table data field")))) @@ -1277,7 +1266,8 @@ value." (let* ((pos (match-beginning 0)) (val (buffer-substring pos (match-end 0)))) (when replace - (replace-match (if (equal replace "") " " replace) t t)) + (org-table-with-shrunk-field + (replace-match (if (equal replace "") " " replace) t t))) (goto-char (min (line-end-position) (1+ pos))) val))) @@ -1330,13 +1320,16 @@ value." ""))))) (defun org-table-current-column () - "Find out which column we are in." + "Return current column number." (interactive) (save-excursion - (let ((column 0) (pos (point))) + (let ((pos (point))) (beginning-of-line) - (while (search-forward "|" pos t) (cl-incf column)) - column))) + (if (not (search-forward "|" pos t)) 0 + (let ((column 1) + (separator (if (org-at-table-hline-p) "[+|]" "|"))) + (while (re-search-forward separator pos t) (cl-incf column)) + column))))) (defun org-table-current-dline () "Find out what table data line we are in. @@ -1379,41 +1372,50 @@ However, when FORCE is non-nil, create new columns if necessary." (interactive) (unless (org-at-table-p) (user-error "Not at a table")) (org-table-find-dataline) - (let* ((col (max 1 (org-table-current-column))) - (beg (org-table-begin)) - (end (copy-marker (org-table-end)))) - (org-table-save-field - (goto-char beg) - (while (< (point) end) - (unless (org-at-table-hline-p) - (org-table-goto-column col t) - (insert "| ")) - (forward-line))) - (set-marker end nil) + (let ((col (max 1 (org-table-current-column))) + (beg (org-table-begin)) + (end (copy-marker (org-table-end))) + (shrunk-columns (org-table--list-shrunk-columns))) + (org-table-expand beg end) + (save-excursion + (goto-char beg) + (while (< (point) end) + (unless (org-at-table-hline-p) + (org-table-goto-column col t) + (unless (search-forward "|" (line-end-position) t 2) + ;; Add missing vertical bar at the end of the row. + (end-of-line) + (insert "|")) + (insert " |")) + (forward-line))) + (org-table-goto-column (1+ col)) (org-table-align) + ;; Shift appropriately stored shrunk column numbers, then hide the + ;; columns again. + (org-table--shrink-columns (mapcar (lambda (c) (if (<= c col) c (1+ c))) + shrunk-columns) + beg end) + (set-marker end nil) + ;; Fix TBLFM formulas, if desirable. (when (or (not org-table-fix-formulas-confirm) (funcall org-table-fix-formulas-confirm "Fix formulas? ")) (org-table-fix-formulas "$" nil (1- col) 1) (org-table-fix-formulas "$LR" nil (1- col) 1)))) (defun org-table-find-dataline () - "Find a data line in the current table, which is needed for column commands." - (if (and (org-at-table-p) - (not (org-at-table-hline-p))) - t - (let ((col (current-column)) - (end (org-table-end))) - (org-move-to-column col) - (while (and (< (point) end) - (or (not (= (current-column) col)) - (org-at-table-hline-p))) - (beginning-of-line 2) - (org-move-to-column col)) - (if (and (org-at-table-p) - (not (org-at-table-hline-p))) - t - (user-error - "Please position cursor in a data line for column operations"))))) + "Find a data line in the current table, which is needed for column commands. +This function assumes point is in a table. Raise an error when +there is no data row below." + (or (not (org-at-table-hline-p)) + (let ((col (current-column)) + (end (org-table-end))) + (forward-line) + (while (and (< (point) end) (org-at-table-hline-p)) + (forward-line)) + (when (>= (point) end) + (user-error "Cannot find data row for column operation")) + (org-move-to-column col) + t))) (defun org-table-line-to-dline (line &optional above) "Turn a buffer line number into a data line number. @@ -1428,7 +1430,7 @@ non-nil, the one above is used." (cond ((or (> (aref org-table-dlines min) line) (< (aref org-table-dlines max) line)) nil) - ((= (aref org-table-dlines max) line) max) + ((= line (aref org-table-dlines max)) max) (t (catch 'exit (while (> (- max min) 1) (let* ((mean (/ (+ max min) 2)) @@ -1436,7 +1438,10 @@ non-nil, the one above is used." (cond ((= v line) (throw 'exit mean)) ((> v line) (setq max mean)) (t (setq min mean))))) - (if above min max)))))) + (cond ((= line (aref org-table-dlines max)) max) + ((= line (aref org-table-dlines min)) min) + (above min) + (t max))))))) ;;;###autoload (defun org-table-delete-column () @@ -1444,10 +1449,12 @@ non-nil, the one above is used." (interactive) (unless (org-at-table-p) (user-error "Not at a table")) (org-table-find-dataline) - (org-table-check-inside-data-field) - (let ((col (org-table-current-column)) - (beg (org-table-begin)) - (end (copy-marker (org-table-end)))) + (org-table-check-inside-data-field nil t) + (let* ((col (org-table-current-column)) + (beg (org-table-begin)) + (end (copy-marker (org-table-end))) + (shrunk-columns (remq col (org-table--list-shrunk-columns)))) + (org-table-expand beg end) (org-table-save-field (goto-char beg) (while (< (point) end) @@ -1457,9 +1464,15 @@ non-nil, the one above is used." (and (looking-at "|[^|\n]+|") (replace-match "|"))) (forward-line))) - (set-marker end nil) (org-table-goto-column (max 1 (1- col))) (org-table-align) + ;; Shift appropriately stored shrunk column numbers, then hide the + ;; columns again. + (org-table--shrink-columns (mapcar (lambda (c) (if (< c col) c (1- c))) + shrunk-columns) + beg end) + (set-marker end nil) + ;; Fix TBLFM formulas, if desirable. (when (or (not org-table-fix-formulas-confirm) (funcall org-table-fix-formulas-confirm "Fix formulas? ")) (org-table-fix-formulas @@ -1472,6 +1485,7 @@ non-nil, the one above is used." "Move column to the right." (interactive) (org-table-move-column nil)) + ;;;###autoload (defun org-table-move-column-left () "Move column to the left." @@ -1484,7 +1498,7 @@ non-nil, the one above is used." (interactive "P") (unless (org-at-table-p) (user-error "Not at a table")) (org-table-find-dataline) - (org-table-check-inside-data-field) + (org-table-check-inside-data-field nil t) (let* ((col (org-table-current-column)) (col1 (if left (1- col) col)) (colpos (if left (1- col) (1+ col))) @@ -1494,33 +1508,49 @@ non-nil, the one above is used." (user-error "Cannot move column further left")) (when (and (not left) (looking-at "[^|\n]*|[^|\n]*$")) (user-error "Cannot move column further right")) - (org-table-save-field - (goto-char beg) - (while (< (point) end) - (unless (org-at-table-hline-p) - (org-table-goto-column col1 t) - (when (looking-at "|\\([^|\n]+\\)|\\([^|\n]+\\)|") - (transpose-regions - (match-beginning 1) (match-end 1) - (match-beginning 2) (match-end 2)))) - (forward-line))) - (set-marker end nil) - (org-table-goto-column colpos) - (org-table-align) - (when (or (not org-table-fix-formulas-confirm) - (funcall org-table-fix-formulas-confirm "Fix formulas? ")) - (org-table-fix-formulas - "$" (list (cons (number-to-string col) (number-to-string colpos)) - (cons (number-to-string colpos) (number-to-string col)))) - (org-table-fix-formulas - "$LR" (list (cons (number-to-string col) (number-to-string colpos)) - (cons (number-to-string colpos) (number-to-string col))))))) + (let ((shrunk-columns (org-table--list-shrunk-columns))) + (org-table-expand beg end) + (org-table-save-field + (goto-char beg) + (while (< (point) end) + (unless (org-at-table-hline-p) + (org-table-goto-column col1 t) + (when (looking-at "|\\([^|\n]+\\)|\\([^|\n]+\\)|") + (transpose-regions + (match-beginning 1) (match-end 1) + (match-beginning 2) (match-end 2)))) + (forward-line))) + (org-table-goto-column colpos) + (org-table-align) + ;; Shift appropriately stored shrunk column numbers, then shrink + ;; the columns again. + (org-table--shrink-columns + (mapcar (lambda (c) + (cond ((and (= col c) left) (1- c)) + ((= col c) (1+ c)) + ((and (= col (1+ c)) left) (1+ c)) + ((and (= col (1- c)) (not left) (1- c))) + (t c))) + shrunk-columns) + beg end) + (set-marker end nil) + ;; Fix TBLFM formulas, if desirable. + (when (or (not org-table-fix-formulas-confirm) + (funcall org-table-fix-formulas-confirm "Fix formulas? ")) + (org-table-fix-formulas + "$" (list (cons (number-to-string col) (number-to-string colpos)) + (cons (number-to-string colpos) (number-to-string col)))) + (org-table-fix-formulas + "$LR" (list + (cons (number-to-string col) (number-to-string colpos)) + (cons (number-to-string colpos) (number-to-string col)))))))) ;;;###autoload (defun org-table-move-row-down () "Move table row down." (interactive) (org-table-move-row nil)) + ;;;###autoload (defun org-table-move-row-up () "Move table row up." @@ -1545,24 +1575,25 @@ non-nil, the one above is used." (when (or (and (not up) (eobp)) (not (org-at-table-p))) (goto-char pos) (user-error "Cannot move row further")) - (setq hline2p (looking-at org-table-hline-regexp)) - (goto-char pos) - (let ((row (delete-and-extract-region (line-beginning-position) - (line-beginning-position 2)))) - (beginning-of-line tonew) - (unless (bolp) (insert "\n")) ;at eob without a newline - (insert row) - (unless (bolp) (insert "\n")) ;missing final newline in ROW - (beginning-of-line 0) - (org-move-to-column col) - (unless (or hline1p hline2p - (not (or (not org-table-fix-formulas-confirm) - (funcall org-table-fix-formulas-confirm - "Fix formulas? ")))) - (org-table-fix-formulas - "@" (list - (cons (number-to-string dline1) (number-to-string dline2)) - (cons (number-to-string dline2) (number-to-string dline1)))))))) + (org-table-with-shrunk-columns + (setq hline2p (looking-at org-table-hline-regexp)) + (goto-char pos) + (let ((row (delete-and-extract-region (line-beginning-position) + (line-beginning-position 2)))) + (beginning-of-line tonew) + (unless (bolp) (insert "\n")) ;at eob without a newline + (insert row) + (unless (bolp) (insert "\n")) ;missing final newline in ROW + (beginning-of-line 0) + (org-move-to-column col) + (unless (or hline1p hline2p + (not (or (not org-table-fix-formulas-confirm) + (funcall org-table-fix-formulas-confirm + "Fix formulas? ")))) + (org-table-fix-formulas + "@" (list + (cons (number-to-string dline1) (number-to-string dline2)) + (cons (number-to-string dline2) (number-to-string dline1))))))))) ;;;###autoload (defun org-table-insert-row (&optional arg) @@ -1570,47 +1601,48 @@ non-nil, the one above is used." With prefix ARG, insert below the current line." (interactive "P") (unless (org-at-table-p) (user-error "Not at a table")) - (let* ((line (buffer-substring (line-beginning-position) (line-end-position))) - (new (org-table-clean-line line))) - ;; Fix the first field if necessary - (if (string-match "^[ \t]*| *[#$] *|" line) - (setq new (replace-match (match-string 0 line) t t new))) - (beginning-of-line (if arg 2 1)) - ;; Buffer may not end of a newline character, so ensure - ;; (beginning-of-line 2) moves point to a new line. - (unless (bolp) (insert "\n")) - (let (org-table-may-need-update) (insert-before-markers new "\n")) - (beginning-of-line 0) - (re-search-forward "| ?" (line-end-position) t) - (when (or org-table-may-need-update org-table-overlay-coordinates) - (org-table-align)) - (when (or (not org-table-fix-formulas-confirm) - (funcall org-table-fix-formulas-confirm "Fix formulas? ")) - (org-table-fix-formulas "@" nil (1- (org-table-current-dline)) 1)))) + (org-table-with-shrunk-columns + (let* ((line (buffer-substring (line-beginning-position) (line-end-position))) + (new (org-table-clean-line line))) + ;; Fix the first field if necessary + (when (string-match "^[ \t]*| *[#*$] *|" line) + (setq new (replace-match (match-string 0 line) t t new))) + (beginning-of-line (if arg 2 1)) + ;; Buffer may not end of a newline character, so ensure + ;; (beginning-of-line 2) moves point to a new line. + (unless (bolp) (insert "\n")) + (let (org-table-may-need-update) (insert-before-markers new "\n")) + (beginning-of-line 0) + (re-search-forward "| ?" (line-end-position) t) + (when (or org-table-may-need-update org-table-overlay-coordinates) + (org-table-align)) + (when (or (not org-table-fix-formulas-confirm) + (funcall org-table-fix-formulas-confirm "Fix formulas? ")) + (org-table-fix-formulas "@" nil (1- (org-table-current-dline)) 1))))) ;;;###autoload (defun org-table-insert-hline (&optional above) "Insert a horizontal-line below the current line into the table. With prefix ABOVE, insert above the current line." (interactive "P") - (if (not (org-at-table-p)) - (user-error "Not at a table")) - (when (eobp) (insert "\n") (backward-char 1)) - (if (not (string-match-p "|[ \t]*$" (org-current-line-string))) - (org-table-align)) - (let ((line (org-table-clean-line - (buffer-substring (point-at-bol) (point-at-eol)))) - (col (current-column))) - (while (string-match "|\\( +\\)|" line) - (setq line (replace-match - (concat "+" (make-string (- (match-end 1) (match-beginning 1)) - ?-) "|") t t line))) - (and (string-match "\\+" line) (setq line (replace-match "|" t t line))) - (beginning-of-line (if above 1 2)) - (insert line "\n") - (beginning-of-line (if above 1 -1)) - (org-move-to-column col) - (and org-table-overlay-coordinates (org-table-align)))) + (unless (org-at-table-p) (user-error "Not at a table")) + (when (eobp) (save-excursion (insert "\n"))) + (unless (string-match-p "|[ \t]*$" (org-current-line-string)) + (org-table-align)) + (org-table-with-shrunk-columns + (let ((line (org-table-clean-line + (buffer-substring (point-at-bol) (point-at-eol)))) + (col (current-column))) + (while (string-match "|\\( +\\)|" line) + (setq line (replace-match + (concat "+" (make-string (- (match-end 1) (match-beginning 1)) + ?-) "|") t t line))) + (and (string-match "\\+" line) (setq line (replace-match "|" t t line))) + (beginning-of-line (if above 1 2)) + (insert line "\n") + (beginning-of-line (if above 1 -1)) + (org-move-to-column col) + (when org-table-overlay-coordinates (org-table-align))))) ;;;###autoload (defun org-table-hline-and-move (&optional same-column) @@ -1643,19 +1675,19 @@ In particular, this does handle wide and invisible characters." (defun org-table-kill-row () "Delete the current row or horizontal line from the table." (interactive) - (if (not (org-at-table-p)) - (user-error "Not at a table")) + (unless (org-at-table-p) (user-error "Not at a table")) (let ((col (current-column)) (dline (and (not (org-match-line org-table-hline-regexp)) (org-table-current-dline)))) - (kill-region (point-at-bol) (min (1+ (point-at-eol)) (point-max))) - (if (not (org-at-table-p)) (beginning-of-line 0)) - (org-move-to-column col) - (when (and dline - (or (not org-table-fix-formulas-confirm) - (funcall org-table-fix-formulas-confirm "Fix formulas? "))) - (org-table-fix-formulas "@" (list (cons (number-to-string dline) "INVALID")) - dline -1 dline)))) + (org-table-with-shrunk-columns + (kill-region (point-at-bol) (min (1+ (point-at-eol)) (point-max))) + (if (not (org-at-table-p)) (beginning-of-line 0)) + (org-move-to-column col) + (when (and dline + (or (not org-table-fix-formulas-confirm) + (funcall org-table-fix-formulas-confirm "Fix formulas? "))) + (org-table-fix-formulas + "@" (list (cons (number-to-string dline) "INVALID")) dline -1 dline))))) ;;;###autoload (defun org-table-sort-lines @@ -1675,7 +1707,8 @@ alphabetically, numerically, or by time (as given in a time stamp in the field, or as a HH:MM value). Sorting in reverse order is also possible. -With prefix argument WITH-CASE, alphabetic sorting will be case-sensitive. +With prefix argument WITH-CASE, alphabetic sorting will be case-sensitive +if the locale allows for it. If SORTING-TYPE is specified when this function is called from a Lisp program, no prompting will take place. SORTING-TYPE must be a character, @@ -1705,7 +1738,9 @@ function is being called interactively." (sorting-type (or sorting-type (read-char-exclusive "Sort Table: [a]lphabetic, [n]umeric, \ -\[t]ime, [f]unc. A/N/T/F means reversed: ")))) +\[t]ime, [f]unc. A/N/T/F means reversed: "))) + (start (org-table-begin)) + (end (org-table-end))) (save-restriction ;; Narrow buffer to appropriate sorting area. (if (org-region-active-p) @@ -1714,21 +1749,18 @@ function is being called interactively." (point) (save-excursion (goto-char (region-end)) (line-beginning-position 2)))) - (let ((start (org-table-begin)) - (end (org-table-end))) - (narrow-to-region - (save-excursion - (if (re-search-backward org-table-hline-regexp start t) - (line-beginning-position 2) - start)) - (if (save-excursion (re-search-forward org-table-hline-regexp end t)) - (match-beginning 0) - end)))) + (narrow-to-region + (save-excursion + (if (re-search-backward org-table-hline-regexp start t) + (line-beginning-position 2) + start)) + (if (save-excursion (re-search-forward org-table-hline-regexp end t)) + (match-beginning 0) + end))) ;; Determine arguments for `sort-subr'. Also record original ;; position. `org-table-save-field' cannot help here since ;; sorting is too much destructive. - (let* ((sort-fold-case (not with-case)) - (coordinates + (let* ((coordinates (cons (count-lines (point-min) (line-beginning-position)) (current-column))) (extract-key-from-field @@ -1755,14 +1787,16 @@ function is being called interactively." (predicate (cl-case sorting-type ((?n ?N ?t ?T) #'<) - ((?a ?A) #'string<) + ((?a ?A) (if with-case #'org-string-collate-lessp + (lambda (s1 s2) (org-string-collate-lessp s1 s2 nil t)))) ((?f ?F) (or compare-func (and interactive? (org-read-function - (concat "Function for comparing keys " - "(empty for default `sort-subr' predicate): ") - 'allow-empty))))))) + "Function for comparing keys (empty for default \ +`sort-subr' predicate): " + 'allow-empty)))))) + (shrunk-columns (remq column (org-table--list-shrunk-columns)))) (goto-char (point-min)) (sort-subr (memq sorting-type '(?A ?N ?T ?F)) (lambda () @@ -1776,6 +1810,8 @@ function is being called interactively." (org-trim (org-table-get-field column)))) nil predicate) + ;; Hide all columns but the one being sorted. + (org-table--shrink-columns shrunk-columns start end) ;; Move back to initial field. (forward-line (car coordinates)) (move-to-column (cdr coordinates)))))) @@ -1792,8 +1828,9 @@ If there is no active region, use just the field at point." ;;;###autoload (defun org-table-copy-region (beg end &optional cut) "Copy rectangular region in table to clipboard. -A special clipboard is used which can only be accessed -with `org-table-paste-rectangle'." +A special clipboard is used which can only be accessed with +`org-table-paste-rectangle'. Return the region copied, as a list +of lists of fields." (interactive (list (if (org-region-active-p) (region-beginning) (point)) (if (org-region-active-p) (region-end) (point)) @@ -1804,7 +1841,7 @@ with `org-table-paste-rectangle'." (c01 (org-table-current-column)) region) (goto-char (max beg end)) - (org-table-check-inside-data-field) + (org-table-check-inside-data-field nil t) (let* ((end (copy-marker (line-end-position))) (c02 (org-table-current-column)) (column-start (min c01 c02)) @@ -1822,6 +1859,8 @@ with `org-table-paste-rectangle'." (forward-line)) (set-marker end nil)) (when cut (org-table-align)) + (message (substitute-command-keys "Cells in the region copied, use \ +\\[org-table-paste-rectangle] to paste them in a table.")) (setq org-table-clip (nreverse region)))) ;;;###autoload @@ -2025,8 +2064,7 @@ toggle `org-table-follow-field-mode'." (arg (let ((b (save-excursion (skip-chars-backward "^|") (point))) (e (save-excursion (skip-chars-forward "^|\r\n") (point)))) - (remove-text-properties b e '(org-cwidth t invisible t - display t intangible t)) + (remove-text-properties b e '(invisible t intangible t)) (if (and (boundp 'font-lock-mode) font-lock-mode) (font-lock-fontify-block)))) (t @@ -2053,9 +2091,7 @@ toggle `org-table-follow-field-mode'." (setq word-wrap t) (goto-char (setq p (point-max))) (insert (org-trim field)) - (remove-text-properties p (point-max) - '(invisible t org-cwidth t display t - intangible t)) + (remove-text-properties p (point-max) '(invisible t intangible t)) (goto-char p) (setq-local org-finish-function 'org-table-finish-edit-field) (setq-local org-window-configuration cw) @@ -2163,8 +2199,8 @@ If NLAST is a number, only the NLAST fields will actually be summed." (sres (if (= org-timecnt 0) (number-to-string res) (setq diff (* 3600 res) - h (floor (/ diff 3600)) diff (mod diff 3600) - m (floor (/ diff 60)) diff (mod diff 60) + h (floor diff 3600) diff (mod diff 3600) + m (floor diff 60) diff (mod diff 60) s diff) (format "%.0f:%02.0f:%02.0f" h m s)))) (kill-new sres) @@ -2241,34 +2277,31 @@ When NAMED is non-nil, look for a named equation." (eq (cond ((and stored equation (string-match-p "^ *=? *$" equation)) stored) - ((stringp equation) - equation) - (t (org-table-formula-from-user - (read-string - (org-table-formula-to-user - (format "%s formula %s=" - (if named "Field" "Column") - scol)) - (if stored (org-table-formula-to-user stored) "") - 'org-table-formula-history - ))))) + ((stringp equation) equation) + (t + (org-table-formula-from-user + (read-string + (org-table-formula-to-user + (format "%s formula %s=" (if named "Field" "Column") scol)) + (if stored (org-table-formula-to-user stored) "") + 'org-table-formula-history))))) mustsave) - (when (not (string-match "\\S-" eq)) - ;; remove formula + (unless (org-string-nw-p eq) + ;; Remove formula. (setq stored-list (delq (assoc scol stored-list) stored-list)) (org-table-store-formulas stored-list) (user-error "Formula removed")) - (if (string-match "^ *=?" eq) (setq eq (replace-match "" t t eq))) - (if (string-match " *$" eq) (setq eq (replace-match "" t t eq))) - (if (and name (not named)) - ;; We set the column equation, delete the named one. - (setq stored-list (delq (assoc name stored-list) stored-list) - mustsave t)) + (when (string-match "^ *=?" eq) (setq eq (replace-match "" t t eq))) + (when (string-match " *$" eq) (setq eq (replace-match "" t t eq))) + (when (and name (not named)) + ;; We set the column equation, delete the named one. + (setq stored-list (delq (assoc name stored-list) stored-list) + mustsave t)) (if stored (setcdr (assoc scol stored-list) eq) (setq stored-list (cons (cons scol eq) stored-list))) - (if (or mustsave (not (equal stored eq))) - (org-table-store-formulas stored-list)) + (when (or mustsave (not (equal stored eq))) + (org-table-store-formulas stored-list)) eq)) (defun org-table-store-formulas (alist &optional location) @@ -2295,7 +2328,7 @@ LOCATION instead." "\n")))) (defsubst org-table-formula-make-cmp-string (a) - (when (string-match "\\`$[<>]" a) + (when (string-match "\\`\\$[<>]" a) (let ((arrow (string-to-char (substring a 1)))) ;; Fake a high number to make sure this is sorted at the end. (setq a (org-table-formula-handle-first/last-rc a)) @@ -2336,14 +2369,14 @@ LOCATION is a buffer position, consider the formulas there." eq-alist seen) (dolist (string strings (nreverse eq-alist)) (when (string-match "\\`\\(@[-+I<>0-9.$@]+\\|\\$\\([_a-zA-Z0-9]+\\|\ -[<>]+\\)\\) *= *\\(.*[^ \t]\\)" +\[<>]+\\)\\) *= *\\(.*[^ \t]\\)" string) (let ((lhs (let ((m (match-string 1 string))) (cond ((not (match-end 2)) m) ;; Is it a column reference? - ((string-match-p "\\`$\\([0-9]+\\|[<>]+\\)\\'" m) m) + ((string-match-p "\\`\\$\\([0-9]+\\|[<>]+\\)\\'" m) m) ;; Since named columns are not possible in ;; LHS, assume this is a named field. (t (match-string 2 string))))) @@ -2702,7 +2735,7 @@ SUPPRESS-ANALYSIS prevents analyzing the table and checking location of point." (interactive "P") (unless suppress-analysis - (org-table-check-inside-data-field) + (org-table-check-inside-data-field nil t) (org-table-analyze)) (if (equal arg '(16)) (let ((eq (org-table-current-field-formula))) @@ -3157,7 +3190,7 @@ ARGS are passed as arguments to the `message' function. Returns current time if a message is printed, otherwise returns T1. If T1 is nil, always messages." (let ((curtime (current-time))) - (if (or (not t1) (< 0 (nth 1 (time-subtract curtime t1)))) + (if (or (not t1) (org-time-less-p 1 (org-time-subtract curtime t1))) (progn (apply 'message args) curtime) t1))) @@ -3192,137 +3225,139 @@ known that the table will be realigned a little later anyway." beg end eqlcol eqlfield) ;; Insert constants in all formulas. (when eqlist - (org-table-save-field - ;; Expand equations, then split the equation list between - ;; column formulas and field formulas. - (dolist (eq eqlist) - (let* ((rhs (org-table-formula-substitute-names - (org-table-formula-handle-first/last-rc (cdr eq)))) - (old-lhs (car eq)) - (lhs - (org-table-formula-handle-first/last-rc - (cond - ((string-match "\\`@-?I+" old-lhs) - (user-error "Can't assign to hline relative reference")) - ((string-match "\\`$[<>]" old-lhs) - (let ((new (org-table-formula-handle-first/last-rc - old-lhs))) - (when (assoc new eqlist) - (user-error "\"%s=\" formula tries to overwrite \ + (org-table-with-shrunk-columns + (org-table-save-field + ;; Expand equations, then split the equation list between + ;; column formulas and field formulas. + (dolist (eq eqlist) + (let* ((rhs (org-table-formula-substitute-names + (org-table-formula-handle-first/last-rc (cdr eq)))) + (old-lhs (car eq)) + (lhs + (org-table-formula-handle-first/last-rc + (cond + ((string-match "\\`@-?I+" old-lhs) + (user-error "Can't assign to hline relative reference")) + ((string-match "\\`\\$[<>]" old-lhs) + (let ((new (org-table-formula-handle-first/last-rc + old-lhs))) + (when (assoc new eqlist) + (user-error "\"%s=\" formula tries to overwrite \ existing formula for column %s" - old-lhs - new)) - new)) - (t old-lhs))))) - (if (string-match-p "\\`\\$[0-9]+\\'" lhs) - (push (cons lhs rhs) eqlcol) - (push (cons lhs rhs) eqlfield)))) - (setq eqlcol (nreverse eqlcol)) - ;; Expand ranges in lhs of formulas - (setq eqlfield (org-table-expand-lhs-ranges (nreverse eqlfield))) - ;; Get the correct line range to process. - (if all - (progn - (setq end (copy-marker (org-table-end))) - (goto-char (setq beg org-table-current-begin-pos)) - (cond - ((re-search-forward org-table-calculate-mark-regexp end t) - ;; This is a table with marked lines, compute selected - ;; lines. - (setq line-re org-table-recalculate-regexp)) - ;; Move forward to the first non-header line. - ((and (re-search-forward org-table-dataline-regexp end t) - (re-search-forward org-table-hline-regexp end t) - (re-search-forward org-table-dataline-regexp end t)) - (setq beg (match-beginning 0))) - ;; Just leave BEG at the start of the table. - (t nil))) - (setq beg (line-beginning-position) - end (copy-marker (line-beginning-position 2)))) - (goto-char beg) - ;; Mark named fields untouchable. Also check if several - ;; field/range formulas try to set the same field. - (remove-text-properties beg end '(org-untouchable t)) - (let ((current-line (count-lines org-table-current-begin-pos - (line-beginning-position))) - seen-fields) - (dolist (eq eqlfield) - (let* ((name (car eq)) - (location (assoc name org-table-named-field-locations)) - (eq-line (or (nth 1 location) - (and (string-match "\\`@\\([0-9]+\\)" name) - (aref org-table-dlines - (string-to-number - (match-string 1 name)))))) - (reference - (if location - ;; Turn field coordinates associated to NAME - ;; into an absolute reference. - (format "@%d$%d" - (org-table-line-to-dline eq-line) - (nth 2 location)) - name))) - (when (member reference seen-fields) - (user-error "Several field/range formulas try to set %s" - reference)) - (push reference seen-fields) - (when (or all (eq eq-line current-line)) - (org-table-goto-field name) - (org-table-put-field-property :org-untouchable t))))) - ;; Evaluate the column formulas, but skip fields covered by - ;; field formulas. - (goto-char beg) - (while (re-search-forward line-re end t) - (unless (string-match "\\` *[_^!$/] *\\'" (org-table-get-field 1)) - ;; Unprotected line, recalculate. - (cl-incf cnt) - (when all - (setq log-last-time - (org-table-message-once-per-second - log-last-time - "Re-applying formulas to full table...(line %d)" cnt))) - (if (markerp org-last-recalc-line) - (move-marker org-last-recalc-line (line-beginning-position)) - (setq org-last-recalc-line - (copy-marker (line-beginning-position)))) - (dolist (entry eqlcol) - (goto-char org-last-recalc-line) - (org-table-goto-column - (string-to-number (substring (car entry) 1)) nil 'force) - (unless (get-text-property (point) :org-untouchable) - (org-table-eval-formula - nil (cdr entry) 'noalign 'nocst 'nostore 'noanalysis))))) - ;; Evaluate the field formulas. - (dolist (eq eqlfield) - (let ((reference (car eq)) - (formula (cdr eq))) - (setq log-last-time - (org-table-message-once-per-second - (and all log-last-time) - "Re-applying formula to field: %s" (car eq))) - (org-table-goto-field - reference - ;; Possibly create a new column, as long as - ;; `org-table-formula-create-columns' allows it. - (let ((column-count (progn (end-of-line) - (1- (org-table-current-column))))) - (lambda (column) - (when (> column 1000) - (user-error "Formula column target too large")) - (and (> column column-count) - (or (eq org-table-formula-create-columns t) - (and (eq org-table-formula-create-columns 'warn) - (progn - (org-display-warning - "Out-of-bounds formula added columns") - t)) - (and (eq org-table-formula-create-columns 'prompt) - (yes-or-no-p - "Out-of-bounds formula. Add columns? "))))))) - (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)) - (set-marker end nil) + old-lhs + new)) + new)) + (t old-lhs))))) + (if (string-match-p "\\`\\$[0-9]+\\'" lhs) + (push (cons lhs rhs) eqlcol) + (push (cons lhs rhs) eqlfield)))) + (setq eqlcol (nreverse eqlcol)) + ;; Expand ranges in lhs of formulas + (setq eqlfield (org-table-expand-lhs-ranges (nreverse eqlfield))) + ;; Get the correct line range to process. + (if all + (progn + (setq end (copy-marker (org-table-end))) + (goto-char (setq beg org-table-current-begin-pos)) + (cond + ((re-search-forward org-table-calculate-mark-regexp end t) + ;; This is a table with marked lines, compute selected + ;; lines. + (setq line-re org-table-recalculate-regexp)) + ;; Move forward to the first non-header line. + ((and (re-search-forward org-table-dataline-regexp end t) + (re-search-forward org-table-hline-regexp end t) + (re-search-forward org-table-dataline-regexp end t)) + (setq beg (match-beginning 0))) + ;; Just leave BEG at the start of the table. + (t nil))) + (setq beg (line-beginning-position) + end (copy-marker (line-beginning-position 2)))) + (goto-char beg) + ;; Mark named fields untouchable. Also check if several + ;; field/range formulas try to set the same field. + (remove-text-properties beg end '(:org-untouchable t)) + (let ((current-line (count-lines org-table-current-begin-pos + (line-beginning-position))) + seen-fields) + (dolist (eq eqlfield) + (let* ((name (car eq)) + (location (assoc name org-table-named-field-locations)) + (eq-line (or (nth 1 location) + (and (string-match "\\`@\\([0-9]+\\)" name) + (aref org-table-dlines + (string-to-number + (match-string 1 name)))))) + (reference + (if location + ;; Turn field coordinates associated to NAME + ;; into an absolute reference. + (format "@%d$%d" + (org-table-line-to-dline eq-line) + (nth 2 location)) + name))) + (when (member reference seen-fields) + (user-error "Several field/range formulas try to set %s" + reference)) + (push reference seen-fields) + (when (or all (eq eq-line current-line)) + (org-table-goto-field name) + (org-table-put-field-property :org-untouchable t))))) + ;; Evaluate the column formulas, but skip fields covered by + ;; field formulas. + (goto-char beg) + (while (re-search-forward line-re end t) + (unless (string-match "\\` *[_^!$/] *\\'" (org-table-get-field 1)) + ;; Unprotected line, recalculate. + (cl-incf cnt) + (when all + (setq log-last-time + (org-table-message-once-per-second + log-last-time + "Re-applying formulas to full table...(line %d)" cnt))) + (if (markerp org-last-recalc-line) + (move-marker org-last-recalc-line (line-beginning-position)) + (setq org-last-recalc-line + (copy-marker (line-beginning-position)))) + (dolist (entry eqlcol) + (goto-char org-last-recalc-line) + (org-table-goto-column + (string-to-number (substring (car entry) 1)) nil 'force) + (unless (get-text-property (point) :org-untouchable) + (org-table-eval-formula + nil (cdr entry) 'noalign 'nocst 'nostore 'noanalysis))))) + ;; Evaluate the field formulas. + (dolist (eq eqlfield) + (let ((reference (car eq)) + (formula (cdr eq))) + (setq log-last-time + (org-table-message-once-per-second + (and all log-last-time) + "Re-applying formula to field: %s" (car eq))) + (org-table-goto-field + reference + ;; Possibly create a new column, as long as + ;; `org-table-formula-create-columns' allows it. + (let ((column-count (progn (end-of-line) + (1- (org-table-current-column))))) + (lambda (column) + (when (> column 1000) + (user-error "Formula column target too large")) + (and (> column column-count) + (or (eq org-table-formula-create-columns t) + (and (eq org-table-formula-create-columns 'warn) + (progn + (org-display-warning + "Out-of-bounds formula added columns") + t)) + (and (eq org-table-formula-create-columns 'prompt) + (yes-or-no-p + "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 marker. + (set-marker end nil))) (unless noalign (when org-table-may-need-update (org-table-align)) (when all @@ -3625,7 +3660,8 @@ Parameters get priority." (setq startline (org-current-line)) (dolist (entry eql) (let* ((type (cond - ((string-match "\\`$\\([0-9]+\\|[<>]+\\)\\'" (car entry)) + ((string-match "\\`\\$\\([0-9]+\\|[<>]+\\)\\'" + (car entry)) 'column) ((equal (string-to-char (car entry)) ?@) 'field) (t 'named))) @@ -3790,6 +3826,396 @@ minutes or seconds." secs0))))) (if (< secs 0) (concat "-" res) res))) + + +;;; Columns shrinking + +(defun org-table--shrunk-field () + "Non-nil if current field is narrowed. +When non-nil, return the overlay narrowing the field." + (cl-some (lambda (o) + (and (eq 'table-column-hide (overlay-get o 'org-overlay-type)) + o)) + (overlays-at (save-excursion + (skip-chars-forward (if (org-at-table-hline-p) "^+|" + "^|") + (line-end-position)) + (1- (point)))))) + +(defun org-table--list-shrunk-columns () + "List currently shrunk columns in table at point." + (save-excursion + ;; We really check shrunk columns in current row only. It could + ;; be wrong if all rows do not contain the same number of columns + ;; (i.e. the table is not properly aligned). As a consequence, + ;; some columns may not be shrunk again upon aligning the table. + ;; + ;; For example, in the following table, cursor is on first row and + ;; "<>" indicates a shrunk column. + ;; + ;; | | + ;; | | <> | + ;; + ;; Aligning table from the first row will not shrink again the + ;; second row, which was not visible initially. + ;; + ;; However, fixing it requires to check every row, which may be + ;; slow on large tables. Moreover, the hindrance of this + ;; pathological case is very limited. + (beginning-of-line) + (search-forward "|") + (let ((separator (if (org-at-table-hline-p) "+" "|")) + (column 1) + (shrunk (and (org-table--shrunk-field) (list 1))) + (end (line-end-position))) + (while (search-forward separator end t) + (cl-incf column) + (when (org-table--shrunk-field) (push column shrunk))) + (nreverse shrunk)))) + +(defun org-table--make-shrinking-overlay (start end display field &optional pre) + "Create an overlay to shrink text between START and END. + +Use string DISPLAY instead of the real text between the two +buffer positions. FIELD is the real contents of the field, as +a string, or nil. It is meant to be displayed upon moving the +mouse onto the overlay. + +When optional argument PRE is non-nil, assume the overlay is +located at the beginning of the field, and prepend +`org-table-separator-space' to it. Otherwise, concatenate +`org-table-shrunk-column-indicator' at its end. + +Return the overlay." + (let ((show-before-edit + (lambda (o &rest _) + ;; Removing one overlay removes all other overlays in the + ;; same column. + (mapc #'delete-overlay + (cdr (overlay-get o 'org-table-column-overlays))))) + (o (make-overlay start end))) + (overlay-put o 'insert-behind-hooks (list show-before-edit)) + (overlay-put o 'insert-in-front-hooks (list show-before-edit)) + (overlay-put o 'modification-hooks (list show-before-edit)) + (overlay-put o 'org-overlay-type 'table-column-hide) + (when (stringp field) (overlay-put o 'help-echo field)) + ;; Make sure overlays stays on top of table coordinates overlays. + ;; See `org-table-overlay-coordinates'. + (overlay-put o 'priority 1) + (let ((d (if pre (concat org-table-separator-space display) + (concat display org-table-shrunk-column-indicator)))) + (org-overlay-display o d 'org-table t)) + o)) + +(defun org-table--shrink-field (width align start end contents) + "Shrink a table field to a specified width. + +WIDTH is an integer representing the number of characters to +display, in addition to `org-table-shrunk-column-indicator'. +ALIGN is the alignment of the current column, as either \"l\", +\"c\" or \"r\". START and END are, respectively, the beginning +and ending positions of the field. CONTENTS is its trimmed +contents, as a string, or `hline' for table rules. + +Real field is hidden under one or two overlays. They have the +following properties: + + `org-overlay-type' + + Set to `table-column-hide'. Used to identify overlays + responsible for shrinking columns in a table. + + `org-table-column-overlays' + + It is a list with the pattern (siblings . COLUMN-OVERLAYS) + where COLUMN-OVERLAYS is the list of all overlays hiding the + same column. + +Whenever the text behind or next to the overlay is modified, all +the overlays in the column are deleted, effectively displaying +the column again. + +Return a list of overlays hiding the field, or nil if field is +already hidden." + (cond + ((= start end) nil) ;no field to narrow + ((org-table--shrunk-field) nil) ;already shrunk + ((= 0 width) ;shrink to one character + (list (org-table--make-shrinking-overlay + start end "" (if (eq 'hline contents) "" contents)))) + ((eq contents 'hline) + (list (org-table--make-shrinking-overlay + start end (make-string (1+ width) ?-) ""))) + ((equal contents "") ;no contents to hide + (list + (let ((w (org-string-width (buffer-substring start end))) + ;; We really want WIDTH + 2 whitespace, to include blanks + ;; around fields. + (full (+ 2 width))) + (if (<= w full) + (org-table--make-shrinking-overlay + (1- end) end (make-string (- full w) ?\s) "") + (org-table--make-shrinking-overlay (- end (- w full) 1) end "" ""))))) + (t + ;; If the field is not empty, display exactly WIDTH characters. + ;; It can mean to partly hide the field, or extend it with virtual + ;; blanks. To that effect, we use one or two overlays. The + ;; first, optional, one may add or hide white spaces before the + ;; contents of the field. The other, mandatory, one cuts the + ;; field or displays white spaces at the end of the field. It + ;; also always displays `org-table-shrunk-column-indicator'. + (let* ((lead (org-with-point-at start (skip-chars-forward " "))) + (trail (org-with-point-at end (abs (skip-chars-backward " ")))) + (contents-width (org-string-width + (buffer-substring (+ start lead) (- end trail))))) + (cond + ;; Contents are too large to fit in WIDTH character. Limit, if + ;; possible, blanks at the beginning of the field to a single + ;; white space, and cut the field at an appropriate location. + ((<= width contents-width) + (let ((pre + (and (> lead 0) + (org-table--make-shrinking-overlay + start (+ start lead) "" contents t))) + (post + (org-table--make-shrinking-overlay + ;; Find cut location so that WIDTH characters are + ;; visible using dichotomy. + (let* ((begin (+ start lead)) + (lower begin) + (upper (1- end)) + ;; Compensate the absence of leading space, + ;; thus preserving alignment. + (width (if (= lead 0) (1+ width) width))) + (catch :exit + (while (> (- upper lower) 1) + (let ((mean (+ (ash lower -1) + (ash upper -1) + (logand lower upper 1)))) + (pcase (org-string-width (buffer-substring begin mean)) + ((pred (= width)) (throw :exit mean)) + ((pred (< width)) (setq upper mean)) + (_ (setq lower mean))))) + upper)) + end "" contents))) + (if pre (list pre post) (list post)))) + ;; Contents fit it WIDTH characters. First compute number of + ;; white spaces needed on each side of contents, then expand or + ;; compact blanks on each side of the field in order to + ;; preserve width and obey to alignment constraints. + (t + (let* ((required (- width contents-width)) + (before + (pcase align + ;; Compensate the absence of leading space, thus + ;; preserving alignment. + ((guard (= lead 0)) -1) + ("l" 0) + ("r" required) + ("c" (/ required 2)))) + (after (- required before)) + (pre + (pcase (1- lead) + ((or (guard (= lead 0)) (pred (= before))) nil) + ((pred (< before)) + (org-table--make-shrinking-overlay + start (+ start (- lead before)) "" contents t)) + (_ + (org-table--make-shrinking-overlay + start (1+ start) + (make-string (- before (1- lead)) ?\s) + contents t)))) + (post + (pcase (1- trail) + ((pred (= after)) + (org-table--make-shrinking-overlay (1- end) end "" contents)) + ((pred (< after)) + (org-table--make-shrinking-overlay + (+ after (- end trail)) end "" contents)) + (_ + (org-table--make-shrinking-overlay + (1- end) end + (make-string (- after (1- trail)) ?\s) + contents))))) + (if pre (list pre post) (list post))))))))) + +(defun org-table--read-column-selection (select max) + "Read column selection select as a list of numbers. + +SELECT is a string containing column ranges, separated by white +space characters, see `org-table-hide-column' for details. MAX +is the maximum column number. + +Return value is a sorted list of numbers. Ignore any number +outside of the [1;MAX] range." + (catch :all + (sort + (delete-dups + (cl-mapcan + (lambda (s) + (cond + ((member s '("-" "1-")) (throw :all (number-sequence 1 max))) + ((string-match-p "\\`[0-9]+\\'" s) + (let ((n (string-to-number s))) + (and (> n 0) (<= n max) (list n)))) + ((string-match "\\`\\([0-9]+\\)?-\\([0-9]+\\)?\\'" s) + (let ((n (match-string 1 s)) + (m (match-string 2 s))) + (number-sequence (if n (max 1 (string-to-number n)) + 1) + (if m (min max (string-to-number m)) + max)))) + (t nil))) ;invalid specification + (split-string select))) + #'<))) + +(defun org-table--shrink-columns (columns beg end) + "Shrink COLUMNS in a table. +COLUMNS is a sorted list of column numbers. BEG and END are, +respectively, the beginning position and the end position of the +table." + (org-with-wide-buffer + (org-font-lock-ensure beg end) + (dolist (c columns) + (goto-char beg) + (let ((align nil) + (width nil) + (fields nil)) + (while (< (point) end) + (catch :continue + (let* ((hline? (org-at-table-hline-p)) + (separator (if hline? "+" "|"))) + ;; Move to COLUMN. + (search-forward "|") + (or (= c 1) ;already there + (search-forward separator (line-end-position) t (1- c)) + (throw :continue nil)) ;skip invalid columns + ;; Extract boundaries and contents from current field. + ;; Also set the column's width if we encounter a width + ;; cookie for the first time. + (let* ((start (point)) + (end (progn + (skip-chars-forward (concat "^|" separator) + (line-end-position)) + (point))) + (contents (if hline? 'hline + (org-trim (buffer-substring start end))))) + (push (list start end contents) fields) + (when (and (not hline?) + (string-match "\\`<\\([lrc]\\)?\\([0-9]+\\)>\\'" + contents)) + (unless align (setq align (match-string 1 contents))) + (unless width + (setq width (string-to-number (match-string 2 contents)))))))) + (forward-line)) + ;; Link overlays for current field to the other overlays in the + ;; same column. + (let ((chain (list 'siblings))) + (dolist (field fields) + (dolist (new (apply #'org-table--shrink-field + (or width 0) (or align "l") field)) + (push new (cdr chain)) + (overlay-put new 'org-table-column-overlays chain)))))))) + +;;;###autoload +(defun org-table-toggle-column-width (&optional arg) + "Shrink or expand current column in an Org table. + +If a width cookie specifies a width W for the column, the first +W visible characters are displayed. Otherwise, the column is +shrunk to a single character. + +When point is before the first column or after the last one, ask +for the columns to shrink or expand, as a list of ranges. +A column range can be one of the following patterns: + + N column N only + N-M every column between N and M (both inclusive) + N- every column between N (inclusive) and the last column + -M every column between the first one and M (inclusive) + - every column + +When optional argument ARG is a string, use it as white space +separated list of column ranges. + +When called with `\\[universal-argument]' prefix, call \ +`org-table-shrink', i.e., +shrink columns with a width cookie and expand the others. + +When called with `\\[universal-argument] \\[universal-argument]' \ +prefix, expand all columns." + (interactive "P") + (unless (org-at-table-p) (user-error "Not in a table")) + (let* ((begin (org-table-begin)) + (end (org-table-end)) + ;; Compute an upper bound for the number of columns. + ;; Nonexistent columns are ignored anyway. + (max-columns (/ (- (line-end-position) (line-beginning-position)) 2)) + (shrunk (org-table--list-shrunk-columns)) + (columns + (pcase arg + (`nil + (if (save-excursion + (skip-chars-backward "^|" (line-beginning-position)) + (or (bolp) (looking-at-p "[ \t]*$"))) + ;; Point is either before first column or past last + ;; one. Ask for columns to operate on. + (org-table--read-column-selection + (read-string "Column ranges (e.g. 2-4 6-): ") + max-columns) + (list (org-table-current-column)))) + ((pred stringp) (org-table--read-column-selection arg max-columns)) + ((or `(4) `(16)) nil) + (_ (user-error "Invalid argument: %S" arg))))) + (pcase arg + (`(4) (org-table-shrink begin end)) + (`(16) (org-table-expand begin end)) + (_ + (org-table-expand begin end) + (org-table--shrink-columns + (cl-set-exclusive-or columns shrunk) begin end))))) + +;;;###autoload +(defun org-table-shrink (&optional begin end) + "Shrink all columns with a width cookie in the table at point. + +Columns without a width cookie are expanded. + +Optional arguments BEGIN and END, when non-nil, specify the +beginning and end position of the current table." + (interactive) + (unless (or begin (org-at-table-p)) (user-error "Not at a table")) + (org-with-wide-buffer + (let ((begin (or begin (org-table-begin))) + (end (or end (org-table-end))) + (regexp "|[ \t]*<[lrc]?[0-9]+>[ \t]*\\(|\\|$\\)") + (columns)) + (goto-char begin) + (while (re-search-forward regexp end t) + (goto-char (match-beginning 1)) + (cl-pushnew (org-table-current-column) columns)) + (org-table-expand begin end) + ;; Make sure invisible characters in the table are at the right + ;; place since column widths take them into account. + (org-font-lock-ensure begin end) + (org-table--shrink-columns (sort columns #'<) begin end)))) + +;;;###autoload +(defun org-table-expand (&optional begin end) + "Expand all columns in the table at point. +Optional arguments BEGIN and END, when non-nil, specify the +beginning and end position of the current table." + (interactive) + (unless (or begin (org-at-table-p)) (user-error "Not at a table")) + (org-with-wide-buffer + (let ((begin (or begin (org-table-begin))) + (end (or end (org-table-end)))) + (remove-overlays begin end 'org-overlay-type 'table-column-hide)))) + + + +;;; Formula editing + (defun org-table-fedit-convert-buffer (function) "Convert all references in this buffer, using FUNCTION." (let ((origin (copy-marker (line-beginning-position)))) @@ -4114,18 +4540,21 @@ When LOCAL is non-nil, show references for the table at point." (select-window win)))) (defun org-table-force-dataline () - "Make sure the cursor is in a dataline in a table." - (unless (save-excursion - (beginning-of-line 1) - (looking-at org-table-dataline-regexp)) + "Move point to the closest data line in a table. +Raise an error if the table contains no data line. Preserve +column when moving point." + (unless (org-match-line org-table-dataline-regexp) (let* ((re org-table-dataline-regexp) - (p1 (save-excursion (re-search-forward re nil 'move))) - (p2 (save-excursion (re-search-backward re nil 'move)))) + (column (current-column)) + (p1 (save-excursion (re-search-forward re (org-table-end) t))) + (p2 (save-excursion (re-search-backward re (org-table-begin) t)))) (cond ((and p1 p2) (goto-char (if (< (abs (- p1 (point))) (abs (- p2 (point)))) - p1 p2))) + p1 + p2))) ((or p1 p2) (goto-char (or p1 p2))) - (t (user-error "No table dataline around here")))))) + (t (user-error "No table data line around here"))) + (org-move-to-column column)))) (defun org-table-fedit-line-up () "Move cursor one line up in the window showing the table." @@ -4220,7 +4649,7 @@ FACE, when non-nil, for the highlight." (mapc 'delete-overlay org-table-coordinate-overlays) (setq org-table-coordinate-overlays nil) (save-excursion - (let ((id 0) (ih 0) hline eol s1 s2 str ic ov beg) + (let ((id 0) (ih 0) hline eol str ov) (goto-char (org-table-begin)) (while (org-at-table-p) (setq eol (point-at-eol)) @@ -4231,17 +4660,17 @@ FACE, when non-nil, for the highlight." (format "%4d" (setq id (1+ id))))) (org-overlay-before-string ov str 'org-special-keyword 'evaporate) (when hline - (setq ic 0) - (while (re-search-forward "[+|]\\(-+\\)" eol t) - (setq beg (1+ (match-beginning 0)) - ic (1+ ic) - s1 (concat "$" (int-to-string ic)) - s2 (org-number-to-letters ic) - str (if (eq org-table-use-standard-references t) s2 s1)) - (setq ov (make-overlay beg (+ beg (length str)))) - (push ov org-table-coordinate-overlays) - (org-overlay-display ov str 'org-special-keyword 'evaporate))) - (beginning-of-line 2))))) + (let ((ic 0)) + (while (re-search-forward "[+|]\\(-+\\)" eol t) + (cl-incf ic) + (let* ((beg (1+ (match-beginning 0))) + (s1 (format "$%d" ic)) + (s2 (org-number-to-letters ic)) + (str (if (eq t org-table-use-standard-references) s2 s1)) + (ov (make-overlay beg (+ beg (length str))))) + (push ov org-table-coordinate-overlays) + (org-overlay-display ov str 'org-special-keyword 'evaporate))))) + (forward-line))))) ;;;###autoload (defun org-table-toggle-coordinate-overlays () @@ -4250,8 +4679,8 @@ FACE, when non-nil, for the highlight." (setq org-table-overlay-coordinates (not org-table-overlay-coordinates)) (message "Tables Row/Column numbers display turned %s" (if org-table-overlay-coordinates "on" "off")) - (if (and (org-at-table-p) org-table-overlay-coordinates) - (org-table-align)) + (when (and (org-at-table-p) org-table-overlay-coordinates) + (org-table-align)) (unless org-table-overlay-coordinates (mapc 'delete-overlay org-table-coordinate-overlays) (setq org-table-coordinate-overlays nil))) @@ -4315,14 +4744,14 @@ FACE, when non-nil, for the highlight." ;;;###autoload (define-minor-mode orgtbl-mode - "The `org-mode' table editor as a minor mode for use in other modes." + "The Org mode table editor as a minor mode for use in other modes." :lighter " OrgTbl" :keymap orgtbl-mode-map (org-load-modules-maybe) (cond ((derived-mode-p 'org-mode) - ;; Exit without error, in case some hook functions calls this - ;; by accident in org-mode. - (message "Orgtbl-mode is not useful in org-mode, command ignored")) + ;; Exit without error, in case some hook functions calls this by + ;; accident in Org mode. + (message "Orgtbl mode is not useful in Org mode, command ignored")) (orgtbl-mode (and (orgtbl-setup) (defun orgtbl-setup () nil)) ;; FIXME: Yuck!?! ;; Make sure we are first in minor-mode-map-alist @@ -4340,15 +4769,12 @@ FACE, when non-nil, for the highlight." (concat orgtbl-line-start-regexp "\\|" auto-fill-inhibit-regexp) orgtbl-line-start-regexp)) - (add-to-invisibility-spec '(org-cwidth)) (when (fboundp 'font-lock-add-keywords) (font-lock-add-keywords nil orgtbl-extra-font-lock-keywords) (org-restart-font-lock)) (easy-menu-add orgtbl-mode-menu)) (t (setq auto-fill-inhibit-regexp org-old-auto-fill-inhibit-regexp) - (org-table-cleanup-narrow-column-properties) - (org-remove-from-invisibility-spec '(org-cwidth)) (remove-hook 'before-change-functions 'org-before-change-function t) (when (fboundp 'font-lock-remove-keywords) (font-lock-remove-keywords nil orgtbl-extra-font-lock-keywords) @@ -4356,19 +4782,6 @@ FACE, when non-nil, for the highlight." (easy-menu-remove orgtbl-mode-menu) (force-mode-line-update 'all)))) -(defun org-table-cleanup-narrow-column-properties () - "Remove all properties related to narrow-column invisibility." - (let ((s (point-min))) - (while (setq s (text-property-any s (point-max) - 'display org-narrow-column-arrow)) - (remove-text-properties s (1+ s) '(display t))) - (setq s (point-min)) - (while (setq s (text-property-any s (point-max) 'org-cwidth 1)) - (remove-text-properties s (1+ s) '(org-cwidth t))) - (setq s (point-min)) - (while (setq s (text-property-any s (point-max) 'invisible 'org-cwidth)) - (remove-text-properties s (1+ s) '(invisible t))))) - (defun orgtbl-make-binding (fun n &rest keys) "Create a function for binding in the table minor mode. FUN is the command to call inside a table. N is used to create a unique @@ -5419,7 +5832,7 @@ which will prompt for the width." ;; - orgtbl-uc-draw-cont (smooth unicode) ;; This is best viewed with the "DejaVu Sans Mono" font -;; (use M-x set-default-font). +;; (use M-x set-frame-font). (defun orgtbl-uc-draw-grid (value min max &optional width) "Draw a bar in a table using block unicode characters. @@ -5461,9 +5874,9 @@ list of the fields in the rectangle." org-table-current-line-types org-table-current-begin-pos org-table-dlines org-table-current-ncol - org-table-hlines org-table-last-alignment - org-table-last-column-widths org-table-last-alignment + org-table-hlines org-table-last-column-widths + org-table-last-alignment buffer loc) (setq form (org-table-convert-refs-to-rc form)) (org-with-wide-buffer diff --git a/elpa/org-20190930/org-tempo.el b/elpa/org-20190930/org-tempo.el new file mode 100644 index 00000000..78424b28 --- /dev/null +++ b/elpa/org-20190930/org-tempo.el @@ -0,0 +1,188 @@ +;;; org-tempo.el --- Template expansion for Org structures -*- lexical-binding: t; -*- + +;; Copyright (C) 2017-2019 Free Software Foundation, Inc. +;; +;; Author: Rasmus Pank Roulund +;; Keywords: outlines, hypermedia, calendar, wp +;; Homepage: http://orgmode.org +;; +;; This file is part of GNU Emacs. +;; +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . +;; +;;; Commentary: +;; +;; Org Tempo reimplements completions of structure template before +;; point like `org-try-structure-completion' in Org v9.1 and earlier. +;; For example, strings like " (length keys) (length (delete-dups keys))) + (warn + "Duplicated keys in `org-structure-template-alist' and `org-tempo-keywords-alist'")) + ;; Remove any keys already defined in case they have been updated. + (setq org-tempo-tags + (cl-remove-if (lambda (tag) (member (car tag) keys)) org-tempo-tags)) + (mapc #'org-tempo-add-block org-structure-template-alist) + (mapc #'org-tempo-add-keyword org-tempo-keywords-alist))) + +(defun org-tempo-add-block (entry) + "Add block entry from `org-structure-template-alist'." + (let* ((key (format "<%s" (car entry))) + (name (cdr entry)) + (special (member name '("src" "export")))) + (tempo-define-template (format "org-%s" (replace-regexp-in-string " " "-" name)) + `(,(format "#+begin_%s%s" name (if special " " "")) + ,(when special 'p) '> n '> ,(unless special 'p) n + ,(format "#+end_%s" (car (split-string name " "))) + >) + key + (format "Insert a %s block" name) + 'org-tempo-tags))) + +(defun org-tempo-add-keyword (entry) + "Add keyword entry from `org-tempo-keywords-alist'." + (let* ((key (format "<%s" (car entry))) + (name (cdr entry))) + (tempo-define-template (format "org-%s" (replace-regexp-in-string " " "-" name)) + `(,(format "#+%s: " name) p '>) + key + (format "Insert a %s keyword" name) + 'org-tempo-tags))) + +(defun org-tempo-complete-tag (&rest _) + "Look for a tag and expand it silently. +Unlike to `tempo-complete-tag', do not give a signal if a partial +completion or no match at all is found. Return nil if expansion +didn't succeed." + (org-tempo--update-maybe) + ;; `tempo-complete-tag' returns its SILENT argument when there is no + ;; completion available at all. + (not (eq 'fail (tempo-complete-tag 'fail)))) + + +;;; Additional keywords + +(defun org-tempo--include-file () + "Add #+include: and a file name." + (let ((inhibit-quit t)) + (unless (with-local-quit + (prog1 t + (insert + (format "#+include: %S " + (file-relative-name + (read-file-name "Include file: ")))))) + (insert ") + " ;; Keywords: outlines, hypermedia, calendar, wp -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; ;; This file is part of GNU Emacs. ;; @@ -139,12 +139,7 @@ the region 0:00:00." (format "Restart timer with offset [%s]: " def))) (unless (string-match "\\S-" s) (setq s def)) (setq delta (org-timer-hms-to-secs (org-timer-fix-incomplete s))))) - (setq org-timer-start-time - (seconds-to-time - ;; Pass `current-time' result to `float-time' (instead - ;; of calling without arguments) so that only - ;; `current-time' has to be overridden in tests. - (- (float-time (current-time)) delta)))) + (setq org-timer-start-time (org-time-since delta))) (setq org-timer-pause-time nil) (org-timer-set-mode-line 'on) (message "Timer start time set to %s, current value is %s" @@ -152,6 +147,7 @@ the region 0:00:00." (org-timer-secs-to-hms (or delta 0))) (run-hooks 'org-timer-start-hook))))) +;;;###autoload (defun org-timer-pause-or-continue (&optional stop) "Pause or continue the relative or countdown timer. With prefix arg STOP, stop it entirely." @@ -167,14 +163,9 @@ With prefix arg STOP, stop it entirely." (setq org-timer-countdown-timer (org-timer--run-countdown-timer new-secs org-timer-countdown-timer-title)) - (setq org-timer-start-time - (time-add (current-time) (seconds-to-time new-secs)))) + (setq org-timer-start-time (org-time-add nil new-secs))) (setq org-timer-start-time - ;; Pass `current-time' result to `float-time' (instead - ;; of calling without arguments) so that only - ;; `current-time' has to be overridden in tests. - (seconds-to-time (- (float-time (current-time)) - (- pause-secs start-secs))))) + (org-time-since (- pause-secs start-secs)))) (setq org-timer-pause-time nil) (org-timer-set-mode-line 'on) (run-hooks 'org-timer-continue-hook) @@ -189,6 +180,7 @@ With prefix arg STOP, stop it entirely." (org-timer-set-mode-line 'paused) (message "Timer paused at %s" (org-timer-value-string))))) +;;;###autoload (defun org-timer-stop () "Stop the relative or countdown timer." (interactive) @@ -227,20 +219,12 @@ it in the buffer." (insert (org-timer-value-string))))) (defun org-timer-value-string () - "Set the timer string." + "Return current timer string." (format org-timer-format (org-timer-secs-to-hms - (abs (floor (org-timer-seconds)))))) - -(defun org-timer-seconds () - ;; Pass `current-time' result to `float-time' (instead of calling - ;; without arguments) so that only `current-time' has to be - ;; overridden in tests. - (if org-timer-countdown-timer - (- (float-time org-timer-start-time) - (float-time (or org-timer-pause-time (current-time)))) - (- (float-time (or org-timer-pause-time (current-time))) - (float-time org-timer-start-time)))) + (let ((time (- (float-time org-timer-pause-time) + (float-time org-timer-start-time)))) + (abs (floor (if org-timer-countdown-timer (- time) time))))))) ;;;###autoload (defun org-timer-change-times-in-region (beg end delta) @@ -395,16 +379,15 @@ VALUE can be `on', `off', or `paused'." (defun org-timer-show-remaining-time () "Display the remaining time before the timer ends." (interactive) - (require 'time) - (if (not org-timer-countdown-timer) - (message "No timer set") - (let* ((rtime (decode-time - (time-subtract (timer--time org-timer-countdown-timer) - (current-time)))) - (rsecs (nth 0 rtime)) - (rmins (nth 1 rtime))) - (message "%d minute(s) %d seconds left before next time out" - rmins rsecs)))) + (message + (if (not org-timer-countdown-timer) + "No timer set" + (format-seconds + "%m minute(s) %s seconds left before next time out" + ;; Note: Once our minimal require is Emacs 27, we can drop this + ;; org-time-convert-to-integer call. + (org-time-convert-to-integer + (org-time-subtract (timer--time org-timer-countdown-timer) nil)))))) ;;;###autoload (defun org-timer-set-timer (&optional opt) @@ -463,8 +446,7 @@ using three `C-u' prefix arguments." (org-timer--run-countdown-timer secs org-timer-countdown-timer-title)) (run-hooks 'org-timer-set-hook) - (setq org-timer-start-time - (time-add (current-time) (seconds-to-time secs))) + (setq org-timer-start-time (org-time-add nil secs)) (setq org-timer-pause-time nil) (org-timer-set-mode-line 'on)))))) diff --git a/elpa/org-20171030/org-version.el b/elpa/org-20190930/org-version.el similarity index 83% rename from elpa/org-20171030/org-version.el rename to elpa/org-20190930/org-version.el index 84c6603d..a6256e32 100644 --- a/elpa/org-20171030/org-version.el +++ b/elpa/org-20190930/org-version.el @@ -5,13 +5,13 @@ (defun org-release () "The release version of Org. Inserted by installing Org mode or when a release is made." - (let ((org-release "9.1.2")) + (let ((org-release "9.2.6")) org-release)) ;;;###autoload (defun org-git-version () - "The Git version of org-mode. + "The Git version of Org mode. Inserted by installing Org or when a release is made." - (let ((org-git-version "9.1.2-25-g2567fe-elpa")) + (let ((org-git-version "9.2.6-4-ge30905-elpa")) org-git-version)) ;;;###autoload (defvar org-odt-data-dir "/usr/share/emacs/etc/org" diff --git a/elpa/org-20171030/org-w3m.el b/elpa/org-20190930/org-w3m.el similarity index 83% rename from elpa/org-20171030/org-w3m.el rename to elpa/org-20190930/org-w3m.el index f396814d..7db34738 100644 --- a/elpa/org-20171030/org-w3m.el +++ b/elpa/org-20190930/org-w3m.el @@ -1,10 +1,10 @@ ;;; org-w3m.el --- Support from Copy and Paste From w3m -*- lexical-binding: t; -*- -;; Copyright (C) 2008-2017 Free Software Foundation, Inc. +;; Copyright (C) 2008-2019 Free Software Foundation, Inc. ;; Author: Andy Stewart ;; Keywords: outlines, hypermedia, calendar, wp -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; ;; This file is part of GNU Emacs. ;; @@ -57,7 +57,7 @@ :description (or w3m-current-title w3m-current-url)))) (defun org-w3m-copy-for-org-mode () - "Copy current buffer content or active region with `org-mode' style links. + "Copy current buffer content or active region with Org style links. This will encode `link-title' and `link-location' with `org-make-link-string', and insert the transformed test into the kill ring, so that it can be yanked into an Org buffer with links working correctly." @@ -72,40 +72,41 @@ so that it can be yanked into an Org buffer with links working correctly." (setq transform-start (region-beginning)) (setq transform-end (region-end)) ;; Deactivate mark if current mark is activate. - (if (fboundp 'deactivate-mark) (deactivate-mark))) + (when (fboundp 'deactivate-mark) (deactivate-mark))) (message "Transforming links...") (save-excursion (goto-char transform-start) - (while (and (not out-bound) ; still inside region to copy + (while (and (not out-bound) ; still inside region to copy (not (org-w3m-no-next-link-p))) ; no next link current buffer ;; store current point before jump next anchor (setq temp-position (point)) ;; move to next anchor when current point is not at anchor (or (get-text-property (point) 'w3m-href-anchor) (org-w3m-get-next-link-start)) - (if (<= (point) transform-end) ; if point is inside transform bound + (if (<= (point) transform-end) ; if point is inside transform bound (progn ;; get content between two links. - (if (> (point) temp-position) - (setq return-content (concat return-content - (buffer-substring - temp-position (point))))) + (when (> (point) temp-position) + (setq return-content (concat return-content + (buffer-substring + temp-position (point))))) ;; get link location at current point. (setq link-location (get-text-property (point) 'w3m-href-anchor)) ;; get link title at current point. (setq link-title (buffer-substring (point) (org-w3m-get-anchor-end))) - ;; concat `org-mode' style url to `return-content'. - (setq return-content (concat return-content - (org-make-link-string - link-location link-title)))) - (goto-char temp-position) ; reset point before jump next anchor - (setq out-bound t) ; for break out `while' loop - )) + ;; concat Org style url to `return-content'. + (setq return-content + (concat return-content + (if (org-string-nw-p link-location) + (org-make-link-string link-location link-title) + link-title)))) + (goto-char temp-position) ; reset point before jump next anchor + (setq out-bound t))) ; for break out `while' loop ;; add the rest until end of the region to be copied - (if (< (point) transform-end) - (setq return-content - (concat return-content - (buffer-substring (point) transform-end)))) + (when (< (point) transform-end) + (setq return-content + (concat return-content + (buffer-substring (point) transform-end)))) (org-kill-new return-content) (message "Transforming links...done, use C-y to insert text into Org file") (message "Copy with link transformation complete.")))) diff --git a/elpa/org-20171030/org.el b/elpa/org-20190930/org.el similarity index 84% rename from elpa/org-20171030/org.el rename to elpa/org-20190930/org.el index 5da51ce3..2cea47d0 100644 --- a/elpa/org-20171030/org.el +++ b/elpa/org-20190930/org.el @@ -1,12 +1,12 @@ ;;; org.el --- Outline-based notes management and organizer -*- lexical-binding: t; -*- ;; Carstens outline-mode for keeping track of everything. -;; Copyright (C) 2004-2017 Free Software Foundation, Inc. +;; Copyright (C) 2004-2019 Free Software Foundation, Inc. ;; ;; Author: Carsten Dominik -;; Maintainer: Carsten Dominik ;; Keywords: outlines, hypermedia, calendar, wp -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org +;; Version: 9.2.6 ;; ;; This file is part of GNU Emacs. ;; @@ -48,7 +48,7 @@ ;; --------------------------- ;; See the corresponding sections in the manual at ;; -;; http://orgmode.org/org.html#Installation +;; https://orgmode.org/org.html#Installation ;; ;; Documentation ;; ------------- @@ -59,13 +59,14 @@ ;; in the doc/ directory. ;; ;; A list of recent changes can be found at -;; http://orgmode.org/Changes.html +;; https://orgmode.org/Changes.html ;; ;;; Code: (defvar org-inhibit-highlight-removal nil) ; dynamically scoped param (defvar-local org-table-formula-constants-local nil "Local version of `org-table-formula-constants'.") +(defvar org-inlinetask-min-level) ;;;; Require other packages @@ -88,16 +89,11 @@ (message "You need to run \"make\" or \"make autoloads\" from Org lisp directory") (sit-for 3)))) -(require 'org-macs) +(eval-and-compile (require 'org-macs)) (require 'org-compat) ;; `org-outline-regexp' ought to be a defconst but is let-bound in ;; some places -- e.g. see the macro `org-with-limited-levels'. -;; -;; In Org buffers, the value of `outline-regexp' is that of -;; `org-outline-regexp'. The only function still directly relying on -;; `outline-regexp' is `org-overview' so that `org-cycle' can do its -;; job when `orgstruct-mode' is active. (defvar org-outline-regexp "\\*+ " "Regexp to match Org headlines.") @@ -112,17 +108,31 @@ Stars are put in group 1 and the trimmed body in group 2.") (declare-function calendar-check-holidays "holidays" (date)) (declare-function cdlatex-environment "ext:cdlatex" (environment item)) +(declare-function cdlatex-math-symbol "ext:cdlatex") +(declare-function Info-goto-node "info" (nodename &optional fork strict-case)) (declare-function isearch-no-upper-case-p "isearch" (string regexp-flag)) (declare-function org-add-archive-files "org-archive" (files)) (declare-function org-agenda-entry-get-agenda-timestamp "org-agenda" (pom)) (declare-function org-agenda-list "org-agenda" (&optional arg start-day span with-hour)) (declare-function org-agenda-redo "org-agenda" (&optional all)) +(declare-function org-agenda-remove-restriction-lock "org-agenda" (&optional noupdate)) +(declare-function org-archive-subtree "org-archive" (&optional find-done)) +(declare-function org-archive-subtree-default "org-archive" ()) +(declare-function org-archive-to-archive-sibling "org-archive" ()) +(declare-function org-attach "org-attach" ()) (declare-function org-babel-do-in-edit-buffer "ob-core" (&rest body) t) (declare-function org-babel-tangle-file "ob-tangle" (file &optional target-file lang)) (declare-function org-beamer-mode "ox-beamer" (&optional prefix) t) +(declare-function org-clock-cancel "org-clock" ()) +(declare-function org-clock-display "org-clock" (&optional arg)) (declare-function org-clock-get-last-clock-out-time "org-clock" ()) +(declare-function org-clock-goto "org-clock" (&optional select)) +(declare-function org-clock-in "org-clock" (&optional select start-time)) +(declare-function org-clock-in-last "org-clock" (&optional arg)) (declare-function org-clock-out "org-clock" (&optional switch-to-state fail-quietly at-time)) +(declare-function org-clock-out-if-current "org-clock" ()) (declare-function org-clock-remove-overlays "org-clock" (&optional beg end noremove)) +(declare-function org-clock-report "org-clock" (&optional arg)) (declare-function org-clock-sum "org-clock" (&optional tstart tend headline-filter propname)) (declare-function org-clock-sum-current-item "org-clock" (&optional tstart)) (declare-function org-clock-timestamps-down "org-clock" (&optional n)) @@ -130,14 +140,15 @@ Stars are put in group 1 and the trimmed body in group 2.") (declare-function org-clock-update-time-maybe "org-clock" ()) (declare-function org-clocking-buffer "org-clock" ()) (declare-function org-clocktable-shift "org-clock" (dir n)) -(declare-function - org-duration-from-minutes "org-duration" (minutes &optional fmt canonical)) +(declare-function org-columns-insert-dblock "org-colview" ()) +(declare-function org-duration-from-minutes "org-duration" (minutes &optional fmt canonical)) (declare-function org-element-at-point "org-element" ()) (declare-function org-element-cache-refresh "org-element" (pos)) (declare-function org-element-cache-reset "org-element" (&optional all)) (declare-function org-element-contents "org-element" (element)) (declare-function org-element-context "org-element" (&optional element)) (declare-function org-element-copy "org-element" (datum)) +(declare-function org-element-create "org-element" (type &optional props &rest children)) (declare-function org-element-interpret-data "org-element" (data)) (declare-function org-element-lineage "org-element" (blob &optional types with-self)) (declare-function org-element-link-parser "org-element" ()) @@ -146,24 +157,42 @@ Stars are put in group 1 and the trimmed body in group 2.") (declare-function org-element-property "org-element" (property element)) (declare-function org-element-put-property "org-element" (element property value)) (declare-function org-element-swap-A-B "org-element" (elem-a elem-b)) +(declare-function org-element-timestamp-parser "org-element" ()) (declare-function org-element-type "org-element" (element)) (declare-function org-element-update-syntax "org-element" ()) +(declare-function org-export-dispatch "ox" (&optional arg)) +(declare-function org-export-get-backend "ox" (name)) +(declare-function org-export-get-backend "ox" (name)) +(declare-function org-export-get-environment "ox" (&optional backend subtreep ext-plist)) +(declare-function org-export-get-environment "ox" (&optional backend subtreep ext-plist)) +(declare-function org-feed-goto-inbox "org-feed" (feed)) +(declare-function org-feed-update-all "org-feed" ()) +(declare-function org-goto "org-goto" (&optional alternative-interface)) +(declare-function org-goto "org-goto" (&optional alternative-interface)) (declare-function org-id-find-id-file "org-id" (id)) (declare-function org-id-get-create "org-id" (&optional force)) (declare-function org-inlinetask-at-task-p "org-inlinetask" ()) (declare-function org-inlinetask-outline-regexp "org-inlinetask" ()) (declare-function org-inlinetask-toggle-visibility "org-inlinetask" ()) +(declare-function org-latex-make-preamble "ox-latex" (info &optional template snippet?)) +(declare-function org-latex-make-preamble "ox-latex" (info &optional template snippet?)) (declare-function org-plot/gnuplot "org-plot" (&optional params)) +(declare-function org-table--shrunk-field "org-table" ()) ;; For `org-table-with-shrunk-field'. (declare-function org-table-align "org-table" ()) (declare-function org-table-begin "org-table" (&optional table-type)) (declare-function org-table-beginning-of-field "org-table" (&optional n)) (declare-function org-table-blank-field "org-table" ()) (declare-function org-table-calc-current-TBLFM "org-table" (&optional arg)) +(declare-function org-table-copy-down "org-table" (N)) (declare-function org-table-copy-region "org-table" (beg end &optional cut)) +(declare-function org-table-create-or-convert-from-region "org-table" (arg)) +(declare-function org-table-create-with-table.el "org-table" ()) (declare-function org-table-cut-region "org-table" (beg end)) (declare-function org-table-edit-field "org-table" (arg)) (declare-function org-table-end "org-table" (&optional table-type)) (declare-function org-table-end-of-field "org-table" (&optional n)) +(declare-function org-table-eval-formula "org-table" (&optional arg equation suppress-align suppress-const suppress-store suppress-analysis)) +(declare-function org-table-field-info "org-table" (arg)) (declare-function org-table-insert-row "org-table" (&optional arg)) (declare-function org-table-justify-field-maybe "org-table" (&optional new)) (declare-function org-table-maybe-eval-formula "org-table" ()) @@ -171,34 +200,30 @@ Stars are put in group 1 and the trimmed body in group 2.") (declare-function org-table-next-row "org-table" ()) (declare-function org-table-paste-rectangle "org-table" ()) (declare-function org-table-recalculate "org-table" (&optional all noalign)) -(declare-function - org-table-sort-lines "org-table" - (&optional with-case sorting-type getkey-func compare-func interactive?)) +(declare-function org-table-rotate-recalc-marks "org-table" (&optional newchar)) +(declare-function org-table-shrink "org-table" (&optional begin end)) +(declare-function org-table-sort-lines "org-table" (&optional with-case sorting-type getkey-func compare-func interactive?)) +(declare-function org-table-sum "org-table" (&optional beg end nlast)) +(declare-function org-table-toggle-column-width "org-table" (&optional arg)) +(declare-function org-table-toggle-coordinate-overlays "org-table" ()) +(declare-function org-table-toggle-formula-debugger "org-table" ()) (declare-function org-table-wrap-region "org-table" (arg)) (declare-function org-tags-view "org-agenda" (&optional todo-only match)) +(declare-function org-timer "org-timer" (&optional restart no-insert)) +(declare-function org-timer-item "org-timer" (&optional arg)) +(declare-function org-timer-pause-or-continue "org-timer" (&optional stop)) +(declare-function org-timer-pause-or-continue "org-timer" (&optional stop)) +(declare-function org-timer-set-timer "org-timer" (&optional opt)) +(declare-function org-timer-start "org-timer" (&optional offset)) +(declare-function org-timer-stop "org-timer" ()) +(declare-function org-timer-stop "org-timer" ()) +(declare-function org-toggle-archive-tag "org-archive" (&optional find-done)) (declare-function orgtbl-ascii-plot "org-table" (&optional ask)) (declare-function orgtbl-mode "org-table" (&optional arg)) -(declare-function org-export-get-backend "ox" (name)) -(declare-function org-export-get-environment "ox" (&optional backend subtreep ext-plist)) -(declare-function org-latex-make-preamble "ox-latex" (info &optional template snippet?)) - -(defvar ffap-url-regexp) ;Silence byte-compiler -(defsubst org-uniquify (list) - "Non-destructively remove duplicate elements from LIST." - (let ((res (copy-sequence list))) (delete-dups res))) - -(defsubst org-get-at-bol (property) - "Get text property PROPERTY at the beginning of line." - (get-text-property (point-at-bol) property)) - -(defsubst org-trim (s &optional keep-lead) - "Remove whitespace at the beginning and the end of string S. -When optional argument KEEP-LEAD is non-nil, removing blank lines -at the beginning of the string does not affect leading indentation." - (replace-regexp-in-string - (if keep-lead "\\`\\([ \t]*\n\\)+" "\\`[ \t\n\r]+") "" - (replace-regexp-in-string "[ \t\n\r]+\\'" "" s))) +(defvar ffap-url-regexp) +(defvar org-element-paragraph-separate) +(defvar org-indent-indentation-per-level) ;; load languages based on value of `org-babel-load-languages' (defvar org-babel-load-languages) @@ -211,10 +236,10 @@ at the beginning of the string does not affect leading indentation." (let ((active (cdr pair)) (lang (symbol-name (car pair)))) (if active (require (intern (concat "ob-" lang))) - (funcall 'fmakunbound - (intern (concat "org-babel-execute:" lang))) - (funcall 'fmakunbound - (intern (concat "org-babel-expand-body:" lang))))))) + (fmakunbound + (intern (concat "org-babel-execute:" lang))) + (fmakunbound + (intern (concat "org-babel-expand-body:" lang))))))) (declare-function org-babel-tangle-file "ob-tangle" (file &optional target-file lang)) ;;;###autoload @@ -227,9 +252,10 @@ file to byte-code before it is loaded." (interactive "fFile to load: \nP") (let* ((age (lambda (file) (float-time - (time-subtract (current-time) - (nth 5 (or (file-attributes (file-truename file)) - (file-attributes file))))))) + (time-since + (file-attribute-modification-time + (or (file-attributes (file-truename file)) + (file-attributes file))))))) (base-name (file-name-sans-extension file)) (exported-file (concat base-name ".el"))) ;; tangle if the Org file is newer than the elisp file @@ -248,15 +274,19 @@ file to byte-code before it is loaded." (defcustom org-babel-load-languages '((emacs-lisp . t)) "Languages which can be evaluated in Org buffers. +\\ This list can be used to load support for any of the languages -below, note that each language will depend on a different set of -system executables and/or Emacs modes. When a language is -\"loaded\", then code blocks in that language can be evaluated -with `org-babel-execute-src-block' bound by default to C-c -C-c (note the `org-babel-no-eval-on-ctrl-c-ctrl-c' variable can -be set to remove code block evaluation from the C-c C-c -keybinding. By default only Emacs Lisp (which has no -requirements) is loaded." +below. Each language will depend on a different set of system +executables and/or Emacs modes. + +When a language is \"loaded\", code blocks in that language can +be evaluated with `org-babel-execute-src-block', which is bound +by default to \\[org-ctrl-c-ctrl-c]. + +The `org-babel-no-eval-on-ctrl-c-ctrl-c' option can be set to +remove code block evaluation from \\[org-ctrl-c-ctrl-c]. By +default, only Emacs Lisp is loaded, since it has no specific +requirement." :group 'org-babel :set 'org-babel-do-load-languages :version "24.1" @@ -427,7 +457,7 @@ Matched keyword is in group 1.") (defconst org-deadline-time-hour-regexp (concat "\\<" org-deadline-string - " *<\\([^>]+[0-9]\\{1,2\\}:[0-9]\\{2\\}[0-9-+:hdwmy \t.]*\\)>") + " *<\\([^>]+[0-9]\\{1,2\\}:[0-9]\\{2\\}[0-9+:hdwmy \t.-]*\\)>") "Matches the DEADLINE keyword together with a time-and-hour stamp.") (defconst org-deadline-line-regexp @@ -443,7 +473,7 @@ Matched keyword is in group 1.") (defconst org-scheduled-time-hour-regexp (concat "\\<" org-scheduled-string - " *<\\([^>]+[0-9]\\{1,2\\}:[0-9]\\{2\\}[0-9-+:hdwmy \t.]*\\)>") + " *<\\([^>]+[0-9]\\{1,2\\}:[0-9]\\{2\\}[0-9+:hdwmy \t.-]*\\)>") "Matches the SCHEDULED keyword together with a time-and-hour stamp.") (defconst org-closed-time-regexp @@ -535,6 +565,20 @@ but the stars and the body are.") An archived subtree does not open during visibility cycling, and does not contribute to the agenda listings.") +(defconst org-tag-re "[[:alnum:]_@#%]+" + "Regexp matching a single tag.") + +(defconst org-tag-group-re "[ \t]+\\(:\\([[:alnum:]_@#%:]+\\):\\)[ \t]*$" + "Regexp matching the tag group at the end of a line, with leading spaces. +Tags are stored in match group 1. Match group 2 stores the tags +without the enclosing colons.") + +(defconst org-tag-line-re + "^\\*+ \\(?:.*[ \t]\\)?\\(:\\([[:alnum:]_@#%:]+\\):\\)[ \t]*$" + "Regexp matching tags in a headline. +Tags are stored in match group 1. Match group 2 stores the tags +without the enclosing colons.") + (eval-and-compile (defconst org-comment-string "COMMENT" "Entries starting with this keyword will never be exported. @@ -631,7 +675,8 @@ on a string that terminates immediately after the date.") The time stamps may be either active or inactive.") (defconst org-repeat-re - "<[0-9]\\{4\\}-[0-9][0-9]-[0-9][0-9] [^>\n]*?\\([.+]?\\+[0-9]+[hdwmy]\\(/[0-9]+[hdwmy]\\)?\\)" + "<[0-9]\\{4\\}-[0-9][0-9]-[0-9][0-9] [^>\n]*?\ +\\([.+]?\\+[0-9]+[hdwmy]\\(/[0-9]+[hdwmy]\\)?\\)" "Regular expression for specifying repeated events. After a match, group 1 contains the repeat expression.") @@ -682,7 +727,7 @@ After a match, group 1 contains the repeat expression.") (org-load-modules-maybe 'force) (org-element-cache-reset 'all))) -(defcustom org-modules '(org-w3m org-bbdb org-bibtex org-docview org-gnus org-info org-irc org-mhe org-rmail) +(defcustom org-modules '(org-w3m org-bbdb org-bibtex org-docview org-gnus org-info org-irc org-mhe org-rmail org-eww) "Modules that should always be loaded together with org.el. If a description starts with , the file is not part of Emacs @@ -699,8 +744,8 @@ to add the symbol `xyz', and the package must have a call to: For export specific modules, see also `org-export-backends'." :group 'org :set 'org-set-modules - :version "24.4" - :package-version '(Org . "8.0") + :version "26.1" + :package-version '(Org . "9.2") :type '(set :greedy t (const :tag " bbdb: Links to BBDB entries" org-bbdb) @@ -719,7 +764,9 @@ For export specific modules, see also `org-export-backends'." (const :tag " mouse: Additional mouse support" org-mouse) (const :tag " protocol: Intercept calls from emacsclient" org-protocol) (const :tag " rmail: Links to RMAIL folders/messages" org-rmail) + (const :tag " tempo: Fast completion for structures" org-tempo) (const :tag " w3m: Special cut/paste from w3m to Org mode." org-w3m) + (const :tag " eshell: Support for links to working directories in eshell" org-eshell) (const :tag "C annotate-file: Annotate a file with org syntax" org-annotate-file) (const :tag "C bookmark: Org links to bookmarks" org-bookmark) @@ -729,26 +776,25 @@ For export specific modules, see also `org-export-backends'." (const :tag "C depend: TODO dependencies for Org mode\n\t\t\t(PARTIALLY OBSOLETE, see built-in dependency support))" org-depend) (const :tag "C drill: Flashcards and spaced repetition for Org mode" org-drill) (const :tag "C elisp-symbol: Org links to emacs-lisp symbols" org-elisp-symbol) - (const :tag "C eshell Support for links to working directories in eshell" org-eshell) (const :tag "C eval-light: Evaluate inbuffer-code on demand" org-eval-light) (const :tag "C eval: Include command output as text" org-eval) (const :tag "C expiry: Expiry mechanism for Org entries" org-expiry) - (const :tag "C favtable: Lookup table of favorite references and links" org-favtable) (const :tag "C git-link: Provide org links to specific file version" org-git-link) (const :tag "C interactive-query: Interactive modification of tags query\n\t\t\t(PARTIALLY OBSOLETE, see secondary filtering)" org-interactive-query) (const :tag "C invoice: Help manage client invoices in Org mode" org-invoice) (const :tag "C learn: SuperMemo's incremental learning algorithm" org-learn) - (const :tag "C mac-iCal Imports events from iCal.app to the Emacs diary" org-mac-iCal) + (const :tag "C mac-iCal: Imports events from iCal.app to the Emacs diary" org-mac-iCal) (const :tag "C mac-link: Grab links and url from various mac Applications" org-mac-link) (const :tag "C mairix: Hook mairix search into Org for different MUAs" org-mairix) (const :tag "C man: Support for links to manpages in Org mode" org-man) (const :tag "C mew: Links to Mew folders/messages" org-mew) - (const :tag "C mtags: Support for muse-like tags" org-mtags) + (const :tag "C notify: Notifications for Org-mode" org-notify) (const :tag "C notmuch: Provide org links to notmuch searches or messages" org-notmuch) (const :tag "C panel: Simple routines for us with bad memory" org-panel) (const :tag "C registry: A registry for Org links" org-registry) (const :tag "C screen: Visit screen sessions through Org links" org-screen) - (const :tag "C secretary: Team management with org-mode" org-secretary) + (const :tag "C screenshot: Take and manage screenshots in Org-mode files" org-screenshot) + (const :tag "C secretary: Team management with Org" org-secretary) (const :tag "C sqlinsert: Convert Org tables to SQL insertions" orgtbl-sqlinsert) (const :tag "C toc: Table of contents for Org buffer" org-toc) (const :tag "C track: Keep up with Org mode development" org-track) @@ -860,8 +906,7 @@ depends on, if any." (defcustom org-support-shift-select nil "Non-nil means make shift-cursor commands select text when possible. -\\\ - +\\ In Emacs 23, when `shift-select-mode' is on, shifted cursor keys start selecting a region, or enlarge regions started in this way. In Org mode, in special contexts, these same keys are used for @@ -918,7 +963,8 @@ matching headlines within the active region. Such string must be a tags/property/todo match as it is used in the agenda tags view. The list of commands is: `org-schedule', `org-deadline', -`org-todo', `org-archive-subtree', `org-archive-set-tag' and +`org-todo', `org-set-tags-command', `org-archive-subtree', +`org-archive-set-tag', `org-toggle-archive-tag' and `org-archive-to-archive-sibling'. The archiving commands skip already archived entries." :type '(choice (const :tag "Don't loop" nil) @@ -929,11 +975,6 @@ already archived entries." :group 'org-todo :group 'org-archive) -(defgroup org-startup nil - "Options concerning startup of Org mode." - :tag "Org Startup" - :group 'org) - (defcustom org-startup-folded t "Non-nil means entering Org mode will switch to OVERVIEW. @@ -1028,8 +1069,6 @@ the following lines anywhere in the buffer: (defcustom org-startup-align-all-tables nil "Non-nil means align all tables when visiting a file. -This is useful when the column width in tables is forced with cookies -in table fields. Such tables will look correct only after the first re-align. This can also be configured on a per-file basis by adding one of the following lines anywhere in the buffer: #+STARTUP: align @@ -1037,6 +1076,17 @@ the following lines anywhere in the buffer: :group 'org-startup :type 'boolean) +(defcustom org-startup-shrink-all-tables nil + "Non-nil means shrink all table columns with a width cookie. +This can also be configured on a per-file basis by adding one of +the following lines anywhere in the buffer: + #+STARTUP: shrink" + :group 'org-startup + :type 'boolean + :version "27.1" + :package-version '(Org . "9.2") + :safe #'booleanp) + (defcustom org-startup-with-inline-images nil "Non-nil means show inline images when loading a new Org file. This can also be configured on a per-file basis by adding one of @@ -1069,15 +1119,17 @@ has been set." :group 'org-startup :type 'boolean) +(defvaralias 'org-CUA-compatible 'org-replace-disputed-keys) + (defcustom org-replace-disputed-keys nil "Non-nil means use alternative key bindings for some keys. + Org mode uses S- keys for changing timestamps and priorities. -These keys are also used by other packages like shift-selection-mode' -\(built into Emacs 23), `CUA-mode' or `windmove.el'. -If you want to use Org mode together with one of these other modes, -or more generally if you would like to move some Org mode commands to -other keys, set this variable and configure the keys with the variable -`org-disputed-keys'. +These keys are also used by other packages like Shift Select mode, +CUA mode or Windmove. If you want to use Org mode together with +one of these other modes, or more generally if you would like to +move some Org mode commands to other keys, set this variable and +configure the keys with the variable `org-disputed-keys'. This option is only relevant at load-time of Org mode, and must be set *before* org.el is loaded. Changing it requires a restart of Emacs to @@ -1093,14 +1145,12 @@ loading Org." :group 'org-startup :type 'boolean) -(defvaralias 'org-CUA-compatible 'org-replace-disputed-keys) - (defcustom org-disputed-keys '(([(shift up)] . [(meta p)]) ([(shift down)] . [(meta n)]) ([(shift left)] . [(meta -)]) ([(shift right)] . [(meta +)]) - ([(control shift right)] . [(meta shift +)]) + ([(control shift right)] . [(meta shift +)]) ([(control shift left)] . [(meta shift -)])) "Keys for which Org mode and other modes compete. This is an alist, cars are the default keys, second element specifies @@ -1284,7 +1334,7 @@ star at the beginning of the headline, you can do this: This list will be checked before `org-speed-commands-default' when the variable `org-use-speed-commands' is non-nil and when the cursor is at the beginning of a headline. -The car if each entry is a string with a single letter, which must +The car of each entry is a string with a single letter, which must be assigned to `self-insert-command' in the global map. The cdr is either a command to be called interactively, a function to be called, or a form to be evaluated. @@ -1427,7 +1477,6 @@ the values `folded', `children', or `subtree'." :type 'hook) (defcustom org-cycle-hook '(org-cycle-hide-archived-subtrees - org-cycle-hide-drawers org-cycle-show-empty-lines org-optimize-window-after-visibility-change) "Hook that is run after `org-cycle' has changed the buffer visibility. @@ -1482,11 +1531,14 @@ stars). The following issues are influenced by this variable: a headline will be indented when this variable is set. Note that this is all about true indentation, by adding and -removing space characters. See also `org-indent.el' which does +removing space characters. See also \"org-indent.el\" which does level-dependent indentation in a virtual way, i.e. at display time in Emacs." :group 'org-edit-structure - :type 'boolean) + :type 'boolean + :safe #'booleanp) + +(defvaralias 'org-special-ctrl-a 'org-special-ctrl-a/e) (defcustom org-special-ctrl-a/e nil "Non-nil means `C-a' and `C-e' behave specially in headlines and items. @@ -1525,7 +1577,6 @@ This may also be a cons cell where the behavior for `C-a' and (const :tag "off" nil) (const :tag "on: before tags first" t) (const :tag "reversed: after tags first" reversed))))) -(defvaralias 'org-special-ctrl-a 'org-special-ctrl-a/e) (defcustom org-special-ctrl-k nil "Non-nil means `C-k' will behave specially in headlines. @@ -1663,19 +1714,6 @@ When nil, such lines will be treated like ordinary lines." :group 'org-edit-structure :type 'boolean) -(defcustom org-goto-auto-isearch t - "Non-nil means typing characters in `org-goto' starts incremental search. -When nil, you can use these keybindings to navigate the buffer: - - q Quit the org-goto interface - n Go to the next visible heading - p Go to the previous visible heading - f Go one heading forward on same level - b Go one heading backward on same level - u Go one heading up" - :group 'org-edit-structure - :type 'boolean) - (defgroup org-sparse-trees nil "Options concerning sparse trees in Org mode." :tag "Org Sparse Trees" @@ -1709,7 +1747,7 @@ doesn't specify any upper case character." :type '(choice (const :tag "Case-sensitive" nil) (const :tag "Case-insensitive" t) - (const :tag "Case-insensitive for lower case searches only" 'smart))) + (const :tag "Case-insensitive for lower case searches only" smart))) (defcustom org-occur-hook '(org-first-headline-recenter) "Hook that is run after `org-occur' has constructed a sparse tree. @@ -1718,17 +1756,6 @@ as possible." :group 'org-sparse-trees :type 'hook) -(defgroup org-imenu-and-speedbar nil - "Options concerning imenu and speedbar in Org mode." - :tag "Org Imenu and Speedbar" - :group 'org-structure) - -(defcustom org-imenu-depth 2 - "The maximum level for Imenu access to Org headlines. -This also applied for speedbar access." - :group 'org-imenu-and-speedbar - :type 'integer) - (defgroup org-table nil "Options concerning tables in Org mode." :tag "Org Table" @@ -1864,7 +1891,7 @@ See the manual for examples." (defcustom org-descriptive-links t "Non-nil means Org will display descriptive links. -E.g. [[http://orgmode.org][Org website]] will be displayed as +E.g. [[https://orgmode.org][Org website]] will be displayed as \"Org Website\", hiding the link itself and just displaying its description. When set to nil, Org will display the full links literally. @@ -2255,8 +2282,7 @@ See `org-file-apps'.") ("\\.x?html?\\'" . default) ("\\.pdf\\'" . default)) "External applications for opening `file:path' items in a document. -\\\ - +\\ Org mode uses system defaults for different file types, but you can use this variable to set the application for a given file extension. The entries in this list are cons cells where the car identifies @@ -2292,7 +2318,7 @@ Possible values for the file identifier are: In a custom function, you can access the group matches with (match-string n link). - Example: (\"\\\\.pdf::\\\\(\\\\d+\\\\)\\\\\\='\" . \ + Example: (\"\\\\.pdf::\\\\([0-9]+\\\\)\\\\\\='\" . \ \"evince -p %1 %s\") to open [[file:document.pdf::5]] with evince at page 5. @@ -2352,7 +2378,7 @@ For more examples, see the system specific constants (string :tag "Command") (function :tag "Function"))))) -(defcustom org-doi-server-url "http://dx.doi.org/" +(defcustom org-doi-server-url "https://doi.org/" "The URL of the DOI server." :type 'string :version "24.3" @@ -2387,25 +2413,6 @@ do not specify a target file." :group 'org-capture :type 'file) -(defcustom org-goto-interface 'outline - "The default interface to be used for `org-goto'. -Allowed values are: -outline The interface shows an outline of the relevant file - and the correct heading is found by moving through - the outline or by searching with incremental search. -outline-path-completion Headlines in the current buffer are offered via - completion. This is the interface also used by - the refile command." - :group 'org-refile - :type '(choice - (const :tag "Outline" outline) - (const :tag "Outline-path-completion" outline-path-completion))) - -(defcustom org-goto-max-level 5 - "Maximum target level when running `org-goto' with refile interface." - :group 'org-refile - :type 'integer) - (defcustom org-reverse-note-order nil "Non-nil means store new notes at the beginning of a file or entry. When nil, new notes will be filed to the end of a file or entry. @@ -2437,8 +2444,8 @@ This option can also be set with on a per-file-basis with You can have local logging settings for a subtree by setting the LOGGING property to one or more of these keywords. -When bulk-refiling from the agenda, the value `note' is forbidden and -will temporarily be changed to `time'." +When bulk-refiling, e.g., from the agenda, the value `note' is +forbidden and will temporarily be changed to `time'." :group 'org-refile :group 'org-progress :version "24.1" @@ -2709,7 +2716,7 @@ selection scheme. When nil, fast selection is never used. When the symbol `prefix', it will be used when `org-todo' is called -with a prefix argument, i.e. `\\[universal-argument] \\[org-todo]' \ +with a prefix argument, i.e. `\\[universal-argument] \\[org-todo]' \ in an Org buffer, and `\\[universal-argument] t' in an agenda buffer. @@ -2817,7 +2824,7 @@ When non-nil, you first need to check off all check boxes before the TODO entry can be switched to DONE. This variable needs to be set before org.el is loaded, and you need to restart Emacs after a change to make the change effective. The only way -to change is while Emacs is running is through the customize interface." +to change it while Emacs is running is through the customize interface." :set (lambda (var val) (set var val) (if val @@ -2896,7 +2903,7 @@ property to one or more of these keywords." (setq org-log-done 'note))) (defcustom org-log-reschedule nil - "Information to record when the scheduling date of a tasks is modified. + "Information to record when the scheduling date of a task is modified. Possible values are: @@ -2908,16 +2915,22 @@ This option can also be set with on a per-file-basis with #+STARTUP: nologreschedule #+STARTUP: logreschedule - #+STARTUP: lognotereschedule" + #+STARTUP: lognotereschedule + +You can have local logging settings for a subtree by setting the LOGGING +property to one or more of these keywords. + +This variable has an effect when calling `org-schedule' or +`org-agenda-schedule' only." :group 'org-todo :group 'org-progress :type '(choice (const :tag "No logging" nil) (const :tag "Record timestamp" time) - (const :tag "Record timestamp with note." note))) + (const :tag "Record timestamp with note" note))) (defcustom org-log-redeadline nil - "Information to record when the deadline date of a tasks is modified. + "Information to record when the deadline date of a task is modified. Possible values are: @@ -2932,7 +2945,10 @@ This option can also be set with on a per-file-basis with #+STARTUP: lognoteredeadline You can have local logging settings for a subtree by setting the LOGGING -property to one or more of these keywords." +property to one or more of these keywords. + +This variable has an effect when calling `org-deadline' or +`org-agenda-deadline' only." :group 'org-todo :group 'org-progress :type '(choice @@ -3003,6 +3019,8 @@ because Agenda Log mode depends on the format of these entries." (unless (assq 'note org-log-note-headings) (push '(note . "%t") org-log-note-headings)) +(defvaralias 'org-log-state-notes-into-drawer 'org-log-into-drawer) + (defcustom org-log-into-drawer nil "Non-nil means insert state change notes and time stamps into a drawer. When nil, state changes notes will be inserted after the headline and @@ -3034,8 +3052,6 @@ function `org-log-into-drawer' instead." (const :tag "LOGBOOK" t) (string :tag "Other"))) -(defvaralias 'org-log-state-notes-into-drawer 'org-log-into-drawer) - (defun org-log-into-drawer () "Name of the log drawer, as a string, or nil. This is the value of `org-log-into-drawer'. However, if the @@ -3076,13 +3092,17 @@ This option can also be set with on a per-file-basis with (defcustom org-todo-repeat-to-state nil "The TODO state to which a repeater should return the repeating task. -By default this is the first task in a TODO sequence, or the previous state -in a TODO_TYP set. But you can specify another task here. -alternatively, set the :REPEAT_TO_STATE: property of the entry." +By default this is the first task of a TODO sequence or the +previous state of a TYPE_TODO set. But you can specify to use +the previous state in a TODO sequence or a string. + +Alternatively, you can set the :REPEAT_TO_STATE: property of the +entry, which has precedence over this option." :group 'org-todo :version "24.1" - :type '(choice (const :tag "Head of sequence" nil) - (string :tag "Specific state"))) + :type '(choice (const :tag "Use the previous TODO state" t) + (const :tag "Use the head of the TODO sequence" nil) + (string :tag "Use a specific TODO state"))) (defcustom org-log-repeat 'time "Non-nil means record moving through the DONE state when triggering repeat. @@ -3111,6 +3131,11 @@ property to one or more of these keywords." (const :tag "Force recording the DONE state" time) (const :tag "Force recording a note with the DONE state" note))) +(defcustom org-todo-repeat-hook nil + "Hook that is run after a task has been repeated." + :package-version '(Org . "9.2") + :group 'org-todo + :type 'hook) (defgroup org-priorities nil "Priorities in Org mode." @@ -3310,7 +3335,7 @@ Depending on the system Emacs is running on, certain dates cannot be represented with the type used internally to represent time. Dates between 1970-1-1 and 2038-1-1 can always be represented correctly. Some systems allow for earlier dates, some for later, -some for both. One way to find out it to insert any date into an +some for both. One way to find out is to insert any date into an Org buffer, putting the cursor on the year and hitting S-up and S-down to test the range. @@ -3318,7 +3343,7 @@ When this variable is set to t, the date/time prompt will not let you specify dates outside the 1970-2037 range, so it is certain that these dates will work in whatever version of Emacs you are running, and also that you can move a file from one Emacs implementation -to another. WHenever Org is forcing the year for you, it will display +to another. Whenever Org is forcing the year for you, it will display a message and beep. When this variable is nil, Org will check if the date is @@ -3340,6 +3365,9 @@ This display will be in an overlay, in the minibuffer." :group 'org-time :type 'boolean) +(defvaralias 'org-popup-calendar-for-date-prompt + 'org-read-date-popup-calendar) + (defcustom org-read-date-popup-calendar t "Non-nil means pop up a calendar when prompting for a date. In the calendar, the date can be selected with mouse-1. However, the @@ -3347,13 +3375,11 @@ minibuffer will also be active, and you can simply enter the date as well. When nil, only the minibuffer will be available." :group 'org-time :type 'boolean) -(defvaralias 'org-popup-calendar-for-date-prompt - 'org-read-date-popup-calendar) (defcustom org-extend-today-until 0 "The hour when your day really ends. Must be an integer. This has influence for the following applications: -- When switching the agenda to \"today\". It it is still earlier than +- When switching the agenda to \"today\". If it is still earlier than the time given here, the day recognized as TODAY is actually yesterday. - When a date is read from the user and it is still before the time given here, the current date and time will be assumed to be yesterday, 23:59. @@ -3413,7 +3439,7 @@ The value of this variable is an alist. Associations either: where TAG is a tag as a string, SELECT is character, used to select that tag through the fast tag selection interface, and SPECIAL is one of the following keywords: `:startgroup', -`:startgrouptag', `:grouptags', `:engroup', `:endgrouptag' or +`:startgrouptag', `:grouptags', `:endgroup', `:endgrouptag' or `:newline'. These keywords are used to define a hierarchy of tags. See manual for details. @@ -3450,7 +3476,7 @@ The value of this variable is an alist. Associations either: where TAG is a tag as a string, SELECT is a character, used to select that tag through the fast tag selection interface, and SPECIAL is one of the following keywords: `:startgroup', -`:startgrouptag', `:grouptags', `:engroup', `:endgrouptag' or +`:startgrouptag', `:grouptags', `:endgroup', `:endgrouptag' or `:newline'. These keywords are used to define a hierarchy of tags. See manual for details. @@ -3475,9 +3501,9 @@ on a per-file basis, insert anywhere in the file: (defcustom org-complete-tags-always-offer-all-agenda-tags nil "If non-nil, always offer completion for all tags of all agenda files. -Instead of customizing this variable directly, you might want to -set it locally for capture buffers, because there no list of -tags in that file can be created dynamically (there are none). + +Setting this variable locally allows for dynamic generation of tag +completions in capture buffers. (add-hook \\='org-capture-mode-hook (lambda () @@ -3608,8 +3634,8 @@ is better to limit inheritance to certain tags using the variables :group 'org-tags :type '(choice (const :tag "No sorting" nil) - (const :tag "Alphabetical" string<) - (const :tag "Reverse alphabetical" string>) + (const :tag "Alphabetical" org-string-collate-lessp) + (const :tag "Reverse alphabetical" org-string-collate-greaterp) (function :tag "Custom function" nil))) (defvar org-tags-history nil @@ -3674,7 +3700,7 @@ and the properties ending in \"_ALL\" when they are used as descriptor for valid values of a property. Note for programmers: -When querying an entry with `org-entry-get', you can control if inheritance +When querying an entry with `org-entry-get', you can control if inheritance should be used. By default, `org-entry-get' looks only at the local properties. You can request inheritance by setting the inherit argument to t (to force inheritance) or to `selective' (to respect the setting @@ -3756,7 +3782,7 @@ This variable is populated from #+PROPERTY lines.") :group 'org) (defvar-local org-category nil - "Variable used by org files to set a category for agenda display. + "Variable used by Org files to set a category for agenda display. Such files should use a file variable to set it, for example # -*- mode: org; org-category: \"ELisp\" @@ -3796,6 +3822,9 @@ regular expression will be included." :group 'org-agenda :type 'regexp) +(defvaralias 'org-agenda-multi-occur-extra-files + 'org-agenda-text-search-extra-files) + (defcustom org-agenda-text-search-extra-files nil "List of extra files to be searched by text search commands. These files will be searched in addition to the agenda files by the @@ -3813,34 +3842,12 @@ scope." (const :tag "Agenda Archives" agenda-archives) (repeat :inline t (file)))) -(defvaralias 'org-agenda-multi-occur-extra-files - 'org-agenda-text-search-extra-files) - (defcustom org-agenda-skip-unavailable-files nil "Non-nil means to just skip non-reachable files in `org-agenda-files'. A nil value means to remove them, after a query, from the list." :group 'org-agenda :type 'boolean) -(defcustom org-calendar-to-agenda-key [?c] - "The key to be installed in `calendar-mode-map' for switching to the agenda. -The command `org-calendar-goto-agenda' will be bound to this key. The -default is the character `c' because then `c' can be used to switch back and -forth between agenda and calendar." - :group 'org-agenda - :type 'sexp) - -(defcustom org-calendar-insert-diary-entry-key [?i] - "The key to be installed in `calendar-mode-map' for adding diary entries. -This option is irrelevant until `org-agenda-diary-file' has been configured -to point to an Org file. When that is the case, the command -`org-agenda-diary-entry' will be bound to the key given here, by default -`i'. In the calendar, `i' normally adds entries to `diary-file'. So -if you want to continue doing this, you need to change this to a different -key." - :group 'org-agenda - :type 'sexp) - (defcustom org-agenda-diary-file 'diary-file "File to which to add new entries with the `i' key in agenda and calendar. When this is the symbol `diary-file', the functionality in the Emacs @@ -3851,17 +3858,6 @@ points to a file, `org-agenda-diary-entry' will be used instead." (const :tag "The standard Emacs diary file" diary-file) (file :tag "Special Org file diary entries"))) -(eval-after-load "calendar" - '(progn - (org-defkey calendar-mode-map org-calendar-to-agenda-key - 'org-calendar-goto-agenda) - (add-hook 'calendar-mode-hook - (lambda () - (unless (eq org-agenda-diary-file 'diary-file) - (define-key calendar-mode-map - org-calendar-insert-diary-entry-key - 'org-agenda-diary-entry)))))) - (defgroup org-latex nil "Options for embedding LaTeX code into Org mode." :tag "Org LaTeX" @@ -4038,7 +4034,7 @@ Place-holders only used by `:image-converter': (defcustom org-preview-latex-image-directory "ltximg/" "Path to store latex preview images. A relative path here creates many directories relative to the -processed org files paths. An absolute path puts all preview +processed Org files paths. An absolute path puts all preview images at the same place." :group 'org-latex :version "26.1" @@ -4149,10 +4145,12 @@ A cell is of the format If SNIPPET-FLAG is non-nil, the package also needs to be included when compiling LaTeX snippets into images for inclusion into -non-LaTeX output. COMPILERS is a list of compilers that should -include the package, see `org-latex-compiler'. If the document -compiler is not in the list, and the list is non-nil, the package -will not be inserted in the final document. +non-LaTeX output. + +COMPILERS is a list of compilers that should include the package, +see `org-latex-compiler'. If the document compiler is not in the +list, and the list is non-nil, the package will not be inserted +in the final document. A string will be inserted as-is in the header of the document." :group 'org-latex @@ -4166,7 +4164,10 @@ A string will be inserted as-is in the header of the document." (list :tag "options/package pair" (string :tag "options") (string :tag "package") - (boolean :tag "Snippet")) + (boolean :tag "Snippet") + (choice + (const :tag "For all compilers" nil) + (repeat :tag "Allowed compiler" string))) (string :tag "A line of LaTeX")))) (defcustom org-latex-packages-alist nil @@ -4177,12 +4178,17 @@ Each element is either a cell or a string. A cell is of the format: - (\"options\" \"package\" SNIPPET-FLAG) + (\"options\" \"package\" SNIPPET-FLAG COMPILERS) SNIPPET-FLAG, when non-nil, indicates that this package is also needed when turning LaTeX snippets into images for inclusion into non-LaTeX output. +COMPILERS is a list of compilers that should include the package, +see `org-latex-compiler'. If the document compiler is not in the +list, and the list is non-nil, the package will not be inserted +in the final document. + A string will be inserted as-is in the header of the document. Make sure that you only list packages here which: @@ -4233,9 +4239,9 @@ lines to the buffer: :type 'boolean) (defcustom org-hidden-keywords nil - "List of symbols corresponding to keywords to be hidden the org buffer. -For example, a value \\='(title) for this list will make the document's title -appear in the buffer without the initial #+TITLE: keyword." + "List of symbols corresponding to keywords to be hidden in the Org buffer. +For example, a value \\='(title) for this list makes the document's title +appear in the buffer without the initial \"#+TITLE:\" part." :group 'org-appearance :version "24.1" :type '(set (const :tag "#+AUTHOR" author) @@ -4275,7 +4281,7 @@ org-level-* faces." (defcustom org-highlight-latex-and-related nil "Non-nil means highlight LaTeX related syntax in the buffer. -When non nil, the value should be a list containing any of the +When non-nil, the value should be a list containing any of the following symbols: `latex' Highlight LaTeX snippets and environments. `script' Highlight subscript and superscript. @@ -4293,7 +4299,8 @@ following symbols: (defcustom org-hide-emphasis-markers nil "Non-nil mean font-lock should hide the emphasis marker characters." :group 'org-appearance - :type 'boolean) + :type 'boolean + :safe #'booleanp) (defcustom org-hide-macro-markers nil "Non-nil mean font-lock should hide the brackets marking macro calls." @@ -4351,7 +4358,7 @@ After a match, the match groups contain these elements: ;; set this option proved cumbersome. See this message/thread: ;; http://article.gmane.org/gmane.emacs.orgmode/68681 (defvar org-emphasis-regexp-components - '("- \t('\"{" "- \t.,:!?;'\")}\\[" " \t\r\n" "." 1) + '("-[:space:]('\"{" "-[:space:].,:!?;'\")}\\[" "[:space:]" "." 1) "Components used to build the regular expression for emphasis. This is a list with five entries. Terminology: In an emphasis string like \" *strong word* \", we call the initial space PREMATCH, the final @@ -4366,7 +4373,7 @@ body-regexp A regexp like \".\" to match a body character. Don't use non-shy groups here, and don't allow newline here. newline The maximum number of newlines allowed in an emphasis exp. -You need to reload Org or to restart Emacs after customizing this.") +You need to reload Org or to restart Emacs after setting this.") (defcustom org-emphasis-alist '(("*" bold) @@ -4429,7 +4436,6 @@ This is needed for font-lock setup.") "org-agenda" (extra txt &optional level category tags dotime remove-re habitp)) -(declare-function org-agenda-maybe-redo "org-agenda" ()) (declare-function org-agenda-new-marker "org-agenda" (&optional pos)) (declare-function org-agenda-save-markers-for-cut-and-paste "org-agenda" @@ -4445,7 +4451,6 @@ This is needed for font-lock setup.") (declare-function org-inlinetask-remove-END-maybe "org-inlinetask" ()) (declare-function orgtbl-send-table "org-table" (&optional maybe)) (declare-function parse-time-string "parse-time" (string)) -(declare-function speedbar-line-directory "speedbar" (&optional depth)) (defvar align-mode-rules-list) (defvar calc-embedded-close-formula) @@ -4503,7 +4508,7 @@ Assume point is already in a table." (unless quietly (message "Mapping tables: done"))) (declare-function org-clock-save-markers-for-cut-and-paste "org-clock" (beg end)) -(declare-function org-clock-update-mode-line "org-clock" ()) +(declare-function org-clock-update-mode-line "org-clock" (&optional refresh)) (declare-function org-resolve-clocks "org-clock" (&optional also-non-dangling-p prompt last-valid)) @@ -4699,19 +4704,17 @@ STATE should be one of the symbols listed in the docstring of ;; Include headline point is currently on. (beginning-of-line) (while (and (< (point) end) (re-search-forward re end t)) - (when (member org-archive-tag (org-get-tags)) + (when (member org-archive-tag (org-get-tags nil t)) (org-flag-subtree t) (org-end-of-subtree t)))))) -(declare-function outline-end-of-heading "outline" ()) -(declare-function outline-flag-region "outline" (from to flag)) (defun org-flag-subtree (flag) (save-excursion (org-back-to-heading t) - (outline-end-of-heading) - (outline-flag-region (point) - (progn (org-end-of-subtree t) (point)) - flag))) + (org-flag-region (line-end-position) + (progn (org-end-of-subtree t) (point)) + flag + 'outline))) (defalias 'org-advertized-archive-subtree 'org-archive-subtree) @@ -4826,6 +4829,7 @@ After a match, the following groups carry important information: ("oddeven" org-odd-levels-only nil) ("align" org-startup-align-all-tables t) ("noalign" org-startup-align-all-tables nil) + ("shrink" org-startup-shrink-all-tables t) ("inlineimages" org-startup-with-inline-images t) ("noinlineimages" org-startup-with-inline-images nil) ("latexpreview" org-startup-with-latex-preview t) @@ -4869,7 +4873,7 @@ After a match, the following groups carry important information: ("beamer" org-startup-with-beamer-mode t) ("entitiespretty" org-pretty-entities t) ("entitiesplain" org-pretty-entities nil)) - "Variable associated with STARTUP options for org-mode. + "Variable associated with STARTUP options for Org. Each element is a list of three items: the startup options (as written in the #+STARTUP line), the corresponding variable, and the value to set this variable to if the option is found. An optional forth element PUSH @@ -4898,6 +4902,40 @@ Support for group tags is controlled by the option (message "Groups tags support has been turned %s" (if org-group-tags "on" "off"))) +(defun org--tag-add-to-alist (alist1 alist2) + "Merge tags from ALIST1 into ALIST2. + +Duplicates tags outside a group are removed. Keywords and order +are preserved. + +The function assumes ALIST1 and ALIST2 are proper tag alists. +See `org-tag-alist' for their structure." + (cond + ((null alist2) alist1) + ((null alist1) alist2) + (t + (let ((to-add nil) + (group-flag nil)) + (dolist (tag-pair alist1) + (pcase tag-pair + (`(,(or :startgrouptag :startgroup)) + (setq group-flag t) + (push tag-pair to-add)) + (`(,(or :endgrouptag :endgroup)) + (setq group-flag nil) + (push tag-pair to-add)) + (`(,(or :grouptags :newline)) + (push tag-pair to-add)) + (`(,tag . ,_) + ;; Remove duplicates from ALIST1, unless they are in + ;; a group. Indeed, it makes sense to have a tag appear in + ;; multiple groups. + (when (or group-flag (not (assoc tag alist2))) + (push tag-pair to-add))) + (_ (error "Invalid association in tag alist: %S" tag-pair)))) + ;; Preserve order of ALIST1. + (append (nreverse 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 @@ -4926,10 +4964,11 @@ related expressions." (mapcar #'org-add-prop-inherited (cdr (assq 'filetags alist)))) (setq org-current-tag-alist - (append org-tag-persistent-alist - (let ((tags (cdr (assq 'tags alist)))) - (if tags (org-tag-string-to-alist tags) - org-tag-alist)))) + (org--tag-add-to-alist + org-tag-persistent-alist + (let ((tags (cdr (assq 'tags alist)))) + (if tags (org-tag-string-to-alist tags) + org-tag-alist)))) (setq org-tag-groups-alist (org-tag-alist-to-groups org-current-tag-alist)) (unless tags-only @@ -5149,8 +5188,7 @@ Return value contains the following keys: `archive', `category', ((equal key "SETUPFILE") (unless buffer-read-only ; Do not check in Gnus messages. (let ((f (and (org-string-nw-p value) - (expand-file-name - (org-unbracket-string "\"" "\"" value))))) + (expand-file-name (org-strip-quotes value))))) (when (and f (file-readable-p f) (not (member f files))) (with-temp-buffer (setq default-directory (file-name-directory f)) @@ -5169,8 +5207,7 @@ S is a value for TAGS keyword or produced with `org-tag-alist-to-string'. Return value is an alist suitable for `org-tag-alist' or `org-tag-persistent-alist'." (let ((lines (mapcar #'split-string (split-string s "\n" t))) - (tag-re (concat "\\`\\([[:alnum:]_@#%]+" - "\\|{.+?}\\)" ; regular expression + (tag-re (concat "\\`\\(" org-tag-re "\\|{.+?}\\)" ; regular expression "\\(?:(\\(.\\))\\)?\\'")) alist group-flag) (dolist (tokens lines (cdr (nreverse alist))) @@ -5244,7 +5281,7 @@ a string, summarizing TAGS, as a list of strings." (`(,(or :endgroup :endgrouptag)) (when (eq group-status 'append) (push (nreverse current-group) groups)) - (setq group-status nil)) + (setq group-status nil current-group nil)) (`(:grouptags) (setq group-status 'append)) ((and `(,tag . ,_) (guard group-status)) (if (eq group-status 'append) (push tag current-group) @@ -5441,8 +5478,8 @@ The following commands are available: (org-load-modules-maybe) (org-install-agenda-files-menu) (when org-descriptive-links (add-to-invisibility-spec '(org-link))) - (add-to-invisibility-spec '(org-cwidth)) (add-to-invisibility-spec '(org-hide-block . t)) + (add-to-invisibility-spec '(org-hide-drawer . t)) (setq-local outline-regexp org-outline-regexp) (setq-local outline-level 'org-outline-level) (setq bidi-paragraph-direction 'left-to-right) @@ -5462,10 +5499,11 @@ The following commands are available: ;; Calc embedded (setq-local calc-embedded-open-mode "# ") ;; Modify a few syntax entries - (modify-syntax-entry ?@ "w") (modify-syntax-entry ?\" "\"") (modify-syntax-entry ?\\ "_") (modify-syntax-entry ?~ "_") + (modify-syntax-entry ?< "(>") + (modify-syntax-entry ?> ")<") (setq-local font-lock-unfontify-region-function 'org-unfontify-region) ;; Activate before-change-function (setq-local org-table-may-need-update t) @@ -5495,6 +5533,8 @@ The following commands are available: (forward-char -1)))) ;; Next error for sparse trees (setq-local next-error-function 'org-occur-next-match) + ;; Make commit log messages from Org documents easier. + (setq-local add-log-current-defun-function #'org-add-log-current-headline) ;; Make sure dependence stuff works reliably, even for users who set it ;; too late :-( (if org-enforce-todo-dependencies @@ -5515,9 +5555,6 @@ The following commands are available: (regexp . "^[ \t]*#\\+[A-Z_]+:\\(\\s-*\\)\\S-+") (modes . '(org-mode))))) - ;; Imenu - (setq-local imenu-create-index-function 'org-imenu-get-tree) - ;; Make isearch reveal context (setq-local outline-isearch-open-invisible-function (lambda (&rest _) (org-show-context 'isearch))) @@ -5539,8 +5576,14 @@ The following commands are available: (unless org-inhibit-startup (org-unmodified (when org-startup-with-beamer-mode (org-beamer-mode)) - (when org-startup-align-all-tables - (org-table-map-tables #'org-table-align t)) + (when (or org-startup-align-all-tables org-startup-shrink-all-tables) + (org-table-map-tables + (cond ((and org-startup-align-all-tables + org-startup-shrink-all-tables) + (lambda () (org-table-align) (org-table-shrink))) + (org-startup-align-all-tables #'org-table-align) + (t #'org-table-shrink)) + t)) (when org-startup-with-inline-images (org-display-inline-images)) (when org-startup-with-latex-preview (org-toggle-latex-fragment '(16))) (unless org-inhibit-startup-visibility-stuff (org-set-startup-visibility)) @@ -5560,7 +5603,8 @@ The following commands are available: ("8.2.7" . "24.4") ("8.3" . "26.1") ("9.0" . "26.1") - ("9.1" . "26.1"))) + ("9.1" . "26.1") + ("9.2" . "27.1"))) (defvar org-mode-transpose-word-syntax-table (let ((st (make-syntax-table text-mode-syntax-table))) @@ -5592,22 +5636,20 @@ When ROUNDING-MINUTES is not an integer, fall back on the car of the rounding returns a past time." (let ((r (or (and (integerp rounding-minutes) rounding-minutes) (car org-time-stamp-rounding-minutes))) - (time (decode-time)) res) + (now (current-time))) (if (< r 1) - (current-time) - (setq res - (apply 'encode-time - (append (list 0 (* r (floor (+ .5 (/ (float (nth 1 time)) r))))) - (nthcdr 2 time)))) - (if (and past (< (float-time (time-subtract (current-time) res)) 0)) - (seconds-to-time (- (float-time res) (* r 60))) - res)))) + now + (let* ((time (decode-time now)) + (res (apply #'encode-time 0 (* r (round (nth 1 time) r)) + (nthcdr 2 time)))) + (if (or (not past) (org-time-less-p res now)) + res + (org-time-subtract res (* r 60))))))) (defun org-today () "Return today date, considering `org-extend-today-until'." (time-to-days - (time-subtract (current-time) - (list 0 (* 3600 org-extend-today-until) 0)))) + (org-time-since (* 3600 org-extend-today-until)))) ;;;; Font-Lock stuff, including the activators @@ -5617,8 +5659,8 @@ the rounding returns a past time." (when org-mouse-1-follows-link (org-defkey org-mouse-map [follow-link] 'mouse-face)) (when org-tab-follows-link - (org-defkey org-mouse-map [(tab)] 'org-open-at-point) - (org-defkey org-mouse-map "\C-i" 'org-open-at-point)) + (org-defkey org-mouse-map (kbd "") #'org-open-at-point) + (org-defkey org-mouse-map (kbd "TAB") #'org-open-at-point)) (require 'font-lock) @@ -5753,6 +5795,10 @@ This should be called after the variable `org-link-parameters' has changed." (when (save-excursion (goto-char (match-beginning 0)) (and + ;; Do not match table hlines. + (not (and (equal marker "+") + (org-match-line + "[ \t]*\\(|[-+]+|?\\|\\+[-+]+\\+\\)[ \t]*$"))) ;; Do not match headline stars. Do not consider ;; stars of a headline as closing marker for bold ;; markup either. @@ -5761,12 +5807,12 @@ This should be called after the variable `org-link-parameters' has changed." (forward-char) (skip-chars-backward "*") (looking-at-p org-outline-regexp-bol)))) - ;; Do not match table hlines. - (not (and (equal marker "+") - (org-match-line - "^[ \t]*\\(|[-+]+|?\\|\\+[-+]+\\+\\)[ \t]*$"))) + ;; Match full emphasis markup regexp. (looking-at (if verbatim? org-verbatim-re org-emph-re)) - ;; At a table row, do not cross cell boundaries. + ;; Do not span over paragraph boundaries. + (not (string-match-p org-element-paragraph-separate + (match-string 2))) + ;; Do not span over cells in table rows. (not (and (save-match-data (org-match-line "[ \t]*|")) (string-match-p "|" (match-string 4)))))) (pcase-let ((`(,_ ,face ,_) (assoc marker org-emphasis-alist))) @@ -5774,7 +5820,9 @@ This should be called after the variable `org-link-parameters' has changed." (match-beginning 2) (match-end 2) 'face face) (when verbatim? (org-remove-flyspell-overlays-in - (match-beginning 0) (match-end 0))) + (match-beginning 0) (match-end 0)) + (remove-text-properties (match-beginning 2) (match-end 2) + '(display t invisible t intangible t))) (add-text-properties (match-beginning 2) (match-end 2) '(font-lock-multiline t org-emphasis t)) (when org-hide-emphasis-markers @@ -5929,7 +5977,7 @@ by a #." (defun org-fontify-meta-lines-and-blocks (limit) (condition-case nil (org-fontify-meta-lines-and-blocks-1 limit) - (error (message "org-mode fontification error in %S at %d" + (error (message "Org mode fontification error in %S at %d" (current-buffer) (line-number-at-pos))))) @@ -6043,17 +6091,21 @@ by a #." (defun org-fontify-macros (limit) "Fontify macros." - (when (re-search-forward "\\({{{\\).+?\\(}}}\\)" limit t) - (add-text-properties - (match-beginning 0) (match-end 0) - '(font-lock-fontified t face org-macro)) - (when org-hide-macro-markers - (add-text-properties (match-end 2) (match-beginning 2) - '(invisible t)) - (add-text-properties (match-beginning 1) (match-end 1) - '(invisible t))) - (org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0)) - t)) + (when (re-search-forward "{{{\\([a-zA-Z][-a-zA-Z0-9_]*\\)" limit t) + (let ((begin (match-beginning 0)) + (opening-end (match-beginning 1))) + (when (and (re-search-forward "\n[ \t]*\n\\|\\(}}}\\)" limit t) + (match-string 1)) + (let ((end (match-end 1)) + (closing-start (match-beginning 1))) + (add-text-properties + begin end + '(font-lock-multiline t font-lock-fontified t face org-macro)) + (org-remove-flyspell-overlays-in begin end) + (when org-hide-macro-markers + (add-text-properties begin opening-end '(invisible t)) + (add-text-properties closing-start end '(invisible t))) + t))))) (defun org-activate-footnote-links (limit) "Add text properties for footnotes." @@ -6113,6 +6165,9 @@ by a #." "Add text properties for target matches." (when org-target-link-regexp (let ((case-fold-search t)) + ;; `org-target-link-regexp' matches one character before the + ;; actual target. + (unless (bolp) (forward-char -1)) (when (re-search-forward org-target-link-regexp limit t) (org-remove-flyspell-overlays-in (match-beginning 1) (match-end 1)) (add-text-properties (match-beginning 1) (match-end 1) @@ -6128,8 +6183,11 @@ by a #." Also refresh fontification if needed." (interactive) (let ((old-regexp org-target-link-regexp) - (before-re "\\(?:^\\|[^[:alnum:]]\\)\\(") - (after-re "\\)\\(?:$\\|[^[:alnum:]]\\)") + ;; Some languages, e.g., Chinese, do not use spaces to + ;; separate words. Also allow to surround radio targets with + ;; line-breakable characters. + (before-re "\\(?:^\\|[^[:alnum:]]\\|\\c|\\)\\(") + (after-re "\\)\\(?:$\\|[^[:alnum:]]\\|\\c|\\)") (targets (org-with-wide-buffer (goto-char (point-min)) @@ -6173,40 +6231,37 @@ Also refresh fontification if needed." (when (memq 'radio org-highlight-links) (org-restart-font-lock))))) -(defun org-hide-wide-columns (limit) - (let (s e) - (setq s (text-property-any (point) (or limit (point-max)) - 'org-cwidth t)) - (when s - (setq e (next-single-property-change s 'org-cwidth)) - (add-text-properties s e '(invisible org-cwidth)) - (goto-char e) - t))) - (defvar org-latex-and-related-regexp nil "Regular expression for highlighting LaTeX, entities and sub/superscript.") (defun org-compute-latex-and-related-regexp () "Compute regular expression for LaTeX, entities and sub/superscript. Result depends on variable `org-highlight-latex-and-related'." - (setq-local - org-latex-and-related-regexp - (let* ((re-sub - (cond ((not (memq 'script org-highlight-latex-and-related)) nil) - ((eq org-use-sub-superscripts '{}) - (list org-match-substring-with-braces-regexp)) - (org-use-sub-superscripts (list org-match-substring-regexp)))) - (re-latex - (when (memq 'latex org-highlight-latex-and-related) - (let ((matchers (plist-get org-format-latex-options :matchers))) - (delq nil - (mapcar (lambda (x) - (and (member (car x) matchers) (nth 1 x))) - org-latex-regexps))))) - (re-entities - (when (memq 'entities org-highlight-latex-and-related) - (list "\\\\\\(there4\\|sup[123]\\|frac[13][24]\\|[a-zA-Z]+\\)\\($\\|{}\\|[^[:alpha:]]\\)")))) - (mapconcat 'identity (append re-latex re-entities re-sub) "\\|")))) + (let ((re-sub + (cond ((not (memq 'script org-highlight-latex-and-related)) nil) + ((eq org-use-sub-superscripts '{}) + (list org-match-substring-with-braces-regexp)) + (org-use-sub-superscripts (list org-match-substring-regexp)))) + (re-latex + (when (memq 'latex org-highlight-latex-and-related) + (let* ((matchers (plist-get org-format-latex-options :matchers)) + (regexps (and (member "begin" matchers) + '("\\\\end{[a-zA-Z0-9\\*]+}[ \t]*$")))) + (dolist (matcher matchers) + (pcase (assoc matcher org-latex-regexps) + (`("begin" . ,_) (push "^[ \t]*\\\\begin{[a-zA-Z0-9\\*]+}" + regexps)) + (`(,_ ,regexp . ,_) (push regexp regexps)) + (_ nil))) + (nreverse regexps)))) + (re-entities + (when (memq 'entities org-highlight-latex-and-related) + (list "\\\\\\(there4\\|sup[123]\\|frac[13][24]\\|[a-zA-Z]+\\)\ +\\($\\|{}\\|[^[:alpha:]]\\)")))) + (setq-local org-latex-and-related-regexp + (mapconcat #'identity + (append re-latex re-entities re-sub) + "\\|")))) (defun org-do-latex-and-related (limit) "Highlight LaTeX snippets and environments, entities and sub/superscript. @@ -6216,22 +6271,38 @@ done, nil otherwise." (when (org-string-nw-p org-latex-and-related-regexp) (catch 'found (while (re-search-forward org-latex-and-related-regexp limit t) - (unless - (cl-some - (lambda (f) - (memq f '(org-code org-verbatim underline org-special-keyword))) - (save-excursion - (goto-char (1+ (match-beginning 0))) - (face-at-point nil t))) - (let ((offset (if (memq (char-after (1+ (match-beginning 0))) + (unless (cl-some (lambda (f) (memq f '(org-code org-verbatim underline + org-special-keyword))) + (save-excursion + (goto-char (1+ (match-beginning 0))) + (face-at-point nil t))) + (let* ((start (if (memq (char-after (1+ (match-beginning 0))) '(?_ ?^)) - 1 - 0))) + (1+ (match-beginning 0)) + (match-beginning 0))) + (end + (let* ((b (match-beginning 0)) + (e (match-end 0)) + (m (buffer-substring-no-properties b e))) + (cond + ((string-match "\\`[ \t]*\\\\begin{\\([a-zA-Z0-9\\*]+\\)}" + m) + (let ((re (format "\\\\end{%s}[ \t]*$" + (regexp-quote (match-string 1 m))))) + (or (re-search-forward re nil t) e))) + ((string-match "\\\\end{\\([a-zA-Z0-9\\*]+\\)}[ \t]*\\'" m) + (let ((re (format "^[ \t]*\\\\begin{%s}" + (regexp-quote (match-string 1 m))))) + (setq start + (or (save-excursion (re-search-backward re nil t)) + b)) + (line-end-position))) + ((string-match "\\`\\\\[a-zA-Z]+\\*?{\\'" m) + (search-forward "}" nil t)) + (t e))))) (font-lock-prepend-text-property - (+ offset (match-beginning 0)) (match-end 0) - 'face 'org-latex-and-related) - (add-text-properties (+ offset (match-beginning 0)) (match-end 0) - '(font-lock-multiline t))) + start end 'face 'org-latex-and-related) + (add-text-properties start end '(font-lock-multiline t))) (throw 'found t))) nil))) @@ -6242,8 +6313,7 @@ done, nil otherwise." (font-lock-mode 1))) (defun org-activate-tags (limit) - (when (re-search-forward - "^\\*+.*[ \t]\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$" limit t) + (when (re-search-forward org-tag-line-re limit t) (org-remove-flyspell-overlays-in (match-beginning 1) (match-end 1)) (add-text-properties (match-beginning 1) (match-end 1) (list 'mouse-face 'highlight @@ -6357,7 +6427,6 @@ needs to be inserted at a specific position in the font-lock sequence.") '("^&?%%(.*\\|<%%([^>\n]*?>" (0 'org-sexp-date t)) ;; Macro '(org-fontify-macros) - '(org-hide-wide-columns (0 nil append)) ;; TODO keyword (list (format org-heading-keyword-regexp-format org-todo-regexp) @@ -6634,85 +6703,309 @@ and subscripts." (list 'invisible t)))) t))) -;;;; Visibility cycling, including org-goto and indirect buffer - -;;; Cycling +(defun org-remove-empty-overlays-at (pos) + "Remove outline overlays that do not contain non-white stuff." + (dolist (o (overlays-at pos)) + (and (eq 'outline (overlay-get o 'invisible)) + (not (string-match "\\S-" (buffer-substring (overlay-start o) + (overlay-end o)))) + (delete-overlay o)))) -(defvar-local org-cycle-global-status nil) -(put 'org-cycle-global-status 'org-state t) -(defvar-local org-cycle-subtree-status nil) -(put 'org-cycle-subtree-status 'org-state t) +(defun org-show-empty-lines-in-parent () + "Move to the parent and re-show empty lines before visible headlines." + (save-excursion + (let ((context (if (org-up-heading-safe) 'children 'overview))) + (org-cycle-show-empty-lines context)))) -(defvar org-inlinetask-min-level) +(defun org-files-list () + "Return `org-agenda-files' list, plus all open Org files. +This is useful for operations that need to scan all of a user's +open and agenda-wise Org files." + (let ((files (mapcar #'expand-file-name (org-agenda-files)))) + (dolist (buf (buffer-list)) + (with-current-buffer buf + (when (and (derived-mode-p 'org-mode) (buffer-file-name)) + (cl-pushnew (expand-file-name (buffer-file-name)) files + :test #'equal)))) + files)) -(defun org-unlogged-message (&rest args) - "Display a message, but avoid logging it in the *Messages* buffer." - (let ((message-log-max nil)) - (apply 'message args))) +(defsubst org-entry-beginning-position () + "Return the beginning position of the current entry." + (save-excursion (org-back-to-heading t) (point))) -;;;###autoload -(defun org-cycle (&optional arg) - "TAB-action and visibility cycling for Org mode. +(defsubst org-entry-end-position () + "Return the end position of the current entry." + (save-excursion (outline-next-heading) (point))) -This is the command invoked in Org mode by the `TAB' key. Its main -purpose is outline visibility cycling, but it also invokes other actions -in special contexts. +(defun org-subtree-end-visible-p () + "Is the end of the current subtree visible?" + (pos-visible-in-window-p + (save-excursion (org-end-of-subtree t) (point)))) -When this function is called with a `\\[universal-argument]' prefix, rotate \ -the entire -buffer through 3 states (global cycling) - 1. OVERVIEW: Show only top-level headlines. - 2. CONTENTS: Show all headlines of all levels, but no body text. - 3. SHOW ALL: Show everything. +(defun org-first-headline-recenter () + "Move cursor to the first headline and recenter the headline." + (let ((window (get-buffer-window))) + (when window + (goto-char (point-min)) + (when (re-search-forward (concat "^\\(" org-outline-regexp "\\)") nil t) + (set-window-start window (line-beginning-position)))))) -With a `\\[universal-argument] \\[universal-argument]' prefix argument, \ -switch to the startup visibility, -determined by the variable `org-startup-folded', and by any VISIBILITY -properties in the buffer. + +;;; Visibility (headlines, blocks, drawers) -With a `\\[universal-argument] \\[universal-argument] \ -\\[universal-argument]' prefix argument, show the entire buffer, including -any drawers. +;;;; Headlines visibility -When inside a table, re-align the table and move to the next field. +(defun org-show-entry () + "Show the body directly following this heading. +Show the heading too, if it is currently invisible." + (interactive) + (save-excursion + (ignore-errors + (org-back-to-heading t) + (org-flag-region + (line-end-position 0) + (save-excursion + (if (re-search-forward + (concat "[\r\n]\\(" org-outline-regexp "\\)") nil t) + (match-beginning 1) + (point-max))) + nil + 'outline)))) -When point is at the beginning of a headline, rotate the subtree started -by this line through 3 different states (local cycling) - 1. FOLDED: Only the main headline is shown. - 2. CHILDREN: The main headline and the direct children are shown. - From this state, you can move to one of the children - and zoom in further. - 3. SUBTREE: Show the entire subtree, including body text. -If there is no subtree, switch directly from CHILDREN to FOLDED. +(defun org-show-children (&optional level) + "Show all direct subheadings of this heading. +Prefix arg LEVEL is how many levels below the current level +should be shown. Default is enough to cause the following +heading to appear." + (interactive "p") + (save-excursion + (org-back-to-heading t) + (let* ((current-level (funcall outline-level)) + (max-level (org-get-valid-level + current-level + (if level (prefix-numeric-value level) 1))) + (end (save-excursion (org-end-of-subtree t t))) + (regexp-fmt "^\\*\\{%d,%s\\}\\(?: \\|$\\)") + (past-first-child nil) + ;; Make sure to skip inlinetasks. + (re (format regexp-fmt + current-level + (cond + ((not (featurep 'org-inlinetask)) "") + (org-odd-levels-only (- (* 2 org-inlinetask-min-level) + 3)) + (t (1- org-inlinetask-min-level)))))) + ;; Display parent heading. + (org-flag-heading nil) + (forward-line) + ;; Display children. First child may be deeper than expected + ;; MAX-LEVEL. Since we want to display it anyway, adjust + ;; MAX-LEVEL accordingly. + (while (re-search-forward re end t) + (unless past-first-child + (setq re (format regexp-fmt + current-level + (max (funcall outline-level) max-level))) + (setq past-first-child t)) + (org-flag-heading nil))))) -When point is at the beginning of an empty headline and the variable -`org-cycle-level-after-item/entry-creation' is set, cycle the level -of the headline by demoting and promoting it to likely levels. This -speeds up creation document structure by pressing `TAB' once or several -times right after creating a new headline. +(defun org-show-subtree () + "Show everything after this heading at deeper levels." + (interactive) + (org-flag-region + (point) (save-excursion (org-end-of-subtree t t)) nil 'outline)) -When there is a numeric prefix, go up to a heading with level ARG, do -a `show-subtree' and return to the previous cursor position. If ARG -is negative, go up that many levels. +;;;; Blocks visibility -When point is not at the beginning of a headline, execute the global -binding for `TAB', which is re-indenting the line. See the option -`org-cycle-emulate-tab' for details. +(defun org-hide-block-toggle-maybe () + "Toggle visibility of block at point. +Unlike to `org-hide-block-toggle', this function does not throw +an error. Return a non-nil value when toggling is successful." + (interactive) + (ignore-errors (org-hide-block-toggle))) -As a special case, if point is at the beginning of the buffer and there is -no headline in line 1, this function will act as if called with prefix arg -\(`\\[universal-argument] TAB', same as `S-TAB') also when called without \ -prefix arg, but only -if the variable `org-cycle-global-at-bob' is t." - (interactive "P") - (org-load-modules-maybe) - (unless (or (run-hook-with-args-until-success 'org-tab-first-hook) - (and org-cycle-level-after-item/entry-creation - (or (org-cycle-level) - (org-cycle-item-indentation)))) - (let* ((limit-level - (or org-cycle-max-level - (and (boundp 'org-inlinetask-min-level) +(defun org-hide-block-toggle (&optional force) + "Toggle the visibility of the current block. +When optional argument FORCE is `off', make block visible. If it +is non-nil, hide it unconditionally. Throw an error when not at +a block. Return a non-nil value when toggling is successful." + (interactive) + (let ((element (org-element-at-point))) + (unless (memq (org-element-type element) + '(center-block comment-block dynamic-block example-block + export-block quote-block special-block + src-block verse-block)) + (user-error "Not at a block")) + (let* ((post (org-element-property :post-affiliated element)) + (start (save-excursion + (goto-char post) + (line-end-position))) + (end (save-excursion + (goto-char (org-element-property :end element)) + (skip-chars-backward " \t\n") + (line-end-position)))) + ;; Do nothing when not before or at the block opening line or at + ;; the block closing line. + (unless (let ((eol (line-end-position))) (and (> eol start) (/= eol end))) + (cond ((eq force 'off) + (org-flag-region start end nil 'org-hide-block)) + (force + (org-flag-region start end t 'org-hide-block)) + ((eq (get-char-property start 'invisible) 'org-hide-block) + (org-flag-region start end nil 'org-hide-block)) + (t + (org-flag-region start end t 'org-hide-block))) + ;; When the block is hidden away, make sure point is left in + ;; a visible part of the buffer. + (when (invisible-p (max (1- (point)) (point-min))) + (goto-char post)) + ;; Signal success. + t)))) + +(defun org-hide-block-toggle-all () + "Toggle the visibility of all blocks in the current buffer." + (org-block-map 'org-hide-block-toggle)) + +(defun org-hide-block-all () + "Fold all blocks in the current buffer." + (interactive) + (org-show-all '(blocks)) + (org-block-map 'org-hide-block-toggle-maybe)) + +;;;; Drawers visibility + +(defun org-cycle-hide-drawers (state &optional exceptions) + "Re-hide all drawers after a visibility state change. +STATE should be one of the symbols listed in the docstring of +`org-cycle-hook'. When non-nil, optional argument EXCEPTIONS is +a list of strings specifying which drawers should not be hidden." + (when (and (derived-mode-p 'org-mode) + (not (memq state '(overview folded contents)))) + (save-excursion + (let* ((globalp (eq state 'all)) + (beg (if globalp (point-min) (point))) + (end (if globalp (point-max) + (if (eq state 'children) + (save-excursion (outline-next-heading) (point)) + (org-end-of-subtree t))))) + (goto-char beg) + (while (re-search-forward org-drawer-regexp (max end (point)) t) + (unless (member-ignore-case (match-string 1) exceptions) + (let ((drawer (org-element-at-point))) + (when (memq (org-element-type drawer) '(drawer property-drawer)) + (org-flag-drawer t drawer) + ;; Make sure to skip drawer entirely or we might flag + ;; it another time when matching its ending line with + ;; `org-drawer-regexp'. + (goto-char (org-element-property :end drawer)))))))))) + +(defun org-flag-drawer (flag &optional element) + "When FLAG is non-nil, hide the drawer we are at. +Otherwise make it visible. When optional argument ELEMENT is +a parsed drawer, as returned by `org-element-at-point', hide or +show that drawer instead." + (let ((drawer (or element + (and (save-excursion + (beginning-of-line) + (looking-at-p org-drawer-regexp)) + (org-element-at-point))))) + (when (memq (org-element-type drawer) '(drawer property-drawer)) + (let ((post (org-element-property :post-affiliated drawer))) + (org-flag-region + (save-excursion (goto-char post) (line-end-position)) + (save-excursion (goto-char (org-element-property :end drawer)) + (skip-chars-backward " \t\n") + (line-end-position)) + flag 'org-hide-drawer) + ;; When the drawer is hidden away, make sure point lies in + ;; a visible part of the buffer. + (when (invisible-p (max (1- (point)) (point-min))) + (goto-char post)))))) + +;;;; Visibility cycling + +(defvar-local org-cycle-global-status nil) +(put 'org-cycle-global-status 'org-state t) +(defvar-local org-cycle-subtree-status nil) +(put 'org-cycle-subtree-status 'org-state t) + +(defun org-show-all (&optional types) + "Show all contents in the visible part of the buffer. +By default, the function expands headings, blocks and drawers. +When optional argument TYPE is a list of symbols among `blocks', +`drawers' and `headings', to only expand one specific type." + (interactive) + (dolist (type (or types '(blocks drawers headings))) + (org-flag-region (point-min) (point-max) nil + (pcase type + (`blocks 'org-hide-block) + (`drawers 'org-hide-drawer) + (`headings 'outline) + (_ (error "Invalid type: %S" type)))))) + +;;;###autoload +(defun org-cycle (&optional arg) + "TAB-action and visibility cycling for Org mode. + +This is the command invoked in Org mode by the `TAB' key. Its main +purpose is outline visibility cycling, but it also invokes other actions +in special contexts. + +When this function is called with a `\\[universal-argument]' prefix, rotate \ +the entire +buffer through 3 states (global cycling) + 1. OVERVIEW: Show only top-level headlines. + 2. CONTENTS: Show all headlines of all levels, but no body text. + 3. SHOW ALL: Show everything. + +With a `\\[universal-argument] \\[universal-argument]' prefix argument, \ +switch to the startup visibility, +determined by the variable `org-startup-folded', and by any VISIBILITY +properties in the buffer. + +With a `\\[universal-argument] \\[universal-argument] \ +\\[universal-argument]' prefix argument, show the entire buffer, including +any drawers. + +When inside a table, re-align the table and move to the next field. + +When point is at the beginning of a headline, rotate the subtree started +by this line through 3 different states (local cycling) + 1. FOLDED: Only the main headline is shown. + 2. CHILDREN: The main headline and the direct children are shown. + From this state, you can move to one of the children + and zoom in further. + 3. SUBTREE: Show the entire subtree, including body text. +If there is no subtree, switch directly from CHILDREN to FOLDED. + +When point is at the beginning of an empty headline and the variable +`org-cycle-level-after-item/entry-creation' is set, cycle the level +of the headline by demoting and promoting it to likely levels. This +speeds up creation document structure by pressing `TAB' once or several +times right after creating a new headline. + +When there is a numeric prefix, go up to a heading with level ARG, do +a `show-subtree' and return to the previous cursor position. If ARG +is negative, go up that many levels. + +When point is not at the beginning of a headline, execute the global +binding for `TAB', which is re-indenting the line. See the option +`org-cycle-emulate-tab' for details. + +As a special case, if point is at the beginning of the buffer and there is +no headline in line 1, this function will act as if called with prefix arg +\(`\\[universal-argument] TAB', same as `S-TAB') also when called without \ +prefix arg, but only +if the variable `org-cycle-global-at-bob' is t." + (interactive "P") + (org-load-modules-maybe) + (unless (or (run-hook-with-args-until-success 'org-tab-first-hook) + (and org-cycle-level-after-item/entry-creation + (or (org-cycle-level) + (org-cycle-item-indentation)))) + (let* ((limit-level + (or org-cycle-max-level + (and (boundp 'org-inlinetask-min-level) org-inlinetask-min-level (1- org-inlinetask-min-level)))) (nstars (and limit-level @@ -6740,7 +7033,7 @@ if the variable `org-cycle-global-at-bob' is t." (org-unlogged-message "Startup visibility, plus VISIBILITY properties")) ((equal arg '(64)) - (outline-show-all) + (org-show-all) (org-unlogged-message "Entire buffer visible, including drawers")) ((equal arg '(4)) (org-cycle-internal-global)) @@ -6799,8 +7092,6 @@ Use `\\[org-edit-special]' to edit table.el tables")) ((run-hook-with-args-until-success 'org-tab-after-check-for-cycling-hook)) - ((org-try-structure-completion)) - ((run-hook-with-args-until-success 'org-tab-before-tab-emulation-hook)) @@ -6843,7 +7134,7 @@ Use `\\[org-edit-special]' to edit table.el tables")) (eq org-cycle-global-status 'contents)) ;; We just showed the table of contents - now show everything (run-hook-with-args 'org-pre-cycle-hook 'all) - (outline-show-all) + (org-show-all '(headings blocks)) (unless ga (org-unlogged-message "SHOW ALL")) (setq org-cycle-global-status 'all) (run-hook-with-args 'org-cycle-hook 'all)) @@ -6859,11 +7150,6 @@ Use `\\[org-edit-special]' to edit table.el tables")) (defvar org-called-with-limited-levels nil "Non-nil when `org-with-limited-levels' is currently active.") -(defun org-invisible-p (&optional pos) - "Non-nil if the character after POS is invisible. -If POS is nil, use `point' instead." - (get-char-property (or pos (point)) 'invisible)) - (defun org-cycle-internal-local () "Do the local cycling action." (let ((goal-column 0) eoh eol eos has-children children-skipped struct) @@ -6920,11 +7206,7 @@ If POS is nil, use `point' instead." (org-list-set-item-visibility (point-at-bol) struct 'children) (org-show-entry) (org-with-limited-levels (org-show-children)) - ;; FIXME: This slows down the func way too much. - ;; How keep drawers hidden in subtree anyway? - ;; (when (memq 'org-cycle-hide-drawers org-cycle-hook) - ;; (org-cycle-hide-drawers 'subtree)) - + (org-show-set-visibility 'canonical) ;; Fold every list in subtree to top-level items. (when (eq org-cycle-include-plain-lists 'integrate) (save-excursion @@ -6952,7 +7234,7 @@ If POS is nil, use `point' instead." ;; now show everything. (unless (org-before-first-heading-p) (run-hook-with-args 'org-pre-cycle-hook 'subtree)) - (outline-flag-region eoh eos nil) + (org-flag-region eoh eos nil 'outline) (org-unlogged-message (if children-skipped "SUBTREE (NO CHILDREN)" "SUBTREE")) (setq org-cycle-subtree-status 'subtree) @@ -6961,7 +7243,7 @@ If POS is nil, use `point' instead." (t ;; Default action: hide the subtree. (run-hook-with-args 'org-pre-cycle-hook 'folded) - (outline-flag-region eoh eos t) + (org-flag-region eoh eos t 'outline) (org-unlogged-message "FOLDED") (setq org-cycle-subtree-status 'folded) (unless (org-before-first-heading-p) @@ -6977,7 +7259,7 @@ With a numeric prefix, show all headlines up to that level." (if (derived-mode-p 'org-mode) org-cycle-include-plain-lists nil))) (cond ((integerp arg) - (outline-show-all) + (org-show-all '(headings blocks)) (outline-hide-sublevels arg) (setq org-cycle-global-status 'contents)) ((equal arg '(4)) @@ -6995,47 +7277,42 @@ With a numeric prefix, show all headlines up to that level." (org-content)) ((or (eq org-startup-folded 'showeverything) (eq org-startup-folded nil)) - (outline-show-all))) + (org-show-all))) (unless (eq org-startup-folded 'showeverything) (when org-hide-block-startup (org-hide-block-all)) - (org-set-visibility-according-to-property 'no-cleanup) + (org-set-visibility-according-to-property) (org-cycle-hide-archived-subtrees 'all) (org-cycle-hide-drawers 'all) (org-cycle-show-empty-lines t))) -(defun org-set-visibility-according-to-property (&optional no-cleanup) - "Switch subtree visibilities according to :VISIBILITY: property." +(defun org-set-visibility-according-to-property () + "Switch subtree visibility according to VISIBILITY property." (interactive) - (org-with-wide-buffer - (goto-char (point-min)) - (while (re-search-forward "^[ \t]*:VISIBILITY:" nil t) - (if (not (org-at-property-p)) (outline-next-heading) - (let ((state (match-string 3))) - (save-excursion - (org-back-to-heading t) - (outline-hide-subtree) - (org-reveal) - (cond - ((equal state "folded") - (outline-hide-subtree)) - ((equal state "children") - (org-show-hidden-entry) - (org-show-children)) - ((equal state "content") - (save-excursion - (save-restriction - (org-narrow-to-subtree) - (org-content)))) - ((member state '("all" "showall")) - (outline-show-subtree))))))) - (unless no-cleanup - (org-cycle-hide-archived-subtrees 'all) - (org-cycle-hide-drawers 'all) - (org-cycle-show-empty-lines 'all)))) - -;; This function uses outline-regexp instead of the more fundamental -;; org-outline-regexp so that org-cycle-global works outside of Org -;; buffers, where outline-regexp is needed. + (let ((regexp (org-re-property "VISIBILITY"))) + (org-with-point-at 1 + (while (re-search-forward regexp nil t) + (let ((state (match-string 3))) + (if (not (org-at-property-p)) (outline-next-heading) + (save-excursion + (org-back-to-heading t) + (outline-hide-subtree) + (org-reveal) + (pcase state + ("folded" + (outline-hide-subtree)) + ("children" + (org-show-hidden-entry) + (org-show-children)) + ("content" + (save-excursion + (save-restriction + (org-narrow-to-subtree) + (org-content)))) + ((or "all" "showall") + (outline-show-subtree)) + (_ nil))) + (org-end-of-subtree))))))) + (defun org-overview () "Switch to overview mode, showing only top-level headlines. This shows all headlines with a level equal or greater than the level @@ -7047,7 +7324,7 @@ results." (let ((level (save-excursion (goto-char (point-min)) - (when (re-search-forward (concat "^" outline-regexp) nil t) + (when (re-search-forward org-outline-regexp-bol nil t) (goto-char (match-beginning 0)) (funcall outline-level))))) (and level (outline-hide-sublevels level))))) @@ -7083,14 +7360,6 @@ This function is the default value of the hook `org-cycle-hook'." ((eq state 'children) (or (org-subtree-end-visible-p) (recenter 1))) ((eq state 'subtree) (or (org-subtree-end-visible-p) (recenter 1)))))) -(defun org-remove-empty-overlays-at (pos) - "Remove outline overlays that do not contain non-white stuff." - (dolist (o (overlays-at pos)) - (and (eq 'outline (overlay-get o 'invisible)) - (not (string-match "\\S-" (buffer-substring (overlay-start o) - (overlay-end o)))) - (delete-overlay o)))) - (defun org-clean-visibility-after-subtree-move () "Fix visibility issues after moving a subtree." ;; First, find a reasonable region to look at: @@ -7116,11 +7385,10 @@ This function is the default value of the hook `org-cycle-hook'." (goto-char (point-min)) (while (re-search-forward re nil t) (when (and (not (org-invisible-p)) - (save-excursion - (goto-char (point-at-eol)) (org-invisible-p))) + (org-invisible-p (line-end-position))) (outline-hide-entry)))) - (org-cycle-show-empty-lines 'overview) - (org-cycle-hide-drawers 'overview))))) + (org-cycle-hide-drawers 'all) + (org-cycle-show-empty-lines 'overview))))) (defun org-cycle-show-empty-lines (state) "Show empty lines above all visible headlines. @@ -7156,7 +7424,7 @@ are at least `org-cycle-separator-lines' empty lines before the headline." (goto-char (match-beginning 0)) (skip-chars-backward " \t\n") (line-end-position))))) - (outline-flag-region b e nil)))))))) + (org-flag-region b e nil 'outline)))))))) ;; Never hide empty lines at the end of the file. (save-excursion (goto-char (point-max)) @@ -7164,433 +7432,80 @@ are at least `org-cycle-separator-lines' empty lines before the headline." (outline-end-of-heading) (when (and (looking-at "[ \t\n]+") (= (match-end 0) (point-max))) - (outline-flag-region (point) (match-end 0) nil)))) - -(defun org-show-empty-lines-in-parent () - "Move to the parent and re-show empty lines before visible headlines." - (save-excursion - (let ((context (if (org-up-heading-safe) 'children 'overview))) - (org-cycle-show-empty-lines context)))) - -(defun org-files-list () - "Return `org-agenda-files' list, plus all open Org files. -This is useful for operations that need to scan all of a user's -open and agenda-wise Org files." - (let ((files (mapcar 'expand-file-name (org-agenda-files)))) - (dolist (buf (buffer-list)) - (with-current-buffer buf - (when (and (derived-mode-p 'org-mode) (buffer-file-name)) - (cl-pushnew (expand-file-name (buffer-file-name)) files)))) - files)) - -(defsubst org-entry-beginning-position () - "Return the beginning position of the current entry." - (save-excursion (org-back-to-heading t) (point))) - -(defsubst org-entry-end-position () - "Return the end position of the current entry." - (save-excursion (outline-next-heading) (point))) - -(defun org-cycle-hide-drawers (state &optional exceptions) - "Re-hide all drawers after a visibility state change. -STATE should be one of the symbols listed in the docstring of -`org-cycle-hook'. When non-nil, optional argument EXCEPTIONS is -a list of strings specifying which drawers should not be hidden." - (when (and (derived-mode-p 'org-mode) - (not (memq state '(overview folded contents)))) - (save-excursion - (let* ((globalp (eq state 'all)) - (beg (if globalp (point-min) (point))) - (end (if globalp (point-max) - (if (eq state 'children) - (save-excursion (outline-next-heading) (point)) - (org-end-of-subtree t))))) - (goto-char beg) - (while (re-search-forward org-drawer-regexp (max end (point)) t) - (unless (member-ignore-case (match-string 1) exceptions) - (let ((drawer (org-element-at-point))) - (when (memq (org-element-type drawer) '(drawer property-drawer)) - (org-flag-drawer t drawer) - ;; Make sure to skip drawer entirely or we might flag - ;; it another time when matching its ending line with - ;; `org-drawer-regexp'. - (goto-char (org-element-property :end drawer)))))))))) - -(defun org-flag-drawer (flag &optional element) - "When FLAG is non-nil, hide the drawer we are at. -Otherwise make it visible. When optional argument ELEMENT is -a parsed drawer, as returned by `org-element-at-point', hide or -show that drawer instead." - (let ((drawer (or element - (and (save-excursion - (beginning-of-line) - (looking-at-p org-drawer-regexp)) - (org-element-at-point))))) - (when (memq (org-element-type drawer) '(drawer property-drawer)) - (let ((post (org-element-property :post-affiliated drawer))) - (save-excursion - (outline-flag-region - (progn (goto-char post) (line-end-position)) - (progn (goto-char (org-element-property :end drawer)) - (skip-chars-backward " \r\t\n") - (line-end-position)) - flag)) - ;; When the drawer is hidden away, make sure point lies in - ;; a visible part of the buffer. - (when (and flag (> (line-beginning-position) post)) - (goto-char post)))))) + (org-flag-region (point) (match-end 0) nil 'outline)))) -(defun org-subtree-end-visible-p () - "Is the end of the current subtree visible?" - (pos-visible-in-window-p - (save-excursion (org-end-of-subtree t) (point)))) - -(defun org-first-headline-recenter () - "Move cursor to the first headline and recenter the headline." - (let ((window (get-buffer-window))) - (when window - (goto-char (point-min)) - (when (re-search-forward (concat "^\\(" org-outline-regexp "\\)") nil t) - (set-window-start window (line-beginning-position)))))) +;;;; Reveal point location -;;; Saving and restoring visibility - -(defun org-outline-overlay-data (&optional use-markers) - "Return a list of the locations of all outline overlays. -These are overlays with the `invisible' property value `outline'. -The return value is a list of cons cells, with start and stop -positions for each overlay. -If USE-MARKERS is set, return the positions as markers." - (let (beg end) - (org-with-wide-buffer - (delq nil - (mapcar (lambda (o) - (when (eq (overlay-get o 'invisible) 'outline) - (setq beg (overlay-start o) - end (overlay-end o)) - (and beg end (> end beg) - (if use-markers - (cons (copy-marker beg) - (copy-marker end t)) - (cons beg end))))) - (overlays-in (point-min) (point-max))))))) - -(defun org-set-outline-overlay-data (data) - "Create visibility overlays for all positions in DATA. -DATA should have been made by `org-outline-overlay-data'." - (org-with-wide-buffer - (outline-show-all) - (dolist (c data) (outline-flag-region (car c) (cdr c) t)))) - -;;; Folding of blocks - -(defvar-local org-hide-block-overlays nil - "Overlays hiding blocks.") +(defun org-show-context (&optional key) + "Make sure point and context are visible. +Optional argument KEY, when non-nil, is a symbol. See +`org-show-context-detail' for allowed values and how much is to +be shown." + (org-show-set-visibility + (cond ((symbolp org-show-context-detail) org-show-context-detail) + ((cdr (assq key org-show-context-detail))) + (t (cdr (assq 'default org-show-context-detail)))))) -(defun org-block-map (function &optional start end) - "Call FUNCTION at the head of all source blocks in the current buffer. -Optional arguments START and END can be used to limit the range." - (let ((start (or start (point-min))) - (end (or end (point-max)))) +(defun org-show-set-visibility (detail) + "Set visibility around point according to DETAIL. +DETAIL is either nil, `minimal', `local', `ancestors', `lineage', +`tree', `canonical' or t. See `org-show-context-detail' for more +information." + ;; Show current heading and possibly its entry, following headline + ;; or all children. + (if (and (org-at-heading-p) (not (eq detail 'local))) + (org-flag-heading nil) + (org-show-entry) + ;; If point is hidden within a drawer or a block, make sure to + ;; expose it. + (dolist (o (overlays-at (point))) + (when (memq (overlay-get o 'invisible) + '(org-hide-block org-hide-drawer outline)) + (delete-overlay o))) + (unless (org-before-first-heading-p) + (org-with-limited-levels + (cl-case detail + ((tree canonical t) (org-show-children)) + ((nil minimal ancestors)) + (t (save-excursion + (outline-next-heading) + (org-flag-heading nil))))))) + ;; Show all siblings. + (when (eq detail 'lineage) (org-show-siblings)) + ;; Show ancestors, possibly with their children. + (when (memq detail '(ancestors lineage tree canonical t)) (save-excursion - (goto-char start) - (while (and (< (point) end) (re-search-forward org-block-regexp end t)) - (save-excursion - (save-match-data - (goto-char (match-beginning 0)) - (funcall function))))))) - -(defun org-hide-block-toggle-all () - "Toggle the visibility of all blocks in the current buffer." - (org-block-map 'org-hide-block-toggle)) - -(defun org-hide-block-all () - "Fold all blocks in the current buffer." - (interactive) - (org-show-block-all) - (org-block-map 'org-hide-block-toggle-maybe)) + (while (org-up-heading-safe) + (org-flag-heading nil) + (when (memq detail '(canonical t)) (org-show-entry)) + (when (memq detail '(tree canonical t)) (org-show-children)))))) -(defun org-show-block-all () - "Unfold all blocks in the current buffer." - (interactive) - (mapc #'delete-overlay org-hide-block-overlays) - (setq org-hide-block-overlays nil)) +(defvar org-reveal-start-hook nil + "Hook run before revealing a location.") -(defun org-hide-block-toggle-maybe () - "Toggle visibility of block at point. -Unlike to `org-hide-block-toggle', this function does not throw -an error. Return a non-nil value when toggling is successful." - (interactive) - (ignore-errors (org-hide-block-toggle))) +(defun org-reveal (&optional siblings) + "Show current entry, hierarchy above it, and the following headline. -(defun org-hide-block-toggle (&optional force) - "Toggle the visibility of the current block. -When optional argument FORCE is `off', make block visible. If it -is non-nil, hide it unconditionally. Throw an error when not at -a block. Return a non-nil value when toggling is successful." - (interactive) - (let ((element (org-element-at-point))) - (unless (memq (org-element-type element) - '(center-block comment-block dynamic-block example-block - export-block quote-block special-block - src-block verse-block)) - (user-error "Not at a block")) - (let* ((start (save-excursion - (goto-char (org-element-property :post-affiliated element)) - (line-end-position))) - (end (save-excursion - (goto-char (org-element-property :end element)) - (skip-chars-backward " \r\t\n") - (line-end-position))) - (overlays (overlays-at start))) - (cond - ;; Do nothing when not before or at the block opening line or - ;; at the block closing line. - ((let ((eol (line-end-position))) (and (> eol start) (/= eol end))) nil) - ((and (not (eq force 'off)) - (not (memq t (mapcar - (lambda (o) - (eq (overlay-get o 'invisible) 'org-hide-block)) - overlays)))) - (let ((ov (make-overlay start end))) - (overlay-put ov 'invisible 'org-hide-block) - ;; Make the block accessible to `isearch'. - (overlay-put - ov 'isearch-open-invisible - (lambda (ov) - (when (memq ov org-hide-block-overlays) - (setq org-hide-block-overlays (delq ov org-hide-block-overlays))) - (when (eq (overlay-get ov 'invisible) 'org-hide-block) - (delete-overlay ov)))) - (push ov org-hide-block-overlays) - ;; When the block is hidden away, make sure point is left in - ;; a visible part of the buffer. - (when (> (line-beginning-position) start) - (goto-char start) - (beginning-of-line)) - ;; Signal successful toggling. - t)) - ((or (not force) (eq force 'off)) - (dolist (ov overlays t) - (when (memq ov org-hide-block-overlays) - (setq org-hide-block-overlays (delq ov org-hide-block-overlays))) - (when (eq (overlay-get ov 'invisible) 'org-hide-block) - (delete-overlay ov)))))))) - -;; Remove overlays when changing major mode -(add-hook 'org-mode-hook - (lambda () (add-hook 'change-major-mode-hook - 'org-show-block-all 'append 'local))) - -;;; Org-goto - -(defvar org-goto-window-configuration nil) -(defvar org-goto-marker nil) -(defvar org-goto-map) -(defun org-goto-map () - "Set the keymap `org-goto'." - (setq org-goto-map - (let ((map (make-sparse-keymap))) - (let ((cmds '(isearch-forward isearch-backward kill-ring-save set-mark-command - mouse-drag-region universal-argument org-occur))) - (dolist (cmd cmds) - (substitute-key-definition cmd cmd map global-map))) - (suppress-keymap map) - (org-defkey map "\C-m" 'org-goto-ret) - (org-defkey map [(return)] 'org-goto-ret) - (org-defkey map [(left)] 'org-goto-left) - (org-defkey map [(right)] 'org-goto-right) - (org-defkey map [(control ?g)] 'org-goto-quit) - (org-defkey map "\C-i" 'org-cycle) - (org-defkey map [(tab)] 'org-cycle) - (org-defkey map [(down)] 'outline-next-visible-heading) - (org-defkey map [(up)] 'outline-previous-visible-heading) - (if org-goto-auto-isearch - (if (fboundp 'define-key-after) - (define-key-after map [t] 'org-goto-local-auto-isearch) - nil) - (org-defkey map "q" 'org-goto-quit) - (org-defkey map "n" 'outline-next-visible-heading) - (org-defkey map "p" 'outline-previous-visible-heading) - (org-defkey map "f" 'outline-forward-same-level) - (org-defkey map "b" 'outline-backward-same-level) - (org-defkey map "u" 'outline-up-heading)) - (org-defkey map "/" 'org-occur) - (org-defkey map "\C-c\C-n" 'outline-next-visible-heading) - (org-defkey map "\C-c\C-p" 'outline-previous-visible-heading) - (org-defkey map "\C-c\C-f" 'outline-forward-same-level) - (org-defkey map "\C-c\C-b" 'outline-backward-same-level) - (org-defkey map "\C-c\C-u" 'outline-up-heading) - map))) - -(defconst org-goto-help - "Browse buffer copy, to find location or copy text.%s -RET=jump to location C-g=quit and return to previous location -\[Up]/[Down]=next/prev headline TAB=cycle visibility [/] org-occur") - -(defvar org-goto-start-pos) ; dynamically scoped parameter - -(defun org-goto (&optional alternative-interface) - "Look up a different location in the current file, keeping current visibility. - -When you want look-up or go to a different location in a -document, the fastest way is often to fold the entire buffer and -then dive into the tree. This method has the disadvantage, that -the previous location will be folded, which may not be what you -want. - -This command works around this by showing a copy of the current -buffer in an indirect buffer, in overview mode. You can dive -into the tree in that copy, use org-occur and incremental search -to find a location. When pressing RET or `Q', the command -returns to the original buffer in which the visibility is still -unchanged. After RET it will also jump to the location selected -in the indirect buffer and expose the headline hierarchy above. - -With a prefix argument, use the alternative interface: e.g., if -`org-goto-interface' is `outline' use `outline-path-completion'." - (interactive "P") - (org-goto-map) - (let* ((org-refile-targets `((nil . (:maxlevel . ,org-goto-max-level)))) - (org-refile-use-outline-path t) - (org-refile-target-verify-function nil) - (interface - (if (not alternative-interface) - org-goto-interface - (if (eq org-goto-interface 'outline) - 'outline-path-completion - 'outline))) - (org-goto-start-pos (point)) - (selected-point - (if (eq interface 'outline) - (car (org-get-location (current-buffer) org-goto-help)) - (let ((pa (org-refile-get-location "Goto"))) - (org-refile-check-position pa) - (nth 3 pa))))) - (if selected-point - (progn - (org-mark-ring-push org-goto-start-pos) - (goto-char selected-point) - (when (or (org-invisible-p) (org-invisible-p2)) - (org-show-context 'org-goto))) - (message "Quit")))) - -(defvar org-goto-selected-point nil) ; dynamically scoped parameter -(defvar org-goto-exit-command nil) ; dynamically scoped parameter -(defvar org-goto-local-auto-isearch-map) ; defined below - -(defun org-get-location (_buf help) - "Let the user select a location in current buffer. -This function uses a recursive edit. It returns the selected position -or nil." - (org-no-popups - (let ((isearch-mode-map org-goto-local-auto-isearch-map) - (isearch-hide-immediately nil) - (isearch-search-fun-function - (lambda () 'org-goto-local-search-headings)) - (org-goto-selected-point org-goto-exit-command)) - (save-excursion - (save-window-excursion - (delete-other-windows) - (and (get-buffer "*org-goto*") (kill-buffer "*org-goto*")) - (pop-to-buffer-same-window - (condition-case nil - (make-indirect-buffer (current-buffer) "*org-goto*") - (error (make-indirect-buffer (current-buffer) "*org-goto*")))) - (with-output-to-temp-buffer "*Org Help*" - (princ (format help (if org-goto-auto-isearch - " Just type for auto-isearch." - " n/p/f/b/u to navigate, q to quit.")))) - (org-fit-window-to-buffer (get-buffer-window "*Org Help*")) - (setq buffer-read-only nil) - (let ((org-startup-truncated t) - (org-startup-folded nil) - (org-startup-align-all-tables nil)) - (org-mode) - (org-overview)) - (setq buffer-read-only t) - (if (and (boundp 'org-goto-start-pos) - (integer-or-marker-p org-goto-start-pos)) - (progn (goto-char org-goto-start-pos) - (when (org-invisible-p) - (org-show-set-visibility 'lineage))) - (goto-char (point-min))) - (let (org-special-ctrl-a/e) (org-beginning-of-line)) - (message "Select location and press RET") - (use-local-map org-goto-map) - (recursive-edit))) - (kill-buffer "*org-goto*") - (cons org-goto-selected-point org-goto-exit-command)))) - -(defvar org-goto-local-auto-isearch-map (make-sparse-keymap)) -(set-keymap-parent org-goto-local-auto-isearch-map isearch-mode-map) -;; `isearch-other-control-char' was removed in Emacs 24.4. -(if (fboundp 'isearch-other-control-char) - (progn - (define-key org-goto-local-auto-isearch-map "\C-i" 'isearch-other-control-char) - (define-key org-goto-local-auto-isearch-map "\C-m" 'isearch-other-control-char)) - (define-key org-goto-local-auto-isearch-map "\C-i" nil) - (define-key org-goto-local-auto-isearch-map "\C-m" nil) - (define-key org-goto-local-auto-isearch-map [return] nil)) - -(defun org-goto-local-search-headings (string bound noerror) - "Search and make sure that any matches are in headlines." - (catch 'return - (while (if isearch-forward - (search-forward string bound noerror) - (search-backward string bound noerror)) - (when (save-match-data - (and (save-excursion - (beginning-of-line) - (looking-at org-complex-heading-regexp)) - (or (not (match-beginning 5)) - (< (point) (match-beginning 5))))) - (throw 'return (point)))))) +This can be used to show a consistent set of context around +locations exposed with `org-show-context'. -(defun org-goto-local-auto-isearch () - "Start isearch." - (interactive) - (goto-char (point-min)) - (let ((keys (this-command-keys))) - (when (eq (lookup-key isearch-mode-map keys) 'isearch-printing-char) - (isearch-mode t) - (isearch-process-search-char (string-to-char keys))))) +With optional argument SIBLINGS, on each level of the hierarchy all +siblings are shown. This repairs the tree structure to what it would +look like when opened with hierarchical calls to `org-cycle'. -(defun org-goto-ret (&optional _arg) - "Finish `org-goto' by going to the new location." +With a \\[universal-argument] \\[universal-argument] prefix, \ +go to the parent and show the entire tree." (interactive "P") - (setq org-goto-selected-point (point)) - (setq org-goto-exit-command 'return) - (throw 'exit nil)) - -(defun org-goto-left () - "Finish `org-goto' by going to the new location." - (interactive) - (if (org-at-heading-p) - (progn - (beginning-of-line 1) - (setq org-goto-selected-point (point) - org-goto-exit-command 'left) - (throw 'exit nil)) - (user-error "Not on a heading"))) - -(defun org-goto-right () - "Finish `org-goto' by going to the new location." - (interactive) - (if (org-at-heading-p) - (progn - (setq org-goto-selected-point (point) - org-goto-exit-command 'right) - (throw 'exit nil)) - (user-error "Not on a heading"))) - -(defun org-goto-quit () - "Finish `org-goto' without cursor motion." - (interactive) - (setq org-goto-selected-point nil) - (setq org-goto-exit-command 'quit) - (throw 'exit nil)) + (run-hooks 'org-reveal-start-hook) + (cond ((equal siblings '(4)) (org-show-set-visibility 'canonical)) + ((equal siblings '(16)) + (save-excursion + (when (org-up-heading-safe) + (org-show-subtree) + (run-hook-with-args 'org-cycle-hook 'subtree)))) + (t (org-show-set-visibility 'lineage)))) + ;;; Indirect buffer display of subtrees (defvar org-indirect-dedicated-frame nil @@ -7658,7 +7573,7 @@ frame is not changed." (pop-to-buffer ibuf)) (t (error "Invalid value"))) (narrow-to-region beg end) - (outline-show-all) + (org-show-all '(headings blocks)) (goto-char pos) (run-hook-with-args 'org-cycle-hook 'all) (and (window-live-p cwin) (select-window cwin)))) @@ -7769,22 +7684,24 @@ unconditionally." (member arg '((4) (16))) (and (not invisible-ok) (invisible-p (max (1- (point)) (point-min))))) - ;; Position point at the location of insertion. - (if (not level) ;before first headline - (org-with-limited-levels (outline-next-heading)) - ;; Make sure we end up on a visible headline if INVISIBLE-OK - ;; is nil. - (org-with-limited-levels (org-back-to-heading invisible-ok)) - (cond ((equal arg '(16)) - (org-up-heading-safe) - (org-end-of-subtree t t)) - (t - (org-end-of-subtree t t)))) - (unless (bolp) (insert "\n")) ;ensure final newline + ;; Position point at the location of insertion. Make sure we + ;; end up on a visible headline if INVISIBLE-OK is nil. + (org-with-limited-levels + (if (not level) (outline-next-heading) ;before first headline + (org-back-to-heading invisible-ok) + (when (equal arg '(16)) (org-up-heading-safe)) + (org-end-of-subtree))) + (unless (bolp) (insert "\n")) (unless (and blank? (org-previous-line-empty-p)) (org-N-empty-lines-before-current (if blank? 1 0))) - (insert stars " \n") - (forward-char -1)) + (insert stars " ") + ;; When INVISIBLE-OK is non-nil, ensure newly created headline + ;; is visible. + (unless invisible-ok + (pcase (get-char-property-and-overlay (point) 'invisible) + (`(outline . ,o) + (move-overlay o (overlay-start o) (line-end-position 0))) + (_ nil)))) ;; At a headline... ((org-at-heading-p) (cond ((bolp) @@ -7800,17 +7717,15 @@ unconditionally." ;; Preserve tags. (let ((split (delete-and-extract-region (point) (match-end 4)))) (if (looking-at "[ \t]*$") (replace-match "") - (org-set-tags nil t)) + (org-align-tags)) (end-of-line) (when blank? (insert "\n")) (insert "\n" stars " ") - (when (org-string-nw-p split) (insert split)) - (when (eobp) (save-excursion (insert "\n"))))) + (when (org-string-nw-p split) (insert split)))) (t (end-of-line) (when blank? (insert "\n")) - (insert "\n" stars " ") - (when (eobp) (save-excursion (insert "\n")))))) + (insert "\n" stars " ")))) ;; On regular text, turn line into a headline or split, if ;; appropriate. ((bolp) @@ -7843,27 +7758,27 @@ So this will delete or add empty lines." When NO-TAGS is non-nil, don't include tags. When NO-TODO is non-nil, don't include TODO keywords. When NO-PRIORITY is non-nil, don't include priority cookie. -When NO-COMMENT is non-nil, don't include COMMENT string." - (save-excursion - (org-back-to-heading t) - (let ((case-fold-search nil)) - (looking-at org-complex-heading-regexp) - (let ((todo (and (not no-todo) (match-string 2))) - (priority (and (not no-priority) (match-string 3))) - (headline (pcase (match-string 4) - (`nil "") - ((and (guard no-comment) h) - (replace-regexp-in-string - (eval-when-compile - (format "\\`%s[ \t]+" org-comment-string)) - "" h)) - (h h))) - (tags (and (not no-tags) (match-string 5)))) - (mapconcat #'identity - (delq nil (list todo priority headline tags)) - " "))))) - -(defvar orgstruct-mode) ; defined below +When NO-COMMENT is non-nil, don't include COMMENT string. +Return nil before first heading." + (unless (org-before-first-heading-p) + (save-excursion + (org-back-to-heading t) + (let ((case-fold-search nil)) + (looking-at org-complex-heading-regexp) + (let ((todo (and (not no-todo) (match-string 2))) + (priority (and (not no-priority) (match-string 3))) + (headline (pcase (match-string 4) + (`nil "") + ((and (guard no-comment) h) + (replace-regexp-in-string + (eval-when-compile + (format "\\`%s[ \t]+" org-comment-string)) + "" h)) + (h h))) + (tags (and (not no-tags) (match-string 5)))) + (mapconcat #'identity + (delq nil (list todo priority headline tags)) + " ")))))) (defun org-heading-components () "Return the components of the current heading. @@ -7876,24 +7791,13 @@ This is a list with the following elements: - the tags string, or nil." (save-excursion (org-back-to-heading t) - (when (let (case-fold-search) - (looking-at - (if orgstruct-mode - org-heading-regexp - org-complex-heading-regexp))) - (if orgstruct-mode - (list (length (match-string 1)) - (org-reduced-level (length (match-string 1))) - nil - nil - (match-string 2) - nil) - (list (length (match-string 1)) - (org-reduced-level (length (match-string 1))) - (match-string-no-properties 2) - (and (match-end 3) (aref (match-string 3) 2)) - (match-string-no-properties 4) - (match-string-no-properties 5)))))) + (when (let (case-fold-search) (looking-at org-complex-heading-regexp)) + (list (length (match-string 1)) + (org-reduced-level (length (match-string 1))) + (match-string-no-properties 2) + (and (match-end 3) (aref (match-string 3) 2)) + (match-string-no-properties 4) + (match-string-no-properties 5))))) (defun org-get-entry () "Get the entry text, after heading, entire subtree." @@ -7916,7 +7820,7 @@ Set it to HEADING when provided." (if old (replace-match new t t nil 4) (goto-char (or (match-end 3) (match-end 2) (match-end 1))) (insert " " new)) - (org-set-tags nil t) + (org-align-tags) (when (looking-at "[ \t]*$") (replace-match "")))))))) (defun org-insert-heading-after-current () @@ -8112,7 +8016,7 @@ odd number. Returns values greater than 0." (user-error "Cannot promote to level 0. UNDO to recover if necessary")) (t (replace-match up-head nil t))) (unless (= level 1) - (when org-auto-align-tags (org-set-tags nil 'ignore-column)) + (when org-auto-align-tags (org-align-tags)) (when org-adapt-indentation (org-fixup-indentation (- diff)))) (run-hooks 'org-after-promote-entry-hook)))) @@ -8126,7 +8030,7 @@ odd number. Returns values greater than 0." (down-head (concat (make-string (org-get-valid-level level 1) ?*) " ")) (diff (abs (- level (length down-head) -1)))) (replace-match down-head nil t) - (when org-auto-align-tags (org-set-tags nil 'ignore-column)) + (when org-auto-align-tags (org-align-tags)) (when org-adapt-indentation (org-fixup-indentation diff)) (run-hooks 'org-after-demote-entry-hook)))) @@ -8285,7 +8189,7 @@ Assume point is at a heading or an inlinetask beginning." ((looking-at-p org-outline-regexp) (forward-line)) ((looking-at-p "[ \t]*$") (forward-line)) (t - (indent-line-to (+ (org-get-indentation) diff)) + (indent-line-to (+ (current-indentation) diff)) (beginning-of-line) (or (and (looking-at-p "[ \t]*#\\+BEGIN_\\(EXAMPLE\\|SRC\\)") (let ((e (org-element-at-point))) @@ -8351,83 +8255,62 @@ case." (org-move-subtree-down (- (prefix-numeric-value arg)))) (defun org-move-subtree-down (&optional arg) - "Move the current subtree down past ARG headlines of the same level." - (interactive "p") - (setq arg (prefix-numeric-value arg)) - (let ((movfunc (if (> arg 0) 'org-get-next-sibling - 'org-get-last-sibling)) - (ins-point (make-marker)) - (cnt (abs arg)) - (col (current-column)) - beg beg0 end txt folded ne-beg ne-end ne-ins ins-end) - ;; Select the tree - (org-back-to-heading) - (setq beg0 (point)) - (save-excursion - (setq ne-beg (org-back-over-empty-lines)) - (setq beg (point))) - (save-match-data - (save-excursion (outline-end-of-heading) - (setq folded (org-invisible-p))) - (progn (org-end-of-subtree nil t) - (unless (eobp) (backward-char)))) - (outline-next-heading) - (setq ne-end (org-back-over-empty-lines)) - (setq end (point)) - (goto-char beg0) - (when (and (> arg 0) (org-first-sibling-p) (< ne-end ne-beg)) - ;; include less whitespace - (save-excursion - (goto-char beg) - (forward-line (- ne-beg ne-end)) - (setq beg (point)))) - ;; Find insertion point, with error handling - (while (> cnt 0) - (or (and (funcall movfunc) (looking-at org-outline-regexp)) - (progn (goto-char beg0) - (user-error "Cannot move past superior level or buffer limit"))) - (setq cnt (1- cnt))) - (when (> arg 0) - ;; Moving forward - still need to move over subtree - (org-end-of-subtree t t) - (save-excursion - (org-back-over-empty-lines) - (or (bolp) (newline)))) - (setq ne-ins (org-back-over-empty-lines)) - (move-marker ins-point (point)) - (setq txt (buffer-substring beg end)) - (org-save-markers-in-region beg end) - (delete-region beg end) - (org-remove-empty-overlays-at beg) - (or (= beg (point-min)) (outline-flag-region (1- beg) beg nil)) - (or (bobp) (outline-flag-region (1- (point)) (point) nil)) - (and (not (bolp)) (looking-at "\n") (forward-char 1)) - (let ((bbb (point))) - (insert-before-markers txt) - (org-reinstall-markers-in-region bbb) - (move-marker ins-point bbb)) - (or (bolp) (insert "\n")) - (setq ins-end (point)) - (goto-char ins-point) - (org-skip-whitespace) - (when (and (< arg 0) - (org-first-sibling-p) - (> ne-ins ne-beg)) - ;; Move whitespace back to beginning - (save-excursion - (goto-char ins-end) - (let ((kill-whole-line t)) - (kill-line (- ne-ins ne-beg)) (point))) - (insert (make-string (- ne-ins ne-beg) ?\n))) - (move-marker ins-point nil) - (if folded - (outline-hide-subtree) - (org-show-entry) - (org-show-children) - (org-cycle-hide-drawers 'children)) - (org-clean-visibility-after-subtree-move) - ;; move back to the initial column we were at - (move-to-column col))) + "Move the current subtree down past ARG headlines of the same level." + (interactive "p") + (setq arg (prefix-numeric-value arg)) + (org-preserve-local-variables + (let ((movfunc (if (> arg 0) 'org-get-next-sibling + 'org-get-last-sibling)) + (ins-point (make-marker)) + (cnt (abs arg)) + (col (current-column)) + beg end txt folded) + ;; Select the tree + (org-back-to-heading) + (setq beg (point)) + (save-match-data + (save-excursion (outline-end-of-heading) + (setq folded (org-invisible-p))) + (progn (org-end-of-subtree nil t) + (unless (eobp) (backward-char)))) + (outline-next-heading) + (setq end (point)) + (goto-char beg) + ;; Find insertion point, with error handling + (while (> cnt 0) + (unless (and (funcall movfunc) (looking-at org-outline-regexp)) + (goto-char beg) + (user-error "Cannot move past superior level or buffer limit")) + (setq cnt (1- cnt))) + (when (> arg 0) + ;; Moving forward - still need to move over subtree + (org-end-of-subtree t t) + (save-excursion + (org-back-over-empty-lines) + (or (bolp) (newline)))) + (move-marker ins-point (point)) + (setq txt (buffer-substring beg end)) + (org-save-markers-in-region beg end) + (delete-region beg end) + (org-remove-empty-overlays-at beg) + (unless (= beg (point-min)) (org-flag-region (1- beg) beg nil 'outline)) + (unless (bobp) (org-flag-region (1- (point)) (point) nil 'outline)) + (and (not (bolp)) (looking-at "\n") (forward-char 1)) + (let ((bbb (point))) + (insert-before-markers txt) + (org-reinstall-markers-in-region bbb) + (move-marker ins-point bbb)) + (or (bolp) (insert "\n")) + (goto-char ins-point) + (org-skip-whitespace) + (move-marker ins-point nil) + (if folded + (outline-hide-subtree) + (org-show-entry) + (org-show-children)) + (org-clean-visibility-after-subtree-move) + ;; move back to the initial column we were at + (move-to-column col)))) (defvar org-subtree-clip "" "Clipboard for cut and paste of subtrees. @@ -8446,7 +8329,7 @@ This is a short-hand for marking the subtree and then cutting it." (org-copy-subtree n 'cut)) (defun org-copy-subtree (&optional n cut force-store-markers nosubtrees) - "Copy the current subtree it in the clipboard. + "Copy the current subtree into the clipboard. With prefix arg N, copy this many sequential subtrees. This is a short-hand for marking the subtree and then copying it. If CUT is non-nil, actually cut the subtree. @@ -8454,38 +8337,40 @@ If FORCE-STORE-MARKERS is non-nil, store the relative locations of some markers in the region, even if CUT is non-nil. This is useful if the caller implements cut-and-paste as copy-then-paste-then-cut." (interactive "p") - (let (beg end folded (beg0 (point))) - (if (called-interactively-p 'any) - (org-back-to-heading nil) ; take what looks like a subtree - (org-back-to-heading t)) ; take what is really there - (setq beg (point)) - (skip-chars-forward " \t\r\n") - (save-match-data - (if nosubtrees - (outline-next-heading) - (save-excursion (outline-end-of-heading) - (setq folded (org-invisible-p))) - (ignore-errors (org-forward-heading-same-level (1- n) t)) - (org-end-of-subtree t t))) - ;; Include the end of an inlinetask - (when (and (featurep 'org-inlinetask) - (looking-at-p (concat (org-inlinetask-outline-regexp) - "END[ \t]*$"))) - (end-of-line)) - (setq end (point)) - (goto-char beg0) - (when (> end beg) - (setq org-subtree-clip-folded folded) - (when (or cut force-store-markers) - (org-save-markers-in-region beg end)) - (if cut (kill-region beg end) (copy-region-as-kill beg end)) - (setq org-subtree-clip (current-kill 0)) - (message "%s: Subtree(s) with %d characters" - (if cut "Cut" "Copied") - (length org-subtree-clip))))) + (org-preserve-local-variables + (let (beg end folded (beg0 (point))) + (if (called-interactively-p 'any) + (org-back-to-heading nil) ; take what looks like a subtree + (org-back-to-heading t)) ; take what is really there + (setq beg (point)) + (skip-chars-forward " \t\r\n") + (save-match-data + (if nosubtrees + (outline-next-heading) + (save-excursion (outline-end-of-heading) + (setq folded (org-invisible-p))) + (ignore-errors (org-forward-heading-same-level (1- n) t)) + (org-end-of-subtree t t))) + ;; Include the end of an inlinetask + (when (and (featurep 'org-inlinetask) + (looking-at-p (concat (org-inlinetask-outline-regexp) + "END[ \t]*$"))) + (end-of-line)) + (setq end (point)) + (goto-char beg0) + (when (> end beg) + (setq org-subtree-clip-folded folded) + (when (or cut force-store-markers) + (org-save-markers-in-region beg end)) + (if cut (kill-region beg end) (copy-region-as-kill beg end)) + (setq org-subtree-clip (current-kill 0)) + (message "%s: Subtree(s) with %d characters" + (if cut "Cut" "Copied") + (length org-subtree-clip)))))) (defun org-paste-subtree (&optional level tree for-yank remove) "Paste the clipboard as a subtree, with modification of headline level. + The entire subtree is promoted or demoted in order to match a new headline level. @@ -8513,42 +8398,33 @@ When REMOVE is non-nil, remove the subtree from the clipboard." (interactive "P") (setq tree (or tree (and kill-ring (current-kill 0)))) (unless (org-kill-is-subtree-p tree) - (user-error "%s" - (substitute-command-keys - "The kill is not a (set of) tree(s) - please use \\[yank] to yank anyway"))) + (user-error + (substitute-command-keys + "The kill is not a (set of) tree(s). Use `\\[yank]' to yank anyway"))) (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)) - (force-level (cond (level (prefix-numeric-value level)) - ((and (looking-at "[ \t]*$") - (string-match - "^\\*+$" (buffer-substring - (point-at-bol) (point)))) - (- (match-end 0) (match-beginning 0))) - ((and (bolp) - (looking-at org-outline-regexp)) - (- (match-end 0) (point) 1)))) - (previous-level (save-excursion - (condition-case nil - (progn - (outline-previous-visible-heading 1) - (if (looking-at ^re_) - (- (match-end 0) (match-beginning 0) 1) - 1)) - (error 1)))) - (next-level (save-excursion - (condition-case nil - (progn - (or (looking-at org-outline-regexp) - (outline-next-visible-heading 1)) - (if (looking-at ^re_) - (- (match-end 0) (match-beginning 0) 1) - 1)) - (error 1)))) + (force-level + (cond + (level (prefix-numeric-value level)) + ;; When point is after the stars in an otherwise empty + ;; headline, use the number of stars as the forced level. + ((and (org-match-line "^\\*+[ \t]*$") + (not (eq ?* (char-after)))) + (org-outline-level)) + ((looking-at-p org-outline-regexp-bol) (org-outline-level)))) + (previous-level + (save-excursion + (org-previous-visible-heading 1) + (if (org-at-heading-p) (org-outline-level) 1))) + (next-level + (save-excursion + (if (org-at-heading-p) (org-outline-level) + (org-next-visible-heading 1) + (if (org-at-heading-p) (org-outline-level) 1)))) (new-level (or force-level (max previous-level next-level))) (shift (if (or (= old-level -1) (= new-level -1) @@ -8556,16 +8432,19 @@ When REMOVE is non-nil, remove the subtree from the clipboard." 0 (- new-level old-level))) (delta (if (> shift 0) -1 1)) - (func (if (> shift 0) 'org-demote 'org-promote)) + (func (if (> shift 0) #'org-demote #'org-promote)) (org-odd-levels-only nil) beg end newend) - ;; Remove the forced level indicator - (when force-level - (delete-region (point-at-bol) (point))) - ;; Paste - (beginning-of-line (if (bolp) 1 2)) + ;; Remove the forced level indicator. + (when (and force-level (not level)) + (delete-region (line-beginning-position) (point))) + ;; Paste before the next visible heading or at end of buffer, + ;; unless point is at the beginning of a headline. + (unless (and (bolp) (org-at-heading-p)) + (org-next-visible-heading 1) + (unless (bolp) (insert "\n"))) (setq beg (point)) - (and (fboundp 'org-id-paste-tracker) (org-id-paste-tracker txt)) + (when (fboundp 'org-id-paste-tracker) (org-id-paste-tracker txt)) (insert-before-markers txt) (unless (string-suffix-p "\n" txt) (insert "\n")) (setq newend (point)) @@ -8576,7 +8455,7 @@ When REMOVE is non-nil, remove the subtree from the clipboard." (setq beg (point)) (when (and (org-invisible-p) visp) (save-excursion (outline-show-heading))) - ;; Shift if necessary + ;; Shift if necessary. (unless (= shift 0) (save-restriction (narrow-to-region beg end) @@ -8585,16 +8464,16 @@ When REMOVE is non-nil, remove the subtree from the clipboard." (setq shift (+ delta shift))) (goto-char (point-min)) (setq newend (point-max)))) - (when (or (called-interactively-p 'interactive) for-yank) + (when (or for-yank (called-interactively-p 'interactive)) (message "Clipboard pasted as level %d subtree" new-level)) (when (and (not for-yank) ; in this case, org-yank will decide about folding kill-ring - (eq org-subtree-clip (current-kill 0)) + (equal org-subtree-clip (current-kill 0)) org-subtree-clip-folded) ;; The tree was folded before it was killed/copied (outline-hide-subtree)) - (and for-yank (goto-char newend)) - (and remove (setq kill-ring (cdr kill-ring)))))) + (when for-yank (goto-char newend)) + (when remove (pop kill-ring))))) (defun org-kill-is-subtree-p (&optional txt) "Check if the current kill is an outline subtree, or a set of trees. @@ -8666,6 +8545,13 @@ If yes, remember the marker and the distance to BEG." (when (and (org-at-heading-p) (not (eobp))) (backward-char 1)) (point))))))) +(defun org-toggle-narrow-to-subtree () + "Narrow to the subtree at point or widen a narrowed buffer." + (interactive) + (if (buffer-narrowed-p) + (widen) + (org-narrow-to-subtree))) + (defun org-narrow-to-block () "Narrow buffer to the current block." (interactive) @@ -8904,7 +8790,7 @@ function is being called interactively." (setq end (point-max)) (setq what "top-level") (goto-char start) - (outline-show-all))) + (org-show-all '(headings blocks)))) (setq beg (point)) (when (>= beg end) (goto-char start) (user-error "Nothing to sort")) @@ -8953,95 +8839,94 @@ function is being called interactively." (when (and (eq (org-clock-is-active) (current-buffer)) (<= start (marker-position org-clock-marker)) (>= end (marker-position org-clock-marker))) - (org-with-silent-modifications - (put-text-property (1- org-clock-marker) org-clock-marker - :org-clock-marker-backup t)) + (with-silent-modifications + (put-text-property (1- org-clock-marker) org-clock-marker + :org-clock-marker-backup t)) t)) (dcst (downcase sorting-type)) (case-fold-search nil) (now (current-time))) - (sort-subr - (/= dcst sorting-type) - ;; This function moves to the beginning character of the "record" to - ;; be sorted. - (lambda nil - (if (re-search-forward re nil t) - (goto-char (match-beginning 0)) - (goto-char (point-max)))) - ;; This function moves to the last character of the "record" being - ;; sorted. - (lambda nil - (save-match-data - (condition-case nil - (outline-forward-same-level 1) - (error - (goto-char (point-max)))))) - ;; This function returns the value that gets sorted against. - (lambda nil - (cond - ((= dcst ?n) - (if (looking-at org-complex-heading-regexp) - (string-to-number (org-sort-remove-invisible (match-string 4))) - nil)) - ((= dcst ?a) - (if (looking-at org-complex-heading-regexp) - (funcall case-func (org-sort-remove-invisible (match-string 4))) - nil)) - ((= dcst ?k) - (or (get-text-property (point) :org-clock-minutes) 0)) - ((= dcst ?t) - (let ((end (save-excursion (outline-next-heading) (point)))) - (if (or (re-search-forward org-ts-regexp end t) - (re-search-forward org-ts-regexp-both end t)) - (org-time-string-to-seconds (match-string 0)) - (float-time now)))) - ((= dcst ?c) - (let ((end (save-excursion (outline-next-heading) (point)))) - (if (re-search-forward - (concat "^[ \t]*\\[" org-ts-regexp1 "\\]") - end t) - (org-time-string-to-seconds (match-string 0)) - (float-time now)))) - ((= dcst ?s) - (let ((end (save-excursion (outline-next-heading) (point)))) - (if (re-search-forward org-scheduled-time-regexp end t) - (org-time-string-to-seconds (match-string 1)) - (float-time now)))) - ((= dcst ?d) - (let ((end (save-excursion (outline-next-heading) (point)))) - (if (re-search-forward org-deadline-time-regexp end t) - (org-time-string-to-seconds (match-string 1)) - (float-time now)))) - ((= dcst ?p) - (if (re-search-forward org-priority-regexp (point-at-eol) t) - (string-to-char (match-string 2)) - org-default-priority)) - ((= dcst ?r) - (or (org-entry-get nil property) "")) - ((= dcst ?o) - (when (looking-at org-complex-heading-regexp) - (let* ((m (match-string 2)) - (s (if (member m org-done-keywords) '- '+))) - (- 99 (funcall s (length (member m org-todo-keywords-1))))))) - ((= dcst ?f) - (if getkey-func - (progn - (setq tmp (funcall getkey-func)) - (when (stringp tmp) (setq tmp (funcall case-func tmp))) - tmp) - (error "Invalid key function `%s'" getkey-func))) - (t (error "Invalid sorting type `%c'" sorting-type)))) - nil - (cond - ((= dcst ?a) 'string<) - ((= dcst ?f) - (or compare-func - (and interactive? - (org-read-function - (concat "Function for comparing keys " - "(empty for default `sort-subr' predicate): ") - 'allow-empty)))) - ((member dcst '(?p ?t ?s ?d ?c ?k)) '<))) + (org-preserve-local-variables + (sort-subr + (/= dcst sorting-type) + ;; This function moves to the beginning character of the + ;; "record" to be sorted. + (lambda nil + (if (re-search-forward re nil t) + (goto-char (match-beginning 0)) + (goto-char (point-max)))) + ;; This function moves to the last character of the "record" being + ;; sorted. + (lambda nil + (save-match-data + (condition-case nil + (outline-forward-same-level 1) + (error + (goto-char (point-max)))))) + ;; This function returns the value that gets sorted against. + (lambda () + (cond + ((= dcst ?n) + (string-to-number + (org-sort-remove-invisible (org-get-heading t t t t)))) + ((= dcst ?a) + (funcall case-func + (org-sort-remove-invisible (org-get-heading t t t t)))) + ((= dcst ?k) + (or (get-text-property (point) :org-clock-minutes) 0)) + ((= dcst ?t) + (let ((end (save-excursion (outline-next-heading) (point)))) + (if (or (re-search-forward org-ts-regexp end t) + (re-search-forward org-ts-regexp-both end t)) + (org-time-string-to-seconds (match-string 0)) + (float-time now)))) + ((= dcst ?c) + (let ((end (save-excursion (outline-next-heading) (point)))) + (if (re-search-forward + (concat "^[ \t]*\\[" org-ts-regexp1 "\\]") + end t) + (org-time-string-to-seconds (match-string 0)) + (float-time now)))) + ((= dcst ?s) + (let ((end (save-excursion (outline-next-heading) (point)))) + (if (re-search-forward org-scheduled-time-regexp end t) + (org-time-string-to-seconds (match-string 1)) + (float-time now)))) + ((= dcst ?d) + (let ((end (save-excursion (outline-next-heading) (point)))) + (if (re-search-forward org-deadline-time-regexp end t) + (org-time-string-to-seconds (match-string 1)) + (float-time now)))) + ((= dcst ?p) + (if (re-search-forward org-priority-regexp (point-at-eol) t) + (string-to-char (match-string 2)) + org-default-priority)) + ((= dcst ?r) + (or (org-entry-get nil property) "")) + ((= dcst ?o) + (when (looking-at org-complex-heading-regexp) + (let* ((m (match-string 2)) + (s (if (member m org-done-keywords) '- '+))) + (- 99 (funcall s (length (member m org-todo-keywords-1))))))) + ((= dcst ?f) + (if getkey-func + (progn + (setq tmp (funcall getkey-func)) + (when (stringp tmp) (setq tmp (funcall case-func tmp))) + tmp) + (error "Invalid key function `%s'" getkey-func))) + (t (error "Invalid sorting type `%c'" sorting-type)))) + nil + (cond + ((= dcst ?a) 'org-string-collate-lessp) + ((= dcst ?f) + (or compare-func + (and interactive? + (org-read-function + (concat "Function for comparing keys " + "(empty for default `sort-subr' predicate): ") + 'allow-empty)))) + ((member dcst '(?p ?t ?s ?d ?c ?k)) '<)))) (when restore-clock? (move-marker org-clock-marker (1+ (next-single-property-change @@ -9051,272 +8936,6 @@ function is being called interactively." (run-hooks 'org-after-sorting-entries-or-items-hook) (message "Sorting entries...done"))) -;;; The orgstruct minor mode - -;; Define a minor mode which can be used in other modes in order to -;; integrate the Org mode structure editing commands. - -;; This is really a hack, because the Org mode structure commands use -;; keys which normally belong to the major mode. Here is how it -;; works: The minor mode defines all the keys necessary to operate the -;; structure commands, but wraps the commands into a function which -;; tests if the cursor is currently at a headline or a plain list -;; item. If that is the case, the structure command is used, -;; temporarily setting many Org mode variables like regular -;; expressions for filling etc. However, when any of those keys is -;; used at a different location, function uses `key-binding' to look -;; up if the key has an associated command in another currently active -;; keymap (minor modes, major mode, global), and executes that -;; command. There might be problems if any of the keys is otherwise -;; used as a prefix key. - -(defcustom orgstruct-heading-prefix-regexp "" - "Regexp that matches the custom prefix of Org headlines in -orgstruct(++)-mode." - :group 'org - :version "26.1" - :package-version '(Org . "8.3") - :type 'regexp) -;;;###autoload(put 'orgstruct-heading-prefix-regexp 'safe-local-variable 'stringp) - -(defcustom orgstruct-setup-hook nil - "Hook run after orgstruct-mode-map is filled." - :group 'org - :version "24.4" - :package-version '(Org . "8.0") - :type 'hook) - -(defvar orgstruct-initialized nil) - -(defvar org-local-vars nil - "List of local variables, for use by `orgstruct-mode'.") - -;;;###autoload -(define-minor-mode orgstruct-mode - "Toggle the minor mode `orgstruct-mode'. -This mode is for using Org mode structure commands in other -modes. The following keys behave as if Org mode were active, if -the cursor is on a headline, or on a plain list item (both as -defined by Org mode)." - nil " OrgStruct" (make-sparse-keymap) - (funcall (if orgstruct-mode - 'add-to-invisibility-spec - 'remove-from-invisibility-spec) - '(outline . t)) - (when orgstruct-mode - (org-load-modules-maybe) - (unless orgstruct-initialized - (orgstruct-setup) - (setq orgstruct-initialized t)))) - -;;;###autoload -(defun turn-on-orgstruct () - "Unconditionally turn on `orgstruct-mode'." - (orgstruct-mode 1)) - -(defvar-local orgstruct-is-++ nil - "Is `orgstruct-mode' in ++ version in the current-buffer?") -(defvar-local org-fb-vars nil) -(defun orgstruct++-mode (&optional arg) - "Toggle `orgstruct-mode', the enhanced version of it. -In addition to setting orgstruct-mode, this also exports all -indentation and autofilling variables from Org mode into the -buffer. It will also recognize item context in multiline items." - (interactive "P") - (setq arg (prefix-numeric-value (or arg (if orgstruct-mode -1 1)))) - (if (< arg 1) - (progn (orgstruct-mode -1) - (dolist (v org-fb-vars) - (set (make-local-variable (car v)) - (if (eq (car-safe (cadr v)) 'quote) - (cl-cadadr v) - (nth 1 v))))) - (orgstruct-mode 1) - (setq org-fb-vars nil) - (unless org-local-vars - (setq org-local-vars (org-get-local-variables))) - (let (var val) - (dolist (x org-local-vars) - (when (string-match - "^\\(paragraph-\\|auto-fill\\|normal-auto-fill\\|fill-paragraph\ -\\|fill-prefix\\|indent-\\)" - (symbol-name (car x))) - (setq var (car x) val (nth 1 x)) - (push (list var `(quote ,(eval var))) org-fb-vars) - (set (make-local-variable var) - (if (eq (car-safe val) 'quote) (nth 1 val) val)))) - (setq-local orgstruct-is-++ t)))) - -;;;###autoload -(defun turn-on-orgstruct++ () - "Unconditionally turn on `orgstruct++-mode'." - (orgstruct++-mode 1)) - -(defun orgstruct-error () - "Error when there is no default binding for a structure key." - (interactive) - (funcall (if (fboundp 'user-error) - 'user-error - 'error) - "This key has no function outside structure elements")) - -(defun orgstruct-setup () - "Setup orgstruct keymap." - (dolist (cell '((org-demote . t) - (org-metaleft . t) - (org-metaright . t) - (org-promote . t) - (org-shiftmetaleft . t) - (org-shiftmetaright . t) - org-backward-element - org-backward-heading-same-level - org-ctrl-c-ret - org-ctrl-c-minus - org-ctrl-c-star - org-cycle - org-force-cycle-archived - org-forward-heading-same-level - org-insert-heading - org-insert-heading-respect-content - org-kill-note-or-show-branches - org-mark-subtree - org-meta-return - org-metadown - org-metaup - org-narrow-to-subtree - org-promote-subtree - org-reveal - org-shiftdown - org-shiftleft - org-shiftmetadown - org-shiftmetaup - org-shiftright - org-shifttab - org-shifttab - org-shiftup - org-show-children - org-show-subtree - org-sort - org-up-element - outline-demote - outline-next-visible-heading - outline-previous-visible-heading - outline-promote - outline-up-heading)) - (let ((f (or (car-safe cell) cell)) - (disable-when-heading-prefix (cdr-safe cell))) - (when (fboundp f) - (let ((new-bindings)) - (dolist (binding (nconc (where-is-internal f org-mode-map) - (where-is-internal f outline-mode-map))) - (push binding new-bindings) - ;; TODO use local-function-key-map - (dolist (rep '(("" . "TAB") - ("" . "RET") - ("" . "ESC") - ("" . "DEL"))) - (setq binding (read-kbd-macro - (let ((case-fold-search)) - (replace-regexp-in-string - (regexp-quote (cdr rep)) - (car rep) - (key-description binding))))) - (cl-pushnew binding new-bindings :test 'equal))) - (dolist (binding new-bindings) - (let ((key (lookup-key orgstruct-mode-map binding))) - (when (or (not key) (numberp key)) - (ignore-errors - (org-defkey orgstruct-mode-map - binding - (orgstruct-make-binding - f binding disable-when-heading-prefix)))))))))) - (run-hooks 'orgstruct-setup-hook)) - -(defun orgstruct-make-binding (fun key disable-when-heading-prefix) - "Create a function for binding in the structure minor mode. -FUN is the command to call inside a table. KEY is the key that -should be checked in for a command to execute outside of tables. -Non-nil `disable-when-heading-prefix' means to disable the command -if `orgstruct-heading-prefix-regexp' is not empty." - (let ((name (concat "orgstruct-hijacker-" (symbol-name fun)))) - (let ((nname name) - (i 0)) - (while (fboundp (intern nname)) - (setq nname (format "%s-%d" name (setq i (1+ i))))) - (setq name (intern nname))) - (eval - (let ((bindings '((org-heading-regexp - (concat "^" - orgstruct-heading-prefix-regexp - "\\(\\*+\\)\\(?: +\\(.*?\\)\\)?[ ]*$")) - (org-outline-regexp - (concat orgstruct-heading-prefix-regexp "\\*+ ")) - (org-outline-regexp-bol - (concat "^" org-outline-regexp)) - (outline-regexp org-outline-regexp) - (outline-heading-end-regexp "\n") - (outline-level 'org-outline-level) - (outline-heading-alist)))) - `(defun ,name (arg) - ,(concat "In Structure, run `" (symbol-name fun) "'.\n" - "Outside of structure, run the binding of `" - (key-description key) "'." - (when disable-when-heading-prefix - (concat - "\nIf `orgstruct-heading-prefix-regexp' is not empty, this command will always fall\n" - "back to the default binding due to limitations of Org's implementation of\n" - "`" (symbol-name fun) "'."))) - (interactive "p") - (let* ((disable - ,(and disable-when-heading-prefix - '(not (string= orgstruct-heading-prefix-regexp "")))) - (fallback - (or disable - (not - (let* ,bindings - (org-context-p 'headline 'item - ,(when (memq fun - '(org-insert-heading - org-insert-heading-respect-content - org-meta-return)) - '(when orgstruct-is-++ - 'item-body)))))))) - (if fallback - (let* ((orgstruct-mode) - (binding - (let ((key ,key)) - (catch 'exit - (dolist - (rep - '(nil - ("<\\([^>]*\\)tab>" . "\\1TAB") - ("<\\([^>]*\\)return>" . "\\1RET") - ("<\\([^>]*\\)escape>" . "\\1ESC") - ("<\\([^>]*\\)delete>" . "\\1DEL")) - nil) - (when rep - (setq key (read-kbd-macro - (let ((case-fold-search)) - (replace-regexp-in-string - (car rep) - (cdr rep) - (key-description key)))))) - (when (key-binding key) - (throw 'exit (key-binding key)))))))) - (if (keymapp binding) - (org-set-transient-map binding) - (let ((func (or binding - (unless disable - 'orgstruct-error)))) - (when func - (call-interactively func))))) - (org-run-like-in-org-mode - (lambda () - (interactive) - (let* ,bindings - (call-interactively ',fun))))))))) - name)) - (defun org-contextualize-keys (alist contexts) "Return valid elements in ALIST depending on CONTEXTS. @@ -9394,20 +9013,11 @@ definitions." (push r res)))) (delete-dups (delq nil res)))) -(defun org-context-p (&rest contexts) - "Check if local context is any of CONTEXTS. -Possible values in the list of contexts are `table', `headline', and `item'." - (let ((pos (point))) - (goto-char (point-at-bol)) - (prog1 (or (and (memq 'table contexts) - (looking-at "[ \t]*|")) - (and (memq 'headline contexts) - (looking-at org-outline-regexp)) - (and (memq 'item contexts) - (looking-at "[ \t]*\\([-+*] \\|[0-9]+[.)] \\)")) - (and (memq 'item-body contexts) - (org-in-item-p))) - (goto-char pos)))) +;; Defined to provide a value for defcustom, since there is no +;; string-collate-greaterp in Emacs. +(defun org-string-collate-greaterp (s1 s2) + "Return non-nil if S1 is greater than S2 in collation order." + (not (org-string-collate-lessp s1 s2))) ;;;###autoload (defun org-run-like-in-org-mode (cmd) @@ -9416,10 +9026,8 @@ This will temporarily bind local variables that are typically bound in Org mode to the values they have in Org mode, and then interactively call CMD." (org-load-modules-maybe) - (unless org-local-vars - (setq org-local-vars (org-get-local-variables))) (let (binds) - (dolist (var org-local-vars) + (dolist (var (org-get-local-variables)) (when (or (not (boundp (car var))) (eq (symbol-value (car var)) (default-value (car var)))) @@ -9449,16 +9057,16 @@ the value of the drawer property." (inherit? (org-property-inherit-p dprop)) (property-re (org-re-property (concat (regexp-quote dprop) "\\+?") t)) (global (and inherit? (org--property-global-value dprop nil)))) - (org-with-silent-modifications - (org-with-point-at 1 - ;; Set global values (e.g., values defined through - ;; "#+PROPERTY:" keywords) to the whole buffer. - (when global (put-text-property (point-min) (point-max) tprop global)) - ;; Set local values. - (while (re-search-forward property-re nil t) - (when (org-at-property-p) - (org-refresh-property tprop (org-entry-get (point) dprop) inherit?)) - (outline-next-heading)))))) + (with-silent-modifications + (org-with-point-at 1 + ;; Set global values (e.g., values defined through + ;; "#+PROPERTY:" keywords) to the whole buffer. + (when global (put-text-property (point-min) (point-max) tprop global)) + ;; Set local values. + (while (re-search-forward property-re nil t) + (when (org-at-property-p) + (org-refresh-property tprop (org-entry-get (point) dprop) inherit?)) + (outline-next-heading)))))) (defun org-refresh-property (tprop p &optional inherit) "Refresh the buffer text property TPROP from the drawer property P. @@ -9490,52 +9098,52 @@ sub-tree if optional argument INHERIT is non-nil." "???")) ((symbolp org-category) (symbol-name org-category)) (t org-category)))) - (org-with-silent-modifications - (org-with-wide-buffer - ;; Set buffer-wide category. Search last #+CATEGORY keyword. - ;; This is the default category for the buffer. If none is - ;; found, fall-back to `org-category' or buffer file name. - (put-text-property - (point-min) (point-max) - 'org-category - (catch 'buffer-category - (goto-char (point-max)) - (while (re-search-backward "^[ \t]*#\\+CATEGORY:" (point-min) t) - (let ((element (org-element-at-point))) - (when (eq (org-element-type element) 'keyword) - (throw 'buffer-category - (org-element-property :value element))))) - default-category)) - ;; Set sub-tree specific categories. - (goto-char (point-min)) - (let ((regexp (org-re-property "CATEGORY"))) - (while (re-search-forward regexp nil t) - (let ((value (match-string-no-properties 3))) - (when (org-at-property-p) - (put-text-property - (save-excursion (org-back-to-heading t) (point)) - (save-excursion (org-end-of-subtree t t) (point)) - 'org-category - value))))))))) + (with-silent-modifications + (org-with-wide-buffer + ;; Set buffer-wide category. Search last #+CATEGORY keyword. + ;; This is the default category for the buffer. If none is + ;; found, fall-back to `org-category' or buffer file name. + (put-text-property + (point-min) (point-max) + 'org-category + (catch 'buffer-category + (goto-char (point-max)) + (while (re-search-backward "^[ \t]*#\\+CATEGORY:" (point-min) t) + (let ((element (org-element-at-point))) + (when (eq (org-element-type element) 'keyword) + (throw 'buffer-category + (org-element-property :value element))))) + default-category)) + ;; Set sub-tree specific categories. + (goto-char (point-min)) + (let ((regexp (org-re-property "CATEGORY"))) + (while (re-search-forward regexp nil t) + (let ((value (match-string-no-properties 3))) + (when (org-at-property-p) + (put-text-property + (save-excursion (org-back-to-heading t) (point)) + (save-excursion (org-end-of-subtree t t) (point)) + 'org-category + value))))))))) (defun org-refresh-stats-properties () "Refresh stats text properties in the buffer." - (org-with-silent-modifications - (org-with-point-at 1 - (let ((regexp (concat org-outline-regexp-bol - ".*\\[\\([0-9]*\\)\\(?:%\\|/\\([0-9]*\\)\\)\\]"))) - (while (re-search-forward regexp nil t) - (let* ((numerator (string-to-number (match-string 1))) - (denominator (and (match-end 2) - (string-to-number (match-string 2)))) - (stats (cond ((not denominator) numerator) ;percent - ((= denominator 0) 0) - (t (/ (* numerator 100) denominator))))) - (put-text-property (point) (progn (org-end-of-subtree t t) (point)) - 'org-stats stats))))))) + (with-silent-modifications + (org-with-point-at 1 + (let ((regexp (concat org-outline-regexp-bol + ".*\\[\\([0-9]*\\)\\(?:%\\|/\\([0-9]*\\)\\)\\]"))) + (while (re-search-forward regexp nil t) + (let* ((numerator (string-to-number (match-string 1))) + (denominator (and (match-end 2) + (string-to-number (match-string 2)))) + (stats (cond ((not denominator) numerator) ;percent + ((= denominator 0) 0) + (t (/ (* numerator 100) denominator))))) + (put-text-property (point) (progn (org-end-of-subtree t t) (point)) + 'org-stats stats))))))) (defun org-refresh-effort-properties () - "Refresh effort properties" + "Refresh effort properties." (org-refresh-properties org-effort-property '((effort . identity) @@ -9581,10 +9189,11 @@ sub-tree if optional argument INHERIT is non-nil." (defun org-store-link-functions () "Return a list of functions that are called to create and store a link. -The functions defined in the :store property of + +The functions are defined in the `:store' property of `org-link-parameters'. -Each function will be called in turn until one returns a non-nil +Each function is called in turn until one returns a non-nil value. Each function should check if it is responsible for creating this link (for example by looking at the major mode). If not, it must exit and return nil. If yes, it should return @@ -9610,8 +9219,8 @@ and then used in capture templates." (defvar org-id-link-to-org-use-id) ; Defined in org-id.el ;;;###autoload -(defun org-store-link (arg) - "Store an org-link to the current location. +(defun org-store-link (arg &optional interactive?) + "Store a link to the current location. \\ This link is added to `org-stored-links' and can later be inserted into an Org buffer with `org-insert-link' (`\\[org-insert-link]'). @@ -9627,8 +9236,11 @@ part of Org core. A `\\[universal-argument] \\[universal-argument] \\[universal-argument]' \ prefix ARG forces storing a link for each line in the -active region." - (interactive "P") +active region. + +Assume the function is called interactively if INTERACTIVE? is +non-nil." + (interactive "P\np") (org-load-modules-maybe) (if (and (equal arg '(64)) (org-region-active-p)) (save-excursion @@ -9642,48 +9254,76 @@ active region." (move-beginning-of-line 2) (set-mark (point))))) (setq org-store-link-plist nil) - (let (link cpltxt desc description search - txt custom-id agenda-link sfuns sfunsn) + (let (link cpltxt desc description search txt custom-id agenda-link) (cond - - ;; Store a link using an external link type + ;; Store a link using an external link type, if any function is + ;; available. If more than one can generate a link from current + ;; location, ask which one to use. ((and (not (equal arg '(16))) - (setq sfuns - (delq - nil (mapcar (lambda (f) - (let (fs) (if (funcall f) (push f fs)))) - (org-store-link-functions))) - sfunsn (mapcar (lambda (fu) (symbol-name (car fu))) sfuns)) - (or (and (cdr sfuns) - (funcall (intern - (completing-read - "Which function for creating the link? " - sfunsn nil t (car sfunsn))))) - (funcall (caar sfuns))) - (setq link (plist-get org-store-link-plist :link) - desc (or (plist-get org-store-link-plist - :description) - link)))) - - ;; Store a link from a source code buffer. + (let ((results-alist nil)) + (dolist (f (org-store-link-functions)) + (when (funcall f) + ;; XXX: return value is not link's plist, so we + ;; store the new value before it is modified. It + ;; would be cleaner to ask store link functions to + ;; return the plist instead. + (push (cons f (copy-sequence org-store-link-plist)) + results-alist))) + (pcase results-alist + (`nil nil) + (`((,_ . ,_)) t) ;single choice: nothing to do + (`((,name . ,_) . ,_) + ;; Reinstate link plist associated to the chosen + ;; function. + (apply #'org-store-link-props + (cdr (assoc-string + (completing-read + "Which function for creating the link? " + (mapcar #'car results-alist) + nil t (symbol-name name)) + results-alist))) + t)))) + (setq link (plist-get org-store-link-plist :link)) + (setq desc (or (plist-get org-store-link-plist :description) + link))) + + ;; Store a link from a remote editing buffer. ((org-src-edit-buffer-p) - (let ((coderef-format (org-src-coderef-format))) - (cond ((save-excursion - (beginning-of-line) - (looking-at (org-src-coderef-regexp coderef-format))) - (setq link (format "(%s)" (match-string-no-properties 3)))) - ((called-interactively-p 'any) - (let ((label (read-string "Code line label: "))) - (end-of-line) - (setq link (format coderef-format label)) - (let ((gc (- 79 (length link)))) - (if (< (current-column) gc) - (org-move-to-column gc t) - (insert " "))) - (insert link) - (setq link (concat "(" label ")")) - (setq desc nil))) - (t (setq link nil))))) + (let ((coderef-format (org-src-coderef-format)) + (format-link + (lambda (label) + (if org-src-source-file-name + (format "file:%s::(%s)" org-src-source-file-name label) + (format "(%s)" label))))) + (cond + ;; Code references do not exist in this type of buffer. + ;; Pretend we're linking from the source buffer directly. + ((not (memq (org-src-source-type) '(example-block src-block))) + (with-current-buffer (org-src-source-buffer) + (org-store-link arg interactive?)) + (setq link nil)) + ;; A code reference exists. Use it. + ((save-excursion + (beginning-of-line) + (re-search-forward (org-src-coderef-regexp coderef-format) + (line-end-position) + t)) + (setq link (funcall format-link (match-string-no-properties 3)))) + ;; No code reference. Create a new one then store the link + ;; to it, but only in the function is called interactively. + (interactive? + (end-of-line) + (let* ((label (read-string "Code line label: ")) + (reference (format coderef-format label)) + (gc (- 79 (length reference)))) + (if (< (current-column) gc) + (org-move-to-column gc t) + (insert " ")) + (insert reference) + (setq link (funcall format-link label)))) + ;; No code reference, and non-interactive call. Don't know + ;; what to do. Give up. + (t (setq link nil))))) ;; We are in the agenda, link to referenced location ((equal (bound-and-true-p org-agenda-buffer-name) (buffer-name)) @@ -9691,19 +9331,14 @@ active region." (get-text-property (point) 'org-marker)))) (when m (org-with-point-at m - (setq agenda-link - (if (called-interactively-p 'any) - (call-interactively 'org-store-link) - (org-store-link nil))))))) + (setq agenda-link (org-store-link nil interactive?)))))) ((eq major-mode 'calendar-mode) (let ((cd (calendar-cursor-to-date))) (setq link (format-time-string (car org-time-stamp-formats) - (apply 'encode-time - (list 0 0 0 (nth 1 cd) (nth 0 cd) (nth 2 cd) - nil nil nil)))) + (encode-time 0 0 0 (nth 1 cd) (nth 0 cd) (nth 2 cd)))) (org-store-link-props :type "calendar" :date cd))) ((eq major-mode 'help-mode) @@ -9758,7 +9393,7 @@ active region." link cpltxt)) ((and (featurep 'org-id) (or (eq org-id-link-to-org-use-id t) - (and (called-interactively-p 'any) + (and interactive? (or (eq org-id-link-to-org-use-id 'create-if-interactive) (and (eq org-id-link-to-org-use-id 'create-if-interactive-and-no-custom-id) @@ -9821,7 +9456,7 @@ active region." desc "NONE"))) (setq link cpltxt)) - ((called-interactively-p 'interactive) + (interactive? (user-error "No method for storing a link from this buffer")) (t (setq link nil))) @@ -9838,9 +9473,7 @@ active region." (lambda (m) (or (match-string 5 m) (match-string 3 m))) desc)))) ;; Return the link - (if (not (and (or (called-interactively-p 'any) - executing-kbd-macro) - link)) + (if (not (and interactive? link)) (or agenda-link (and link (org-make-link-string link desc))) (push (list link desc) org-stored-links) (message "Stored: %s" (or desc link)) @@ -9935,20 +9568,24 @@ according to FMT (default from `org-email-link-description-format')." (reverse slines))) "\n"))))) (mapconcat #'identity (split-string s) " "))) +(defconst org-link-escape-chars + ;;%20 %5B %5D %25 + '(?\s ?\[ ?\] ?%) + "List of characters that should be escaped in a link when stored to Org. +This is the list that is used for internal purposes.") + (defun org-make-link-string (link &optional description) "Make a link with brackets, consisting of LINK and DESCRIPTION." (unless (org-string-nw-p link) (error "Empty link")) (let ((uri (cond ((string-match org-link-types-re link) (concat (match-string 1 link) (org-link-escape (substring link (match-end 1))))) - ;; For readability, url-encode internal links only - ;; when absolutely needed (i.e, when they contain - ;; square brackets). File links however, are - ;; encoded since, e.g., spaces are significant. ((or (file-name-absolute-p link) - (string-match-p "\\`\\.\\.?/\\|[][]" link)) + (string-match-p "\\`\\.\\.?/" link)) (org-link-escape link)) - (t link))) + ;; For readability, do not encode space characters + ;; in fuzzy links. + (t (org-link-escape link (remq ?\s org-link-escape-chars))))) (description (and (org-string-nw-p description) ;; Remove brackets from description, as they are fatal. @@ -9959,12 +9596,6 @@ according to FMT (default from `org-email-link-description-format')." uri (if description (format "[%s]" description) "")))) -(defconst org-link-escape-chars - ;;%20 %5B %5D %25 - '(?\s ?\[ ?\] ?%) - "List of characters that should be escaped in a link when stored to Org. -This is the list that is used for internal purposes.") - (defun org-link-escape (text &optional table merge) "Return percent escaped representation of TEXT. TEXT is a string with the text to escape. @@ -10019,7 +9650,7 @@ Note: this function also decodes single byte encodings like (cons 6 128)))) (when (>= val 192) (setq eat (car shift-xor))) (setq val (logxor val (cdr shift-xor))) - (setq sum (+ (lsh sum (car shift-xor)) val)) + (setq sum (+ (ash sum (car shift-xor)) val)) (when (> eat 0) (setq eat (- eat 1))) (cond ((= 0 eat) ;multi byte @@ -10035,10 +9666,6 @@ Note: this function also decodes single byte encodings like (char-to-string (string-to-number byte 16))) (cdr (split-string hex "%")) "")) -(defun org-xor (a b) - "Exclusive or." - (if a (not b) b)) - (defun org-fixup-message-id-for-http (s) "Replace special characters in a message id, so it can be used in an http query." (when (string-match "%" s) @@ -10161,7 +9788,8 @@ If the DEFAULT-DESCRIPTION parameter is non-nil, this value will be used as the default description. Otherwise, if `org-make-link-description-function' is non-nil, this function will be called with the link target, and the result will be the -default link description." +default link description. When called non-interactively, don't +allow to edit the default description." (interactive "P") (let* ((wcf (current-window-configuration)) (origbuf (current-buffer)) @@ -10266,11 +9894,19 @@ Use TAB to complete link prefixes, then RET for type-specific completion support ;; We are linking to this same file, with a search option (setq link search))))) - ;; Check if we can/should use a relative path. If yes, simplify the link + ;; Check if we can/should use a relative path. If yes, simplify + ;; the link. (let ((case-fold-search nil)) (when (string-match "\\`\\(file\\|docview\\):" link) (let* ((type (match-string-no-properties 0 link)) - (path (substring-no-properties link (match-end 0))) + (path-start (match-end 0)) + (search (and (string-match "::\\(.*\\)\\'" link) + (match-string 1 link))) + (path + (if search + (substring-no-properties + link path-start (match-beginning 0)) + (substring-no-properties link (match-end 0)))) (origpath path)) (cond ((or (eq org-link-file-path-type 'absolute) @@ -10291,7 +9927,7 @@ Use TAB to complete link prefixes, then RET for type-specific completion support (setq path (substring (expand-file-name path) (match-end 0))) (setq path (abbreviate-file-name (expand-file-name path))))))) - (setq link (concat type path)) + (setq link (concat type path (and search (concat "::" search)))) (when (equal desc origpath) (setq desc path))))) @@ -10307,9 +9943,11 @@ Use TAB to complete link prefixes, then RET for type-specific completion support (symbol-name org-make-link-description-function)) (sit-for 2) nil)))))) - (setq desc (read-string "Description: " initial-input)))) + (setq desc (if (called-interactively-p 'any) + (read-string "Description: " initial-input) + initial-input)))) - (unless (string-match "\\S-" desc) (setq desc nil)) + (unless (org-string-nw-p desc) (setq desc nil)) (when remove (apply 'delete-region remove)) (insert (org-make-link-string link desc)) ;; Redisplay so as the new link has proper invisible characters. @@ -10341,16 +9979,6 @@ Use TAB to complete link prefixes, then RET for type-specific completion support (match-string 1 (expand-file-name file)))) (t (concat "file:" file))))) -(defun org-completing-read (&rest args) - "Completing-read with SPACE being a normal character." - (let ((enable-recursive-minibuffers t) - (minibuffer-local-completion-map - (copy-keymap minibuffer-local-completion-map))) - (org-defkey minibuffer-local-completion-map " " 'self-insert-command) - (org-defkey minibuffer-local-completion-map "?" 'self-insert-command) - (org-defkey minibuffer-local-completion-map (kbd "C-c !") - 'org-time-stamp-inactive) - (apply #'completing-read args))) ;;; Opening/following a link @@ -10401,7 +10029,7 @@ If the link is in hidden text, expose it." "Move backward to the previous link. If the link is in hidden text, expose it." (interactive) - (funcall 'org-next-link t)) + (org-next-link t)) (defun org-translate-link (s) "Translate a link string if a translation function has been defined." @@ -10423,7 +10051,7 @@ This is still an experimental function, your mileage may vary." ((and (equal type "lisp") (string-match "^/" path)) ;; Planner has a slash, we do not. (setq type "elisp" path (substring path 1))) - ((string-match "^//\\(.?*\\)/\\(<.*>\\)$" path) + ((string-match "^//\\(.*\\)/\\(<.*>\\)$" path) ;; A typical message link. Planner has the id after the final slash, ;; we separate it with a hash mark (setq path (concat (match-string 1 path) "#" @@ -10451,18 +10079,24 @@ This is saved in case the need arises to restore it.") ;;;###autoload (defun org-open-at-point-global () - "Follow a link or time-stamp like Org mode does. -This command can be called in any mode to follow an external link -or a time-stamp that has Org mode syntax. Its behavior is -undefined when called on internal links (e.g., fuzzy links). -Raise an error when there is nothing to follow. " + "Follow a link or a time-stamp like Org mode does. +Also follow links and emails as seen by `thing-at-point'. +This command can be called in any mode to follow an external +link or a time-stamp that has Org mode syntax. Its behavior +is undefined when called on internal links like fuzzy links. +Raise a user error when there is nothing to follow." (interactive) - (cond ((org-in-regexp org-any-link-re) - (org-open-link-from-string (match-string-no-properties 0))) - ((or (org-in-regexp org-ts-regexp-both nil t) - (org-in-regexp org-tsr-regexp-both nil t)) - (org-follow-timestamp-link)) - (t (user-error "No link found")))) + (let ((tap-url (thing-at-point 'url)) + (tap-email (thing-at-point 'email))) + (cond ((org-in-regexp org-any-link-re) + (org-open-link-from-string (match-string-no-properties 0))) + ((or (org-in-regexp org-ts-regexp-both nil t) + (org-in-regexp org-tsr-regexp-both nil t)) + (org-follow-timestamp-link)) + (tap-url (org-open-link-from-string tap-url)) + (tap-email (org-open-link-from-string + (concat "mailto:" tap-email))) + (t (user-error "No link found"))))) ;;;###autoload (defun org-open-link-from-string (s &optional arg reference-buffer) @@ -10566,148 +10200,152 @@ When optional argument REFERENCE-BUFFER is non-nil, it should specify a buffer from where the link search should happen. This is used internally by `org-open-link-from-string'. -On top of syntactically correct links, this function will also -try to open links and time-stamps in comments, example -blocks... i.e., whenever point is on something looking like -a timestamp or a link." +On top of syntactically correct links, this function also tries +to open links and time-stamps in comments, node properties, and +keywords if point is on something looking like a timestamp or +a link." (interactive "P") - ;; On a code block, open block's results. - (unless (call-interactively 'org-babel-open-src-block-result) - (org-load-modules-maybe) - (setq org-window-config-before-follow-link (current-window-configuration)) - (org-remove-occur-highlights nil nil t) - (unless (run-hook-with-args-until-success 'org-open-at-point-functions) - (let* ((context - ;; Only consider supported types, even if they are not - ;; the closest one. - (org-element-lineage - (org-element-context) - '(clock footnote-definition footnote-reference headline - inlinetask link timestamp) - t)) - (type (org-element-type context)) - (value (org-element-property :value context))) - (cond - ;; On a headline or an inlinetask, but not on a timestamp, - ;; a link, a footnote reference. - ((memq type '(headline inlinetask)) - (org-match-line org-complex-heading-regexp) - (if (and (match-beginning 5) - (>= (point) (match-beginning 5)) - (< (point) (match-end 5))) - ;; On tags. - (org-tags-view arg (substring (match-string 5) 0 -1)) - ;; Not on tags. - (pcase (org-offer-links-in-entry (current-buffer) (point) arg) - (`(nil . ,_) - (require 'org-attach) - (org-attach-reveal 'if-exists)) - (`(,links . ,links-end) - (dolist (link (if (stringp links) (list links) links)) - (search-forward link nil links-end) - (goto-char (match-beginning 0)) - (org-open-at-point)))))) - ;; On a footnote reference or at definition's label. - ((or (eq type 'footnote-reference) - (and (eq type 'footnote-definition) - (save-excursion - ;; Do not validate action when point is on the - ;; spaces right after the footnote label, in - ;; order to be on par with behaviour on links. - (skip-chars-forward " \t") - (let ((begin - (org-element-property :contents-begin context))) - (if begin (< (point) begin) - (= (org-element-property :post-affiliated context) - (line-beginning-position))))))) - (org-footnote-action)) - ;; No valid context. Ignore catch-all types like `headline'. - ;; If point is on something looking like a link or - ;; a time-stamp, try opening it. It may be useful in - ;; comments, example blocks... - ((memq type '(footnote-definition headline inlinetask nil)) - (call-interactively #'org-open-at-point-global)) - ;; On a clock line, make sure point is on the timestamp - ;; before opening it. - ((and (eq type 'clock) - value - (>= (point) (org-element-property :begin value)) - (<= (point) (org-element-property :end value))) - (org-follow-timestamp-link)) - ;; Do nothing on white spaces after an object. - ((>= (point) - (save-excursion - (goto-char (org-element-property :end context)) - (skip-chars-backward " \t") - (point))) - (user-error "No link found")) - ((eq type 'timestamp) (org-follow-timestamp-link)) - ((eq type 'link) - (let ((type (org-element-property :type context)) - (path (org-link-unescape (org-element-property :path context)))) - ;; Switch back to REFERENCE-BUFFER needed when called in - ;; a temporary buffer through `org-open-link-from-string'. - (with-current-buffer (or reference-buffer (current-buffer)) - (cond - ((equal type "file") - (if (string-match "[*?{]" (file-name-nondirectory path)) - (dired path) - ;; Look into `org-link-parameters' in order to find - ;; a DEDICATED-FUNCTION to open file. The function - ;; will be applied on raw link instead of parsed - ;; link due to the limitation in `org-add-link-type' - ;; ("open" function called with a single argument). - ;; If no such function is found, fallback to - ;; `org-open-file'. - (let* ((option (org-element-property :search-option context)) - (app (org-element-property :application context)) - (dedicated-function - (org-link-get-parameter - (if app (concat type "+" app) type) - :follow))) - (if dedicated-function - (funcall dedicated-function - (concat path - (and option (concat "::" option)))) - (apply #'org-open-file - path - (cond (arg) - ((equal app "emacs") 'emacs) - ((equal app "sys") 'system)) - (cond ((not option) nil) - ((string-match-p "\\`[0-9]+\\'" option) - (list (string-to-number option))) - (t (list nil - (org-link-unescape option))))))))) - ((functionp (org-link-get-parameter type :follow)) - (funcall (org-link-get-parameter type :follow) path)) - ((member type '("coderef" "custom-id" "fuzzy" "radio")) - (unless (run-hook-with-args-until-success - 'org-open-link-functions path) - (if (not arg) (org-mark-ring-push) - (switch-to-buffer-other-window - (org-get-buffer-for-internal-link (current-buffer)))) - (let ((destination - (org-with-wide-buffer - (if (equal type "radio") - (org-search-radio-target - (org-element-property :path context)) - (org-link-search - (if (member type '("custom-id" "coderef")) - (org-element-property :raw-link context) - path) - ;; Prevent fuzzy links from matching - ;; themselves. - (and (equal type "fuzzy") - (+ 2 (org-element-property :begin context))))) - (point)))) - (unless (and (<= (point-min) destination) - (>= (point-max) destination)) - (widen)) - (goto-char destination)))) - (t (browse-url-at-point)))))) - (t (user-error "No link found"))))) - (run-hook-with-args 'org-follow-link-hook))) + (org-load-modules-maybe) + (setq org-window-config-before-follow-link (current-window-configuration)) + (org-remove-occur-highlights nil nil t) + (unless (run-hook-with-args-until-success 'org-open-at-point-functions) + (let* ((context + ;; Only consider supported types, even if they are not the + ;; closest one. + (org-element-lineage + (org-element-context) + '(clock comment comment-block footnote-definition + footnote-reference headline inline-src-block inlinetask + keyword link node-property planning src-block timestamp) + t)) + (type (org-element-type context)) + (value (org-element-property :value context))) + (cond + ((not type) (user-error "No link found")) + ;; No valid link at point. For convenience, look if something + ;; looks like a link under point in some specific places. + ((memq type '(comment comment-block node-property keyword)) + (call-interactively #'org-open-at-point-global)) + ;; On a headline or an inlinetask, but not on a timestamp, + ;; a link, a footnote reference. + ((memq type '(headline inlinetask)) + (org-match-line org-complex-heading-regexp) + (if (and (match-beginning 5) + (>= (point) (match-beginning 5)) + (< (point) (match-end 5))) + ;; On tags. + (org-tags-view arg (substring (match-string 5) 0 -1)) + ;; Not on tags. + (pcase (org-offer-links-in-entry (current-buffer) (point) arg) + (`(nil . ,_) + (require 'org-attach) + (org-attach-reveal 'if-exists)) + (`(,links . ,links-end) + (dolist (link (if (stringp links) (list links) links)) + (search-forward link nil links-end) + (goto-char (match-beginning 0)) + (org-open-at-point)))))) + ;; On a footnote reference or at definition's label. + ((or (eq type 'footnote-reference) + (and (eq type 'footnote-definition) + (save-excursion + ;; Do not validate action when point is on the + ;; spaces right after the footnote label, in order + ;; to be on par with behavior on links. + (skip-chars-forward " \t") + (let ((begin + (org-element-property :contents-begin context))) + (if begin (< (point) begin) + (= (org-element-property :post-affiliated context) + (line-beginning-position))))))) + (org-footnote-action)) + ;; On a planning line. Check if we are really on a timestamp. + ((and (eq type 'planning) + (org-in-regexp org-ts-regexp-both nil t)) + (org-follow-timestamp-link)) + ;; On a clock line, make sure point is on the timestamp + ;; before opening it. + ((and (eq type 'clock) + value + (>= (point) (org-element-property :begin value)) + (<= (point) (org-element-property :end value))) + (org-follow-timestamp-link)) + ((eq type 'src-block) (org-babel-open-src-block-result)) + ;; Do nothing on white spaces after an object. + ((>= (point) + (save-excursion + (goto-char (org-element-property :end context)) + (skip-chars-backward " \t") + (point))) + (user-error "No link found")) + ((eq type 'inline-src-block) (org-babel-open-src-block-result)) + ((eq type 'timestamp) (org-follow-timestamp-link)) + ((eq type 'link) + (let ((type (org-element-property :type context)) + (path (org-element-property :path context))) + ;; Switch back to REFERENCE-BUFFER needed when called in + ;; a temporary buffer through `org-open-link-from-string'. + (with-current-buffer (or reference-buffer (current-buffer)) + (cond + ((equal type "file") + (if (string-match "[*?{]" (file-name-nondirectory path)) + (dired path) + ;; Look into `org-link-parameters' in order to find + ;; a DEDICATED-FUNCTION to open file. The function + ;; will be applied on raw link instead of parsed link + ;; due to the limitation in `org-add-link-type' + ;; ("open" function called with a single argument). + ;; If no such function is found, fallback to + ;; `org-open-file'. + (let* ((option (org-element-property :search-option context)) + (app (org-element-property :application context)) + (dedicated-function + (org-link-get-parameter + (if app (concat type "+" app) type) + :follow))) + (if dedicated-function + (funcall dedicated-function + (concat path + (and option (concat "::" option)))) + (apply #'org-open-file + path + (cond (arg) + ((equal app "emacs") 'emacs) + ((equal app "sys") 'system)) + (cond ((not option) nil) + ((string-match-p "\\`[0-9]+\\'" option) + (list (string-to-number option))) + (t (list nil option)))))))) + ((functionp (org-link-get-parameter type :follow)) + (funcall (org-link-get-parameter type :follow) path)) + ((member type '("coderef" "custom-id" "fuzzy" "radio")) + (unless (run-hook-with-args-until-success + 'org-open-link-functions path) + (if (not arg) (org-mark-ring-push) + (switch-to-buffer-other-window + (org-get-buffer-for-internal-link (current-buffer)))) + (let ((destination + (org-with-wide-buffer + (if (equal type "radio") + (org-search-radio-target + (org-element-property :path context)) + (org-link-search + (pcase type + ("custom-id" (concat "#" path)) + ("coderef" (format "(%s)" path)) + (_ path)) + ;; Prevent fuzzy links from matching + ;; themselves. + (and (equal type "fuzzy") + (+ 2 (org-element-property :begin context))))) + (point)))) + (unless (and (<= (point-min) destination) + (>= (point-max) destination)) + (widen)) + (goto-char destination)))) + (t (browse-url-at-point)))))) + (t (user-error "No link found"))))) + (run-hook-with-args 'org-follow-link-hook)) (defun org-offer-links-in-entry (buffer marker &optional nth zero) "Offer links in the current entry and return the selected link. @@ -10766,7 +10404,7 @@ there is one, return it." (cons link end))))) ;; TODO: These functions are deprecated since `org-open-at-point' -;; hard-codes behaviour for "file+emacs" and "file+sys" types. +;; hard-codes behavior for "file+emacs" and "file+sys" types. (defun org-open-file-with-system (path) "Open file at PATH using the system way of opening it." (org-open-file path 'system)) @@ -10891,18 +10529,12 @@ of matched result, which is either `dedicated' or `fuzzy'." (let ((element (org-element-at-point))) (when (and (memq (org-element-type element) '(example-block src-block)) - ;; Build proper regexp according to current - ;; block's label format. - (let ((label-fmt - (regexp-quote - (or (org-element-property :label-fmt element) - org-coderef-label-format)))) - (save-excursion - (beginning-of-line) - (looking-at (format ".*?\\(%s\\)[ \t]*$" - (format label-fmt coderef)))))) + (org-match-line + (concat ".*?" (org-src-coderef-regexp + (org-src-coderef-format element) + coderef)))) (setq type 'dedicated) - (goto-char (match-beginning 1)) + (goto-char (match-beginning 2)) (throw :coderef-match nil)))) (goto-char origin) (error "No match for coderef: %s" coderef)))) @@ -11046,31 +10678,37 @@ to read." (goto-char (point-min)) (select-window cwin)))) -;;; The mark ring for links jumps + +;;; The Mark Ring (defvar org-mark-ring nil "Mark ring for positions before jumps in Org mode.") + (defvar org-mark-ring-last-goto nil "Last position in the mark ring used to go back.") + ;; Fill and close the ring -(setq org-mark-ring nil org-mark-ring-last-goto nil) ;; in case file is reloaded -(dotimes (_ org-mark-ring-length) - (push (make-marker) org-mark-ring)) +(setq org-mark-ring nil) +(setq org-mark-ring-last-goto nil) ;in case file is reloaded + +(dotimes (_ org-mark-ring-length) (push (make-marker) org-mark-ring)) (setcdr (nthcdr (1- org-mark-ring-length) org-mark-ring) org-mark-ring) (defun org-mark-ring-push (&optional pos buffer) - "Put the current position or POS into the mark ring and rotate it." + "Put the current position into the mark ring and rotate it. +Also push position into the Emacs mark ring. If optional +argument POS and BUFFER are not nil, mark this location instead." (interactive) - (setq pos (or pos (point))) - (setq org-mark-ring (nthcdr (1- org-mark-ring-length) org-mark-ring)) - (move-marker (car org-mark-ring) - (or pos (point)) - (or buffer (current-buffer))) - (message "%s" - (substitute-command-keys - "Position saved to mark ring, go back with \ -`\\[org-mark-ring-goto]'."))) + (let ((pos (or pos (point))) + (buffer (or buffer (current-buffer)))) + (with-current-buffer buffer + (org-with-point-at pos (push-mark nil t))) + (setq org-mark-ring (nthcdr (1- org-mark-ring-length) org-mark-ring)) + (move-marker (car org-mark-ring) pos buffer)) + (message + (substitute-command-keys + "Position saved to mark ring, go back with `\\[org-mark-ring-goto]'."))) (defun org-mark-ring-goto (&optional n) "Jump to the previous position in the mark ring. @@ -11156,7 +10794,7 @@ If the file does not exist, an error is thrown." 'org-file-apps-entry-match-against-dlink-p file-apps)) (apps-dlink (cl-remove-if-not 'org-file-apps-entry-match-against-dlink-p file-apps)) - (remp (and (assq 'remote apps) (org-file-remote-p file))) + (remp (and (assq 'remote apps) (file-remote-p file))) (dirp (unless remp (file-directory-p file))) (file (if (and dirp org-open-directory-means-index-dot-org) (concat (file-name-as-directory file) "index.org") @@ -11328,21 +10966,6 @@ be opened in Emacs." (when add-auto-mode (mapcar (lambda (x) (cons (car x) 'emacs)) auto-mode-alist)))) -(defvar ange-ftp-name-format) -(defun org-file-remote-p (file) - "Test whether FILE specifies a location on a remote system. -Return non-nil if the location is indeed remote. - -For example, the filename \"/user@host:/foo\" specifies a location -on the system \"/user@host:\"." - (cond ((fboundp 'file-remote-p) - (file-remote-p file)) - ((fboundp 'tramp-handle-file-remote-p) - (tramp-handle-file-remote-p file)) - ((and (boundp 'ange-ftp-name-format) - (string-match (car ange-ftp-name-format) file)) - t))) - ;;;; Refiling @@ -11515,7 +11138,7 @@ order.") (buffer-base-buffer)))) (_ nil)) (mapcar (lambda (s) (replace-regexp-in-string - "/" "\\/" s nil t)) + "/" "\\/" s nil t)) (org-get-outline-path t t))) "/")))) (push (list target f re (org-refile-marker (point))) @@ -11658,7 +11281,7 @@ the *old* location.") "Like `org-refile', but copy." (interactive) (let ((org-refile-keep t)) - (funcall 'org-refile nil nil nil "Copy"))) + (org-refile nil nil nil "Copy"))) (defun org-refile (&optional arg default-buffer rfloc msg) "Move the entry or entries at point to another heading. @@ -11714,7 +11337,7 @@ prefix argument (`C-u C-u C-u C-c C-w')." (setq last-command nil) (when regionp (goto-char region-start) - (or (bolp) (goto-char (point-at-bol))) + (beginning-of-line) (setq region-start (point)) (unless (or (org-kill-is-subtree-p (buffer-substring region-start region-end)) @@ -11802,13 +11425,21 @@ prefix argument (`C-u C-u C-u C-c C-w')." (or (outline-next-heading) (goto-char (point-max))))) (unless (bolp) (newline)) (org-paste-subtree level nil nil t) - (when org-log-refile - (org-add-log-setup 'refile nil nil org-log-refile) - (unless (eq org-log-refile 'note) - (save-excursion (org-add-log-note)))) + ;; Record information, according to `org-log-refile'. + ;; Do not prompt for a note when refiling multiple + ;; headlines, however. Simply add a time stamp. + (cond + ((not org-log-refile)) + (regionp + (org-map-region + (lambda () (org-add-log-setup 'refile nil nil 'time)) + (point) + (+ (point) (- region-end region-start)))) + (t + (org-add-log-setup 'refile nil nil org-log-refile))) (and org-auto-align-tags (let ((org-loop-over-headlines-in-active-region nil)) - (org-set-tags nil t))) + (org-align-tags))) (let ((bookmark-name (plist-get org-bookmark-names-plist :last-refile))) (when bookmark-name @@ -11828,13 +11459,15 @@ prefix argument (`C-u C-u C-u C-c C-w')." (unless org-refile-keep (if regionp (delete-region (point) (+ (point) (- region-end region-start))) - (delete-region - (and (org-back-to-heading t) (point)) - (min (1+ (buffer-size)) (org-end-of-subtree t t) (point))))) + (org-preserve-local-variables + (delete-region + (and (org-back-to-heading t) (point)) + (min (1+ (buffer-size)) (org-end-of-subtree t t) (point)))))) (when (featurep 'org-inlinetask) (org-inlinetask-remove-END-maybe)) (setq org-markers-to-move nil) - (message (concat actionmsg " to \"%s\" in file %s: done") (car it) file))))))) + (message "%s to \"%s\" in file %s: done" actionmsg + (car it) file))))))) (defun org-refile-goto-last-stored () "Go to the location where the last refile was stored." @@ -12146,76 +11779,188 @@ keywords relative to each registered export back-end." "TITLE:" "TODO:" "TYP_TODO:" "SELECT_TAGS:" "EXCLUDE_TAGS:")) (defcustom org-structure-template-alist - '(("s" "#+BEGIN_SRC ?\n\n#+END_SRC") - ("e" "#+BEGIN_EXAMPLE\n?\n#+END_EXAMPLE") - ("q" "#+BEGIN_QUOTE\n?\n#+END_QUOTE") - ("v" "#+BEGIN_VERSE\n?\n#+END_VERSE") - ("V" "#+BEGIN_VERBATIM\n?\n#+END_VERBATIM") - ("c" "#+BEGIN_CENTER\n?\n#+END_CENTER") - ("C" "#+BEGIN_COMMENT\n?\n#+END_COMMENT") - ("l" "#+BEGIN_EXPORT latex\n?\n#+END_EXPORT") - ("L" "#+LaTeX: ") - ("h" "#+BEGIN_EXPORT html\n?\n#+END_EXPORT") - ("H" "#+HTML: ") - ("a" "#+BEGIN_EXPORT ascii\n?\n#+END_EXPORT") - ("A" "#+ASCII: ") - ("i" "#+INDEX: ?") - ("I" "#+INCLUDE: %file ?")) - "Structure completion elements. -This is a list of abbreviation keys and values. The value gets inserted -if you type `<' followed by the key and then press the completion key, -usually `TAB'. %file will be replaced by a file name after prompting -for the file using completion. The cursor will be placed at the position -of the `?' in the template. -There are two templates for each key, the first uses the original Org syntax, -the second uses Emacs Muse-like syntax tags. These Muse-like tags become -the default when the /org-mtags.el/ module has been loaded. See also the -variable `org-mtags-prefer-muse-templates'." - :group 'org-completion + '(("a" . "export ascii") + ("c" . "center") + ("C" . "comment") + ("e" . "example") + ("E" . "export") + ("h" . "export html") + ("l" . "export latex") + ("q" . "quote") + ("s" . "src") + ("v" . "verse")) + "An alist of keys and block types. +`org-insert-structure-template' will display a menu with this +list of templates to choose from. The block type is inserted, +with \"#+BEGIN_\" and \"#+END_\" added automatically. + +The menu keys are defined by the car of each entry in this alist. +If two entries have the keys \"a\" and \"aa\" respectively, the +former will be inserted by typing \"a TAB/RET/SPC\" and the +latter will be inserted by typing \"aa\". If an entry with the +key \"aab\" is later added, it can be inserted by typing \"ab\". + +If loaded, Org Tempo also uses `org-structure-template-alist'. A +block can be inserted by pressing TAB after the string \" (length elms) 3))) + (append + (list + ;; Make a description of the submenu. + (list topkey + (concat + (mapconcat #'cdr + (cl-subseq elms 0 (if long 3 (length elms))) + ", ") + (when long ", ...")))) + ;; List of entries in submenu. + (cl-mapcar #'list + (org--insert-structure-template-unique-keys keys) + (mapcar #'cdr elms) + (make-list (length elms) "")))))) + superlist)) + "Select a key\n============" + "Key: "))) + +(defun org--insert-structure-template-unique-keys (keys) + "Make a list of unique, two characters long elements from KEYS. + +Elements of length one have a tab appended. Elements of length +two are kept as is. Longer elements are truncated to length two. + +If an element cannot be made unique, an error is raised." + (let ((orderd-keys (cl-sort (copy-sequence keys) #'< :key #'length)) + menu-keys) + (dolist (key orderd-keys) + (let ((potential-key + (cl-case (length key) + (1 (concat key "\t")) + (2 key) + (otherwise + (cl-find-if-not (lambda (k) (assoc k menu-keys)) + (mapcar (apply-partially #'concat (substring key 0 1)) + (split-string (substring key 1) "" t))))))) + (if (or (not potential-key) (assoc potential-key menu-keys)) + (user-error "Could not make unique key for %s." key) + (push (cons potential-key key) menu-keys)))) + (mapcar #'car + (cl-sort menu-keys #'< + :key (lambda (elm) (cl-position (cdr elm) keys)))))) + +(defun org-insert-structure-template (type) + "Insert a block structure of the type #+begin_foo/#+end_foo. +Select a block from `org-structure-template-alist' then type +either RET, TAB or SPC to write the block type. With an active +region, wrap the region in the block. Otherwise, insert an empty +block." + (interactive + (list (pcase (org--insert-structure-template-mks) + (`("\t" . ,_) (read-string "Structure type: ")) + (`(,_ ,choice . ,_) choice)))) + (let* ((region? (use-region-p)) + (region-start (and region? (region-beginning))) + (region-end (and region? (copy-marker (region-end)))) + (extended? (string-match-p "\\`\\(src\\|export\\)\\'" type)) + (verbatim? (string-match-p + (concat "\\`" (regexp-opt '("example" "export" "src"))) + type))) + (when region? (goto-char region-start)) + (let ((column (current-indentation))) + (if (save-excursion (skip-chars-backward " \t") (bolp)) + (beginning-of-line) + (insert "\n")) + (save-excursion + (indent-to column) + (insert (format "#+begin_%s%s\n" type (if extended? " " ""))) + (when region? + (when verbatim? (org-escape-code-in-region (point) region-end)) + (goto-char region-end) + ;; Ignore empty lines at the end of the region. + (skip-chars-backward " \r\t\n") + (end-of-line)) + (unless (bolp) (insert "\n")) + (indent-to column) + (insert (format "#+end_%s" (car (split-string type)))) + (if (looking-at "[ \t]*$") (replace-match "") + (insert "\n")) + (when (and (eobp) (not (bolp))) (insert "\n"))) + (if extended? (end-of-line) + (forward-line) + (skip-chars-forward " \t"))))) -(defun org-complete-expand-structure-template (start cell) - "Expand a structure template." - (let ((rpl (nth 1 cell)) - (ind "")) - (delete-region start (point)) - (when (string-match "\\`[ \t]*#\\+" rpl) - (cond - ((bolp)) - ((not (string-match "\\S-" (buffer-substring (point-at-bol) (point)))) - (setq ind (buffer-substring (point-at-bol) (point)))) - (t (newline)))) - (setq start (point)) - (when (string-match "%file" rpl) - (setq rpl (replace-match - (concat - "\"" - (save-match-data - (abbreviate-file-name (read-file-name "Include file: "))) - "\"") - t t rpl))) - (setq rpl (mapconcat 'identity (split-string rpl "\n") - (concat "\n" ind))) - (insert rpl) - (when (re-search-backward "\\?" start t) (delete-char 1)))) ;;;; TODO, DEADLINE, Comments @@ -12242,8 +11987,6 @@ expands them." If the last change removed the TODO tag or switched to DONE, then this is nil.") -(defvar org-setting-tags nil) ; dynamically skipped - (defvar org-todo-setup-filter-hook nil "Hook for functions that pre-filter todo specs. Each function takes a todo spec and returns either nil or the spec @@ -12363,7 +12106,7 @@ When called through ELisp, arg is also interpreted in the following way: (or (looking-at (concat " +" org-todo-regexp "\\( +\\|[ \t]*$\\)")) (looking-at "\\(?: *\\|[ \t]*$\\)")) (let* ((match-data (match-data)) - (startpos (point-at-bol)) + (startpos (copy-marker (line-beginning-position))) (logging (save-match-data (org-entry-get nil "LOGGING" t t))) (org-log-done org-log-done) (org-log-repeat org-log-repeat) @@ -12444,7 +12187,7 @@ When called through ELisp, arg is also interpreted in the following way: (run-hook-with-args-until-success 'org-todo-get-default-hook org-state org-last-state) org-state)) - (next (if org-state (concat " " org-state " ") " ")) + (next (if (org-string-nw-p org-state) (concat " " org-state " ") " ")) (change-plist (list :type 'todo-state-change :from this :to org-state :position startpos)) dolog now-done-p) @@ -12515,9 +12258,11 @@ When called through ELisp, arg is also interpreted in the following way: (org-add-log-setup 'state org-state this dolog))) ;; Fixup tag positioning. (org-todo-trigger-tag-changes org-state) - (and org-auto-align-tags (not org-setting-tags) (org-set-tags nil t)) + (when org-auto-align-tags (org-align-tags)) (when org-provide-todo-statistics (org-update-parent-todo-statistics)) + (when (bound-and-true-p org-clock-out-when-done) + (org-clock-out-if-current)) (run-hooks 'org-after-todo-state-change-hook) (when (and arg (not (member org-state org-done-keywords))) (setq head (org-get-todo-sequence-head org-state))) @@ -12623,7 +12368,7 @@ not relevant for the behavior, but it makes things more visible. Note that toggling the tag with tags commands will not change the property and therefore not influence behavior! -This can be t, meaning the tag ORDERED should be used, It can also be a +This can be t, meaning the tag ORDERED should be used. It can also be a string to select a different tag for this task." :group 'org-todo :type '(choice @@ -12943,7 +12688,9 @@ Returns the new TODO keyword, or nil if no state change should occur." (when (and (= cnt 0) (not ingroup)) (insert " ")) (insert "[" c "] " tg (make-string (- fwidth 4 (length tg)) ?\ )) - (when (= (setq cnt (1+ cnt)) ncol) + (when (and (= (setq cnt (1+ cnt)) ncol) + ;; Avoid lines with just a closing delimiter. + (not (equal (car tbl) '(:endgroup)))) (insert "\n") (when ingroup (insert " ")) (setq cnt 0))))) @@ -13044,115 +12791,109 @@ This function is run automatically after each state change to a DONE state." (org-log-done nil) (org-todo-log-states nil) (end (copy-marker (org-entry-end-position)))) - (unwind-protect - (when (and repeat (not (zerop (string-to-number (substring repeat 1))))) - (when (eq org-log-repeat t) (setq org-log-repeat 'state)) - (let ((to-state (or (org-entry-get nil "REPEAT_TO_STATE" 'selective) - org-todo-repeat-to-state))) - (org-todo (cond - ((and to-state (member to-state org-todo-keywords-1)) - to-state) - ((eq interpret 'type) org-last-state) - (head) - (t 'none)))) - (org-back-to-heading t) - (org-add-planning-info nil nil 'closed) - ;; When `org-log-repeat' is non-nil or entry contains - ;; a clock, set LAST_REPEAT property. - (when (or org-log-repeat - (catch :clock - (save-excursion - (while (re-search-forward org-clock-line-re end t) - (when (org-at-clock-log-p) (throw :clock t)))))) - (org-entry-put nil "LAST_REPEAT" (format-time-string - (org-time-stamp-format t t) - (current-time)))) - (when org-log-repeat - (if (or (memq 'org-add-log-note (default-value 'post-command-hook)) - (memq 'org-add-log-note post-command-hook)) - ;; We are already setup for some record. - (when (eq org-log-repeat 'note) - ;; Make sure we take a note, not only a time stamp. - (setq org-log-note-how 'note)) - ;; Set up for taking a record. - (org-add-log-setup 'state - (or done-word (car org-done-keywords)) - org-last-state - org-log-repeat))) - (let ((planning-re (regexp-opt - (list org-scheduled-string org-deadline-string)))) - (while (re-search-forward org-ts-regexp end t) - (let* ((ts (match-string 0)) - (planning? (org-at-planning-p)) - (type (if (not planning?) "Plain:" - (save-excursion - (re-search-backward - planning-re (line-beginning-position) t) - (match-string 0))))) - (cond - ;; Ignore fake time-stamps (e.g., within comments). - ((not (org-at-timestamp-p 'agenda))) - ;; Time-stamps without a repeater are usually - ;; skipped. However, a SCHEDULED time-stamp without - ;; one is removed, as they are no longer relevant. - ((not (string-match "\\([.+]\\)?\\(\\+[0-9]+\\)\\([hdwmy]\\)" - ts)) - (when (equal type org-scheduled-string) - (org-remove-timestamp-with-keyword type))) - (t - (let ((n (string-to-number (match-string 2 ts))) - (what (match-string 3 ts))) - (when (equal what "w") (setq n (* n 7) what "d")) - (when (and (equal what "h") - (not (string-match-p "[0-9]\\{1,2\\}:[0-9]\\{2\\}" - ts))) - (user-error - "Cannot repeat in Repeat in %d hour(s) because no hour \ -has been set" - n)) - ;; Preparation, see if we need to modify the start - ;; date for the change. - (when (match-end 1) - (let ((time (save-match-data - (org-time-string-to-time ts)))) - (cond - ((equal (match-string 1 ts) ".") - ;; Shift starting date to today - (org-timestamp-change - (- (org-today) (time-to-days time)) - 'day)) - ((equal (match-string 1 ts) "+") - (let ((nshiftmax 10) - (nshift 0)) - (while (or (= nshift 0) - (not (time-less-p (current-time) time))) - (when (= (cl-incf nshift) nshiftmax) - (or (y-or-n-p - (format "%d repeater intervals were not \ + (when (and repeat (not (= 0 (string-to-number (substring repeat 1))))) + (when (eq org-log-repeat t) (setq org-log-repeat 'state)) + (let ((to-state (or (org-entry-get nil "REPEAT_TO_STATE" 'selective) + (and (stringp org-todo-repeat-to-state) + org-todo-repeat-to-state) + (and org-todo-repeat-to-state org-last-state)))) + (org-todo (cond ((and to-state (member to-state org-todo-keywords-1)) + to-state) + ((eq interpret 'type) org-last-state) + (head) + (t 'none)))) + (org-back-to-heading t) + (org-add-planning-info nil nil 'closed) + ;; When `org-log-repeat' is non-nil or entry contains + ;; a clock, set LAST_REPEAT property. + (when (or org-log-repeat + (catch :clock + (save-excursion + (while (re-search-forward org-clock-line-re end t) + (when (org-at-clock-log-p) (throw :clock t)))))) + (org-entry-put nil "LAST_REPEAT" (format-time-string + (org-time-stamp-format t t)))) + (when org-log-repeat + (if (or (memq 'org-add-log-note (default-value 'post-command-hook)) + (memq 'org-add-log-note post-command-hook)) + ;; We are already setup for some record. + (when (eq org-log-repeat 'note) + ;; Make sure we take a note, not only a time stamp. + (setq org-log-note-how 'note)) + ;; Set up for taking a record. + (org-add-log-setup 'state + (or done-word (car org-done-keywords)) + org-last-state + org-log-repeat))) + ;; Time-stamps without a repeater are usually skipped. However, + ;; a SCHEDULED time-stamp without one is removed, as they are no + ;; longer relevant. + (save-excursion + (let ((scheduled (org-entry-get (point) "SCHEDULED"))) + (when (and scheduled (not (string-match-p org-repeat-re scheduled))) + (org-remove-timestamp-with-keyword org-scheduled-string)))) + ;; Update every time-stamp with a repeater in the entry. + (let ((planning-re (regexp-opt + (list org-scheduled-string org-deadline-string)))) + (while (re-search-forward org-repeat-re end t) + (let* ((ts (match-string 0)) + (type (if (not (org-at-planning-p)) "Plain:" + (save-excursion + (re-search-backward + planning-re (line-beginning-position) t) + (match-string 0))))) + (when (and (org-at-timestamp-p 'agenda) + (string-match "\\([.+]\\)?\\(\\+[0-9]+\\)\\([hdwmy]\\)" ts)) + (let ((n (string-to-number (match-string 2 ts))) + (what (match-string 3 ts))) + (when (equal what "w") (setq n (* n 7) what "d")) + (when (and (equal what "h") + (not (string-match-p "[0-9]\\{1,2\\}:[0-9]\\{2\\}" + ts))) + (user-error + "Cannot repeat in %d hour(s) because no hour has been set" + n)) + ;; Preparation, see if we need to modify the start + ;; date for the change. + (when (match-end 1) + (let ((time (save-match-data (org-time-string-to-time ts))) + (repeater-type (match-string 1 ts))) + (cond + ((equal "." repeater-type) + ;; Shift starting date to today. + (org-timestamp-change (- (org-today) (time-to-days time)) + 'day)) + ((equal "+" repeater-type) + (let ((nshiftmax 10) + (nshift 0)) + (while (or (= nshift 0) + (not (org-time-less-p nil time))) + (when (= nshiftmax (cl-incf nshift)) + (or (y-or-n-p + (format "%d repeater intervals were not \ enough to shift date past today. Continue? " - nshift)) - (user-error "Abort"))) - (org-timestamp-change n (cdr (assoc what whata))) - (org-in-regexp org-ts-regexp3) - (setq ts (match-string 1)) - (setq time - (save-match-data - (org-time-string-to-time ts))))) - (org-timestamp-change (- n) (cdr (assoc what whata))) - ;; Rematch, so that we have everything in place - ;; for the real shift. + nshift)) + (user-error "Abort"))) + (org-timestamp-change n (cdr (assoc what whata))) (org-in-regexp org-ts-regexp3) (setq ts (match-string 1)) - (string-match "\\([.+]\\)?\\(\\+[0-9]+\\)\\([hdwmy]\\)" - ts))))) - (save-excursion - (org-timestamp-change n (cdr (assoc what whata)) nil t)) - (setq msg - (concat - msg type " " org-last-changed-timestamp " ")))))))) - (setq org-log-post-message msg) - (message "%s" msg)) - (set-marker end nil)))) + (setq time + (save-match-data + (org-time-string-to-time ts))))) + (org-timestamp-change (- n) (cdr (assoc what whata))) + ;; Rematch, so that we have everything in place + ;; for the real shift. + (org-in-regexp org-ts-regexp3) + (setq ts (match-string 1)) + (string-match "\\([.+]\\)?\\(\\+[0-9]+\\)\\([hdwmy]\\)" + ts))))) + (save-excursion + (org-timestamp-change n (cdr (assoc what whata)) nil t)) + (setq msg + (concat msg type " " org-last-changed-timestamp " "))))))) + (run-hooks 'org-todo-repeat-hook) + (setq org-log-post-message msg) + (message msg)))) (defun org-show-todo-tree (arg) "Make a compact tree which shows all headlines marked with TODO. @@ -13204,12 +12945,15 @@ TYPE is either `deadline' or `scheduled'. See `org-deadline' or (match-string 1 old-date))))) (pcase arg (`(4) - (when (and old-date log) - (org-add-log-setup (if deadline? 'deldeadline 'delschedule) - nil old-date log)) - (org-remove-timestamp-with-keyword keyword) - (message (if deadline? "Item no longer has a deadline." - "Item is no longer scheduled."))) + (if (not old-date) + (message (if deadline? "Entry had no deadline to remove" + "Entry was not scheduled")) + (when (and old-date log) + (org-add-log-setup (if deadline? 'deldeadline 'delschedule) + nil old-date log)) + (org-remove-timestamp-with-keyword keyword) + (message (if deadline? "Entry no longer has a deadline." + "Entry is no longer scheduled.")))) (`(16) (save-excursion (org-back-to-heading t) @@ -13296,7 +13040,7 @@ for calling org-schedule with, or if there is no scheduling, returns nil." (let ((time (org-entry-get pom "SCHEDULED" inherit))) (when time - (apply 'encode-time (org-parse-time-string time))))) + (org-time-string-to-time time)))) (defun org-get-deadline-time (pom &optional inherit) "Get the deadline as a time tuple, of a format suitable for @@ -13304,7 +13048,7 @@ calling org-deadline with, or if there is no scheduling, returns nil." (let ((time (org-entry-get pom "DEADLINE" inherit))) (when time - (apply 'encode-time (org-parse-time-string time))))) + (org-time-string-to-time time)))) (defun org-remove-timestamp-with-keyword (keyword) "Remove all time stamps with KEYWORD in the current entry." @@ -13363,7 +13107,7 @@ WHAT entry will also be removed." org-deadline-time-regexp) end t) (setq ts (match-string 1) - default-time (apply 'encode-time (org-parse-time-string ts)) + default-time (org-time-string-to-time ts) default-input (and ts (org-get-compact-tod ts))))))) (when what (setq time @@ -13374,9 +13118,12 @@ WHAT entry will also be removed." (org-read-date-analyze time default-time (decode-time default-time))) ;; If necessary, get the time from the user - (or time (org-read-date nil 'to-time nil nil + (or time (org-read-date nil 'to-time nil + (cl-case what + (deadline "DEADLINE") + (scheduled "SCHEDULED") + (otherwise nil)) default-time default-input))))) - (org-with-wide-buffer (org-back-to-heading t) (forward-line) @@ -13488,7 +13235,9 @@ narrowing." (unless (bolp) (insert "\n")) (let ((beg (point))) (insert ":" drawer ":\n:END:\n") - (org-indent-region beg (point))) + (org-indent-region beg (point)) + (org-flag-region + (line-end-position -1) (1- (point)) t 'org-hide-drawer)) (end-of-line -1))))) (t (org-end-of-meta-data org-log-state-notes-insert-after-drawers) @@ -13527,8 +13276,8 @@ EXTRA is additional text that will be inserted into the notes buffer." (regexp-quote (cdr (assq 'state org-log-note-headings))) `(("%d" . ,org-ts-regexp-inactive) ("%D" . ,org-ts-regexp) - ("%s" . "\"\\S-+\"") - ("%S" . "\"\\S-+\"") + ("%s" . "\\(?:\"\\S-+\"\\)?") + ("%S" . "\\(?:\"\\S-+\"\\)?") ("%t" . ,org-ts-regexp-inactive) ("%T" . ,org-ts-regexp) ("%u" . ".*?") @@ -13552,25 +13301,19 @@ EXTRA is additional text that will be inserted into the notes buffer." (let ((org-inhibit-startup t)) (org-mode)) (insert (format "# Insert note for %s. # Finish with C-c C-c, or cancel with C-c C-k.\n\n" - (cond - ((eq org-log-note-purpose 'clock-out) "stopped clock") - ((eq org-log-note-purpose 'done) "closed todo item") - ((eq org-log-note-purpose 'state) + (cl-case org-log-note-purpose + (clock-out "stopped clock") + (done "closed todo item") + (reschedule "rescheduling") + (delschedule "no longer scheduled") + (redeadline "changing deadline") + (deldeadline "removing deadline") + (refile "refiling") + (note "this entry") + (state (format "state change from \"%s\" to \"%s\"" (or org-log-note-previous-state "") (or org-log-note-state ""))) - ((eq org-log-note-purpose 'reschedule) - "rescheduling") - ((eq org-log-note-purpose 'delschedule) - "no longer scheduled") - ((eq org-log-note-purpose 'redeadline) - "changing deadline") - ((eq org-log-note-purpose 'deldeadline) - "removing deadline") - ((eq org-log-note-purpose 'refile) - "refiling") - ((eq org-log-note-purpose 'note) - "this entry") (t (error "This should not happen"))))) (when org-log-note-extra (insert org-log-note-extra)) (setq-local org-finish-function 'org-store-log-note) @@ -13654,8 +13397,7 @@ EXTRA is additional text that will be inserted into the notes buffer." (indent-line-to ind) (insert line))) (message "Note stored") - (org-back-to-heading t) - (org-cycle-hide-drawers 'children)) + (org-back-to-heading t)) ;; Fix `buffer-undo-list' when `org-store-log-note' is called ;; from within `org-add-log-note' because `buffer-undo-list' ;; is then modified outside of `org-with-remote-undo'. @@ -13772,126 +13514,58 @@ The function must neither move point nor alter narrowing." (unless keep-previous (org-remove-occur-highlights nil nil t)) (push (cons regexp callback) org-occur-parameters) - (let ((cnt 0)) - (save-excursion - (goto-char (point-min)) - (when (or (not keep-previous) ; do not want to keep - (not org-occur-highlights)) ; no previous matches - ;; hide everything - (org-overview)) - (let ((case-fold-search (if (eq org-occur-case-fold-search 'smart) - (isearch-no-upper-case-p regexp t) - org-occur-case-fold-search))) - (while (re-search-forward regexp nil t) - (when (or (not callback) - (save-match-data (funcall callback))) - (setq cnt (1+ cnt)) - (when org-highlight-sparse-tree-matches - (org-highlight-new-match (match-beginning 0) (match-end 0))) - (org-show-context 'occur-tree))))) - (when org-remove-highlights-with-change - (add-hook 'before-change-functions 'org-remove-occur-highlights - nil 'local)) - (unless org-sparse-tree-open-archived-trees - (org-hide-archived-subtrees (point-min) (point-max))) - (run-hooks 'org-occur-hook) - (when (called-interactively-p 'interactive) - (message "%d match(es) for regexp %s" cnt regexp)) - cnt)) - -(defun org-occur-next-match (&optional n _reset) - "Function for `next-error-function' to find sparse tree matches. -N is the number of matches to move, when negative move backwards. -This function always goes back to the starting point when no -match is found." - (let* ((limit (if (< n 0) (point-min) (point-max))) - (search-func (if (< n 0) - 'previous-single-char-property-change - 'next-single-char-property-change)) - (n (abs n)) - (pos (point)) - p1) - (catch 'exit - (while (setq p1 (funcall search-func (point) 'org-type)) - (when (equal p1 limit) - (goto-char pos) - (user-error "No more matches")) - (when (equal (get-char-property p1 'org-type) 'org-occur) - (setq n (1- n)) - (when (= n 0) - (goto-char p1) - (throw 'exit (point)))) - (goto-char p1)) - (goto-char p1) - (user-error "No more matches")))) - -(defun org-show-context (&optional key) - "Make sure point and context are visible. -Optional argument KEY, when non-nil, is a symbol. See -`org-show-context-detail' for allowed values and how much is to -be shown." - (org-show-set-visibility - (cond ((symbolp org-show-context-detail) org-show-context-detail) - ((cdr (assq key org-show-context-detail))) - (t (cdr (assq 'default org-show-context-detail)))))) - -(defun org-show-set-visibility (detail) - "Set visibility around point according to DETAIL. -DETAIL is either nil, `minimal', `local', `ancestors', `lineage', -`tree', `canonical' or t. See `org-show-context-detail' for more -information." - ;; Show current heading and possibly its entry, following headline - ;; or all children. - (if (and (org-at-heading-p) (not (eq detail 'local))) - (org-flag-heading nil) - (org-show-entry) - ;; If point is hidden within a drawer or a block, make sure to - ;; expose it. - (dolist (o (overlays-at (point))) - (when (memq (overlay-get o 'invisible) '(org-hide-block outline)) - (delete-overlay o))) - (unless (org-before-first-heading-p) - (org-with-limited-levels - (cl-case detail - ((tree canonical t) (org-show-children)) - ((nil minimal ancestors)) - (t (save-excursion - (outline-next-heading) - (org-flag-heading nil))))))) - ;; Show all siblings. - (when (eq detail 'lineage) (org-show-siblings)) - ;; Show ancestors, possibly with their children. - (when (memq detail '(ancestors lineage tree canonical t)) - (save-excursion - (while (org-up-heading-safe) - (org-flag-heading nil) - (when (memq detail '(canonical t)) (org-show-entry)) - (when (memq detail '(tree canonical t)) (org-show-children)))))) - -(defvar org-reveal-start-hook nil - "Hook run before revealing a location.") - -(defun org-reveal (&optional siblings) - "Show current entry, hierarchy above it, and the following headline. - -This can be used to show a consistent set of context around -locations exposed with `org-show-context'. - -With optional argument SIBLINGS, on each level of the hierarchy all -siblings are shown. This repairs the tree structure to what it would -look like when opened with hierarchical calls to `org-cycle'. + (let ((cnt 0)) + (save-excursion + (goto-char (point-min)) + (when (or (not keep-previous) ; do not want to keep + (not org-occur-highlights)) ; no previous matches + ;; hide everything + (org-overview)) + (let ((case-fold-search (if (eq org-occur-case-fold-search 'smart) + (isearch-no-upper-case-p regexp t) + org-occur-case-fold-search))) + (while (re-search-forward regexp nil t) + (when (or (not callback) + (save-match-data (funcall callback))) + (setq cnt (1+ cnt)) + (when org-highlight-sparse-tree-matches + (org-highlight-new-match (match-beginning 0) (match-end 0))) + (org-show-context 'occur-tree))))) + (when org-remove-highlights-with-change + (add-hook 'before-change-functions 'org-remove-occur-highlights + nil 'local)) + (unless org-sparse-tree-open-archived-trees + (org-hide-archived-subtrees (point-min) (point-max))) + (run-hooks 'org-occur-hook) + (when (called-interactively-p 'interactive) + (message "%d match(es) for regexp %s" cnt regexp)) + cnt)) -With a \\[universal-argument] \\[universal-argument] prefix, \ -go to the parent and show the entire tree." - (interactive "P") - (run-hooks 'org-reveal-start-hook) - (cond ((equal siblings '(4)) (org-show-set-visibility 'canonical)) - ((equal siblings '(16)) - (save-excursion - (when (org-up-heading-safe) - (org-show-subtree) - (run-hook-with-args 'org-cycle-hook 'subtree)))) - (t (org-show-set-visibility 'lineage)))) +(defun org-occur-next-match (&optional n _reset) + "Function for `next-error-function' to find sparse tree matches. +N is the number of matches to move, when negative move backwards. +This function always goes back to the starting point when no +match is found." + (let* ((limit (if (< n 0) (point-min) (point-max))) + (search-func (if (< n 0) + 'previous-single-char-property-change + 'next-single-char-property-change)) + (n (abs n)) + (pos (point)) + p1) + (catch 'exit + (while (setq p1 (funcall search-func (point) 'org-type)) + (when (equal p1 limit) + (goto-char pos) + (user-error "No more matches")) + (when (equal (get-char-property p1 'org-type) 'org-occur) + (setq n (1- n)) + (when (= n 0) + (goto-char p1) + (throw 'exit (point)))) + (goto-char p1)) + (goto-char p1) + (user-error "No more matches")))) (defun org-highlight-new-match (beg end) "Highlight from BEG to END and mark the highlight is an occur headline." @@ -13930,10 +13604,19 @@ from the `before-change-functions' in the current buffer." (interactive) (org-priority 'down)) -(defun org-priority (&optional action _show) +(defun org-priority (&optional action show) "Change the priority of an item. -ACTION can be `set', `up', `down', or a character." + +When called interactively with a `\\[universal-argument]' prefix, +show the priority in the minibuffer instead of changing it. + +When called programatically, ACTION can be `set', `up', `down', +or a character." (interactive "P") + (when show + ;; Deprecation warning inserted for Org 9.2; once enough time has + ;; passed the SHOW argument should be removed. + (warn "`org-priority' called with deprecated SHOW argument")) (if (equal action '(4)) (org-show-priority) (unless org-enable-priority-commands @@ -13959,7 +13642,7 @@ ACTION can be `set', `up', `down', or a character." (when (and (= (upcase org-highest-priority) org-highest-priority) (= (upcase org-lowest-priority) org-lowest-priority)) (setq new (upcase new))) - (cond ((equal new ?\ ) (setq remove t)) + (cond ((equal new ?\s) (setq remove t)) ((or (< (upcase new) org-highest-priority) (> (upcase new) org-lowest-priority)) (user-error "Priority must be between `%c' and `%c'" org-highest-priority org-lowest-priority)))) @@ -14008,7 +13691,7 @@ ACTION can be `set', `up', `down', or a character." (insert " [#" news "]")) (goto-char (match-beginning 3)) (insert "[#" news "] ")))) - (org-set-tags nil 'align)) + (org-align-tags)) (if remove (message "Priority removed") (message "Priority of current item set to %s" news))))) @@ -14048,9 +13731,9 @@ Can be set by the action argument to `org-scan-tags' and `org-map-entries'.") "The current tag list while the tags scanner is running.") (defvar org-trust-scanner-tags nil - "Should `org-get-tags-at' use the tags for the scanner. + "Should `org-get-tags' use the tags for the scanner. This is for internal dynamical scoping only. -When this is non-nil, the function `org-get-tags-at' will return the value +When this is non-nil, the function `org-get-tags' will return the value of `org-scanner-tags' instead of building the list by itself. This can lead to large speed-ups when the tags scanner is used in a file with many entries, and when the list of tags is retrieved, for example to @@ -14085,9 +13768,8 @@ headlines matching this string." ;; Get the correct level to match (concat "\\*\\{" (number-to-string start-level) "\\} ") org-outline-regexp) - " *\\(\\<\\(" - (mapconcat #'regexp-quote org-todo-keywords-1 "\\|") - "\\)\\>\\)? *\\(.*?\\)\\(:[[:alnum:]_@#%:]+:\\)?[ \t]*$")) + " *\\(" (regexp-opt org-todo-keywords-1 'words) "\\)?" + " *\\(.*?\\)\\([ \t]:\\(?:" org-tag-re ":\\)+\\)?[ \t]*$")) (props (list 'face 'default 'done-face 'org-agenda-done 'undone-face 'default @@ -14096,7 +13778,7 @@ headlines matching this string." 'org-todo-regexp org-todo-regexp 'org-complex-heading-regexp org-complex-heading-regexp 'help-echo - (format "mouse-2 or RET jump to org file %s" + (format "mouse-2 or RET jump to Org file %S" (abbreviate-file-name (or (buffer-file-name (buffer-base-buffer)) (buffer-name (buffer-base-buffer))))))) @@ -14117,10 +13799,11 @@ headlines matching this string." (re-search-forward re nil t)) (setq org-map-continue-from nil) (catch :skip - (setq todo - ;; TODO: is the 1-2 difference a bug? - (when (match-end 1) (match-string-no-properties 2)) - tags (when (match-end 4) (match-string-no-properties 4))) + ;; Ignore closing parts of inline tasks. + (when (and (fboundp 'org-inlinetask-end-p) (org-inlinetask-end-p)) + (throw :skip t)) + (setq todo (and (match-end 1) (match-string-no-properties 1))) + (setq tags (and (match-end 4) (org-trim (match-string-no-properties 4)))) (goto-char (setq lspos (match-beginning 0))) (setq level (org-reduced-level (org-outline-level)) category (org-get-category)) @@ -14292,10 +13975,12 @@ instead of the agenda files." (mapcar (lambda (file) (set-buffer (find-file-noselect file)) - (mapcar (lambda (x) - (and (stringp (car-safe x)) - (list (car-safe x)))) - (or org-current-tag-alist (org-get-buffer-tags)))) + (org--tag-add-to-alist + (org-get-buffer-tags) + (mapcar (lambda (x) + (and (stringp (car-safe x)) + (list (car-safe x)))) + org-current-tag-alist))) (if (car-safe files) files (org-agenda-files)))))))) @@ -14322,16 +14007,21 @@ See also `org-scan-tags'." ;; Get a new match request, with completion against the global ;; tags table and the local tags in current buffer. (let ((org-last-tags-completion-table - (org-uniquify - (delq nil (append (org-get-buffer-tags) - (org-global-tags-completion-table)))))) + (org--tag-add-to-alist + (org-get-buffer-tags) + (org-global-tags-completion-table)))) (setq match (completing-read "Match: " 'org-tags-completion-function nil nil nil 'org-tags-history)))) (let ((match0 match) - (re "^&?\\([-+:]\\)?\\({[^}]+}\\|LEVEL\\([<=>]\\{1,2\\}\\)\\([0-9]+\\)\\|\\(\\(?:[[:alnum:]_]+\\(?:\\\\-\\)*\\)+\\)\\([<>=]\\{1,2\\}\\)\\({[^}]+}\\|\"[^\"]*\"\\|-?[.0-9]+\\(?:[eE][-+]?[0-9]+\\)?\\)\\|[[:alnum:]_@#%]+\\)") + (re (concat + "^&?\\([-+:]\\)?\\({[^}]+}\\|LEVEL\\([<=>]\\{1,2\\}\\)" + "\\([0-9]+\\)\\|\\(\\(?:[[:alnum:]_]+\\(?:\\\\-\\)*\\)+\\)" + "\\([<>=]\\{1,2\\}\\)" + "\\({[^}]+}\\|\"[^\"]*\"\\|-?[.0-9]+\\(?:[eE][-+]?[0-9]+\\)?\\)" + "\\|" org-tag-re "\\)")) (start 0) tagsmatch todomatch tagsmatcher todomatcher) @@ -14400,7 +14090,7 @@ See also `org-scan-tags'." (if timep 'time strp)))) (setq pv (if (or regexp strp) (substring pv 1 -1) pv)) (when timep (setq pv (org-matcher-time pv))) - (cond ((and regexp (eq po 'org<>)) + (cond ((and regexp (eq po '/=)) `(not (string-match ,pv (or ,gv "")))) (regexp `(string-match ,pv (or ,gv ""))) (strp `(,po (or ,gv "") ,pv)) @@ -14445,7 +14135,20 @@ See also `org-scan-tags'." (setq matcher `(and (member todo org-not-done-keywords) ,matcher))) (cons match0 `(lambda (todo tags-list level) ,matcher))))) -(defun org-tags-expand (match &optional single-as-list downcased tags-already-expanded) +(defun org--tags-expand-group (group tag-groups expanded) + "Recursively Expand all tags in GROUP, according to TAG-GROUPS. +TAG-GROUPS is the list of groups used for expansion. EXPANDED is +an accumulator used in recursive calls." + (dolist (tag group) + (unless (member tag expanded) + (let ((group (assoc tag tag-groups))) + (push tag expanded) + (when group + (setq expanded + (org--tags-expand-group (cdr group) tag-groups expanded)))))) + expanded) + +(defun org-tags-expand (match &optional single-as-list downcased) "Expand group tags in MATCH. This replaces every group tag in MATCH with a regexp tag search. @@ -14462,7 +14165,7 @@ E.g., this expansion Work|Home => {\\(?:Work\\|Lab\\|Conf\\}|Home will match anything tagged with \"Lab\" and \"Home\", or tagged -with \"Conf\" and \"Home\" or tagged with \"Work\" and \"home\". +with \"Conf\" and \"Home\" or tagged with \"Work\" and \"Home\". A group tag in MATCH can contain regular expressions of its own. For example, a group tag \"Proj\" defined as { Proj : {P@.+} } @@ -14474,241 +14177,78 @@ When the optional argument SINGLE-AS-LIST is non-nil, MATCH is assumed to be a single group tag, and the function will return the list of tags in this group. -When DOWNCASE is non-nil, expand downcased TAGS." - (if org-group-tags +When DOWNCASED is non-nil, expand downcased TAGS." + (unless (org-string-nw-p match) (error "Invalid match tag: %S" match)) + (let ((tag-groups + (let ((g (or org-tag-groups-alist-for-agenda org-tag-groups-alist))) + (if (not downcased) g + (mapcar (lambda (s) (mapcar #'downcase s)) g))))) + (cond + (single-as-list (org--tags-expand-group (list match) tag-groups nil)) + (org-group-tags (let* ((case-fold-search t) - (stable org-mode-syntax-table) - (taggroups (or org-tag-groups-alist-for-agenda org-tag-groups-alist)) - (taggroups (if downcased - (mapcar (lambda (tg) (mapcar #'downcase tg)) - taggroups) - taggroups)) - (taggroups-keys (mapcar #'car taggroups)) - (return-match (if downcased (downcase match) match)) - (count 0) - (work-already-expanded tags-already-expanded) - regexps-in-match tags-in-group regexp-in-group regexp-in-group-escaped) + (tag-syntax org-mode-syntax-table) + (group-keys (mapcar #'car tag-groups)) + (key-regexp (concat "\\([+-]?\\)" (regexp-opt group-keys 'words))) + (return-match (if downcased (downcase match) match))) + ;; Mark regexp-expressions in the match-expression so that we + ;; do not replace them later on. + (let ((s 0)) + (while (string-match "{.+?}" return-match s) + (setq s (match-end 0)) + (add-text-properties + (match-beginning 0) (match-end 0) '(regexp t) return-match))) ;; @ and _ are allowed as word-components in tags. - (modify-syntax-entry ?@ "w" stable) - (modify-syntax-entry ?_ "w" stable) - ;; Temporarily replace regexp-expressions in the match-expression. - (while (string-match "{.+?}" return-match) - (cl-incf count) - (push (match-string 0 return-match) regexps-in-match) - (setq return-match (replace-match (format "<%d>" count) t nil return-match))) - (while (and taggroups-keys - (with-syntax-table stable - (string-match - (concat "\\(?1:[+-]?\\)\\(?2:\\<" - (regexp-opt taggroups-keys) "\\>\\)") - return-match))) - (let* ((dir (match-string 1 return-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)) - (setq tags-in-group (assoc tag taggroups)) - (push tag work-already-expanded) - ;; Recursively expand each tag in the group, if the tag hasn't - ;; already been expanded. Restore the match-data after all recursive calls. - (save-match-data - (let (tags-expanded) - (dolist (x (cdr tags-in-group)) - (if (and (member x taggroups-keys) - (not (member x work-already-expanded))) - (setq tags-expanded - (delete-dups - (append - (org-tags-expand x t downcased - work-already-expanded) - tags-expanded))) - (setq tags-expanded - (append (list x) tags-expanded))) - (setq work-already-expanded - (delete-dups - (append tags-expanded - work-already-expanded)))) - (setq tags-in-group - (delete-dups (cons (car tags-in-group) - tags-expanded))))) - ;; Filter tag-regexps from tags. - (setq regexp-in-group-escaped - (delq nil (mapcar (lambda (x) - (if (stringp x) - (and (equal "{" (substring x 0 1)) - (equal "}" (substring x -1)) - x) - x)) - tags-in-group)) - regexp-in-group - (mapcar (lambda (x) - (substring x 1 -1)) - regexp-in-group-escaped) - tags-in-group - (delq nil (mapcar (lambda (x) - (if (stringp x) - (and (not (equal "{" (substring x 0 1))) - (not (equal "}" (substring x -1))) - x) - x)) - tags-in-group))) - ;; If single-as-list, do no more in the while-loop. - (if (not single-as-list) - (progn - (when regexp-in-group - (setq regexp-in-group - (concat "\\|" - (mapconcat 'identity regexp-in-group - "\\|")))) - (setq tags-in-group - (concat dir - "{\\<" - (regexp-opt tags-in-group) - "\\>" - regexp-in-group - "}")) - (when (stringp tags-in-group) - (org-add-props tags-in-group '(grouptag t))) - (setq return-match - (replace-match tags-in-group t t return-match))) - (setq tags-in-group - (append regexp-in-group-escaped tags-in-group)))) - (setq taggroups-keys (delete tag taggroups-keys)))) - ;; Add the regular expressions back into the match-expression again. - (while regexps-in-match - (setq return-match (replace-regexp-in-string (format "<%d>" count) - (pop regexps-in-match) - return-match t t)) - (cl-decf count)) - (if single-as-list - (if tags-in-group tags-in-group (list return-match)) - return-match)) - (if single-as-list - (list (if downcased (downcase match) match)) - match))) + (modify-syntax-entry ?@ "w" tag-syntax) + (modify-syntax-entry ?_ "w" tag-syntax) + ;; For each tag token found in MATCH, compute a regexp and it + (with-syntax-table tag-syntax + (replace-regexp-in-string + key-regexp + (lambda (m) + (if (get-text-property (match-beginning 2) 'regexp m) + m ;regexp tag: ignore + (let* ((operator (match-string 1 m)) + (tag-token (let ((tag (match-string 2 m))) + (list (if downcased (downcase tag) tag)))) + regexp-tags regular-tags) + ;; Partition tags between regexp and regular tags. + ;; Remove curly bracket syntax from regexp tags. + (dolist (tag (org--tags-expand-group tag-token tag-groups nil)) + (save-match-data + (if (string-match "{\\(.+?\\)}" tag) + (push (match-string 1 tag) regexp-tags) + (push tag regular-tags)))) + ;; Replace tag token by the appropriate regexp. + ;; Regular tags need to be regexp-quoted, whereas + ;; regexp-tags are inserted as-is. + (let ((regular (regexp-opt regular-tags)) + (regexp (mapconcat #'identity regexp-tags "\\|"))) + (concat operator + (cond + ((null regular-tags) (format "{%s}" regexp)) + ((null regexp-tags) (format "{\\<%s\\>}" regular)) + (t (format "{\\<%s\\>\\|%s}" regular regexp)))))))) + return-match + t t)))) + (t match)))) (defun org-op-to-function (op &optional stringp) "Turn an operator into the appropriate function." (setq op (cond - ((equal op "<" ) '(< string< org-time<)) + ((equal op "<" ) '(< org-string< org-time<)) ((equal op ">" ) '(> org-string> org-time>)) ((member op '("<=" "=<")) '(<= org-string<= org-time<=)) ((member op '(">=" "=>")) '(>= org-string>= org-time>=)) ((member op '("=" "==")) '(= string= org-time=)) - ((member op '("<>" "!=")) '(org<> org-string<> org-time<>)))) + ((member op '("<>" "!=")) '(/= org-string<> org-time<>)))) (nth (if (eq stringp 'time) 2 (if stringp 1 0)) op)) -(defun org<> (a b) (not (= a b))) -(defun org-string<= (a b) (or (string= a b) (string< a b))) -(defun org-string>= (a b) (not (string< a b))) -(defun org-string> (a b) (and (not (string= a b)) (not (string< a b)))) -(defun org-string<> (a b) (not (string= a b))) -(defun org-time= (a b) (setq a (org-2ft a) b (org-2ft b)) (and (> a 0) (> b 0) (= a b))) -(defun org-time< (a b) (setq a (org-2ft a) b (org-2ft b)) (and (> a 0) (> b 0) (< a b))) -(defun org-time<= (a b) (setq a (org-2ft a) b (org-2ft b)) (and (> a 0) (> b 0) (<= a b))) -(defun org-time> (a b) (setq a (org-2ft a) b (org-2ft b)) (and (> a 0) (> b 0) (> a b))) -(defun org-time>= (a b) (setq a (org-2ft a) b (org-2ft b)) (and (> a 0) (> b 0) (>= a b))) -(defun org-time<> (a b) (setq a (org-2ft a) b (org-2ft b)) (and (> a 0) (> b 0) (org<> a b))) -(defun org-2ft (s) - "Convert S to a floating point time. -If S is already a number, just return it. If it is a string, parse -it as a time string and apply `float-time' to it. If S is nil, just return 0." - (cond - ((numberp s) s) - ((stringp s) - (condition-case nil - (float-time (apply #'encode-time (org-parse-time-string s nil t))) - (error 0.))) - (t 0.))) - -(defun org-time-today () - "Time in seconds today at 0:00. -Returns the float number of seconds since the beginning of the -epoch to the beginning of today (00:00)." - (float-time (apply 'encode-time - (append '(0 0 0) (nthcdr 3 (decode-time)))))) - -(defun org-matcher-time (s) - "Interpret a time comparison value." - (save-match-data - (cond - ((string= s "") (float-time)) - ((string= s "") (org-time-today)) - ((string= s "") (+ 86400.0 (org-time-today))) - ((string= s "") (- (org-time-today) 86400.0)) - ((string-match "^<\\([-+][0-9]+\\)\\([hdwmy]\\)>$" s) - (+ (org-time-today) - (* (string-to-number (match-string 1 s)) - (cdr (assoc (match-string 2 s) - '(("d" . 86400.0) ("w" . 604800.0) - ("m" . 2678400.0) ("y" . 31557600.0))))))) - (t (org-2ft s))))) - -(defun org-match-any-p (re list) - "Does re match any element of list?" - (setq list (mapcar (lambda (x) (string-match re x)) list)) - (delq nil list)) - (defvar org-add-colon-after-tag-completion nil) ;; dynamically scoped param (defvar org-tags-overlay (make-overlay 1 1)) (delete-overlay org-tags-overlay) -(defun org-get-local-tags-at (&optional pos) - "Get a list of tags defined in the current headline." - (org-get-tags-at pos 'local)) - -(defun org-get-local-tags () - "Get a list of tags defined in the current headline." - (org-get-tags-at nil 'local)) - -(defun org-get-tags-at (&optional pos local) - "Get a list of all headline tags applicable at POS. -POS defaults to point. If tags are inherited, the list contains -the targets in the same sequence as the headlines appear, i.e. -the tags of the current headline come last. -When LOCAL is non-nil, only return tags from the current headline, -ignore inherited ones." - (interactive) - (if (and org-trust-scanner-tags - (or (not pos) (equal pos (point))) - (not local)) - org-scanner-tags - (let (tags ltags lastpos parent) - (save-excursion - (save-restriction - (widen) - (goto-char (or pos (point))) - (save-match-data - (catch 'done - (condition-case nil - (progn - (org-back-to-heading t) - (while (not (equal lastpos (point))) - (setq lastpos (point)) - (when (looking-at ".+?:\\([[:alnum:]_@#%:]+\\):[ \t]*$") - (setq ltags (org-split-string - (match-string-no-properties 1) ":")) - (when parent - (setq ltags (mapcar 'org-add-prop-inherited ltags))) - (setq tags (append - (if parent - (org-remove-uninherited-tags ltags) - ltags) - tags))) - (or org-use-tag-inheritance (throw 'done t)) - (when local (throw 'done t)) - (or (org-up-heading-safe) (error nil)) - (setq parent t))) - (error nil))))) - (if local - tags - (reverse (delete-dups - (reverse (append - (org-remove-uninherited-tags - org-file-tags) - tags))))))))) - (defun org-add-prop-inherited (s) (add-text-properties 0 (length s) '(inherited t) s) s) @@ -14719,14 +14259,9 @@ If ONOFF is `on' or `off', don't toggle but set to this state." (save-excursion (org-back-to-heading t) (let ((current - (when (re-search-forward "[ \t]:\\([[:alnum:]_@#%:]+\\):[ \t]*$" - (line-end-position) t) - (let ((tags (match-string 1))) - ;; Clear current tags. - (replace-match "") - ;; Reverse the tags list so any new tag is appended to - ;; the current list of tags. - (nreverse (org-split-string tags ":"))))) + ;; Reverse the tags list so any new tag is appended to the + ;; current list of tags. + (nreverse (org-get-tags nil t))) res) (pcase onoff (`off (setq current (delete tag current))) @@ -14734,209 +14269,159 @@ If ONOFF is `on' or `off', don't toggle but set to this state." (setq res t) (cl-pushnew tag current :test #'equal)) (_ (setq current (delete tag current)))) - (end-of-line) - (if current - (progn - (insert " :" (mapconcat #'identity (nreverse current) ":") ":") - (org-set-tags nil t)) - (delete-horizontal-space)) - (run-hooks 'org-after-tags-change-hook) + (org-set-tags (nreverse current)) res))) (defun org--align-tags-here (to-col) "Align tags on the current headline to TO-COL. -Assume point is on a headline." - (let ((pos (point))) - (beginning-of-line) - (if (or (not (looking-at ".*?\\([ \t]+\\)\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$")) - (>= pos (match-beginning 2))) - ;; No tags or point within tags: do not align. - (goto-char pos) - (goto-char (match-beginning 1)) - (let ((shift (max (- (if (>= to-col 0) to-col - (- (abs to-col) (string-width (match-string 2)))) - (current-column)) - 1))) - (replace-match (make-string shift ?\s) nil nil nil 1) - ;; Preserve initial position, if possible. In any case, stop - ;; before tags. - (when (< pos (point)) (goto-char pos)))))) - -(defun org-set-tags-command (&optional arg just-align) - "Call the set-tags command for the current entry." +Assume point is on a headline. Preserve point when aligning +tags." + (when (org-match-line org-tag-line-re) + (let* ((tags-start (match-beginning 1)) + (blank-start (save-excursion + (goto-char tags-start) + (skip-chars-backward " \t") + (point))) + (new (max (if (>= to-col 0) to-col + (- (abs to-col) (string-width (match-string 1)))) + ;; Introduce at least one space after the heading + ;; or the stars. + (save-excursion + (goto-char blank-start) + (1+ (current-column))))) + (current + (save-excursion (goto-char tags-start) (current-column))) + (origin (point-marker)) + (column (current-column)) + (in-blank? (and (> origin blank-start) (<= origin tags-start)))) + (when (/= new current) + (delete-region blank-start tags-start) + (goto-char blank-start) + (let ((indent-tabs-mode nil)) (indent-to new)) + ;; Try to move back to original position. If point was in the + ;; blanks before the tags, ORIGIN marker is of no use because + ;; it now points to BLANK-START. Use COLUMN instead. + (if in-blank? (org-move-to-column column) (goto-char origin)))))) + +(defun org-set-tags-command (&optional arg) + "Set the tags for the current visible entry. + +When called with `\\[universal-argument]' prefix argument ARG, \ +realign all tags +in the current buffer. If a region is active, set tags for +all headlines in the region. + +This function is for interactive use only; +in Lisp code use `org-set-tags' instead." (interactive "P") - (if (or (org-at-heading-p) (and arg (org-before-first-heading-p))) - (org-set-tags arg just-align) - (save-excursion - (unless (and (org-region-active-p) - org-loop-over-headlines-in-active-region) - (org-back-to-heading 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." - (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 + (cond + (arg (org-align-tags t)) + ((and (org-region-active-p) org-loop-over-headlines-in-active-region) + ;; Disable `org-loop-over-headlines-in-active-region' for + ;; successive calls. + (let (org-loop-over-headlines-in-active-region) + (org-map-entries + #'org-set-tags-command + nil + (if (eq org-loop-over-headlines-in-active-region 'start-level) + 'region-start-level + 'region) + (lambda () (when (org-invisible-p) (org-end-of-subtree nil t)))))) + (t (save-excursion - (org-back-to-heading t) - (when (let ((case-fold-search nil)) - (looking-at org-complex-heading-regexp)) - (if (match-end 5) + (org-back-to-heading) + (let* ((all-tags (org-get-tags)) + (table (setq org-last-tags-completion-table + (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 + (cl-remove-if (lambda (tag) (get-text-property 0 'inherited tag)) + all-tags)) + (inherited-tags + (cl-remove-if-not (lambda (tag) (get-text-property 0 'inherited tag)) + all-tags)) + (tags + (replace-regexp-in-string + ;; Ignore all forbidden characters in tags. + "[^[:alnum:]_@#%]+" ":" + (if (or (eq t org-use-fast-tag-selection) + (and org-use-fast-tag-selection + (delq nil (mapcar #'cdr table)))) + (org-fast-tag-selection + current-tags + inherited-tags + table + (and org-fast-tag-selection-include-todo org-todo-key-alist)) + (let ((org-add-colon-after-tag-completion (< 1 (length table)))) + (org-trim (completing-read + "Tags: " + #'org-tags-completion-function + nil nil (org-make-tag-string current-tags) + 'org-tags-history))))))) + (org-set-tags tags)))))) + +(defun org-align-tags (&optional all) + "Align tags in current entry. +When optional argument ALL is non-nil, align all tags in the +visible part of the buffer." + (let ((get-indent-column + (lambda () + (let ((offset (if (bound-and-true-p org-indent-mode) + (* (1- org-indent-indentation-per-level) + (1- (org-current-level))) + 0))) + (+ org-tags-column + (if (> org-tags-column 0) (- offset) offset)))))) + (if (and (not all) (org-at-heading-p)) + (org--align-tags-here (funcall get-indent-column)) + (save-excursion + (if all (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)))))) + (goto-char (point-min)) + (while (re-search-forward org-tag-line-re nil t) + (org--align-tags-here (funcall get-indent-column)))) + (org-back-to-heading t) + (org--align-tags-here (funcall get-indent-column))))))) -(defun org-align-all-tags () - "Align the tags in all headings." - (interactive) - (save-excursion - (or (ignore-errors (org-back-to-heading t)) - (outline-next-heading)) - (if (org-at-heading-p) - (org-set-tags t) - (message "No headings")))) +(defun org-set-tags (tags) + "Set the tags of the current entry to TAGS, replacing current tags. -(defvar org-indent-indentation-per-level) -(defun org-set-tags (&optional arg just-align) - "Set the tags for the current headline. -With prefix ARG, realign all tags in headings in the current buffer. -When JUST-ALIGN is non-nil, only align tags." - (interactive "P") - (if (and (org-region-active-p) org-loop-over-headlines-in-active-region) - (let ((cl (if (eq org-loop-over-headlines-in-active-region 'start-level) - 'region-start-level - 'region)) - org-loop-over-headlines-in-active-region) - (org-map-entries - ;; We don't use ARG and JUST-ALIGN here because these args - ;; are not useful when looping over headlines. - #'org-set-tags - org-loop-over-headlines-in-active-region - cl - '(when (org-invisible-p) (org-end-of-subtree nil t)))) - (let ((org-setting-tags t)) - (if arg - (save-excursion - (goto-char (point-min)) - (while (re-search-forward org-outline-regexp-bol nil t) - (org-set-tags nil t) - (end-of-line)) - (message "All tags realigned to column %d" org-tags-column)) - (let* ((current (org-get-tags-string)) - (tags - (if just-align current - ;; Get a new set of tags from the user. - (save-excursion - (let* ((seen) - (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)))))))) - (current-tags (org-split-string current ":")) - (inherited-tags - (nreverse (nthcdr (length current-tags) - (nreverse (org-get-tags-at)))))) - (replace-regexp-in-string - "\\([-+&]+\\|,\\)" - ":" - (if (or (eq t org-use-fast-tag-selection) - (and org-use-fast-tag-selection - (delq nil (mapcar #'cdr table)))) - (org-fast-tag-selection - current-tags inherited-tags table - (and org-fast-tag-selection-include-todo - org-todo-key-alist)) - (let ((org-add-colon-after-tag-completion - (< 1 (length table)))) - (org-trim - (completing-read - "Tags: " - #'org-tags-completion-function - nil nil current 'org-tags-history)))))))))) - - (when org-tags-sort-function - (setq tags - (mapconcat - #'identity - (sort (org-split-string tags "[^[:alnum:]_@#%]+") - org-tags-sort-function) - ":"))) - - (if (or (string= ":" tags) - (string= "::" tags)) - (setq tags "")) - (if (not (org-string-nw-p tags)) (setq tags "") - (unless (string-suffix-p ":" tags) (setq tags (concat tags ":"))) - (unless (string-prefix-p ":" tags) (setq tags (concat ":" tags)))) - - ;; Insert new tags at the correct column. - (unless (equal current tags) - (save-excursion - (beginning-of-line) - (let ((case-fold-search nil)) - (looking-at org-complex-heading-regexp)) - ;; Remove current tags, if any. - (when (match-end 5) (replace-match "" nil nil nil 5)) - ;; Insert new tags, if any. Otherwise, remove trailing - ;; white spaces. - (end-of-line) - (if (not (equal tags "")) - ;; When text is being inserted on an invisible - ;; region boundary, it can be inadvertently sucked - ;; into invisibility. - (outline-flag-region (point) (progn (insert " " tags) (point)) nil) - (skip-chars-backward " \t") - (delete-region (point) (line-end-position))))) - ;; Align tags, if any. Fix tags column if `org-indent-mode' - ;; is on. - (unless (equal tags "") - (let* ((level (save-excursion - (beginning-of-line) - (skip-chars-forward "\\*"))) - (offset (if (bound-and-true-p org-indent-mode) - (* (1- org-indent-indentation-per-level) - (1- level)) - 0)) - (tags-column - (+ org-tags-column - (if (> org-tags-column 0) (- offset) offset)))) - (org--align-tags-here tags-column)))) - (unless just-align (run-hooks 'org-after-tags-change-hook)))))) +TAGS may be a tags string like \":aa:bb:cc:\", or a list of tags. +If TAGS is nil or the empty string, all tags are removed. + +This function assumes point is on a headline." + (org-with-wide-buffer + (let ((tags (pcase tags + ((pred listp) tags) + ((pred stringp) (split-string (org-trim tags) ":" t)) + (_ (error "Invalid tag specification: %S" tags)))) + (old-tags (org-get-tags nil t)) + (tags-change? nil)) + (when (functionp org-tags-sort-function) + (setq tags (sort tags org-tags-sort-function))) + (setq tags-change? (not (equal tags old-tags))) + (when tags-change? + ;; Delete previous tags and any trailing white space. + (goto-char (if (org-match-line org-tag-line-re) (match-beginning 1) + (line-end-position))) + (skip-chars-backward " \t") + (delete-region (point) (line-end-position)) + ;; Deleting white spaces may break an otherwise empty headline. + ;; Re-introduce one space in this case. + (unless (org-at-heading-p) (insert " ")) + (when tags + (save-excursion (insert " " (org-make-tag-string tags))) + ;; When text is being inserted on an invisible region + ;; boundary, it can be inadvertently sucked into + ;; invisibility. + (unless (org-invisible-p (line-beginning-position)) + (org-flag-region (point) (line-end-position) nil 'outline)))) + ;; Align tags, if any. + (when tags (org-align-tags)) + (when tags-change? (run-hooks 'org-after-tags-change-hook))))) (defun org-change-tag-in-region (beg end tag off) "Add or remove TAG for each entry in the region. @@ -14945,9 +14430,9 @@ This works in the agenda, and also in an Org buffer." (list (region-beginning) (region-end) (let ((org-last-tags-completion-table (if (derived-mode-p 'org-mode) - (org-uniquify - (delq nil (append (org-get-buffer-tags) - (org-global-tags-completion-table)))) + (org--tag-add-to-alist + (org-get-buffer-tags) + (org-global-tags-completion-table)) (org-global-tags-completion-table)))) (completing-read "Tag: " 'org-tags-completion-function nil nil nil @@ -14980,32 +14465,33 @@ This works in the agenda, and also in an Org buffer." (message "Tag :%s: %s in %d headings" tag (if off "removed" "set") cnt))) (defun org-tags-completion-function (string _predicate &optional flag) - (let (s1 s2 rtn (ctable org-last-tags-completion-table) - (confirm (lambda (x) (stringp (car x))))) - (if (string-match "^\\(.*[-+:&,|]\\)\\([^-+:&,|]*\\)$" string) - (setq s1 (match-string 1 string) - s2 (match-string 2 string)) - (setq s1 "" s2 string)) - (cond - ((eq flag nil) - ;; try completion - (setq rtn (try-completion s2 ctable confirm)) - (when (stringp rtn) - (setq rtn - (concat s1 s2 (substring rtn (length s2)) - (if (and org-add-colon-after-tag-completion - (assoc rtn ctable)) - ":" "")))) - rtn) - ((eq flag t) - ;; all-completions - (all-completions s2 ctable confirm)) - ((eq flag 'lambda) - ;; exact match? - (assoc s2 ctable))))) + "Complete tag STRING. +FLAG specifies the type of completion operation to perform. This +function is passed as a collection function to `completing-read', +which see." + (let ((completion-ignore-case nil) ;tags are case-sensitive + (confirm (lambda (x) (stringp (car x)))) + (prefix "")) + (when (string-match "^\\(.*[-+:&,|]\\)\\([^-+:&,|]*\\)$" string) + (setq prefix (match-string 1 string)) + (setq string (match-string 2 string))) + (pcase flag + (`t (all-completions string org-last-tags-completion-table confirm)) + (`lambda (assoc string org-last-tags-completion-table)) ;exact match? + (`nil + (pcase (try-completion string org-last-tags-completion-table confirm) + ((and completion (pred stringp)) + (concat prefix + completion + (if (and org-add-colon-after-tag-completion + (assoc completion org-last-tags-completion-table)) + ":" + ""))) + (completion completion))) + (_ nil)))) (defun org-fast-tag-insert (kwd tags face &optional end) - "Insert KDW, and the TAGS, the latter with face FACE. + "Insert KWD, and the TAGS, the latter with face FACE. Also insert END." (insert (format "%-12s" (concat kwd ":")) (org-add-props (mapconcat 'identity tags " ") nil 'face face) @@ -15023,7 +14509,7 @@ Also insert END." (defun org-set-current-tags-overlay (current prefix) "Add an overlay to CURRENT tag with PREFIX." - (let ((s (concat ":" (mapconcat 'identity current ":") ":"))) + (let ((s (org-make-tag-string current))) (put-text-property 0 (length s) 'face '(secondary-selection org-tag) s) (org-overlay-display org-tags-overlay (concat prefix s)))) @@ -15037,10 +14523,12 @@ TODO keywords, should these have keys assigned to them. If the keys are nil, a-z are automatically assigned. Returns the new tags string, or nil to not change the current settings." (let* ((fulltable (append table todo-table)) - (maxlen (apply 'max (mapcar - (lambda (x) - (if (stringp (car x)) (string-width (car x)) 0)) - fulltable))) + (maxlen (if (null fulltable) 0 + (apply #'max + (mapcar (lambda (x) + (if (stringp (car x)) (string-width (car x)) + 0)) + fulltable)))) (buf (current-buffer)) (expert (eq org-fast-tag-selection-single-key 'expert)) (buffer-tags nil) @@ -15054,8 +14542,8 @@ Returns the new tags string, or nil to not change the current settings." (done-keywords org-done-keywords) groups ingroup intaggroup) (save-excursion - (beginning-of-line 1) - (if (looking-at ".*[ \t]\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$") + (beginning-of-line) + (if (looking-at org-tag-line-re) (setq ov-start (match-beginning 1) ov-end (match-end 1) ov-prefix "") @@ -15069,191 +14557,222 @@ Returns the new tags string, or nil to not change the current settings." " " (make-string (- org-tags-column (current-column)) ?\ )))))) (move-overlay org-tags-overlay ov-start ov-end) - (save-window-excursion - (if expert - (set-buffer (get-buffer-create " *Org tags*")) - (delete-other-windows) - (set-window-buffer (split-window-vertically) (get-buffer-create " *Org tags*")) - (org-switch-to-buffer-other-window " *Org tags*")) - (erase-buffer) - (setq-local org-done-keywords done-keywords) - (org-fast-tag-insert "Inherited" inherited i-face "\n") - (org-fast-tag-insert "Current" current c-face "\n\n") - (org-fast-tag-show-exit exit-after-next) - (org-set-current-tags-overlay current ov-prefix) - (setq tbl fulltable char ?a cnt 0) - (while (setq e (pop tbl)) - (cond - ((eq (car e) :startgroup) - (push '() groups) (setq ingroup t) - (unless (zerop cnt) - (setq cnt 0) - (insert "\n")) - (insert (if (cdr e) (format "%s: " (cdr e)) "") "{ ")) - ((eq (car e) :endgroup) - (setq ingroup nil cnt 0) - (insert "}" (if (cdr e) (format " (%s) " (cdr e)) "") "\n")) - ((eq (car e) :startgrouptag) - (setq intaggroup t) - (unless (zerop cnt) - (setq cnt 0) - (insert "\n")) - (insert "[ ")) - ((eq (car e) :endgrouptag) - (setq intaggroup nil cnt 0) - (insert "]\n")) - ((equal e '(:newline)) - (unless (zerop cnt) - (setq cnt 0) - (insert "\n") - (setq e (car tbl)) - (while (equal (car tbl) '(:newline)) + (save-excursion + (save-window-excursion + (if expert + (set-buffer (get-buffer-create " *Org tags*")) + (delete-other-windows) + (set-window-buffer (split-window-vertically) (get-buffer-create " *Org tags*")) + (org-switch-to-buffer-other-window " *Org tags*")) + (erase-buffer) + (setq-local org-done-keywords done-keywords) + (org-fast-tag-insert "Inherited" inherited i-face "\n") + (org-fast-tag-insert "Current" current c-face "\n\n") + (org-fast-tag-show-exit exit-after-next) + (org-set-current-tags-overlay current ov-prefix) + (setq tbl fulltable char ?a cnt 0) + (while (setq e (pop tbl)) + (cond + ((eq (car e) :startgroup) + (push '() groups) (setq ingroup t) + (unless (zerop cnt) + (setq cnt 0) + (insert "\n")) + (insert (if (cdr e) (format "%s: " (cdr e)) "") "{ ")) + ((eq (car e) :endgroup) + (setq ingroup nil cnt 0) + (insert "}" (if (cdr e) (format " (%s) " (cdr e)) "") "\n")) + ((eq (car e) :startgrouptag) + (setq intaggroup t) + (unless (zerop cnt) + (setq cnt 0) + (insert "\n")) + (insert "[ ")) + ((eq (car e) :endgrouptag) + (setq intaggroup nil cnt 0) + (insert "]\n")) + ((equal e '(:newline)) + (unless (zerop cnt) + (setq cnt 0) (insert "\n") - (setq tbl (cdr tbl))))) - ((equal e '(:grouptags)) (insert " : ")) - (t - (setq tg (copy-sequence (car e)) c2 nil) - (if (cdr e) - (setq c (cdr e)) - ;; automatically assign a character. - (setq c1 (string-to-char - (downcase (substring - tg (if (= (string-to-char tg) ?@) 1 0))))) - (if (or (rassoc c1 ntable) (rassoc c1 table)) - (while (or (rassoc char ntable) (rassoc char table)) - (setq char (1+ char))) - (setq c2 c1)) - (setq c (or c2 char))) - (when ingroup (push tg (car groups))) - (setq tg (org-add-props tg nil 'face - (cond - ((not (assoc tg table)) - (org-get-todo-face tg)) - ((member tg current) c-face) - ((member tg inherited) i-face)))) - (when (equal (caar tbl) :grouptags) - (org-add-props tg nil 'face 'org-tag-group)) - (when (and (zerop cnt) (not ingroup) (not intaggroup)) (insert " ")) - (insert "[" c "] " tg (make-string - (- fwidth 4 (length tg)) ?\ )) - (push (cons tg c) ntable) - (when (= (cl-incf cnt) ncol) - (insert "\n") - (when (or ingroup intaggroup) (insert " ")) - (setq cnt 0))))) - (setq ntable (nreverse ntable)) - (insert "\n") - (goto-char (point-min)) - (unless expert (org-fit-window-to-buffer)) - (setq rtn - (catch 'exit - (while t - (message "[a-z..]:toggle [SPC]:clear [RET]:accept [TAB]:edit [!] %sgroups%s" - (if (not groups) "no " "") - (if expert " [C-c]:window" (if exit-after-next " [C-c]:single" " [C-c]:multi"))) - (setq c (let ((inhibit-quit t)) (read-char-exclusive))) - (setq org-last-tag-selection-key c) - (cond - ((= c ?\r) (throw 'exit t)) - ((= c ?!) - (setq groups (not groups)) - (goto-char (point-min)) - (while (re-search-forward "[{}]" nil t) (replace-match " "))) - ((= c ?\C-c) - (if (not expert) - (org-fast-tag-show-exit - (setq exit-after-next (not exit-after-next))) - (setq expert nil) - (delete-other-windows) - (set-window-buffer (split-window-vertically) " *Org tags*") - (org-switch-to-buffer-other-window " *Org tags*") - (org-fit-window-to-buffer))) - ((or (= c ?\C-g) - (and (= c ?q) (not (rassoc c ntable)))) - (delete-overlay org-tags-overlay) - (setq quit-flag t)) - ((= c ?\ ) - (setq current nil) - (when exit-after-next (setq exit-after-next 'now))) - ((= c ?\t) - (condition-case nil - (setq tg (completing-read - "Tag: " - (or buffer-tags - (with-current-buffer buf - (setq buffer-tags - (org-get-buffer-tags)))))) - (quit (setq tg ""))) - (when (string-match "\\S-" tg) - (cl-pushnew (list tg) buffer-tags :test #'equal) + (setq e (car tbl)) + (while (equal (car tbl) '(:newline)) + (insert "\n") + (setq tbl (cdr tbl))))) + ((equal e '(:grouptags)) (insert " : ")) + (t + (setq tg (copy-sequence (car e)) c2 nil) + (if (cdr e) + (setq c (cdr e)) + ;; automatically assign a character. + (setq c1 (string-to-char + (downcase (substring + tg (if (= (string-to-char tg) ?@) 1 0))))) + (if (or (rassoc c1 ntable) (rassoc c1 table)) + (while (or (rassoc char ntable) (rassoc char table)) + (setq char (1+ char))) + (setq c2 c1)) + (setq c (or c2 char))) + (when ingroup (push tg (car groups))) + (setq tg (org-add-props tg nil 'face + (cond + ((not (assoc tg table)) + (org-get-todo-face tg)) + ((member tg current) c-face) + ((member tg inherited) i-face)))) + (when (equal (caar tbl) :grouptags) + (org-add-props tg nil 'face 'org-tag-group)) + (when (and (zerop cnt) (not ingroup) (not intaggroup)) (insert " ")) + (insert "[" c "] " tg (make-string + (- fwidth 4 (length tg)) ?\ )) + (push (cons tg c) ntable) + (when (= (cl-incf cnt) ncol) + (unless (memq (caar tbl) '(:endgroup :endgrouptag)) + (insert "\n") + (when (or ingroup intaggroup) (insert " "))) + (setq cnt 0))))) + (setq ntable (nreverse ntable)) + (insert "\n") + (goto-char (point-min)) + (unless expert (org-fit-window-to-buffer)) + (setq rtn + (catch 'exit + (while t + (message "[a-z..]:toggle [SPC]:clear [RET]:accept [TAB]:edit [!] %sgroups%s" + (if (not groups) "no " "") + (if expert " [C-c]:window" (if exit-after-next " [C-c]:single" " [C-c]:multi"))) + (setq c (let ((inhibit-quit t)) (read-char-exclusive))) + (setq org-last-tag-selection-key c) + (cond + ((= c ?\r) (throw 'exit t)) + ((= c ?!) + (setq groups (not groups)) + (goto-char (point-min)) + (while (re-search-forward "[{}]" nil t) (replace-match " "))) + ((= c ?\C-c) + (if (not expert) + (org-fast-tag-show-exit + (setq exit-after-next (not exit-after-next))) + (setq expert nil) + (delete-other-windows) + (set-window-buffer (split-window-vertically) " *Org tags*") + (org-switch-to-buffer-other-window " *Org tags*") + (org-fit-window-to-buffer))) + ((or (= c ?\C-g) + (and (= c ?q) (not (rassoc c ntable)))) + (delete-overlay org-tags-overlay) + (setq quit-flag t)) + ((= c ?\ ) + (setq current nil) + (when exit-after-next (setq exit-after-next 'now))) + ((= c ?\t) + (condition-case nil + (setq tg (completing-read + "Tag: " + (or buffer-tags + (with-current-buffer buf + (setq buffer-tags + (org-get-buffer-tags)))))) + (quit (setq tg ""))) + (when (string-match "\\S-" tg) + (cl-pushnew (list tg) buffer-tags :test #'equal) + (if (member tg current) + (setq current (delete tg current)) + (push tg current))) + (when exit-after-next (setq exit-after-next 'now))) + ((setq e (rassoc c todo-table) tg (car e)) + (with-current-buffer buf + (save-excursion (org-todo tg))) + (when exit-after-next (setq exit-after-next 'now))) + ((setq e (rassoc c ntable) tg (car e)) (if (member tg current) (setq current (delete tg current)) - (push tg current))) - (when exit-after-next (setq exit-after-next 'now))) - ((setq e (rassoc c todo-table) tg (car e)) - (with-current-buffer buf - (save-excursion (org-todo tg))) - (when exit-after-next (setq exit-after-next 'now))) - ((setq e (rassoc c ntable) tg (car e)) - (if (member tg current) - (setq current (delete tg current)) - (cl-loop for g in groups do - (when (member tg g) - (dolist (x g) (setq current (delete x current))))) - (push tg current)) - (when exit-after-next (setq exit-after-next 'now)))) - - ;; Create a sorted list - (setq current - (sort current - (lambda (a b) - (assoc b (cdr (memq (assoc a ntable) ntable)))))) - (when (eq exit-after-next 'now) (throw 'exit t)) - (goto-char (point-min)) - (beginning-of-line 2) - (delete-region (point) (point-at-eol)) - (org-fast-tag-insert "Current" current c-face) - (org-set-current-tags-overlay current ov-prefix) - (while (re-search-forward "\\[.\\] \\([[:alnum:]_@#%]+\\)" nil t) - (setq tg (match-string 1)) - (add-text-properties - (match-beginning 1) (match-end 1) - (list 'face - (cond - ((member tg current) c-face) - ((member tg inherited) i-face) - (t (get-text-property (match-beginning 1) 'face)))))) - (goto-char (point-min))))) - (delete-overlay org-tags-overlay) - (if rtn - (mapconcat 'identity current ":") - nil)))) - -(defun org-get-tags-string () - "Get the TAGS string in the current headline." - (unless (org-at-heading-p t) - (user-error "Not on a heading")) - (save-excursion - (beginning-of-line 1) - (if (looking-at ".*[ \t]\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$") - (match-string-no-properties 1) - ""))) - -(defun org-get-tags () - "Get the list of tags specified in the current headline." - (org-split-string (org-get-tags-string) ":")) + (cl-loop for g in groups do + (when (member tg g) + (dolist (x g) (setq current (delete x current))))) + (push tg current)) + (when exit-after-next (setq exit-after-next 'now)))) + + ;; Create a sorted list + (setq current + (sort current + (lambda (a b) + (assoc b (cdr (memq (assoc a ntable) ntable)))))) + (when (eq exit-after-next 'now) (throw 'exit t)) + (goto-char (point-min)) + (beginning-of-line 2) + (delete-region (point) (point-at-eol)) + (org-fast-tag-insert "Current" current c-face) + (org-set-current-tags-overlay current ov-prefix) + (let ((tag-re (concat "\\[.\\] \\(" org-tag-re "\\)"))) + (while (re-search-forward tag-re nil t) + (let ((tag (match-string 1))) + (add-text-properties + (match-beginning 1) (match-end 1) + (list 'face + (cond + ((member tag current) c-face) + ((member tag inherited) i-face) + (t (get-text-property (match-beginning 1) ' + face)))))))) + (goto-char (point-min))))) + (delete-overlay org-tags-overlay) + (if rtn + (mapconcat 'identity current ":") + nil))))) + +(defun org-make-tag-string (tags) + "Return string associated to TAGS. +TAGS is a list of strings." + (if (null tags) "" + (format ":%s:" (mapconcat #'identity tags ":")))) + +(defun org--get-local-tags () + "Return list of tags for the current headline. +Assume point is at the beginning of the headline." + (and (looking-at org-tag-line-re) + (split-string (match-string-no-properties 2) ":" t))) + +(defun org-get-tags (&optional pos local) + "Get the list of tags specified in the current headline. + +When argument POS is non-nil, retrieve tags for headline at POS. + +According to `org-use-tag-inheritance', tags may be inherited +from parent headlines, and from the whole document, through +`org-file-tags'. In this case, the returned list of tags +contains tags in this order: file tags, tags inherited from +parent headlines, local tags. + +However, when optional argument LOCAL is non-nil, only return +tags specified at the headline. + +Inherited tags have the `inherited' text property." + (if (and org-trust-scanner-tags + (or (not pos) (eq pos (point))) + (not local)) + org-scanner-tags + (org-with-point-at (or pos (point)) + (unless (org-before-first-heading-p) + (org-back-to-heading t) + (let ((ltags (org--get-local-tags)) itags) + (if (or local (not org-use-tag-inheritance)) ltags + (while (org-up-heading-safe) + (setq itags (append (mapcar #'org-add-prop-inherited + (org--get-local-tags)) + itags))) + (setq itags (append org-file-tags itags)) + (delete-dups + (append (org-remove-uninherited-tags itags) ltags)))))))) (defun org-get-buffer-tags () "Get a table of all tags used in the buffer, for completion." - (org-with-wide-buffer - (goto-char (point-min)) - (let ((tag-re (concat org-outline-regexp-bol - "\\(?:.*?[ \t]\\)?:\\([[:alnum:]_@#%:]+\\):[ \t]*$")) - tags) - (while (re-search-forward tag-re nil t) - (dolist (tag (org-split-string (match-string-no-properties 1) ":")) - (push tag tags))) - (mapcar #'list (append org-file-tags (org-uniquify tags)))))) + (org-with-point-at 1 + (let (tags) + (while (re-search-forward org-tag-line-re nil t) + (setq tags (nconc (split-string (match-string-no-properties 2) ":") + tags))) + (mapcar #'list (delete-dups (append org-file-tags tags)))))) ;;;; The mapping API @@ -15314,7 +14833,7 @@ the scanner. The following items can be given here: If your function needs to retrieve the tags including inherited tags at the *current* entry, you can use the value of the variable `org-scanner-tags' which will be much faster than getting the value -with `org-get-tags-at'. If your function gets properties with +with `org-get-tags'. If your function gets properties with `org-entry-properties' at the *current* entry, bind `org-trust-scanner-tags' to t around the call to `org-entry-properties' to get the same speedup. Note that if your function moves around to retrieve tags and properties at @@ -15415,7 +14934,7 @@ but in some other way.") Being in this list makes sure that they are offered for completion.") (defun org--valid-property-p (property) - "Non nil when string PROPERTY is a valid property name." + "Non-nil when string PROPERTY is a valid property name." (not (or (equal property "") (string-match-p "\\s-" property)))) @@ -15483,61 +15002,44 @@ See `org-property-re' for match data, if applicable." (defun org-inc-effort () "Increment the value of the effort property in the current entry." (interactive) - (org-set-effort nil t)) + (org-set-effort t)) (defvar org-clock-effort) ; Defined in org-clock.el. (defvar org-clock-current-task) ; Defined in org-clock.el. -(defun org-set-effort (&optional value increment) +(defun org-set-effort (&optional increment value) "Set the effort property of the current entry. -With numerical prefix arg, use the nth allowed value, 0 stands for the -10th allowed value. - -When INCREMENT is non-nil, set the property to the next allowed value." +If INCREMENT is non-nil, set the property to the next allowed +value. Otherwise, if optional argument VALUE is provided, use +it. Eventually, prompt for the new value if none of the previous +variables is set." (interactive "P") - (when (equal value 0) (setq value 10)) - (let* ((completion-ignore-case t) - (prop org-effort-property) - (cur (org-entry-get nil prop)) - (allowed (org-property-get-allowed-values nil prop 'table)) - (existing (mapcar 'list (org-property-values prop))) - (heading (nth 4 (org-heading-components))) - rpl - (val (cond - ((stringp value) value) - ((and allowed (integerp value)) - (or (car (nth (1- value) allowed)) - (car (org-last allowed)))) - ((and allowed increment) - (or (cl-caadr (member (list cur) allowed)) - (user-error "Allowed effort values are not set"))) - (allowed - (message "Select 1-9,0, [RET%s]: %s" - (if cur (concat "=" cur) "") - (mapconcat 'car allowed " ")) - (setq rpl (read-char-exclusive)) - (if (equal rpl ?\r) - cur - (setq rpl (- rpl ?0)) - (when (equal rpl 0) (setq rpl 10)) - (if (and (> rpl 0) (<= rpl (length allowed))) - (car (nth (1- rpl) allowed)) - (org-completing-read "Effort: " allowed nil)))) - (t - (org-completing-read - (concat "Effort" (and cur (string-match "\\S-" cur) - (concat " [" cur "]")) - ": ") - existing nil nil "" nil cur))))) - (unless (equal (org-entry-get nil prop) val) - (org-entry-put nil prop val)) - (org-refresh-property - '((effort . identity) - (effort-minutes . org-duration-to-minutes)) - val) - (when (equal heading (bound-and-true-p org-clock-current-task)) - (setq org-clock-effort (get-text-property (point-at-bol) 'effort)) + (let* ((allowed (org-property-get-allowed-values nil org-effort-property t)) + (current (org-entry-get nil org-effort-property)) + (value + (cond + (increment + (unless allowed (user-error "Allowed effort values are not set")) + (or (cl-caadr (member (list current) allowed)) + (user-error "Unknown value %S among allowed values" current))) + (value + (if (stringp value) value + (error "Invalid effort value: %S" value))) + (t + (let ((must-match + (and allowed + (not (get-text-property 0 'org-unrestricted + (caar allowed)))))) + (completing-read "Effort: " allowed nil must-match)))))) + (unless (equal current value) + (org-entry-put nil org-effort-property value)) + (org-refresh-property '((effort . identity) + (effort-minutes . org-duration-to-minutes)) + value) + (when (equal (org-get-heading t t t t) + (bound-and-true-p org-clock-current-task)) + (setq org-clock-effort (org-get-at-bol 'effort)) (org-clock-update-mode-line)) - (message "%s is now %s" prop val))) + (message "%s is now %s" org-effort-property value))) (defun org-entry-properties (&optional pom which) "Get all properties of the current entry. @@ -15608,14 +15110,15 @@ strings." props) (when specific (throw 'exit props))) (when (or (not specific) (string= specific "TAGS")) - (let ((value (org-string-nw-p (org-get-tags-string)))) - (when value (push (cons "TAGS" value) props))) + (let ((tags (org-get-tags nil t))) + (when tags + (push (cons "TAGS" (org-make-tag-string tags)) + props))) (when specific (throw 'exit props))) (when (or (not specific) (string= specific "ALLTAGS")) - (let ((value (org-get-tags-at))) - (when value - (push (cons "ALLTAGS" - (format ":%s:" (mapconcat #'identity value ":"))) + (let ((tags (org-get-tags))) + (when tags + (push (cons "ALLTAGS" (org-make-tag-string tags)) props))) (when specific (throw 'exit props))) (when (or (not specific) (string= specific "BLOCKED")) @@ -15966,10 +15469,10 @@ decreases scheduled or deadline date by one day." ((not (member value org-todo-keywords-1)) (user-error "\"%s\" is not a valid TODO state" value))) (org-todo value) - (org-set-tags nil 'align)) + (org-align-tags)) ((equal property "PRIORITY") (org-priority (if (org-string-nw-p value) (string-to-char value) ?\s)) - (org-set-tags nil 'align)) + (org-align-tags)) ((equal property "SCHEDULED") (forward-line) (if (and (looking-at-p org-planning-line-re) @@ -16012,8 +15515,7 @@ decreases scheduled or deadline date by one day." (org-indent-line))))) (run-hook-with-args 'org-property-changed-functions property value))) -(defun org-buffer-property-keys - (&optional specials defaults columns ignore-malformed) +(defun org-buffer-property-keys (&optional specials defaults columns) "Get all property keys in the current buffer. When SPECIALS is non-nil, also list the special properties that @@ -16024,10 +15526,7 @@ special meaning internally: ARCHIVE, CATEGORY, SUMMARY, DESCRIPTION, LOCATION, and LOGGING and others. When COLUMNS in non-nil, also include property names given in -COLUMN formats in the current buffer. - -When IGNORE-MALFORMED is non-nil, malformed drawer repair will not be -automatically performed, such drawers will be silently ignored." +COLUMN formats in the current buffer." (let ((case-fold-search t) (props (append (and specials org-special-properties) @@ -16036,15 +15535,9 @@ automatically performed, such drawers will be silently ignored." (org-with-wide-buffer (goto-char (point-min)) (while (re-search-forward org-property-start-re nil t) - (let ((range (org-get-property-block))) - (catch 'skip - (unless range - (when (and (not ignore-malformed) - (not (org-before-first-heading-p)) - (y-or-n-p (format "Malformed drawer at %d, repair?" - (line-beginning-position)))) - (org-get-property-block nil t)) - (throw 'skip nil)) + (catch :skip + (let ((range (org-get-property-block))) + (unless range (throw :skip nil)) (goto-char (car range)) (let ((begin (car range)) (end (cdr range))) @@ -16062,7 +15555,7 @@ automatically performed, such drawers will be silently ignored." ;; :PROPERTIES: ;; #+END_EXAMPLE ;; - (if (< begin (point)) (throw 'skip nil) (goto-char begin)) + (if (< begin (point)) (throw :skip nil) (goto-char begin)) (while (< (point) end) (let ((p (progn (looking-at org-property-re) (match-string-no-properties 2)))) @@ -16191,23 +15684,33 @@ This is computed according to `org-property-set-functions-alist'." (or (cdr (assoc property org-property-set-functions-alist)) 'org-completing-read)) -(defun org-read-property-value (property) - "Read PROPERTY value from user." +(defun org-read-property-value (property &optional pom) + "Read value for PROPERTY, as a string. +When optional argument POM is non-nil, completion uses additional +information, i.e., allowed or existing values at point or marker +POM." (let* ((completion-ignore-case t) - (allowed (org-property-get-allowed-values nil property 'table)) - (cur (org-entry-get nil property)) - (prompt (concat property " value" - (if (and cur (string-match "\\S-" cur)) - (concat " [" cur "]") "") ": ")) - (set-function (org-set-property-function property)) - (val (if allowed - (funcall set-function prompt allowed nil - (not (get-text-property 0 'org-unrestricted - (caar allowed)))) - (funcall set-function prompt - (mapcar 'list (org-property-values property)) - nil nil "" nil cur)))) - (org-trim val))) + (allowed + (or (org-property-get-allowed-values nil property 'table) + (and pom (org-property-get-allowed-values pom property 'table)))) + (current (org-entry-get nil property)) + (prompt (format "%s value%s: " + property + (if (org-string-nw-p current) + (format " [%s]" current) + ""))) + (set-function (org-set-property-function property))) + (org-trim + (if allowed + (funcall set-function + prompt allowed nil + (not (get-text-property 0 'org-unrestricted (caar allowed)))) + (let ((all (mapcar #'list + (append (org-property-values property) + (and pom + (org-with-point-at pom + (org-property-values property))))))) + (funcall set-function prompt all nil nil "" nil current)))))) (defvar org-last-set-property nil) (defvar org-last-set-property-value nil) @@ -16482,7 +15985,7 @@ a priority cookie and tags in the standard locations." (move-marker (make-marker) (match-beginning 0)))))))) (defun org-find-exact-heading-in-directory (heading &optional dir) - "Find Org node headline HEADING in all .org files in directory DIR. + "Find Org node headline HEADING in all \".org\" files in directory DIR. When the target headline is found, return a marker to this location." (let ((files (directory-files (or dir default-directory) t "\\`[^.#].*\\.org\\'")) @@ -16541,8 +16044,7 @@ non-nil." ((org-at-timestamp-p 'lax) (match-string 0)))) ;; Default time is either the timestamp at point or today. ;; When entering a range, only the range start is considered. - (default-time (if (not ts) (current-time) - (apply #'encode-time (org-parse-time-string ts)))) + (default-time (and ts (org-time-string-to-time ts))) (default-input (and ts (org-get-compact-tod ts))) (repeater (and ts (string-match "\\([.+-]+[0-9]+[hdwmy] ?\\)+" ts) @@ -16550,13 +16052,13 @@ non-nil." org-time-was-given org-end-time-was-given (time - (and (if (equal arg '(16)) (current-time) - ;; Preserve `this-command' and `last-command'. - (let ((this-command this-command) - (last-command last-command)) - (org-read-date - arg 'totime nil nil default-time default-input - inactive)))))) + (if (equal arg '(16)) (current-time) + ;; Preserve `this-command' and `last-command'. + (let ((this-command this-command) + (last-command last-command)) + (org-read-date + arg 'totime nil nil default-time default-input + inactive))))) (cond ((and ts (memq last-command '(org-time-stamp org-time-stamp-inactive)) @@ -16605,10 +16107,18 @@ non-nil." (defun org-time-stamp-inactive (&optional arg) "Insert an inactive time stamp. + An inactive time stamp is enclosed in square brackets instead of angle brackets. It is inactive in the sense that it does not trigger agenda entries, does not link to the calendar and cannot be changed with the S-cursor keys. -So these are more for recording a certain time/date." +So these are more for recording a certain time/date. + +If the user specifies a time like HH:MM or if this command is called with +at least one prefix argument, the time stamp contains the date and the time. +Otherwise, only the date is included. + +When called with two universal prefix arguments, insert an active time stamp +with the current time without prompting the user." (interactive "P") (org-time-stamp arg 'inactive)) @@ -16644,57 +16154,57 @@ So these are more for recording a certain time/date." (org-defkey map (kbd "C-.") (lambda () (interactive) (org-eval-in-calendar '(calendar-goto-today)))) - (org-defkey map [(meta shift left)] + (org-defkey map (kbd "M-S-") (lambda () (interactive) (org-eval-in-calendar '(calendar-backward-month 1)))) - (org-defkey map [(meta shift right)] - (lambda () (interactive) - (org-eval-in-calendar '(calendar-forward-month 1)))) - (org-defkey map [(meta shift up)] - (lambda () (interactive) - (org-eval-in-calendar '(calendar-backward-year 1)))) - (org-defkey map [(meta shift down)] - (lambda () (interactive) - (org-eval-in-calendar '(calendar-forward-year 1)))) - (org-defkey map [?\e (shift left)] + (org-defkey map (kbd "ESC S-") (lambda () (interactive) (org-eval-in-calendar '(calendar-backward-month 1)))) - (org-defkey map [?\e (shift right)] + (org-defkey map (kbd "M-S-") + (lambda () (interactive) + (org-eval-in-calendar '(calendar-forward-month 1)))) + (org-defkey map (kbd "ESC S-") (lambda () (interactive) (org-eval-in-calendar '(calendar-forward-month 1)))) - (org-defkey map [?\e (shift up)] + (org-defkey map (kbd "M-S-") (lambda () (interactive) (org-eval-in-calendar '(calendar-backward-year 1)))) - (org-defkey map [?\e (shift down)] + (org-defkey map (kbd "ESC S-") + (lambda () (interactive) + (org-eval-in-calendar '(calendar-backward-year 1)))) + (org-defkey map (kbd "M-S-") + (lambda () (interactive) + (org-eval-in-calendar '(calendar-forward-year 1)))) + (org-defkey map (kbd "ESC S-") (lambda () (interactive) (org-eval-in-calendar '(calendar-forward-year 1)))) - (org-defkey map [(shift up)] + (org-defkey map (kbd "S-") (lambda () (interactive) (org-eval-in-calendar '(calendar-backward-week 1)))) - (org-defkey map [(shift down)] + (org-defkey map (kbd "S-") (lambda () (interactive) (org-eval-in-calendar '(calendar-forward-week 1)))) - (org-defkey map [(shift left)] + (org-defkey map (kbd "S-") (lambda () (interactive) (org-eval-in-calendar '(calendar-backward-day 1)))) - (org-defkey map [(shift right)] + (org-defkey map (kbd "S-") (lambda () (interactive) (org-eval-in-calendar '(calendar-forward-day 1)))) - (org-defkey map "!" + (org-defkey map (kbd "!") (lambda () (interactive) (org-eval-in-calendar '(diary-view-entries)) (message ""))) - (org-defkey map ">" + (org-defkey map (kbd ">") (lambda () (interactive) (org-eval-in-calendar '(calendar-scroll-left 1)))) - (org-defkey map "<" + (org-defkey map (kbd "<") (lambda () (interactive) (org-eval-in-calendar '(calendar-scroll-right 1)))) - (org-defkey map "\C-v" + (org-defkey map (kbd "C-v") (lambda () (interactive) (org-eval-in-calendar '(calendar-scroll-left-three-months 1)))) - (org-defkey map "\M-v" + (org-defkey map (kbd "M-v") (lambda () (interactive) (org-eval-in-calendar '(calendar-scroll-right-three-months 1)))) @@ -16854,13 +16364,14 @@ user." "range representable on this machine")) (ding)) - ;; One round trip to get rid of 34th of August and stuff like that.... - (setq final (decode-time (apply 'encode-time final))) + (setq final (apply #'encode-time final)) (setq org-read-date-final-answer ans) (if to-time - (apply 'encode-time final) + final + ;; This round-trip gets rid of 34th of August and stuff like that.... + (setq final (decode-time final)) (if (and (boundp 'org-time-was-given) org-time-was-given) (format "%04d-%02d-%02d %02d:%02d" (nth 5 final) (nth 4 final) (nth 3 final) @@ -16890,7 +16401,7 @@ user." (and (boundp 'org-time-was-given) org-time-was-given)) (cdr fmts) (car fmts))) - (txt (format-time-string fmt (apply 'encode-time f))) + (txt (format-time-string fmt (apply #'encode-time f))) (txt (if org-read-date-inactive (concat "[" (substring txt 1 -1) "]") txt)) (txt (concat "=> " txt))) (when (and org-end-time-was-given @@ -16907,12 +16418,9 @@ user." (defun org-read-date-analyze (ans def defdecode) "Analyze the combined answer of the date prompt." ;; FIXME: cleanup and comment - ;; Pass `current-time' result to `decode-time' (instead of calling - ;; without arguments) so that only `current-time' has to be - ;; overridden in tests. (let ((org-def def) (org-defdecode defdecode) - (nowdecode (decode-time (current-time))) + (nowdecode (decode-time)) delta deltan deltaw deltadef year month day hour minute second wday pm h2 m2 tl wday1 iso-year iso-weekday iso-week iso-date futurep kill-year) @@ -16921,7 +16429,7 @@ user." (when (string-match "\\`[ \t]*\\.[ \t]*\\'" ans) (setq ans "+0")) - (when (setq delta (org-read-date-get-relative ans (current-time) org-def)) + (when (setq delta (org-read-date-get-relative ans nil org-def)) (setq ans (replace-match "" t t ans) deltan (car delta) deltaw (nth 1 delta) @@ -17078,7 +16586,7 @@ user." ; (when (and org-read-date-prefer-future ; (not iso-year) ; (< (calendar-absolute-from-gregorian iso-date) - ; (time-to-days (current-time)))) + ; (time-to-days nil))) ; (setq year (1+ year) ; iso-date (calendar-gregorian-from-absolute ; (calendar-iso-to-absolute @@ -17089,10 +16597,7 @@ user." (deltan (setq futurep nil) (unless deltadef - ;; Pass `current-time' result to `decode-time' (instead of - ;; calling without arguments) so that only `current-time' has - ;; to be overridden in tests. - (let ((now (decode-time (current-time)))) + (let ((now (decode-time))) (setq day (nth 3 now) month (nth 4 now) year (nth 5 now)))) (cond ((member deltaw '("d" "")) (setq day (+ day deltan))) ((equal deltaw "w") (setq day (+ day (* 7 deltan)))) @@ -17272,7 +16777,7 @@ Don't touch the rest." If SECONDS is non-nil, return the difference in seconds." (let ((fdiff (if seconds #'float-time #'time-to-days))) (- (funcall fdiff (org-time-string-to-time timestamp-string)) - (funcall fdiff (current-time))))) + (funcall fdiff nil)))) (defun org-deadline-close-p (timestamp-string &optional ndays) "Is the time in TIMESTAMP-STRING close to the current date?" @@ -17377,8 +16882,8 @@ both scheduled and deadline timestamps." 'timestamp) (org-at-planning-p)) (time-less-p - (org-time-string-to-time match t) - (org-time-string-to-time d t))))))) + (org-time-string-to-time match) + (org-time-string-to-time d))))))) (message "%d entries before %s" (org-occur regexp nil callback) d))) @@ -17399,8 +16904,8 @@ both scheduled and deadline timestamps." 'timestamp) (org-at-planning-p)) (not (time-less-p - (org-time-string-to-time match t) - (org-time-string-to-time d t)))))))) + (org-time-string-to-time match) + (org-time-string-to-time d)))))))) (message "%d entries after %s" (org-occur regexp nil callback) d))) @@ -17423,11 +16928,11 @@ both scheduled and deadline timestamps." 'timestamp) (org-at-planning-p)) (not (time-less-p - (org-time-string-to-time match t) - (org-time-string-to-time start-date t))) + (org-time-string-to-time match) + (org-time-string-to-time start-date))) (time-less-p - (org-time-string-to-time match t) - (org-time-string-to-time end-date t)))))))) + (org-time-string-to-time match) + (org-time-string-to-time end-date)))))))) (message "%d entries between %s and %s" (org-occur regexp nil callback) start-date end-date))) @@ -17454,10 +16959,8 @@ days in order to avoid rounding problems." (match-end (match-end 0)) (time1 (org-time-string-to-time ts1)) (time2 (org-time-string-to-time ts2)) - (t1 (float-time time1)) - (t2 (float-time time2)) - (diff (abs (- t2 t1))) - (negative (< (- t2 t1) 0)) + (diff (abs (float-time (time-subtract time2 time1)))) + (negative (time-less-p time2 time1)) ;; (ys (floor (* 365 24 60 60))) (ds (* 24 60 60)) (hs (* 60 60)) @@ -17468,14 +16971,14 @@ days in order to avoid rounding problems." (fh "%02d:%02d") y d h m align) (if havetime - (setq ; y (floor (/ diff ys)) diff (mod diff ys) + (setq ; y (floor diff ys) diff (mod diff ys) y 0 - d (floor (/ diff ds)) diff (mod diff ds) - h (floor (/ diff hs)) diff (mod diff hs) - m (floor (/ diff 60))) - (setq ; y (floor (/ diff ys)) diff (mod diff ys) + d (floor diff ds) diff (mod diff ds) + h (floor diff hs) diff (mod diff hs) + m (floor diff 60)) + (setq ; y (floor diff ys) diff (mod diff ys) y 0 - d (floor (+ (/ diff ds) 0.5)) + d (round diff ds) h 0 m 0)) (if (not to-buffer) (message "%s" (org-make-tdiff-string y d h m)) @@ -17512,19 +17015,13 @@ days in order to avoid rounding problems." (push m l)) (apply 'format fmt (nreverse l)))) -(defun org-time-string-to-time (s &optional zone) - "Convert timestamp string S into internal time. -The optional ZONE is omitted or nil for Emacs local time, t for -Universal Time, ‘wall’ for system wall clock time, or a string as -in the TZ environment variable." - (apply #'encode-time (org-parse-time-string s nil zone))) +(defun org-time-string-to-time (s) + "Convert timestamp string S into internal time." + (apply #'encode-time (org-parse-time-string s))) -(defun org-time-string-to-seconds (s &optional zone) - "Convert a timestamp string S into a number of seconds. -The optional ZONE is omitted or nil for Emacs local time, t for -Universal Time, ‘wall’ for system wall clock time, or a string as -in the TZ environment variable." - (float-time (org-time-string-to-time s zone))) +(defun org-time-string-to-seconds (s) + "Convert a timestamp string S into a number of seconds." + (float-time (org-time-string-to-time s))) (org-define-error 'org-diary-sexp-no-match "Unable to match diary sexp") @@ -17555,7 +17052,7 @@ signaled." (daynr (org-closest-date s daynr prefer)) (t (time-to-days (condition-case errdata - (apply #'encode-time (org-parse-time-string s)) + (org-time-string-to-time s) (error (error "Bad timestamp `%s'%s\nError was: %s" s (if (not (and buffer pos)) "" @@ -17572,7 +17069,7 @@ signaled." YEAR is expanded into one of the 30 next years, if possible, or into a past one. Any year larger than 99 is returned unchanged." (if (>= year 100) year - (let* ((current (string-to-number (format-time-string "%Y" (current-time)))) + (let* ((current (string-to-number (format-time-string "%Y"))) (century (/ current 100)) (offset (- year (% current 100)))) (cond ((> offset 30) (+ (* (1- century) 100) year)) @@ -17653,12 +17150,12 @@ stamp stay unchanged. In any case, return value is an absolute day number." (if (not (string-match "\\+\\([0-9]+\\)\\([hdwmy]\\)" start)) ;; No repeater. Do not shift time stamp. - (time-to-days (apply #'encode-time (org-parse-time-string start))) + (time-to-days (org-time-string-to-time start)) (let ((value (string-to-number (match-string 1 start))) (type (match-string 2 start))) (if (= 0 value) ;; Repeater with a 0-value is considered as void. - (time-to-days (apply #'encode-time (org-parse-time-string start))) + (time-to-days (org-time-string-to-time start)) (let* ((base (org-date-to-gregorian start)) (target (org-date-to-gregorian current)) (sday (calendar-absolute-from-gregorian base)) @@ -17741,39 +17238,11 @@ day number." (list (nth 4 d) (nth 3 d) (nth 5 d)))) ((listp d) (list (nth 4 d) (nth 3 d) (nth 5 d))))) -(defun org-parse-time-string (s &optional nodefault zone) - "Parse the standard Org time string. - -This should be a lot faster than the normal `parse-time-string'. - -If time is not given, defaults to 0:00. However, with optional -NODEFAULT, hour and minute fields will be nil if not given. - -The optional ZONE is omitted or nil for Emacs local time, t for -Universal Time, ‘wall’ for system wall clock time, or a string as -in the TZ environment variable." - (cond ((string-match org-ts-regexp0 s) - (list 0 - (when (or (match-beginning 8) (not nodefault)) - (string-to-number (or (match-string 8 s) "0"))) - (when (or (match-beginning 7) (not nodefault)) - (string-to-number (or (match-string 7 s) "0"))) - (string-to-number (match-string 4 s)) - (string-to-number (match-string 3 s)) - (string-to-number (match-string 2 s)) - nil nil zone)) - ((string-match "^<[^>]+>$" s) - ;; FIXME: `decode-time' needs to be called with ZONE as its - ;; second argument. However, this requires at least Emacs - ;; 25.1. We can do it when we switch to this version as our - ;; minimal requirement. - (decode-time (seconds-to-time (org-matcher-time s)))) - (t (error "Not a standard Org time string: %s" s)))) - (defun org-timestamp-up (&optional arg) "Increase the date item at the cursor by one. If the cursor is on the year, change the year. If it is on the month, -the day or the time, change that. +the day or the time, change that. If the cursor is on the enclosing +bracket, change the timestamp type. With prefix ARG, change by that many units." (interactive "p") (org-timestamp-change (prefix-numeric-value arg) nil 'updown)) @@ -17781,7 +17250,8 @@ With prefix ARG, change by that many units." (defun org-timestamp-down (&optional arg) "Decrease the date item at the cursor by one. If the cursor is on the year, change the year. If it is on the month, -the day or the time, change that. +the day or the time, change that. If the cursor is on the enclosing +bracket, change the timestamp type. With prefix ARG, change by that many units." (interactive "p") (org-timestamp-change (- (prefix-numeric-value arg)) nil 'updown)) @@ -17901,10 +17371,16 @@ When matching, the match groups are the following: (defvar org-clock-adjust-closest nil) ; defined in org-clock.el (defun org-timestamp-change (n &optional what updown suppress-tmp-delay) "Change the date in the time stamp at point. -The date will be changed by N times WHAT. WHAT can be `day', `month', -`year', `minute', `second'. If WHAT is not given, the cursor position -in the timestamp determines what will be changed. -When SUPPRESS-TMP-DELAY is non-nil, suppress delays like \"--2d\"." + +The date is changed by N times WHAT. WHAT can be `day', `month', +`year', `hour', or `minute'. If WHAT is not given, the cursor +position in the timestamp determines what is changed. + +When optional argument UPDOWN is non-nil, minutes are rounded +according to `org-time-stamp-rounding-minutes'. + +When SUPPRESS-TMP-DELAY is non-nil, suppress delays like +\"--2d\"." (let ((origin (point)) (timestamp? (org-at-timestamp-p 'lax)) origin-cat @@ -18051,7 +17527,7 @@ When SUPPRESS-TMP-DELAY is non-nil, suppress delays like \"--2d\"." h (string-to-number (match-string 2 s))) (if (org-pos-in-match-range pos 2) (setq h (+ h n)) - (setq n (* dm (with-no-warnings (signum n)))) + (setq n (* dm (with-no-warnings (cl-signum n)))) (unless (= 0 (setq rem (% m dm))) (setq m (+ m (if (> n 0) (- rem) (- dm rem))))) (setq m (+ m n))) @@ -18096,7 +17572,7 @@ A prefix ARG can be used to force the current date." diff) (when (or (org-at-timestamp-p 'lax) (org-match-line (concat ".*" org-ts-regexp))) - (let ((d1 (time-to-days (current-time))) + (let ((d1 (time-to-days nil)) (d2 (time-to-days (org-time-string-to-time (match-string 1))))) (setq diff (- d2 d1)))) (calendar) @@ -18119,29 +17595,6 @@ If there is already a time stamp at the cursor position, update it." (org-insert-time-stamp (encode-time 0 0 0 (nth 1 cal-date) (car cal-date) (nth 2 cal-date)))))) -(defcustom org-effort-durations - `(("min" . 1) - ("h" . 60) - ("d" . ,(* 60 8)) - ("w" . ,(* 60 8 5)) - ("m" . ,(* 60 8 5 4)) - ("y" . ,(* 60 8 5 40))) - "Conversion factor to minutes for an effort modifier. - -Each entry has the form (MODIFIER . MINUTES). - -In an effort string, a number followed by MODIFIER is multiplied -by the specified number of MINUTES to obtain an effort in -minutes. - -For example, if the value of this variable is ((\"hours\" . 60)), then an -effort string \"2hours\" is equivalent to 120 minutes." - :group 'org-agenda - :version "26.1" - :package-version '(Org . "8.3") - :type '(alist :key-type (string :tag "Modifier") - :value-type (number :tag "Minutes"))) - (defcustom org-image-actual-width t "Should we use the actual width of images when inlining them? @@ -18212,7 +17665,7 @@ Prompt for confirmation when there are unsaved changes. Be sure you know what you are doing before letting this function overwrite your changes. -This function is useful in a setup where one tracks org files +This function is useful in a setup where one tracks Org files with a version control system, to revert on one machine after pulling changes from another. I believe the procedure must be like this: @@ -18504,7 +17957,7 @@ When a buffer is unmodified, it is just killed. When modified, it is saved (pall '(:org-archived t :org-comment t)) (inhibit-read-only t) (org-inhibit-startup org-agenda-inhibit-startup) - (rea (concat ":" org-archive-tag ":")) + (rea (org-make-tag-string (list org-archive-tag))) re pos) (setq org-tag-alist-for-agenda nil org-tag-groups-alist-for-agenda nil) @@ -18534,9 +17987,9 @@ When a buffer is unmodified, it is just killed. When modified, it is saved (setq org-todo-keyword-alist-for-agenda (append org-todo-keyword-alist-for-agenda org-todo-key-alist)) (setq org-tag-alist-for-agenda - (org-uniquify - (append org-tag-alist-for-agenda - org-current-tag-alist))) + (org--tag-add-to-alist + org-tag-alist-for-agenda + org-current-tag-alist)) ;; Merge current file's tag groups into global ;; `org-tag-groups-alist-for-agenda'. (when org-group-tags @@ -18545,20 +17998,20 @@ When a buffer is unmodified, it is just killed. When modified, it is saved (if old (setcdr old (org-uniquify (append (cdr old) (cdr alist)))) (push alist org-tag-groups-alist-for-agenda))))) - (org-with-silent-modifications - (save-excursion - (remove-text-properties (point-min) (point-max) pall) - (when org-agenda-skip-archived-trees - (goto-char (point-min)) - (while (re-search-forward rea nil t) - (when (org-at-heading-p t) - (add-text-properties (point-at-bol) (org-end-of-subtree t) pa)))) - (goto-char (point-min)) - (setq re (format "^\\*+ .*\\<%s\\>" org-comment-string)) - (while (re-search-forward re nil t) - (when (save-match-data (org-in-commented-heading-p t)) - (add-text-properties - (match-beginning 0) (org-end-of-subtree t) pc))))) + (with-silent-modifications + (save-excursion + (remove-text-properties (point-min) (point-max) pall) + (when org-agenda-skip-archived-trees + (goto-char (point-min)) + (while (re-search-forward rea nil t) + (when (org-at-heading-p t) + (add-text-properties (point-at-bol) (org-end-of-subtree t) pa)))) + (goto-char (point-min)) + (setq re (format "^\\*+ .*\\<%s\\>" org-comment-string)) + (while (re-search-forward re nil t) + (when (save-match-data (org-in-commented-heading-p t)) + (add-text-properties + (match-beginning 0) (org-end-of-subtree t) pc))))) (goto-char pos))))) (setq org-todo-keywords-for-agenda (org-uniquify org-todo-keywords-for-agenda)) @@ -18571,11 +18024,11 @@ When a buffer is unmodified, it is just killed. When modified, it is saved (defvar org-cdlatex-mode-map (make-sparse-keymap) "Keymap for the minor `org-cdlatex-mode'.") -(org-defkey org-cdlatex-mode-map "_" 'org-cdlatex-underscore-caret) -(org-defkey org-cdlatex-mode-map "^" 'org-cdlatex-underscore-caret) -(org-defkey org-cdlatex-mode-map "`" 'cdlatex-math-symbol) -(org-defkey org-cdlatex-mode-map "'" 'org-cdlatex-math-modify) -(org-defkey org-cdlatex-mode-map "\C-c{" 'org-cdlatex-environment-indent) +(org-defkey org-cdlatex-mode-map (kbd "_") #'org-cdlatex-underscore-caret) +(org-defkey org-cdlatex-mode-map (kbd "^") #'org-cdlatex-underscore-caret) +(org-defkey org-cdlatex-mode-map (kbd "`") #'cdlatex-math-symbol) +(org-defkey org-cdlatex-mode-map (kbd "'") #'org-cdlatex-math-modify) +(org-defkey org-cdlatex-mode-map (kbd "C-c {") #'org-cdlatex-environment-indent) (defvar org-cdlatex-texmathp-advice-is-done nil "Flag remembering if we have applied the advice to texmathp already.") @@ -18688,7 +18141,7 @@ environment remains unintended." (let ((ind (if (bolp) 0 (save-excursion (org-return-indent) - (prog1 (org-get-indentation) + (prog1 (current-indentation) (when (progn (skip-chars-forward " \t") (eolp)) (delete-region beg (point))))))) (bol (progn (skip-chars-backward " \t") (bolp)))) @@ -19268,7 +18721,6 @@ SNIPPETS-P indicates if this is run to create snippet images for HTML." "Return string to be used as color value for an RGB component." (format "%g" (/ value 65535.0))) - ;; Image display @@ -19298,6 +18750,9 @@ INCLUDE-LINKED is passed to `org-display-inline-images'." (org-toggle-inline-images) (org-toggle-inline-images))) +;; For without-x builds. +(declare-function image-refresh "image" (spec &optional frame)) + (defun org-display-inline-images (&optional include-linked refresh beg end) "Display inline images. @@ -19308,7 +18763,8 @@ conventions: from `image-file-name-regexp' and it has no contents. 2. Its description consists in a single link of the previous - type. + type. In this case, that link must be a well-formed plain + or angle link, i.e., it must have an explicit \"file\" type. When optional argument INCLUDE-LINKED is non-nil, also links with a text description part will be inlined. This can be nice for @@ -19324,89 +18780,112 @@ boundaries." (unless refresh (org-remove-inline-images) (when (fboundp 'clear-image-cache) (clear-image-cache))) - (org-with-wide-buffer - (goto-char (or beg (point-min))) - (let* ((case-fold-search t) - (file-extension-re (image-file-name-regexp)) - (link-abbrevs (mapcar #'car - (append org-link-abbrev-alist-local - org-link-abbrev-alist))) - ;; Check absolute, relative file names and explicit - ;; "file:" links. Also check link abbreviations since - ;; some might expand to "file" links. - (file-types-re (format "[][]\\[\\(?:file\\|[./~]%s\\)" - (and link-abbrevs - (format "\\|\\(?:%s:\\)" - (regexp-opt link-abbrevs)))))) - (while (re-search-forward file-types-re end t) - (let ((link (save-match-data (org-element-context)))) - ;; Check if we're at an inline image, i.e., an image file - ;; link without a description (unless INCLUDE-LINKED is - ;; non-nil). - (when (and (equal "file" (org-element-property :type link)) - (or include-linked - (null (org-element-contents link))) - (string-match-p file-extension-re - (org-element-property :path link))) - (let ((file (expand-file-name - (org-link-unescape - (org-element-property :path link))))) - (when (file-exists-p file) - (let ((width - ;; Apply `org-image-actual-width' specifications. - (cond - ((not (image-type-available-p 'imagemagick)) nil) - ((eq org-image-actual-width t) nil) - ((listp org-image-actual-width) - (or - ;; First try to find a width among - ;; attributes associated to the paragraph - ;; containing link. - (let ((paragraph - (let ((e link)) - (while (and (setq e (org-element-property - :parent e)) - (not (eq (org-element-type e) - 'paragraph)))) - e))) - (when paragraph - (save-excursion - (goto-char (org-element-property :begin paragraph)) - (when - (re-search-forward - "^[ \t]*#\\+attr_.*?: +.*?:width +\\(\\S-+\\)" - (org-element-property - :post-affiliated paragraph) - t) - (string-to-number (match-string 1)))))) - ;; Otherwise, fall-back to provided number. - (car org-image-actual-width))) - ((numberp org-image-actual-width) - org-image-actual-width))) - (old (get-char-property-and-overlay - (org-element-property :begin link) - 'org-image-overlay))) - (if (and (car-safe old) refresh) - (image-refresh (overlay-get (cdr old) 'display)) - (let ((image (create-image file - (and width 'imagemagick) - nil - :width width))) - (when image - (let ((ov (make-overlay - (org-element-property :begin link) - (progn - (goto-char - (org-element-property :end link)) - (skip-chars-backward " \t") - (point))))) - (overlay-put ov 'display image) - (overlay-put ov 'face 'default) - (overlay-put ov 'org-image-overlay t) - (overlay-put - ov 'modification-hooks - (list 'org-display-inline-remove-overlay)) - (push ov org-inline-image-overlays))))))))))))))) + (org-with-point-at (or beg 1) + (let* ((case-fold-search t) + (file-extension-re (image-file-name-regexp)) + (link-abbrevs (mapcar #'car + (append org-link-abbrev-alist-local + org-link-abbrev-alist))) + ;; Check absolute, relative file names and explicit + ;; "file:" links. Also check link abbreviations since + ;; some might expand to "file" links. + (file-types-re + (format "\\[\\[\\(?:file%s:\\|[./~]\\)\\|\\]\\[\\(") #'org-cycle) +(org-defkey org-mode-map (kbd "C-") #'org-force-cycle-archived) +(org-defkey org-mode-map (kbd "M-") #'pcomplete) +(org-defkey org-mode-map (kbd "M-TAB") #'pcomplete) +(org-defkey org-mode-map (kbd "ESC ") #'pcomplete) +(org-defkey org-mode-map (kbd "ESC TAB") #'pcomplete) + +(org-defkey org-mode-map (kbd "") #'org-shifttab) +(org-defkey org-mode-map (kbd "S-") #'org-shifttab) +(define-key org-mode-map (kbd "") #'org-shifttab) + +;;;; RET key with modifiers +(org-defkey org-mode-map (kbd "S-") #'org-table-copy-down) +(org-defkey org-mode-map (kbd "M-S-") #'org-insert-todo-heading) +(org-defkey org-mode-map (kbd "ESC S-") #'org-insert-todo-heading) (org-defkey org-mode-map (kbd "M-RET") #'org-meta-return) - -;; Cursor keys with modifiers -(org-defkey org-mode-map [(meta left)] 'org-metaleft) -(org-defkey org-mode-map [(meta right)] 'org-metaright) -(org-defkey org-mode-map [(meta up)] 'org-metaup) -(org-defkey org-mode-map [(meta down)] 'org-metadown) - -(org-defkey org-mode-map [(control meta shift right)] 'org-increase-number-at-point) -(org-defkey org-mode-map [(control meta shift left)] 'org-decrease-number-at-point) -(org-defkey org-mode-map [(meta shift left)] 'org-shiftmetaleft) -(org-defkey org-mode-map [(meta shift right)] 'org-shiftmetaright) -(org-defkey org-mode-map [(meta shift up)] 'org-shiftmetaup) -(org-defkey org-mode-map [(meta shift down)] 'org-shiftmetadown) - -(org-defkey org-mode-map [(shift up)] 'org-shiftup) -(org-defkey org-mode-map [(shift down)] 'org-shiftdown) -(org-defkey org-mode-map [(shift left)] 'org-shiftleft) -(org-defkey org-mode-map [(shift right)] 'org-shiftright) - -(org-defkey org-mode-map [(control shift right)] 'org-shiftcontrolright) -(org-defkey org-mode-map [(control shift left)] 'org-shiftcontrolleft) -(org-defkey org-mode-map [(control shift up)] 'org-shiftcontrolup) -(org-defkey org-mode-map [(control shift down)] 'org-shiftcontroldown) - -;; Babel keys +(org-defkey org-mode-map (kbd "ESC RET") #'org-meta-return) + +;;;; Cursor keys with modifiers +(org-defkey org-mode-map (kbd "M-") #'org-metaleft) +(org-defkey org-mode-map (kbd "M-") #'org-metaright) +(org-defkey org-mode-map (kbd "ESC ") #'org-metaright) +(org-defkey org-mode-map (kbd "M-") #'org-metaup) +(org-defkey org-mode-map (kbd "ESC ") #'org-metaup) +(org-defkey org-mode-map (kbd "M-") #'org-metadown) +(org-defkey org-mode-map (kbd "ESC ") #'org-metadown) + +(org-defkey org-mode-map (kbd "C-M-S-") #'org-increase-number-at-point) +(org-defkey org-mode-map (kbd "C-M-S-") #'org-decrease-number-at-point) +(org-defkey org-mode-map (kbd "M-S-") #'org-shiftmetaleft) +(org-defkey org-mode-map (kbd "ESC S-") #'org-shiftmetaleft) +(org-defkey org-mode-map (kbd "M-S-") #'org-shiftmetaright) +(org-defkey org-mode-map (kbd "ESC S-") #'org-shiftmetaright) +(org-defkey org-mode-map (kbd "M-S-") #'org-shiftmetaup) +(org-defkey org-mode-map (kbd "ESC S-") #'org-shiftmetaup) +(org-defkey org-mode-map (kbd "M-S-") #'org-shiftmetadown) +(org-defkey org-mode-map (kbd "ESC S-") #'org-shiftmetadown) + +(org-defkey org-mode-map (kbd "S-") #'org-shiftup) +(org-defkey org-mode-map (kbd "S-") #'org-shiftdown) +(org-defkey org-mode-map (kbd "S-") #'org-shiftleft) +(org-defkey org-mode-map (kbd "S-") #'org-shiftright) + +(org-defkey org-mode-map (kbd "C-S-") #'org-shiftcontrolright) +(org-defkey org-mode-map (kbd "C-S-") #'org-shiftcontrolleft) +(org-defkey org-mode-map (kbd "C-S-") #'org-shiftcontrolup) +(org-defkey org-mode-map (kbd "C-S-") #'org-shiftcontroldown) + +;;;; Babel keys (define-key org-mode-map org-babel-key-prefix org-babel-map) -(dolist (pair org-babel-key-bindings) - (define-key org-babel-map (car pair) (cdr pair))) +(pcase-dolist (`(,key . ,def) org-babel-key-bindings) + (define-key org-babel-map key def)) + +;;;; Extra keys for TTY access. -;;; Extra keys for tty access. ;; We only set them when really needed because otherwise the ;; menus don't show the simple keys (when (or org-use-extra-keys (not window-system)) - (org-defkey org-mode-map "\C-c\C-xc" 'org-table-copy-down) - (org-defkey org-mode-map "\C-c\C-xM" 'org-insert-todo-heading) - (org-defkey org-mode-map "\C-c\C-xm" 'org-meta-return) - (org-defkey org-mode-map [?\e (return)] 'org-meta-return) - (org-defkey org-mode-map [?\e (left)] 'org-metaleft) - (org-defkey org-mode-map "\C-c\C-xl" 'org-metaleft) - (org-defkey org-mode-map [?\e (right)] 'org-metaright) - (org-defkey org-mode-map "\C-c\C-xr" 'org-metaright) - (org-defkey org-mode-map [?\e (up)] 'org-metaup) - (org-defkey org-mode-map "\C-c\C-xu" 'org-metaup) - (org-defkey org-mode-map [?\e (down)] 'org-metadown) - (org-defkey org-mode-map "\C-c\C-xd" 'org-metadown) - (org-defkey org-mode-map "\C-c\C-xL" 'org-shiftmetaleft) - (org-defkey org-mode-map "\C-c\C-xR" 'org-shiftmetaright) - (org-defkey org-mode-map "\C-c\C-xU" 'org-shiftmetaup) - (org-defkey org-mode-map "\C-c\C-xD" 'org-shiftmetadown) - (org-defkey org-mode-map [?\C-c (up)] 'org-shiftup) - (org-defkey org-mode-map [?\C-c (down)] 'org-shiftdown) - (org-defkey org-mode-map [?\C-c (left)] 'org-shiftleft) - (org-defkey org-mode-map [?\C-c (right)] 'org-shiftright) - (org-defkey org-mode-map [?\C-c ?\C-x (right)] 'org-shiftcontrolright) - (org-defkey org-mode-map [?\C-c ?\C-x (left)] 'org-shiftcontrolleft) - (org-defkey org-mode-map [?\e (tab)] #'pcomplete) - (org-defkey org-mode-map [?\e (shift return)] 'org-insert-todo-heading) - (org-defkey org-mode-map [?\e (shift left)] 'org-shiftmetaleft) - (org-defkey org-mode-map [?\e (shift right)] 'org-shiftmetaright) - (org-defkey org-mode-map [?\e (shift up)] 'org-shiftmetaup) - (org-defkey org-mode-map [?\e (shift down)] 'org-shiftmetadown)) - -;; All the other keys + (org-defkey org-mode-map (kbd "C-c C-x c") #'org-table-copy-down) + (org-defkey org-mode-map (kbd "C-c C-x m") #'org-meta-return) + (org-defkey org-mode-map (kbd "C-c C-x M") #'org-insert-todo-heading) + (org-defkey org-mode-map (kbd "C-c C-x RET") #'org-meta-return) + (org-defkey org-mode-map (kbd "ESC RET") #'org-meta-return) + (org-defkey org-mode-map (kbd "ESC ") #'org-metaleft) + (org-defkey org-mode-map (kbd "C-c C-x l") #'org-metaleft) + (org-defkey org-mode-map (kbd "ESC ") #'org-metaright) + (org-defkey org-mode-map (kbd "C-c C-x r") #'org-metaright) + (org-defkey org-mode-map (kbd "C-c C-x u") #'org-metaup) + (org-defkey org-mode-map (kbd "C-c C-x d") #'org-metadown) + (org-defkey org-mode-map (kbd "C-c C-x L") #'org-shiftmetaleft) + (org-defkey org-mode-map (kbd "C-c C-x R") #'org-shiftmetaright) + (org-defkey org-mode-map (kbd "C-c C-x U") #'org-shiftmetaup) + (org-defkey org-mode-map (kbd "C-c C-x D") #'org-shiftmetadown) + (org-defkey org-mode-map (kbd "C-c ") #'org-shiftup) + (org-defkey org-mode-map (kbd "C-c ") #'org-shiftdown) + (org-defkey org-mode-map (kbd "C-c ") #'org-shiftleft) + (org-defkey org-mode-map (kbd "C-c ") #'org-shiftright) + (org-defkey org-mode-map (kbd "C-c C-x ") #'org-shiftcontrolright) + (org-defkey org-mode-map (kbd "C-c C-x ") #'org-shiftcontrolleft)) + +;;;; Narrow map +(org-defkey narrow-map "s" #'org-narrow-to-subtree) +(org-defkey narrow-map "b" #'org-narrow-to-block) +(org-defkey narrow-map "e" #'org-narrow-to-element) + +;;;; Remap usual Emacs bindings (org-remap org-mode-map - 'self-insert-command 'org-self-insert-command - 'delete-char 'org-delete-char - 'delete-backward-char 'org-delete-backward-char) -(org-defkey org-mode-map "|" 'org-force-self-insert) - -(org-defkey org-mode-map "\C-c\C-a" 'outline-show-all) ; in case allout messed up. -(org-defkey org-mode-map "\C-c\C-r" 'org-reveal) -(if (boundp 'narrow-map) - (org-defkey narrow-map "s" 'org-narrow-to-subtree) - (org-defkey org-mode-map "\C-xns" 'org-narrow-to-subtree)) -(if (boundp 'narrow-map) - (org-defkey narrow-map "b" 'org-narrow-to-block) - (org-defkey org-mode-map "\C-xnb" 'org-narrow-to-block)) -(if (boundp 'narrow-map) - (org-defkey narrow-map "e" 'org-narrow-to-element) - (org-defkey org-mode-map "\C-xne" 'org-narrow-to-element)) -(org-defkey org-mode-map "\C-\M-t" 'org-transpose-element) -(org-defkey org-mode-map "\M-}" 'org-forward-element) -(org-defkey org-mode-map "\M-{" 'org-backward-element) -(org-defkey org-mode-map "\C-c\C-^" 'org-up-element) -(org-defkey org-mode-map "\C-c\C-_" 'org-down-element) -(org-defkey org-mode-map "\C-c\C-f" 'org-forward-heading-same-level) -(org-defkey org-mode-map "\C-c\C-b" 'org-backward-heading-same-level) -(org-defkey org-mode-map "\C-c\M-f" 'org-next-block) -(org-defkey org-mode-map "\C-c\M-b" 'org-previous-block) -(org-defkey org-mode-map "\C-c$" 'org-archive-subtree) -(org-defkey org-mode-map "\C-c\C-x\C-s" 'org-archive-subtree) -(org-defkey org-mode-map "\C-c\C-x\C-a" 'org-archive-subtree-default) -(org-defkey org-mode-map "\C-c\C-xd" 'org-insert-drawer) -(org-defkey org-mode-map "\C-c\C-xa" 'org-toggle-archive-tag) -(org-defkey org-mode-map "\C-c\C-xA" 'org-archive-to-archive-sibling) -(org-defkey org-mode-map "\C-c\C-xb" 'org-tree-to-indirect-buffer) -(org-defkey org-mode-map "\C-c\C-xq" 'org-toggle-tags-groups) -(org-defkey org-mode-map "\C-c\C-j" 'org-goto) -(org-defkey org-mode-map "\C-c\C-t" 'org-todo) -(org-defkey org-mode-map "\C-c\C-q" 'org-set-tags-command) -(org-defkey org-mode-map "\C-c\C-s" 'org-schedule) -(org-defkey org-mode-map "\C-c\C-d" 'org-deadline) -(org-defkey org-mode-map "\C-c;" 'org-toggle-comment) -(org-defkey org-mode-map "\C-c\C-w" 'org-refile) -(org-defkey org-mode-map "\C-c\M-w" 'org-copy) -(org-defkey org-mode-map "\C-c/" 'org-sparse-tree) ; Minor-mode reserved -(org-defkey org-mode-map "\C-c\\" 'org-match-sparse-tree) ; Minor-mode res. -(org-defkey org-mode-map "\C-c\C-m" 'org-ctrl-c-ret) -(org-defkey org-mode-map "\C-c\C-xc" 'org-clone-subtree-with-time-shift) -(org-defkey org-mode-map "\C-c\C-xv" 'org-copy-visible) -(org-defkey org-mode-map [(control return)] 'org-insert-heading-respect-content) -(org-defkey org-mode-map [(shift control return)] 'org-insert-todo-heading-respect-content) -(org-defkey org-mode-map "\C-c\C-x\C-n" 'org-next-link) -(org-defkey org-mode-map "\C-c\C-x\C-p" 'org-previous-link) -(org-defkey org-mode-map "\C-c\C-l" 'org-insert-link) -(org-defkey org-mode-map "\C-c\M-l" 'org-insert-last-stored-link) -(org-defkey org-mode-map "\C-c\C-\M-l" 'org-insert-all-links) -(org-defkey org-mode-map "\C-c\C-o" 'org-open-at-point) -(org-defkey org-mode-map "\C-c%" 'org-mark-ring-push) -(org-defkey org-mode-map "\C-c&" 'org-mark-ring-goto) -(org-defkey org-mode-map "\C-c\C-z" 'org-add-note) ; Alternative binding -(org-defkey org-mode-map "\C-c." 'org-time-stamp) ; Minor-mode reserved -(org-defkey org-mode-map "\C-c!" 'org-time-stamp-inactive) ; Minor-mode r. -(org-defkey org-mode-map "\C-c," 'org-priority) ; Minor-mode reserved -(org-defkey org-mode-map "\C-c\C-y" 'org-evaluate-time-range) -(org-defkey org-mode-map "\C-c>" 'org-goto-calendar) -(org-defkey org-mode-map "\C-c<" 'org-date-from-calendar) -(org-defkey org-mode-map [(control ?,)] 'org-cycle-agenda-files) -(org-defkey org-mode-map [(control ?\')] 'org-cycle-agenda-files) -(org-defkey org-mode-map "\C-c[" 'org-agenda-file-to-front) -(org-defkey org-mode-map "\C-c]" 'org-remove-file) -(org-defkey org-mode-map "\C-c\C-x<" 'org-agenda-set-restriction-lock) -(org-defkey org-mode-map "\C-c\C-x>" 'org-agenda-remove-restriction-lock) -(org-defkey org-mode-map "\C-c-" 'org-ctrl-c-minus) -(org-defkey org-mode-map "\C-c*" 'org-ctrl-c-star) -(org-defkey org-mode-map "\C-c^" 'org-sort) -(org-defkey org-mode-map "\C-c\C-c" 'org-ctrl-c-ctrl-c) -(org-defkey org-mode-map "\C-c\C-k" 'org-kill-note-or-show-branches) -(org-defkey org-mode-map "\C-c#" 'org-update-statistics-cookies) -(org-defkey org-mode-map [remap open-line] 'org-open-line) -(org-defkey org-mode-map [remap comment-dwim] 'org-comment-dwim) -(org-defkey org-mode-map [remap forward-paragraph] 'org-forward-paragraph) -(org-defkey org-mode-map [remap backward-paragraph] 'org-backward-paragraph) -(org-defkey org-mode-map "\M-^" 'org-delete-indentation) -(org-defkey org-mode-map "\C-m" 'org-return) -(org-defkey org-mode-map "\C-j" 'org-return-indent) -(org-defkey org-mode-map "\C-c?" 'org-table-field-info) -(org-defkey org-mode-map "\C-c " 'org-table-blank-field) -(org-defkey org-mode-map "\C-c+" 'org-table-sum) -(org-defkey org-mode-map "\C-c=" 'org-table-eval-formula) -(org-defkey org-mode-map "\C-c'" 'org-edit-special) -(org-defkey org-mode-map "\C-c`" 'org-table-edit-field) -(org-defkey org-mode-map "\C-c\"a" 'orgtbl-ascii-plot) -(org-defkey org-mode-map "\C-c\"g" 'org-plot/gnuplot) -(org-defkey org-mode-map "\C-c|" 'org-table-create-or-convert-from-region) -(org-defkey org-mode-map [(control ?#)] 'org-table-rotate-recalc-marks) -(org-defkey org-mode-map "\C-c~" 'org-table-create-with-table.el) -(org-defkey org-mode-map "\C-c\C-a" 'org-attach) -(org-defkey org-mode-map "\C-c}" 'org-table-toggle-coordinate-overlays) -(org-defkey org-mode-map "\C-c{" 'org-table-toggle-formula-debugger) -(org-defkey org-mode-map "\C-c\C-e" 'org-export-dispatch) -(org-defkey org-mode-map "\C-c:" 'org-toggle-fixed-width) -(org-defkey org-mode-map "\C-c\C-x\C-f" 'org-emphasize) -(org-defkey org-mode-map "\C-c\C-xf" 'org-footnote-action) -(org-defkey org-mode-map "\C-c\C-x\C-mg" 'org-mobile-pull) -(org-defkey org-mode-map "\C-c\C-x\C-mp" 'org-mobile-push) -(org-defkey org-mode-map "\C-c@" 'org-mark-subtree) -(org-defkey org-mode-map "\M-h" 'org-mark-element) -(org-defkey org-mode-map [?\C-c (control ?*)] 'org-list-make-subtree) -;;(org-defkey org-mode-map [?\C-c (control ?-)] 'org-list-make-list-from-subtree) - -(org-defkey org-mode-map "\C-c\C-x\C-w" 'org-cut-special) -(org-defkey org-mode-map "\C-c\C-x\M-w" 'org-copy-special) -(org-defkey org-mode-map "\C-c\C-x\C-y" 'org-paste-special) - -(org-defkey org-mode-map "\C-c\C-x\C-t" 'org-toggle-time-stamp-overlays) -(org-defkey org-mode-map "\C-c\C-x\C-i" 'org-clock-in) -(org-defkey org-mode-map "\C-c\C-x\C-x" 'org-clock-in-last) -(org-defkey org-mode-map "\C-c\C-x\C-z" 'org-resolve-clocks) -(org-defkey org-mode-map "\C-c\C-x\C-o" 'org-clock-out) -(org-defkey org-mode-map "\C-c\C-x\C-j" 'org-clock-goto) -(org-defkey org-mode-map "\C-c\C-x\C-q" 'org-clock-cancel) -(org-defkey org-mode-map "\C-c\C-x\C-d" 'org-clock-display) -(org-defkey org-mode-map "\C-c\C-x\C-r" 'org-clock-report) -(org-defkey org-mode-map "\C-c\C-x\C-u" 'org-dblock-update) -(org-defkey org-mode-map "\C-c\C-x\C-l" 'org-toggle-latex-fragment) -(org-defkey org-mode-map "\C-c\C-x\C-v" 'org-toggle-inline-images) -(org-defkey org-mode-map "\C-c\C-x\C-\M-v" 'org-redisplay-inline-images) -(org-defkey org-mode-map "\C-c\C-x\\" 'org-toggle-pretty-entities) -(org-defkey org-mode-map "\C-c\C-x\C-b" 'org-toggle-checkbox) -(org-defkey org-mode-map "\C-c\C-xp" 'org-set-property) -(org-defkey org-mode-map "\C-c\C-xP" 'org-set-property-and-value) -(org-defkey org-mode-map "\C-c\C-xe" 'org-set-effort) -(org-defkey org-mode-map "\C-c\C-xE" 'org-inc-effort) -(org-defkey org-mode-map "\C-c\C-xo" 'org-toggle-ordered-property) -(org-defkey org-mode-map "\C-c\C-xi" 'org-columns-insert-dblock) -(org-defkey org-mode-map [(control ?c) (control ?x) ?\;] 'org-timer-set-timer) - -(org-defkey org-mode-map "\C-c\C-x." 'org-timer) -(org-defkey org-mode-map "\C-c\C-x-" 'org-timer-item) -(org-defkey org-mode-map "\C-c\C-x0" 'org-timer-start) -(org-defkey org-mode-map "\C-c\C-x_" 'org-timer-stop) -(org-defkey org-mode-map "\C-c\C-x," 'org-timer-pause-or-continue) - -(define-key org-mode-map "\C-c\C-x\C-c" 'org-columns) - -(define-key org-mode-map "\C-c\C-x!" 'org-reload) - -(define-key org-mode-map "\C-c\C-xg" 'org-feed-update-all) -(define-key org-mode-map "\C-c\C-xG" 'org-feed-goto-inbox) - -(define-key org-mode-map "\C-c\C-x[" 'org-reftex-citation) + 'self-insert-command 'org-self-insert-command + 'delete-char 'org-delete-char + 'delete-backward-char 'org-delete-backward-char + 'kill-line 'org-kill-line + 'open-line 'org-open-line + 'yank 'org-yank + 'comment-dwim 'org-comment-dwim + 'move-beginning-of-line 'org-beginning-of-line + 'move-end-of-line 'org-end-of-line + 'forward-paragraph 'org-forward-paragraph + 'backward-paragraph 'org-backward-paragraph + 'backward-sentence 'org-backward-sentence + 'forward-sentence 'org-forward-sentence + 'fill-paragraph 'org-fill-paragraph + 'delete-indentation 'org-delete-indentation + 'transpose-words 'org-transpose-words) + +;;;; All the other keys +(org-defkey org-mode-map (kbd "|") #'org-force-self-insert) +(org-defkey org-mode-map (kbd "C-c C-r") #'org-reveal) +(org-defkey org-mode-map (kbd "C-M-t") #'org-transpose-element) +(org-defkey org-mode-map (kbd "M-}") #'org-forward-element) +(org-defkey org-mode-map (kbd "ESC }") #'org-forward-element) +(org-defkey org-mode-map (kbd "M-{") #'org-backward-element) +(org-defkey org-mode-map (kbd "ESC {") #'org-backward-element) +(org-defkey org-mode-map (kbd "C-c C-^") #'org-up-element) +(org-defkey org-mode-map (kbd "C-c C-_") #'org-down-element) +(org-defkey org-mode-map (kbd "C-c C-f") #'org-forward-heading-same-level) +(org-defkey org-mode-map (kbd "C-c C-b") #'org-backward-heading-same-level) +(org-defkey org-mode-map (kbd "C-c M-f") #'org-next-block) +(org-defkey org-mode-map (kbd "C-c M-b") #'org-previous-block) +(org-defkey org-mode-map (kbd "C-c $") #'org-archive-subtree) +(org-defkey org-mode-map (kbd "C-c C-x C-s") #'org-archive-subtree) +(org-defkey org-mode-map (kbd "C-c C-x C-a") #'org-archive-subtree-default) +(org-defkey org-mode-map (kbd "C-c C-x d") #'org-insert-drawer) +(org-defkey org-mode-map (kbd "C-c C-x a") #'org-toggle-archive-tag) +(org-defkey org-mode-map (kbd "C-c C-x A") #'org-archive-to-archive-sibling) +(org-defkey org-mode-map (kbd "C-c C-x b") #'org-tree-to-indirect-buffer) +(org-defkey org-mode-map (kbd "C-c C-x q") #'org-toggle-tags-groups) +(org-defkey org-mode-map (kbd "C-c C-j") #'org-goto) +(org-defkey org-mode-map (kbd "C-c C-t") #'org-todo) +(org-defkey org-mode-map (kbd "C-c C-q") #'org-set-tags-command) +(org-defkey org-mode-map (kbd "C-c C-s") #'org-schedule) +(org-defkey org-mode-map (kbd "C-c C-d") #'org-deadline) +(org-defkey org-mode-map (kbd "C-c ;") #'org-toggle-comment) +(org-defkey org-mode-map (kbd "C-c C-w") #'org-refile) +(org-defkey org-mode-map (kbd "C-c M-w") #'org-copy) +(org-defkey org-mode-map (kbd "C-c /") #'org-sparse-tree) ;minor-mode reserved +(org-defkey org-mode-map (kbd "C-c \\") #'org-match-sparse-tree) ;minor-mode r. +(org-defkey org-mode-map (kbd "C-c RET") #'org-ctrl-c-ret) +(org-defkey org-mode-map (kbd "C-c C-x c") #'org-clone-subtree-with-time-shift) +(org-defkey org-mode-map (kbd "C-c C-x v") #'org-copy-visible) +(org-defkey org-mode-map (kbd "C-") #'org-insert-heading-respect-content) +(org-defkey org-mode-map (kbd "C-S-") #'org-insert-todo-heading-respect-content) +(org-defkey org-mode-map (kbd "C-c C-x C-n") #'org-next-link) +(org-defkey org-mode-map (kbd "C-c C-x C-p") #'org-previous-link) +(org-defkey org-mode-map (kbd "C-c C-l") #'org-insert-link) +(org-defkey org-mode-map (kbd "C-c M-l") #'org-insert-last-stored-link) +(org-defkey org-mode-map (kbd "C-c C-M-l") #'org-insert-all-links) +(org-defkey org-mode-map (kbd "C-c C-o") #'org-open-at-point) +(org-defkey org-mode-map (kbd "C-c %") #'org-mark-ring-push) +(org-defkey org-mode-map (kbd "C-c &") #'org-mark-ring-goto) +(org-defkey org-mode-map (kbd "C-c C-z") #'org-add-note) ;alternative binding +(org-defkey org-mode-map (kbd "C-c .") #'org-time-stamp) ;minor-mode reserved +(org-defkey org-mode-map (kbd "C-c !") #'org-time-stamp-inactive) ;minor-mode r. +(org-defkey org-mode-map (kbd "C-c ,") #'org-priority) ;minor-mode reserved +(org-defkey org-mode-map (kbd "C-c C-y") #'org-evaluate-time-range) +(org-defkey org-mode-map (kbd "C-c >") #'org-goto-calendar) +(org-defkey org-mode-map (kbd "C-c <") #'org-date-from-calendar) +(org-defkey org-mode-map (kbd "C-,") #'org-cycle-agenda-files) +(org-defkey org-mode-map (kbd "C-'") #'org-cycle-agenda-files) +(org-defkey org-mode-map (kbd "C-c [") #'org-agenda-file-to-front) +(org-defkey org-mode-map (kbd "C-c ]") #'org-remove-file) +(org-defkey org-mode-map (kbd "C-c C-x <") #'org-agenda-set-restriction-lock) +(org-defkey org-mode-map (kbd "C-c C-x >") #'org-agenda-remove-restriction-lock) +(org-defkey org-mode-map (kbd "C-c -") #'org-ctrl-c-minus) +(org-defkey org-mode-map (kbd "C-c *") #'org-ctrl-c-star) +(org-defkey org-mode-map (kbd "C-c TAB") #'org-ctrl-c-tab) +(org-defkey org-mode-map (kbd "C-c ^") #'org-sort) +(org-defkey org-mode-map (kbd "C-c C-c") #'org-ctrl-c-ctrl-c) +(org-defkey org-mode-map (kbd "C-c C-k") #'org-kill-note-or-show-branches) +(org-defkey org-mode-map (kbd "C-c #") #'org-update-statistics-cookies) +(org-defkey org-mode-map (kbd "RET") #'org-return) +(org-defkey org-mode-map (kbd "C-j") #'org-return-indent) +(org-defkey org-mode-map (kbd "C-c ?") #'org-table-field-info) +(org-defkey org-mode-map (kbd "C-c SPC") #'org-table-blank-field) +(org-defkey org-mode-map (kbd "C-c +") #'org-table-sum) +(org-defkey org-mode-map (kbd "C-c =") #'org-table-eval-formula) +(org-defkey org-mode-map (kbd "C-c '") #'org-edit-special) +(org-defkey org-mode-map (kbd "C-c `") #'org-table-edit-field) +(org-defkey org-mode-map (kbd "C-c \" a") #'orgtbl-ascii-plot) +(org-defkey org-mode-map (kbd "C-c \" g") #'org-plot/gnuplot) +(org-defkey org-mode-map (kbd "C-c |") #'org-table-create-or-convert-from-region) +(org-defkey org-mode-map (kbd "C-#") #'org-table-rotate-recalc-marks) +(org-defkey org-mode-map (kbd "C-c ~") #'org-table-create-with-table.el) +(org-defkey org-mode-map (kbd "C-c C-a") #'org-attach) +(org-defkey org-mode-map (kbd "C-c }") #'org-table-toggle-coordinate-overlays) +(org-defkey org-mode-map (kbd "C-c {") #'org-table-toggle-formula-debugger) +(org-defkey org-mode-map (kbd "C-c C-e") #'org-export-dispatch) +(org-defkey org-mode-map (kbd "C-c :") #'org-toggle-fixed-width) +(org-defkey org-mode-map (kbd "C-c C-x C-f") #'org-emphasize) +(org-defkey org-mode-map (kbd "C-c C-x f") #'org-footnote-action) +(org-defkey org-mode-map (kbd "C-c @") #'org-mark-subtree) +(org-defkey org-mode-map (kbd "M-h") #'org-mark-element) +(org-defkey org-mode-map (kbd "ESC h") #'org-mark-element) +(org-defkey org-mode-map (kbd "C-c C-*") #'org-list-make-subtree) +(org-defkey org-mode-map (kbd "C-c C-x C-w") #'org-cut-special) +(org-defkey org-mode-map (kbd "C-c C-x M-w") #'org-copy-special) +(org-defkey org-mode-map (kbd "C-c C-x C-y") #'org-paste-special) +(org-defkey org-mode-map (kbd "C-c C-x C-t") #'org-toggle-time-stamp-overlays) +(org-defkey org-mode-map (kbd "C-c C-x C-i") #'org-clock-in) +(org-defkey org-mode-map (kbd "C-c C-x C-x") #'org-clock-in-last) +(org-defkey org-mode-map (kbd "C-c C-x C-z") #'org-resolve-clocks) +(org-defkey org-mode-map (kbd "C-c C-x C-o") #'org-clock-out) +(org-defkey org-mode-map (kbd "C-c C-x C-j") #'org-clock-goto) +(org-defkey org-mode-map (kbd "C-c C-x C-q") #'org-clock-cancel) +(org-defkey org-mode-map (kbd "C-c C-x C-d") #'org-clock-display) +(org-defkey org-mode-map (kbd "C-c C-x C-r") #'org-clock-report) +(org-defkey org-mode-map (kbd "C-c C-x C-u") #'org-dblock-update) +(org-defkey org-mode-map (kbd "C-c C-x C-l") #'org-toggle-latex-fragment) +(org-defkey org-mode-map (kbd "C-c C-x C-v") #'org-toggle-inline-images) +(org-defkey org-mode-map (kbd "C-c C-x C-M-v") #'org-redisplay-inline-images) +(org-defkey org-mode-map (kbd "C-c C-x \\") #'org-toggle-pretty-entities) +(org-defkey org-mode-map (kbd "C-c C-x C-b") #'org-toggle-checkbox) +(org-defkey org-mode-map (kbd "C-c C-x p") #'org-set-property) +(org-defkey org-mode-map (kbd "C-c C-x P") #'org-set-property-and-value) +(org-defkey org-mode-map (kbd "C-c C-x e") #'org-set-effort) +(org-defkey org-mode-map (kbd "C-c C-x E") #'org-inc-effort) +(org-defkey org-mode-map (kbd "C-c C-x o") #'org-toggle-ordered-property) +(org-defkey org-mode-map (kbd "C-c C-x i") #'org-columns-insert-dblock) +(org-defkey org-mode-map (kbd "C-c C-,") #'org-insert-structure-template) +(org-defkey org-mode-map (kbd "C-c C-x .") #'org-timer) +(org-defkey org-mode-map (kbd "C-c C-x -") #'org-timer-item) +(org-defkey org-mode-map (kbd "C-c C-x 0") #'org-timer-start) +(org-defkey org-mode-map (kbd "C-c C-x _") #'org-timer-stop) +(org-defkey org-mode-map (kbd "C-c C-x ;") #'org-timer-set-timer) +(org-defkey org-mode-map (kbd "C-c C-x ,") #'org-timer-pause-or-continue) +(org-defkey org-mode-map (kbd "C-c C-x C-c") #'org-columns) +(org-defkey org-mode-map (kbd "C-c C-x !") #'org-reload) +(org-defkey org-mode-map (kbd "C-c C-x g") #'org-feed-update-all) +(org-defkey org-mode-map (kbd "C-c C-x G") #'org-feed-goto-inbox) +(org-defkey org-mode-map (kbd "C-c C-x [") #'org-reftex-citation) +(org-defkey org-mode-map (kbd "C-c C-x I") #'org-info-find-node) + +;;; Speed commands (defconst org-speed-commands-default '( @@ -19723,7 +19185,8 @@ COMMANDS is a list of alternating OLDDEF NEWDEF command names." ("c" . org-cycle) ("C" . org-shifttab) (" " . org-display-outline-path) - ("s" . org-narrow-to-subtree) + ("s" . org-toggle-narrow-to-subtree) + ("k" . org-cut-subtree) ("=" . org-columns) ("Outline Structure Editing") ("U" . org-metaup) @@ -19867,12 +19330,13 @@ overwritten, and the table is not marked as requiring realignment." (t (let (org-use-speed-commands) (call-interactively 'org-self-insert-command))))) ((and - (org-at-table-p) - (eq N 1) + (= N 1) (not (org-region-active-p)) + (org-at-table-p) (progn ;; Check if we blank the field, and if that triggers align. - (and (featurep 'org-table) org-table-auto-blank-field + (and (featurep 'org-table) + org-table-auto-blank-field (memq last-command '(org-cycle org-return org-shifttab org-ctrl-c-ctrl-c)) (if (or (eq (char-after) ?\s) (looking-at "[^|\n]* |")) @@ -19883,10 +19347,16 @@ overwritten, and the table is not marked as requiring realignment." ;; width. (org-table-blank-field))) t) - (looking-at "[^|\n]* \\( \\)|")) + (looking-at "[^|\n]* |")) ;; There is room for insertion without re-aligning the table. - (delete-region (match-beginning 1) (match-end 1)) - (self-insert-command N)) + (self-insert-command N) + (org-table-with-shrunk-field + (save-excursion + (skip-chars-forward "^|") + ;; Do not delete last space, which is + ;; `org-table-separator-space', but the regular space before + ;; it. + (delete-region (- (point) 2) (1- (point)))))) (t (setq org-table-may-need-update t) (self-insert-command N) @@ -19971,12 +19441,11 @@ The detailed reaction depends on the user option `org-catch-invisible-edits'." (defun org-fix-tags-on-the-fly () "Align tags in headline at point. -Unlike to `org-set-tags', it ignores region and sorting." - (when (and (eq (char-after (line-beginning-position)) ?*) ;short-circuit - (org-at-heading-p)) - (let ((org-ignore-region t) - (org-tags-sort-function nil)) - (org-set-tags nil t)))) +Unlike `org-align-tags', this function does nothing if point is +either not currently on a tagged headline or on a tag." + (when (and (org-match-line org-tag-line-re) + (< (point) (match-beginning 1))) + (org-align-tags))) (defun org-delete-backward-char (N) "Like `delete-backward-char', insert whitespace at field end in tables. @@ -19987,22 +19456,14 @@ because, in this case the deletion might narrow the column." (interactive "p") (save-match-data (org-check-before-invisible-edit 'delete-backward) - (if (and (org-at-table-p) - (eq N 1) + (if (and (= N 1) + (not overwrite-mode) (not (org-region-active-p)) - (string-match "|" (buffer-substring (point-at-bol) (point))) - (looking-at ".*?|")) - (let ((pos (point)) - (noalign (looking-at "[^|\n\r]* |")) - (c org-table-may-need-update)) - (backward-delete-char N) - (unless overwrite-mode - (skip-chars-forward "^|") - (insert " ") - (goto-char (1- pos))) - ;; noalign: if there were two spaces at the end, this field - ;; does not determine the width of the column. - (when noalign (setq org-table-may-need-update c))) + (not (eq (char-before) ?|)) + (save-excursion (skip-chars-backward " \t") (not (bolp))) + (looking-at-p ".*?|") + (org-at-table-p)) + (progn (forward-char -1) (org-delete-char 1)) (backward-delete-char N) (org-fix-tags-on-the-fly)))) @@ -20015,23 +19476,28 @@ because, in this case the deletion might narrow the column." (interactive "p") (save-match-data (org-check-before-invisible-edit 'delete) - (if (and (org-at-table-p) - (not (bolp)) - (not (= (char-after) ?|)) - (eq N 1)) - (if (looking-at ".*?|") - (let ((pos (point)) - (noalign (looking-at "[^|\n\r]* |")) - (c org-table-may-need-update)) - (replace-match - (concat (substring (match-string 0) 1 -1) " |") nil t) - (goto-char pos) - ;; noalign: if there were two spaces at the end, this field - ;; does not determine the width of the column. - (when noalign (setq org-table-may-need-update c))) - (delete-char N)) + (cond + ((or (/= N 1) + (eq (char-after) ?|) + (save-excursion (skip-chars-backward " \t") (bolp)) + (not (org-at-table-p))) (delete-char N) - (org-fix-tags-on-the-fly)))) + (org-fix-tags-on-the-fly)) + ((looking-at ".\\(.*?\\)|") + (let* ((update? org-table-may-need-update) + (noalign (looking-at-p ".*? |"))) + (delete-char 1) + (org-table-with-shrunk-field + (save-excursion + ;; Last space is `org-table-separator-space', so insert + ;; a regular one before it instead. + (goto-char (- (match-end 0) 2)) + (insert " "))) + ;; If there were two spaces at the end, this field does not + ;; determine the width of the column. + (when noalign (setq org-table-may-need-update update?)))) + (t + (delete-char N))))) ;; Make `delete-selection-mode' work with Org mode and Orgtbl mode (put 'org-self-insert-command 'delete-selection @@ -20064,7 +19530,6 @@ word constituents." (interactive) (with-syntax-table org-mode-transpose-word-syntax-table (call-interactively 'transpose-words))) -(org-remap org-mode-map 'transpose-words 'org-transpose-words) (defvar org-ctrl-c-ctrl-c-hook nil "Hook for functions attaching themselves to `C-c C-c'. @@ -20382,12 +19847,20 @@ for more information." (cond ((run-hook-with-args-until-success 'org-metaup-hook)) ((org-region-active-p) - (let* ((a (min (region-beginning) (region-end))) - (b (1- (max (region-beginning) (region-end)))) - (c (save-excursion (goto-char a) - (move-beginning-of-line 0))) - (d (save-excursion (goto-char a) - (move-end-of-line 0) (point)))) + (let* ((a (save-excursion + (goto-char (min (region-beginning) (region-end))) + (line-beginning-position))) + (b (save-excursion + (goto-char (max (region-beginning) (region-end))) + (if (bolp) (1- (point)) (line-end-position)))) + (c (save-excursion + (goto-char a) + (move-beginning-of-line 0) + (point))) + (d (save-excursion + (goto-char a) + (move-end-of-line 0) + (point)))) (transpose-regions a b c d) (goto-char c))) ((org-at-table-p) (org-call-with-arg 'org-table-move-row 'up)) @@ -20404,12 +19877,20 @@ commands for more information." (cond ((run-hook-with-args-until-success 'org-metadown-hook)) ((org-region-active-p) - (let* ((a (min (region-beginning) (region-end))) - (b (max (region-beginning) (region-end))) - (c (save-excursion (goto-char b) - (move-beginning-of-line 1))) - (d (save-excursion (goto-char b) - (move-end-of-line 1) (1+ (point))))) + (let* ((a (save-excursion + (goto-char (min (region-beginning) (region-end))) + (line-beginning-position))) + (b (save-excursion + (goto-char (max (region-beginning) (region-end))) + (if (bolp) (1- (point)) (line-end-position)))) + (c (save-excursion + (goto-char b) + (move-beginning-of-line (if (bolp) 1 2)) + (point))) + (d (save-excursion + (goto-char b) + (move-end-of-line (if (bolp) 1 2)) + (point)))) (transpose-regions a b c d) (goto-char d))) ((org-at-table-p) (call-interactively 'org-table-move-row)) @@ -20470,7 +19951,7 @@ depending on context. See the individual commands for more information." Depending on context, this does one of the following: - switch a timestamp at point one day into the future -- on a headline, switch to the next TODO keyword. +- on a headline, switch to the next TODO keyword - on an item, switch entire list to the next bullet type - on a property line, switch to the next allowed value - on a clocktable definition line, move time block into the future" @@ -20591,7 +20072,7 @@ this numeric value." (unless inc (setq inc 1)) (let ((pos (point)) (beg (skip-chars-backward "-+^/*0-9eE.")) - (end (skip-chars-forward "-+^/*0-9eE^.")) nap) + (end (skip-chars-forward "-+^/*0-9eE.")) nap) (setq nap (buffer-substring-no-properties (+ pos beg) (+ pos beg end))) (delete-region (+ pos beg) (+ pos beg end)) @@ -20635,7 +20116,9 @@ this numeric value." (let ((next (next-single-char-property-change beg 'invisible nil end))) (setq result (concat result (buffer-substring beg next))) (setq beg next))) - (kill-new result))) + (setq deactivate-mark t) + (kill-new result) + (message "Visible strings have been copied to the kill ring."))) (defun org-copy-special () "Copy region in table or copy current subtree. @@ -20670,7 +20153,10 @@ When in a fixed-width region, call `org-edit-fixed-width-region'. When in an export block, call `org-edit-export-block'. When in a LaTeX environment, call `org-edit-latex-environment'. When at an #+INCLUDE keyword, visit the included file. -When at a footnote reference, call `org-edit-footnote-reference' +When at a footnote reference, call `org-edit-footnote-reference'. +When at a planning line call, `org-deadline' and/or `org-schedule'. +When at an active timestamp, call `org-time-stamp'. +When at an inactive timestamp, call `org-time-stamp-inactive'. On a link, call `ffap' to visit the link at point. Otherwise, return a user error." (interactive "P") @@ -20684,28 +20170,25 @@ Otherwise, return a user error." (params (nth 2 info)) (session (cdr (assq :session params)))) (if (not session) (org-edit-src-code) - ;; At a src-block with a session and function called with - ;; an ARG: switch to the buffer related to the inferior - ;; process. + ;; At a source block with a session and function called + ;; with an ARG: switch to the buffer related to the + ;; inferior process. (switch-to-buffer (funcall (intern (concat "org-babel-prep-session:" lang)) session params)))))) (`keyword - (if (member (org-element-property :key element) '("INCLUDE" "SETUPFILE")) - (org-open-link-from-string - (format "[[%s]]" - (expand-file-name - (let ((value (org-element-property :value element))) - (cond ((org-file-url-p value) - (user-error "The file is specified as a URL, cannot be edited")) - ((not (org-string-nw-p value)) - (user-error "No file to edit")) - ((string-match "\\`\"\\(.*?\\)\"" value) - (match-string 1 value)) - ((string-match "\\`[^ \t\"]\\S-*" value) - (match-string 0 value)) - (t (user-error "No valid file specified"))))))) - (user-error "No special environment to edit here"))) + (unless (member (org-element-property :key element) + '("INCLUDE" "SETUPFILE")) + (user-error "No special environment to edit here")) + (let ((value (org-element-property :value element))) + (unless (org-string-nw-p value) (user-error "No file to edit")) + (let ((file (and (string-match "\\`\"\\(.*?\\)\"\\|\\S-+" value) + (or (match-string 1 value) + (match-string 0 value))))) + (when (org-file-url-p file) + (user-error "Files located with a URL cannot be edited")) + (org-open-link-from-string + (format "[[%s]]" (expand-file-name file)))))) (`table (if (eq (org-element-property :type element) 'table.el) (org-edit-table.el) @@ -20716,6 +20199,13 @@ Otherwise, return a user error." (`export-block (org-edit-export-block)) (`fixed-width (org-edit-fixed-width-region)) (`latex-environment (org-edit-latex-environment)) + (`planning + (let ((proplist (cadr element))) + (mapc #'call-interactively + (remq nil + (list + (when (plist-get proplist :deadline) #'org-deadline) + (when (plist-get proplist :scheduled) #'org-schedule)))))) (_ ;; No notable element at point. Though, we may be at a link or ;; a footnote reference, which are objects. Thus, scan deeper. @@ -20723,6 +20213,9 @@ Otherwise, return a user error." (pcase (org-element-type context) (`footnote-reference (org-edit-footnote-reference)) (`inline-src-block (org-edit-inline-src-code)) + (`timestamp (if (eq 'inactive (org-element-property :type context)) + (call-interactively #'org-time-stamp-inactive) + (call-interactively #'org-time-stamp))) (`link (call-interactively #'ffap)) (_ (user-error "No special environment to edit here")))))))) @@ -20807,7 +20300,7 @@ This command does many different things, depending on context: ;; Act according to type of element or object at point. ;; ;; Do nothing on a blank line, except if it is contained in - ;; a src block. Hence, we first check if point is in such + ;; a source block. Hence, we first check if point is in such ;; a block and then if it is at a blank line. (pcase type ((or `inline-src-block `src-block) @@ -20834,7 +20327,7 @@ This command does many different things, depending on context: (`footnote-reference (call-interactively #'org-footnote-action)) ((or `headline `inlinetask) (save-excursion (goto-char (org-element-property :begin context)) - (call-interactively #'org-set-tags))) + (call-interactively #'org-set-tags-command))) (`item ;; At an item: `C-u C-u' sets checkbox to "[-]" ;; unconditionally, whereas `C-u' will toggle its presence. @@ -20888,7 +20381,6 @@ This command does many different things, depending on context: ;; first item in the list. Without an argument, repair the ;; list. (let* ((begin (org-element-property :contents-begin context)) - (beginm (move-marker (make-marker) begin)) (struct (org-element-property :structure context)) (old-struct (copy-tree struct)) (first-box (save-excursion @@ -20910,10 +20402,12 @@ This command does many different things, depending on context: ;; item of the list and no argument is provided, simply ;; toggle checkbox of that item, if any. (org-list-set-checkbox begin struct new-box))) - (org-list-write-struct - struct (org-list-parents-alist struct) old-struct) - (org-update-checkbox-count-maybe) - (save-excursion (goto-char beginm) (org-list-send-list 'maybe)))) + (when (equal + (org-list-write-struct + struct (org-list-parents-alist struct) old-struct) + old-struct) + (message "Cannot update this checkbox")) + (org-update-checkbox-count-maybe))) ((or `property-drawer `node-property) (call-interactively #'org-property-action)) (`radio-target @@ -20948,7 +20442,7 @@ Use `\\[org-edit-special]' to edit table.el tables")) ((and `nil (guard (org-at-heading-p))) ;; When point is on an unsupported object type, we can miss ;; the fact that it also is at a heading. Handle it here. - (call-interactively #'org-set-tags)) + (call-interactively #'org-set-tags-command)) ((guard (run-hook-with-args-until-success 'org-ctrl-c-ctrl-c-final-hook))) (_ @@ -20970,9 +20464,12 @@ Use `\\[org-edit-special]' to edit table.el tables")) "Abort storing current note, or call `outline-show-branches'." (interactive) (if (not org-finish-function) - (progn - (outline-hide-subtree) - (call-interactively 'outline-show-branches)) + (save-excursion + (save-restriction + (org-narrow-to-subtree) + (org-flag-subtree t) + (call-interactively 'outline-show-branches) + (org-hide-archived-subtrees (point-min) (point-max)))) (let ((org-note-abort t)) (funcall org-finish-function)))) @@ -21005,7 +20502,7 @@ With a non-nil optional argument, join it to the following one." ;; Adjust alignment of tags. (cond ((not tags-column)) ;no tags - (org-auto-align-tags (org-set-tags nil t)) + (org-auto-align-tags (org-align-tags)) (t (org--align-tags-here tags-column)))) ;preserve tags column (delete-indentation arg))) @@ -21036,26 +20533,37 @@ object (e.g., within a comment). In these case, you need to use (let ((context (if org-return-follows-link (org-element-context) (org-element-at-point)))) (cond - ;; In a table, call `org-table-next-row'. - ((or (and (eq (org-element-type context) 'table) + ;; In a table, call `org-table-next-row'. However, before first + ;; column or after last one, split the table. + ((or (and (eq 'table (org-element-type context)) + (not (eq 'table.el (org-element-property :type context))) (>= (point) (org-element-property :contents-begin context)) (< (point) (org-element-property :contents-end context))) (org-element-lineage context '(table-row table-cell) t)) - (org-table-justify-field-maybe) - (call-interactively #'org-table-next-row)) + (if (or (looking-at-p "[ \t]*$") + (save-excursion (skip-chars-backward " \t") (bolp))) + (insert "\n") + (org-table-justify-field-maybe) + (call-interactively #'org-table-next-row))) ;; On a link or a timestamp, call `org-open-at-point' if ;; `org-return-follows-link' allows it. Tolerate fuzzy ;; locations, e.g., in a comment, as `org-open-at-point'. ((and org-return-follows-link - (or (org-in-regexp org-ts-regexp-both nil t) + (or (and (eq 'link (org-element-type context)) + ;; Ensure point is not on the white spaces after + ;; the link. + (let ((origin (point))) + (org-with-point-at (org-element-property :end context) + (skip-chars-backward " \t") + (> (point) origin)))) + (org-in-regexp org-ts-regexp-both nil t) (org-in-regexp org-tsr-regexp-both nil t) (org-in-regexp org-any-link-re nil t))) (call-interactively #'org-open-at-point)) ;; Insert newline in heading, but preserve tags. ((and (not (bolp)) - (save-excursion (beginning-of-line) - (let ((case-fold-search nil)) - (looking-at org-complex-heading-regexp)))) + (let ((case-fold-search nil)) + (org-match-line org-complex-heading-regexp))) ;; At headline. Split line. However, if point is on keyword, ;; priority cookie or tags, do not break any of them: add ;; a newline after the headline instead. @@ -21068,7 +20576,7 @@ object (e.g., within a comment). In these case, you need to use ;; Adjust tag alignment. (cond ((not (and tags-column string))) - (org-auto-align-tags (org-set-tags nil t)) + (org-auto-align-tags (org-align-tags)) (t (org--align-tags-here tags-column))) ;preserve tags column (end-of-line) (org-show-entry) @@ -21082,7 +20590,13 @@ object (e.g., within a comment). In these case, you need to use (delete-and-extract-region (point) (line-end-position)))) (newline-and-indent) (save-excursion (insert trailing-data)))) - (t (if indent (newline-and-indent) (newline)))))) + (t + ;; Do not auto-fill when point is in an Org property drawer. + (let ((auto-fill-function (and (not (org-at-property-p)) + auto-fill-function))) + (if indent + (newline-and-indent) + (newline))))))) (defun org-return-indent () "Goto next table row or insert a newline and indent. @@ -21091,6 +20605,15 @@ context. See the individual commands for more information." (interactive) (org-return t)) +(defun org-ctrl-c-tab (&optional _arg) + "Toggle columns width in a table, or show children. +Call `org-table-toggle-column-width' if point is in a table. +Otherwise, call `org-show-children'." + (interactive "p") + (call-interactively + (if (org-at-table-p) #'org-table-toggle-column-width + #'org-show-children))) + (defun org-ctrl-c-star () "Compute table, or change heading status of lines. Calls `org-table-recalculate' or `org-toggle-heading', @@ -21250,7 +20773,8 @@ an argument, unconditionally call `org-insert-heading'." ["Move Column Left" org-metaleft (org-at-table-p)] ["Move Column Right" org-metaright (org-at-table-p)] ["Delete Column" org-shiftmetaleft (org-at-table-p)] - ["Insert Column" org-shiftmetaright (org-at-table-p)]) + ["Insert Column" org-shiftmetaright (org-at-table-p)] + ["Shrink Column" org-table-toggle-column-width (org-at-table-p)]) ("Row" ["Move Row Up" org-metaup (org-at-table-p)] ["Move Row Down" org-metadown (org-at-table-p)] @@ -21305,7 +20829,7 @@ an argument, unconditionally call `org-insert-heading'." ["Cycle Global Visibility" org-shifttab :active (not (org-at-table-p))] ["Sparse Tree..." org-sparse-tree t] ["Reveal Context" org-reveal t] - ["Show All" outline-show-all t] + ["Show All" org-show-all t] "--" ["Subtree to indirect buffer" org-tree-to-indirect-buffer t]) "--" @@ -21383,7 +20907,7 @@ an argument, unconditionally call `org-insert-heading'." ["Next keyword set" org-shiftcontrolright (and (> (length org-todo-sets) 1) (org-at-heading-p))] ["Previous keyword set" org-shiftcontrolright (and (> (length org-todo-sets) 1) (org-at-heading-p))]) ["Show TODO Tree" org-show-todo-tree :active t :keys "C-c / t"] - ["Global TODO list" org-todo-list :active t :keys "C-c a t"] + ["Global TODO list" org-todo-list :active t :keys "\\[org-agenda] t"] "--" ["Enforce dependencies" (customize-variable 'org-enforce-todo-dependencies) :selected org-enforce-todo-dependencies :style toggle :active t] @@ -21462,8 +20986,8 @@ an argument, unconditionally call `org-insert-heading'." "--" ["Export/Publish..." org-export-dispatch t] ("LaTeX" - ["Org CDLaTeX mode" org-cdlatex-mode :style toggle - :selected org-cdlatex-mode] + ["Org CDLaTeX mode" org-cdlatex-mode :active (require 'cdlatex nil t) + :style toggle :selected org-cdlatex-mode] ["Insert Environment" cdlatex-environment (fboundp 'cdlatex-environment)] ["Insert math symbol" cdlatex-math-symbol (fboundp 'cdlatex-math-symbol)] ["Modify math symbol" org-cdlatex-math-modify @@ -21473,13 +20997,14 @@ an argument, unconditionally call `org-insert-heading'." ("MobileOrg" ["Push Files and Views" org-mobile-push t] ["Get Captured and Flagged" org-mobile-pull t] - ["Find FLAGGED Tasks" (org-agenda nil "?") :active t :keys "C-c a ?"] + ["Find FLAGGED Tasks" (org-agenda nil "?") :active t :keys "\\[org-agenda] ?"] "--" ["Setup" (progn (require 'org-mobile) (customize-group 'org-mobile)) t]) "--" ("Documentation" ["Show Version" org-version t] - ["Info Documentation" org-info t]) + ["Info Documentation" org-info t] + ["Browse Org News" org-browse-news t]) ("Customize" ["Browse Org Group" org-customize t] "--" @@ -21490,8 +21015,7 @@ an argument, unconditionally call `org-insert-heading'." ("Refresh/Reload" ["Refresh setup current buffer" org-mode-restart t] ["Reload Org (after update)" org-reload t] - ["Reload Org uncompiled" (org-reload t) :active t :keys "C-u C-c C-x !"]) - )) + ["Reload Org uncompiled" (org-reload t) :active t :keys "C-u C-c C-x !"]))) (defun org-info (&optional node) "Read documentation for Org in the info system. @@ -21499,6 +21023,11 @@ With optional NODE, go directly to that node." (interactive) (info (format "(org)%s" (or node "")))) +(defun org-browse-news () + "Browse the news for the latest major release." + (interactive) + (browse-url "https://orgmode.org/Changes.html")) + ;;;###autoload (defun org-submit-bug-report () "Submit a bug report on Org via mail. @@ -21551,7 +21080,7 @@ such private information before sending the email.") "Remember to cover the basics, that is, what you expected to happen and what in fact did happen. You don't know how to make a good report? See - http://orgmode.org/manual/Feedback.html#Feedback + https://orgmode.org/manual/Feedback.html#Feedback Your bug report will be posted to the Org mailing list. ------------------------------------------------------------------------") @@ -21591,7 +21120,7 @@ Your bug report will be posted to the Org mailing list. ;;;###autoload (defun org-reload (&optional uncompiled) - "Reload all org lisp files. + "Reload all Org Lisp files. With prefix arg UNCOMPILED, load the uncompiled versions." (interactive "P") (require 'loadhist) @@ -21671,25 +21200,25 @@ With prefix arg UNCOMPILED, load the uncompiled versions." ;;; Generally useful functions -(defun org-get-at-eol (property n) - "Get text property PROPERTY at the end of line less N characters." - (get-text-property (- (point-at-eol) n) property)) - -(defun org-find-text-property-in-string (prop s) - "Return the first non-nil value of property PROP in string S." - (or (get-text-property 0 prop s) - (get-text-property (or (next-single-property-change 0 prop s) 0) - prop s))) - -(defun org-display-warning (message) - "Display the given MESSAGE as a warning." - (display-warning 'org message :warning)) +(defun org-link-display-format (s) + "Replace links in string S with their description. +If there is no description, use the link target." + (save-match-data + (replace-regexp-in-string + org-bracket-link-analytic-regexp + (lambda (m) + (if (match-end 5) (match-string 5 m) + (concat (match-string 1 m) (match-string 3 m)))) + s nil t))) -(defun org-eval (form) - "Eval FORM and return result." - (condition-case error - (eval form) - (error (format "%%![Error: %s]" error)))) +(defun org-toggle-link-display () + "Toggle the literal or descriptive display of links." + (interactive) + (if org-descriptive-links + (remove-from-invisibility-spec '(org-link)) + (add-to-invisibility-spec '(org-link))) + (org-restart-font-lock) + (setq org-descriptive-links (not org-descriptive-links))) (defun org-in-clocktable-p () "Check if the cursor is in a clocktable." @@ -21708,27 +21237,6 @@ With prefix arg UNCOMPILED, load the uncompiled versions." (>= (point) (match-beginning 3)) (<= (point) (match-end 4))))) -(defun org-overlay-display (ovl text &optional face evap) - "Make overlay OVL display TEXT with face FACE." - (overlay-put ovl 'display text) - (if face (overlay-put ovl 'face face)) - (if evap (overlay-put ovl 'evaporate t))) - -(defun org-overlay-before-string (ovl text &optional face evap) - "Make overlay OVL display TEXT with face FACE." - (if face (org-add-props text nil 'face face)) - (overlay-put ovl 'before-string text) - (if evap (overlay-put ovl 'evaporate t))) - -(defun org-find-overlays (prop &optional pos delete) - "Find all overlays specifying PROP at POS or point. -If DELETE is non-nil, delete all those overlays." - (let (found) - (dolist (ov (overlays-at (or pos (point))) found) - (cond ((not (overlay-get ov prop))) - (delete (delete-overlay ov)) - (t (push ov found)))))) - (defun org-goto-marker-or-bmk (marker &optional bookmark) "Go to MARKER, widen if necessary. When marker is not live, try BOOKMARK." (if (and marker (marker-buffer marker) @@ -21754,105 +21262,6 @@ If DELETE is non-nil, delete all those overlays." (interactive "p") (self-insert-command N)) -(defun org-shorten-string (s maxlength) - "Shorten string S so that it is no longer than MAXLENGTH characters. -If the string is shorter or has length MAXLENGTH, just return the -original string. If it is longer, the functions finds a space in the -string, breaks this string off at that locations and adds three dots -as ellipsis. Including the ellipsis, the string will not be longer -than MAXLENGTH. If finding a good breaking point in the string does -not work, the string is just chopped off in the middle of a word -if necessary." - (if (<= (length s) maxlength) - s - (let* ((n (max (- maxlength 4) 1)) - (re (concat "\\`\\(.\\{1," (int-to-string n) "\\}[^ ]\\)\\([ ]\\|\\'\\)"))) - (if (string-match re s) - (concat (match-string 1 s) "...") - (concat (substring s 0 (max (- maxlength 3) 0)) "..."))))) - -(defun org-get-indentation (&optional line) - "Get the indentation of the current line, interpreting tabs. -When LINE is given, assume it represents a line and compute its indentation." - (if line - (when (string-match "^ *" (org-remove-tabs line)) - (match-end 0)) - (save-excursion - (beginning-of-line 1) - (skip-chars-forward " \t") - (current-column)))) - -(defun org-get-string-indentation (s) - "What indentation has S due to SPACE and TAB at the beginning of the string?" - (let ((n -1) (i 0) (w tab-width) c) - (catch 'exit - (while (< (setq n (1+ n)) (length s)) - (setq c (aref s n)) - (cond ((= c ?\ ) (setq i (1+ i))) - ((= c ?\t) (setq i (* (/ (+ w i) w) w))) - (t (throw 'exit t))))) - i)) - -(defun org-remove-tabs (s &optional width) - "Replace tabulators in S with spaces. -Assumes that s is a single line, starting in column 0." - (setq width (or width tab-width)) - (while (string-match "\t" s) - (setq s (replace-match - (make-string - (- (* width (/ (+ (match-beginning 0) width) width)) - (match-beginning 0)) ?\ ) - t t s))) - s) - -(defun org-fix-indentation (line ind) - "Fix indentation in LINE. -IND is a cons cell with target and minimum indentation. -If the current indentation in LINE is smaller than the minimum, -leave it alone. If it is larger than ind, set it to the target." - (let* ((l (org-remove-tabs line)) - (i (org-get-indentation l)) - (i1 (car ind)) (i2 (cdr ind))) - (when (>= i i2) (setq l (substring line i2))) - (if (> i1 0) - (concat (make-string i1 ?\ ) l) - l))) - -(defun org-remove-indentation (code &optional n) - "Remove maximum common indentation in string CODE and return it. -N may optionally be the number of columns to remove. Return CODE -as-is if removal failed." - (with-temp-buffer - (insert code) - (if (org-do-remove-indentation n) (buffer-string) code))) - -(defun org-do-remove-indentation (&optional n) - "Remove the maximum common indentation from the buffer. -When optional argument N is a positive integer, remove exactly -that much characters from indentation, if possible. Return nil -if it fails." - (catch :exit - (goto-char (point-min)) - ;; Find maximum common indentation, if not specified. - (let ((n (or n - (let ((min-ind (point-max))) - (save-excursion - (while (re-search-forward "^[ \t]*\\S-" nil t) - (let ((ind (1- (current-column)))) - (if (zerop ind) (throw :exit nil) - (setq min-ind (min min-ind ind)))))) - min-ind)))) - (if (zerop n) (throw :exit nil) - ;; Remove exactly N indentation, but give up if not possible. - (while (not (eobp)) - (let ((ind (progn (skip-chars-forward " \t") (current-column)))) - (cond ((eolp) (delete-region (line-beginning-position) (point))) - ((< ind n) (throw :exit nil)) - (t (indent-line-to (- ind n)))) - (forward-line))) - ;; Signal success. - t)))) - (defun org-fill-template (template alist) "Find each %key of ALIST in TEMPLATE and replace it." (let ((case-fold-search nil)) @@ -21864,48 +21273,6 @@ if it fails." (or (cdr entry) "") template t t))) template)) -(defun org-base-buffer (buffer) - "Return the base buffer of BUFFER, if it has one. Else return the buffer." - (if (not buffer) - buffer - (or (buffer-base-buffer buffer) - buffer))) - -(defun org-wrap (string &optional width lines) - "Wrap string to either a number of lines, or a width in characters. -If WIDTH is non-nil, the string is wrapped to that width, however many lines -that costs. If there is a word longer than WIDTH, the text is actually -wrapped to the length of that word. -IF WIDTH is nil and LINES is non-nil, the string is forced into at most that -many lines, whatever width that takes. -The return value is a list of lines, without newlines at the end." - (let* ((words (split-string string)) - (maxword (apply 'max (mapcar 'org-string-width words))) - w ll) - (cond (width - (org-do-wrap words (max maxword width))) - (lines - (setq w maxword) - (setq ll (org-do-wrap words maxword)) - (if (<= (length ll) lines) - ll - (setq ll words) - (while (> (length ll) lines) - (setq w (1+ w)) - (setq ll (org-do-wrap words w))) - ll)) - (t (error "Cannot wrap this"))))) - -(defun org-do-wrap (words width) - "Create lines of maximum width WIDTH (in characters) from word list WORDS." - (let (lines line) - (while words - (setq line (pop words)) - (while (and words (< (+ (length line) (length (car words))) width)) - (setq line (concat line " " (pop words)))) - (setq lines (push line lines))) - (nreverse lines))) - (defun org-quote-vert (s) "Replace \"|\" with \"\\vert\"." (while (string-match "|" s) @@ -21918,8 +21285,8 @@ The return value is a list of lines, without newlines at the end." (defun org-in-src-block-p (&optional inside) "Whether point is in a code source block. -When INSIDE is non-nil, don't consider we are within a src block -when point is at #+BEGIN_SRC or #+END_SRC." +When INSIDE is non-nil, don't consider we are within a source +block when point is at #+BEGIN_SRC or #+END_SRC." (let ((case-fold-search t)) (or (and (eq (get-char-property (point) 'src-block) t)) (and (not inside) @@ -22047,28 +21414,6 @@ and :keyword." (setq clist (nreverse (delq nil clist))) clist)) -(defun org-in-regexp (regexp &optional nlines visually) - "Check if point is inside a match of REGEXP. - -Normally only the current line is checked, but you can include -NLINES extra lines around point into the search. If VISUALLY is -set, require that the cursor is not after the match but really -on, so that the block visually is on the match. - -Return nil or a cons cell (BEG . END) where BEG and END are, -respectively, the positions at the beginning and the end of the -match." - (catch :exit - (let ((pos (point)) - (eol (line-end-position (if nlines (1+ nlines) 1)))) - (save-excursion - (beginning-of-line (- 1 (or nlines 0))) - (while (and (re-search-forward regexp eol t) - (<= (match-beginning 0) pos)) - (let ((end (match-end 0))) - (when (or (> end pos) (and (= end pos) (not visually))) - (throw :exit (cons (match-beginning 0) (match-end 0)))))))))) - (defun org-between-regexps-p (start-re end-re &optional lim-up lim-down) "Non-nil when point is between matches of START-RE and END-RE. @@ -22160,40 +21505,6 @@ for the search purpose." (error "Unable to create a link to here")))) (org-occur-in-agenda-files (regexp-quote link)))) -(defun org-reverse-string (string) - "Return the reverse of STRING." - (apply 'string (reverse (string-to-list string)))) - -;; defsubst org-uniquify must be defined before first use - -(defun org-uniquify-alist (alist) - "Merge elements of ALIST with the same key. - -For example, in this alist: - -\(org-uniquify-alist \\='((a 1) (b 2) (a 3))) - => \\='((a 1 3) (b 2)) - -merge (a 1) and (a 3) into (a 1 3). - -The function returns the new ALIST." - (let (rtn) - (dolist (e alist rtn) - (let (n) - (if (not (assoc (car e) rtn)) - (push e rtn) - (setq n (cons (car e) (append (cdr (assoc (car e) rtn)) (cdr e)))) - (setq rtn (assq-delete-all (car e) rtn)) - (push n rtn)))))) - -(defun org-delete-all (elts list) - "Remove all elements in ELTS from LIST. -Comparison is done with `equal'. It is a destructive operation -that may remove elements by altering the list structure." - (while elts - (setq list (delete (pop elts) list))) - list) - (defun org-back-over-empty-lines () "Move backwards over whitespace, to the beginning of the first empty line. Returns the number of empty lines passed." @@ -22206,42 +21517,6 @@ Returns the number of empty lines passed." (goto-char (min (point) pos)) (count-lines (point) pos))) -(defun org-skip-whitespace () - (skip-chars-forward " \t\n\r")) - -(defun org-point-in-group (point group &optional context) - "Check if POINT is in match-group GROUP. -If CONTEXT is non-nil, return a list with CONTEXT and the boundaries of the -match. If the match group does not exist or point is not inside it, -return nil." - (and (match-beginning group) - (>= point (match-beginning group)) - (<= point (match-end group)) - (if context - (list context (match-beginning group) (match-end group)) - t))) - -(defun org-switch-to-buffer-other-window (&rest args) - "Switch to buffer in a second window on the current frame. -In particular, do not allow pop-up frames. -Returns the newly created buffer." - (org-no-popups - (apply 'switch-to-buffer-other-window args))) - -(defun org-combine-plists (&rest plists) - "Create a single property list from all plists in PLISTS. -The process starts by copying the first list, and then setting properties -from the other lists. Settings in the last list are the most significant -ones and overrule settings in the other lists." - (let ((rtn (copy-sequence (pop plists))) - p v ls) - (while plists - (setq ls (pop plists)) - (while ls - (setq p (pop ls) v (pop ls)) - (setq rtn (plist-put rtn p v)))) - rtn)) - (defun org-replace-escapes (string table) "Replace %-escapes in STRING with values in TABLE. TABLE is an association list with keys like \"%a\" and string values. @@ -22269,15 +21544,6 @@ so values can contain further %-escapes if they are define later in TABLE." (setq string (replace-match sref t t string))))) string)) -(defun org-find-base-buffer-visiting (file) - "Like `find-buffer-visiting' but always return the base buffer and -not an indirect buffer." - (let ((buf (or (get-file-buffer file) - (find-buffer-visiting file)))) - (if buf - (or (buffer-base-buffer buf) buf) - nil))) - ;;; TODO: Only called once, from ox-odt which should probably use ;;; org-export-inline-image-p or something. (defun org-file-image-p (file) @@ -22328,73 +21594,6 @@ hierarchy of headlines by UP levels before marking the subtree." (call-interactively 'org-mark-element) (org-mark-element))) -(defun org-file-newer-than-p (file time) - "Non-nil if FILE is newer than TIME. -FILE is a filename, as a string, TIME is a list of integers, as -returned by, e.g., `current-time'." - (and (file-exists-p file) - ;; Only compare times up to whole seconds as some file-systems - ;; (e.g. HFS+) do not retain any finer granularity. As - ;; a consequence, make sure we return non-nil when the two - ;; times are equal. - (not (time-less-p (cl-subseq (nth 5 (file-attributes file)) 0 2) - (cl-subseq time 0 2))))) - -(defun org-compile-file (source process ext &optional err-msg log-buf spec) - "Compile a SOURCE file using PROCESS. - -PROCESS is either a function or a list of shell commands, as -strings. EXT is a file extension, without the leading dot, as -a string. It is used to check if the process actually succeeded. - -PROCESS must create a file with the same base name and directory -as SOURCE, but ending with EXT. The function then returns its -filename. Otherwise, it raises an error. The error message can -then be refined by providing string ERR-MSG, which is appended to -the standard message. - -If PROCESS is a function, it is called with a single argument: -the SOURCE file. - -If it is a list of commands, each of them is called using -`shell-command'. By default, in each command, %b, %f, %F, %o and -%O are replaced with, respectively, SOURCE base name, name, full -name, directory and absolute output file name. It is possible, -however, to use more place-holders by specifying them in optional -argument SPEC, as an alist following the pattern - - (CHARACTER . REPLACEMENT-STRING). - -When PROCESS is a list of commands, optional argument LOG-BUF can -be set to a buffer or a buffer name. `shell-command' then uses -it for output." - (let* ((base-name (file-name-base source)) - (full-name (file-truename source)) - (out-dir (or (file-name-directory source) "./")) - (output (expand-file-name (concat base-name "." ext) out-dir)) - (time (current-time)) - (err-msg (if (stringp err-msg) (concat ". " err-msg) ""))) - (save-window-excursion - (pcase process - ((pred functionp) (funcall process (shell-quote-argument source))) - ((pred consp) - (let ((log-buf (and log-buf (get-buffer-create log-buf))) - (spec (append spec - `((?b . ,(shell-quote-argument base-name)) - (?f . ,(shell-quote-argument source)) - (?F . ,(shell-quote-argument full-name)) - (?o . ,(shell-quote-argument out-dir)) - (?O . ,(shell-quote-argument output)))))) - (dolist (command process) - (shell-command (format-spec command spec) log-buf)) - (when log-buf (with-current-buffer log-buf (compilation-mode))))) - (_ (error "No valid command to process %S%s" source err-msg)))) - ;; Check for process failure. Output file is expected to be - ;; located in the same directory as SOURCE. - (unless (org-file-newer-than-p output time) - (error (format "File %S wasn't produced%s" output err-msg))) - output)) - ;;; Indentation (defvar org-element-greater-elements) @@ -22418,7 +21617,7 @@ ELEMENT." ((item plain-list) (org-list-item-body-column post-affiliated)) (t (goto-char start) - (org-get-indentation)))) + (current-indentation)))) ((memq type '(headline inlinetask nil)) (if (org-match-line "[ \t]*$") (org--get-expected-indentation element t) @@ -22451,7 +21650,7 @@ ELEMENT." (setq start (org-element-property :begin previous))) (t (goto-char (org-element-property :begin previous)) (throw 'exit - (if (bolp) (org-get-indentation) + (if (bolp) (current-indentation) ;; At first paragraph in an item or ;; a footnote definition. (org--get-expected-indentation @@ -22470,7 +21669,7 @@ ELEMENT." ((and (memq type '(footnote-definition plain-list)) (> (count-lines (point) pos) 2)) (goto-char start) - (org-get-indentation)) + (current-indentation)) ;; Line above is the first one of a paragraph at the ;; beginning of an item or a footnote definition. Indent ;; like parent. @@ -22497,9 +21696,9 @@ ELEMENT." (org--get-expected-indentation last (eq (org-element-type last) 'item))) (goto-char start) - (org-get-indentation))) + (current-indentation))) ;; In any other case, indent like the current line. - (t (org-get-indentation))))))))) + (t (current-indentation))))))))) (defun org--align-node-property () "Align node property at point. @@ -22560,10 +21759,6 @@ list structure. Instead, use \\`\\[org-shiftmetaleft]' or \ Also align node properties according to `org-property-format'." (interactive) (cond - (orgstruct-is-++ - (let ((indent-line-function - (cl-cadadr (assq 'indent-line-function org-fb-vars)))) - (indent-according-to-mode))) ((org-at-heading-p) 'noindent) (t (let* ((element (save-excursion (beginning-of-line) (org-element-at-point))) @@ -22639,7 +21834,7 @@ assumed to be significant there." (not (or org-src-preserve-indentation (org-element-property :preserve-indent element))))) - (let ((offset (- ind (org-get-indentation)))) + (let ((offset (- ind (current-indentation)))) (unless (zerop offset) (indent-rigidly (org-element-property :begin element) (org-element-property :end element) @@ -22695,7 +21890,7 @@ assumed to be significant there." ;; might break the list as a whole. On the other ;; hand, when at a plain list, indent it as a whole. (cond ((eq type 'plain-list) - (let ((offset (- ind (org-get-indentation)))) + (let ((offset (- ind (current-indentation)))) (unless (zerop offset) (indent-rigidly (org-element-property :begin element) (org-element-property :end element) @@ -22775,7 +21970,6 @@ assumed to be significant there." ;; `org-setup-filling' installs filling and auto-filling related ;; variables during `org-mode' initialization. -(defvar org-element-paragraph-separate) ; org-element.el (defun org-setup-filling () (require 'org-element) ;; Prevent auto-fill from inserting unwanted new items. @@ -22799,9 +21993,9 @@ assumed to be significant there." (defun org-fill-line-break-nobreak-p () "Non-nil when a new line at point would create an Org line break." (save-excursion - (skip-chars-backward "[ \t]") + (skip-chars-backward " \t") (skip-chars-backward "\\\\") - (looking-at "\\\\\\\\\\($\\|[^\\\\]\\)"))) + (looking-at "\\\\\\\\\\($\\|[^\\]\\)"))) (defun org-fill-paragraph-with-timestamp-nobreak-p () "Non-nil when a new line at point would split a timestamp." @@ -22814,78 +22008,64 @@ assumed to be significant there." ;; parenthesis can end up being parsed as a new list item. (looking-at-p "[ \t]*{{{n\\(?:([^\n)]*)\\)?}}}[.)]\\(?:$\\| \\)")) -(declare-function message-in-body-p "message" ()) (defvar orgtbl-line-start-regexp) ; From org-table.el (defun org-adaptive-fill-function () "Compute a fill prefix for the current line. Return fill prefix, as a string, or nil if current line isn't meant to be filled. For convenience, if `adaptive-fill-regexp' matches in paragraphs or comments, use it." - (catch 'exit - (when (derived-mode-p 'message-mode) - (save-excursion - (beginning-of-line) - (cond ((not (message-in-body-p)) (throw 'exit nil)) - ((looking-at-p org-table-line-regexp) (throw 'exit nil)) - ((looking-at message-cite-prefix-regexp) - (throw 'exit (match-string-no-properties 0))) - ((looking-at org-outline-regexp) - (throw 'exit (make-string (length (match-string 0)) ?\s)))))) - (org-with-wide-buffer - (unless (org-at-heading-p) - (let* ((p (line-beginning-position)) - (element (save-excursion - (beginning-of-line) - (org-element-at-point))) - (type (org-element-type element)) - (post-affiliated (org-element-property :post-affiliated element))) - (unless (< p post-affiliated) - (cl-case type - (comment + (org-with-wide-buffer + (unless (org-at-heading-p) + (let* ((p (line-beginning-position)) + (element (save-excursion + (beginning-of-line) + (org-element-at-point))) + (type (org-element-type element)) + (post-affiliated (org-element-property :post-affiliated element))) + (unless (< p post-affiliated) + (cl-case type + (comment + (save-excursion + (beginning-of-line) + (looking-at "[ \t]*") + (concat (match-string 0) "# "))) + (footnote-definition "") + ((item plain-list) + (make-string (org-list-item-body-column post-affiliated) ?\s)) + (paragraph + ;; Fill prefix is usually the same as the current line, + ;; unless the paragraph is at the beginning of an item. + (let ((parent (org-element-property :parent element))) (save-excursion (beginning-of-line) - (looking-at "[ \t]*") - (concat (match-string 0) "# "))) - (footnote-definition "") - ((item plain-list) - (make-string (org-list-item-body-column post-affiliated) ?\s)) - (paragraph - ;; Fill prefix is usually the same as the current line, - ;; unless the paragraph is at the beginning of an item. - (let ((parent (org-element-property :parent element))) - (save-excursion - (beginning-of-line) - (cond ((eq (org-element-type parent) 'item) - (make-string (org-list-item-body-column - (org-element-property :begin parent)) - ?\s)) - ((and adaptive-fill-regexp - ;; Locally disable - ;; `adaptive-fill-function' to let - ;; `fill-context-prefix' handle - ;; `adaptive-fill-regexp' variable. - (let (adaptive-fill-function) - (fill-context-prefix - post-affiliated - (org-element-property :end element))))) - ((looking-at "[ \t]+") (match-string 0)) - (t ""))))) - (comment-block - ;; Only fill contents if P is within block boundaries. - (let* ((cbeg (save-excursion (goto-char post-affiliated) - (forward-line) - (point))) - (cend (save-excursion - (goto-char (org-element-property :end element)) - (skip-chars-backward " \r\t\n") - (line-beginning-position)))) - (when (and (>= p cbeg) (< p cend)) - (if (save-excursion (beginning-of-line) (looking-at "[ \t]+")) - (match-string 0) - ""))))))))))) - -(declare-function message-goto-body "message" ()) -(defvar message-cite-prefix-regexp) ; From message.el + (cond ((eq (org-element-type parent) 'item) + (make-string (org-list-item-body-column + (org-element-property :begin parent)) + ?\s)) + ((and adaptive-fill-regexp + ;; Locally disable + ;; `adaptive-fill-function' to let + ;; `fill-context-prefix' handle + ;; `adaptive-fill-regexp' variable. + (let (adaptive-fill-function) + (fill-context-prefix + post-affiliated + (org-element-property :end element))))) + ((looking-at "[ \t]+") (match-string 0)) + (t ""))))) + (comment-block + ;; Only fill contents if P is within block boundaries. + (let* ((cbeg (save-excursion (goto-char post-affiliated) + (forward-line) + (point))) + (cend (save-excursion + (goto-char (org-element-property :end element)) + (skip-chars-backward " \r\t\n") + (line-beginning-position)))) + (when (and (>= p cbeg) (< p cend)) + (if (save-excursion (beginning-of-line) (looking-at "[ \t]+")) + (match-string 0) + "")))))))))) (defun org-fill-element (&optional justify) "Fill element at point, when applicable. @@ -22909,7 +22089,7 @@ a footnote definition, try to fill the first paragraph within." ;; First check if point is in a blank line at the beginning of ;; the buffer. In that case, ignore filling. (cl-case (org-element-type element) - ;; Use major mode filling function is src blocks. + ;; Use major mode filling function is source blocks. (src-block (org-babel-do-key-sequence-in-edit-buffer (kbd "M-q"))) ;; Align Org tables, leave table.el tables as-is. (table-row (org-table-align) t) @@ -22927,15 +22107,6 @@ a footnote definition, try to fill the first paragraph within." (org-element-property :contents-end element)))) ;; Do nothing if point is at an affiliated keyword. (if (< (line-end-position) beg) t - (when (derived-mode-p 'message-mode) - ;; In `message-mode', do not fill following citation - ;; in current paragraph nor text before message body. - (let ((body-start (save-excursion (message-goto-body)))) - (when body-start (setq beg (max body-start beg)))) - (when (save-excursion - (re-search-forward - (concat "^" message-cite-prefix-regexp) end t)) - (setq end (match-beginning 0)))) ;; Fill paragraph, taking line breaks into account. (save-excursion (goto-char beg) @@ -23028,20 +22199,8 @@ fill each of the elements in the active region, instead of just filling the current element." (interactive (progn (barf-if-buffer-read-only) - (list (if current-prefix-arg 'full) t))) + (list (when current-prefix-arg 'full) t))) (cond - ((and (derived-mode-p 'message-mode) - (or (not (message-in-body-p)) - (save-excursion (move-beginning-of-line 1) - (looking-at message-cite-prefix-regexp)))) - ;; First ensure filling is correct in message-mode. - (let ((fill-paragraph-function - (cl-cadadr (assq 'fill-paragraph-function org-fb-vars))) - (fill-prefix (cl-cadadr (assq 'fill-prefix org-fb-vars))) - (paragraph-start (cl-cadadr (assq 'paragraph-start org-fb-vars))) - (paragraph-separate - (cl-cadadr (assq 'paragraph-separate org-fb-vars)))) - (fill-paragraph nil))) ((and region transient-mark-mode mark-active (not (eq (region-beginning) (region-end)))) (let ((origin (point-marker)) @@ -23055,7 +22214,6 @@ filling the current element." (goto-char origin) (set-marker origin nil)))) (t (org-fill-element justify)))) -(org-remap org-mode-map 'fill-paragraph 'org-fill-paragraph) (defun org-auto-fill-function () "Auto-fill function." @@ -23169,7 +22327,7 @@ region only contains such lines." (catch 'zerop (while (< (point) end) (unless (looking-at-p "[ \t]*$") - (let ((ind (org-get-indentation))) + (let ((ind (current-indentation))) (setq min-ind (min min-ind ind)) (when (zerop ind) (throw 'zerop t)))) (forward-line))))) @@ -23203,7 +22361,69 @@ region only contains such lines." (forward-line))))))) (set-marker end nil)))) + +;;; Blocks + +(defun org-block-map (function &optional start end) + "Call FUNCTION at the head of all source blocks in the current buffer. +Optional arguments START and END can be used to limit the range." + (let ((start (or start (point-min))) + (end (or end (point-max)))) + (save-excursion + (goto-char start) + (while (and (< (point) end) (re-search-forward org-block-regexp end t)) + (save-excursion + (save-match-data + (goto-char (match-beginning 0)) + (funcall function))))))) + +(defun org-next-block (arg &optional backward block-regexp) + "Jump to the next block. + +With a prefix argument ARG, jump forward ARG many blocks. + +When BACKWARD is non-nil, jump to the previous block. + +When BLOCK-REGEXP is non-nil, use this regexp to find blocks. +Match data is set according to this regexp when the function +returns. + +Return point at beginning of the opening line of found block. +Throw an error if no block is found." + (interactive "p") + (let ((re (or block-regexp "^[ \t]*#\\+BEGIN")) + (case-fold-search t) + (search-fn (if backward #'re-search-backward #'re-search-forward)) + (count (or arg 1)) + (origin (point)) + last-element) + (if backward (beginning-of-line) (end-of-line)) + (while (and (> count 0) (funcall search-fn re nil t)) + (let ((element (save-excursion + (goto-char (match-beginning 0)) + (save-match-data (org-element-at-point))))) + (when (and (memq (org-element-type element) + '(center-block comment-block dynamic-block + example-block export-block quote-block + special-block src-block verse-block)) + (<= (match-beginning 0) + (org-element-property :post-affiliated element))) + (setq last-element element) + (cl-decf count)))) + (if (= count 0) + (prog1 (goto-char (org-element-property :post-affiliated last-element)) + (save-match-data (org-show-context))) + (goto-char origin) + (user-error "No %s code blocks" (if backward "previous" "further"))))) + +(defun org-previous-block (arg &optional block-regexp) + "Jump to the previous block. +With a prefix argument ARG, jump backward ARG many source blocks. +When BLOCK-REGEXP is non-nil, use this regexp to find blocks." + (interactive "p") + (org-next-block arg t block-regexp)) + ;;; Comments ;; Org comments syntax is quite complex. It requires the entire line @@ -23328,28 +22548,60 @@ strictly within a source block, use appropriate comment syntax." (forward-line))))))))) (defun org-comment-dwim (_arg) - "Call `comment-dwim' within a source edit buffer if needed." + "Call the comment command you mean. +Call `org-toggle-comment' if on a heading, otherwise call +`comment-dwim', within a source edit buffer if needed." (interactive "*P") - (if (org-in-src-block-p) - (org-babel-do-in-edit-buffer (call-interactively 'comment-dwim)) - (call-interactively 'comment-dwim))) + (cond ((org-at-heading-p) + (call-interactively #'org-toggle-comment)) + ((org-in-src-block-p) + (org-babel-do-in-edit-buffer (call-interactively #'comment-dwim))) + (t (call-interactively #'comment-dwim)))) ;;; Timestamps API -;; This section contains tools to operate on timestamp objects, as -;; returned by, e.g. `org-element-context'. +;; This section contains tools to operate on, or create, timestamp +;; objects, as returned by, e.g. `org-element-context'. -(defun org-timestamp--to-internal-time (timestamp &optional end) - "Encode TIMESTAMP object into Emacs internal time. -Use end of date range or time range when END is non-nil." - (apply #'encode-time - (cons 0 - (mapcar - (lambda (prop) (or (org-element-property prop timestamp) 0)) - (if end '(:minute-end :hour-end :day-end :month-end :year-end) - '(:minute-start :hour-start :day-start :month-start - :year-start)))))) +(defun org-timestamp-from-string (s) + "Convert Org timestamp S, as a string, into a timestamp object. +Return nil if S is not a valid timestamp string." + (when (org-string-nw-p s) + (with-temp-buffer + (save-excursion (insert s)) + (org-element-timestamp-parser)))) + +(defun org-timestamp-from-time (time &optional with-time inactive) + "Convert a time value into a timestamp object. + +TIME is an Emacs internal time representation, as returned, e.g., +by `current-time'. + +When optional argument WITH-TIME is non-nil, return a timestamp +object with a time part, i.e., with hours and minutes. + +Return an inactive timestamp if INACTIVE is non-nil. Otherwise, +return an active timestamp." + (pcase-let ((`(,_ ,minute ,hour ,day ,month ,year . ,_) (decode-time time))) + (org-element-create 'timestamp + (list :type (if inactive 'inactive 'active) + :year-start year + :month-start month + :day-start day + :hour-start (and with-time hour) + :minute-start (and with-time minute))))) + +(defun org-timestamp-to-time (timestamp &optional end) + "Convert TIMESTAMP object into an Emacs internal time value. +Use end of date range or time range when END is non-nil. +Otherwise, use its start." + (apply #'encode-time 0 + (mapcar + (lambda (prop) (or (org-element-property prop timestamp) 0)) + (if end '(:minute-end :hour-end :day-end :month-end :year-end) + '(:minute-start :hour-start :day-start :month-start + :year-start))))) (defun org-timestamp-has-time-p (timestamp) "Non-nil when TIMESTAMP has a time specified." @@ -23364,11 +22616,10 @@ FORMAT is a format specifier to be passed to When optional argument END is non-nil, use end of date-range or time-range, if possible. -When optional argument UTC is non-nil, time will be expressed as +When optional argument UTC is non-nil, time is be expressed as Universal Time." - (format-time-string - format (org-timestamp--to-internal-time timestamp end) - (and utc t))) + (format-time-string format (org-timestamp-to-time timestamp end) + (and utc t))) (defun org-timestamp-split-range (timestamp &optional end) "Extract a TIMESTAMP object from a date or time range. @@ -23425,9 +22676,7 @@ it has a `diary' type." (org-timestamp-format timestamp fmt t)) (org-timestamp-format timestamp fmt (eq boundary 'end))))))) - - -;;; Other stuff. +;;; Other stuff (defvar reftex-docstruct-symbol) (defvar org--rds) @@ -23464,9 +22713,13 @@ package ox-bibtex by Taru Karttunen." (defun org-beginning-of-line (&optional n) "Go to the beginning of the current visible line. -If this is a headline, and `org-special-ctrl-a/e' is set, ignore -tags on the first attempt, and only move to after the tags when -the cursor is already beyond the end of the headline. +If this is a headline, and `org-special-ctrl-a/e' is not nil or +symbol `reversed', on the first attempt move to where the +headline text starts, and only move to beginning of line when the +cursor is already before the start of the text of the headline. + +If `org-special-ctrl-a/e' is symbol `reversed' then go to the +start of the text on the second attempt. With argument N not nil or 1, move forward N - 1 lines first." (interactive "^p") @@ -23523,9 +22776,13 @@ With argument N not nil or 1, move forward N - 1 lines first." (defun org-end-of-line (&optional n) "Go to the end of the line, but before ellipsis, if any. -If this is a headline, and `org-special-ctrl-a/e' is set, ignore -tags on the first attempt, and only move to after the tags when -the cursor is already beyond the end of the headline. +If this is a headline, and `org-special-ctrl-a/e' is not nil or +symbol `reversed', ignore tags on the first attempt, and only +move to after the tags when the cursor is already beyond the end +of the headline. + +If `org-special-ctrl-a/e' is symbol `reversed' then ignore tags +on the second attempt. With argument N not nil or 1, move forward N - 1 lines first." (interactive "^p") @@ -23579,9 +22836,6 @@ With argument N not nil or 1, move forward N - 1 lines first." (end-of-line)))) (t (end-of-line))))) -(define-key org-mode-map "\C-a" 'org-beginning-of-line) -(define-key org-mode-map "\C-e" 'org-end-of-line) - (defun org-backward-sentence (&optional _arg) "Go to beginning of sentence, or beginning of table field. This will call `backward-sentence' or `org-table-beginning-of-field', @@ -23632,9 +22886,6 @@ depending on context." (let ((sentence-end (concat (sentence-end) "\\|^\\*+ .*$"))) (call-interactively #'forward-sentence))))))) -(define-key org-mode-map "\M-a" 'org-backward-sentence) -(define-key org-mode-map "\M-e" 'org-forward-sentence) - (defun org-kill-line (&optional _arg) "Kill line, to tags or end of line." (interactive) @@ -23642,19 +22893,25 @@ depending on context." ((or (not org-special-ctrl-k) (bolp) (not (org-at-heading-p))) - (when (and (get-char-property (min (point-max) (point-at-eol)) 'invisible) + (when (and (get-char-property (line-end-position) 'invisible) org-ctrl-k-protect-subtree (or (eq org-ctrl-k-protect-subtree 'error) (not (y-or-n-p "Kill hidden subtree along with headline? ")))) - (user-error "C-k aborted as it would kill a hidden subtree")) + (user-error + (substitute-command-keys + "`\\[org-kill-line]' aborted as it would kill a hidden subtree"))) (call-interactively (if (bound-and-true-p visual-line-mode) 'kill-visual-line 'kill-line))) - ((looking-at ".*?\\S-\\([ \t]+\\(:[[:alnum:]_@#%:]+:\\)\\)[ \t]*$") - (kill-region (point) (match-beginning 1)) - (org-set-tags nil t)) - (t (kill-region (point) (point-at-eol))))) - -(define-key org-mode-map "\C-k" 'org-kill-line) + ((org-match-line org-tag-line-re) + (let ((end (save-excursion + (goto-char (match-beginning 1)) + (skip-chars-backward " \t") + (point)))) + (if (<= end (point)) ;on tags part + (kill-region (point) (line-end-position)) + (kill-region (point) end))) + (org-align-tags)) + (t (kill-region (point) (line-end-position))))) (defun org-yank (&optional arg) "Yank. If the kill is a subtree, treat it specially. @@ -23758,25 +23015,6 @@ interactive command with similar behavior." (and (bolp) (looking-at-p org-outline-regexp) (<= (org-outline-level) level)))))))) -(define-key org-mode-map "\C-y" 'org-yank) - -(defun org-truely-invisible-p () - "Check if point is at a character currently not visible. -This version does not only check the character property, but also -`visible-mode'." - (unless (bound-and-true-p visible-mode) - (org-invisible-p))) - -(defun org-invisible-p2 () - "Check if point is at a character currently not visible. - -If the point is at EOL (and not at the beginning of a buffer too), -move it back by one char before doing this check." - (save-excursion - (when (and (eolp) (not (bobp))) - (backward-char 1)) - (org-invisible-p))) - (defun org-back-to-heading (&optional invisible-ok) "Call `outline-back-to-heading', but provide a better error message." (condition-case nil @@ -23786,11 +23024,13 @@ move it back by one char before doing this check." (defun org-before-first-heading-p () "Before first heading?" - (save-excursion - (end-of-line) - (null (re-search-backward org-outline-regexp-bol nil t)))) + (org-with-limited-levels + (save-excursion + (end-of-line) + (null (re-search-backward org-outline-regexp-bol nil t))))) -(defun org-at-heading-p (&optional ignored) +(defun org-at-heading-p (&optional _) + "Non-nil when on a headline." (outline-on-heading-p t)) (defun org-in-commented-heading-p (&optional no-inheritance) @@ -23845,8 +23085,6 @@ empty." (defun org-at-target-p () (or (org-in-regexp org-radio-target-regexp) (org-in-regexp org-target-regexp))) -;; Compatibility alias with Org versions < 7.8.03 -(defalias 'org-on-target-p 'org-at-target-p) (defun org-up-heading-all (arg) "Move to the heading line of which the present line is a subheading. @@ -23933,15 +23171,13 @@ When ENTRY is non-nil, show the entire entry." (save-excursion (org-back-to-heading t) ;; Check if we should show the entire entry - (if entry - (progn - (org-show-entry) - (save-excursion - (and (outline-next-heading) - (org-flag-heading nil)))) - (outline-flag-region (max (point-min) (1- (point))) - (save-excursion (outline-end-of-heading) (point)) - flag)))) + (if (not entry) + (org-flag-region + (line-end-position 0) (line-end-position) flag 'outline) + (org-show-entry) + (save-excursion + (and (outline-next-heading) + (org-flag-heading nil)))))) (defun org-get-next-sibling () "Move to next heading of the same level, and return point. @@ -24078,52 +23314,6 @@ respect customization of `org-odd-levels-only'." (org-with-limited-levels (outline-previous-visible-heading arg))) -(defun org-next-block (arg &optional backward block-regexp) - "Jump to the next block. - -With a prefix argument ARG, jump forward ARG many blocks. - -When BACKWARD is non-nil, jump to the previous block. - -When BLOCK-REGEXP is non-nil, use this regexp to find blocks. -Match data is set according to this regexp when the function -returns. - -Return point at beginning of the opening line of found block. -Throw an error if no block is found." - (interactive "p") - (let ((re (or block-regexp "^[ \t]*#\\+BEGIN")) - (case-fold-search t) - (search-fn (if backward #'re-search-backward #'re-search-forward)) - (count (or arg 1)) - (origin (point)) - last-element) - (if backward (beginning-of-line) (end-of-line)) - (while (and (> count 0) (funcall search-fn re nil t)) - (let ((element (save-excursion - (goto-char (match-beginning 0)) - (save-match-data (org-element-at-point))))) - (when (and (memq (org-element-type element) - '(center-block comment-block dynamic-block - example-block export-block quote-block - special-block src-block verse-block)) - (<= (match-beginning 0) - (org-element-property :post-affiliated element))) - (setq last-element element) - (cl-decf count)))) - (if (= count 0) - (prog1 (goto-char (org-element-property :post-affiliated last-element)) - (save-match-data (org-show-context))) - (goto-char origin) - (user-error "No %s code blocks" (if backward "previous" "further"))))) - -(defun org-previous-block (arg &optional block-regexp) - "Jump to the previous block. -With a prefix argument ARG, jump backward ARG many source blocks. -When BLOCK-REGEXP is non-nil, use this regexp to find blocks." - (interactive "p") - (org-next-block arg t block-regexp)) - (defun org-forward-paragraph () "Move forward to beginning of next paragraph or equivalent. @@ -24509,72 +23699,6 @@ modified." (org-do-remove-indentation)))))))) (funcall unindent-tree (org-element-contents parse-tree)))) -(defun org-show-children (&optional level) - "Show all direct subheadings of this heading. -Prefix arg LEVEL is how many levels below the current level -should be shown. Default is enough to cause the following -heading to appear." - (interactive "p") - ;; If `orgstruct-mode' is active, use the slower version. - (if orgstruct-mode (call-interactively #'outline-show-children) - (save-excursion - (org-back-to-heading t) - (let* ((current-level (funcall outline-level)) - (max-level (org-get-valid-level - current-level - (if level (prefix-numeric-value level) 1))) - (end (save-excursion (org-end-of-subtree t t))) - (regexp-fmt "^\\*\\{%d,%s\\}\\(?: \\|$\\)") - (past-first-child nil) - ;; Make sure to skip inlinetasks. - (re (format regexp-fmt - current-level - (cond - ((not (featurep 'org-inlinetask)) "") - (org-odd-levels-only (- (* 2 org-inlinetask-min-level) - 3)) - (t (1- org-inlinetask-min-level)))))) - ;; Display parent heading. - (outline-flag-region (line-end-position 0) (line-end-position) nil) - (forward-line) - ;; Display children. First child may be deeper than expected - ;; MAX-LEVEL. Since we want to display it anyway, adjust - ;; MAX-LEVEL accordingly. - (while (re-search-forward re end t) - (unless past-first-child - (setq re (format regexp-fmt - current-level - (max (funcall outline-level) max-level))) - (setq past-first-child t)) - (outline-flag-region - (line-end-position 0) (line-end-position) nil)))))) - -(defun org-show-subtree () - "Show everything after this heading at deeper levels." - (interactive) - (outline-flag-region - (point) - (save-excursion - (org-end-of-subtree t t)) - nil)) - -(defun org-show-entry () - "Show the body directly following this heading. -Show the heading too, if it is currently invisible." - (interactive) - (save-excursion - (ignore-errors - (org-back-to-heading t) - (outline-flag-region - (max (point-min) (1- (point))) - (save-excursion - (if (re-search-forward - (concat "[\r\n]\\(" org-outline-regexp "\\)") nil t) - (match-beginning 1) - (point-max))) - nil) - (org-cycle-hide-drawers 'children)))) - (defun org-make-options-regexp (kwds &optional extra) "Make a regular expression for keyword lines. KWDS is a list of keywords, as strings. Optional argument EXTRA, @@ -24584,285 +23708,61 @@ when non-nil, is a regexp matching keywords names." (and extra (concat (and kwds "\\|") extra)) "\\):[ \t]*\\(.*\\)")) -;;;; Integration with and fixes for other packages - -;;; Imenu support - -(defvar-local org-imenu-markers nil - "All markers currently used by Imenu.") - -(defun org-imenu-new-marker (&optional pos) - "Return a new marker for use by Imenu, and remember the marker." - (let ((m (make-marker))) - (move-marker m (or pos (point))) - (push m org-imenu-markers) - m)) + +;;; Conveniently switch to Info nodes -(defun org-imenu-get-tree () - "Produce the index for Imenu." - (dolist (x org-imenu-markers) (move-marker x nil)) - (setq org-imenu-markers nil) - (let* ((case-fold-search nil) - (n org-imenu-depth) - (re (concat "^" (org-get-limited-outline-regexp))) - (subs (make-vector (1+ n) nil)) - (last-level 0) - m level head0 head) - (org-with-wide-buffer - (goto-char (point-max)) - (while (re-search-backward re nil t) - (setq level (org-reduced-level (funcall outline-level))) - (when (and (<= level n) - (looking-at org-complex-heading-regexp) - (setq head0 (match-string-no-properties 4))) - (setq head (org-link-display-format head0) - m (org-imenu-new-marker)) - (org-add-props head nil 'org-imenu-marker m 'org-imenu t) - (if (>= level last-level) - (push (cons head m) (aref subs level)) - (push (cons head (aref subs (1+ level))) (aref subs level)) - (cl-loop for i from (1+ level) to n do (aset subs i nil))) - (setq last-level level)))) - (aref subs 1))) - -(eval-after-load "imenu" - '(progn - (add-hook 'imenu-after-jump-hook - (lambda () - (when (derived-mode-p 'org-mode) - (org-show-context 'org-goto)))))) +(defun org-info-find-node (&optional nodename) + "Find Info documentation NODENAME or Org documentation according context. +Started from `gnus-info-find-node'." + (interactive) + (Info-goto-node + (or nodename + (let ((default-org-info-node "(org) Top")) + (cond + ((eq 'org-agenda-mode major-mode) "(org) Agenda Views") + ((eq 'org-mode major-mode) + (let* ((context (org-element-at-point)) + (element-info-nodes ; compare to `org-element-all-elements'. + `((babel-call . "(org) Evaluating Code Blocks") + (center-block . "(org) Paragraphs") + (clock . ,default-org-info-node) + (comment . "(org) Comment Lines") + (comment-block . "(org) Comment Lines") + (diary-sexp . ,default-org-info-node) + (drawer . "(org) Drawers") + (dynamic-block . "(org) Dynamic Blocks") + (example-block . "(org) Literal Examples") + (export-block . "(org) ASCII/Latin-1/UTF-8 export") + (fixed-width . ,default-org-info-node) + (footnote-definition . "(org) Creating Footnotes") + (headline . "(org) Document Structure") + (horizontal-rule . "(org) Built-in Table Editor") + (inlinetask . ,default-org-info-node) + (item . "(org) Plain Lists") + (keyword . "(org) Per-file keywords") + (latex-environment . "(org) LaTeX Export") + (node-property . "(org) Properties and Columns") + (paragraph . "(org) Paragraphs") + (plain-list . "(org) Plain Lists") + (planning . "(org) Deadlines and Scheduling") + (property-drawer . "(org) Properties and Columns") + (quote-block . "(org) Paragraphs") + (section . ,default-org-info-node) + (special-block . ,default-org-info-node) + (src-block . "(org) Working with Source Code") + (table . "(org) Tables") + (table-row . "(org) Tables") + (verse-block . "(org) Paragraphs")))) + (or (cdr (assoc (car context) element-info-nodes)) + default-org-info-node))) + (t default-org-info-node)))))) -(defun org-link-display-format (s) - "Replace links in string S with their description. -If there is no description, use the link target." - (save-match-data - (replace-regexp-in-string - org-bracket-link-analytic-regexp - (lambda (m) - (if (match-end 5) (match-string 5 m) - (concat (match-string 1 m) (match-string 3 m)))) - s nil t))) + +;;; Finish up -(defun org-toggle-link-display () - "Toggle the literal or descriptive display of links." - (interactive) - (if org-descriptive-links - (progn (org-remove-from-invisibility-spec '(org-link)) - (org-restart-font-lock) - (setq org-descriptive-links nil)) - (progn (add-to-invisibility-spec '(org-link)) - (org-restart-font-lock) - (setq org-descriptive-links t)))) - -;; Speedbar support - -(defvar org-speedbar-restriction-lock-overlay (make-overlay 1 1) - "Overlay marking the agenda restriction line in speedbar.") -(overlay-put org-speedbar-restriction-lock-overlay - 'face 'org-agenda-restriction-lock) -(overlay-put org-speedbar-restriction-lock-overlay - 'help-echo "Agendas are currently limited to this item.") -(delete-overlay org-speedbar-restriction-lock-overlay) - -(defun org-speedbar-set-agenda-restriction () - "Restrict future agenda commands to the location at point in speedbar. -To get rid of the restriction, use `\\[org-agenda-remove-restriction-lock]'." - (interactive) - (require 'org-agenda) - (let (p m tp np dir txt) - (cond - ((setq p (text-property-any (point-at-bol) (point-at-eol) - 'org-imenu t)) - (setq m (get-text-property p 'org-imenu-marker)) - (with-current-buffer (marker-buffer m) - (goto-char m) - (org-agenda-set-restriction-lock 'subtree))) - ((setq p (text-property-any (point-at-bol) (point-at-eol) - 'speedbar-function 'speedbar-find-file)) - (setq tp (previous-single-property-change - (1+ p) 'speedbar-function) - np (next-single-property-change - tp 'speedbar-function) - dir (speedbar-line-directory) - txt (buffer-substring-no-properties (or tp (point-min)) - (or np (point-max)))) - (with-current-buffer (find-file-noselect - (let ((default-directory dir)) - (expand-file-name txt))) - (unless (derived-mode-p 'org-mode) - (user-error "Cannot restrict to non-Org mode file")) - (org-agenda-set-restriction-lock 'file))) - (t (user-error "Don't know how to restrict Org mode agenda"))) - (move-overlay org-speedbar-restriction-lock-overlay - (point-at-bol) (point-at-eol)) - (setq current-prefix-arg nil) - (org-agenda-maybe-redo))) - -(defvar speedbar-file-key-map) -(declare-function speedbar-add-supported-extension "speedbar" (extension)) -(eval-after-load "speedbar" - '(progn - (speedbar-add-supported-extension ".org") - (define-key speedbar-file-key-map "<" 'org-speedbar-set-agenda-restriction) - (define-key speedbar-file-key-map "\C-c\C-x<" 'org-speedbar-set-agenda-restriction) - (define-key speedbar-file-key-map ">" 'org-agenda-remove-restriction-lock) - (define-key speedbar-file-key-map "\C-c\C-x>" 'org-agenda-remove-restriction-lock) - (add-hook 'speedbar-visiting-tag-hook - (lambda () (and (derived-mode-p 'org-mode) (org-show-context 'org-goto)))))) - -;;; Fixes and Hacks for problems with other packages - -(defun org--flyspell-object-check-p (element) - "Non-nil when Flyspell can check object at point. -ELEMENT is the element at point." - (let ((object (save-excursion - (when (looking-at-p "\\>") (backward-char)) - (org-element-context element)))) - (cl-case (org-element-type object) - ;; Prevent checks in links due to keybinding conflict with - ;; Flyspell. - ((code entity export-snippet inline-babel-call - inline-src-block line-break latex-fragment link macro - statistics-cookie target timestamp verbatim) - nil) - (footnote-reference - ;; Only in inline footnotes, within the definition. - (and (eq (org-element-property :type object) 'inline) - (< (save-excursion - (goto-char (org-element-property :begin object)) - (search-forward ":" nil t 2)) - (point)))) - (otherwise t)))) - -(defun org-mode-flyspell-verify () - "Function used for `flyspell-generic-check-word-predicate'." - (if (org-at-heading-p) - ;; At a headline or an inlinetask, check title only. This is - ;; faster than relying on `org-element-at-point'. - (and (save-excursion (beginning-of-line) - (and (let ((case-fold-search t)) - (not (looking-at-p "\\*+ END[ \t]*$"))) - (let ((case-fold-search nil)) - (looking-at org-complex-heading-regexp)))) - (match-beginning 4) - (>= (point) (match-beginning 4)) - (or (not (match-beginning 5)) - (< (point) (match-beginning 5)))) - (let* ((element (org-element-at-point)) - (post-affiliated (org-element-property :post-affiliated element))) - (cond - ;; Ignore checks in all affiliated keywords but captions. - ((< (point) post-affiliated) - (and (save-excursion - (beginning-of-line) - (let ((case-fold-search t)) (looking-at "[ \t]*#\\+CAPTION:"))) - (> (point) (match-end 0)) - (org--flyspell-object-check-p element))) - ;; Ignore checks in LOGBOOK (or equivalent) drawer. - ((let ((log (org-log-into-drawer))) - (and log - (let ((drawer (org-element-lineage element '(drawer)))) - (and drawer - (eq (compare-strings - log nil nil - (org-element-property :drawer-name drawer) nil nil t) - t))))) - nil) - (t - (cl-case (org-element-type element) - ((comment quote-section) t) - (comment-block - ;; Allow checks between block markers, not on them. - (and (> (line-beginning-position) post-affiliated) - (save-excursion - (end-of-line) - (skip-chars-forward " \r\t\n") - (< (point) (org-element-property :end element))))) - ;; Arbitrary list of keywords where checks are meaningful. - ;; Make sure point is on the value part of the element. - (keyword - (and (member (org-element-property :key element) - '("DESCRIPTION" "TITLE")) - (save-excursion - (search-backward ":" (line-beginning-position) t)))) - ;; Check is globally allowed in paragraphs verse blocks and - ;; table rows (after affiliated keywords) but some objects - ;; must not be affected. - ((paragraph table-row verse-block) - (let ((cbeg (org-element-property :contents-begin element)) - (cend (org-element-property :contents-end element))) - (and cbeg (>= (point) cbeg) (< (point) cend) - (org--flyspell-object-check-p element)))))))))) -(put 'org-mode 'flyspell-mode-predicate 'org-mode-flyspell-verify) - -(defun org-remove-flyspell-overlays-in (beg end) - "Remove flyspell overlays in region." - (and (bound-and-true-p flyspell-mode) - (fboundp 'flyspell-delete-region-overlays) - (flyspell-delete-region-overlays beg end))) - -(defvar flyspell-delayed-commands) -(eval-after-load "flyspell" - '(add-to-list 'flyspell-delayed-commands 'org-self-insert-command)) - -;; Make `bookmark-jump' shows the jump location if it was hidden. -(eval-after-load "bookmark" - '(if (boundp 'bookmark-after-jump-hook) - ;; We can use the hook - (add-hook 'bookmark-after-jump-hook 'org-bookmark-jump-unhide) - ;; Hook not available, use advice - (defadvice bookmark-jump (after org-make-visible activate) - "Make the position visible." - (org-bookmark-jump-unhide)))) - -;; Make sure saveplace shows the location if it was hidden -(eval-after-load "saveplace" - '(defadvice save-place-find-file-hook (after org-make-visible activate) - "Make the position visible." - (org-bookmark-jump-unhide))) - -;; Make sure ecb shows the location if it was hidden -(eval-after-load "ecb" - '(defadvice ecb-method-clicked (after esf/org-show-context activate) - "Make hierarchy visible when jumping into location from ECB tree buffer." - (when (derived-mode-p 'org-mode) - (org-show-context)))) - -(defun org-bookmark-jump-unhide () - "Unhide the current position, to show the bookmark location." - (and (derived-mode-p 'org-mode) - (or (org-invisible-p) - (save-excursion (goto-char (max (point-min) (1- (point)))) - (org-invisible-p))) - (org-show-context 'bookmark-jump))) - -(defun org-mark-jump-unhide () - "Make the point visible with `org-show-context' after jumping to the mark." - (when (and (derived-mode-p 'org-mode) - (org-invisible-p)) - (org-show-context 'mark-goto))) - -(eval-after-load "simple" - '(defadvice pop-to-mark-command (after org-make-visible activate) - "Make the point visible with `org-show-context'." - (org-mark-jump-unhide))) - -(eval-after-load "simple" - '(defadvice exchange-point-and-mark (after org-make-visible activate) - "Make the point visible with `org-show-context'." - (org-mark-jump-unhide))) - -(eval-after-load "simple" - '(defadvice pop-global-mark (after org-make-visible activate) - "Make the point visible with `org-show-context'." - (org-mark-jump-unhide))) - -;; Make session.el ignore our circular variable -(defvar session-globals-exclude) -(eval-after-load "session" - '(add-to-list 'session-globals-exclude 'org-mark-ring)) - -;;;; Finish up +(add-hook 'org-mode-hook ;remove overlays when changing major mode + (lambda () (add-hook 'change-major-mode-hook + 'org-show-all 'append 'local))) (provide 'org) diff --git a/elpa/org-20171030/orgcard.pdf b/elpa/org-20190930/orgcard.pdf similarity index 60% rename from elpa/org-20171030/orgcard.pdf rename to elpa/org-20190930/orgcard.pdf index 2b00569d9dbf094a292354c05d44a439d8e029de..9e256dec6cb2a8a39b9662745943605e8c25294c 100644 GIT binary patch delta 46819 zcmV(vK0TCKOz(HJ{h0(lVLzWmN3{Abk?4ZaOS(@{c1n#ruakIra zz^zfu;gToH2R@dg3}*Yj5t5-SHrU(6{n^5I?Ri1yn&zuwaBkuun4BLi*`xnRtMq?5 z&C>deti=PP`1wPe!Gy==SQZ2+pF`Y~WcALRXkN1mRdZdJnE!fxwjjUY8h*c{D}woQ zRPc&wXo^e62*m`iUcTB#vtYL@LcsxBx9*PZXm zV#h`<>Cg|01oI1d($bIISplOpJ9d9^+pdx|e;C7dzGxUb$b(U=oYkvM0VCWoN=RF2RepWuyBXIOvX{hP{#!mB7Dy|5tT)g za{=5@Nh?xz%Qzup0jnGqDMmpeQ0~&_vRF{z9h04$z%zFQds;LV!?q!6q7{ET9Zl(#C_M1Bxf$4Y9a0N${t~WwDTNEc!rqQCy zkIi=11%dLSmMC@^qUMM&RhqY|ngC;}nhL8vrXRI1iDfc#$-o4M7(Yv^nj@<5c3esQ z{jcVq-hJ~mXWp4l?pp?MpBH}_OHbVQt@HgLdpnL}_+HlgTYZc(V5PGilti}$auw1|BS6=#T5&Dg=07HxFJM@J8j zjDGd*Pw&`xeDdXkNyTP^W0?L8vs?un-*Yvr!3u8|mnTt0z>)S;z#)G)S_G0xo<5Z> zwdq8-Ef?0uw_tg|e{21xlp!lxYH+m{6GsLs;=)9o+E8W)u(tRvv?$jih4IWo5Mc`R zH{H>Ht3@Z`Tx^RPn+b-0lT_#1#aFN2T$%4LzWno*rkdIx>!1&);lN(D0Eh~>(zN|s z>aH-g&>7Mciqf06%B6qVnF;f6avew=-FX;FcnFGgp9C8a^;Sza1Y|f>i8T@3r7k{B zs;Vfvt74XTO*|EoT9*Z-mxjZ}8S)2Bs>E3#L;y|X3B_{q=qA>jYD|1=>L*j0Q{P#* zuRG#Ya}TIk^_Gdz;}l@Gn!s+-EHeQec>a$j$NA#Ue7m^QT#0`NAPLHE6kA3FjZEDh z)`Grg*r9i9^al}h!heTe7=psy({V>pS+;RTH!}03lI#SKCJ#hX2$D2t#X;umUuE8n zM#R#=IY+zJy;-n`_&sKEk8;tSzbuI%wC5W_#uUhStK$d7^6jliNZa44Dll|37J|$2 z;061)E(DD-RMmen}3UydGdr;b+ zfUVN=xQg|fuB{c#U%rQd&;NY!kJs!%jeu}gNQKhkUd?~dji7g@g>4)rGGA(ua8;Bs zZe2aOqC&MJp3+f}iJ()LfUI!YVpTys)j3{R?^93#-)!_e{lM* zHuZeabyj~|qpTmNC?PWU#nBq)38&$f1@MVJD8xbOYR)dNc$N``GvDzI&k03pn6LpN zE(zxYCpc^_&P$9~^4TK-hu|Lw;I$O~-lMh=iqwYie`z97gg)SS?Ap8!HrB=vAsowa zZCgz3!`EnwKm2t=T)7V~i9TOrX7M3@qqO<3IGTU7<8SM_XnCvs1U&A5b=03a*YUOb zpvAq0VGu$toq2@`r=nWy6(G(x8AgJ5u9UoZJSTj1J0O8z=NRWUn8NOI_t^#sqe z-W25BP0c4sb3?bx7PZg$Vh#1pajdz)AyKN~6h--*NtEz)S`S9Zcbnw|3ITbZXe($S z9_K@L6XBY}YV7xfPf89EA&ubD&FLK`$2H4@t zaCbcciHoe+=IkOqmQL8zjz-zA^v>W`ig<$t&~a)G@ZhG+d~@}Zsf!93 zf`PG@w&4f9x;eZzuI(Gdmln5t&fGY}#!y&{CKXif(wTbb8%z7d#Q%ZGvoKK6`1|Vj z7^NU1q;0NscT?I#Fbv%b-45qK2gm$DPvO&-9(GpYga!poZHnBjxg$O}7NCFP8WD3q zBr`+h7*G4Qj=^U*Zj#zX-KMpoQNTURglgHsK`s-T zL{J4o?9V3hh)Bp7b3hQ6hUH7AnK)#a!IZlB2&$b>|~XIhHw>db$(9G=Rdj%y6* z8q7V~yA(tlE`wkUjBI&^-P$`!8bee!bVhcUhV4j@J1C>^NMs8sf;Ao_qir~mt3p)` zl(OxxkII9<+ZhI>4&nwz5Cxt4hHNT%Tj1=G_rIEfWn7S0`e#wlcb`^uo3&@iKt{7u zQbnWDZFnS8B_eRX+W~*&tXo#ZDH4me-__!_CAIX&18xnhm)$4&fvu5XX?WH_nvSsS z}7x8Xen^im51qX$@N1H=IZpZch@cD~d@@CMFUtC-m#uwxb7Z(?x)COU3$6KKo z+U>Fjjf4*6OR|Q9FGnfF=<;HeJS{_4xb6gV#1OGn%>^U3+?1@yG%$VRA|Y&0QplxrK;+tqW0@MpRgkC(dalb**&1?T=a>kSGWgz zv@!xxdt4!08?qFc6XpGCQQ_}rEF1oBZ9uNXx2Q2{fOcHEj#-a(|0sU z@a*-~v!8#SfqAiJ_RI?cBJB2TNu0=F7H^+@`@Jhvpag@b_R7P@K83p zeD=3zub{iAvv)*LyS4}K@q(^*)gcTqzgEyv=A#puA%HudtGeg;o>3ILn4*zMmzV#j zS6eD-GN6Q}Op{JwRD!RY^&0DM?)=C6_rNAzWEp=;XXaZ=!*Qh#=zwp*rWbm&;9G7Y z?fH&=u%jzpMh&ox-P@5q8?wnkiV-jJJ!(tg50ct0&(h0~F6Yqd)I? zLyDd{5mH~wbt4>^KBXxL{h9wXnQcp@$B(LE8cIwG+DgqzXk7DcTYJ8s?qBOVe3e$a zec69~qHV{x0Pk1ubURe_Ku6-qdW{wa{g$nCRS%MPTCdaPqO(1Ge3r_fHLmJ@nX~M^ zRJ}Bbt{R^_t%bhJ^{~WcvA2)I(unOYiO}Udec<=@Wpy?}v@nJHOt0AUxZqi}B+aGX zqqia}CGhRQW2+Zw_Rum&Vey)e3(qp?5@|B3sLwu0zyM?kav8Z(r34o#afi z1NBt4PARH=aPtNA@k9JUn{kOeiNa1Qp;g}(q&EJhnplvUP2L<+3umdf&arwjGVI=y z%jP@|U5m{7)*#cfRMKz*kygBLdW&MTNF>R@`Y|;nNpHk@XSI!Ftn+(87jK!gjFrHR&{_v2bW3I zv+J$awrDE6uuVrd3G$0lh@o*c3w7c`G@+uQ0*DT%HsUF#)HHuGu@Mz|WTDHiw@EAu z5?Ljm?6OYUwFGgUro4WmMJA9W;iP}I7KMS}R68B$t{1VTzOk*tS@wrGv3Q;2vw;(dfm9yNXg zCC){8!|UOtWrGiUbU*t6T>FYfAkMtAvWy*25m)%9&LYx;!{;@ ziK`~-_nXDC0-crbA4jaV2|l&CVvQx3wevofoFbs&D!eR#9%=DAT5W^cK38Eb zP`PgV^Lvif6c?%w?#GF}5%_*b!h0chBFd(V-w{#2%M+aJ;8H6q^Jp%aqgPm0Pr-mi1;0)Yt?d?>oHQy#h;+FVT0cirM7sw*-GZZApF+^x7Z&=!38HTwYeZHSVE|)q_p$o4xHc z|BYq+PJ~%CyIq!!*VP@zxYBf;)+}Lb1)L4YfeMzK?y~^7NWof5082Pv#}Zc*Gx<>l zLF`8HsS_&@rEfxTLy>=-ye?7Mi&I`9Q2~8aio-($NRLQyU^u){w<5kEb9~8yxFH4V zxDoGkBL@|(*w+H#1h6T;hFz9|Uld&rr#<&)@+$tU#c5fw_eH^h3W-s_j60D*-=tu6@^l2=Z zRrqd$ODq~($y}D*EOvM6P(1&b2ukiELiNS}05I@4E|V`3RDbJp+cpya-oL^(y_rfg z5h;@5E7$8xB0Fi?B=$LK?`G1@97VzsYl>9)u%-Y004xB451F9sez-3ZMS;L#vDp3X z1AM#sMt^4;7sf)f7LIwby1TFq%{7e++i^6*b}m-Y#n;JozL|Z>rZdZ&L&JEJJx6mAGaWOM2&GjwloIG%s z<@jlPF?pC;^9jm}I7`V5d*W-R=G2`LS`E#&ZA$CRGd0}kVrDKh*JH%4t}m~Fs1GID z6+l&xMvTxc3a5A;_iH+xj9ed3(Is_`sq`?lF7%pbWq(j2AhO)Di=w`l-2uJgzp%!7xDjJ&*f6Fvj^Ub`hexBMEN9_#W?KfnD7z%hpzX}lEXRWf3Y4Ib4UnQksqb_2 z5NA~(6WBATZEK!m@nOHrK3=_B>9-%=|G4TKmbIn>`)UKDa(LL~Od5D2*8^qmDO@D%pkAy8*9(`A|DYF$RvpB;>ktoEq zY;B=^9%p%666%ifPFi$!5^izMPI?7jU*Ei4{(r8-#vJW3!lehwu~SrrSRLYD*?r8K z+~wJh{WYB#lPbpo{d}^&+$@zCn+I`$^n?=rND0q}_iL9D?Z7A{946GlFSgnC zNq@jElej2{rt%4EpWCaIl1vDVvoI%=C_)=1kS{S#E6InfG6$F&u*CpPN=Tz3qE1?<#L^0;9x)4QpXO_A z%J8bjA=6xh+kHgMEp0KE$f~;37`A4cHh*vOdOBOU=HzjkaR&W1Hx>yIF(jcFc@W#e zHp%Tw{o7uQ!lsTPiX$M()ORMqW*BwU`jWH;J;R|=M=fqq5XI?c#7h0Crdv>u#GABD zh_G=<0t?8-FNO)IS~g^m5+*YtCWQm8j!mUBJmOsj+F=WS?Sc{ni*Tl%fhv!FGk>gw z5^0+xTVqZfYvBwwD2)Q94mc%b=d~HhHymEj0xz!m@?`_^=6W_fa|5`@B)BL>1t4Jt zi5HV)mQ=eGZvILzgtAn2@Rp8ujA3Q@8JcXbBPB)`Y{W1Q5^jojJ3N_|Saz`>vkWOJ zUQU^@Ez*O4u`p2eMG+T@xO-#!_>gVSfZud#!-_ z0wq@Of_pj`Lne~cJjM~q^)$%y2G$-J^@oP9^u5xmbiELn4#7?(;P^>doiGLjQPhUy zFt`G!R##e=C_&{ZFHe0yGPfs9p{dPDaEn5(c!w~Q-0g?K7q%d~ec3`?kpLiIKdHsx z9t`%OdH2f7OjF`i5`zQZ8-G-h(d<+GnwIAK!bMwGWt;w<>A{o)6EKMBBf+vX(=$#3 zJWWaH{>n*`9bNAvSRyw2AS`2uJE}~Ljr=#IWs_NZdG+S<M@=yFylE#DdFJm97>!oCAQGx%AJj*+P`Mg)~=sec9!7?rg;M@+|> z^`2;eOPj~_>Q3??-JlU1J*sh(`U?T(8tJ{IU{3lDhTZUoZOt`>uln13?sSKCG}{wR z3_fd!8FlBhurzz&*GQFyjdc>p?FNM$M{`_PEh;1<%I?IEbcY7HzRMsYvDG<=eVkxR zTTh|M70cJGTAwI!rGLu^)6qQdg+pT!6M`^AMbQq11_^O1bA~mi0I{CVJVYmw0KKyL zgOX&*3Z^BJ!p{{RcWqR-7a(S#N|hR9k~s$M_fX7a6l;XXJt8Sn&;4;5Crp+BS)gcW zN2XlCeR!<42^rdpI47LOhLWVV}LM{%)F0_GIMpCnk#{(mIePN!>nj>pL0f$2yO z`E#s-E^N!wyakI$EQ#l5kys@DxTlh`n0ug5dvTeedE^IWZy9jW3u!lVh#lUy{NHD# z4Wuc>YKvZGdp!)&5G4w=GzSf#$R`M`PQLVY9W_$V^N+QLOV%NKo zX_Fkiv6O@(0DqF+2||~_nn!^jV~$e#Rx(E{KAxWywa*7acb>sG^@gi47Mwfnwm6n> z-Si&cv1t@+2y*k)&O{DNZo)G~OqHrm^Xu7Zw$7H7iL4WBN75pz^0TP>T@861L&2PF zo>iM|*Q(US*-8ngPXp5ZFw|yKC74Gcu%6^Ri_-`G2%DnKz%$y)ic6(e;MIf%F{U< zw$}9XOn>ef1b=!t$srQJqfkXzu`oL4Djv?C{DG0^XcE7D$?caCDmQh0fZ)qrTpn$8oo}EkX0lEp?7nnHmdBeo1KQxJn+n-+5+fwgb722FHD; zwtug;G#*GdANRHwljFd~d;Vf&BMSw0ATp8Ug7JEZ;iQ&Y*0R8UR09rVBECo~1~^2N z;(8R{qky=_dW2YEtxCE!0!es;uZJD^HYX29_WR4tXc39xAU}3ZKE0v0gTR|Sj-;W5eRNRl5E3^z9=d8 zVmd@9RDf2}AngJ8nCKr#6 zJM8)O_@Bb|x55=cD%Yt(Bt6}b@w2g%DDY}_a@j?TR7l7b261(giw{*|U_LloRKmP4)DvqlId zn|C0UKruy7WL$66;V)9RMmz@^HZ~^v@iOhkIM11COWNaFHaW3 zZ&^Zmh?>_;;a`nA1|iBNpDI~|O-Xrn_$P?`R%KrzRqizLLAKjhrASoqjDJ0iDuIh9 zk=A10xJ1UQhUnbRI<6vNJw6#!alRuLK%S0*)`~6QIQe*AW&OrR`?%P3DU)~ z^U8}(OgAph%1IS^^g^`_S&EvblQzPBK@y`}PlB@FMHxEU)+tZ$#;@ft@v;G?8KzU! z6s_kZ>yMHkQgZJb)S>|@`Yj|;`?5p0%cGlGgC)1wxd0X*ALrq*a z+@t>}@#~MOy()MwrlLHdOR+87jzOmVq*lur_6rCS9Ob@G4VAX^*3?TP2 zR5Z}wSJmLx+o!RaYcP60#YK1ujEP1NK9M4Ye7|xXlF9ywfa6%%+<&*qsXB5|3-gOb zTwPWGx)cR81bDV0(5ELWhuUQ)OfENS*SXlrbuNl^_O)p~Ro^022g$VAL;;cL>@x}J zjrHxfL4k@Bhc}tyMc~75E$HwN{(n?l(zNzl zyG6Jn(95HNM5Hh);eT{mN*8t5iCrr0`hU@L5|C<$AYpKIh|80E!)za~0GWKneg7Se zT0V$M`V--c=bgdeha(Q^MDPP^ebfvx^YCQlhJ_zuhVo-TkNKhhwBA4vMg+PXAS7Yd zA?Hp-hqd5!=%|j^l3qOzdZk4X!A79RGwM(hB`HORy>LB)^?#bsBPBnGf6|x~iL)7B#!Iht%lE)hxe` zOl`|u(tAX}c7z8<)2psQO%}&YyoZLqN} z;0nwkUhfcN+kz@}&ebmnAiJ%9?F$G77Mif&P3blbi5U5cUsCm0RIT3!yoo@W2{ty?jDD$hU zJOtm)BWtZcj7~B%(xlHEzZk8Zu=BM~I&ZL%R|o#sm(sQ!LDRS6Wrha1c!hbnyxEt`E1!Xc{k6tZoh)X%b)TpDD(QhHtV+>(*UhBkENIa_0NhtpMF!~^r zBZVboFucgcYy9+r#;NDlgr)-tvP(0D_13fy8;Kfh5JSS&xp>NnI1@tYC=$Oj0i0w5pU_bEez2jW$&p@qP4$++VIf{5mxZ5C6h&XZ7Lw zbMKBKq1Ksco0Ff>kJ9E5E_$h ze1|XK98MQV&MnQsoykguj1?qB)-w_YgmcaIn#a@0fH|TVY(_njf`n$G**!WIeIsJw zsj;ipjYQAfx#n61<`PE2ro*-Perj37x=7Y!vnBWFv@R?MYg4?{G{bAeZ?J}yx_>sc zxp^_G8(|jPT?%~7^&L*3IX8SPONKjnH}zdW`Uq}($?i&`WgZC`RHuq&8I}fKeYP;1 z$%izA)yKO>GcYS=j^_C62+#w4wI4hUVve5>ZyK~{uAbbY&0aw}N*3u5`vL|A{&IhB zs&bp<)Yv(bn{AxLdwA#;`pfPK!G8?n+qh55ZalvZ3L5C1?%?K6r zEjZ*F>=JIlk5!SIYqnODNhR8E5o`TEP9hXAMi^LzoW{VnSWN4&*@hyWQ?G&CD^X6~ zEJsPZYyJ2B^Dl7cJxWndY5~bz>WYML{V@))=LHkTQf8TEa~-Di#W01)^cJznTWr7_ zz9HYjj$D6pwfg3NDsOS3lObypvk4@v9>h;xtW7Z0Vd{F zK!Cis485bPBQ3xHWc-(*ft7>JyT5^dvw^vlf#JKs-^2|7;zEi5gZKLWQ=Nm6y}7NU z1HFT})n64d{1xW?ki|g8A~x36K#-#Y!e9JE&Fz6k@2Bp@@ON7+K{hTRkAI#`%t6K` zf0bbDWXqrmGPiRAN{Rl*;$4LBM`j9i1h6qOGIDTo0f2S@psSG?!(YKw+-!k=e=C{( z62J5J^02kB1(>{-0Q5390lt4AcsLk10|AcqPCze@e=GhsLSSM77@He80t|ts<{*SW z(ci^DlYj7g=k3j10a}djgU1A5{Ok4KC!P1%GPVI(x&1N!ySWVNN}>{yYBYZr{9l!@ zu#GFggN~UIK*!9+2w-C3VgYb}ygzvT?A_{UcYWMTv0`iJcMDg6&&=l^t{ z@;{3~1^C~wY*_T zqPc^(xhv3E!Q9cv?4MEjN3QzUf?1h^fC@Ga=6_u%06Hc{#{Z*x-zp=^_e;a!eIEZ- z0pFMAf2R}!8QB>BwO!0?>;MCMdjmIw_ZGh+Hh>4y`x+VpUH_h700TY9#_`<+@Lrx5 zz{JKL;jezOvjG@{{u2FvgE#;TBL77ki~t7lKZpsyAn^yW02rkHAa($Q%pdd~MfMNk z1Te_`L0kX^`Tru$_Y4Yu5Ho;5=?{9(p!^5D^HlvW;(E_u@CUtTF#Lnwc^cXq7+C_} zFLD#dKXR7;%Kw?j|0>=o8T}Wry$3V0v3l>v|43L_|B_f+|4I0NSECq={{`Pu0{;cy z>oEBjd{1opFZdqL>`(Cby3E{c&48ePS-i{4{{`QRwfq-+CusFA_|D$?4`h00_9qnE zyDR8@j{c>8r)u*j`@6Hv|5CqGxBa7jZ>#P5hT8nAR;G9Q_Wy$KTpj-8dsjNVUs`|E z?-Bl-^!xHNIGWji1OFs^A8Q6j7n^@Myfb$C7kn?)`Csszugf3E{2tHk58HQJccA@0 z!T#5h7&+P7zkfyieTltq(Es4SzmI@GSD+EX@`8;KPoPCzVEaRj5WWlD-UQz)`JQ?z z6`jYjeTUN%GHeo6b*BHO{V$=U;a=3W9Wlx~!4;wxkCT>v2H23+1jV-Bp3i!5O4EC7 z2uoAg1Cxa(LiPOw@So^Z1ou5(>^#-{EFoLKyS|X;+BtC|E97H5xb#W5*7ujKjs-95 zDehOZOCvs)&Co@uMr!*N&ynXDX3gW0z&O$oz)_=Lx}wb8{hCG3nS3Mq5=VpJbsEL; z%|mmGIr?#b-hI77h1sDSj|@)}mjLn(eQcV-L-;WH3(lfP$+u1Wv6Ol2j`3~lL?)|4 zO7}fEr3d??Yh4QRNp4C!Tn0!?sfftUR>^qlV&Zrh)~w65FPpAX*BmW|4z%*|=5O*= z9Cc6?vqi-FhM1quv2{;2_oo{s=#Itsky(lzc_d(eBYF3Dtgg6!z(0JGS589B-&UrU z7x=-|o;$g@yuFojTZ5kS5J@!siS9K7`gbYJgA2gT6qgfB#zDhzp;;^u(N40)ma&k3 zGz58Y58;s3ZtHk8yd@FEF198Z6TZS4O;c2dW2Ci3-jYs2Z(aMR@+d})n?&ZFO!n#{e4T#vdG_OA(O0NZF7NQ2iE%?lM5p~MLmu%mPD%xF4G7OgOi^X>csIV+ zU{esWqMv4R$W&@}O_{uTNoeq|{mPP9N!s880}lPWG}(Q`#ZvO5em=WE<-Rep${2o*Mg7K)A?P zOh|%8!q^ZsG)pW@(3>rCBYe@WlyUsLog9PhW1H!{~GB$LOrOmDhPAh&kIbG zidShIx(O_;Vl5A|Wf!MD5d>UhklmVp*BJB0ZaP+ugwgh>xoCVjxasL5{E--#(!S(l zGX|(k9opxVjwn0W^kRhWG3u0|r2evUV{wh_E8f(LVmu37Z&M-zc=^=^x=ipoWzFOy z;2(f9&l*ONtaEa(l3Hy%{wD6bW@~+n0o$yKUX5bboI6{W(}PFm@=d#c`in6vCr!6< zt{7i&_t&sDP}8Vd9Qo|3z)bZ*j>L!-Ye3`=(MhV+vzZu}IIrUX-l*?Xr{uP8v7+R5 z_LkE&*MVOtDPZC{2OEu`!m(m`b>~{;19-%xAPe)Fltj`Fq@U;@Ozte&@6J=!+$Uh$ zn)0Tn2-g6aC#TP5JCP25G+WdOc&c=n)kK>p+I=sSpL+O2wT!6*pEt;%9DVPSsYpwf zareo-RDpKFrV5WpY?=>RntxQl~`-X ze|aevDq8<>*cr-yAP3fT7Ur>Vv|>ko;9^m^XUhF?Jr6{4^?%hp&i#NNW~$@+d>NZbyRdFn`r|slav)~;M8rfa(~s>*Tqk@g!YvtO z=J{#N7!C)27G{cpvdf#|^`Kj!=9@6rcab+&-$*Wm$Bkq77;@b0ds?m>Sa7sSc{u6Q z*)tj3)HNvQPneRlk(m55(LuM7pJ>?|5+O)vLIcRO~0)oNhBu5 zu_tnWyrMFt@G6lkM13{^RnjqMssO2)2KNhu)CWBMSa|O>XtR?VA4LscT&lu+CViQM z7~j;+*A~fZHLKDQ`3OE%yh;rP4dz)si9DZOaMt(>@+*1~8U~5yX+a%h+?2ZCe74P{ zQ0@SuR&5|7tY1ndEC7r4H_%s_mg1YwHa>HIPShh>(k5J0&nmqa-fF$8)x+puYb@>u zX{B9lQe3MZzchX|ue|&jC)ZYO0P9hau1+(vr?33dF z4-;>vVVemvsi5=5=J^KcX)nJL2JQ=PWOO9Vh;(FydlJlgzriSCU}5{S=)_@v zm{Vxruq`X)0C{Kp`1@O)1_UeJ>FkM2!`{J%`tj<%O9*qsi}iDHwOSAI0ar+TF=)LH zm6_D~Q!?^DR8MaZ1{0;bDkVmS2^>6q%B;T>^pdmTtyjlSUKAM%Ib-nRS!`8x`qx3z zsY7L-ac`o~@?i;U99O(r=ap@xo&rgK?AaWVD^aTQeTUDU`itwJKArN@Zn-SGO6dXa zfb|YxO=#O=%dW{vj$ru>-xPsi?a*dCZvZ;2kC_rC1c@_&;FS7#)Q?vTJMB_+9xj)x z=Be@qB){MKqAs*Ca<*E?J?I{2@}Bg|IoG!Zd43pc=J{NG93q6k-@tdxxl#XrjJtJd zDg++4MF#2IZ8t>@fsw$6Em)2SP;kT4b19xWD(>|42(M_d?P1T{oIZU;mVwBZO@6VC zl_h;aP(lbg(#Y^>XwNL4CY#DVt@OPJzJ#XGqJS8 zH}Dd4Y=+jP$od@D%eM>1@-1+G&Jaqf*z}WXHXB?3(6@4E;H6ZkqZ)iS*9)EYx%isu z0Grz!4{pHd(oB=vs_UqF#{UDacsj=%6ax+CO?8)c-bs%deSKz(jke|2LRcVpd+v`a zC>r#Ff$@**F5iS3%|&`_mXmKT?ISkHmdemSv7S`f_pE!O(>V*vbCF|pC z#LtYaPFliJ!FX_DFH2Tw0RM(0g>CJeF?IbUf80q@LW_VAz)hJ;E^^YkaZxI3-XwT2 zu6>uKRSR>Auyz*}=9n~pvxUWX7^NzE1=14M!x~~v)`N^f76dt^3dqdRVu`A&VvfB= z&bc;&;qf_nC6QV;Cb1LDx(Xo?xavYHYW}7n$AphL38VJFnGBzAvIi(h!fR1$xTUl* z?wJo(G8z~{zu+ryln%QsbcWeF6IvFltc)$HDAADjbAX*c!x7bgtr3USuHc$HG>D@B zOeHq9z_Jv&BbWu0$uT?|4asYEUSCr3Pvs~a2e|oh#pFjczI?g(0{vDPuNj?CcJwAJ zNk=K9sGzh)WN%AB*%>aKEgcrHDTSYBMAyxR20={unebAal( z=V)d5%s^$=Q&Dh#PQrq6e4Ep>!)=e%w(g^*!%QzYm@XH85UskxWiDowdj>>uWG2r7 zjZ&y%klOgys~x^^MC}=;qE_J~*#5H{RZ0=(0Z11C$whbz$2V^<(VRkDSI4ub*?`uk za505=tsz$wu<}`ksJg&B<|cots%e_7hNd)>9OUVd+F{qAG1l0o`%>gsb}32I8XK{N z&ms9spgO~Uef&OctI9E%crzo2lV?K)lz$xP6Qe|E*-ro*?z^-o*sd*_PyosHcMEu!fV;gP% z`EdnGT=`^}21&JJcyx{Ip>c4c6$1~k#f)beeo6{F&l}cnBDv6?o6tt|VMw*35?8GJ zQM}pBhKF(G)tBH>U}JS=)mmYS|0BsL>0r{pQwvilsQ zoD>Uxr*uWdkGXDspr<~rjE&pJgc-J`8i~MKm5uqi;XpMX*jsdj`|^}C8g;N*Wv!3$ z$JQ)ZaSGPPVMnxRwMZc|E-?|S$moD__Y`0(q*L`332JPM*BArMBpIsa0p=z)4Lf3bjT2Q3uJ@e!Ae)ZTjK z=V!4+AhHeFM0$R4()tXIJ12;NPXJ_pFMj}qg<~Z4o;_NK-Nva8TZff$Bd9Gx>K7xtX<76oD>=oMzW-#fanz*{yaII8tl*; z5ZoH9$I}X%R?&nRZg)qiSNhVN#eLRJzsyZ_?vG8VH4Xn!0Lt*yv7cVPoaw$%1BOTEs}4U=7E9Hn zTdnSyMVgPaC*^euKL~MgX-6U9zJ|+WCPh4*7O5CHD$lrf|LIr(1-zba%`@1fp zn0`wQL41<;Y6WN8KBqwPC+4-6)k~~qU=PsHOg;d zSk&FW`MWAUZ-#6Ju!SNKnj!fFs`;j@>(d_IIoq?S5Jang%zA9Tb+BN`cdou%Wa%|V zMf09a1kQ?{(!dwLfp3^$ZF~%?Vf?H#MFBAXOJfq=3QvSb9%7^Sk~K4HuF%3fU{)-Ck2* z7-yLDhScbP>Mj@kYBGap2(Slju(ux{X?yP-VV!>K9{2rJnz9a840uZ(Y_hDp=VJWm z?3wbVGt2KoDKI1f<5}KDq}TW2nU+z}G1eT6EYfSipTv{Iv`;=mstSRjHiS2=PE4VU znrLy8V&C0tzW}8vU9|m6=sFgC?5~jkBfO8IgPK==KM?|3-ZafoCys0HHxv5J(tqb_ z@e-;G0P8#ffh$oeR1+kA&_c%@OWRE9)Dl~sj)-b!+Jrhe1xZ=po!r{NjVEMw-y$ z#LeG-VWK~YOrj^8Wdlkic9H8$L7a4B5Me8rv^Nx30gK`IJt0^iKog|K7BNpad4j)G zRhfq%92vykI`ZqxM&rkooll=`C0nAVEuhJsc1<`QNB1W;q+I_OD9rAL)NgN$HylEf z;hV+war4DqVywBt?n0G^8_4Q0_G7!``U{eO%eI=W_qKe)9yvBXKj^zX4oE+j-PJqE zq8&!7)NWn>Na}~u@;AMa^7vuEAv}cEn|Llltzmk56(uSbCr_p1Otp4=;*J*RMvQ?R zjtbpRSQ-ybQZJ8G3ABLRwH!E&^VyWVx+TJ#tc5lX*(3^JkZ2$7_v=U75=h2kia4}? z*M~~{g~S@WG3{q`++F0FR`L9a(t*+hzS)kDNEO}eYX{+;}*r@hjI zsjv`_S^NG{kK!jTeVtv#;0ZC=sg{&~SqMaTlLg9-Q#b|8h_)8y`TbmhB$(W_q(}we z_o!L!pAo>F=oDF+FU4S|h$c1`JZA*7fDWvQa4_+zvw|( zc#sTd{|ZX(kF94+#MzQ;B(C_x{_+c^nUK+<1a@sIom!r@M#ixY>^x+dR*b=aty%S! z&oSWoOFL3h?Lg^jb_}(oOCqJ*jG*QUKmH}-zNbgTxG#@P_RNUF@JsKfKHCD?=lcq# z$cN{~qV__-5aw?7!Fo$}yWsAcg!%--WGjeV01tfbWh zlM7_%llWmI0r0W$`em%iHgNg$)>09rt$zoWub{~5;bQ8)_je^~=X zWrP-J2Zi%z03M@Vn?yP9_SsL47^!clxA~}yQc{)0(tfN?ft{_BT{2`hnR=Nb_W_K- zX(a`nExQh>z_a6>6|{a{O^|aD^mrmJLqTw?(x`B-jJ1QJk*-tBc%3# zu(seG&g!hXQ?-6!jaVIf<`C=ee-;wkz%1{2sqSKoRlAD4V9hWu<4Si`dnG&SplJ9s zG!9>y2~mL6`p;!AA|EQh1Zp{@4xT(aMZCbFt`5{1`sZhAmnYxKTuG&0R~35fk^(b! zEv{Cn+F&@}**z@p#^n(j!(F`8=2=#W^RwH_SjA-0GrYHsYcLCiL&yf0e~nW`Eg}FR z&6n`Ix=eIbT?wfot*_fxNXpIIPFeM8Dp4~l@L~_Cj(4c(h#(Fg4!$OAF5i4s}h~I?M=?plD z6C;Z>So4j}%9zLRgxMZXfBXE}w?xCx=O{TWRM%*hONUtKxFlGq4zt)T-pQ^XV;cH6 zI44bE>nu&VN5P2 zxLM7&VCRLMzf;ezW$KpgxbTN8sYy8(J?@uS#m+BwV+bIhI4Ilqf4yb=Zk!+`H51Ln z;MdWT&aAhd8$#!AxcIpq_F?&nIZ4@hB_a5cCth-sWyQWe`t4o4Hh4furu2J!T zuywNRh5?7%Ww~E4LNIf^?CIiZFr(K}yhRBp2E2P}Z- zB@WA~T*n8#7lp;Aq*~U>wBy*uDO8H$*fGb7z0ov5xXT<3hAQ4xU@RK2XSgBc@#p4| z<&Dd$vU95j0o&;zB?PA`=cJ8746Y4cuJR1JpLbj{X~{lO0cU2?nuzz@rMkex>F^~Q z>Hy5hzE+j>e=@($D<%&PtESzX{c6q)eAvxMt*63Q;#ufj3ls+puHr}07_GA;tILxh zVkBcSRfjIz3to*g#H9c;*@B+z@)*fI_uaN}=n3JI8Fj=MN4}X>s$w!#7k)zNb=(m| z4Poa^8&X%nEb@pt)44^A8aX#pC7I1a%$_%}C9KAJe<1Odx+X9V!AebA8_^N`qNl@t z(>_)H!4ASV)pYZ3k|HZ2g~EQkF_{)8-eD<9M z5oj0De-|Js_AZtP8HH*_H-M9%DIEGbb6%Eqc;FFQn?ObtrMfZNa$5kaNxFAfJT2g< zG+fN6ybNEsIF@&Gg`3L!eF8xFeg&ichU%IqfA<(#-e(Cs(2C;=a0i56tbq9KWVYgQ`pmJhgvFDQUCgm zZa!(o6}YF73Vvm)mg)k~!SoTyCPD=fC*3dRRt~RKe{9F+s#BcqabQ3BHDo>p&4soJ**cItVur>l zEd=p=f+;hzkggHDKkLi{4HE`@<)3$X8N_jg$nN@Su}?-AO`d{JTl~<%40C`N*Y?v` zsQ0tTqo-4Sc|_10$qcwfi7wk3yCt>4?gH};XAP=|qoQ}levN9K|VBtDJ zFSOlFMGt4I`qr)Np;lOM!yE>*)$_n?ha*-R%a*-3-YcojsyU%a<3j{;ZrJhC~D=vLWi0G)$3DIkD2gv6;PwYSv z{VZMBMF~4X$E{TDx`hr*S1*Xmv)&A=2~U(9N!<~!>d}dXioq?Kzaauo%8)2Aq4H;6 z6Tt!(E79Lsc>t(091|@O4hVJsm{X@e*zq44g*S;kQK9W zbB{@R2{Tq!P1I(%BO0@vx?DC@uMXE)=s?G$k?feTuL_RrP8TX9P{p#beOrgI%oZ{~ z9!c&4uv_ScuGs~f8@u|&%n>U#@FN#(G{5pX&yu7p2DJ3+SoF(>Z#PIQrJUN_HGk&p zZ7=_>5e{6(to;lv8Tc#qW7qk zY#`eFgB{QjlLSs7hi%0LR)zaJ^sDbuTHcQ;gYmY{yLJgoC{mMLj94}H+0TSuh<_Yo zzg}hG2Roem#qunH;}BnT)JKdS^&|^?mC_=aCH*C~D^#RLe|zPjISE!cWvHdrW~NA4 zl#|SH#_7KB!2mS48{EE;_L%5UC(7I~X$W*IZ%poPPKWoG_ra#b|p zu$=JxhV&g|(<5IPyC;vsg1A-~?ZTQ9)blz{O09V)Ci_a}Hy8b?RK-U&^Fg02QgwGM zde3^pq+Q#*e@3&ie702R!P=sc?aN~G z`}uSWReqd<%` zCI7sQ-p}p=+Rh|TPw?-YKu19 z6EZt3f5`Q6Lm|=tjZvp)%N0h5grazDQCj#?tFahV)9L3|fZO4uqdY;OgzX%J%O&(c~W-;5^}jwH=b ziW~vfM_tONQ#o-b>T}a#Q~5tQGZr+*w~579e{vd24#yr?!u-PYIHRw zf1vuCc4G*+D6Xe)?Jow%wS2SvHaw0#y?V0f7WD0bv zFF4R;iR51vlnzaD?B$Ds#;%8`!cSX)f8f&t##765wf9Tv0qWc!O8}sCR-_wLtwO+G zWITk$VA$SBXx~v->%zflcvsNcdqF~yE*C2`mRLn{WmZVw&eC;Wm zR!>nbm2I}C{8WYcWoVC#s-j@|{Ox23+d77cM$sQmxSGg>6Z3RI_bF=+j$ojOe}q!` z)Qr%+L7e`?L9^)_;=#^HDwAgRU@FI*Ls&OFM*UojoUicptu#y>47!v)2isxxw86l4GLUSy^Hl%7FCgy0Pt{~ z1UaPEmXM*nOlU*%!)}jde;=2UfsJ!j>1v93?FPkW7tZaYokKp3SO$G~*qZad^mQT# zIVB{F1&g+^qDMbP;9LOoJo??eTZx@>?{S z)xGAxN-rF2dKN0rWhud+VQW@D=1INs4~8VDuG4Yt`L%Y-$iM#jAm?@OKpy}R!&gc( z8}yOGA*15Tyt7S!CryNE68p9RCJw>Fjgs_N zr6hxjP1mw8zc=2F4ZD6)qYMu%H6^sQx8FWlUnO|htpue*^Ax04lrS8LX+F(x@qDM_ zSmB(qBeApNc4bqj_+aV{vFD0D$<)7XDZ$a5F3)x@e|Ri&fKcji(4?iUVi6?}XQazl zSzPaJ8Fn51Wa#;`i}hj7g!w41@8S1RNi<6{#F3v4C{8+;k@z z^A8uh@V#*#UT?o_*sfO;&h@G*V#QNr>V#SsNrirrygGAFkD>jfs!Eywr-gwt4?#8G zW$=?ae?Dd^q9PIPjmdP4ul{!Kh>qh!NHG7OlP|^$PUu{E+K1YqQFQe%-FIRfE0wuly{V_-I*cMpy0xO= zOcl^e$Hi*<90*X-)75m)AxUITw(4dN?~_{ORd_GbIdqrQqe1Ij2Utgnt)v*s)Yqp& zf4&V!3)HQ*S4&DOxsY5YVYY<^bW=NYo=to`yCj>x>&onCy={FdIyWh3?eL zM<=is#yxwyftBvNd>eox6FeVCipMAa zENbc0B^6e-RU8YPB4#h=ZE`FrUw>JN^7y2xr^KO~g0Wa&ufBC3wrv9-f}IFlR|oQB zn1__FmJln^Wll2REe5=}#D=Gk-kXX}lb}KkkN?M-!{TS?AVbdF?Sr73DEeJES=ylAuYcj7wU4LFA>R zbIiz7O$pi&o>+tS!cxhS4;u^vDX=NKo>>1v&tZXBQ@rUKOhf zt3xvpH-A8ZVz3kFS48o&F#kXoh5G;^KSDsp|F@^8q{Aua=(&C$=1ebSBaI4u}w|q)Te#S-916b zlDdXRwFQB^43D>V6bkZue-JNxyHudz)n0raALcFr{a-n6>8*0+$(w9UJ@Icwc2O6L zHB!pz64ob-*$X&JOsfbG%NR+5A_Kn`k?to)f2C5NkIz(;sNsJg=t()gI|n@F;m!A% z9Y@L`^1SfPhj@@9+tD-Q33U@hA6_ov{RidGZ1wb6}c?LuSG-ux08j}tA{S*8PEzF}S+OpRDi zAZyk3cX^>`2c`lFf5oWn+gMW~el6YtW~v{TgXwPOh_3KEkzgJ13yoCr)E}6fR7_`` ziw!AO(70)ZI9EejD@U;6-;;z%>Y4tzXIr6-I zWXGBwmA91R77E|eW~E}H|4?X>Ra@}Phjjn@-0553NDFj%e=BxiA&s@Nu55EycRXIo zlMfYxa|x?}viIa7_NzfD*n#WL^ylh)2 z>JuF2Jl;ct(ts<@3dlrZpfN+F*u$OKIIG->&KWl3{>$n7p~4Rdt$|NPe6>4Q-Dt8l z@^fZPd*2Cu6ozkVr7@3PZ?8+3`ZA*u=^r(-v$tK-e>ox_DOjVSA#t=+ujECeE*8zD zOZb1kW5jDW1u^nwk!cPp*ET#wJ`>_@X@yDZloP+w`DgVMtZuDYMw3c@3(GkY%-1^1 zcV|?>OcvVd6q@TpBaJmg=X9Ugxv;KQ)6Wa!>B`gLT^I?0FD5;Qp!lFj(0dCwNl>g2 zSBmX2e;a`-MY*moLTB`|?1CW5=-`prLsvXxWA_)2j{e!;L?$F&1c~t=@5XBe;(jB$ zSA{gw5M`HY$;i&+#viLx@Kl~RujwHlZdAm9I5QAk&p5hBtUCv0l*&{gpAkSaq$~_e zslAXR^Y-1y!r3JY;p0C%mr0`RNdIP{`xzuUe{n&YUQ`$H_<&iAH7-ni+Z!wCfQ7AC z+~iuT&}JO%qBn!;jn+E=W08=O_-I%P#` ze}B=w_S9Q6ocMKWMRHLt;x1Xc=*a`-=-OBf`n44UgkgdSuscOf0E-45DU~+I>L(;w z-Y-aSwq3EFbM5${|DrWr1*Z`SacaRvQF18PO4s!r!P`7&JNk!*K3Q8k> zRuXy&JNEm%dxR~9dUH3F+TXuAR0kTbwEkrcoXIgXornsyeS%p2>JD0w5ZB1jn<0=npE^|(^-{BiyZR$J-y^#}O^ON6+F5YXnjxjD$C2(|&hb>Y4wyqx5fA2n;`t94c zfH$!o%-*qszaZ%O^hQmUj)_vPkJz`T~@UPn{c3W{MF zU_JaZ(P*Y;Zw9S|e?x!_{6xQQ%|4Sb`Z}mMDr47=_r4_AcBreD*UgHu7$*tKXE(Xq z5P_-ldC4%kyj<&}FI)4bY_$S_Y%-)xF_-#j`-wEvGDy9RV&f=v9bensgaWy7Pe?RGRY4g2DVNrP?LamY# zuoMYWo(Ct>p2Yt$O`-g@*t$)%_eK&#f6O{G#!IT!RNhEDhK+!^hDl#r;f|c{%HJyW zNogBUtjALd=EZ*P*K4jF__N@s|MUsFIM2t;nN4sb9TV@>@Cl}rX0-4OS~Ps&t8GS@ zP|j9E%+EX>e_cnz+W^HVZU1zcnh*%WVK<-d7c{txF~)mlg>n}NgBD(}l}3UOTa}u> z5^Y+*y0{G~ew<|}%RgRrllmFa_i>tO6nx(uN4jWq_UlDd+bmnIF08-U)>+U}9~Y3T zy`l>E;#c2GW$G*Yc?)t-nKoi0Ac~l*R$*Rv9M&uzf4W-icCFu)mlpf(!yz6LK%HYq z?DMnnA$P6bvD#vLp5iGBRUc%`j4_sq&(zg@1{TCKuol$i+b*3y@fpoGu!&3Q+yZ}S z|4vfQkt&N4LZQjdtqs&Drkg29zTX^SC-s7{qG(LgI|TbP6i(a|H)0Yyql#V@H<)uw z4ha9Nf0ec%>uQd2tmVF}or_@&*yT1CrxBUBq(oOy^bK}cr_ei*`zNvLdYY_S6RkwM zsJETifSWeu)H3`o6vj-8!&( z#TlVckCj@%@esXJ#i#~|+{q7|P>#SV{D-Y4L{B17QQ&8CeL0*C@61X0P}!qzVCrA9 zZq*%b&E}@G3%xsWK6l|@8+IPKi{-0P;WUKYJ@hTA33QBW(bsGIKZl$5Pm`(KDG@O^ z3NK7$ZfA68G9WQHH90wxFeDTOGB7YTHk0q5Cx48$1yEdxx-N>lyN1Ty9fAdSC%8B6 z?(RVY1a}Q?!QEYg1qiOe-R1Vo>@&$e?^WGfT}7|&cV7)9sgf$Ah^f6XP{Q8Mg^`ts zg%2PqufhXhVPR)tVPQj{q*SwXu>t-=MWECGIyqa~+wuLu7j*&}xqxV5MlK*Rd3!s6 zjDM>QfR!D<%EiaZ&Bww5U}It7{U1SlCq96fk(;F{K%NO8V{Zp^MxYe6ckpzwG`Da8 zdHJ750F4PPfR&e*o8fPDfQT*7$$IcXxLtBU@)Cdna>2S_Xi-rHchX1%K!abaDfl0{%)DpkQPR{5vrw1WJIKg{AX9 zWL0}J7k48kAOJ+Lu`~hNIfE2j?M#7A0FZBhsb#-7?x3hF~1xkzkM*>7b_)Rkhx&Sy? zSXj7uSph&t0MNt4g847wYMu_jzkiv3lR@$OdOO%V0L(xs0DUdZfS@k~Z)YPnAi%}R z73k~zC*!{n0xK)P)Y8NSU<@?3v_tr99YhA2{ewZBce3;V=&*nWj}^f3*XQ3SJk&TlDz{e-?ul@ZYu+>_HO?1kn5*a9tKo78B4P*8k@* z|6Aq%Z@T}o@_!ld{~eEntBuXyT$;bw{~xZAt)-3UfB2wzb#(#FzPvqX1ML2{=ttl` z>naa4wRE-p-&|=IBhU_r*ngSZ{98mzX9-IWpsA9ji;2ZQqw)`3{jUYHv9tp!**jbQ zbx;6|tSl`5iwD{&6Kl}Xa0boe-z*?#Y5v=#xSff;>0jH$#>oXRa&j{AL;$rIgg61- zte`bC1$z8F!2o6^J9`(93ILRzFTl*+3E{7Pa&ZEfMgAiFgSY_9AAf!$ZUD3BZ^Q#& z7W<8O0nFn6BG5oFOZ-Nx0A|VGhz-Cj^&7E+hV(ZAd6)f-K;GqkBanCb-w5Pg;Wq+# zSNs?8fV?aHMj(GGzY)lv>TkpWU{?E$K;G4VBanBE-w5PS^IyaZipA((!~ybPb@#kN^b-{N2gFkfSST@BY;R z1qm7%8zb94bU-0YR1fBT!aQ`oAr6f>iB5i}X7;kS9A=TjRg(m-!zN{FRaY?-)Tg z?f=kX{VPL<-)xW%2hbbS?!S7=!TKNSe|MGxl#BytR_smxFb67-Rj61s8y8um% zZT`z5JI8Ove}5Zg=lu`ozsanuAdNpd%?ira`FAluOlQmAaHw#Oe3WZv@+2r7fu-|)XK zoQbOwsHQG|zkxvK?|<;$KPG@c51JTIceJ#={nNmG`Q- zWD%dszJD{us7LDtmdsJ+8E4Jok-@ky62sA9oO__o-Q3P%nIegS+TmTD0yoo-&WqF|lcz#AB0LHFJn<`Q zBuT^G&yw15vf-D4=NqT-NKj%{8hJ{3lS?DK9GZwxy_cqTHeMraD_HdNPa%ZyQR;$p zNPosrFj2&AuBsH7D7m?*{ZOMZxZOuat7efB$+cTM=+nJVLYW)-c zwk=pM9j?&6pj2iDS@<}mLQES!54G{tGMpp~W{h@Ua(ANfkm&}pzU47RW%GIKb-X2k z5gPC|$vL;Fe{C~Zg4Tx5_uX4H`;I0;0)I3zvAo+oWGSVj!g=T704~G#;tpm%!|BL7 zvW#O$8ECY4MK*Sx<#<#m4$`D>r> z6+D#(HWo3?dOZe@1wsh+lDD~011HhCT)@!0JGCE_fMUzF9G;2!z0y|gp<4oPt$)N= zhSwuDC0bC~J$eYx=Oschg?ZNaG`Jc+yz|G?;h_e6d7v!v)@S{e=Ke6Ax$w64wDOhR zq0wR6@8KY9*P&uc`N#LaBoKW@t@KqiW!2MGoy6LIXR8!!Ho;Ld*GfyA>MI|ap;SC_ zV9qvOXTxe9GrlEpGx;kW3$HW8<#jG|VV;KV#9B!*@b zhIS`W0LAg`8Y}1LGj8w=zZN{$1MO@u2%@jc$x|oAsD+H`p<+EVwn7l>lMTmTL#W}7 zAMhhO3tF~HF*VSp=v9^o{Uu)5)m#yS*0DaijgB)P(m8d>?CHD0tX0>?7fLuE9hos>i)zjuyWqaNjU*57I8g^X z=E*4NgV(7KCI&12Q+g)cq3@=G*@(!Oo>xjZ&q(T<1kQpKG73%^+V zmodWZX*9M38X5ZFu`8dYnI1UF%*2v|`IF2etPN}4<+_DntSg{rK7RrFODXd(FFgaJ zF}r&U@5lIiZV2D3#lsZ<3i`>B*ZgKd3sG~?>%{C=0(H+9HHXJ;m&K>%*vJcm=VUgH z(tRVY@6M&4!}oDWVdfMw0OaGAi_sKo^|~7(R}M}T@$Q^SrMjqN4mJ_F5n6Vvu7wV! zI;UeNHr74Rq&6zYJAZDM0iQUc4Lm|I+7ArgQ4qjr=$t*lBuZ(&WZ%hFKRM~T-{iG_ z_IIT`HKqwVMx7F6z|qjJI*>Rj{{{C^i$CN`rX|^sPSR!-Er_0uvGs2!HLoF~>m?K)>o)J|H%} zWg!clu5naT1lN;;(GBQCz!DkHxSy$j`Q9%-k$58?n;dFiPLksx*V_3h^1Gkw$UD8@ zHiMa&<$YvuEZ%9Rkuu@grg!OtpN5$2@4*MNr6~w?@_%YENQFgV6muQ}2I znMX7~9sY@@F?fjh)AFw`-rKIQeaN3eO$z9C`Af%uLd(Xx>qB5R8WpcTca!MCh5a*( z==nreMfteXAk>~#OzW)hI7okKw12mz?f~m{ecJ`PA0!aTUWt=KeR`u#c`T#BgC;dGJ<_jQC*J9o3S5?$CWHS4r+O<7s=x$T7jlFm{oNXcj7Q>+$gsC8ndi<6De_ zbF(IC41bp+V_b+lD)lMmOWr`-@;Vvo&>+KAtFy<*H)+*^6sU~;%zF%tH!}SbEACzP zOz}}S4Vbhv8mN3V{ZrXn#(Zm`=!=oF^x4l$oBXEUwDX$|a33si;pjOk4&q$Z;SuTT z$`2qm`5tW(i}>FYQ#uFLk}@I`ZH@3~W=zmKP=9gUTBTv{;5XhX>bJAj7O6S7#fXLK zr^I9R_rsDzr>`Jidr+i)JE1qTx!&>koPeLV$K6vcu!Ya6$|Xp6?u7j)PZ;h6;MiDa z(R)KqDVWeq3l%M18~aIudDsKbhVKtO*lOVX#_1|nq5nuNw7m}hVg+=>xj%sIdAuos zMt`blr@_R9>v)(=Tv8TyHKX+CJ)p5Ag98WufJkHP6??=dW78JUn*CW0a`zFic5pzwAb) z&K65raa>|eY{9846nB+ZM!Of4Y)&PUM}KijQi6pZFgM1qF|=Z(s)tQA%6cr}I6Y1` zd`P!4qM1$?8)sQ&6Mm^`rjUf0;_awS1Yb=JDLk}c3UzO1L)`5BLMGcUcAXFYHjoa# zz~Qo@rWJ>Z%bWhD>C0gOR7SGtG2j+XLf0lz@BiA#TqI)BN;i!O_En@umxGvJVSm=U z0fvO*?IiCRiu0yor(3SNXGwrmgOdrdGt1WrTz2z`7^lcFXh$^-l8##CQ6L*7fUk4J zMFQNwH&9W75$_Z~U+lE9I&%85ny;)<$8ttT z#-nnvfTZ2XwDgPMo83XgkH#c5dbG+h=!;fncCc|{4iNJA|d}(C#HzrpRg)!XTIF70r7vblFBG>f%JwvVaIh^6PQIWUJfGfL#e#gyMjsW1YOlzF@k;LLTU_x5yEZj6w|?3h9UgM-qo zTH>0`WDcU4c{acFYsY#|vQR!*+RBI7g;_Dr={h92V|hUY@l}Qa4wK@A9-m(b1ilF< z5h&2R0+0JOSd9}N*v7J_Y|p0K zB}i5oYeOgvb9TZI5~y?O(p1={KCQ|0po3u`n^+7iP5O4cGPSlduoBGbxmAz5whL2^6@M`v=-we}1AVerR#BTh?#L?9 zqimMT3birN_9>ZHH~H*PxVJrHp9Ergmu4V>s8K&Uok*M*YP$Y~vbmN9$xOy8a(r9= z9b!fUb#i?j9K?AOvI?MqZ6YqrD5M={C^-LA3j<{#OuISn`bC>4cy`7-)U*#?op+Xb z+b8dOR)1rvL(KpKXO)V8!XTppCscqn?a2#sQgTsp(_`oWi5Vi2tgf-RTH@};9=f#t zJp)}rOf~M0Tht};MXd|_MZR?-s(35WRlLCA>VYEH6TBPQ4#TpVG1uN$=;avzB=c>i z>!Z7oxJyiSJAmAVG{86LD!v?X^Ci0lJo-7*>VHRgSY`xH2{j#1#bTEcHHPV(1y(74 zj0KE*k^SJ03X|$M)T!G6k4GAkbIWeLD0jqW><5MMX4kFcAIP`w)J|{U;sr{@^V4ioI2 zdVhJd=G8+J#w2}vh0ffigM^Ndd6qq0`s@Qm)0uDA=`M=7&l&GU)7(tUzC5 zs@96Fd^XlOZ;{#KDM`jV=cXg0A_WVWoXo1gxR0TtxbT*II4zD7GPLPH%jqkl4UXog z@^K53N5N}_z3=YJ*1gR}QB{Q#FF=vAKYzDAV0ww@pHavrjG+=X1V{U>njX!211uQ3 zY4~zc6E-|E^$91XG1(+D!++JXBO7tZ4(U1yyc4{$la!B+op&w)LORlxB!BN6 zO*dx?wA@c`(b5|leqyr@2Ga|d?F1Y87Js*+x9)F&Kc1D%K%S<5c5Zd1r+ESwuS_0h zr4N%&Jn^fc+@-cJj~i$59#r{^O!u8qtP-DLvc6OOa0g>aX|N}pu-FPFNrG>@el^~V z0195m`pnxf_~Y2~V(Tt4A(s)=)PE;joL^=xuWn=#I7&QcK3JdWA-((*0y|ge1wQyk z%HyElxtm?X-U)I(ZN7#_a}lqX`-?26OUrzsj`L;|v8ki5;6Jk^uT*Y+$4O#p%0l4E zPG3f{AZij=cB4IuGV^K9hqdcNzaIY{YU5@uvRcHun${WL&QGg>?T1(1bbr_JIgO;S ziuxm*zmWNhySdf}=lZ3`5~9;=83#RtuOMbuM&q2n>vXY!wMW87D-gwrE*XDGr7y7D z^KZ+@ryq&FFJHDpclF)K%89Nzk3O}sX~#-R68k1FVgQ*9=Nq}y@{^7=id|@n_v?rg z=lApK#P_P6-*k=DM|2>MEq|3d2erGExV&PURCB*e?FSxMep>G+WV!aJ@`+cw?Z=-b zpB!F^UQ!+j$08@p=m+F!5R;gy5mu<;db zDk36w`;7~w6^E-ar&nozSOcxBSwy%AY|hZQy_pw65T}Wf6JhN#e}5{yU+C+x$*;Wr zM5cOhtIrlA>mKel_aMSAz4m=cpfRM600Jmk>buy#0w26|Z1i33%M=xcP(tt+qYIM! z&Pyf}Ol4|5pvT6{2l-?xZSw;~78tD_bS4JWL06?tePzdi0H@%N?r2eM*f98q{5PV= zbvBL>vNH+t!Zq2w`Y`+rybVtlzHDMU3v0%t~Pj1%cLHSDmZe5O(BRARe z=~tHu7+ef_Y|53Yb8~Dc{WR>gRT*W+;PB?c)8av&ljClVOifl`SA1Pi4Qfx|4$9~q z{x0mD)Nx8xpy5v#bXA|^8)_qLQf{5w1#PMTrVnniyulpaet#3y)Z$6FHaoY)>#GkR zc#*iwd!y`BQK@`S#wFx3IGtF1H4n1dg!reVhN{+GU*}OQL+>LjA z+U8RK3M?LY_CJ-Z`p{|D6xS;&KOUL&tVsM6oesQyUVnwo4wwy0IO@|7vana-^b8SN zO>@ibZ`OVlrfxW;@3!?!<=hc|$LEm!9ed#X7o208x}oO;0^0^$-m4!zmGDG^f(w6e zbnffD0OVv1;(6Tijr~zimll1Q?BGg9U|f_$-+)V~S3h%;mx^_O|AU?vL$*yHFMBUl z1EPK`QhzyC%$w&^KUH&uE<#>-gByK;o8}>A>yfJ{+asiORW8agj9<<*fq8J+XJ>(X zG8%_n<@S=>Trw5q?q4OUj;tP$#&~hdbW!Xkc*mD#J)Mt-pTXg8 zkAL2y^yW90k5qn8n`6Vj_33W4e)V;Xb=a`}+EZFMJt~&e?7T@X?7Bppt6&lReefjx z>b84kZaT9;U=h8h!c~~Yq};D=HEAKO;k`_JS8FbkL8lG#(pICSaCjUSM}Y^leR+ZE zSAU^L*L@B@3vMGT$+xfW;0s^E3daiO(`sIfd4BkC|LXHUI5faa#^?tZxg7e&<}4_D z;`GBhmWsk|cWyGA(5`Z+%kT;7(^R{uteApXXf8?hjz1U6U;qbs8x>dLO+5$ide!*s z>&?Ul#7 zb#@n+H?i?%%*~!%J#p6T;6~DT(+Y_X{-!9kqVbFVl*|>T14UWW%NAb*+b48iduN;i zY^PsgBfuBLU7VtR_QSx4)+}<}Z#&@l@Oyd=tR=J470(mel1^ZA)V9`%0?l=N(|;Qb zON;S?Bgob3vG;9fC;@=$zT?GlIDzwkYyD~Ajnx@1lfZAW4$5VkphLF=jq)K4eKZgFNNpiVwm=6&kO;wFe= zsjbiY$_m>^Zj9LbcxijfQVzx^a%9QSxtDu9HQ2tsRLIi<#t;T%p&$^+uc}=m>qW+@ z?!Fq`M3LX>!o_paY~8hDVT85Dr)|Hzp|8|*aIKFd`OKA_=sDR^v|!u*eSeh?!ufE} zj>77qyzM(T8{Vu11^Vj~?Awz))&I zOE&3Y_Z6W~2>A<`Ya@7!m4s7(bS=&Wywy_bt8Ai*F6Woi@Ep`5i9HuIEEyHl=Hfd9 zxAvj9i;rpi53?KLvDJ*Qv^ir?`UqwHy3S`RsIGCWfIuRq(V88vRDa_&*!G(*xj_|h zvYaf&R6<9P%ltyF=%@zuh1V)=@9HIi%0G_^dVr|Vqh$?mGuR7La<_CvS5@A|4zKa`j=XqHK`L@~is7A&4=qB!5uC`825Yl!#XSojtYl3a0r9c^7OMGQfIDz$M(*BE@@X)BTI9 zplpX^9m3sHdGqjx7coe=I|%J|S%j@iH|lZ1#lqB`-_Y#x5PLqptxtY?F-`x*%k3_*z*g^`Oy2T7T&7JQ>g&+FY?XB9irm z?dMP}Qe@VTi_o7g-0-e&q4;iJSR+U)Jq5^($~7LpVLq88d;4xY>-XAo5PziL2%&3s zXXi;jLia>e`tg~Focflzxk5I+&^3u!lhGlx?s<4PFD_((NtnJV8NDXLxY{13lWc%= z@?-E%YoVMkuYWh&_YFVOl*Oiq<%$j)>R}*7C%XD*Sq3<0-L~PSadr6dIKCyld-VS$ zAg#mukWZ8NlMZ1IolC<)KX&nBP`v}XD3`#6t9wP=esf|1C+&I+cW-V%%A&HbQ=@`> z!45n+kCB7@Q**EaN_6LY>wL9sT{l)hF>V76%4QGZgnvtXw_>WuqelKOXcokXco(cV z+inyFJ|nAu1sKe|uWUf*sBPGs8*8Z}u+engkEP(^Ot4q(W=4ut;22&oL<3}mmw`S@ zo^83?I!=Y*(|)DUyD!$!ligjrRjGcMu5b(yEzWhW^Y(u z@-UMNi+?U-WXQKhuXXoh6q<)f&C|y!QT+{Z;ihS^RkC&5$FbB92tKPQ zt@yDhK9M>1x@m3i2**^*g?VeU5%QqY zdv#s%Ok|V`QjhAaGxV=r+w+W<7w=miK{=lWsejAfr?G(#SAAeql$IgSTi83Rq>F&| zy@FkFCAH~l@HI$w%>IHg`#`o>;4jk_ucf^_TO9v^Pppk>S`fBnU*gf^I|=wo$?5Ub z9p2E8V>GnnO9uY_0nvhI!D}i-cqR3W^m2}col|t6UC^aF?AW$#J007$Z98vlJ6~+G zW83Q3w(X>+|Cu#w&E1^aQ`e`~soMM5ntT6(2+07jLgid;wj{vrp((QCNVlVK1If#$KtU$Pj&0FRDu4{ zbI}p1A|sNQjXlHYkkamMOswQ!2z4ql{&i|S@U!ECq)R9(p6J^R{c)%3Dt`?sDFdU0Jb=8Dp}qix73zlI!T z)`F(O(EP`qbeuD=!7PB!4svAdE{*(C?<+M%g$%Ibbr-?z5q&TB^i8t0dIjqGQxLQJ zQAOJJW~~MgE=+{17`yq|UE`;b+T^({UE=Z(LEanu{*>-k+vU*p&>~t$4!A=2R#0)H z9VOfP$K@V79uAQ%noI{1kYs&V3M*jW5W02xQh|rIj`67$LxrL2Ed>=n-$ZipXdT}` znUZZHP3Y+>^QCSFUgY-`8v>(QG_-nf%@?u?T(~J39ZA{)a6z+{V+S zhi@DxBQEQVe6)z?ZcnT6Z;n8XJHiS0oi|zv-Oc3ga_iQ41j8O1gqM&-hF0%u+#Shyzh=xk7$o;WR zV@g3oSU@pa%)3t{4v;69SGo%;MCif0&W<0>P{jBb)3=ByjUhg&^DaF7-^px7Su)XC zPJN}EpNcG587PDq#59nM5Ov^Ekcx9W`Tz!L#$KGh6mjR!kSen{ZNl@K$u6etAje1X z&5qHmz@}8oo8mI`_>Sv$(z-q36d&@W07s%|9fX_))n!&`(4D5mZFdy)24A*Y~(C{;ceTyLRK^ zBdr**szFWM%<{rd?N~J947-~Lky3H<$HF<^K+LrRyVDxEcWkf=_E|xjv3I%y;g!Lf zx!I{*!W6WUT2^n@G;-))cckpn2v$m4`>t&Ir8jUI0stfFHRH6B7;~T!EGMXuI!Piq zCbYVG5YZEi`n~-lrMPBu9V^tZO6>q%b|~2Sl*D?St@GwuvO{&kK#t4h8oTb}YAOV= zd@bUvqs*TrQrR11KX2CuMZCBSJ!g8z{b>7b1Ru$h%?}js>9MzM^&>^Ic!-T{YCf>4 zvf<>V6JVN)0DK!oy4HQc@$G(dQpGfdTlaI}^LYSTI zH}o83FfI6oFnX8nZ!yf4pG{uPC8YKF@=kc@R=|_{DD-ftGx?F$!s6%mL!?ix1U~k( zpWpuKf}CB+eEHtW12%5%#78!l@-FE=(y4DSuJGP{m}*}NhW>sz{A6PLf5BM@`!3#B zcWIQcEbk@-&Rm^aCsS#g-9c&LU?yd@FnN=l`55hJKunQJcxw7PNn{W@uFcmu{|-Vs z20(*0il8@wun~+x3)8FJk9ex)tNGIUQa&p4seDbRHOPpQsex>hx=y}kWK4H-?ovc< z_S|br_`5~YI`=8P`My+G#rK$Ue;k_wz89K9&d(R=oM12)sdQO~y;(5>eoj4aWT92Y5#&3rw>l=B1fJy76cP@|)6Vh7)T%Trj6+N%@hu5ZF4ge|-EsjZK1k zE|L3N0P59&ySU_oooTlst^Nf``UMwG6scdGlQ&;>!A7w;tfS*nmryed5dS5q{`%ir z^c($4k`t3$&0)DO1&+XX5GIbZ3?Y}2<;wc#?T6;-Kkax=7ZLF$Uu(+X|EeACT+wi!X*|Ld${)w=mha9q&0zZ}HphMh5TMr3FN zUm#yy2X>VQFFG{}D9>0rSgs+K*n@$mHiV%jkcM1k`%LZ*`?p56)j0Mek!?CznDd|M z6|SA#hg5Ne=^z{b#A81z(1r2N9rDRGJ^zmg!((Do41d`y9svFL4DgGKckr9hWL3FJ za?CCJ^8d)c$&}pAqfxwatrrrDn9}JBsvxVxC1tz(D%9`;)LtvbYqKL%5l;L(CeViO zh&DXy1kWkVDm2-~!NW~)jHfiNFC^`DW*%{_?peg;B#y|I=TWC9Qs;{mwi)zzZ~R3) z#KE69$OFfo|h0=a5pl**Jv4kH>C-;U({Rdr@-G11Z;$sw8VV{ShD?f zJ{yeA znrFP%=)im{x#J&jgxx!_ub6DqK$~-R|$Hyi6 zXcRAFVUs*Lu^gA|CG9TyEy+U*a{b0) zG=bUxLNO%f>($aEAqq^am&DtEtGSZy;EWE7KN#lRdCK!=AI0REcO~$2*WaZ)Z^kDB z0}f_j9fuNdB5Y`%T6Qq;c%v)CYetm_tX3KI#FDMDmoi){uR+*X$m)5y&?B+kuPdQ| zQx2vwW3VG=AVVE}%O`G&=gj+`dsBZ)@#l;|g^QiN`cu|Q<+GgGtw_y7dQTQ!JMJDQ z)bI6+u|@g~Hv<$qZW4h9!RmQK1aq&O$&Y0$`}~|jai0JDDVT3l%;oKZLu#cMCe2_T z`E_8fzs|IY!!G=-XeBEj;;KT*-Yu&E9Uoi#EEx!Z^DD_k(+m9gHPBcXqI8pf~8*S{;O{w&E)Nd!CLWgd~Sp~3H zvz{^a3wtw#k=|l07!*piy0>b%`A)&PSZ*a$yzPJ^Vi?Rw`j@;H zbX@DQP@t>m%h4ams(e7-gw^Kb7-aCAkSSm4`J*i>*=!jqP=o&;iF(E60e7uPYqc7MDGBx=V`3lxEq$hHM{Tz6J0}f&G_|=Grnt9 zGE@;j)fj$BQ{&1_`I;1h{?Sx_M24CIHjsB|-N99>94?Xnmxb>lG%@<%JP@@DWki2; zDChwlp7@_V;R-%Ja(2t_c%+qwKi^`Z*Aa}Pa6K(uLxJOag z8m+_9hDv^bV#FRPy(U*!9g~$H2#FbTHzn{SIib0%|W6WJgEkxUtUkNg~be+xD8ugGXib)YYv zFCLf!J8IiD)CM^(99B||LD3+i!muU4eka3<3bnu)m`2vqTn>U=GMGogMUSM4%%5?I zAC>~PlD8uzsLgcK?`Q5X3 zc0oDr@?RwquXmJx;!XThtF~E`4wV!9u9T zyLtD~W;W0}9JRHs*SOFr`lHYVr(?k}=%#rPrZ)W{EU4^3jTeRql@}M~+=1y5j)5T6 zgpTw1P^E4X5#o<($1adkXt7kuUl6r?*=W>+8}fSd;4?*!ek<}F zLmq~YkI3Wph}04ARa2Y7+|zqq(N_lo+rwN=C{gq8EZOy-?*8_PN+H3i`ey3|1}P{B zZruGG0eBrHs;;O9xqu74_x zT)#qRFm&O#e}qa<#502LVhL?@HBC7X@`!rulMY`VFl8j8Ho>5OIOl{+kr6%(v z6R%ksMgc+yRlX8&c(Z{&zv9NUk%q6{gyR8cN#;tJ%p`D_VJ&PJg#n^DbnmUg?p!Tb ziit+%N4$K182y!rQqy8{@0gG`-|+IWSQbz9+}f@96PyB?YBEN+RKC7O&?y@bn6jUz zONZ+q&Wh}UkF-!dx>8igL8x}*>EKlAuEG963= zx;tRGDG1}QUD2OdSQXbI$jycIkqatcFZmdo$7!*R^pLhaSX`iTEA^01D9~OUZI{rd z_fHx*WV=>ljzDcS;|4Bq;&lNb9h9b8te+Ug#HF6nn{4xki9UbsMm5Vsn88$trVUHp$SN#b2! zax=CEg3o+RqpW_z-3!Mc1?E|ES(iofo(T+^@aj@yqd+Lu7TS7Sp&vwQzzC$`?aICB z&Zz07WR7dkV)65dr#Z+FFRLRU#FBN-NZ2ho(NJ2pg_a%}GyZzur0s-%-=o(!ehlkV zMK~(SQ}NePPHrzptZD%wq%50j`*21nzp;dp|6|SAeAP$2pXp+d&51a*X6-dJZVRQP z3oN^*Q$@X#_a+Qw28+AEURZ#m%{xfpKHb2~4MSv-b*M# z9&p!FgE4pb=1Iqmr(k_~E3XVLCE(`{f62;kJXcs>eO8j3#AITP71xGrRV*L93YlDpw=;Z?`d4^vSiZ0HxqP)-iK76Ho$5@(d zVruD0;=#n=RiR`_t*JcY*mbJaEICK{IsNqf&j!l$LW4&OuH9!{A{C-;m_)*Z7(nXS(FQt@ME=Vl`9urn%M=Rk=liznBIl zh=y$)`<^C;n2fO;f!38F42w?wF^--y6{N8p{AlTAiEG60+7HAR?$5CL$EL%d zhwa|K1!-9o;XN*+ihJF_qGA6)Cz9aU4AWt|&gFh`c@tnAF(2M9&JNxb;7g=GRP^cy z(`HqtXYdsA%XnDb=w{Y7FOOnHZgSJRk2IiP3MBv@ulbnA-MHimie16121)$oXj}%| zZadO;q>qrVJvvS8+xeesb*1qs z)Q?Xt^@-aLsv`wdUj5iQJm!&Yqt>})$Vj8gy`cUyHWXM6DW`Jwbe;S)2wIiJO)r4l zyrfh#KQ(4`;@{uY9p+BWjw`NaXt1o*kAIfUMp*qya4E3T+lrk3j)V&vWtC!| zv(-2;R7$j5g3bgfl@rj$&&_75*2`+|>PD`uRC`fBAV;DXj;pASX#RPIL0WR>mdM_F z6is>?d#GT56hNkwdDKQ^(Hx~cqV8rwu@WIAX8V>YMXLi1cn*h7p&gxwdsaR>Cfuw} zl%dD&cIwTLVnc<>;w&C(1XlxYCiUla&UP6@Y#g_e{g7sz+@P^+w|~C`pA5!ay>HM$ zd+goCqCGt&%lPepn-WB}8aMNi5l^S&+WPi~UuG<-mAMcs4e^%7MU!SLqMTVZZT1tF zE?lIYs8HW)**bj^tz5KfDBFT_j5y`y@tgnC227)xts&V!b6L8KJawzZRQG5*$6o8~pL^gY za3$mC;-bt5QkG;T-EobK*~e>zcdA?|l&+e~x*@CfSb5BWbu+N(D6&<(hT=do^=Eyu}SA>D~^T>zOD#tV8fXBF zEz0+Md@kG1O(nO#mnIX<^CCXw!pn+MEQh=ZnKWCT^8S z%nUu~_`*@0l)k`Y=%;}Zf~e16b}3oOwa>(iV3|!lktSIV_$`=BN*r87N4~+qoz1pO z1e4n2*vbUSCC)X#^?eMhS}P2@blj52QDBCM7#J_y#nvcqOL5>eS9s4XSz7=UK}3DG z86dU184CARLnHbygBlWT$LS?t3Rf&NjYp4P4~aY6g#7bgw5v{&2=Q9e7rk&hBO}_T z_+uDpdojw%c1UM5G?ij%jgQt^-|-L1{dJ)vleY*mooFUKE|Fk~q~yF8ndsZM1_i6m zvY)~SIV=fx`|z*J1IvH~GL4uZ<^)Z5QhilLorohE7b!DJo=NZ%bu5E9rSSB@Niz`P zc=tw=mjRUo7M?Ogu6-m_pZ}mHr@SPlmmW)t0WI=}6)2vw>AvG)Pb)k%+l6Ju59QvT zY$X18N9j|p0fnYs47_{irZ~1}N2?}`&Gy-T38EGIxuo57jPrCJOkz;`a*9S(bf;3? zIS~oNUU`K8$?QO&RXBqcgsStMxL3?TSBfz(A)bSD8CzEjG2$<*puo6^_2 zx<21>ce5jd?%BAeT~R;6`I-Ev2oZR)P7JI9LrIlH0iSN^=U)7k?yp15MZVt;vjvUu zxO6bIW>d2o*Lc>I<&3(CkXRR4TQI<%cA|w#r}w8pfuN(S*3QGTcV^J2#cZov*bKngY|1o>A&5%hss4W*`& zq@m?jUs`;jB3+HNL@jJ>Hp(I3<5ST|T88Pt)%#MfL2MWl<~}K-rY7`=b_p-bVGd^y zmT*V^5^;!cjmKto?(7c6PLsVe&6YgTvn}Y6`L-DRLN9*AE@;MvtHk+;F(Klm9>@%} zQOos?O*o$HUQ4*UowwP>=ow_2K0wRtlQqxO2WTd~){`Mh_LZ+nNLyu^-Dj@FHgNbE za2V!1h-JuU_R?yG&r(_v;~dAx?m`*Qrd?+}ykVb>872Pyh<{IZ43VA=<_zz26XSoe zY@y705b#}DoxV%9R%B+Vor};91B8*3F3hF8YyLpRA4s>hiS!^ybLz;~FTT=?Wh%}F zE?97$f^INQ#d%25%~&5QAE~g%$OBYXK9+k^CV^SBiX0t4GtAz8;2^x9Q zju0}(xk_K0rlm_gTGp{J1!j`110Y+#w_DNvr5ldg$+p*R5&5<#4hHZ@FxF9$B7XVF#vwqO+(@Y(d-JwW5CRefwj+)<%Epm*>;ALmONs&#-5z#$in~wABax*klim6 z5sv@Vy*kn``F`KJ71}!Zmj^b3lxm|7sCNU-BZd;n*e@w4{Qy|HD|dcgV<=WgI4Z%2 z#e1Q7wkzDkx3{8$9Xh8h{KRflZRf8K$ln`fCFe*qEzvk{bh8fb3NYC=lzVs%RhPmA z6#w!D+{CtcYyB9G)`E0;X^WA*Gw;+L@hhIrS-Zl&`tJ^CbUY!NmiWM7Z8Aza@NmDA zdpD8LKHoDbCILsx3eJvesBsCyoRNDp!+;@chE3{A=)$6)k4NXy!^7t8x!(kocj~Ug z`LgDw=LQz+i}J&kn&b-z8Gq(L3&5TJrK9Z@_?Xl#9gmHga%u$#JwJ z#Tj=Y+iKd}qpAGJFYZnmMP+^XUDaXikmp;S&=23_#02#Hi$M;Xm=dRVON4mjrIb@3 zCw=R;rc|`*o};T6=BJ<9-#GbE^o%abG^!rf!0Q)j=$rd4CrO8h64ICKNnP-zJ4_FW z%yiNeWPiv6N_u?zcNb5Nn_OCd48hQ+d(a{inbke^-1JgcT4<|aHfF|{#d7qw~A2q(g7DCB!D?r#5eZQ zDD`pwKGoB$=Wu5(20hHW3%cpPAl3%`bCcIl_!kKDVe`h_kZduup7X8RDI?vp7Oni` z3dOBn4e$t4Pg?zG`)_Khyx&5n)9q$tl+;IsfD1Iyu~U$b0d~cX@r1GKHI+X|z_o#9 zovI&6MzQBltZJ|n{drcnv{Gb~H9WIPh5d|TFa4zEh!VzAVbvIh)hh$Fmc=gk&z|09 z(KrA*d6(_mAG+NY6{%O0*_U4~|B@z$icoA%M&YnixuMg*iZEFUFzD9trb))cpRvjk zeasR6IoLI@y+O+C(rIyxocp7LcWnyFQ9seeEkrfK-Eryzvw|-mIvrBNcZp#QL19-J z655)3du)Xi$mf$1h59`Gv4TPRv*C?lMGC+Pu?a=(=F{J&ch8#*raEFh>diaZH4DKz zbDzfpaV9B1QIF6XXsH!R{=6d>l0i|brp~T&YO4LG7R1#FmmC=o4@hbzYP^}Y&hRYd zEov+Fp_yzv@_Go#VjkOfa?wd8kx!`a2)6KDy?ED|AiAO!CH1?;%m${x=llF7?0`iG z#>X-{E1a72rKBdm$$9GFpVR$9KJt)+tExW~vZ1q;KD)lPH>aY8wH%(9Ok9Y`kKvVv zLiFKAdgbH7T}ceh?^w{fW!W)&i4y$$b(>PUt#`O%EuJI#Bgjz)!20u$reUs+r$4tG z@b1}yQZD91bK!>{i=|e)0%TEGh5*DG{FvKReHt2SFReucv_Q@(77+di&B)nhjgjXG zd)DD0TgXKFJ_hu)a5{yo59$J@HX(va9K*=709UmV&p#2RtCo{j&5Q&y$>G11=03tn zHgDmi$Z2)aRQRaO852)=WaY`Yl%~YE8m!B&Dr>a#a@1#1<>p^)wenVR@=&&XYW-OTsCOU6Y zl=L0nU*jT}Ca8{1MzDP$RcbHTmN#sP929)fT9!wr^k>WtE5EayQ16XJNuEG{>OM=* zxLA=%7Jj-Heu6iKDa6_D5&|4g@x$-TSWQ5JJd8Lvj{a4KLzRoX{`jPSZR88=ZQJ{# zCQ(Or_kFk$uWTPgIAu9z8b97~1)Bm~vOMx}Ywyi?)JZ`a^AO8cv9!+ccEHF4^=kjYhySaU za+O1@?C&Q$1!0CwEX3ysAt*QG%tDLTf*H;Ig}|{AX@!_QQ=rOsJ;F}8n+2*~rVmqn zIj-#{Vm)m_Y)v`G2Umg*`cWbM`^L|FbLM($jgY^It7;&B^X#q*j#++5js3Qz6&o(v zxg6NxVQb_!b3QOI#s&DkgnnS_*45vWS@vh^Or0wO!&N(P4k3wHuuq;fIfvA-vHr-H zUa=Z49->J%-}8o3wyABu#3Ufu%H(93KzPy+uYXN-bP=~F$Db+ma?7V|T_Q@SDf~C? zc7Pq4Va$$(ydx#nX|wip;`nc`ZZ}@YYx3Nhqe*)EQx&}(H6H*sIxX|)u{{+2s_Ytj zRVC}3Q!gYCShCK_2P@sB!73y1#qob7k|_f{5(J^)8V?Me8VOa|=3 zK1v3VWvsbnW2%yg-W0ybhJ;f+Gvs==13SGpIt#F+>M5#xr|-H%h%D`0at#I6c=HcYIBN^nPzf$x=_ zECsheKYiFN6G{V?1oC>8z4@8$!ARHaXBq03O|)yf1ubEZgec16l#I1gim5J$A397q z4!boYe5zPPRI9~0Z_W^QL5X&V8i$8x|Mr^86n>RY_+1g15_M57kJG5Sx#sP znygn2I!+Y2IZtGn&r4IMN^H?F`h^0mU{Cbh)69K<~7NN$VqaBR2Igg(EtDJ}?2G#7$i6qMN59~=-{ zH{IH0(3ZGKUyeRWwYP8{5OD!e2pF_xa-)Sh3UqR3ZCBhk%{@B=Ej~5yQC}ljiP4c) zlSChTC+a4kt1}X1E#JNxj1JS9yZ>{CU)J>WudMW*5!@B)IGmO&QO3SU&dPXbCK$psp`ohsC@7svtjiXHtx@ zk`7<~i?EV^@YM|!VgMfk5|^02nXJ#=wS7dAW9+&JPRQcojd*k^ZFyq$y@m(;9l)dJ z$Ab|a2s?kEH!0isC_TH_HQR4Zyr#0?_hR(c3BDFNkO&lGotX8+!izH?pMkya6fCjr z&qD_G`_quR8#9Wq!f}Z{p#GWAKcaG)AHgLni0b2>PF{rX|CusNz(&|$ z0n?tlqWYhc9(@E(3g_;NWNN|C0U)E+4t`Iqt~#VibHdwhF}cvSrKzODlVWrgvi1bUtd9q~j$72ywo zX!Q;SZs^0xNtevR_QfzI1?zHFu6)M1VLxK7c{PDof3OjpUjV+d>|G}40-$U%5YFr` zc=L#Oi++d|f;!0R1n>RD!=pb-YGkJ5=|XT>*`l{O2Y+k3mk{ttCpPb(-E$jeb9|G) zL)xUCLG#1E!V0z`hIK3MQ*54Y;vso|(V!gbJ_rHw$l--*=SDpjLS@A8=$m7-Co`IP z#5zqPAI8ky)Wy}=%*YPLthJ8@g#JGe?)2*+5OQj6CT>=ye}{#IRht@yQO?0s)X3G0 zh)R@)g^Bt9y-b%J22n!dCZbX`(MGVF+eUP7b2~ zP1(EB(s59cg7crP%Xm>sZZ{}~si22(Es%kJsqq|3D^~@L`j4pLufO0%@&dOMB3r;S zG&J7IL4%+{oQ1q`s=9b;ag4??xLLNdp`7ye0VyqEHj9{8UP@>s1CF<5yu4O4FcU|& zs@mA7&z(mUGjS24aM?0WRc1toc2s@;=O;i#oriy@1OdOnP-V!T(hO5uoTx!;$XhH$ znW{>3lrIeZ3r%ei+OauG-3G!Gfs5!#fCda9D}|FrTt)ojqiFmA5M*3DboFn*l8dVq zsKLlnmpMXuwq?ttPt!1{oyC+n41l1F_DFvitg1Vg6-nsEJ`s)^Sst;2ct53SGx~gWO1HuFe9o|VYB_p}W-(Gb z-|5hkeD==VHUEx*OybxQQv)Lqe*h>bH7v}>;HBoqNh(MFNDiVDIBrnVN@vcc$oj#( zH~x>D3SP6G z(gYGYgc<%NtP^?Kbnjj_W_PdplF|p;$HBkkoR8E!2{jxlS!LCo7Gt90pA9H=nDVKc zEaS7UD?2_7ddWF8%#KCk6^5>3Q}HEX;TKG<6_JrE?u(5Qxf~973zN{=Af`N@k|^u_ zL)hL+R9&DxmCT)Y>MiL)ANR(-GBg$1Fh$iRu$bjmNRoZy!Lp}_#?b|=G)c>W=ScE| zZluMJR zWpHt)CluvYaA0QtscpXLZk|HpbDG_*iVOaOFGOPtjXFrwR)krtmR=9Bkp4}MWo?Pt zK;p{=er8d=YGoyqMxV~AMw6rq<$!?mH0F8Azd}@DOLar7A`L5_r3$cjm;GeaR&bVa zS9VlY*QMhrvHnj^l>l0ZK;?8(byU_#*)}R^1@~?B*k{dnp?`EH_Lf1$$iekoKhXz= zk%SpXL`_xOP3dlpX*$(rg^XY?v#|V%`u-nf#3TO{N7u{h9wSpj)TMNfYSB2T;E6sq z!C^yYPPB|dpiUG;#RJ%ZcB8QHw`DGJ)TUP=@2(Z}#5kbzKLYBUN97_$o_~8s z!?TIiTIpW{8ee1@Z)2Pc1)&Zh!uWJv1jVcA1Is`MyJ09SvUDM8{~fV`@0Jl;9?M95 z>DY=obNX8xagU@!pL{Rj zA9-}G$)%$OyD`9>uL5+}Z_5cyI`KHgccRo71iGh3bb*H@36wmkU}>FyrnO{>G2AT5=y3#;E(Ms5)|;x5X!kOE?DS*L zuAaV)z5M;&{?Qic9exATg2qRN&xcRZ8US7nUJnNjEFo}=DRU%tkg${ZBCP6zfiA*J zj4gD4{$}VUUpLn9>%sE-ZEyd6pZ|NxiH(@Esl~$b&XfJGqnH2f+5Vt#|L5BxRv1(=W-drSfSGpVDJ39yC-9qH@s1x z(=G4gv;zcQUxVi?@*K`IjZHF)#g~mT%Ks%h1e5Z(2UM{>4s7xH)J`M9{n z8q4d(mh8~*89tcm=VgnH!99dB`FZHGxEI8~Ds*X&dAY#(lTsm%>A9e($VfW>vrkZv0FU zwJpF65Vdb>*@;}=ZgcPK{5P<|?fFV`Sb2BPu}OCK=w>eD&~;$fw&m;eJmCHtaPsZD zcH6aNF7S*}>)`vh@1dEQ;JxQdJ+EDV;7V?D+5V$6k1g#nYXs9%*nqFYw^h}mT2fGX z&*XqJp@#Az?OV zCJ`1UF?KcLZDF@~gfOfuEHLEcVhZ9g{|h9>hQ|N^ delta 47024 zcmV(zK<2-+p9hnn2aqHKH#s1a@SrD=PP%`v4drEk)ixsEr&t%EW00F>3&%4;J7n+s z64!N_uNkh(8kIFp_K{cwL}&y72XS>4M)QIVSz?qhH1!6vgCbvKY0gg)xX+r$%@*eX zw?;LGOP(kn_*jlInC<&UNQSc5U~d=qXA9r8=LMl_ny-q%xrv8ha(=XAkNzXA((8XT zOY1YT77vW#=MQlP6CRsmSrDXr4slbG)jM;ddCe|V&2?R3{_FMGg8YJO`2CKq2YEHh_;y)RMET#`$(1=on(b!X5fD8AlmI9T!Z9@IB{5R2EIn z1#m|ttw`A|Om=bt&)gC0Y0*>++lHu#R_uRtK;`C6 ziv8bYZL?7Z|-0Orr$xs6&z8z-U#VzQJhGbMvE># zHrrhn1j>tAqS$4Knj^wgY2K=80*t9@Dy;gLe$>JwmdVT|0}~u#{4A|%j;O}laV7Ql zznXt~_s!Rwd1pSkZyCUSUSxkPJ#pW+&i8}t?KqC%dtGaIS(i;*Hzl{zuamUau@z}v zfy$$k$njlgT}?U{IxBQ$&-nzoMWJ#!jWypc-oL)mBK9#Xhv0u`5lAX|`c%5q zrW4_|Tv#99g5?4Kt@WQ$hOB6*!PQz!92u;L3lnu}LzyAK+Ty#=qFjp<#xoB=gelP9 zbVvWK7M+N5u`OzBCK&!rQk`!XU%h^FWxl`o^3PYAYHEM1gFc{!1AEy5AS&QW)Anzv zyTa5$XGl{hN^jmOmu7!wCd|Ldbs%+g=V2(}At=&)5^O-!TP@uXkl|D%)zB_4l(Bq+a8Y#9+WGIe`c z3;Ld6hu*Q#A4JRv{~dZ^2nu^o#~npw*~S^&$jp~YvJ*g>JP=7CNYbDc2br^fm3cQB z5laW>9PL{7X2Bxj_n5^!%0+knvLuGko^J>lQy}B5jvo}ux3?l8ZGWq(z|hfH2rkQm z7wq4<5H!kARV#mqk#R#3k9mUj_XCS4{J>7sB`MNhD+RkhKPS`?$B&19KFscWmJpT9 zWl9H31J|~dbn&O~|ab^Bl{)M4T5L1}*i zwo1?AD%NYdwpKKM`5p#7|MSH^Ub71|0>W7#6-tYHHA8UUS1N5Q*pgb|7zyIJQu5;QobdU=6^g8jr?bKWP`g&=%+yq3kzEkv zfE=Y6ojqN25|pQe_6b&apc-LccTLUS z>3RWE@#H_F1F*9fa!XFG@_eSZoZnEZ`B1UzTO?d>aHzHJ>ES4c#(Z)IR5nHPko9vE~McM5%^T6yz$THNwEbK?*jLt!zRR8YA~XX>GEEbS8${|6?|!azmi@2lTq zl!A64*ja@W8Wc3ODRQ^wj`-kMfQo->M9cw^ z%nX%dKuJ^<`J-7=Q>H6>;MwB}`nPEn<19lt2A|=$Nop5$o7Rd(0rxBus$~lYxlCvh zK@|+KKby!SA|YeU0YO|EmM@)dmh>VaO-zFRiaQ%kg@aHjEF9Jiq_?4?J{% zC`pH(z*vu|bm2oNyvDN{z6gK9M5#%dCwiWbT-tx>IY8(}(T;m+K|$!xSCrN0f{DZm z-$c-@ywUYi@jbV>U~+i)i7M$aE(CEBwfbg|>p^)1g9TyK^IVXTK=21Z@kcwle9K|U z%)yglA+OiKA~voXzHv(#ikuK!Tve7;m!l52eI{2R6A}rZX(_g=GuwZ1cq)fFt}&!* zF!yNhQV?yp41zH*vgH|eYwsv&3{lNku9VM)_9PNw&6ss3RN{w z%C^HkDh~p0XBd<^h#MF|6m;$zvZ>^4fwM>6|7r%7aY16~pG866eOlFR)}A2)8O=^f z6^%x>;gL+0h`{-72b6!aZdnnhNG#fZSBu-0)Y2ahxHYg|cAw}6wnl=b;aLZ1I>NG- zJE%sjHW=5V_V^90VJ){*?lP*DJX<6YS97T(gi->M>kpp~>iD_r|IwD^^ zq&Gq%be2a0ecLgXmfYuiKJXUbup;MZbZkQ|R=(rF9#23xz}0_a8YePZ6Frnp?Pjz1 zLcAEU<-9hatNT z`W|g}8Ro9}%Y;9BUSu{mZ+Uyk857qJFFv+E``FRS?nb@rF4Mm-%Kv!h{u| zBqu;=dV3cyw3EN>G9i&rp(XDEu2{iinpOr@RL-GQ>0Fj3oM2>QyRS@Rh7BZl|4?Ce)e-_az& zv)5P8etLff=Ea)XGcO2;u-mgGaUz3RynXiV_tq>SKmBE98EzEL?&yu%8PuJ?L)q-| z+25YMg6^Wu-Vs6V+8(^e3%cG_hcLwaT0u*hk4|WY0PcLQ>YnF&Mp5iyibf_~UjCzA zZKuvIW;jam}}F?fHVbf355ARa))# zW%qxHwjJXFykEi7?NHSN9f>FFHCh<-Tei|wJxJbZy-t^l&i3%}St^6pxT^bQ&a(Sb z_0lA|YJBpv7WyvN!xERp-aZaXBeuIFLYMROf#2Jg)!7Kq!W8Z^y<*Sff@jr|G?#jh z>T+$heY76UH5`jm<*PKmIgqVh8cWw!E2w{j-VuF@Y%OoP4pBe3tN3laeN`)Tk~7H; z)Kl3yrKtA7%@@?i5Ag?W#wGG33OlKUR()TP+W4DlVnJ#)d2>uHoTc76$Lh(*uzOD~ zoAWqyEi&(0gG|p-Ny814Ls=!;^O8ig$P%;N_G!UJ@)8PM#Fkqo=cBYcoYr-j9Swib zq_ZJq5fRYrmJIi%e77&cQ!?b_Yp36)c6gQ zI2Yv&uZNeG4LSaeT&O;{A1C%k;QJj3?}gZjD4Q;RM@0QDPjIq>ORcQTqq+F@NU!1^h1*HM z=VV~FL>feqE@&YWcd=!Y$vzS zzRg=m;DD_i9Py?Mc2eP=8kV$zGjO++r)*^cu;XkUh*d|E$I4Utv$}sj5@veFa=`77 zTS>gU@9=W>3M@gsMBlY4W|Onu68!bFCHY0rYk%~k55CfKd0Fw+xQ8-U4>q}P_O{df zH))n@Rc9KN1E@(6mPqam$jL{21|G`oSr;jDl9MZRc1Y2jOz8gwkY zC{k0<@H6XOh96j*{=mC26aG86&+x1I*`S_4(I(&LKna_DdJ_MWoGhW^F)j;e@?84j zD@}0to$Y!<<>t2Gw=K=eP3oSz;kfdaU-L1G9h)7zdw&w0!GnW?dxq=F^#4Z#jTfQe z1yO%!mfVLizr0E0RcTRZ1WuRjlrK~r7~X-21#N4|_{2M#%1O%lMTJ(QAGu@Gr?FsG z;kykkv1o85b6Iw?*xju|@%&>VD7lLW)ffK*hzB?+lQ0rge{GN3xDoz-zha9ka5fN2 zmSny7+8&U2H@UP)Hr@Ez0=WY!OI%yGvgC@=uKn*za!87L@rrV`ANs|XWr`dQhcnN- zP;b`XnQvX|%32uC!n3c|_gAiE__lTBdY)mq-qkw3`Z~ESwzH4LAaSH7|I=N9ceSQwtOxSCmx;V&KNoIY@$ z7vyPoF?pOi^9d?&l4taWJ6Rf*p>#%RwTz|fGFoSWZIDJ+Gkan90Vj5SdwmN;y)V%o z165%bb3%70nv!`uY}j;idVNH=OX{3Z84zlH=(Whpf3QSAWVz!PxW1R)1HJOUs4575 z=yXcBkq~P5Ft##|<=aL;Mq{I_X3=!!Iu^MoyClt^?JO`HFMtOyN>RiI$k4Gg4+VNm z@(Qa2_6+K}M&LPO*e|mWH*eSG-TQYxult7Ot=Yg!y@63VJnU+w3_P_agJbham-%*^ zayH-Ie_h|)-CV_k;vS~p zw$PzS@**iIbtiQvEjl}iw76s^y@Ic=uivbGf74=Pf%ZA&(j(*8IVvNf4#}_lA>mE# zi+s=jn$E0ARS<#xcCx>GUTHD52osFVlo9^K2rq{Cdy#_rGW+GTd42oOPh1^exul)% z(RPca;V(qHuXZ1^ZQC~7MRO-58K%3HE0QO{LP9Uo)N|0(^9h^UkyA=JOsR!me6t`N1I!KiVt^*4q%jfECoR%qX$4b{xdnC4^R+f* zWL1-hYc9&|KBDH1v6w4lRb6T<*KloDe>C}VI$QYm7AX}mq@Wme5Z56# z$?r`4`(BK~r%oV>Cn3so=}p4zFzTrFC2b9QMnI*GTHK*9PO|NYmHLmKZb4z1Y_m2Y z(#EAJEFd2r4--(eY{(!bTxKFdiU3?4o62Z-BD)Nn>+ z(za>7A)GkX!WnK+7KdCN2ukSAYco=8II^IaEUy0Y?wEtBjR%gKuiG}*yKT8zeg#3%_m^N zr_A^k=|R9m7?}EEhzrHSy>XZ1f1e5s+u0P|mu8V{cY5HjtO`EyJQHl;%Sy+smvxkJ z(NpD7cp$?gby%#7+d#zeDGT>W1V1(@peWG!;|WX#z&iIZ|5GL9WjxVSOL)g|7n|vQ zm8K(C`%z2CP%NgQ-Lc-5dJ*X*@NX$?YGxj|J5_KTJ0Q>Sv`SPx+vjQFe*`mot%3SN zEmrTt2R0Z-CW_QNB{3?@EG&u!)*cx3r-rZeXRTG~dLb$ulAT(>@uRjn;S31lxDCl+ za1Btcue7dFipq0dp8kMzZqJ%R+nCef7K2{N9uX+HKMaE}VnOzYvW2>02|&PpGK(WT z7~(^V?zNSfp~a~*0SCS}f2g9O+2{JT9b>taF50Fl+w}KL52hrUKtN0%365jffps3> z8CpX3znmo9(e+M(CE~LWqcVZGqt4X$$bZmUHkGy4H?OZhy#I8=;U7b(V})fki${<9 zW%cvT^)DYpjBLDwu4Y(k`7S``p)i#(@f`q~!Ov=Rj7*O)GN@Ebe>Hf(sI1jF;yTu@ z_e29+x+1PucT$Ae7LDNONspt`wf|c4%0b`y3(?J5!L@#|gf) z^%R<1ah8Tt>k}=me{>mPdqxnvaA-_nLKsB|<90AKOsQL0aI856i1mEtAwH7?=#|Z% zv?NniFfEakey;SmYoj8(067a?s`Ma}$}w=ihhiq9SR*~|5lNYP?oYcU<+2RO0>wik z?+G49Gs_$srnHxIs<_OFcL_ zoD&svMLj=<#v;kb1Cx}+JOG8-i_0t{pg$OU%TS13#JZV7?C_!G|9(^2 zK$%jax9DYlFrzSwP^v-OOQZ-C5_9vYB_Mp|Ypq%4r3jh5V{OEA`1MJ2$a&dk_F=N@#3PWeK8Qa3oOp5*Fuf);M{q)#dD1wO{3sKkXx*FE^}CF6Ok$6s#JHHUoTFxb+)WZWSw9;(H41CTtwY(ddTY(N#^W| zyxQ)%R;4D+)k-+6W~&D_bPQSrJ;Ke<_xurSQ+@PtV5B1S^QGN(3`{ zttv+zZWnoQJgrY$D8BkJl=Q>CTIWHO)r68N`4FXV=EijwuSsF~0u=T!xX#$ih*p!? z7*rOD5-NWY%mAWQC&q4O%j2>0S-%{|dlDV5I^_sYvAC%Q>XQ+wo)fv94Y}K3WdvxhtUOB$#Bcb?*xgCCh_~1+Ih^y5R z_Fm!!_uioI*}F^)XCjeYijzWm#zJ%@rLn<-8b!EAgCsn`*W;dk+mpu=|NZ6jXc38%usC&1KD%MIgTUJ&iIuZzHq?JmpQQeJFlEk!3-H^>ZpSy-*7qJrzYX%I|aK_vrvcx4#I5C!**<>Kp)sK|(Y5bCWoFZ_?I6q$0_ zMdd{&rkmi4a#GlgU#PYr&rs8JvPQ%&NE1|;X;}8VC__ivI^_w$__Z7+UNyih!*s5i zqE#n2Hu)~=^IEu{pD4*ye>Y}e@SZ#;&)m+J23cGs`)YQwoptrW*|ev7*;ahtP!qQe z_vl|*{QA9WuL{|VnJiD}QtV2%V~}Zo)vM(Ui-(4mt+LK7hR%-yrbksNv1-a2hLHOi zDjI0;t7`D;&GXpIw>Z5Y6C9lbW3my1Pn1ZZ*snr|o%@FsV>D0~>M<-MTV9#>gGAp!ZW4@>Ek41Bp@rn@{%xG@^+|7Xo5&1%23 zTZAhEy&@V&MT)Qze@>@mY*B}u*p=q4|2sP;0jY)<5(YQNq&&Mf?Dp{rkjYoV_usRq z<)f^mKNG(Awlf&waKurc2ytMokD5Vd9-pn;aL7a4P<{y6F+cRL)*A?-m_nB$ge2@b z$s%rIC|B->Pq0v5l;OP2NMQXPyKzaHfe%)XQM8){IPCmV3v2Y@GU4{D+E{p z+k)XBt%!oMe|8WGq*v%zqKw8<#SU9GK>OUVED73;^4OzwEYI*=S+iSvNR5ts!&%mm zsa?5GdyfdXp7h{Ydeyg>$)Z`*nLYQ7!1kMZx`9xZL<(6ZD=%0;&marq2P#Wh8)B?6 zT!A?x>s=sRrKM~k;~?akAGFTl7mLpEq^`0Rl(f(xe+?sKD2ZR8kJ0fUZ7$h12cU|> zfKeG9MfTA1NA0Yh2zrQ588}KTqL}ees0##wK#ih6&)eZoqpMw8{K&^lA}9T&fYKMjf?^ez8=K353x_trJ%v$*4jnsrc)|=z~y> z7M9S#$Rgt($vd8(pELVRNpII5C|zG0(a=vy5re-Ji?T&-?De!Tg#1~ncKlO!^xtV=16Xc()ZEGU?SpLMfU1 zdG2KP%e)vwqRvYD4IynJ>jPsQYGnim>%4iY`wEISb?sFUFQOvr5Qug7l$U6b*|ZpK zf41=ElQoN}(kt-|#)n>o@P(`G7GZ#l^f%Lc;(vEJ+0YsqP=Pcz3!U7t$d>|tUEt;sIA zCl_!Irwb(Kj^UBcR3$^l3R9f-j6?w8+;D^D@pL+1ffxpxF^>e(&`dmgKquTcA`zY% zyBgg{^vs_dzGD$C5hQGTLW>`!jzg`BVokO?dXG)(%JGOcC0os~f=2v?Xjr9df7_Vb zSF^eiVX@n#U}^YEPf%#jEuYAeui?Z6X0~FE*q%V}#jT zaOgGICDKA1tD-kIe61LhN_5yE-uhjV#wg^Bu!szKje+lonAT(S4MjU=UIV>XqJq9z zj*)iX`tRMRU*OI=l%ayw0@Az86^Y>bLlP0s3nosa%(3m}I!xJ%VX(~f7V*hDe82*} zA>YD}Tz_}7{_ekefN_tr_ao4J5H$)fOl59obZ9alF*7+iGm|kS6$CXhH8Yd&peuh| zYqJIl;~Lx{z~Jug?(P9X(7|DWiE-14g5!nK%of) zIa=7+^8QON1_By7z01T6o!-q9>}-Dlvd-237B&D2Coc;ZFEcZMm6@66e+=zFyZ~`S z7Yh@B0wX}y&KBs1Kp|#l?+&ssGk1E=@;{dVYGWDz3l9$${on2Y5gQ=L!r0IjpkU}^ z4zzjCXl!T=P_r|(06MwF>5$+1k0SiFl6{>aRLP5=&OW@avK9stk*0CY1pXZkC+y1Rcp@NXr{U*dQE z-k$b$_5joO5`f+oroi_f1W!jp7a+h1)W?_r)C;Gb> zX!;L+?>xxD4WP^XK6oqu=D$Awz0!N1EfYIiYxh6qe>ay&N=HLOQJn7Yg8!=$6}58% zcrvgu0~lC2m;o#-JZygeuJ;S?{~bly(BeNVnE&|7*qYh_c>W>#eoFsC*yTUnr~c1k z&;b5-EJeHbi3I|v{|xwNW)5cK_b-U6Ljf?bFf;!j-TPJD&s1nBnn1Ou2DZS9=iT>$Upc>_%C zKnQ>Jlam9$B=Uck=pV!dU=sT;;$j9cN&Z1B@8k6cu>qK5{vb{Oll&j_9!22~;s!7& z{y{tdCZ+!(?)MDJe-JBxN%aqU&!F}Pz4O%gFXDO6VE6~UXE6GM-gz2<42`XT?>BN& zr$2JG|H}WF$p0$dDH;D4al8jJwzGck$Nxy!+5eK**!+J<_*bKtO#TJmQv&}5-|H~_ z7kp1__AmGz&iqgC_qxp8?ahI<|FU?OS^NvW7i;w|_)gIJU+|s1%^%3}&g@Spj(1nv z_c{8P{++7bpX~3>cK=KLPTl^G`n|38?;C3OuUc8&>4W|S-?=*e$@domy8OEsmiHKc z&iZ}*nVf&jLBKyL-v^t?$<^*(4)2_u{{`R6b@>;3XYBe1vcAW2|HJp))&mIoC)od5 z6Juu(==~w__igNbhyDlu{X_x+-GIgji}QBId_k5qL9O>yA_T4syW;{g6uVlfGz^}L zpf=}6WY{E{%8Y<@&~K5Xp>EWbZ3*gI;U(f1&*OilI@plr1eKO2uV?)@)v4VUgkO`` z{S*1eBDH;l@E;k}h4;K(9K1CBtstAgJ7g(x9Gtn4mGdy}U3;b6YWqr;M}y~gRrV@5 zb4o_HgcjiW>GK8a#0@YLC0 zjedWa^H?ocXLanvBgfOhC4{_1ADyD~6g^0m#aZwyE?5VRrp#ftjcwW_vREHbd+aKz z-h&RWzEDz3@KWR9GC^X>L`1GPOUK(3k;KEWXI`wxuDi)xaWxq^(ksPVyeV08)j*Zc z6q4*2VSYTr{&Kv&H&r*za3mp!%vR*YCk1~S$-m2IeaYJce_x=amV}zOsYa_L)Wg%7 zGqJw7xsh^Hg`RyMNj&wD;WY&MsRZWU72s}$%MB*)sO>c0D3OThAYEn8oG&;Mf;_N` za6s>{akL!Xl!)RGTNR86Uv7h@Bd*6a+}xyO#UQ1>`gu!j1f$AbD&tl@>*ggfJve_> z5uf|f?Ar;e3XC`JVNX8lp4X!o(_2nXcHJoc)9g^3^@pj1-YBt)RaS#ezi4@9wy{-| zjTUV2acDSNlsU115)PuaskB|k*(v!z4LmDc8|ktSk`Bx2ro%eq2R9cL(_U#SdyTB4 zZq`dbltP>r+}h*Kqz;(8z+re#C>4KgeJ{vmha^m-Lvre;-@Dp?eV2LIlxD2|n;58gNAGPq5S+SAwJzr--hywvGurSSjF)#&{-yEq5PZKYCSzj7~iTN|NPIv@V$>kF1LzVu3u%M@!XPHpBOyl~J zz}76$bU#yie&QQJ$U_dXtjgNyvf}Z zq1q7*b%~MNf1--xN2jp`niM(5h#B*_oVxWZr2X@P@S>m|-ka&xB7}d|^nTDXmr9J3 z=5gXixotkG&q%g_9`vD3tU)AN-dRF0?H+^=7vceF7D^6W%u=NB-mg1XLgvO?h@$Wp z4NvV%TgG91H<=FQoQfjtLKQuHgP(CFQ2h#uB$F@+*tcDqpIi@lFZOCx`GTD)(tqJ* zB+%)Z#Z?_)=*(gceSLpLda-kKEloI3(eS6qXyA_cF=!aRCGy2^z(vrlKdN^`I-phG zc6iYT%s(x{8}FR>ZN)c2%_)6YDl?p`{KK?dD=t?kYrAP?g;>@v3uY-S8y07wfIyr% z_Att1z2p6*)Jl`FH%Y%0dz&K+*hUTXN)+?PoSB;JE+Hbe(EB5&}h? zpTgd38%8waC}x(0rYq;OrG|Cc10#FHCuo*Wr(g%tfuU) zf<94G!o;-?)Eh&EW5x1+nQc}I8|X$eo%b zS^;DnpFEpyM>>DfZO|s*X)t6|60f6t?tP*D*d-vYYeFOZyhZ`#p-5hg%c7EERe@q&w%3d9^|8{ojYenC_p`st=Rrojf)}}++d13caqO2nEIzSv*O$XjiI2! zs-ar*2v;p<{jTjf&Td`o`gnnQglNqHy^q>ujjTcxtq2v(eMdCmOmeD;O}<`0fwSc? z=u*hsFe7mNptpKvwS%DHWRB+WuWT&8I&6mA_5_nZ%%#>TWj>-|Rdo`5BGKIrSp1a( z6>ab^hfV-f?T64t^ISvPc6RV$SnM6Ip&HF zoGs+@1x0%iu@%ZzLVaWIE$(lj>|dKP_@RHVu3e18I|ztLkpnJpk{g9h7Q3pU8+@*Z zL|9a~14J0S*29cg3_L2TEx`bFvB}GY&pMw`^B8{zK<6bNa(s3M96QoTe;OU(=&8D= zrKM4V2F00C&E?b8=4g(}JvbHi1h!HzUP-B%l#~vVU;E$BAKsIdE{Pm<=El2`RER7^$CL~^P~7Q_2Gyy#0<}QZmJ`20q<+3>#1r8H`gjj&3KhvoMU_wu8~vX z2OrTq#e8Mr`>qS=PiBK-uw)SxNN|;zlp7Kf-(`{8+y-ziFPW zEKpSI{76R>AjB_!l^OgxkZbiQ_I!HIT@@fKsNzjz^i?uf7wQP(y2Rs}%07outqqJ; zqmG=Y_E$2|cd+OHLj%<*8G*ShlT&|}M1A64pNW>WGE446H=1v&^)cEw>Wlhpb<-}_ zDX%n+Ug|$tR9tMuDYjG^JCApOE?m%MQuH)sir0Sxe^xs?BbAB%0kh|V?3?Wf4-@a8 zZJz-%p{)1D;q?aT1yWiH1NQ?rHa-+(#=4G@)AU-%ISyvOTVob8w6xzUJa&H^;uh&Y zXvs|3N8TPg`uUct4Z+TEGIK0nx4ZwLcC51Z0>T3EeDzFHv)YrQ-wl#L0$Tq=MFy?G zq`Xp(#>q9pK%!hnh1Bp6p`({?sg3OSZVC>()ynvZ^Fk957Yu$p%Z(rH0X5JJT2NW1 zyz40R0$8HjN9C_JxuqMaCqREv5Qh_T1+zoFB|zM>kak0*lk8?K9PGWvj9V69_V z1KQ^3qFb`66IfndfeJ9J722Hd4Zxs_pCM&Rm^d8-PHm7&`*6v$-6~V#>3YF#k*Z`! z`t;Ttb^aM6d!vcMli{8&_tBt?dv#Noug63u*Y^^CkO+ccjleDYT8n=QcjLlL1Uzno z9MYxJVUhv@BS8RLxC{}X?2f7LS~PiB)b8gQUfyKi#hI}_b@GZV50R&k{9+TUK=y*5 zitzPN`CRJRwzz!T+LC}A!5tK}k*+-2m4!A&|U&UbmONmHZCHPK`H#+@u(G|@;Hm?O9 zT)**!xel*&$6@7kzz2TGbgo$_COYox%8t*u$6cC?wHYyXpRGRS!veuub9#P2(V>6u zAH(N#EfB4@5bLs6`i5AIjv_hSm7?e-t~Zv=PlVG=2d}Ne{L6oBJdJSh2r5KZ$7enu zv1sROdz!t_{k2g8Cr_-u=$&LSJ+4$Vm*E*smnMw%{7U@OvC~JSZphHz3cfDJf~?qD zWW{Xd%=^b61@a0*_%|dOY#WzvlUI*QNA0A=^avP%ywo`qV#m#E=Oqdj4Z`PRpKmjD zt6^>sR&JxhoRWX0H?RZ_qBImPZFNQUu?AU_^&z8>g>9Wvh2*E{vBb4BFh^e_XWbgX z@C2N_lgMo9lQ;=y+(eKF-M&Dp=seL;V8X{7htYcCOoY!hfB>q}@Vd0x?kUa8yA}f# z%!WqLF9gb5B}4A>?P2yVL{>%WOQQ?ws&o{6TwrI2mPxoS@K+`AU;hBs34Eqx{Epw)_oCthjvIPHI9~aOH1(^^lHc%_)46QVe z6{zNRA`TwFP4vBt!0sgNVAFHCrSq`iAj2CDro(^LmR?KwA_wz_$2W-N$PB)DI@M68 zubN|@F1H275I;{l7dDF~!Skhi1fR)WKMb!l5vNij=1-Gb`v@&F2KiW{f^7S{Cp`Dh%N{V) zW~xP;a2vq$f$`3Axu~D7QaFVIJQ}R4MSFjnf!MW8VpT7NMAxx%(uiAKcJ|RAs)r>g zNwwo4IwXy@p^+8x`}%?LW(+*UCUd?;_(>V?Tpw8f@#OpfULrg3`$3Ji3S5b@2gycv zJ3i*6S3klFp|$1dWgF#5L448?vVo-j$0{VuXmt)*5?cIw-(8#sH5}n0g*`4ZZpwf8 z6NbW~ha7i*+s9s>Z)-OX3DX=6RZ>CK>T7eeLqVFpus7%kcV#K3bXs85YP$GJM>cF& zamqF(VTbf+Wps&Zev`OeFGZK?C%M5^_wKi-s{G`LSYtb@e(;;DZ-#J`)4vP($y33s@hB@< z&_l;?j3`wJ(mUh>3EvQfJh2D=)*I)vesfgQ2T#8@N#)d zz*K@_HeU%JFWTNjykOPl#$yn=WWHB#vk5D>=I49?v`1%%Tp}Hmn+%qw6@n{lHSf)h zLNjcR&C~+>$aAT-W;H-mBa!N z*^YcXJ+CNfb(+qD+m=Z{$ku;ysunkEin;=Jp?8Fu9y`5I$)D8~@sOW0SJKuvhlONU zq{)Lob5fPy5vx}wt>x%f4V}7GryUN@kJM#el=UI4&kvz4v5cq??tUU1Sc!Z6-DX!{ zrg}n_oHTF!Zr@7Xmq`?3IPxOQ=x2CYGb7SN&m^N-(J1zv=Ohfyew=@T&4?bj`MTc0 zQLk1G1*cQiA%97~9t+3}z>H8Vyw#jIs9w&>pAZ=oMY5u!gy~f--t_>SI*AD1`CqoK;@5>G$sL zWD0ez+#ur;A=N1Bp{ailQvbZ5<8~~K1hVtCV_p7~J=Hs6$n@ZH+2$|KW~GsIquV*X zK!;C%TvjvRLxhV1oGqoXCH&*Q}&=DOyirA_5D? zd0e5VMPb%yysMsbm9dsxUt$9FCa4g~+ST+$(bD$}xl31ZPBL$;5)Y>gjSML~IZ0ga98>YbPww_xyLf8lJa^Tjt~#_p4YltE$SC~8 z511sLc;T5+g_B*tR=R+|J!-LlT4#}}ZU-p5N$Uf3V`trD#QP-6d4U*-bePMzY&_O` zF?NcP>pI`^DlAqy6OhVT^E7rICKF#*Tu$s#+=I8+-+zBXg?+u=D2;>qI?kh5o@53g zJ}P-PgL7=2Q6dG9@Pice6RIw)#ika&?W6eN4?$xsD58)R4#Y;+vLh!7y3o@ptX;Ak z?RVPShv{!uMxRtLUsx#ny^bX%oks?=mS2X%HkuW*>#&5z@cMoA*|VUIw~h?o7O-;o zVOUvy!PtMvg0hqGYmJJRk7j;NkDd5}{+JWT+0A%geo>^_FmUk;Ny&{oGFVMmJZX+I zb{6rsErg*AAAy1iu}QWd-F5&Y3-=57ilxlMqq@>B6(j_ez&9-7tVH(}>H-NY+Ri7z zj&iE?ko7>0P$VLAB;O!Szm!!2`h!~+5Suz-wEBOH=lWY48RqetlFl|M7Ux zjQ9y1e9;^DnmN`Qepn3~5yo%;2LI-+1>@0$t291u)yz0~D;%phwSU7)p+H&1S=kJc zoLzaQ6?x_$dQk^0UzpixhP zFF?>zlse5gsXw&HQQNOg7A;z-4KF7|&C}0BdfDHTGQrymgjzBcK5iI>qTa#~-8=7& zDmj1s!4rnJl(Tbq_*{1NdcZw(B=18NWx4!&Iq&SXAL^T6zP;LuFRCV4LYFhIV4Hub z!2~j?zG$YMZ6b-QVtWeWggcWM$M*@4kg5&;X)e5skonil3k-Q?+xhk|c6#oUQI+1-IxC!@R_&n z{pwQr$YY?l!yG&=p)lE$G6R2s=wUif-F5<}j2Y3=#5%W^Ba{S_vyv344Ez~2!@Cs$ z+>TCBppz{EJ3%zHv*c@`2v@9W{Um?|hrHy0Luo~(cC$cv%0n;RAA9Y;(?8#pvqY|?I)3AX zj6JNVEX7U9c?h}@ZfZe(nM~H~$0FD5tc$hO7i^L8t*y0d$Aaw@_q40o%9HDtkS=Fu zD~3>W0i!GbRZ&z6p$dPAv`3IL?tRn4ROy@x&qk|&_hIIaKy|c0A*h002TU=DsaLAU zSjMf!k~Q{IHC~(xq#MajC#~r$QF)*Dxkg#3R_jE#FpZ|0@cV0k9^71nQ%`~gFzj?aF6(duCdXtCBEF)7ft4XSVxMc(&r11iN=L-u1 zO-DkiSo7=VC6XFAU9N90bK8vEM_BQS7f$*dF7ax-s3><=2J%BT)M`cY0Kg(5L^)7y ziN$kRJtEAmZY8kN!-`K?nV8_3`8T@~LBge?A70J(+J{ZmyFm;9)GTrns4nH(+P^ z?N6y^SMoKB4m<>dR4`K2KQk;h+hk`*LAJ^1flzSem{NvHIA;;*zj6_%dw)IRIP zy<+O$_aX-AYk>RwyqIApb5C6uzHB_8RwDe$K|`3BR!!Yhg9WkN;{&=nB6z9MB>3XE ze}x|~_Eg1xR9r8-cB;~(N-CMC6`Ds<&1;K7di_+KwXyz1At~+Shfy*@CE!Fps9U-f zjqBW7u2OVyj#ugw55MFXAXc~xHv0XO)vBAIeFA~ZBbaTZ%8)j9=gWBM2yBf4r%~Vm zZ)uJ!MhIq(H;5sg4l{Zs#k-hNjVb@$5askEPiU2Yby1e%F4bY7bhu&D{**zfZP$#q z+qL{Omph%itC~zC2kfbWW{ZxnBCw6iW5Y@cwcv+&Nj+y9h=oiLY8-gW);j)-y;SoleobmF5K!2p-)JxYy=gc*R;DFF&n@! zjd+l4a}^#uYt9$=PnyOkGXM<;F8k+u7l%TBdB={V5PGhWkU0|KO(Is3b}ahP#7`X7 zz-IpA=*&;vu_!)aaFB@FW|8UPUu-545?({zL+0V(uST; zH1ng>DXx4nybF#$>Be}@%ePgZ_VDU;^&!8M{*b#DQYM`cUg;?;){07U{M73?4x?dCG z2atwAL)p62Zy}(Cn+<@W=}k5(j1=@jvGeCxi*QQ#z3Dj`tgCYAFj>Q@%SWSs(_}jx zrnNZnLY8c0d2t5h{a}Z*90!X8+S#}y< z`p4nSnyr(c=OZSAPs4NHb^T|8xM8%3n3x5?bNDuLvEci=6eN8Dhn z^AmU#B>unL*?3?? zkk9v5HvS&VMnDXiL0n$>)K!tip4p$gu%n@8PwvLU8Zxn<3=t%PwO`y!Q`hPG(-VEv z>?^vm#_ME`-s^}FNBQRho+FWKnsJ%?Zdk&o{Qx7|kM32~NK4-0Md>4dCHZN3gyewy zf$5lZPVTp<0vi$Mk1uOUHFY!i zYs}?dg-=~5^xnI#sumT|?dNm|*J8qV(q$J+Iyk%Xx2b;mO((n%dlWSa#qIAY1egGm zBsC#Fan;r}5spt#%iK2HMN}6!xb|Z9&*E$fB-=yj_bMR}I66 zeq37IR>8nyBLgqJ#pE1-73B>yruRP*v7Lcz5%Wab<%*mK^T@+8ZeCZ`^*+5RcKoyv zKO2n~{UfMZwE{H@poL?8mov7RX+V1lQM;jHO-H~41x;K6ucD=37$;!Jrg+!f(wybK z-!)trds0!FQz9FGZiApG-;Do=YZ(72sQuf4m)RPgYtw#~|kz|7#&<&&p#c;BH z6te7ge0_1?_N?*c1wj6AXeL8zHXvJw6mR6lOKpm1K&vEiV0cCUZHMF7d~7#3b_btr zv3!F(>8E>SDhX1&0_>BH+-`O9A0djX+X_KPbqvIpn7sLfomsOL>M#E~rds6C|Cm5p zgqMY`V>-Wow&z)m`F1aU$)Mk(W-*Pi2DtxB4<|g_(e=#H#Qe3FQqTxxBdcy_N;lKW z*Cftz(+!^#bzQvt`o@8jimvzwVt0BNev>-_fRphIH}#;klTc^7Fx-UJ;%}=p{4_vw zntI{AT8!I$7_RBDOrQ=9J^kYs!R$qedW#G^N&L!xM-5DvR z8q{}x^ANgy5LV6|<~i<}7V!)n%SKNl+R2bPga~`a)2&vLdz&#YU@m9G7hxIIKPp0{ z0@&mXEOiQD^%~B3A?l*XH;_JmxN8lk7qwnBJotvHxgy4%NkSniU$!&2gW)Q!q0b1r zq^SlEWDz^15nJd2|C)9; zTSzO@>-(Zb1qm;nV(0A9pW^K~&X34peE6YpCN)?=zV?MS>gd6=|l>bySUPg;+0>cB$a> zdAfo`Vxab*q$}x(5fF?qc)o?KxdMh)k$}aje$Y6PKP81*0MpsL+EY&O7Qiomow*8j zprS&UQ4<&t9ud{8q*71jgPZTWM9W8}&a|>9+IVyC6xRrJweiu3YpRRQyPkk7l2_be z5aKQY>?w=eve?k~Mhi_0dqxmc(fAqQ-qk^92bO1hNfJYVm%;662scQM*sP}{=`u$u za60OPT_s6V6y+_HW;XzYdZF5XvHVh?-NW+-fa=794X9;TUI>$eMW zm}d8_p_a(DdQ*_N-H$|DTR1A$@%G7Mj|<>TJZDKQjX~bkR;z(;&-y}14o=f_qif?I z8}7q^;u~Q0ZeLrVS~b8^i3bmq(~{irHMXA^J5LwKpOckU7#NW<1AfncR}!c-U@(w` zWOBH)&mC*J#ijZGdMLzw`Ft}hASXt{R=BT3(R*Ui)zpMVj-D_UL9J7FRQ$lVK|q_h zy{!^TpJpqFg~50qp^@#azMM8b4C9c_QSi!fKFAH_u2!Sfm_OL~SUnkC>U6gDz{-v* zQRYyBE<+ap8Xx!H-02d3pqx!3>vcyh|DiKF27lk`kz1%F_cnW8y6IAN6U!q(R686e zjJaDNbFr(d&%EMZK#4z`d$q7p5;Jg6;I*1m;;#JEh?o^OcicgVc(U7 zgFPcC22X$I5^_JE)L@M4qev_CA`1)9OQ@JmD!s_APeb1-+m>v9*DR9lv#ay9SS3{@ zW2V-};c9M)KuRa)q)sofCxHHL@=8PbKuc-Xw4cGjc!}Dowr<-~@Nkw>bqgo2lgd-YQ&ELQJd7=)=A`Bu&bfTQ+=uP+J5%e1%{6;yO)AX)=b(p5}x$} z{%=_!y*M7RU(N(5%KcijMP~ZwPaugxGSb3ClEy zd0QZeM?QXkFZu{E*pDSr=uJ>&D8^*bxNoL&N+7k$N1bqWvW>($t(|slwJdj}> zICXdDMu5P7A+b<84Qk04d%-w$D)S9@V-3y= z1(}#BYgVn|p$?mzcO9=6Q%-t~D%f~;q~LwyJUqu~LZ-2exH%sJJ(3 zhLYfBf}E;kJf^aK2Wheok|6Il0Aclnkbctsjzz9n@AQF^%SP2w%_Bam!=E8#?HC_5 z=Z1T^7mKL%_JO*2vn5I5_P8-((bl%ipY?fv``b^)2Xl`$-LH{gK3Dy@nEo8+^sB<%7heS>qfY@N9Dzez|N8h9IojtbKdMC&Sqe=={ zt9f(seK=QfFz0tz&C`<>i)^XNe=oW^l2QiI)eP^9b)yMdW?WES?#&$LiMpSv$wNouR)oyeAzOy#+pmKt!`dgtf?Q z9Vz;u#&Q!Fu7SNnCk^-fv4EhSOQL%sh%b>%%D6l#+VNu}TaFov!5UoJi$NQ;7iEc3 z5}mh_<;5vn<}Y~>tpjqzxKHIp4SlnJ-nw5Hq6L%nW-Nf#RIL-?WAO28m=ToCKleZU z_&WdEYUzibXP0`VO%3%#pykCP3_RF~CD-^B{(F2RkLBfy>h^*inm_3tt%VQGE^nk= zO&+U;n+zDa5DMEDAdXN8id@)9RfM|Zs>*j#;=Aon5w6=~PfNnTe8uCHLp4)>4?@P* z>(}!b*nSj;hak|vJ?p@vp1Vp@#opI-$W{@?xvD}rCLf*$?Lt?D7kN*DtCQ`IRhNB> z>zzU??(ewQ{c`q=;Yo_8po*C=i*!fo*ChGJk74#vI!>Xy6eAEkZ(!PK%vJXNVJ$O} zY5^aTI3Glkz5|HXR>2{pLPbD-`lL9*WFL5k{mL4Yll_^c7UB38PS!+|S~p5mg_g$5 z%>ewn<%Pwfpbrv zRMKXR2{T4OSgD*^ip=VkzzR)7t)4#7N1-#10O^oG8@6lIF2`^XpDg62g4E9DSLAR` zhSF#!N&VE`ThDaTBy*z!y^>3Jv-)-Z$o4p;4Wd@rKoVE5K@AE`8Q5G}gGk*SN?a)7 z!~olfZTK1;t8BMTXI`p*xeDgkJ}Q3!(8l6BzW%Ld6!rnQ<0af!C}iUdrb0Cu;88Fn zJ9`QSc4N;b1|x|_L2Vp%^+UKS^>8R0lfc?;0G6%H}0^sYocrtw=v$U6I zRGwda0W9`W$kEmCUVwp(I2RPvT1+0jTYu+p2&bThQqcyu#>NRytIS*vHWmPbt1Bq&q(5& z$_pMcOcI{JrTJyQWZs{<)++i`Ib38}*1Xn_o2s}YU4jXJHwK!X4_p>@2|N;&&%vJ+ zoQzGoT(+Xh@jK|G4Ov8lJKwdWwYZ09Q4wMW7V8&OGn3KMH8HHplhG?R6AvoJlVaxY zk7+O}ivj@m;Y1E%7E0O|A8kJCsyF?K7XU5uLWM)? zcHag^)mim_6$2_Zc+~iSqQ4J)mp;o=7T2Mak-E^QZ0_ew41z3^GGwRqy9{C?L=$mz zB$L(t=B9$%l34GhKxr8d#hJ>fMw=GK>S!(P2$|h4qq=!T-}^k0YOQ^4@w=qNwPopb zKRo05=S9`cwy75(?5ZDXAC2V`8H(S9)CkNU$v}R8N@2cX{UHmp;$L{_DVf+wTS|CA z`{>CadaL5#%g$(lv&72j{PH>K>L*JomHj;inr1rTwCx8fWc{W{QkQmo@ILJrD+Y{D zF5$l$+zinfbi9brJ5Z${N(CC`Vb-II2mu2b1J!ziA*#IuS}u+>OkPJ^3ZHAO?O-eD zaq6Le;aG9FbV5291@zd8kuMZmSX zT4z=Cw*25ja`r?jGYEDc&{iENRve<*yfbaw+PLTaT!x5BRNvCo%%E$tg8>gw=NfyH z$tfLe-u@}@cjRm?vNkn&OV#IuS+pRRvLa!BukM6jDq*nKQ9=LHGT3Iv*(K z*549yCMGow?x6cADkSqZkzQ(jg&(tjV?GR`qJjWngHBO#t2{K8XO)NK(e=i{N zB*lBNtExgpiCki>qH|yvv)|J;1C+G(fmCyV@@iG8OmUp&q-I|i$zI%wW@^xX&u@f} z?pFe#)eftVX42OlL((1rar{<`hAJh$c~U$+ghDxKbE+{}O1gf-F4&MNI$eie@bU2Z zb%L}1jgDw0#{#ra7t-W@zN#(Q{-fI;*5Rl;zKSEu*u1t?1O2sA0uU2=&sW3U#xz0srmie8lRS%Q zo8{&H=nDJlAwlT?Df%4q+SHX65u+`V!k%ap7BuIn^pgJPrt@64PXrl%?H-#o4KH$U z(6l}g&!T9N9xozec$11z9cASR97aB$ex07h%KxJ8d8A%?!$4Nc)p0!)CHK?bJM0=4 zEMB}}==I2!a;?)xiHUaUyR!N;5{fVZ_2`G?A$GkNXxtjuev4hFwu&R26yWS}vJ76~ zqWm&xd@$+fI{S5DMOD0ih5CbU3+EhBfcUPTdD*OJrj0i_3O`oB^Dl*EWlNVijjIu| zuq!f&biX&;pUMpZnR{#{3(?(po(^bPlHZ=1z}K-dFX1O7QBWe!*cK-zBnPhM5!7>3 zB(*O(L(>(tu(?~6D9^%nu0NV@R@kRFge_;775py~fXWx-p4WyVi3Q zmvrkZ+~SKN0;Tj>GFmqcZD$|>WXFj#nOAGD~v?3H?fa-gJVG zcD0~Y5p{N98Ckob+1;A{(Zl2qqFOPnDxEt`dh+>l$lT^t);wMjA~`JE?X@o#MJS`J z0*T*xmg}~EzoznGm$bxslxZ4nhOcXRc*t;w{9I}f<&_=A`Yd(5===3kR0a!a1JBb8 z%IILti&qYbvAZs432WOz(4dg!H+n9Pp5Vg)vYldGHKQAHST}-!grMf`tn-d?{h09v zlV6BV)=yRr1~ZuBIdG!S%*@DVEzX}yEnc3?30-Y}OL<#sna!2K%aQYvOfoSea8i7Q z>%1+#A~8(v$7&%kYeZqhp5w2dyBZ?Psa6nwt4o%=qAySt@qsaHO)x+YlZRkCnQalS z9ia3ZQ5=_?vRXkLif%5%D?^vnllF5GR@adz!lz%#OyQ|ecs}V(Jeh-B&X&8qLJ%<( znn0p|HXQqW2YLp0S&xSSsX zK>#%}O&yv47z5kxR*%6F(r^e=t{x73TOS=wrW$NO@C#Mec_|xO>jb&Z(3A_>`B^l= zT)8!MiEy^qYR2KcjqXRoB;g^OHUUkyTge=M4iZs<*5z0~PXk3UPj^U%{Jr)=f%1lR zs{wlhWdUl!y6#`*I``QCo|;&2$5BKfhi11>nrrJu|NF(73oV#C$J8kgfXCygLpxJSbl_lXPj>usgkpKjwcNp7WjxE(FllU zJS%Q?U+c#Z?qBDNeh&Y5`R;peKKfwgpfeYPv0oL(t$J8h3YhcXy|8cbDK6B)D5}hv328o#3v) zonW{3o;i~}=e??Xiz?{#>H6$%$cdFy>4nW4On?#&_OA5I3`{%#QF#?E0231{0}~Sq zJUO|Vm8&iAUs8B-4WP4&m4iLcKlGx`Kx0>sOw8C7WG3%m50HOxvjs4-0+=~?m^pcv zm;fwHOx*ut=-|u)5HohSG6Tpn0Aw8OfiCdmq7IH;&Q=zduAnUc^ASL0N)2G<=H{gP z+Z`Zm2XwYFHMR%H8@pNp?LZk#jcoy{4yIN>SFisHLB(h3>gveD$mrqW!C-9X!rpK$;7{wt7`{ol^Urlt;d zj>h(0R`wPEb1PdQKv6=D!PV214q$9=_Lrftt&0Q5-`IcM*vi(}1Z40xabtjlurk0H zRNud=b1`+ca&&cJaIv!et3t-V!ho7AZf_>)U}p!kcXfgPi=UX4Gtd;&buY%h$7*Bm z;9>9cug~UI_GadPm0;%P$f#~_<>UsG7W=maNCf{!W&v~suro0+adI;QfKC9Qr>Q05 zU%}P99D#p-EB_XQ`1|=dIyeH%K_vkFtjvL+Kkz;-#_m9XtFs%>&*z_t|3>i4%m6bh zQ&)fq(89_d{!es}7-;@444S;Nl_x-#3AA|30H(iw{_{y6v|DBl_O@Ps%>N!Pqn3)S zxRf02-v$3iB_iVB3Gkt3J`>!bfmj(ad zd?eg#ZU5F%{iXi@XpQZxY`y-i2konyD`@xS9Y7ag|G!N&f&V&Jd7zn%eTS?14%SE>?d%C;)n9CZ_+T16`G= z4d~Hu0qx`8Dj?`+{yU|(y{UuQU)ROL&H*rXb~g5c2aOnn*a1GwpffZBdj7q^07eFT z2Um~_092kIz}&$Z{;zp*umc!{{}TNRaR7f9MgAa80Hf$1#06j!`-8XvjN<=6poLT{*shgd-EogrKBW4HXFmavMwDmtAsQWhmfS@ke z{sV$K_Yb1Xpz{AjW(T?2gAVCWZJz7{ZagP zP*(1LYyMlz%nb7Q$E2A-)w=v)0&0eft+9*cKMX+R{eGE*<}RXd+hiQJT`lWCOpwaLGR)6(7b|sSDCE8B2e`R1veKx=MJW4sGn#kT4y>03TkudoD(eSH_&B*j zY&$O(rOC|-oFoi-tWIBY_g9l4vn?b8t5dS7mdm!=cq=^PkHGsRm%QfwjqP9wYFi$^ zPwzFXds^@b&`5uT^6rn2rR0(dmz_%k*mSeSKN$UurXwFnGEX68pg+bdvaoWk#9P4t zV(9gyB|n?){V?a;n-44=zh+sQz)M&u^iu;Mza0)DmGueTe4y~e#301lY(V3(gb%@7 z_OUQ-WGC2^3mjVTp!A30S8TnN!!fmZRNARKaZli`lNf)?^!|-W{_%79BWeiH_ccN> zm2uAGJh%ooyz}St$%)2?iXd5}okWAymi{oV`S5l=YWb?}(3r4YJ~#-wO{myX-tohf z1cF4ADnCUtW_=yiNsPl!c1pqK6Ku8fZPbKme)5r-O2s2b7A({Cw#*i><2w>}lgAmz z7aIkRNU47sV9kElF+NQte7dNZ1ngEairVD@6ASE+Xj)NdI-LZ8WT*EV%SVm&iAng&6l&Y6iJ9<^MR>h!oZGPRy#90jK zp1WrC^xdG>sT<%5CR~n=%$T!8wd9OlaX#Efk_LL7se>K${jh8M^5f3P`kU#9O(U5b zPYZvHN;$@IXq1)sp?cfL_J#b(kGXuO9Xm}63dC20BfHZfO*r|$Kt=J>nYb?Ld~OXQW|OEL>v>7g;ltV?NP_#qZC%)DYI zfOOnyDTZvLL2pa=#?hH9-h(}oCn#OXJ{d}$AqRx#kI9uo5g$H|I z#b!d&sL=0$el;gNIB?=qV1nX-p`Cws7FdY4oDWkJh{KG z+BTy5AD<5{N7U-FJIjUpIl-x2y4zWcF78*D$oHf1SmbP<_4I|`f9Tgx{DomPd2sl3 zr5xo`6{+uxm)!$B+XOw`*i{ySd8ov_r{-_u*dG-?zQ;Pcv}h5>ayWm{$A!qFP@bc| z<`2ZJY?3e!4bt7Txp8+uM-=l5L+G-7{k2NgOt+>fWZugl8f zZsz2ky+>4bByiy1A_!C_&Q97+xNhM3lNC~g7DLPZU^qpNoOxdhs(9)YmX(Du&A>a( z!WI^^ldpme zFQ-0;O17Yo$tQn1Cn~`}4V)jN+ZtN6R@KL(7-c?{aGD;c89t#|9ns35`4VSUZX15B zYOaukp6cVIL-3)75>jYr%M9w#-j=Y%=aodZU+lI3{Cyzf!y=pOs+x8j3O0AfyOtlD zB~TgBw#SfDC<#@EK)t`LlkuCdX&cQnI#`)-j~*K#ufl(vPa_Nw+xuDm3l#fZLT9$0Gq~*bGa=SDr_Xz;>5w#(D!=)2kOO%-M_eVq4gG=?HRy59aRZk> zzGg@y@L%nGA>^ge$!(7f+33lO`Y7oT1AKrN|FR@TCrowyos0ga|_0Cxwa zw=V-Z7*2mWkb8}XD6d9hDzX`mk=%&R4y&TUD(Cd$f$G+d3o}@%ynyY^#QH&e;cuOt zgxGabu2_K_B;BtI~NV_2PfmV(z(kPUw6h>g)MmA!Sg+gIRPn ztHs)U#0EIm+6lRP?(r#Q0ylCVruUyonQy0}l_yB@5`52BzqeG565}Y+c@1 zJJvr-NWZH|ZN*6ugc>D+-DkLGbteBR+vg{rV=zAO0+$Voi>&gJ7kRQL{-Nq->pk2aLwEuY`|U2D;|^uv zW@vlJlCoAwi?7mBDKYx6;z&=m$TtZN0Rw*;+3(H!fgNl-RN-)Adb?^x+C;D}d|eHB zEn6vl3ax@$@bbCCh-XO0l(nOVP4pRR6i{}edhU+fgpcLyO*QF;i@4HAsP7DJ!U|*9 zy>V>SGp<4}N8j8s3J#34H|Md2+ed}pw*znN3;Uh6E4$;WCC4v{IH%|;?dl`4|ZAW2^pnOmF_^O~+llslCdfEQn<8(=dnUhMHbhR5?uK#o9$-sk^)Sc}m#;fZM? zd(QH54$%?yY_NZBp!oo$F08>>?Wuq455y!r7nd0~XJiLgVJShh&fFM6Zk)Flf{;L& z&yc3TH1lmsrUgA{CI(?6Z3?AS*{XmQ8`QgugP$0DOSn-X!AO;XZ5e<{rx`}*kIh(# z8?1s$af2EDU9ixL=;%fGF7dV5{c)-Rei~Vvw29Bizi)!vr{K8u!q;uK*UEpch=;py za!1enJOTWiI@f-|XhT_z$2t0@DaF5t7p?uvV+H*vFg}`S6{WQ}Em?_2vtmP{dnVYu zPR2bw>u@X-i{EkGog^2jF4pG1DG+kRU2moS4;uqbDSlbmcjAisx91e;h2Doy%+ zx;nM7H?SJa?6uQ?y|E8dff0W(9^~;u)E4^epuDm!XWWTdqDR?0j~QxfpglU7TQB+I zM5wnT^N&FKJ;+7bu) zeZGmWK-hlGX$6mY3AKOz86K7ufmK3D15~lxr$>op_+*Ju${TA5Bmd1|@MooIO&rS9 z{eb6hDxyoPZk#9&gci&vh4B`*o#dZL_n*|x@8IJ3OTpVX3;-JGX>Ubj^)NA)x&(>l z@q3eJi>E2Sg>+pOZNLH^*lc9lFNGMZRTayp?6qa|NbH93_RoL4eVFqbpz&jqzP~|d z?bAR)N65U$o-Zf*LQ!=V*mrt}qA#`phS^3aAgm2Le@IrMZZOnnf2n#g(Y#U}^9(9fnD+8n>l6Xe zs8nVe(UFYOO=-03csL9b*JtN&YY5X+O{dNW*FZsCX)AvsJ}0y7xk7D^^ZSn(jg4!V z%!9$SLgjnGMt;S!_Ov$rtshS3WHXVbXP4}cYSjwk-$>oy70wFq=oeMR|x7{rR5h1h?K`deef{9g?$iUf8Krz zkKrKPtOyWZ$&i+bri}BU7q+b@v*f+7Bdt|uhvt7aKDUV&R?%RD{TPY2xSL~haK2x9 zEFmV{j(*Tn=muhLbu`XpR=0}QN=(0&l8f~G~K|p(E0qsc4W5tR+s+-?d zc5Y1dWz4y?Z3jkDlGu0t5ktrvIKRl{)-@XDC|1E8?y?bQ_SwstuY9Ur-}Ow?M|2@i zt(1Q{2X(rYIK00!tLDv09R?j)MQ{EnV!HLL_KjD&@5h}Zog7|`Symn;s1Y;-xXBdn zie4ADaM)cMU9-E+0ONk6>&4*{H+9uMbiCbmd{7R4$HY~%t&E7+?>8xuRvfNDpI)c_ zX#=#jVG`!Vv%UDp>BG1ff-p^x{1w(dYfXQNZ?Uh(wxH@Znnd;J-hd@m)+5|~{z;fu zdSiB(zbT{-4+1Dz>bKOt`XPAv)Oc1dWr_k#Fd=x1-W5@P?=_17rYfxf&|_=vi*&Y= zzAZwQ4MwdGorMN<)K#V1Q1#=8pIu;2Z}eMT*f6+A!8<|ZCJWmL$%O=I(S~eRmE3>3 zIE~1$T^Yfe2SUNRDcwk|C0#Bbsd>96`5W!0O*wY9ykxKE<1Q62xLDFJsW+-FEnh-u zr(tic%gKKX4sS0$FCFzcJMHJn)Mf{D#n*qXMd=CJLmqv=-G_aUI!&z(GFpQ{RrO82 zqcp}O=G47k)S(Du5OJ5~4rcT5pQwMK6i>po-McT|Tz?YbM&z*Qjj~roq3}B!mypY3 zcV_m}I?8SrF`bL1%$zjLri+;AEKsOA(H$8R5dqtBO;bXCdrme4i zAe`Jn{fDbvi8yho*-SluTT1+Qh~RpM@Q4)OvuA$!jjLqIEHh}?8`rdRowtd{Jy%dcI244^>Fk*k-y`K9iS}OJ6 z^TQk6X$#%8PSD$axrws;hLo<(Lq3J^&%MR72u@FQ;eRBda@<$$D7nugQBm$bE>U%2 z_KX}araL@lHXn)5mHgbP?@2*4k&GH(lbhDYF8)$ViTL9EMZzxice;L6L-b^{esJOIq3qb(qPDDVT@m5!LJka4-!9vXQn^aD2UMVB_Ab9-n)=o7h6z)sn1MRDV~k(Fo=) z%c0Dmkcc6@RG)v^7Sf2h{n6tL^#oL)-f%6+7}YAD82@;i(*@>3XtEu9cVOQ@m_0YR zl{DVGO5}^XElR0q@@g<8bA#?kR^I%&!xO<0jq2y%f>ns=d>l3cd_~yD`qs~S5){#v zO{({O4;=TyfxaVi$=r11%Y=@kGuS+(oy}MNmU^D)ExLc@rTD=Sq?*kykL?%8fq>h- z)1`4Z{>#8ygK43y^%-x|pzmKCW4c>dnKh_kkba5;kd0Nb>;4E`v@W9##x_*f*(txq;d9;Cn&ZszD-YF+d@5D{X=<4G{^^LVz(LQO&rxSJz!1Mc)2 z%ib1?@(+7v-14f$K*M85NY4;s<#5j-j|K&2-+UxvlUoHT1C5 zxnocU@a6q_E*B~&ZgI?jAOeQb+CA?ylMR2^j=Pk+&y{ep>`W#Ug1;bFcm>^1Q4AZ3 zZdKYpHAn)L*M1fD08yYv%NyTkFhhP#h+Dqvcp488!bS72L!a0F^3S;U5)HW>$2_2A ze-~ygofhR#F`=$rMC@Umyw3}Xcycn#Gk~#!pTi#EqSYGG=JMpdd;<$_pCf|Kl!DX0FW6B?8F1wEsRdVR)aTMzmh|t{oyo14F<9IWxn{r7opL9F@nm;iH2~YH+}T{BB7j?Wsb=hVNgaiWl(>ekQbWx zbF=-Kw7iJ;jVsMoWIK@|gXw`ttF!nYK3R)!u*MQpRb#jAs{@y9Bd)sC5)BM2o*^VQGR^v18VGJY}DD7V?aF5|LdcLn}LA^TT zd#QKdw`zD=FSdw15|xaEM$6r6*)#fNY8@y#;}gqr@_lOvlk;2<0mi-Mzh;E+@ZQHi zLjO1lrdEo^Z|>4eF`5_|FsWu>#HgpHzs*KC9jn$G%fRor#)X|ja3;XI zhLeeH+nU&#*tTuk_+w*YTNB&1oj;t|wsoe?t-HF5+lyXwebvkEue$nu9&Edr7{dv| zD%iUW_t}k{68rrkowfDjb!G)Havh<~Y{tAElLsA$f;PBZoW!;(qZ#}IP&N@(`~k+09sx-4&0?GDegA36 zvm4ZV#)SG0`Uga>+;B+Cnm=O(X{6wa?qDac5Xxi;gf4)1nWYVqo9cm2AEf;#JZDQW;CR zPw+am45gcuS2Bx_BMDm^*blSGz|;U5szw;sADb3`?}-Pf(Qkf^m>#B=6NH|97F~tn zm8)ct-A4mlxsqvCwZY`PZZqDWgeh>(obd~fVOy!-z9EJ(I}Wzt(bFncGMgaO>I|^SmG2%Q3(zk+4huq`>b-u zY@ISmm8Pl3$F%kzg6WvGmVfYJE5;^r$0k>sx((((ipeoRnBU0lVTGcL`MaOqf*MfB zuqO%}UsQ^VwD{Y2V=6Mb8{GSsEEFV2?3DppfIB7?&h;|ySbVsICV@eCYxh=f$T;@r zj5HzGi-fB3B5fx_9oVGL!{$+DRBpLOrb~e~QKd0t+c@gfZ>DzwU9Nx@ zm)o0F%FeD4)@OO#(Kd;L+bxyvr!?|(bxwN^@?aOb|DaZeW z_Qb(CV5lYc9Y>oS?^`CBV*fx@^05avj(r9iEgIPl93=7SmZ(L?$k=WiN^rjpOxuGr7uFxaldRdBmD0M=dQiOl8a*bT zAqQ_+B_eA3yO3>CHB{siCq3j@TjkA4^2c|0!KT#rzVsiP!HyoRX^e36Rr+KeuPeU3 zx{S5&J#;+^fQ(j!w%NS;@+*K93^UNA@e9_g5{lhkWBgtJZ;t$^-btAA{RIbB{|%iM zJtP(AeyU!vK6&S`V^j3x@m`oj;S9PD$#W}=;>huNSTL1DKY#_)sFB_u-Aui_Wa@Cj z9e^5#KcUry+f1L){uRH}^*`Er5Y14d`5N$8oz}bnm`-u-e&OlEri@cc0LPIyEUNC< zK_a%ro2*u0u*qi|=f!XAutPEZb7@q(tNHVnk43PPeZ9A0zKOLbv7J_CF(R|{q3|Oh zKsctm6)xk5F}Lt=dIK;}C*?C>Fsm4YvQHNw3Bx>1I5i@GI^OTv5tZ%QQxD_Iz zI%UUwktY2SVTRsrE;OF*I}d3Wc!QHMI4^&es?JOMqU*@&d*g~qlBCK~qU!0JKO@c~ zO?sMrOs-XO5)@vQ*dY^;&ND9jaeJde&<=(POBkK%W~#u!RW3>6&A( z%+^A{c?x27G|k_`32@|^pN=4H_jX|+&fDCEbBt#}VWNxdaJ6jpfdvL_68cR6Z8=`0 z?j$l>ott_H?|?gks#->bO10ls{?kHT_Pz1)Ve{#IuP)FooD4kxMuU1=T-MbKcB+myuS*9x0@&C8*9Ub`9*1)Pb4ivvMVR+7 z+%U{X=Tp)VnaOMU)P}i6nT}657lgO{Qi9=sczH0`n?XzahE)_ma_YxcGQXl0rieFN ztq>Y@%)mF1ANs2%(-6C|Iz*@wsR6uef;AhKQgB;}C#>5w#$lcJDpDsICXAg=VVZZD$3@qaGrIU>P0`c34MFiaK!g2FuN|wOwSMReH zq6qYE9q{wrmy>3m@KA{8NPp?`LB*_SqT5e$F&fnYq1!}R3TrS0SyV{!$0N9*rjk60BlwLV(_@HNwHT7C(!N*Px_Yy3wGo-Jk9<4 zLkcoXu+z}bbK*TPEfcCk=PLFe45+fA6ne z9>6Lr-9KN7HA?2rwNXbYj96Q}z`aIQ+=^{Tku@EgtuGK^>Mr0Q2!WXR zerh0)Gs-k>F4oXU(y7dQYOsvv4uQ2B?8JTv2gAgCH&!zaHB_tgF;Kh8a!$s`!euc; z;bl=!m-vg>cH7*?kqvYbU1KXtyV*yC2s8U6z3ARhJJ!u}1y)8JJ1(RUkb0*dL|jN! z0D}JvflHA@t=J@DgDl6W<@)(v6Y;RqdT2SV09sQaJIt$>ZLm&|-=HaQ*!i>{QDv@- zEGWTDgP`4^TXxVD6+yo`lQu=h&%_IDazLX8v_bJ0Z)`i?kMlPf+8CkV_u zfBA?_8a_r_N2v9%r+9t#vm8fg#E;aA3~j-6eUP6_E*XsQo+h1oxwo>F+*@;fk`k{N z0XcJ#0CH#aS5?nh*sPI`rV5)qJ!Z^$!poR9$gGY-W>4;HxBZ|8plsZFsQTK8J=~`I zC1o+%wl(ziAXTX#Jr=A@YB@`g37fw0=`V?`NOlgeonMjWkuMBt45#1Zc>GP*UT^(g zeag*0NvBdtqSV@={G+~}6?q(%zV5y&_-UoSEi$pLY0uG4WLcc;Ve+?g{_Dw`t7${C zyWt^D^4)6(gi?D8U_^`p7ByFIr)yGj)K4Jc@^(Di*(2BJXYvbZjKtgr=QPB-_2SFZ z`~h+G=Z1ZBp*0 z)ut`UhR25ov@iuD5as50YE`Ij!$JcB-+xN(o|k0qp)B6{np8d#!UNtDFCk3|eafGN zDHq-^wj2{6G2NbdK7KANiG=G^36f$%oW(w-3pp;2`oAgzDx&e2;^gv5RwMS zWFE6q&YHBphUJ~0BBoNSg`yCah{UpVPt->IajCq|_N)j-pvL6z20GB%YS$i5`)>4E zp>Lo7xaB$>J8Hu!gV*^k`B|Q?&Sd(}V;!_O+tzffUlXCOAAeKutT@Wlu6mS83dl=E zyfF`k2Y6Tu{@vE4>zTR1>a3inllzZqB?6E|$x`R$9)v9fA9HfW0g&({{D zm5PZogClWI!6r~j6I-Y4=kSG9Zx}bQ8eFzp;O4Sn3&(P1dd!>e{+i%bpp2i-0!rn8 zlmV%9AI^g!zmA=7=$vX6P}?9$IzK-#zH{C}#$nCl&w~< z=Q->koaa#^|3MJX)@cu3TgS5RR05Aa-Jm~1-1-vEDx0R8?toz;7M-({j*-zZR4wz~ zH0&W7Y%ez9R5t3^$#YsA8%(o;%AN~hS~jBdPmh9%aCJzNuo#A*|E5B_#(<8ND|K}t9NW_oSl2+pEegXJtJYR5ci>Q%IQYLp~Y^1}ps z`>I0XVZ+uzbm10&hZW@wLB&L$k;&tLT~rCq1m_CsA(+n1FYV7lD9&YJ zow#1R9z@*SZwaYEjeq*@{W^{<6&;Qckk+WR_`sqzE5xzoE=Y{&l+-^GrLw(tL&Qs@ zHVZJHp{RH?s8Nvx%ymi(v^;8;dK9KkOUw>ouR2xzmL#b*<0`lQF|MfqSWa7o!5!x7 z#w{Q9S-7Oc2L6A*-yEknTwLed@S5_GDc&dZou7-}LC31$otKO23#0v35jDQ>Up)lW zEw9!13HIE??rv{*Dkn!{`KCFN0A1etocK z;d`nU>Qf!K^jz!qfG~3au4RVb88w+L!)*=_3pCm&4K@{hs$~Sth@6nR&MYeWb(uIK%#Ahl@`0 zBL0dHzm5>u#!A6SVY^X#lJ@SQE&i3IK>&HC71Yg<*mO4^$$@WWW_#W zAgQm;v;1ZmHka^>Nb6^$hqmGzF7EWT+FAZxK;t4(zb|OYt*&7~N6^~9`(SKs@e?}H z9-tgyNHnHdTgkEl_)u3M848C&q{uSl@xV~cf+&L_xql8d+G5jUZSJ{G`yXH&J&{Qwpb(pM z=n;MGtX5F*X8&L`F6H0mX)n65^}a|Nt9QOt!q$Acflh`i059P3jy>9w@>|9MRWESY zi0YjGO``AI(bKWAtR=U{rGYeoVe*xGjTZB&(cv(tQ<46RCnl3^$PWA{g&`|-l#+_( zk}t;fW}}1m&R(aK{;m91kh1-&GLwjI=kd@e7f|&E z%WD>;Cce-o1rF$_)MfHhVVgtZhsXVq%iQ&DAvcf+05N$VjZuHnO-kS=jBwY~c4t$9 zfi7tYJE6S9s=1|*> z_Gfd=(W|*W7Qns+o zjrjd_!9qj~CAZ*oX+S<9dH$TZ#boiD<~@nfX{l|CcHnL%6kO+JFZX4%3U}jVx`lKT zV0(!(4aUZ53@i2iv~F>3Aej5%W+E|@T^ffChb3WXSLBk6few@lm|BNAVqC~s^s_sp zo{fH&Ty}E2pCM7oN^(WdY)+v6($*~N2 zlMz9jUmbmk)=v1-`RcIOJj( z&=ZjNMA2a#5AxZIc>3+b8``(>wE$@A_)fW!Hr~@Px|I5D{xHtg#raqi6P%s8H*Mpw zR*vD4wFEXCcXPcFrEmdr3MX1~>)b5w@1jA4lO$N~NV-~w+h!uCb-a>MRZ_#{mCiVM1{LSYar(W&SW zgk0l(QWngG*x@k~-?d^6pwK232)j;vOj2&@1-v|DUbJZr%nrP;WXI+XtQ^WXB(|kJ zhw)^-3IzUU4r6-dK?DP1fcN@}oZwAjB)V5ZIU<2Vv})nLo)IWMQt5cxJmPKeGys!Y zRe(5rMxg0(*=_IG%a=5TfF*!#Zeum7{P++>2`;9mF)iI!ycUoIcywlvVo)n9G_;Jl zOkBhc$0Khv8?~n7v4exZF*+B`C#XxKK=U2KQ}^=KhLsBD%#v5HiTBF*%c+O0_7?T2 z(;n?@f9w+C)b&N~W5g_LJR4D!hax8+#D|zU;2#CcSuDD-T4BaD6{_s5oUXgjU${rW zMe9-CL*=3prnVaaG`$}2;y*P#jVG?-#GK64XxET}f?+-+>AS==ZLo|m^Yh?L&cDNHSJ zS*+ZphA>&vwNKq7Zi?j^A?g8FWy=A za}`PEV6B?8d9C?+g+G~4>`L@Z1Ci*xpQ&Qr`c(3^4`AZ2I!^DOx=AL`q~VlZBX*dM zP8?_GqRNOG4E`PW#m=QlCTi>BEfL5MwQ>t`6Bm(<(7W>TjQHr=y7L>-wMP>x-AN$9 zrBPFOW)#@~9CDrvnb@K(2IiIPzGu#x8SkZRhiD}@qP-%@g+l_vLq8SBK{fOW1le4L zq4JBFnYcI(%d5z0fpIlIo%fH=^E!padJk@-b(GA~6dX?SR>pDU35`VvSOI=Jku=m! z!U}&_Qo_j&++=>D1hP#a-%5w1Byi#ceh)dx@Np0zSFoRh8{%7G+DOH7jPFh}8i$Hr z-;~*GTu<5$8ipXkSrd|qC+FJk+=>wZ`^^}OmW-;w->wAF%1;K?!VDl?l>k!$#_J-` z;b?*CH4vRF53_eyNo)P=M#b&lhP~aF z+4umkU9MToNR-rX-&;dfmd;SCjB?%;hS8d|x|vml^|ga2qx0cQP*{o9@m(?bK1nB8+Ap&V?^O`l4cqNzX&m6=qjLTx!*dzVy_lnmdQa%_ zFo669C@Hy27}iZo~#}O<~{E+`HVE@)oV-o z4j;tLAHoXU%xITt0%qR7TsSB=?pFaEZd#TFn9}V_0Tb&`sZ<~%2|mv`korlLGXO&a zp4Xg<)(Pv~eyDB&Fjn-xb>1|9cCJuO|208khvgJ_;!xf5hkwRWiD2Rjh}`c85Yvg; z;<-oipSWpaBnzj(-AB9Td_Z;bL~3OE3UV$73WEi66LX2o-f{CXCjGT2;}>R@T(TH=L*J?2M4%>GaPZu-G=&E|E?0Y}X@@9t*Y&kq`l)h-JbC>=+8;v3V* z)s@9jB}kqK*xC)E)eyY}I#P8RpU;IMBiaR7LG9D(G>+siMy9Rxk4}KA>0{@RJXVAA zPyAvRrrpBEJh^u|ZH3+6dt&@7IH@wcJTS+E}?Z$=X)@#Un;E)_P zh6X-q<=6`|nr$l5UQz%t9vB%_eyKCM{kpHQNXlQ5jE`kX3nZBvoPk@gi%@_VxYauc z@ka;jN-U_%X$ZThAFW#(l6=YXTLE)ddD-YyvFLXiWs}U;PD{GFPy{}!AhZ`*{U6d` z!Mf5NW~0f`9XfyWSm=A1bk=EXv|QgEL{ZS21q{&IK8Ypi)n@@N-%7Ke@% z3(S-~fI2~0AxCT%{xbYM4KQj*iJmt)eGa;{$*r(pWZjo zrPbM#QBAT~jB@YR>wQEiD6v_dz5JR2e@#jO`3eu}mqKux7jYwJ=UR`nZ?$P^@?~_M z54xSBwrGz;QE5O<7!gmAAa1TM!sy|pMYon6ZmCl{s zd?_{1(7SM12~eo1;f}IE`30Q&st-N>%aYLig)&c~a{AW0k-tNA5uhNaYf16}DG=X# zO^d^J1V&hj_CiLwS3yg#jy0anIDuMUX*}x4clv8KqMG*#%X^M+F~J$Ie2uyh;YXi- zdO_%0rse@KbK%S*>n$^!ep&K#M#Rl67^Ki(Qu81PaC6J*ke5*Zr3qSF*}PG3MblV4 zS*GbG9O>Tv$OBo1qj{)YeEZ-zKC5RtCJh*+(CaI#^B-{r_P3&+N#9%T!@b^@rlB4( zIqU?Cx>>xv5^?Usa+ngK(X^~f7W6}}5Y52`L7o7ZDsBBT3rx}-%z7>!GV})Z#2L$@ zyzyP>mI|?QbjDl9^%sjuJB*tZ;6d!k_Zr_m_P0X+NI-(fu8hgl{95^ikI8xCn^aio zDZ6#c;%pn9v~jD#^Q#awLN5h$B^K;iFnNBb=rkVGvvbnHBOrRQ1)1|-Qu8kP%f_q| zxrG9dw1vAcy$H6`3*yAmk=k!XG7a@TzN1~CINQN~q3++(tyDD1xnsmhJQ{=VciD4Z z+B=qf__b$%6ZPIwW)dk{-%<;kuZEvPe2dkpGSOD3(qm~4h=NptM}XH^S)TsZkRRNX zXUng_^QTSs>n#q+tWAX8qH;i}c90)`houMH3yZl`lHtcBBL{8Upp9otmmU2am(@-n zvtJiocadBxF74*?i6IZpm+~H8KoBXOQ$Kp-$5_nNH*wN zNP)bk8N=a-zyRLI5nY1qrAfA;o_jwamV(vc@})&3>lc^?(4wM>9z)umD^{}5gZ*Fh zBJQ^FL^x@)+_jODEglyJZ6#A+$Xsvv_YVu|#UrHwh#iqf(wlf+_)Eoa`=9maYG+S_ z4*e?q6AMlGKDV9UEg*-woEl9X;*C}9bd%R;c1=CcgaLM@Asu|n>&YeX; zP4Iknu@!DlHc*8TQciXutm7cEjlf7HS+Bp8&w@e1Co3lCLK_$L>TXFvC* z<;yf@a@d<_)h~@mh6mqiM-0rw4g78U_KB9hDqK-eB&anQNMn!^D zC&?{25diP?nx6f6p~08+!opewxbmz>Zt0TV%cAIgDxyWCp$$Jhvv(HExk%njLf$Y{ zu*Hke`%rb`HrZ2hGm9$Sv(0F1y!)Na(t;)ZDVPK^f$qR4u524$;9FlVp5fv-*L zOd4uW+pPQ);sL9~Hp3%>F09j9ba#it%?3NeIkAXbp7CsN1!g zTy+al7jAbr03ndaHdSq^t@x2$r83$e8HyP>itG)?Pkw6Cl{e*jRYec=lX}5IZK%B~ zVsbhJxY``6qP=aqcO`-zVg{U)U#*Xy|T z@1RL2U{7l6=Be5kXh4k9n+#LbejQ9hF;fL3L`A-B81)@oa>ec)N~il%&a&q~pILEO znA$f)tSQG@KV$ca7%5&G`{A!#Ex?Dio^iR)G*}W^-Qx;2L+^MI;I;_KPN^=Hd76nW zzm6Ht74}DKJXc74OoW6=l|oJ92EdQ#)>Ew|QGay>^YWLd%(qeF zfAay~2%#j>D7wER8g(N{r_f&^A-uk+NInqvH^Z)P9?E@43t)^pK=nJJxB;}q1_D`u z5WV^fa62AIP!m0=J>{x5!>UuN`}BhKqLD6?+=++{&j| z7oz64YKk(JA69Wci_04dyX2-c$w71BHZ6nik6`TK(dkh!`ztE=Tyd{mDqCycPTI?9 zL)yA5H0@s_3UCH|g@P!~DimnZzOWdfL=EdE0phn<0&1CQj=CTvXy~3k_)+v!Vk5p=!F+*#24SbDR?C;*tcPgsXmynz5@Cu;3P>xiJK{&xBJqtzV5j2^iwXmB)0=b?X5IUn0Z+O zHd=B@fWoPIeogIP@0Mi{Xf)-?;M~V3YW%V>vhm#0hs4Jqx6<0KGp7qx)BVj|9&|j9 zL>>m~0-?_`$-C0;ft%W8dit#@EPlB`GNx`JPF}g|nG-;fzAp8t+Z{yr5KeLkw0JphBsD6g;9R?#1Hgy9FZsLmD9f4Gj3rj8aS z2iMT=XP0Z7lr6ruq(Jjb_g2Mc5BpJ*!VRpvuo%BaHug5LqYZ|Dbr^duhg`s5-Y+?7 zrS1}xM%tOVu$c3ojX%H^tm9fK0A;_~7U1zZ^FyI8N|Gh}=)!}D8)DfMHDg=a*71-W z3HyI<2|!-pHZRCjDtkius>0GvUYz+EEtBN-V|_wVd524bKYNVKzn{z~dfT}E&bBPx zbM&NRy8_4PJHhf61JrhoShTp<2^V_s@C=xTO1l`U{geD@d*+C45LIyNx`Y3O9tn$jdVmX$Nzg1 z_78ylRWQT-SkWF8;E^c=CU!!OW8NHH9eDBp`3T+7|Ivz;SFoKqrFnA2Wrg3UK%X8s z<`bvpKU`M3@kX%26y2@n3`jrQF4|J&U-A6&glZFw8)*1_iGj*^VW^)^d!PBO5M^{9 zdg%6LN4-JxaPh2mIBui8(@Tq>vLiwAVDioj4801_=9r%0wl0=pIyn)q&W!i(N-KQq zxiS{^v_+?eq1kS~r(f?zZyL_ToxkobN30hbzeb;U%*P ze`#^>Sgzx2G8|m~!CJ%{+a@HO&J%eInvW?qaL=Li*IxaNf*x^w46}YfE2m@fBl0!e zL}sI0s1p7_+ZqqYoW9F_>4f)JhG=gdC%8rEjUo|5J~WL`VV6Be6iC;D6N1KVDX0l!t|h z`Tv%r35HQtMm= zj~n&-s#lok`V7|QA+JECxV!10;%qH8jj(ItG-)EW?SG=`aHZGX&P$jKn8X>zM6+ z>J2&Fqy_{ojJtpyEtT5}jBCKK+?2_o&j7nQA2Np9f?_d^`OEWi;%wnSTb&W(D}2UK|rzX7oF= z1uyh|pd#Q0C_n8%>_dq&#j^Gl4n`*J5Y!`!>=AqSrXwMP*GB+QycDOmXG??Q)dpw! z-_xLC@>E+9-n;6&9W)23hD*MB1L;Lpv5N=Ee-R$E|5koFJl<+gYe71^0jGtfdk@2* zc%z*!WAslvdua5cYz4@PAO|KEAPv|0ZU2f+%+2=hqjoj59D;zG;VMdK?O{x36efB~ zblqv7%ZD`7NkqR;a>e(3ti$!l1LyCD)f7XOve3=)WF!&Pp>9Hbq>4_68olmI)wQ%@q)XqHh>VDjK|+C0%4-&)@l+?mg!p7}YJUeXOms0s zY7m2+pO`3Pn#ll|dfVoHPbVUXvEM=d@irk$BrxF6_-EQU&`B@E@Q@gb2mRDB)Z4<0 z#d=49e~NHPf0DLvGkDpq(#a|3I7|BerOf#ly_MIq+_2U;h=Zlo5fm=%Q*4f>kc62s zhvC>G8{RSo$84%&66wM?S#Y5~9k&8WHj^!rNf!4N1at#vh=~X}y5qPVr{IP*y+YXf zto9R&m)mZumbe&{;#pxAVX>mssmtSNQIP^b;%1u66L%$di!}+HJ2d-Ea<20+)bQ+d zScm8oBK0PUo7rmWyXPXP^UD(@8RSXVqb2?J?zp4EUnEJ&Uuo_*KeK)X3IjD!>h2-W zG$gx6k0b%A!cf5rX{*A7%g2JKw7}u}DDf(rYhKDnQ=(S-2kJb^F_3xJ*QhX;UujFO zbK;o>%ZWvE`(_dwE|yn#^XRgH-I3I>iZ=|ogftgzIXN*oa5d1LM?*de$*TGzWc@=v zs3Vru1Mf*iKIvAsBnXk=9EK{1W6}+HG_E4^ICTJ?CZPk+YN)gzL|3E;oT(T2r+v>d z+Mk4SFoeu1@s!HGnNgqzpKL7AgN`c^zEwXFK9#WL&pT6Jn z277*8Z^$=<6nk<(@Nm2POkODE(Vhv%9QztYEav}I26B75VnU{C#q)flm^IwdC=+7Z zYtl&}?%16i2_t_G8bdH{6Z~iNV{b1X&C~!$=7U-0JVmW*t%um=?(y3>IsR`eU-MfT z)P}~Y`as#FA$?zoE#}lq$uaC?v;ZSmPqD3PsFx^PFv+Vl&f1DyAUmJ;#=a%wu{*dt zA;+O5*J_S#EG^`j00;2JLlK3khH_{so}( z71w(_`aveJ+k3C@5tH^2g!DpD`-1glHdgz>-rLjJUPI|S)_aFSbPtnvcUrv1`2lHg zECEalYs1k#WYxd-R$X4{+MRx;$-D1;@$jF#{*o#ng6}u7y6Xkui#o{CkQl8cOY{f( zO#(`j^2#kJ-HtNm7jOd|@ILoLA|HTIT67wc?*rYL1+CNwirtF9)cfh>{q{rw;$nL} zDux;T1MUn(cPYtHs2&rOqT{g{;9!;`?#W<&xMKqxvX=xSZ>0|(IfKzGdX z1NrNF-}B?QL9N}6${*3ceP){=JdZ09ibOMz_qS7;H9Bz zTs>YD)+3-}JY#AU3s^;{&%Z#beAjd9aBroeryo<;w-;!-x5!UmMls%+e#AE_ZJV@T z^gQbDj7Ty{^u1aa%(el8TLX}m9!av#Fp+%0$pKHT*$I%&7LmZW-Og%@5Pxuzjb7(awt#{K?hYe!d$v^c5C+j@$Cj$(DuytMh3`wFkJ&{Mh~KpJx{L zZ8&`h4!Erh57UtwOSB3-8H$d#>q1p%J8mriY;Q!IP%6cNhIVA@3d`Wahc7urID{2V zTCbH)KxSb)P^}+h%>nB4)a>@9t9QoB#!4yOhilE%VANMOR{vC-6P=kw9FuNq?$+0< zxv_!+jPZ0@TB{1w_5mdAABHwMyn{<&tni7Py_S1qh{DTH6CF|8>dW?pIm(0AmbV+z z{f_FK>DFx@4=-5_ejs{zVQJHDv3Xl9oLk*p)vHf7EyI)>!%r=p&qXy>YE_vdI$NKm z!%wB1t>GApcL{$E7n;_$9wrJ}jCE?))Z6WVnV9xIi*ypRQ5vVs!i^bbW@)LPNSar< zaCE6F6S5nKJHrc4NEfv!h?~vTD`&E9AZe3rCAzJ#dHOaVPdrdEidePbY3#i5K`+b% z{^~uztF*brG7Wz13_qJsqIly5-!$SGP+JvFHfB~f4i*t+4)%W&6BnzvC^H9_s2CSJ z2N#F9Fy}8~zW=vG?|1imGaB%)w!%!mOsk zT3((NHa^D^8&AnoRiu658fRVfOhFqC`yT}l>K6b2 diff --git a/elpa/org-20171030/ox-ascii.el b/elpa/org-20190930/ox-ascii.el similarity index 92% rename from elpa/org-20171030/ox-ascii.el rename to elpa/org-20190930/ox-ascii.el index 9e04387d..7917e3da 100644 --- a/elpa/org-20171030/ox-ascii.el +++ b/elpa/org-20190930/ox-ascii.el @@ -1,6 +1,6 @@ ;;; ox-ascii.el --- ASCII Back-End for Org Export Engine -*- lexical-binding: t; -*- -;; Copyright (C) 2012-2017 Free Software Foundation, Inc. +;; Copyright (C) 2012-2019 Free Software Foundation, Inc. ;; Author: Nicolas Goaziou ;; Keywords: outlines, hypermedia, calendar, wp @@ -177,7 +177,8 @@ Inner margin is applied between each headline." (defcustom org-ascii-quote-margin 6 "Width of margin used for quoting text, in characters. -This margin is applied on both sides of the text." +This margin is applied on both sides of the text. It is also +applied on the left side of contents in descriptive lists." :group 'org-export-ascii :version "24.4" :package-version '(Org . "8.0") @@ -551,79 +552,69 @@ INFO is a plist used as a communication channel." (`inlinetask (plist-get info :ascii-inlinetask-width)) (`headline (- (plist-get info :ascii-text-width) - (let ((low-level-rank (org-export-low-level-p element info))) - (if low-level-rank (* low-level-rank 2) - (plist-get info :ascii-global-margin))))) + (let ((low-level-rank (org-export-low-level-p element info))) + (if low-level-rank (* low-level-rank 2) + (plist-get info :ascii-global-margin))))) ;; Elements with a relative width: store maximum text width in ;; TOTAL-WIDTH. (_ (let* ((genealogy (org-element-lineage element nil t)) - ;; Total width is determined by the presence, or not, of an - ;; inline task among ELEMENT parents. - (total-width - (if (cl-some (lambda (parent) - (eq (org-element-type parent) 'inlinetask)) - genealogy) - (plist-get info :ascii-inlinetask-width) - ;; No inlinetask: Remove global margin from text width. - (- (plist-get info :ascii-text-width) - (plist-get info :ascii-global-margin) - (let ((parent (org-export-get-parent-headline element))) - ;; Inner margin doesn't apply to text before first - ;; headline. - (if (not parent) 0 - (let ((low-level-rank - (org-export-low-level-p parent info))) - ;; Inner margin doesn't apply to contents of - ;; low level headlines, since they've got their - ;; own indentation mechanism. - (if low-level-rank (* low-level-rank 2) - (plist-get info :ascii-inner-margin))))))))) + ;; Total width is determined by the presence, or not, of an + ;; inline task among ELEMENT parents. + (total-width + (if (cl-some (lambda (parent) + (eq (org-element-type parent) 'inlinetask)) + genealogy) + (plist-get info :ascii-inlinetask-width) + ;; No inlinetask: Remove global margin from text width. + (- (plist-get info :ascii-text-width) + (plist-get info :ascii-global-margin) + (let ((parent (org-export-get-parent-headline element))) + ;; Inner margin doesn't apply to text before first + ;; headline. + (if (not parent) 0 + (let ((low-level-rank + (org-export-low-level-p parent info))) + ;; Inner margin doesn't apply to contents of + ;; low level headlines, since they've got their + ;; own indentation mechanism. + (if low-level-rank (* low-level-rank 2) + (plist-get info :ascii-inner-margin))))))))) (- total-width - ;; Each `quote-block' and `verse-block' above narrows text - ;; width by twice the standard margin size. - (+ (* (cl-count-if (lambda (parent) - (memq (org-element-type parent) - '(quote-block verse-block))) - genealogy) - 2 - (plist-get info :ascii-quote-margin)) - ;; Apply list margin once per "top-level" plain-list - ;; containing current line - (* (cl-count-if - (lambda (e) - (and (eq (org-element-type e) 'plain-list) - (not (eq (org-element-type (org-export-get-parent e)) - 'item)))) - genealogy) - (plist-get info :ascii-list-margin)) - ;; Text width within a plain-list is restricted by - ;; indentation of current item. If that's the case, - ;; compute it with the help of `:structure' property from - ;; parent item, if any. - (let ((item - (if (eq (org-element-type element) 'item) element - (cl-find-if (lambda (parent) - (eq (org-element-type parent) 'item)) - genealogy)))) - (if (not item) 0 - ;; Compute indentation offset of the current item, - ;; that is the sum of the difference between its - ;; indentation and the indentation of the top item in - ;; the list and current item bullet's length. Also - ;; remove checkbox length, and tag length (for - ;; description lists) or bullet length. - (let ((struct (org-element-property :structure item)) - (beg-item (org-element-property :begin item))) - (+ (- (org-list-get-ind beg-item struct) - (org-list-get-ind - (org-list-get-top-point struct) struct)) - (string-width (or (org-ascii--checkbox item info) - "")) - (string-width - (let ((tag (org-element-property :tag item))) - (if tag (org-export-data tag info) - (org-element-property :bullet item)))))))))))))) + ;; Each `quote-block' and `verse-block' above narrows text + ;; width by twice the standard margin size. + (+ (* (cl-count-if (lambda (parent) + (memq (org-element-type parent) + '(quote-block verse-block))) + genealogy) + 2 + (plist-get info :ascii-quote-margin)) + ;; Apply list margin once per "top-level" plain-list + ;; containing current line + (* (cl-count-if + (lambda (e) + (and (eq (org-element-type e) 'plain-list) + (not (eq (org-element-type (org-export-get-parent e)) + 'item)))) + genealogy) + (plist-get info :ascii-list-margin)) + ;; Compute indentation offset due to current list. It is + ;; `org-ascii-quote-margin' per descriptive item in the + ;; genealogy, bullet's length otherwise. + (let ((indentation 0)) + (dolist (e genealogy) + (cond + ((not (eq 'item (org-element-type e)))) + ((eq (org-element-property :type (org-export-get-parent e)) + 'descriptive) + (cl-incf indentation org-ascii-quote-margin)) + (t + (cl-incf indentation + (+ (string-width + (or (org-ascii--checkbox e info) "")) + (string-width + (org-element-property :bullet e))))))) + indentation))))))) (defun org-ascii--current-justification (element) "Return expected justification for ELEMENT's contents. @@ -641,7 +632,7 @@ Return value is a symbol among `left', `center', `right' and (or justification 'left))) (defun org-ascii--build-title - (element info text-width &optional underline notags toc) + (element info text-width &optional underline notags toc) "Format ELEMENT title and return it. ELEMENT is either an `headline' or `inlinetask' element. INFO is @@ -660,13 +651,12 @@ possible. It doesn't apply to `inlinetask' elements." (let* ((headlinep (eq (org-element-type element) 'headline)) (numbers ;; Numbering is specific to headlines. - (and headlinep (org-export-numbered-headline-p element info) - ;; All tests passed: build numbering string. - (concat - (mapconcat - 'number-to-string - (org-export-get-headline-number element info) ".") - " "))) + (and headlinep + (org-export-numbered-headline-p element info) + (let ((numbering (org-export-get-headline-number element info))) + (if toc (format "%d. " (org-last numbering)) + (concat (mapconcat #'number-to-string numbering ".") + " "))))) (text (org-trim (org-export-data @@ -681,8 +671,7 @@ possible. It doesn't apply to `inlinetask' elements." (plist-get info :with-tags) (let ((tag-list (org-export-get-tags element info))) (and tag-list - (format ":%s:" - (mapconcat 'identity tag-list ":")))))) + (org-make-tag-string tag-list))))) (priority (and (plist-get info :with-priority) (let ((char (org-element-property :priority element))) @@ -969,7 +958,7 @@ channel." (t (concat (org-ascii--fill-string - (format "[%s] %s" anchor (org-element-property :raw-link link)) + (format "[%s] <%s>" anchor (org-element-property :raw-link link)) width info) "\n\n"))))) links "")) @@ -1458,40 +1447,54 @@ contextual information." (bullet ;; First parent of ITEM is always the plain-list. Get ;; `:type' property from it. - (org-list-bullet-string - (pcase list-type - (`descriptive - (concat checkbox - (org-export-data (org-element-property :tag item) info) - ": ")) - (`ordered - ;; Return correct number for ITEM, paying attention to - ;; counters. - (let* ((struct (org-element-property :structure item)) - (bul (org-element-property :bullet item)) - (num (number-to-string - (car (last (org-list-get-item-number - (org-element-property :begin item) - struct - (org-list-prevs-alist struct) - (org-list-parents-alist struct))))))) - (replace-regexp-in-string "[0-9]+" num bul))) - (_ (let ((bul (org-element-property :bullet item))) - ;; Change bullets into more visible form if UTF-8 is active. - (if (not utf8p) bul + (pcase list-type + (`descriptive + (concat checkbox + (org-export-data (org-element-property :tag item) + info))) + (`ordered + ;; Return correct number for ITEM, paying attention to + ;; counters. + (let* ((struct (org-element-property :structure item)) + (bul (org-list-bullet-string + (org-element-property :bullet item))) + (num (number-to-string + (car (last (org-list-get-item-number + (org-element-property :begin item) + struct + (org-list-prevs-alist struct) + (org-list-parents-alist struct))))))) + (replace-regexp-in-string "[0-9]+" num bul))) + (_ (let ((bul (org-list-bullet-string + (org-element-property :bullet item)))) + ;; Change bullets into more visible form if UTF-8 is active. + (if (not utf8p) bul + (replace-regexp-in-string + "-" "•" (replace-regexp-in-string - "-" "•" - (replace-regexp-in-string - "+" "⁃" - (replace-regexp-in-string "*" "‣" bul)))))))))) + "\\+" "⁃" + (replace-regexp-in-string "\\*" "‣" bul)))))))) + (indentation (if (eq list-type 'descriptive) org-ascii-quote-margin + (string-width bullet)))) (concat bullet - (unless (eq list-type 'descriptive) checkbox) + checkbox ;; Contents: Pay attention to indentation. Note: check-boxes are ;; already taken care of at the paragraph level so they don't ;; interfere with indentation. - (let ((contents (org-ascii--indent-string contents (string-width bullet)))) - (if (eq (org-element-type (car (org-element-contents item))) 'paragraph) + (let ((contents (org-ascii--indent-string contents indentation))) + ;; Determine if contents should follow the bullet or start + ;; a new line. Do the former when the first contributing + ;; element to contents is a paragraph. In descriptive lists + ;; however, contents always start a new line. + (if (and (not (eq list-type 'descriptive)) + (org-string-nw-p contents) + (eq 'paragraph + (org-element-type + (cl-some (lambda (e) + (and (org-string-nw-p (org-export-data e info)) + e)) + (org-element-contents item))))) (org-trim contents) (concat "\n" contents)))))) @@ -1597,11 +1600,13 @@ INFO is a plist holding contextual information." ;; Don't know what to do. Signal it. (_ "???")))) (t - (let ((raw-link (org-element-property :raw-link link))) - (if (not (org-string-nw-p desc)) (format "[%s]" raw-link) + (let ((raw-link (concat (org-element-property :type link) + ":" + (org-element-property :path link)))) + (if (not (org-string-nw-p desc)) (format "<%s>" raw-link) (concat (format "[%s]" desc) (and (not (plist-get info :ascii-links-to-notes)) - (format " (%s)" raw-link))))))))) + (format " (<%s>)" raw-link))))))))) ;;;; Node Properties @@ -2061,6 +2066,20 @@ a communication channel." ;;; End-user functions +;;;###autoload +(defun org-ascii-convert-region-to-ascii () + "Assume region has Org syntax, and convert it to plain ASCII." + (interactive) + (let ((org-ascii-charset 'ascii)) + (org-export-replace-region-by 'ascii))) + +;;;###autoload +(defun org-ascii-convert-region-to-utf8 () + "Assume region has Org syntax, and convert it to UTF-8." + (interactive) + (let ((org-ascii-charset 'utf-8)) + (org-export-replace-region-by 'ascii))) + ;;;###autoload (defun org-ascii-export-as-ascii (&optional async subtreep visible-only body-only ext-plist) diff --git a/elpa/org-20171030/ox-beamer.el b/elpa/org-20190930/ox-beamer.el similarity index 96% rename from elpa/org-20171030/ox-beamer.el rename to elpa/org-20190930/ox-beamer.el index 5750d6da..d9d228c9 100644 --- a/elpa/org-20171030/ox-beamer.el +++ b/elpa/org-20190930/ox-beamer.el @@ -1,6 +1,6 @@ ;;; ox-beamer.el --- Beamer Back-End for Org Export Engine -*- lexical-binding: t; -*- -;; Copyright (C) 2007-2017 Free Software Foundation, Inc. +;; Copyright (C) 2007-2019 Free Software Foundation, Inc. ;; Author: Carsten Dominik ;; Nicolas Goaziou @@ -174,11 +174,11 @@ through `org-beamer-environments-extra' variable.") ("quotation" "q" "\\begin{quotation}%a %% %h" "\\end{quotation}") ("quote" "Q" "\\begin{quote}%a %% %h" "\\end{quote}") ("structureenv" "s" "\\begin{structureenv}%a %% %h" "\\end{structureenv}") - ("theorem" "t" "\\begin{theorem}%a%U" "\\end{theorem}") - ("definition" "d" "\\begin{definition}%a%U" "\\end{definition}") - ("example" "e" "\\begin{example}%a%U" "\\end{example}") + ("theorem" "t" "\\begin{theorem}%a[%h]" "\\end{theorem}") + ("definition" "d" "\\begin{definition}%a[%h]" "\\end{definition}") + ("example" "e" "\\begin{example}%a[%h]" "\\end{example}") ("exampleblock" "E" "\\begin{exampleblock}%a{%h}" "\\end{exampleblock}") - ("proof" "p" "\\begin{proof}%a%U" "\\end{proof}") + ("proof" "p" "\\begin{proof}%a[%h]" "\\end{proof}") ("beamercolorbox" "o" "\\begin{beamercolorbox}%o{%h}" "\\end{beamercolorbox}")) "Environments triggered by properties in Beamer export. These are the defaults - for user definitions, see @@ -326,7 +326,7 @@ INFO is a plist used as a communication channel. The value is either the label specified in \"BEAMER_opt\" property, the custom ID, if there is one and -`:latex-prefer-user-labels' property has a non nil value, or +`:latex-prefer-user-labels' property has a non-nil value, or a unique internal label. This function assumes HEADLINE will be treated as a frame." (cond @@ -424,9 +424,8 @@ used as a communication channel." (let* ((beamer-opt (org-element-property :BEAMER_OPT headline)) (options ;; Collect nonempty options from default value and - ;; headline's properties. Also add a label for - ;; links. - (cl-remove-if-not 'org-string-nw-p + ;; headline's properties. + (cl-remove-if-not #'org-string-nw-p (append (org-split-string (plist-get info :beamer-frame-default-options) ",") @@ -436,29 +435,31 @@ used as a communication channel." ;; them. (and (string-match "^\\[?\\(.*\\)\\]?$" beamer-opt) (match-string 1 beamer-opt)) - ",")) - ;; Provide an automatic label for the frame - ;; unless the user specified one. Also refrain - ;; from labeling `allowframebreaks' frames; this - ;; is not allowed by beamer. - (unless (and beamer-opt - (or (string-match "\\(^\\|,\\)label=" beamer-opt) - (string-match "allowframebreaks" beamer-opt))) - (list - (let ((label (org-beamer--get-label headline info))) - ;; Labels containing colons need to be - ;; wrapped within braces. - (format (if (string-match-p ":" label) - "label={%s}" - "label=%s") - label)))))))) + ","))))) + (fragile + ;; Add "fragile" option if necessary. + (and fragilep + (not (member "fragile" options)) + (list "fragile"))) + (label + ;; Provide an automatic label for the frame unless + ;; the user specified one. Also refrain from + ;; labeling `allowframebreaks' frames; this is not + ;; allowed by Beamer. + (and (not (member "allowframebreaks" options)) + (not (cl-some (lambda (s) (string-match-p "^label=" s)) + options)) + (list + (let ((label (org-beamer--get-label headline info))) + ;; Labels containing colons need to be + ;; wrapped within braces. + (format (if (string-match-p ":" label) + "label={%s}" + "label=%s") + label)))))) ;; Change options list into a string. (org-beamer--normalize-argument - (mapconcat - 'identity - (if (or (not fragilep) (member "fragile" options)) options - (cons "fragile" options)) - ",") + (mapconcat #'identity (append label fragile options) ",") 'option)) ;; Title. (let ((env (org-element-property :BEAMER_ENV headline))) @@ -914,9 +915,9 @@ value." (org-back-to-heading t) ;; Filter out Beamer-related tags and install environment tag. (let ((tags (cl-remove-if (lambda (x) (string-match "^B_" x)) - (org-get-tags))) + (org-get-tags nil t))) (env-tag (and (org-string-nw-p value) (concat "B_" value)))) - (org-set-tags-to (if env-tag (cons env-tag tags) tags)) + (org-set-tags (if env-tag (cons env-tag tags) tags)) (when env-tag (org-toggle-tag env-tag 'on))))) ((equal property "BEAMER_col") (org-toggle-tag "BMCOL" (if (org-string-nw-p value) 'on 'off))))) @@ -1075,12 +1076,12 @@ aid, but the tag does not have any semantic meaning." (org-tag-persistent-alist nil) (org-use-fast-tag-selection t) (org-fast-tag-selection-single-key t)) - (org-set-tags) - (let ((tags (or (ignore-errors (org-get-tags-string)) ""))) + (org-set-tags-command) + (let ((tags (org-get-tags nil t))) (cond ;; For a column, automatically ask for its width. ((eq org-last-tag-selection-key ?|) - (if (string-match ":BMCOL:" tags) + (if (member "BMCOL" tags) (org-set-property "BEAMER_col" (read-string "Column width: ")) (org-delete-property "BEAMER_col"))) ;; For an "againframe" section, automatically ask for reference @@ -1096,8 +1097,12 @@ aid, but the tag does not have any semantic meaning." (read-string "Frame reference (*Title, #custom-id, id:...): ")) (org-set-property "BEAMER_act" (read-string "Overlay specification: ")))) - ((string-match (concat ":B_\\(" (mapconcat 'car envs "\\|") "\\):") tags) - (org-entry-put nil "BEAMER_env" (match-string 1 tags))) + ((let* ((tags-re (concat "B_" (regexp-opt (mapcar #'car envs) t))) + (env (cl-some (lambda (tag) + (and (string-match tags-re tag) + (match-string 1 tag))) + tags))) + (and env (progn (org-entry-put nil "BEAMER_env" env) t)))) (t (org-entry-delete nil "BEAMER_env")))))) ;;;###autoload diff --git a/elpa/org-20171030/ox-html.el b/elpa/org-20190930/ox-html.el similarity index 92% rename from elpa/org-20171030/ox-html.el rename to elpa/org-20190930/ox-html.el index fe820999..375754f3 100644 --- a/elpa/org-20171030/ox-html.el +++ b/elpa/org-20190930/ox-html.el @@ -1,6 +1,6 @@ ;;; ox-html.el --- HTML Back-End for Org Export Engine -*- lexical-binding: t; -*- -;; Copyright (C) 2011-2017 Free Software Foundation, Inc. +;; Copyright (C) 2011-2019 Free Software Foundation, Inc. ;; Author: Carsten Dominik ;; Jambunathan K @@ -215,7 +215,7 @@ (defconst org-html-html5-elements '("article" "aside" "audio" "canvas" "details" "figcaption" "figure" "footer" "header" "menu" "meter" "nav" "output" - "progress" "section" "video") + "progress" "section" "summary" "video") "New elements in html5. For blocks that should contain headlines, use the HTML_CONTAINER @@ -234,7 +234,7 @@ property on the headline itself.") @licstart The following is the entire license notice for the JavaScript code in this tag. -Copyright (C) 2012-2017 Free Software Foundation, Inc. +Copyright (C) 2012-2019 Free Software Foundation, Inc. The JavaScript code in this tag is free software: you can redistribute it and/or modify it under the terms of the GNU @@ -430,6 +430,19 @@ for the JavaScript code in this tag. .footdef { margin-bottom: 1em; } .figure { padding: 1em; } .figure p { text-align: center; } + .equation-container { + display: table; + text-align: center; + width: 100%; + } + .equation { + vertical-align: middle; + } + .equation-label { + display: table-cell; + text-align: right; + vertical-align: middle; + } .inlinetask { padding: 10px; border: 2px solid gray; @@ -465,7 +478,7 @@ customize `org-html-head-include-default-style'.") ;;;; Handle infojs (defvar org-html-infojs-opts-table - '((path PATH "http://orgmode.org/org-info.js") + '((path PATH "https://orgmode.org/org-info.js") (view VIEW "info") (toc TOC :with-toc) (ftoc FIXED_TOC "0") @@ -524,7 +537,7 @@ means to use the maximum value consistent with other options." * @licstart The following is the entire license notice for the * JavaScript code in %SCRIPT_PATH. * - * Copyright (C) 2012-2017 Free Software Foundation, Inc. + * Copyright (C) 2012-2019 Free Software Foundation, Inc. * * * The JavaScript code in this tag is free software: you can @@ -553,7 +566,7 @@ means to use the maximum value consistent with other options." @licstart The following is the entire license notice for the JavaScript code in this tag. -Copyright (C) 2012-2017 Free Software Foundation, Inc. +Copyright (C) 2012-2019 Free Software Foundation, Inc. The JavaScript code in this tag is free software: you can redistribute it and/or modify it under the terms of the GNU @@ -1138,7 +1151,7 @@ checkboxes. The other two use the `off' checkbox for `trans'.") (defcustom org-html-checkbox-type 'ascii "The type of checkboxes to use for HTML export. -See `org-html-checkbox-types' for for the values used for each +See `org-html-checkbox-types' for the values used for each option." :group 'org-export-html :version "24.4" @@ -1324,7 +1337,7 @@ like that: \"%%\"." :type 'string) (defcustom org-html-creator-string - (format "Emacs %s (Org mode %s)" + (format "Emacs %s (Org mode %s)" emacs-version (if (fboundp 'org-version) (org-version) "unknown version")) "Information about the creator of the HTML document. @@ -1452,13 +1465,13 @@ done, timestamp, timestamp-kwd, tag, target. For example, a valid value would be: If you want to refer to an external style, use something like @@ -1693,7 +1706,7 @@ object unless a different class is specified with an attribute." (defun org-html--textarea-block (element) "Transcode ELEMENT into a textarea block. -ELEMENT is either a src block or an example block." +ELEMENT is either a source or an example block." (let* ((code (car (org-export-unravel-code element))) (attr (org-export-read-attribute :attr_html element))) (format "

\n\n

" @@ -1736,8 +1749,8 @@ If you then set `org-html-htmlize-output-type' to `css', calls to the function `org-html-htmlize-region-for-paste' will produce code that uses these same face definitions." (interactive) - (or (require 'htmlize nil t) - (error "Please install htmlize from https://github.com/hniksic/emacs-htmlize")) + (unless (require 'htmlize nil t) + (error "htmlize library missing. Aborting")) (and (get-buffer "*html*") (kill-buffer "*html*")) (with-temp-buffer (let ((fl (face-list)) @@ -1751,12 +1764,12 @@ produce code that uses these same face definitions." (htmlize-region (point-min) (point-max)))) (pop-to-buffer-same-window "*html*") (goto-char (point-min)) - (if (re-search-forward "" nil t) - (delete-region (1+ (match-end 0)) (point-max))) + (when (re-search-forward "" nil t) + (delete-region (1+ (match-end 0)) (point-max))) (beginning-of-line 1) - (if (looking-at " +") (replace-match "")) + (when (looking-at " +") (replace-match "")) (goto-char (point-min))) (defun org-html--make-string (n string) @@ -1771,33 +1784,38 @@ Replaces invalid characters with \"_\"." (defun org-html-footnote-section (info) "Format the footnote section. INFO is a plist used as a communication channel." - (let* ((fn-alist (org-export-collect-footnote-definitions info)) - (fn-alist - (cl-loop for (n _type raw) in fn-alist collect - (cons n (if (eq (org-element-type raw) 'org-data) - (org-trim (org-export-data raw info)) - (format "
%s
" - (org-trim (org-export-data raw info)))))))) - (when fn-alist + (pcase (org-export-collect-footnote-definitions info) + (`nil nil) + (definitions (format (plist-get info :html-footnotes-section) (org-html--translate "Footnotes" info) (format "\n%s\n" (mapconcat - (lambda (fn) - (let ((n (car fn)) (def (cdr fn))) - (format - "
%s %s
\n" - (format - (plist-get info :html-footnote-format) - (org-html--anchor - (format "fn.%d" n) - n - (format " class=\"footnum\" href=\"#fnr.%d\"" n) - info)) - def))) - fn-alist + (lambda (definition) + (pcase definition + (`(,n ,_ ,def) + ;; `org-export-collect-footnote-definitions' can return + ;; two kinds of footnote definitions: inline and blocks. + ;; Since this should not make any difference in the HTML + ;; output, we wrap the inline definitions within + ;; a "footpara" class paragraph. + (let ((inline? (not (org-element-map def org-element-all-elements + #'identity nil t))) + (anchor (org-html--anchor + (format "fn.%d" n) + n + (format " class=\"footnum\" href=\"#fnr.%d\"" n) + info)) + (contents (org-trim (org-export-data def info)))) + (format "
%s %s
\n" + (format (plist-get info :html-footnote-format) anchor) + (format "
%s
" + (if (not inline?) contents + (format "

%s

" + contents)))))))) + definitions "\n")))))) @@ -1935,7 +1953,8 @@ INFO is a plist used as a communication channel." (?c . ,(plist-get info :creator)) (?C . ,(let ((file (plist-get info :input-file))) (format-time-string timestamp-format - (and file (nth 5 (file-attributes file)))))) + (and file (file-attribute-modification-time + (file-attributes file)))))) (?v . ,(or (plist-get info :html-validation-link) ""))))) (defun org-html--build-pre/postamble (type info) @@ -1979,21 +1998,18 @@ communication channel." (plist-get info :html-metadata-timestamp-format)))) (when (plist-get info :with-creator) (format "

%s

\n" creator)) - (format "

%s

\n" - validation-link)))) - (t (format-spec - (or (cadr (assoc-string - (plist-get info :language) - (eval (intern - (format "org-html-%s-format" type))) - t)) - (cadr - (assoc-string - "en" - (eval - (intern (format "org-html-%s-format" type))) - t))) - spec)))))) + (when (org-string-nw-p validation-link) + (format "

%s

\n" + validation-link))))) + (t + (let ((formats (plist-get info (if (eq type 'preamble) + :html-preamble-format + :html-postamble-format))) + (language (plist-get info :language))) + (format-spec + (cadr (or (assoc-string language formats t) + (assoc-string "en" formats t))) + spec))))))) (let ((div (assq type (plist-get info :html-divs)))) (when (org-string-nw-p section-contents) (concat @@ -2088,12 +2104,12 @@ holding export options." ;; Postamble. (org-html--build-pre/postamble 'postamble info) ;; Possibly use the Klipse library live code blocks. - (if (plist-get info :html-klipsify-src) - (concat "")) + (when (plist-get info :html-klipsify-src) + (concat "")) ;; Closing document. "\n")) @@ -2154,21 +2170,15 @@ CODE is a string representing the source code to colorize. LANG is the language used for CODE, as a string, or nil." (when code (cond - ;; Case 1: No lang. Possibly an example block. - ((not lang) - ;; Simple transcoding. - (org-html-encode-plain-text code)) - ;; Case 2: No htmlize or an inferior version of htmlize - ((not (and (or (require 'htmlize nil t) - (error "Please install htmlize from https://github.com/hniksic/emacs-htmlize")) - (fboundp 'htmlize-region-for-paste))) + ;; No language. Possibly an example block. + ((not lang) (org-html-encode-plain-text code)) + ;; Plain text explicitly set. + ((not org-html-htmlize-output-type) (org-html-encode-plain-text code)) + ;; No htmlize library or an inferior version of htmlize. + ((not (progn (require 'htmlize nil t) + (fboundp 'htmlize-region-for-paste))) ;; Emit a warning. - (message "Cannot fontify src block (htmlize.el >= 1.34 required)") - ;; Simple transcoding. - (org-html-encode-plain-text code)) - ;; Case 3: plain text explicitly set - ((not org-html-htmlize-output-type) - ;; Simple transcoding. + (message "Cannot fontify source block (htmlize.el >= 1.34 required)") (org-html-encode-plain-text code)) (t ;; Map language @@ -2177,7 +2187,6 @@ is the language used for CODE, as a string, or nil." (cond ;; Case 1: Language is not associated with any Emacs mode ((not (functionp lang-mode)) - ;; Simple transcoding. (org-html-encode-plain-text code)) ;; Case 2: Default. Fontify code. (t @@ -2207,7 +2216,7 @@ is the language used for CODE, as a string, or nil." (org-html-htmlize-region-for-paste (point-min) (point-max)))))) ;; Strip any enclosing
 tags.
-	  (let* ((beg (and (string-match "\\`]*>\n*" code) (match-end 0)))
+	  (let* ((beg (and (string-match "\\`]*>\n?" code) (match-end 0)))
 		 (end (and beg (string-match "\\'" code))))
 	    (if (and beg end) (substring code beg end) code)))))))))
 
@@ -2220,7 +2229,7 @@ alist between line numbers and references (as returned by
 `org-export-unravel-code'), a boolean specifying if labels should
 appear in the source code, and the number associated to the first
 line of code."
-  (let* ((code-lines (org-split-string code "\n"))
+  (let* ((code-lines (split-string code "\n"))
 	 (code-length (length code-lines))
 	 (num-fmt
 	  (and num-start
@@ -2248,14 +2257,14 @@ line of code."
 
 (defun org-html-format-code (element info)
   "Format contents of ELEMENT as source code.
-ELEMENT is either an example block or a src block.  INFO is
-a plist used as a communication channel."
+ELEMENT is either an example or a source block.  INFO is a plist
+used as a communication channel."
   (let* ((lang (org-element-property :language element))
 	 ;; Extract code and references.
 	 (code-info (org-export-unravel-code element))
 	 (code (car code-info))
 	 (refs (cdr code-info))
-	 ;; Does the src block contain labels?
+	 ;; Does the source block contain labels?
 	 (retain-labels (org-element-property :retain-labels element))
 	 ;; Does it have line numbers?
 	 (num-start (org-export-get-loc element info)))
@@ -2584,18 +2593,8 @@ holding contextual information."
            (full-text (funcall (plist-get info :html-format-headline-function)
                                todo todo-type priority text tags info))
            (contents (or contents ""))
-	   (ids (delq nil
-                      (list (org-element-property :CUSTOM_ID headline)
-                            (org-export-get-reference headline info)
-                            (org-element-property :ID headline))))
-           (preferred-id (car ids))
-           (extra-ids
-	    (mapconcat
-	     (lambda (id)
-	       (org-html--anchor
-		(if (org-uuidgen-p id) (concat "ID-" id) id)
-		nil nil info))
-	     (cdr ids) "")))
+	   (id (or (org-element-property :CUSTOM_ID headline)
+		   (org-export-get-reference headline info))))
       (if (org-export-low-level-p headline info)
           ;; This is a deep sub-tree: export it as a list item.
           (let* ((html-type (if numberedp "ol" "ul")))
@@ -2604,11 +2603,9 @@ holding contextual information."
 		  (apply #'format "<%s class=\"org-%s\">\n"
 			 (make-list 2 html-type)))
 	     (org-html-format-list-item
-                   contents (if numberedp 'ordered 'unordered)
-		   nil info nil
-                   (concat (org-html--anchor preferred-id nil nil info)
-                           extra-ids
-                           full-text)) "\n"
+	      contents (if numberedp 'ordered 'unordered)
+	      nil info nil
+	      (concat (org-html--anchor id nil nil info) full-text)) "\n"
 	     (and (org-export-last-sibling-p headline info)
 		  (format "\n" html-type))))
 	;; Standard headline.  Export it as a section.
@@ -2621,10 +2618,9 @@ holding contextual information."
                   (concat (format "outline-%d" level)
                           (and extra-class " ")
                           extra-class)
-                  (format "\n%s%s\n"
+                  (format "\n%s\n"
                           level
-                          preferred-id
-                          extra-ids
+                          id
                           (concat
                            (and numberedp
                                 (format
@@ -2702,7 +2698,7 @@ holding contextual information."
 
 (defun org-html-format-inlinetask-default-function
   (todo todo-type priority text tags contents info)
-  "Default format function for a inlinetasks.
+  "Default format function for inlinetasks.
 See `org-html-format-inlinetask-function' for details."
   (format "
\n%s%s\n%s
" (org-html-format-headline-default-function @@ -2841,26 +2837,73 @@ INFO is a plist containing export properties." "Creating LaTeX Image..." nil processing-type) (buffer-string)))) +(defun org-html--wrap-latex-environment (contents _ &optional caption label) + "Wrap CONTENTS string within appropriate environment for equations. +When optional arguments CAPTION and LABEL are given, use them for +caption and \"id\" attribute." + (format "\n\n%s%s\n
" + ;; ID. + (if (org-string-nw-p label) (format " id=\"%s\"" label) "") + ;; Contents. + (format "\n%s\n" contents) + ;; Caption. + (if (not (org-string-nw-p caption)) "" + (format "\n\n%s\n" + caption)))) + +(defun org-html--math-environment-p (element &optional _) + "Non-nil when ELEMENT is a LaTeX math environment. +Math environments match the regular expression defined in +`org-latex-math-environments-re'. This function is meant to be +used as a predicate for `org-export-get-ordinal' or a value to +`org-html-standalone-image-predicate'." + (string-match-p org-latex-math-environments-re + (org-element-property :value element))) + +(defun org-html--unlabel-latex-environment (latex-frag) + "Change environment in LATEX-FRAG string to an unnumbered one. +For instance, change an 'equation' environment to 'equation*'." + (replace-regexp-in-string + "\\`[ \t]*\\\\begin{\\([^*]+?\\)}" + "\\1*" + (replace-regexp-in-string "^[ \t]*\\\\end{\\([^*]+?\\)}[ \r\t\n]*\\'" + "\\1*" + latex-frag nil nil 1) + nil nil 1)) + (defun org-html-latex-environment (latex-environment _contents info) "Transcode a LATEX-ENVIRONMENT element from Org to HTML. CONTENTS is nil. INFO is a plist holding contextual information." (let ((processing-type (plist-get info :with-latex)) (latex-frag (org-remove-indentation (org-element-property :value latex-environment))) - (attributes (org-export-read-attribute :attr_html latex-environment))) + (attributes (org-export-read-attribute :attr_html latex-environment)) + (label (and (org-element-property :name latex-environment) + (org-export-get-reference latex-environment info))) + (caption (number-to-string + (org-export-get-ordinal + latex-environment info nil + #'org-html--math-environment-p)))) (cond ((memq processing-type '(t mathjax)) - (org-html-format-latex latex-frag 'mathjax info)) + (org-html-format-latex + (if (org-string-nw-p label) + (replace-regexp-in-string "\\`.*" + (format "\\&\n\\\\label{%s}" label) + latex-frag) + latex-frag) + 'mathjax info)) ((assq processing-type org-preview-latex-process-alist) (let ((formula-link - (org-html-format-latex latex-frag processing-type info))) - (when (and formula-link (string-match "file:\\([^]]*\\)" formula-link)) - ;; Do not provide a caption or a name to be consistent with - ;; `mathjax' handling. - (org-html--wrap-image - (org-html--format-image - (match-string 1 formula-link) attributes info) info)))) - (t latex-frag)))) + (org-html-format-latex + (org-html--unlabel-latex-environment latex-frag) + processing-type info))) + (when (and formula-link (string-match "file:\\([^]]*\\)" formula-link)) + (org-html--wrap-latex-environment + (org-html--format-image + (match-string 1 formula-link) attributes info) + info caption label)))) + (t (org-html--wrap-latex-environment latex-frag info caption label))))) ;;;; Latex Fragment @@ -2958,10 +3001,7 @@ images, set it to: DESC is the description part of the link, or the empty string. INFO is a plist holding contextual information. See `org-export-data'." - (let* ((home (when (plist-get info :html-link-home) - (org-trim (plist-get info :html-link-home)))) - (use-abs-url (plist-get info :html-link-use-abs-url)) - (link-org-files-as-html-maybe + (let* ((link-org-files-as-html-maybe (lambda (raw-path info) ;; Treat links to `file.org' as links to `file.html', if ;; needed. See `org-html-link-org-files-as-html'. @@ -2979,46 +3019,53 @@ INFO is a plist holding contextual information. See (path (cond ((member type '("http" "https" "ftp" "mailto" "news")) - (url-encode-url (org-link-unescape (concat type ":" raw-path)))) + (url-encode-url (concat type ":" raw-path))) ((string= type "file") - ;; Treat links to ".org" files as ".html", if needed. + ;; During publishing, turn absolute file names belonging + ;; to base directory into relative file names. Otherwise, + ;; append "file" protocol to absolute file name. (setq raw-path - (funcall link-org-files-as-html-maybe raw-path info)) - ;; If file path is absolute, prepend it with protocol - ;; component - "file://". - (cond - ((file-name-absolute-p raw-path) - (setq raw-path (org-export-file-uri raw-path))) - ((and home use-abs-url) - (setq raw-path (concat (file-name-as-directory home) raw-path)))) + (org-export-file-uri + (org-publish-file-relative-name raw-path info))) + ;; Possibly append `:html-link-home' to relative file + ;; name. + (let ((home (and (plist-get info :html-link-home) + (org-trim (plist-get info :html-link-home))))) + (when (and home + (plist-get info :html-link-use-abs-url) + (file-name-absolute-p raw-path)) + (setq raw-path (concat (file-name-as-directory home) raw-path)))) + ;; Maybe turn ".org" into ".html". + (setq raw-path (funcall link-org-files-as-html-maybe raw-path info)) ;; Add search option, if any. A search option can be ;; relative to a custom-id, a headline title, a name or ;; a target. (let ((option (org-element-property :search-option link))) - (cond ((not option) raw-path) - ;; Since HTML back-end use custom-id value as-is, - ;; resolving is them is trivial. - ((eq (string-to-char option) ?#) (concat raw-path option)) - (t - (concat raw-path - "#" - (org-publish-resolve-external-link - option - (org-element-property :path link))))))) + (if (not option) raw-path + (let ((path (org-element-property :path link))) + (concat raw-path + "#" + (org-publish-resolve-external-link option path t)))))) (t raw-path))) - ;; Extract attributes from parent's paragraph. HACK: Only do - ;; this for the first link in parent (inner image link for - ;; inline images). This is needed as long as attributes - ;; cannot be set on a per link basis. (attributes-plist - (let* ((parent (org-export-get-parent-element link)) - (link (let ((container (org-export-get-parent link))) - (if (and (eq (org-element-type container) 'link) - (org-html-inline-image-p link info)) - container - link)))) - (and (eq (org-element-map parent 'link 'identity info t) link) - (org-export-read-attribute :attr_html parent)))) + (org-combine-plists + ;; Extract attributes from parent's paragraph. HACK: Only + ;; do this for the first link in parent (inner image link + ;; for inline images). This is needed as long as + ;; attributes cannot be set on a per link basis. + (let* ((parent (org-export-get-parent-element link)) + (link (let ((container (org-export-get-parent link))) + (if (and (eq 'link (org-element-type container)) + (org-html-inline-image-p link info)) + container + link)))) + (and (eq link (org-element-map parent 'link #'identity info t)) + (org-export-read-attribute :attr_html parent))) + ;; Also add attributes from link itself. Currently, those + ;; need to be added programmatically before `org-html-link' + ;; is invoked, for example, by backends building upon HTML + ;; export. + (org-export-read-attribute :attr_html link))) (attributes (let ((attr (org-html--make-attribute-string attributes-plist))) (if (org-string-nw-p attr) (concat " " attr) "")))) @@ -3082,23 +3129,37 @@ INFO is a plist holding contextual information. See (format "%s" href attributes desc))) ;; Fuzzy link points to a target or an element. (_ - (let* ((ref (org-export-get-reference destination info)) - (org-html-standalone-image-predicate - #'org-html--has-caption-p) - (number (cond - (desc nil) - ((org-html-standalone-image-p destination info) - (org-export-get-ordinal - (org-element-map destination 'link - #'identity info t) - info 'link 'org-html-standalone-image-p)) - (t (org-export-get-ordinal - destination info nil 'org-html--has-caption-p)))) - (desc (cond (desc) - ((not number) "No description for this link") - ((numberp number) (number-to-string number)) - (t (mapconcat #'number-to-string number "."))))) - (format "%s" ref attributes desc)))))) + (if (and destination + (memq (plist-get info :with-latex) '(mathjax t)) + (eq 'latex-environment (org-element-type destination)) + (eq 'math (org-latex--environment-type destination))) + ;; Caption and labels are introduced within LaTeX + ;; environment. Use "eqref" macro to refer to those in + ;; the document. + (format "\\eqref{%s}" + (org-export-get-reference destination info)) + (let* ((ref (org-export-get-reference destination info)) + (org-html-standalone-image-predicate + #'org-html--has-caption-p) + (counter-predicate + (if (eq 'latex-environment (org-element-type destination)) + #'org-html--math-environment-p + #'org-html--has-caption-p)) + (number + (cond + (desc nil) + ((org-html-standalone-image-p destination info) + (org-export-get-ordinal + (org-element-map destination 'link #'identity info t) + info 'link 'org-html-standalone-image-p)) + (t (org-export-get-ordinal + destination info nil counter-predicate)))) + (desc + (cond (desc) + ((not number) "No description for this link") + ((numberp number) (number-to-string number)) + (t (mapconcat #'number-to-string number "."))))) + (format "%s" ref attributes desc))))))) ;; Coderef: replace link with the reference name or the ;; equivalent line number. ((string= type "coderef") @@ -3112,18 +3173,18 @@ INFO is a plist holding contextual information. See (format (org-export-get-coderef-format path desc) (org-export-resolve-coderef path info))))) ;; External link with a description part. - ((and path desc) (format "%s" - (org-html-encode-plain-text path) - attributes - desc)) + ((and path desc) + (format "%s" + (org-html-encode-plain-text path) + attributes + desc)) ;; External link without a description part. - (path (let ((path (org-html-encode-plain-text path))) - (format "%s" - path - attributes - (org-link-unescape path)))) + (path + (let ((path (org-html-encode-plain-text path))) + (format "%s" path attributes path))) ;; No path, only description. Try to do something useful. - (t (format "%s" desc))))) + (t + (format "%s" desc))))) ;;;; Node Property @@ -3666,8 +3727,8 @@ contextual information." (with-temp-buffer (insert contents) (set-auto-mode t) - (if (plist-get info :html-indent) - (indent-region (point-min) (point-max))) + (when (plist-get info :html-indent) + (indent-region (point-min) (point-max))) (buffer-substring-no-properties (point-min) (point-max)))) diff --git a/elpa/org-20171030/ox-icalendar.el b/elpa/org-20190930/ox-icalendar.el similarity index 99% rename from elpa/org-20171030/ox-icalendar.el rename to elpa/org-20190930/ox-icalendar.el index 4783f115..297d624d 100644 --- a/elpa/org-20171030/ox-icalendar.el +++ b/elpa/org-20190930/ox-icalendar.el @@ -1,11 +1,11 @@ ;;; ox-icalendar.el --- iCalendar Back-End for Org Export Engine -*- lexical-binding: t; -*- -;; Copyright (C) 2004-2017 Free Software Foundation, Inc. +;; Copyright (C) 2004-2019 Free Software Foundation, Inc. ;; Author: Carsten Dominik ;; Nicolas Goaziou ;; Keywords: outlines, hypermedia, calendar, wp -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; This file is part of GNU Emacs. @@ -317,7 +317,7 @@ A headline is blocked when either done first or is a child of a blocked grandparent entry." (or ;; Check if any child is not done. - (org-element-map headline 'headline + (org-element-map (org-element-contents headline) 'headline (lambda (hl) (eq (org-element-property :todo-type hl) 'todo)) info 'first-match) ;; Check :ORDERED: node property. diff --git a/elpa/org-20171030/ox-latex.el b/elpa/org-20190930/ox-latex.el similarity index 96% rename from elpa/org-20171030/ox-latex.el rename to elpa/org-20190930/ox-latex.el index 61b6b8cc..569a4a0a 100644 --- a/elpa/org-20171030/ox-latex.el +++ b/elpa/org-20190930/ox-latex.el @@ -1,6 +1,6 @@ ;;; ox-latex.el --- LaTeX Back-End for Org Export Engine -*- lexical-binding: t; -*- -;; Copyright (C) 2011-2017 Free Software Foundation, Inc. +;; Copyright (C) 2011-2019 Free Software Foundation, Inc. ;; Author: Nicolas Goaziou ;; Keywords: outlines, hypermedia, calendar, wp @@ -159,7 +159,6 @@ (defconst org-latex-babel-language-alist '(("af" . "afrikaans") ("bg" . "bulgarian") - ("bt-br" . "brazilian") ("ca" . "catalan") ("cs" . "czech") ("cy" . "welsh") @@ -179,7 +178,7 @@ ("et" . "estonian") ("eu" . "basque") ("fi" . "finnish") - ("fr" . "frenchb") + ("fr" . "french") ("fr-ca" . "canadien") ("gl" . "galician") ("hr" . "croatian") @@ -195,6 +194,7 @@ ("no" . "norsk") ("pl" . "polish") ("pt" . "portuguese") + ("pt-br" . "brazilian") ("ro" . "romanian") ("ru" . "russian") ("sa" . "sanskrit") @@ -211,13 +211,12 @@ (defconst org-latex-polyglossia-language-alist '(("am" "amharic") - ("ast" "asturian") ("ar" "arabic") - ("bo" "tibetan") - ("bn" "bengali") + ("ast" "asturian") ("bg" "bulgarian") + ("bn" "bengali") + ("bo" "tibetan") ("br" "breton") - ("bt-br" "brazilian") ("ca" "catalan") ("cop" "coptic") ("cs" "czech") @@ -226,6 +225,7 @@ ("de" "german" "german") ("de-at" "german" "austrian") ("de-de" "german" "german") + ("dsb" "lsorbian") ("dv" "divehi") ("el" "greek") ("en" "english" "usmax") @@ -247,40 +247,40 @@ ("he" "hebrew") ("hi" "hindi") ("hr" "croatian") + ("hsb" "usorbian") ("hu" "magyar") ("hy" "armenian") - ("id" "bahasai") ("ia" "interlingua") + ("id" "bahasai") ("is" "icelandic") ("it" "italian") ("kn" "kannada") ("la" "latin" "modern") - ("la-modern" "latin" "modern") ("la-classic" "latin" "classic") ("la-medieval" "latin" "medieval") + ("la-modern" "latin" "modern") ("lo" "lao") ("lt" "lithuanian") ("lv" "latvian") - ("mr" "maranthi") ("ml" "malayalam") - ("nl" "dutch") + ("mr" "maranthi") ("nb" "norsk") - ("nn" "nynorsk") ("nko" "nko") + ("nl" "dutch") + ("nn" "nynorsk") ("no" "norsk") ("oc" "occitan") ("pl" "polish") ("pms" "piedmontese") ("pt" "portuges") + ("pt-br" "brazilian") ("rm" "romansh") ("ro" "romanian") ("ru" "russian") ("sa" "sanskrit") - ("hsb" "usorbian") - ("dsb" "lsorbian") + ("se" "samin") ("sk" "slovak") ("sl" "slovenian") - ("se" "samin") ("sq" "albanian") ("sr" "serbian") ("sv" "swedish") @@ -295,8 +295,6 @@ ("vi" "vietnamese")) "Alist between language code and corresponding Polyglossia option") - - (defconst org-latex-table-matrix-macros '(("bordermatrix" . "\\cr") ("qbordermatrix" . "\\cr") ("kbordermatrix" . "\\\\")) @@ -810,8 +808,9 @@ attributes." :type 'boolean :safe #'booleanp) -(defcustom org-latex-table-scientific-notation "%s\\,(%s)" +(defcustom org-latex-table-scientific-notation nil "Format string to display numbers in scientific notation. + The format should have \"%s\" twice, for mantissa and exponent \(i.e., \"%s\\\\times10^{%s}\"). @@ -920,15 +919,14 @@ using customize, or with (add-to-list \\='org-latex-packages-alist \\='(\"newfloat\" \"minted\")) In addition, it is necessary to install pygments -\(http://pygments.org), and to configure the variable +\(URL `http://pygments.org>'), and to configure the variable `org-latex-pdf-process' so that the -shell-escape option is passed to pdflatex. The minted choice has possible repercussions on the preview of latex fragments (see `org-preview-latex-fragment'). If you run into previewing problems, please consult - - http://orgmode.org/worg/org-tutorials/org-latex-preview.html" +URL `https://orgmode.org/worg/org-tutorials/org-latex-preview.html'." :group 'org-export-latex :type '(choice (const :tag "Use listings" t) @@ -1027,7 +1025,7 @@ value. For example, (setq org-latex-minted-options \\='((\"bgcolor\" \"bg\") (\"frame\" \"lines\"))) -will result in src blocks being exported with +will result in source blocks being exported with \\begin{minted}[bgcolor=bg,frame=lines]{} @@ -1048,12 +1046,13 @@ block-specific options, you may use the following syntax: (defcustom org-latex-custom-lang-environments nil "Alist mapping languages to language-specific LaTeX environments. -It is used during export of src blocks by the listings and minted -latex packages. The environment may be a simple string, composed of -only letters and numbers. In this case, the string is directly the -name of the latex environment to use. The environment may also be -a format string. In this case the format string will be directly -exported. This format string may contain these elements: +It is used during export of source blocks by the listings and +minted LaTeX packages. The environment may be a simple string, +composed of only letters and numbers. In this case, the string +is directly the name of the LaTeX environment to use. The +environment may also be a format string. In this case the format +string will be directly exported. This format string may contain +these elements: %s for the formatted source %c for the caption @@ -1075,7 +1074,7 @@ would have the effect that if Org encounters a Python source block during LaTeX export it will produce \\begin{pythoncode} - + \\end{pythoncode} and if Org encounters an Ocaml source block during LaTeX export it @@ -1083,7 +1082,7 @@ will produce \\begin{listing} \\begin{minted}[]{ocaml} - + \\end{minted} \\caption{} \\label{